JP4060024B2 - Color balance adjusting method and apparatus, and recording medium - Google Patents
Color balance adjusting method and apparatus, and recording medium Download PDFInfo
- Publication number
- JP4060024B2 JP4060024B2 JP2000139747A JP2000139747A JP4060024B2 JP 4060024 B2 JP4060024 B2 JP 4060024B2 JP 2000139747 A JP2000139747 A JP 2000139747A JP 2000139747 A JP2000139747 A JP 2000139747A JP 4060024 B2 JP4060024 B2 JP 4060024B2
- Authority
- JP
- Japan
- Prior art keywords
- light source
- color balance
- white point
- parameter
- image data
- 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
Links
Images
Landscapes
- Image Processing (AREA)
- Color Television Image Signal Generators (AREA)
- Processing Of Color Television Signals (AREA)
- Facsimile Image Signal Circuits (AREA)
- Color Image Communication Systems (AREA)
Description
【0001】
【発明の属する技術分野】
本発明は、画像のカラーバランスを調整するカラーバランス調整方法および装置並びにカラーバランス調整方法をコンピュータに実行させるためのプログラムを記録したコンピュータ読取り可能な記録媒体に関するものである。
【0002】
【従来の技術】
デジタル電子スチルカメラ(以下デジタルカメラとする)においては、撮影により取得した画像をデジタル画像データとしてデジタルカメラ内部に設けられた内部メモリやICカードなどの記録媒体に記憶し、記憶されたデジタル画像データに基づいて、プリントなどのハードコピーとしてあるいはディスプレイ上にソフトコピーとして撮影により取得した画像を再現することができる。このように、デジタルカメラにより取得した画像を再現する場合においては、ネガフイルムからプリントされた写真と同様の高品位な画質を有するものとすることが期待されている。
【0003】
一方、人間の視覚には色順応といって、昼光やそれと分光エネルギー分布の異なる蛍光灯下やタングステン光下において白い紙を見ても、青っぽいあるいは赤っぽいというようには知覚せず、基本的には白として認識する機構が作用する。このような色順応を考慮し、タングステン光、蛍光灯あるいは屋外の昼光のように撮影光源が異なっても、光源色に依存しない画像を得ることができるように、撮影された画像を表す画像データに対して撮影光源に応じたホワイトバランス調整処理(AWB処理)を自動的に施すようにした機能(AWB機能)を有するデジタルカメラが提案されている。
【0004】
このような、ホワイトバランス調整方法としては、von Kriesの色順応予測式に従う方法が用いられている。この方法は、光源1において撮影した画像を光源2下において観察する場合に、光源1および光源2の白色点の生理原色に基づく三刺激値がL1w,M1w,S1wおよびL2w,M2w,S2wであるとすると、ホワイトバランス調整前の光源1下における画像のLMS三刺激値(L,M,S)1を、下記の式(1)に示すようにホワイトバランス調整後の光源2下における画像のLMS三刺激値(L,M,S)2に変換するものである。
【0005】
【数1】
しかしながら、von Kriesの色順応予測式に従う方法は、昼光光源の場合には白色以外の顔等の色も適切に調整することができるが、例えば蛍光灯やタングステン光のような特殊な光源下において撮影された画像については、白色以外の顔等の色が不自然な色に変換されてしまうという問題がある。
【0006】
このため、生理原色の変換を上記式(1)に示すように対角項にのみ0でない値を有するマトリクスを用いるのではなく、非対角項も0でない値を有するマトリクスを用いて行うことにより画像のカラーバランスを調整する方法も提案されている。以下この方法について説明する。
【0007】
自然界の物体の分光反射率は3つの主成分により代表できることが一般的に知られている。したがって、撮影した物体の分光反射率は、3つの主成分x1(λ),x2(λ),x3(λ)(λ:スペクトル周波数)の線形結合として下記の式(2)に示すように表すことができる。
【0008】
【数2】
但し、a1,a2,a3は各主成分を重み付け加算する際の重みである。
【0009】
光源1の分光放射分布をF(λ)とし、三刺激値のL−cone,M−cone,S−coneをそれぞれ
【数3】
となる。なお、式(3)〜(5)において積分は可視領域の積分であるが、全スペクトル領域において積分を行ってもよい。ここで、光源1の分光放射分布F(λ)、各主成分x1(λ),x2(λ),x3(λ)および
【数4】
のように置き換えると、光源1下において分光反射率x(λ)の物体を見たときのLMS三刺激値は、
【数5】
となる。同様に、光源2下において分光反射率x(λ)の物体を見たときのLMS三刺激値は、
【数6】
となる。式(7)および(8)からa1,a2,a3を消去すると、
【数7】
となり、光源1下におけるLMS三刺激値(y1とする)から光源2下におけるLMS三刺激値(y2とする)への変換は、式(9)より、
【数8】
のように非対角成分をも有する3×3のマトリクスP2P1 −1により行うことができる。
【0010】
【発明が解決しようとする課題】
しかしながら、デジタルカメラにより撮影を行うことにより得られた画像データは、どのような光源下において撮影を行うことにより得られたものであるかは不明であり、その結果、撮影時の光源の分光強度分布も不明であることから、上記式(10)におけるマトリクスP1を求めることができず、その結果変換に使用する3×3のマトリクスを得ることができないという問題がある。また、デジタルカメラにおいて得られる画像データは、すでにカラーバランス調整処理が施されている場合があるが、このような場合、得られる画像データはどのような観察光源を前提としてカラーバランス調整処理が施されているか分からない。このため、このようにすでにカラーバランス調整処理が施された画像データに対して、ある特定の観察光源下において画像を観察するためにカラーバランスを調整処理を施す場合、上記と同様に変換に使用するマトリクスを得ることができない。
【0011】
本発明は上記事情に鑑みなされたものであり、カラーバランスの調整を行うためのマトリクスが未知の光源下において撮影された画像であっても、またすでにカラーバランス調整処理が施された画像であっても、適切にカラーバランスを調整できるカラーバランス調整方法および装置並びにカラーバランス調整方法をコンピュータに実行させるためのプログラムを記録したコンピュータ読取り可能な記録媒体を提供することを目的とするものである。
【0012】
【課題を解決するための手段】
本発明によるカラーバランス調整方法は、所定の撮影光源下において被写体を撮影することにより取得した画像を所定の観察光源下において観察する際に、前記画像を表す画像データに対してまたは前記所定の観察光源とは異なる他の光源下において観察することを前提としたカラーバランス調整処理が施された画像データカラーバランスを調整する処理を施して処理済み画像データを得るカラーバランス調整方法において、
複数の光源について該各光源の白色点および該各光源下における三刺激値を前記観察光源下における三刺激値に変換するための光源パラメータを予め記憶手段に記憶し、
前記撮影光源または前記他の光源の白色点を算出し、
該撮影光源または前記他の光源の白色点に近い白色点を有する光源を前記複数の光源から選択し、前記撮影光源または前記他の光源の白色点および前記選択された光源の白色点に基づいて前記選択された光源の光源パラメータに対して補間演算を施して、前記撮影光源下または前記他の光源下における三刺激値を前記観察光源下における三刺激値に変換するための処理パラメータを生成し、
該処理パラメータに基づいて、前記画像データの三刺激値を前記観察光源下における三刺激値に変換して前記処理済み画像データを得ることを特徴とするものである。
【0013】
複数の光源から選択された光源は複数である必要はなく、1つのみであってもよい。
【0014】
「三刺激値」としては、撮影を行う撮像装置の分光特性に関連する色空間の三刺激値(例えばRGB三刺激値)であってもよく、人間の視覚特性に関連する色空間の三刺激値(例えば生理原色に基づくLMS三刺激値)であってもよい。
【0015】
「光源パラメータ」とは、ある光源下において撮影を行うことにより得られた画像を観察光源下において観察する際に、光源に依存しない色の画像を得ることができるように、その光源下における三刺激値を観察光源下の三刺激値に変換するためのパラメータである。
【0016】
なお、本発明によるカラーバランス調整方法においては、前記補間演算は、前記選択された光源の白色点と前記撮影光源または前記他の光源の白色点との距離を算出し、
該距離に基づいて前記光源パラメータを重み付け加算する演算であることが好ましい。
【0017】
この場合、前記重み付け加算による白色点のずれをさらに修正して前記処理パラメータを生成することが好ましい。
【0018】
また、本発明によるカラーバランス調整方法においては、前記処理パラメータを新たな光源の光源パラメータとして、前記記憶手段に記憶することが好ましい。
【0019】
さらに、本発明によるカラーバランス調整方法においては、前記撮影光源または前記他の光源の指定を受け付け、
該指定された撮影光源または他の光源に応じて、前記処理パラメータの生成と、該処理パラメータの生成とは異なる他の方法による他の処理パラメータの生成とを切替可能とすることが好ましい。
【0020】
ここで、撮影光源または他の光源の指定の受け付けは、例えば本発明を実施するための装置において、キーボード、光源を指定するキー等からの入力を受け付けることにより行うことができる。また、撮影時に画像データに撮影光源に関する情報を付与しておく、またはカラーバランス調整処理時に観察を前提とする他の光源の情報を付与しておき、処理パラメータの生成時に画像データに付与された撮影光源または他の光源に関する情報を読み取ることにより、撮影光源または他の光源の指定を受け付けるようにしてもよい。
【0021】
「他の方法」とは、本発明によるカラーバランス調整方法における処理パラメータの生成よりも簡易な処理により処理パラメータを生成する方法であり、例えば上述したvon Kriesの色順応予測式に基づく方法、画像データがRGB色信号からなる場合に、各色信号の平均値を一致させる方法等を採用することができる。
【0022】
本発明によるカラーバランス調整装置は、所定の撮影光源下において被写体を撮影することにより取得した画像を所定の観察光源下において観察する際に、前記画像を表す画像データまたは前記所定の観察光源とは異なる他の光源下において観察することを前提としたカラーバランス調整処理が施された画像データに対してカラーバランスを調整する処理を施して処理済み画像データを得るカラーバランス調整装置において、
複数の光源について該各光源の白色点および該各光源下における三刺激値を前記観察光源下における三刺激値に変換するための光源パラメータを予め記憶した記憶手段と、
前記撮影光源または前記他の光源の白色点を算出する白色点算出手段と、
該撮影光源または前記他の光源の白色点に近い白色点を有する光源を前記複数の光源から選択し、前記撮影光源または前記他の光源の白色点および前記選択された光源の白色点に基づいて前記選択された光源の光源パラメータに対して補間演算を施して、前記撮影光源下または前記他の光源下における三刺激値を前記観察光源下における三刺激値に変換するための処理パラメータを生成するパラメータ生成手段と、
該処理パラメータに基づいて、前記画像データの三刺激値を前記観察光源下における三刺激値に変換して前記処理済み画像データを得る処理手段とを備えたことを特徴とするものである。
【0023】
なお、本発明によるカラーバランス調整装置においては、前記パラメータ生成手段は、前記補間演算を、前記選択された光源の白色点と前記撮影光源または前記他の光源の白色点との距離を算出し、
該距離に基づいて前記光源パラメータを重み付け加算することにより行う手段であることが好ましい。
【0024】
この場合、前記パラメータ生成手段は、前記重み付け加算による白色点のずれをさらに修正して前記処理パラメータを生成する手段であることが好ましい。
【0025】
なお、前記三刺激値は、人間の視覚特性に関連する色空間における三刺激値であってもよく、前記画像を撮影した撮影装置の分光特性に関連する色空間の三刺激値であってもよい。
【0026】
また、本発明によるカラーバランス調整装置においては、前記記憶手段は、前記処理パラメータを新たな光源の光源パラメータとして記憶する手段であることが好ましい。
【0027】
さらに、本発明によるカラーバランス調整装置においては、前記撮影光源または前記他の光源の指定を受け付ける受付手段と、
前記パラメータ生成手段における処理パラメータの生成とは異なる他の方法により他の処理パラメータの生成を行う他のパラメータ生成手段と、
前記受付手段による撮影光源または他の光源の指定に応じて、前記パラメータ生成手段による処理パラメータの生成と、前記他のパラメータ生成手段による他の処理パラメータの生成とを切り替える切替手段とをさらに備えることが好ましい。
【0028】
なお、本発明によるカラーバランス調整方法をコンピュータに実行させるためのプログラムとして、コンピュータ読取り可能な記録媒体に記録して提供してもよい。
【0029】
また、本発明によるカラーバランス調整装置を、デジタルカメラのような撮像装置に設けてもよい。
【0030】
さらに、本発明によるカラーバランス調整装置を、プリンタ、モニタのような出力装置に設けてもよい。
【0031】
【発明の効果】
本発明によれば、複数の光源についての白色点および各光源下における三刺激値を、画像を観察する観察光源下における三刺激値に変換するための光源パラメータが予め用意されて記憶手段に記憶されている。そして、撮影により取得された画像の白色点が算出され、複数の光源から撮影光源または所定の観察光源とは異なる他の光源の白色点に近い白色点を有する光源が選択される。次いで、撮影光源または他の光源の白色点および選択された光源の白色点に基づいて、選択された光源の光源パラメータに対して補間演算を施して、撮影光源下または他の光源下における三刺激値を観察光源下における三刺激値に変換するための処理パラメータが生成される。これは例えば三刺激値の色空間において、選択された光源の白色点および撮影光源または他の光源の白色点をプロットし、選択された光源の白色点と撮影光源または他の光源の白色点との距離を求め、この距離に応じて選択された光源の光源パラメータを重み付け加算することにより求められる。そして生成された処理パラメータにより画像データの三刺激値を観察光源下における三刺激値に変換することにより処理済み画像データが得られる。
【0032】
したがって、本発明によれば、撮影光源下または他の光源下における三刺激値を観察光源下における三刺激値に変換するための処理パラメータが未知であっても、光源パラメータからその処理パラメータを求めることができるため、この処理パラメータにより画像データの三刺激値を変換することによって得られた処理済み画像データにより表される処理済み画像を、適切にカラーバランスが調整されたものとすることができる。
【0033】
また、三刺激値の色空間において、選択された光源の白色点と撮影光源または他の光源との白色点との距離を算出し、この距離に基づいて光源パラメータを重み付け加算することにより、簡易な演算により処理パラメータを生成できるため、処理パラメータ生成のための演算時間を短縮できる。
【0034】
この場合、三刺激値の色空間において、撮影光源または他の光源の白色点が複数の光源の白色点を結んだ直線上に位置する場合には、撮影光源下または他の光源下における三刺激値を観察光源下における三刺激値に変換するための処理パラメータを適切に得ることができる。しかしながら、撮影光源または他の光源の白色点が複数の光源の白色点を結んだ直線上に位置しない場合には、得られた処理パラメータにより撮影光源下または他の光源下における画像データの三刺激値を変換すると、処理済み画像の白色点が本来得られるべき白色点からずれてしまい、処理済み画像の色が不自然なものとなってしまう。このため、重み付け加算による白色点のずれを修正することにより、不自然な色のない処理済み画像を得ることができる。
【0035】
また、三刺激値を人間の視覚特性に関連する色空間の三刺激値とすることにより、人間がものを見た際に認識する色に基づいてカラーバランス調整を行うことができるため、見た目の印象に忠実な画像が再現されるようなカラーバランス調整処理を行うことができる。
【0036】
さらに、三刺激値を画像を撮影した撮影装置の分光特性に関連する色空間の三刺激値とすることにより、デジタルカメラなどの撮影装置において取得されたデータに対して何ら色変換を行うことなくカラーバランス調整処理を行うことができるため、装置の構成を簡易なものとすることができ、かつ処理を高速に行うことができる。
【0037】
また、生成された処理パラメータを新たな光源の光源パラメータとして記憶手段に記憶することにより、この新たな光源と同一の撮影光源において撮影を行うことにより得られた画像またはこの新たな光源と同一の光源下において観察することを前提としたカラーバランス調整処理が施された画像のカラーバランスを調整する際には、同一の演算を行って処理パラメータを生成する必要がなくなるため、カラーバランス調整処理を効率よく行うことができる。
【0038】
さらに、処理パラメータの生成と、他の方法による処理パラメータの生成とを撮影光源または他の光源の指定に応じて切替可能とすることにより、例えば昼光下において撮影を行うことにより得られた画像のように簡易に処理パラメータを生成することができる場合には、他の方法により処理パラメータを生成すれば、処理を高速に行うことができる。
【0039】
【発明の実施の形態】
以下図面を参照して本発明の実施形態について説明する。
【0040】
図1は本発明の第1の実施形態によるカラーバランス調整装置の構成を示す概略ブロック図である。図1に示すように、本実施形態によるカラーバランス調整装置1は、デジタルカメラ2においてシーンを撮影することにより取得された画像データS0に対してカラーバランス調整処理を施して処理済み画像データS3を得るためのものであり、画像データS0が記憶されたメモリカード2Aから画像データS0を読み出すカードスロット等の読出手段3と、画像データS0から画像データS0により表される画像における白色点の生理原色に基づく三刺激値L1w,M1w,S1wを算出する白色点算出手段4と、複数の光源(以下既知光源とする)について各既知光源下における三刺激値を、処理済み画像データS3を観察する観察光源下における三刺激値に変換するためのパラメータ(以下既知光源パラメータとする)および各既知光源の白色点の三刺激値を記憶したデータベース5と、後述するように画像データS0に対してカラーバランス調整処理を施すための処理パラメータPをデータベース5に記憶された既知光源パラメータに基づいて生成するパラメータ生成手段6と、パラメータ生成手段6において生成された処理パラメータPに基づいて画像データS0に対してカラーバランス調整処理を施して処理済み画像データS3を得るカラーバランス調整処理手段7とを備える。
【0041】
なお、第1の実施形態においては、撮影者はデジタルカメラ2により普通蛍光灯のように、その光源下における三刺激値を観察光源下における三刺激値に変換するためのパラメータが未知の光源下(光源1とする)においてシーンの撮影を行うことにより、画像データS0を取得したものとする。また、処理済み画像データS3の観察光源を光源2とする。
【0042】
ここで、デジタルカメラ2において取得された画像データS0は、ITU Rec.709規格に準拠したRGB各色8ビットの信号値からなるものとし、各信号値をR0,G0,B0として説明する。
【0043】
白色点算出手段4は、画像データS0を構成する各色信号R0,G0,B0を下記の式(11),(12)により0〜1の値に正規化された信号値R1に変換する。
【0044】
【数9】
なお、ここでは色信号R1についてのみ説明したが、信号値G1,B1についても信号値R1と同様の演算により求める。
【0045】
次いで、画像データS0により表される画像の全画素数Nを用いて、下記の式(13)により信号値R1,G1,B1の平均値R2,G2,B2を算出する。
【0046】
【数10】
そして、算出された平均値R2,G2,B2を下記の式(14)によりCIE1931XYZ三刺激値に変換し、これを画像データS0により表される画像における白色点の三刺激値X1w,Y1w,Z1wとする。
【0047】
【数11】
さらに、三刺激値X1w,Y1w,Z1wを下記の式(15)により生理原色に基づく三刺激値に変換し、これを光源1下において撮影を行うことにより得られた画像データS0により表される画像における白色点の生理原色に基づく三刺激値L1w,M1w,S1wとする。
【0048】
【数12】
データベース5には複数の既知光源について、各既知光源下における三刺激値を光源2下における三刺激値に変換するための既知光源パラメータが記憶されている。なお、この既知光源パラメータは上記式(10)における3×3のマトリクスである。また、既知光源パラメータは既知光源の白色点の三刺激値と対応付けられてデータベース5に記憶されている。
【0049】
ここで、既知光源パラメータの算出について説明する。既知光源の分光強度分布は既知であり、観察光源である光源2の分光強度分布も既知である。例えば処理済み画像データS3をプリント出力する場合は観察光源はCIE−D50であり、モニタに再生する場合はCIE−D65である。したがって、上記式(2)〜(10)により、下記の式(16)に示すように、ある既知光源A下におけるLMS三刺激値を光源2下におけるLMS三刺激値に変換するための3×3のマトリクスP2PA −1を求めることができる。そしてこのマトリクスP2PA −1が既知光源パラメータとしてデータベース5に記憶されてなるものである。なお、マトリクスP2とマトリクスPA −1とを別個に求め、マトリクスPA −1を既知光源パラメータとしてもよい。
【0050】
y2=P2PA −1yA (16)
但し、y2:光源2下におけるLMS三刺激値
yA:既知光源A下におけるLMS三刺激値
P2:光源2下において分光反射率x(λ)の物体を見たときのLMS値を求めるための3×3のマトリクス
PA:既知光源A下において分光反射率x(λ)の物体を見たときのLMS値を求めるための3×3のマトリクス
なお、例えばマンセルカラーチップ中の1269色のように多数色の分光反射率データを用いて、既知光源下Aおよび光源2下におけるLMS三刺激値を求め、最小二乗法などによって三刺激値yAを三刺激値y2に変換するためのマトリクスを既知光源パラメータとして求めるようにしてもよい。ここで、求めたマトリクスはP2PA −1に相当するため、上記式(8)によりマトリクスP2を求め、これを用いてマトリクスPA −1を求めれば、マトリクスP2とマトリクスPA −1とを別個に得ることができる。
【0051】
また、既知光源Aの白色が光源2の白色に変換されるように、マトリクスを決定することもできる。これはまず、上記マンセルカラーチップのような多数色の分光反射率データを用いて、既知光源Aおよび光源2下におけるLMS三刺激値を求め、最小二乗法などによって三刺激値yAを三刺激値y2に変換するためのマトリクスを求める。この際、既知光源Aにおける白色が光源2の白色に変換されるよう、下記の式(17)に示すように、求めるマトリクスをvon Kriesの色順応予測式に基づくマトリクスVと、三刺激値yAに垂直なマトリクスV′とに分解してマトリクスV,V′を求める。
【0052】
y2=(VA+VA′)yA (17)
但し、VA′yA=0
この場合、P2PA −1=VA+VA′となる。このように、既知光源Aの白色が光源2の白色に変換されるように、マトリクスを決定することにより、既知光源A下における白色と光源2下における白色とを一致させることができるため、より好ましい。なお、上記式(8)によりマトリクスP2を求め、これを用いてマトリクスPA −1を求めれば、マトリクスP2とマトリクスPA −1とを別個に得ることができる。
【0053】
パラメータ生成手段6は、光源1の白色点の三刺激値L1w,M1w,S1wおよび光源1の白色点に近い白色点を有する既知光源の白色点の三刺激値に基づいて、データベース5に記憶された既知光源パラメータから画像データS0のカラーバランス調整処理を行うための処理パラメータPを生成するものである。以下、この処理パラメータPの生成について説明する。
【0054】
まず、パラメータ生成手段6は、LMS色空間において白色点算出手段4から入力された白色点の三刺激値L1w,M1w,S1wと、データベース5に記憶された既知光源の白色点の三刺激値との距離を求め、この距離が最も小さい2つの既知光源を選択する。具体的には、データベース5に記憶された既知光源の白色点の三刺激値および三刺激値L1w,M1w,S1wをLMS色空間にプロットし、LMS色空間において、光源1の白色点に最も近い位置にあるすなわち同種の光源と見なすことができる既知光源を選択する。ここでは、図2に示すように既知光源A,Bが選択されたものとする。
【0055】
ここで、既知光源Aの既知光源パラメータは上記式(16)におけるP2PA −1であり、既知光源Bの既知光源パラメータは下記の式(18)におけるP2PB −1である。
【0056】
y2=P2PB −1yB (18)
但し、yB:既知光源B下におけるLMS三刺激値
PB:既知光源B下において分光反射率x(λ)の物体を見たときのLMS値を求めるための3×3のマトリクス
また、上記式(17)と同様に、下記の式(19)により既知光源Bのパラメータを求めることもできる。
【0057】
y2=(VB+VB′)yB (19)
但し、VB′yB=0
このように2つの既知光源A,Bが選択されると、LMS色空間上において既知光源A,Bの白色点(点A,Bとする)を結ぶ直線ABと、光源1の白色点(図2における×点)から直線ABに下した垂線との交点Cを求める。ここで、交点Cにより直線ABが1−α:αの分割比率により分割されるとすると、交点Cは、図3に示すように既知光源Aの分光強度分布と既知光源Bの分光強度分布とをα:1−αの割合で合成した分光強度分布を有する光源の白色点に相当するものとなる。
【0058】
上記のようにして交点Cが求められると、既知光源A,Bの既知光源パラメータに対して補間演算を施すことにより、交点Cに対応する光源におけるパラメータを算出する。
【0059】
具体的には、上述したように算出したαに基づいて、交点Cに対応する光源下におけるLMS三刺激値を光源2下におけるLMS三刺激値に変換するためのマトリクスPcを下記の式(20)により求める。
【0060】
Pc=αP2PA −1+(1−α)P2PB −1 (20)
なお、マトリクスP2,PA −1,PB −1がそれぞれ別個に求められている場合には、下記の式(20′)に示すようにマトリクスPcを求めることができる。
【0061】
Pc=P2(αPA+(1−α)PB)−1 (20′)
したがって、交点Cに対応する光源下におけるLMS三刺激値yCは下記の式(21)により光源2下におけるLMS三刺激値に変換することができる。
【0062】
y2=PcyC (21)
一方、上記交点CはLMS色空間において既知光源A,Bの白色点を結ぶ直線AB上にあり光源1とは一致していない。したがって、光源1下における白色が光源2下における白色に変換されるように下記のようにしてマトリクスPcを補正する。まず、マトリクスPcに補正マトリクスΔPを加算して、下記の式(22)に示すように、光源1下における白色が光源2下における白色に変換されるようにすることを考える。
【0063】
【数13】
但し、L1w,M1w,S1w:光源1の白色点の生理原色に基づく三刺激値L2w,M2w,S2w:光源2の白色点の生理原色に基づく三刺激値次いで、マトリクスPcおよびΔPを、下記の式(23)、(24)に示すように、光源1から光源2へのvon Kriesの色順応予測式に従う成分Vと、その他の成分QcおよびΔQとに分解する。
【0064】
Pc=QcV (23)
ΔP=ΔQV (24)
ここで、三刺激値L1w,M1w,S1wと三刺激値L2w,M2w,S2wとは下記の式(25)に示す関係にあることから、式(23)および(24)を式(22)に代入すると下記の式(26)となる。
【0065】
【数14】
式(26)を変形すると下記の式(27)となる。
【0066】
【数15】
但し、E:単位行列
式(23)より
Qc=PcV−1 (28)
であることから、式(27)の右辺は既知である。したがって、
【数16】
のように置き換えを行うと、
【数17】
となる。ここで、ベクトル(q00,q01,q02)、(q10,q11,q12)、(q20,q21,q22)の値が最小となれば補正マトリクスΔPの成分も最小となるため、マトリクスPcに少ない補正を加えるのみで、光源1下における白色点を光源2下における白色点に変換できることとなる。
【0067】
ベクトル(q00,q01,q02)、(q10,q11,q12)、(q20,q21,q22)の値が最小となるのは、これらのベクトルがベクトル(L2w,M2w,S2w)に平行な場合である。したがって、下記の式(29)〜(31)によりベクトル(q00,q01,q02)、(q10,q11,q12)、(q20,q21,q22)を決定することにより、マトリクスΔQを求める。
【0068】
【数18】
よって、補正マトリクスΔPは上記式(24)により求めることができる。これにより、光源1下におけるLMS三刺激値を光源2下におけるLMS三刺激値に変換するためのマトリクスMは、
M=Pc+ΔP (32)
により求めることができる。
【0069】
このマトリクスMは、光源1下における白色点の三刺激値を光源2下における白色点の三刺激値に変換する。また、交点Cに対応する光源下におけるLMS三刺激値を光源2下におけるLMS三刺激値に変換するためのマトリクスPcを補正したものであるため、光源1下におけるLMS三刺激値を光源2下におけるLMS三刺激値に変換する特徴をも備えたものとなっている。
【0070】
そして、このようにして生成されたマトリクスMは処理パラメータPとしてカラーバランス調整処理手段7に入力される。カラーバランス調整処理手段7においては、まず、画像データS0を構成する色信号R0,G0,B0を上記式(11)、(12)により正規化された信号値R1,G1,B1に変換する。そして、下記の式(33)により信号値R1,G1,B1をCIE1931XYZ三刺激値X1,Y1,Z1に変換する。
【0071】
【数19】
さらに、三刺激値X1,Y1,Z1を下記の式(34)により生理原色に基づく三刺激値L1,M1,S1に変換する。
【0072】
【数20】
そして、下記の式(35)により上記マトリクスMを用いて三刺激値L1,M1,S1を変換して変換済み三刺激値L3,M3,S3を得る。
【0073】
【数21】
そして変換済み三刺激値L3,M3,S3に対して、式(34)および式(33)の逆変換を施して、処理済み画像データS3を構成する処理済み信号R3,G3,B3を得る。
【0074】
次いで、本実施形態の動作について説明する。
【0075】
図4は第1の実施形態の動作を示すフローチャートである。まず、デジタルカメラ2において撮影が行われて画像データS0が記憶されたメモリカード2Aから、読出手段3において画像データS0が読み出される(ステップS1)。そして、白色点算出手段4において画像データS0の白色点のLMS三刺激値L1w,M1w,S1wが算出される(ステップS2)。そしてパラメータ生成手段6において、この白色点のLMS三刺激値L1w,M1w,S1wおよびこの白色点に近い白色点を有する既知光源の白色点の三刺激値に基づいて、既知光源のパラメータから画像データS0を変換するためのマトリクスMが処理パラメータPとして生成される(ステップS3)。このように生成された処理パラメータPはカラーバランス調整処理手段7に入力され、この処理パラメータPにより画像データS0に対してカラーバランスを調整する処理が施されて処理済み画像データS3が得られ(ステップS4)、処理を終了する。
【0076】
このように、第1の実施形態においては、既知光源A,Bの既知光源パラメータから、光源1下において撮影を行うことにより得られた画像データS0に対してカラーバランス調整処理を施すための処理パラメータPを求めるようにしたため、この処理パラメータPにより光源1下において得られた画像データS0のカラーバランスを調整すれば、適切なカラーバランスを有する画像を再現可能な処理済み画像データS3を得ることができる。
【0077】
また、選択された既知光源A,Bの白色点と光源1との白色点との距離ABを算出し、この距離ABおよび光源1から直線ABに下した垂線との交点Cに基づいて既知光源A,Bのパラメータを重み付け加算することにより、簡易な演算により処理パラメータPを生成できるため、処理パラメータPの生成のための演算時間を短縮できる。
【0078】
さらに、人間の視覚特性に関連する色空間であるLMS色空間においてカラーバランス調整処理を行っているため、人間がものを見た際に認識する色に基づいてカラーバランス調整を行うことができ、これにより、見た目の印象に忠実な画像が再現されるようなカラーバランス調整処理を行うことができる。
【0079】
次いで、本発明の第2の実施形態について説明する。図5は本発明の第2の実施形態によるカラーバランス調整装置の構成を示す概略ブロック図である。なお、第2の実施形態において、第1の実施形態と同一の構成については同一の参照番号を付し、詳細な説明は省略する。第2の実施形態によるカラーバランス調整装置1は、読出手段3においてメモリカード2Aから読み出された画像データS0を表示するモニタ8と、画像データS0が蛍光灯下において撮影がなされた場合にそれを指定するための蛍光灯指定キー9とを備え、パラメータ生成手段6においては、蛍光灯指定キー9により蛍光灯が指定された場合には上記第1の実施形態と同様の処理により処理パラメータPを生成し、蛍光灯が指定されなかった場合には、式(1)に示すvon Kriesの色順応予測式に基づくマトリクスを処理パラメータPとして生成するようにしたものである。
【0080】
以下、第2の実施形態の動作について説明する。図6は第2の実施形態の動作を示すフローチャートである。まず、デジタルカメラ2において撮影が行われて画像データS0が記憶されたメモリカード2Aから、読出手段3において画像データS0が読み出される(ステップS11)。画像データS0はモニタ8に表示される(ステップS12)。また、白色点算出手段4において画像データS0の白色点のLMS三刺激値L1w,M1w,S1wが算出される(ステップS13)。そして、蛍光灯指定キー9がオンされたか否かが判断され(ステップS14)、オンされた場合には、上記第1の実施形態と同様の処理により処理パラメータPが生成される(ステップS15)。一方、蛍光灯指定キー9がオンされていない場合には、式(1)に示すvon Kriesの色順応予測式に基づくマトリクスが処理パラメータPとして生成される(ステップS16)。このように生成された処理パラメータPはカラーバランス調整処理手段7に入力され、この処理パラメータPにより画像データS0に対してカラーバランスを調整する処理が施されて処理済み画像データS3が得られ(ステップS17)、処理を終了する。
【0081】
このように、第2の実施形態においては、第1の実施形態により生成された処理パラメータPによるカラーバランス調整方法と、von Kriesの色順応予測式に基づく処理パラメータPによるカラーバランス調整方法とを、蛍光灯指定キー9のオン/オフに応じて切り替えるようにしたため、昼光下において撮影を行うことにより得られた画像のように、簡易にカラーバランス調整処理を施すことができる場合には、第1の実施形態の方法により処理パラメータPを生成しなくとも、von Kriesの色順応予測式のように簡易に処理パラメータPを生成できるため、処理を高速に行うことができる。
【0082】
なお、第2の実施形態においては、蛍光灯指定キー9により蛍光灯下において撮影が行われた場合を指定可能としているが、蛍光灯に加えてタングステン光のように他の種類の光源を指定可能としてもよい。また、蛍光灯を指定する場合に、普通型蛍光灯、3波長型蛍光灯、高演色型蛍光灯のように蛍光灯の種類を指定可能としてもよい。また、このように複数の種類の光源を指定可能とした場合、画像データS0をモニタ8に表示したのみでは、光源の種類を特定できない場合がある。このような場合には、何らかの光源を指定して処理を行って処理済み画像データS3を得、これをモニタ8に表示して所望とする色が得られたか否かを確認し、所望とする色が得られるまで光源の種類を変更してカラーバランス調整処理を行えばよい。
【0083】
次いで、本発明の第3の実施形態について説明する。図7は本発明の第3の実施形態によるカラーバランス調整装置の構成を示す概略ブロック図である。なお、第3の実施形態において、第1の実施形態と同一の構成については同一の参照番号を付し、詳細な説明は省略する。第3の実施形態によるカラーバランス調整装置1は、デジタルカメラ2に蛍光灯指定キー10を設け、撮影時に撮影者が画像データS0にその画像が蛍光灯下において撮影されたことを示す情報Fを付与するようにしたものである。そして、読出手段3においては画像データS0に情報Fが付与されている場合、この情報Fをパラメータ生成手段6に入力し、パラメータ生成手段6においては、画像データS0に情報Fが付与されている場合には上記第1の実施形態と同様の処理により処理パラメータPを生成し、情報Fが付与されていなかった場合には、式(1)に示すvon Kriesの色順応予測式に基づくマトリクスを処理パラメータPとして生成するようにしたものである。
【0084】
以下、第3の実施形態の動作について説明する。図8は第3の実施形態の動作を示すフローチャートである。まず、デジタルカメラ2において撮影が行われて画像データS0が記憶されたメモリカード2Aから、読出手段3において画像データS0が読み出される(ステップS21)。この際、撮影時に撮影手段2の蛍光灯指定キー10がオンとされて画像データS0に蛍光灯下で撮影がなされたことを表す情報Fが付与されている場合は、これも同時に読み出され、パラメータ生成手段6に入力される。また、白色点算出手段4において画像データS0の白色点のLMS三刺激値L1w,M1w,S1wが算出される(ステップS22)。そして、パラメータ生成手段6において情報Fが入力されたか否かが判断され(ステップS23)、情報Fが入力された場合には、上記第1の実施形態と同様の処理により処理パラメータPが生成される(ステップS24)。一方、情報Fが入力されていない場合には、式(1)に示すvon Kriesの色順応予測式に基づくマトリクスが処理パラメータPとして生成される(ステップS25)。このように生成された処理パラメータPはカラーバランス調整処理手段7に入力され、この処理パラメータPにより画像データS0に対してカラーバランスを調整する処理が施されて処理済み画像データS3が得られ(ステップS26)、処理を終了する。
【0085】
次いで、本発明の第4の実施形態について説明する。図9は本発明の第4の実施形態によるカラーバランス調整装置の構成を示す概略ブロック図である。なお、第4の実施形態において、第1の実施形態と同一の構成については同一の参照番号を付し、詳細な説明は省略する。上記第2および第3の実施形態においては、蛍光灯指定キー9の入力の有無あるいは画像データS0への情報Fの付与の有無に応じて、パラメータ生成手段6における処理パラメータPの生成方法を変更しているが、第4の実施形態においては、第1の実施形態と同様の処理により処理パラメータP1の生成を行う第1のパラメータ生成手段6Aおよびvon Kriesの色順応予測式に基づくマトリクスを処理パラメータP2として生成する第2のパラメータ生成手段6Bをそれぞれ別個に設け、第1および第2のパラメータ生成手段6A,6Bへの入力を切替手段11により切り替えるようにしたものである。なお、切替手段11における切り替えは、第2の実施形態と同様に蛍光灯指定キー9の入力の有無に応じて行えばよいが、第3の実施形態と同様に、デジタルカメラ2において画像データS0に付与された情報Fの有無に応じて行ってもよい。
【0086】
次いで、第4の実施形態の動作について説明する。図10は第4の実施形態の動作を示すフローチャートである。まず、デジタルカメラ2において撮影が行われて画像データS0が記憶されたメモリカード2Aから、読出手段3において画像データS0が読み出される(ステップS31)。画像データS0はモニタ8に表示される(ステップS32)。また、白色点算出手段4において画像データS0の白色点のLMS三刺激値L1w,M1w,S1wが算出される(ステップS33)。そして、蛍光灯指定キー9がオンされたか否かが判断され(ステップS34)、オンされた場合には、切替手段11により第1のパラメータ生成手段6AへLMS三刺激値L1w,M1w,S1wが入力され、上記第1の実施形態と同様の処理により処理パラメータP1が生成される(ステップS35)。一方、蛍光灯指定キー9がオンされていない場合には、切替手段11により第2のパラメータ生成手段6BへLMS三刺激値L1w,M1w,S1wが入力され、式(1)に示すvon Kriesの色順応予測式に基づくマトリクスが処理パラメータP2として生成される(ステップS36)。このように生成された処理パラメータP1またはP2はカラーバランス調整処理手段7に入力され、この処理パラメータP1またはP2により画像データS0に対してカラーバランスを調整する処理が施されて処理済み画像データS3が得られ(ステップS37)、処理を終了する。
【0087】
ここで、第1の実施形態による処理パラメータP1の生成においては3×3のマトリクスを演算する必要があるが、von Kriesの色順応予測式に基づく場合には単にLMS生理原色を定数倍する処理パラメータP2を生成すればよいものである。このため、第4の実施形態のように、処理パラメータP1,P2を生成する手段をそれぞれ別個に設けることにより、とくに蛍光灯指定キー9がオンされなかった場合には演算を高速に行うことができるため、カラーバランス調整処理の高速化を図ることができる。
【0088】
なお、上記第1から第4の実施形態においては、本発明によるカラーバランス調整装置を単独の装置として用いているが、本発明によるカラーバランス調整装置をプリンタに設けてもよい。この場合、第2の実施形態における蛍光灯指定キー9をハードウェアとして設ける必要はなく、プリンタドライバに付属するキーボタンとしてもよい。
【0089】
また、本発明によるカラーバランス調整装置をデジタルカメラ2に設けてもよい。以下、これを第5の実施形態として説明する。図11は本発明によるカラーバランス調整装置を備えたデジタルカメラの構成を示す概略ブロック図である。なお、デジタルカメラ2には上記第1から第4の実施形態のいずれのカラーバランス調整装置をも設けることができるが、ここでは第2の実施形態によるカラーバランス調整装置を設けたものとして説明する。図11に示すようにデジタルカメラ2は、CCD等の撮像手段12と、撮像手段12において得られた画像データS0を表示する小型の液晶モニタ13と、蛍光灯指定キー14と、第1の実施形態と同様の白色点算出手段4、データベース5、パラメータ生成手段6、およびカラーバランス調整処理手段7とを備え、カラーバランス調整処理手段7において得られた処理済み画像データS3をメモリカード2Aに記憶するものである。
【0090】
以下、第5の実施形態の動作について説明する。図12は第5の実施形態の動作を示すフローチャートである。まず、撮像手段12において被写体が撮像されて画像データS0が得られる(ステップS41)。画像データS0は液晶モニタ13に表示される(ステップS42)。また、白色点算出手段4において画像データS0の白色点のLMS三刺激値L1w,M1w,S1wが算出される(ステップS43)。そして、蛍光灯指定キー14がオンされたか否かが判断され(ステップS44)、オンされた場合には、上記第1の実施形態と同様の処理により処理パラメータPが生成される(ステップS45)。一方、蛍光灯指定キー14がオンされていない場合には、式(1)に示すvon Kriesの色順応予測式に基づくマトリクスが処理パラメータPとして生成される(ステップS46)。このように生成された処理パラメータPはカラーバランス調整処理手段7に入力され、この処理パラメータPにより画像データS0に対してカラーバランスを調整する処理が施されて処理済み画像データS3が得られる(ステップS47)。処理済み画像データS3はメモリカード2Aに記憶され(ステップS48)、処理を終了する。
【0091】
なお、上記第2から第5の実施形態においては、蛍光灯指定キーがオンされなかった場合、あるいは画像データS0に情報Fが付与されなかった場合に、von Kriesの色順応予測式に基づくマトリクスを処理パラメータP,P2として生成してカラーバランス調整処理を行っているが、例えば上記式(10)により求めた各色信号の平均値R2,G2,B2を一致させるような処理パラメータを求めてカラーバランス調整処理を行ってもよい。
【0092】
また、上記各実施形態においては、LMS色空間において処理パラメータPの生成およびカラーバランス調整処理を行っているが、とくに第5の実施形態のように本発明によるカラーバランス調整装置をデジタルカメラに設けた場合は、処理時間短縮のためにRGB色空間において処理パラメータPの生成およびカラーバランス調整処理を行うことが好ましい。この場合、上記式(13)により算出した色信号の平均値R2,G2,B2を光源1の白色点の三刺激値R1w,G1w,B1wとし、データベース5には、既知光源A,Bの白色点の三刺激値RAw,GAw,BAw、RBw,GBw,BBwと、既知光源下における被写体のRGB三刺激値を観察光源下における被写体のRGB三刺激値に変換するための既知光源のパラメータとを対応付けて記憶しておく。
【0093】
そして、光源1の白色点の三刺激値R1w,G1w,B1wが算出されると、図13に示すようにRGB色空間において、既知光源A,Bの白色点の三刺激値RAw,GAw,BAw、RBw,GBw,BBwと光源1の白色点の三刺激値R1,G1w,B1wとの距離を求め、上記第1の実施形態と同様に式(20)に示すように交点Cに対応する光源下におけるRGB三刺激値を光源2下におけるRGB三刺激値に変換するためのマトリクスPcを生成し、必要であればさらに上記マトリクスMを生成してこれを処理パラメータPとすればよい。
【0094】
また、上記各実施形態においては、既知光源からの距離に応じて図14に示すように処理パラメータPを生成する既知光源を選択するようにしてもよい。すなわち、図14に示すように、LMS色空間において既知光源A,B,Cを設定し、既知光源Aの白色点と既知光源Bの白色点とを結ぶ直線ABに垂直な面M1、既知光源Bの白色点と既知光源Cの白色点とを結ぶ直線BCに垂直な面M2および直線ABと直線BCとから等距離な面M3を設定し、各面M1〜M3および直線AB,BCにより規定される領域1〜5を定める。そして、光源1がいずれの領域に位置するかを判断し、領域1,5にある場合には、既知光源A,Bと光源1との距離に応じて処理パラメータPを生成し、領域3,4にある場合には、既知光源B,Cと光源1との距離に応じて処理パラメータPを生成し、領域2にある場合には既知光源Bのパラメータをそのまま処理パラメータPとして用いるようにしてもよい。
【0095】
また、上記各実施形態においては、生成された処理パラメータPを新たな既知光源のパラメータとしてデータベース5に記憶するようにしてもよい。これにより、新たな既知光源と同一の撮影光源下において撮影を行うことにより得られた画像のカラーバランスを調整する際には、同一の演算を行って処理パラメータPを生成する必要がなくなるため、カラーバランス調整処理を効率よく行うことができる。
【0096】
さらに、上記各実施形態においては、上記式(11)〜(15)により画像データS0の白色点の三刺激値を算出しているが、例えば特願平11−70186号に記載された白色点推定方法により画像データS0の白色点の三刺激値を算出してもよい。以下、特願平11−70186号に記載された白色点の三刺激値の算出方法について説明する。
【0097】
さらにまた、上記実施形態においては、その光源下における三刺激値を観察光源下における三刺激値に変換するためのパラメータが未知の光源下において取得された画像データS0に対してカラーバランス調整処理を施しているが、デジタルカメラによっては、撮影により取得した画像データに対してカメラ内においてRGBゲイン補正などのカラーバランス調整処理を行うものもある。この場合、デジタルカメラにおいて得られる画像データはすでにある観察光源下において観察することを前提としたカラーバランス調整処理が施されたものとなっている。また、画像データに対して、ある観察光源下において観察することを前提としたカラーバランス調整処理がすでに施されている場合がある。このように、すでにカラーバランス調整処理が施された画像をある特定の観察光源下において画像を観察する場合、この画像に対してカラーバランス調整処理を施す必要があるが、このような場合にも、上記ある観察光源を光源1として、上記各実施形態と同様に処理パラメータPを生成してカラーバランス調整処理を行うことができる。この場合、撮影により取得した画像データS0、ある観察光源下において観察することを前提としたカラーバランス調整処理A、カラーバランス調整処理Aが施された画像データS11、本発明によるカラーバランス調整処理Bおよび処理済み画像データS12の流れは、図15に示すものとなる。
【0098】
まず、画像データS0を構成する色信号R0,G0,B0から式(11)、(12)により色信号R1,G1,B1を得、色信号R1,G1,B1を式(33)によりCIE1931XYZ三刺激値に変換するとともに、下記の式(36)によりCIE1976uv色度値に変換する。
【0099】
u=4X/(X+15Y+3Z)
v=9Y/(X+15Y+3Z) (36)
そして、上記式(36)により求められた色度値u,vの平均値u0,v0を下記の式(37)により算出する。
【0100】
u0=Σu/n
v0=Σv/n (37)
但し、n:画素数
次いで平均値u0,v0を下記の式(38)〜(40)により生理原色L0,M0,S0に変換する。
【0101】
sx=9.0×u0(6.0×u0−16.0×v0+12.0)
sy=4.0×v0(6.0×u0−16.0×v0+12.0) (38)
X0=sx/sy
Y0=100.0 (39)
Z0=(1.0−sx−sy)/sy
L0 X0
M0 =|B|・Y0 (40)
S0 Z0
ここで、マトリクス|B|は、式(34)におけるマトリクスである。そして、このようにして求められた生理原色L0,M0,S0を画像データS0の白色点の三刺激値とするものである。
【0102】
さらに、上記各実施形態においては、RGBの色信号からなる画像データS0に対してカラーバランス調整処理を施しているが、これに限定されるものではなく、CMYの色信号からなる画像データS0に対してカラーバランス調整処理を施すものであってもよい。この場合、CMYの色信号からなる画像データS0から白色点のLMS三刺激値を算出し、上記各実施形態と同様に処理パラメータPを生成してカラーバランス調整処理を行えばよい。
【図面の簡単な説明】
【図1】本発明の第1の実施形態によるカラーバランス調整装置の構成を示す概略ブロック図
【図2】LMS色空間における処理パラメータの生成を説明するための図(その1)
【図3】LMS色空間における処理パラメータの生成を説明するための図(その2)
【図4】第1の実施形態の動作を示すフローチャート
【図5】本発明の第2の実施形態によるカラーバランス調整装置の構成を示す概略ブロック図
【図6】第2の実施形態の動作を示すフローチャート
【図7】本発明の第3の実施形態によるカラーバランス調整装置の構成を示す概略ブロック図
【図8】第3の実施形態の動作を示すフローチャート
【図9】本発明の第4の実施形態によるカラーバランス調整装置の構成を示す概略ブロック図
【図10】第4の実施形態の動作を示すフローチャート
【図11】本発明の第5の実施形態によるカラーバランス調整装置を備えたデジタルカメラの構成を示す概略ブロック図
【図12】第5の実施形態の動作を示すフローチャート
【図13】RGB色空間における処理パラメータの生成を説明するための図
【図14】LMS色空間における処理パラメータの生成を説明するための図(その3)
【図15】すでにカラーバランス調整処理が施された画像に対して本発明によるカラーバランス調整処理を施す処理を示す図
【符号の説明】
1 カラーバランス調整装置
2 デジタルカメラ
3 読出手段
4 白色点算出手段
5 データベース
6 パラメータ生成手段
7 カラーバランス調整処理手段
8 モニタ
9,10,14 蛍光灯指定キー
12 撮像手段
13 液晶モニタ[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a color balance adjustment method and apparatus for adjusting the color balance of an image, and a computer-readable recording medium on which a program for causing a computer to execute the color balance adjustment method is recorded.
[0002]
[Prior art]
In a digital electronic still camera (hereinafter referred to as a digital camera), an image acquired by photographing is stored as digital image data in a recording medium such as an internal memory or an IC card provided in the digital camera, and the stored digital image data Based on the above, it is possible to reproduce an image acquired by photographing as a hard copy such as a print or as a soft copy on a display. Thus, when reproducing an image acquired by a digital camera, it is expected to have a high-quality image similar to a photo printed from a negative film.
[0003]
On the other hand, in human vision, chromatic adaptation is not perceived as bluish or reddish, even when looking at white paper under daylight, fluorescent light with different spectral energy distribution or under tungsten light, Basically, a mechanism for recognizing it as white works. Considering such chromatic adaptation, an image representing a photographed image so that an image independent of the light source color can be obtained even if the photographing light source is different, such as tungsten light, fluorescent light, or outdoor daylight. There has been proposed a digital camera having a function (AWB function) that automatically performs white balance adjustment processing (AWB processing) on data according to a photographing light source.
[0004]
As such a white balance adjustment method, a method according to the von Kries chromatic adaptation prediction formula is used. In this method, when an image captured by the
[0005]
[Expression 1]
However, in the case of a daylight source, the method according to the von Kries chromatic adaptation prediction formula can appropriately adjust the color of the face other than white, but for example, under a special light source such as a fluorescent lamp or tungsten light. There is a problem that the color of the face other than white is converted into an unnatural color.
[0006]
For this reason, the conversion of the physiological primary color is not performed using a matrix having non-zero values only in the diagonal terms as shown in the above formula (1), but using a matrix having non-zero values in the non-diagonal terms. A method for adjusting the color balance of an image has also been proposed. This method will be described below.
[0007]
It is generally known that the spectral reflectance of a natural object can be represented by three main components. Therefore, the spectral reflectance of the photographed object has three main components x1(Λ), x2(Λ), x3The linear combination of (λ) (λ: spectral frequency) can be expressed as shown in the following equation (2).
[0008]
[Expression 2]
However, a1, A2, A3Is a weight for weighted addition of each principal component.
[0009]
The spectral radiation distribution of the
[Equation 3]
It becomes. In the equations (3) to (5), integration is integration in the visible region, but integration may be performed in the entire spectral region. Here, the spectral radiation distribution F (λ) of the
[Expression 4]
In this way, the LMS tristimulus value when viewing an object with the spectral reflectance x (λ) under the
[Equation 5]
It becomes. Similarly, the LMS tristimulus value when viewing an object having a spectral reflectance x (λ) under the
[Formula 6]
It becomes. From equations (7) and (8) a1, A2, A3If you delete
[Expression 7]
LMS tristimulus values under light source 1 (y1LMS tristimulus values under the light source 2 (y)2)) From equation (9)
[Equation 8]
A 3 × 3 matrix P having non-diagonal components as2P1 -1Can be performed.
[0010]
[Problems to be solved by the invention]
However, it is unclear under what light source the image data obtained by photographing with a digital camera is obtained, and as a result, the spectral intensity of the light source at the time of photographing Since the distribution is also unknown, the matrix P in the above equation (10)1Cannot be obtained, and as a result, a 3 × 3 matrix used for conversion cannot be obtained. In addition, image data obtained with a digital camera may already be subjected to color balance adjustment processing. In such a case, the obtained image data is subjected to color balance adjustment processing on the premise of what observation light source. I do n’t know if it ’s been. For this reason, when color balance adjustment processing is performed on image data that has already been subjected to color balance adjustment processing in this way in order to observe the image under a specific observation light source, it is used for conversion as described above. To get a matrix.
[0011]
The present invention has been made in view of the above circumstances, and is an image that has been subjected to color balance adjustment processing, even if the matrix for performing color balance adjustment is an image taken under an unknown light source. However, it is an object of the present invention to provide a color balance adjustment method and apparatus capable of appropriately adjusting the color balance, and a computer-readable recording medium recording a program for causing a computer to execute the color balance adjustment method.
[0012]
[Means for Solving the Problems]
According to the color balance adjustment method of the present invention, when observing an image obtained by photographing a subject under a predetermined photographing light source under a predetermined observation light source, the image data representing the image or the predetermined observation In the color balance adjustment method for obtaining processed image data by performing a process of adjusting the color balance of the image data subjected to the color balance adjustment process on the assumption that the observation is performed under another light source different from the light source.
The light source parameters for converting the white point of each light source and the tristimulus values under each light source into the tristimulus values under the observation light source for a plurality of light sources are stored in the storage means in advance.
Calculating a white point of the imaging light source or the other light source;
A light source having a white point close to a white point of the photographing light source or the other light source is selected from the plurality of light sources, and based on a white point of the photographing light source or the other light source and a white point of the selected light source An interpolation operation is performed on the light source parameter of the selected light source to generate a processing parameter for converting a tristimulus value under the imaging light source or the other light source into a tristimulus value under the observation light source. ,
Based on the processing parameters, the tristimulus values of the image data are converted into tristimulus values under the observation light source to obtain the processed image data.
[0013]
The number of light sources selected from the plurality of light sources need not be plural, and may be only one.
[0014]
The “tristimulus value” may be a tristimulus value in a color space (for example, an RGB tristimulus value) related to the spectral characteristics of an imaging apparatus that performs imaging, or a tristimulus in a color space related to human visual characteristics. It may be a value (for example, LMS tristimulus value based on physiological primary colors).
[0015]
“Light source parameter” means that when an image obtained by photographing under a certain light source is observed under an observation light source, an image of a color independent of the light source can be obtained. This is a parameter for converting a stimulus value into a tristimulus value under an observation light source.
[0016]
In the color balance adjustment method according to the present invention, the interpolation calculation calculates a distance between a white point of the selected light source and a white point of the photographing light source or the other light source,
It is preferable that the light source parameter is weighted and added based on the distance.
[0017]
In this case, it is preferable that the processing parameter is generated by further correcting the deviation of the white point due to the weighted addition.
[0018]
In the color balance adjustment method according to the present invention, it is preferable that the processing parameter is stored in the storage unit as a light source parameter of a new light source.
[0019]
Furthermore, in the color balance adjustment method according to the present invention, the designation of the photographing light source or the other light source is accepted,
It is preferable that the generation of the processing parameter and the generation of another processing parameter by another method different from the generation of the processing parameter can be switched in accordance with the designated imaging light source or other light source.
[0020]
Here, the designation of the imaging light source or the other light source can be received by receiving input from a keyboard, a key for designating the light source, or the like in the apparatus for carrying out the present invention. In addition, information regarding the photographic light source is added to the image data at the time of shooting, or information on other light sources that are presumed to be observed is added at the time of color balance adjustment processing, and is added to the image data at the time of processing parameter generation. You may make it receive designation | designated of an imaging light source or another light source by reading the information regarding an imaging light source or another light source.
[0021]
The “other method” is a method of generating a processing parameter by a process simpler than the generation of the processing parameter in the color balance adjustment method according to the present invention. For example, a method based on the above-described von Kries chromatic adaptation prediction formula, an image When the data is composed of RGB color signals, a method of matching the average values of the color signals can be employed.
[0022]
The color balance adjusting device according to the present invention is the image data representing the image or the predetermined observation light source when observing an image obtained by photographing the subject under a predetermined photographing light source under the predetermined observation light source. In a color balance adjustment device that obtains processed image data by performing a process of adjusting a color balance on image data that has been subjected to a color balance adjustment process on the premise of observing under a different light source,
Storage means for preliminarily storing light source parameters for converting a white point of each light source and a tristimulus value under each light source into a tristimulus value under the observation light source for a plurality of light sources;
A white point calculating means for calculating a white point of the photographing light source or the other light source;
A light source having a white point close to a white point of the photographing light source or the other light source is selected from the plurality of light sources, and based on a white point of the photographing light source or the other light source and a white point of the selected light source Interpolation is performed on the light source parameter of the selected light source to generate a processing parameter for converting a tristimulus value under the imaging light source or the other light source into a tristimulus value under the observation light source. Parameter generation means;
Processing means for converting the tristimulus values of the image data into tristimulus values under the observation light source to obtain the processed image data based on the processing parameters.
[0023]
In the color balance adjusting apparatus according to the present invention, the parameter generating means calculates the distance between the white point of the selected light source and the white point of the photographing light source or the other light source by performing the interpolation calculation.
Preferably, the light source parameters are weighted and added based on the distance.
[0024]
In this case, it is preferable that the parameter generation unit is a unit that further corrects a deviation of a white point due to the weighted addition and generates the processing parameter.
[0025]
The tristimulus value may be a tristimulus value in a color space related to human visual characteristics, or may be a tristimulus value in a color space related to spectral characteristics of a photographing apparatus that has captured the image. Good.
[0026]
In the color balance adjusting apparatus according to the present invention, it is preferable that the storage unit is a unit that stores the processing parameter as a light source parameter of a new light source.
[0027]
Furthermore, in the color balance adjusting apparatus according to the present invention, a receiving unit that receives designation of the photographing light source or the other light source,
Other parameter generation means for generating other processing parameters by another method different from the generation of processing parameters in the parameter generation means,
A switching unit that switches between generation of a processing parameter by the parameter generation unit and generation of another processing parameter by the other parameter generation unit in response to designation of a photographing light source or another light source by the reception unit; Is preferred.
[0028]
Note that the program for causing a computer to execute the color balance adjusting method according to the present invention may be provided by being recorded on a computer-readable recording medium.
[0029]
In addition, the color balance adjusting device according to the present invention may be provided in an imaging device such as a digital camera.
[0030]
Furthermore, the color balance adjusting device according to the present invention may be provided in an output device such as a printer or a monitor.
[0031]
【The invention's effect】
According to the present invention, the light source parameters for converting the white point and the tristimulus values under each light source into the tristimulus values under the observation light source for observing the image are prepared in advance and stored in the storage means. Has been. Then, the white point of the image acquired by photographing is calculated, and a light source having a white point close to the white point of another light source different from the photographing light source or the predetermined observation light source is selected from the plurality of light sources. Then, based on the white point of the photographic light source or other light source and the white point of the selected light source, an interpolation operation is performed on the light source parameters of the selected light source, so that the tristimulus under the photographic light source or under the other light source Processing parameters are generated for converting the values into tristimulus values under the observation light source. This plots, for example, in the tristimulus color space, the white point of the selected light source and the white point of the photographic or other light source, and the white point of the selected light source and the white point of the photographic or other light source. Is obtained by weighting and adding the light source parameters of the light source selected according to this distance. Then, the processed image data is obtained by converting the tristimulus values of the image data into the tristimulus values under the observation light source by the generated processing parameters.
[0032]
Therefore, according to the present invention, even if a processing parameter for converting a tristimulus value under an imaging light source or another light source into a tristimulus value under an observation light source is unknown, the processing parameter is obtained from the light source parameter. Therefore, the processed image represented by the processed image data obtained by converting the tristimulus values of the image data by this processing parameter can be appropriately adjusted in color balance. .
[0033]
In the tristimulus color space, the distance between the white point of the selected light source and the white point of the photographic light source or other light source is calculated, and the light source parameters are weighted and added based on this distance, thereby simplifying Since the processing parameter can be generated by simple calculation, the calculation time for generating the processing parameter can be shortened.
[0034]
In this case, in the tristimulus color space, when the white point of the photographic light source or other light source is located on a straight line connecting the white points of a plurality of light sources, the tristimulus under the photographic light source or other light source Processing parameters for converting the values into tristimulus values under the observation light source can be appropriately obtained. However, if the white point of the photographic light source or other light source is not located on a straight line connecting the white points of a plurality of light sources, the tristimulus of the image data under the photographic light source or under the other light source depends on the obtained processing parameters. When the value is converted, the white point of the processed image is shifted from the white point that should be originally obtained, and the color of the processed image becomes unnatural. For this reason, it is possible to obtain a processed image without an unnatural color by correcting the deviation of the white point due to weighted addition.
[0035]
In addition, by setting the tristimulus values as tristimulus values in a color space related to human visual characteristics, color balance adjustment can be performed based on the colors that humans perceive when looking at things. Color balance adjustment processing that reproduces an image faithful to the impression can be performed.
[0036]
Furthermore, by setting the tristimulus values as tristimulus values in a color space related to the spectral characteristics of the imaging device that captured the image, no color conversion is performed on the data acquired in the imaging device such as a digital camera. Since color balance adjustment processing can be performed, the configuration of the apparatus can be simplified, and processing can be performed at high speed.
[0037]
In addition, by storing the generated processing parameter in the storage unit as a light source parameter of a new light source, an image obtained by shooting with the same photographing light source as the new light source or the same as the new light source When adjusting the color balance of an image that has been subjected to color balance adjustment processing that is presumed to be observed under a light source, it is not necessary to perform the same calculation to generate processing parameters. It can be done efficiently.
[0038]
Furthermore, by making it possible to switch between the generation of processing parameters and the generation of processing parameters by other methods according to the designation of the imaging light source or other light source, for example, an image obtained by shooting in daylight If the processing parameters can be generated easily as described above, the processing can be performed at high speed if the processing parameters are generated by other methods.
[0039]
DETAILED DESCRIPTION OF THE INVENTION
Embodiments of the present invention will be described below with reference to the drawings.
[0040]
FIG. 1 is a schematic block diagram showing the configuration of a color balance adjusting apparatus according to the first embodiment of the present invention. As shown in FIG. 1, the color
[0041]
In the first embodiment, the photographer uses a
[0042]
Here, the image data S0 acquired by the
[0043]
The white point calculation means 4 converts each color signal R0, G0, B0 constituting the image data S0 into a signal value R1 normalized to a value of 0 to 1 by the following equations (11) and (12).
[0044]
[Equation 9]
Although only the color signal R1 has been described here, the signal values G1 and B1 are also obtained by the same calculation as the signal value R1.
[0045]
Next, the average value R2, G2, B2 of the signal values R1, G1, B1 is calculated by the following equation (13) using the total number of pixels N of the image represented by the image data S0.
[0046]
[Expression 10]
Then, the calculated average values R2, G2, and B2 are converted into CIE1931XYZ tristimulus values by the following equation (14), and this is converted to the tristimulus value X of the white point in the image represented by the image data S0.1w, Y1w, Z1wAnd
[0047]
## EQU11 ##
Furthermore, tristimulus value X1w, Y1w, Z1wIs converted into tristimulus values based on physiological primary colors by the following equation (15), and these are converted into tristimulus values based on the physiological primary colors of the white point in the image represented by the image data S0 obtained by photographing under the
[0048]
[Expression 12]
The database 5 stores, for a plurality of known light sources, known light source parameters for converting tristimulus values under each known light source into tristimulus values under the
[0049]
Here, calculation of the known light source parameter will be described. The spectral intensity distribution of the known light source is known, and the spectral intensity distribution of the
[0050]
y2= P2PA -1yA (16)
However, y2: LMS tristimulus value under
yA: LMS tristimulus value under known light source A
P2: A 3 × 3 matrix for obtaining an LMS value when an object having a spectral reflectance x (λ) is viewed under the
PA: A 3 × 3 matrix for obtaining an LMS value when an object having a spectral reflectance x (λ) is viewed under a known light source A
For example, the LMS tristimulus values under the known light source A and the
[0051]
The matrix can also be determined so that the white color of the known light source A is converted to the white color of the
[0052]
y2= (VA+ VA′) YA (17)
However, VA'YA= 0
In this case, P2PA -1= VA+ VAIt becomes ′. In this way, by determining the matrix so that the white color of the known light source A is converted to the white color of the
[0053]
The parameter generating means 6 is a tristimulus value L of the white point of the light source 1.1w, M1w, S1wAnd a processing parameter P for performing the color balance adjustment processing of the image data S0 from the known light source parameters stored in the database 5 based on the tristimulus values of the white point of the known light source having a white point close to the white point of the
[0054]
First, the
[0055]
Here, the known light source parameter of the known light source A is P in the above equation (16).2PA -1The known light source parameter of the known light source B is P in the following equation (18).2PB -1It is.
[0056]
y2= P2PB -1yB (18)
However, yB: LMS tristimulus value under known light source B
PB: 3 × 3 matrix for obtaining LMS values when an object having a spectral reflectance x (λ) is viewed under a known light source B
Similarly to the above equation (17), the parameter of the known light source B can be obtained by the following equation (19).
[0057]
y2= (VB+ VB′) YB (19)
However, VB'YB= 0
When two known light sources A and B are selected in this way, a straight line AB connecting the white points (referred to as points A and B) of the known light sources A and B in the LMS color space and the white point (see FIG. The intersection C with the perpendicular line drawn from the x point in FIG. Here, assuming that the straight line AB is divided by the division ratio of 1−α: α by the intersection point C, the intersection point C includes the spectral intensity distribution of the known light source A and the spectral intensity distribution of the known light source B as shown in FIG. Is equivalent to the white point of a light source having a spectral intensity distribution synthesized at a ratio of α: 1-α.
[0058]
When the intersection point C is obtained as described above, an interpolation calculation is performed on the known light source parameters of the known light sources A and B, thereby calculating a parameter at the light source corresponding to the intersection point C.
[0059]
Specifically, a matrix Pc for converting the LMS tristimulus values under the light source corresponding to the intersection C into the LMS tristimulus values under the
[0060]
Pc = αP2PA -1+ (1-α) P2PB -1 (20)
Matrix P2, PA -1, PB -1Are obtained separately, the matrix Pc can be obtained as shown in the following equation (20 ′).
[0061]
Pc = P2(ΑPA+ (1-α) PB)-1 (20 ')
Therefore, the LMS tristimulus value y under the light source corresponding to the intersection CCCan be converted into LMS tristimulus values under the
[0062]
y2= PcyC (21)
On the other hand, the intersection C is on a straight line AB connecting the white points of the known light sources A and B in the LMS color space and does not coincide with the
[0063]
[Formula 13]
However, L1w, M1w, S1w: Tristimulus value L based on the physiological primary color of the white point of the
[0064]
Pc = QcV (23)
ΔP = ΔQV (24)
Here, the tristimulus value L1w, M1w, S1wAnd tristimulus value L2w, M2w, S2wIs in the relationship shown in the following equation (25), and when the equations (23) and (24) are substituted into the equation (22), the following equation (26) is obtained.
[0065]
[Expression 14]
When the equation (26) is modified, the following equation (27) is obtained.
[0066]
[Expression 15]
E: Unit matrix
From equation (23)
Qc = PcV-1 (28)
Therefore, the right side of Expression (27) is known. Therefore,
[Expression 16]
If you replace like
[Expression 17]
It becomes. Here, if the values of the vectors (q00, q01, q02), (q10, q11, q12), (q20, q21, q22) are minimized, the components of the correction matrix ΔP are also minimized. The white point under the
[0067]
The values of vectors (q00, q01, q02), (q10, q11, q12), (q20, q21, q22) are minimized because these vectors are vector (L2w, M2w, S2w). Therefore, the matrix ΔQ is obtained by determining the vectors (q00, q01, q02), (q10, q11, q12), (q20, q21, q22) by the following equations (29) to (31).
[0068]
[Formula 18]
Therefore, the correction matrix ΔP can be obtained by the above equation (24). Thereby, the matrix M for converting the LMS tristimulus values under the
M = Pc + ΔP (32)
It can ask for.
[0069]
This matrix M converts the tristimulus value of the white point under the
[0070]
The matrix M generated in this way is input to the color balance adjustment processing means 7 as a processing parameter P. In the color balance adjustment processing means 7, first, the color signals R0, G0, B0 constituting the image data S0 are converted into signal values R1, G1, B1 normalized by the above equations (11), (12). Then, the signal values R1, G1, B1 are converted into CIE1931XYZ tristimulus values X1, Y1, Z1 by the following equation (33).
[0071]
[Equation 19]
Further, the tristimulus values X1, Y1, and Z1 are converted into tristimulus values L1, M1, and S1 based on physiological primary colors by the following equation (34).
[0072]
[Expression 20]
Then, the tristimulus values L1, M1, and S1 are converted using the matrix M by the following equation (35) to obtain converted tristimulus values L3, M3, and S3.
[0073]
[Expression 21]
Then, the converted tristimulus values L3, M3, and S3 are subjected to inverse transformations of Expression (34) and Expression (33) to obtain processed signals R3, G3, and B3 constituting the processed image data S3.
[0074]
Next, the operation of this embodiment will be described.
[0075]
FIG. 4 is a flowchart showing the operation of the first embodiment. First, the image data S0 is read by the reading means 3 from the memory card 2A in which the image is taken by the
[0076]
As described above, in the first embodiment, the process for performing the color balance adjustment process on the image data S0 obtained by photographing under the
[0077]
Further, the distance AB between the white point of the selected known light sources A and B and the white point of the
[0078]
Furthermore, since color balance adjustment processing is performed in the LMS color space, which is a color space related to human visual characteristics, color balance adjustment can be performed based on the color recognized when a human sees an object, This makes it possible to perform color balance adjustment processing that reproduces an image that is faithful to the visual impression.
[0079]
Next, a second embodiment of the present invention will be described. FIG. 5 is a schematic block diagram showing the configuration of the color balance adjusting apparatus according to the second embodiment of the present invention. Note that, in the second embodiment, the same components as those in the first embodiment are denoted by the same reference numerals, and detailed description thereof is omitted. The color
[0080]
The operation of the second embodiment will be described below. FIG. 6 is a flowchart showing the operation of the second embodiment. First, the image data S0 is read by the reading means 3 from the memory card 2A in which the image is taken by the
[0081]
As described above, in the second embodiment, the color balance adjustment method using the processing parameter P generated according to the first embodiment and the color balance adjustment method using the processing parameter P based on the von Kries chromatic adaptation prediction formula. When the fluorescent lamp designation key 9 is switched on / off, when color balance adjustment processing can be easily performed as in an image obtained by shooting in daylight, Even if the processing parameter P is not generated by the method of the first embodiment, the processing parameter P can be easily generated as in the von Kries chromatic adaptation prediction formula, so that the processing can be performed at high speed.
[0082]
In the second embodiment, it is possible to designate a case where photographing is performed under a fluorescent lamp by the fluorescent lamp designation key 9, but other types of light sources such as tungsten light can be designated in addition to the fluorescent lamp. It may be possible. When a fluorescent lamp is designated, the type of fluorescent lamp may be designated such as a normal fluorescent lamp, a three-wavelength fluorescent lamp, and a high color rendering fluorescent lamp. When a plurality of types of light sources can be specified as described above, the type of light source may not be specified only by displaying the image data S0 on the
[0083]
Next, a third embodiment of the present invention will be described. FIG. 7 is a schematic block diagram showing the configuration of the color balance adjusting apparatus according to the third embodiment of the present invention. Note that in the third embodiment, identical symbols are assigned to configurations identical to those in the first embodiment and detailed description thereof is omitted. In the color
[0084]
The operation of the third embodiment will be described below. FIG. 8 is a flowchart showing the operation of the third embodiment. First, the image data S0 is read by the reading means 3 from the memory card 2A in which the image is taken by the
[0085]
Next, a fourth embodiment of the present invention will be described. FIG. 9 is a schematic block diagram showing the configuration of the color balance adjusting apparatus according to the fourth embodiment of the present invention. Note that in the fourth embodiment, identical symbols are assigned to configurations identical to those in the first embodiment and detailed description thereof is omitted. In the second and third embodiments, the method for generating the processing parameter P in the
[0086]
Next, the operation of the fourth embodiment will be described. FIG. 10 is a flowchart showing the operation of the fourth embodiment. First, the image data S0 is read by the reading means 3 from the memory card 2A in which the image is taken by the
[0087]
Here, in the generation of the processing parameter P1 according to the first embodiment, it is necessary to calculate a 3 × 3 matrix. However, when the von Kries chromatic adaptation prediction formula is used, the LMS physiological primary color is simply multiplied by a constant. The parameter P2 may be generated. For this reason, as in the fourth embodiment, by separately providing means for generating the processing parameters P1, P2, the calculation can be performed at high speed, particularly when the fluorescent lamp designation key 9 is not turned on. Therefore, the speed of the color balance adjustment process can be increased.
[0088]
In the first to fourth embodiments, the color balance adjusting device according to the present invention is used as a single device. However, the color balance adjusting device according to the present invention may be provided in a printer. In this case, the fluorescent lamp designation key 9 in the second embodiment does not need to be provided as hardware, and may be a key button attached to the printer driver.
[0089]
Further, the color balance adjusting device according to the present invention may be provided in the
[0090]
The operation of the fifth embodiment will be described below. FIG. 12 is a flowchart showing the operation of the fifth embodiment. First, a subject is imaged by the imaging means 12, and image data S0 is obtained (step S41). The image data S0 is displayed on the liquid crystal monitor 13 (step S42). Further, in the white point calculation means 4, the LMS tristimulus value L of the white point of the image data S0.1w, M1w, S1wIs calculated (step S43). Then, it is determined whether or not the fluorescent
[0091]
In the second to fifth embodiments, the matrix based on the von Kries chromatic adaptation prediction formula when the fluorescent lamp designation key is not turned on or when the information F is not added to the image data S0. Is generated as the processing parameters P and P2, and the color balance adjustment processing is performed. For example, the processing parameters such that the average values R2, G2, and B2 of the respective color signals obtained by the above equation (10) are matched are obtained and the color is adjusted. A balance adjustment process may be performed.
[0092]
In each of the above embodiments, the processing parameter P is generated and the color balance adjustment processing is performed in the LMS color space. In particular, the color balance adjustment device according to the present invention is provided in the digital camera as in the fifth embodiment. In this case, it is preferable to generate the processing parameter P and perform color balance adjustment processing in the RGB color space in order to shorten the processing time. In this case, the average values R2, G2, B2 of the color signals calculated by the above equation (13) are used as the tristimulus values R of the white point of the light source 1.1w, G1w, B1wIn the database 5, the tristimulus value R of the white point of the known light sources A and B is stored.Aw, GAw, BAw, RBw, GBw, BBwAnd the parameters of the known light source for converting the RGB tristimulus values of the subject under the known light source into the RGB tristimulus values of the subject under the observation light source are stored in association with each other.
[0093]
And the tristimulus value R of the white point of the
[0094]
In each of the above embodiments, a known light source that generates the processing parameter P may be selected as shown in FIG. 14 according to the distance from the known light source. That is, as shown in FIG. 14, the known light sources A, B, and C are set in the LMS color space, and the surface M1 perpendicular to the straight line AB connecting the white point of the known light source A and the white point of the known light source B, the known light source A surface M2 perpendicular to the straight line BC connecting the white point of B and the white point of the known light source C and a surface M3 equidistant from the straight line AB and the straight line BC are set, and are defined by the respective surfaces M1 to M3 and the straight lines AB and BC.
[0095]
In each of the above embodiments, the generated processing parameter P may be stored in the database 5 as a new known light source parameter. Thereby, when adjusting the color balance of an image obtained by shooting under the same shooting light source as a new known light source, it is not necessary to perform the same calculation to generate the processing parameter P. Color balance adjustment processing can be performed efficiently.
[0096]
Further, in each of the above embodiments, the tristimulus value of the white point of the image data S0 is calculated by the above formulas (11) to (15). For example, the white point described in Japanese Patent Application No. 11-70186 is used. The tristimulus value of the white point of the image data S0 may be calculated by the estimation method. The white point tristimulus value calculation method described in Japanese Patent Application No. 11-70186 will be described below.
[0097]
Furthermore, in the above embodiment, the color balance adjustment process is performed on the image data S0 acquired under the light source whose parameter for converting the tristimulus value under the light source into the tristimulus value under the observation light source is unknown. However, some digital cameras perform color balance adjustment processing such as RGB gain correction on the image data acquired by photographing. In this case, the image data obtained by the digital camera has been subjected to color balance adjustment processing on the premise that the image data is already observed under an observation light source. In some cases, the image data is already subjected to color balance adjustment processing on the premise that the image data is observed under a certain observation light source. As described above, when an image that has already been subjected to color balance adjustment processing is observed under a specific observation light source, it is necessary to perform color balance adjustment processing on the image. Using the observation light source as the
[0098]
First, the color signals R1, G1, B1 are obtained from the color signals R0, G0, B0 constituting the image data S0 according to the equations (11), (12), and the color signals R1, G1, B1 are obtained according to the equation (33) as CIE1931XYZ3. While converting into a stimulus value, it converts into a CIE1976uv chromaticity value by the following formula | equation (36).
[0099]
u = 4X / (X + 15Y + 3Z)
v = 9Y / (X + 15Y + 3Z) (36)
Then, average values u0 and v0 of the chromaticity values u and v obtained by the above equation (36) are calculated by the following equation (37).
[0100]
u0 = Σu / n
v0 = Σv / n (37)
Where n is the number of pixels
Next, the average values u0, v0 are converted into physiological primary colors L0, M0, S0 by the following equations (38) to (40).
[0101]
sx = 9.0 × u0 (6.0 × u0-16.0 × v0 + 12.0)
sy = 4.0 × v0 (6.0 × u0-16.0 × v0 + 12.0) (38)
X0 = sx / sy
Y0 = 100.0 (39)
Z0 = (1.0−sx−sy) / sy
L0 X0
M0 = | B | .Y0 (40)
S0 Z0
Here, the matrix | B | is a matrix in the equation (34). Then, the physiological primary colors L0, M0, S0 obtained in this way are set as the tristimulus values of the white point of the image data S0.
[0102]
Further, in each of the above embodiments, the color balance adjustment processing is performed on the image data S0 composed of RGB color signals. However, the present invention is not limited to this, and the image data S0 composed of CMY color signals is not limited thereto. Alternatively, color balance adjustment processing may be performed. In this case, the LMS tristimulus value of the white point is calculated from the image data S0 composed of CMY color signals, and the processing parameter P is generated as in the above embodiments to perform the color balance adjustment process.
[Brief description of the drawings]
FIG. 1 is a schematic block diagram showing the configuration of a color balance adjustment device according to a first embodiment of the present invention.
FIG. 2 is a diagram for explaining generation of processing parameters in an LMS color space (part 1);
FIG. 3 is a diagram for explaining generation of processing parameters in an LMS color space (part 2);
FIG. 4 is a flowchart showing the operation of the first embodiment.
FIG. 5 is a schematic block diagram showing the configuration of a color balance adjustment device according to a second embodiment of the present invention.
FIG. 6 is a flowchart showing the operation of the second embodiment.
FIG. 7 is a schematic block diagram showing the configuration of a color balance adjustment device according to a third embodiment of the present invention.
FIG. 8 is a flowchart showing the operation of the third embodiment.
FIG. 9 is a schematic block diagram showing the configuration of a color balance adjustment device according to a fourth embodiment of the present invention.
FIG. 10 is a flowchart showing the operation of the fourth embodiment.
FIG. 11 is a schematic block diagram showing a configuration of a digital camera provided with a color balance adjusting device according to a fifth embodiment of the present invention.
FIG. 12 is a flowchart showing the operation of the fifth embodiment.
FIG. 13 is a diagram for explaining processing parameter generation in the RGB color space;
FIG. 14 is a diagram for explaining generation of processing parameters in an LMS color space (part 3);
FIG. 15 is a diagram showing processing for performing color balance adjustment processing according to the present invention on an image that has already been subjected to color balance adjustment processing;
[Explanation of symbols]
1 Color balance adjustment device
2 Digital camera
3 Reading means
4 White point calculation means
5 Database
6 Parameter generation means
7 Color balance adjustment processing means
8 Monitor
9, 10, 14 Fluorescent lamp designation key
12 Imaging means
13 LCD monitor
Claims (23)
複数の光源について該各光源の白色点および該各光源下における三刺激値を前記観察光源下における三刺激値に変換するための光源パラメータを予め記憶手段に記憶し、
前記撮影光源または前記他の光源の白色点を算出し、
該撮影光源または前記他の光源の白色点に近い白色点を有する光源を前記複数の光源から選択し、前記撮影光源または前記他の光源の白色点および前記選択された光源の白色点に基づいて前記選択された光源の光源パラメータに対して補間演算を施して、前記撮影光源下または前記他の光源下における三刺激値を前記観察光源下における三刺激値に変換するための処理パラメータを生成し、
該処理パラメータに基づいて、前記画像データの三刺激値を前記観察光源下における三刺激値に変換して前記処理済み画像データを得ることを特徴とするカラーバランス調整方法。When observing an image acquired by photographing a subject under a predetermined photographing light source under a predetermined observation light source, observing under image data representing the image or another light source different from the predetermined observation light source In the color balance adjustment method for obtaining processed image data by performing a process for adjusting the color balance on the image data subjected to the color balance adjustment process based on
The light source parameters for converting the white point of each light source and the tristimulus values under each light source into the tristimulus values under the observation light source for a plurality of light sources are stored in the storage means in advance.
Calculating a white point of the imaging light source or the other light source;
A light source having a white point close to a white point of the photographing light source or the other light source is selected from the plurality of light sources, and based on a white point of the photographing light source or the other light source and a white point of the selected light source An interpolation operation is performed on the light source parameter of the selected light source to generate a processing parameter for converting a tristimulus value under the imaging light source or the other light source into a tristimulus value under the observation light source. ,
A color balance adjustment method, wherein the processed image data is obtained by converting tristimulus values of the image data into tristimulus values under the observation light source based on the processing parameters.
該距離に基づいて前記光源パラメータを重み付け加算する演算であることを特徴とする請求項1記載のカラーバランス調整方法。The interpolation calculation calculates a distance between a white point of the selected light source and a white point of the photographing light source or the other light source,
The color balance adjustment method according to claim 1, wherein the light source parameter is calculated by weighted addition based on the distance.
該指定された撮影光源または他の光源に応じて、前記処理パラメータの生成と、該処理パラメータの生成とは異なる他の方法による他の処理パラメータの生成とを切替可能としたことを特徴とする請求項1から6のいずれか1項記載のカラーバランス調整方法。Accept designation of the imaging light source or the other light source;
According to the designated imaging light source or other light source, the generation of the processing parameter and the generation of another processing parameter by another method different from the generation of the processing parameter can be switched. The color balance adjustment method according to any one of claims 1 to 6.
複数の光源について該各光源の白色点および該各光源下における三刺激値を前記観察光源下における三刺激値に変換するための光源パラメータを予め記憶した記憶手段と、
前記撮影光源または前記他の光源の白色点を算出する白色点算出手段と、
該撮影光源または前記他の光源の白色点に近い白色点を有する光源を前記複数の光源から選択し、前記撮影光源または前記他の光源の白色点および前記選択された光源の白色点に基づいて前記選択された光源の光源パラメータに対して補間演算を施して、前記撮影光源下または前記他の光源下における三刺激値を前記観察光源下における三刺激値に変換するための処理パラメータを生成するパラメータ生成手段と、
該処理パラメータに基づいて、前記画像データの三刺激値を前記観察光源下における三刺激値に変換して前記処理済み画像データを得る処理手段とを備えたことを特徴とするカラーバランス調整装置。When observing an image acquired by photographing a subject under a predetermined photographing light source under a predetermined observation light source, observing under image data representing the image or another light source different from the predetermined observation light source In a color balance adjustment device that obtains processed image data by performing a process of adjusting the color balance on the image data that has been subjected to the color balance adjustment process based on
Storage means for preliminarily storing light source parameters for converting a white point of each light source and a tristimulus value under each light source into a tristimulus value under the observation light source for a plurality of light sources;
A white point calculating means for calculating a white point of the photographing light source or the other light source;
A light source having a white point close to a white point of the photographing light source or the other light source is selected from the plurality of light sources, and based on a white point of the photographing light source or the other light source and a white point of the selected light source Interpolation is performed on the light source parameter of the selected light source to generate a processing parameter for converting a tristimulus value under the imaging light source or the other light source into a tristimulus value under the observation light source. Parameter generation means;
A color balance adjustment apparatus comprising: processing means for converting the tristimulus values of the image data into tristimulus values under the observation light source based on the processing parameters to obtain the processed image data.
該距離に基づいて前記光源パラメータを重み付け加算することにより行う手段であることを特徴とする請求項8記載のカラーバランス調整装置。The parameter generation means calculates the distance between the white point of the selected light source and the white point of the imaging light source or the other light source, as the interpolation calculation,
9. The color balance adjusting apparatus according to claim 8, wherein the color balance adjusting device is a means for performing weighted addition of the light source parameters based on the distance.
前記パラメータ生成手段における処理パラメータの生成とは異なる他の方法により他の処理パラメータの生成を行う他のパラメータ生成手段と、
前記受付手段による撮影光源または他の光源の指定に応じて、前記パラメータ生成手段による処理パラメータの生成と、前記他のパラメータ生成手段による他の処理パラメータの生成とを切り替える切替手段とをさらに備えたことを特徴とする請求項8から13のいずれか1項記載のカラーバランス調整装置。Accepting means for accepting designation of the imaging light source or the other light source;
Other parameter generation means for generating other processing parameters by another method different from the generation of processing parameters in the parameter generation means,
And a switching unit that switches between generation of a processing parameter by the parameter generation unit and generation of another processing parameter by the other parameter generation unit in response to designation of a photographing light source or another light source by the reception unit. 14. The color balance adjusting device according to claim 8, wherein the color balance adjusting device is a color balance adjusting device.
前記プログラムは、複数の光源について該各光源の白色点および該各光源下における三刺激値を前記観察光源下における三刺激値に変換するための光源パラメータを予め記憶手段に記憶する手順と、
前記撮影光源または前記他の光源の白色点を算出する手順と、
該撮影光源または前記他の光源の白色点に近い白色点を有する光源を前記複数の光源から選択し、前記撮影光源または前記他の光源の白色点および前記選択された光源の白色点に基づいて前記選択された光源の光源パラメータに対して補間演算を施して、前記撮影光源下または前記他の光源下における三刺激値を前記観察光源下における三刺激値に変換するための処理パラメータを生成する手順と、
該処理パラメータに基づいて、前記画像データの三刺激値を前記観察光源下における三刺激値に変換して前記処理済み画像データを得る手順とを有することを特徴とするコンピュータ読取り可能な記録媒体。When observing an image acquired by photographing a subject under a predetermined photographing light source under a predetermined observation light source, observing under image data representing the image or another light source different from the predetermined observation light source A computer-readable recording of a program for causing a computer to execute a color balance adjustment method for obtaining processed image data by performing color balance adjustment processing on image data that has undergone color balance adjustment processing based on In a recording medium
The program stores in advance a light source parameter for converting a white point of each light source and a tristimulus value under each light source into a tristimulus value under the observation light source in a storage unit for a plurality of light sources;
Calculating a white point of the imaging light source or the other light source;
A light source having a white point close to a white point of the photographing light source or the other light source is selected from the plurality of light sources, and based on a white point of the photographing light source or the other light source and a white point of the selected light source Interpolation is performed on the light source parameter of the selected light source to generate a processing parameter for converting a tristimulus value under the imaging light source or the other light source into a tristimulus value under the observation light source. Procedure and
A computer-readable recording medium comprising: a procedure for converting the tristimulus values of the image data into tristimulus values under the observation light source based on the processing parameters to obtain the processed image data.
該距離に基づいて前記光源パラメータを重み付け加算する手順とを有することを特徴とする請求項15記載のコンピュータ読取り可能な記録媒体。The interpolation calculation in the step of generating the processing parameter is a step of calculating a distance between a white point of the selected light source and a white point of the photographing light source or the other light source,
The computer-readable recording medium according to claim 15, further comprising a step of weighting and adding the light source parameters based on the distance.
前記処理パラメータの生成とは異なる他の方法により他の処理パラメータを生成する手順と、
前記受け付ける手順による撮影光源または他の光源の指定に応じて、前記処理パラメータの生成と前記他の処理パラメータの生成とを切り替える手順とをさらに有することを特徴とする請求項15から20のいずれか1項記載のコンピュータ読取り可能な記録媒体。A procedure for accepting designation of the imaging light source or the other light source;
A procedure for generating other processing parameters by another method different from the generation of the processing parameters;
21. The method according to claim 15, further comprising a step of switching between generation of the processing parameter and generation of the other processing parameter in accordance with designation of an imaging light source or another light source in the receiving procedure. 2. A computer-readable recording medium according to item 1.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2000139747A JP4060024B2 (en) | 2000-05-12 | 2000-05-12 | Color balance adjusting method and apparatus, and recording medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2000139747A JP4060024B2 (en) | 2000-05-12 | 2000-05-12 | Color balance adjusting method and apparatus, and recording medium |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2001320727A JP2001320727A (en) | 2001-11-16 |
JP4060024B2 true JP4060024B2 (en) | 2008-03-12 |
Family
ID=18647144
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2000139747A Expired - Fee Related JP4060024B2 (en) | 2000-05-12 | 2000-05-12 | Color balance adjusting method and apparatus, and recording medium |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4060024B2 (en) |
Families Citing this family (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1359743B1 (en) | 2001-02-09 | 2011-10-05 | Seiko Epson Corporation | Apparatus and method for adjusting output image from image data |
EP1626586A4 (en) | 2003-05-01 | 2007-06-27 | Seiko Epson Corp | ADJUSTING THE BALANCE OF COLORS TAKING ACCOUNT OF THE REPRODUCIBILITY OF A COLOR GIVEN |
KR100848757B1 (en) * | 2004-01-29 | 2008-07-25 | 올림푸스 가부시키가이샤 | Color reproducing system and color reproducing method |
JP4424216B2 (en) | 2004-03-30 | 2010-03-03 | セイコーエプソン株式会社 | Image processing apparatus, image processing method, and image processing program |
JP4371069B2 (en) | 2005-03-16 | 2009-11-25 | セイコーエプソン株式会社 | Color balance correction according to the color cast tendency |
JP2008033620A (en) * | 2006-07-28 | 2008-02-14 | Seiko Epson Corp | Image processing apparatus, image processing method, and image processing program |
US8284279B2 (en) * | 2007-01-29 | 2012-10-09 | Park Jong-Il | Method of multispectral imaging and an apparatus thereof |
JP5473194B2 (en) * | 2007-04-26 | 2014-04-16 | キヤノン株式会社 | Color processing apparatus and method |
JP4934487B2 (en) * | 2007-04-26 | 2012-05-16 | キヤノン株式会社 | Color processing apparatus and method |
KR20120014804A (en) | 2010-08-10 | 2012-02-20 | 삼성전자주식회사 | Video signal generating device and method for reducing crosstalk between brightness signal and color difference signal |
JP7427526B2 (en) | 2020-05-14 | 2024-02-05 | キヤノン株式会社 | Image processing device, image processing method, and program |
-
2000
- 2000-05-12 JP JP2000139747A patent/JP4060024B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2001320727A (en) | 2001-11-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7830566B2 (en) | Image processing method and device enabling faithful reproduction of appearance and further preferred color reproduction of appearance, image output device and digital camera using the same, and image processing program for executing the image processing method and recording medium on which the program is recorded | |
US6639628B1 (en) | Apparatus and method for processing color images | |
US6744920B1 (en) | Method, apparatus, and recording medium for processing image data to obtain color-balance adjusted image data based on white-balance adjusted image data | |
US6504952B1 (en) | Image processing method and apparatus | |
US7265781B2 (en) | Method and apparatus for determining a color correction matrix by minimizing a color difference maximum or average value | |
US20040095478A1 (en) | Image-capturing apparatus, image-processing apparatus, image-recording apparatus, image-processing method, program of the same and recording medium of the program | |
JP5195430B2 (en) | Image processing method, image processing program, image processing apparatus, camera | |
JP2003284084A (en) | Image processing apparatus and method, and manufacturing method of image processing apparatus | |
JPS6359292A (en) | Method of correcting saturation in electronic image processing | |
JPH10229502A (en) | Color conversion method | |
JP5407600B2 (en) | Image processing apparatus, image processing method, and electronic camera | |
JP4060024B2 (en) | Color balance adjusting method and apparatus, and recording medium | |
JPH1173488A (en) | Image printing system and its method | |
JP2020004268A (en) | Image processing device, image processing method, and program | |
US20070133017A1 (en) | Image processing apparatus, photographing apparatus, image processing system, image processing method and program | |
JP2004088345A (en) | Image forming method, image processor, print preparation device, and storage medium | |
JP3952113B2 (en) | Imaging apparatus and white balance adjustment method and apparatus | |
JP4037036B2 (en) | Color balance adjusting method and apparatus, and recording medium | |
JP2005215353A (en) | Image data generation device for generating reproducible image data with a plurality of gradation characteristics, and corresponding image reproduction device | |
JP3539883B2 (en) | Image processing method and apparatus, recording medium, imaging apparatus, and image reproducing apparatus | |
US20040057617A1 (en) | Image data supply method, recording apparatus and program | |
JP2005260693A (en) | Image reproduction method for reproducing an image by performing coordinate transformation according to an illumination light source | |
JP2005078171A (en) | Spectral image data processing method and spectral image data processor | |
JP2004023207A (en) | Color conversion table creation device, color conversion table creation method, recording medium on which color conversion table creation program is recorded, and profile creation device for creating a profile based on the color conversion table created by the above device or method | |
JP2000261825A (en) | Image processing method, device therefor and recording medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20050912 |
|
A711 | Notification of change in applicant |
Free format text: JAPANESE INTERMEDIATE CODE: A712 Effective date: 20061201 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20071207 |
|
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: 20071218 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20071219 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20101228 Year of fee payment: 3 |
|
R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 Ref document number: 4060024 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20101228 Year of fee payment: 3 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20111228 Year of fee payment: 4 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20111228 Year of fee payment: 4 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20121228 Year of fee payment: 5 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20121228 Year of fee payment: 5 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20131228 Year of fee payment: 6 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
LAPS | Cancellation because of no payment of annual fees |