JP2001160976A - Image processing method, image processor and computer- readable recording medium with image processing program recorded thereon - Google Patents

Image processing method, image processor and computer- readable recording medium with image processing program recorded thereon

Info

Publication number
JP2001160976A
JP2001160976A JP34361699A JP34361699A JP2001160976A JP 2001160976 A JP2001160976 A JP 2001160976A JP 34361699 A JP34361699 A JP 34361699A JP 34361699 A JP34361699 A JP 34361699A JP 2001160976 A JP2001160976 A JP 2001160976A
Authority
JP
Japan
Prior art keywords
gain
point
movable range
color
image processing
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.)
Pending
Application number
JP34361699A
Other languages
Japanese (ja)
Inventor
Yasushi Kodama
裕史 児玉
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.)
Sharp Corp
Original Assignee
Sharp Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sharp Corp filed Critical Sharp Corp
Priority to JP34361699A priority Critical patent/JP2001160976A/en
Publication of JP2001160976A publication Critical patent/JP2001160976A/en
Pending legal-status Critical Current

Links

Landscapes

  • Color Television Image Signal Generators (AREA)
  • Processing Of Color Television Signals (AREA)

Abstract

PROBLEM TO BE SOLVED: To prevent white balance correction to an object in a chromatic color from all the more causing unnatural color correction and to correctly control color tone by preventing an RB gain from being locked, even when the color of a light source is changed rapidly or an object is changed to cause a rapid changes in the color of a reflected light. SOLUTION: An RB gain denoted by a point M on a cross line between an area consisting of points within a prescribed distance from a straight line 'ON' and a border line closest to a point N among border lines within the RB gain movable range is used for a new RB gain.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、この発明は、カラ
ー画像のホワイトバランス制御を行う画像処理方法、画
像処理装置および画像処理プログラムを記録したコンピ
ュータ読み取り可能な記録媒体に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an image processing method for controlling white balance of a color image, an image processing apparatus, and a computer-readable recording medium storing an image processing program.

【0002】[0002]

【従来の技術】CCDやC−MOSイメージャ等の固体
撮像素子を画像入力装置としたカラーカメラや、イメー
ジスキャナ等によって取り込まれた画像について高い満
足感を得るために、画像の明るさ、コントラスト、色再
現が適正であることが重要である。この中で色再現に関
しては、太陽光に照明された被写体に含まれる白い部分
を白く再現することが基本となる。太陽光は朝や夕暮れ
においては赤い光源、晴れの昼間であれば白い光源、ま
た、日陰であれば青い光源というふうに、時間や季節、
直接、間接等により様々な色の光源となりうる。
2. Description of the Related Art In order to obtain high satisfaction with an image captured by a color camera or an image scanner using a solid-state image sensor such as a CCD or C-MOS imager as an image input device, the brightness, contrast, It is important that the color reproduction is proper. Among these, with regard to color reproduction, it is fundamental to reproduce white portions included in a subject illuminated by sunlight in white. Sunlight is a red light source in the morning or dusk, a white light source in the sunny daytime, a blue light source in the shade, time and season,
It can be a light source of various colors by direct, indirect, etc.

【0003】この光源色変化において、白い被写体を白
く再現するための画像補正がホワイトバランス制御であ
り、通常カラーカメラの場合図10に示すような構成で
ホワイトバランス補正を行う。101は固体撮像素子で
あり、被写体の画像情報を光電変換する。A/Dコンバ
ータ102で光電変換されたアナログデータをデジタル
データに変換し、OBオフセットクランプ103で撮像
素子101の光電変換面に設けられている光を遮断する
部分の出力信号がゼロとなるようにクランプされる。
[0003] In this light source color change, image correction for reproducing a white object white is white balance control. In the case of a normal color camera, white balance correction is performed with a configuration as shown in FIG. Reference numeral 101 denotes a solid-state imaging device, which photoelectrically converts image information of a subject. The analog data photoelectrically converted by the A / D converter 102 is converted into digital data, and the output signal of a portion that blocks light provided on the photoelectric conversion surface of the image sensor 101 by the OB offset clamp 103 becomes zero. Clamped.

【0004】Rアンプ104、Bアンプ105はそれぞ
れR画素、B画素の出力信号の増幅部であり、これらの
アンプのゲイン(Rゲイン、Bゲイン)を調節し、被写
体の白い部分のR,G,B各画素の出力値が等しくなる
ようにすることによりホワイトバランス制御を行う。白
ピクセル積算部106は、ホワイトバランスがとれてい
ない場合に被写体を撮像したデジタル画像信号における
白い部分にどれだけの色成分が含まれているかを計算す
る。被写体に含まれる白い部分の抽出には様々な方法が
あり、たとえば特開平11−205812号公報では、
色差ドメインを数個のメッシュに分割する方法が提案さ
れている。次フレームRBゲイン計算部107は、白ピ
クセル積算部106で求められた色成分に基づいてRB
ゲインの補正量を計算し、現在のRBゲインに加算し、
次フレームのRBゲインを算出する。
An R amplifier 104 and a B amplifier 105 are amplifiers for output signals of the R and B pixels, respectively, and adjust the gains (R gain and B gain) of these amplifiers so that the R and G of the white portion of the subject can be adjusted. , B are controlled so that the output values of the respective pixels become equal. The white pixel integration unit 106 calculates how many color components are included in a white portion in a digital image signal obtained by imaging a subject when white balance is not achieved. There are various methods for extracting a white portion included in a subject. For example, in Japanese Patent Application Laid-Open No. H11-205812,
A method of dividing a color difference domain into several meshes has been proposed. The next frame RB gain calculation unit 107 performs RB calculation based on the color components obtained by the white pixel integration unit 106.
Calculate the gain correction amount, add it to the current RB gain,
The RB gain of the next frame is calculated.

【0005】通常、このRBゲインには時定数がかけら
れ、被写体の白い部分が光源の色から白へとなめらかな
変化が行われるように計算される。可動範囲判定部10
8では、次フレームRBゲイン計算部107で求められ
たRBゲインが、RB平面上で定めたある範囲にあるか
判定する。これは、有彩色である被写体に対しホワイト
バランス補正を行うことによりかえって不自然な色補正
となることを防止するため、被写体の色成分が本来太陽
光変化に含まれない色であった場合はRBゲインを若干
変化させるだけにとどめるためである。
Usually, a time constant is multiplied by the RB gain, and the RB gain is calculated so that the white portion of the subject smoothly changes from the color of the light source to white. Movable range determination unit 10
In step 8, it is determined whether the RB gain calculated by the next frame RB gain calculator 107 is within a certain range defined on the RB plane. This is because if the color component of the subject is a color that is not originally included in the change in sunlight, the white balance correction is performed on the chromatic subject to prevent unnatural color correction. This is because the RB gain is only slightly changed.

【0006】すなわち、RBゲイン可動範囲を特に設け
ない場合には、例えば被写体が緑っぽい色調となった場
合に、(1)被写体が緑っぽい色調となった原因が、緑
っぽい色調の光源によるものであった場合は、適切に、
被写体がホワイトバランス制御され、グレーとなる。し
かし一方、(2)このように被写体が緑っぽい色調とな
った原因が、被写体が緑色の物体であることによるもの
であった場合に、もし、その被写体が白(正確にはグレ
ー)画素であると誤って判断してしまった場合には、適
切に被写体がホワイトバランス制御されず、緑色のもの
を撮影しているつもりで制御された結果、本来緑のもの
がグレーとなり、背景は例えばマゼンタ色になってしま
い、非常に不自然な画像となってしまう。別の例を挙げ
れば、紫色の被写体をグレーになるようにホワイトバラ
ンス制御すると、背景が緑色になってしまう。
That is, when the RB gain movable range is not particularly provided, for example, when the subject has a greenish tone, (1) the cause of the subject having a greenish tone is caused by the greenish tone. If it was due to the light source,
The subject is subjected to white balance control and becomes gray. On the other hand, on the other hand, (2) if the subject becomes greenish in this way because the subject is a green object, if the subject is a white (accurately gray) pixel If the subject is incorrectly determined to be white balance control of the subject is not properly performed, and as a result of being controlled as if a green subject is being photographed, the green subject is originally gray and the background is, for example, gray. The image becomes magenta, which results in a very unnatural image. As another example, if white balance control is performed so that a purple object becomes gray, the background becomes green.

【0007】上記従来のホワイトバランス制御は、本願
発明を説明するための図2に示すYIQ立方体Rに基づ
いて行われており、このYIQ立方体Rは、通常、制御
に余裕をもたせるため、多少大きめに設定されている。
そして、このようにしてYIQ立方体Rを大きくする
と、上記のように光源色が大きく変化した場合にホワイ
トバランス制御の停止を防ぐことができる。しかし、緑
色や紫色といった、太陽光の変化に含まれない色までホ
ワイトバランス制御でグレーにしてしまい、色調が不自
然になってしまう。そこで、ホワイトバランス制御の計
算結果のRBゲインに、許容可動範囲となるRBゲイン
可動範囲を設けている。
The above-mentioned conventional white balance control is performed based on a YIQ cube R shown in FIG. 2 for explaining the present invention, and the YIQ cube R is usually slightly larger in order to allow a margin for control. Is set to
When the YIQ cube R is made larger in this way, it is possible to prevent the white balance control from being stopped when the light source color changes significantly as described above. However, colors not included in the change in sunlight, such as green and purple, are grayed by white balance control, and the color tone becomes unnatural. Therefore, an RB gain movable range that is an allowable movable range is provided in the RB gain resulting from the white balance control calculation.

【0008】そして、RBゲイン可動範囲をはずれる場
合には、RBゲイン可動範囲内においてRBゲインを若
干変化させるだけにされる。それによって、緑や紫のよ
うに、被写体の色成分が太陽光に含まれない色であった
場合は、多少色が薄くなる程度に色調が若干変化するだ
けに制限されることになる。
When the RB gain is out of the movable range, the RB gain is only slightly changed within the RB gain movable range. Accordingly, when the color component of the subject is a color that is not included in sunlight, such as green or purple, the color tone is limited to a slight change to such an extent that the color becomes slightly lighter.

【0009】また、この緑色や紫色のものをさらにグレ
ーに近づけるようにすると、RBゲインが可動範囲外と
なるため、RBゲインを変化させないようにしている。
それ以上は、この緑色や紫色のものはグレーっぽくはな
らない。すなわち、有彩色は有彩色のまま出力されるこ
とになる。
Further, if the green and purple colors are made closer to gray, the RB gain is out of the movable range, so that the RB gain is not changed.
Beyond that, this green or purple thing doesn't look gray. That is, the chromatic colors are output as chromatic colors.

【0010】図11を用いて、このRBゲイン判定部分
の処理手順について説明する。ステップ101(以下ス
テップは単にSと記載する。)からS103において、
白画素の色成分から次に設定するRBゲインを算出して
いる。S104でこのRBゲインが可動範囲にあるかど
うか判定し、可動範囲にある場合は計算したRBゲイン
をそのままRBゲインアンプに設定し、可動範囲にない
場合は、RBゲインを設定しない。すなわち現在のRB
ゲインが次フレームのRBゲインとしても適用される。
The processing procedure of the RB gain determination portion will be described with reference to FIG. In steps 101 (hereinafter, steps are simply described as S) to S103,
The RB gain to be set next is calculated from the color components of the white pixels. In S104, it is determined whether or not the RB gain is within the movable range. If the RB gain is within the movable range, the calculated RB gain is set as it is in the RB gain amplifier, and if not, the RB gain is not set. That is, the current RB
The gain is also applied as the RB gain of the next frame.

【0011】[0011]

【発明が解決しようとする課題】上述した通り、上記従
来技術のようにRBゲインが可動範囲内かどうかを判断
し、ゲインの設定を制限することにより、有彩色である
被写体に対しホワイトバランス補正を行うことによりか
えって不自然な色補正となることを防止することができ
る。
As described above, it is determined whether or not the RB gain is within the movable range as in the above-described prior art, and the setting of the gain is restricted to correct the white balance of the chromatic object. , It is possible to prevent an unnatural color correction.

【0012】しかしながら、上記従来技術によるRBゲ
イン制限方法では、光源色が急激に変化した場合、ある
いは被写体が変化し、反射光の色が急激に変化した場合
に問題が生じる。
However, in the RB gain limiting method according to the prior art, a problem occurs when the color of the light source changes abruptly, or when the subject changes and the color of the reflected light changes abruptly.

【0013】たとえば、屋内から窓越しに屋外の日陰部
分を撮影しており(日陰は青い光源である。)、ホワイ
トバランス補正を行った結果Rゲイン大、Bゲイン小の
状態で安定している状態で、急激に屋内の白熱灯(白熱
灯は赤い光源である。)で照明された被写体にカメラを
向けたときは、Rゲイン小、Bゲイン大となるような補
正を行う。このとき、RBゲイン補正量のアンバランス
により、座標(Bゲイン、Rゲイン)がRB可動範囲外
となり図11に示すフローによりRBゲインが変化しな
い。RBゲインが変化しないため次フレームにおいて
も、カメラから取り込まれる画像の色成分が変化せず、
結果、同じRBゲインを計算するが、やはり、RB可動
範囲外であるためRBゲインが変化しない。以下これの
繰り返しとなり、RBゲインがロック(ロックアウト)
されたのと同様となる。
For example, an outdoor shade portion is photographed from the indoor through a window (the shade is a blue light source). As a result of white balance correction, the R gain is large and the B gain is small. In this state, when the camera is pointed at a subject suddenly illuminated by an indoor incandescent lamp (an incandescent lamp is a red light source), correction is performed so that the R gain is small and the B gain is large. At this time, due to the imbalance of the RB gain correction amount, the coordinates (B gain, R gain) are outside the RB movable range, and the RB gain does not change according to the flow shown in FIG. Since the RB gain does not change, the color component of the image captured from the camera does not change even in the next frame.
As a result, the same RB gain is calculated, but the RB gain does not change because it is outside the RB movable range. Hereinafter, this is repeated, and the RB gain is locked (locked out).
It is the same as what was done.

【0014】例えば、テレビのCRTのように青い光源
を大写しに撮影している状況では、ホワイトバランス制
御は、画面を赤くする方向に働く。その結果、Rゲイン
大、Bゲイン小というゲインを計算してアンプに設定す
る。ここで、白熱灯で照明された白い物体に急激にカメ
ラを向け、赤い物体を時間的に急激に撮影するとする。
すると、前回は青い物体を撮影していたので現在はRゲ
イン大、Bゲイン小という状態になっているが、被写体
が赤い物体に時間的に急激に替わったため、ホワイトバ
ランス制御を行う装置は、大きく補正する必要があると
判断し、かなり青くするような値として、かなり小さい
Rゲインとかなり大きいBゲインとを算出する。これら
の値がRBゲイン可動範囲を超えてしまった場合には、
超えたとの判断に基づき、前回のRBゲインをそのまま
設定してしまう。つまり、赤い状態を白く戻すためにR
ゲイン小、Bゲイン大とする必要があるのに、青い物体
を写していたときのRゲイン大、Bゲイン小というゲイ
ンが設定されたままとなる。その結果、画面は、赤い色
調のままで変化しなくなってしまう。すなわち、RBゲ
インがロックされる。
For example, in a situation where a blue light source is photographed as a large image such as a CRT of a television, the white balance control works in a direction to make the screen red. As a result, gains of large R gain and small B gain are calculated and set in the amplifier. Here, it is assumed that the camera is suddenly pointed at a white object illuminated by an incandescent lamp, and a red object is suddenly photographed temporally.
Then, the R gain is large and the B gain is small at the moment because the blue object was photographed last time, but since the subject has rapidly changed to a red object in time, the device that performs white balance control is: It is determined that it is necessary to make a large correction, and a fairly small R gain and a fairly large B gain are calculated as values that make the color fairly blue. If these values exceed the RB gain movable range,
Based on the determination that the RB gain has been exceeded, the previous RB gain is set as it is. That is, to return the red state to white,
Although it is necessary to set the gain to be small and the B gain to be large, the gain of large R gain and small B gain when a blue object is photographed remains set. As a result, the screen remains unchanged with a red tone. That is, the RB gain is locked.

【0015】つまり、RBゲイン可動範囲を超えるの
は、緑や紫と言った太陽光以外の色をグレーにしようと
するとき(これは防止する必要がある)だけでなく、そ
れ以外にも、青から赤またはその逆のように、太陽光に
は含まれるが急激に替わったものをすぐにグレーにしよ
うとするとき(これはそうすることが望まれる)とがあ
るので、RBゲイン可動範囲を超えたからといってRB
ゲインの新規設定を停止してしまうと、後者の場合には
適切なホワイトバランス制御がされず、正常な色調とな
らなくなってしまう。
That is, the reason that the RB gain exceeds the movable range is not only when a color other than sunlight such as green or purple is to be grayed (this needs to be prevented), but also in other cases, There are times when it is desired to immediately turn gray that is included in sunlight but changed rapidly, such as from blue to red or vice versa (this is desirable), so the RB gain movable range RB just exceeded
If the new setting of the gain is stopped, appropriate white balance control is not performed in the latter case, and a normal color tone is not obtained.

【0016】本発明は、上記課題に鑑みなされたもので
あり、その目的は、有彩色である被写体に対しホワイト
バランス補正を行うことによりかえって不自然な色補正
となることを防止するとともに、光源色が急激に変化し
た場合あるいは被写体が変化し、反射光の色が急激に変
化した場合でも、RBゲインがロックせず、色調を正し
く制御することができる画像処理方法、画像処理装置お
よび画像処理プログラムを記録したコンピュータ読み取
り可能な記録媒体を提供することにある。
SUMMARY OF THE INVENTION The present invention has been made in view of the above problems, and has as its object to perform white balance correction on a chromatic subject, thereby preventing unnatural color correction from occurring. An image processing method, an image processing apparatus, and an image processing method capable of correctly controlling a color tone without locking the RB gain even when the color changes rapidly or the subject changes and the color of the reflected light changes rapidly. An object of the present invention is to provide a computer-readable recording medium on which a program is recorded.

【0017】[0017]

【課題を解決するための手段】上記の課題を解決するた
め、本発明の画像処理方法は、原点をOとし、Rゲイン
およびBゲインをそれぞれ座標軸にとった座標平面を考
え、太陽光の光源色に応じてホワイトバランスをとるた
めに必要なRBゲインの軌跡を曲線Wとし、有彩色を引
き込まないようにするためのRBゲイン可動範囲を表す
領域を、上記曲線Wに基づいて設けた境界線にて形成
し、現在のRBゲインを表す点を点Cとし、対象とする
画素の色成分から求められる、その色成分がゼロとなる
ようなRBゲインを表す点を点Nとし、画素のホワイト
バランスを調整する処理のためにRBゲインを設定する
画像処理方法において、上記点Nが上記RBゲイン可動
範囲の外に位置するときに、上記境界線上の点が表すR
Bゲインを新たなRBゲインとして設定することを特徴
としている。
In order to solve the above-mentioned problems, an image processing method according to the present invention considers a coordinate plane in which the origin is set to O, the R gain and the B gain are set to coordinate axes, and a light source of sunlight is used. The trajectory of the RB gain necessary for obtaining the white balance according to the color is represented by a curve W, and a region representing the RB gain movable range for preventing chromatic colors from being drawn is defined by a boundary line based on the curve W. , The point representing the current RB gain is designated as point C, the point representing the RB gain obtained from the color component of the target pixel such that the color component is zero is designated as point N, and the pixel white In the image processing method for setting the RB gain for the process of adjusting the balance, when the point N is outside the RB gain movable range, the point R on the boundary line represents
It is characterized in that the B gain is set as a new RB gain.

【0018】上記の構成により、上記境界線上の点が表
すRBゲインを、新たなRBゲインとして設定する。す
なわち、RBゲイン可動範囲の外縁である境界線上の点
が表すRBゲインを、新たなRBゲインとして設定す
る。したがって、算出されるRBゲインの各値は、あく
までもRBゲイン可動範囲内の値にとどまり、範囲の外
へは出ない。それゆえ、RBゲインの制御がロックせ
ず、ホワイトバランス制御が続行される。その後も通常
通りホワイトバランスが制御され、色調が正しく調整さ
れる。
With the above configuration, the RB gain represented by the point on the boundary line is set as a new RB gain. That is, the RB gain represented by a point on the boundary line that is the outer edge of the RB gain movable range is set as a new RB gain. Therefore, each value of the calculated RB gain remains within the RB gain movable range to the last, and does not go out of the range. Therefore, the control of the RB gain is not locked, and the white balance control is continued. Thereafter, the white balance is controlled as usual, and the color tone is correctly adjusted.

【0019】このように、光源色が急激に変化した場
合、あるいは被写体が変化し、反射光の色が急激に変化
した場合でも、RBゲインのロックを防止することがで
きる。すなわち、有彩色である被写体に対しホワイトバ
ランス補正を行うことによりかえって不自然な色補正と
なることを防止するとともに、光源色が急激に変化した
場合、あるいは被写体が変化し、反射光の色が急激に変
化した場合でも、RBゲインがロックせず、色調を正し
く制御することができる。
As described above, even when the color of the light source changes abruptly, or when the subject changes and the color of the reflected light changes abruptly, the lock of the RB gain can be prevented. In other words, by performing white balance correction on a chromatic subject, it is possible to prevent unnatural color correction from occurring, and when the light source color changes abruptly or when the subject changes, the reflected light color changes. Even in the case of a sudden change, the RB gain does not lock and the color tone can be correctly controlled.

【0020】また、本発明の画像処理方法は、上記構成
に加えて、上記RBゲイン可動範囲を表す領域が、一つ
以上の境界線としての線分で形成されており、上記点N
が上記RBゲイン可動範囲の外に位置するときに、上記
境界線のうちで点Nに最も近い境界線と、直線ONから
所定の距離以内にある点からなる領域Sとの交線上の点
が表すRBゲインを、新たなRBゲインとして設定する
ことを特徴としている。
According to the image processing method of the present invention, in addition to the above configuration, the area representing the RB gain movable range is formed by one or more line segments as boundary lines.
Is located outside the RB gain movable range, a point on the intersection line between the boundary line closest to the point N among the boundary lines and the region S including points within a predetermined distance from the straight line ON is determined. The RB gain to be represented is set as a new RB gain.

【0021】上記の構成により、直線ONから所定の距
離以内にある点からなる領域Sと、上記境界線のうちで
点Nに最も近い境界線との交線上の点が表すRBゲイン
を、新たなRBゲインとして設定する。したがって、算
出された、本来設定すべきRBゲインを表す点Nと、実
際に設定するRBゲインを表す点とが互いに近い。すな
わち、両者でRゲインおよびBゲインがそれぞれ近い値
となる。そして、点Cから点Nへの移動と比べて、各ゲ
インの増減方向が同一であり、青みを加え赤みを減らす
方向か、赤みを加え青みを減らす方向かといった、ホワ
イトバランスの制御方向を大きく逸脱することがない。
それゆえ、上記構成による効果に加えて、光源色が急激
に変化した場合、あるいは被写体が変化し、反射光の色
が急激に変化した場合に、被写体の色が極端に異なる色
へと変化するのを抑えることができる。
With the above configuration, the RB gain represented by the point on the intersection of the region S consisting of points within a predetermined distance from the straight line ON and the boundary line closest to the point N among the boundary lines is newly set. RB gain. Therefore, the calculated point N representing the RB gain to be originally set and the point representing the RB gain to be actually set are close to each other. That is, the R gain and the B gain are close to each other. Then, as compared with the movement from the point C to the point N, the increasing / decreasing direction of each gain is the same, and the white balance control direction such as the direction of adding bluish and reducing reddish or the direction of adding reddish and reducing bluish is increased. Do not deviate.
Therefore, in addition to the effect of the above configuration, when the color of the light source changes abruptly, or when the subject changes and the color of the reflected light changes abruptly, the color of the subject changes to an extremely different color. Can be suppressed.

【0022】また、本発明の画像処理方法は、上記の構
成に加えて、上記境界線のうちで点Nに最も近い境界線
と、上記所定の距離が0である直線ONとの交線上の点
Mが表すRBゲインを、新たなRBゲインとして設定す
ることを特徴としている。
Further, in addition to the above configuration, the image processing method according to the present invention further comprises a boundary line closest to the point N among the boundary lines and a straight line ON having the predetermined distance of 0. The RB gain represented by the point M is set as a new RB gain.

【0023】上記の構成により、上記所定の距離が0で
ある直線ONと、上記境界線のうちで点Nに最も近い境
界線との交線上の点Mが表すRBゲインを、新たなRB
ゲインとして設定する。したがって、算出された、本来
設定すべきRBゲインを表す点Nと、実際に設定するR
Bゲインを表す点とが互いに近い。すなわち、両者でR
ゲインおよびBゲインがそれぞれ近い値となる。そし
て、点Cから点Nへの移動と比べて、各ゲインの増減方
向が同一であり、青みを加え赤みを減らす方向か、赤み
を加え青みを減らす方向かといった、ホワイトバランス
の制御方向を逸脱しない。それゆえ、上記構成による効
果に加えて、光源色が急激に変化した場合、あるいは被
写体が変化し、反射光の色が急激に変化した場合に、被
写体の色が極端に異なる色へと変化するのを、より効果
的に抑えることができる。
With the above configuration, the RB gain represented by the point M on the intersection of the straight line ON having the predetermined distance of 0 and the boundary line closest to the point N among the boundary lines is calculated by a new RB gain.
Set as gain. Therefore, the calculated point N representing the RB gain to be set and the point N actually set
The points representing the B gain are close to each other. That is, R
The gain and the B gain are close to each other. Then, as compared with the movement from the point C to the point N, the increasing / decreasing direction of each gain is the same, and deviates from the white balance control direction such as the direction of adding bluish to reduce reddish or the direction of adding reddish to reduce bluish. do not do. Therefore, in addition to the effect of the above configuration, when the color of the light source changes abruptly, or when the subject changes and the color of the reflected light changes abruptly, the color of the subject changes to an extremely different color. Can be suppressed more effectively.

【0024】また、本発明の画像処理方法は、上記構成
において、上記RBゲイン可動範囲を表す領域が、一つ
以上の境界線としての線分で形成されており、上記点N
が上記RBゲイン可動範囲の外に位置するときに、上記
境界線のうちで点Nに最も近い境界線と、直線CNから
所定の距離以内にある点からなる領域Tとの交線上の点
が表すRBゲインを、新たなRBゲインとして設定する
ことを特徴としている。
Further, in the image processing method of the present invention, in the above configuration, the area representing the RB gain movable range is formed by one or more line segments as boundary lines.
Is located outside the RB gain movable range, a point on the intersection line between the boundary line closest to the point N among the boundary lines and the region T including points within a predetermined distance from the straight line CN is determined. The RB gain to be represented is set as a new RB gain.

【0025】上記の構成により、直線CNから所定の距
離以内にある点からなる領域Tと、上記境界線のうちで
点Nに最も近い境界線との交線上の点が表すRBゲイン
を、新たなRBゲインとして設定する。したがって、算
出された、本来設定すべきRBゲインを表す点Nと、実
際に設定するRBゲインを表す点とが互いに近い。すな
わち、両者でRゲインおよびBゲインがそれぞれ近い値
となる。そして、点Cから点Nへの移動と比べて、各ゲ
インの増減方向が同一であり、青みを加え赤みを減らす
方向か、赤みを加え青みを減らす方向かといった、ホワ
イトバランスの制御方向を大きく逸脱することがない。
それゆえ、上記構成による効果に加えて、光源色が急激
に変化した場合あるいは被写体が変化し、反射光の色が
急激に変化した場合に、被写体の色が極端に異なる色へ
と変化するのを抑えることができる。
With the above configuration, the RB gain represented by the point on the intersection of the region T consisting of points within a predetermined distance from the straight line CN and the boundary line closest to the point N among the boundary lines is newly set. RB gain. Therefore, the calculated point N representing the RB gain to be originally set and the point representing the RB gain to be actually set are close to each other. That is, the R gain and the B gain are close to each other. Then, as compared with the movement from the point C to the point N, the increasing / decreasing direction of each gain is the same, and the white balance control direction such as the direction of adding bluish and reducing reddish or the direction of adding reddish and reducing bluish is increased. Do not deviate.
Therefore, in addition to the effect of the above configuration, when the color of the light source changes abruptly or when the subject changes and the color of the reflected light changes abruptly, the color of the subject changes to an extremely different color. Can be suppressed.

【0026】また、本発明の画像処理方法は、上記の構
成に加えて、上記境界線のうちで点Nに最も近い境界線
と、上記所定の距離が0である直線CNとの交線上の点
Pが表すRBゲインを、新たなRBゲインとして設定す
ることを特徴としている。
Further, in addition to the above configuration, the image processing method according to the present invention further comprises an intersection between the boundary line closest to the point N among the boundary lines and the straight line CN having the predetermined distance of 0. The RB gain represented by the point P is set as a new RB gain.

【0027】上記の構成により、上記所定の距離が0で
ある直線CNと、上記境界線のうちで点Nに最も近い境
界線との交線上の点Pが表すRBゲインを、新たなRB
ゲインとして設定する。したがって、算出された、本来
設定すべきRBゲインを表す点Nと、実際に設定するR
Bゲインを表す点とが互いに近い。すなわち、両者でR
ゲインおよびBゲインがそれぞれ近い値となる。そし
て、点Cから点Nへの移動と比べて、各ゲインの増減方
向が同一であり、青みを加え赤みを減らす方向か、赤み
を加え青みを減らす方向かといった、ホワイトバランス
の制御方向を逸脱しない。それゆえ、上記構成による効
果に加えて、光源色が急激に変化した場合あるいは被写
体が変化し、反射光の色が急激に変化した場合に、被写
体の色が極端に異なる色へと変化するのを、より効果的
に抑えることができる。
According to the above configuration, the RB gain represented by the point P on the intersection of the straight line CN having the predetermined distance of 0 and the boundary line closest to the point N among the boundary lines is calculated by a new RB gain.
Set as gain. Therefore, the calculated point N representing the RB gain to be set and the point N actually set
The points representing the B gain are close to each other. That is, R
The gain and the B gain are close to each other. Then, as compared with the movement from the point C to the point N, the increasing / decreasing direction of each gain is the same, and deviates from the white balance control direction such as the direction of adding bluish to reduce reddish or the direction of adding reddish to reduce bluish. do not do. Therefore, in addition to the effect of the above configuration, when the color of the light source changes abruptly or when the subject changes and the color of the reflected light changes abruptly, the color of the subject changes to an extremely different color. Can be suppressed more effectively.

【0028】また、本発明の画像処理方法は、上記の構
成に加えて、上記点Nが上記RBゲイン可動範囲の外に
位置するときに、新たに設定するRBゲインを表す点を
点Aとすると、上記境界線のなかで、曲線Wについて点
Nと同じ側にある部分であって、かつ、ベクトルCNと
ベクトルCAとについて横軸成分同士および縦軸成分同
士で符号がそれぞれ等しくなるような部分上の点Aが表
すRBゲインを、新たなRBゲインとして設定すること
を特徴としている。
The image processing method according to the present invention, in addition to the above configuration, further comprises, when the point N is located outside the RB gain movable range, a point representing a newly set RB gain as a point A. Then, in the above-described boundary line, a portion on the same side as the point N with respect to the curve W, and the signs of the horizontal axis components and the vertical axis components of the vector CN and the vector CA are equal to each other. The RB gain represented by the point A on the portion is set as a new RB gain.

【0029】上記の構成により、上記境界線のなかで、
曲線Wについて点Nと同じ側にある部分であって、か
つ、ベクトルCNとベクトルCAとについて横軸成分同
士および縦軸成分同士で符号がそれぞれ等しくなるよう
な部分上の点Aが表すRBゲインを、新たなRBゲイン
として設定する。したがって、算出された、本来設定す
べきRBゲインを表す点Nと、実際に設定するRBゲイ
ンを表す点とが互いに近い。すなわち、両者でRゲイン
およびBゲインがそれぞれ近い値となる。そして、点C
から点Nへの移動と比べて、各ゲインの増減方向が同一
であり、青みを加え赤みを減らす方向か、赤みを加え青
みを減らす方向かといった、ホワイトバランスの制御方
向を大きく逸脱することがない。それゆえ、上記構成に
よる効果に加えて、光源色が急激に変化した場合あるい
は被写体が変化し、反射光の色が急激に変化した場合
に、被写体の色が極端に異なる色へと変化するのを抑え
ることができる。
According to the above configuration, within the boundary line,
An RB gain represented by a point A on a portion on the same side as the point N with respect to the curve W and having the same sign between the horizontal axis components and the vertical axis components of the vector CN and the vector CA. Is set as a new RB gain. Therefore, the calculated point N representing the RB gain to be originally set and the point representing the RB gain to be actually set are close to each other. That is, the R gain and the B gain are close to each other. And point C
As compared to the movement from the point to the point N, the direction of increase / decrease of each gain is the same, and the control direction of the white balance such as the direction of adding bluish and reducing reddish or the direction of adding reddish and reducing bluish can greatly deviate. Absent. Therefore, in addition to the effect of the above configuration, when the color of the light source changes abruptly or when the subject changes and the color of the reflected light changes abruptly, the color of the subject changes to an extremely different color. Can be suppressed.

【0030】また、本発明の画像処理方法は、上記構成
において、上記点Aとして、直線CN上の点Pが表すR
Bゲインを、新たなRBゲインとして設定することを特
徴としている。
Further, in the image processing method according to the present invention, in the above configuration, the point A is represented by R
It is characterized in that the B gain is set as a new RB gain.

【0031】上記の構成により、上記点Aとして、上記
境界線のうちで点Nに最も近い境界線と、直線CNとの
交線上の点Pが表すRBゲインを、新たなRBゲインと
して設定する。したがって、算出された、本来設定すべ
きRBゲインを表す点Nと、実際に設定するRBゲイン
を表す点とが互いに近い。すなわち、両者でRゲインお
よびBゲインがそれぞれ近い値となる。そして、点Cか
ら点Nへの移動と比べて、各ゲインの増減方向が同一で
あり、青みを加え赤みを減らす方向か、赤みを加え青み
を減らす方向かといった、ホワイトバランスの制御方向
を逸脱しない。それゆえ、上記構成による効果に加え
て、光源色が急激に変化した場合あるいは被写体が変化
し、反射光の色が急激に変化した場合に、被写体の色が
極端に異なる色へと変化するのを、より効果的に抑える
ことができる。
With the above configuration, as the point A, an RB gain represented by a point P on an intersection of the boundary line closest to the point N and the straight line CN among the boundary lines is set as a new RB gain. . Therefore, the calculated point N representing the RB gain to be originally set and the point representing the RB gain to be actually set are close to each other. That is, the R gain and the B gain are close to each other. Then, as compared with the movement from the point C to the point N, the increasing / decreasing direction of each gain is the same, and deviates from the white balance control direction such as the direction of adding bluish to reduce reddish or the direction of adding reddish to reduce bluish. do not do. Therefore, in addition to the effect of the above configuration, when the color of the light source changes abruptly or when the subject changes and the color of the reflected light changes abruptly, the color of the subject changes to an extremely different color. Can be suppressed more effectively.

【0032】また、上記の課題を解決するため、本発明
の画像処理装置は、原点をOとし、RゲインおよびBゲ
インをそれぞれ座標軸にとった座標平面を考え、太陽光
の光源色に応じてホワイトバランスをとるために必要な
RBゲインの軌跡を曲線Wとし、有彩色を引き込まない
ようにするためのRBゲイン可動範囲を表す領域を、上
記曲線Wに基づいて設けた境界線にて形成し、現在のR
Bゲインを表す点を点Cとし、対象とする画素の色成分
から求められる、その色成分がゼロとなるようなRBゲ
インを表す点を点Nとし、画素のホワイトバランスを調
整する処理のためにRBゲインを設定する画像処理装置
において、上記点Nが上記RBゲイン可動範囲の外に位
置するときに、上記境界線上の点が表すRBゲインを新
たなRBゲインとして設定するRBゲイン設定手段を有
することを特徴としている。
Further, in order to solve the above-mentioned problems, the image processing apparatus of the present invention considers a coordinate plane in which the origin is set to O, and the R gain and the B gain are respectively set on the coordinate axes, and is set according to the light source color of sunlight. The trajectory of the RB gain necessary for obtaining the white balance is defined as a curve W, and a region representing the RB gain movable range for preventing chromatic colors from being drawn is formed by a boundary line provided based on the curve W. , The current R
A point representing a B gain is defined as a point C, a point representing an RB gain obtained from a color component of a target pixel and having a color component of zero is defined as a point N, and processing for adjusting the white balance of the pixel. An RB gain setting unit that sets an RB gain represented by a point on the boundary line as a new RB gain when the point N is outside the RB gain movable range. It is characterized by having.

【0033】なお、上記画像処理装置は、例えば、R画
素の出力信号を増幅するRゲイン増幅手段や、B画素の
出力信号を増幅するBゲイン増幅手段や、前記白画素の
色成分から色成分がゼロとなるようなRBゲインを算出
するRBゲイン算出手段や、RBゲインが上記RBゲイ
ン可動範囲内にあるかどうかを判定する可動範囲判定手
段を備えることができる。
The image processing apparatus includes, for example, R gain amplifying means for amplifying the output signal of the R pixel, B gain amplifying means for amplifying the output signal of the B pixel, and a color component of the white pixel. RB gain calculating means for calculating an RB gain such that the RB gain becomes zero, and a movable range determining means for determining whether the RB gain is within the RB gain movable range.

【0034】また、上記画像処理装置は、例えば、被写
体の情報を取り込む撮像手段や、R画素、G画素、B画
素から白画素を抽出する白画素抽出手段や、白画素の色
成分を計算する色成分計算手段を備えることができる。
Further, the image processing apparatus includes, for example, an image pickup means for taking in information of a subject, a white pixel extraction means for extracting white pixels from R, G, and B pixels, and a color component of white pixels. Color component calculation means can be provided.

【0035】また、上記の課題を解決するため、本発明
の画像処理プログラムを記録したコンピュータ読み取り
可能な記録媒体は、原点をOとし、RゲインおよびBゲ
インをそれぞれ座標軸にとった座標平面を考え、太陽光
の光源色に応じてホワイトバランスをとるために必要な
RBゲインの軌跡を曲線Wとし、有彩色を引き込まない
ようにするためのRBゲイン可動範囲を表す領域を、上
記曲線Wに基づいて設けた境界線にて形成し、現在のR
Bゲインを表す点を点Cとし、対象とする画素の色成分
から求められる、その色成分がゼロとなるようなRBゲ
インを表す点を点Nとし、画素のホワイトバランスを調
整する処理のためにRBゲインを設定する画像処理プロ
グラムを記録したコンピュータ読み取り可能な記録媒体
において、上記点Nが上記RBゲイン可動範囲の外に位
置するときに、上記境界線上の点が表すRBゲインを新
たなRBゲインとして設定することを特徴としている。
In order to solve the above-mentioned problem, a computer-readable recording medium on which an image processing program of the present invention is recorded is considered as a coordinate plane in which the origin is O and the R gain and the B gain are each coordinate axes. The trajectory of the RB gain necessary for obtaining the white balance according to the light source color of sunlight is defined as a curve W, and a region representing the RB gain movable range for preventing chromatic colors from being drawn is defined based on the curve W. The current R
A point representing a B gain is defined as a point C, a point representing an RB gain obtained from a color component of a target pixel and having a color component of zero is defined as a point N, and processing for adjusting the white balance of the pixel. In a computer-readable recording medium on which an image processing program for setting an RB gain is set, when the point N is outside the RB gain movable range, the RB gain represented by the point on the boundary line is set to a new RB. It is characterized in that it is set as a gain.

【0036】[0036]

【発明の実施の形態】〔実施の形態1〕本発明の実施の
一形態について図1ないし図7に基づいて説明すれば、
以下の通りである。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS [Embodiment 1] An embodiment of the present invention will be described with reference to FIGS.
It is as follows.

【0037】図1に示すように、画像処理装置としての
映像信号補正装置は、固体撮像素子1、A/Dコンバー
タ2、OBオフセットクランプ3、Rアンプ4、Bアン
プ5、白ピクセル積算部6、次フレームRBゲイン計算
部7、可動範囲判定部8、可動範囲外RBゲイン再計算
部9、後段処理部10を備えている。上記白ピクセル積
算部6、次フレームRBゲイン計算部7、可動範囲判定
部8、および可動範囲外RBゲイン再計算部9によっ
て、RBゲイン設定手段が構成されている。
As shown in FIG. 1, a video signal correction device as an image processing device includes a solid-state image pickup device 1, an A / D converter 2, an OB offset clamp 3, an R amplifier 4, a B amplifier 5, a white pixel integrator 6, RB gain calculating section 7, movable range determining section 8, RB gain recalculating section 9 outside the movable range, and post-processing section 10. The white pixel integrator 6, the next frame RB gain calculator 7, the movable range determination unit 8, and the RB gain recalculator 9 outside the movable range constitute an RB gain setting unit.

【0038】固体撮像素子1は、被写体の情報を取り込
む撮像手段であり、被写体の画像情報を光電変換する。
A/Dコンバータ2で、光電変換されたアナログ画像電
気情報をデジタルデータに変換し、OBオフセットクラ
ンプ3により、固体撮像素子1に設けられている光が遮
断されている部分の出力信号がゼロとなるようにクラン
プされる。
The solid-state image pickup device 1 is an image pickup means for taking in information of a subject, and photoelectrically converts image information of the subject.
The A / D converter 2 converts the photoelectrically converted analog image electrical information into digital data, and the OB offset clamp 3 reduces the output signal of the portion of the solid-state imaging device 1 where light is blocked to zero. It is clamped to become.

【0039】Rアンプ4およびBアンプ5はそれぞれ、
R画素、B画素の出力信号を増幅して後段処理部10へ
出力する色信号アンプ(Rゲイン増幅手段、Bゲイン増
幅手段)である。なお、Rアンプ4およびBアンプ5を
RBアンプと総称する。
The R amplifier 4 and the B amplifier 5 are respectively
A color signal amplifier (R gain amplifying means, B gain amplifying means) for amplifying output signals of the R pixel and the B pixel and outputting the amplified signal to the post-processing unit 10. Note that the R amplifier 4 and the B amplifier 5 are generically called an RB amplifier.

【0040】本実施の形態では、これらの色信号アンプ
のゲイン(Rゲイン、Bゲイン)を調節し、ホワイトバ
ランス制御を行う。すなわち、被写体に含まれる白い部
分のR,G,B各画素の出力値が等しくなるようにRB
アンプのゲインを調節することにより、被写体の白部分
が白く再現されるように制御する。
In this embodiment, the white balance control is performed by adjusting the gains (R gain and B gain) of these color signal amplifiers. That is, RB is set so that the output values of the R, G, and B pixels of the white portion included in the subject are equal.
By controlling the gain of the amplifier, control is performed so that the white portion of the subject is reproduced white.

【0041】白ピクセル積算部6は、R画素、G画素、
B画素から白画素を抽出する白画素抽出手段であるとと
もに、その白画素の色成分を計算する色成分計算手段で
あり、ホワイトバランスがとれていない場合に被写体を
撮像したデジタル画像信号において白い部分にどれだけ
の色成分が含まれているかを計算する。被写体の白い部
分は、赤から青までの様々な色変化を伴う太陽光を反射
することにより光源色同様赤みがかった色から青みがか
った色までの変化を示す。
The white pixel accumulator 6 includes an R pixel, a G pixel,
White pixel extraction means for extracting white pixels from B pixels, and color component calculation means for calculating the color components of the white pixels. A white portion in a digital image signal obtained by imaging a subject when white balance is not achieved. Calculate how many color components are included in. The white portion of the subject reflects the sunlight with various color changes from red to blue, and shows a change from a reddish color to a bluish color like the light source color.

【0042】RBゲイン算出手段である次フレームRB
ゲイン計算部7では、白部分のRGB値からその色成分
を計算する。すなわち、白画素の色成分から色成分がゼ
ロとなるようなRBゲインを算出する。
Next frame RB as RB gain calculating means
The gain calculator 7 calculates the color component from the RGB values of the white portion. That is, the RB gain is calculated from the color components of the white pixels so that the color components become zero.

【0043】次に、図2を用いて白画素抽出の仕組みを
説明する。各画素のRGB値(R、G、B)を用いて、
式(1)に示す数式により各画素の色差成分IとQ、お
よび輝度値Yを算出する。すなわち、 Y=0.3R+0.59G+0.11B I=0.6R−0.28G−0.32B Q=0.21R−0.52G+0.31B (1) である。
Next, the mechanism of white pixel extraction will be described with reference to FIG. Using the RGB values (R, G, B) of each pixel,
The color difference components I and Q and the luminance value Y of each pixel are calculated by the equation shown in the equation (1). That is, Y = 0.3R + 0.59G + 0.11B I = 0.6R−0.28G−0.32B Q = 0.21R−0.52G + 0.31B (1)

【0044】次に、式(1)によって求めたY、I、Q
の各値について、式(2)の条件を同時に満足する画素
のRGB値を別々に積算(加算)し、式(2)の条件を
満たした画素の総数で除することにより、1フレームの
画像の色評価値(RGB評価値、RGB平均値)r、
g、bを求める。すなわち、 Imin≦I≦Imax Qmin≦Q≦Qmax Ymin≦Y≦Ymax (2) である。
Next, Y, I, Q obtained by the equation (1)
For each value of, the RGB values of the pixels that simultaneously satisfy the condition of Expression (2) are separately integrated (added), and divided by the total number of pixels that satisfy the condition of Expression (2) to obtain an image of one frame. Color evaluation value (RGB evaluation value, RGB average value) r,
Find g and b. That is, Imin ≦ I ≦ Imax Qmin ≦ Q ≦ Qmax Ymin ≦ Y ≦ Ymax (2)

【0045】このことは、図2において、YIQ立方体
Rの内部にある画素のみのRGB平均値を求めることを
示している。通常、被写体の白い部分は、光源色をほぼ
そのまま反射する。したがって、4本の直線I=Ima
x、Q=Qmax、I=Imin、Q=Qminによっ
て形成される矩形を考え、太陽光源色の分布がその矩形
に完全に含まれるようにImax、Qmax、Imi
n、Qminを選ぶことにより、白画素のみのRGB値
を積算し、フレームのRGB平均値を求めることができ
る。
This means that, in FIG. 2, the RGB average value of only the pixels inside the YIQ cube R is obtained. Usually, the white portion of the subject reflects the light source color almost as it is. Therefore, four straight lines I = Ima
Consider a rectangle formed by x, Q = Qmax, I = Imin, Q = Qmin, and Imax, Qmax, Imi such that the distribution of the color of the sun light source is completely included in the rectangle.
By selecting n and Qmin, the RGB values of only the white pixels can be integrated, and the RGB average value of the frame can be obtained.

【0046】ここで、YIQ立方体Rの大きさつまり上
記4つの境界値(Imax、Qmax、Imin、Qm
in)、およびRBゲイン可動範囲について述べる。
Here, the size of the YIQ cube R, that is, the above four boundary values (Imax, Qmax, Imin, Qm
in) and the RB gain movable range will be described.

【0047】すなわち、図2にあるようなYIQ立方体
Rの内側にあるような画素のみを計算対象とすることに
より、色が濃い画素は白画素として抽出しないようにす
ることができる。
That is, only pixels that are inside the YIQ cube R as shown in FIG. 2 are to be calculated, so that dark pixels can be prevented from being extracted as white pixels.

【0048】しかし、YIQ立方体Rをあまり小さくす
ると、光源が急激に変化した場合に白画素抽出ができな
くなり、そこでホワイトバランス制御が停止してしま
う。そのため、ある程度色がついている画素でも白画
素、より正確にはグレー画素として計算対象とするよ
う、YIQ立方体Rは多少大きめに設定しておく。例え
ば、テレビのCRT(陰極線管)のような青い光源を大
写しに撮影している状況で、白熱灯で照明された白い物
体に急激にカメラを向ける場合を考えると、カメラを向
ける前は、最初にCRTの青い光源を白くするようにホ
ワイトバランス制御しているので、CRT以外の部分は
その補色でオレンジっぽい色となる。そこへ上記のよう
に、オレンジ色の光源である白熱灯で照明された白い物
体へカメラを向けると、カメラにはかなり赤い被写体が
写ることになる。本来、これは白い物体であるため、こ
の物体が白くなるように制御しなければならないが、こ
の場合、あまりに赤い被写体が写り込んでいるために、
このオレンジ色がYIQ立方体Rから完全にはずれて、
白画素抽出結果、ゼロ個の画素がYIQ立方体Rを通過
することになり、ホワイトバランス制御が停止してしま
う。それを防ぐために、YIQ立方体Rは、多少大きめ
に設定しておく。このようにしてYIQ立方体Rを大き
くすると、上記のように光源色が大きく変化した場合
に、ホワイトバランス制御の停止を防ぐことができる。
However, if the YIQ cube R is too small, white pixels cannot be extracted when the light source changes suddenly, and the white balance control stops there. For this reason, the YIQ cube R is set to be slightly larger so that even pixels having a certain degree of color are calculated as white pixels, more precisely, gray pixels. For example, in a situation where a blue light source such as a CRT (cathode ray tube) of a television is photographed in a close-up, and the camera is suddenly pointed at a white object illuminated by an incandescent lamp, before turning the camera, Since the white balance is controlled so as to make the blue light source of the CRT white, the parts other than the CRT have a complementary color of orange. When the camera is pointed at a white object illuminated by an incandescent lamp, which is an orange light source, as described above, a considerably red object appears on the camera. Originally, this is a white object, so we had to control it to make it white, but in this case, because the subject was too red,
This orange color is completely off the YIQ cube R,
As a result of the white pixel extraction, zero pixels pass through the YIQ cube R, and the white balance control stops. To prevent this, the YIQ cube R is set slightly larger. When the YIQ cube R is made large in this way, it is possible to prevent the white balance control from being stopped when the light source color changes greatly as described above.

【0049】しかし、その結果、緑色や紫色といった、
太陽光の変化に含まれない色までホワイトバランス制御
でグレーにしてしまうと、色調が不自然になってしま
う。そこで、ホワイトバランス制御の計算結果のRBゲ
インに、許容可動範囲(RBゲイン可動範囲)を設けて
おき、計算結果のRBゲインがこの範囲内かどうかを調
べるようになっている。
However, as a result, green or purple
If the color not included in the change in sunlight is changed to gray by the white balance control, the color tone becomes unnatural. Therefore, an allowable movable range (RB gain movable range) is provided in the RB gain of the calculation result of the white balance control, and it is checked whether the RB gain of the calculation result is within this range.

【0050】規定値YmaxとYminとの選び方とし
ては、白画素を抽出するのが目的であるため、理想的に
は、7色のチャートを一定の照度で照明し、撮影してい
る状態で黄色よりも輝度が高く、上限までの値というこ
とになる。ただし、実際には、このように7色のチャー
トを一定の照度で照明する状態は存在しない。そこで、
あまり輝度が低い部分は除外するというようにして、そ
のときに使うセンサ等に応じて設定を行う。
Since the purpose of selecting the specified values Ymax and Ymin is to extract white pixels, ideally, a chart of seven colors is illuminated with a constant illuminance, and the yellow color is obtained in a shooting state. This is a value higher than the brightness and up to the upper limit. However, in reality, there is no state in which the chart of seven colors is illuminated with a constant illuminance. Therefore,
The setting is performed according to the sensor and the like to be used at that time by excluding a portion having a very low luminance.

【0051】次いで、次フレームRBゲイン計算部7で
は、白ピクセル積算部6で求めた色評価値に基づいて次
フレームのRBゲインを算出する。ホワイトバランス補
正前は被写体の白部分は光源色によって色がついている
ため、色評価値r、g、bは等しくない。ホワイトバラ
ンス補正後はこの白部分が白くなっているはずであるの
でr=g=bとなる。したがって、ホワイトバランスを
とるために必要なRアンプ4およびBアンプ5に設定さ
れるRB画素の各係数は、R画素の係数をGr、B画素
の係数をGbとすると、 Gr=g/r Gb=g/b (3) となる。
Next, the next frame RB gain calculator 7 calculates the RB gain of the next frame based on the color evaluation value obtained by the white pixel accumulator 6. Before the white balance correction, the white portion of the subject is colored by the light source color, so that the color evaluation values r, g, and b are not equal. After white balance correction, the white portion should be white, so that r = g = b. Therefore, the respective coefficients of the RB pixels set in the R amplifier 4 and the B amplifier 5 necessary for obtaining the white balance are as follows: Gr = g / r Gb where Gr is the coefficient of the R pixel and Gb is the coefficient of the B pixel. = G / b (3)

【0052】通常は、数フレームにわたってなめらかに
白く補正されるように、式(3)により求められたRB
ゲインを一定の割合でRBアンプに設定する。割合をd
(%)とすると、次フレームのRBゲインは、現在のR
BゲインをそれぞれcGr、cGbとすると、 Gr=(g/r−cGr)×d/100+cGr Gb=(g/b−cGb)×d/100+cGb (4) と表される。
Normally, the RB obtained by the equation (3) is corrected so that white is corrected smoothly over several frames.
The gain is set in the RB amplifier at a fixed rate. The proportion is d
(%), The RB gain of the next frame is
When the B gains are cGr and cGb, respectively, Gr = (g / r−cGr) × d / 100 + cGr Gb = (g / b−cGb) × d / 100 + cGb (4)

【0053】上記可動範囲判定部8によって、RBゲイ
ンがRBゲイン可動範囲内にあるかどうかを判定する可
動範囲判定手段が構成されている。可動範囲判定部8で
は、上記Gr、Gbが有彩色の物体色を白く引き込まな
いように定めたRBゲイン可動範囲内にあるかどうかを
判定する。本実施の形態では、図3中、斜線で示すよう
に、境界線としての次の6本の直線上および6本の直線
で囲まれた部分の内部を、RBゲインとして設定可能な
領域(RBゲイン可動範囲)としている。すなわち、 Gr=Grmin Gr=Grmax Gr=p×Gb+q Gb=Gbmin Gb=Gbmax Gr=p×Gb+q’ (5) である。
The movable range determining section 8 constitutes a movable range determining means for determining whether or not the RB gain is within the RB gain movable range. The movable range determination section 8 determines whether or not the Gr and Gb are within the RB gain movable range that is set so as not to draw the chromatic object color white. In this embodiment, as shown by hatching in FIG. 3, the region (RB gain) that can be set as an RB gain is set on the next six straight lines as a boundary line and inside a portion surrounded by the six straight lines. Gain movable range). That is, Gr = Grmin Gr = Grmax Gr = p × Gb + q Gb = Gbmin Gb = Gbmax Gr = p × Gb + q ′ (5)

【0054】図3において中央部の曲線Wは、太陽光の
光源色が季節や時刻、日陰、日向であるかといった照明
条件によって様々に変化した場合にホワイトバランスを
とるために設定されるRBゲインの軌跡を示しており、
上記のRBゲイン可動範囲も、太陽光が光源である場合
にホワイトバランス制御を行うよう、上記各境界線が曲
線Wを含みかつ多少幅(余裕)を持たせるように設定す
る。曲線Wは、太陽光に含まれない色は存在しないよう
になっているのに対応して、両端を有する有限の曲線と
なっている。曲線Wは、正確には、黒体輻射軌跡に基づ
くものである。すなわち、黒体輻射軌跡は、黒体(完全
放射体)を熱したときに発生する色の軌跡であり、赤い
色から、橙色、黄色、白色と変化する。この色を、ある
色を発生しているときの黒体の温度(色温度)で表現す
る。
In FIG. 3, a curve W at the center is an RB gain set for obtaining a white balance when the color of the light source of the sun light changes variously depending on the lighting conditions such as season, time, shade, and sunshine. Shows the trajectory of
The RB gain movable range is also set such that each boundary line includes the curve W and has a certain width (margin) so that white balance control is performed when sunlight is a light source. The curve W is a finite curve having both ends corresponding to the absence of the color not included in the sunlight. The curve W is precisely based on the blackbody radiation locus. That is, the black body radiation locus is a locus of a color generated when a black body (complete radiator) is heated, and changes from red to orange, yellow, and white. This color is represented by the temperature (color temperature) of a black body when a certain color is generated.

【0055】GrとGbとの限界値について述べる。上
述のように、赤い色は色温度が低く、青い色は色温度が
高い。そこで、カメラを設計するときに、どの程度赤い
光からどの程度青い光までを白くホワイトバランス制御
できるようにするかを考え、例えば赤いほうは色温度3
200Kから、青いほうは9100Kまでというように
決定する。この3200Kと9100Kとに相当するR
Bゲインがそれぞれ、(Grmin、Gbmax)、
(Grmax、Gbmin)となる。このようにしてG
rとGbとの限界値がそれぞれ設定される。なお、これ
らの限界値は、多少マージンをみて広げることもでき
る。
The limit value between Gr and Gb will be described. As described above, the red color has a low color temperature, and the blue color has a high color temperature. Therefore, when designing a camera, consider how much white light can be controlled from red light to blue light to a certain degree.
From 200K, the blue one is decided to 9100K. R corresponding to these 3200K and 9100K
B gains are (Grmin, Gbmax),
(Grmax, Gbmin). Thus, G
Limit values of r and Gb are set respectively. Note that these limit values can be extended with some margin.

【0056】本実施の形態では曲線Wをほぼ直線と見な
して、RBゲイン可動範囲を式(5)に示す直線により
設定しているが、RBゲイン可動範囲の境界線は直線に
よる必要はなく、曲線Wをそのまま上下それぞれに移動
し、この上下2本の曲線と4つの直線Gr=Grmi
n、Gr=Grmax、Gb=Gbmin、Gb=Gb
maxで囲まれる範囲としてもよい。あるいは、曲線W
を数本の折れ線で近似してもよい。
In the present embodiment, the curve W is regarded as a substantially straight line and the RB gain movable range is set by the straight line shown in the equation (5). However, the boundary of the RB gain movable range does not need to be a straight line. The curve W is moved up and down as it is, and the upper and lower two curves and four straight lines Gr = Grmi
n, Gr = Grmax, Gb = Gbmin, Gb = Gb
It may be a range surrounded by max. Alternatively, the curve W
May be approximated by several broken lines.

【0057】可動範囲外RBゲイン再計算部9では、可
動範囲判定部8でGr、GbがRBゲイン可動範囲外で
あった場合に、後述のようにRBゲインの再計算を行
う。
The RB gain recalculation unit 9 outside the movable range recalculates the RB gain as described later when Gr and Gb are outside the RB gain movable range in the movable range determination unit 8.

【0058】図4を用いて可動範囲判定部8の作用を説
明する。点Cは現在のRBゲインである。CはBゲイン
が低く、Rゲインが高いため、現在の光源が青い光であ
ることを示している。たとえば、晴天下において日陰に
ある被写体を撮影する場合や、太陽が雲に隠れ、青空の
みが光源となっている場合等である。いま、次のような
撮影シーンを想定し、そのときのRBゲインの変化を考
える。
The operation of the movable range determination section 8 will be described with reference to FIG. Point C is the current RB gain. C indicates that the current light source is blue light because the B gain is low and the R gain is high. For example, there is a case where a subject in the shade is photographed under fine weather, a case where the sun is hidden by clouds, and only the blue sky is a light source. Now, assuming the following photographic scene, a change in the RB gain at that time is considered.

【0059】白熱灯で照明された屋内から窓越しに屋外
の日陰になっている部分を撮影しているとする。この場
合ホワイトバランスがとれている状態ではRBゲインの
座標(Gb、Gr)は点Cのような位置にある。このと
き、急激にカメラを室内に向けたとする。そうすると固
体撮像素子1に入射する光は一転して赤い光となり、ホ
ワイトバランスをとるためにRゲインを減らし、かつ、
Bゲインを増す。しかしながら、室内の光源やカメラに
写り込む物体の色調によっては、RBゲインの変化は、
図4の斜線で示すRBゲイン可動範囲をはずれ、点Nに
移動する。すなわち、このように光源が青から赤に急激
に変わったときにすぐに完全にホワイトバランス制御し
ようとすると、このような点Nのように、RBゲイン可
動範囲をはずれた値が算出される。
It is assumed that an image of an outdoor shaded area is taken from a room illuminated by an incandescent lamp through a window. In this case, the coordinates (Gb, Gr) of the RB gain are at a position like point C in a state where the white balance is maintained. At this time, it is assumed that the camera is suddenly turned to the room. Then, the light incident on the solid-state imaging device 1 turns into red light, and the R gain is reduced to obtain white balance, and
Increase B gain. However, depending on the light source in the room and the color of the object reflected in the camera, the change in the RB gain is
The RB gain moves out of the RB gain movable range shown by oblique lines in FIG. In other words, if the white balance is to be completely controlled immediately when the light source suddenly changes from blue to red, a value out of the RB gain movable range, such as the point N, is calculated.

【0060】このように光源が青から赤に急激に変わっ
た場合に有彩色の影響を受けた場合の他にも、緑や紫等
の、黒体輻射軌跡から大きくはずれた色調の光源による
反射光に対してホワイトバランス制御を行った場合や、
また、被写体である、緑や紫等の、黒体輻射軌跡から大
きくはずれた色の物体(緑色や紫色の紙や服等)の反射
光に対してホワイトバランス制御を行った場合にも、上
記点Nのような位置となる。
As described above, in addition to the case where the light source suddenly changes from blue to red and is affected by the chromatic color, the reflection by the light source having a color tone such as green or purple, which greatly deviates from the blackbody radiation locus. When white balance control is performed on light,
Also, when white balance control is performed on reflected light of an object (green or purple paper, clothes, or the like) of a color that deviates greatly from the blackbody radiation locus, such as green or purple, as the subject. The position is like point N.

【0061】従来であれば、算出されたRBゲインがR
Bゲイン可動範囲をはずれると制御を停止するようにし
ているため、すでに述べたように、被写体の色調が急激
に変化した場合には、RBゲインが今後も変わらず、ホ
ワイトバランス制御がロックしてしまう。
Conventionally, the calculated RB gain is R
Since the control is stopped when the B gain is out of the movable range, as described above, if the color tone of the subject changes rapidly, the RB gain does not change in the future, and the white balance control is locked. I will.

【0062】一方、本実施の形態では、RBゲイン可動
範囲は定めているが、それだけでなく、算出されたRB
ゲインがRBゲイン可動範囲をはずれた場合でも、ホワ
イトバランス制御を、後述するように図4の点M等の点
までは行うようにしている。つまり、計算で得られた値
がRBゲイン可動範囲をはずれたら、可動範囲外RBゲ
イン再計算部9により、RBゲイン可動範囲の境界線上
の点が示すRBゲインを設定するよう制御を行うように
している。この結果、ロックアウトが生じず、赤い画面
は徐々に白に戻ることになる。
On the other hand, in the present embodiment, the RB gain movable range is determined.
Even when the gain deviates from the RB gain movable range, the white balance control is performed up to a point such as a point M in FIG. 4 as described later. That is, when the value obtained by the calculation falls outside the RB gain movable range, the RB gain recalculating unit 9 outside the movable range performs control so as to set the RB gain indicated by a point on the boundary of the RB gain movable range. ing. As a result, no lockout occurs, and the red screen gradually returns to white.

【0063】さらに、本実施の形態では、算出されたR
Bゲインが上述のようにRBゲイン可動範囲をはずれた
ときに、そのRBゲインを示す点(座標)、すなわち上
述のCRTから白熱灯への急激な変化の例でいえば、赤
い画面を白く戻すためのかなり小さいRゲインとかなり
大きいBゲインとを示す点Nと、原点Oとを結ぶ直線を
含む領域を考える。そして、この領域と、RBゲイン可
動範囲の境界線との交線上の点、例えば直線ONと上記
境界線との交点(点M)が示すRBゲインを設定し、そ
の結果、ベクトルCN同様、Rゲイン減少、Bゲイン増
加という方向にホワイトバランス制御を行うようにして
いる。それゆえ、よりスムーズに白へと戻っていくよう
にすることができる。
Further, in the present embodiment, the calculated R
When the B gain deviates from the RB gain movable range as described above, a point (coordinate) indicating the RB gain, that is, in the example of the above-described rapid change from the CRT to the incandescent lamp, the red screen is returned to white. A region including a straight line connecting a point N indicating a very small R gain and a very large B gain for the purpose and an origin O is considered. Then, an RB gain indicated by a point on the intersection of this region and the boundary line of the RB gain movable range, for example, an intersection (point M) between the straight line ON and the boundary line is set. The white balance control is performed in the direction of decreasing the gain and increasing the B gain. Therefore, it is possible to smoothly return to white.

【0064】なお、被写体自身が緑であるものを白(正
確にはグレー)画素とみなした場合も上記のように境界
線上のRBゲインを設定することになるが、ホワイトバ
ランス制御は継続しているので、この場合でも、正しい
色調の画像へと徐々に変化していく。
Note that when the subject itself is regarded as a green pixel as a white (accurately, gray) pixel, the RB gain on the boundary line is set as described above, but the white balance control is continued. Therefore, even in this case, the image gradually changes to an image having a correct color tone.

【0065】次に、上記RBゲイン設定処理の詳細につ
いて述べる。上記点Nは、本来有彩色を引き込むことを
防止するために設けられたRBゲイン可動範囲の外にあ
り、本実施の形態では、その目的上、点NのRBゲイン
を設定することはできない。本実施の形態では、可動範
囲外RBゲイン再計算部9により、まず、原点Oと点N
とを結んでできる直線ONから所定の距離以内にある点
からなる、所定範囲としての領域(Sとする)を設定す
る。すなわち、図5に示すように、まず、直線ONを、
横軸(Gb)方向正の向きにΔBだけずらす。できた直
線と、後述のように全境界線のうちで点Nに最も近い境
界線である直線Gr=p×Gb+qとの交点をJとす
る。なお、直線Gr=p×Gb+q’との同様の交点を
Fとする。同様に、直線ONを、横軸方向負の向きにΔ
Bだけずらす。できた直線と直線Gr=p×Gb+qと
の交点をKとする。なお、直線Gr=p×Gb+q’と
の同様の交点をHとする。
Next, details of the RB gain setting process will be described. The point N is outside the RB gain movable range originally provided to prevent the drawing in of a chromatic color, and in the present embodiment, the RB gain of the point N cannot be set for the purpose. In the present embodiment, the origin O and the point N
Is set as a predetermined range (hereinafter, referred to as S), which includes points within a predetermined distance from a straight line ON formed by connecting. That is, as shown in FIG.
It is shifted by ΔB in the positive direction on the horizontal axis (Gb). Let J be the intersection of the resulting straight line and the straight line Gr = p × Gb + q which is the boundary line closest to the point N among all the boundary lines as described later. Note that a similar intersection with the straight line Gr = p × Gb + q ′ is F. Similarly, the straight line ON is shifted by Δ in the negative direction on the horizontal axis.
Shift by B. Let K be the intersection of the resulting straight line and the straight line Gr = p × Gb + q. Note that the same intersection with the straight line Gr = p × Gb + q ′ is set to H.

【0066】このようにΔBずらしてできた2直線とR
Gゲイン可動範囲とで囲まれた部分、すなわち直線JF
と直線KHとで囲まれた帯状の部分が領域Sである。
The two straight lines shifted by ΔB and R
A portion surrounded by the G gain movable range, that is, a straight line JF
A band-shaped portion surrounded by and the straight line KH is a region S.

【0067】なお、正の向きにずらす量と、負の向きに
ずらす量とは、異なった値でもよい。
The amount of shift in the positive direction and the amount of shift in the negative direction may be different values.

【0068】上記の所定範囲、またしたがってずらす量
(ΔB)は、操作者が補正後の色調としてどのようなも
のが得られるようにしたいかといった希望や、ΔBの大
きさが他の要素に与える影響等に応じ、それを参酌して
操作者が任意に決めることができる。すなわち、RBゲ
インの可変ステップは、ホワイトバランス制御速度を決
める元となる。上記所定範囲を決めるためのΔBは、こ
のRBゲインの可変ステップに比べて小さい値とするこ
とが好ましい。このとき、ΔBを大きくするとホワイト
バランス制御速度が遅くなり、ΔBを小さくするとホワ
イトバランス制御速度を速くすることができる。
The above-mentioned predetermined range, and thus the amount of shift (ΔB), gives the operator the desire to obtain what color tone after correction, and the magnitude of ΔB gives other factors. The operator can arbitrarily determine the influence according to the influence and the like. That is, the variable step of the RB gain is the basis for determining the white balance control speed. ΔB for determining the predetermined range is preferably set to a value smaller than the variable step of the RB gain. At this time, increasing ΔB decreases the white balance control speed, and decreasing ΔB increases the white balance control speed.

【0069】また、調整後に得られるRBゲインの値と
しては、点Nが示すRBゲインと比べて、その制御方向
が同一であることが好ましい。すなわち、例えばこの図
4に示す場合であれば、点Cから点Nへ向かう制御は
「Bゲイン増加、Rゲイン減少」である。そのため、調
整後に得られるRBゲインの値としては、同じく「Bゲ
イン増加、Rゲイン減少」となる値を設定することが好
ましい。そして、上記のの所定の範囲としては、このよ
うに調整後に得られるRBゲインが、点Nが示すRBゲ
インと比べて制御方向が同一となるような範囲とするこ
とが好ましい。
The value of the RB gain obtained after the adjustment is preferably the same as that of the RB gain indicated by the point N in the same control direction. That is, for example, in the case shown in FIG. 4, the control from point C to point N is "B gain increase, R gain decrease". Therefore, as the value of the RB gain obtained after the adjustment, it is preferable to similarly set a value that becomes “B gain increase, R gain decrease”. The above-mentioned predetermined range is preferably set so that the RB gain obtained after the adjustment in this way has the same control direction as the RB gain indicated by the point N.

【0070】また、図5に示すようにここでは直線FK
と縦軸とが互いに平行であるが、これに限定されない。
このように直線FKと縦軸(Gr軸)とを互いに平行に
することにより、RBゲイン可動範囲を決める6本の直
線のうち斜めの2本(直線Gr=p×Gb+qと直線G
r=p×Gb+q’)の間の距離(間隔)をΔBに簡単
に反映させることができる。すなわち、この斜めの線の
間隔が広ければ、RBゲイン可動範囲が広いということ
であり、このときはΔBも大きくしてよい。一方、この
斜めの線の間隔が狭ければ、RBゲイン可動範囲が狭い
ということであり、このときはΔBも小さくあるべきで
ある。直線FKと縦軸とを互いに平行にすることによ
り、この原理に忠実に、かつ、少ない演算量で、ΔB、
ひいては設定すべきRBゲインを求めることができる。
Also, as shown in FIG.
And the vertical axis are parallel to each other, but are not limited thereto.
By making the straight line FK and the vertical axis (Gr axis) parallel to each other, two diagonal lines (the straight line Gr = p × Gb + q and the straight line G) out of the six straight lines that determine the RB gain movable range are set.
r = p × Gb + q ′) can be easily reflected in ΔB. That is, if the interval between the oblique lines is wide, the RB gain movable range is wide, and in this case, ΔB may be increased. On the other hand, if the interval between the oblique lines is narrow, it means that the RB gain movable range is narrow. At this time, ΔB should be small. By making the straight line FK and the vertical axis parallel to each other, ΔB,
Consequently, the RB gain to be set can be obtained.

【0071】点Nの位置としては様々なものがありうる
が、例えば、RBゲイン可動範囲を構成する直線のひと
つGr=p×Gb+qよりも上にある場合や、Gr=p
×Gb+q’よりも下にある場合がある。あるいは、そ
れら2直線間ではあるが、他の境界線としての直線すな
わち直線Gb=Gbmin、Gr=Grmax、Gb=
GbmaxまたはGr=Grminによって範囲外とな
っているような場合もありうる。
The position of the point N can be various. For example, one of the straight lines constituting the movable range of the RB gain, Gr = p × Gb + q, or Gr = p
× Gb + q ′ in some cases. Alternatively, a straight line Gb = Gbmin, Gr = Grmax, Gb =
Gbmax or Gr = Grmin may be outside the range.

【0072】本実施の形態では、点Nが、RBゲイン可
動範囲を構成する直線のひとつGr=p×Gb+qより
も上にあるため、直線Gr=p×Gb+qのほうが、直
線Gr=p×Gb+q’よりも、点Nに近い。また、他
の全ての境界線としての直線すなわち直線Gb=Gbm
in、Gr=Grmax、Gb=Gbmax、Gr=G
rminと比べても、直線Gr=p×Gb+qが、最も
点Nに近い。そのため、上記領域Sと直線Gr=p×G
b+qとの交線上の点を求め、その座標のGr、Gbを
次フレームのRBゲインとしてRBアンプに設定する。
この交線とは、図5中、線分JKである。
In the present embodiment, since the point N is above one of the straight lines constituting the RB gain movable range, Gr = p × Gb + q, the straight line Gr = p × Gb + q is more straight line Gr = p × Gb + q. Is closer to point N than '. Also, a straight line as all other boundary lines, that is, a straight line Gb = Gbm
in, Gr = Grmax, Gb = Gbmax, Gr = G
The straight line Gr = p × Gb + q is closest to the point N as compared with rmin. Therefore, the region S and the straight line Gr = p × G
A point on the line of intersection with b + q is determined, and Gr and Gb at the coordinates are set in the RB amplifier as the RB gain of the next frame.
This intersection is a line segment JK in FIG.

【0073】つまり、全ての境界線としての直線すなわ
ち直線Gr=p×Gb+q、Gr=p×Gb+q’、G
b=Gbmin、Gr=Grmax、Gb=Gbma
x、Gr=Grminのなかで最も点Nに近い直線をそ
の都度求める。そして、上記領域Sとその直線との交線
上の点を求め、その座標のGr、Gbを次フレームのR
BゲインとしてRBアンプに設定する。
That is, straight lines as all boundary lines, ie, straight lines Gr = p × Gb + q, Gr = p × Gb + q ′, G
b = Gbmin, Gr = Grmax, Gb = Gbma
A straight line closest to the point N in x, Gr = Grmin is obtained each time. Then, a point on the line of intersection of the area S and the straight line is obtained, and Gr and Gb of the coordinates are converted to R of the next frame.
The RB amplifier is set as the B gain.

【0074】このように、本実施の形態においては、点
Nに基づき形成される、点Nを含んだある領域(領域
S)と、RBゲイン可動範囲の境界線のうちで点Nに最
も近い境界線との交線上の点に設定する。特に、ここで
は、直線ONと、直線Gr=p×Gb+qとの交点Mを
求め、その座標のGr、Gbを次フレームのRBゲイン
としてRBアンプに設定する。すなわち、上記の所定距
離が0である場合であり、したがって、ずらす量(Δ
B)が0である場合である。
As described above, in the present embodiment, a region (region S) including point N and formed on the basis of point N is closest to point N among the boundaries of the RB gain movable range. Set to a point on the line of intersection with the boundary line. In particular, here, an intersection M between the straight line ON and the straight line Gr = p × Gb + q is determined, and Gr and Gb of the coordinates are set in the RB amplifier as the RB gain of the next frame. That is, this is the case where the above-mentioned predetermined distance is 0, and therefore, the shift amount (Δ
B) is 0.

【0075】なお、例えば、直線Gr=p×Gb+q’
上の点、例えばこの直線と直線ONとの交点Lの近傍の
点、なかでも特に、この直線と、点C(図4参照)を通
り縦軸に平行な直線との交点の座標のGr、Gbを次フ
レームのRBゲインとしてRBアンプに設定した場合
は、調整前すなわち点Cと比べて、Rゲインが減少し、
Bゲインはそのままとなるため、マゼンタ色となる。
For example, a straight line Gr = p × Gb + q ′
An upper point, for example, a point near an intersection L of the straight line and the straight line ON, and particularly, a coordinate Gr of an intersection of the straight line and a straight line passing through the point C (see FIG. 4) and parallel to the vertical axis, When Gb is set as the RB gain of the next frame in the RB amplifier, the R gain decreases as compared to before the adjustment, that is, at the point C,
Since the B gain remains unchanged, the color becomes magenta.

【0076】直線ONと、RBゲイン可動範囲の境界線
のうちで点Nに最も近い境界線との交点の座標(Gb_
m,Gr_m)は、次の式で求められる。すなわち、同
図に示すように点Nが直線Gr=p×Gb+qよりも上
にあるときは、 (Gb_m,Gr_m)=(q/(a−p),q/(a−p)×a) (6) となり(点M)、一方、点Nが直線Gr=p×Gb+
q’よりも下にあるとき(図示せず)は、 (Gb_m,Gr_m)=(q’/(a−p),q’/(a−p)×a) (7) となり、これは同図中、点Lに相当する。
The coordinates (Gb_G) of the intersection of the straight line ON and the boundary line closest to the point N among the boundary lines of the RB gain movable range.
m, Gr_m) is obtained by the following equation. That is, when the point N is located above the straight line Gr = p × Gb + q as shown in the figure, (Gb_m, Gr_m) = (q / (ap), q / (ap) × a) (6) (Point M), while the point N is a straight line Gr = p × Gb +
When it is below q ′ (not shown), (Gb_m, Gr_m) = (q ′ / (ap), q ′ / (ap) × a) (7) In the figure, it corresponds to the point L.

【0077】このような交点MやL等の座標に相当する
RBゲインをRアンプおよびBアンプにそれぞれ設定す
ることにより、目標のRBゲインがRBゲイン可動範囲
の外にあるときでも、RBゲイン可動範囲を決める直線
(境界線)上の値がRBゲインとして設定されるため、
有彩色を引き込むことなく、また、RBゲインのロック
アウトを発生させず、なめらかなホワイトバランス制御
動作を実現する事が可能である。
By setting the RB gain corresponding to the coordinates of the intersections M and L in the R amplifier and the B amplifier respectively, even when the target RB gain is out of the RB gain movable range, the RB gain can be adjusted. Since the value on the straight line (boundary line) that determines the range is set as the RB gain,
It is possible to realize a smooth white balance control operation without drawing in a chromatic color and without generating an RB gain lockout.

【0078】このように点M等のRBゲインを設定した
後の画像の色調変化についていえば、カメラが取り込む
画像の色がどう変化するかによっても変わるが、RBゲ
インは、上記設定値(上記例では点M)から若干移動す
る程度に落ち着く。ただし、毎回新しいRBゲインを設
定していくようになっているため、別の被写体を撮影す
ると、RBゲインは、その被写体における白画素該当部
分を白く引き込むように変化していく。
The change in the color tone of the image after the RB gain of the point M and the like is set as described above also changes depending on how the color of the image captured by the camera changes. In the example, it calms down to the extent that it moves slightly from the point M). However, since a new RB gain is set every time, when another subject is photographed, the RB gain changes so as to draw a portion corresponding to a white pixel in the subject to white.

【0079】なお、本発明は、特に、上記固体撮像素子
1等を用いて実際の被写体を撮影する場合に、被写体の
色や光源の色の急激な変化に対応でき、特に有用であ
る。しかしながら、これに限らず、固体撮像素子1、A
/Dコンバータ2およびOBオフセットクランプ3を用
いる代わりに、これらの部材による処理によって得られ
るのと同様の、動画データとしての画像信号を外部の記
憶媒体に記録しておき、その記録媒体からその動画デー
タを次々に読み出してそのホワイトバランスの調整処理
を行うようにすることもできる。
The present invention is particularly useful when an actual subject is photographed using the solid-state imaging device 1 or the like, because it can cope with a sudden change in the color of the subject or the color of the light source. However, the present invention is not limited to this, and the solid-state imaging device 1, A
Instead of using the / D converter 2 and the OB offset clamp 3, an image signal as moving image data similar to that obtained by processing by these members is recorded on an external storage medium, and the moving image is recorded from the recording medium. It is also possible to read out the data one after another and perform the white balance adjustment process.

【0080】次に、上記処理をコンピュータソフトウェ
アにて行う場合について述べる。図1に示す各ブロック
のうちの任意の部材、例えば、次フレームRBゲイン計
算部7、可動範囲判定部8および可動範囲外RBゲイン
再計算部9は、専用のハードウェアによらずマイクロコ
ンピュータにより実行されるソフトウェアによって実現
されるものであってもよい。また、このソフトウェア
は、フロッピーディスクや、MO、メモリカードといっ
た記録媒体に、自動露出調整方法を提供するプログラム
といっしょに記録され、カメラ装置に読み込まれマイク
ロコンピュータによって実行される形態でもよい。画素
値の積算は高速の動作が要求されるため、一般にはハー
ドウェアによって実現されることが多い。
Next, a case where the above processing is performed by computer software will be described. Arbitrary members of the blocks shown in FIG. 1, for example, the next frame RB gain calculation unit 7, the movable range determination unit 8, and the RB gain recalculation unit 9 outside the movable range are not controlled by dedicated hardware but by a microcomputer. It may be realized by software to be executed. This software may be recorded on a recording medium such as a floppy disk, MO, or memory card together with a program for providing an automatic exposure adjustment method, read into a camera device, and executed by a microcomputer. Since the integration of pixel values requires a high-speed operation, it is often realized by hardware in general.

【0081】図6および図7を用いてソフトウェア制御
による処理について説明する。なお、ここで行うホワイ
トバランス制御の内容は、ソフトウェア制御で行うとい
う点以外については、上記の図1の構成について述べた
のと同一である。そのため、以下では、主として、ソフ
トウェア制御で行うという点について述べることとす
る。
The processing under software control will be described with reference to FIGS. 6 and 7. The contents of the white balance control performed here are the same as those described with reference to the configuration in FIG. 1 except that the white balance control is performed by software control. Therefore, in the following, the point that the control is performed mainly by software will be described.

【0082】ここでは、固体撮像素子21、A/Dコン
バータ22、OBオフセットクランプ23、Rアンプ2
4、Bアンプ25、および白ピクセル積算部26はそれ
ぞれ、図1に示す固体撮像素子1、A/Dコンバータ
2、OBオフセットクランプ3、Rアンプ4、Bアンプ
5、および白ピクセル積算部6と同一のものを用いてい
る。すなわち、21は固体撮像素子であり、被写体の画
像情報を光電変換する。光電変換されたアナログ画像電
気情報をA/Dコンバータ22でデジタルデータに変換
し、OBオフセットクランプ23により、固体撮像素子
21に設けられている光が遮断され光電変換が行われな
い部分の出力信号がゼロとなるようにクランプされる。
Here, the solid-state image pickup device 21, A / D converter 22, OB offset clamp 23, R amplifier 2
4, the B amplifier 25, and the white pixel accumulator 26 are respectively a solid-state image sensor 1, an A / D converter 2, an OB offset clamp 3, an R amplifier 4, a B amplifier 5, and a white pixel accumulator 6 shown in FIG. The same is used. That is, reference numeral 21 denotes a solid-state imaging device, which photoelectrically converts image information of a subject. The analog image electrical information subjected to the photoelectric conversion is converted into digital data by the A / D converter 22, and the OB offset clamp 23 cuts off the light provided on the solid-state imaging device 21 and outputs the signal at the portion where the photoelectric conversion is not performed. Is clamped to be zero.

【0083】Rアンプ24およびBアンプ25はそれぞ
れR画素、B画素の出力信号を増幅して後段処理部30
へ出力する色信号アンプ(Rゲイン増幅手段、Bゲイン
増幅手段)であり、これらの色信号アンプのゲイン(R
ゲイン、Bゲイン)を調節し、ホワイトバランス制御を
行う。すなわち、被写体の白い部分のR,G,B各画素
の出力値が等しくなるようにRBアンプのゲインを調節
することにより被写体の白部分が白く再現されるように
制御する。なお、Rアンプ24およびBアンプ25をR
Bアンプと総称する。
The R amplifier 24 and the B amplifier 25 amplify the output signals of the R and B pixels, respectively, and
Color signal amplifiers (R gain amplifying means and B gain amplifying means) for outputting the gains (R
Gain and B gain) to perform white balance control. That is, by controlling the gain of the RB amplifier so that the output values of the R, G, and B pixels of the white portion of the subject become equal, the white portion of the subject is controlled to be reproduced white. Note that the R amplifier 24 and the B amplifier 25
It is generically called B amplifier.

【0084】白ピクセル積算部26は、ホワイトバラン
スがとれていない場合に被写体を撮像したデジタル画像
信号において白い部分にどれだけの色成分が含まれてい
るかを計算する。被写体の白い部分は、赤から青までの
様々な色変化を伴う太陽光を反射することにより光源色
同様赤から青っぽい色までの変化を示す。
The white pixel accumulating section 26 calculates how many color components are included in a white portion in a digital image signal obtained by photographing a subject when white balance is not achieved. The white portion of the subject reflects the sunlight accompanied by various color changes from red to blue, and shows a change from red to bluish as well as the light source color.

【0085】マイクロコンピュータ27は、次フレーム
RBゲイン計算部7、可動範囲判定部8および可動範囲
外RBゲイン再計算部9の役割を有し、内部にマスクR
OMを内蔵しており、図7のフローチャートに示すソフ
トウェアおよび、自動露出調整を行うソフトウェアが書
き込まれている。
The microcomputer 27 has a role of the next frame RB gain calculation section 7, the movable range determination section 8, and the RB gain recalculation section 9 outside the movable range.
OM is built in, and software shown in the flowchart of FIG. 7 and software for performing automatic exposure adjustment are written.

【0086】次に、マイクロコンピュータ27に内蔵さ
れたソフトウェアの処理手順について図7を用いて説明
する。ステップ1(以下ステップを単にSと表記す
る。)にて、まず、白ピクセル積算部26が、前記式
(1)および式(2)で示す条件で白画素の抽出および
色成分IおよびQの積算値を出力する。そして、マイク
ロコンピュータ27に内蔵された上記ソフトウェアが、
この積算値を画素の総数で除することにより1フレーム
の画像の色評価値r、g、bを求める。
Next, the processing procedure of the software built in the microcomputer 27 will be described with reference to FIG. In step 1 (hereinafter, the step is simply referred to as S), first, the white pixel integrator 26 extracts white pixels and calculates the color components I and Q under the conditions shown in the above equations (1) and (2). Output the integrated value. Then, the software built in the microcomputer 27 is
By dividing this integrated value by the total number of pixels, the color evaluation values r, g, and b of the image of one frame are obtained.

【0087】S2では、S1で求めた色評価値(r、
g、b)に基づいて次フレームのRBゲインを算出す
る。ホワイトバランス補正前は被写体の白部分は光源色
によって色がついているため、色評価値r、g、bは等
しくない。ホワイトバランス補正後はこの白部分が白く
なっているはずであるのでr=g=bとなる。したがっ
て、ホワイトバランスをとるために必要なRアンプ24
およびBアンプ25に設定されるRB画素の各係数は、
R画素の係数をGr、B画素の係数をGbとすると、前
記式(3)となる。
In S2, the color evaluation value (r, r,
The RB gain of the next frame is calculated based on g and b). Before the white balance correction, the white portion of the subject is colored by the light source color, so that the color evaluation values r, g, and b are not equal. After white balance correction, the white portion should be white, so that r = g = b. Therefore, the R amplifier 24 necessary for white balance is required.
And each coefficient of the RB pixel set in the B amplifier 25 is
If the coefficient of the R pixel is Gr and the coefficient of the B pixel is Gb, the above equation (3) is obtained.

【0088】通常は、数フレームにわたってなめらかに
白く補正されるように、前記式(3)により求められた
RBゲインを一定の割合でRBアンプに設定する。割合
をd(%)とすると、次フレームのRBゲインは、現在
のRBゲインをそれぞれcGr、cGbすると、前記式
(4)のように表される(S3)。
Normally, the RB gain obtained by the above equation (3) is set in the RB amplifier at a constant rate so that the white is corrected smoothly over several frames. Assuming that the ratio is d (%), the RB gain of the next frame is expressed by the above equation (4), where the current RB gain is cGr and cGb, respectively (S3).

【0089】マイクロコンピュータ27は、上述の通り
可動範囲設定部8としての機能も持っており、上記G
r、Gbが、有彩色の物体色を白く引き込まないように
定めたRBゲイン可動範囲内にあるかどうかを判定する
(S4)。本実施の形態では図3に示すように、前記式
(5)に示す6本の直線上および6本の直線で囲まれた
部分の内部のみを、RBゲインとして設定可能な領域と
している。上記Gr、GbがRBゲイン可動範囲内であ
れば、GrをRアンプに、GbをBアンプにそれぞれ設
定する(S5)。一方、上記Gr、GbがRBゲイン可
動範囲内でなければ、S6、S7、S8へと進む。
The microcomputer 27 also has a function as the movable range setting section 8 as described above, and
It is determined whether or not r and Gb are within the RB gain movable range which is set so as not to draw the chromatic object color white (S4). In the present embodiment, as shown in FIG. 3, only the area on the six straight lines and the area surrounded by the six straight lines shown in the above equation (5) is a region that can be set as the RB gain. If Gr and Gb are within the RB gain movable range, Gr is set to the R amplifier, and Gb is set to the B amplifier (S5). On the other hand, if Gr and Gb are not within the RB gain movable range, the process proceeds to S6, S7 and S8.

【0090】前述のように、図3において、中央部の曲
線Wは、太陽光の光源色が季節や時刻、日陰、日向であ
るかといった照明条件によって様々に変化した場合にホ
ワイトバランスをとるために設定されるRBゲインの軌
跡を示しており、RBゲインの可動範囲も太陽光が光源
である場合にホワイトバランス制御を行うよう、曲線W
を含みかつ多少幅を持たせるように設定する。
As described above, in FIG. 3, the curve W at the center is used to balance the white light when the color of the light source of the sun varies variously depending on the lighting conditions such as the season, time, shade, and sunshine. Shows the locus of the RB gain set in the curve W. The movable range of the RB gain also indicates the curve W so that white balance control is performed when sunlight is the light source.
Is set to have a certain width.

【0091】本実施の形態では、曲線Wをほぼ直線と見
なして、RB可動範囲を前記式(5)に示す直線により
設定しているが、RBゲインの可動範囲は直線による必
要はなく、曲線Wをそのまま上下それぞれに移動し、上
下2本の曲線とGr=Grmin、Gr=Grmax、
Gb=Gbmin、Gb=Gbmaxで形成される範囲
であってもよい。あるいは、曲線Wを数本の折れ線で近
似してもよい。
In the present embodiment, the curve W is regarded as a substantially straight line, and the RB movable range is set by the straight line represented by the equation (5). However, the movable range of the RB gain does not need to be a straight line. W is moved up and down respectively, and two upper and lower curves, Gr = Grmin, Gr = Grmax,
The range formed by Gb = Gbmin and Gb = Gbmax may be used. Alternatively, the curve W may be approximated by several broken lines.

【0092】マイクロコンピュータ27は、上述の通
り、可動範囲外RBゲイン再計算部9としての機能も持
っており、可動範囲判定部8として動作した結果Gr、
GbがRBゲイン可動範囲外であった場合に、RBゲイ
ンの再計算を行う。
As described above, the microcomputer 27 also has a function as the out-of-movement-range RB gain recalculation unit 9, and as a result of operating as the movable-range determination unit 8, Gr,
When Gb is out of the RB gain movable range, the RB gain is recalculated.

【0093】図4を用いて、マイクロコンピュータ27
の可動範囲判定部8としての作用を説明する。すなわ
ち、すでに述べたように、点Cは現在のRBゲインであ
る。CはBゲインが低く、Rゲインが高いため現在の光
源が青い光であることを示している。たとえば、晴天に
日陰である場合や、太陽が雲に隠れ、青空が光源となっ
ている場合である。いま、次のような撮影シーンを想定
し、そのときのRBゲインの変化を考える。
Referring to FIG.
The operation as the movable range determination unit 8 will be described. That is, as described above, point C is the current RB gain. C indicates that the current light source is blue light because the B gain is low and the R gain is high. For example, there is a case where there is a shade on a sunny day, or a case where the sun is hidden by clouds and the blue sky is a light source. Now, assuming the following photographic scene, a change in the RB gain at that time is considered.

【0094】白熱灯で照明された屋内から窓越しに屋外
の日陰になっている部分を撮影しているとする。この場
合ホワイトバランスがとれている状態ではRBゲインの
座標(Gb、Gr)は点Cのような位置にある。このと
き、急激にカメラを室内に向けたとする。そうすると固
体撮像素子21に入射する光は一転して赤い光となり、
ホワイトバランスをとるためにRゲインを減らし、か
つ、Bゲインを増す。しかしながら室内の光源が太陽光
と異なる場合、RBゲインの変化は図4のグレーの範囲
をはずれ、点Nに移動する。点Nは、本来有彩色を引き
込むことを防止するために設けられたRBゲイン可動範
囲の外にあり、その目的上、点NのRBゲインを設定す
ることはできない。
It is assumed that an image of an outdoor shaded area is taken from a room illuminated by an incandescent lamp through a window. In this case, the coordinates (Gb, Gr) of the RB gain are at a position like point C in a state where the white balance is maintained. At this time, it is assumed that the camera is suddenly turned to the room. Then, the light incident on the solid-state imaging device 21 turns into red light,
The R gain is reduced and the B gain is increased to achieve white balance. However, when the light source in the room is different from the sunlight, the change in the RB gain moves out of the gray range in FIG. The point N is outside the RB gain movable range originally provided to prevent the drawing in of a chromatic color, and for that purpose, the RB gain at the point N cannot be set.

【0095】本実施の形態では、すでに述べたように、
点NがRBゲイン可動範囲を構成する直線のひとつGr
=p×Gb+qよりも上にあるため、原点Oを結ぶ直線
ONと、直線Gr=p×Gb+qとの交点Mを求め、そ
の座標のGr、Gbを次フレームのRBゲインとしてR
Bアンプに設定する(図7中、S6、S7、S8)。点
NがGr=p×Gb+q’よりも下にある場合は、直線
ONとGr=p×Gb+q’との交点Lを次フレームの
RBゲインとしてRBアンプに設定する。このとき、交
点M(またはL)の座標(Gb_m,Gr_m)は次の
式で求められる。すなわち、点Nが直線Gr=p×Gb
+qよりも上にあるときは前記式(6)のようになり、
点Nが直線Gr=p×Gb+q’よりも下にあるときは
前記式(7)のようになる。
In this embodiment, as described above,
The point N is one of the straight lines Gr constituting the RB gain movable range.
= P × Gb + q, the intersection M of the straight line ON connecting the origin O and the straight line Gr = p × Gb + q is determined, and Gr and Gb of the coordinates are set as R and B gains of the next frame.
Set to B amplifier (S6, S7, S8 in FIG. 7). When the point N is below Gr = p × Gb + q ′, the intersection L of the straight line ON and Gr = p × Gb + q ′ is set in the RB amplifier as the RB gain of the next frame. At this time, the coordinates (Gb_m, Gr_m) of the intersection M (or L) are obtained by the following equation. That is, the point N is a straight line Gr = p × Gb
When it is higher than + q, the above equation (6) is obtained.
When the point N is below the straight line Gr = p × Gb + q ′, the above equation (7) is obtained.

【0096】このような交点MやL等の座標に相当する
RBゲインをRアンプ24およびBアンプ25にそれぞ
れ設定することにより、目標のRBゲインがRBゲイン
可動範囲の外にあるときでも、RBゲイン可動範囲を決
める直線(境界線)上の値がRBゲインとして設定され
るため、有彩色を引き込むことなく、また、なめらかな
ホワイトバランス制御動作を実現することが可能であ
る。
By setting the RB gain corresponding to the coordinates of the intersections M and L in the R amplifier 24 and the B amplifier 25 respectively, even when the target RB gain is out of the movable range of the RB gain, Since the value on the straight line (boundary line) that determines the gain movable range is set as the RB gain, it is possible to realize a smooth white balance control operation without drawing in chromatic colors.

【0097】〔実施の形態2〕本発明の他の実施の形態
について図8に基づいて説明すれば、以下の通りであ
る。なお、説明の便宜上、前記の実施の形態の図面に示
した部材と同一の機能を有する部材には、同一の符号を
付記してその説明を省略する。
[Second Embodiment] The following will describe another embodiment of the present invention with reference to FIG. For convenience of explanation, members having the same functions as the members shown in the drawings of the above-described embodiment are denoted by the same reference numerals, and description thereof will be omitted.

【0098】実施の形態1同様にしてRBゲイン可動範
囲外の点Nが得られた場合に、本実施の形態において
は、実施の形態1同様、点Nに基づき形成される、点N
を含んだある領域と、RBゲイン可動範囲の境界線のう
ちで点Nに最も近い境界線との交線上の点に設定すると
いう考え方に基づいて処理する。その詳細を以下に述べ
る。
When a point N outside the RB gain movable range is obtained in the same manner as in the first embodiment, in the present embodiment, the point N is formed based on the point N as in the first embodiment.
Is set to a point on the intersection of a certain region including the boundary and the boundary line closest to the point N among the boundary lines of the RB gain movable range. The details are described below.

【0099】まず、点Cと点Nとを結んでできる直線C
Nから所定の距離以内にある点からなる領域(Tとす
る)を設定する。すなわち、図8に示すように、まず、
直線CNを、横軸(Gb)方向正の向きにΔBだけずら
す。できた直線と、後述のように全境界線のうちで点N
に最も近い境界線である直線Gr=p×Gb+qとの交
点をJ’とする。同様に、直線CNを、横軸方向負の向
きにΔBだけずらす。できた直線と直線Gr=p×Gb
+qとの交点をK’とする。このようにΔBずらしてで
きた2直線とRGゲイン可動範囲とで囲まれた帯状の部
分が領域Tである。
First, a straight line C connecting point C and point N
An area (referred to as T) consisting of points within a predetermined distance from N is set. That is, as shown in FIG.
The straight line CN is shifted by ΔB in the positive direction along the horizontal axis (Gb). The resulting straight line and the point N of the whole boundary line as described later
The intersection with the straight line Gr = p × Gb + q, which is the boundary line closest to, is defined as J ′. Similarly, the straight line CN is shifted by ΔB in the negative direction along the horizontal axis. Straight line and straight line Gr = p × Gb
The intersection with + q is K ′. A band-shaped portion surrounded by the two straight lines shifted by ΔB and the RG gain movable range is a region T.

【0100】なお、上記のずらす量(ΔB)の決定の仕
方については、実施の形態1と同様である。このため説
明を省略する。
The method of determining the shift amount (ΔB) is the same as in the first embodiment. Therefore, the description is omitted.

【0101】本実施の形態では、点Nが、RBゲイン可
動範囲を構成する直線のひとつGr=p×Gb+qより
も上にあるため、直線Gr=p×Gb+qのほうが、直
線Gr=p×Gb+q’よりも、点Nに近い。また、他
の全ての境界線としての直線すなわち直線Gb=Gbm
in、Gr=Grmax、Gb=Gbmax、Gr=G
rminと比べても、直線Gr=p×Gb+qが、最も
点Nに近い。そのため、上記領域Tと直線Gr=p×G
b+qとの交線上の点を求め、その座標のGr、Gbを
次フレームのRBゲインとしてRBアンプに設定する。
この交線とは、図8中、線分J’K’である。
In this embodiment, since the point N is above one of the straight lines constituting the RB gain movable range, Gr = p × Gb + q, the straight line Gr = p × Gb + q is more straight line Gr = p × Gb + q. Is closer to point N than '. Also, a straight line as all other boundary lines, that is, a straight line Gb = Gbm
in, Gr = Grmax, Gb = Gbmax, Gr = G
The straight line Gr = p × Gb + q is closest to the point N as compared with rmin. Therefore, the region T and the straight line Gr = p × G
A point on the line of intersection with b + q is determined, and Gr and Gb at the coordinates are set in the RB amplifier as the RB gain of the next frame.
This intersection is a line segment J'K 'in FIG.

【0102】つまり、全ての境界線としての直線すなわ
ち直線Gr=p×Gb+q、Gr=p×Gb+q’、G
b=Gbmin、Gr=Grmax、Gb=Gbma
x、Gr=Grminのなかで最も点Nに近い直線をそ
の都度求める。そして、上記領域Tとその直線との交線
上の点を求め、その座標のGr、Gbを次フレームのR
BゲインとしてRBアンプに設定する。
That is, straight lines as all boundary lines, that is, straight lines Gr = p × Gb + q, Gr = p × Gb + q ′, G
b = Gbmin, Gr = Grmax, Gb = Gbma
A straight line closest to the point N in x, Gr = Grmin is obtained each time. Then, a point on the line of intersection between the region T and the straight line is determined, and Gr and Gb of the coordinates are calculated as R and R of the next frame.
The RB amplifier is set as the B gain.

【0103】このように、点Nに基づき形成される、点
Nを含んだある領域(領域T)と、RBゲイン可動範囲
の境界線のうちで点Nに最も近い境界線との交線上の点
に設定する。このため、点Nに示されるRBゲインに設
定する場合と制御の方向が一致する。
As described above, a certain region (region T) including the point N formed on the basis of the point N and the boundary line closest to the point N among the boundary lines of the RB gain movable range are shown in FIG. Set to a point. Therefore, the direction of control matches the case of setting the RB gain indicated by point N.

【0104】特に、ここでは、直線CNと、直線Gr=
p×Gb+qとの交点Pを求め、その座標のGr、Gb
を次フレームのRBゲインとしてRBアンプに設定す
る。すなわち、上記の所定距離が0である場合であり、
したがって、ずらす量(ΔB)が0である場合である。
すなわち、前回のRBゲイン座標であり、RBゲイン可
動範囲内あるいは境界線上にある点Cと、RBゲイン可
動範囲外となった今回のRBゲイン座標である点Nとを
含む直線CNと、この境界線との交点Pを設定するもの
である。なお、実際には、RBゲインのとりうる値の範
囲が0〜2047であるのに対し、RBゲインの可変ス
テップは1〜16という小さな値である。このため、点
Nと点Cとの距離はかなり小さいと考えることができ
る。このように直線CNと上記境界線との交点を設定す
る方法も、その設定後の点が示している制御の方向が、
点Nが示している制御の方向と一致しているため、より
良好な制御が行えることとなる。
In particular, here, a straight line CN and a straight line Gr =
An intersection P with p × Gb + q is obtained, and Gr, Gb of the coordinates are obtained.
Is set in the RB amplifier as the RB gain of the next frame. That is, when the above-mentioned predetermined distance is 0,
Therefore, this is a case where the shift amount (ΔB) is 0.
That is, a straight line CN including a point C which is the previous RB gain coordinate and is within the RB gain movable range or on the boundary line, and a point N which is the current RB gain coordinate which is out of the RB gain movable range, and An intersection P with a line is set. Actually, the range of possible values of the RB gain is 0 to 2047, whereas the variable step of the RB gain is a small value of 1 to 16. Therefore, it can be considered that the distance between the point N and the point C is considerably small. As described above, the method of setting the intersection of the straight line CN and the boundary line also includes a method in which the direction of control indicated by the point after the setting is
Since the control direction indicated by the point N coincides with the control direction, better control can be performed.

【0105】なお、実施の形態1で述べたように直線O
Nと境界線との交点(点M)を採用した場合には、本実
施の形態と比べて、演算量が少なくて済み、ROM容量
の圧迫度合いを抑えることができる。
Note that, as described in the first embodiment, the straight line O
When the intersection (point M) between N and the boundary line is adopted, the amount of calculation is smaller than in this embodiment, and the degree of compression of the ROM capacity can be suppressed.

【0106】〔実施の形態3〕本発明のさらに他の実施
の形態について図9に基づいて説明すれば、以下の通り
である。なお、説明の便宜上、前記の実施の形態の図面
に示した部材と同一の機能を有する部材には、同一の符
号を付記してその説明を省略する。
[Embodiment 3] The following will describe another embodiment of the present invention with reference to FIG. For convenience of explanation, members having the same functions as the members shown in the drawings of the above-described embodiment are denoted by the same reference numerals, and description thereof will be omitted.

【0107】実施の形態1同様にしてRBゲイン可動範
囲外の点Nが得られた場合に、本実施の形態において
は、以下のように処理する。すなわち、点Cを始点とす
るベクトルを考えると、その終点は、図9中、領域α、
β、γ、δのうちの4つのいずれかに位置する。すなわ
ち、そのベクトルを(u、v)と表すと、領域αは、u
>0、v<0の範囲である。以下同様に、領域βはu>
0、v>0の範囲、領域γはu<0、v>0の範囲、領
域δはu<0、v<0の範囲である。そして、座標平面
はこれら4つの領域に区分されるので、RBゲイン可動
範囲も、それに従って区分されることになる。なお、領
域αないしδの境界を形成する線(同図中、一点鎖線で
示す)上となる4つの領域、すなわち、u>0、v=0
の領域、u=0、v>0の領域、u<0、v=0の領
域、u=0、v<0の領域も含めた、8つの領域に区分
して考えることもできる。
If a point N outside the RB gain movable range is obtained in the same manner as in the first embodiment, the following processing is performed in the present embodiment. That is, considering a vector starting from the point C, its end point is the area α,
It is located at any one of four of β, γ, and δ. That is, if the vector is expressed as (u, v), the area α is u
> 0, v <0. Similarly, the region β is u>
0, v> 0, region γ is u <0, v> 0, and region δ is u <0, v <0. Since the coordinate plane is divided into these four regions, the RB gain movable range is also divided according to the four regions. Note that four regions on a line (indicated by a dashed line in the figure) forming a boundary between the regions α to δ, that is, u> 0, v = 0
, An area of u = 0 and v> 0, an area of u <0 and v = 0, and an area of u = 0 and v <0.

【0108】次に、点Nが上記4つのうちのどの領域に
位置するかを調べる。ここでは、同図に示すように、点
Nは領域αに位置している(以下、点N存在領域と称す
る)。
Next, it is checked in which of the above four areas the point N is located. Here, as shown in the figure, the point N is located in the area α (hereinafter, referred to as a point N existence area).

【0109】次に、RBゲイン可動範囲を形成する境界
線(ここでは実施の形態1同様6つの線分からなる)の
うちで、曲線Wについて、点Nと同じ側にある部分(以
下、点N側部分と称する)を特定する。同図の場合であ
れば、(ア)直線Gr=p×Gb+qのすべて、(イ)
直線Gr=Grmaxの一部、および(ウ)直線Gb=
Gbmaxの一部である。
Next, of the boundary lines forming the RB gain movable range (here, six line segments as in the first embodiment), the portion of the curve W on the same side as the point N (hereinafter, the point N Side part). In the case of the figure, (A) all of the straight lines Gr = p × Gb + q, (A)
Straight line Gr = part of Grmax, and (c) straight line Gb =
Gbmax.

【0110】そして、上記点N存在領域と点N側部分と
の両方に含まれる領域(ここでは重なり領域と称する)
が定まる。本実施の形態では、上記重なり領域上の点が
示す座標のGr、Gbを次フレームのRBゲインとして
RBアンプに設定する。この領域上の点として、同図に
は点Aや点Pを例示している。すなわち、点Pは、直線
CNと上記(ア)の部分との交点であり、点Aは、上記
(ア)の部分上ではあるが点Pとは異なる点の例であ
る。
An area included in both the point N existence area and the point N side portion (hereinafter, referred to as an overlap area)
Is determined. In this embodiment, Gr and Gb of the coordinates indicated by the point on the overlapping area are set in the RB amplifier as the RB gain of the next frame. As points on this area, points A and P are illustrated in FIG. In other words, the point P is an intersection of the straight line CN and the portion (A), and the point A is an example of a point different from the point P on the portion (A).

【0111】つまり、RBゲイン可動範囲を形成する全
ての境界線、すなわちここでは直線Gr=p×Gb+
q、Gr=p×Gb+q’、Gb=Gbmin、Gr=
Grmax、Gb=Gbmax、Gr=Grminのな
かで、領域αないしδのうちで点Nが存在するのと同一
の領域であって、曲線Wについて点Nと同じ側にある部
分を求め、その部分内の点の座標のGr、Gbを次フレ
ームのRBゲインとしてRBアンプに設定する。
That is, all the boundaries forming the RB gain movable range, that is, the straight line Gr = p × Gb +
q, Gr = p × Gb + q ′, Gb = Gbmin, Gr =
Among the areas Grmax, Gb = Gbmax, and Gr = Grmin, a part that is the same as the point N among the areas α to δ and that is on the same side of the curve W as the point N is obtained. Gr and Gb of the coordinates of the points within are set in the RB amplifier as the RB gain of the next frame.

【0112】言い換えれば、新たに設定するRBゲイン
を表す点を点Aとすると、RBゲイン可動範囲を形成す
る境界線のなかで、曲線Wについて点Nと同じ側にある
部分であって、かつ、ベクトルCNとベクトルCAとに
ついて横軸成分同士および縦軸成分同士で符号がそれぞ
れ等しくなるような部分上の点Aが表すRBゲインを、
新たなRBゲインとして設定するということである。す
なわち、この例では、ベクトルCNを(Δx、Δy)と
すると、Δx>0、Δy<0であり、ベクトルCAやベ
クトルCPについても、それぞれ(Δxa、Δya)、
(Δxp、Δyp)とすると、Δxa>0、Δya<
0、Δxp>0、Δyp<0である。
In other words, assuming that the point representing the RB gain to be newly set is point A, it is a part on the same side as point N with respect to curve W in the boundary line forming the RB gain movable range, and , The RB gain represented by the point A on the portion where the signs are equal between the horizontal axis components and the vertical axis components of the vector CN and the vector CA,
That is, a new RB gain is set. That is, in this example, assuming that the vector CN is (Δx, Δy), Δx> 0 and Δy <0, and the vectors CA and CP are also (Δxa, Δya), respectively.
(Δxp, Δyp), Δxa> 0, Δya <
0, Δxp> 0 and Δyp <0.

【0113】この重なり領域上の点は、上記点N存在領
域上であるため、RBゲインを点Nに従って設定した場
合と制御方向が一致している。すなわち、Rゲイン・B
ゲインについてそれぞれ増加・減少のいずれを行うかの
方向が一致している。加えて、この重なり領域上の点
は、上記点N側部分上であるため、点Nの存在しない側
の点と比べて、RBゲインの値が点Nと大きく異なるこ
とがない。
Since the point on the overlap area is on the area where the point N exists, the control direction is the same as the case where the RB gain is set according to the point N. That is, R gain · B
The direction in which the gain is increased or decreased is the same. In addition, since the point on the overlapping area is on the point N side, the value of the RB gain does not greatly differ from the point N as compared with the point on the side where the point N does not exist.

【0114】特に、ここでは、直線CNと、直線Gr=
p×Gb+qとの交点Pを求め、その座標のGr、Gb
を次フレームのRBゲインとしてRBアンプに設定す
る。すなわち、点Cを始点、設定後の点を終点とするベ
クトルの向きと、直線CNの向き、特にベクトルCNの
向きとが一致する場合である。
In particular, here, a straight line CN and a straight line Gr =
An intersection P with p × Gb + q is obtained, and Gr, Gb of the coordinates are obtained.
Is set in the RB amplifier as the RB gain of the next frame. That is, this is a case where the direction of the vector starting from the point C and ending at the point after setting matches the direction of the straight line CN, particularly the direction of the vector CN.

【0115】なお、実施の形態1・2では、複数の境界
線のうち点Nに最も近い境界線を選んだが、そのように
する代わりに、本実施の形態のように、上記重なり領域
上の境界線というように選んでもよい。
In the first and second embodiments, the boundary line closest to the point N is selected from the plurality of boundary lines, but instead of doing so, as in the present embodiment, It may be selected as a boundary line.

【0116】なお、本発明に係る画像処理装置を、下記
のように構成してもよい。すなわち、画像処理装置は、
被写体の情報を取り込む撮像部と、R画素の出力信号を
増幅する増幅手段と、B画素の出力信号を増幅する増幅
手段と、R画素、G画素、B画素から白画素を抽出する
手段と、白画素の色成分を計算する手段と、前記白画素
の色成分から色成分がゼロとなるようなRゲイン(Rア
ンプゲイン)、Bゲイン(Bアンプゲイン)を算出する
手段と、RゲインとBゲインとを両軸にとり、原点をO
とし、前記RゲインおよびBゲインが、有彩色を引き込
まないように設定されたRゲインおよびBゲインの可動
範囲内にあるかどうかを判断する手段と、前記可動範囲
外にRゲイン、Bゲインがある場合に、前記可動範囲外
のRゲイン、Bゲインが示す点をNとしたとき、直線O
Nから所定の距離以内にある点からなる領域と、上記可
動範囲の境界線で点Nに最も近い境界線との交線上にあ
る点を、新たなRゲイン、Bゲインとして、それぞれR
アンプ、Bアンプに設定するように構成してもよい。
Note that the image processing apparatus according to the present invention may be configured as follows. That is, the image processing device
An imaging unit that captures information of a subject, an amplifying unit that amplifies an output signal of an R pixel, an amplifying unit that amplifies an output signal of a B pixel, and a unit that extracts a white pixel from an R pixel, a G pixel, and a B pixel; Means for calculating a color component of a white pixel; means for calculating an R gain (R amplifier gain) and a B gain (B amplifier gain) such that the color component becomes zero from the color component of the white pixel; B gain on both axes and origin at O
Means for judging whether the R gain and the B gain are within the movable ranges of the R gain and the B gain set so as not to draw in chromatic colors, and R and B gains outside the movable range. In some cases, when a point indicated by the R gain and the B gain outside the movable range is set to N, a straight line O
A point on the intersection of an area consisting of points within a predetermined distance from N and a boundary line closest to the point N on the boundary line of the movable range is defined as a new R gain and B gain, respectively.
You may comprise so that it may set to an amplifier and a B amplifier.

【0117】また、本発明に係る画像処理装置を、下記
のように構成してもよい。すなわち、画像処理装置は、
被写体の情報を取り込む撮像部と、R画素の出力信号を
増幅する増幅手段と、B画素の出力信号を増幅する増幅
手段と、R画素、G画素、B画素から白画素を抽出する
手段と、白画素の色成分を計算する手段と、前記白画素
の色成分から色成分がゼロとなるようなRゲイン、Bゲ
インを算出する手段と、前記Rゲイン、Bゲインが、有
彩色を引き込まないように設定されたRゲイン、Bゲイ
ンの可動範囲内にあるかどうかを判断する手段と、前記
可動範囲外にRゲイン、Bゲインがある場合に、前記可
動範囲外のRゲイン、Bゲインに近く、可動範囲内にあ
るRゲイン、Bゲインを、それぞれRアンプ、Bアンプ
に設定するように構成してもよい。
Further, the image processing apparatus according to the present invention may be configured as follows. That is, the image processing device
An imaging unit that captures information of a subject, an amplifying unit that amplifies an output signal of an R pixel, an amplifying unit that amplifies an output signal of a B pixel, and a unit that extracts a white pixel from an R pixel, a G pixel, and a B pixel; Means for calculating a color component of a white pixel; means for calculating an R gain and a B gain such that the color component becomes zero from the color component of the white pixel; and the R gain and the B gain do not draw a chromatic color. Means for judging whether the R gain and the B gain are within the movable ranges set as described above, and, when the R gain and the B gain are outside the movable range, the R gain and the B gain outside the movable range are determined. The R gain and the B gain that are near and within the movable range may be set to the R amplifier and the B amplifier, respectively.

【0118】上記の構成によれば、RBゲインを算出し
た結果、それがRBゲインの可動範囲外となる場合にお
いても、RBゲインの可動範囲内であり、かつ、RBゲ
インの算出結果にもっとも近いRBゲインが設定され、
前回のフレームの色成分とは異なった新たな色成分が毎
フレームごとに得られる。そのため、RBゲインがロッ
クされることがない。すなわち、急激に照明が変化した
場合でも必ずRBゲイン可動範囲境界線およびその内部
の値がRB増幅部に設定されるため、ロックアウトが発
生することがない。
According to the above configuration, even if the calculated RB gain is out of the RB gain movable range, the RB gain is within the RB gain movable range and is closest to the RB gain calculated result. RB gain is set,
A new color component different from the color component of the previous frame is obtained for each frame. Therefore, the RB gain is not locked. That is, even when the illumination changes suddenly, the RB gain movable range boundary line and the value inside the RB gain movable range boundary are always set in the RB amplification unit, so that lockout does not occur.

【0119】また、簡単な一次式で実施されるため、本
方法に従って処理を行うソフトウェアが簡単に記述で
き、また実行するマイクロコンピュータ等も簡易な4b
itマイコン等が使用できる利点がある。
Further, since the processing is carried out by a simple linear expression, software for performing the processing according to the present method can be easily described, and a microcomputer or the like to execute the processing can be a simple 4b.
There is an advantage that an it microcomputer can be used.

【0120】また、パーソナルコンピュータや、ハンド
ヘルドコンピュータといった計算機により、ホワイトバ
ランス処理を実施することが可能である。
The white balance processing can be performed by a computer such as a personal computer or a handheld computer.

【0121】また、本発明に係る画像処理装置を、下記
のように構成してもよい。すなわち、画像処理装置は、
新しいRゲイン、Bゲインが可動範囲外にある場合に、
前記可動範囲外のRゲイン、Bゲインに近く、可動範囲
内にあるRゲイン、Bゲインとして、Rゲイン、Bゲイ
ンの座標上で座標(Bゲイン、Rゲイン)と原点とを結
ぶ直線と、可動範囲の境界線との交点の座標を新たなR
ゲイン、Bゲインとして、それぞれRアンプ、Bアンプ
に設定するように構成してもよい。
The image processing apparatus according to the present invention may be configured as follows. That is, the image processing device
When the new R gain and B gain are out of the movable range,
A straight line connecting the coordinates (B gain, R gain) and the origin on the coordinates of the R gain and the B gain as the R gain and the B gain close to the R gain and the B gain outside the movable range and within the movable range; The coordinates of the intersection with the boundary of the movable range are
The gain and the B gain may be set to the R amplifier and the B amplifier, respectively.

【0122】上記の構成によれば、簡単な一次式で処理
装置に演算負担をかけることなくなめらかなホワイトバ
ランス補正を続行することが可能である。
According to the above configuration, it is possible to continue smooth white balance correction with a simple linear equation without imposing a computational burden on the processing device.

【0123】[0123]

【発明の効果】以上のように、本発明の画像処理方法
は、上記点Nが上記RBゲイン可動範囲の外に位置する
ときに、上記境界線上の点が表すRBゲインを新たなR
Bゲインとして設定する構成である。
As described above, according to the image processing method of the present invention, when the point N is located outside the RB gain movable range, the RB gain represented by the point on the boundary line is set to a new R
In this configuration, the gain is set as B gain.

【0124】また、本発明の画像処理装置は、上記点N
が上記RBゲイン可動範囲の外に位置するときに、上記
境界線上の点が表すRBゲインを新たなRBゲインとし
て設定するRBゲイン設定手段を有する構成である。
Further, the image processing apparatus of the present invention has the above-mentioned point N
Has an RB gain setting means for setting an RB gain represented by a point on the boundary line as a new RB gain when the RB gain is outside the RB gain movable range.

【0125】また、本発明の画像処理プログラムを記録
したコンピュータ読み取り可能な記録媒体は、上記点N
が上記RBゲイン可動範囲の外に位置するときに、上記
境界線上の点が表すRBゲインを新たなRBゲインとし
て設定する構成である。
The computer-readable recording medium on which the image processing program of the present invention is recorded is characterized in that
Is located outside the RB gain movable range, the RB gain indicated by the point on the boundary line is set as a new RB gain.

【0126】これにより、有彩色である被写体に対しホ
ワイトバランス補正を行うことによりかえって不自然な
色補正となることを防止するとともに、光源色が急激に
変化した場合、あるいは被写体が変化し、反射光の色が
急激に変化した場合でも、RBゲインがロックせず、色
調を正しく制御することができるという効果を奏する。
Thus, by performing white balance correction on a chromatic subject, it is possible to prevent unnatural color correction from occurring, and when the light source color changes suddenly or when the subject changes, the Even when the color of light changes abruptly, the RB gain is not locked, and the color tone can be controlled correctly.

【0127】また、本発明の画像処理方法は、上記の構
成に加えて、上記RBゲイン可動範囲を表す領域が、一
つ以上の境界線としての線分で形成されており、上記点
Nが上記RBゲイン可動範囲の外に位置するときに、上
記境界線のうちで点Nに最も近い境界線と、直線ONか
ら所定の距離以内にある点からなる領域Sとの交線上の
点が表すRBゲインを、新たなRBゲインとして設定す
る構成である。
Further, in the image processing method according to the present invention, in addition to the above configuration, the area representing the RB gain movable range is formed by one or more line segments as boundaries, and the point N When located outside the RB gain movable range, a point on the intersection line between the boundary line closest to the point N among the boundary lines and the region S including points within a predetermined distance from the straight line ON is represented. In this configuration, the RB gain is set as a new RB gain.

【0128】これにより、ホワイトバランスの制御方向
を大きく逸脱することがないので、上記構成による効果
に加えて、光源色が急激に変化した場合あるいは被写体
が変化し、反射光の色が急激に変化した場合に、被写体
の色が極端に異なる色へと変化するのを抑えることがで
きるという効果を奏する。
As a result, since the control direction of the white balance does not greatly deviate, in addition to the effect of the above configuration, when the color of the light source changes abruptly or the subject changes, the color of the reflected light changes abruptly. In this case, it is possible to prevent the color of the subject from changing to an extremely different color.

【0129】また、本発明の画像処理方法は、上記の構
成に加えて、上記境界線のうちで点Nに最も近い境界線
と、上記所定の距離が0である直線ONとの交線上の点
Mが表すRBゲインを、新たなRBゲインとして設定す
る構成である。
Further, in addition to the above configuration, the image processing method according to the present invention further comprises a line on the intersection of the boundary line closest to the point N among the boundary lines and the straight line ON having the predetermined distance of 0. In this configuration, the RB gain indicated by the point M is set as a new RB gain.

【0130】これにより、ホワイトバランスの制御方向
を逸脱しないので、上記構成による効果に加えて、光源
色が急激に変化した場合あるいは被写体が変化し、反射
光の色が急激に変化した場合に、被写体の色が極端に異
なる色へと変化するのを、より効果的に抑えることがで
きるという効果を奏する。
As a result, since the control direction of the white balance is not deviated, in addition to the effect of the above configuration, when the color of the light source changes rapidly or when the subject changes and the color of the reflected light changes rapidly, It is possible to more effectively suppress the color of the subject from changing to an extremely different color.

【0131】また、本発明の画像処理方法は、上記の構
成に加えて、上記RBゲイン可動範囲を表す領域が、一
つ以上の境界線としての線分で形成されており、上記点
Nが上記RBゲイン可動範囲の外に位置するときに、上
記境界線のうちで点Nに最も近い境界線と、直線CNか
ら所定の距離以内にある点からなる領域Tとの交線上の
点が表すRBゲインを、新たなRBゲインとして設定す
る構成である。
Further, in the image processing method of the present invention, in addition to the above configuration, the area representing the RB gain movable range is formed by one or more line segments as boundaries, and the point N When located outside the RB gain movable range, a point on the intersection of a boundary line closest to the point N and a region T including points within a predetermined distance from the straight line CN among the boundary lines represents the boundary line. In this configuration, the RB gain is set as a new RB gain.

【0132】これにより、ホワイトバランスの制御方向
を大きく逸脱することがないので、上記構成による効果
に加えて、光源色が急激に変化した場合あるいは被写体
が変化し、反射光の色が急激に変化した場合に、被写体
の色が極端に異なる色へと変化するのを抑えることがで
きるという効果を奏する。
As a result, the control direction of the white balance does not greatly deviate, and in addition to the effects of the above-described configuration, when the color of the light source changes abruptly or the subject changes, the color of the reflected light changes abruptly. In this case, it is possible to prevent the color of the subject from changing to an extremely different color.

【0133】また、本発明の画像処理方法は、上記の構
成に加えて、上記境界線のうちで点Nに最も近い境界線
と、上記所定の距離が0である直線CNとの交線上の点
Pが表すRBゲインを、新たなRBゲインとして設定す
る構成である。
Further, in addition to the above configuration, the image processing method according to the present invention further comprises an intersecting line between the boundary line closest to the point N among the boundary lines and the straight line CN having the predetermined distance of 0. In this configuration, the RB gain indicated by the point P is set as a new RB gain.

【0134】これにより、ホワイトバランスの制御方向
を逸脱しないので、上記構成による効果に加えて、光源
色が急激に変化した場合あるいは被写体が変化し、反射
光の色が急激に変化した場合に、被写体の色が極端に異
なる色へと変化するのを、より効果的に抑えることがで
きるという効果を奏する。
As a result, since the control direction of the white balance is not deviated, in addition to the effect of the above configuration, when the color of the light source changes abruptly or when the color of the reflected light changes abruptly when the subject changes. It is possible to more effectively suppress the color of the subject from changing to an extremely different color.

【0135】また、本発明の画像処理方法は、上記の構
成に加えて、上記点Nが上記RBゲイン可動範囲の外に
位置するときに、新たに設定するRBゲインを表す点を
点Aとすると、上記境界線のなかで、曲線Wについて点
Nと同じ側にある部分であって、かつ、ベクトルCNと
ベクトルCAとについて横軸成分同士および縦軸成分同
士で符号がそれぞれ等しくなるような部分上の点Aが表
すRBゲインを、新たなRBゲインとして設定する構成
である。
Further, in addition to the above configuration, when the point N is located outside the movable range of the RB gain, the image processing method of the present invention sets the point representing the newly set RB gain to the point A. Then, in the above-described boundary line, a portion on the same side as the point N with respect to the curve W, and the signs of the horizontal axis components and the vertical axis components of the vector CN and the vector CA are equal to each other. In this configuration, the RB gain represented by the point A on the portion is set as a new RB gain.

【0136】これにより、ホワイトバランスの制御方向
を大きく逸脱することがないので、上記構成による効果
に加えて、光源色が急激に変化した場合あるいは被写体
が変化し、反射光の色が急激に変化した場合に、被写体
の色が極端に異なる色へと変化するのを抑えることがで
きるという効果を奏する。
As a result, the control direction of the white balance does not greatly deviate. In addition to the effects of the above-described configuration, when the color of the light source changes abruptly or the subject changes, the color of the reflected light changes abruptly. In this case, it is possible to prevent the color of the subject from changing to an extremely different color.

【0137】また、本発明の画像処理方法は、上記の構
成に加えて、上記点Aとして、直線CN上の点Pが表す
RBゲインを、新たなRBゲインとして設定する構成で
ある。
Further, the image processing method of the present invention has a configuration in which, in addition to the above configuration, the RB gain represented by the point P on the straight line CN is set as a new RB gain as the point A.

【0138】これにより、ホワイトバランスの制御方向
を逸脱しないので、上記構成による効果に加えて、光源
色が急激に変化した場合あるいは被写体が変化し、反射
光の色が急激に変化した場合に、被写体の色が極端に異
なる色へと変化するのを、より効果的に抑えることがで
きるという効果を奏する。
As a result, since the control direction of the white balance is not deviated, in addition to the effect of the above configuration, when the color of the light source changes abruptly or when the color of the reflected light changes abruptly when the subject changes. It is possible to more effectively suppress the color of the subject from changing to an extremely different color.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明に係る画像処理方法を実行する映像信号
補正装置の一構成例を示すブロック図である。
FIG. 1 is a block diagram illustrating a configuration example of a video signal correction device that executes an image processing method according to the present invention.

【図2】映像信号から色成分を抽出する方法を示す説明
図である。
FIG. 2 is an explanatory diagram illustrating a method of extracting a color component from a video signal.

【図3】Rゲイン、Bゲインの可動範囲を示す説明図で
ある。
FIG. 3 is an explanatory diagram showing a movable range of an R gain and a B gain.

【図4】本発明における、Rゲイン、Bゲインが可動範
囲外になった場合の再計算方法を示す説明図である。
FIG. 4 is an explanatory diagram showing a recalculation method when the R gain and the B gain are out of a movable range in the present invention.

【図5】本発明における、Rゲイン、Bゲインが可動範
囲外になった場合の再計算方法を示す説明図である。
FIG. 5 is an explanatory diagram showing a recalculation method when the R gain and the B gain are out of a movable range in the present invention.

【図6】本発明に係る画像処理方法をマイクロコンピュ
ータにて実行する映像信号補正装置の構成例を示すブロ
ック図である。
FIG. 6 is a block diagram illustrating a configuration example of a video signal correction device that executes an image processing method according to the present invention by a microcomputer.

【図7】本発明における映像信号補正処理を示すフロー
チャートである。
FIG. 7 is a flowchart illustrating a video signal correction process according to the present invention.

【図8】本発明に係る画像処理方法の他の構成例におけ
る、Rゲイン、Bゲインが可動範囲外になった場合の再
計算方法を示す説明図である。
FIG. 8 is an explanatory diagram showing a recalculation method when an R gain and a B gain are out of a movable range in another configuration example of the image processing method according to the invention.

【図9】本発明に係る画像処理方法のさらに他の構成例
における、Rゲイン、Bゲインが可動範囲外になった場
合の再計算方法を示す説明図である。
FIG. 9 is an explanatory diagram showing a recalculation method when an R gain and a B gain are out of a movable range in still another configuration example of the image processing method according to the present invention.

【図10】従来の映像信号補正装置の構成例を示すブロ
ック図である。
FIG. 10 is a block diagram illustrating a configuration example of a conventional video signal correction device.

【図11】従来の映像信号補正処理を示すフローチャー
トである。
FIG. 11 is a flowchart showing a conventional video signal correction process.

【符号の説明】[Explanation of symbols]

1 固体撮像素子 2 A/Dコンバータ 3 OBオフセットクランプ 4 Rアンプ 5 Bアンプ 6 白ピクセル積算部(RBゲイン設定手段) 7 次フレームRBゲイン計算部(RBゲイン設定手
段) 8 可動範囲判定部(RBゲイン設定手段) 9 可動範囲外RBゲイン再計算部(RBゲイン設定
手段) 10 後段処理部 21 固体撮像素子 22 A/Dコンバータ 23 OBオフセットクランプ 24 Rアンプ 25 Bアンプ 26 白ピクセル積算部(RBゲイン設定手段) 27 マイクロコンピュータ(RBゲイン設定手段) 30 後段処理部
DESCRIPTION OF SYMBOLS 1 Solid-state image sensor 2 A / D converter 3 OB offset clamp 4 R amplifier 5 B amplifier 6 White pixel integration part (RB gain setting means) 7th-order frame RB gain calculation part (RB gain setting means) 8 Movable range determination part (RB Gain setting means) 9 RB gain recalculation unit outside movable range (RB gain setting means) 10 post-processing unit 21 solid-state imaging device 22 A / D converter 23 OB offset clamp 24 R amplifier 25 B amplifier 26 white pixel integration unit (RB gain Setting means) 27 microcomputer (RB gain setting means) 30 post-processing unit

───────────────────────────────────────────────────── フロントページの続き Fターム(参考) 5C065 AA01 BB02 CC01 CC02 CC03 CC09 DD01 DD17 GG15 GG17 GG18 GG22 GG31 GG32 5C066 AA01 BA20 CA08 DD07 EA08 EA14 EA19 GA01 GA02 GA05 HA03 KA09 KA12 KD02 KD04 KD06 KE05 KE09 KE17 KE19 KG01 KG05 KM01  ──────────────────────────────────────────────────続 き Continuing on the front page F term (reference) 5C065 AA01 BB02 CC01 CC02 CC03 CC09 DD01 DD17 GG15 GG17 GG18 GG22 GG31 GG32 5C066 AA01 BA20 CA08 DD07 EA08 EA14 EA19 GA01 GA02 GA05 HA03 KA09 KA12 KD02 KD17 KG04 KM01

Claims (9)

【特許請求の範囲】[Claims] 【請求項1】原点をOとし、RゲインおよびBゲインを
それぞれ座標軸にとった座標平面を考え、太陽光の光源
色に応じてホワイトバランスをとるために必要なRBゲ
インの軌跡を曲線Wとし、有彩色を引き込まないように
するためのRBゲイン可動範囲を表す領域を、上記曲線
Wに基づいて設けた境界線にて形成し、現在のRBゲイ
ンを表す点を点Cとし、対象とする画素の色成分から求
められる、その色成分がゼロとなるようなRBゲインを
表す点を点Nとし、画素のホワイトバランスを調整する
処理のためにRBゲインを設定する画像処理方法におい
て、上記点Nが上記RBゲイン可動範囲の外に位置する
ときに、上記境界線上の点が表すRBゲインを新たなR
Bゲインとして設定することを特徴とする画像処理方
法。
1. Consider a coordinate plane in which the origin is O and the R and B gains are coordinate axes, respectively. An area representing an RB gain movable range for preventing chromatic colors from being drawn is formed by a boundary line provided based on the curve W, and a point representing a current RB gain is set as a point C and is set as an object. In the image processing method for setting an RB gain for a process of adjusting a white balance of a pixel, a point representing an RB gain obtained from a color component of a pixel such that the color component becomes zero is set as a point N, When N is outside the RB gain movable range, the RB gain represented by the point on the boundary line is changed to a new R
An image processing method characterized by setting as a B gain.
【請求項2】上記RBゲイン可動範囲を表す領域が、一
つ以上の境界線としての線分で形成されており、上記点
Nが上記RBゲイン可動範囲の外に位置するときに、上
記境界線のうちで点Nに最も近い境界線と、直線ONか
ら所定の距離以内にある点からなる領域Sとの交線上の
点が表すRBゲインを、新たなRBゲインとして設定す
ることを特徴とする請求項1に記載の画像処理方法。
2. An area representing the RB gain movable range is formed by one or more line segments as boundaries, and when the point N is located outside the RB gain movable range, the boundary is determined. An RB gain represented by a point on an intersection of a boundary line closest to the point N among the lines and an area S including points within a predetermined distance from the straight line ON is set as a new RB gain. The image processing method according to claim 1.
【請求項3】上記境界線のうちで点Nに最も近い境界線
と、上記所定の距離が0である直線ONとの交線上の点
Mが表すRBゲインを、新たなRBゲインとして設定す
ることを特徴とする請求項2に記載の画像処理方法。
3. An RB gain represented by a point M on an intersection of the boundary line closest to the point N and the straight line ON having the predetermined distance of 0 is set as a new RB gain. 3. The image processing method according to claim 2, wherein:
【請求項4】上記RBゲイン可動範囲を表す領域が、一
つ以上の境界線としての線分で形成されており、上記点
Nが上記RBゲイン可動範囲の外に位置するときに、上
記境界線のうちで点Nに最も近い境界線と、直線CNか
ら所定の距離以内にある点からなる領域Tとの交線上の
点が表すRBゲインを、新たなRBゲインとして設定す
ることを特徴とする請求項1に記載の画像処理方法。
4. An area representing the RB gain movable range is formed by one or more line segments as boundaries, and when the point N is located outside the RB gain movable range, the boundary is determined. An RB gain represented by a point on an intersection of a boundary line closest to the point N among the lines and an area T including a point within a predetermined distance from the straight line CN is set as a new RB gain. The image processing method according to claim 1.
【請求項5】上記境界線のうちで点Nに最も近い境界線
と、上記所定の距離が0である直線CNとの交線上の点
Pが表すRBゲインを、新たなRBゲインとして設定す
ることを特徴とする請求項4に記載の画像処理方法。
5. An RB gain represented by a point P on an intersection of the boundary line closest to the point N among the boundary lines and the straight line CN having the predetermined distance of 0 is set as a new RB gain. 5. The image processing method according to claim 4, wherein:
【請求項6】上記点Nが上記RBゲイン可動範囲の外に
位置するときに、新たに設定するRBゲインを表す点を
点Aとすると、上記境界線のなかで、曲線Wについて点
Nと同じ側にある部分であって、かつ、ベクトルCNと
ベクトルCAとについて横軸成分同士および縦軸成分同
士で符号がそれぞれ等しくなるような部分上の点Aが表
すRBゲインを、新たなRBゲインとして設定すること
を特徴とする請求項1に記載の画像処理方法。
6. When the point N is outside the RB gain movable range and a point representing a newly set RB gain is point A, the point W of the curve W in the boundary line An RB gain represented by a point A on a part on the same side and having the same sign between the horizontal axis components and the vertical axis components of the vector CN and the vector CA is represented by a new RB gain. The image processing method according to claim 1, wherein:
【請求項7】上記点Aとして、直線CN上の点Pが表す
RBゲインを、新たなRBゲインとして設定することを
特徴とする請求項6に記載の画像処理方法。
7. The image processing method according to claim 6, wherein, as the point A, an RB gain represented by a point P on the straight line CN is set as a new RB gain.
【請求項8】原点をOとし、RゲインおよびBゲインを
それぞれ座標軸にとった座標平面を考え、太陽光の光源
色に応じてホワイトバランスをとるために必要なRBゲ
インの軌跡を曲線Wとし、有彩色を引き込まないように
するためのRBゲイン可動範囲を表す領域を、上記曲線
Wに基づいて設けた境界線にて形成し、現在のRBゲイ
ンを表す点を点Cとし、対象とする画素の色成分から求
められる、その色成分がゼロとなるようなRBゲインを
表す点を点Nとし、画素のホワイトバランスを調整する
処理のためにRBゲインを設定する画像処理装置におい
て、上記点Nが上記RBゲイン可動範囲の外に位置する
ときに、上記境界線上の点が表すRBゲインを新たなR
Bゲインとして設定するRBゲイン設定手段を有するこ
とを特徴とする画像処理装置。
8. A coordinate plane in which the origin is O and the R gain and the B gain are each on a coordinate axis is considered, and the locus of the RB gain required for white balance according to the light source color of sunlight is defined as a curve W. An area representing an RB gain movable range for preventing chromatic colors from being drawn is formed by a boundary line provided based on the curve W, and a point representing a current RB gain is set as a point C and is set as an object. In the image processing apparatus for setting an RB gain for a process of adjusting a white balance of a pixel, a point representing an RB gain obtained from a color component of the pixel such that the color component becomes zero is set as a point N. When N is outside the RB gain movable range, the RB gain represented by the point on the boundary line is changed to a new R
An image processing apparatus comprising RB gain setting means for setting as a B gain.
【請求項9】原点をOとし、RゲインおよびBゲインを
それぞれ座標軸にとった座標平面を考え、太陽光の光源
色に応じてホワイトバランスをとるために必要なRBゲ
インの軌跡を曲線Wとし、有彩色を引き込まないように
するためのRBゲイン可動範囲を表す領域を、上記曲線
Wに基づいて設けた境界線にて形成し、現在のRBゲイ
ンを表す点を点Cとし、対象とする画素の色成分から求
められる、その色成分がゼロとなるようなRBゲインを
表す点を点Nとし、画素のホワイトバランスを調整する
処理のためにRBゲインを設定する画像処理プログラム
を記録したコンピュータ読み取り可能な記録媒体におい
て、上記点Nが上記RBゲイン可動範囲の外に位置する
ときに、上記境界線上の点が表すRBゲインを新たなR
Bゲインとして設定することを特徴とする画像処理プロ
グラムを記録したコンピュータ読み取り可能な記録媒
体。
9. Consider a coordinate plane in which the origin is O and the R and B gains are coordinate axes respectively, and the locus of the RB gain required for white balance according to the light source color of sunlight is a curve W. An area representing an RB gain movable range for preventing chromatic colors from being drawn is formed by a boundary line provided based on the curve W, and a point representing a current RB gain is set as a point C and is set as an object. A computer which records an image processing program for setting an RB gain for a process of adjusting a white balance of a pixel, where a point representing an RB gain obtained from a color component of the pixel such that the color component becomes zero is set as a point N. In a readable recording medium, when the point N is outside the RB gain movable range, the RB gain represented by the point on the boundary line is changed to a new R
A computer-readable recording medium having recorded thereon an image processing program set as a B gain.
JP34361699A 1999-12-02 1999-12-02 Image processing method, image processor and computer- readable recording medium with image processing program recorded thereon Pending JP2001160976A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP34361699A JP2001160976A (en) 1999-12-02 1999-12-02 Image processing method, image processor and computer- readable recording medium with image processing program recorded thereon

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP34361699A JP2001160976A (en) 1999-12-02 1999-12-02 Image processing method, image processor and computer- readable recording medium with image processing program recorded thereon

Publications (1)

Publication Number Publication Date
JP2001160976A true JP2001160976A (en) 2001-06-12

Family

ID=18362919

Family Applications (1)

Application Number Title Priority Date Filing Date
JP34361699A Pending JP2001160976A (en) 1999-12-02 1999-12-02 Image processing method, image processor and computer- readable recording medium with image processing program recorded thereon

Country Status (1)

Country Link
JP (1) JP2001160976A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003250164A (en) * 2002-02-25 2003-09-05 Sanyo Electric Co Ltd Digital camera
JP2006229355A (en) * 2005-02-15 2006-08-31 Sanyo Electric Co Ltd Electronic camera
JP2006319831A (en) * 2005-05-16 2006-11-24 Sony Corp Image processor and image pickup device
US7319483B2 (en) 2003-12-03 2008-01-15 Samsung Electro-Mechanics Co., Ltd. Digital automatic white balance device
JP2010034955A (en) * 2008-07-30 2010-02-12 Olympus Corp White balance correction apparatus and signal processing program

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003250164A (en) * 2002-02-25 2003-09-05 Sanyo Electric Co Ltd Digital camera
US7319483B2 (en) 2003-12-03 2008-01-15 Samsung Electro-Mechanics Co., Ltd. Digital automatic white balance device
JP2006229355A (en) * 2005-02-15 2006-08-31 Sanyo Electric Co Ltd Electronic camera
JP2006319831A (en) * 2005-05-16 2006-11-24 Sony Corp Image processor and image pickup device
JP4539432B2 (en) * 2005-05-16 2010-09-08 ソニー株式会社 Image processing apparatus and imaging apparatus
US8416337B2 (en) 2005-05-16 2013-04-09 Sony Corporation Image process apparatus and method for processing a color image signal
JP2010034955A (en) * 2008-07-30 2010-02-12 Olympus Corp White balance correction apparatus and signal processing program

Similar Documents

Publication Publication Date Title
US8290263B2 (en) Image processing apparatus
US5974190A (en) Photographed image reproducing apparatus
US8830348B2 (en) Imaging device and imaging method
US7102669B2 (en) Digital color image pre-processing
JP5321163B2 (en) Imaging apparatus and imaging method
US7057653B1 (en) Apparatus capable of image capturing
US7319483B2 (en) Digital automatic white balance device
US8229217B2 (en) Image processing method and apparatus, image processing program and medium storing this program
EP1515545A1 (en) Image processing apparatus and method, recording medium, and program for correcting shading of a captured image
US20140240533A1 (en) Imaging device and image signal processor
US7880783B2 (en) Image pickup apparatus and method
JP6685188B2 (en) Imaging device, image processing device, control method thereof, and program
TWI243610B (en) Image pickup apparatus
EP2362662B1 (en) Imaging device, imaging method and computer readable recording medium storing program for performing the imaging method
US20030160876A1 (en) Imaging apparatus and method
US7251057B2 (en) Digital camera
JP3652902B2 (en) White balance adjustment device
JP2011009937A (en) Image processing apparatus and program
JP2003333616A (en) White balance adjustment method, image pickup device, program, and storage medium
JP2001238129A (en) Image processing apparatus and recording medium
JP2001160976A (en) Image processing method, image processor and computer- readable recording medium with image processing program recorded thereon
JPH11289548A (en) White balance control method and device
JP2003348604A (en) Imaging apparatus and imaging method
JP2000165896A (en) White balance control method and its system
JP2000201277A (en) Image correcting method

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20040608