JP4214457B2 - Image processing apparatus and method, recording medium, and program - Google Patents

Image processing apparatus and method, recording medium, and program Download PDF

Info

Publication number
JP4214457B2
JP4214457B2 JP2003003134A JP2003003134A JP4214457B2 JP 4214457 B2 JP4214457 B2 JP 4214457B2 JP 2003003134 A JP2003003134 A JP 2003003134A JP 2003003134 A JP2003003134 A JP 2003003134A JP 4214457 B2 JP4214457 B2 JP 4214457B2
Authority
JP
Japan
Prior art keywords
image
tone curve
luminance
pixel
contrast
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2003003134A
Other languages
Japanese (ja)
Other versions
JP2004221644A (en
Inventor
知生 光永
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sony Corp
Original Assignee
Sony Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sony Corp filed Critical Sony Corp
Priority to JP2003003134A priority Critical patent/JP4214457B2/en
Priority to CNB2003801004014A priority patent/CN100366052C/en
Priority to US10/507,274 priority patent/US7570390B2/en
Priority to EP03778755A priority patent/EP1494462A4/en
Priority to PCT/JP2003/015758 priority patent/WO2004064388A1/en
Priority to KR1020047014084A priority patent/KR101051604B1/en
Publication of JP2004221644A publication Critical patent/JP2004221644A/en
Application granted granted Critical
Publication of JP4214457B2 publication Critical patent/JP4214457B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、画像処理装置および方法、記録媒体、並びにプログラムに関し、特に、見栄得を損なうことなく、画像のコントラストを強調する場合に用いて好適な画像処理装置および方法、記録媒体、並びにプログラムに関する。
【0002】
【従来の技術】
従来、CCD(Charge Coupled Device)やCMOS(Complementary Metal-Oxide Semiconductor)等の固体撮像素子がビデオカメラやスチルカメラなどの撮像機器、FA(Factory Automation)における部品検査装置、ME(Medical Electronics)における電子内視鏡などの光計測装置等に幅広く利用されている。
【0003】
近年、これらの固体撮像素子を用いて光学フィルム写真に匹敵するような画素値のダイナミックレンジが広い画像(以下、広DR画像と記述する)を得るための技術が多数提案されている(例えば、特許文献1参照)。
【0004】
一方、動画像や静止画像を表示するCRT(Cathode Ray Tube)、LCD(Liquid Crystal Display)等の表示装置、プロジェクタ等の投影装置、各種の印刷装置は、現在においても、対応できる画素値のダイナミックレンジは広域化されておらず、対応可能な輝度階調に制限がある。このため、広DR画像を撮影したとしても、それをその状態で表示、投影あるいは印刷可能な装置が存在していないのが現状である。
【0005】
そこで、当面においては、広DR画像の画素値のダイナミックレンジを狭めて、換言すれば、輝度階調を圧縮して、表示装置などのダイナミックレンジに適応させた画像(以下、狭DR画像と記述する)を生成するための技術(以下、階調圧縮技術と記述する)が必要とされている。
【0006】
ここで、従来において提案された階調圧縮技術について説明する。階調圧縮技術は、単純には、広DR画像の画素値の階調を、表示装置等が対応可能なより狭いダイナミックレンジの階調に合わせて再配分することにより実現される。
【0007】
しかしながら、上述したように、単に、広DR画像の画素値の階調を、狭いダイナミックレンジに均等に階調を再配分しただけでは、画像全体の輝度変化が小さくなってしまい、コントラストが低下した見栄得が悪い画像に変換されてしまうことになる。そこで、従来、コントラスト低下を抑制することができる階調圧縮技術がいくつか提案されている。以下、従来提案されている3種類の階調圧縮技術について説明する。
【0008】
第1の階調圧縮技術としては、入力する広DR画像の輝度のヒストグラムに基づき、階調の再配分規則を適応的に決定する(具体的には、階調変換曲線を、入力画像のヒストグラムを元に算出する)技術を挙げることができる。第1の階調圧縮技術は、画像中の重要な被写体が占める面積の比率は大きいことを前提として、ヒストグラムのピーク近辺の輝度値になるべく多くの階調を配分するように階調変換曲線を決定するようにし、少なくとも重要な被写体におけるコントラスト低下を抑制しようとするものである(例えば、特許文献2参照)。
【0009】
しかしながら、このような階調配分のみの工夫ではあらゆる状況で満足が得られる結果を得ることは難しい。例えば、重要な被写体が画像中に複数存在する場合、背景が均一な輝度であって、かつ、比較的広い面積を占めている場合(例えば青空)などでは、しばしば被写体に十分な階調が配分されなくなることがある。
【0010】
第2の階調圧縮技術としては、階調変換前または後のどちらか一方において画像中の高周波成分を強調する技術を挙げることができる。第2の階調圧縮技術は、階調変換によって失われた(または階調変換によって失われると思われる)コントラストを画像から見積もり、その分をアンシャープマスキングなどの高周波強調フィルタを用いて補償するものである(例えば、特許文献3参照)。
【0011】
第2の階調圧縮技術は、第1の階調圧縮技術のように画像の構図に依存する問題は生じないという利点がある。しかしながら、高周波強調フィルタは被写体の輪郭部分においてオーバーシュートを生じたり、平坦な部分においてノイズを強調したりするなどの問題があり、見栄得が良い画像を得られないことがある。
【0012】
第3の階調変換技術としては、広DR画像を低周波成分画像と高周波成分画像に分離し、高周波成分画像はそのままに、低周波成分画像に対して適当な階調変換処理を施して、最後にそれらを1つの画像に加算合成する技術を挙げることができる(例えば、特許文献4参照)。
【0013】
第3の階調変換技術によれば、広DR画像の高周波成分は階調圧縮を施さないので、生成される画像のコントラスト低下を防ぐことができる。しかしながら、第3の階調変換技術も、第2の階調変換技術と同様に、被写体の輪郭部分において輝度のオーバーシュートを生じたり、平坦な部分においてノイズを強調したりするなどの問題があるので、低周波成分画像と高周波成分画像に分離する処理に非線形フィルタ(例えば、メディアンフィルタ)を用いることにより、この問題を解決する方法も提案されている(例えば、特許文献4参照)。
【0014】
【特許文献1】
特開平8−223491号公報
【特許文献2】
特開平9−331469号公報
【特許文献3】
特開2000−115534号公報
【特許文献4】
特開平9−214766号公報
【0015】
【発明が解決しようとする課題】
以上に説明した第1乃至第3の階調圧縮技術をまとめると以下の課題が存在する。
【0016】
第1に、高周波成分を強調することに伴い、被写体の輪郭部分において輝度のオーバーシュートが生じることである。これを抑止するためには、比較的大きいサイズ(20×20画素)の2次元非線形フィルタが必要であるが、このようなサイズの2次元非線形フィルタをソフトウェアとして実現するには演算コストが非常に大きくなる課題があり、ハードウェアとして実現するためにはディレイラインを大量に必要とするため回路規模が大きくなってしまう課題があった。
【0017】
第2に、高輝度域および低輝度域における高周波成分のコントラスト強調量の制御についてである。上述した第2および第3の階調圧縮技術では、輝度を低周波成分と高周波成分に分離して、低周波成分を比較的抑制し、高周波成分を強調することにより、コントラストを保持した階調圧縮を行うことが共通している。
【0018】
しかしながら、表示装置などが許容する最大輝度と最小輝度の近辺では高周波成分を強調することによって輝度のクリッピングが生じて結果的に画像のディテールが失われ、適切な階調変換が行われたとはいえないので、輝度のクリッピングが生じないような対処が必要である課題があった。
【0019】
さらに、輝度のクリッピングが生じないような状態でも、コントラストの強調が強すぎれば、被写体の輪郭部分が不自然に強調された画像となってしまう課題があった。
【0020】
本発明はこのような状況に鑑みてなされたものであり、使用するメモリの容量がより小さく、演算が少なくて、ハードウェア化が容易であり、かつ、適切に画像のコントラストを強調できるようにすることを目的とする。
【0021】
【課題を解決するための手段】
本発明の画像処理装置は、入力された画像の画素値を、予め用意されているトーンカーブに基づいて、階調を圧縮する方向に補正することにより、トーンカーブ補正画像を生成するトーンカーブ補正手段と、トーンカーブ補正画像の画素の輝度Lcを平滑化して、平滑化画像を生成する平滑化手段と、トーンカーブ補正画像の画素の輝度Lc、平滑化画像を構成する画素の輝度Ll、およびトーンカーブの傾きの逆数を利用して設定されたゲイン値gに基づき、コントラスト補正画像を生成するコントラスト補正手段とを含み、平滑化手段は、入力されたトーンカーブ補正画像を縮小して、縮小画像を生成する縮小手段と、縮小画像を構成する画素を用いた補間演算により、平滑化画像の画素の輝度Llを演算する補間手段とを含む。
【0022】
前記コントラスト補正手段は、コントラスト補正画像を構成する画素の輝度Luを、次式
u=g・(Lc−Ll)+Ll
に基づいて算出するようにすることができる。
【0023】
前記縮小手段は、入力されたトーンカーブ補正画像を複数のブロックに分割し、各ブロックに属する画素の輝度の平均値を計算して、平均値を画素の輝度とする、ブロックの数と同数の画素から構成される縮小画像を生成する
求項1に記載の画像処理装置。
【0024】
前記補間手段は、平滑化手段によって補間される画素の位置である補間位置に対応する縮小画像上の位置を特定し、特定した位置の近傍に存在する縮小画像の画素を用いて、平滑化画像の画素の輝度Llを演算するようにすることができる。
【0025】
前記補間手段は、平滑化手段によって補間される画素の位置である補間位置に対応する縮小画像上の位置を特定し、特定した位置の近傍に存在する縮小画像の4×4画素を用いた双3次補間により、平滑化画像の画素の輝度Llを演算するようにすることができる。
【0026】
本発明の像処理装置は、平滑化手段に入力する前のトーンカーブ補正画像を構成する画素の輝度Lcを対数変換する対数変換手段と、コントラスト補正手段によって出力されたコントラスト補正画像を構成する画素の輝度を対数逆変換する対数逆変換手段とをさらに含むことができる。
【0027】
本発明の画像処理方法は、入力された画像の画素値を、予め用意されているトーンカーブに基づいて、階調を圧縮する方向に補正することにより、トーンカーブ補正画像を生成するトーンカーブ補正ステップと、トーンカーブ補正画像の画素の輝度Lcを平滑化して、平滑化画像を生成する平滑化ステップと、トーンカーブ補正画像の画素の輝度Lc、平滑化画像を構成する画素の輝度Ll、およびトーンカーブの傾きの逆数を利用して設定されたゲイン値gに基づき、コントラスト補正画像を生成するコントラスト補正ステップとを含み、平滑化ステップの処理は、入力されたトーンカーブ補正画像を縮小して、縮小画像を生成する縮小ステップと、縮小画像を構成する画素を用いた補間演算により、平滑化画像の画素の輝度Llを演算する補間ステップとを含む。
【0028】
本発明の記録媒体は、入力された画像の画素値を、予め用意されているトーンカーブに基づいて、階調を圧縮する方向に補正することにより、トーンカーブ補正画像を生成するトーンカーブ補正ステップと、トーンカーブ補正画像の画素の輝度Lcを平滑化して、平滑化画像を生成する平滑化ステップと、トーンカーブ補正画像の画素の輝度Lc、平滑化画像を構成する画素の輝度Ll、およびトーンカーブの傾きの逆数を利用して設定されたゲイン値gに基づき、コントラスト補正画像を生成するコントラスト補正ステップとを含み、平滑化ステップの処理は、入力されたトーンカーブ補正画像を縮小して、縮小画像を生成する縮小ステップと、縮小画像を構成する画素を用いた補間演算により、平滑化画像の画素の輝度Llを演算する補間ステップとを含む処理をコンピュータに実行させるプログラムが記録されている。
【0029】
本発明のプログラムは、入力された画像の画素値を、予め用意されているトーンカーブに基づいて、階調を圧縮する方向に補正することにより、トーンカーブ補正画像を生成するトーンカーブ補正ステップと、トーンカーブ補正画像の画素の輝度Lcを平滑化して、平滑化画像を生成する平滑化ステップと、トーンカーブ補正画像の画素の輝度Lc、平滑化画像を構成する画素の輝度Ll、およびトーンカーブの傾きの逆数を利用して設定されたゲイン値gに基づき、コントラスト補正画像を生成するコントラスト補正ステップとを含み、平滑化ステップの処理は、入力されたトーンカーブ補正画像を縮小して、縮小画像を生成する縮小ステップと、縮小画像を構成する画素を用いた補間演算により、平滑化画像の画素の輝度Llを演算する補間ステップとを含む処理をコンピュータに実行させる。
【0030】
本発明においては、入力された画像の画素値が、予め用意されているトーンカーブに基づいて、階調を圧縮する方向に補正されることにより、トーンカーブ補正画像が生成され、トーンカーブ補正画像の画素の輝度Lcが平滑化されて平滑化画像が生成され、トーンカーブ補正画像の画素の輝度Lc、平滑化画像を構成する画素の輝度Ll、およびトーンカーブの傾きの逆数を利用して設定されたゲイン値gに基づき、コントラスト補正画像が生成される。なお、平滑化の処理では、入力されたトーンカーブ補正画像が縮小されて縮小画像が生成され、縮小画像を構成する画素を用いた補間演算により、平滑化画像の画素の輝度Llが演算される。
【0052】
【発明の実施の形態】
図1は、本発明を適用した画像処理システムの構成例を示している。この画像処理システム1は、被写体を撮影し、通常よりも広いダイナミックレンジの画素値(輝度)を有する画素から構成される広DR画像Lを生成するビデオカメラ2、ビデオカメラ2によって生成された広DR画像Lの階調を、ディスプレイ11が表示可能な階調の範囲に圧縮する画像処理装置10、および画像処理装置10によって生成される階調圧縮画像Luを表示するディスプレイ11から構成される。
【0053】
ビデオカメラ2は、被写体の光画像を集光するレンズ3、光画像の光量を調整する絞り4、集光された光画像を光電変換して輝度信号を生成するCCDイメージセンサ5、生成された輝度信号からノイズ成分を除去する前置増幅器(Pre-amp.)6、ノイズ成分が除去された輝度信号を、例えば14乃至16ビット程度のビット幅のディジタルデータに変換するADコンバータ(A/D)7、およびディジタル化された輝度を有する画素から構成される広DR画像Lを画像処理装置10に出力するI/Oインタフェース(I/O)8から構成される。
【0054】
図2は、画像処理システム1の動作概要を示している。ステップS1において、ビデオカメラ2は、被写体を撮影し、対応する広DR画像Lを生成して、画像処理装置10に出力する。ステップS2において、画像処理装置10は、広DR画像Lに階調圧縮処理を施して階調圧縮画像Luを生成し、ディスプレイ11に出力する。ステップS3において、ディスプレイ11は、階調圧縮画像Luを表示する。
【0055】
次に、図3は、画像処理装置10の第1の構成例を示している。画像処理装置10のトーンカーブ補正部21は、ビデオカメラ2から入力される広DR画像Lを、予め用意されているトーンカーブに基づいて、階調を圧縮する方向に補正し、その結果として得られるトーンカーブ補正画像Lcを、平滑化輝度生成部22、ゲイン値設定部23、およびコントラスト補正部24に出力する。なお、このトーンカーブ補正画像Lcは、階調が圧縮されており、階調が圧縮されたことに起因して、コントラストが弱められたものとなっている。また、トーンカーブ補正部21は、補正に用いたトーンカーブの傾きを示す代表値γをゲイン値設定部23に出力する。
【0056】
図4は、トーンカーブ補正部21の構成例を示している。トーンカーブ補正部21のLUTメモリ31には、図5に示すような単調増加のトーンカーブに相当するルックアップテーブル(以下、LUTと記述する)と、トーンカーブの傾きを示す代表値γが予め保持されている。なお、LUTの代わりに、トーンカーブに相当する関数を保持するようにしてもよい。テーブル参照部32は、LUTメモリ31に保持されているLUTに基づき、広DR画像Lを、トーンカーブ補正画像Lcに補正する。
【0057】
図5は、トーンカーブの一例を示しており、横軸が広DR画像Lの輝度を、縦軸が補正後のトーンカーブ補正画像Lcの輝度を、それぞれ[0,1]に正規化して表示している。図5に示されたトーンカーブは、正規化された広DR画像Lの輝度値が0.5よりも大きい場合にはその値を補正せず、正規化された広DR画像Lの輝度値が0.5よりも小さい場合には、その値が小さいほど、大きな補正量で補正する。つまり、ディスプレイ11に表示されたとき、画像の中の暗い領域が黒くつぶれないように補正が行われる。なお、トーンカーブの傾きを示す代表値γは、例えば、輝度全域の傾きをそれぞれ求めて、それらの平均値を代表値γとすればよい。例えば、図5に示されたトーンカーブの代表値は、γ=0.94である。
【0058】
図3に戻る。平滑化輝度生成部22は、トーンカーブ補正画像Lcの輝度を平滑化し、得られる平滑化画像の輝度Lcl(p)をコントラスト補正部24に出力する。図6は、平滑化輝度生成部22の構成例を示している。
【0059】
平滑化輝度生成部22の縮小画像生成部41は、トーンカーブ補正部21から入力されたトーンカーブ補正画像Lcの画素を、その画素位置に対応してm×nブロックに分類し、各ブロックに分類された画素の輝度の平均値を画素とする縮小画像Lclを生成する。縮小画像メモリ42は、生成されたm×n画素の縮小画像Lclを保持する。補間部43は、順次指定される画素位置pの輝度を、縮小画像メモリ42に保持されている縮小画像の画素を用いた補間処理により算出して、得られた補間値Lcl(p)を、平滑化画像の画素の輝度としてコントラスト補正部24に出力する。ここで、p=(x,y)は、画素位置を示す座標またはベクトルである。従って、補間部43から出力される平滑化画像のサイズは、トーンカーブ補正画像Lcのサイズは同一である。
【0060】
すなわち、平滑化輝度生成部22では、トーンカーブ補正画像Lcが縮小されて縮小画像Lclが生成され、保持された縮小画像Lclが利用されて平滑化画像の輝度Lcl(p)が1画素ずつ補間演算によって算出されることになる。
【0061】
従来では、上述したように、効果的な階調圧縮処理を実施するためには比較的大きなサイズのフィルタ処理が必要であったが、平滑化輝度生成部22では、m×n画素の縮小画像を保持する縮小画像メモリ42を設ければ済むことになる。
【0062】
図7は、図6の縮小画像生成部41の構成例を示している。縮小画像生成部41のソート部51は、前段のトーンカーブ補正部21から入力されたトーンカーブ補正画像Lcの画素を、その画素位置に応じてm×n個のブロックに分類し、平均値計算部52−1乃至52−N(=m×n)に供給する。例えば、1番目のブロックに分類されたものは平均値計算部52−1に供給され、2番目のブロックに分類されたものは平均値計算部52−2に供給される。以下同様であり、N番目のブロックに分類されたものは平均値計算部52−Nに供給される。以下、平均値計算部52−1乃至52−Nを個々に区別する必要がない場合、単に平均値計算部72と記述する。
【0063】
平均値計算部52−i(i=1,2,…,N)は、i番目のブロックに分類されたトーンカーブ補正画像Lcの画素の輝度の平均値を算出して、合成部53に出力する。合成部53は、平均値計算部52−iからそれぞれ入力される輝度のの平均値を画素値とするm×n画素の縮小画像を生成する。
【0064】
図8は、図7の平均値計算部52の構成例を示している。平均値計算部52の加算器61は、前段のソート部51から入力されるトーンカーブ補正画像Lcの輝度に、レジスタ(r)62が保持する値を加算して、レジスタ(r)62が保持する値を更新する。除算器63は、レジスタ62が最終的に保持している値を、1個のブロックを構成する画素数Qで除算することにより、1個のブロックに分類されたQ個の画素の輝度の平均値を算出する。
【0065】
図9は、図6の補間部43の構成例を示している。補間部43の近傍選択部71は、補間位置pの入力を受けて、縮小画像メモリ42に保持されているm×n画素の縮小画像Lclから、補間位置pの近傍の4×4画素の輝度a[4][4]を取得して、積和部74に出力する。
【0066】
ここでa[i][j]の表記は、輝度aがi×jの2次元配列データであることを示す。また、近傍選択部71は、取得した輝度a[4][4]と補間位置pとの水平方向の位置ずれ量dx、垂直方向の位置ずれ量dyを、それぞれ、水平係数算出部72または垂直係数算出部73に出力する。
【0067】
ここで、補間位置p、近傍の輝度a[4][4]、位置ずれ量dx,dyの関係について、図10を参照して説明する。
【0068】
図10のm×nのマス目は、縮小画像Lclを構成するm×n画素を表している。いま、補間位置p=(px,py)が与えられたとすると、補間位置pに対応する縮小画像Lcl上の位置qは、q=(qx,qy)=(px/bx−0.5,py/by−0.5)である。ただし、(bx,by)=(トーンカーブ補正画像Lcの水平画素数/m,トーンカーブ補正画像Lcの垂直画素数/n)である。
【0069】
補間位置pに対応する縮小画像Lcl上の位置qから近傍の画素を得るには、図10においては斜線で示されたqx−2<x<qx+2、qy−2<y<qy+2の範囲に位置する縮小画像Lclの画素を取得すればよい。斜線で示された領域内の4×4の”+”マークで示された位置が取得される画素の位置である。近傍画素と補間位置pのずれ量(dx,dy)は、補間位置qの左下方向の最も近い画素との差分とする。すなわち、ずれ量(dx,dy)=(qxの小数部,qyの小数部)である。
【0070】
図9に戻る。水平係数算出部72は、近傍選択部71から入力された水平方向ずれ量dxに基づき、水平方向の3次補間係数kx[4]を計算する。同様に、垂直係数算出部73は、近傍選択部71から入力された垂直方向ずれ量dyに基づき、垂直方向の3次補間係数ky[4]を計算する。
【0071】
例えば、水平方向の3次補間係数kx[4]は、次式(1)を用いて計算する。
【数1】

Figure 0004214457
…(1)
【0072】
また、例えば、垂直方向の3次補間係数ky[4]は、次式(2)を用いて計算する。
【数2】
Figure 0004214457
…(2)
【0073】
なお、3次補間係数kx[4],ky[4]の計算には、上述した式(1),(2)の他、十分に滑らかな補間が得られるならば、任意の計算式を用いることができる。
【0074】
積和部74は、近傍の画素の輝度a[4][4]と、水平方向の補間係数kx[4]および垂直方向の補間係数ky[4]との積和計算により、縮小画像Lclの補間位置pの補間値Lcl(p)を、次式(3)を用いて算出する。
【数3】
Figure 0004214457
…(3)
【0075】
図3に戻る。ゲイン設定部23は、トーンカーブ補正部21から入力される代表値γに基づき、コントラスト補正部24において平滑化画像の輝度Lcl(p)のコントラストを補正するときの補正量を調整するゲイン値g(p)を各画素位置に対して算出し、コントラスト補正部24に出力する。
【0076】
ここで、ゲイン値g(p)について説明する。ゲイン値g(p)=1である場合、コントラスト補正部24においてコントラストは強調も抑制も行われない。ゲイン値g(p)>1である場合、その値に対応してコントラストが強調される。反対に、ゲイン値g(p)<1である場合、その値に対応してコントラストが抑制される。
【0077】
ゲイン値設定の概略を説明する。トーンカーブ補正画像Lcのコントラストは、トーンカーブ補正による階調圧縮によって既に抑制されているが、その抑制量はトーンカーブの傾きに依存している。例えば強い階調圧縮を行うように傾きの小さなトーンカーブが適用されていれば、コントラストの抑制も強くなされていることになる。また、例えばトーンカーブとして傾き1の直線が適用されていれば、画像が変化しない、すなわち、コントラストの抑制は行われていないことになる。
【0078】
そこで、ゲイン値設定部23では、トーンカーブの傾きの代表値γが1よりも小さい場合には、ゲイン値が1より大きくなるように、トーンカーブの傾きの代表値γの逆数1/γをゲイン値として採用する。
【0079】
また、入力されるトーンカーブ補正された輝度Lcが白レベルまたは黒レベルに近い場合には、中間輝度域と同じようなコントラスト強調を行うとクリッピングが生じて逆に画像のディテールを失う結果となるので、入力されたトーンカーブ補正された輝度Lcが白レベルまたは黒レベルに近くなるに従って、ゲイン値が1に近づくようする。
【0080】
すなわち、代表値γの逆数1/γ=g0として、ゲイン値g(p)を次式(4)のように算出する。
Figure 0004214457
ここで、attn(p)は、減衰する係数であって、次式(5)を用いて計算される。
【数4】
Figure 0004214457
…(5)
【0081】
なお、式(5)において、Lgrayは、中庸なグレイレベルの輝度を示し、Lwhiteは、白クリップレベル(最大の白レベル)の輝度を示しており、どちらも予め設定されている定数である。
【0082】
図11は、ゲイン値設定部23の構成例を示している。除算器81は、前段から入力される代表値γの逆数1/γ=g0を算出して減算器82に出力する。減算器82は、(g0−1)を演算して乗算器88に出力する。
【0083】
減算器83は、トーンカーブ補正画像Lcの各輝度と、中庸なグレイレベルの輝度Lgrayの差(Lc−Lgray)を演算して、除算器85に出力する。減算器84は、白クリップレベルの輝度Lwhiteと、輝度Lgrayの差(Lwhite−Lgray)を演算して、除算器85に出力する。除算器85は、減算器83の出力(Lc−Lgray)を、減算器84の出力(Lwhite−Lgray)で除算して、絶対値計算器86に出力する。絶対値計算器86は、除算器85の出力の絶対値を計算してクリップ器87に出力する。クリップ器87は、絶対値計算器86の出力が1を超過する場合、その値を1にクリッピングし、絶対値計算器86の出力が1を超過しない場合、その値をそのまま、attn(p)として乗算器88に出力する。
【0084】
乗算器88は、減算器82の出力に、クリップ器87の出力を乗算して、加算器89に出力する。加算器89は、乗算器88の出力に1を加算し、演算結果をゲイン値g(p)として後段に出力する。
【0085】
図3に戻る。コントラスト補正部24は、ゲイン値設定部23から入力される各画素位置pのゲイン値g(p)および平滑化輝度生成部22から入力される平滑化画像の輝度Lcl(p)に基づき、コントラストが弱められているトーンカーブ補正画像Lcのコントラストを強調して階調圧縮画像Luを生成する。
【0086】
図12は、コントラスト補正部24の構成例を示している。コントラスト補正部24の減算器91は、トーンカーブ補正画像Lcの各画素の輝度Lc(p)と、平滑化画像の対応する画素の輝度(すなわち、縮小画像の補間値Lcl(p))との差(Lc(p)−Lcl(p))を演算して、乗算器92に出力する。乗算器92は、減算器91の出力と、ゲイン値設定部23から入力されたゲイン値g(p)との積を演算して、加算器93に出力する。加算器93は、乗算器92の出力に、平滑化画像の画素の輝度(縮小画像の補間値Lcl(p))を加算して、その結果得られた輝度Lu(p)を、コントラスト補正がなされた階調圧縮画像Luを構成する画素の輝度として後段に出力する。
【0087】
なお、平滑化画像の画素の輝度(縮小画像の補間値Lcl(p))は、m×n画素の縮小画像Lclの画素を元にして補間された値であるから、縮小前のトーンカーブ補正画像Lcのごく低周波域成分だけをもつものである。
【0088】
従って、減算器91の出力(Lc(p)−Lcl(p))は、元のトーンカーブ補正画像logLcから、ごく低域成分だけを差し引いたものとなる。このように輝度信号を、ごく低周波域の成分とそれ以外の成分に分離し、そのうち、低周波域成分以外(減算器91の出力)を、ゲイン値g(p)を乗算することによってコントラストを強調した後、再び加算器93により合成したものが、コントラスト補正がなされた階調圧縮画像の輝度Lu(p)である。
【0089】
このように、コントラスト補正部24では、ごく低周波域を除く、低中周波域から高周波域の成分が同じゲイン値g(p)で強調されるようになされている。従って、コントラスト補正がなされた階調圧縮画像の輝度Lu(p)は、高周波域だけを強調したときに目立つ、エッジ部分の局所的なオーバーシュートは発生せず、見た目にもごく自然にコントラストが強調された画像が得られるようになされている。
【0090】
次に、画像処理装置10の第1の構成例による階調圧縮画像生成処理(すなわち、図2のフローチャートを参照して上述したステップS2の処理)の詳細について、図13のフローチャートを参照して説明する。
【0091】
ステップS11において、トーンカーブ補正部21は、ビデオカメラ2から入力された広DR画像Lの輝度を、予め用意されているLUTに基づいて補正し、その結果として得られるトーンカーブ補正画像Lcを、平滑化輝度生成部22、ゲイン値設定部23、およびコントラスト補正部24に出力する。また、トーンカーブ補正部21は、補正に用いたトーンカーブの傾きを示す代表値γをゲイン値設定部23に出力する。
【0092】
ステップS12において、平滑化輝度生成部22は、トーンカーブ補正画像Lcを縮小して、縮小画像Lclを生成し、さらに、縮小画像Lclの画素を用いた補間演算により、平滑化画像の画素の輝度Lcl(p)を算出して、コントラスト補正部24に出力する。
【0093】
ステップS13において、ゲイン設定部23は、トーンカーブ補正部21から入力された代表値γに基づき、コントラスト補正部24において平滑化画像の輝度Lcl(p)のコントラストを補正するときの補正量を調整するゲイン値g(p)を各画素位置に対して算出し、コントラスト補正部24に出力する。
【0094】
なお、ステップS12の処理と、ステップS13の処理は、並行して実施することが可能である。
【0095】
ステップS14において、コントラスト補正部24は、ゲイン値設定部23から入力された各画素位置pのゲイン値g(p)および平滑化輝度生成部22から入力される平滑化画像の輝度Lcl(p)に基づき、トーンカーブ補正画像Lcの輝度を補正して、階調圧縮画像Luの画素の輝度Lu(p)を算出する。このようにして得られた、コントラスト補正がなされた階調圧縮画像Luは、高周波域だけを強調したときに目立つ、エッジ部分の局所的なオーバーシュートは発生せず、見た目にもごく自然にコントラストが強調された画像となる。以上で、画像処理装置10の第1の構成例による階調圧縮画像生成処理の説明を終了する。
【0096】
次に、図14は、画像処理装置10の第2の構成例を示している。この第2の構成例は、図3に示された第1の構成例のトーンカーブ補正部21の上段に、ビデオカメラ1から入力される広DR画像Lの輝度を対数変換する対数変換部101を設け、さらに、第1の構成例のコントラスト補正部24の下段に、コントラスト補正部24の出力を対数逆変換する対数逆変換部102を設けたものである。
【0097】
画像処理装置10の第2の構成例を構成する対数変換部101および対数逆変換部102以外の構成要素については、図3の第1の構成例と同等であるので、同一の符号を付しており、その説明は適宜省略する。ただし、第2の構成例において、トーンカーブ補正部21乃至コントラスト補正部24は、それぞれ対数変換された輝度を処理することになる。
【0098】
図15は、第2の構成例におけるトーンカーブ補正部21で適用されるトーンカーブの一例であり、横軸が広DR画像Lの輝度を、縦軸がトーンカーブ補正画像Lcの輝度を、それぞれ[0,1]に正規化して対数軸で表示している。この例のように、単調増加であって、緩やかな逆S字形のトーンカーブを適用すると、高輝度領域と低輝度領域では、階調圧縮があまり強く作用しないので、階調圧縮後でも白ツブレや黒ツブレが少ない良好な色調が得られる。逆に中間輝度域は階調圧縮が強く作用するが、その分だけ、中間輝度域に対しては、コントラスト補正が十分に適用されるので、中間輝度域でもコントラスト劣化のない良好な階調圧縮画像Luを得ることができる。図15に示されたトーンカーブの場合、代表値γ=0.67である。
【0099】
次に、画像処理装置10の第2の構成例による階調圧縮画像生成処理の詳細について、図16のフローチャートを参照して説明する。
【0100】
ステップS21において、対数変換部101は、ビデオカメラ2から入力された広DR画像Lの輝度を対数変換し、その結果得られた対数広DR画像logLをトーンカーブ補正部21に出力する。
【0101】
ステップS22において、トーンカーブ補正部21は、対数広DR画像logLの輝度を、予め用意されている、例えば、図15に示されたトーンカーブに相当するLUTに基づいて補正し、その結果として得られた対数トーンカーブ補正画像logLcを、平滑化輝度生成部22、ゲイン値設定部23、およびコントラスト補正部24に出力する。また、トーンカーブ補正部21は、補正に用いたトーンカーブの傾きを示す代表値γをゲイン値設定部23に出力する。
【0102】
ステップS23において、平滑化輝度生成部22は、対数トーンカーブ補正画像logLcを縮小して、対数縮小画像logLclを生成し、さらに、対数縮小画像logLclの画素を用いた補間演算により、対数平滑化画像の画素の輝度logLcl(p)を算出して、コントラスト補正部24に出力する。
【0103】
ステップS24において、ゲイン設定部23は、トーンカーブ補正部21から入力された代表値γに基づき、コントラスト補正部24において対数平滑化画像の輝度logLcl(p)のコントラストを補正するときの補正量を調整するゲイン値g(p)を各画素位置に対して算出し、コントラスト補正部24に出力する。
【0104】
なお、ステップS23の処理と、ステップS24の処理は、並行して実施することが可能である。
【0105】
ステップS25において、コントラスト補正部24は、ゲイン値設定部23から入力された各画素位置pのゲイン値g(p)および平滑化輝度生成部22から入力される対数平滑化画像の輝度logLcl(p)に基づき、対数トーンカーブ補正画像logLcの輝度を補正して、対数階調圧縮画像logLuの画素の輝度logLu(p)を算出し、対数逆変換部102に出力する。
【0106】
ステップS26において、対数逆変換部102は、対数階調圧縮画像logLuの画素の輝度logLu(p)を対数逆変換して、その結果得られたLu(p)を階調圧縮画像Luの画素の輝度として出力する。
【0107】
このようにして得られた、コントラスト補正がなされた階調圧縮画像Luは、高輝度領域と低輝度領域では、階調圧縮があまり強く作用しないので、階調圧縮後でも白ツブレや黒ツブレが少ない良好な色調となる。逆に中間輝度域は階調圧縮が強く作用するが、その分だけ、中間輝度域に対しては、コントラスト補正が十分に適用されるので、中間輝度域でもコントラスト劣化のない良好な画像となる。以上で、画像処理装置10の第2の構成例による階調圧縮画像生成処理の説明を終了する。
【0108】
以上説明したように、本発明の一実施の形態である画像処理装置10によれば、従来の階調圧縮技術に必要であった大量のメモリ(フレームメモリや画素系列データのディレイラインとして使用される)を大幅に削減した構成で、通常よりも広いダイナミックレンジの輝度を有する広DR画像を、見栄得を損なうことなく、表示可能な輝度のダイナミックレンジがより狭いディスプレイ11に表示させることができる階調圧縮画像に変換することが可能となる。また、従来大きなフィルタ処理をもって実現されていた階調圧縮処理と遜色のない階調圧縮画像を得ることができる。
【0109】
勿論、画像処理装置10は、広DR画像を、ディスプレイ11以外のプリンタやプロジェクタが表現可能なダイナミックレンジに適合させて、広DR画像を階調圧縮画像に変換することが可能である。
【0110】
なお、本発明は、例えば、ディジタルビデオカメラ、ディジタルスチルカメラの撮影デバイスの他、ディスプレイ、プリンタ、プロジェクタ等の表現デバイスに内蔵される画像信号処理回路に適用することができる。
【0111】
ところで、上述した一連の処理は、ハードウェアにより実行させることもできるが、ソフトウェアにより実行させることもできる。一連の処理をソフトウェアにより実行させる場合には、そのソフトウェアを構成するプログラムが、専用のハードウェアに組み込まれているコンピュータ、または、各種のプログラムをインストールすることで、各種の機能を実行することが可能な、例えば汎用のパーソナルコンピュータなどに、記録媒体からインストールされる。
【0112】
図17は、汎用のパーソナルコンピュータの構成例を示している。このパーソナルコンピュータ120は、CPU(Central Processing Unit)121を内蔵している。CPU121にはバス124を介して、入出力インタフェース125が接続されている。バス124には、ROM(Read Only Memory)122およびRAM(Random Access Memory)123が接続されている。
【0113】
入出力インタフェース125には、ユーザが操作コマンドを入力するキーボード、マウスなどの入力デバイスよりなる入力部126、処理操作画面や処理結果の画像を表示デバイスに出力する出力部127、プログラムや各種データを格納するハードディスクドライブなどよりなる記憶部128、ビデオカメラ2等と画像データを通信するI/Oインタフェース129が接続されている。また、磁気ディスク131(フレキシブルディスクを含む)、光ディスク132(CD-ROM(Compact Disc-Read Only Memory)、DVD(Digital Versatile Disc)を含む)、光磁気ディスク133(MD(Mini Disc)を含む)、もしくは半導体メモリ134などの記録媒体に対してデータを読み書きするドライブ130が接続されている。
【0114】
CPU121は、ROM122に記憶されているプログラム、または磁気ディスク131乃至半導体メモリ134から読み出されて記憶部128にインストールされ、記憶部128からRAM123にロードされたプログラムに従って各種の処理を実行する。RAM123にはまた、CPU121が各種の処理を実行する上において必要なデータなども適宜記憶される。
【0115】
なお、本明細書において、記録媒体に記録されるプログラムを記述するステップは、記載された順序に従って時系列的に行われる処理は勿論、必ずしも時系列的に処理されなくとも、並列的あるいは個別に実行される処理をも含むものである。
【0116】
また、本明細書において、システムとは、複数の装置により構成される装置全体を表すものである。
【0117】
【発明の効果】
以上のように、本発明によれば、使用するメモリの容量がより小さく、演算量が少なくて、ハードウェア化が容易であり、かつ、適切に階調圧縮された画像のコントラストを強調することが可能となる。
【図面の簡単な説明】
【図1】本発明を適用した画像処理システムの構成例を示すブロック図である。
【図2】図1に示された画像処理システムの動作を説明するフローチャートである。
【図3】図1に示された画像処理装置の第1の構成例を示すブロック図である。
【図4】図3に示されたトーンカーブ補正部の構成例を示すブロック図である。
【図5】画像処理装置の第1の構成例において用いられるトーンカーブの一例を示す図である。
【図6】図3に示された平滑化輝度生成部の構成例を示すブロック図である。
【図7】図6に示された縮小画像生成部の構成例を示すブロック図である。
【図8】図7に示された平均値計算部部の構成例を示すブロック図である。
【図9】図6に示された補間部の構成例を示すブロック図である。
【図10】図6に示された補間部の処理を説明するための図である。
【図11】図3に示されたゲイン値設定部の構成例を示すブロック図である。
【図12】図3に示されたコントラスト補正部の構成例を示すブロック図である。
【図13】画像処理装置の第1の構成例による階調圧縮画像生成処理を説明するフローチャートである。
【図14】図1に示された画像処理装置の第2の構成例を示すブロック図である。
【図15】画像処理装置の第2の構成例において用いられるトーンカーブの一例を示す図である。
【図16】画像処理装置の第2の構成例による階調圧縮画像生成処理を説明するフローチャートである。
【図17】汎用のパーソナルコンピュータの構成例を示すブロック図である。
【符号の説明】
1 画像処理システム, 2 ビデオカメラ,5 CCDイメージセンサ, 10 画像処理装置, 11 ディスプレイ, 21 トーンカーブ補正部, 22 平滑化輝度生成部, 23 ゲイン値設定部, 24 コントラスト補正部, 101 対数変換部, 102 対数逆変換部, 121 CPU, 131磁気ディスク, 132 光ディスク, 133 光磁気ディスク, 134半導体メモリ[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an image processing apparatus and method, a recording medium, and a program, and more particularly, to an image processing apparatus and method, a recording medium, and a program that are suitable for enhancing the contrast of an image without impairing appearance. .
[0002]
[Prior art]
Conventionally, solid-state imaging devices such as CCD (Charge Coupled Device) and CMOS (Complementary Metal-Oxide Semiconductor) have been used for imaging equipment such as video cameras and still cameras, component inspection equipment in FA (Factory Automation), and electronics in ME (Medical Electronics). Widely used in optical measuring devices such as endoscopes.
[0003]
In recent years, many techniques for obtaining an image having a wide dynamic range of pixel values (hereinafter referred to as a wide DR image) comparable to an optical film photograph using these solid-state imaging devices have been proposed (for example, Patent Document 1).
[0004]
On the other hand, display devices such as CRT (Cathode Ray Tube) and LCD (Liquid Crystal Display) that display moving images and still images, projection devices such as projectors, and various printing devices are still compatible with dynamic pixel values. The range is not widened, and there is a limit to the luminance gradation that can be handled. For this reason, even if a wide DR image is taken, there is currently no apparatus capable of displaying, projecting, or printing in that state.
[0005]
Therefore, for the time being, the dynamic range of the pixel value of the wide DR image is narrowed, in other words, an image in which the luminance gradation is compressed and adapted to the dynamic range of a display device (hereinafter referred to as a narrow DR image). A technique (hereinafter referred to as a gradation compression technique) is required.
[0006]
Here, a conventionally proposed gradation compression technique will be described. The gradation compression technique is simply realized by redistributing the gradation of the pixel value of the wide DR image in accordance with a gradation of a narrower dynamic range that can be handled by a display device or the like.
[0007]
However, as described above, simply redistributing the gradation of the pixel values of the wide DR image evenly in a narrow dynamic range reduces the change in luminance of the entire image and reduces the contrast. It will be converted into an image with poor appearance. Therefore, several gradation compression techniques that can suppress a decrease in contrast have been proposed. Hereinafter, three types of conventionally proposed gradation compression techniques will be described.
[0008]
As a first gradation compression technique, a gradation redistribution rule is adaptively determined based on a luminance histogram of an input wide DR image (specifically, a gradation conversion curve is represented by an input image histogram). (Based on the calculation)). In the first gradation compression technique, assuming that the ratio of the area occupied by an important subject in the image is large, the gradation conversion curve is set so as to distribute as many gradations as possible to the luminance value near the peak of the histogram. The determination is made so as to suppress at least a decrease in contrast in an important subject (see, for example, Patent Document 2).
[0009]
However, it is difficult to obtain a satisfactory result in all situations by such a device with only gradation distribution. For example, when there are multiple important subjects in the image, and when the background is of uniform brightness and occupies a relatively large area (for example, blue sky), often sufficient gradation is allocated to the subject. May not be.
[0010]
As the second gradation compression technique, a technique for emphasizing high-frequency components in an image either before or after gradation conversion can be cited. The second tone compression technique estimates the contrast lost by tone conversion (or seems to be lost by tone conversion) from the image, and compensates for this by using a high-frequency enhancement filter such as unsharp masking. (For example, refer to Patent Document 3).
[0011]
The second gradation compression technique has an advantage that there is no problem depending on the composition of the image unlike the first gradation compression technique. However, the high-frequency emphasis filter has problems such as overshooting at the contour portion of the subject and noise enhancement at a flat portion, and an image with good appearance may not be obtained.
[0012]
As a third gradation conversion technique, the wide DR image is separated into a low-frequency component image and a high-frequency component image, and an appropriate gradation conversion process is performed on the low-frequency component image without changing the high-frequency component image. Finally, a technique of adding and combining them into one image can be given (for example, see Patent Document 4).
[0013]
According to the third gradation conversion technique, the high-frequency component of the wide DR image is not subjected to gradation compression, so that it is possible to prevent a decrease in contrast of the generated image. However, similarly to the second gradation conversion technique, the third gradation conversion technique has problems such as luminance overshoot in the contour portion of the subject and noise enhancement in the flat portion. Therefore, a method for solving this problem by using a non-linear filter (for example, a median filter) for the process of separating the low-frequency component image and the high-frequency component image has been proposed (for example, see Patent Document 4).
[0014]
[Patent Document 1]
JP-A-8-223491
[Patent Document 2]
JP-A-9-331469
[Patent Document 3]
JP 2000-115534 A
[Patent Document 4]
JP-A-9-214766
[0015]
[Problems to be solved by the invention]
Summarizing the first to third gradation compression techniques described above, the following problems exist.
[0016]
First, as the high-frequency component is emphasized, luminance overshoot occurs in the contour portion of the subject. In order to suppress this, a two-dimensional nonlinear filter having a relatively large size (20 × 20 pixels) is necessary. However, in order to realize such a two-dimensional nonlinear filter as software, the calculation cost is very high. There is a problem that the circuit scale becomes large because a large amount of delay lines are required to realize it as hardware.
[0017]
Secondly, the control of the contrast enhancement amount of the high frequency component in the high luminance region and the low luminance region. In the second and third gradation compression techniques described above, the brightness is separated into a low-frequency component and a high-frequency component, the low-frequency component is relatively suppressed, and the high-frequency component is emphasized, thereby maintaining the contrast. It is common to perform compression.
[0018]
However, in the vicinity of the maximum luminance and the minimum luminance allowed by a display device or the like, high-frequency components are emphasized to cause luminance clipping, resulting in loss of image details and appropriate gradation conversion. Therefore, there is a problem that needs to be dealt with so as not to cause clipping of luminance.
[0019]
Furthermore, even in a state where no luminance clipping occurs, there is a problem that if the contrast enhancement is too strong, the contour portion of the subject is unnaturally enhanced.
[0020]
The present invention has been made in view of such circumstances, so that the capacity of the memory to be used is smaller, the number of operations is small, hardware is easy, and the contrast of the image can be enhanced appropriately. The purpose is to do.
[0021]
[Means for Solving the Problems]
  The image processing apparatus of the present invention corrects a pixel value of an input image based on a tone curve prepared in advance in a direction in which gradation is compressed, thereby generating a tone curve corrected image. Means and luminance L of the pixel of the tone curve corrected imagecSmoothing means for generating a smoothed image, and the luminance L of the pixel of the tone curve corrected imagec, Luminance L of the pixels constituting the smoothed imagel,andSet using the inverse of the slope of the tone curveContrast correction means for generating a contrast-corrected image based on the gain value g, and the smoothing means reduces the input tone curve correction image to form a reduced image and a reduced image. The luminance L of the pixel of the smoothed image is obtained by interpolation using the pixel.lInterpolating means for calculating.
[0022]
The contrast correction means is a luminance L of pixels constituting a contrast corrected image.uThe following formula
Lu= G · (Lc-Ll) + Ll
It can be made to calculate based on.
[0023]
  The reduction means is inputTone curve correctionThe image is divided into a plurality of blocks, the average value of the luminance of the pixels belonging to each block is calculated, and a reduced image composed of the same number of pixels as the number of blocks is generated with the average value being the pixel luminance.
  ContractThe image processing apparatus according to claim 1.
[0024]
The interpolation means specifies a position on the reduced image corresponding to the interpolation position, which is the position of the pixel to be interpolated by the smoothing means, and uses the pixels of the reduced image existing in the vicinity of the specified position, Luminance L of the pixellCan be calculated.
[0025]
The interpolation means specifies a position on the reduced image corresponding to the interpolation position, which is the position of the pixel to be interpolated by the smoothing means, and uses the 4 × 4 pixels of the reduced image existing in the vicinity of the specified position. The luminance L of the smoothed image pixel is obtained by cubic interpolation.lCan be calculated.
[0026]
  Of the present inventionPaintingThe image processing apparatus is the one before input to the smoothing means.Tone curve correctionLuminance L of pixels constituting the imagecLogarithm conversion means for logarithmically converting the image, and logarithmic inverse conversion means for logarithmically inversely converting the luminance of the pixels constituting the contrast-corrected image output by the contrast correction means.
[0027]
  The image processing method of the present invention is a tone curve correction that generates a tone curve corrected image by correcting pixel values of an input image in a direction in which gradation is compressed based on a tone curve prepared in advance. Step and luminance L of the pixel of the tone curve corrected imagecSmoothing step for generating a smoothed image and the luminance L of the pixel of the tone curve corrected imagec, Luminance L of the pixels constituting the smoothed imagel,andSet using the inverse of the slope of the tone curveA contrast correction step for generating a contrast correction image based on the gain value g. The smoothing step processing reduces the input tone curve correction image to generate a reduced image; The luminance L of the pixel of the smoothed image is obtained by interpolation using the constituent pixels.lAn interpolation step for calculating.
[0028]
  The recording medium of the present invention is a tone curve correction step for generating a tone curve corrected image by correcting pixel values of an input image in a direction in which gradation is compressed based on a tone curve prepared in advance. And the luminance L of the pixel of the tone curve corrected imagecSmoothing step for generating a smoothed image and the luminance L of the pixel of the tone curve corrected imagec, Luminance L of the pixels constituting the smoothed imagel,andSet using the inverse of the slope of the tone curveA contrast correction step for generating a contrast correction image based on the gain value g. The smoothing step processing reduces the input tone curve correction image to generate a reduced image; The luminance L of the pixel of the smoothed image is obtained by interpolation using the constituent pixels.lA program for causing a computer to execute a process including an interpolation step for calculating is recorded.
[0029]
  The program of the present invention includes a tone curve correction step for generating a tone curve corrected image by correcting pixel values of an input image in a direction in which gradation is compressed based on a tone curve prepared in advance. , Pixel brightness L of tone curve correction imagecSmoothing step for generating a smoothed image and the luminance L of the pixel of the tone curve corrected imagec, Luminance L of the pixels constituting the smoothed imagel,andSet using the inverse of the slope of the tone curveA contrast correction step for generating a contrast correction image based on the gain value g. The smoothing step processing reduces the input tone curve correction image to generate a reduced image; The luminance L of the pixel of the smoothed image is obtained by interpolation using the constituent pixels.lThe computer is caused to execute processing including an interpolation step for calculating.
[0030]
  In the present invention, the tone value correction image is generated by correcting the pixel value of the input image in the direction of compressing the gradation based on the tone curve prepared in advance, and the tone curve correction image is generated. Luminance L of the pixelcIs smoothed to generate a smoothed image, and the luminance L of the pixel of the tone curve corrected imagec, Luminance L of the pixels constituting the smoothed imagel,andSet using the inverse of the slope of the tone curveA contrast corrected image is generated based on the gain value g. In the smoothing process, the input tone curve correction image is reduced to generate a reduced image, and the luminance L of the pixel of the smoothed image is obtained by interpolation using the pixels constituting the reduced image.lIs calculated.
[0052]
DETAILED DESCRIPTION OF THE INVENTION
FIG. 1 shows a configuration example of an image processing system to which the present invention is applied. The image processing system 1 shoots a subject and generates a wide DR image L composed of pixels having pixel values (brightness) having a wider dynamic range than usual, and a wide camera generated by the video camera 2 and the video camera 2. An image processing apparatus 10 that compresses the gradation of the DR image L to a range of gradations that can be displayed on the display 11, and a gradation compressed image L generated by the image processing apparatus 10uIt is comprised from the display 11 which displays.
[0053]
The video camera 2 includes a lens 3 that collects a light image of a subject, a diaphragm 4 that adjusts the light amount of the light image, a CCD image sensor 5 that photoelectrically converts the collected light image to generate a luminance signal, and A preamplifier (Pre-amp.) 6 that removes noise components from the luminance signal, an AD converter (A / D) that converts the luminance signals from which the noise components have been removed, for example, into digital data having a bit width of about 14 to 16 bits. 7) and an I / O interface (I / O) 8 that outputs a wide DR image L composed of pixels having digitized luminance to the image processing apparatus 10.
[0054]
FIG. 2 shows an outline of the operation of the image processing system 1. In step S <b> 1, the video camera 2 captures a subject, generates a corresponding wide DR image L, and outputs the wide DR image L to the image processing apparatus 10. In step S <b> 2, the image processing apparatus 10 performs gradation compression processing on the wide DR image L to perform the gradation compressed image L.uIs output to the display 11. In step S3, the display 11 displays the gradation compressed image L.uIs displayed.
[0055]
Next, FIG. 3 shows a first configuration example of the image processing apparatus 10. The tone curve correction unit 21 of the image processing apparatus 10 corrects the wide DR image L input from the video camera 2 in the direction of compressing the gradation based on the tone curve prepared in advance, and obtains the result. Tone curve correction image LcIs output to the smoothed luminance generation unit 22, the gain value setting unit 23, and the contrast correction unit 24. The tone curve corrected image LcThe tone is compressed, and the contrast is weakened due to the compression of the tone. Further, the tone curve correction unit 21 outputs a representative value γ indicating the slope of the tone curve used for the correction to the gain value setting unit 23.
[0056]
FIG. 4 shows a configuration example of the tone curve correction unit 21. In the LUT memory 31 of the tone curve correction unit 21, a lookup table (hereinafter referred to as LUT) corresponding to a monotonically increasing tone curve as shown in FIG. 5 and a representative value γ indicating the slope of the tone curve are stored in advance. Is retained. Note that a function corresponding to a tone curve may be held instead of the LUT. The table reference unit 32 converts the wide DR image L into the tone curve corrected image L based on the LUT held in the LUT memory 31.cTo correct.
[0057]
FIG. 5 shows an example of the tone curve. The horizontal axis represents the brightness of the wide DR image L, and the vertical axis represents the tone curve corrected image L after correction.cAre normalized to [0, 1], respectively. The tone curve shown in FIG. 5 is not corrected when the brightness value of the normalized wide DR image L is larger than 0.5, and the brightness value of the normalized wide DR image L is not corrected. If it is smaller than 0.5, the smaller the value, the larger the correction amount. That is, when displayed on the display 11, the correction is performed so that the dark area in the image is not crushed black. Note that the representative value γ indicating the tone curve inclination may be obtained by, for example, obtaining the inclination of the entire luminance range and setting the average value thereof as the representative value γ. For example, the representative value of the tone curve shown in FIG. 5 is γ = 0.94.
[0058]
Returning to FIG. The smoothed luminance generation unit 22 generates the tone curve corrected image LcThe brightness L of the smoothed image obtained by smoothing the brightness ofcl(P) is output to the contrast correction unit 24. FIG. 6 shows a configuration example of the smoothed luminance generation unit 22.
[0059]
The reduced image generation unit 41 of the smoothed luminance generation unit 22 receives the tone curve correction image L input from the tone curve correction unit 21.cAre classified into m × n blocks corresponding to the pixel positions, and the reduced image L having the average luminance value of the pixels classified in each block as a pixel.clIs generated. The reduced image memory 42 stores the generated reduced image L of m × n pixels.clHold. The interpolation unit 43 calculates the luminance of the pixel position p that is sequentially designated by the interpolation process using the pixels of the reduced image held in the reduced image memory 42, and obtains the obtained interpolation value Lcl(P) is output to the contrast correction unit 24 as the luminance of the pixel of the smoothed image. Here, p = (x, y) is a coordinate or vector indicating the pixel position. Accordingly, the size of the smoothed image output from the interpolation unit 43 is the tone curve corrected image L.cAre the same size.
[0060]
That is, in the smoothed luminance generation unit 22, the tone curve corrected image LcReduced image LclReduced image L generated and heldclIs used to obtain the brightness L of the smoothed image.cl(P) is calculated pixel by pixel by interpolation calculation.
[0061]
Conventionally, as described above, in order to perform effective gradation compression processing, filter processing of a relatively large size is necessary. However, the smoothed luminance generation unit 22 reduces the reduced image of m × n pixels. It is sufficient to provide a reduced image memory 42 that holds
[0062]
FIG. 7 shows a configuration example of the reduced image generation unit 41 in FIG. The sorting unit 51 of the reduced image generating unit 41 includes a tone curve corrected image L input from the preceding tone curve correcting unit 21.cAre classified into m × n blocks according to the pixel position, and supplied to the average value calculation units 52-1 to 52-N (= m × n). For example, those classified into the first block are supplied to the average value calculation unit 52-1, and those classified into the second block are supplied to the average value calculation unit 52-2. The same applies hereinafter, and those classified into the Nth block are supplied to the average value calculation unit 52-N. Hereinafter, when it is not necessary to individually distinguish the average value calculation units 52-1 to 52-N, they are simply referred to as the average value calculation unit 72.
[0063]
The average value calculation unit 52-i (i = 1, 2,..., N) calculates the tone curve corrected image L classified into the i-th block.cThe average value of the luminance of the pixels is calculated and output to the synthesis unit 53. The synthesizing unit 53 generates a reduced image of m × n pixels using the average value of the luminances input from the average value calculating unit 52-i as the pixel value.
[0064]
FIG. 8 shows a configuration example of the average value calculation unit 52 of FIG. The adder 61 of the average value calculation unit 52 is a tone curve correction image L input from the previous sorting unit 51.cThe value held by the register (r) 62 is added to the luminance of the value to update the value held by the register (r) 62. The divider 63 divides the value finally held by the register 62 by the number Q of pixels constituting one block, thereby averaging the luminances of the Q pixels classified into one block. Calculate the value.
[0065]
FIG. 9 shows a configuration example of the interpolation unit 43 of FIG. The neighborhood selection unit 71 of the interpolation unit 43 receives the input of the interpolation position p and receives a reduced image L of m × n pixels held in the reduced image memory 42.clThen, the luminance a [4] [4] of 4 × 4 pixels in the vicinity of the interpolation position p is acquired and output to the product-sum unit 74.
[0066]
Here, the notation a [i] [j] indicates that the luminance a is two-dimensional array data of i × j. In addition, the neighborhood selection unit 71 sets the horizontal position displacement amount dx and the vertical direction displacement amount dy between the acquired luminance a [4] [4] and the interpolation position p to the horizontal coefficient calculation unit 72 or the vertical position, respectively. It outputs to the coefficient calculation part 73.
[0067]
Here, the relationship between the interpolation position p, the nearby luminance a [4] [4], and the positional deviation amounts dx and dy will be described with reference to FIG.
[0068]
The m × n squares in FIG.clM × n pixels that constitutes. Now, assuming that the interpolation position p = (px, py) is given, the reduced image L corresponding to the interpolation position p.clThe upper position q is q = (qx, qy) = (px / bx−0.5, py / by−0.5). However, (bx, by) = (tone curve correction image LcHorizontal pixel count / m, tone curve corrected image LcOf vertical pixels / n).
[0069]
Reduced image L corresponding to the interpolation position pclIn order to obtain neighboring pixels from the upper position q, the reduced image L positioned in the range of qx−2 <x <qx + 2 and qy−2 <y <qy + 2 indicated by hatching in FIG.clIt is sufficient to acquire the pixels. The position indicated by the 4 × 4 “+” mark in the hatched area is the pixel position to be acquired. The shift amount (dx, dy) between the neighboring pixel and the interpolation position p is a difference from the nearest pixel in the lower left direction of the interpolation position q. That is, the deviation amount (dx, dy) = (decimal part of qx, decimal part of qy).
[0070]
Returning to FIG. The horizontal coefficient calculation unit 72 is based on the horizontal direction shift amount dx input from the neighborhood selection unit 71, and the horizontal third-order interpolation coefficient k.xCalculate [4]. Similarly, the vertical coefficient calculating unit 73 is based on the vertical direction shift amount dy input from the neighborhood selecting unit 71 and the vertical third-order interpolation coefficient k.yCalculate [4].
[0071]
For example, horizontal cubic interpolation coefficient kx[4] is calculated using the following equation (1).
[Expression 1]
Figure 0004214457
... (1)
[0072]
Also, for example, the cubic interpolation coefficient k in the vertical directiony[4] is calculated using the following equation (2).
[Expression 2]
Figure 0004214457
... (2)
[0073]
The cubic interpolation coefficient kx[4], kyFor the calculation of [4], any calculation formula can be used as long as sufficiently smooth interpolation is obtained in addition to the above-described formulas (1) and (2).
[0074]
The product-sum unit 74 calculates the luminance a [4] [4] of the neighboring pixels and the horizontal interpolation coefficient k.x[4] and vertical interpolation coefficient kyReduced image L by product-sum calculation with [4]clInterpolation value L at the interpolation position p ofcl(P) is calculated using the following equation (3).
[Equation 3]
Figure 0004214457
... (3)
[0075]
Returning to FIG. Based on the representative value γ input from the tone curve correction unit 21, the gain setting unit 23 performs the brightness L of the smoothed image in the contrast correction unit 24.clA gain value g (p) for adjusting a correction amount when correcting the contrast of (p) is calculated for each pixel position and output to the contrast correction unit 24.
[0076]
Here, the gain value g (p) will be described. When the gain value g (p) = 1, the contrast correction unit 24 does not enhance or suppress the contrast. When the gain value g (p)> 1, the contrast is enhanced corresponding to the value. On the other hand, when the gain value g (p) <1, the contrast is suppressed corresponding to the value.
[0077]
An outline of gain value setting will be described. Tone curve correction image LcIs already suppressed by tone compression by tone curve correction, but the amount of suppression depends on the slope of the tone curve. For example, if a tone curve with a small inclination is applied so as to perform strong gradation compression, the suppression of contrast is also strong. For example, if a straight line having an inclination of 1 is applied as the tone curve, the image does not change, that is, the contrast is not suppressed.
[0078]
Therefore, in the gain value setting unit 23, when the representative value γ of the tone curve slope is smaller than 1, the reciprocal 1 / γ of the representative value γ of the tone curve slope is set so that the gain value is larger than 1. Adopted as a gain value.
[0079]
The input tone curve corrected luminance LcIs close to the white level or the black level, if contrast enhancement similar to that in the intermediate luminance region is performed, clipping occurs and the image details are lost.cAs the value approaches the white level or the black level, the gain value approaches 1.
[0080]
That is, the reciprocal 1 / γ = g of the representative value γ0The gain value g (p) is calculated as in the following equation (4).
Figure 0004214457
Here, attn (p) is an attenuation coefficient, and is calculated using the following equation (5).
[Expression 4]
Figure 0004214457
... (5)
[0081]
In equation (5), LgrayIndicates moderate gray level brightness and LwhiteIndicates the brightness of the white clip level (maximum white level), both of which are preset constants.
[0082]
FIG. 11 shows a configuration example of the gain value setting unit 23. The divider 81 is a reciprocal 1 / γ = g of the representative value γ input from the previous stage.0Is calculated and output to the subtractor 82. The subtractor 82 (g0-1) is calculated and output to the multiplier 88.
[0083]
The subtractor 83 generates the tone curve corrected image LcBrightness and moderate gray level brightness LgrayDifference (Lc-Lgray) And output to the divider 85. The subtractor 84 generates a white clip level luminance LwhiteAnd luminance LgrayDifference (Lwhite-Lgray) And output to the divider 85. The divider 85 outputs the output (Lc-Lgray) Is output from the subtractor 84 (Lwhite-Lgray) And output to the absolute value calculator 86. The absolute value calculator 86 calculates the absolute value of the output of the divider 85 and outputs it to the clipper 87. The clipper 87 clips the value to 1 when the output of the absolute value calculator 86 exceeds 1, and when the output of the absolute value calculator 86 does not exceed 1, the clipper 87 keeps the value as it is and attn (p) To the multiplier 88.
[0084]
Multiplier 88 multiplies the output of subtractor 82 by the output of clipper 87 and outputs the result to adder 89. The adder 89 adds 1 to the output of the multiplier 88 and outputs the calculation result as a gain value g (p) to the subsequent stage.
[0085]
Returning to FIG. The contrast correction unit 24 receives the gain value g (p) of each pixel position p input from the gain value setting unit 23 and the brightness L of the smoothed image input from the smoothed brightness generation unit 22.clBased on (p), the tone curve corrected image L whose contrast is weakenedcTone compression image L with enhanced contrastuIs generated.
[0086]
FIG. 12 shows a configuration example of the contrast correction unit 24. The subtractor 91 of the contrast correction unit 24 performs tone curve correction image LcLuminance L of each pixelc(P) and the brightness of the corresponding pixel of the smoothed image (that is, the interpolation value L of the reduced image)cl(P)) and the difference (Lc(P) -Lcl(P)) is calculated and output to the multiplier 92. The multiplier 92 calculates the product of the output of the subtractor 91 and the gain value g (p) input from the gain value setting unit 23 and outputs the product to the adder 93. The adder 93 outputs the luminance of the pixel of the smoothed image (interpolated value L of the reduced image) to the output of the multiplier 92.cl(P)) is added and the resulting luminance Lu(P) is a tone-compressed image L with contrast corrected.uIs output to the subsequent stage as the luminance of the pixels constituting the.
[0087]
Note that the brightness of the pixel of the smoothed image (interpolated value L of the reduced image)cl(P)) is a reduced image L of m × n pixels.clTone curve corrected image L before reductioncIt has only very low frequency components.
[0088]
Accordingly, the output of the subtractor 91 (Lc(P) -Lcl(P)) is the original tone curve corrected image logLcFrom which only the very low frequency components are subtracted. In this way, the luminance signal is separated into a very low frequency component and other components, and a component other than the low frequency component (the output of the subtractor 91) is multiplied by the gain value g (p). , And then synthesized again by the adder 93 is the brightness L of the tone-compressed image with the contrast corrected.u(P).
[0089]
As described above, the contrast correction unit 24 emphasizes the components from the low to medium frequency range to the high frequency range except the very low frequency range with the same gain value g (p). Accordingly, the brightness L of the gradation-compressed image with the contrast corrected.uIn (p), the local overshoot of the edge portion, which is noticeable when only the high frequency region is emphasized, does not occur, and an image in which the contrast is emphasized naturally is obtained.
[0090]
Next, details of the tone-compressed image generation process (that is, the process of step S2 described above with reference to the flowchart of FIG. 2) according to the first configuration example of the image processing apparatus 10 will be described with reference to the flowchart of FIG. explain.
[0091]
In step S11, the tone curve correction unit 21 corrects the luminance of the wide DR image L input from the video camera 2 based on a LUT prepared in advance, and the tone curve correction image L obtained as a result thereof.cIs output to the smoothed luminance generation unit 22, the gain value setting unit 23, and the contrast correction unit 24. Further, the tone curve correction unit 21 outputs a representative value γ indicating the slope of the tone curve used for the correction to the gain value setting unit 23.
[0092]
In step S12, the smoothed luminance generation unit 22 performs the tone curve correction image L.cTo reduce the reduced image LclAnd a reduced image LclThe luminance L of the pixel of the smoothed image is obtained by interpolation using the pixels ofcl(P) is calculated and output to the contrast correction unit 24.
[0093]
In step S <b> 13, the gain setting unit 23 determines the brightness L of the smoothed image in the contrast correction unit 24 based on the representative value γ input from the tone curve correction unit 21.clA gain value g (p) for adjusting a correction amount when correcting the contrast of (p) is calculated for each pixel position and output to the contrast correction unit 24.
[0094]
In addition, the process of step S12 and the process of step S13 can be implemented in parallel.
[0095]
In step S <b> 14, the contrast correction unit 24 receives the gain value g (p) of each pixel position p input from the gain value setting unit 23 and the luminance L of the smoothed image input from the smoothed luminance generation unit 22.clBased on (p), the tone curve corrected image LcIs corrected, and the gradation compressed image L is corrected.uLuminance L of the pixelu(P) is calculated. The tone-compressed image L with the contrast corrected obtained in this way.uIn this case, the local overshoot of the edge portion, which is conspicuous when only the high frequency region is emphasized, does not occur, and the image is enhanced with natural contrast. Above, description of the gradation compression image generation process by the 1st structural example of the image processing apparatus 10 is complete | finished.
[0096]
Next, FIG. 14 shows a second configuration example of the image processing apparatus 10. In the second configuration example, a logarithmic conversion unit 101 that performs logarithmic conversion on the luminance of the wide DR image L input from the video camera 1 is arranged on the upper stage of the tone curve correction unit 21 of the first configuration example shown in FIG. Furthermore, a logarithmic inverse conversion unit 102 that performs logarithmic inverse conversion of the output of the contrast correction unit 24 is provided in the lower stage of the contrast correction unit 24 of the first configuration example.
[0097]
The constituent elements other than the logarithmic conversion unit 101 and the logarithmic inverse conversion unit 102 constituting the second configuration example of the image processing apparatus 10 are the same as those in the first configuration example of FIG. The description thereof is omitted as appropriate. However, in the second configuration example, the tone curve correction unit 21 to the contrast correction unit 24 process the logarithmically converted luminance.
[0098]
FIG. 15 is an example of a tone curve applied by the tone curve correction unit 21 in the second configuration example. The horizontal axis represents the luminance of the wide DR image L, and the vertical axis represents the tone curve corrected image L.cAre normalized to [0, 1] and displayed on a logarithmic axis. As shown in this example, when a tone curve that is monotonically increasing and has a gentle inverted S-shape is applied, gradation compression does not work very strongly in the high luminance region and the low luminance region. A good color tone with little black blur is obtained. On the contrary, gradation compression works strongly in the intermediate luminance range, but because of that, contrast correction is sufficiently applied to the intermediate luminance range, so good gradation compression without contrast deterioration even in the intermediate luminance range Image LuCan be obtained. In the case of the tone curve shown in FIG. 15, the representative value γ = 0.67.
[0099]
Next, details of the gradation compressed image generation processing according to the second configuration example of the image processing apparatus 10 will be described with reference to the flowchart of FIG.
[0100]
In step S <b> 21, the logarithmic conversion unit 101 performs logarithmic conversion on the luminance of the wide DR image L input from the video camera 2, and outputs the logarithmic wide DR image logL obtained as a result to the tone curve correction unit 21.
[0101]
In step S22, the tone curve correction unit 21 corrects the brightness of the logarithmic wide DR image logL based on a LUT prepared in advance, for example, corresponding to the tone curve shown in FIG. Logarithmic tone curve correction image logLcIs output to the smoothed luminance generation unit 22, the gain value setting unit 23, and the contrast correction unit 24. Further, the tone curve correction unit 21 outputs a representative value γ indicating the slope of the tone curve used for the correction to the gain value setting unit 23.
[0102]
In step S23, the smoothed luminance generation unit 22 performs logarithmic tone curve correction image logL.cLogarithmically reduced logLclAnd logarithmically reduced image logLclThe luminance of the logarithm smoothed image pixel logLcl(P) is calculated and output to the contrast correction unit 24.
[0103]
In step S24, the gain setting unit 23 determines the luminance logL of the logarithmically smoothed image in the contrast correction unit 24 based on the representative value γ input from the tone curve correction unit 21.clA gain value g (p) for adjusting a correction amount when correcting the contrast of (p) is calculated for each pixel position and output to the contrast correction unit 24.
[0104]
In addition, the process of step S23 and the process of step S24 can be implemented in parallel.
[0105]
In step S <b> 25, the contrast correction unit 24 receives the gain value g (p) of each pixel position p input from the gain value setting unit 23 and the luminance logL of the logarithmically smoothed image input from the smoothed luminance generation unit 22.clBased on (p), the logarithmic tone curve corrected image logLcLogarithmic gradation compressed image logLuLuminance of pixel logLu(P) is calculated and output to the logarithmic inverse transform unit 102.
[0106]
In step S26, the logarithmic inverse transformation unit 102 performs logarithmic gradation compression image logL.uLuminance of pixel logLuThe logarithm inverse transformation of (p) and the resulting Lu(P) represents the gradation compressed image LuIs output as the luminance of the pixel.
[0107]
The tone-compressed image L with the contrast corrected obtained in this way.uIn the high luminance region and the low luminance region, gradation compression does not work so strongly, and therefore, even after gradation compression, a good color tone with little white and black blurring is obtained. Conversely, tone compression works strongly in the intermediate luminance range, but since the contrast correction is sufficiently applied to the intermediate luminance range, a good image with no contrast deterioration is obtained even in the intermediate luminance range. . Above, description of the gradation compression image generation process by the 2nd structural example of the image processing apparatus 10 is complete | finished.
[0108]
As described above, according to the image processing apparatus 10 according to an embodiment of the present invention, a large amount of memory (used as a delay line for frame memories and pixel series data, which is necessary for conventional gradation compression technology). And a wide DR image having a wider dynamic range than usual can be displayed on the display 11 having a narrower dynamic range of displayable brightness without impairing the appearance. It is possible to convert to a gradation compressed image. In addition, it is possible to obtain a gradation-compressed image that is not inferior to the gradation compression process that has been realized with a large filter process.
[0109]
Of course, the image processing apparatus 10 can convert the wide DR image into a gradation compressed image by adapting the wide DR image to a dynamic range that can be expressed by a printer or projector other than the display 11.
[0110]
The present invention can be applied to, for example, an image signal processing circuit incorporated in an expression device such as a display, a printer, or a projector, in addition to a photographing device of a digital video camera or a digital still camera.
[0111]
By the way, the series of processes described above can be executed by hardware, but can also be executed by software. When a series of processing is executed by software, a program constituting the software may execute various functions by installing a computer incorporated in dedicated hardware or various programs. For example, it is installed from a recording medium in a general-purpose personal computer or the like.
[0112]
FIG. 17 shows a configuration example of a general-purpose personal computer. The personal computer 120 includes a CPU (Central Processing Unit) 121. An input / output interface 125 is connected to the CPU 121 via the bus 124. A ROM (Read Only Memory) 122 and a RAM (Random Access Memory) 123 are connected to the bus 124.
[0113]
The input / output interface 125 includes an input unit 126 including an input device such as a keyboard and a mouse for a user to input an operation command, an output unit 127 for outputting a processing operation screen and an image of the processing result to a display device, a program and various data. An I / O interface 129 that communicates image data with a storage unit 128 including a hard disk drive and the like, a video camera 2 and the like is connected. Also, a magnetic disk 131 (including a flexible disk), an optical disk 132 (including a CD-ROM (Compact Disc-Read Only Memory), a DVD (Digital Versatile Disc)), and a magneto-optical disk 133 (including an MD (Mini Disc)). Alternatively, a drive 130 for reading / writing data from / to a recording medium such as the semiconductor memory 134 is connected.
[0114]
The CPU 121 executes various processes according to a program stored in the ROM 122 or a program read from the magnetic disk 131 to the semiconductor memory 134 and installed in the storage unit 128 and loaded from the storage unit 128 to the RAM 123. The RAM 123 also appropriately stores data necessary for the CPU 121 to execute various processes.
[0115]
In the present specification, the step of describing the program recorded on the recording medium is not limited to the processing performed in time series according to the described order, but is not necessarily performed in time series, either in parallel or individually. The process to be executed is also included.
[0116]
Further, in this specification, the system represents the entire apparatus constituted by a plurality of apparatuses.
[0117]
【The invention's effect】
As described above, according to the present invention, the capacity of a memory to be used is smaller, the amount of calculation is small, hardware implementation is easy, and the contrast of an image that is appropriately tone-compressed is emphasized. Is possible.
[Brief description of the drawings]
FIG. 1 is a block diagram illustrating a configuration example of an image processing system to which the present invention is applied.
FIG. 2 is a flowchart for explaining the operation of the image processing system shown in FIG. 1;
FIG. 3 is a block diagram illustrating a first configuration example of the image processing apparatus illustrated in FIG. 1;
4 is a block diagram illustrating a configuration example of a tone curve correction unit illustrated in FIG. 3;
FIG. 5 is a diagram illustrating an example of a tone curve used in the first configuration example of the image processing apparatus.
6 is a block diagram illustrating a configuration example of a smoothed luminance generation unit illustrated in FIG. 3;
7 is a block diagram illustrating a configuration example of a reduced image generation unit illustrated in FIG. 6;
8 is a block diagram illustrating a configuration example of an average value calculation unit illustrated in FIG. 7;
9 is a block diagram illustrating a configuration example of an interpolation unit illustrated in FIG. 6;
10 is a diagram for explaining processing of an interpolation unit shown in FIG. 6;
11 is a block diagram illustrating a configuration example of a gain value setting unit illustrated in FIG. 3;
12 is a block diagram illustrating a configuration example of a contrast correction unit illustrated in FIG. 3;
FIG. 13 is a flowchart illustrating a gradation compressed image generation process according to the first configuration example of the image processing apparatus.
14 is a block diagram illustrating a second configuration example of the image processing apparatus illustrated in FIG. 1. FIG.
FIG. 15 is a diagram illustrating an example of a tone curve used in the second configuration example of the image processing apparatus.
FIG. 16 is a flowchart illustrating a gradation compressed image generation process according to the second configuration example of the image processing apparatus.
FIG. 17 is a block diagram illustrating a configuration example of a general-purpose personal computer.
[Explanation of symbols]
DESCRIPTION OF SYMBOLS 1 Image processing system, 2 Video camera, 5 CCD image sensor, 10 Image processing apparatus, 11 Display, 21 Tone curve correction part, 22 Smoothing luminance production | generation part, 23 Gain value setting part, 24 Contrast correction part, 101 Logarithm conversion part , 102 logarithmic inverse conversion unit, 121 CPU, 131 magnetic disk, 132 optical disk, 133 magneto-optical disk, 134 semiconductor memory

Claims (9)

画像のコントラストを補正する画像処理装置において、
入力された画像の画素値を、予め用意されているトーンカーブに基づいて、階調を圧縮する方向に補正することにより、トーンカーブ補正画像を生成するトーンカーブ補正手段と、
前記トーンカーブ補正画像の画素の輝度Lcを平滑化して、平滑化画像を生成する平滑化手段と、
前記トーンカーブ補正画像の画素の輝度Lc、前記平滑化画像を構成する画素の輝度Ll、および前記トーンカーブの傾きの逆数を利用して設定されたゲイン値gに基づき、コントラスト補正画像を生成するコントラスト補正手段とを含み、
前記平滑化手段は、
入力された前記トーンカーブ補正画像を縮小して、縮小画像を生成する縮小手段と、
前記縮小画像を構成する画素を用いた補間演算により、前記平滑化画像の画素の輝度Llを演算する補間手段と
を含む画像処理装置。
In an image processing apparatus for correcting the contrast of an image,
Tone curve correction means for generating a tone curve corrected image by correcting the pixel value of the input image in the direction of compressing gradation based on a tone curve prepared in advance;
Smoothing means for smoothing the luminance L c of the pixels of the tone curve corrected image to generate a smoothed image;
A contrast-corrected image is obtained on the basis of a gain value g set using the luminance L c of the pixel of the tone curve corrected image, the luminance L l of the pixel constituting the smoothed image, and the inverse of the slope of the tone curve. A contrast correcting means for generating,
The smoothing means includes
Reduction means for reducing the input tone curve correction image and generating a reduced image;
An image processing apparatus comprising: interpolation means for calculating a luminance L l of a pixel of the smoothed image by an interpolation calculation using pixels constituting the reduced image.
前記コントラスト補正手段は、前記コントラスト補正画像を構成する画素の輝度Luを、次式
u=g・(Lc−Ll)+Ll
に基づいて算出する
請求項1に記載の画像処理装置。
The contrast correction means calculates the luminance L u of the pixels constituting the contrast corrected image by the following formula: L u = g · (L c −L l ) + L l
The image processing device according to claim 1, wherein the image processing device is calculated based on the image processing device.
前記縮小手段は、入力された前記トーンカーブ補正画像を複数のブロックに分割し、各ブロックに属する画素の輝度の平均値を計算して、前記平均値を画素の輝度とする、前記ブロックの数と同数の画素から構成される前記縮小画像を生成する
請求項1に記載の画像処理装置。
The reduction means divides the input tone curve correction image into a plurality of blocks, calculates an average value of luminance of pixels belonging to each block, and sets the average value as the luminance of the pixel. The image processing apparatus according to claim 1, wherein the reduced image including the same number of pixels is generated.
前記補間手段は、前記平滑化手段によって補間される画素の位置である補間位置に対応する前記縮小画像上の位置を特定し、特定した前記位置の近傍に存在する前記縮小画像の画素を用いて、前記平滑化画像の画素の輝度Llを演算する
請求項1に記載の画像処理装置。
The interpolation unit specifies a position on the reduced image corresponding to the interpolation position which is a pixel position to be interpolated by the smoothing unit, and uses the pixels of the reduced image existing in the vicinity of the specified position. The image processing apparatus according to claim 1, wherein a luminance L l of a pixel of the smoothed image is calculated.
前記補間手段は、前記平滑化手段によって補間される画素の位置である補間位置に対応する前記縮小画像上の位置を特定し、特定した前記位置の近傍に存在する前記縮小画像の4×4画素を用いた双3次補間により、前記平滑化画像の画素の輝度Llを演算する
請求項4に記載の画像処理装置。
The interpolation means specifies a position on the reduced image corresponding to an interpolation position which is a position of a pixel to be interpolated by the smoothing means, and 4 × 4 pixels of the reduced image existing in the vicinity of the specified position The image processing apparatus according to claim 4, wherein a luminance L l of a pixel of the smoothed image is calculated by bicubic interpolation using the.
前記平滑化手段に入力する前の前記トーンカーブ補正画像を構成する画素の輝度Lcを対数変換する対数変換手段と、
前記コントラスト補正手段によって出力された前記コントラスト補正画像を構成する画素の輝度を対数逆変換する対数逆変換手段と
をさらに含む請求項1に記載の画像処理装置。
Logarithmic conversion means for logarithmically converting the luminance L c of the pixels constituting the tone curve corrected image before being input to the smoothing means;
The image processing apparatus according to claim 1, further comprising: a logarithmic inverse conversion unit that performs logarithmic inverse conversion on a luminance of a pixel constituting the contrast correction image output by the contrast correction unit.
画像のコントラストを補正する画像処理方法において、
入力された画像の画素値を、予め用意されているトーンカーブに基づいて、階調を圧縮する方向に補正することにより、トーンカーブ補正画像を生成するトーンカーブ補正ステップと、
前記トーンカーブ補正画像の画素の輝度Lcを平滑化して、平滑化画像を生成する平滑化ステップと、
前記トーンカーブ補正画像の画素の輝度Lc、前記平滑化画像を構成する画素の輝度Ll、および前記トーンカーブの傾きの逆数を利用して設定されたゲイン値gに基づき、コントラスト補正画像を生成するコントラスト補正ステップとを含み、
前記平滑化ステップの処理は、
入力された前記トーンカーブ補正画像を縮小して、縮小画像を生成する縮小ステップと、
前記縮小画像を構成する画素を用いた補間演算により、前記平滑化画像の画素の輝度Llを演算する補間ステップと
を含む画像処理方法。
In an image processing method for correcting the contrast of an image,
A tone curve correction step for generating a tone curve corrected image by correcting the pixel value of the input image based on a tone curve prepared in advance in a direction in which gradation is compressed;
A smoothing step of smoothing a luminance L c of a pixel of the tone curve corrected image to generate a smoothed image;
A contrast-corrected image is obtained on the basis of a gain value g set using the luminance L c of the pixel of the tone curve corrected image, the luminance L l of the pixel constituting the smoothed image, and the inverse of the slope of the tone curve. Generating a contrast correction step,
The process of the smoothing step is
A reduction step of reducing the input tone curve correction image to generate a reduced image;
An image processing method comprising: an interpolation step of calculating a luminance L l of a pixel of the smoothed image by an interpolation calculation using pixels constituting the reduced image.
入力された画像の画素値を、予め用意されているトーンカーブに基づいて、階調を圧縮する方向に補正することにより、トーンカーブ補正画像を生成するトーンカーブ補正ステップと、
前記トーンカーブ補正画像の画素の輝度Lcを平滑化して、平滑化画像を生成する平滑化ステップと、
前記トーンカーブ補正画像の画素の輝度Lc、前記平滑化画像を構成する画素の輝度Ll、および前記トーンカーブの傾きの逆数を利用して設定されたゲイン値gに基づき、コントラスト補正画像を生成するコントラスト補正ステップとを含み、
前記平滑化ステップの処理は、
入力された前記トーンカーブ補正画像を縮小して、縮小画像を生成する縮小ステップと、
前記縮小画像を構成する画素を用いた補間演算により、前記平滑化画像の画素の輝度Llを演算する補間ステップと
を含む処理をコンピュータに実行させるプログラムが記録されている記録媒体。
A tone curve correction step for generating a tone curve corrected image by correcting the pixel value of the input image based on a tone curve prepared in advance in a direction in which gradation is compressed;
A smoothing step of smoothing a luminance L c of a pixel of the tone curve corrected image to generate a smoothed image;
A contrast-corrected image is obtained on the basis of a gain value g set using the luminance L c of the pixel of the tone curve corrected image, the luminance L l of the pixel constituting the smoothed image, and the inverse of the slope of the tone curve. Generating a contrast correction step,
The process of the smoothing step is
A reduction step of reducing the input tone curve correction image to generate a reduced image;
A recording medium on which a program for causing a computer to execute a process including an interpolation step of calculating a luminance L l of a pixel of the smoothed image by an interpolation calculation using pixels constituting the reduced image is recorded.
入力された画像の画素値を、予め用意されているトーンカーブに基づいて、階調を圧縮する方向に補正することにより、トーンカーブ補正画像を生成するトーンカーブ補正ステップと、
前記トーンカーブ補正画像の画素の輝度Lcを平滑化して、平滑化画像を生成する平滑化ステップと、
前記トーンカーブ補正画像の画素の輝度Lc、前記平滑化画像を構成する画素の輝度Ll、および前記トーンカーブの傾きの逆数を利用して設定されたゲイン値gに基づき、コントラスト補正画像を生成するコントラスト補正ステップとを含み、
前記平滑化ステップの処理は、
入力された前記トーンカーブ補正画像を縮小して、縮小画像を生成する縮小ステップと、
前記縮小画像を構成する画素を用いた補間演算により、前記平滑化画像の画素の輝度Llを演算する補間ステップと
を含む処理をコンピュータに実行させるプログラム。
A tone curve correction step for generating a tone curve corrected image by correcting the pixel value of the input image based on a tone curve prepared in advance in a direction in which gradation is compressed;
A smoothing step of smoothing a luminance L c of a pixel of the tone curve corrected image to generate a smoothed image;
A contrast-corrected image is obtained on the basis of a gain value g set using the luminance L c of the pixel of the tone curve corrected image, the luminance L l of the pixel constituting the smoothed image, and the inverse of the slope of the tone curve. Generating a contrast correction step,
The process of the smoothing step is
A reduction step of reducing the input tone curve correction image to generate a reduced image;
A program for causing a computer to execute a process including an interpolation step of calculating a luminance L l of a pixel of the smoothed image by an interpolation calculation using pixels constituting the reduced image.
JP2003003134A 2003-01-09 2003-01-09 Image processing apparatus and method, recording medium, and program Expired - Fee Related JP4214457B2 (en)

Priority Applications (6)

Application Number Priority Date Filing Date Title
JP2003003134A JP4214457B2 (en) 2003-01-09 2003-01-09 Image processing apparatus and method, recording medium, and program
CNB2003801004014A CN100366052C (en) 2003-01-09 2003-12-10 Image processing device and method
US10/507,274 US7570390B2 (en) 2003-01-09 2003-12-10 Image processing device and method
EP03778755A EP1494462A4 (en) 2003-01-09 2003-12-10 Image processing device and method
PCT/JP2003/015758 WO2004064388A1 (en) 2003-01-09 2003-12-10 Image processing device and method
KR1020047014084A KR101051604B1 (en) 2003-01-09 2003-12-10 Image processing apparatus and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003003134A JP4214457B2 (en) 2003-01-09 2003-01-09 Image processing apparatus and method, recording medium, and program

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2008150629A Division JP4632100B2 (en) 2008-06-09 2008-06-09 Image processing apparatus, image processing method, recording medium, and program

Publications (2)

Publication Number Publication Date
JP2004221644A JP2004221644A (en) 2004-08-05
JP4214457B2 true JP4214457B2 (en) 2009-01-28

Family

ID=32894487

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003003134A Expired - Fee Related JP4214457B2 (en) 2003-01-09 2003-01-09 Image processing apparatus and method, recording medium, and program

Country Status (2)

Country Link
JP (1) JP4214457B2 (en)
CN (1) CN100366052C (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2541497A1 (en) 2011-06-28 2013-01-02 Dai Nippon Printing Co., Ltd. Image processing apparatus, image processing method, image processing program, and recording medium
US8422815B2 (en) 2009-10-30 2013-04-16 Dai Nippon Printing Co., Ltd. Image processing apparatus, image processing method and image processing program

Families Citing this family (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101142810B (en) * 2005-03-15 2010-09-01 欧姆龙株式会社 Image processor, image processing method, image processing system
WO2006098356A1 (en) * 2005-03-15 2006-09-21 Omron Corporation Image processor, image processing method, program and recording medium
WO2006137361A1 (en) * 2005-06-20 2006-12-28 Nikon Corporation Image processing device, image processing method, image processing program product, and imaging device
US7426312B2 (en) * 2005-07-05 2008-09-16 Xerox Corporation Contrast enhancement of images
JP4687320B2 (en) 2005-08-11 2011-05-25 ソニー株式会社 Image processing apparatus and method, recording medium, and program
JP4992379B2 (en) * 2005-10-24 2012-08-08 株式会社ニコン Image gradation conversion apparatus, program, electronic camera, and method thereof
JP2007295373A (en) * 2006-04-26 2007-11-08 Matsushita Electric Ind Co Ltd Image processing device, method, and program
JP5003196B2 (en) 2007-02-19 2012-08-15 ソニー株式会社 Image processing apparatus and method, and program
JP4950784B2 (en) * 2007-07-06 2012-06-13 キヤノン株式会社 Image forming apparatus and control method thereof
KR20100099686A (en) 2007-12-04 2010-09-13 소니 주식회사 Image processing device and method, program, and recording medium
TWI385638B (en) * 2007-12-21 2013-02-11 Wintek Corp Method for processing image, method and device for converting data of image
CN101546423B (en) * 2008-03-24 2011-05-04 鸿富锦精密工业(深圳)有限公司 Device and method for image interception
CN101588436B (en) * 2008-05-20 2013-03-27 株式会社理光 Method, device and digital camera for compressing dynamic range of original image
EP3364647B1 (en) * 2008-07-17 2023-10-11 Nikon Corporation Imaging apparatus, image processing program, image processing apparatus, and image processing method
JP5569042B2 (en) * 2010-03-02 2014-08-13 株式会社リコー Image processing apparatus, imaging apparatus, and image processing method
WO2012017946A1 (en) * 2010-08-04 2012-02-09 日本電気株式会社 Image processing method, image processing device and image processing program
JP5852385B2 (en) * 2011-09-26 2016-02-03 キヤノン株式会社 Imaging device
JP5820213B2 (en) * 2011-09-26 2015-11-24 キヤノン株式会社 Image processing apparatus and method, and imaging apparatus
JP5815386B2 (en) 2011-12-02 2015-11-17 富士フイルム株式会社 Image processing apparatus, image processing method, and program
JP2015139082A (en) 2014-01-22 2015-07-30 ソニー株式会社 Image processor, image processing method, program and electronic apparatus
JP6309777B2 (en) * 2014-02-10 2018-04-11 シナプティクス・ジャパン合同会社 Display device, display panel driver, and display panel driving method
EP3054418A1 (en) * 2015-02-06 2016-08-10 Thomson Licensing Method and apparatus for processing high dynamic range images
WO2018150627A1 (en) * 2017-02-16 2018-08-23 オリンパス株式会社 Image processing device, image processing method, and image processing program
JP2019028537A (en) 2017-07-26 2019-02-21 キヤノン株式会社 Image processing apparatus and image processing method

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000137805A (en) * 1998-10-29 2000-05-16 Canon Inc Processor and method for image processing
JP4056670B2 (en) * 2000-01-31 2008-03-05 富士フイルム株式会社 Image processing method
JP2002016939A (en) * 2000-04-28 2002-01-18 Fuji Photo Film Co Ltd Method and apparatus for processing image as well as recording medium
JP2002238016A (en) * 2001-02-07 2002-08-23 Minolta Co Ltd Image processor, image processing system, image processing method, image processing program, and computer- readable recording medium recorded with the image processing program
JP3507039B2 (en) * 2001-03-07 2004-03-15 株式会社ナムコ PROGRAM, INFORMATION STORAGE MEDIUM, AND GAME DEVICE

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8422815B2 (en) 2009-10-30 2013-04-16 Dai Nippon Printing Co., Ltd. Image processing apparatus, image processing method and image processing program
EP2541497A1 (en) 2011-06-28 2013-01-02 Dai Nippon Printing Co., Ltd. Image processing apparatus, image processing method, image processing program, and recording medium
US8744207B2 (en) 2011-06-28 2014-06-03 Dai Nippon Printing Co., Ltd. Image processing device, image processing method, image processing program and recording medium

Also Published As

Publication number Publication date
CN1692629A (en) 2005-11-02
JP2004221644A (en) 2004-08-05
CN100366052C (en) 2008-01-30

Similar Documents

Publication Publication Date Title
JP4214457B2 (en) Image processing apparatus and method, recording medium, and program
KR101051604B1 (en) Image processing apparatus and method
JP4894595B2 (en) Image processing apparatus and method, and program
JP4595330B2 (en) Image processing apparatus and method, recording medium, and program
JP4687320B2 (en) Image processing apparatus and method, recording medium, and program
JP5003196B2 (en) Image processing apparatus and method, and program
JP4577621B2 (en) Image correction processing system and image correction processing method
US8411991B2 (en) Image processing apparatus, image processing method, and program
JP4556276B2 (en) Image processing circuit and image processing method
US8208039B2 (en) Image processing apparatus and computer-readable medium
JP2008177801A (en) Imaging apparatus, noise removing device, noise removal method, program for noise removal method, and recording medium with program for noise removal method recorded thereon
JP4479527B2 (en) Image processing method, image processing apparatus, image processing program, and electronic camera
US7561189B2 (en) Method and apparatus of image dynamic response re-mapping and digital camera using the same
JP3208762B2 (en) Image processing apparatus and image processing method
JP4161719B2 (en) Image processing apparatus and method, recording medium, and program
JP2007180851A (en) Gray scale transformation device, program and method for raw image, and electronic camera
JP2005004510A (en) Image processing program
JP2011015277A (en) Image processing device, image processing method, image processing program, and recording medium recording image processing program
JP4632100B2 (en) Image processing apparatus, image processing method, recording medium, and program
JP2020145553A (en) Image processing apparatus, image processing method and program
JP2015211320A (en) Image processing apparatus, control method thereof and program
JP2000149014A (en) Image processor and image processing method
JP2012010227A (en) Image processing apparatus, and image processing method
JP6628925B2 (en) Image display device and control method thereof
JP2021048522A (en) Image processing apparatus and image processing method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20051220

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080410

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080609

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20080710

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080908

A911 Transfer to examiner for re-examination before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20080919

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20081009

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20081022

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20111114

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121114

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20131114

Year of fee payment: 5

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees