JP2004297439A - Image correction method, apparatus, and program - Google Patents

Image correction method, apparatus, and program Download PDF

Info

Publication number
JP2004297439A
JP2004297439A JP2003086953A JP2003086953A JP2004297439A JP 2004297439 A JP2004297439 A JP 2004297439A JP 2003086953 A JP2003086953 A JP 2003086953A JP 2003086953 A JP2003086953 A JP 2003086953A JP 2004297439 A JP2004297439 A JP 2004297439A
Authority
JP
Japan
Prior art keywords
correction
condition
image
target image
correction target
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.)
Granted
Application number
JP2003086953A
Other languages
Japanese (ja)
Other versions
JP4057939B2 (en
Inventor
Yoshihiro Yamaguchi
義弘 山口
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.)
Fujifilm Holdings Corp
Original Assignee
Fuji Photo Film Co Ltd
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 Fuji Photo Film Co Ltd filed Critical Fuji Photo Film Co Ltd
Priority to JP2003086953A priority Critical patent/JP4057939B2/en
Publication of JP2004297439A publication Critical patent/JP2004297439A/en
Application granted granted Critical
Publication of JP4057939B2 publication Critical patent/JP4057939B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide an image correction method, apparatus, and program capable of properly correcting the density or the like of an image whose dynamic range is extremely small. <P>SOLUTION: An image correction processing includes: a step 100 of interleaving image data of a processing object in units of pixels to generate reduced image data; a step 102 of generating histograms of R, G, B, Y, Cb and Cr; a step 104 of thereafter obtaining a color balance correction amount; steps 106 to 120 of extracting a principal region in the image to obtain a density correction condition; a step 122 of obtaining a saturation correction amount; a step 124 of setting a first correction condition; a step 126 of extracting the density of a highlight point from the histograms of R, G, B and extracting a gradation value at a shadow point from the histogram of Y; a step 130 of setting a second correction condition from them; a step 132 of obtaining the dynamic range of the image; a step 134 of using a weight correction set in response to the dynamic range to generate conversion data equivalent to the weighted average between the first correction condition and the second correction condition and converting the image data of the processing object by means of a 3D-LUT by using the generated conversion data. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

【0001】
【発明の属する技術分野】
本発明は画像補正装置、方法及びプログラムに係り、特に、画像の濃度及び色バランスを補正するための画像補正方法、該画像補正方法を適用可能な画像補正装置、及び、コンピュータを前記画像補正装置として機能させるためのプログラムに関する。
【0002】
【従来の技術】
カメラやデジタルスチルカメラ(DSC)等の撮影装置を用いて任意の被写体を撮影することで得られた画像の濃度や色バランスを補正するための補正方法としては、従来より種々の補正方法が提案されており、例えば補正対象の画像から標準濃度領域の平均濃度を算出すると共に、補正対象の画像から抽出した主要画像部分の平均濃度及び面積率を算出し、算出結果に基づいて補正対象の画像の代表濃度を算出し、算出した代表濃度が目標濃度となるように濃度補正曲線を定め、該濃度補正曲線に基づいて補正対象の画像の濃度を補正する技術が提案されている(例えば特許文献1を参照)。
【0003】
【特許文献1】
特開2002−199221号公報
【0004】
【発明が解決しようとする課題】
上記技術は、例えば人物写真では人物の顔が最も注目される等のように、画像の観賞で注目されるのは一定の部分(主要画像部分)であることが殆どであるという事実に基づいており、上記技術を適用することで、大多数の画像については濃度等を適正に補正することができるが、上記技術は、極端な露出不足で撮影された画像等のように、ダイナミックレンジ(最大濃度と最小濃度の差)が非常に小さい画像の濃度等を適正に補正することが困難であるという欠点があった。
【0005】
最近、写真プリントの作成等の写真処理をインターネット経由で依頼する依頼形態が普及してきているが、この依頼形態では、写真フィルムに撮影記録された画像の同時プリントが依頼される場合と同様に、依頼主としての顧客自身により画像の内容が確認されることなく写真処理が依頼されることも多く、写真処理が依頼された画像の中に、上記のようにダイナミックレンジが非常に小さい画像が混在していることも増えてきている。このため、ダイナミックレンジが非常に小さい画像についても濃度等を適正に補正できる補正方式の確立が求められるようになってきている。
【0006】
本発明は上記事実を考慮して成されたもので、ダイナミックレンジが非常に小さい画像の濃度等も適正に補正可能な画像補正装置、画像補正方法及びプログラムを得ることが目的である。
【0007】
【課題を解決するための手段】
本願発明者は、ダイナミックレンジが非常に小さい画像に対し、公知の種々の補正方法を適用して濃度等を補正し、補正結果を評価する実験を行った。その結果、ダイナミックレンジが非常に小さい画像に対しては、画像のハイライトに相当する階調値とシャドーに相当する階調値の差(すなわちダイナミックレンジ)が所定値となるように(元の画像よりも拡大されるように)濃度等を補正する補正方法を適用すれば、画像のダイナミックレンジが拡大されることで濃度等を適正に補正できるとの知見を得、本発明を成すに至った。
【0008】
上記に基づき請求項1記載の発明に係る画像補正装置は、補正対象画像の主要部領域を認識し、認識した主要部領域の特徴量に基づいて前記補正対象画像を補正するための第1の補正条件を演算する第1演算手段と、前記補正対象対象画像におけるハイライトに相当する階調値とシャドーに相当する階調値の差が所定値となるように前記補正対象画像を補正するための第2の補正条件を演算する第2演算手段と、前記補正対象画像のダイナミックレンジに基づいて前記第1の補正条件及び前記第2の補正条件に対する重みを設定する設定手段と、前記設定手段によって設定された重みに基づき、前記補正対象画像に対し、前記第1演算手段によって演算された第1の補正条件での補正と、前記第2演算手段によって演算された第2の補正条件での補正の加重平均に相当する補正を行う補正手段と、を含んで構成されている。
【0009】
請求項1記載の発明に係る第1演算手段は、補正対象画像の主要部領域を認識し、認識した主要部領域の特徴量に基づいて前記補正対象画像を補正するための第1の補正条件を演算する。これにより、ダイナミックレンジが非常に小さい一部の画像を除いた大多数の画像について濃度等を適正に補正できる補正条件(第1の補正条件)を得ることができる。また、請求項1記載の発明に係る第2演算手段は、補正対象対象画像におけるハイライトに相当する階調値とシャドーに相当する階調値の差が所定値となるように(例えば前記階調値の差が元の画像より拡大されるように)補正対象画像を補正するための第2の補正条件を演算する。これにより、ダイナミックレンジが非常に小さい画像について濃度等を適正に補正できる補正条件(第2の補正条件)を得ることができる。
【0010】
また、請求項1記載の発明では、補正対象画像のダイナミックレンジに基づいて、第1の補正条件及び第2の補正条件に対する重みが設定手段によって設定される。なお、上記の重みは、例えば補正対象画像のダイナミックレンジが比較的大きい場合には第1の補正条件に対する重みが大きくなり、ダイナミックレンジが非常に小さい場合には第2の補正条件に対する重みが大きくなるように設定することができる。
【0011】
そして、請求項1記載の発明に係る補正手段は、設定手段によって設定された重みに基づき、第1演算手段によって演算された第1の補正条件での補正と、第2演算手段によって演算された第2の補正条件での補正の加重平均に相当する補正を補正対象画像に対して行う。このように、請求項1記載の発明では、補正対象画像に対する補正の内容(第1の補正条件での補正と第2の補正条件での補正の比重)を、補正対象画像のダイナミックレンジに応じて変化させることができるので、ダイナミックレンジが非常に小さい画像の濃度等も適正に補正することが可能となる。
【0012】
なお、請求項1記載の発明において、第1演算手段は、例えば請求項2に記載したように、補正対象画像のうち彩度が所定値以下の画素群の色座標上での分布に基づいて色バランスの補正条件を設定すると共に、認識した主要部領域の特徴量から求めた補正対象濃度が所定の目標濃度に変換されるように濃度の補正条件を設定し、第1の補正条件として、設定した補正条件で補正対象画像の色バランス及び濃度を補正する補正条件を演算するように構成することができる。これにより、補正対象画像が異種光源による照明下で撮影された画像である場合にも、補正対象画像の色バランスを適正に補正できる補正条件を得ることができ、第1の補正条件として、ダイナミックレンジが非常に小さい一部の画像を除いた大多数の画像の濃度や色バランスを適正に補正できる補正条件を得ることができる。
【0013】
また、請求項1記載の発明において、第2演算手段は、例えば請求項3に記載したように、第2の補正条件として、補正対象画像における各色成分毎のハイライトに相当する階調値が各々第1の所定値になり、補正対象画像におけるシャドーに相当する階調値が第2の所定値となるように補正対象画像を補正する補正条件を演算するように構成することができる。これにより、補正対象画像が異種光源による照明下で撮影された画像である場合にも、補正対象画像の色バランスを適正に補正できる補正条件を得ることができ、第2の補正条件として、ダイナミックレンジが非常に小さい画像の濃度や色バランスを適正に補正できる補正条件を得ることができる。
【0014】
また、請求項1記載の発明において、第1の補正条件及び第2の補正条件は補正演算の演算式等であってもよいが、第1の補正条件及び第2の補正条件が、補正対象画像を変換することで補正対象画像を補正するための変換条件である場合には、補正手段は、例えば請求項4に記載したように、第1の補正条件に相当する変換条件と第2の補正条件に相当する変換条件の加重平均に相当する変換条件を求め、該求めた変換条件に従って補正対象画像を変換することで、前記加重平均に相当する補正を行うように構成することができる。
【0015】
また、請求項4記載の発明において、補正手段は3次元ルックアップテーブルを含んで構成することができ、この場合補正手段は、例えば請求項5に記載したように、求めた変換条件を前記3次元ルックアップテーブルにセットした後に補正対象画像のデータを入力することで補正を行うことができる。これにより、第1の補正条件での補正と第2の補正条件での補正の加重平均に相当する補正を簡単な処理によって実現することができる。
【0016】
請求項6記載の発明に係る画像補正方法は、補正対象画像の主要部領域を認識し、認識した主要部領域の特徴量に基づいて前記補正対象画像を補正するための第1の補正条件を演算し、且つ、前記補正対象対象画像におけるハイライトに相当する階調値とシャドーに相当する階調値の差が所定値となるように前記補正対象画像を補正するための第2の補正条件を演算すると共に、前記補正対象画像のダイナミックレンジに基づいて前記第1の補正条件及び前記第2の補正条件に対する重みを設定し、設定した重みに基づき、前記補正対象画像に対し、前記演算した第1の補正条件での補正と、前記演算した第2の補正条件での補正の加重平均に相当する補正を行うので、請求項1記載の発明と同様に、ダイナミックレンジが非常に小さい画像の濃度等も適正に補正することが可能となる。
【0017】
請求項7記載の発明に係るプログラムは、コンピュータを、補正対象画像の主要部領域を認識し、認識した主要部領域の特徴量に基づいて前記補正対象画像を補正するための第1の補正条件を演算する第1演算手段、前記補正対象対象画像におけるハイライトに相当する階調値とシャドーに相当する階調値の差が所定値となるように前記補正対象画像を補正するための第2の補正条件を演算する第2演算手段、前記補正対象画像のダイナミックレンジに基づいて前記第1の補正条件及び前記第2の補正条件に対する重みを設定する設定手段、前記設定手段によって設定された重みに基づき、前記補正対象画像に対し、前記第1演算手段によって演算された第1の補正条件での補正と、前記第2演算手段によって演算された第2の補正条件での補正の加重平均に相当する補正を行う補正手段として機能させる。
【0018】
請求項7記載の発明に係るプログラムは、コンピュータ(例えばDSC等の撮影装置やその他の機器に内蔵されたコンピュータであってもよい)を、上記の第1演算手段、第2演算手段、設定手段及び補正手段として機能させるプログラムであるので、コンピュータが請求項7記載の発明に係るプログラムを実行することにより、コンピュータが請求項1に記載の画像補正装置として機能することになり、請求項1記載の発明と同様に、ダイナミックレンジが非常に小さい画像の濃度等も適正に補正することが可能となる。
【0019】
【発明の実施の形態】
以下、図面を参照して本発明の実施形態の一例を詳細に説明する。図1には本発明が適用されたカラープリンタ10が示されている。カラープリンタ10は、各感熱発色層を備えた長尺状のカラー感熱記録紙12に画像を記録する構成であり、カラー感熱記録紙12はロール状に巻かれた記録紙ロール13として装置本体11の内部にセットされる。
【0020】
カラー感熱記録紙12は一対の給紙ローラ14によって挟持され、モータ16の駆動力が伝達されて給紙ローラ14が回転されることで下流側へ給紙される。給紙ローラ14の下流側には、複数の発熱素子をライン状に配列した発熱素子アレイ19が取り付けられたサーマルヘッド18が配置されている。サーマルヘッド18は回転軸20を中心として回転可能とされており、図示しないモータの駆動力が伝達されることで、発熱素子アレイ19がカラー感熱記録紙12に圧着する記録位置(破線で示す位置)又はカラー感熱記録紙12から離間する退避位置(実線で示す位置)へ移動される。
【0021】
また、発熱素子アレイ19に対向する部位にはプラテンローラ22が配置されている。プラテンローラ22はカラー感熱記録紙12の搬送に応じて回転し、カラー感熱記録紙12を支持することでカラー感熱記録紙12と発熱素子アレイ19との接触状態の安定性を向上させる。カラー感熱記録紙12への画像記録時、サーマルヘッド18は、プリントデータ(後述)に応じて発熱素子アレイ19の各発熱素子を所定温度に発熱させ、カラー感熱記録紙12の各感熱発色層を選択的に発色させる。
【0022】
サーマルヘッド18の下流側には、画像記録時にカラー感熱記録紙12を搬送するための一対の搬送ローラ26が配置されている。搬送ローラ26はモータ16の駆動力が伝達されて回転される。そして、カラー感熱記録紙12は、給紙ローラ14及び搬送ローラ26により、記録紙ロール13から引き出される給紙方向又は記録紙ロール13に巻き戻される巻戻し方向に搬送される。
【0023】
また、サーマルヘッド18と搬送ローラ26の間には定着装置28が配置されている。定着装置28は、イエロー用紫外線ランプ29、マゼンダ用紫外線ランプ30、及び、紫外線ランプ29,30から発せられた紫外線をカラー感熱記録紙12へ向けて反射させるためのリフレクタ31を備えている。紫外線ランプ29,30から発せられた紫外線により、カラー感熱記録紙12の画像記録済みのイエロー感熱発色層及びマゼンダ感熱発色層は、再度加熱されても発色しないように定着される。
【0024】
また、搬送ローラ26の下流側にはプリント排出口34が形成されており、プリント排出口34と搬送ローラ26の間には、カラー感熱記録紙12を切断する切断装置32が配置されている。切断装置32で切断されたカラー感熱記録紙12は、プリント排出口34を介して装置本体11の外部へ排出される。
【0025】
次に、図2を参照してカラープリンタ10の制御系の構成について説明する。カラープリンタ10はその装置全体の動作を司るCPU60及びI/O回路62を備え、CPU60にはRAM86及びROM88が接続されている。RAM86の記憶領域には、CPU60が各種の処理を行う際に一時的にデータを記憶するためのワーク領域等が形成されている。また、ROM88には後述する画像補正処理を行うための画像補正プログラムが記憶されている。なお、この画像補正プログラムは請求項7に記載のプログラムに対応している。
【0026】
また、I/O回路62にはデジタルスチルカメラ(DSC)64(の記録メディア)やコンピュータ66が接続され、DSC64又はコンピュータ66から画像データ(例えば各画素の色をR,G,B各8ビットで表す画像データ)が入力される。I/O回路62にはフレームメモリ68が接続されており、I/O回路62に入力された画像データはフレームメモリ68に記憶される。なお、I/O回路62にはビデオ出力端子が設けられており、該ビデオ出力端子を介してI/O回路62と接続されるディスプレイ70には、ビデオ出力端子を介して出力された画像データ(NTSC方式のコンポジット信号)が表す画像が表示される。
【0027】
また、フレームメモリ68にはメモリコントローラ72及びプリントデータ形成部74に接続されている。フレームメモリ68に記憶された画像データは、CPU60によって画像補正処理が行われることで補正された後に、CPU60によってメモリコントローラ72が制御されることでフレームメモリ68から読み出され、プリントデータ形成部74へ出力される。プリントデータ形成部74は、フレームメモリ68から入力された画像データに基づき、発熱素子アレイ19を駆動するプリントデータを生成する。プリントデータ形成部74で生成されたプリントデータはヘッドドライバ76に供給される。ヘッドドライバ76は、入力されたプリントデータに応じて、発熱素子アレイ19の各発熱素子を発熱させる。これにより、発熱素子アレイ19の各発熱素子によってカラー感熱記録紙12の各感熱発色層に画像が記録されることになる。
【0028】
次に本実施形態の作用として、カラー感熱記録紙12に記録すべき画像を表す画像データが、DSC64又はコンピュータ66から入力されてフレームメモリ68に記憶され、ROM88に記憶されている画像補正プログラムがCPU60によって実行されることで実現される画像補正処理について、図3のフローチャートを参照して説明する。
【0029】
ステップ100では、フレームメモリ68に記憶されている処理対象の画像データを読み出し、読み出した処理対象の画像データを画素単位で間引くことで、元の画像データが表す画像を縮小した画像(例えば128画素×92画素、160画素×120画素程度のサムネイル画像)を表す縮小画像データを生成する。またステップ102では、ステップ100で生成した縮小画像データからR,G,Bのヒストグラムを生成すると共に、縮小画像データを所定の演算式に従ってYCbCr表色系のデータへ変換し、変換によって得られたYCbCr表色系のデータY,Cb,CrからY,Cb,Crのヒストグラムを生成する。
【0030】
次のステップ104〜124では、本発明に係る第1の補正条件に相当する変換データを求める処理を行う。すなわち、ステップ104では、縮小画像データから得られたYCbCr表色系のデータY,Cb,Crに基づいてカラーバランス補正量を設定する。具体的には、まずYCbCr色空間上に、例として図4に示すようにY軸に沿って延びるグレイ検出ゾーンを設定する。図4の例では、グレイ検出ゾーンとして、各々楕円体状で中間輝度付近での半径が相違している2種類のグレイ検出ゾーン(グレイ検出ゾーン(内側)及びグレイ検出ゾーン(外側))を示している。
【0031】
次に、縮小画像データから得られたデータY,Cb,Crに基づいて、縮小画像データ上の各画素のうち、YCbCr色座標上での位置が各グレイ検出ゾーン内に位置している画素を抽出し、グレイ検出ゾーン(内側)内に位置している画素の色バランスGrayIn_Cb,GrayIn_Crを求めると共に、グレイ検出ゾーン(内側)の外側に位置しておりかつグレイ検出ゾーン(外側)内に位置している画素の色バランスGrayOut_Cb,GrayOut_Crを求める。そして、処理対象の画像のグレイバランスGray_Cb,Gray_Crを次の(1)式に従って求める。
Gray_Cb=(GrayIn_Cb+GrayOut_Cb)/2
Gray_Cr=(GrayIn_Cr+GrayOut_Cr)/2 …(1)
なお、処理対象の画像のグレイバランスとして、上記のように各グレイ検出ゾーン内に位置している画素の色バランスの平均を求めることに代えて、各グレイ検出ゾーンに対して各々重みを付与し、各グレイ検出ゾーン内に位置している画素の色バランスの加重平均を求めるようにしてもよい。
【0032】
また、カラーバランス補正量Cb_offset,Cr_offsetとしては、処理対象の画像のグレイバランスGray_Cb,Gray_Crをそのまま用い、グレイバランスGray_Cb,Gray_Crが各々0となるように設定してもよいが、処理対象の画像データがDSC64から入力された画像データ(例えばEXIF形式やその他の形式の画像ファイル)である場合、該画像データには撮影時の撮影条件を表す撮影情報が付加されているので、この撮影情報のうち撮影輝度BV(Brightness Value)に基づいて定まる係数を処理対象の画像のグレイバランスGray_Cb,Gray_Crに乗じた値をカラーバランス補正量Cb_offset,Cr_offsetとして用いる(次の(2)式参照)ようにしてもよい。
Cb_offset=Gray_Cb×f(BV)
Cr_offset=Gray_Cr×f(BV) …(2)
【0033】
なお、上式において、関数f(BV)は撮影輝度BVに応じて値が変化する強度係数であり、例えばBV<0(夜景や花火のシーン)の場合にはf(BV)=1.0、0≦BV<1(薄暗いタングステン光源、蛍光灯、ミックス光源下のシーン)の場合にはf(BV)=0.1×BV+1、1≦BV<3(通常の室内のシーン)の場合にはf(BV)=1.1、3≦BV<6(日中野外や逆光気味のシーン)の場合にはf(BV)=−2×BV/15+1.5、6≦BV(晴天日中野外や海山のシーン)の場合にはf(BV)=0.7となるように定めることができる。
【0034】
また、撮影情報にはストロボを使用して撮影したか否かを表す情報も含まれているが、該情報を利用し、撮影時にストロボが使用されたか否かに応じて強度係数を変更するようにしてもよい。例えば上記の例では、撮影輝度BVが若干暗いシーンに対応する値のときに強度係数を1より大きい値にしているが、ストロボを使用して撮影された場合には画像のグレイバランスが適切であることが比較的多いので、強度係数の値を小さくする(例えば0.8程度の値にする)ようにしてもよい。
【0035】
ステップ106では縮小画像を複数の領域に分割するための閾値を設定する。すなわち、まず縮小画像の各画素のうちの特定画素P0に対し、特定画素P0と特定画素P0の周囲に存在する8近傍の画素P1〜P8(図5参照)との輝度差を演算し、その平均値(平均輝度差)を演算する。また、特定画素P0とその8近傍の画素P1〜P8との色差を演算し、その平均値(平均色差)も演算する。そして上記の演算を縮小画像の各画素に対して各々行い、各画素毎の平均輝度差の平均値(画面内平均輝度差Ymean)を求める。
【0036】
本実施形態において、縮小画像を複数の領域へ分割することは、縮小画像の各画素について、平均輝度差及び平均色差が閾値以上か否かに基づき、領域の境界に相当する画素か否かを判断することによって行う。このため、縮小画像を分割したときの分割領域の数は閾値に応じて変化する。例として図6には、画面内平均輝度差Ymeanに係数を乗じた値を平均輝度差の閾値として用い、多数の自然画像(縮小画像)に対して領域分割を行って分割領域の数を求めることを、係数の値を変更しながら繰り返したときの、係数の値と分割領域の数(最大領域数、平均領域数及び最小領域数)との関係を示す。
【0037】
本願発明者によれば、縮小画像の総画素数の2割程度の数の領域に縮小画像を分割すれば、元の処理対象の画像の特徴が反映された領域分割が可能であることが判明している。従って、縮小画像の総画素数に基づき図6に示す関係を用いて係数を決定し、決定した係数を画面内平均輝度差Ymeanに乗ずることで平均輝度差の閾値を求めることができる。
【0038】
例えば縮小画像が160画素×120画素の画像である場合、総画素数は19200であり、適当な分割領域の数は総画素数の2割である3840となる。図5に示す係数の値と分割領域の数(平均領域数)との関係において、分割領域の数が3840となるときの係数の値は0.5であるので、画面内平均輝度差Ymeanに0.5を乗じた値を平均輝度差の閾値とすることができる。なお、平均色差の閾値については、予め固定的に定めておいてもよいし、各画素毎の平均色差の平均値(画面内平均色差)に応じて値を変更するようにしてもよい。
【0039】
次のステップ108では、ステップ106で決定した閾値を用いて縮小画像を複数の領域に分割する。具体的には、例えば縮小画像上の隣り合う画素の平均輝度差及び平均色差を比較し、平均輝度差の差が閾値以下でかつ平均色差の差が閾値以下の場合には、該隣り合う画素同士を同一領域の画素とすることを、縮小画像を順にスキャンしながら繰り返す。これにより、縮小画像は、領域内の輝度及び色相が各々略均一な複数の領域に分割されることになる。また、領域分割が終了すると、各領域毎に平均濃度や彩度等の特徴量を演算する。
【0040】
ステップ110では、分割によって得られた複数の領域から主要部領域でないと推定される領域を除去する。すなわち、まず各領域の彩度を所定値と比較し、彩度が所定値以上の領域を除去する。続いて、以下の(3)式に従って第1の限界濃度DFminを求めると共に、(4)式に従って第2の限界濃度DFmaxを求める。
DFmin=(Dmin+Dstd)/2 …(3)
DFmax=(Dmax+Dstd)/2 …(4)
但し、Dminは縮小画像の最低濃度、Dmaxは縮小画像の最高濃度、Dstdは基準濃度(例えばDstd=0.75)である。次に、未除去の領域のうち、平均濃度が第1の限界濃度DFmin以上又は第2の限界濃度DFmax以下の領域を除去候補領域として抽出する。
【0041】
次に、除去候補領域として抽出した各領域について、次の(5)式に従って濃度フェリア・モーメントdfmntを各々演算する。
dfmnt=|dav−Dstd|×s …(5)
但し、davは除去候補領域の平均濃度、sは除去候補領域の面積である。そして、各除去候補領域の濃度フェリア・モーメントdfmntの値を比較し、濃度フェリア・モーメントdfmntの値の降順に所定数の除去候補領域を除去する。従って、ステップ110の処理により、高彩度の領域が除去されると共に、低輝度(高濃度)又は高輝度(低濃度)で比較的大面積の領域が除去されることになる。
【0042】
ステップ112では、ステップ110の処理を経て除去されずに残存している領域全体の平均濃度Davを演算する。またステップ114では、残存している領域の中から主要部領域として色相が肌色の領域を抽出し、抽出した主要部領域の平均濃度Ds及び面積率Rsを演算する。なお、上記の「色相が肌色」という条件以外に、例えば「面積が規定値以内」「中心位置が縮小画像の四隅から所定値以上離間している」「細長い形状でない」等の条件を付加して主要部領域を抽出するようにしてもよい。
【0043】
次のステップ116では補正対象濃度Dtargを演算する。この演算は、まず例として図7に示すような変換条件に従い、主要部領域の面積率Rsを補正係数coef(Rs)へ変換した後に、平均濃度Dav、主要部領域の平均濃度Ds及び補正係数coef(Rs)を次の(6)式に代入することで実現することができる。
Dtarg=[[3−2×coef(Rs)]×Dav+2×coef(Rs)×Ds]/3 …(6)
そしてステップ118では、ステップ116で求めた補正対象濃度Dtargを、固定的に定められた基準濃度Dstdへ変換する濃度補正カーブを設定する。これにより、例として図8に示すような濃度補正カーブが得られる。なお、基準濃度Dstdに代えて、次の(7)式で規定される目標濃度Dtargを用いてもよい。
Dtarg=Dstd−C1×coef(Rs) …(7)
但し、C1は処理対象の画像が逆光シーンを撮影した画像か否かに応じて値が0又は1となる定数である。
【0044】
またステップ120では、ステップ118で設定した濃度補正カーブに基づいて輝度補正カーブを生成する。すなわち、まずステップ102で生成したYのヒストグラムにおいて、輝度Yの最大値からの累積画素数が総画素数の0.4%となる点(ハイライト点)に相当する輝度Ymaxを求めると共に、輝度Yの最小値からの累積画素数が総画素数の0.4%となる点(シャドー点)に相当する輝度Yminを求める。
【0045】
そして、例えば図9に示すように、輝度入力値Yinがハイライト点に相当する輝度Ymaxのときには最大輝度(例えば輝度出力値Youtが8ビットであれば255)へ変換され、輝度入力値Yinがシャドー点に相当する輝度Yminのときには最小輝度(例えば輝度出力値Youtが0)へ変換されると共に、輝度入力値Yinが輝度Ymaxと輝度Yminの間に相当する中間階調の値のときには、ステップ118で設定した濃度補正カーブに応じた変換特性で輝度出力値へ変換されるように輝度補正カーブの変換特性を設定し、設定した変換特性で輝度の変換が行われるように輝度補正カーブを生成する。
【0046】
これにより、輝度入力値Yinに対し、主要部領域を抽出して求めた補正対象濃度Dtargを基準濃度Dstdへ変換する濃度補正を行って(このときコントラストの補正も同時に行われる)輝度出力値Youtとして出力する輝度補正カーブが得られることになる。また、ステップ122では縮小画像データに基づいて彩度補正量を演算する。なお、彩度補正量の演算については説明を省略するが、例えば特開2001−218078号公報に記載の技術を適用することができる。
【0047】
そしてステップ124では、ステップ104で設定されたカラーバランス補正量、ステップ106〜120の処理によって設定された輝度補正カーブ、及び、ステップ122で演算された彩度補正量に基づいて、図10に示すように、入力されたR,G,BのデータをYCbCr表色系のデータへ変換し、データYに対し輝度補正カーブに応じた濃度補正(及びコントラスト補正)を行ったことに相当するデータY’へ変換すると共に、データCb,Crに対してカラーバランス補正量に応じたカラーバランス補正を行ったことに相当するデータCb’,Cr’へ変換し、更にデータCb’,Cr’に対して彩度補正量に応じた彩度補正を行ったことに相当するデータCb”,Cr”へ変換し、変換後のY’,Cb”,Cr”のデータをR’,G’,B’のデータへ変換することを、一回の変換により実現するための変換データ(本発明に係る第1の補正条件に相当)を設定する。
【0048】
なお、上記の変換は3次元ルックアップテーブル(3D−LUT)を用いて行われるが、本実施形態では変換データ(入力データと対応付けて記憶する、出力データを規定するデータ)のデータ量を削減するために変換データの間引きを行っており、R,G,B各8ビットのデータの各々が、8ビットのデータで表現可能な数値範囲(0〜255)を8刻みで分割したときの分割位置に相当する値であった場合の変換データのみを記憶しておき、3D−LUTに入力されたR,G,Bのデータに対応する変換データが存在しない場合は、記憶されている変換データから出力データを補間演算によって求めるようにしている。
【0049】
このため、ステップ124における変換データの設定は、格子点(互いに直交するR,G,Bの各座標軸で規定されるRGB色空間上に分布する、R,G,B各8ビットのデータで表現可能な色再現範囲を、8ビットのデータで表現可能な256階調を8階調毎に区切ったときの境界に相当する位置で分割することで、前記色再現範囲を格子状に多数の立方体領域へ区切ったときの個々の矩形領域の頂点に相当する点)に対応するR,G,Bのデータについてのみ、前述した一連の変換(R,G,B→R’,G’,B’の変換)を行い、変換後のデータを変換前のデータと対応付けることによって成される。
【0050】
上記により、ダイナミックレンジが非常に小さい画像を除く大多数の画像の濃度や色バランス、彩度等を適正に補正できる変換データを得ることができる。なお、上述したステップ104〜124は本発明に係る第1演算手段(詳しくは請求項2に記載の第1演算手段)に対応している。
【0051】
次のステップ126〜130では、本発明に係る第2の補正条件に相当する変換データを求める処理を行う。すなわち、ステップ126ではステップ102で生成したR,G,Bのヒストグラムからハイライト点(濃度R又は濃度G又は濃度Bの最小からの累積画素数が総画素数の0.4%となる点)に相当する濃度Rmax,Gmax,Bmaxを各々抽出する。またステップ128では、ステップ102で生成した輝度Y(Y=0.299×R+0.587×G+0.114×B)のヒストグラムからシャドー点(輝度Yの最小値からの累積画素数が総画素数の0.4%となる点)に相当する階調値Yminを求める。
【0052】
そしてステップ130では、R,G,Bの各色成分について、例として図11に示すように、ハイライト点に相当する濃度値Rmax又は濃度値Gmax又は濃度値Bmaxを255、シャドー点に相当する階調値Yminを0に変換し、かつ中間階調を線形変換する変換条件を定め、入力されたR,G,Bのデータを、上記で定めた変換条件に従ってR’,G’,B’のデータへ変換することを3D−LUTによって実現するための変換データ(本発明に係る第2の補正条件に相当)を設定する。なお、上記の変換条件を演算式で表すと以下のようになる。
R’=255×(R−Ymin)/(Rmax−Ymin)
G’=255×(G−Ymin)/(Gmax−Ymin)
B’=255×(B−Ymin)/(Bmax−Ymin)
また、ステップ130における変換データの設定についても、格子点に対応するR,G,Bのデータについてのみ、定めた変換条件に基づく変換(R,G,B→R’,G’,B’の変換)を行い、変換後のデータを変換前のデータと対応付けることによって成される。
【0053】
上記の処理により、ハイライト点に相当する濃度値とシャドー点に相当する濃度値の差を最大(255)とする変換条件(ダイナミックレンジを最大限拡大する変換条件)を実現する変換データが得られるので、該変換データに従って画像データを変換することで、ダイナミックレンジが非常に小さい画像の濃度等を適正に補正することができる。また、上記の変換データによって実現される変換条件は、ハイライト点に相当する濃度値Rmax,Gmax,Bmaxを各々同一の値(=255)に変換する変換条件であるので、例えば処理対象の画像が異種光源による照明下で撮影された画像である等の理由で、処理対象の画像中のハイライト点に異種光源特有の色味が付いている場合にも、上記の変換データによる変換を行うことでハイライト点の色味が白となるように補正されることになり、異種光源補正も同時に行われることになる。なお、上述したステップ126〜130は本発明に係る第2演算手段(詳しくは請求項3に記載の第2演算手段)に対応している。
【0054】
ステップ132では、縮小画像におけるY輝度の最大値dmax及び最小値dminを求め、次の(8)式に従い画像のダイナミックレンジdを演算する。
d=dmax−dmin …(8)
ステップ134では、ステップ132で求めたダイナミックレンジdに基づき、第1の補正条件に相当する変換データに対する重み係数c(d)を求める。重み係数c(d)としては、例えば図12にも示すように、
d≦d1の場合 :c(d)=0
d1<d<d2の場合:c(d)=(d−d1)/(d2−d1)
d≧d2の場合 :c(d)=1
なる特性を有する関数を用いることができる。そして、求めた重み係数c(d)に基づき、第1の補正条件に相当する変換データと第2の補正条件に相当する変換データの加重平均に相当する変換データを生成する。
【0055】
なお、上記の変換データの生成は、変換データの設定についても、各格子点について次の(9)式の演算を各々行うことで実現できる。
f(r,g,b)=c(d)×p(r,g,b)+(1−c(d))×q(r,g,b) …(9)
但し、p(r,g,b)は第1の補正条件に相当する変換データのうち特定の格子点に対応する変換データ、q(r,g,b)は第2の補正条件に相当する変換データのうち特定の格子点に対応する変換データ、f(r,g,b)は特定格子点に対応する加重平均に相当する変換データである。
【0056】
上述したように、ステップ134で生成した変換データは、第1の補正条件に相当する変換データと第2の補正条件に相当する変換データを、画像のダイナミックレンジに応じた重み係数c(d)を用いて重み付けして平均化したに相当する変換条件を表す変換データであるので、該変換データを用いて処理対象の画像データを変換することで、処理対象の画像のダイナミックレンジの大小に拘らず、処理対象の画像の濃度等を適正に補正することができる。
【0057】
なお、上述したステップ132及びステップ134のうち重み係数c(d)を求める処理は本発明に係る設定手段に対応しており、ステップ134のうち加重平均に相当する変換データを求める処理は、該変換データに従って処理対象の画像データを実際に変換する処理と共に、本発明に係る補正手段(詳しくは請求項4,5に記載の補正手段)に対応している。
【0058】
上述した画像補正処理が終了すると、CPU60は画像補正処理によって得られた変換データを3D−LUTとして機能する変換テーブルに設定する。そして、フレームメモリ68に記憶されている処理対象の画像データを、個々の画素のデータを単位として順に取り出し、変換データを設定した変換テーブルに基づいて順次変換する。
【0059】
この変換は、まず取り出した画素データ(R,G,B各8ビットのデータ)を出力データと対応付ける変換データが変換テーブルに登録されているか(すなわち格子点位置に相当するデータであるか)否かを判断し、変換テーブルに登録されていた場合には、画素データと対応付けて変換テーブルに登録されている出力データ(R,G,B各8ビットのデータ)を出力し、画素データが変換テーブルに登録されていなかった場合には、RGB色空間上で画素データの座標位置の周囲に位置している複数の格子点位置のデータと対応付けて変換テーブルに登録されている複数の出力データに基づいて、画素データに対応する出力データを補間演算によって求めることによって成される。上記の変換により、処理対象の画像のダイナミックレンジの大小に拘らず、処理対象の画像の濃度等が適正に補正されることになる。
【0060】
3D−LUTによる変換を経た処理対象の画像データは、一旦フレームメモリ68に記憶された後にプリントデータ形成部74へ入力され、プリントデータ形成部74によってプリントデータへ変換される。このプリントデータがヘッドドライバ76に供給され、ヘッドドライバ76がプリントデータに応じて発熱素子アレイ19の各発熱素子を発熱させることで、カラー感熱記録紙12の各感熱発色層に画像が記録される。そして、画像が記録されたカラー感熱記録紙12は、定着装置28によって画像が定着された後に、切断装置32によって画像齣単位で切断され、プリント排出口34を介して装置本体11の外部へ排出されることになる。
【0061】
なお、上記では本発明に係る第1の補正条件での補正と本発明に係る第2の補正条件での補正の加重平均に相当する補正を実現するための変換データを求め、求めた変換データを3D−LUTに設定して処理対象の画像データを変換することで、処理対象の画像データに対して前記加重平均に相当する補正を行う態様を例に説明したが、本発明はこれに限定されるものではなく、前記加重平均に相当する補正を行うための演算式を求め、処理対象の画像データに対して前記演算式に従って補正演算を施すことで、前記加重平均に相当する補正を行うようにしてもよい。
【0062】
また、上記ではカラー感熱記録紙12に画像を記録する構成のカラープリンタ10における画像データの補正に本発明を適用した例を説明したが、本発明はデジタル画像の補正に広く適用可能であり、例えば写真フィルムに記録された画像を読み取ることでデータ化し、印画紙に露光記録することで写真プリントを作成する場合の補正に適用したり、デジタルスチルカメラ(DSC)等によって被写体を撮像することで得られた画像データに対する補正(例えばインターネット等のネットワーク経由で依頼された写真処理を行う際の画像補正)に適用することも可能である。
【0063】
また、上記で説明した画像補正処理を実現するための画像補正プログラムと、画像補正処理によって生成された変換データに基づいて画像データを変換することで画像データを補正する変換プログラムをDSCに記憶させておくことで、本発明に係る画像補正をDSCで行わせるようにしてもよい。この態様では、DSCが本発明に係る画像補正装置として機能することになる。
【0064】
更に、パーソナル・コンピュータ(PC)等で実行するための画像処理ソフトに、上記の画像補正プログラム及び変換プログラムを付加することで、本発明に係る画像補正をPCで行わせるようにしてもよい。この態様ではPCが本発明に係る画像補正装置として機能することになる。また、上記の画像処理ソフトも請求項7に記載のプログラムに対応している。
【0065】
【発明の効果】
以上説明したように本発明は、補正対象画像の主要部領域を認識し、認識した主要部領域の特徴量に基づいて演算した第1の補正条件と、補正対象対象画像におけるハイライトに相当する階調値とシャドーに相当する階調値の差が所定値となるように演算した第2の補正条件に対する重みを、補正対象画像のダイナミックレンジに基づいて設定し、補正対象画像に対し、第1の補正条件での補正と第2の補正条件での補正の加重平均に相当する補正を行うようにしたので、ダイナミックレンジが非常に小さい画像の濃度等も適正に補正することが可能となる、という優れた効果を有する。
【図面の簡単な説明】
【図1】本実施形態に係るカラープリンタの概略構成図である。
【図2】カラープリンタの制御系の概略構成を示すブロック図である。
【図3】画像補正処理の内容を示すフローチャートである。
【図4】グレイ検出ゾーンの一例を示す概念図である。
【図5】特定画素とその周囲の8近傍の画素を示す概念図である。
【図6】画面内平均輝度差Ymeanに乗ずる係数の値と分割領域の数(最大領域数、平均領域数及び最小領域数)との関係の一例を示す線図である。
【図7】主要部領域の面積率Rsと補正係数coef(Rs)との関係の一例を示す線図である。
【図8】濃度補正カーブの一例を示す線図である。
【図9】輝度補正カーブの一例を示す線図である。
【図10】第1の変換条件による変換の概要を示す概念図である。
【図11】第2の変換条件の変換特性の一例を示す線図である。
【図12】ダイナミックレンジdと重み係数c(d)との関係の一例を示す線図である。
【符号の説明】
10 カラープリンタ
12 カラー感熱記録紙
18 サーマルヘッド
28 定着装置
32 切断装置
60 CPU
68 フレームメモリ
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an image correction apparatus, method, and program, and more particularly to an image correction method for correcting image density and color balance, an image correction apparatus to which the image correction method can be applied, and a computer. Related to the program to function as.
[0002]
[Prior art]
Various correction methods have been proposed as correction methods for correcting the density and color balance of an image obtained by shooting an arbitrary subject using a camera or a digital still camera (DSC). For example, the average density of the standard density region is calculated from the correction target image, and the average density and area ratio of the main image portion extracted from the correction target image are calculated. Based on the calculation result, the correction target image is calculated. A technique has been proposed in which a density correction curve is determined so that the calculated representative density becomes a target density, and the density of the image to be corrected is corrected based on the density correction curve (for example, Patent Documents). 1).
[0003]
[Patent Document 1]
JP 2002-199221 A
[0004]
[Problems to be solved by the invention]
The above technique is based on the fact that it is almost always a fixed part (main image part) that is noticed in image viewing, for example, a person's face is most noticeable in a portrait. However, by applying the above technique, it is possible to properly correct the density and the like for the majority of images. However, the above technique uses a dynamic range (maximum There is a drawback that it is difficult to appropriately correct the density of an image having a very small difference between the density and the minimum density.
[0005]
Recently, a request form for requesting photo processing such as creation of a photo print via the Internet has become widespread, but in this request form, as in the case where simultaneous printing of images photographed and recorded on photographic film is requested, In many cases, the client who is the client himself / herself requests photo processing without confirming the contents of the image, and the images for which photo processing has been requested are mixed together as described above. It is also increasing. For this reason, establishment of a correction method capable of appropriately correcting the density and the like for an image having a very small dynamic range has been demanded.
[0006]
The present invention has been made in consideration of the above facts, and an object thereof is to obtain an image correction apparatus, an image correction method, and a program that can appropriately correct the density of an image having a very small dynamic range.
[0007]
[Means for Solving the Problems]
The inventor of the present application conducted an experiment to correct the density and the like by applying various known correction methods to an image having a very small dynamic range, and to evaluate the correction result. As a result, for an image having a very small dynamic range, the difference between the gradation value corresponding to the highlight of the image and the gradation value corresponding to the shadow (that is, the dynamic range) becomes a predetermined value (the original value). By applying a correction method that corrects the density etc. (so that it is enlarged than the image), the knowledge that the density etc. can be corrected properly by expanding the dynamic range of the image has been obtained, and the present invention has been achieved. It was.
[0008]
Based on the above, the image correction apparatus according to the first aspect of the present invention recognizes the main part region of the correction target image, and corrects the correction target image based on the recognized feature amount of the main part region. First correction means for calculating correction conditions and correcting the correction target image so that a difference between a gradation value corresponding to highlight and a gradation value corresponding to shadow in the correction target image becomes a predetermined value. Second calculating means for calculating the second correction condition, setting means for setting a weight for the first correction condition and the second correction condition based on a dynamic range of the correction target image, and the setting means Based on the weight set by the correction, the correction target image is corrected under the first correction condition calculated by the first calculation means, and the second correction condition is calculated by the second calculation means. Is configured to include a correction means for performing a weighted mean equivalent to correction of the correction, the.
[0009]
The first calculation means according to the first aspect of the invention recognizes a main part region of the correction target image, and corrects the correction target image based on the recognized feature amount of the main part region. Is calculated. Accordingly, it is possible to obtain a correction condition (first correction condition) that can appropriately correct the density and the like for the majority of images excluding a part of the images having a very small dynamic range. In addition, the second calculation means according to the first aspect of the invention is configured so that the difference between the gradation value corresponding to the highlight in the correction target image and the gradation value corresponding to the shadow becomes a predetermined value (for example, the floor). The second correction condition for correcting the correction target image is calculated (so that the difference between the tone values is enlarged from that of the original image). Thereby, it is possible to obtain a correction condition (second correction condition) that can appropriately correct the density and the like of an image having a very small dynamic range.
[0010]
According to the first aspect of the present invention, the weights for the first correction condition and the second correction condition are set by the setting means based on the dynamic range of the correction target image. For example, when the dynamic range of the correction target image is relatively large, the weight for the first correction condition is large, and when the dynamic range is very small, the weight for the second correction condition is large. Can be set to
[0011]
The correction means according to the first aspect of the invention is based on the weight set by the setting means and is corrected by the first correction condition calculated by the first calculation means and calculated by the second calculation means. Correction corresponding to the weighted average of correction under the second correction condition is performed on the correction target image. Thus, according to the first aspect of the present invention, the content of correction (the specific gravity of the correction under the first correction condition and the correction under the second correction condition) is corrected according to the dynamic range of the correction target image. Therefore, it is possible to appropriately correct the density of an image having a very small dynamic range.
[0012]
In the first aspect of the invention, the first calculating means is based on the distribution on the color coordinates of the pixel group whose saturation is equal to or less than a predetermined value in the correction target image. In addition to setting the color balance correction condition, the density correction condition is set so that the correction target density obtained from the feature amount of the recognized main area is converted to a predetermined target density. As the first correction condition, A correction condition for correcting the color balance and density of the correction target image under the set correction condition can be calculated. As a result, even when the correction target image is an image taken under illumination with a different type of light source, a correction condition for properly correcting the color balance of the correction target image can be obtained. It is possible to obtain a correction condition that can appropriately correct the density and color balance of the majority of images excluding some images with a very small range.
[0013]
Further, in the first aspect of the invention, as described in the third aspect of the invention, for example, the second calculation means has a gradation value corresponding to the highlight for each color component in the correction target image as the second correction condition. The correction condition for correcting the correction target image can be calculated so that each of the first predetermined values becomes a second predetermined value of the gradation value corresponding to the shadow in the correction target image. As a result, even when the correction target image is an image taken under illumination with a different light source, a correction condition that can correct the color balance of the correction target image properly can be obtained. Correction conditions that can appropriately correct the density and color balance of an image with a very small range can be obtained.
[0014]
Further, in the first aspect of the invention, the first correction condition and the second correction condition may be an arithmetic expression of the correction calculation, but the first correction condition and the second correction condition are correction targets. In the case where the conversion condition is for correcting the correction target image by converting the image, the correction means, for example, as described in claim 4, the conversion condition corresponding to the first correction condition and the second A conversion condition corresponding to the weighted average of the conversion conditions corresponding to the correction condition is obtained, and the correction target image is converted according to the obtained conversion condition, so that the correction corresponding to the weighted average can be performed.
[0015]
Further, in the invention according to claim 4, the correction means can be configured to include a three-dimensional lookup table. In this case, the correction means, for example, as described in claim 5, sets the obtained conversion condition to the 3 Correction can be performed by inputting correction target image data after being set in the dimension lookup table. Thereby, the correction corresponding to the weighted average of the correction under the first correction condition and the correction under the second correction condition can be realized by a simple process.
[0016]
According to a sixth aspect of the present invention, there is provided an image correction method for recognizing a main part region of a correction target image and setting a first correction condition for correcting the correction target image based on a feature amount of the recognized main part region. A second correction condition for calculating and correcting the correction target image so that a difference between a gradation value corresponding to highlight and a gradation value corresponding to shadow in the correction target image becomes a predetermined value And calculating a weight for the first correction condition and the second correction condition based on the dynamic range of the correction target image, and calculating the calculation for the correction target image based on the set weight. Since the correction corresponding to the weighted average of the correction under the first correction condition and the correction under the calculated second correction condition is performed, an image with a very small dynamic range is provided as in the invention of claim 1. It is possible that concentration and the like are also appropriately corrected.
[0017]
According to a seventh aspect of the present invention, there is provided a program for recognizing a main area of a correction target image and correcting the correction target image based on a feature amount of the recognized main area. A second computing unit for correcting the correction target image so that a difference between a gradation value corresponding to highlight and a gradation value corresponding to shadow in the correction target image becomes a predetermined value. Second calculation means for calculating the correction condition, setting means for setting weights for the first correction condition and the second correction condition based on the dynamic range of the correction target image, and weights set by the setting means Based on the above, the correction target image is corrected under the first correction condition calculated by the first calculation means, and under the second correction condition calculated by the second calculation means. To function as a correction means for correcting corresponding to the weighted average of the positive.
[0018]
According to a seventh aspect of the invention, a program (for example, a computer incorporated in a photographing apparatus such as a DSC or other equipment) may be used as the first calculation means, the second calculation means, and the setting means. Therefore, when the computer executes the program according to the seventh aspect of the present invention, the computer functions as the image correction apparatus according to the first aspect. Similar to the invention, it is possible to appropriately correct the density of an image having a very small dynamic range.
[0019]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, an example of an embodiment of the present invention will be described in detail with reference to the drawings. FIG. 1 shows a color printer 10 to which the present invention is applied. The color printer 10 is configured to record an image on a long color thermosensitive recording paper 12 provided with each thermosensitive coloring layer. The color thermosensitive recording paper 12 is a recording paper roll 13 wound in a roll shape, and the apparatus main body 11. Set inside.
[0020]
The color thermal recording paper 12 is sandwiched between a pair of paper feed rollers 14, and the driving force of the motor 16 is transmitted to rotate the paper feed roller 14 to feed the paper downstream. A thermal head 18 to which a heating element array 19 in which a plurality of heating elements are arranged in a line is attached is disposed downstream of the paper feed roller 14. The thermal head 18 is rotatable about a rotary shaft 20, and a recording position (a position indicated by a broken line) where the heating element array 19 is pressure-bonded to the color thermal recording paper 12 by transmitting a driving force of a motor (not shown). ) Or a retreat position (a position indicated by a solid line) away from the color thermal recording paper 12.
[0021]
Further, a platen roller 22 is disposed at a portion facing the heating element array 19. The platen roller 22 rotates according to the conveyance of the color thermal recording paper 12 and supports the color thermal recording paper 12 to improve the stability of the contact state between the color thermal recording paper 12 and the heating element array 19. When recording an image on the color thermal recording paper 12, the thermal head 18 causes each heating element of the heating element array 19 to generate heat at a predetermined temperature in accordance with print data (described later), and each thermal coloring layer of the color thermal recording paper 12 is formed. Selectively develop color.
[0022]
A pair of transport rollers 26 for transporting the color thermal recording paper 12 at the time of image recording is disposed on the downstream side of the thermal head 18. The transport roller 26 is rotated by the driving force of the motor 16 being transmitted. Then, the color thermal recording paper 12 is transported by the paper feed roller 14 and the transport roller 26 in the paper feeding direction pulled out from the recording paper roll 13 or in the rewinding direction rewound on the recording paper roll 13.
[0023]
A fixing device 28 is disposed between the thermal head 18 and the transport roller 26. The fixing device 28 includes a yellow ultraviolet lamp 29, a magenta ultraviolet lamp 30, and a reflector 31 for reflecting the ultraviolet rays emitted from the ultraviolet lamps 29, 30 toward the color thermal recording paper 12. The yellow heat-sensitive color developing layer and the magenta heat-sensitive color developing layer on the color heat-sensitive recording paper 12 are fixed by the ultraviolet light emitted from the ultraviolet lamps 29 and 30 so as not to be colored even if heated again.
[0024]
A print discharge port 34 is formed on the downstream side of the conveyance roller 26, and a cutting device 32 for cutting the color thermal recording paper 12 is disposed between the print discharge port 34 and the conveyance roller 26. The color thermal recording paper 12 cut by the cutting device 32 is discharged to the outside of the main body 11 through the print discharge port 34.
[0025]
Next, the configuration of the control system of the color printer 10 will be described with reference to FIG. The color printer 10 includes a CPU 60 and an I / O circuit 62 that control the operation of the entire apparatus, and a RAM 86 and a ROM 88 are connected to the CPU 60. In the storage area of the RAM 86, a work area for temporarily storing data when the CPU 60 performs various processes is formed. The ROM 88 stores an image correction program for performing an image correction process described later. This image correction program corresponds to the program described in claim 7.
[0026]
Further, a digital still camera (DSC) 64 (recording medium) and a computer 66 are connected to the I / O circuit 62, and image data (for example, the color of each pixel is 8 bits each for R, G, B) from the DSC 64 or the computer 66. Is input). A frame memory 68 is connected to the I / O circuit 62, and image data input to the I / O circuit 62 is stored in the frame memory 68. The I / O circuit 62 is provided with a video output terminal. The display 70 connected to the I / O circuit 62 via the video output terminal has image data output via the video output terminal. An image represented by (NTSC composite signal) is displayed.
[0027]
The frame memory 68 is connected to a memory controller 72 and a print data forming unit 74. The image data stored in the frame memory 68 is corrected by the image correction processing performed by the CPU 60 and then read from the frame memory 68 by the CPU 60 controlling the memory controller 72, and the print data forming unit 74. Is output. The print data forming unit 74 generates print data for driving the heating element array 19 based on the image data input from the frame memory 68. The print data generated by the print data forming unit 74 is supplied to the head driver 76. The head driver 76 causes each heating element of the heating element array 19 to generate heat according to the input print data. As a result, an image is recorded on each thermosensitive coloring layer of the color thermosensitive recording paper 12 by each heater element of the heater element array 19.
[0028]
Next, as an operation of the present embodiment, image data representing an image to be recorded on the color thermal recording paper 12 is input from the DSC 64 or the computer 66 and stored in the frame memory 68, and an image correction program stored in the ROM 88 is stored. The image correction process realized by being executed by the CPU 60 will be described with reference to the flowchart of FIG.
[0029]
In step 100, the processing target image data stored in the frame memory 68 is read, and the read processing target image data is thinned out in units of pixels, thereby reducing the image represented by the original image data (for example, 128 pixels). Reduced image data representing thumbnail images of about 92 pixels × 160 pixels × 120 pixels) is generated. In step 102, an R, G, B histogram is generated from the reduced image data generated in step 100, and the reduced image data is converted into YCbCr color system data according to a predetermined arithmetic expression, and obtained by conversion. A histogram of Y, Cb, and Cr is generated from Y, Cb, and Cr data Y, Cb, and Cr.
[0030]
In the next steps 104 to 124, conversion data corresponding to the first correction condition according to the present invention is obtained. That is, in step 104, the color balance correction amount is set based on the YCbCr color system data Y, Cb, Cr obtained from the reduced image data. Specifically, first, a gray detection zone extending along the Y axis is set on the YCbCr color space as shown in FIG. 4 as an example. In the example of FIG. 4, two types of gray detection zones (gray detection zone (inner side) and gray detection zone (outer side)) each having an ellipsoidal shape and different radii in the vicinity of the intermediate luminance are shown as gray detection zones. ing.
[0031]
Next, based on the data Y, Cb, and Cr obtained from the reduced image data, among the pixels on the reduced image data, pixels whose positions on the YCbCr color coordinates are located in the gray detection zones are determined. Extracting and obtaining the color balance GrayIn_Cb, GrayIn_Cr of the pixel located in the gray detection zone (inner side), located outside the gray detection zone (inner side) and located in the gray detection zone (outer side) The color balances GrayOut_Cb and GrayOut_Cr of the current pixel are obtained. Then, the gray balance Gray_Cb, Gray_Cr of the image to be processed is obtained according to the following equation (1).
Gray_Cb = (GrayIn_Cb + GrayOut_Cb) / 2
Gray_Cr = (GrayIn_Cr + GrayOut_Cr) / 2 (1)
As the gray balance of the image to be processed, instead of obtaining the average color balance of the pixels located in each gray detection zone as described above, a weight is assigned to each gray detection zone. The weighted average of the color balance of the pixels located in each gray detection zone may be obtained.
[0032]
Further, as the color balance correction amounts Cb_offset and Cr_offset, the gray balance Gray_Cb and Gray_Cr of the image to be processed may be used as they are, and the gray balance Gray_Cb and Gray_Cr may be set to 0, but the image data to be processed Is image data input from the DSC 64 (for example, an image file in EXIF format or other format), the image data includes shooting information representing shooting conditions at the time of shooting. Values obtained by multiplying the gray balance Gray_Cb, Gray_Cr of the image to be processed by the coefficient determined based on the photographing brightness BV (Brightness Value) are used as the color balance correction amounts Cb_offset, Cr_offset (see the following equation (2)). You may do it.
Cb_offset = Gray_Cb × f (BV)
Cr_offset = Gray_Cr × f (BV) (2)
[0033]
In the above equation, the function f (BV) is an intensity coefficient whose value changes according to the photographing luminance BV. For example, when BV <0 (night scene or fireworks scene), f (BV) = 1.0. , 0 ≦ BV <1 (scene under dim tungsten light source, fluorescent lamp, mixed light source), f (BV) = 0.1 × BV + 1, 1 ≦ BV <3 (normal indoor scene) Is f (BV) = 1.1, 3 ≦ BV <6 (daytime outdoor scene or backlit scene), f (BV) = − 2 × BV / 15 + 1.5, 6 ≦ BV (daytime in fine weather) In the case of an outdoor or seamount scene), f (BV) = 0.7 can be set.
[0034]
In addition, the shooting information includes information indicating whether or not shooting was performed using a strobe, and the intensity coefficient is changed according to whether or not the strobe was used during shooting. It may be. For example, in the above example, the intensity coefficient is set to a value larger than 1 when the shooting brightness BV is a value corresponding to a slightly dark scene, but when the image is shot using a strobe, the gray balance of the image is appropriate. Since there are relatively many cases, the value of the intensity coefficient may be reduced (for example, a value of about 0.8).
[0035]
In step 106, a threshold for dividing the reduced image into a plurality of areas is set. That is, first, the luminance difference between the specific pixel P0 and the eight neighboring pixels P1 to P8 (see FIG. 5) around the specific pixel P0 is calculated for the specific pixel P0 among the pixels of the reduced image. An average value (average luminance difference) is calculated. Further, the color difference between the specific pixel P0 and the eight neighboring pixels P1 to P8 is calculated, and the average value (average color difference) is also calculated. Then, the above calculation is performed for each pixel of the reduced image, and the average value of the average luminance difference for each pixel (in-screen average luminance difference Ymean) is obtained.
[0036]
In the present embodiment, dividing the reduced image into a plurality of regions is whether or not each pixel of the reduced image is a pixel corresponding to the boundary of the region based on whether or not the average luminance difference and the average color difference are equal to or greater than a threshold value. Do by judging. For this reason, the number of divided areas when the reduced image is divided changes according to the threshold value. For example, in FIG. 6, a value obtained by multiplying the average luminance difference in the screen Ymean by a coefficient is used as a threshold value for the average luminance difference, and the number of divided regions is obtained by performing region division on a large number of natural images (reduced images). The relationship between the coefficient value and the number of divided areas (maximum area number, average area number, and minimum area number) when this is repeated while changing the coefficient value is shown.
[0037]
According to the inventor of the present application, it is found that if the reduced image is divided into about 20% of the total number of pixels of the reduced image, the area division reflecting the characteristics of the original image to be processed is possible. doing. Therefore, the threshold value of the average luminance difference can be obtained by determining a coefficient using the relationship shown in FIG. 6 based on the total number of pixels of the reduced image and multiplying the determined coefficient by the average luminance difference in the screen Ymean.
[0038]
For example, when the reduced image is an image of 160 pixels × 120 pixels, the total number of pixels is 19200, and the number of appropriate divided regions is 3840, which is 20% of the total number of pixels. In the relationship between the coefficient values shown in FIG. 5 and the number of divided areas (average area number), the coefficient value when the number of divided areas is 3840 is 0.5. A value obtained by multiplying 0.5 can be used as a threshold value of the average luminance difference. The average color difference threshold value may be fixed in advance or may be changed according to the average color difference average value (in-screen average color difference) for each pixel.
[0039]
In the next step 108, the reduced image is divided into a plurality of regions using the threshold value determined in step 106. Specifically, for example, the average luminance difference and the average color difference of adjacent pixels on the reduced image are compared, and if the difference in average luminance difference is equal to or smaller than the threshold and the difference in average color difference is equal to or smaller than the threshold, the adjacent pixels Repeating scanning the reduced images in order is performed by setting the pixels in the same region. As a result, the reduced image is divided into a plurality of regions each having substantially uniform luminance and hue within the region. When the region division is completed, feature amounts such as average density and saturation are calculated for each region.
[0040]
In step 110, a region estimated not to be a main region is removed from a plurality of regions obtained by the division. That is, first, the saturation of each region is compared with a predetermined value, and regions where the saturation is greater than or equal to the predetermined value are removed. Subsequently, the first limit concentration DFmin is obtained according to the following equation (3), and the second limit concentration DFmax is obtained according to the equation (4).
DFmin = (Dmin + Dstd) / 2 (3)
DFmax = (Dmax + Dstd) / 2 (4)
However, Dmin is the lowest density of the reduced image, Dmax is the highest density of the reduced image, and Dstd is the reference density (for example, Dstd = 0.75). Next, out of the unremoved regions, a region having an average density equal to or higher than the first limit density DFmin or equal to or lower than the second limit density DFmax is extracted as a removal candidate area.
[0041]
Next, for each area extracted as a removal candidate area, the density feria moment dfmnt is calculated according to the following equation (5).
dfmnt = | dav−Dstd | × s (5)
Where dav is the average density of the removal candidate region, and s is the area of the removal candidate region. Then, the density feria / moment dfmnt values of the respective removal candidate areas are compared, and a predetermined number of removal candidate areas are removed in descending order of the density feria / moment dfmnt value. Therefore, the processing in step 110 removes a high-saturation region and removes a region with a relatively large area at low luminance (high density) or high luminance (low concentration).
[0042]
In step 112, the average density Dav of the entire region remaining without being removed through the processing of step 110 is calculated. In step 114, a skin color area is extracted from the remaining areas as the main area, and the average density Ds and area ratio Rs of the extracted main area are calculated. In addition to the above-mentioned condition that “hue is flesh-colored”, for example, conditions such as “the area is within a predetermined value”, “the center position is separated from the four corners of the reduced image by a predetermined value”, “not an elongated shape”, and the like are added. Thus, the main area may be extracted.
[0043]
In the next step 116, the correction target density Dtarg is calculated. This calculation is performed by first converting the area ratio Rs of the main area into the correction coefficient coef (Rs) according to the conversion conditions as shown in FIG. 7 as an example, and then the average density Dav, the average density Ds of the main area, and the correction coefficient. This can be realized by substituting coef (Rs) into the following equation (6).
Dtarget = [[3-2 × coef (Rs)] × Dav + 2 × coef (Rs) × Ds] / 3 (6)
In step 118, a density correction curve for converting the correction target density Dtarg obtained in step 116 into a fixed reference density Dstd is set. Thereby, a density correction curve as shown in FIG. 8 is obtained as an example. Instead of the reference density Dstd, a target density Dtarget defined by the following equation (7) may be used.
Dtarget = Dstd−C1 × coef (Rs) (7)
However, C1 is a constant whose value is 0 or 1 depending on whether or not the image to be processed is an image obtained by photographing a backlight scene.
[0044]
In step 120, a brightness correction curve is generated based on the density correction curve set in step 118. That is, first, in the histogram of Y generated in step 102, the luminance Ymax corresponding to the point (highlight point) at which the cumulative number of pixels from the maximum value of the luminance Y becomes 0.4% of the total number of pixels is obtained. A luminance Ymin corresponding to a point (shadow point) at which the cumulative number of pixels from the minimum value of Y becomes 0.4% of the total number of pixels is obtained.
[0045]
For example, as shown in FIG. 9, when the luminance input value Yin is the luminance Ymax corresponding to the highlight point, the luminance input value Yin is converted to the maximum luminance (for example, 255 if the luminance output value Yout is 8 bits). When the luminance Ymin corresponding to the shadow point is converted to the minimum luminance (for example, the luminance output value Yout is 0), and when the luminance input value Yin is an intermediate gradation value corresponding to between the luminance Ymax and the luminance Ymin, a step is performed. The conversion characteristic of the luminance correction curve is set so that it is converted into the luminance output value with the conversion characteristic according to the density correction curve set in 118, and the luminance correction curve is generated so that the luminance is converted with the set conversion characteristic. To do.
[0046]
As a result, the luminance input value Yin is subjected to density correction for converting the correction target density Dtarg obtained by extracting the main region into the reference density Dstd (at this time, the contrast correction is also performed simultaneously). As a result, a luminance correction curve to be output as is obtained. In step 122, the saturation correction amount is calculated based on the reduced image data. Although the description of the calculation of the saturation correction amount is omitted, for example, the technique described in JP-A-2001-218078 can be applied.
[0047]
In step 124, the color balance correction amount set in step 104, the luminance correction curve set by the processing in steps 106 to 120, and the saturation correction amount calculated in step 122 are shown in FIG. In this way, the input R, G, B data is converted into YCbCr color system data, and the data Y corresponding to the density correction (and contrast correction) corresponding to the luminance correction curve is performed on the data Y. Is converted to data Cb ′ and Cr ′ corresponding to the color balance correction amount corresponding to the color balance correction amount for the data Cb and Cr, and further the data Cb ′ and Cr ′. The data is converted into data Cb ″, Cr ″ corresponding to the saturation correction corresponding to the saturation correction amount, and the converted data of Y ′, Cb ″, Cr ″ is R ′, G ′, B ′. To convert the data, sets the conversion data for realizing the conversion of one (corresponding to the first correction condition according to the present invention).
[0048]
The above conversion is performed using a three-dimensional lookup table (3D-LUT). In this embodiment, the amount of conversion data (data defining output data stored in association with input data) is determined. In order to reduce the conversion data, thinning of the conversion data is performed, and each of the 8-bit data of R, G, B each divides the numerical range (0 to 255) that can be expressed by 8-bit data into 8 increments. Only conversion data in the case of a value corresponding to the division position is stored, and if there is no conversion data corresponding to R, G, B data input to the 3D-LUT, the stored conversion is stored. Output data is obtained from the data by interpolation.
[0049]
For this reason, the setting of the conversion data in step 124 is represented by 8-bit data of R, G, and B distributed on the RGB color space defined by the grid points (R, G, and B coordinate axes orthogonal to each other). By dividing the possible color reproduction range at a position corresponding to the boundary when 256 gradations that can be expressed by 8-bit data are divided every 8 gradations, the color reproduction range is divided into a large number of cubes in a lattice shape. Only the R, G, B data corresponding to the R, G, B data corresponding to the vertices of the individual rectangular areas when divided into areas (R, G, B → R ′, G ′, B ′). Conversion) and associating the converted data with the data before conversion.
[0050]
As described above, it is possible to obtain conversion data that can appropriately correct the density, color balance, saturation, and the like of the majority of images excluding images with a very small dynamic range. Steps 104 to 124 described above correspond to the first calculation means according to the present invention (specifically, the first calculation means according to claim 2).
[0051]
In the next steps 126 to 130, processing for obtaining conversion data corresponding to the second correction condition according to the present invention is performed. That is, in step 126, the highlight point from the histogram of R, G, B generated in step 102 (the point at which the cumulative number of pixels from the minimum of density R or density G or density B becomes 0.4% of the total number of pixels). Concentrations Rmax, Gmax, and Bmax corresponding to are extracted. In step 128, the brightness Y (Y = 0.299 × R + 0.587 × G + 0.114 × B) generated in step 102 is used to calculate the shadow point (the cumulative number of pixels from the minimum value of luminance Y is the total number of pixels). A gradation value Ymin corresponding to 0.4% is obtained.
[0052]
In step 130, for each of the R, G, and B color components, as shown in FIG. 11 as an example, the density value Rmax or density value Gmax or density value Bmax corresponding to the highlight point is 255, and the level corresponding to the shadow point. A conversion condition for converting the tone value Ymin to 0 and linearly converting the intermediate gradation is determined, and the input R, G, B data is converted to R ′, G ′, B ′ according to the conversion condition defined above. Conversion data (corresponding to the second correction condition according to the present invention) for realizing conversion to data by the 3D-LUT is set. Note that the above conversion condition is represented by an arithmetic expression as follows.
R ′ = 255 × (R−Ymin) / (Rmax−Ymin)
G ′ = 255 × (G−Ymin) / (Gmax−Ymin)
B ′ = 255 × (B−Ymin) / (Bmax−Ymin)
Also, with respect to the setting of the conversion data in step 130, only the R, G, B data corresponding to the grid points are converted based on the determined conversion conditions (R, G, B → R ′, G ′, B ′). Conversion), and the converted data is associated with the data before conversion.
[0053]
By the above processing, conversion data that realizes a conversion condition (conversion condition that maximizes the dynamic range) that maximizes the difference between the density value corresponding to the highlight point and the density value corresponding to the shadow point (255) is obtained. Therefore, by converting the image data according to the conversion data, it is possible to appropriately correct the density of the image having a very small dynamic range. The conversion condition realized by the conversion data is a conversion condition for converting the density values Rmax, Gmax, and Bmax corresponding to the highlight points to the same value (= 255). Even if the highlight point in the image to be processed has a color peculiar to a different light source, for example, because the image is taken under illumination with a different light source, the conversion using the conversion data is performed. Thus, the highlight point is corrected to be white, and the different light source correction is also performed at the same time. Steps 126 to 130 described above correspond to the second calculation means according to the present invention (specifically, the second calculation means according to claim 3).
[0054]
In step 132, the maximum value dmax and the minimum value dmin of Y luminance in the reduced image are obtained, and the dynamic range d of the image is calculated according to the following equation (8).
d = dmax−dmin (8)
In step 134, the weight coefficient c (d) for the conversion data corresponding to the first correction condition is obtained based on the dynamic range d obtained in step 132. As the weighting coefficient c (d), for example, as shown in FIG.
When d ≦ d1: c (d) = 0
When d1 <d <d2: c (d) = (d−d1) / (d2−d1)
When d ≧ d2: c (d) = 1
A function having the following characteristics can be used. Then, based on the obtained weight coefficient c (d), conversion data corresponding to a weighted average of conversion data corresponding to the first correction condition and conversion data corresponding to the second correction condition is generated.
[0055]
Note that the generation of the conversion data can also be realized by performing the calculation of the following equation (9) for each lattice point in setting the conversion data.
f (r, g, b) = c (d) * p (r, g, b) + (1-c (d)) * q (r, g, b) (9)
However, p (r, g, b) is conversion data corresponding to a specific lattice point among the conversion data corresponding to the first correction condition, and q (r, g, b) is equivalent to the second correction condition. Among the conversion data, conversion data corresponding to a specific grid point, f (r, g, b) is conversion data corresponding to a weighted average corresponding to the specific grid point.
[0056]
As described above, the conversion data generated in step 134 is obtained by converting the conversion data corresponding to the first correction condition and the conversion data corresponding to the second correction condition into weight coefficients c (d) corresponding to the dynamic range of the image. Conversion data representing conversion conditions corresponding to weighting and averaging using the conversion data, and by converting the image data to be processed using the conversion data, the dynamic range of the image to be processed is considered to be large or small. Therefore, it is possible to appropriately correct the density of the image to be processed.
[0057]
Note that the processing for obtaining the weighting coefficient c (d) in Step 132 and Step 134 described above corresponds to the setting means according to the present invention, and the processing for obtaining conversion data corresponding to the weighted average in Step 134 includes In addition to the process of actually converting the image data to be processed in accordance with the conversion data, this corresponds to the correction means according to the present invention (specifically, the correction means described in claims 4 and 5).
[0058]
When the image correction process described above is completed, the CPU 60 sets the conversion data obtained by the image correction process in a conversion table that functions as a 3D-LUT. Then, the image data to be processed stored in the frame memory 68 is sequentially extracted in units of individual pixel data, and sequentially converted based on a conversion table in which conversion data is set.
[0059]
In this conversion, first, conversion data that associates the extracted pixel data (8-bit data for each of R, G, and B) with output data is registered in the conversion table (that is, whether the data corresponds to the grid point position). If it is registered in the conversion table, output data (R, G, B, each 8 bits data) registered in the conversion table in association with the pixel data is output. If not registered in the conversion table, a plurality of outputs registered in the conversion table in association with data of a plurality of grid point positions located around the coordinate position of the pixel data in the RGB color space Based on the data, output data corresponding to the pixel data is obtained by interpolation calculation. By the above conversion, the density or the like of the image to be processed is corrected appropriately regardless of the dynamic range of the image to be processed.
[0060]
The image data to be processed that has undergone the conversion by the 3D-LUT is temporarily stored in the frame memory 68, then input to the print data forming unit 74, and converted into print data by the print data forming unit 74. This print data is supplied to the head driver 76, and the head driver 76 generates heat in each heat generating element of the heat generating element array 19 according to the print data, whereby an image is recorded on each heat sensitive coloring layer of the color thermosensitive recording paper 12. . The color thermal recording paper 12 on which the image is recorded is fixed by the fixing device 28, then cut by the cutting device 32 in units of image defects, and discharged to the outside of the apparatus main body 11 through the print discharge port 34. Will be.
[0061]
In the above description, conversion data for realizing correction corresponding to the weighted average of correction under the first correction condition according to the present invention and correction under the second correction condition according to the present invention is obtained, and the obtained conversion data is obtained. As an example, a mode corresponding to the weighted average is applied to the processing target image data by converting the processing target image data by setting the 3D-LUT to the processing target. However, the present invention is not limited to this. Rather than being calculated, an arithmetic expression for performing correction corresponding to the weighted average is obtained, and correction corresponding to the weighted average is performed by performing correction calculation on the image data to be processed according to the arithmetic expression. You may do it.
[0062]
In the above description, the example in which the present invention is applied to the correction of image data in the color printer 10 configured to record an image on the color thermal recording paper 12 has been described. However, the present invention is widely applicable to the correction of digital images. For example, it can be converted into data by reading an image recorded on photographic film and applied to correction when creating a photographic print by exposure recording on photographic paper, or by imaging a subject with a digital still camera (DSC) or the like. It is also possible to apply the correction to the obtained image data (for example, image correction when performing photo processing requested via a network such as the Internet).
[0063]
The DSC stores an image correction program for realizing the image correction process described above and a conversion program for correcting the image data by converting the image data based on the conversion data generated by the image correction process. By doing so, the image correction according to the present invention may be performed by the DSC. In this aspect, the DSC functions as the image correction apparatus according to the present invention.
[0064]
Further, the image correction software and the conversion program described above may be added to image processing software for execution on a personal computer (PC) or the like so that the image correction according to the present invention is performed on the PC. In this aspect, the PC functions as the image correction apparatus according to the present invention. The image processing software also corresponds to the program according to claim 7.
[0065]
【The invention's effect】
As described above, the present invention corresponds to the first correction condition that is recognized based on the feature amount of the recognized main part area, and the highlight in the correction target object image. A weight for the second correction condition calculated so that the difference between the gradation value and the gradation value corresponding to the shadow becomes a predetermined value is set based on the dynamic range of the correction target image. Since the correction corresponding to the weighted average of the correction under the first correction condition and the correction under the second correction condition is performed, it is possible to appropriately correct the density of an image having a very small dynamic range. , Has an excellent effect.
[Brief description of the drawings]
FIG. 1 is a schematic configuration diagram of a color printer according to an embodiment.
FIG. 2 is a block diagram illustrating a schematic configuration of a control system of a color printer.
FIG. 3 is a flowchart showing the contents of image correction processing.
FIG. 4 is a conceptual diagram illustrating an example of a gray detection zone.
FIG. 5 is a conceptual diagram illustrating a specific pixel and eight neighboring pixels around the specific pixel.
FIG. 6 is a diagram showing an example of a relationship between a coefficient value multiplied by an in-screen average luminance difference Ymean and the number of divided regions (maximum number of regions, average number of regions, and minimum number of regions).
FIG. 7 is a diagram showing an example of a relationship between an area ratio Rs of a main region and a correction coefficient coef (Rs).
FIG. 8 is a diagram showing an example of a density correction curve.
FIG. 9 is a diagram showing an example of a luminance correction curve.
FIG. 10 is a conceptual diagram showing an outline of conversion according to a first conversion condition.
FIG. 11 is a diagram showing an example of conversion characteristics of a second conversion condition.
FIG. 12 is a diagram showing an example of a relationship between a dynamic range d and a weighting factor c (d).
[Explanation of symbols]
10 Color printer
12 color thermal recording paper
18 Thermal head
28 Fixing device
32 Cutting device
60 CPU
68 frame memory

Claims (7)

補正対象画像の主要部領域を認識し、認識した主要部領域の特徴量に基づいて前記補正対象画像を補正するための第1の補正条件を演算する第1演算手段と、
前記補正対象対象画像におけるハイライトに相当する階調値とシャドーに相当する階調値の差が所定値となるように前記補正対象画像を補正するための第2の補正条件を演算する第2演算手段と、
前記補正対象画像のダイナミックレンジに基づいて前記第1の補正条件及び前記第2の補正条件に対する重みを設定する設定手段と、
前記設定手段によって設定された重みに基づき、前記補正対象画像に対し、前記第1演算手段によって演算された第1の補正条件での補正と、前記第2演算手段によって演算された第2の補正条件での補正の加重平均に相当する補正を行う補正手段と、
を含む画像補正装置。
First calculating means for recognizing a main part region of the correction target image and calculating a first correction condition for correcting the correction target image based on a feature amount of the recognized main part region;
A second calculation for calculating a second correction condition for correcting the correction target image so that a difference between a gradation value corresponding to highlight and a gradation value corresponding to shadow in the correction target image becomes a predetermined value. Computing means;
Setting means for setting weights for the first correction condition and the second correction condition based on the dynamic range of the correction target image;
Based on the weight set by the setting unit, the correction target image is corrected under the first correction condition calculated by the first calculation unit and the second correction calculated by the second calculation unit. Correction means for performing correction corresponding to a weighted average of corrections under conditions;
An image correction apparatus including:
前記第1演算手段は、前記補正対象画像のうち彩度が所定値以下の画素群の色座標上での分布に基づいて色バランスの補正条件を設定すると共に、認識した主要部領域の特徴量から求めた補正対象濃度が所定の目標濃度に変換されるように濃度の補正条件を設定し、前記第1の補正条件として、設定した補正条件で補正対象画像の色バランス及び濃度を補正する補正条件を演算することを特徴とする請求項1記載の画像補正装置。The first calculation means sets a color balance correction condition based on a distribution on a color coordinate of a pixel group having a saturation equal to or less than a predetermined value in the correction target image, and also recognizes a feature amount of a recognized main region. A correction condition for density is set so that the correction target density obtained from the above is converted to a predetermined target density, and the color balance and density of the correction target image are corrected under the set correction condition as the first correction condition. The image correction apparatus according to claim 1, wherein the condition is calculated. 前記第2演算手段は、前記第2の補正条件として、前記補正対象画像における各色成分毎のハイライトに相当する階調値が各々第1の所定値になり、前記補正対象画像におけるシャドーに相当する階調値が第2の所定値となるように補正対象画像を補正する補正条件を演算することを特徴とする請求項1記載の画像補正装置。The second calculation means has, as the second correction condition, gradation values corresponding to highlights for the respective color components in the correction target image, respectively, become first predetermined values, and corresponds to shadows in the correction target image. The image correction apparatus according to claim 1, wherein a correction condition for correcting the correction target image is calculated so that a gradation value to be adjusted becomes a second predetermined value. 前記第1の補正条件及び第2の補正条件は、前記補正対象画像を変換することで補正するための変換条件であり、前記補正手段は、第1の補正条件に相当する変換条件と第2の補正条件に相当する変換条件の加重平均に相当する変換条件を求め、該求めた変換条件に従って補正対象画像を変換することで、前記加重平均に相当する補正を行うことを特徴とする請求項1記載の画像補正装置。The first correction condition and the second correction condition are conversion conditions for correcting the image to be corrected by converting the correction target image, and the correction means includes a conversion condition corresponding to the first correction condition and a second correction condition. A conversion condition corresponding to a weighted average of conversion conditions corresponding to the correction condition is obtained, and correction corresponding to the weighted average is performed by converting a correction target image according to the obtained conversion condition. The image correction apparatus according to 1. 前記補正手段は3次元ルックアップテーブルを含んで構成され、前記求めた変換条件を前記3次元ルックアップテーブルにセットした後に補正対象画像のデータを入力することで前記補正を行うことを特徴とする請求項4記載の画像補正装置。The correction unit includes a three-dimensional lookup table, and performs the correction by inputting data of a correction target image after setting the obtained conversion condition in the three-dimensional lookup table. The image correction apparatus according to claim 4. 補正対象画像の主要部領域を認識し、認識した主要部領域の特徴量に基づいて前記補正対象画像を補正するための第1の補正条件を演算し、
且つ、前記補正対象対象画像におけるハイライトに相当する階調値とシャドーに相当する階調値の差が所定値となるように前記補正対象画像を補正するための第2の補正条件を演算すると共に、
前記補正対象画像のダイナミックレンジに基づいて前記第1の補正条件及び前記第2の補正条件に対する重みを設定し、
設定した重みに基づき、前記補正対象画像に対し、前記演算した第1の補正条件での補正と、前記演算した第2の補正条件での補正の加重平均に相当する補正を行う画像補正方法。
Recognizing the main part region of the correction target image, calculating a first correction condition for correcting the correction target image based on the feature amount of the recognized main part region,
In addition, a second correction condition for correcting the correction target image is calculated so that a difference between the gradation value corresponding to the highlight in the correction target image and the gradation value corresponding to the shadow becomes a predetermined value. With
Setting weights for the first correction condition and the second correction condition based on the dynamic range of the correction target image;
An image correction method for performing correction corresponding to a weighted average of correction under the calculated first correction condition and correction under the calculated second correction condition on the correction target image based on a set weight.
コンピュータを、
補正対象画像の主要部領域を認識し、認識した主要部領域の特徴量に基づいて前記補正対象画像を補正するための第1の補正条件を演算する第1演算手段、
前記補正対象対象画像におけるハイライトに相当する階調値とシャドーに相当する階調値の差が所定値となるように前記補正対象画像を補正するための第2の補正条件を演算する第2演算手段、
前記補正対象画像のダイナミックレンジに基づいて前記第1の補正条件及び前記第2の補正条件に対する重みを設定する設定手段、
前記設定手段によって設定された重みに基づき、前記補正対象画像に対し、前記第1演算手段によって演算された第1の補正条件での補正と、前記第2演算手段によって演算された第2の補正条件での補正の加重平均に相当する補正を行う補正手段
として機能させるためのプログラム。
Computer
A first calculation means for recognizing a main part region of the correction target image and calculating a first correction condition for correcting the correction target image based on a feature amount of the recognized main part region;
A second calculation for calculating a second correction condition for correcting the correction target image so that a difference between a gradation value corresponding to highlight and a gradation value corresponding to shadow in the correction target image becomes a predetermined value. Computing means,
Setting means for setting weights for the first correction condition and the second correction condition based on a dynamic range of the correction target image;
Based on the weight set by the setting unit, the correction target image is corrected under the first correction condition calculated by the first calculation unit and the second correction calculated by the second calculation unit. A program for functioning as correction means for performing correction corresponding to a weighted average of correction under conditions.
JP2003086953A 2003-03-27 2003-03-27 Image correction apparatus, method, and program Expired - Fee Related JP4057939B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003086953A JP4057939B2 (en) 2003-03-27 2003-03-27 Image correction apparatus, method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003086953A JP4057939B2 (en) 2003-03-27 2003-03-27 Image correction apparatus, method, and program

Publications (2)

Publication Number Publication Date
JP2004297439A true JP2004297439A (en) 2004-10-21
JP4057939B2 JP4057939B2 (en) 2008-03-05

Family

ID=33401434

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003086953A Expired - Fee Related JP4057939B2 (en) 2003-03-27 2003-03-27 Image correction apparatus, method, and program

Country Status (1)

Country Link
JP (1) JP4057939B2 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006120839A1 (en) * 2005-05-13 2006-11-16 Konica Minolta Photo Imaging, Inc. Image processing method, image processing device, and image processing program
CN100461828C (en) * 2005-08-31 2009-02-11 奥林巴斯映像株式会社 Device and method for processing images
JP2009038827A (en) * 2006-02-21 2009-02-19 Seiko Epson Corp Exposure determination apparatus, and method of determining same
WO2009078862A1 (en) * 2007-12-17 2009-06-25 Hewlett-Packard Development Company, L.P. Image processing using target values
CN103701463A (en) * 2012-08-24 2014-04-02 亚德诺半导体技术公司 Input current cancellation scheme for fast channel switching systems

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006120839A1 (en) * 2005-05-13 2006-11-16 Konica Minolta Photo Imaging, Inc. Image processing method, image processing device, and image processing program
US8170364B2 (en) 2005-05-13 2012-05-01 Konica Minolta Opto, Inc. Image processing method, image processing device, and image processing program
CN100461828C (en) * 2005-08-31 2009-02-11 奥林巴斯映像株式会社 Device and method for processing images
JP2009038827A (en) * 2006-02-21 2009-02-19 Seiko Epson Corp Exposure determination apparatus, and method of determining same
WO2009078862A1 (en) * 2007-12-17 2009-06-25 Hewlett-Packard Development Company, L.P. Image processing using target values
CN103701463A (en) * 2012-08-24 2014-04-02 亚德诺半导体技术公司 Input current cancellation scheme for fast channel switching systems
CN103701463B (en) * 2012-08-24 2017-04-19 亚德诺半导体集团 Input current cancellation scheme for fast channel switching systems

Also Published As

Publication number Publication date
JP4057939B2 (en) 2008-03-05

Similar Documents

Publication Publication Date Title
JP4978378B2 (en) Image processing device
JP2002344989A (en) Output image adjustment apparatus for image files
US6836345B1 (en) Method for including traditional photographic calibration into digital color management
JP2003203231A (en) Image processing method for keeping black level
JP4655210B2 (en) Density correction curve generation method and density correction curve generation module
JP4057939B2 (en) Image correction apparatus, method, and program
JP2004088345A (en) Image forming method, image processor, print preparation device, and storage medium
JP4441876B2 (en) Photographed image processing method, photographed image processing program, and photographed image processing apparatus
JP2000092337A (en) Image processing method, its device and recording medium
JP4798446B2 (en) Photographed image correction method and photographed image correction module
JP2005159387A (en) Method of determining density characteristic curve and density correction management apparatus for executing this method
JP4284604B2 (en) Contrast adjustment method and contrast adjustment apparatus for implementing the method
JP2002094810A (en) Picture processor, picture processing method and memory medium having stored programs for the method
JP4402041B2 (en) Image processing method and apparatus, and storage medium
JP2000222564A (en) Image forming device
JP2006072743A (en) Catch light composition method and device
JP2006146646A (en) Method and apparatus for processing photographic image
JP2000270222A (en) Image processor, image processing method and photographing device
JP2008160704A (en) Density correction curve generation method and density correction curve generation module
JP2024047232A (en) Image processing method and image processing device
JP3883711B2 (en) White balance adjustment method and apparatus, and recording medium
JP2003264711A (en) Image processing method, image processor and image recorder
JP3530640B2 (en) Digital image recording method and apparatus, and digital image processing apparatus
JP2001292332A (en) Color correction method, color correction device, and recording medium for recording color correction control program
JP2003348343A (en) Output image adjustment method for image file

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050303

A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20061220

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20070801

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070807

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070921

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: 20071211

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20071214

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20101221

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20101221

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20111221

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20111221

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20121221

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20121221

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20131221

Year of fee payment: 6

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees