JP2005079623A - Method, apparatus and program of correcting white balance - Google Patents

Method, apparatus and program of correcting white balance Download PDF

Info

Publication number
JP2005079623A
JP2005079623A JP2003304374A JP2003304374A JP2005079623A JP 2005079623 A JP2005079623 A JP 2005079623A JP 2003304374 A JP2003304374 A JP 2003304374A JP 2003304374 A JP2003304374 A JP 2003304374A JP 2005079623 A JP2005079623 A JP 2005079623A
Authority
JP
Japan
Prior art keywords
pixel group
color
candidate pixel
gray
pixels
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.)
Withdrawn
Application number
JP2003304374A
Other languages
Japanese (ja)
Inventor
Hiroyuki Furuya
宏行 古谷
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 JP2003304374A priority Critical patent/JP2005079623A/en
Publication of JP2005079623A publication Critical patent/JP2005079623A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Processing Of Color Television Signals (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Color Image Communication Systems (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To improve the effect of white balance of a color image. <P>SOLUTION: In a white balance correcting method, the image signal of each pixel of a color image is multiplied by predetermined coefficients, a group of gray candidate pixels corresponding to each of the coefficients is obtained using a pixel included near a black body locus curve of the gray as a gray candidate pixel, the coefficient at which the number of the pixels of the group of gray candidate pixels is the maximum is used as the optimum coefficient, the color temperature of the photographing light source of the color image is obtained from the color temperature of each pixel contained in the group of gray candidate pixels corresponding to the optimum coefficient, and the image signal of the color image which is multiplied by the optimum coefficient is corrected by the difference between the obtained color temperature and the color temperature of reference white. In this method, the sum obtained by weighted addition of the number of counts of each of the gray candidate pixels for the group of gray candidate images using a weighting coefficient shown in the figure is used as the number of pixels of the group of gray candidate pixels. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

本発明はカラー画像に対してホワイトバランス補正を行う方法および装置並びにそのためのプログラムに関するものである。   The present invention relates to a method and apparatus for performing white balance correction on a color image, and a program therefor.

ネガフィルムやカラーリバーサルフィルムなどの写真フィルムに記録された写真画像をスキャナーなどの読取装置で光電的に読み取って得たデジタル画像や、デジタルスチルカメラ(DSC)で撮像して得た画像などに対して、種々の画像処理を施してプリントすることが行われている。これらの画像処理の一つとして、カラーの画像の場合において、撮影光源の色味がプリントに反映されることに起因するプリントの画質劣化を避けるためのホワイトバランス補正処理が挙げられる。   For digital images obtained by photoelectrically reading photographic images recorded on photographic films such as negative films and color reversal films with a reading device such as a scanner, and images obtained by taking images with a digital still camera (DSC) Thus, various image processing is performed for printing. As one of these image processes, in the case of a color image, there is a white balance correction process for avoiding the deterioration of the print image quality caused by the color of the photographing light source being reflected in the print.

また、写真フィルムに記録されたカラーの写真画像を読み取って得たデジタル画像やDSCにより得られたカラー画像(以下略して全部画像という)は、プリントすることに限らず、モニタに表示されるなど、様々な形態で利用されている。モニタに表示する場合においても、撮影光源の色味の影響を取り除いて、ホワイトバランスの取れた美しい画像にする必要がある。   In addition, digital images obtained by reading color photographic images recorded on photographic film and color images obtained by DSC (hereinafter abbreviated as all images) are displayed on a monitor, not limited to printing. It is used in various forms. Even when the image is displayed on the monitor, it is necessary to remove the influence of the color of the photographing light source to obtain a beautiful image with white balance.

従来、ホワイトバランス補正の代表的な手法として、「世の中の色をすべて平均すればグレーとなる」というエバンスの原理(仮説)に基づいたLATD(Large Area Transmission Density、大面積平均透過濃度)方式の補正方法が用いられている。この補正方法は、補正した後の画像の平均色がグレーとなるように補正を行うものである。   Conventionally, as a representative method of white balance correction, a LATD (Large Area Transmission Density) method based on the Evans principle (hypothesis) that “all colors in the world are averaged to become gray” is used. A correction method is used. In this correction method, correction is performed so that the average color of the corrected image is gray.

しかし、LATD方式のホワイトバランス補正方法は、画像にかかった色味が撮影光源に起因するものか、被写体に起因するものかの区別ができないため、原因が撮影光源の場合にはうまくいくが、原因が被写体の場合には、補正後の画像は却って画質悪化してしまうという問題がある。例えば、赤い服を着た女性を撮影して得た画像の場合、LATD方式でホワイトバランスを施すと、画像全体をグレーにしようとするために、赤い服が濁り、女性の顔色が悪くなってしまう。   However, since the LATD method white balance correction method cannot distinguish whether the color applied to the image is caused by the photographic light source or the subject, it works well when the cause is the photographic light source. When the cause is the subject, there is a problem that the image quality of the corrected image is deteriorated. For example, in the case of an image obtained by taking a picture of a woman wearing red clothes, when white balance is applied using the LATD method, the red clothes become cloudy and the female's complexion color deteriorates in order to make the entire image gray. End up.

また、近年のほとんどのDSCには、撮影して得た画像に対してホワイトバランス補正を自動的に行うAWB(Auto White Balance)機能が搭載されており、DSCから出力された画像がこのWAB機能によってホワイトバランス補正されたものとなる。DSC内部のAWB機能によるホワイトバランス補正処理は、撮影直後の全画素の画像信号のR、G、Bを一様に定数倍にするように動作する簡単なものであり、うまく機能する場合とうまく機能しない場合があり、全ての画像をホワイトバランスの取れた画像にすることができないため、AWB機能がうまく動作しなかった場合の影響を取り除く必要がある。   In addition, most recent DSCs are equipped with an AWB (Auto White Balance) function that automatically performs white balance correction on an image obtained by shooting, and an image output from the DSC is the WAB function. The white balance is corrected by. The white balance correction processing by the AWB function in the DSC is a simple operation that operates to uniformly multiply R, G, and B of the image signals of all the pixels immediately after shooting, and when it works well. In some cases, it does not function, and it is impossible to make all images into a white balance image. Therefore, it is necessary to remove the influence when the AWB function does not work well.

上述した問題を解決するために、特許文献1には、処理対象の画像に対して、光源の色温度を求めるのに適した所定の色(例えばグレーまたは肌色)となる画素を検出し、これらの画素の色温度から撮影光源の色温度を求め、求めた撮影光源の色温度に基づいてホワイトバランス補正を行う方法が提案されている。なお、カラーネガフィルムを読み取って得た画像の場合でも、DSCにより取得して得た画像の場合でも、この方法を適用することができ、以下、DSCにより取得した画像からグレーの画素を検出してホワイトバランス補正を行うことを例にしてこの方法の原理を説明する。例えば、DSCにより色温度4000Kの自然昼光でグレー部分(グレーおよびその近似色)を含むシーンを撮影した場合を考える。このとき、撮影したグレー部分の画像信号(R,G,B)を次の式(1)により、色度座標(r,b)に変換して、色度図にプロットする。   In order to solve the above-described problem, Patent Document 1 detects pixels having a predetermined color (for example, gray or skin color) suitable for obtaining a color temperature of a light source for an image to be processed. A method has been proposed in which the color temperature of a photographic light source is obtained from the color temperature of the pixel and white balance correction is performed based on the obtained color temperature of the photographic light source. Note that this method can be applied to images obtained by reading a color negative film or images obtained by DSC. Hereinafter, gray pixels are detected from an image obtained by DSC. The principle of this method will be described using white balance correction as an example. For example, consider a case where a scene including a gray portion (gray and its approximate color) is photographed with natural daylight with a color temperature of 4000 K by DSC. At this time, the image signal (R, G, B) of the photographed gray portion is converted into chromaticity coordinates (r, b) by the following equation (1) and plotted on the chromaticity diagram.


r=R/(R+G+B)
b=B/(R+G+B) (1)

図1に色度図を示す。図1において、曲線Gyはグレーの黒体軌跡曲線である。黒体軌跡とは、色温度をT、色温度Tの黒体放射エネルギ分布をP(λ)、被写体の分光反射率分布をρ(λ)、DSCのCCDセンサの分光感度分布をSi(λ)(i=R、G、B)としたとき、次の式(2)で計算されたEiを上記の式(1)により色度座標(r,b)に変換して色度図にプロットしたとき、色温度Tを動かしたときの軌跡である。黒体軌跡は、CCDセンサの分光分布および被写体の色ごとに存在し、グレーの黒体軌跡は、被写体をグレーとしたときの被写体の分光反射率ρ(λ)1として得られる。

r = R / (R + G + B)
b = B / (R + G + B) (1)

FIG. 1 shows a chromaticity diagram. In FIG. 1, a curve Gy is a gray black body locus curve. The black body locus is the color temperature T, the black body radiant energy distribution of the color temperature T is P (λ), the spectral reflectance distribution of the subject is ρ (λ), and the spectral sensitivity distribution of the DSC CCD sensor is Si (λ ) (I = R, G, B), Ei calculated by the following equation (2) is converted into chromaticity coordinates (r, b) by the above equation (1) and plotted on the chromaticity diagram. This is the locus when the color temperature T is moved. A black body locus exists for each spectral distribution of the CCD sensor and the color of the subject, and a gray black body locus is obtained as a spectral reflectance ρ (λ) 1 of the subject when the subject is gray.


Ei=∫P(λ)ρ(λ)Si(λ)dλ (2)

上述したシーンの中のグレーの部分の画像信号を図1に示す色度図にプロットすると、グレーの黒体軌跡Gyの4000Kの近傍Gy0に散布すると考えられる。しかし、上述のように、最近のDSCは、殆どAWB(オートホワイトバランス)機能を有しているため、この機能が上手く動作した場合には、グレー部分は標準白色(例えば5500K)の近傍GY1に散布するが、この機能が上手く動作しなかった場合には、撮影光源の色温度4000Kから離れた位置不明な場所(例えば図1に示す場所A)に散布してしまう。

Ei = ∫P (λ) ρ (λ) Si (λ) dλ (2)

When the image signal of the gray portion in the scene described above is plotted on the chromaticity diagram shown in FIG. 1, it is considered that the image signal is scattered in the vicinity Gy0 of 4000K of the gray black body locus Gy. However, as described above, since most recent DSCs have an AWB (auto white balance) function, when this function works well, the gray part is in the vicinity of standard white (for example, 5500K) GY1. If this function does not work well, it will be sprayed to a location whose location is unknown from the color temperature 4000K of the photographic light source (for example, location A shown in FIG. 1).

そこで、DSC画像に含まれる、図1に示すAのような位置不明なグレー部分を基準白色の近傍Gy1に変換する処理をホワイトバランス補正処理とし、この処理を画像中の全ての画素に対して施せば、ホワイトバランスの取れた画像が得られる。しかし、図1に示すAの部分の位置は不明であるので、Aを基準白色の近傍Gy1へ直接変換するのは不可能である。そこで、特許文献1提案の方法では、ホワイトバランス処理を図1に示すベクトルαとβによる2段階の変換に分けて行う。図示のように、ベクトルαは、DSC側のAWB機能の不完全性により引き起こされた黒体軌跡Gyからのずれ量を補正するベクトルであり、ベクトルαによる変換で図1に示すAの部分が黒体軌跡Gy上の部分Gy0に変換される。また、ベクトルβは、黒体軌跡上のGy0の部分を基準白色(例えば5500K)の近傍Gy1に変換するベクトルであり、この2つのベクトルαとβとの合成により、図1に示すAから基準白色の近傍Gy1への変換が実現される。   Therefore, a process of converting a gray part with an unknown position, such as A shown in FIG. 1, included in the DSC image into a reference white neighborhood Gy <b> 1 is a white balance correction process, and this process is performed for all pixels in the image. If applied, an image with white balance can be obtained. However, since the position of the portion A shown in FIG. 1 is unknown, it is impossible to directly convert A to the reference white neighborhood Gy1. Therefore, in the method proposed in Patent Document 1, the white balance processing is divided into two stages of conversion using vectors α and β shown in FIG. As shown in the figure, the vector α is a vector for correcting the amount of deviation from the black body locus Gy caused by the imperfection of the AWB function on the DSC side, and the portion A shown in FIG. It is converted into a part Gy0 on the black body locus Gy. Further, the vector β is a vector for converting the portion of Gy0 on the black body locus into the neighborhood Gy1 of the reference white (for example, 5500 K). By combining these two vectors α and β, the reference A is obtained from A shown in FIG. Conversion to the white neighborhood Gy1 is realized.

2つのベクトルαとβのうち、図1に示すAの部分を黒体軌跡Gy上のGy0に移すベクトルαを求めることが難しい。黒体軌跡上のGy0が求められれば、Gy0から撮影光源の色温度Tを求めることができる。そして、黒体軌跡Gy上でこのGy0(色温度T)をGy1(色温度5500K)へ移す変換を表すベクトルβを求めるのは容易である。   Of the two vectors α and β, it is difficult to obtain a vector α that moves the portion A shown in FIG. 1 to Gy0 on the black body locus Gy. If Gy0 on the black body locus is obtained, the color temperature T of the photographing light source can be obtained from Gy0. Then, it is easy to obtain a vector β representing a conversion for transferring this Gy0 (color temperature T) to Gy1 (color temperature 5500K) on the black body locus Gy.

一方、DSCのAWB機能は、撮影直後の全画素の画像信号R、G、Bを一様に定数倍にするように作用する。この作用により、画像信号が黒体軌跡からずれたとすれば、これと逆の操作をすれば、黒体軌跡上の撮影光源の色温度(ここの例では、4000K)近傍(図1のGy0部分)に、多くのグレー部分が散布するようになるはずである。DSCのAWB機能が、画像信号に対する一次変換であるので、その逆変換も一次変換、すなわち、DSCの画像信号R、G、Bに対して所定の係数を乗算することである(図1では、画像信号R、G、Bを色度座標に変換している)。特許文献1提案の方法では、これを利用してベクトルαを求める。具体的には、DSCの画像信号に対して、所定の係数を乗算し、各係数に対して、この乗算がされた信号をグレーの黒体軌跡と比較し、黒体軌跡の近傍に位置すると検出される画素をグレーの可能性が高いとして、グレー候補画素とする。近傍であるか否かの判断は、色度座標(r,b)上で例えば距離0.01の範囲内であるか否かで行えばよい。   On the other hand, the AWB function of the DSC acts so that the image signals R, G, and B of all the pixels immediately after photographing are uniformly multiplied by a constant. As a result, if the image signal deviates from the black body locus, if the operation is reversed, the vicinity of the color temperature of the imaging light source (4000K in this example) on the black body locus (Gy0 portion in FIG. 1) ), Many gray parts should be scattered. Since the AWB function of the DSC is the primary conversion for the image signal, the inverse conversion is also the primary conversion, that is, the DSC image signal R, G, B is multiplied by a predetermined coefficient (in FIG. 1, The image signals R, G, and B are converted into chromaticity coordinates). In the method proposed in Patent Document 1, the vector α is obtained using this. Specifically, the DSC image signal is multiplied by a predetermined coefficient, and the multiplied signal is compared with a gray black body locus for each coefficient. Assuming that the detected pixel has a high possibility of gray, it is determined as a gray candidate pixel. The determination of whether or not it is in the vicinity may be made based on whether or not the distance is within a range of 0.01 on the chromaticity coordinates (r, b).

こうして、乗算する係数毎に、グレー候補画素により構成されるグレー候補画素群が得られる。これらのグレー候補画素群に含まれる画素の数を数え、グレー候補画素の数が最も多いグレー候補画素群(図1に示すAの部分に相当する)に対応する係数を最適係数、すなわち、図1に示すAの部分を黒体軌跡上のGy0に変換するベクトルαとすることができる。   Thus, a gray candidate pixel group composed of gray candidate pixels is obtained for each coefficient to be multiplied. The number of pixels included in these gray candidate pixel groups is counted, and the coefficient corresponding to the gray candidate pixel group having the largest number of gray candidate pixels (corresponding to the portion A shown in FIG. 1) is the optimum coefficient, that is, A portion A shown in FIG. 1 can be used as a vector α for converting Gy0 on the black body locus.

ベクトルαを用いて、このベクトルαに対応するグレー候補画素群の各画素の信号を図1に示す黒体軌跡Gy上のGy0に変換すれば、Gy0の各画素の色温度の平均値を求めて撮影光源の色温度として求めることができる。求められた色温度から基準白色に変換するためのベクトルβを求めることができるので、ベクトルαとβを画像の全ての画素に対して適用することによってホワイトバランス補正処理が施されることになる。   If the signal of each pixel of the gray candidate pixel group corresponding to this vector α is converted into Gy0 on the black body locus Gy shown in FIG. 1, the average value of the color temperature of each pixel of Gy0 is obtained. The color temperature of the photographic light source can be obtained. Since the vector β for converting the obtained color temperature into the reference white can be obtained, the white balance correction process is performed by applying the vectors α and β to all the pixels of the image. .

また、ベクトルαを求める際に、グレーに限らず、被写体の中で、撮影頻度が高く、種類によって色味の変換が少ない肌色を用いてもよい。肌色は、人種(白人、黄人、黒人など)によって色味がかなり異なると思われるが、測定した分光スペクトルによれば、違うのは主として明るさであり、スペクトルの形はあまり変わらず色味の変化は小さいことが分かるので、肌色を色の同定に利用することができる。すなわち、グレーの黒体軌跡の代わりに肌色の黒体軌跡を用い、前述したグレー候補画素群を求めるのと同じようにして肌色候補画素群を求め、肌色候補画素の個数が最も多い肌色候補画素群に対応する係数を最適係数にしてベクトルαを求めるようにしてもよい。   Further, when obtaining the vector α, not only gray, but also a skin color with a high frequency of photographing and a little color conversion depending on the type may be used in the subject. The skin color seems to vary considerably depending on race (white, yellow, black, etc.), but according to the measured spectrum, the difference is mainly brightness, and the shape of the spectrum does not change much. Since the change in taste is small, the skin color can be used for color identification. That is, using the skin color black body locus instead of the gray body locus, the skin color candidate pixel group is obtained in the same manner as the gray candidate pixel group described above, and the skin color candidate pixel having the largest number of skin color candidate pixels is obtained. The vector α may be obtained by using the coefficient corresponding to the group as the optimum coefficient.

さらに、ベクトルαをより精度良く求めるために、グレー候補画素群と肌色候補画素群両方との両方を検出し、グレー候補画素群に含まれるグレー候補画素の個数と、肌色候補画素群に含まれる肌色候補画素の個数との和が最も多い係数を最適係数、すなわちベクトルαとするようにしてもよい。   Further, in order to obtain the vector α more accurately, both the gray candidate pixel group and the skin color candidate pixel group are detected, and the number of gray candidate pixels included in the gray candidate pixel group and the skin color candidate pixel group are included. The coefficient having the largest sum with the number of skin color candidate pixels may be the optimum coefficient, that is, the vector α.

また、グレー部分と肌色部分とを含むシーンを均一光源で撮影した場合、グレーを用いて求めた撮影光源の色温度と、肌色を用いて求めた撮影光源の色温度とは一致するはずであることを利用して、グレー候補画素群の平均色温度と肌色候補画素群の平均色温度との差が最も小さい係数を最適係数、すわわち、ベクトルαとして求めてよい。   In addition, when a scene including a gray portion and a skin color portion is shot with a uniform light source, the color temperature of the shooting light source obtained using gray and the color temperature of the shooting light source obtained using skin color should match. By utilizing this, the coefficient having the smallest difference between the average color temperature of the gray candidate pixel group and the average color temperature of the skin color candidate pixel group may be obtained as the optimum coefficient, that is, the vector α.

さらに、グレー候補画素群に含まれるグレー候補画素の個数と肌色候補画素群に含まれる肌色候補画素の個数との和が最も多く、かつグレー候補画素群の平均色温度と肌色候補画素群の平均色温度との差が最も小さい係数を最適係数とするようにして、ベクトルαの精度をより高くするようにしてもよい。   Further, the sum of the number of gray candidate pixels included in the gray candidate pixel group and the number of skin color candidate pixels included in the skin color candidate pixel group is the largest, and the average color temperature of the gray candidate pixel group and the average of the skin color candidate pixel group The coefficient having the smallest difference from the color temperature may be set as the optimum coefficient, and the accuracy of the vector α may be further increased.

このように、ベクトルαとベクトルβを求めて、画像中の全ての画素の画像信号に対して適用することによってホワイトバランス補正を施す方法では、画像中の真のグレーおよび/または肌色の画素を検出して撮影光源の色温度を求めてホワイトバランス補正を行っているので、LATD方式に基づいたホワイトバランス補正方法より適切なホワイトバランス補正効果を得ることができると共に、DSCのAWB機能のばらつきにも影響されない。
特開2002−152772号公報
Thus, in the method of obtaining the vector α and the vector β and applying the white balance correction to the image signals of all the pixels in the image, true gray and / or skin color pixels in the image are obtained. Since the white balance correction is performed by detecting the color temperature of the photographic light source, it is possible to obtain a more appropriate white balance correction effect than the white balance correction method based on the LATD method, and to the variation in the AWB function of the DSC. Is not affected.
JP 2002-152772 A

しかしながら、特許文献1記載の方法において、最適係数、すなわちベクトルαを求める際に、各グレー候補画素のカウント数を平等に取り扱うようにしてグレー候補画素群のグレー候補画素の個数を求めるようにしている。すなわち、グレー候補画素群に対して、1つのグレー候補画素を1個としてカウントして各グレー候補画素群に含まれるグレー候補画素の個数を求め、この個数が最も多いグレー候補画素群に対応する係数を最適係数としている。肌色を用いる場合においても同様である。   However, in the method described in Patent Document 1, when obtaining the optimum coefficient, that is, the vector α, the number of gray candidate pixels in the gray candidate pixel group is obtained by treating the count number of each gray candidate pixel equally. Yes. That is, for each gray candidate pixel group, one gray candidate pixel is counted as one to obtain the number of gray candidate pixels included in each gray candidate pixel group, and this gray candidate pixel group corresponding to the largest number of gray candidate pixels is obtained. The coefficient is the optimum coefficient. The same applies when skin color is used.

また、グレー候補画素群の平均色温度と肌色候補画素群の平均色温度との差が最も小さい係数を最適係数としてベクトルαを求める際においても、各候補画素の色温度を平等に取り扱うようにしてグレー候補画素群と肌色候補画素群の平均色温度を求めるようにしている。   Also, when obtaining the vector α using the coefficient having the smallest difference between the average color temperature of the gray candidate pixel group and the average color temperature of the skin color candidate pixel group as the optimum coefficient, the color temperature of each candidate pixel is handled equally. Thus, the average color temperature of the gray candidate pixel group and the skin color candidate pixel group is obtained.

一方、同じ候補画素群(グレー候補画素群または肌色候補画素群)に含まれる候補画素(グレー候補画素または肌色候補画素)であっても、真のグレーまたは真の肌色である確率が異なるため、同じ候補画素群に含まれる候補画素が、真のグレーまたは真の肌色である確率を考慮し、最適係数の精度を高め、より良いホワイトバランス補正を実現することが要望されている。   On the other hand, even if the candidate pixel (gray candidate pixel or skin color candidate pixel) included in the same candidate pixel group (gray candidate pixel group or skin color candidate pixel group), the probability of true gray or true skin color is different. Considering the probability that candidate pixels included in the same candidate pixel group are true gray or true skin color, it is desired to improve the accuracy of the optimum coefficient and realize better white balance correction.

本発明は、上記事情に鑑み、同じ候補画素群に含まれる候補画素が、真のグレーまたは真の肌色である確率を考慮した上で最適係数となるベクトルαを求め、より良い効果を得られるホワイトバランス補正の方法および装置並びにそのためのプログラムを提供することを目的とするものである。   In view of the above circumstances, the present invention obtains a vector α that is an optimum coefficient in consideration of the probability that candidate pixels included in the same candidate pixel group are true gray or true skin color, and can obtain a better effect. An object of the present invention is to provide a white balance correction method and apparatus, and a program therefor.

本発明の第1のホワイトバランス補正方法は、カラー画像の各画素の画像信号に対して、所定の係数を乗算し、その結果、グレーの黒体軌跡曲線の近傍に入る画素をグレー候補画素として各前記係数に対応するグレー候補画素群を得、該グレー候補画素群の画素数が最大となる前記係数を最適係数とすると共に、該最適係数に対応する前記グレー候補画素群をグレー画素群とし、該グレー画素群に含まれる各々の画素の色温度から前記カラー画像の撮影光源の色温度を求め、前記最適係数を乗算された前記カラー画像の画像信号を、前記求められた色温度と基準白色の色温度との差分だけ補正するホワイトバランス補正方法において、
前記グレーの黒体軌跡曲線に近い画素ほどカウント数の重みが高くなるように前記グレー候補画像群毎に各々の前記グレー候補画素のカウント数を重み付け加算して得た和を当該グレー候補画素群の画素数とすることを特徴とするものである。
The first white balance correction method of the present invention multiplies an image signal of each pixel of a color image by a predetermined coefficient, and as a result, a pixel that enters the vicinity of a gray black body locus curve is determined as a gray candidate pixel. A gray candidate pixel group corresponding to each coefficient is obtained, and the coefficient that maximizes the number of pixels of the gray candidate pixel group is set as an optimal coefficient, and the gray candidate pixel group corresponding to the optimal coefficient is set as a gray pixel group. The color temperature of the photographing light source of the color image is obtained from the color temperature of each pixel included in the gray pixel group, and the image signal of the color image multiplied by the optimum coefficient is used as the obtained color temperature and the reference. In the white balance correction method that corrects only the difference from the white color temperature,
The gray candidate pixel group is a sum obtained by weighting and adding the count number of each gray candidate pixel for each gray candidate image group so that the weight of the count number becomes higher as the pixel is closer to the gray black body locus curve. The number of pixels is the characteristic.

すなわち、本発明の第1のホワイトバランス補正方法は、グレーを用いて撮影光源の色温度を求めてホワイトバランス補正を行うものであり、グレーの黒体軌跡曲線に位置するべきであるにも拘わらずグレーの黒体軌跡曲線からずれたグレーの部分を、グレーの黒体軌跡曲線上に戻す変換を行うための前記最適係数として、画素数が最も多いグレー候補画素群(すなわちグレー画素群)に対応する係数を求めて撮影光源の色温度を取得する点については、特許文献1記載の方法と同様であるが、各グレー候補画素群の画素数を求める際に、特許文献1に記載された方法のように、単純に各グレー候補画素群に含まれるグレー候補画素をカウントして加算する、すなわち1個のグレー候補画素を1としてカウントし、カウント数の和を該当するグレー候補画素群の画素数とするのではなく、同じグレー候補画素群に含まれるグレー候補画素であっても、グレーの黒体軌跡曲線に近い画素ほど、真のグレーの画素である可能性が高いことに着目し、グレーの黒体軌跡曲線に近いグレー候補画素ほど、カウント数の重みが高くようにグレー候補画素群毎に各々の前記グレー候補画素のカウント数を重み付け加算して得た和を当該グレー候補画素群の画素数とする。すなわち、同じグレー候補群に含まれるグレー候補画素のうち、グレーの黒体軌跡曲線に位置する(黒体軌跡曲線との距離が零である)グレー候補画素に対して、そのカウント数(1個の候補画素のカウント数が1となる)を最大の重みを付け、グレーの黒体軌跡曲線からの距離が遠いグレー候補画素ほど、その重みが前記最大の重みより小さくなるようにしてグレー候補画素群毎にグレー候補画素のカウント数を重み付け加算して得た和を当該グレー候補画素群の画素数とする。   That is, the first white balance correction method of the present invention is to perform white balance correction by obtaining the color temperature of the photographing light source using gray, and it should be positioned on the gray black body locus curve. The gray candidate pixel group having the largest number of pixels (that is, the gray pixel group) is used as the optimum coefficient for converting the gray portion shifted from the gray black body locus curve back to the gray black body locus curve. The point of obtaining the color temperature of the photographic light source by obtaining the corresponding coefficient is the same as the method described in Patent Document 1, but was described in Patent Document 1 when obtaining the number of pixels of each gray candidate pixel group. As in the method, the gray candidate pixels included in each gray candidate pixel group are simply counted and added, that is, one gray candidate pixel is counted as 1, and the sum of the count numbers is applicable. Rather than using the number of pixels in the gray candidate pixel group, even a gray candidate pixel included in the same gray candidate pixel group may be a true gray pixel as the pixel is closer to the gray black body locus curve. Focusing on the fact that the gray candidate pixel is closer to the gray black body locus curve, the sum obtained by weighting and adding the count number of each gray candidate pixel for each gray candidate pixel group so that the weight of the count number is higher. Is the number of pixels of the gray candidate pixel group. That is, among the gray candidate pixels included in the same gray candidate group, the number of counts (one) for the gray candidate pixels located on the gray black body locus curve (the distance from the black body locus curve is zero). The gray candidate pixel is such that the gray candidate pixel that is farther from the gray black body locus curve has a smaller weight than the maximum weight. The sum obtained by weighting and adding the count number of gray candidate pixels for each group is set as the number of pixels of the gray candidate pixel group.

また、「黒体軌跡曲線の近傍に入る画素」とは、その画素の画像信号(ここでは、前記所定の係数を乗算した信号)が色度図における位置と黒体軌跡曲線との距離が所定の値(例えば0.03)以下である画素のことを意味する。また、前記「距離」は、前記画素と黒体軌跡曲線との遠近を表すことができるものであれば如何なる求め方で求められた値であってもよく(但し、同じグレー候補画素群の全ての画素に対して同じ求め方で求める必要がある)、例えば、その画素の位置から黒体軌跡曲線までの法線の長さ(例えば、図1に示す画素Qの場合、法線の長さL1)を用いることは勿論、その画素の位置から色度座標のいずれか1つの座標に平行する方向に沿って黒体軌跡曲線まで引いた線の長さ(例えば、図1に示す画素Qの場合、色度座標rに平行する線の長さL2)を用いてもよい。なお、実際の実験の結果、画素の位置から色度座標rに平行する方向に沿って黒体軌跡曲線まで引いた線の長さを、画素の位置と黒体軌跡曲線との距離として用いる場合において、最も良いホワイトバランスの効果を得ているので、画素の位置から色度座標rに平行する方向に沿って黒体軌跡曲線まで引いた線の長さを、画素の位置と黒体軌跡曲線との距離として用いることが好ましい。   In addition, “a pixel entering the vicinity of the black body locus curve” means that the image signal of the pixel (here, a signal multiplied by the predetermined coefficient) is a distance between the position in the chromaticity diagram and the black body locus curve. Means a pixel that is less than or equal to the value (for example, 0.03). The “distance” may be a value obtained by any method as long as the distance between the pixel and the black body locus curve can be represented (however, all of the same gray candidate pixel group). For example, the length of the normal line from the position of the pixel to the black body locus curve (for example, in the case of the pixel Q shown in FIG. 1, the length of the normal line) Of course, the length of the line drawn from the position of the pixel to the black body locus curve along the direction parallel to any one of the chromaticity coordinates (for example, the pixel Q shown in FIG. 1) In this case, the length L2) of the line parallel to the chromaticity coordinate r may be used. As a result of an actual experiment, the length of a line drawn from the pixel position to the black body locus curve along the direction parallel to the chromaticity coordinate r is used as the distance between the pixel position and the black body locus curve. Since the best white balance effect is obtained, the length of the line drawn from the pixel position to the black body locus curve along the direction parallel to the chromaticity coordinate r is defined as the pixel position and the black body locus curve. It is preferable to use it as a distance.

また、グレー画素群に含まれるグレー画素の色温度とは、該画素のグレーの黒体軌跡曲線における色温度のことを意味し、例えば、図1に示す画素Qの場合、その色温度は、グレーの黒体軌跡曲線Gy上の点Q1の色温度値となる。   Further, the color temperature of the gray pixel included in the gray pixel group means the color temperature in the gray black body locus curve of the pixel. For example, in the case of the pixel Q shown in FIG. The color temperature value of the point Q1 on the gray black body locus curve Gy is obtained.

また、本発明における「色温度」は、色温度そのものに限らず、色温度を表すことができる数値であればいかなる数値を用いてもよい。例えば、通常の、直接的に単位Kにより表される数値を用いるのは勿論、単位としてKではないが、間接的でありながら色温度を表すことができる、下記の式(3)に示すmired値を用いてもよい。   Further, the “color temperature” in the present invention is not limited to the color temperature itself, and any numerical value may be used as long as it can represent the color temperature. For example, the usual numerical value represented directly by the unit K is used, but of course, the unit is not K, but the color temperature can be expressed while being indirectly, mired shown in the following formula (3) A value may be used.


mired=10/T (3)
但し、T:色温度値(K)

なお、上記における「黒体軌跡の近傍に入る画素」および「色温度」の説明は、本発明の全てのホワイトバランス補正方法および装置並びにプログラムに適用することとし、以下の説明においてその説明を省略する。

mired = 10 6 / T (3)
T: Color temperature value (K)

The description of “pixels in the vicinity of the black body locus” and “color temperature” in the above description is applied to all the white balance correction methods, apparatuses, and programs of the present invention, and the description is omitted in the following description. To do.

本発明の第2のホワイトバランス補正方法は、カラー画像の各画素の画像信号に対して、所定の係数を乗算し、その結果、グレーの黒体軌跡曲線の近傍に入る画素をグレー候補画素として各前記係数に対応するグレー候補画素群を得、該グレー候補画素群の画素数が最大となる前記係数を最適係数とすると共に、該最適係数に対応する前記グレー候補画素群をグレー画素群とし、該グレー画素群に含まれる各々の画素の色温度から前記カラー画像の撮影光源の色温度を求め、前記最適係数を乗算された前記カラー画像の画像信号を、前記求められた色温度と基準白色の色温度との差分だけ補正するホワイトバランス補正方法において、
サンプルカラー画像中のグレー画素の個数が当該サンプルカラー画像の全画素の個数に占める割合に対して、多数の前記サンプルカラー画像を用いて統計的に求められた各々の前記割合毎のサンプルカラー画像の存在頻度に応じた補正係数で、前記グレー候補画素群に含まれるグレー候補画素の個数が前記カラー画像の全画素の個数に占める割合に応じて前記グレー候補画素群毎にそのグレー候補画素の個数を補正して得た値を当該グレー候補画素群の画素数とすることを特徴とするものである。
In the second white balance correction method of the present invention, the image signal of each pixel of the color image is multiplied by a predetermined coefficient, and as a result, a pixel that enters the vicinity of the gray black body locus curve is determined as a gray candidate pixel. A gray candidate pixel group corresponding to each coefficient is obtained, and the coefficient that maximizes the number of pixels of the gray candidate pixel group is set as an optimal coefficient, and the gray candidate pixel group corresponding to the optimal coefficient is set as a gray pixel group. The color temperature of the photographing light source of the color image is obtained from the color temperature of each pixel included in the gray pixel group, and the image signal of the color image multiplied by the optimum coefficient is used as the obtained color temperature and the reference. In the white balance correction method that corrects only the difference from the white color temperature,
The sample color image for each of the ratios statistically obtained using a number of the sample color images with respect to the ratio of the number of gray pixels in the sample color image to the total number of pixels of the sample color image Correction coefficient according to the presence frequency of the gray candidate pixel group, the gray candidate pixel group for each gray candidate pixel group according to the ratio of the number of gray candidate pixels included in the gray candidate pixel group to the total number of pixels of the color image. A value obtained by correcting the number is used as the number of pixels of the gray candidate pixel group.

すなわち、本発明の第2のホワイトバランス補正方法は、第1のホワイトバランス補正方法と同じように、グレーを用いて撮影光源の色温度を求めてホワイトバランス補正を行うものであり、グレーの黒体軌跡曲線に位置するべきであるにも拘わらずグレーの黒体軌跡曲線からずれたグレーの部分を、グレーの黒体軌跡曲線上に戻す変換を行うための前記最適係数として、画素数が最も多いグレー候補画素群(すなわちグレー画素群)に対応する係数を求めて撮影光源の色温度を取得するが、各グレー候補画素群の画素数を求める際に、第1のホワイトバランス補正方法と異なる視点から、グレー候補画素群に含まれるグレー候補画素の個数に対して補正を行って得た値を当該グレー候補画素群の画素数とする。以下その詳細について説明する。   That is, in the second white balance correction method of the present invention, as in the first white balance correction method, the color temperature of the photographic light source is obtained using gray and white balance correction is performed. The optimal coefficient for performing the conversion to return the gray portion deviated from the gray black body locus curve to the gray body locus curve, although it should be located on the body locus curve, has the largest number of pixels. The coefficient corresponding to many gray candidate pixel groups (that is, gray pixel groups) is obtained to obtain the color temperature of the photographing light source. However, when obtaining the number of pixels of each gray candidate pixel group, it differs from the first white balance correction method. A value obtained by correcting the number of gray candidate pixels included in the gray candidate pixel group from the viewpoint is set as the number of pixels of the gray candidate pixel group. The details will be described below.

カラー画像から検出された前記グレー候補群に含まれるグレー候補画素の個数が前記カラー画像の全画素の個数に占める割合が大きいほど、このグレー候補画素群に含まれるグレー候補画素が真のグレー画素である可能性が高い。この傾向に基づいて、グレー候補画素群の画素数を求める際に、グレー候補画素群の前記割合に応じて、割合が大きいほど大きくなる補正係数で、グレー候補画素群に含まれるグレー候補画素の個数を補正して得た値を当該グレー候補画素群の画素数とするようにすれば、より精度良く前記最適係数を得ることができるはずである。   As the ratio of the number of gray candidate pixels included in the gray candidate group detected from the color image to the total number of pixels in the color image increases, the gray candidate pixel included in the gray candidate pixel group becomes a true gray pixel. Is likely. Based on this tendency, when obtaining the number of pixels of the gray candidate pixel group, a correction coefficient that increases as the ratio increases according to the ratio of the gray candidate pixel group. If the value obtained by correcting the number is set as the number of pixels of the gray candidate pixel group, the optimum coefficient should be obtained with higher accuracy.

一方、図2(a)は、様々なシーンを撮影して得た多数(数万枚)のカラー画像(前記サンプルカラー画像)に対して、サンプルカラー画像中のグレー画素の個数がサンプルカラー画像全体の画素(全画素)の個数に占める割合を画像毎に求めると共に、各々の割合に対して、該割合を有するサンプルカラー画像の存在頻度を求めた結果(例えば、2万枚のサンプルカラー画像のうち、wとなる前記割合を有するサンプルカラー画像が200枚あるとすれば、wの前記割合に対応するサンプルカラー画像の存在頻度が2万分の200、すなわち1%となる。)に基づいて得た前記割合とサンプルカラー画像の存在頻度との関係を示す図である。図示のように、グレー画素の個数が全画素の個数に占める割合が大きいほど、その割合を有するサンプルカラー画像の存在頻度が低くなるが、存在頻度の減少率が、前記割合が大きくなるにつれ小さくなる。   On the other hand, FIG. 2A shows a sample color image in which the number of gray pixels in the sample color image is a large number (tens of thousands) of color images (the sample color image) obtained by photographing various scenes. The ratio of the total number of pixels (all pixels) to each image is calculated for each image, and the result of determining the existence frequency of sample color images having the ratio for each ratio (for example, 20,000 sample color images) If there are 200 sample color images having the above-mentioned ratio of w, the presence frequency of the sample color image corresponding to the above-mentioned ratio of w is 200 / 20,000, that is, 1%). It is a figure which shows the relationship between the obtained said ratio and the presence frequency of a sample color image. As shown in the figure, the greater the ratio of the number of gray pixels to the total number of pixels, the lower the existence frequency of the sample color image having the ratio, but the decrease rate of the existence frequency decreases as the ratio increases. Become.

このような統計的な傾向があるから、前述の「割合が大きいほど大きくなる補正係数」としては、図2(a)に示す統計的な傾向を反映した補正係数を用いた方が、この統計的な傾向を反映しない補正係数を用いるより、より良い精度で前記最適係数を求めることができる。   Since there is such a statistical tendency, the above-mentioned “correction coefficient that increases as the ratio increases” uses this correction coefficient that reflects the statistical tendency shown in FIG. The optimum coefficient can be obtained with better accuracy than using a correction coefficient that does not reflect a general tendency.

図2(b)は、図2(a)に示す統計的な傾向を反映した補正係数の例を示している。図示のように、この補正係数は、前述の「割合が大きいほど大きくなる補正係数」であり、かつ図2(a)に示す傾向を反映し、グレー候補画素群に含まれるグレー候補画素の個数が全画素の個数に占める割合に応じて、該割合が大きいほど大きくなり、かつ該割合が大きいほど増加率が小さくなるものである。   FIG. 2B shows an example of the correction coefficient reflecting the statistical tendency shown in FIG. As shown in the figure, this correction coefficient is the above-mentioned “correction coefficient that increases as the ratio increases” and reflects the tendency shown in FIG. 2A, and the number of gray candidate pixels included in the gray candidate pixel group. Increases as the ratio increases, and the increase rate decreases as the ratio increases.

本発明の第2のホワイトバランス補正方法は、図2(a)に示す統計的な傾向を反映した補正係数(例えば図2(b)に示す補正係数)で、前記グレー候補画素群に含まれるグレー候補画素の個数が前記カラー画像の全画素の個数に占める割合に応じて、前記グレー候補画素群毎にそのグレー候補画素の個数を補正して得た値を当該グレー候補画素群の画素数とする。   The second white balance correction method of the present invention is a correction coefficient reflecting the statistical tendency shown in FIG. 2A (for example, the correction coefficient shown in FIG. 2B) and is included in the gray candidate pixel group. According to the ratio of the number of gray candidate pixels to the total number of pixels of the color image, the value obtained by correcting the number of gray candidate pixels for each gray candidate pixel group is the number of pixels in the gray candidate pixel group. And

なお、図2(a)に示す統計的な傾向を求める際に、サンプルカラー画像中のグレー画素としては、できるだけ真のグレー画素に近い画素を用いることが望ましい。例えば、特許文献1に記載の方法で最適係数を求め、この最適係数に対応するグレー候補画素群に含まれる画素を用いてもよく、本発明の第1のホワイトバランス補正方法を用いて得られた最適係数に対応するグレー候補画素群に含まれる画素を用いてもよい。   When obtaining the statistical tendency shown in FIG. 2A, it is desirable to use a pixel as close to a true gray pixel as possible as the gray pixel in the sample color image. For example, an optimal coefficient may be obtained by the method described in Patent Document 1, and a pixel included in a gray candidate pixel group corresponding to the optimal coefficient may be used, which is obtained using the first white balance correction method of the present invention. Pixels included in the gray candidate pixel group corresponding to the optimum coefficient may be used.

本発明の第3のホワイトバランス補正方法は、カラー画像の各画素の画像信号に対して、所定の係数を乗算し、その結果、肌色の黒体軌跡曲線の近傍に入る画素を肌色候補画素として各前記係数に対応する肌色候補画素群を得、該肌色候補画素群の画素数が最大となる前記係数を最適係数とすると共に、該最適係数に対応する前記肌色候補画素群を肌色画素群とし、該肌色画素群に含まれる各々の画素の色温度から前記カラー画像の撮影光源の色温度を求め、前記最適係数を乗算された前記カラー画像の画像信号を、前記求められた色温度と基準白色の色温度との差分だけ補正するホワイトバランス補正方法において、
前記肌色の黒体軌跡曲線に近い画素ほどカウント数の重みが高くなるように前記肌色候補画素群毎に各々の前記肌色候補画素のカウント数を重み付け加算して得た和を当該肌色候補群の画素数とすることを特徴とするものである。
In the third white balance correction method of the present invention, the image signal of each pixel of the color image is multiplied by a predetermined coefficient, and as a result, a pixel that is in the vicinity of the skin color black body locus curve is defined as a skin color candidate pixel. A skin color candidate pixel group corresponding to each coefficient is obtained, the coefficient that maximizes the number of pixels of the skin color candidate pixel group is set as an optimal coefficient, and the skin color candidate pixel group corresponding to the optimal coefficient is set as a skin color pixel group. The color temperature of the photographing light source of the color image is obtained from the color temperature of each pixel included in the skin color pixel group, and the image signal of the color image multiplied by the optimum coefficient is used as the obtained color temperature and the reference. In the white balance correction method that corrects only the difference from the white color temperature,
For each skin color candidate pixel group, the sum obtained by weighting and adding the count number of each skin color candidate pixel so that the weight closer to the skin color black body locus curve is higher in the count number is added to the skin color candidate group. It is characterized by the number of pixels.

本発明の第3のホワイトバランス補正方法は、グレーの代わりに肌色を用いる点を除いて、第1のホワイトバランス補正方法と同様である。すなわち、本発明の第3のホワイトバランス補正方法は、肌色を用いて撮影光源の色温度を求めてホワイトバランス補正を行うものであり、肌色の黒体軌跡曲線に位置するべきであるにも拘わらず肌色の黒体軌跡曲線からずれた肌色の部分を、肌色の黒体軌跡曲線上に戻す変換を行うための前記最適係数として、画素数が最も多い肌色候補画素群(すなわち肌色画素群)に対応する係数を求めて撮影光源の色温度を取得する点については、特許文献1記載の方法と同様であるが、各肌色候補画素群の画素数を求める際に、特許文献1に記載された方法のように、単純に各肌色候補画素群に含まれる肌色候補画素をカウントして加算する、すなわち1個の肌色候補画素を1としてカウントし、カウント数の和を該当する肌色候補画素群の画素数とするのではなく、同じ肌色候補画素群に含まれる肌色候補画素であっても、肌色の黒体軌跡曲線に近い画素ほど、真の肌色の画素である可能性が高いことに着目し、肌色の黒体軌跡曲線に近い肌色候補画素ほど、カウント数の重みが高くように肌色候補画素群毎に各々の前記肌色候補画素のカウント数を重み付け加算して得た和を当該肌色候補画素群の画素数とする。すなわち、同じ肌色候補群に含まれる肌色候補画素のうち、肌色の黒体軌跡曲線に位置する(黒体軌跡曲線との距離が零である)肌色候補画素に対して、そのカウント数(1個の候補画素のカウント数が1となる)を最大の重みを付け、肌色の黒体軌跡曲線からの距離が遠い肌色候補画素ほど、その重みが前記最大の重みより小さくなるようにして肌色候補画素群毎に肌色候補画素のカウント数を重み付け加算して得た和を当該肌色候補画素群の画素数とする。   The third white balance correction method of the present invention is the same as the first white balance correction method except that skin color is used instead of gray. That is, the third white balance correction method of the present invention performs white balance correction by obtaining the color temperature of the photographic light source using the skin color, and should be positioned on the skin color black body locus curve. The skin color candidate pixel group having the largest number of pixels (that is, the skin color pixel group) is used as the optimum coefficient for converting the skin color portion shifted from the skin color black body locus curve back to the skin color black body locus curve. The point of obtaining the color temperature of the photographing light source by obtaining the corresponding coefficient is the same as the method described in Patent Document 1, but it was described in Patent Document 1 when obtaining the number of pixels of each skin color candidate pixel group. As in the method, the flesh color candidate pixels included in each flesh color candidate pixel group are simply counted and added, that is, one flesh color candidate pixel is counted as 1, and the sum of the counts is calculated for the corresponding flesh color candidate pixel group. Number of pixels Rather than focusing on the fact that even skin color candidate pixels included in the same skin color candidate pixel group, pixels closer to the skin color black body locus curve are more likely to be true skin color pixels. Pixels of the skin color candidate pixel group are sums obtained by weighting and adding the count numbers of the skin color candidate pixels for each skin color candidate pixel group so that the skin color candidate pixels closer to the black body locus curve have higher count weights. It is a number. That is, among the skin color candidate pixels included in the same skin color candidate group, the count number (1) is determined for the skin color candidate pixels located on the skin color black body locus curve (the distance from the black body locus curve is zero). Skin color candidate pixels with the maximum weight assigned to the skin color candidate pixel, and the skin color candidate pixels that are farther away from the skin color black body locus curve have a smaller weight than the maximum weight. The sum obtained by weighting and adding the counts of the skin color candidate pixels for each group is set as the number of pixels of the skin color candidate pixel group.

本発明の第4のホワイトバランス補正方法は、カラー画像の各画素の画像信号に対して、所定の係数を乗算し、その結果、肌色の黒体軌跡曲線の近傍に入る画素を肌色候補画素として各前記係数に対応する肌色候補画素群を得、該肌色候補画素群の画素数が最大となる前記係数を最適係数とすると共に、該最適係数に対応する前記肌色候補画素群を肌色画素群とし、該肌色画素群に含まれる各々の画素の色温度から前記カラー画像の撮影光源の色温度を求め、前記最適係数を乗算された前記カラー画像の画像信号を、前記求められた色温度と基準白色の色温度との差分だけ補正するホワイトバランス補正方法において、
サンプルカラー画像中の肌色画素の個数が当該サンプルカラー画像の全画素の個数に占める割合に対して、多数の前記サンプルカラー画像を用いて統計的に求められた各々の前記割合毎のサンプルカラー画像の存在頻度に応じた補正係数で、前記肌色候補画素群に含まれる肌色候補画素の個数が前記カラー画像の全画素の個数に占める割合に応じて前記肌色候補画素群毎にその肌色候補画素の個数を補正して得た値を当該肌色候補画素群の画素数とすることを特徴とするものである。
The fourth white balance correction method of the present invention multiplies the image signal of each pixel of the color image by a predetermined coefficient, and as a result, a pixel that is in the vicinity of the skin color black body locus curve is used as the skin color candidate pixel. A skin color candidate pixel group corresponding to each coefficient is obtained, the coefficient that maximizes the number of pixels of the skin color candidate pixel group is set as an optimal coefficient, and the skin color candidate pixel group corresponding to the optimal coefficient is set as a skin color pixel group. The color temperature of the photographing light source of the color image is obtained from the color temperature of each pixel included in the skin color pixel group, and the image signal of the color image multiplied by the optimum coefficient is used as the obtained color temperature and the reference. In the white balance correction method that corrects only the difference from the white color temperature,
The sample color image for each of the proportions statistically determined using a number of the sample color images with respect to the proportion of the number of skin color pixels in the sample color image to the total number of pixels of the sample color image The correction coefficient according to the presence frequency of the flesh color candidate pixel group includes the flesh color candidate pixel group for each flesh color candidate pixel group according to the ratio of the number of flesh color candidate pixels included in the flesh color candidate pixel group to the total number of pixels of the color image. A value obtained by correcting the number is used as the number of pixels of the skin color candidate pixel group.

すなわち、本発明の第4のホワイトバランス補正方法は、第3のホワイトバランス補正方法と同じように、肌色を用いて撮影光源の色温度を求めてホワイトバランス補正を行うものであり、肌色の黒体軌跡曲線に位置するべきであるにも拘わらず肌色の黒体軌跡曲線からずれた肌色の部分を、肌色の黒体軌跡曲線上に戻す変換を行うための前記最適係数として、画素数が最も多い肌色候補画素群(すなわち肌色画素群)に対応する係数を求めて撮影光源の色温度を取得するが、各肌色候補画素群の画素数を求める際に、第3のホワイトバランス補正方法と異なる視点から、肌色候補画素群に含まれる肌色候補画素の個数に対して補正を行って得た値を当該肌色候補画素群の画素数とする。以下その詳細について説明する。   That is, the fourth white balance correction method of the present invention performs white balance correction by obtaining the color temperature of the photographing light source using the skin color, as in the third white balance correction method. The optimal number of pixels is the most suitable coefficient for converting the skin-colored portion that deviates from the skin-colored black body locus curve into the skin-colored black body locus curve, although it should be located on the body locus curve. The color temperature of the photographing light source is obtained by obtaining coefficients corresponding to many skin color candidate pixel groups (that is, skin color pixel groups). However, when obtaining the number of pixels of each skin color candidate pixel group, it differs from the third white balance correction method. A value obtained by correcting the number of skin color candidate pixels included in the skin color candidate pixel group from the viewpoint is set as the number of pixels of the skin color candidate pixel group. The details will be described below.

カラー画像から検出された前記肌色候補群に含まれる肌色候補画素の個数が前記カラー画像の全画素の個数に占める割合が大きいほど、この肌色候補画素群に含まれる肌色候補画素が真の肌色画素である可能性が高い。この傾向に基づいて、肌色候補画素群の画素数を求める際に、肌色候補画素群の前記割合に応じて、割合が大きいほど大きくなる補正係数で、肌色候補画素群に含まれる肌色候補画素の個数を補正して得た値を当該肌色候補画素群の画素数とするようにすれば、より精度良く前記最適係数を得ることができるはずである。   As the ratio of the number of skin color candidate pixels included in the skin color candidate group detected from the color image to the total number of pixels in the color image increases, the skin color candidate pixel included in the skin color candidate pixel group becomes a true skin color pixel. Is likely. Based on this tendency, when obtaining the number of pixels of the skin color candidate pixel group, according to the ratio of the skin color candidate pixel group, a correction coefficient that increases as the ratio increases and the skin color candidate pixels included in the skin color candidate pixel group If the value obtained by correcting the number is used as the number of pixels of the skin color candidate pixel group, the optimum coefficient should be obtained with higher accuracy.

一方、図3(a)は、様々なシーンを撮影して得た多数(数万枚)のカラー画像(前記サンプルカラー画像)に対して、サンプルカラー画像中の肌色画素の個数がサンプルカラー画像全体の画素(全画素)の個数に占める割合を画像毎に求めると共に、各々の割合に対して、該割合を有するサンプルカラー画像の存在頻度を求めた結果(例えば、2万枚のサンプルカラー画像のうち、wとなる前記割合を有するサンプルカラー画像が200枚あるとすれば、wの前記割合に対応するサンプルカラー画像の存在頻度が2万分の200、すなわち1%となる。)に基づいて得た前記割合とサンプルカラー画像の存在頻度との関係を示す図である。図示のように、肌色画素の個数が全画素の個数に占める割合が大きいほど、その割合を有するサンプルカラー画像の存在頻度が低くなる(所定の値、図3(a)の例では、0.18程度の割合でゼロになる)が、存在頻度の減少率が、前記割合が大きくなるにつれ小さくなる。   On the other hand, FIG. 3A shows a sample color image in which the number of skin color pixels in the sample color image is a large number (tens of thousands) of color images (the sample color image) obtained by photographing various scenes. The ratio of the total number of pixels (all pixels) to each image is calculated for each image, and the result of determining the existence frequency of sample color images having the ratio for each ratio (for example, 20,000 sample color images) If there are 200 sample color images having the above-mentioned ratio of w, the presence frequency of the sample color image corresponding to the above-mentioned ratio of w is 200 / 20,000, that is, 1%). It is a figure which shows the relationship between the obtained said ratio and the presence frequency of a sample color image. As shown in the figure, the greater the ratio of the number of skin color pixels to the total number of pixels, the lower the frequency of existence of the sample color image having that ratio (predetermined value, in the example of FIG. However, the rate of decrease in the existence frequency decreases as the ratio increases.

このような統計的な傾向があるから、前述の「割合が大きいほど大きくなる補正係数」としては、図3(a)に示す統計的な傾向を反映した補正係数を用いた方が、この統計的な傾向を反映しない補正係数を用いるより、より良い精度で前記最適係数を求めることができる。   Since there is such a statistical tendency, the above-mentioned “correction coefficient that increases as the ratio increases” uses this correction coefficient that reflects the statistical tendency shown in FIG. The optimum coefficient can be obtained with better accuracy than using a correction coefficient that does not reflect a general tendency.

図3(b)は、図3(a)に示す統計的な傾向を反映した補正係数の例を示している。図示のように、この補正係数は、前述の「割合が大きいほど大きくなる補正係数」であり、かつ図3(a)に示す傾向を反映し、肌色候補画素群に含まれる肌色候補画素の個数が全画素の個数に占める割合に応じて、所定の値(存在頻度がゼロとなる割合の値)の割合まで該割合が大きいほど大きくなり、かつ該割合が大きいほど増加率が小さくなる一方、前記所定の値以降は該割合が大きいほど小さくなるものである。   FIG. 3B shows an example of a correction coefficient that reflects the statistical tendency shown in FIG. As shown in the figure, this correction coefficient is the aforementioned “correction coefficient that increases as the ratio increases”, and reflects the tendency shown in FIG. 3A, and the number of skin color candidate pixels included in the skin color candidate pixel group. Depending on the ratio of the total number of pixels, the larger the ratio is, the larger the ratio is, and the larger the ratio is, the smaller the increase rate is. After the predetermined value, the larger the ratio, the smaller.

本発明の第4のホワイトバランス補正方法は、図3(a)に示す統計的な傾向を反映した補正係数(例えば図3(b)に示す補正係数)で、前記肌色候補画素群に含まれる肌色候補画素の個数が前記カラー画像の全画素の個数に占める割合に応じて、前記肌色候補画素群毎にその肌色候補画素の個数を補正して得た値を当該肌色候補画素群の画素数とする。   The fourth white balance correction method of the present invention is a correction coefficient that reflects the statistical tendency shown in FIG. 3A (for example, the correction coefficient shown in FIG. 3B) and is included in the skin color candidate pixel group. According to the ratio of the number of skin color candidate pixels to the total number of pixels in the color image, the value obtained by correcting the number of skin color candidate pixels for each skin color candidate pixel group is the number of pixels in the skin color candidate pixel group. And

なお、図3(a)に示す統計的な傾向を求める際に、サンプルカラー画像中の肌色画素としては、できるだけ真の肌色画素に近い画素を用いることが望ましい。例えば、特許文献1に記載の方法で最適係数を求め、この最適係数に対応する肌色候補画素群に含まれる画素を用いてもよく、本発明の第3のホワイトバランス補正方法を用いて得られた最適係数に対応する肌色候補画素群に含まれる画素を用いてもよい。   When obtaining the statistical tendency shown in FIG. 3A, it is desirable to use a pixel that is as close as possible to the true skin color pixel as the skin color pixel in the sample color image. For example, an optimum coefficient may be obtained by the method described in Patent Document 1, and a pixel included in a skin color candidate pixel group corresponding to the optimum coefficient may be used, which is obtained by using the third white balance correction method of the present invention. Alternatively, pixels included in the flesh color candidate pixel group corresponding to the optimum coefficient may be used.

本発明の第5のホワイトバランス補正方法は、色温度をより精度良く求めるために、グレーと肌色との両方を用い、「グレー候補画素群の画素数と肌色候補群の画素数との和」が最も大きい係数に対応するグレー候補画素群と肌色候補画素群はグレー画素群と肌色画素群になることに基づいてホワイトバランス補正を行うものである。具体的には、本発明の第5のホワイトバランス補正方法は、カラー画像の各画素の画像信号に対して所定の係数を乗算し、その結果、グレーの黒体軌跡曲線の近傍に入る画素をグレー候補画素として各前記係数に対応するグレー候補画素群と、肌色の黒体軌跡曲線の近傍に入る画素を肌色候補画素として各前記係数に対応する肌色候補画素群とを得、前記グレー候補画素群の画素数と、前記肌色候補画素群の画素数との和が最大となる前記係数を最適係数とすると共に、該最適係数に対応する前記グレー候補画素群と肌色候補画素群を夫々グレー画素群と肌色画素群にし、該グレー画素群に含まれる各々の画素の色温度および該肌色画素群に含まれる各々の画素の色温度から前記カラー画像の撮影光源の色温度を求め、前記最適係数が乗算された前記カラー画像の画像信号を、前記求められた色温度と基準白色との差分だけ補正するホワイトバランス補正方法において、
前記グレーの黒体軌跡曲線に近い画素ほどカウント数の重みが高くなるように前記グレー候補画像群毎に各々の前記グレー候補画素のカウント数を重み付け加算して得た和、または、サンプルカラー画像中のグレー画素の個数が当該サンプルカラー画像の全画素の個数に占める割合に対して、多数の前記サンプルカラー画像を用いて統計的に求められた各々の前記割合毎のサンプルカラー画像の存在頻度に応じた補正係数で、前記グレー候補画素群に含まれるグレー候補画素の個数が前記カラー画像の全画素の個数に占める割合に応じて前記グレー候補画素群毎にそのグレー候補画素の個数を補正して得た値、を当該グレー候補画素群の画素数とする工程、および/または、
前記肌色の黒体軌跡曲線に近い画素ほどカウント数の重みが高くなるように前記肌色候補画素群毎に各々の前記肌色候補画素のカウント数を重み付け加算して得た和、または、サンプルカラー画像中の肌色画素の個数が当該サンプルカラー画像の全画素の個数に占める割合に対して、多数の前記サンプルカラー画像を用いて統計的に求められた各々の前記割合毎のサンプルカラー画像の存在頻度に応じた補正係数で、前記肌色候補画素群に含まれる肌色候補画素の個数が前記カラー画像の全画素の個数に占める割合に応じて前記肌色候補画素群毎にその肌色候補画素の個数を補正して得た値、を当該肌色候補画素群の画素数とする工程を有することを特徴とするものである。
The fifth white balance correction method of the present invention uses both gray and skin color in order to obtain the color temperature with higher accuracy, and “the sum of the number of pixels of the gray candidate pixel group and the number of pixels of the skin color candidate group”. The gray candidate pixel group and the skin color candidate pixel group corresponding to the coefficient with the largest is a gray pixel group and a skin color pixel group, and performs white balance correction. Specifically, in the fifth white balance correction method of the present invention, the image signal of each pixel of the color image is multiplied by a predetermined coefficient, and as a result, pixels that fall in the vicinity of the gray black body locus curve are obtained. Obtaining a gray candidate pixel group corresponding to each coefficient as a gray candidate pixel, and a skin color candidate pixel group corresponding to each coefficient as a skin color candidate pixel that is in the vicinity of a skin color black body locus curve; The coefficient that maximizes the sum of the number of pixels in the group and the number of pixels in the skin color candidate pixel group is set as an optimal coefficient, and the gray candidate pixel group and the skin color candidate pixel group corresponding to the optimal coefficient are gray pixels. A color temperature of the photographing light source of the color image is obtained from the color temperature of each pixel included in the gray pixel group and the color temperature of each pixel included in the skin color pixel group. Is multiplied An image signal of the color image, the white balance correction method for correcting only the difference between the determined color temperature and reference white,
Sum obtained by weighting and adding the count number of each gray candidate pixel for each gray candidate image group so that the weight of the count number becomes higher as the pixel is closer to the gray black body locus curve, or a sample color image The presence frequency of the sample color image for each of the proportions statistically obtained using a number of the sample color images with respect to the proportion of the number of gray pixels in the total number of pixels of the sample color image. The number of gray candidate pixels included in the gray candidate pixel group is corrected for each gray candidate pixel group according to the ratio of the number of gray candidate pixels included in the gray candidate pixel group to the total number of pixels in the color image. The value obtained as a result, the number of pixels of the gray candidate pixel group, and / or
A sum obtained by weighting and adding the count number of each skin color candidate pixel for each skin color candidate pixel group so that the weight of the count number becomes higher as the pixel closer to the skin color black body locus curve, or a sample color image The presence frequency of the sample color image for each of the ratios statistically obtained using a number of the sample color images with respect to the ratio of the number of skin color pixels to the total number of pixels of the sample color image The number of flesh color candidate pixels included in the flesh color candidate pixel group is corrected for each flesh color candidate pixel group according to the proportion of the total number of pixels in the color image. The value obtained in this way is used as the number of pixels of the skin color candidate pixel group.

本発明の第6のホワイトバランス補正方法は、グレーと肌色との両方を用いて、「グレー候補画素群の平均色温度と肌色候補画素群の平均色温度との差」が最も小さい係数に対応するグレー候補画素群と肌色候補画素群はグレー画素群と肌色画素群になることに基づいてホワイトバランス補正を行うものである。具体的には、本発明の第6のホワイトバランス補正方法は、カラー画像の各画素の画像信号に対して所定の係数を乗算し、その結果、グレーの黒体軌跡曲線の近傍に入る画素をグレー候補画素として各前記係数に対応するグレー候補画素群と、肌色の黒体軌跡曲線の近傍に入る画素を肌色候補画素として各前記係数に対応する肌色候補画素群とを得、前記グレー候補画素群の平均色温度と前記肌色候補画素群の平均色温度との差が最小となる前記係数を最適係数とすると共に、該最適係数に対応する前記グレー候補画素群と肌色候補画素群を夫々グレー画素群と肌色画素群にし、該グレー画素群に含まれる各々の画素の色温度および該肌色画素群に含まれる各々の画素の色温度から前記カラー画像の撮影光源の色温度を求め、前記最適係数が乗算された前記カラー画像の画像信号を、前記求められた色温度と基準白色との差分だけ補正するホワイトバランス補正方法において、
前記グレーの黒体軌跡曲線に近いグレー候補画素ほどその色温度の重みが高くなるように前記グレー候補画素群に含まれる各々のグレー候補画素の色温度を重み付け平均演算して得た値を該グレー候補画素群の平均色温度とする工程、および/または、
前記肌色の黒体軌跡曲線に近い肌色候補画素ほどその色温度の重みが高くなるように前記肌色候補画素群に含まれる各々の肌色候補画素の色温度を重み付け平均演算して得た値を該肌色候補画素群の平均色温度とする工程を有することを特徴とするものである。
The sixth white balance correction method of the present invention uses both gray and skin color, and corresponds to the coefficient having the smallest “difference between the average color temperature of the gray candidate pixel group and the average color temperature of the skin color candidate pixel group”. The gray candidate pixel group and the skin color candidate pixel group to be subjected to white balance correction are based on becoming a gray pixel group and a skin color pixel group. Specifically, in the sixth white balance correction method of the present invention, the image signal of each pixel of the color image is multiplied by a predetermined coefficient, and as a result, pixels that fall in the vicinity of the gray black body locus curve are obtained. Obtaining a gray candidate pixel group corresponding to each coefficient as a gray candidate pixel, and a skin color candidate pixel group corresponding to each coefficient as a skin color candidate pixel that is in the vicinity of a skin color black body locus curve; The coefficient that minimizes the difference between the average color temperature of the group and the average color temperature of the skin color candidate pixel group is set as an optimal coefficient, and the gray candidate pixel group and the skin color candidate pixel group corresponding to the optimal coefficient are gray. The color temperature of the photographing light source of the color image is obtained from the color temperature of each pixel included in the gray pixel group and the color temperature of each pixel included in the skin color pixel group. Coefficient is An image signal calculated by said color image, the white balance correction method for correcting only the difference between the determined color temperature and reference white,
A value obtained by performing a weighted average operation on the color temperature of each gray candidate pixel included in the gray candidate pixel group so that the gray candidate pixel closer to the gray black body locus curve has a higher color temperature weight. A step of setting an average color temperature of a gray candidate pixel group, and / or
A value obtained by performing a weighted average operation on the color temperature of each skin color candidate pixel included in the skin color candidate pixel group so that the skin temperature candidate pixel closer to the skin color black body locus curve has a higher color temperature weight. It has the process of setting it as the average color temperature of a skin color candidate pixel group.

本発明の第7のホワイトバランス補正方法は、グレーと肌色との両方を用い、「グレー候補画素群の画素数と肌色候補画素数との和」が最も大きく、かつ「グレー候補画素群の平均色温度と肌色候補画素群の平均色温度との差」が小さい係数に対応するグレー候補画素群と肌色候補画素群はグレー画素群と肌色画素群になることに基づいてホワイトバランス補正を行うものである。具体的には、本発明の第7のホワイトバランス補正方法は、カラー画像の各画素の画像信号に対して所定の係数を乗算し、その結果、グレーの黒体軌跡曲線の近傍に入る画素をグレー候補画素として各前記係数に対応するグレー候補画素群と、肌色の黒体軌跡曲線の近傍に入る画素を肌色候補画素として各前記係数に対応する肌色候補画素群とを得、前記グレー候補画素群の画素数と、前記肌色候補画素群の画素数との和が最大となり、かつ前記グレー候補画素群の平均色温度と前記肌色候補画素群の平均色温度との差が最小となる前記係数を最適係数とすると共に、該最適係数に対応する前記グレー候補画素群と肌色候補画素群を夫々グレー画素群と肌色画素群にし、該グレー画素群に含まれる各々の画素の色温度および該肌色画素群に含まれる各々の画素の色温度から前記カラー画像の撮影光源の色温度を求め、前記最適係数が乗算された前記カラー画像の画像信号を、前記求められた色温度と基準白色との差分だけ補正すホワイトバランス補正方法において、
前記グレーの黒体軌跡曲線に近い画素ほどカウント数の重みが高くなるように前記グレー候補画像群毎に各々の前記グレー候補画素のカウント数を重み付け加算して得た和、または、サンプルカラー画像中のグレー画素の個数が当該サンプルカラー画像の全画素の個数に占める割合に対して、多数の前記サンプルカラー画像を用いて統計的に求められた各々の前記割合毎のサンプルカラー画像の存在頻度に応じた補正係数で、前記グレー候補画素群に含まれるグレー候補画素の個数が前記カラー画像の全画素の個数に占める割合に応じて前記グレー候補画素群毎にそのグレー候補画素の個数を補正して得た値、を当該グレー候補画素群の画素数とする工程、および/または、
前記肌色の黒体軌跡曲線に近い画素ほどカウント数の重みが高くなるように前記肌色候補画素群毎に各々の前記肌色候補画素のカウント数を重み付け加算して得た和、または、サンプルカラー画像中の肌色画素の個数が当該サンプルカラー画像の全画素の個数に占める割合に対して、多数の前記サンプルカラー画像を用いて統計的に求められた各々の前記割合毎のサンプルカラー画像の存在頻度に応じた補正係数で、前記肌色候補画素群に含まれる肌色候補画素の個数が前記カラー画像の全画素の個数に占める割合に応じて前記肌色候補画素群毎にその肌色候補画素の個数を補正して得た値、を当該肌色候補画素群の画素数とする工程、および/または、
前記グレーの黒体軌跡曲線に近いグレー候補画素ほどその色温度の重みが高くなるように前記グレー候補画素群に含まれる各々のグレー候補画素の色温度を重み付け平均演算して得た値を該グレー候補画素群の平均色温度とする工程、および/または、
前記肌色の黒体軌跡曲線に近い肌色候補画素ほどその色温度の重みが高くなるように前記肌色候補画素群に含まれる各々の肌色候補画素の色温度を重み付け平均演算して得た値を該肌色候補画素群の平均色温度とする工程を有することを特徴とするものである。
The seventh white balance correction method of the present invention uses both gray and skin color, has the largest “sum of the number of pixels of the gray candidate pixel group and the number of skin color candidate pixels”, and the “average of the gray candidate pixel group” A gray candidate pixel group and a skin color candidate pixel group corresponding to a coefficient having a small difference between the color temperature and the average color temperature of the skin color candidate pixel group are a gray pixel group and a skin color pixel group, and performs white balance correction. It is. Specifically, in the seventh white balance correction method of the present invention, the image signal of each pixel of the color image is multiplied by a predetermined coefficient, and as a result, pixels that enter the vicinity of the gray black body locus curve are obtained. A gray candidate pixel group corresponding to each coefficient as a gray candidate pixel, and a skin color candidate pixel group corresponding to each coefficient as a skin color candidate pixel that is in the vicinity of a skin color black body locus curve are obtained, and the gray candidate pixel The coefficient that maximizes the sum of the number of pixels of the group and the number of pixels of the skin color candidate pixel group, and minimizes the difference between the average color temperature of the gray candidate pixel group and the average color temperature of the skin color candidate pixel group And the gray candidate pixel group and the skin color candidate pixel group corresponding to the optimal coefficient as a gray pixel group and a skin color pixel group, respectively, and the color temperature and the skin color of each pixel included in the gray pixel group Included in pixel group The color temperature of the color image photographing light source is obtained from the color temperature of each pixel to be corrected, and the image signal of the color image multiplied by the optimum coefficient is corrected by the difference between the obtained color temperature and the reference white color. In the white balance correction method,
Sum obtained by weighting and adding the count number of each gray candidate pixel for each gray candidate image group so that the weight of the count number becomes higher as the pixel is closer to the gray black body locus curve, or a sample color image The presence frequency of the sample color image for each of the proportions statistically obtained using a number of the sample color images with respect to the proportion of the number of gray pixels in the total number of pixels of the sample color image. The number of gray candidate pixels included in the gray candidate pixel group is corrected for each gray candidate pixel group according to the ratio of the number of gray candidate pixels included in the gray candidate pixel group to the total number of pixels in the color image. The value obtained as a result, the number of pixels of the gray candidate pixel group, and / or
Sum obtained by weighting and adding the count number of each skin color candidate pixel for each skin color candidate pixel group so that the weight of the count number becomes higher as the pixel closer to the flesh color black body locus curve, or a sample color image The presence frequency of the sample color image for each of the ratios statistically obtained using a number of the sample color images with respect to the ratio of the number of skin color pixels to the total number of pixels of the sample color image The number of flesh color candidate pixels included in the flesh color candidate pixel group is corrected for each flesh color candidate pixel group for each flesh color candidate pixel group according to the ratio of the total number of pixels in the color image. And / or a step of setting the obtained value as the number of pixels of the skin color candidate pixel group, and / or
A value obtained by performing a weighted average operation on the color temperature of each gray candidate pixel included in the gray candidate pixel group so that the gray candidate pixel closer to the gray black body locus curve has a higher color temperature weight. A step of setting an average color temperature of a gray candidate pixel group, and / or
A value obtained by performing a weighted average operation on the color temperature of each skin color candidate pixel included in the skin color candidate pixel group so that the skin temperature candidate pixel closer to the skin color black body locus curve has a higher color temperature weight. It has the process of setting it as the average color temperature of a skin color candidate pixel group.

本発明の第1から第7のホワイトバランス補正方法において、前記カラー画像の全ての画素の中から前記グレー候補画素群および/または肌色候補画素群を取得するようにしてもよいが、前記カラー画像の画素のうち、前記グレー候補画素群および/または肌色候補画素群を得るために有効な画素のみを用いて、これらの有効な画素から前記グレー候補画素群および/または肌色候補画素群を取得するようにすることが好ましい。例えば、第1のホワイトバランス補正方法のようにグレーを用いる場合、カラー画像の全ての画素の画像信号に対して所定の係数を乗算し、その結果、グレーの黒体軌跡曲線の近傍に入る画素をグレー候補画素として各係数に対応するグレー候補画素群を得る代わりに、カラー画像の全ての画素のうち、グレー候補画素を求めるのに有効な画素、すなわち、グレー候補画素になる可能性が高い画素を抽出し、抽出されたこれらの画素の画像信号に対して、所定の係数を乗算し、乗算の結果、グレーの黒体軌跡曲線の近傍に入る画素をグレー候補として各係数に対応するグレー候補画素群を得るようにすることが好ましい。   In the first to seventh white balance correction methods of the present invention, the gray candidate pixel group and / or the skin color candidate pixel group may be acquired from all the pixels of the color image. Of these pixels, only the pixels effective for obtaining the gray candidate pixel group and / or the skin color candidate pixel group are used, and the gray candidate pixel group and / or the skin color candidate pixel group are acquired from these effective pixels. It is preferable to do so. For example, when gray is used as in the first white balance correction method, the image signal of all the pixels of the color image is multiplied by a predetermined coefficient, and as a result, pixels that enter the vicinity of the gray black body locus curve Instead of obtaining a gray candidate pixel group corresponding to each coefficient with a gray candidate pixel as a gray candidate pixel, it is highly likely that the pixel is an effective pixel for obtaining a gray candidate pixel among all the pixels of the color image, that is, a gray candidate pixel. Pixels are extracted, and the extracted image signals of these pixels are multiplied by a predetermined coefficient. As a result of the multiplication, pixels that fall in the vicinity of the gray blackbody locus curve are gray candidates and gray corresponding to each coefficient. It is preferable to obtain a candidate pixel group.

グレー候補画素群および肌色候補画素群を得るための有効な画素として、例えば、カラー画像中の高彩度画素(例えば、R=G=Bのグレー軸からの距離が所定の閾値以上の画素。なお、閾値は、各色相に対して同じ閾値を用いてもよく、色相によって閾値を変えるようにしてもよい)を除外した画素、画像中の輝度の高い領域に位置する画素またはそれらの画素の組合わせとすることができる。   As an effective pixel for obtaining the gray candidate pixel group and the skin color candidate pixel group, for example, a high-saturation pixel (for example, a pixel whose distance from the gray axis of R = G = B is a predetermined threshold or more in a color image. As for the threshold value, the same threshold value may be used for each hue, or the threshold value may be changed depending on the hue), a pixel that is located in a bright area in the image, or a combination of these pixels It can be.

また、肌色を用いる場合、従来公知の顔抽出技術でカラー画像中の顔部分を抽出し、顔部分の画素を有効な画素とするようにしてもよい。   When skin color is used, a face part in a color image may be extracted by a conventionally known face extraction technique, and the face part pixel may be an effective pixel.

また、DSCにより取得したカラー画像の場合、ハイエスト画素(CCDの飽和に起因する、画素値がさちっている画素)には、撮影光源の色温度が正しく反映されていないので、このような画素を用いて撮影光源の色温度を求めると、精度が下がり、ホワイトバランス補正に悪い影響を与えてしまうので、ハイライトの所定のパーセンテージまでの画素を無効画素とし、これらの無効画素を除去した画像中の画素を有効な画素とするようにしてもよい。   Further, in the case of a color image acquired by DSC, since the color temperature of the photographing light source is not correctly reflected in the highest pixel (the pixel whose pixel value is reduced due to the saturation of the CCD), such a pixel. If the color temperature of the photographic light source is determined using, the accuracy will be reduced and the white balance correction will be adversely affected.Therefore, pixels up to a predetermined percentage of the highlights are regarded as invalid pixels, and these invalid pixels are removed. The middle pixel may be an effective pixel.

本発明の第1から第7までのホワイトバランス補正方法は、最適係数に対応する候補画素群(グレー候補画素群および/または肌色候補画素群)に含まれる各々の画素の色温度から撮影光源の色温度を求める際に、黒体軌跡曲線(グレー候補画素群の場合はグレーの黒体軌跡曲線、肌色候補画素群の場合は、肌色の黒体軌跡曲線)に近い画素ほどその色温度の重みが高くなるように前記最適係数に対応する前記候補画素群に含まれる各々の画素の色温度を重付平均演算して得た平均色温度を前記撮影光源の色温度として求めることが好ましい。   According to the first to seventh white balance correction methods of the present invention, the photographic light source is detected from the color temperature of each pixel included in the candidate pixel group (gray candidate pixel group and / or skin color candidate pixel group) corresponding to the optimum coefficient. When obtaining the color temperature, the closer to the black body locus curve (the gray black body locus curve in the case of the gray candidate pixel group, the skin color black body locus curve in the case of the skin color candidate pixel group), the weight of the color temperature. It is preferable that an average color temperature obtained by performing a weighted average calculation of the color temperatures of the pixels included in the candidate pixel group corresponding to the optimal coefficient is obtained as the color temperature of the photographing light source so that the color temperature becomes higher.

また、上述のホワイトバランス補正方法において、黒体軌跡曲線を用いているが、昼光軌跡曲線が黒体軌跡曲線と略同じである理由から、上述の全てのホワイトバランス補正方法において、黒体軌跡曲線の代わりに昼光軌跡曲線を用いるようにしてもよい。   In the above white balance correction method, the black body locus curve is used. However, because the daylight locus curve is substantially the same as the black body locus curve, in all the above white balance correction methods, the black body locus curve is used. A daylight locus curve may be used instead of the curve.

本発明の第1のホワイトバランス補正装置は、カラー画像の各画素の画像信号に対して、所定の係数を乗算する乗算手段と、
前記乗算の結果、グレーの黒体軌跡曲線の近傍に入る画素をグレー候補画素として各前記係数に対応するグレー候補画素群を得、該グレー候補画素群の画素数を求めるグレー候補画素群画素数取得手段と、
該グレー候補画素群画素数取得手段により取得された画素数が最大となる前記グレー候補画素群に対応する前記係数を最適係数として取得する最適係数取得手段と、
該最適係数取得手段により取得された前記最適係数に対応する前記グレー候補画素群をグレー画素群とし、該グレー画素群に含まれる各々の画素の色温度から前記カラー画像の撮影光源の色温度を求める光源色温度取得手段と、
前記カラー画像の画像信号に対して前記最適係数を乗算すると共に、該乗算がされた前記画像信号を、前記光源色温度取得手段により求められた色温度と基準白色の色温度との差分だけ補正する補正手段とを有してなるホワイトバランス補正装置において、
前記グレー候補画素群画素数取得手段が、前記グレーの黒体軌跡曲線に近い画素ほどカウント数の重みが高くなるように前記グレー候補画像群毎に各々の前記グレー候補画素のカウント数を重み付け加算して得た和を当該グレー候補画素群の画素数とすることを特徴とするものである。
A first white balance correction apparatus of the present invention includes a multiplying unit that multiplies an image signal of each pixel of a color image by a predetermined coefficient;
As a result of the multiplication, a pixel that falls in the vicinity of a gray black body locus curve is used as a gray candidate pixel to obtain a gray candidate pixel group corresponding to each coefficient, and the number of gray candidate pixel groups for obtaining the number of gray candidate pixel groups Acquisition means;
Optimal coefficient acquisition means for acquiring, as an optimal coefficient, the coefficient corresponding to the gray candidate pixel group having the maximum number of pixels acquired by the gray candidate pixel group pixel number acquisition means;
The gray candidate pixel group corresponding to the optimal coefficient acquired by the optimal coefficient acquisition unit is set as a gray pixel group, and the color temperature of the photographing light source of the color image is determined from the color temperature of each pixel included in the gray pixel group. A light source color temperature acquisition means to be obtained;
The image signal of the color image is multiplied by the optimum coefficient, and the multiplied image signal is corrected by the difference between the color temperature obtained by the light source color temperature acquisition unit and the color temperature of the reference white. And a white balance correction device having correction means for
The gray candidate pixel group pixel number acquisition unit weights and adds the count number of each gray candidate pixel for each gray candidate image group so that the weight closer to the gray black body locus curve is higher in the count number. The sum obtained in this way is the number of pixels of the gray candidate pixel group.

本発明の第2のホワイトバランス補正装置は、カラー画像の各画素の画像信号に対して、所定の係数を乗算する乗算手段と、
前記乗算の結果、グレーの黒体軌跡曲線の近傍に入る画素をグレー候補画素として各前記係数に対応するグレー候補画素群を得、該グレー候補画素群の画素数を求めるグレー候補画素群画素数取得手段と、
該グレー候補画素群画素数取得手段により取得された画素数が最大となる前記グレー候補画素群に対応する前記係数を最適係数として取得する最適係数取得手段と、
該最適係数取得手段により取得された前記最適係数に対応する前記グレー候補画素群をグレー画素群とし、該グレー画素群に含まれる各々の画素の色温度から前記カラー画像の撮影光源の色温度を求める光源色温度取得手段と、
前記カラー画像の画像信号に対して前記最適係数を乗算すると共に、該乗算がされた前記画像信号を、前記光源色温度取得手段により求められた色温度と基準白色の色温度との差分だけ補正する補正手段とを有してなるホワイトバランス補正装置において、
前記グレー候補画素群画素数取得手段が、サンプルカラー画像中のグレー画素の個数が当該サンプルカラー画像の全画素の個数に占める割合に対して、多数の前記サンプルカラー画像を用いて統計的に求められた各々の前記割合毎のサンプルカラー画像の存在頻度に応じた補正係数で、前記グレー候補画素群に含まれるグレー候補画素の個数が前記カラー画像の全画素の個数に占める割合に応じて前記グレー候補画素群毎にそのグレー候補画素の個数を補正して得た値を当該グレー候補画素群の画素数とすることを特徴とするものである。
The second white balance correction apparatus of the present invention includes a multiplying unit that multiplies the image signal of each pixel of the color image by a predetermined coefficient,
As a result of the multiplication, a pixel that falls in the vicinity of a gray black body locus curve is used as a gray candidate pixel to obtain a gray candidate pixel group corresponding to each coefficient, and the number of gray candidate pixel groups for obtaining the number of gray candidate pixel groups Acquisition means;
Optimal coefficient acquisition means for acquiring, as an optimal coefficient, the coefficient corresponding to the gray candidate pixel group having the maximum number of pixels acquired by the gray candidate pixel group pixel number acquisition means;
The gray candidate pixel group corresponding to the optimal coefficient acquired by the optimal coefficient acquisition unit is set as a gray pixel group, and the color temperature of the photographing light source of the color image is determined from the color temperature of each pixel included in the gray pixel group. A light source color temperature acquisition means to be obtained;
The image signal of the color image is multiplied by the optimum coefficient, and the multiplied image signal is corrected by the difference between the color temperature obtained by the light source color temperature acquisition unit and the color temperature of the reference white. And a white balance correction device having correction means for
The gray candidate pixel group pixel number acquisition means statistically obtains the ratio of the number of gray pixels in the sample color image to the total number of pixels in the sample color image using a large number of sample color images. The correction coefficient according to the frequency of existence of the sample color image for each of the ratios is determined according to the ratio of the number of gray candidate pixels included in the gray candidate pixel group to the total number of pixels of the color image. A value obtained by correcting the number of gray candidate pixels for each gray candidate pixel group is set as the number of pixels of the gray candidate pixel group.

本発明の第3のホワイトバランス補正装置は、カラー画像の各画素の画像信号に対して、所定の係数を乗算する乗算手段と、
前記乗算の結果、肌色の黒体軌跡曲線の近傍に入る画素を肌色候補画素として各前記係数に対応する肌色候補画素群を得、該肌色候補画素群の画素数を求める肌色候補画素群画素数取得手段と、
該肌色候補画素群画素数取得手段により取得された画素数が最大となる前記肌色候補画素群に対応する前記係数を最適係数として取得する最適係数取得手段と、
該最適係数取得手段により取得された前記最適係数に対応する前記肌色候補画素群を肌色画素群とし、該肌色画素群に含まれる各々の画素の色温度から前記カラー画像の撮影光源の色温度を求める光源色温度取得手段と、
前記カラー画像の画像信号に対して前記最適係数を乗算すると共に、該乗算がされた前記画像信号を、前記光源色温度取得手段により求められた色温度と基準白色の色温度との差分だけ補正する補正手段とを有してなるホワイトバランス補正装置において、
前記肌色候補画素群画素数取得手段が、前記肌色の黒体軌跡曲線に近い画素ほどカウント数の重みが高くなるように前記肌色候補画素群毎に各々の前記肌色候補画素のカウント数を重み付け加算して得た和を当該肌色候補画素群の画素数とすることを特徴とするものである。
A third white balance correction apparatus according to the present invention includes a multiplying unit that multiplies an image signal of each pixel of a color image by a predetermined coefficient;
As a result of the multiplication, a pixel that enters the vicinity of the skin color black body locus curve is used as a skin color candidate pixel to obtain a skin color candidate pixel group corresponding to each of the coefficients, and a skin color candidate pixel group pixel number for obtaining the number of pixels of the skin color candidate pixel group Acquisition means;
Optimal coefficient acquisition means for acquiring, as an optimal coefficient, the coefficient corresponding to the skin color candidate pixel group in which the number of pixels acquired by the skin color candidate pixel group pixel number acquisition means is maximized;
The skin color candidate pixel group corresponding to the optimal coefficient acquired by the optimal coefficient acquisition unit is defined as a skin color pixel group, and the color temperature of the photographing light source of the color image is determined from the color temperature of each pixel included in the skin color pixel group. A light source color temperature acquisition means to be obtained;
The image signal of the color image is multiplied by the optimum coefficient, and the multiplied image signal is corrected by the difference between the color temperature obtained by the light source color temperature acquisition unit and the color temperature of the reference white. And a white balance correction device having correction means for
The skin color candidate pixel group pixel number acquisition unit weights and adds the count number of each skin color candidate pixel for each skin color candidate pixel group so that a pixel closer to the skin color black body locus curve has a higher weight of the count number. The sum obtained in this way is used as the number of pixels of the skin color candidate pixel group.

本発明の第4のホワイトバランス補正装置は、カラー画像の各画素の画像信号に対して、所定の係数を乗算する乗算手段と、
前記乗算の結果、肌色の黒体軌跡曲線の近傍に入る画素を肌色候補画素として各前記係数に対応する肌色候補画素群を得、該肌色候補画素群の画素数を求める肌色候補画素群画素数取得手段と、
該肌色候補画素群画素数取得手段により取得された画素数が最大となる前記肌色候補画素群に対応する前記係数を最適係数として取得する最適係数取得手段と、
該最適係数取得手段により取得された前記最適係数に対応する前記肌色候補画素群を肌色画素群とし、該肌色画素群に含まれる各々の画素の色温度から前記カラー画像の撮影光源の色温度を求める光源色温度取得手段と、
前記カラー画像の画像信号に対して前記最適係数を乗算すると共に、該乗算がされた前記画像信号を、前記光源色温度取得手段により求められた色温度と基準白色の色温度との差分だけ補正する補正手段とを有してなるホワイトバランス補正装置において、
前記肌色候補画素群画素数取得手段が、サンプルカラー画像中の肌色画素の個数が当該サンプルカラー画像の全画素の個数に占める割合に対して、多数の前記サンプルカラー画像を用いて統計的に求められた各々の前記割合毎のサンプルカラー画像の存在頻度に応じた補正係数で、前記肌色候補画素群に含まれる肌色候補画素の個数が前記カラー画像の全画素の個数に占める割合に応じて前記肌色候補画素群毎にその肌色候補画素の個数を補正して得た値を当該肌色候補画素群の画素数とすることを特徴とするものである。
A fourth white balance correction apparatus according to the present invention includes a multiplying unit that multiplies an image signal of each pixel of a color image by a predetermined coefficient;
As a result of the multiplication, a pixel that enters the vicinity of the skin color black body locus curve is used as a skin color candidate pixel to obtain a skin color candidate pixel group corresponding to each of the coefficients, and a skin color candidate pixel group pixel number for obtaining the number of pixels of the skin color candidate pixel group Acquisition means;
Optimal coefficient acquisition means for acquiring, as an optimal coefficient, the coefficient corresponding to the skin color candidate pixel group in which the number of pixels acquired by the skin color candidate pixel group pixel number acquisition means is maximized;
The skin color candidate pixel group corresponding to the optimal coefficient acquired by the optimal coefficient acquisition unit is defined as a skin color pixel group, and the color temperature of the photographing light source of the color image is determined from the color temperature of each pixel included in the skin color pixel group. A light source color temperature acquisition means to be obtained;
The image signal of the color image is multiplied by the optimum coefficient, and the multiplied image signal is corrected by the difference between the color temperature obtained by the light source color temperature acquisition unit and the color temperature of the reference white. And a white balance correction device having correction means for
The skin color candidate pixel group pixel number acquisition means statistically obtains the ratio of the number of skin color pixels in the sample color image to the total number of pixels of the sample color image using a large number of sample color images. The correction coefficient corresponding to the frequency of existence of the sample color image for each of the ratios, and the number of skin color candidate pixels included in the skin color candidate pixel group according to the ratio of the total number of pixels of the color image A value obtained by correcting the number of skin color candidate pixels for each skin color candidate pixel group is used as the number of pixels of the skin color candidate pixel group.

本発明の第5のホワイトバランス補正装置は、カラー画像の各画素の画像信号に対して所定の係数を乗算する乗算手段と、
前記乗算の結果、グレーの黒体軌跡曲線の近傍に入る画素をグレー候補画素として各前記係数に対応するグレー候補画素群と肌色の黒体軌跡曲線の近傍に入る画素を肌色候補画素として各前記係数に対応する肌色候補画素群とを得、前記グレー候補画素群の画素数および前記肌色候補画素群の画素数を求める候補画素群画素数取得手段と、
該候補画素群画素数取得手段により取得された前記グレー候補画素群の画素数と前記肌色候補画素群の画素数との和が最大となる前記係数を最適係数として取得する最適係数取得手段と、
該最適係数取得手段により取得された前記適係数に対応する前記グレー候補画素群と肌色候補画素群を夫々グレー画素群と肌色画素群にし、該グレー画素群に含まれる各々の画素の色温度および該肌色画素群に含まれる各々の画素の色温度から前記カラー画像の撮影光源の色温度を求める光源色温度取得手段と、
前記カラー画像の画像信号に対して前記最適係数を乗算すると共に、該乗算がされた前記画像信号を、前記光源色温度取得手段により求められた色温度と基準白色との差分だけ補正する補正手段とを有してなるホワイトバランス補正装置において、
前記候補画素群画素数取得手段が、前記グレーの黒体軌跡曲線に近い画素ほどカウント数の重みが高くなるように前記グレー候補画像群毎に各々の前記グレー候補画素のカウント数を重み付け加算して得た和、または、サンプルカラー画像中のグレー画素の個数が当該サンプルカラー画像の全画素の個数に占める割合に対して、多数の前記サンプルカラー画像を用いて統計的に求められた各々の前記割合毎のサンプルカラー画像の存在頻度に応じた補正係数で、前記グレー候補画素群に含まれるグレー候補画素の個数が前記カラー画像の全画素の個数に占める割合に応じて前記グレー候補画素群毎にそのグレー候補画素の個数を補正して得た値、を当該グレー候補画素群の画素数とする処理、および/または、
前記肌色の黒体軌跡曲線に近い画素ほどカウント数の重みが高くなるように前記肌色候補画素群毎に各々の前記肌色候補画素のカウント数を重み付け加算して得た和、またはサンプルカラー画像中の肌色画素の個数が当該サンプルカラー画像の全画素の個数に占める割合に対して、多数の前記サンプルカラー画像を用いて統計的に求められた各々の前記割合毎のサンプルカラー画像の存在頻度に応じた補正係数で、前記肌色候補画素群に含まれる肌色候補画素の個数が前記カラー画像の全画素の個数に占める割合に応じて前記肌色候補画素群毎にその肌色候補画素の個数を補正して得た値、を当該肌色候補画素群の画素数とする処理を行うことを特徴とするものである。
A fifth white balance correction apparatus of the present invention includes a multiplying unit that multiplies an image signal of each pixel of a color image by a predetermined coefficient,
As a result of the multiplication, pixels that are in the vicinity of the gray black body locus curve are regarded as gray candidate pixels, and the gray candidate pixel group corresponding to each coefficient and the pixels that are in the vicinity of the skin color black body locus curve are defined as skin color candidate pixels. A candidate pixel group pixel number acquisition unit for obtaining a skin color candidate pixel group corresponding to a coefficient and calculating the number of pixels of the gray candidate pixel group and the number of pixels of the skin color candidate pixel group;
Optimal coefficient acquisition means for acquiring, as an optimal coefficient, the coefficient that maximizes the sum of the number of pixels of the gray candidate pixel group acquired by the candidate pixel group pixel number acquisition means and the number of pixels of the skin color candidate pixel group;
The gray candidate pixel group and the skin color candidate pixel group corresponding to the appropriate coefficient acquired by the optimal coefficient acquisition unit are set as a gray pixel group and a skin color pixel group, respectively, and the color temperature of each pixel included in the gray pixel group and Light source color temperature obtaining means for obtaining a color temperature of a photographing light source of the color image from a color temperature of each pixel included in the skin color pixel group;
A correction unit that multiplies the image signal of the color image by the optimum coefficient and corrects the multiplied image signal by a difference between the color temperature obtained by the light source color temperature acquisition unit and a reference white color. In a white balance correction device having
The candidate pixel group pixel number acquisition unit weights and adds the count number of each gray candidate pixel for each gray candidate image group so that the weight closer to the gray black body locus curve is higher in the count number. Or the ratio of the number of gray pixels in the sample color image to the total number of pixels in the sample color image obtained statistically using a number of sample color images. The gray candidate pixel group according to the ratio of the number of gray candidate pixels included in the gray candidate pixel group to the total number of pixels of the color image, with a correction coefficient according to the frequency of existence of the sample color image for each ratio. A value obtained by correcting the number of gray candidate pixels for each of the gray candidate pixel groups, and / or
In a sample color image, or a sum obtained by weighting and adding each skin color candidate pixel count number for each skin color candidate pixel group so that a weight closer to the skin color black body locus curve is higher in the count number The ratio of the number of skin color pixels to the total number of pixels of the sample color image is the frequency of existence of the sample color image for each of the ratios statistically determined using a number of the sample color images. The number of skin color candidate pixels included in the skin color candidate pixel group is corrected for each skin color candidate pixel group for each skin color candidate pixel group according to the ratio of the number of skin color candidate pixels included in the skin color candidate pixel group to the total number of pixels in the color image. The value obtained in this way is used as the number of pixels of the skin color candidate pixel group.

本発明の第6のホワイトバランス補正装置は、カラー画像の各画素の画像信号に対して所定の係数を乗算する乗算手段と、
前記乗算の結果、グレーの黒体軌跡曲線の近傍に入る画素をグレー候補画素として各前記係数に対応するグレー候補画素群と肌色の黒体軌跡曲線の近傍に入る画素を肌色候補画素として各前記係数に対応する肌色候補画素群とを得、前記グレー候補画素群の平均色温度と前記肌色候補画素群の平均色温度を求める候補画素群平均色温度取得手段と、
該候補画素群平均色温度により取得された前記グレー候補画素群の平均色温度と前記肌色候補画素群の平均色温度との差が最小となる前記係数を最適係数として取得する最適係数取得手段と、
該最適係数取得手段により取得された前記適係数に対応する前記グレー候補画素群と肌色候補画素群を夫々グレー画素群と肌色画素群にし、該グレー画素群に含まれる各々の画素の色温度および該肌色画素群に含まれる各々の画素の色温度から前記カラー画像の撮影光源の色温度を求める光源色温度取得手段と、
前記カラー画像の画像信号に対して前記最適係数を乗算すると共に、該乗算がされた前記画像信号を、前記光源色温度取得手段により求められた色温度と基準白色との差分だけ補正する補正手段とを有してなるホワイトバランス補正装置において、
前記候補画素群平均色温度取得手段が、前記グレーの黒体軌跡曲線に近いグレー候補画素ほどその色温度の重みが高くなるように前記グレー候補画素群に含まれる各々のグレー候補画素の色温度を重み付け平均演算して得た値を該グレー候補画素群の平均色温度とする処理、および/または、
前記肌色の黒体軌跡曲線に近い肌色候補画素ほどその色温度の重みが高くなるように前記肌色候補画素群に含まれる各々の肌色候補画素の色温度を重み付け平均演算して得た値を該肌色候補画素群の平均色温度とする処理を行うことを特徴とするものである。
A sixth white balance correction apparatus according to the present invention includes a multiplying unit that multiplies an image signal of each pixel of a color image by a predetermined coefficient;
As a result of the multiplication, pixels that are in the vicinity of the gray black body locus curve are regarded as gray candidate pixels, and the gray candidate pixel group corresponding to each coefficient and the pixels that are in the vicinity of the skin color black body locus curve are defined as skin color candidate pixels. A candidate color group obtaining means for obtaining a skin color candidate pixel group corresponding to a coefficient, and obtaining an average color temperature of the gray candidate pixel group and an average color temperature of the skin color candidate pixel group;
An optimum coefficient obtaining unit that obtains, as an optimum coefficient, the coefficient that minimizes the difference between the average color temperature of the gray candidate pixel group obtained from the candidate pixel group average color temperature and the average color temperature of the skin color candidate pixel group; ,
The gray candidate pixel group and the skin color candidate pixel group corresponding to the appropriate coefficient acquired by the optimal coefficient acquisition unit are set as a gray pixel group and a skin color pixel group, respectively, and the color temperature of each pixel included in the gray pixel group and Light source color temperature obtaining means for obtaining a color temperature of a photographing light source of the color image from a color temperature of each pixel included in the skin color pixel group;
A correction unit that multiplies the image signal of the color image by the optimum coefficient and corrects the multiplied image signal by a difference between the color temperature obtained by the light source color temperature acquisition unit and a reference white color. In a white balance correction device having
The candidate pixel group average color temperature acquisition unit is configured so that a gray candidate pixel closer to the gray black body locus curve has a higher color temperature weight so that the color temperature of each gray candidate pixel included in the gray candidate pixel group is higher. A value obtained by performing a weighted average calculation on the gray candidate pixel group as an average color temperature, and / or
A value obtained by performing a weighted average operation on the color temperature of each skin color candidate pixel included in the skin color candidate pixel group so that the skin temperature candidate pixel closer to the skin color black body locus curve has a higher color temperature weight. The processing is performed to obtain the average color temperature of the skin color candidate pixel group.

本発明の第7のホワイトバランス補正装置は、カラー画像の各画素の画像信号に対して所定の係数を乗算する乗算手段と、
前記乗算の結果、グレーの黒体軌跡曲線の近傍に入る画素をグレー候補画素として各前記係数に対応するグレー候補画素群と肌色の黒体軌跡曲線の近傍に入る画素を肌色候補画素として各前記係数に対応する肌色候補画素群とを得る候補画素群取得手段と、
該候補画素群取得手段により取得された前記グレー候補画素群の画素数および前記肌色候補画素群の画素数を求める候補画素群画素数取得手段と、
前記候補画素群取得手段により取得された前記グレー候補画素群の平均色温度と前記肌色候補画素群の平均色温度を求める候補画素群平均色温度取得手段と、
前記候補画素群画素数取得手段により取得された前記グレー候補画素群の画素数と前記肌色候補画素群の画素数との和が最大となり、かつ前記候補画素群平均色温度取得手段により取得された前記グレー候補画素群の平均色温度と前記肌色候補画素群の平均色温度との差が最小となる前記係数を最適係数として取得する最適係数取得手段と、
該最適係数取得手段により取得された前記適係数に対応する前記グレー候補画素群と肌色候補画素群を夫々グレー画素群と肌色画素群にし、該グレー画素群に含まれる各々の画素の色温度および該肌色画素群に含まれる各々の画素の色温度から前記カラー画像の撮影光源の色温度を求める光源色温度取得手段と、
前記カラー画像の画像信号に対して前記最適係数を乗算すると共に、該乗算がされた前記画像信号を、前記光源色温度取得手段により求められた色温度と基準白色との差分だけ補正する補正手段とを有してなるホワイトバランス補正装置において、
前記候補画素群画素数取得手段が、前記グレーの黒体軌跡曲線に近い画素ほどカウント数の重みが高くなるように前記グレー候補画像群毎に各々の前記グレー候補画素のカウント数を重み付け加算して得た和、または、サンプルカラー画像中のグレー画素の個数が当該サンプルカラー画像の全画素の個数に占める割合に対して、多数の前記サンプルカラー画像を用いて統計的に求められた各々の前記割合毎のサンプルカラー画像の存在頻度に応じた補正係数で、前記グレー候補画素群に含まれるグレー候補画素の個数が前記カラー画像の全画素の個数に占める割合に応じて前記グレー候補画素群毎にそのグレー候補画素の個数を補正して得た値、を当該グレー候補画素群の画素数とする処理、および/または、
前記肌色の黒体軌跡曲線に近い画素ほどカウント数の重みが高くなるように前記肌色候補画素群毎に各々の前記肌色候補画素のカウント数を重み付け加算して得た和、または、サンプルカラー画像中の肌色画素の個数が当該サンプルカラー画像の全画素の個数に占める割合に対して、多数の前記サンプルカラー画像を用いて統計的に求められた各々の前記割合毎のサンプルカラー画像の存在頻度に応じた補正係数で、前記肌色候補画素群に含まれる肌色候補画素の個数が前記カラー画像の全画素の個数に占める割合に応じて前記肌色候補画素群毎にその肌色候補画素の個数を補正して得た値、を当該肌色候補画素群の画素数とする処理を行うことを特徴とするものである。
A seventh white balance correction apparatus of the present invention includes a multiplying unit for multiplying an image signal of each pixel of a color image by a predetermined coefficient,
As a result of the multiplication, pixels that are in the vicinity of the gray black body locus curve are regarded as gray candidate pixels, and the gray candidate pixel group corresponding to each coefficient and the pixels that are in the vicinity of the skin color black body locus curve are each defined as the skin color candidate pixel. Candidate pixel group obtaining means for obtaining a skin color candidate pixel group corresponding to the coefficient;
Candidate pixel group pixel number obtaining means for obtaining the number of pixels of the gray candidate pixel group and the number of pixels of the skin color candidate pixel group obtained by the candidate pixel group obtaining means;
Candidate pixel group average color temperature acquisition means for obtaining an average color temperature of the gray candidate pixel group acquired by the candidate pixel group acquisition means and an average color temperature of the skin color candidate pixel group;
The sum of the number of pixels of the gray candidate pixel group acquired by the candidate pixel group pixel number acquisition unit and the number of pixels of the skin color candidate pixel group is maximized, and acquired by the candidate pixel group average color temperature acquisition unit An optimum coefficient obtaining unit that obtains, as an optimum coefficient, the coefficient that minimizes the difference between the average color temperature of the gray candidate pixel group and the average color temperature of the skin color candidate pixel group;
The gray candidate pixel group and the skin color candidate pixel group corresponding to the appropriate coefficient acquired by the optimal coefficient acquisition unit are set as a gray pixel group and a skin color pixel group, respectively, and the color temperature of each pixel included in the gray pixel group and Light source color temperature obtaining means for obtaining a color temperature of a photographing light source of the color image from a color temperature of each pixel included in the skin color pixel group;
A correction unit that multiplies the image signal of the color image by the optimum coefficient and corrects the multiplied image signal by a difference between the color temperature obtained by the light source color temperature acquisition unit and a reference white color. In a white balance correction device having
The candidate pixel group pixel number acquisition unit weights and adds the count number of each gray candidate pixel for each gray candidate image group so that the weight closer to the gray black body locus curve is higher in the count number. Or the ratio of the number of gray pixels in the sample color image to the total number of pixels in the sample color image obtained statistically using a number of sample color images. The gray candidate pixel group according to the ratio of the number of gray candidate pixels included in the gray candidate pixel group to the total number of pixels of the color image, with a correction coefficient according to the frequency of existence of the sample color image for each ratio. A value obtained by correcting the number of gray candidate pixels for each of the gray candidate pixel groups, and / or
Sum obtained by weighting and adding the count number of each skin color candidate pixel for each skin color candidate pixel group so that the weight of the count number becomes higher as the pixel closer to the flesh color black body locus curve, or a sample color image The presence frequency of the sample color image for each of the ratios statistically obtained using a number of the sample color images with respect to the ratio of the number of skin color pixels to the total number of pixels of the sample color image The number of flesh color candidate pixels included in the flesh color candidate pixel group is corrected for each flesh color candidate pixel group for each flesh color candidate pixel group according to the ratio of the total number of pixels in the color image. The value obtained in this way is used as the number of pixels of the skin color candidate pixel group.

本発明の第8のホワイトバランス補正装置は、カラー画像の各画素の画像信号に対して所定の係数を乗算する乗算手段と、
前記乗算の結果、グレーの黒体軌跡曲線の近傍に入る画素をグレー候補画素として各前記係数に対応するグレー候補画素群と肌色の黒体軌跡曲線の近傍に入る画素を肌色候補画素として各前記係数に対応する肌色候補画素群とを得る候補画素群取得手段と、
該候補画素群取得手段により取得された前記グレー候補画素群の画素数および前記肌色候補画素群の画素数を求める候補画素群画素数取得手段と、
前記候補画素群取得手段により取得された前記グレー候補画素群の平均色温度と前記肌色候補画素群の平均色温度を求める候補画素群平均色温度取得手段と、
前記候補画素群画素数取得手段により取得された前記グレー候補画素群の画素数と前記肌色候補画素群の画素数との和が最大となり、かつ前記候補画素群平均色温度取得手段により取得された前記グレー候補画素群の平均色温度と前記肌色候補画素群の平均色温度との差が最小となる前記係数を最適係数として取得する最適係数取得手段と、
該最適係数取得手段により取得された前記適係数に対応する前記グレー候補画素群と肌色候補画素群を夫々グレー画素群と肌色画素群にし、該グレー画素群に含まれる各々の画素の色温度および該肌色画素群に含まれる各々の画素の色温度から前記カラー画像の撮影光源の色温度を求める光源色温度取得手段と、
前記カラー画像の画像信号に対して前記最適係数を乗算すると共に、該乗算がされた前記画像信号を、前記光源色温度取得手段により求められた色温度と基準白色との差分だけ補正する補正手段とを有してなるホワイトバランス補正装置において、
前記候補画素群平均色温度取得手段が、前記グレーの黒体軌跡曲線に近いグレー候補画素ほどその色温度の重みが高くなるように前記グレー候補画素群に含まれる各々のグレー候補画素の色温度を重み付け平均演算して得た値を該グレー候補画素群の平均色温度とする処理、および/または、
前記肌色の黒体軌跡曲線に近い肌色候補画素ほどその色温度の重みが高くなるように前記肌色候補画素群に含まれる各々の肌色候補画素の色温度を重み付け平均演算して得た値を該肌色候補画素群の平均色温度とする処理を行うことを特徴とするものである。
An eighth white balance correction apparatus according to the present invention includes a multiplying unit that multiplies the image signal of each pixel of a color image by a predetermined coefficient,
As a result of the multiplication, pixels that are in the vicinity of the gray black body locus curve are regarded as gray candidate pixels, and the gray candidate pixel group corresponding to each coefficient and the pixels that are in the vicinity of the skin color black body locus curve are each defined as the skin color candidate pixel. Candidate pixel group obtaining means for obtaining a skin color candidate pixel group corresponding to the coefficient;
Candidate pixel group pixel number obtaining means for obtaining the number of pixels of the gray candidate pixel group and the number of pixels of the skin color candidate pixel group obtained by the candidate pixel group obtaining means;
Candidate pixel group average color temperature acquisition means for obtaining an average color temperature of the gray candidate pixel group acquired by the candidate pixel group acquisition means and an average color temperature of the skin color candidate pixel group;
The sum of the number of pixels of the gray candidate pixel group acquired by the candidate pixel group pixel number acquisition unit and the number of pixels of the skin color candidate pixel group is maximized, and acquired by the candidate pixel group average color temperature acquisition unit An optimum coefficient obtaining unit that obtains, as an optimum coefficient, the coefficient that minimizes the difference between the average color temperature of the gray candidate pixel group and the average color temperature of the skin color candidate pixel group;
The gray candidate pixel group and the skin color candidate pixel group corresponding to the appropriate coefficient acquired by the optimal coefficient acquisition unit are set as a gray pixel group and a skin color pixel group, respectively, and the color temperature of each pixel included in the gray pixel group and Light source color temperature obtaining means for obtaining a color temperature of a photographing light source of the color image from a color temperature of each pixel included in the skin color pixel group;
A correction unit that multiplies the image signal of the color image by the optimum coefficient and corrects the multiplied image signal by a difference between the color temperature obtained by the light source color temperature acquisition unit and a reference white color. In a white balance correction device having
The candidate pixel group average color temperature acquisition unit is configured so that a gray candidate pixel closer to the gray black body locus curve has a higher color temperature weight so that the color temperature of each gray candidate pixel included in the gray candidate pixel group is higher. A value obtained by performing a weighted average calculation on the gray candidate pixel group as an average color temperature, and / or
A value obtained by performing a weighted average operation on the color temperature of each skin color candidate pixel included in the skin color candidate pixel group so that the skin temperature candidate pixel closer to the skin color black body locus curve has a higher color temperature weight. The processing is performed to obtain the average color temperature of the skin color candidate pixel group.

本発明の第1から第8のホワイトバランス補正装置は、前記カラー画像の各画素のうち、前記グレー候補画素群および/または肌色候補画素群を得るために有効な画素を抽出し、該有効な画素のみを前記グレー候補画素群および/または肌色候補画素群の取得に供する有効画素抽出手段をさらに備えたことが好ましい。   The first to eighth white balance correction devices of the present invention extract effective pixels for obtaining the gray candidate pixel group and / or skin color candidate pixel group from the pixels of the color image, and It is preferable that the image processing apparatus further includes an effective pixel extraction unit that uses only pixels for obtaining the gray candidate pixel group and / or the skin color candidate pixel group.

本発明のホワイトバランス装置において、前記光源色温度取得手段は、前記黒体軌跡曲線に近い画素ほどその色温度の重みが高くなるように前記最適係数に対応する前記候補画素群に含まれる各々の画素の色温度を重付平均演算して得た平均色温度を前記撮影光源の色温度として求めるものであることが好ましい。   In the white balance device of the present invention, the light source color temperature acquisition unit includes each pixel included in the candidate pixel group corresponding to the optimal coefficient so that a pixel closer to the black body locus curve has a higher color temperature weight. It is preferable that an average color temperature obtained by weighted average calculation of the color temperature of the pixel is obtained as the color temperature of the photographing light source.

本発明のホワイトバランス補正装置において、前記黒体軌跡曲線の代わりに昼光軌跡曲線を用いてもよい。   In the white balance correction device of the present invention, a daylight locus curve may be used instead of the black body locus curve.

本発明の第1のプログラムは、カラー画像の各画素の画像信号に対して、所定の係数を乗算する乗算処理と、
前記乗算の結果、グレーの黒体軌跡曲線の近傍に入る画素をグレー候補画素として各前記係数に対応するグレー候補画素群を得、該グレー候補画素群の画素数を求めるグレー候補画素群画素数取得処理と、
該グレー候補画素群画素数取得処理により取得された画素数が最大となる前記グレー候補画素群に対応する前記係数を最適係数として取得する最適係数取得処理と、
該最適係数取得処理により取得された前記最適係数に対応する前記グレー候補画素群をグレー画素群とし、該グレー画素群に含まれる各々の画素の色温度から前記カラー画像の撮影光源の色温度を求める光源色温度取得処理と、
前記カラー画像の画像信号に対して前記最適係数を乗算すると共に、該乗算がされた前記画像信号を、前記光源色温度取得処理により求められた色温度と基準白色の色温度との差分だけ補正する補正処理とをコンピュータに行わせるプログラムであって、
前記グレー候補画素群画素数取得処理が、前記グレーの黒体軌跡曲線に近い画素ほどカウント数の重みが高くなるように前記グレー候補画像群毎に各々の前記グレー候補画素のカウント数を重み付け加算して得た和を当該グレー候補画素群の画素数とすることを特徴とするものである。
A first program according to the present invention includes a multiplication process for multiplying an image signal of each pixel of a color image by a predetermined coefficient;
As a result of the multiplication, a pixel that enters the vicinity of the gray black body locus curve is regarded as a gray candidate pixel, a gray candidate pixel group corresponding to each coefficient is obtained, and the number of gray candidate pixel groups for obtaining the number of pixels in the gray candidate pixel group Acquisition process,
An optimal coefficient acquisition process for acquiring, as an optimal coefficient, the coefficient corresponding to the gray candidate pixel group in which the number of pixels acquired by the gray candidate pixel group pixel number acquisition process is maximized;
The gray candidate pixel group corresponding to the optimal coefficient acquired by the optimal coefficient acquisition process is defined as a gray pixel group, and the color temperature of the imaging light source of the color image is determined from the color temperature of each pixel included in the gray pixel group. The desired light source color temperature acquisition process;
The image signal of the color image is multiplied by the optimum coefficient, and the multiplied image signal is corrected by the difference between the color temperature obtained by the light source color temperature acquisition process and the color temperature of the reference white. A program for causing a computer to perform correction processing,
In the gray candidate pixel group pixel number acquisition process, the count number of each gray candidate pixel is weighted and added for each gray candidate image group such that the weight closer to the gray black body locus curve is higher in the count number. The sum obtained in this way is the number of pixels of the gray candidate pixel group.

本発明の第2のプログラムは、カラー画像の各画素の画像信号に対して、所定の係数を乗算する乗算処理と、
前記乗算の結果、グレーの黒体軌跡曲線の近傍に入る画素をグレー候補画素として各前記係数に対応するグレー候補画素群を得、該グレー候補画素群の画素数を求めるグレー候補画素群画素数取得処理と、
該グレー候補画素群画素数取得処理により取得された画素数が最大となる前記グレー候補画素群に対応する前記係数を最適係数として取得する最適係数取得処理と、
該最適係数取得処理により取得された前記最適係数に対応する前記グレー候補画素群をグレー画素群とし、該グレー画素群に含まれる各々の画素の色温度から前記カラー画像の撮影光源の色温度を求める光源色温度取得処理と、
前記カラー画像の画像信号に対して前記最適係数を乗算すると共に、該乗算がされた前記画像信号を、前記光源色温度取得処理により求められた色温度と基準白色の色温度との差分だけ補正する補正処理とをコンピュータに行わせるプログラムであって、
前記グレー候補画素群画素数取得処理が、サンプルカラー画像中のグレー画素の個数が当該サンプルカラー画像の全画素の個数に占める割合に対して、多数の前記サンプルカラー画像を用いて統計的に求められた各々の前記割合毎のサンプルカラー画像の存在頻度に応じた補正係数で、前記グレー候補画素群に含まれるグレー候補画素の個数が前記カラー画像の全画素の個数に占める割合に応じて前記グレー候補画素群毎にそのグレー候補画素の個数を補正して得た値を当該グレー候補画素群の画素数とすることを特徴とするものである。
A second program of the present invention includes a multiplication process for multiplying an image signal of each pixel of a color image by a predetermined coefficient,
As a result of the multiplication, a pixel that enters the vicinity of the gray black body locus curve is regarded as a gray candidate pixel, a gray candidate pixel group corresponding to each coefficient is obtained, and the number of gray candidate pixel groups for obtaining the number of pixels in the gray candidate pixel group Acquisition process,
An optimal coefficient acquisition process for acquiring, as an optimal coefficient, the coefficient corresponding to the gray candidate pixel group in which the number of pixels acquired by the gray candidate pixel group pixel number acquisition process is maximized;
The gray candidate pixel group corresponding to the optimal coefficient acquired by the optimal coefficient acquisition process is defined as a gray pixel group, and the color temperature of the imaging light source of the color image is determined from the color temperature of each pixel included in the gray pixel group. The desired light source color temperature acquisition process;
The image signal of the color image is multiplied by the optimum coefficient, and the multiplied image signal is corrected by the difference between the color temperature obtained by the light source color temperature acquisition process and the color temperature of the reference white. A program for causing a computer to perform correction processing,
The gray candidate pixel group pixel number acquisition process is statistically obtained using a large number of sample color images with respect to the ratio of the number of gray pixels in the sample color image to the total number of pixels in the sample color image. The correction coefficient according to the frequency of existence of the sample color image for each of the ratios, and the number of gray candidate pixels included in the gray candidate pixel group according to the ratio of the total number of pixels of the color image according to the ratio A value obtained by correcting the number of gray candidate pixels for each gray candidate pixel group is set as the number of pixels of the gray candidate pixel group.

本発明の第3のプログラムは、カラー画像の各画素の画像信号に対して、所定の係数を乗算する乗算処理と、
前記乗算の結果、肌色の黒体軌跡曲線の近傍に入る画素を肌色候補画素として各前記係数に対応する肌色候補画素群を得、該肌色候補画素群の画素数を求める肌色候補画素群画素数取得処理と、
該肌色候補画素群画素数取得処理により取得された画素数が最大となる前記肌色候補画素群に対応する前記係数を最適係数として取得する最適係数取得処理と、
該最適係数取得処理により取得された前記最適係数に対応する前記肌色候補画素群を肌色画素群とし、該肌色画素群に含まれる各々の画素の色温度から前記カラー画像の撮影光源の色温度を求める光源色温度取得処理と、
前記カラー画像の画像信号に対して前記最適係数を乗算すると共に、該乗算がされた前記画像信号を、前記光源色温度取得処理により求められた色温度と基準白色の色温度との差分だけ補正する補正処理とをコンピュータに実行させるプログラムであって、
前記肌色候補画素群画素数取得処理が、前記肌色の黒体軌跡曲線に近い画素ほどカウント数の重みが高くなるように前記肌色候補画素群毎に各々の前記肌色候補画素のカウント数を重み付け加算して得た和を当該肌色候補画素群の画素数とすることを特徴とするものである。
A third program of the present invention includes a multiplication process for multiplying an image signal of each pixel of a color image by a predetermined coefficient,
As a result of the multiplication, a pixel that enters the vicinity of the skin color black body locus curve is used as a skin color candidate pixel to obtain a skin color candidate pixel group corresponding to each of the coefficients, and a skin color candidate pixel group pixel number for obtaining the number of pixels of the skin color candidate pixel group Acquisition process,
An optimal coefficient acquisition process for acquiring the coefficient corresponding to the skin color candidate pixel group that maximizes the number of pixels acquired by the skin color candidate pixel group pixel number acquisition process;
The skin color candidate pixel group corresponding to the optimal coefficient acquired by the optimal coefficient acquisition process is defined as a skin color pixel group, and the color temperature of the photographing light source of the color image is determined from the color temperature of each pixel included in the skin color pixel group. The desired light source color temperature acquisition process;
The image signal of the color image is multiplied by the optimum coefficient, and the multiplied image signal is corrected by the difference between the color temperature obtained by the light source color temperature acquisition process and the color temperature of the reference white. A program for causing a computer to execute correction processing to be performed,
In the skin color candidate pixel group pixel number acquisition process, the count number of each skin color candidate pixel is weighted and added for each skin color candidate pixel group so that the weight closer to the skin color black body locus curve is higher in the count number. The sum obtained in this way is used as the number of pixels of the skin color candidate pixel group.

本発明の第4のプログラムは、カラー画像の各画素の画像信号に対して、所定の係数を乗算する乗算処理と、
前記乗算の結果、肌色の黒体軌跡曲線の近傍に入る画素を肌色候補画素として各前記係数に対応する肌色候補画素群を得、該肌色候補画素群の画素数を求める肌色候補画素群画素数取得処理と、
該肌色候補画素群画素数取得処理により取得された画素数が最大となる前記肌色候補画素群に対応する前記係数を最適係数として取得する最適係数取得処理と、
該最適係数取得処理により取得された前記最適係数に対応する前記肌色候補画素群を肌色画素群とし、該肌色画素群に含まれる各々の画素の色温度から前記カラー画像の撮影光源の色温度を求める光源色温度取得処理と、
前記カラー画像の画像信号に対して前記最適係数を乗算すると共に、該乗算がされた前記画像信号を、前記光源色温度取得処理により求められた色温度と基準白色の色温度との差分だけ補正する補正処理とをコンピュータに実行させるプログラムであって、
前記肌色候補画素群画素数取得処理が、サンプルカラー画像中の肌色画素の個数が当該サンプルカラー画像の全画素の個数に占める割合に対して、多数の前記サンプルカラー画像を用いて統計的に求められた各々の前記割合毎のサンプルカラー画像の存在頻度に応じた補正係数で、前記肌色候補画素群に含まれる肌色候補画素の個数が前記カラー画像の全画素の個数に占める割合に応じて前記肌色候補画素群毎にその肌色候補画素の個数を補正して得た値を該当肌色候補画素群の画素数とすることを特徴とするものである。
A fourth program of the present invention includes a multiplication process for multiplying an image signal of each pixel of a color image by a predetermined coefficient,
As a result of the multiplication, a pixel that enters the vicinity of the skin color black body locus curve is used as a skin color candidate pixel to obtain a skin color candidate pixel group corresponding to each of the coefficients, and a skin color candidate pixel group pixel number for obtaining the number of pixels of the skin color candidate pixel group Acquisition process,
An optimal coefficient acquisition process for acquiring the coefficient corresponding to the skin color candidate pixel group that maximizes the number of pixels acquired by the skin color candidate pixel group pixel number acquisition process;
The skin color candidate pixel group corresponding to the optimal coefficient acquired by the optimal coefficient acquisition process is defined as a skin color pixel group, and the color temperature of the photographing light source of the color image is determined from the color temperature of each pixel included in the skin color pixel group. The desired light source color temperature acquisition process;
The image signal of the color image is multiplied by the optimum coefficient, and the multiplied image signal is corrected by the difference between the color temperature obtained by the light source color temperature acquisition process and the color temperature of the reference white. A program for causing a computer to execute correction processing to be performed,
The skin color candidate pixel group pixel number acquisition process is statistically obtained using a large number of sample color images with respect to the ratio of the number of skin color pixels in the sample color image to the total number of pixels in the sample color image. The correction coefficient according to the frequency of existence of the sample color image for each of the ratios is determined according to the ratio of the number of skin color candidate pixels included in the skin color candidate pixel group to the total number of pixels of the color image. A value obtained by correcting the number of skin color candidate pixels for each skin color candidate pixel group is used as the number of pixels of the corresponding skin color candidate pixel group.

本発明の第5のプログラムは、カラー画像の各画素の画像信号に対して所定の係数を乗算する乗算処理と、
前記乗算の結果、グレーの黒体軌跡曲線の近傍に入る画素をグレー候補画素として各前記係数に対応するグレー候補画素群と肌色の黒体軌跡曲線の近傍に入る画素を肌色候補画素として各前記係数に対応する肌色候補画素群とを得、前記グレー候補画素群の画素数および前記肌色候補画素群の画素数を求める候補画素群画素数取得処理と、
該候補画素群画素数取得処理により取得された前記グレー候補画素群の画素数と前記肌色候補画素群の画素数との和が最大となる前記係数を最適係数として取得する最適係数取得処理と、
該最適係数取得処理により取得された前記適係数に対応する前記グレー候補画素群と肌色候補画素群を夫々グレー画素群と肌色画素群にし、該グレー画素群に含まれる各々の画素の色温度および該肌色画素群に含まれる各々の画素の色温度から前記カラー画像の撮影光源の色温度を求める光源色温度取得処理と、
前記カラー画像の画像信号に対して前記最適係数を乗算すると共に、該乗算がされた前記画像信号を、前記光源色温度取得処理により求められた色温度と基準白色との差分だけ補正する補正処理とをコンピュータに実行させるプログラムであって、
前記候補画素群画素数取得処理が、前記グレーの黒体軌跡曲線に近い画素ほどカウント数の重みが高くなるように前記グレー候補画像群毎に各々の前記グレー候補画素のカウント数を重み付け加算して得た和、または、サンプルカラー画像中のグレー画素の個数が当該サンプルカラー画像の全画素の個数に占める割合に対して、多数の前記サンプルカラー画像を用いて統計的に求められた各々の前記割合毎のサンプルカラー画像の存在頻度に応じた補正係数で、前記グレー候補画素群に含まれるグレー候補画素の個数が前記カラー画像の全画素の個数に占める割合に応じて前記グレー候補画素群毎にそのグレー候補画素の個数を補正して得た値、を当該グレー候補画素群の画素数とする手順、および/または、
前記肌色の黒体軌跡曲線に近い画素ほどカウント数の重みが高くなるように前記肌色候補画素群毎に各々の前記肌色候補画素のカウント数を重み付け加算して得た和、または、サンプルカラー画像中の肌色画素の個数が当該サンプルカラー画像の全画素の個数に占める割合に対して、多数の前記サンプルカラー画像を用いて統計的に求められた各々の前記割合毎のサンプルカラー画像の存在頻度に応じた補正係数で、前記肌色候補画素群に含まれる肌色候補画素の個数が前記カラー画像の全画素の個数に占める割合に応じて前記肌色候補画素群毎にその肌色候補画素の個数を補正して得た値、を当該肌色候補画素群の画素数とする手順を有することを特徴とするものである。
A fifth program of the present invention includes a multiplication process for multiplying an image signal of each pixel of a color image by a predetermined coefficient,
As a result of the multiplication, pixels that are in the vicinity of the gray black body locus curve are regarded as gray candidate pixels, and the gray candidate pixel group corresponding to each coefficient and the pixels that are in the vicinity of the skin color black body locus curve are defined as skin color candidate pixels. Obtaining a skin color candidate pixel group corresponding to a coefficient, obtaining a pixel number of the gray candidate pixel group and a number of pixels of the skin color candidate pixel group, and obtaining a pixel number of candidate pixel groups,
An optimum coefficient obtaining process for obtaining, as an optimum coefficient, the coefficient that maximizes the sum of the number of pixels of the gray candidate pixel group obtained by the candidate pixel group pixel number obtaining process and the number of pixels of the skin color candidate pixel group;
The gray candidate pixel group and the skin color candidate pixel group corresponding to the optimal coefficient acquired by the optimal coefficient acquisition process are set as a gray pixel group and a skin color pixel group, respectively, and the color temperature of each pixel included in the gray pixel group and A light source color temperature acquisition process for obtaining a color temperature of a photographing light source of the color image from a color temperature of each pixel included in the skin color pixel group;
A correction process for multiplying the image signal of the color image by the optimum coefficient, and correcting the multiplied image signal by a difference between the color temperature obtained by the light source color temperature acquisition process and a reference white color Is a program that causes a computer to execute
In the candidate pixel group pixel number acquisition processing, the count number of each gray candidate pixel is weighted and added for each gray candidate image group so that the weight closer to the gray black body locus curve is higher in the count number. Or the ratio of the number of gray pixels in the sample color image to the total number of pixels in the sample color image, statistically determined using a number of sample color images. The gray candidate pixel group according to the ratio of the number of gray candidate pixels included in the gray candidate pixel group to the total number of pixels of the color image with a correction coefficient according to the frequency of existence of the sample color image for each ratio. A procedure in which the value obtained by correcting the number of gray candidate pixels for each time is the number of pixels of the gray candidate pixel group, and / or
Sum obtained by weighting and adding the count number of each skin color candidate pixel for each skin color candidate pixel group so that the weight of the count number becomes higher as the pixel closer to the flesh color black body locus curve, or a sample color image The presence frequency of the sample color image for each of the ratios statistically obtained using a number of the sample color images with respect to the ratio of the number of skin color pixels to the total number of pixels of the sample color image The number of flesh color candidate pixels included in the flesh color candidate pixel group is corrected for each flesh color candidate pixel group according to the proportion of the total number of pixels in the color image. The value obtained in this manner is used as the number of pixels of the skin color candidate pixel group.

本発明の第6のプログラムは、カラー画像の各画素の画像信号に対して所定の係数を乗算する乗算処理と、
前記乗算の結果、グレーの黒体軌跡曲線の近傍に入る画素をグレー候補画素として各前記係数に対応するグレー候補画素群と肌色の黒体軌跡曲線の近傍に入る画素を肌色候補画素として各前記係数に対応する肌色候補画素群とを得、前記グレー候補画素群の平均色温度と前記肌色候補画素群の平均色温度を求める候補画素群平均色温度取得処理と、
該候補画素群平均色温度により取得された前記グレー候補画素群の平均色温度と前記肌色候補画素群の平均色温度との差が最小となる前記係数を最適係数として取得する最適係数取得処理と、
該最適係数取得処理により取得された前記適係数に対応する前記グレー候補画素群と肌色候補画素群を夫々グレー画素群と肌色画素群にし、該グレー画素群に含まれる各々の画素の色温度および該肌色画素群に含まれる各々の画素の色温度から前記カラー画像の撮影光源の色温度を求める光源色温度取得処理と、
前記カラー画像の画像信号に対して前記最適係数を乗算すると共に、該乗算がされた前記画像信号を、前記光源色温度取得処理により求められた色温度と基準白色との差分だけ補正する補正処理とをコンピュータに実行させるプログラムであって、
前記候補画素群平均色温度取得処理が、前記グレーの黒体軌跡曲線に近いグレー候補画素ほどその色温度の重みが高くなるように前記グレー候補画素群に含まれる各々のグレー候補画素の色温度を重み付け平均演算して得た値を該グレー候補画素群の平均色温度とする手順、および/または、
前記肌色の黒体軌跡曲線に近い肌色候補画素ほどその色温度の重みが高くなるように前記肌色候補画素群に含まれる各々の肌色候補画素の色温度を重み付け平均演算して得た値を該肌色候補画素群の平均色温度とする手順を有することを特徴とするものである。
A sixth program of the present invention includes a multiplication process for multiplying an image signal of each pixel of a color image by a predetermined coefficient,
As a result of the multiplication, pixels that are in the vicinity of the gray black body locus curve are regarded as gray candidate pixels, and the gray candidate pixel group corresponding to each coefficient and the pixels that are in the vicinity of the skin color black body locus curve are defined as skin color candidate pixels. Obtaining a skin color candidate pixel group corresponding to a coefficient, and obtaining an average color temperature of the gray candidate pixel group and an average color temperature of the skin color candidate pixel group;
An optimal coefficient acquisition process for acquiring, as an optimal coefficient, the coefficient that minimizes the difference between the average color temperature of the gray candidate pixel group acquired by the candidate pixel group average color temperature and the average color temperature of the skin color candidate pixel group; ,
The gray candidate pixel group and the skin color candidate pixel group corresponding to the optimal coefficient acquired by the optimal coefficient acquisition process are set as a gray pixel group and a skin color pixel group, respectively, and the color temperature of each pixel included in the gray pixel group and A light source color temperature acquisition process for obtaining a color temperature of a photographing light source of the color image from a color temperature of each pixel included in the skin color pixel group;
A correction process for multiplying the image signal of the color image by the optimum coefficient, and correcting the multiplied image signal by a difference between the color temperature obtained by the light source color temperature acquisition process and a reference white color Is a program that causes a computer to execute
In the candidate pixel group average color temperature acquisition process, the color temperature of each gray candidate pixel included in the gray candidate pixel group is such that a gray candidate pixel closer to the gray black body locus curve has a higher color temperature weight. The procedure of setting the value obtained by performing the weighted average calculation as the average color temperature of the gray candidate pixel group, and / or
A value obtained by performing a weighted average operation on the color temperature of each skin color candidate pixel included in the skin color candidate pixel group so that the skin temperature candidate pixel closer to the skin color black body locus curve has a higher color temperature weight. It has the procedure which makes it the average color temperature of a skin color candidate pixel group.

本発明の第7のプログラムは、カラー画像の各画素の画像信号に対して所定の係数を乗算する乗算処理と、
前記乗算の結果、グレーの黒体軌跡曲線の近傍に入る画素をグレー候補画素として各前記係数に対応するグレー候補画素群と肌色の黒体軌跡曲線の近傍に入る画素を肌色候補画素として各前記係数に対応する肌色候補画素群とを得る候補画素群取得処理と、
該候補画素群取得処理により取得された前記グレー候補画素群の画素数および前記肌色候補画素群の画素数を求める候補画素群画素数取得処理と、
前記候補画素群取得処理により取得された前記グレー候補画素群の平均色温度と前記肌色候補画素群の平均色温度を求める候補画素群平均色温度取得処理と、
前記候補画素群画素数取得処理により取得された前記グレー候補画素群の画素数と前記肌色候補画素群の画素数との和が最大となり、かつ前記候補画素群平均色温度取得処理により取得された前記グレー候補画素群の平均色温度と前記肌色候補画素群の平均色温度との差が最小となる前記係数を最適係数として取得する最適係数取得処理と、
該最適係数取得処理により取得された前記適係数に対応する前記グレー候補画素群と肌色候補画素群を夫々グレー画素群と肌色画素群にし、該グレー画素群に含まれる各々の画素の色温度および該肌色画素群に含まれる各々の画素の色温度から前記カラー画像の撮影光源の色温度を求める光源色温度取得処理と、
前記カラー画像の画像信号に対して前記最適係数を乗算すると共に、該乗算がされた前記画像信号を、前記光源色温度取得処理により求められた色温度と基準白色との差分だけ補正する補正処理とをコンピュータに実行させるプログラムであって、
前記候補画素群画素数取得処理が、前記グレーの黒体軌跡曲線に近い画素ほどカウント数の重みが高くなるように前記グレー候補画像群毎に各々の前記グレー候補画素のカウント数を重み付け加算して得た和、または、サンプルカラー画像中のグレー画素の個数が当該サンプルカラー画像の全画素の個数に占める割合に対して、多数の前記サンプルカラー画像を用いて統計的に求められた各々の前記割合毎のサンプルカラー画像の存在頻度に応じた補正係数で、前記グレー候補画素群に含まれるグレー候補画素の個数が前記カラー画像の全画素の個数に占める割合に応じて前記グレー候補画素群毎にそのグレー候補画素の個数を補正して得た値、を当該グレー候補画素群の画素数する手順、および/または、
前記肌色の黒体軌跡曲線に近い画素ほどカウント数の重みが高くなるように前記肌色候補画素群毎に各々の前記肌色候補画素のカウント数を重み付け加算して得た和、または、サンプルカラー画像中の肌色画素の個数が当該サンプルカラー画像の全画素の個数に占める割合に対して、多数の前記サンプルカラー画像を用いて統計的に求められた各々の前記割合毎のサンプルカラー画像の存在頻度に応じた補正係数で、前記肌色候補画素群に含まれる肌色候補画素の個数が前記カラー画像の全画素の個数に占める割合に応じて前記肌色候補画素群毎にその肌色候補画素の個数を補正して得た値、を当該肌色候補画素群の画素数とする手順を有することを特徴とするものである。
A seventh program of the present invention includes a multiplication process for multiplying an image signal of each pixel of a color image by a predetermined coefficient,
As a result of the multiplication, the pixels that are in the vicinity of the gray black body locus curve are regarded as gray candidate pixels, and the gray candidate pixel group corresponding to each coefficient and the pixels that are in the vicinity of the skin color black body locus curve are each defined as the skin color candidate pixel. A candidate pixel group acquisition process for obtaining a skin color candidate pixel group corresponding to the coefficient;
A candidate pixel group pixel number acquisition process for obtaining the number of pixels of the gray candidate pixel group acquired by the candidate pixel group acquisition process and the number of pixels of the skin color candidate pixel group;
A candidate pixel group average color temperature acquisition process for obtaining an average color temperature of the gray candidate pixel group acquired by the candidate pixel group acquisition process and an average color temperature of the skin color candidate pixel group;
The sum of the number of pixels of the gray candidate pixel group acquired by the candidate pixel group pixel number acquisition process and the number of pixels of the skin color candidate pixel group is maximized, and acquired by the candidate pixel group average color temperature acquisition process An optimal coefficient acquisition process for acquiring, as an optimal coefficient, the coefficient that minimizes the difference between the average color temperature of the gray candidate pixel group and the average color temperature of the skin color candidate pixel group;
The gray candidate pixel group and the skin color candidate pixel group corresponding to the optimal coefficient acquired by the optimal coefficient acquisition process are set as a gray pixel group and a skin color pixel group, respectively, and the color temperature of each pixel included in the gray pixel group and A light source color temperature acquisition process for obtaining a color temperature of a photographing light source of the color image from a color temperature of each pixel included in the skin color pixel group;
A correction process for multiplying the image signal of the color image by the optimum coefficient, and correcting the multiplied image signal by a difference between the color temperature obtained by the light source color temperature acquisition process and a reference white color Is a program that causes a computer to execute
The candidate pixel group pixel number acquisition processing weights and adds the count number of each gray candidate pixel for each gray candidate image group so that the weight closer to the gray black body locus curve is higher in the count number. Or the ratio of the number of gray pixels in the sample color image to the total number of pixels in the sample color image obtained statistically using a number of sample color images. The gray candidate pixel group according to the ratio of the number of gray candidate pixels included in the gray candidate pixel group to the total number of pixels of the color image, with a correction coefficient according to the frequency of existence of the sample color image for each ratio. A value obtained by correcting the number of gray candidate pixels for each step, and / or the number of pixels in the gray candidate pixel group, and / or
Sum obtained by weighting and adding the count number of each skin color candidate pixel for each skin color candidate pixel group so that the weight of the count number becomes higher as the pixel closer to the flesh color black body locus curve, or a sample color image The presence frequency of the sample color image for each of the ratios statistically obtained using a number of the sample color images with respect to the ratio of the number of skin color pixels to the total number of pixels of the sample color image The number of flesh color candidate pixels included in the flesh color candidate pixel group is corrected for each flesh color candidate pixel group according to the proportion of the total number of pixels in the color image. The value obtained in this manner is used as the number of pixels of the skin color candidate pixel group.

本発明の第8のプログラムは、カラー画像の各画素の画像信号に対して所定の係数を乗算する乗算処理と、
前記乗算の結果、グレーの黒体軌跡曲線の近傍に入る画素をグレー候補画素として各前記係数に対応するグレー候補画素群と肌色の黒体軌跡曲線の近傍に入る画素を肌色候補画素として各前記係数に対応する肌色候補画素群とを得る候補画素群取得処理と、
該候補画素群取得処理により取得された前記グレー候補画素群の画素数および前記肌色候補画素群の画素数を求める候補画素群画素数取得処理と、
前記候補画素群取得処理により取得された前記グレー候補画素群の平均色温度と前記肌色候補画素群の平均色温度を求める候補画素群平均色温度取得処理と、
前記候補画素群画素数取得処理により取得された前記グレー候補画素群の画素数と前記肌色候補画素群の画素数との和が最大となり、かつ前記候補画素群平均色温度取得処理により取得された前記グレー候補画素群の平均色温度と前記肌色候補画素群の平均色温度との差が最小となる前記係数を最適係数として取得する最適係数取得処理と、
該最適係数取得処理により取得された前記適係数に対応する前記グレー候補画素群と肌色候補画素群を夫々グレー画素群と肌色画素群にし、該グレー画素群に含まれる各々の画素の色温度および該肌色画素群に含まれる各々の画素の色温度から前記カラー画像の撮影光源の色温度を求める光源色温度取得処理と、
前記カラー画像の画像信号に対して前記最適係数を乗算すると共に、該乗算がされた前記画像信号を、前記光源色温度取得処理により求められた色温度と基準白色との差分だけ補正する補正処理とをコンピュータに実行させるプログラムであって、
前記候補画素群平均色温度取得処理が、前記グレーの黒体軌跡曲線に近いグレー候補画素ほどその色温度の重みが高くなるように前記グレー候補画素群に含まれる各々のグレー候補画素の色温度を重み付け平均演算して得た値を該グレー候補画素群の平均色温度とする手順、および/または、
前記肌色の黒体軌跡曲線に近い肌色候補画素ほどその色温度の重みが高くなるように前記肌色候補画素群に含まれる各々の肌色候補画素の色温度を重み付け平均演算して得た値を該肌色候補画素群の平均色温度とする手順を有することを特徴とするものである。
An eighth program of the present invention includes a multiplication process for multiplying an image signal of each pixel of a color image by a predetermined coefficient;
As a result of the multiplication, the pixels that are in the vicinity of the gray black body locus curve are regarded as gray candidate pixels, and the gray candidate pixel group corresponding to each coefficient and the pixels that are in the vicinity of the skin color black body locus curve are each defined as the skin color candidate pixel. A candidate pixel group acquisition process for obtaining a skin color candidate pixel group corresponding to the coefficient;
A candidate pixel group pixel number acquisition process for obtaining the number of pixels of the gray candidate pixel group acquired by the candidate pixel group acquisition process and the number of pixels of the skin color candidate pixel group;
A candidate pixel group average color temperature acquisition process for obtaining an average color temperature of the gray candidate pixel group acquired by the candidate pixel group acquisition process and an average color temperature of the skin color candidate pixel group;
The sum of the number of pixels of the gray candidate pixel group acquired by the candidate pixel group pixel number acquisition process and the number of pixels of the skin color candidate pixel group is maximized, and acquired by the candidate pixel group average color temperature acquisition process An optimal coefficient acquisition process for acquiring, as an optimal coefficient, the coefficient that minimizes the difference between the average color temperature of the gray candidate pixel group and the average color temperature of the skin color candidate pixel group;
The gray candidate pixel group and the skin color candidate pixel group corresponding to the optimal coefficient acquired by the optimal coefficient acquisition process are set as a gray pixel group and a skin color pixel group, respectively, and the color temperature of each pixel included in the gray pixel group and A light source color temperature acquisition process for obtaining a color temperature of a photographing light source of the color image from a color temperature of each pixel included in the skin color pixel group;
A correction process for multiplying the image signal of the color image by the optimum coefficient, and correcting the multiplied image signal by a difference between the color temperature obtained by the light source color temperature acquisition process and a reference white color Is a program that causes a computer to execute
In the candidate pixel group average color temperature acquisition process, the color temperature of each gray candidate pixel included in the gray candidate pixel group is such that a gray candidate pixel closer to the gray black body locus curve has a higher color temperature weight. The procedure of setting the value obtained by performing the weighted average calculation as the average color temperature of the gray candidate pixel group, and / or
A value obtained by performing a weighted average operation on the color temperature of each skin color candidate pixel included in the skin color candidate pixel group so that the skin temperature candidate pixel closer to the skin color black body locus curve has a higher color temperature weight. It has the procedure which makes it the average color temperature of a skin color candidate pixel group.

本発明の第1から第8のプログラムは、前記カラー画像の各画素のうち、前記グレー候補画素群および/または肌色候補画素群を得るために有効な画素を抽出し、該有効な画素のみを前記グレー候補画素群および/または肌色候補画素群の取得に供する有効画素抽出処理をさらにコンピュータに行わせるものであることが好ましい。   The first to eighth programs of the present invention extract effective pixels for obtaining the gray candidate pixel group and / or skin color candidate pixel group from the pixels of the color image, and only the effective pixels are extracted. It is preferable that the effective pixel extraction process for obtaining the gray candidate pixel group and / or the skin color candidate pixel group is further performed by a computer.

本発明のプログラムは、前記光源色温度取得処理として、前記黒体軌跡曲線に近い画素ほどその色温度の重みが高くなるように前記最適係数に対応する前記候補画素群に含まれる各々の画素の色温度を重付平均演算して得た平均色温度を前記撮影光源の色温度として求めるものであることが好ましい。   According to the program of the present invention, as the light source color temperature acquisition process, each pixel included in the candidate pixel group corresponding to the optimal coefficient is weighted so that a pixel closer to the black body locus curve has a higher color temperature weight. It is preferable that an average color temperature obtained by weighted average calculation of the color temperature is obtained as the color temperature of the photographing light source.

本発明のプログラムにより実行される各処理において、前記黒体軌跡曲線の代わりに昼光軌跡曲線を用いてもよい。   In each process executed by the program of the present invention, a daylight locus curve may be used instead of the black body locus curve.

本発明のホワイトバランス補正方法および装置並びにそのためのプログラムによれば、グレー候補画素群および/または肌色候補画素群の画素数を求める際に、候補画素のカウント数(1つの候補画素はカウント数が1である)の和を単純加算した値を画素数とせず、同じ候補画素群に含まれる候補画素であっても、グレー候補画素が真のグレー画素となる確率、肌色候補画素が真の肌色画素となる確率に応じて候補画素のカウント数を重み付け加算して得た値を候補画素群の画素数にしているので、候補画素群の画素数に基づいて得た最適係数およびこの最適係数に対応する候補画素群から、撮影光源の色温度をより精度良く求めることができ、より良いホワイトバランス補正の効果を得ることができる。   According to the white balance correction method and apparatus and the program therefor according to the present invention, when obtaining the number of gray candidate pixel groups and / or skin color candidate pixel groups, the candidate pixel count number (one candidate pixel has a count number). The probability that a gray candidate pixel is a true gray pixel and the skin color candidate pixel is a true flesh color, even if the candidate pixel is a candidate pixel included in the same candidate pixel group. Since the value obtained by weighting and adding the count number of candidate pixels according to the probability of becoming a pixel is used as the number of pixels of the candidate pixel group, the optimum coefficient obtained based on the number of pixels of the candidate pixel group and the optimum coefficient From the corresponding candidate pixel group, the color temperature of the photographing light source can be obtained with higher accuracy, and a better white balance correction effect can be obtained.

本発明のホワイトバランス補正方法および装置並びにそのためのプログラムによれば、グレー候補画素群および/または肌色候補画素群の画素数を求める際に、統計的に求められた傾向に応じた補正係数(例えばグレーと肌色夫々に対応した図2(b)と図3(b)に示す補正係数)で候補画素のカウント数を単純加算して得た和を補正して得た値を候補画素群の画素数にしているので、候補画素群の画素数に基づいて得た最適係数およびこの最適係数に対応する候補画素群から、撮影光源の色温度をより精度良く求めることができ、より良いホワイトバランス補正の効果を得ることができる。   According to the white balance correction method and apparatus and the program therefor according to the present invention, when determining the number of pixels of the gray candidate pixel group and / or the skin color candidate pixel group, a correction coefficient according to a statistically determined tendency (for example, The values obtained by correcting the sum obtained by simply adding the count numbers of the candidate pixels with the correction coefficients shown in FIGS. 2B and 3B corresponding to gray and skin color, respectively, are the pixels of the candidate pixel group. Therefore, the color temperature of the photographic light source can be obtained more accurately from the optimum coefficient obtained based on the number of pixels in the candidate pixel group and the candidate pixel group corresponding to the optimum coefficient, and a better white balance correction can be obtained. The effect of can be obtained.

「グレー候補画素群の平均色温度と肌色候補画素群の平均色温度との差が最も小さい」であるべきことに基づいて、グレー候補画素群の平均色温度と肌色候補画素群の平均色温度を求める際に、候補画素群に含まれる各々の画素の色温度を単純平均して得た値を候補画素群の色温度とせず、同じ候補画素群に含まれる候補画素であっても、グレー候補画素が真のグレー画素となる確率、肌色候補画素が真の肌色画素となる確率に応じて候補画素の色温度を重み付け平均演算して得た値を候補画素群の平均色温度としているので、精度良く最適係数を求めることができ、ひいては撮影光源の色温度を精度良く求めることができる。   Based on the fact that the difference between the average color temperature of the gray candidate pixel group and the average color temperature of the skin color candidate pixel group should be the smallest, the average color temperature of the gray candidate pixel group and the average color temperature of the skin color candidate pixel group Is obtained by simply averaging the color temperatures of the pixels included in the candidate pixel group as the color temperature of the candidate pixel group, even if it is a candidate pixel included in the same candidate pixel group. The value obtained by weighted averaging the color temperature of the candidate pixel according to the probability that the candidate pixel is a true gray pixel and the probability that the skin color candidate pixel is a true skin color pixel is used as the average color temperature of the candidate pixel group. Therefore, the optimum coefficient can be obtained with high accuracy, and consequently the color temperature of the photographing light source can be obtained with high accuracy.

また、撮影光源の色温度を求める際にも、最適係数に対応する候補画素群の色温度を単純平均演算して得た値を撮影光源の色温度とせず、最適係数に対応する候補画素群に含まれる各々の候補画素が、真のグレー画素または真の肌色画素となる確率に応じて各々の候補画素の色温度を重み付け平均演算して得た値を撮影光源の色温度としているので、精度良く撮影光源の色温度を求めることができ、良いホワイトバランス補正の効果を図ることができる。   Also, when obtaining the color temperature of the photographic light source, the value obtained by performing a simple average operation on the color temperature of the candidate pixel group corresponding to the optimal coefficient is not used as the color temperature of the photographic light source, and the candidate pixel group corresponding to the optimal coefficient Since each candidate pixel included in is a value obtained by performing a weighted average calculation of the color temperature of each candidate pixel according to the probability of being a true gray pixel or a true skin color pixel, The color temperature of the photographing light source can be obtained with high accuracy, and the effect of good white balance correction can be achieved.

また、候補画素を取得する際に、カラー画像中の全ての画素から有効な画素を抽出するようにし、これらの有効な画素から候補画素を取得するようにすれば、候補画素を取得するための計算量を減らすことができると共に、撮影光源の色温度の取得に悪い影響を与えるハイエスト画素のような無効な画素を取り除くことにより、より精度良く撮影光源の色温度を求めることができ、ホワイトバランス補正の効果を向上させることができる。   In addition, when acquiring candidate pixels, effective pixels are extracted from all pixels in the color image, and candidate pixels are acquired from these effective pixels. The amount of calculation can be reduced and the color temperature of the photographic light source can be obtained with higher accuracy by removing invalid pixels such as the highest pixels that adversely affect the acquisition of the color temperature of the photographic light source. The effect of correction can be improved.

以下、図面を参照して、本発明の実施形態について説明する。   Embodiments of the present invention will be described below with reference to the drawings.

図4は、本発明のホワイトバランス補正方法および装置並びにそのためのプログラムの実施形態となる画像処理装置Aの構成を示すブロック図である。なお、本実施形態の画像処理装置Aは、カラー画像に対してホワイトバランス補正を行うものであり、補助記憶装置に読み込まれたホワイトバランス補正プログラムをコンピュータ(たとえばパーソナルコンピュータ等)上で実行することにより実現される。また、このホワイトバランス補正プログラムは、CDROM等の情報記憶媒体に記憶され、もしくはインターネット等のネットワークを介して配布され、コンピュータにインストールされることになる。   FIG. 4 is a block diagram showing a configuration of an image processing apparatus A which is an embodiment of the white balance correction method and apparatus of the present invention and a program therefor. Note that the image processing apparatus A according to the present embodiment performs white balance correction on a color image, and executes a white balance correction program read into an auxiliary storage device on a computer (for example, a personal computer). It is realized by. The white balance correction program is stored in an information storage medium such as a CDROM or distributed via a network such as the Internet and installed in a computer.

図示のように、本実施形態の画像処理装置Aは、デジタルスチールカメラ(DSC)により取得したカラー画像S0(R0,G0,B0)から、有効な画素を抽出するための第1の有効画素抽出手段10aおよび第2の有効画素抽出手段10bと、有効画素抽出手段10aおよび10bにより抽出された有効な画素の画像信号S1aとs1bに対して所定の係数を乗算して各係数に対応する画像信号の集合となる画像信号群S2aおよびS2bを得る乗算手段15と、乗算手段15により得られた画像信号群S2aを用いて各係数に対応するグレー候補画素群S3aを検出するグレー候補画素群検出手段20aと、乗算手段15により得られた画像信号群S2aおよびS2bを用いて各係数に対応する肌色候補画素群S3bを検出する肌色候補画素群検出手段20bと、各々のグレー候補画素群S3aの夫々の画素数Maおよび各々の肌色候補画素群S3bの夫々の画素数Mbを求める画素数算出手段30aと、各々のグレー候補画素群S3aの夫々の平均色温度Taおよび各々の肌色候補画素群S3bの夫々の平均色温度Tbを求める平均色温度算出手段30bと、グレー候補画素群の画素数と肌色候補画素群の画素数との和が最も大きい、かつグレー候補画素群の平均色温度と肌色候補画素群の平均色温度との差が最も小さい係数を最適係数αとして取得する最適係数取得手段40と、最適係数取得手段40により取得された最適係数αに対応するグレー候補画素群S3aと肌色候補画素群S3bに含まれる各々の画素の色温度から撮影光源の色温度Tを求める光源色温度取得手段50と、最適係数取得手段40により求められた最適係数αおよび光源色温度取得手段50により取得された撮影光源の色温度を用いてカラー画像S0の全ての画素の画像信号に対して補正を行って補正済み画像S4(R4,G4,B4)を得る補正手段60とを有してなる。   As shown in the figure, the image processing apparatus A of the present embodiment performs first effective pixel extraction for extracting effective pixels from a color image S0 (R0, G0, B0) acquired by a digital still camera (DSC). The image signal corresponding to each coefficient by multiplying the image signals S1a and s1b of the effective pixels extracted by the means 10a and the second effective pixel extracting means 10b and the effective pixel extracting means 10a and 10b by a predetermined coefficient. And a gray candidate pixel group detecting unit for detecting a gray candidate pixel group S3a corresponding to each coefficient using the image signal group S2a obtained by the multiplication unit 15. 20a and a skin color candidate for detecting a skin color candidate pixel group S3b corresponding to each coefficient using the image signal groups S2a and S2b obtained by the multiplying unit 15 Pixel group detection means 20b, pixel number calculation means 30a for determining the number of pixels Ma of each gray candidate pixel group S3a and the number of pixels Mb of each skin color candidate pixel group S3b, and each gray candidate pixel group S3a The average color temperature calculating means 30b for determining the respective average color temperature Ta and the average color temperature Tb of each skin color candidate pixel group S3b, and the sum of the number of pixels of the gray candidate pixel group and the number of pixels of the skin color candidate pixel group Obtained by the optimum coefficient obtaining means 40 and the optimum coefficient obtaining means 40 for obtaining the coefficient having the smallest difference between the average color temperature of the gray candidate pixel group and the average color temperature of the skin color candidate pixel group as the optimum coefficient α. The light source color temperature acquisition means for obtaining the color temperature T of the photographing light source from the color temperature of each pixel included in the gray candidate pixel group S3a and the skin color candidate pixel group S3b corresponding to the optimum coefficient α. 50 and the optimum coefficient α obtained by the optimum coefficient obtaining means 40 and the color temperature of the photographing light source obtained by the light source color temperature obtaining means 50 are used to correct the image signals of all the pixels of the color image S0. Correction means 60 for obtaining corrected images S4 (R4, G4, B4).

次に、図1に示す画像処理装置Aの各構成について説明する。   Next, each configuration of the image processing apparatus A shown in FIG. 1 will be described.

第1の有効画素抽出手段10aは、まず、カラー画像S0中の下記のような画素を無効な画素として除去する。   The first effective pixel extracting means 10a first removes the following pixels in the color image S0 as invalid pixels.

1. カラー画像中の高彩度画素
ここでは、R=G=Bのグレー軸からの距離が所定の閾値以上の画素を高彩度画素とする。なお、閾値は、各色相に対して同じ閾値を用いてもよく、色相によって閾値を変えるようにしてもよい。
1. Highly Saturated Pixel in Color Image Here, a pixel whose distance from the gray axis of R = G = B is a predetermined threshold or higher is defined as a highly saturated pixel. The same threshold value may be used for each hue, or the threshold value may be changed depending on the hue.

2. ハイエスト画素
ここでは、カラー画像S0中のハイライトの所定のパーセンテージ(例えば5% )までの画素をハイエスト画素とする
第1の有効画素抽出手段10aが、上記無効な画素を除去して得た残りの画素に、カラー画像S0中の輝度の高い領域にある画素、すなわち、輝度値が所定の閾値以上の画素を加えて、有効画素S1a(R1a,G1a,B1a)を得る。
2. Highest pixel Here, the remaining pixels obtained by removing the invalid pixels by the first effective pixel extracting unit 10a, which uses the pixels up to a predetermined percentage (for example, 5%) of the highlight in the color image S0 as the highest pixel. The effective pixel S1a (R1a, G1a, B1a) is obtained by adding a pixel in the high luminance region in the color image S0, that is, a pixel having a luminance value equal to or higher than a predetermined threshold value to the pixel.

第2の有効画素抽出手段10bが、顔抽出手段であり、カラー画像S0中の顔部分を抽出し、抽出した顔部分の画素を有効画素S1b(R1b,G1b,G1b)として第1の抽出手段10aにより抽出された有効画素S1aに加える。     The second effective pixel extraction means 10b is a face extraction means, extracts a face portion in the color image S0, and uses the extracted face portion pixels as effective pixels S1b (R1b, G1b, G1b). The effective pixel S1a extracted by 10a is added.

乗算手段15は、有効画素S1aとS1bの画像信号に対して下記の式(4)のように所定の係数α0(α1,α2)を乗算して各係数α0に対応する画像信号の集合となる画像信号群S2aおよびS2bを得て、画像信号群S2aをグレー候補画素群検出手段20aに出力すると共に、画像信号群S2aおよびS2bを肌色候補画素群検出手段20bに出力する。なお、乗算をR、G、Bの3信号に対して行う必要がなく、いずれか2つの信号、ここではR、Gに対して行えれば十分である。     The multiplication means 15 multiplies the image signals of the effective pixels S1a and S1b by a predetermined coefficient α0 (α1, α2) as shown in the following equation (4) to form a set of image signals corresponding to each coefficient α0. The image signal groups S2a and S2b are obtained, and the image signal group S2a is output to the gray candidate pixel group detection means 20a, and the image signal groups S2a and S2b are output to the skin color candidate pixel group detection means 20b. Note that it is not necessary to perform multiplication on the three signals R, G, and B, and it is sufficient if it can be performed on any two signals, here R and G.


R2a=α1R1a
G2a=α2G1a (4)
R2b=α1R1b
G2b=α2G1b

グレー候補画素群検出手段20aと肌色候補画素群検出手段20bは、夫々画像信号群S2aと、S2aおよびS2bとを用いて各係数に対応するグレー候補画素群と肌色候補画素群とを夫々検出するものである。以下図1を参照して、グレー候補画素群検出手段20aと肌色候補画素群検出手段20bの動作を具体的に説明する。

R2a = α1R1a
G2a = α2G1a (4)
R2b = α1R1b
G2b = α2G1b

The gray candidate pixel group detection unit 20a and the skin color candidate pixel group detection unit 20b detect the gray candidate pixel group and the skin color candidate pixel group corresponding to each coefficient using the image signal group S2a, S2a, and S2b, respectively. Is. Hereinafter, the operations of the gray candidate pixel group detection unit 20a and the skin color candidate pixel group detection unit 20b will be described in detail with reference to FIG.

図1において、Gyはグレーの黒体軌跡曲線である。前述したように、黒体軌跡とは、色温度をT、色温度Tの黒体放射エネルギ分布をP(λ)、被写体の分光反射率分布をρ(λ)、DSCのCCDセンサの分光感度分布をSi(λ)(i=R、G、B)としたとき、次の式(2)で計算されたEiを式(1)により色度座標(r,b)に変換して色度図にプロットしたとき、色温度Tを動かしたときの軌跡である。黒体軌跡は、CCDセンサの分光分布および被写体の色ごとに存在し、グレーの黒体軌跡は、被写体をグレーとしたときの被写体の分光反射率ρ(λ)1として得られる。なお、CCDセンサの分光感度分布Si(λ)は、カラー画像S0を撮影したDSCのCCDセンサ固有のものを用いることが好ましいが、図5に示すようなBT709準拠の理想分光感度分布を用いてもよい。   In FIG. 1, Gy is a gray black body locus curve. As described above, the black body locus means that the color temperature is T, the black body radiant energy distribution at the color temperature T is P (λ), the spectral reflectance distribution of the subject is ρ (λ), and the spectral sensitivity of the DSC CCD sensor. When the distribution is Si (λ) (i = R, G, B), Ei calculated by the following equation (2) is converted into chromaticity coordinates (r, b) by equation (1), and chromaticity is obtained. It is a locus when the color temperature T is moved when plotted in the figure. A black body locus exists for each spectral distribution of the CCD sensor and the color of the subject, and a gray black body locus is obtained as the spectral reflectance ρ (λ) 1 of the subject when the subject is gray. The spectral sensitivity distribution Si (λ) of the CCD sensor is preferably unique to the DSC CCD sensor that captured the color image S0. However, the ideal spectral sensitivity distribution conforming to BT709 as shown in FIG. 5 is used. Also good.


r=R/(R+G+B)
b=B/(R+G+B) (1)


Ei=∫P(λ)ρ(λ)Si(λ)dλ (2)

また、肌色の黒体軌跡曲線は、グレーの黒体軌跡曲線Gyと同じ方法で、肌色に対して得たものであり、ここで図示を省略する。

r = R / (R + G + B)
b = B / (R + G + B) (1)


Ei = ∫P (λ) ρ (λ) Si (λ) dλ (2)

The skin color black body locus curve is obtained for the skin color in the same manner as the gray black body locus curve Gy, and is not shown here.

グレー候補画素群検出手段20aは、乗算手段15により得られた画像信号群S2aに対して、まず、式(1)に従って、(R、G、B)信号を色度座標(r,b)に変換すると共に、図1に示す色度図にプロットする。そして次に、グレー候補画素群検出手段20aは、画像信号群S2aの各信号をグレーの黒体軌跡曲線Gyと比較して、グレーの黒体軌跡曲線Gyの近傍の信号を有する画素(ここでは、黒体軌跡曲線Gy上の点と比較して、色度座標rの差が0.03以下の信号の画素)をグレー候補画素として検出する。このように、グレー候補画素群検出手段20aは、各係数α0に対してグレー候補画素を検出し、各々の係数α0に対応するグレー候補画素群S3aを検出する。   For the image signal group S2a obtained by the multiplication means 15, the gray candidate pixel group detection means 20a first converts the (R, G, B) signal into chromaticity coordinates (r, b) according to the equation (1). The data is converted and plotted on the chromaticity diagram shown in FIG. Next, the gray candidate pixel group detection means 20a compares each signal of the image signal group S2a with the gray black body locus curve Gy, and has a pixel having a signal in the vicinity of the gray black body locus curve Gy (here, Compared with a point on the blackbody locus curve Gy, a pixel having a signal having a chromaticity coordinate r difference of 0.03 or less is detected as a gray candidate pixel. As described above, the gray candidate pixel group detection unit 20a detects gray candidate pixels for each coefficient α0, and detects a gray candidate pixel group S3a corresponding to each coefficient α0.

肌色候補画素群検出手段20bは、画像信号S2a、S2bを用いて各係数α0に対応する肌色候補画素群S3bを検出するものであり、黒体軌跡曲線として、グレーの黒体軌跡曲線Gyの代わりに肌色の黒体軌跡曲線を用いる点を除けば、グレー候補画素群検出手段20aと略同様に動作するので、ここでその詳細な説明を省略する。   The skin color candidate pixel group detection means 20b detects the skin color candidate pixel group S3b corresponding to each coefficient α0 using the image signals S2a and S2b, and instead of the gray black body locus curve Gy as the black body locus curve. Except for the point of using a skin-colored black body locus curve, the operation is substantially the same as that of the gray candidate pixel group detection unit 20a, and thus detailed description thereof is omitted here.

こうして、グレー候補画素群検出手段20aと肌色候補画素群検出手段20bにより、各々の係数α0(α1,α2)に対応するグレー候補画素群S3aとS3bが夫々検出される。   In this way, gray candidate pixel groups S3a and S3b corresponding to the respective coefficients α0 (α1, α2) are detected by the gray candidate pixel group detection unit 20a and the skin color candidate pixel group detection unit 20b, respectively.

画素数算出手段30aは、各グレー候補画素群S3aの画素数Maおよび各肌色候補画素群S3bの画素数Mbを算出するものであり、平均色温度算出手段30bは、各グレー候補画素群S3aの平均色温度Taおよび各肌色候補画素群S3bの平均色温度Tbを算出するものである。まず、画素数算出手段30aの動作を説明する。   The pixel number calculating unit 30a calculates the pixel number Ma of each gray candidate pixel group S3a and the pixel number Mb of each skin color candidate pixel group S3b. The average color temperature calculating unit 30b includes the gray candidate pixel group S3a. The average color temperature Ta and the average color temperature Tb of each skin color candidate pixel group S3b are calculated. First, the operation of the pixel number calculation means 30a will be described.

画素数算出手段30aは、グレー候補画素群S3aの各画素のカウント数に対して、図1に示すグレーの黒体軌跡曲線Gyに近い画素ほど、そのカウント数の重みが高くなる重み付け係数で重み付け加算して得た和を当該グレー候補画素群S3aの画素数Maとする。図6は、本実施形態における画素数算出手段30aが用いた重み付け係数(図示実線)を示している。図示のように、同じグレー候補画素群に含まれる画素でも、グレーの黒体軌跡曲線Gy上の画素(黒体軌跡曲線Gyとの距離がゼロである)の場合、そのカウント数に対する重み付け係数が1であり、すなわち、1つの画素が画素群の画素数に対して1を貢献する一方、グレーの黒体軌跡曲線Gyとの距離が0.02である画素の場合、そのカウント数に対する重み付け係数が0.05であり、すなわち、1つの画素が画素群の画素数に0.05しか貢献しない。なお、図示点線は、特許文献1提案の方法において候補画素群の画素数を算出する際に用いる重み付け係数を示している。図示のように、特許文献1提案の方法では、グレー候補画素群の画素数を算出する際に、グレー候補画素群の全ての画素に対して、重み付け係数として1を用い、すなわち、グレーの黒体軌跡曲線との遠近(真のグレーである確率の高低)に関係なく、1つの候補画素は画素数1を貢献することになっている。   The pixel number calculation means 30a weights the count number of each pixel of the gray candidate pixel group S3a with a weighting coefficient that increases the weight of the count number as the pixel is closer to the gray black body locus curve Gy shown in FIG. The sum obtained by the addition is set as the pixel number Ma of the gray candidate pixel group S3a. FIG. 6 shows the weighting coefficient (shown by a solid line) used by the pixel number calculation means 30a in the present embodiment. As shown in the figure, even if the pixels are included in the same gray candidate pixel group, if the pixel is on the gray black body locus curve Gy (the distance from the black body locus curve Gy is zero), the weighting coefficient for the count number is 1. In other words, when one pixel contributes 1 to the number of pixels in the pixel group, and the distance from the black body locus curve Gy is 0.02, the weighting coefficient for the count number Is 0.05, that is, one pixel contributes only 0.05 to the number of pixels in the pixel group. The dotted line in the figure indicates the weighting coefficient used when calculating the number of pixels of the candidate pixel group in the method proposed in Patent Document 1. As illustrated, in the method proposed in Patent Document 1, when calculating the number of pixels of the gray candidate pixel group, 1 is used as the weighting coefficient for all the pixels of the gray candidate pixel group, that is, the gray black One candidate pixel is supposed to contribute 1 pixel regardless of the distance from the body locus curve (the probability of being true gray).

同様に、画素数算出手段30aは、肌色候補画素群S3bの各画素のカウント数に対して、図示しない肌色の黒体軌跡曲線に近い画素ほど、そのカウント数の重みが高くなる重み付け係数で重み付け加算して得た和を当該肌色候補画素群S3bの画素数Mbとする。ここで、画素数算出手段30aは、グレー候補画素群S3aの画素数を算出する際と同じように、図6に示す重み付け係数を用いて肌色候補画素群S3bの画素数Mbを算出する。   Similarly, the pixel number calculation means 30a weights the count number of each pixel of the skin color candidate pixel group S3b with a weighting coefficient that gives a higher weight to the count number of pixels closer to a skin color black body locus curve (not shown). The sum obtained by the addition is set as the number of pixels Mb of the skin color candidate pixel group S3b. Here, the pixel number calculation means 30a calculates the pixel number Mb of the flesh color candidate pixel group S3b using the weighting coefficient shown in FIG. 6 in the same manner as when calculating the pixel number of the gray candidate pixel group S3a.

平均色温度算出手段30bは、グレー候補画素群S3aの各画素(例えば図1に示すA部分)に対して、グレーの黒体軌跡曲線Gyに近い画素ほど、その色温度の重みが高くなるように各々のグレー候補画素の色温度を重み付け平均演算して得た値を当該グレー候補画素群S3aの平均色温度Taとすると共に、肌色候補画素群S3bの各画素に対して、肌色の黒体軌跡曲線に近い画素ほど、その色温度の重みが高くなるように各々の肌色候補画素の色温度を重み付け平均演算して得た値を当該肌色候補画素群S3bの平均色温度Tbとする。なお、ここで、例として、平均色温度算出手段30bは、色温度の重み付け係数として、画素数算出手段30aが用いた、図6に示す重み付け係数を用いて各候補画素群の平均色温度TaおよびTbを算出する。   The average color temperature calculation unit 30b makes the weight of the color temperature higher for each pixel of the gray candidate pixel group S3a (for example, A portion shown in FIG. 1) as the pixel is closer to the gray black body locus curve Gy. A value obtained by performing a weighted average operation on the color temperature of each gray candidate pixel is set as the average color temperature Ta of the gray candidate pixel group S3a, and a skin-colored black body is applied to each pixel of the skin color candidate pixel group S3b. A value obtained by performing a weighted average calculation of the color temperature of each skin color candidate pixel so that the weight of the color temperature is higher for a pixel closer to the locus curve is defined as the average color temperature Tb of the skin color candidate pixel group S3b. Here, as an example, the average color temperature calculation unit 30b uses the weighting coefficient shown in FIG. 6 used by the pixel number calculation unit 30a as the color temperature weighting coefficient, and the average color temperature Ta of each candidate pixel group. And Tb are calculated.

画素数算出手段30aにより算出された各グレー候補画素群S3aの画素数Maおよび肌色候補画素群S3bの画素数Mbと、平均色温度算出手段30bにより算出された各グレー候補画素群S3aの平均色温度Taおよび肌色候補画素群S3bの平均色温度Tbとは、最適係数取得手段40に出力される。最適係数取得手段40は、「グレー候補画素群と肌色候補画素群との画素数の和が最も大きい」、かつ「グレー候補画素群の平均色温度と肌色画素群の平均色温度との差が最も小さい」ことを目的関数として係数α0の最適化をして最適係数α(α1,α2)を得て、補正手段60および光源色温度取得手段50に出力する。ここで、最適係数αは、図1に示すベクトルαに相当する。   The pixel number Ma of each gray candidate pixel group S3a calculated by the pixel number calculation unit 30a and the pixel number Mb of the skin color candidate pixel group S3b, and the average color of each gray candidate pixel group S3a calculated by the average color temperature calculation unit 30b The temperature Ta and the average color temperature Tb of the skin color candidate pixel group S3b are output to the optimum coefficient acquisition unit 40. The optimum coefficient acquisition means 40 determines that “the sum of the number of pixels of the gray candidate pixel group and the skin color candidate pixel group is the largest” and “the difference between the average color temperature of the gray candidate pixel group and the average color temperature of the skin color pixel group is The coefficient α0 is optimized by using “smallest” as an objective function to obtain the optimum coefficient α (α1, α2), which is output to the correction means 60 and the light source color temperature acquisition means 50. Here, the optimum coefficient α corresponds to the vector α shown in FIG.

光源色温度取得手段50は、最適係数α(α1,α2)に対応するグレー候補画素群および肌色候補画素群の各々の画素の色温度から撮影光源の色温度を推定するものであり、ここでは、最適係数αに対応するグレー候補画素群の平均色温度T1aと最適係数αに対応する肌色候補画素群の平均色温度T1bとをさらに平均して得た値を撮影光源の色温度Tを求めるものである。なお、最適係数αに対応するグレー候補画素群(グレー画素群)および最適係数αに対応する肌色候補画素群(肌色画素群)の夫々の平均色温度T1a、T1bを新たに求めてもよいが、ここでは、光源色温度取得手段は、平均色温度算出手段30bにより算出された平均色温度から、最適係数αに対応する候補画素群の平均色温度T1a、T1bを取得して、それらの平均値を光源の色温度Tとして算出する。なお、T1aとT1bを平均する際に、下記の式(5)のように単純平均して得た値を撮影光源の色温度Tとしてもよいし、グレーの色を重視する場合はT1aを光源の色温度Tとしてもよい。さらに、グレーと肌色を夫々重視する程度に応じて、T1aとT1bとを重み付け平均演算して得た値を光源の色温度Tとしてもよい。   The light source color temperature acquisition means 50 estimates the color temperature of the photographing light source from the color temperatures of the gray candidate pixel group and the skin color candidate pixel group corresponding to the optimum coefficient α (α1, α2). The color temperature T of the photographing light source is obtained by further averaging the average color temperature T1a of the gray candidate pixel group corresponding to the optimum coefficient α and the average color temperature T1b of the skin color candidate pixel group corresponding to the optimum coefficient α. Is. The average color temperatures T1a and T1b of the gray candidate pixel group (gray pixel group) corresponding to the optimum coefficient α and the skin color candidate pixel group (skin color pixel group) corresponding to the optimum coefficient α may be newly obtained. Here, the light source color temperature acquisition unit acquires the average color temperatures T1a and T1b of the candidate pixel group corresponding to the optimum coefficient α from the average color temperature calculated by the average color temperature calculation unit 30b, and averages them. The value is calculated as the color temperature T of the light source. When averaging T1a and T1b, a value obtained by simple averaging as shown in the following equation (5) may be used as the color temperature T of the photographic light source. When gray color is important, T1a is used as the light source. The color temperature T may be set as follows. Furthermore, the color temperature T of the light source may be a value obtained by performing a weighted average operation on T1a and T1b according to the degree of emphasis on gray and skin color.


T=(T1a+T1b)/2 (5)
但し、T:撮影光源の色温度
T1a:グレー画素の平均色温度
T1b:肌色画素の平均色温度

補正手段60は、まず、光源色温度取得手段50により取得された色温度Tを基準白色(例えば5500K)へ変換する変換、すなわち、図1に示すベクトルβ(β1、β2)を求める。

T = (T1a + T1b) / 2 (5)
Where T: color temperature of the photographic light source
T1a: Average color temperature of gray pixels
T1b: Average color temperature of skin color pixels

First, the correcting unit 60 obtains a conversion for converting the color temperature T acquired by the light source color temperature acquiring unit 50 into a reference white color (for example, 5500 K), that is, a vector β (β1, β2) shown in FIG.

最適係数、すなわち図1に示すベクトルα(α1,α2)およびベクトルβ(β1,β2)を用いて、下記の式(6)に従って、カラー画像S0(R0,G0,B0)に対して補正処理を施して補正済み画像S4(R4,G4,B4)を得ることができる。   Using the optimum coefficients, that is, the vector α (α1, α2) and the vector β (β1, β2) shown in FIG. 1, correction processing is performed on the color image S0 (R0, G0, B0) according to the following equation (6). The corrected image S4 (R4, G4, B4) can be obtained.


R4=α1β1R0
G4=α2G0 (6)
B4=β2B0
但し,
R4,G4,B4:補正済み画像S4の画素値
R0,G0,B0:カラー画像S0の画素値
(α1,α2): 最適係数α

また、式(6)に示す変換は、カラーバランスだけではなく、明るさの変化を含むので、G信号を不変として表現すれば、次の式(7)になる。

R4 = α1β1R0
G4 = α2G0 (6)
B4 = β2B0
However,
R4, G4, B4: Pixel value of the corrected image S4 R0, G0, B0: Pixel value of the color image S0 (α1, α2): Optimal coefficient α

Further, since the conversion shown in the equation (6) includes not only the color balance but also the change in brightness, if the G signal is expressed as invariant, the following equation (7) is obtained.


R4=(α1β1/α2)R0
G4=G0 (7)
B4=(β2/α2)B0
但し,
R4,G4,B4:補正済み画像S4の画素値
R0,G0,B0:カラー画像S0の画素値
(α1,α2):最適係数α

補正手段60は、カラー画像S0の全ての画素の画像信号に対して式(7)に示す変換を行い、補正済み画像S4を得る。

R4 = (α1β1 / α2) R0
G4 = G0 (7)
B4 = (β2 / α2) B0
However,
R4, G4, B4: pixel values of the corrected image S4
R0, G0, B0: Pixel value of the color image S0
(Α1, α2): Optimal coefficient α

The correcting unit 60 performs the conversion shown in Expression (7) on the image signals of all the pixels of the color image S0, and obtains a corrected image S4.

図1に示す実施形態の画像処理装置Aにおいて、候補画素群(グレー候補画素群または肌色候補画素群)の画素数を求めて、この画素数に基づいて最適係数、すなわちベクトルαを求める際に、黒体軌跡曲線に近い候補画素ほど、真のグレー画素または真の肌色画素になる確率が高いことに着目し、黒体軌跡曲線との距離に応じて各画素のカウント数を重み付け加算して得た値を候補画素群の画素数とするようにしてベクトルαを求めるようにしているので、ベクトルαに基づいて算出された撮影光源の色温度の精度を上げることができ、より良いホワイトバランス補正の効果を図ることができる。   In the image processing apparatus A of the embodiment shown in FIG. 1, when the number of pixels of a candidate pixel group (gray candidate pixel group or skin color candidate pixel group) is obtained, and the optimum coefficient, that is, the vector α is obtained based on the number of pixels. Focusing on the fact that candidate pixels closer to the black body locus curve have a higher probability of becoming true gray pixels or true skin color pixels, weighting and adding the count number of each pixel according to the distance from the black body locus curve Since the vector α is obtained by using the obtained value as the number of pixels of the candidate pixel group, the accuracy of the color temperature of the photographing light source calculated based on the vector α can be improved, and the white balance is improved. The effect of correction can be achieved.

図7は、本発明のホワイトバランス補正方法および装置並びにプログラムの実施形態となる画像処理装置Bの構成を示すブロック図である。なお、本実施形態の画像処理装置Bは、後述する画素数算出手段30’aが図1に示す画像処理装置Aの画素数算出手段30aと異なる動作をする点を除けば、画像処理装置Aと同様な構成を有するものであるので、画像処理装置Aの相対応する構成と同様な動作をする構成については、同じ符号を付与すると共に、画像処理装置Bの画素数算出手段30’aの動作のみについて説明する。   FIG. 7 is a block diagram showing a configuration of an image processing apparatus B as an embodiment of the white balance correction method and apparatus and program of the present invention. It should be noted that the image processing apparatus B of the present embodiment is similar to the image processing apparatus A except that a pixel number calculating unit 30′a described later operates differently from the pixel number calculating unit 30a of the image processing apparatus A shown in FIG. Therefore, the same reference numerals are given to configurations that perform the same operations as the corresponding configurations of the image processing apparatus A, and the pixel number calculation unit 30′a of the image processing apparatus B has the same configuration. Only the operation will be described.

図7に示すように、本実施形態の画像処理装置Bは、デジタルスチールカメラ(DSC)により取得したカラー画像S0(R0,G0,B0)から、有効な画素を抽出するための第1の有効画素抽出手段10aおよび第2の有効画素抽出手段10bと、有効画素抽出手段10aおよび10bにより抽出された有効な画素の画像信号S1aとs1bに対して所定の係数を乗算して各係数に対応する画像信号の集合となる画像信号群S2aおよびS2bを得る乗算手段15と、乗算手段15により得られた画像信号群S2aを用いて各係数に対応するグレー候補画素群S3aを検出するグレー候補画素群検出手段20aと、乗算手段15により得られた画像信号群S2aおよびS2bを用いて各係数に対応する肌色候補画素群S3bを検出する肌色候補画素群検出手段20bと、各々のグレー候補画素群S3aの夫々の画素数M’aおよび各々の肌色候補画素群S3bの夫々の画素数M’bを求める画素数算出手段30’aと、各々のグレー候補画素群S3aの夫々の平均色温度Taおよび各々の肌色候補画素群S3bの夫々の平均色温度Tbを求める平均色温度算出手段30bと、グレー候補画素群の画素数と肌色候補画素群の画素数との和が最も大きい、かつグレー候補画素群の平均色温度と肌色候補画素群の平均色温度との差が最も小さい係数を最適係数α’として取得する最適係数取得手段40と、最適係数取得手段40により取得された最適係数α’に対応するグレー候補画素群S3aと肌色候補画素群S3bに含まれる各々の画素の色温度から撮影光源の色温度T’を求める光源色温度取得手段50と、最適係数取得手段40により求められた最適係数α’および光源色温度取得手段50により取得された撮影光源の色温度を用いてカラー画像S0の全ての画素の画像信号に対して補正を行って補正済み画像S4(R4,G4,B4)を得る補正手段60とを有してなる。   As shown in FIG. 7, the image processing apparatus B according to the present embodiment has a first effective for extracting effective pixels from a color image S0 (R0, G0, B0) acquired by a digital still camera (DSC). The pixel extraction means 10a, the second effective pixel extraction means 10b, and the effective pixel image signals S1a and s1b extracted by the effective pixel extraction means 10a and 10b are multiplied by predetermined coefficients to correspond to the respective coefficients. Multiplication means 15 for obtaining image signal groups S2a and S2b as a set of image signals, and gray candidate pixel group for detecting gray candidate pixel group S3a corresponding to each coefficient using image signal group S2a obtained by multiplication means 15 Skin for detecting a skin color candidate pixel group S3b corresponding to each coefficient using the detection means 20a and the image signal groups S2a and S2b obtained by the multiplication means 15 A candidate pixel group detection unit 20b, a pixel number calculation unit 30'a for obtaining a pixel number M'a of each gray candidate pixel group S3a and a pixel number M'b of each skin color candidate pixel group S3b; Average color temperature calculation means 30b for determining the average color temperature Ta of each gray candidate pixel group S3a and the average color temperature Tb of each skin color candidate pixel group S3b, the number of pixels of the gray candidate pixel group and the skin color candidate pixels An optimum coefficient acquisition means 40 for acquiring, as an optimum coefficient α ′, a coefficient having the largest sum of the number of pixels of the group and the smallest difference between the average color temperature of the gray candidate pixel group and the average color temperature of the skin color candidate pixel group; The color temperature T ′ of the photographing light source is obtained from the color temperature of each pixel included in the gray candidate pixel group S3a and the skin color candidate pixel group S3b corresponding to the optimal coefficient α ′ acquired by the optimal coefficient acquisition unit 40. Using the source color temperature acquisition means 50, the optimum coefficient α ′ obtained by the optimum coefficient acquisition means 40, and the color temperature of the photographic light source obtained by the light source color temperature acquisition means 50, image signals of all pixels of the color image S0. And a correcting means 60 for correcting the image to obtain a corrected image S4 (R4, G4, B4).

ここで、画素数算出手段30’aの動作についてのみを説明する。   Here, only the operation of the pixel number calculating means 30'a will be described.

画素数算出手段30’aは、各グレー候補画素群S3aの画素数M’aおよび各肌色候補画素群S3bの画素数M’bを算出するものであり、まず、図2を参照して、画素数算出手段30’aによるグレー候補画素群S3aの画素数M’aの算出を説明する。   The pixel number calculation means 30′a calculates the pixel number M′a of each gray candidate pixel group S3a and the pixel number M′b of each skin color candidate pixel group S3b. First, referring to FIG. The calculation of the pixel number M′a of the gray candidate pixel group S3a by the pixel number calculation unit 30′a will be described.

前述したように、図2(b)は、図2(a)に示す統計的な傾向を反映した補正係数の例を示している。図示のように、この補正係数は、「割合が大きいほど大きくなる補正係数」であり、かつ図2(a)に示す傾向を反映し、グレー候補画素群に含まれるグレー候補画素の個数が全画素の個数に占める割合に応じて、該割合が大きいほど大きくなり、かつ該割合が大きいほど増加率が小さくなるものである。図7に示す画像処理装置Bの画素数算出手段30’aは、図2(b)に示す補正係数でグレー候補画素群S3a毎にそのグレー候補画素の個数を補正して得た値を当該グレー候補画素群の画素数M’aとする。   As described above, FIG. 2B shows an example of the correction coefficient that reflects the statistical tendency shown in FIG. As shown in the figure, this correction coefficient is a “correction coefficient that increases as the ratio increases”, and reflects the tendency shown in FIG. 2A, so that the number of gray candidate pixels included in the gray candidate pixel group is all. Depending on the ratio of the number of pixels, the larger the ratio, the larger the ratio, and the larger the ratio, the smaller the increase rate. The pixel number calculation means 30′a of the image processing apparatus B shown in FIG. 7 calculates the value obtained by correcting the number of gray candidate pixels for each gray candidate pixel group S3a with the correction coefficient shown in FIG. It is assumed that the pixel number M′a of the gray candidate pixel group.

次に図3を参照して、画素数算出手段30’aによる肌色候補画素群S3bの画素数M’bの算出を説明する。   Next, the calculation of the pixel number M′b of the flesh color candidate pixel group S3b by the pixel number calculation unit 30′a will be described with reference to FIG.

前述したように、図3(b)は、図3(a)に示す統計的な傾向を反映した補正係数の例を示している。図示のように、この補正係数は、「割合が大きいほど大きくなる補正係数」であり、かつ図3(a)に示す傾向を反映し、肌色候補画素群に含まれる肌色候補画素の個数が全画素の個数に占める割合に応じて、所定の値(存在頻度がゼロとなる割合の値)の割合まで該割合が大きいほど大きくなり、かつ該割合が大きいほど増加率が小さくなる一方、前記所定の値以降は該割合が大きいほど小さくなるものである。本実施形態の画像処理装置Bの画素数算出手段30’bは、図3(b)に示す補正係数で肌色候補画素群S3b毎にその肌色候補画素の個数を補正して得た値を当該肌色候補画素群の画素数M’bとする。   As described above, FIG. 3B shows an example of the correction coefficient that reflects the statistical tendency shown in FIG. As shown in the figure, this correction coefficient is “a correction coefficient that increases as the ratio increases”, and reflects the tendency shown in FIG. 3A, and the number of skin color candidate pixels included in the skin color candidate pixel group is all. Depending on the ratio of the number of pixels, the larger the ratio is, the larger the ratio is, and the larger the ratio is, the smaller the increase rate is. After this value, the larger the ratio, the smaller. The number-of-pixels calculation unit 30′b of the image processing apparatus B of the present embodiment calculates the value obtained by correcting the number of skin color candidate pixels for each skin color candidate pixel group S3b with the correction coefficient shown in FIG. The number of pixels M′b of the skin color candidate pixel group is assumed.

画像処理装置Bの最適係数取得手段40は、画素数算出手段30’aにより得られたグレー候補画素群の画素数M’aおよび肌色候補画素群の画素数M’bと、平均色温度算出手段30bにより得られたグレー候補画素群の平均色温度Taおよび肌色候補画素群の平均色温度Tbとを用いて最適係数α’を得、光源色温度取得手段50は、最適係数α’に対応するグレー候補画素群と肌色候補画素群の夫々の平均色温度T1’aとT1’bをさらに平均して得た値を撮影光源の色温度T’として算出し、補正手段60は、光源色温度取得手段50により取得した撮影光源の色温度T’に基づいて得た図1に示すベクトルβに相当するベクトルβ’と、最適係数取得手段40により取得した最適係数α’とを用いて、カラー画像S0に対して補正処理を行って補正済み画像S4を得る。   The optimum coefficient acquisition unit 40 of the image processing apparatus B calculates the average color temperature and the pixel number M′a of the gray candidate pixel group and the pixel number M′b of the skin color candidate pixel group obtained by the pixel number calculation unit 30′a. The optimum coefficient α ′ is obtained using the average color temperature Ta of the gray candidate pixel group and the average color temperature Tb of the skin color candidate pixel group obtained by the means 30b, and the light source color temperature acquisition means 50 corresponds to the optimum coefficient α ′. A value obtained by further averaging the average color temperatures T1′a and T1′b of the gray candidate pixel group and the skin color candidate pixel group to be calculated is calculated as the color temperature T ′ of the photographic light source. Using the vector β ′ corresponding to the vector β shown in FIG. 1 obtained based on the color temperature T ′ of the imaging light source acquired by the temperature acquisition unit 50 and the optimum coefficient α ′ acquired by the optimum coefficient acquisition unit 40, Correction processing for color image S0 Then, a corrected image S4 is obtained.

このように、本実施形態の画像処理装置Bは、候補画素群(グレー候補画素群または肌色候補画素群)の画素数を求めて、この画素数に基づいて最適係数、すなわちベクトルα’を求める際に、画像処理装置Aと異なる視点から、候補画素群に含まれる候補画素の個数がカラー画像の全画素の個数に占める割合に応じて、統計的に求められた傾向に応じた補正係数(グレーと肌色夫々に対応した図2(b)と図3(b)に示す補正係数)で候補画素のカウント数を単純加算して得た和を補正して得た値を候補画素群の画素数にしているので、候補画素群の画素数に基づいて得た最適係数およびこの最適係数に対応する候補画素群から、撮影光源の色温度をより精度良く求めることができ、より良いホワイトバランス補正の効果を得ることができる。   As described above, the image processing apparatus B according to the present embodiment obtains the number of pixels of the candidate pixel group (gray candidate pixel group or skin color candidate pixel group), and obtains the optimum coefficient, that is, the vector α ′ based on the number of pixels. At this time, from a viewpoint different from that of the image processing apparatus A, a correction coefficient according to a statistically determined tendency according to the ratio of the number of candidate pixels included in the candidate pixel group to the total number of pixels of the color image ( The values obtained by correcting the sum obtained by simply adding the count numbers of the candidate pixels with the correction coefficients shown in FIGS. 2B and 3B corresponding to gray and skin color, respectively, are the pixels of the candidate pixel group. Therefore, the color temperature of the photographic light source can be obtained more accurately from the optimum coefficient obtained based on the number of pixels in the candidate pixel group and the candidate pixel group corresponding to the optimum coefficient, and a better white balance correction can be obtained. Can get the effect of That.

以上、本発明の望ましい実施形態について説明したが、本発明のホワイトバランス補正方法および装置並びにそのためのプログラムは、上述した実施形態に限られることがなく、本発明の主旨を逸脱しない限り、様々な増減、変化を加えることができる。   The preferred embodiment of the present invention has been described above. However, the white balance correction method and apparatus of the present invention and the program therefor are not limited to the above-described embodiment, and various methods can be used without departing from the gist of the present invention. Increase, decrease, change can be added.

例えば、図1に示す実施形態の画像処理装置Aおよび図7に示す画像処理装置Bにおいて、カラー画像S0の全ての画素から有効な画素を抽出し、これらの有効な画素を用いて、候補画素群の検出、最適係数α(α’)と撮影光源の色温度の算出などを行っているが、カラー画像S0に対して縮小処理を得た画像に対して上述の処理、すなわち、有効な画素の抽出から、最適係数と撮影光源の色温度の算出までの処理を行うようにして演算量を減らし、処理のスピードアップを図ってもよい。なお、この場合、縮小処理として間引き縮小処理を用いれば演算の精度を高めることができるが、例えばDSCにより連続撮影して得た一連の画像のような類似シーン間のホワイトバランス補正効果のバラツキを減らす視点から、縮小処理としては、間引き縮小処理よりも平均縮小処理を用いることが望ましい。   For example, in the image processing apparatus A of the embodiment shown in FIG. 1 and the image processing apparatus B shown in FIG. 7, effective pixels are extracted from all the pixels of the color image S0, and these effective pixels are used as candidate pixels. The group detection, the optimum coefficient α (α ′) and the color temperature of the photographing light source are calculated, but the above-described processing is performed on the image obtained by reducing the color image S0, that is, the effective pixel. It is possible to reduce the amount of calculation by performing processing from extraction of the above to calculation of the optimum coefficient and the color temperature of the photographing light source, thereby speeding up the processing. In this case, if the thinning reduction process is used as the reduction process, the accuracy of the calculation can be improved. However, for example, the variation in the white balance correction effect between similar scenes such as a series of images obtained by continuous shooting by DSC can be reduced. From the viewpoint of reducing, it is desirable to use the average reduction process as the reduction process rather than the thinning reduction process.

また、図1に示す実施形態の画像処理装置Aおよび図7に示す画像処理装置Bは、演算の精度および速度の向上のため、カラー画像S0から有効な画素を抽出して、これらの有効な画素を用いて最適係数および光源の色温度の算出を行っているが、カラー画像S0の全ての画素を用いて上述した処理を行うようにしてもよい。   Further, the image processing apparatus A according to the embodiment shown in FIG. 1 and the image processing apparatus B shown in FIG. 7 extract effective pixels from the color image S0 in order to improve calculation accuracy and speed, Although calculation of the optimum coefficient and the color temperature of the light source is performed using pixels, the above-described processing may be performed using all pixels of the color image S0.

また、図1に示す実施形態の画像処理装置Aおよび図7に示す画像処理装置Bは、グレーと肌色との両方を用いているが、グレーと肌色のいずれか一方の色のみを用いるようにしてもよい。   Further, the image processing apparatus A of the embodiment shown in FIG. 1 and the image processing apparatus B shown in FIG. 7 use both gray and skin color, but use only one of gray and skin color. May be.

また、図1に示す実施形態の画像処理装置Aおよび図7に示す画像処理装置Bは、候補画素群の画素数および候補画素群の平均色温度の両方を用いて最適係数を求めるようにしているが、画素数と平均色温度のいずれか一方のみを用いて最適係数を求めるようにしてもよい。   Further, the image processing apparatus A according to the embodiment shown in FIG. 1 and the image processing apparatus B shown in FIG. 7 obtain the optimum coefficient by using both the number of pixels of the candidate pixel group and the average color temperature of the candidate pixel group. However, the optimum coefficient may be obtained using only one of the number of pixels and the average color temperature.

また、本発明のホワイトバランス補正方法および装置並びにプログラムは、DSCにより取得されたカラー画像に限らず、従来のネガカラーフィルムにより取得した写真画像をスキャナーなどの読取装置で読み取って得たカラー画像にも適用することができる。   The white balance correction method, apparatus, and program of the present invention are not limited to color images acquired by DSC, but are also applied to color images obtained by reading a photographic image acquired by a conventional negative color film with a reading device such as a scanner. Can be applied.

本発明のホワイトバランス方法および装置並びにプログラムの原理を説明するための色度図Chromaticity diagram for explaining the principle of the white balance method and apparatus and program of the present invention サンプルカラー画像の存在頻度とサンプルカラー画像中のグレー画素が全画素に占める割合との関係を統計的に求められた傾向を示す図The figure which shows the tendency for which the relation of the existence frequency of a sample color image and the ratio which the gray pixel in a sample color image accounts to all the pixels was calculated statistically 図2(a)に示す傾向を反映したグレー候補画素の個数に対する補正係数Correction coefficient for the number of gray candidate pixels reflecting the tendency shown in FIG. サンプルカラー画像の存在頻度とサンプルカラー画像中の肌色画素が全画素に占める割合との関係を統計的に求められた傾向を示す図The figure which shows the tendency for which the relation of the existence frequency of a sample color image and the ratio which the skin color pixel in a sample color image occupies for all the pixels was calculated statistically 図3(a)に示す傾向を反映した肌色候補画素の個数に対する補正係数Correction coefficient for the number of skin color candidate pixels reflecting the tendency shown in FIG. 本発明の実施形態となる画像処理装置Aの構成を示すブロック図The block diagram which shows the structure of the image processing apparatus A used as embodiment of this invention. BT709準拠のCCDセンサの理想分光感度分布を示す図The figure which shows ideal spectral sensitivity distribution of the CCD sensor of BT709 conformity 図4に示す画像処理装置Aにおける画素数算出手段30aおよび平均色温度算出手段30bの動作を説明するための図The figure for demonstrating operation | movement of the pixel number calculation means 30a and the average color temperature calculation means 30b in the image processing apparatus A shown in FIG. 本発明の実施形態となる画像処理装置Bの構成を示すブロック図The block diagram which shows the structure of the image processing apparatus B used as embodiment of this invention

符号の説明Explanation of symbols

10a 第1の有効画素抽出手段
10b 第2の有効画素抽出手段
15 乗算手段
20a グレー候補画素群検出手段
20b 肌色候補画素群検出手段
30a,30’a 画素数算出手段
30b 平均色温度算出手段
40 最適係数取得手段
50 光源色温度取得手段
60 補正手段
DESCRIPTION OF SYMBOLS 10a 1st effective pixel extraction means 10b 2nd effective pixel extraction means 15 Multiplication means 20a Gray candidate pixel group detection means 20b Skin color candidate pixel group detection means 30a, 30'a Pixel number calculation means 30b Average color temperature calculation means 40 Optimal Coefficient acquisition means 50 Light source color temperature acquisition means 60 Correction means

Claims (26)

カラー画像の各画素の画像信号に対して、所定の係数を乗算し、その結果、グレーの黒体軌跡曲線の近傍に入る画素をグレー候補画素として各前記係数に対応するグレー候補画素群を得、該グレー候補画素群の画素数が最大となる前記係数を最適係数とすると共に、該最適係数に対応する前記グレー候補画素群をグレー画素群とし、該グレー画素群に含まれる各々の画素の色温度から前記カラー画像の撮影光源の色温度を求め、前記最適係数を乗算された前記カラー画像の画像信号を、前記求められた色温度と基準白色の色温度との差分だけ補正するホワイトバランス補正方法において、
前記グレーの黒体軌跡曲線に近い画素ほどカウント数の重みが高くなるように前記グレー候補画像群毎に各々の前記グレー候補画素のカウント数を重み付け加算して得た和、または、
サンプルカラー画像中のグレー画素の個数が当該サンプルカラー画像の全画素の個数に占める割合に対して、多数の前記サンプルカラー画像を用いて統計的に求められた各々の前記割合毎のサンプルカラー画像の存在頻度に応じた補正係数で、前記グレー候補画素群に含まれるグレー候補画素の個数が前記カラー画像の全画素の個数に占める割合に応じて前記グレー候補画素群毎にそのグレー候補画素の個数を補正して得た値、
を当該グレー候補画素群の画素数とすることを特徴とするホワイトバランス補正方法。
The image signal of each pixel of the color image is multiplied by a predetermined coefficient, and as a result, a gray candidate pixel group corresponding to each coefficient is obtained by setting a pixel that enters the vicinity of the gray black body locus curve as a gray candidate pixel. The coefficient that maximizes the number of pixels of the gray candidate pixel group is the optimum coefficient, the gray candidate pixel group corresponding to the optimum coefficient is the gray pixel group, and each pixel included in the gray pixel group A white balance that obtains a color temperature of the photographing light source of the color image from a color temperature and corrects the image signal of the color image multiplied by the optimum coefficient by a difference between the obtained color temperature and a reference white color temperature. In the correction method,
The sum obtained by weighted addition of the count number of each gray candidate pixel for each gray candidate image group so that the weight of the count number is higher for pixels closer to the gray black body locus curve, or
The sample color image for each of the ratios statistically obtained using a number of the sample color images with respect to the ratio of the number of gray pixels in the sample color image to the total number of pixels of the sample color image Correction coefficient according to the presence frequency of the gray candidate pixel group, the gray candidate pixel group for each gray candidate pixel group according to the ratio of the number of gray candidate pixels included in the gray candidate pixel group to the total number of pixels of the color image. The value obtained by correcting the number,
Is the number of pixels in the gray candidate pixel group.
カラー画像の各画素の画像信号に対して、所定の係数を乗算し、その結果、肌色の黒体軌跡曲線の近傍に入る画素を肌色候補画素として各前記係数に対応する肌色候補画素群を得、該肌色候補画素群の画素数が最大となる前記係数を最適係数とすると共に、該最適係数に対応する前記肌色候補画素群を肌色画素群とし、該肌色画素群に含まれる各々の画素の色温度から前記カラー画像の撮影光源の色温度を求め、前記最適係数を乗算された前記カラー画像の画像信号を、前記求められた色温度と基準白色の色温度との差分だけ補正するホワイトバランス補正方法において、
前記肌色の黒体軌跡曲線に近い画素ほどカウント数の重みが高くなるように前記肌色候補画素群毎に各々の前記肌色候補画素のカウント数を重み付け加算して得た和、または、
サンプルカラー画像中の肌色画素の個数が当該サンプルカラー画像の全画素の個数に占める割合に対して、多数の前記サンプルカラー画像を用いて統計的に求められた各々の前記割合毎のサンプルカラー画像の存在頻度に応じた補正係数で、前記肌色候補画素群に含まれる肌色候補画素の個数が前記カラー画像の全画素の個数に占める割合に応じて前記肌色候補画素群毎にその肌色候補画素の個数を補正して得た値、
を当該肌色候補画素群の画素数とすることを特徴とするホワイトバランス補正方法。
The image signal of each pixel of the color image is multiplied by a predetermined coefficient, and as a result, a skin color candidate pixel group corresponding to each coefficient is obtained by setting a pixel that is in the vicinity of the skin color black body locus curve as a skin color candidate pixel. The coefficient that maximizes the number of pixels of the skin color candidate pixel group is the optimum coefficient, and the skin color candidate pixel group corresponding to the optimum coefficient is the skin color pixel group. A white balance that obtains a color temperature of the light source for photographing the color image from the color temperature and corrects an image signal of the color image multiplied by the optimum coefficient by a difference between the obtained color temperature and a color temperature of a reference white In the correction method,
The sum obtained by weighting and adding the count number of each skin color candidate pixel for each skin color candidate pixel group so that the weight of the count number becomes higher as the pixel closer to the skin color black body locus curve, or
The sample color image for each of the ratios statistically obtained using a large number of the sample color images with respect to the ratio of the number of skin color pixels in the sample color image to the total number of pixels of the sample color image The correction coefficient according to the presence frequency of the skin color candidate pixel group is determined for each skin color candidate pixel group according to the ratio of the number of skin color candidate pixels included in the skin color candidate pixel group to the total number of pixels of the color image. The value obtained by correcting the number,
Is the number of pixels of the skin color candidate pixel group.
カラー画像の各画素の画像信号に対して所定の係数を乗算し、その結果、グレーの黒体軌跡曲線の近傍に入る画素をグレー候補画素として各前記係数に対応するグレー候補画素群と、肌色の黒体軌跡曲線の近傍に入る画素を肌色候補画素として各前記係数に対応する肌色候補画素群とを得、前記グレー候補画素群の画素数と、前記肌色候補画素群の画素数との和が最大となる前記係数を最適係数とすると共に、該最適係数に対応する前記グレー候補画素群と肌色候補画素群を夫々グレー画素群と肌色画素群にし、該グレー画素群に含まれる各々の画素の色温度および該肌色画素群に含まれる各々の画素の色温度から前記カラー画像の撮影光源の色温度を求め、前記最適係数が乗算された前記カラー画像の画像信号を、前記求められた色温度と基準白色との差分だけ補正するホワイトバランス補正方法において、
前記グレーの黒体軌跡曲線に近い画素ほどカウント数の重みが高くなるように前記グレー候補画像群毎に各々の前記グレー候補画素のカウント数を重み付け加算して得た和、または、サンプルカラー画像中のグレー画素の個数が当該サンプルカラー画像の全画素の個数に占める割合に対して、多数の前記サンプルカラー画像を用いて統計的に求められた各々の前記割合毎のサンプルカラー画像の存在頻度に応じた補正係数で、前記グレー候補画素群に含まれるグレー候補画素の個数が前記カラー画像の全画素の個数に占める割合に応じて前記グレー候補画素群毎にそのグレー候補画素の個数を補正して得た値、を当該グレー候補画素群の画素数とする工程、および/または、
前記肌色の黒体軌跡曲線に近い画素ほどカウント数の重みが高くなるように前記肌色候補画素群毎に各々の前記肌色候補画素のカウント数を重み付け加算して得た和、または、サンプルカラー画像中の肌色画素の個数が当該サンプルカラー画像の全画素の個数に占める割合に対して、多数の前記サンプルカラー画像を用いて統計的に求められた各々の前記割合毎のサンプルカラー画像の存在頻度に応じた補正係数で、前記肌色候補画素群に含まれる肌色候補画素の個数が前記カラー画像の全画素の個数に占める割合に応じて前記肌色候補画素群毎にその肌色候補画素の個数を補正して得た値、を当該肌色候補画素群の画素数とする工程を有することを特徴とするホワイトバランス補正方法。
The gray candidate pixel group corresponding to each coefficient is determined by multiplying the image signal of each pixel of the color image by a predetermined coefficient and, as a result, a pixel that enters the vicinity of the gray black body locus curve is a gray candidate pixel, and skin color A skin color candidate pixel group corresponding to each coefficient is obtained using a pixel that is in the vicinity of the black body locus curve as a skin color candidate pixel, and the sum of the number of pixels of the gray candidate pixel group and the number of pixels of the skin color candidate pixel group And the gray candidate pixel group and the skin color candidate pixel group corresponding to the optimal coefficient as a gray pixel group and a skin color pixel group, respectively, and each pixel included in the gray pixel group The color temperature of the photographing light source of the color image is obtained from the color temperature of each pixel included in the skin color pixel group, and the image signal of the color image multiplied by the optimum coefficient is used as the obtained color. Temperature and In the white balance correction method for correcting only the difference between the quasi-white,
Sum obtained by weighting and adding the count number of each gray candidate pixel for each gray candidate image group so that the weight of the count number becomes higher as the pixel is closer to the gray black body locus curve, or a sample color image The presence frequency of the sample color image for each of the proportions statistically obtained using a number of the sample color images with respect to the proportion of the number of gray pixels in the total number of pixels of the sample color image. The number of gray candidate pixels included in the gray candidate pixel group is corrected for each gray candidate pixel group according to the ratio of the number of gray candidate pixels included in the gray candidate pixel group to the total number of pixels in the color image. The value obtained as a result, the number of pixels of the gray candidate pixel group, and / or
Sum obtained by weighting and adding the count number of each skin color candidate pixel for each skin color candidate pixel group so that the weight of the count number becomes higher as the pixel closer to the flesh color black body locus curve, or a sample color image The presence frequency of the sample color image for each of the ratios statistically obtained using a number of the sample color images with respect to the ratio of the number of skin color pixels to the total number of pixels of the sample color image The number of flesh color candidate pixels included in the flesh color candidate pixel group is corrected for each flesh color candidate pixel group for each flesh color candidate pixel group according to the ratio of the total number of pixels in the color image. A white balance correction method comprising a step of setting the obtained value as the number of pixels of the skin color candidate pixel group.
カラー画像の各画素の画像信号に対して所定の係数を乗算し、その結果、グレーの黒体軌跡曲線の近傍に入る画素をグレー候補画素として各前記係数に対応するグレー候補画素群と、肌色の黒体軌跡曲線の近傍に入る画素を肌色候補画素として各前記係数に対応する肌色候補画素群とを得、前記グレー候補画素群の平均色温度と前記肌色候補画素群の平均色温度との差が最小となる前記係数を最適係数とすると共に、該最適係数に対応する前記グレー候補画素群と肌色候補画素群を夫々グレー画素群と肌色画素群にし、該グレー画素群に含まれる各々の画素の色温度および該肌色画素群に含まれる各々の画素の色温度から前記カラー画像の撮影光源の色温度を求め、前記最適係数が乗算された前記カラー画像の画像信号を、前記求められた色温度と基準白色との差分だけ補正するホワイトバランス補正方法において、
前記グレーの黒体軌跡曲線に近いグレー候補画素ほどその色温度の重みが高くなるように前記グレー候補画素群に含まれる各々のグレー候補画素の色温度を重み付け平均演算して得た値を該グレー候補画素群の平均色温度とする工程、および/または、
前記肌色の黒体軌跡曲線に近い肌色候補画素ほどその色温度の重みが高くなるように前記肌色候補画素群に含まれる各々の肌色候補画素の色温度を重み付け平均演算して得た値を該肌色候補画素群の平均色温度とする工程を有することを特徴とするホワイトバランス補正方法。
The gray candidate pixel group corresponding to each coefficient is determined by multiplying the image signal of each pixel of the color image by a predetermined coefficient and, as a result, a pixel that enters the vicinity of the gray black body locus curve is a gray candidate pixel, and skin color A skin color candidate pixel group corresponding to each coefficient is obtained as a skin color candidate pixel that is in the vicinity of the black body locus curve, and an average color temperature of the gray candidate pixel group and an average color temperature of the skin color candidate pixel group are obtained. The coefficient having the smallest difference is set as an optimum coefficient, and the gray candidate pixel group and the skin color candidate pixel group corresponding to the optimum coefficient are set as a gray pixel group and a skin color pixel group, respectively. The color temperature of the photographing light source of the color image is obtained from the color temperature of the pixel and the color temperature of each pixel included in the skin color pixel group, and the image signal of the color image multiplied by the optimum coefficient is obtained. color In the white balance correction method for correcting by the difference between the degree and reference white,
A value obtained by performing a weighted average operation on the color temperature of each gray candidate pixel included in the gray candidate pixel group so that the gray candidate pixel closer to the gray black body locus curve has a higher color temperature weight. A step of setting an average color temperature of a gray candidate pixel group, and / or
A value obtained by performing a weighted average operation on the color temperature of each skin color candidate pixel included in the skin color candidate pixel group so that the skin temperature candidate pixel closer to the skin color black body locus curve has a higher color temperature weight. A white balance correction method comprising a step of setting an average color temperature of a skin color candidate pixel group.
カラー画像の各画素の画像信号に対して所定の係数を乗算し、その結果、グレーの黒体軌跡曲線の近傍に入る画素をグレー候補画素として各前記係数に対応するグレー候補画素群と、肌色の黒体軌跡曲線の近傍に入る画素を肌色候補画素として各前記係数に対応する肌色候補画素群とを得、前記グレー候補画素群の画素数と、前記肌色候補画素群の画素数との和が最大となり、かつ前記グレー候補画素群の平均色温度と前記肌色候補画素群の平均色温度との差が最小となる前記係数を最適係数とすると共に、該最適係数に対応する前記グレー候補画素群と肌色候補画素群を夫々グレー画素群と肌色画素群にし、該グレー画素群に含まれる各々の画素の色温度および該肌色画素群に含まれる各々の画素の色温度から前記カラー画像の撮影光源の色温度を求め、前記最適係数が乗算された前記カラー画像の画像信号を、前記求められた色温度と基準白色との差分だけ補正すホワイトバランス補正方法において、
前記グレーの黒体軌跡曲線に近い画素ほどカウント数の重みが高くなるように前記グレー候補画像群毎に各々の前記グレー候補画素のカウント数を重み付け加算して得た和、または、サンプルカラー画像中のグレー画素の個数が当該サンプルカラー画像の全画素の個数に占める割合に対して、多数の前記サンプルカラー画像を用いて統計的に求められた各々の前記割合毎のサンプルカラー画像の存在頻度に応じた補正係数で、前記グレー候補画素群に含まれるグレー候補画素の個数が前記カラー画像の全画素の個数に占める割合に応じて前記グレー候補画素群毎にそのグレー候補画素の個数を補正して得た値、を当該グレー候補画素群の画素数とする工程、および/または、
前記肌色の黒体軌跡曲線に近い画素ほどカウント数の重みが高くなるように前記肌色候補画素群毎に各々の前記肌色候補画素のカウント数を重み付け加算して得た和、または、サンプルカラー画像中の肌色画素の個数が当該サンプルカラー画像の全画素の個数に占める割合に対して、多数の前記サンプルカラー画像を用いて統計的に求められた各々の前記割合毎のサンプルカラー画像の存在頻度に応じた補正係数で、前記肌色候補画素群に含まれる肌色候補画素の個数が前記カラー画像の全画素の個数に占める割合に応じて前記肌色候補画素群毎にその肌色候補画素の個数を補正して得た値、を当該肌色候補画素群の画素数とする工程、および/または、
前記グレーの黒体軌跡曲線に近いグレー候補画素ほどその色温度の重みが高くなるように前記グレー候補画素群に含まれる各々のグレー候補画素の色温度を重み付け平均演算して得た値を該グレー候補画素群の平均色温度とする工程、および/または、
前記肌色の黒体軌跡曲線に近い肌色候補画素ほどその色温度の重みが高くなるように前記肌色候補画素群に含まれる各々の肌色候補画素の色温度を重み付け平均演算して得た値を該肌色候補画素群の平均色温度とする工程を有することを特徴とするホワイトバランス補正方法。
The gray candidate pixel group corresponding to each coefficient is multiplied by a predetermined coefficient for the image signal of each pixel of the color image, and as a result, pixels that enter the vicinity of the gray black body locus curve are gray candidate pixels, and skin color A skin color candidate pixel group corresponding to each coefficient is obtained using a pixel that is in the vicinity of the black body locus curve as a skin color candidate pixel, and the sum of the number of pixels of the gray candidate pixel group and the number of pixels of the skin color candidate pixel group The coefficient that minimizes the difference between the average color temperature of the gray candidate pixel group and the average color temperature of the skin color candidate pixel group is the optimum coefficient, and the gray candidate pixel corresponding to the optimum coefficient The color image is captured from the color temperature of each pixel included in the gray pixel group and the color temperature of each pixel included in the skin color pixel group. Light source Determined temperature, the image signal of the color image the optimum coefficients is multiplied, in the white balance correction method to correct only the difference between the determined color temperature and reference white,
Sum obtained by weighting and adding the count number of each gray candidate pixel for each gray candidate image group so that the weight of the count number becomes higher as the pixel is closer to the gray black body locus curve, or a sample color image The presence frequency of the sample color image for each of the proportions statistically obtained using a number of the sample color images with respect to the proportion of the number of gray pixels in the total number of pixels of the sample color image. The number of gray candidate pixels included in the gray candidate pixel group is corrected for each gray candidate pixel group according to the ratio of the number of gray candidate pixels included in the gray candidate pixel group to the total number of pixels in the color image. The value obtained as a result, the number of pixels of the gray candidate pixel group, and / or
Sum obtained by weighting and adding the count number of each skin color candidate pixel for each skin color candidate pixel group so that the weight of the count number becomes higher as the pixel closer to the flesh color black body locus curve, or a sample color image The presence frequency of the sample color image for each of the ratios statistically obtained using a number of the sample color images with respect to the ratio of the number of skin color pixels to the total number of pixels of the sample color image The number of flesh color candidate pixels included in the flesh color candidate pixel group is corrected for each flesh color candidate pixel group for each flesh color candidate pixel group according to the ratio of the total number of pixels in the color image. And / or a step of setting the obtained value as the number of pixels of the skin color candidate pixel group, and / or
A value obtained by performing a weighted average operation on the color temperature of each gray candidate pixel included in the gray candidate pixel group so that the gray candidate pixel closer to the gray black body locus curve has a higher color temperature weight. A step of setting an average color temperature of a gray candidate pixel group, and / or
A value obtained by performing a weighted average operation on the color temperature of each skin color candidate pixel included in the skin color candidate pixel group so that the skin temperature candidate pixel closer to the skin color black body locus curve has a higher color temperature weight. A white balance correction method comprising a step of setting an average color temperature of a skin color candidate pixel group.
前記カラー画像の各画素のうち、前記候補画素群を得るために有効な画素のみから前記候補画素群を得ることを特徴とする請求項1から5のいずれか1項記載のホワイトバランス補正方法。   6. The white balance correction method according to claim 1, wherein the candidate pixel group is obtained from only pixels effective for obtaining the candidate pixel group among the pixels of the color image. 前記黒体軌跡曲線に近い画素ほどその色温度の重みが高くなるように前記最適係数に対応する前記候補画素群に含まれる各々の画素の色温度を重付平均演算して得た平均色温度を前記撮影光源の色温度として求めることを特徴とする請求項1から6のいずれか1項記載のホワイトバランス補正方法。   Average color temperature obtained by weighted average calculation of the color temperature of each pixel included in the candidate pixel group corresponding to the optimum coefficient so that the closer to the black body locus curve, the higher the color temperature weight. The white balance correction method according to claim 1, wherein the color temperature of the photographing light source is obtained. 前記黒体軌跡曲線の代わりに昼光軌跡曲線を用いることを特徴とする請求項1から7のいずれか1項記載のホワイトバランス補正方法。   8. The white balance correction method according to claim 1, wherein a daylight locus curve is used instead of the black body locus curve. カラー画像の各画素の画像信号に対して、所定の係数を乗算する乗算手段と、
前記乗算の結果、グレーの黒体軌跡曲線の近傍に入る画素をグレー候補画素として各前記係数に対応するグレー候補画素群を得、該グレー候補画素群の画素数を求めるグレー候補画素群画素数取得手段と、
該グレー候補画素群画素数取得手段により取得された画素数が最大となる前記グレー候補画素群に対応する前記係数を最適係数として取得する最適係数取得手段と、
該最適係数取得手段により取得された前記最適係数に対応する前記グレー候補画素群をグレー画素群とし、該グレー画素群に含まれる各々の画素の色温度から前記カラー画像の撮影光源の色温度を求める光源色温度取得手段と、
前記カラー画像の画像信号に対して前記最適係数を乗算すると共に、該乗算がされた前記画像信号を、前記光源色温度取得手段により求められた色温度と基準白色の色温度との差分だけ補正する補正手段とを有してなるホワイトバランス補正装置において、
前記グレー候補画素群画素数取得手段が、前記グレーの黒体軌跡曲線に近い画素ほどカウント数の重みが高くなるように前記グレー候補画像群毎に各々の前記グレー候補画素のカウント数を重み付け加算して得た和、または、
サンプルカラー画像中のグレー画素の個数が当該サンプルカラー画像の全画素の個数に占める割合に対して、多数の前記サンプルカラー画像を用いて統計的に求められた各々の前記割合毎のサンプルカラー画像の存在頻度に応じた補正係数で、前記グレー候補画素群に含まれるグレー候補画素の個数が前記カラー画像の全画素の個数に占める割合に応じて前記グレー候補画素群毎にそのグレー候補画素の個数を補正して得た値、
を当該グレー候補画素群の画素数とすることを特徴とするホワイトバランス補正装置。
Multiplication means for multiplying the image signal of each pixel of the color image by a predetermined coefficient;
As a result of the multiplication, a pixel that falls in the vicinity of a gray black body locus curve is used as a gray candidate pixel to obtain a gray candidate pixel group corresponding to each coefficient, and the number of gray candidate pixel groups for obtaining the number of gray candidate pixel groups Acquisition means;
Optimal coefficient acquisition means for acquiring, as an optimal coefficient, the coefficient corresponding to the gray candidate pixel group having the maximum number of pixels acquired by the gray candidate pixel group pixel number acquisition means;
The gray candidate pixel group corresponding to the optimal coefficient acquired by the optimal coefficient acquisition unit is set as a gray pixel group, and the color temperature of the photographing light source of the color image is determined from the color temperature of each pixel included in the gray pixel group. A light source color temperature acquisition means to be obtained;
The image signal of the color image is multiplied by the optimum coefficient, and the multiplied image signal is corrected by the difference between the color temperature obtained by the light source color temperature acquisition unit and the color temperature of the reference white. And a white balance correction device having correction means for
The gray candidate pixel group pixel number acquisition unit weights and adds the count number of each gray candidate pixel for each gray candidate image group so that the weight closer to the gray black body locus curve is higher in the count number. Or the sum obtained
The sample color image for each of the ratios statistically obtained using a number of the sample color images with respect to the ratio of the number of gray pixels in the sample color image to the total number of pixels of the sample color image Correction coefficient according to the presence frequency of the gray candidate pixel group, the gray candidate pixel group for each gray candidate pixel group according to the ratio of the number of gray candidate pixels included in the gray candidate pixel group to the total number of pixels of the color image. The value obtained by correcting the number,
Is the number of pixels of the gray candidate pixel group.
カラー画像の各画素の画像信号に対して、所定の係数を乗算する乗算手段と、
前記乗算の結果、肌色の黒体軌跡曲線の近傍に入る画素を肌色候補画素として各前記係数に対応する肌色候補画素群を得、該肌色候補画素群の画素数を求める肌色候補画素群画素数取得手段と、
該肌色候補画素群画素数取得手段により取得された画素数が最大となる前記肌色候補画素群に対応する前記係数を最適係数として取得する最適係数取得手段と、
該最適係数取得手段により取得された前記最適係数に対応する前記肌色候補画素群を肌色画素群とし、該肌色画素群に含まれる各々の画素の色温度から前記カラー画像の撮影光源の色温度を求める光源色温度取得手段と、
前記カラー画像の画像信号に対して前記最適係数を乗算すると共に、該乗算がされた前記画像信号を、前記光源色温度取得手段により求められた色温度と基準白色の色温度との差分だけ補正する補正手段とを有してなるホワイトバランス補正装置において、
前記肌色候補画素群画素数取得手段が、前記肌色の黒体軌跡曲線に近い画素ほどカウント数の重みが高くなるように前記肌色候補画素群毎に各々の前記肌色候補画素のカウント数を重み付け加算して得た和、または、
サンプルカラー画像中の肌色画素の個数が当該サンプルカラー画像の全画素の個数に占める割合に対して、多数の前記サンプルカラー画像を用いて統計的に求められた各々の前記割合毎のサンプルカラー画像の存在頻度に応じた補正係数で、前記肌色候補画素群に含まれる肌色候補画素の個数が前記カラー画像の全画素の個数に占める割合に応じて前記肌色候補画素群毎にその肌色候補画素の個数を補正して得た値、
を当該肌色候補画素群の画素数とすることを特徴とするホワイトバランス補正装置。
Multiplication means for multiplying the image signal of each pixel of the color image by a predetermined coefficient;
As a result of the multiplication, a pixel that enters the vicinity of the skin color black body locus curve is used as a skin color candidate pixel to obtain a skin color candidate pixel group corresponding to each of the coefficients, and a skin color candidate pixel group pixel number for obtaining the number of pixels of the skin color candidate pixel group Acquisition means;
Optimal coefficient acquisition means for acquiring, as an optimal coefficient, the coefficient corresponding to the skin color candidate pixel group in which the number of pixels acquired by the skin color candidate pixel group pixel number acquisition means is maximized;
The skin color candidate pixel group corresponding to the optimal coefficient acquired by the optimal coefficient acquisition unit is defined as a skin color pixel group, and the color temperature of the photographing light source of the color image is determined from the color temperature of each pixel included in the skin color pixel group. A light source color temperature acquisition means to be obtained;
The image signal of the color image is multiplied by the optimum coefficient, and the multiplied image signal is corrected by the difference between the color temperature obtained by the light source color temperature acquisition unit and the color temperature of the reference white. And a white balance correction device having correction means for
The skin color candidate pixel group pixel number acquisition unit weights and adds the count number of each skin color candidate pixel for each skin color candidate pixel group so that a pixel closer to the skin color black body locus curve has a higher weight of the count number. Or the sum obtained
The sample color image for each of the ratios statistically obtained using a large number of the sample color images with respect to the ratio of the number of skin color pixels in the sample color image to the total number of pixels of the sample color image The correction coefficient according to the presence frequency of the skin color candidate pixel group is determined for each skin color candidate pixel group according to the ratio of the number of skin color candidate pixels included in the skin color candidate pixel group to the total number of pixels of the color image. The value obtained by correcting the number,
Is the number of pixels of the skin color candidate pixel group.
カラー画像の各画素の画像信号に対して所定の係数を乗算する乗算手段と、
前記乗算の結果、グレーの黒体軌跡曲線の近傍に入る画素をグレー候補画素として各前記係数に対応するグレー候補画素群と肌色の黒体軌跡曲線の近傍に入る画素を肌色候補画素として各前記係数に対応する肌色候補画素群とを得、前記グレー候補画素群の画素数および前記肌色候補画素群の画素数を求める候補画素群画素数取得手段と、
該候補画素群画素数取得手段により取得された前記グレー候補画素群の画素数と前記肌色候補画素群の画素数との和が最大となる前記係数を最適係数として取得する最適係数取得手段と、
該最適係数取得手段により取得された前記適係数に対応する前記グレー候補画素群と肌色候補画素群を夫々グレー画素群と肌色画素群にし、該グレー画素群に含まれる各々の画素の色温度および該肌色画素群に含まれる各々の画素の色温度から前記カラー画像の撮影光源の色温度を求める光源色温度取得手段と、
前記カラー画像の画像信号に対して前記最適係数を乗算すると共に、該乗算がされた前記画像信号を、前記光源色温度取得手段により求められた色温度と基準白色との差分だけ補正する補正手段とを有してなるホワイトバランス補正装置において、
前記候補画素群画素数取得手段が、前記グレーの黒体軌跡曲線に近い画素ほどカウント数の重みが高くなるように前記グレー候補画像群毎に各々の前記グレー候補画素のカウント数を重み付け加算して得た和、または、サンプルカラー画像中のグレー画素の個数が当該サンプルカラー画像の全画素の個数に占める割合に対して、多数の前記サンプルカラー画像を用いて統計的に求められた各々の前記割合毎のサンプルカラー画像の存在頻度に応じた補正係数で、前記グレー候補画素群に含まれるグレー候補画素の個数が前記カラー画像の全画素の個数に占める割合に応じて前記グレー候補画素群毎にそのグレー候補画素の個数を補正して得た値、を当該グレー候補画素群の画素数とする処理、および/または、
前記肌色の黒体軌跡曲線に近い画素ほどカウント数の重みが高くなるように前記肌色候補画素群毎に各々の前記肌色候補画素のカウント数を重み付け加算して得た和、または、サンプルカラー画像中の肌色画素の個数が当該サンプルカラー画像の全画素の個数に占める割合に対して、多数の前記サンプルカラー画像を用いて統計的に求められた各々の前記割合毎のサンプルカラー画像の存在頻度に応じた補正係数で、前記肌色候補画素群に含まれる肌色候補画素の個数が前記カラー画像の全画素の個数に占める割合に応じて前記肌色候補画素群毎にその肌色候補画素の個数を補正して得た値、を当該肌色候補画素群の画素数とする処理を行うことを特徴とするホワイトバランス補正装置。
Multiplication means for multiplying the image signal of each pixel of the color image by a predetermined coefficient;
As a result of the multiplication, pixels that are in the vicinity of the gray black body locus curve are regarded as gray candidate pixels, and the gray candidate pixel group corresponding to each coefficient and the pixels that are in the vicinity of the skin color black body locus curve are defined as skin color candidate pixels. A candidate pixel group pixel number acquisition unit for obtaining a skin color candidate pixel group corresponding to a coefficient and calculating the number of pixels of the gray candidate pixel group and the number of pixels of the skin color candidate pixel group;
Optimal coefficient acquisition means for acquiring, as an optimal coefficient, the coefficient that maximizes the sum of the number of pixels of the gray candidate pixel group acquired by the candidate pixel group pixel number acquisition means and the number of pixels of the skin color candidate pixel group;
The gray candidate pixel group and the skin color candidate pixel group corresponding to the appropriate coefficient acquired by the optimal coefficient acquisition unit are set as a gray pixel group and a skin color pixel group, respectively, and the color temperature of each pixel included in the gray pixel group and Light source color temperature obtaining means for obtaining a color temperature of a photographing light source of the color image from a color temperature of each pixel included in the skin color pixel group;
A correction unit that multiplies the image signal of the color image by the optimum coefficient and corrects the multiplied image signal by a difference between the color temperature obtained by the light source color temperature acquisition unit and a reference white color. In a white balance correction device having
The candidate pixel group pixel number acquisition unit weights and adds the count number of each gray candidate pixel for each gray candidate image group so that the weight closer to the gray black body locus curve is higher in the count number. Or the ratio of the number of gray pixels in the sample color image to the total number of pixels in the sample color image obtained statistically using a number of sample color images. The gray candidate pixel group according to the ratio of the number of gray candidate pixels included in the gray candidate pixel group to the total number of pixels of the color image, with a correction coefficient according to the frequency of existence of the sample color image for each ratio. A value obtained by correcting the number of gray candidate pixels for each of the gray candidate pixel groups, and / or
A sum obtained by weighting and adding the count number of each skin color candidate pixel for each skin color candidate pixel group so that the weight of the count number becomes higher as the pixel closer to the skin color black body locus curve, or a sample color image The presence frequency of the sample color image for each of the ratios statistically obtained using a number of the sample color images with respect to the ratio of the number of skin color pixels to the total number of pixels of the sample color image The number of flesh color candidate pixels included in the flesh color candidate pixel group is corrected for each flesh color candidate pixel group according to the proportion of the total number of pixels in the color image. A white balance correction apparatus that performs a process of setting the obtained value as the number of pixels of the skin color candidate pixel group.
カラー画像の各画素の画像信号に対して所定の係数を乗算する乗算手段と、
前記乗算の結果、グレーの黒体軌跡曲線の近傍に入る画素をグレー候補画素として各前記係数に対応するグレー候補画素群と肌色の黒体軌跡曲線の近傍に入る画素を肌色候補画素として各前記係数に対応する肌色候補画素群とを得、前記グレー候補画素群の平均色温度と前記肌色候補画素群の平均色温度を求める候補画素群平均色温度取得手段と、
該候補画素群平均色温度により取得された前記グレー候補画素群の平均色温度と前記肌色候補画素群の平均色温度との差が最小となる前記係数を最適係数として取得する最適係数取得手段と、
該最適係数取得手段により取得された前記適係数に対応する前記グレー候補画素群と肌色候補画素群を夫々グレー画素群と肌色画素群にし、該グレー画素群に含まれる各々の画素の色温度および該肌色画素群に含まれる各々の画素の色温度から前記カラー画像の撮影光源の色温度を求める光源色温度取得手段と、
前記カラー画像の画像信号に対して前記最適係数を乗算すると共に、該乗算がされた前記画像信号を、前記光源色温度取得手段により求められた色温度と基準白色との差分だけ補正する補正手段とを有してなるホワイトバランス補正装置において、
前記候補画素群平均色温度取得手段が、前記グレーの黒体軌跡曲線に近いグレー候補画素ほどその色温度の重みが高くなるように前記グレー候補画素群に含まれる各々のグレー候補画素の色温度を重み付け平均演算して得た値を該グレー候補画素群の平均色温度とする処理、および/または、
前記肌色の黒体軌跡曲線に近い肌色候補画素ほどその色温度の重みが高くなるように前記肌色候補画素群に含まれる各々の肌色候補画素の色温度を重み付け平均演算して得た値を該肌色候補画素群の平均色温度とする処理を行うことを特徴とするホワイトバランス補正装置。
Multiplication means for multiplying the image signal of each pixel of the color image by a predetermined coefficient;
As a result of the multiplication, pixels that are in the vicinity of the gray black body locus curve are regarded as gray candidate pixels, and the gray candidate pixel group corresponding to each coefficient and the pixels that are in the vicinity of the skin color black body locus curve are defined as skin color candidate pixels. A candidate color group obtaining means for obtaining a skin color candidate pixel group corresponding to a coefficient, and obtaining an average color temperature of the gray candidate pixel group and an average color temperature of the skin color candidate pixel group;
An optimum coefficient obtaining unit that obtains, as an optimum coefficient, the coefficient that minimizes the difference between the average color temperature of the gray candidate pixel group obtained from the candidate pixel group average color temperature and the average color temperature of the skin color candidate pixel group; ,
The gray candidate pixel group and the skin color candidate pixel group corresponding to the appropriate coefficient acquired by the optimal coefficient acquisition unit are set as a gray pixel group and a skin color pixel group, respectively, and the color temperature of each pixel included in the gray pixel group and Light source color temperature obtaining means for obtaining a color temperature of a photographing light source of the color image from a color temperature of each pixel included in the skin color pixel group;
A correction unit that multiplies the image signal of the color image by the optimum coefficient and corrects the multiplied image signal by a difference between the color temperature obtained by the light source color temperature acquisition unit and a reference white color. In a white balance correction device having
The candidate pixel group average color temperature acquisition unit is configured so that a gray candidate pixel closer to the gray black body locus curve has a higher color temperature weight so that the color temperature of each gray candidate pixel included in the gray candidate pixel group is higher. A value obtained by performing a weighted average calculation on the gray candidate pixel group as an average color temperature, and / or
A value obtained by performing a weighted average operation on the color temperature of each skin color candidate pixel included in the skin color candidate pixel group so that the skin temperature candidate pixel closer to the skin color black body locus curve has a higher color temperature weight. A white balance correction apparatus that performs processing to obtain an average color temperature of a skin color candidate pixel group.
カラー画像の各画素の画像信号に対して所定の係数を乗算する乗算手段と、
前記乗算の結果、グレーの黒体軌跡曲線の近傍に入る画素をグレー候補画素として各前記係数に対応するグレー候補画素群と肌色の黒体軌跡曲線の近傍に入る画素を肌色候補画素として各前記係数に対応する肌色候補画素群とを得る候補画素群取得手段と、
該候補画素群取得手段により取得された前記グレー候補画素群の画素数および前記肌色候補画素群の画素数を求める候補画素群画素数取得手段と、
前記候補画素群取得手段により取得された前記グレー候補画素群の平均色温度と前記肌色候補画素群の平均色温度を求める候補画素群平均色温度取得手段と、
前記候補画素群画素数取得手段により取得された前記グレー候補画素群の画素数と前記肌色候補画素群の画素数との和が最大となり、かつ前記候補画素群平均色温度取得手段により取得された前記グレー候補画素群の平均色温度と前記肌色候補画素群の平均色温度との差が最小となる前記係数を最適係数として取得する最適係数取得手段と、
該最適係数取得手段により取得された前記適係数に対応する前記グレー候補画素群と肌色候補画素群を夫々グレー画素群と肌色画素群にし、該グレー画素群に含まれる各々の画素の色温度および該肌色画素群に含まれる各々の画素の色温度から前記カラー画像の撮影光源の色温度を求める光源色温度取得手段と、
前記カラー画像の画像信号に対して前記最適係数を乗算すると共に、該乗算がされた前記画像信号を、前記光源色温度取得手段により求められた色温度と基準白色との差分だけ補正する補正手段とを有してなるホワイトバランス補正装置において、
前記候補画素群画素数取得手段が、前記グレーの黒体軌跡曲線に近い画素ほどカウント数の重みが高くなるように前記グレー候補画像群毎に各々の前記グレー候補画素のカウント数を重み付け加算して得た和、または、サンプルカラー画像中のグレー画素の個数が当該サンプルカラー画像の全画素の個数に占める割合に対して、多数の前記サンプルカラー画像を用いて統計的に求められた各々の前記割合毎のサンプルカラー画像の存在頻度に応じた補正係数で、前記グレー候補画素群に含まれるグレー候補画素の個数が前記カラー画像の全画素の個数に占める割合に応じて前記グレー候補画素群毎にそのグレー候補画素の個数を補正して得た値、を当該グレー候補画素群の画素数とする処理、および/または、
前記肌色の黒体軌跡曲線に近い画素ほどカウント数の重みが高くなるように前記肌色候補画素群毎に各々の前記肌色候補画素のカウント数を重み付け加算して得た和、または、サンプルカラー画像中の肌色画素の個数が当該サンプルカラー画像の全画素の個数に占める割合に対して、多数の前記サンプルカラー画像を用いて統計的に求められた各々の前記割合毎のサンプルカラー画像の存在頻度に応じた補正係数で、前記肌色候補画素群に含まれる肌色候補画素の個数が前記カラー画像の全画素の個数に占める割合に応じて前記肌色候補画素群毎にその肌色候補画素の個数を補正して得た値、を当該肌色候補画素群の画素数とする処理を行うことを特徴とするホワイトバランス補正装置。
Multiplication means for multiplying the image signal of each pixel of the color image by a predetermined coefficient;
As a result of the multiplication, pixels that are in the vicinity of the gray black body locus curve are regarded as gray candidate pixels, and the gray candidate pixel group corresponding to each coefficient and the pixels that are in the vicinity of the skin color black body locus curve are each defined as the skin color candidate pixel. Candidate pixel group obtaining means for obtaining a skin color candidate pixel group corresponding to the coefficient;
Candidate pixel group pixel number obtaining means for obtaining the number of pixels of the gray candidate pixel group and the number of pixels of the skin color candidate pixel group obtained by the candidate pixel group obtaining means;
Candidate pixel group average color temperature acquisition means for obtaining an average color temperature of the gray candidate pixel group acquired by the candidate pixel group acquisition means and an average color temperature of the skin color candidate pixel group;
The sum of the number of pixels of the gray candidate pixel group acquired by the candidate pixel group pixel number acquisition unit and the number of pixels of the skin color candidate pixel group is maximized, and acquired by the candidate pixel group average color temperature acquisition unit An optimum coefficient obtaining unit that obtains, as an optimum coefficient, the coefficient that minimizes the difference between the average color temperature of the gray candidate pixel group and the average color temperature of the skin color candidate pixel group;
The gray candidate pixel group and the skin color candidate pixel group corresponding to the appropriate coefficient acquired by the optimal coefficient acquisition unit are set as a gray pixel group and a skin color pixel group, respectively, and the color temperature of each pixel included in the gray pixel group and Light source color temperature obtaining means for obtaining a color temperature of a photographing light source of the color image from a color temperature of each pixel included in the skin color pixel group;
A correction unit that multiplies the image signal of the color image by the optimum coefficient and corrects the multiplied image signal by a difference between the color temperature obtained by the light source color temperature acquisition unit and a reference white color. In a white balance correction device having
The candidate pixel group pixel number acquisition unit weights and adds the count number of each gray candidate pixel for each gray candidate image group so that the weight closer to the gray black body locus curve is higher in the count number. Or the ratio of the number of gray pixels in the sample color image to the total number of pixels in the sample color image obtained statistically using a number of sample color images. The gray candidate pixel group according to the ratio of the number of gray candidate pixels included in the gray candidate pixel group to the total number of pixels of the color image, with a correction coefficient according to the frequency of existence of the sample color image for each ratio. A value obtained by correcting the number of gray candidate pixels for each of the gray candidate pixel groups, and / or
A sum obtained by weighting and adding the count number of each skin color candidate pixel for each skin color candidate pixel group so that the weight of the count number becomes higher as the pixel closer to the skin color black body locus curve, or a sample color image The presence frequency of the sample color image for each of the ratios statistically obtained using a number of the sample color images with respect to the ratio of the number of skin color pixels to the total number of pixels of the sample color image The number of flesh color candidate pixels included in the flesh color candidate pixel group is corrected for each flesh color candidate pixel group according to the proportion of the total number of pixels in the color image. A white balance correction apparatus that performs a process of setting the obtained value as the number of pixels of the skin color candidate pixel group.
カラー画像の各画素の画像信号に対して所定の係数を乗算する乗算手段と、
前記乗算の結果、グレーの黒体軌跡曲線の近傍に入る画素をグレー候補画素として各前記係数に対応するグレー候補画素群と肌色の黒体軌跡曲線の近傍に入る画素を肌色候補画素として各前記係数に対応する肌色候補画素群とを得る候補画素群取得手段と、
該候補画素群取得手段により取得された前記グレー候補画素群の画素数および前記肌色候補画素群の画素数を求める候補画素群画素数取得手段と、
前記候補画素群取得手段により取得された前記グレー候補画素群の平均色温度と前記肌色候補画素群の平均色温度を求める候補画素群平均色温度取得手段と、
前記候補画素群画素数取得手段により取得された前記グレー候補画素群の画素数と前記肌色候補画素群の画素数との和が最大となり、かつ前記候補画素群平均色温度取得手段により取得された前記グレー候補画素群の平均色温度と前記肌色候補画素群の平均色温度との差が最小となる前記係数を最適係数として取得する最適係数取得手段と、
該最適係数取得手段により取得された前記適係数に対応する前記グレー候補画素群と肌色候補画素群を夫々グレー画素群と肌色画素群にし、該グレー画素群に含まれる各々の画素の色温度および該肌色画素群に含まれる各々の画素の色温度から前記カラー画像の撮影光源の色温度を求める光源色温度取得手段と、
前記カラー画像の画像信号に対して前記最適係数を乗算すると共に、該乗算がされた前記画像信号を、前記光源色温度取得手段により求められた色温度と基準白色との差分だけ補正する補正手段とを有してなるホワイトバランス補正装置において、
前記候補画素群平均色温度取得手段が、前記グレーの黒体軌跡曲線に近いグレー候補画素ほどその色温度の重みが高くなるように前記グレー候補画素群に含まれる各々のグレー候補画素の色温度を重み付け平均演算して得た値を該グレー候補画素群の平均色温度とする処理、および/または、
前記肌色の黒体軌跡曲線に近い肌色候補画素ほどその色温度の重みが高くなるように前記肌色候補画素群に含まれる各々の肌色候補画素の色温度を重み付け平均演算して得た値を該肌色候補画素群の平均色温度とする処理を行うことを特徴とするホワイトバランス補正装置。
Multiplication means for multiplying the image signal of each pixel of the color image by a predetermined coefficient;
As a result of the multiplication, pixels that are in the vicinity of the gray black body locus curve are regarded as gray candidate pixels, and the gray candidate pixel group corresponding to each coefficient and the pixels that are in the vicinity of the skin color black body locus curve are each defined as the skin color candidate pixel. Candidate pixel group obtaining means for obtaining a skin color candidate pixel group corresponding to the coefficient;
Candidate pixel group pixel number obtaining means for obtaining the number of pixels of the gray candidate pixel group and the number of pixels of the skin color candidate pixel group obtained by the candidate pixel group obtaining means;
Candidate pixel group average color temperature acquisition means for obtaining an average color temperature of the gray candidate pixel group acquired by the candidate pixel group acquisition means and an average color temperature of the skin color candidate pixel group;
The sum of the number of pixels of the gray candidate pixel group acquired by the candidate pixel group pixel number acquisition unit and the number of pixels of the skin color candidate pixel group is maximized, and acquired by the candidate pixel group average color temperature acquisition unit An optimum coefficient obtaining unit that obtains, as an optimum coefficient, the coefficient that minimizes the difference between the average color temperature of the gray candidate pixel group and the average color temperature of the skin color candidate pixel group;
The gray candidate pixel group and the skin color candidate pixel group corresponding to the appropriate coefficient acquired by the optimal coefficient acquisition unit are set as a gray pixel group and a skin color pixel group, respectively, and the color temperature of each pixel included in the gray pixel group and Light source color temperature obtaining means for obtaining a color temperature of a photographing light source of the color image from a color temperature of each pixel included in the skin color pixel group;
A correction unit that multiplies the image signal of the color image by the optimum coefficient and corrects the multiplied image signal by a difference between the color temperature obtained by the light source color temperature acquisition unit and a reference white color. In a white balance correction device having
The candidate pixel group average color temperature acquisition unit is configured so that a gray candidate pixel closer to the gray black body locus curve has a higher color temperature weight so that the color temperature of each gray candidate pixel included in the gray candidate pixel group is higher. A value obtained by performing a weighted average calculation on the gray candidate pixel group as an average color temperature, and / or
A value obtained by performing a weighted average operation on the color temperature of each skin color candidate pixel included in the skin color candidate pixel group so that the skin temperature candidate pixel closer to the skin color black body locus curve has a higher color temperature weight. A white balance correction apparatus that performs processing to obtain an average color temperature of a skin color candidate pixel group.
前記カラー画像の各画素のうち、前記グレー候補画素群および/または肌色候補画素群を得るために有効な画素を抽出し、該有効な画素のみを前記グレー候補画素群および/または肌色候補画素群の取得に供する有効画素抽出手段をさらに備えたことを特徴とする請求項9から14のいずれか1項記載のホワイトバランス補正装置。   Of the pixels of the color image, effective pixels are extracted to obtain the gray candidate pixel group and / or skin color candidate pixel group, and only the effective pixels are extracted from the gray candidate pixel group and / or skin color candidate pixel group. The white balance correction apparatus according to claim 9, further comprising effective pixel extraction means for obtaining the image data. 前記光源色温度取得手段が、前記黒体軌跡曲線に近い画素ほどその色温度の重みが高くなるように前記最適係数に対応する前記候補画素群に含まれる各々の画素の色温度を重付平均演算して得た平均色温度を前記撮影光源の色温度として求めることを特徴とする請求項9から15のいずれか1項記載のホワイトバランス補正装置。   The light source color temperature acquisition unit calculates a weighted average of the color temperatures of each pixel included in the candidate pixel group corresponding to the optimal coefficient so that a pixel closer to the black body locus curve has a higher color temperature weight. 16. The white balance correction apparatus according to claim 9, wherein an average color temperature obtained by calculation is obtained as a color temperature of the photographing light source. 前記黒体軌跡曲線の代わりに昼光軌跡曲線を用いることを特徴とする請求項9から16のいずれか1項記載のホワイトバランス補正装置。   The white balance correction device according to any one of claims 9 to 16, wherein a daylight locus curve is used instead of the black body locus curve. カラー画像の各画素の画像信号に対して、所定の係数を乗算する乗算処理と、
前記乗算の結果、グレーの黒体軌跡曲線の近傍に入る画素をグレー候補画素として各前記係数に対応するグレー候補画素群を得、該グレー候補画素群の画素数を求めるグレー候補画素群画素数取得処理と、
該グレー候補画素群画素数取得処理により取得された画素数が最大となる前記グレー候補画素群に対応する前記係数を最適係数として取得する最適係数取得処理と、
該最適係数取得処理により取得された前記最適係数に対応する前記グレー候補画素群をグレー画素群とし、該グレー画素群に含まれる各々の画素の色温度から前記カラー画像の撮影光源の色温度を求める光源色温度取得処理と、
前記カラー画像の画像信号に対して前記最適係数を乗算すると共に、該乗算がされた前記画像信号を、前記光源色温度取得処理により求められた色温度と基準白色の色温度との差分だけ補正する補正処理とをコンピュータに行わせるプログラムであって、
前記グレー候補画素群画素数取得処理が、前記グレーの黒体軌跡曲線に近い画素ほどカウント数の重みが高くなるように前記グレー候補画像群毎に各々の前記グレー候補画素のカウント数を重み付け加算して得た和、または、
サンプルカラー画像中のグレー画素の個数が当該サンプルカラー画像の全画素の個数に占める割合に対して、多数の前記サンプルカラー画像を用いて統計的に求められた各々の前記割合毎のサンプルカラー画像の存在頻度に応じた補正係数で、前記グレー候補画素群に含まれるグレー候補画素の個数が前記カラー画像の全画素の個数に占める割合に応じて前記グレー候補画素群毎にそのグレー候補画素の個数を補正して得た値、
を当該グレー候補画素群の画素数とすることを特徴とするプログラム。
A multiplication process for multiplying an image signal of each pixel of the color image by a predetermined coefficient;
As a result of the multiplication, a pixel that enters the vicinity of the gray black body locus curve is regarded as a gray candidate pixel, a gray candidate pixel group corresponding to each coefficient is obtained, and the number of gray candidate pixel groups for obtaining the number of pixels in the gray candidate pixel group Acquisition process,
An optimal coefficient acquisition process for acquiring, as an optimal coefficient, the coefficient corresponding to the gray candidate pixel group in which the number of pixels acquired by the gray candidate pixel group pixel number acquisition process is maximized;
The gray candidate pixel group corresponding to the optimal coefficient acquired by the optimal coefficient acquisition process is defined as a gray pixel group, and the color temperature of the imaging light source of the color image is determined from the color temperature of each pixel included in the gray pixel group. The desired light source color temperature acquisition process;
The image signal of the color image is multiplied by the optimum coefficient, and the multiplied image signal is corrected by the difference between the color temperature obtained by the light source color temperature acquisition process and the color temperature of the reference white. A program for causing a computer to perform correction processing,
In the gray candidate pixel group pixel number acquisition process, the count number of each gray candidate pixel is weighted and added for each gray candidate image group so that the weight closer to the gray black body locus curve is higher in the count number. Or the sum obtained
The sample color image for each of the ratios statistically obtained using a number of the sample color images with respect to the ratio of the number of gray pixels in the sample color image to the total number of pixels of the sample color image Correction coefficient according to the presence frequency of the gray candidate pixel group, the gray candidate pixel group for each gray candidate pixel group according to the ratio of the number of gray candidate pixels included in the gray candidate pixel group to the total number of pixels of the color image. The value obtained by correcting the number,
Is the number of pixels of the gray candidate pixel group.
カラー画像の各画素の画像信号に対して、所定の係数を乗算する乗算処理と、
前記乗算の結果、肌色の黒体軌跡曲線の近傍に入る画素を肌色候補画素として各前記係数に対応する肌色候補画素群を得、該肌色候補画素群の画素数を求める肌色候補画素群画素数取得処理と、
該肌色候補画素群画素数取得処理により取得された画素数が最大となる前記肌色候補画素群に対応する前記係数を最適係数として取得する最適係数取得処理と、
該最適係数取得処理により取得された前記最適係数に対応する前記肌色候補画素群を肌色画素群とし、該肌色画素群に含まれる各々の画素の色温度から前記カラー画像の撮影光源の色温度を求める光源色温度取得処理と、
前記カラー画像の画像信号に対して前記最適係数を乗算すると共に、該乗算がされた前記画像信号を、前記光源色温度取得処理により求められた色温度と基準白色の色温度との差分だけ補正する補正処理とをコンピュータに実行させるプログラムであって、
前記肌色候補画素群画素数取得処理が、前記肌色の黒体軌跡曲線に近い画素ほどカウント数の重みが高くなるように前記肌色候補画素群毎に各々の前記肌色候補画素のカウント数を重み付け加算して得た和、または、
サンプルカラー画像中の肌色画素の個数が当該サンプルカラー画像の全画素の個数に占める割合に対して、多数の前記サンプルカラー画像を用いて統計的に求められた各々の前記割合毎のサンプルカラー画像の存在頻度に応じた補正係数で、前記肌色候補画素群に含まれる肌色候補画素の個数が前記カラー画像の全画素の個数に占める割合に応じて前記肌色候補画素群毎にその肌色候補画素の個数を補正して得た値、
を該当肌色候補画素群の画素数とすることを特徴とするプログラム。
A multiplication process for multiplying an image signal of each pixel of the color image by a predetermined coefficient;
As a result of the multiplication, a pixel that enters the vicinity of the skin color black body locus curve is used as a skin color candidate pixel to obtain a skin color candidate pixel group corresponding to each of the coefficients, and a skin color candidate pixel group pixel number for obtaining the number of pixels of the skin color candidate pixel group Acquisition process,
An optimal coefficient acquisition process for acquiring the coefficient corresponding to the skin color candidate pixel group that maximizes the number of pixels acquired by the skin color candidate pixel group pixel number acquisition process;
The skin color candidate pixel group corresponding to the optimal coefficient acquired by the optimal coefficient acquisition process is defined as a skin color pixel group, and the color temperature of the photographing light source of the color image is determined from the color temperature of each pixel included in the skin color pixel group. The desired light source color temperature acquisition process;
The image signal of the color image is multiplied by the optimum coefficient, and the multiplied image signal is corrected by the difference between the color temperature obtained by the light source color temperature acquisition process and the color temperature of the reference white. A program for causing a computer to execute correction processing to be performed,
In the skin color candidate pixel group pixel number acquisition process, the count number of each skin color candidate pixel is weighted and added for each skin color candidate pixel group so that the weight closer to the skin color black body locus curve is higher in the count number. Or the sum obtained
The sample color image for each of the ratios statistically obtained using a large number of the sample color images with respect to the ratio of the number of skin color pixels in the sample color image to the total number of pixels of the sample color image The correction coefficient according to the presence frequency of the skin color candidate pixel group is determined for each skin color candidate pixel group according to the ratio of the number of skin color candidate pixels included in the skin color candidate pixel group to the total number of pixels of the color image. The value obtained by correcting the number,
Is a number of pixels of the corresponding skin color candidate pixel group.
カラー画像の各画素の画像信号に対して所定の係数を乗算する乗算処理と、
前記乗算の結果、グレーの黒体軌跡曲線の近傍に入る画素をグレー候補画素として各前記係数に対応するグレー候補画素群と肌色の黒体軌跡曲線の近傍に入る画素を肌色候補画素として各前記係数に対応する肌色候補画素群とを得、前記グレー候補画素群の画素数および前記肌色候補画素群の画素数を求める候補画素群画素数取得処理と、
該候補画素群画素数取得処理により取得された前記グレー候補画素群の画素数と前記肌色候補画素群の画素数との和が最大となる前記係数を最適係数として取得する最適係数取得処理と、
該最適係数取得処理により取得された前記適係数に対応する前記グレー候補画素群と肌色候補画素群を夫々グレー画素群と肌色画素群にし、該グレー画素群に含まれる各々の画素の色温度および該肌色画素群に含まれる各々の画素の色温度から前記カラー画像の撮影光源の色温度を求める光源色温度取得処理と、
前記カラー画像の画像信号に対して前記最適係数を乗算すると共に、該乗算がされた前記画像信号を、前記光源色温度取得処理により求められた色温度と基準白色との差分だけ補正する補正処理とをコンピュータに実行させるプログラムであって、
前記候補画素群画素数取得処理が、前記グレーの黒体軌跡曲線に近い画素ほどカウント数の重みが高くなるように前記グレー候補画像群毎に各々の前記グレー候補画素のカウント数を重み付け加算して得た和、または、サンプルカラー画像中のグレー画素の個数が当該サンプルカラー画像の全画素の個数に占める割合に対して、多数の前記サンプルカラー画像を用いて統計的に求められた各々の前記割合毎のサンプルカラー画像の存在頻度に応じた補正係数で、前記グレー候補画素群に含まれるグレー候補画素の個数が前記カラー画像の全画素の個数に占める割合に応じて前記グレー候補画素群毎にそのグレー候補画素の個数を補正して得た値、を当該グレー候補画素群の画素数とする手順、および/または、
前記肌色の黒体軌跡曲線に近い画素ほどカウント数の重みが高くなるように前記肌色候補画素群毎に各々の前記肌色候補画素のカウント数を重み付け加算して得た和、または、サンプルカラー画像中の肌色画素の個数が当該サンプルカラー画像の全画素の個数に占める割合に対して、多数の前記サンプルカラー画像を用いて統計的に求められた各々の前記割合毎のサンプルカラー画像の存在頻度に応じた補正係数で、前記肌色候補画素群に含まれる肌色候補画素の個数が前記カラー画像の全画素の個数に占める割合に応じて前記肌色候補画素群毎にその肌色候補画素の個数を補正して得た値、を当該肌色候補画素群の画素数とする手順を有することを特徴とするプログラム。
A multiplication process for multiplying the image signal of each pixel of the color image by a predetermined coefficient;
As a result of the multiplication, pixels that are in the vicinity of the gray black body locus curve are regarded as gray candidate pixels, and the gray candidate pixel group corresponding to each coefficient and the pixels that are in the vicinity of the skin color black body locus curve are defined as skin color candidate pixels. Obtaining a skin color candidate pixel group corresponding to a coefficient, obtaining a pixel number of the gray candidate pixel group and a number of pixels of the skin color candidate pixel group, and obtaining a pixel number of candidate pixel groups,
An optimum coefficient obtaining process for obtaining, as an optimum coefficient, the coefficient that maximizes the sum of the number of pixels of the gray candidate pixel group obtained by the candidate pixel group pixel number obtaining process and the number of pixels of the skin color candidate pixel group;
The gray candidate pixel group and the skin color candidate pixel group corresponding to the optimal coefficient acquired by the optimal coefficient acquisition process are set as a gray pixel group and a skin color pixel group, respectively, and the color temperature of each pixel included in the gray pixel group and A light source color temperature acquisition process for obtaining a color temperature of a photographing light source of the color image from a color temperature of each pixel included in the skin color pixel group;
A correction process for multiplying the image signal of the color image by the optimum coefficient, and correcting the multiplied image signal by a difference between the color temperature obtained by the light source color temperature acquisition process and a reference white color Is a program that causes a computer to execute
In the candidate pixel group pixel number acquisition processing, the count number of each gray candidate pixel is weighted and added for each gray candidate image group so that the weight closer to the gray black body locus curve is higher in the count number. Or the ratio of the number of gray pixels in the sample color image to the total number of pixels in the sample color image, statistically determined using a number of sample color images. The gray candidate pixel group according to the ratio of the number of gray candidate pixels included in the gray candidate pixel group to the total number of pixels of the color image with a correction coefficient according to the frequency of existence of the sample color image for each ratio. A procedure in which the value obtained by correcting the number of gray candidate pixels for each time is the number of pixels of the gray candidate pixel group, and / or
Sum obtained by weighting and adding the count number of each skin color candidate pixel for each skin color candidate pixel group so that the weight of the count number becomes higher as the pixel closer to the flesh color black body locus curve, or a sample color image The presence frequency of the sample color image for each of the ratios statistically obtained using a number of the sample color images with respect to the ratio of the number of skin color pixels to the total number of pixels of the sample color image The number of flesh color candidate pixels included in the flesh color candidate pixel group is corrected for each flesh color candidate pixel group for each flesh color candidate pixel group according to the ratio of the total number of pixels in the color image. A program having a procedure of setting the obtained value as the number of pixels of the skin color candidate pixel group.
カラー画像の各画素の画像信号に対して所定の係数を乗算する乗算処理と、
前記乗算の結果、グレーの黒体軌跡曲線の近傍に入る画素をグレー候補画素として各前記係数に対応するグレー候補画素群と肌色の黒体軌跡曲線の近傍に入る画素を肌色候補画素として各前記係数に対応する肌色候補画素群とを得、前記グレー候補画素群の平均色温度と前記肌色候補画素群の平均色温度を求める候補画素群平均色温度取得処理と、
該候補画素群平均色温度により取得された前記グレー候補画素群の平均色温度と前記肌色候補画素群の平均色温度との差が最小となる前記係数を最適係数として取得する最適係数取得処理と、
該最適係数取得処理により取得された前記適係数に対応する前記グレー候補画素群と肌色候補画素群を夫々グレー画素群と肌色画素群にし、該グレー画素群に含まれる各々の画素の色温度および該肌色画素群に含まれる各々の画素の色温度から前記カラー画像の撮影光源の色温度を求める光源色温度取得処理と、
前記カラー画像の画像信号に対して前記最適係数を乗算すると共に、該乗算がされた前記画像信号を、前記光源色温度取得処理により求められた色温度と基準白色との差分だけ補正する補正処理とをコンピュータに実行させるプログラムであって、
前記候補画素群平均色温度取得処理が、前記グレーの黒体軌跡曲線に近いグレー候補画素ほどその色温度の重みが高くなるように前記グレー候補画素群に含まれる各々のグレー候補画素の色温度を重み付け平均演算して得た値を該グレー候補画素群の平均色温度とする手順、および/または、
前記肌色の黒体軌跡曲線に近い肌色候補画素ほどその色温度の重みが高くなるように前記肌色候補画素群に含まれる各々の肌色候補画素の色温度を重み付け平均演算して得た値を該肌色候補画素群の平均色温度とする手順を有することを特徴とするプログラム。
A multiplication process for multiplying the image signal of each pixel of the color image by a predetermined coefficient;
As a result of the multiplication, pixels that are in the vicinity of the gray black body locus curve are regarded as gray candidate pixels, and the gray candidate pixel group corresponding to each coefficient and the pixels that are in the vicinity of the skin color black body locus curve are defined as skin color candidate pixels. Obtaining a skin color candidate pixel group corresponding to a coefficient, and obtaining an average color temperature of the gray candidate pixel group and an average color temperature of the skin color candidate pixel group;
An optimal coefficient acquisition process for acquiring, as an optimal coefficient, the coefficient that minimizes the difference between the average color temperature of the gray candidate pixel group acquired by the candidate pixel group average color temperature and the average color temperature of the skin color candidate pixel group; ,
The gray candidate pixel group and the skin color candidate pixel group corresponding to the optimal coefficient acquired by the optimal coefficient acquisition process are set as a gray pixel group and a skin color pixel group, respectively, and the color temperature of each pixel included in the gray pixel group and A light source color temperature acquisition process for obtaining a color temperature of a photographing light source of the color image from a color temperature of each pixel included in the skin color pixel group;
A correction process for multiplying the image signal of the color image by the optimum coefficient, and correcting the multiplied image signal by a difference between the color temperature obtained by the light source color temperature acquisition process and a reference white color Is a program that causes a computer to execute
In the candidate pixel group average color temperature acquisition process, the color temperature of each gray candidate pixel included in the gray candidate pixel group is such that a gray candidate pixel closer to the gray black body locus curve has a higher color temperature weight. The procedure of setting the value obtained by performing the weighted average calculation as the average color temperature of the gray candidate pixel group, and / or
A value obtained by performing a weighted average operation on the color temperature of each skin color candidate pixel included in the skin color candidate pixel group so that the skin temperature candidate pixel closer to the skin color black body locus curve has a higher color temperature weight. A program having a procedure for setting an average color temperature of a skin color candidate pixel group.
カラー画像の各画素の画像信号に対して所定の係数を乗算する乗算処理と、
前記乗算の結果、グレーの黒体軌跡曲線の近傍に入る画素をグレー候補画素として各前記係数に対応するグレー候補画素群と肌色の黒体軌跡曲線の近傍に入る画素を肌色候補画素として各前記係数に対応する肌色候補画素群とを得る候補画素群取得処理と、
該候補画素群取得処理により取得された前記グレー候補画素群の画素数および前記肌色候補画素群の画素数を求める候補画素群画素数取得処理と、
前記候補画素群取得処理により取得された前記グレー候補画素群の平均色温度と前記肌色候補画素群の平均色温度を求める候補画素群平均色温度取得処理と、
前記候補画素群画素数取得処理により取得された前記グレー候補画素群の画素数と前記肌色候補画素群の画素数との和が最大となり、かつ前記候補画素群平均色温度取得処理により取得された前記グレー候補画素群の平均色温度と前記肌色候補画素群の平均色温度との差が最小となる前記係数を最適係数として取得する最適係数取得処理と、
該最適係数取得処理により取得された前記適係数に対応する前記グレー候補画素群と肌色候補画素群を夫々グレー画素群と肌色画素群にし、該グレー画素群に含まれる各々の画素の色温度および該肌色画素群に含まれる各々の画素の色温度から前記カラー画像の撮影光源の色温度を求める光源色温度取得処理と、
前記カラー画像の画像信号に対して前記最適係数を乗算すると共に、該乗算がされた前記画像信号を、前記光源色温度取得処理により求められた色温度と基準白色との差分だけ補正する補正処理とをコンピュータに実行させるプログラムであって、
前記候補画素群画素数取得処理が、前記グレーの黒体軌跡曲線に近い画素ほどカウント数の重みが高くなるように前記グレー候補画像群毎に各々の前記グレー候補画素のカウント数を重み付け加算して得た和、または、サンプルカラー画像中のグレー画素の個数が当該サンプルカラー画像の全画素の個数に占める割合に対して、多数の前記サンプルカラー画像を用いて統計的に求められた各々の前記割合毎のサンプルカラー画像の存在頻度に応じた補正係数で、前記グレー候補画素群に含まれるグレー候補画素の個数が前記カラー画像の全画素の個数に占める割合に応じて前記グレー候補画素群毎にそのグレー候補画素の個数を補正して得た値、を当該グレー候補画素群の画素数する手順、および/または、
前記肌色の黒体軌跡曲線に近い画素ほどカウント数の重みが高くなるように前記肌色候補画素群毎に各々の前記肌色候補画素のカウント数を重み付け加算して得た和、または、サンプルカラー画像中の肌色画素の個数が当該サンプルカラー画像の全画素の個数に占める割合に対して、多数の前記サンプルカラー画像を用いて統計的に求められた各々の前記割合毎のサンプルカラー画像の存在頻度に応じた補正係数で、前記肌色候補画素群に含まれる肌色候補画素の個数が前記カラー画像の全画素の個数に占める割合に応じて前記肌色候補画素群毎にその肌色候補画素の個数を補正して得た値、を当該肌色候補画素群の画素数とする手順を有することを特徴とするプログラム。
A multiplication process for multiplying the image signal of each pixel of the color image by a predetermined coefficient;
As a result of the multiplication, the pixels that are in the vicinity of the gray black body locus curve are regarded as gray candidate pixels, and the gray candidate pixel group corresponding to each coefficient and the pixels that are in the vicinity of the skin color black body locus curve are each defined as the skin color candidate pixel. A candidate pixel group acquisition process for obtaining a skin color candidate pixel group corresponding to the coefficient;
A candidate pixel group pixel number acquisition process for obtaining the number of pixels of the gray candidate pixel group acquired by the candidate pixel group acquisition process and the number of pixels of the skin color candidate pixel group;
A candidate pixel group average color temperature acquisition process for obtaining an average color temperature of the gray candidate pixel group acquired by the candidate pixel group acquisition process and an average color temperature of the skin color candidate pixel group;
The sum of the number of pixels of the gray candidate pixel group acquired by the candidate pixel group pixel number acquisition process and the number of pixels of the skin color candidate pixel group is maximized, and acquired by the candidate pixel group average color temperature acquisition process An optimal coefficient acquisition process for acquiring, as an optimal coefficient, the coefficient that minimizes the difference between the average color temperature of the gray candidate pixel group and the average color temperature of the skin color candidate pixel group;
The gray candidate pixel group and the skin color candidate pixel group corresponding to the optimal coefficient acquired by the optimal coefficient acquisition process are set as a gray pixel group and a skin color pixel group, respectively, and the color temperature of each pixel included in the gray pixel group and A light source color temperature acquisition process for obtaining a color temperature of a photographing light source of the color image from a color temperature of each pixel included in the skin color pixel group;
A correction process for multiplying the image signal of the color image by the optimum coefficient, and correcting the multiplied image signal by a difference between the color temperature obtained by the light source color temperature acquisition process and a reference white color Is a program that causes a computer to execute
The candidate pixel group pixel number acquisition processing weights and adds the count number of each gray candidate pixel for each gray candidate image group so that the weight closer to the gray black body locus curve is higher in the count number. Or the ratio of the number of gray pixels in the sample color image to the total number of pixels in the sample color image obtained statistically using a number of sample color images. The gray candidate pixel group according to the ratio of the number of gray candidate pixels included in the gray candidate pixel group to the total number of pixels of the color image, with a correction coefficient according to the frequency of existence of the sample color image for each ratio. A value obtained by correcting the number of gray candidate pixels for each step, and / or the number of pixels in the gray candidate pixel group, and / or
Sum obtained by weighting and adding the count number of each skin color candidate pixel for each skin color candidate pixel group so that the weight of the count number becomes higher as the pixel closer to the flesh color black body locus curve, or a sample color image The presence frequency of the sample color image for each of the ratios statistically obtained using a number of the sample color images with respect to the ratio of the number of skin color pixels to the total number of pixels of the sample color image The number of flesh color candidate pixels included in the flesh color candidate pixel group is corrected for each flesh color candidate pixel group for each flesh color candidate pixel group according to the ratio of the total number of pixels in the color image. A program having a procedure of setting the obtained value as the number of pixels of the skin color candidate pixel group.
カラー画像の各画素の画像信号に対して所定の係数を乗算する乗算処理と、
前記乗算の結果、グレーの黒体軌跡曲線の近傍に入る画素をグレー候補画素として各前記係数に対応するグレー候補画素群と肌色の黒体軌跡曲線の近傍に入る画素を肌色候補画素として各前記係数に対応する肌色候補画素群とを得る候補画素群取得処理と、
該候補画素群取得処理により取得された前記グレー候補画素群の画素数および前記肌色候補画素群の画素数を求める候補画素群画素数取得処理と、
前記候補画素群取得処理により取得された前記グレー候補画素群の平均色温度と前記肌色候補画素群の平均色温度を求める候補画素群平均色温度取得処理と、
前記候補画素群画素数取得処理により取得された前記グレー候補画素群の画素数と前記肌色候補画素群の画素数との和が最大となり、かつ前記候補画素群平均色温度取得処理により取得された前記グレー候補画素群の平均色温度と前記肌色候補画素群の平均色温度との差が最小となる前記係数を最適係数として取得する最適係数取得処理と、
該最適係数取得処理により取得された前記適係数に対応する前記グレー候補画素群と肌色候補画素群を夫々グレー画素群と肌色画素群にし、該グレー画素群に含まれる各々の画素の色温度および該肌色画素群に含まれる各々の画素の色温度から前記カラー画像の撮影光源の色温度を求める光源色温度取得処理と、
前記カラー画像の画像信号に対して前記最適係数を乗算すると共に、該乗算がされた前記画像信号を、前記光源色温度取得処理により求められた色温度と基準白色との差分だけ補正する補正処理とをコンピュータに実行させるプログラムであって、
前記候補画素群平均色温度取得処理が、前記グレーの黒体軌跡曲線に近いグレー候補画素ほどその色温度の重みが高くなるように前記グレー候補画素群に含まれる各々のグレー候補画素の色温度を重み付け平均演算して得た値を該グレー候補画素群の平均色温度とする手順、および/または、
前記肌色の黒体軌跡曲線に近い肌色候補画素ほどその色温度の重みが高くなるように前記肌色候補画素群に含まれる各々の肌色候補画素の色温度を重み付け平均演算して得た値を該肌色候補画素群の平均色温度とする手順を有することを特徴とするプログラム。
A multiplication process for multiplying the image signal of each pixel of the color image by a predetermined coefficient;
As a result of the multiplication, the pixels that are in the vicinity of the gray black body locus curve are regarded as gray candidate pixels, and the gray candidate pixel group corresponding to each coefficient and the pixels that are in the vicinity of the skin color black body locus curve are each defined as the skin color candidate pixel. A candidate pixel group acquisition process for obtaining a skin color candidate pixel group corresponding to the coefficient;
A candidate pixel group pixel number acquisition process for obtaining the number of pixels of the gray candidate pixel group acquired by the candidate pixel group acquisition process and the number of pixels of the skin color candidate pixel group;
A candidate pixel group average color temperature acquisition process for obtaining an average color temperature of the gray candidate pixel group acquired by the candidate pixel group acquisition process and an average color temperature of the skin color candidate pixel group;
The sum of the number of pixels of the gray candidate pixel group acquired by the candidate pixel group pixel number acquisition process and the number of pixels of the skin color candidate pixel group is maximized, and acquired by the candidate pixel group average color temperature acquisition process An optimal coefficient acquisition process for acquiring, as an optimal coefficient, the coefficient that minimizes the difference between the average color temperature of the gray candidate pixel group and the average color temperature of the skin color candidate pixel group;
The gray candidate pixel group and the skin color candidate pixel group corresponding to the optimal coefficient acquired by the optimal coefficient acquisition process are set as a gray pixel group and a skin color pixel group, respectively, and the color temperature of each pixel included in the gray pixel group and A light source color temperature acquisition process for obtaining a color temperature of a photographing light source of the color image from a color temperature of each pixel included in the skin color pixel group;
A correction process for multiplying the image signal of the color image by the optimum coefficient, and correcting the multiplied image signal by a difference between the color temperature obtained by the light source color temperature acquisition process and a reference white color Is a program that causes a computer to execute
In the candidate pixel group average color temperature acquisition process, the color temperature of each gray candidate pixel included in the gray candidate pixel group is such that a gray candidate pixel closer to the gray black body locus curve has a higher color temperature weight. The procedure of setting the value obtained by performing the weighted average calculation as the average color temperature of the gray candidate pixel group, and / or
A value obtained by performing a weighted average operation on the color temperature of each skin color candidate pixel included in the skin color candidate pixel group so that the skin temperature candidate pixel closer to the skin color black body locus curve has a higher color temperature weight. A program having a procedure for setting an average color temperature of a skin color candidate pixel group.
前記カラー画像の各画素のうち、前記グレー候補画素群および/または肌色候補画素群を得るために有効な画素を抽出し、該有効な画素のみを前記グレー候補画素群および/または肌色候補画素群の取得に供する有効画素抽出処理をさらにコンピュータに行わせることを特徴とする請求項9から14のいずれか1項記載のプログラム。   Of the pixels of the color image, effective pixels are extracted to obtain the gray candidate pixel group and / or skin color candidate pixel group, and only the effective pixels are extracted from the gray candidate pixel group and / or skin color candidate pixel group. The program according to claim 9, further causing a computer to perform an effective pixel extraction process for obtaining the data. 前記光源色温度取得処理が、前記黒体軌跡曲線に近い画素ほどその色温度の重みが高くなるように前記最適係数に対応する前記候補画素群に含まれる各々の画素の色温度を重付平均演算して得た平均色温度を前記撮影光源の色温度として求めることを特徴とする請求項18から24のいずれか1項記載のプログラム。   In the light source color temperature acquisition process, a weighted average of the color temperatures of each pixel included in the candidate pixel group corresponding to the optimal coefficient is set such that a pixel closer to the black body locus curve has a higher color temperature weight. 25. The program according to claim 18, wherein an average color temperature obtained by calculation is obtained as a color temperature of the photographing light source. 前記黒体軌跡曲線の代わりに昼光軌跡曲線を用いることを特徴とする請求項18から25のいずれか1項記載のプログラム。   The program according to any one of claims 18 to 25, wherein a daylight locus curve is used instead of the black body locus curve.
JP2003304374A 2003-08-28 2003-08-28 Method, apparatus and program of correcting white balance Withdrawn JP2005079623A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003304374A JP2005079623A (en) 2003-08-28 2003-08-28 Method, apparatus and program of correcting white balance

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003304374A JP2005079623A (en) 2003-08-28 2003-08-28 Method, apparatus and program of correcting white balance

Publications (1)

Publication Number Publication Date
JP2005079623A true JP2005079623A (en) 2005-03-24

Family

ID=34408083

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003304374A Withdrawn JP2005079623A (en) 2003-08-28 2003-08-28 Method, apparatus and program of correcting white balance

Country Status (1)

Country Link
JP (1) JP2005079623A (en)

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100691250B1 (en) 2005-10-20 2007-03-12 삼성전자주식회사 Apparatus and method for auto white balancing in portable terminal
JP2007110576A (en) * 2005-10-17 2007-04-26 Fujifilm Corp Color correction device for subject image data and control method thereof
JP2008148009A (en) * 2006-12-11 2008-06-26 Fuji Xerox Co Ltd Image processor and image processing program
JP2008278055A (en) * 2007-04-26 2008-11-13 Canon Inc Color processor and method therefor
JP2012005011A (en) * 2010-06-21 2012-01-05 Nikon Corp Image processing system, imaging apparatus, and image processing program
JP2012023692A (en) * 2010-07-16 2012-02-02 Canon Inc Image processing device, image processing method, and program
JP2012023693A (en) * 2010-07-16 2012-02-02 Canon Inc Image processor, image processing method, and program
JP2012023691A (en) * 2010-07-16 2012-02-02 Canon Inc Image processing device, image processing method and program
US8482630B2 (en) 2009-08-27 2013-07-09 Samsung Electronics Co., Ltd. Apparatus and method for adjusting automatic white balance by detecting effective area
CN105100576A (en) * 2014-04-21 2015-11-25 展讯通信(上海)有限公司 Light source detection method and device
CN107621929A (en) * 2017-09-12 2018-01-23 珠海智汇网络设备有限公司 A kind of gray scale thermal printing method, thermal printer and readable storage medium storing program for executing
CN112710685A (en) * 2019-10-27 2021-04-27 合肥美亚光电技术股份有限公司 X-ray sensor gray scale correction method and device and X-ray foreign matter detector
WO2022007080A1 (en) * 2020-07-07 2022-01-13 深圳市华星光电半导体显示技术有限公司 White balance adjustment method and apparatus, and electronic device
CN115334295A (en) * 2022-08-10 2022-11-11 杭州联吉技术有限公司 Image white balance processing method and electronic equipment

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007110576A (en) * 2005-10-17 2007-04-26 Fujifilm Corp Color correction device for subject image data and control method thereof
KR100691250B1 (en) 2005-10-20 2007-03-12 삼성전자주식회사 Apparatus and method for auto white balancing in portable terminal
JP2008148009A (en) * 2006-12-11 2008-06-26 Fuji Xerox Co Ltd Image processor and image processing program
JP2008278055A (en) * 2007-04-26 2008-11-13 Canon Inc Color processor and method therefor
US8482630B2 (en) 2009-08-27 2013-07-09 Samsung Electronics Co., Ltd. Apparatus and method for adjusting automatic white balance by detecting effective area
JP2012005011A (en) * 2010-06-21 2012-01-05 Nikon Corp Image processing system, imaging apparatus, and image processing program
JP2012023693A (en) * 2010-07-16 2012-02-02 Canon Inc Image processor, image processing method, and program
JP2012023691A (en) * 2010-07-16 2012-02-02 Canon Inc Image processing device, image processing method and program
JP2012023692A (en) * 2010-07-16 2012-02-02 Canon Inc Image processing device, image processing method, and program
CN105100576A (en) * 2014-04-21 2015-11-25 展讯通信(上海)有限公司 Light source detection method and device
CN105100576B (en) * 2014-04-21 2018-03-23 展讯通信(上海)有限公司 light source detection method and device
CN107621929A (en) * 2017-09-12 2018-01-23 珠海智汇网络设备有限公司 A kind of gray scale thermal printing method, thermal printer and readable storage medium storing program for executing
CN107621929B (en) * 2017-09-12 2023-07-14 珠海智汇网络设备有限公司 Gray scale thermal printing method, thermal printer and readable storage medium
CN112710685A (en) * 2019-10-27 2021-04-27 合肥美亚光电技术股份有限公司 X-ray sensor gray scale correction method and device and X-ray foreign matter detector
WO2022007080A1 (en) * 2020-07-07 2022-01-13 深圳市华星光电半导体显示技术有限公司 White balance adjustment method and apparatus, and electronic device
US11735130B2 (en) 2020-07-07 2023-08-22 Shenzhen China Star Optoelectronics Semiconductor Display Technology Co., Ltd. White balance adjusting method and electronic equipment
CN115334295A (en) * 2022-08-10 2022-11-11 杭州联吉技术有限公司 Image white balance processing method and electronic equipment
CN115334295B (en) * 2022-08-10 2024-05-03 杭州联吉技术有限公司 Image white balance processing method and electronic equipment

Similar Documents

Publication Publication Date Title
US7599093B2 (en) Image processing apparatus, method and program
US9247153B2 (en) Image processing apparatus, method and imaging apparatus
US7146041B2 (en) Method and apparatus for correcting white balance, method for correcting density and recording medium on which program for carrying out the methods is recorded
US8957993B2 (en) Detecting red eye filter and apparatus using meta-data
US7139425B2 (en) Method and apparatus for correcting white balance, method for correcting density and a recording medium on which a program for carrying out the methods is recorded
JP2005079623A (en) Method, apparatus and program of correcting white balance
KR101309008B1 (en) Image processing method and image processing apparatus
US10621754B2 (en) Method of detecting skin color area of human
KR20090065480A (en) Pupil color correction device and program
JP4478087B2 (en) Image processing apparatus and method, and image processing program
JP2002271638A (en) White balance correction method and device, and recording medium recorded with program for executing the method
JP3853224B2 (en) White balance correction method
JP3819302B2 (en) White balance correction method
JP2005236651A (en) Method, device and program for processing image
JP2009272709A (en) Image processing apparatus, method, and program
JP2005260481A (en) Device and method for detecting motion vector and camera
JP3813513B2 (en) White balance correction method
JP2004274482A (en) Image processing apparatus and imaging system
CN114697483A (en) Device and method for shooting under screen based on compressed sensing white balance algorithm
JP2013229809A (en) Image processing apparatus, method, and program
JP2021086269A (en) Image processing device, control method of the same, and program
JP2016170626A (en) Image processor, image processing method, and image processing program

Legal Events

Date Code Title Description
A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20061107