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

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

Info

Publication number
JP4052001B2
JP4052001B2 JP2002136535A JP2002136535A JP4052001B2 JP 4052001 B2 JP4052001 B2 JP 4052001B2 JP 2002136535 A JP2002136535 A JP 2002136535A JP 2002136535 A JP2002136535 A JP 2002136535A JP 4052001 B2 JP4052001 B2 JP 4052001B2
Authority
JP
Japan
Prior art keywords
value
area
areas
image
equal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2002136535A
Other languages
Japanese (ja)
Other versions
JP2003333618A (en
Inventor
英輔 宇根
由美 左中
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sony Corp
Original Assignee
Sony Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sony Corp filed Critical Sony Corp
Priority to JP2002136535A priority Critical patent/JP4052001B2/en
Publication of JP2003333618A publication Critical patent/JP2003333618A/en
Application granted granted Critical
Publication of JP4052001B2 publication Critical patent/JP4052001B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は画像処理装置および方法、記録媒体、並びにプログラムに関し、特に、ホワイトバランスを調整することにより、特定の色が所望の色となるように画像全体の色を調整する装置に適用して好適な画像処理装置および方法、記録媒体、並びにプログラムに関する。
【0002】
【従来の技術】
ビデオカメラ、スチールカメラなど、デジタルやアナログを問わず、カラー画像を扱うカメラが普及しているが、これらのカメラで撮像した画像と、人間の目で見た画像とでは、色調が異なっている場合がある。これは、例えば、光源の分光分布により赤色が強い光源や緑色が強い光源が存在し、光源からの光を受けた被写体からの反射光の色バランスが崩れているからであり、人間は、白色に感じでも、受光素子を使用するデジタルカメラなどにおいては、光源の色を感知してしまうといった原因が一例としてあげられる。その結果、全体的に赤色を帯びた画像や、緑色を帯びた画像となってしまう場合があった。
【0003】
このようなことを防ぐために、デジタルカメラでは受光素子に取り込まれた被写体画像の色調を調整して、人間の目で見た被写体と同じ色調になるように、色バランスを調整する機能を有している。このような色バランスの調整は、色バランスが適切な白色光源下での色を再現するという意味で、一般にホワイトバランスの調整と称されており、そのホワイトバランスの調整は、例えば、適切な白色光源下でのR(赤)、G(緑)、B(青)の3原色の強度比を用いて行われる。
【0004】
【発明が解決しようとする課題】
上述したように、人間の目で見た被写体と同じ色調になるように、デジタルカメラに取り込まれた被写体の色調を調整する場合、様々な状況、例えば、太陽光の下で撮影する状況、室内で撮影する状況などの異なる状況下で、常に最適な調整を行うのは困難であるという問題があった。
【0005】
ホワイトバランスなどの調整により色調を調整しても、誤った判断のもと誤った調整を行ってしまい、その画像を見る人に不快感を与えてしまう場合がある可能性があった。特に人間は、肌色、緑色、空色などの記憶色に対する判断が、他の色と比較して敏感であるという特徴がある。そのため、これらの色が撮像された画像において、ユーザが認識していた被写体の色調と異なると、他の色が異なる場合よりも、より敏感に反応し、不快感を感じてしまうといった問題があった。
【0006】
撮像された画像の色調が、忠実に被写体の色調を再現していたとしても、その再現によりユーザが不快感を感じてしまう場合もあった。例えば、上述したように、人間は、肌の色には敏感であるが、肌の色に関しては、カメラにより取得された画像と実際の画像の色とが異なっている方が好ましい場合がある。例えば、白人は、実際には赤みをおびた肌の色であっても、その色を忠実に再現した画像を見ると、もっと肌の色は白いはずであると感じたり、その赤みに対して不快に感じたりする場合があるということが経験的に言われている。従って、必ずしも、実際の色を忠実に再現すれば好ましいということではないという問題があった。
【0007】
また、人の顔のアップの画像では、色温度の低い光源の下では、白色との判別が難しいといった問題があり、そのために、誤った判断がされ、その判断のもと、色補正などの処理が実行されてしまったために、肌の色が青白く再現されてしまういったような問題もあった。
【0008】
ユーザは、デジタルカメラにより取得された画像の色調が気に入らなかった場合、所定のソフトウェアを用いて、その画像の色調を変化させる(加工する)ことができる。しかしながら、静止画については、このような処理を行うことができても、動画像に対してはできない、または、できても困難であるといった問題があった。
【0009】
また、そのようなソフトウェアを用いて修正することは、その修正を行ったユーザの好みや感覚が強く反映されるため、実際の色調とは大きくかけ離れてしまう可能性があり、実際の色調を再現するといった意味からは、あまり好ましい状況ではないといった問題があった。
【0010】
本発明はこのような状況に鑑みてなされたものであり、ホワイトバランスを調整することにより、肌色などの目的とする色が好ましい色として再現されるようにすることを課題とする。
【0011】
【課題を解決するための手段】
本発明の画像処理装置は、画像を撮像する撮像手段と、撮像手段により撮像された画像を複数の領域に分割し、その領域内の色を判別する判別手段と、判別手段による判別結果に基づいて、画像の四隅に対応する所定数の領域に、予め処理対象として設定されている肌色であると判別される領域があるか否かを判断する判断手段と、判断手段により肌色であると判別された領域がないと判断された場合、ホワイトバランスの調整を行うための目標値を算出する目標値算出手段と、複数の領域のうちの第1の領域の輝度値と、第1の領域の周囲に位置する第2の領域の輝度値との差分値を算出する差分値算出手段と、差分値算出手段により算出された差分値が所定の値以上である第1の領域の数が、所定の値以下である第1の領域の数よりも多く、画像の所定の位置に位置する領域の輝度値の平均値が所定の値以下である場合か、差分値算出手段により算出された差分値が所定の値以上である第1の領域の数が、所定の値以下である第1の領域の数と同等であり、画像内で肌色の領域が所定数以内である場合、目標値算出手段により算出された目標値を用いて、ホワイトバランスを調整する調整手段とを備えることを特徴とする。
【0014】
本発明の画像処理方法は、撮像された画像を複数の領域に分割し、その領域内の色を判別し、判別結果に基づいて、画像の四隅に対応する所定数の領域に、予め処理対象として設定されている肌色であると判別される領域があるか否かを判断し、肌色であると判別された領域がないと判断された場合、ホワイトバランスの調整を行うための目標値を算出し、複数の領域のうちの第1の領域の輝度値と、第1の領域の周囲に位置する第2の領域の輝度値との差分値を算出し、算出された差分値が所定の値以上である第1の領域の数が、所定の値以下である第1の領域の数よりも多く、画像の所定の位置に位置する領域の輝度値の平均値が所定の値以下である場合か、算出された差分値が所定の値以上である第1の領域の数が、所定の値以下である第1の領域の数と同等であり、画像内で肌色の領域が所定数以内である場合、算出された目標値を用いて、ホワイトバランスを調整するステップを含むことを特徴とする。
【0015】
本発明の記録媒体のプログラムは、撮像された画像を複数の領域に分割し、その領域内の色を判別し、判別結果に基づいて、画像の四隅に対応する所定数の領域に、予め処理対象として設定されている肌色であると判別される領域があるか否かを判断し、肌色であると判別された領域がないと判断された場合、ホワイトバランスの調整を行うための目標値を算出し、複数の領域のうちの第1の領域の輝度値と、第1の領域の周囲に位置する第2の領域の輝度値との差分値を算出し、算出された差分値が所定の値以上である第1の領域の数が、所定の値以下である第1の領域の数よりも多く、画像の所定の位置に位置する領域の輝度値の平均値が所定の値以下である場合か、算出された差分値が所定の値以上である第1の領域の数が、所定の値以下である第1の領域の数と同等であり、画像内で肌色の領域が所定数以内である場合、算出された目標値を用いて、ホワイトバランスを調整するステップを含むことを特徴とする。
【0016】
本発明のプログラムは、撮像された画像を複数の領域に分割し、その領域内の色を判別し、判別結果に基づいて、画像の四隅に対応する所定数の領域に、予め処理対象として設定されている肌色であると判別される領域があるか否かを判断し、肌色であると判別された領域がないと判断された場合、ホワイトバランスの調整を行うための目標値を算出し、複数の領域のうちの第1の領域の輝度値と、第1の領域の周囲に位置する第2の領域の輝度値との差分値を算出し、算出された差分値が所定の値以上である第1の領域の数が、所定の値以下である第1の領域の数よりも多く、画像の所定の位置に位置する領域の輝度値の平均値が所定の値以下である場合か、算出された差分値が所定の値以上である第1の領域の数が、所定の値以下である第1の領域の数と同等であり、画像内で肌色の領域が所定数以内である場合、算出された目標値を用いて、ホワイトバランスを調整するステップをコンピュータに実行させるプログラム。
【0017】
本発明の画像処理装置および方法、並びにプログラムにおいては、撮像された画像が複数の領域に分割され、その領域内の色が判別され、画像の四隅に対応する所定数の領域に、予め処理対象として設定されている肌色の領域がないと判断された場合、ホワイトバランスの調整を行うための目標値が算出され、複数の領域のうちの第1の領域の輝度値と、第1の領域の周囲に位置する第2の領域の輝度値との差分値が算出され、算出された差分値が所定の値以上である第1の領域の数が、所定の値以下である第1の領域の数よりも多く、画像の所定の位置に位置する領域の輝度値の平均値が所定の値以下である場合か、算出された差分値が所定の値以上である第1の領域の数が、所定の値以下である第1の領域の数と同等であり、画像内で肌色の領域が所定数以内である場合、算出された目標値が用いられて、ホワイトバランスが調整される。
【0018】
【発明の実施の形態】
以下に、本発明の実施の形態について図面を参照して説明する。図1は、本発明を適用した画像処理装置の一実施の形態の構成を示す図である。図1に示した画像処理装置10は、デジタル式のビデオカメラやスチールカメラに備えられ、撮像された画像(映像)に対して色の補正を行う装置である。
【0019】
被写体の画像(光)は、画像処理装置10のレンズ11を介してCCD(Charge Coupled Devices)12により受光される。CCD12は、受光した光の強度を電気信号に変換し、S/H(Sampling/Hold)回路13に供給する。S/H回路13は、所定のサンプリング周波数に基づき入力された電気信号をサンプリングし、そのサンプリングした値を一旦保持する。
【0020】
保持された値(信号)は、AGC(Automatic Gain Control)回路14に供給される。AGC回路14は、入力された信号を、後段の信号処理のために、適切な信号レベルになるように変換し、A/D(Analog/Digital)変換回路15に供給する。A/D変換回路15は、入力されたRGBのカラーアナログ信号をデジタル信号に変換して、RGBマトリクス回路16に出力する。
【0021】
RGBマトリクス回路16は、入力されたRGBのカラーデジタル信号を、R(赤)、G(緑)、および、B(青)のそれぞれの成分のデジタル信号にし、WB(ホワイトバランス)アンプ17とWB調整回路18に出力する。WB調整回路18は、WBアンプ17におけるゲインを調整するための回路であり、図2にその詳細な構成を示し、後述する。
【0022】
WBアンプ17は、入力されたR,G,Bのそれぞれのデジタル信号に対して、WB調整回路18からの指示に基づくゲインを乗算することによりホワイトバランスを調整し、色差計算回路19に供給する。
【0023】
ここで、ホワイトバランスについて簡単に説明する。R(赤)、G(緑)、および、B(青)を加算すると(R+G+B、ただし、R=G=B)と白色が生成される。ホワイトバランスという処理を施さずに、例えば、人間が白と認識する紙を、晴天下で撮像したときの画像と、曇り空の下で撮像した時の画像を比較すると、それらの画像の白い紙は、同一の白さであるとは認識されない。すなわち、撮影条件などにより、白は白として必ずしも認識される色として撮像されるとは限らない。
【0024】
そこで、いかなる状況下で撮像された画像であっても、基本的に、白が白として認識されるように、撮像された画像の信号に対してホワイトバランスの調整を行うようにする。
【0025】
色差計算回路19は、ホワイトバランスが調整されたR信号、G信号、および、B信号を用いて、色差信号を生成する。生成される色差信号はR−G信号とB−G信号である。これは、G(緑)を基準としてR(赤)とB(青)を表現するために、このような色差が算出される。
【0026】
さらに、色差マトリクス回路20により、R−Y信号とB−Y信号に変換される。ここでYは、輝度信号(輝度値)を示す。このY信号は、図示されていない回路から供給される。
【0027】
図2は、WB調整回路18の内部構成例を示す図である。WB調整回路18には、RGBマトリクス回路16から、R信号、G信号、および、B信号が、それぞれ供給されるわけだが、それらの信号は、検波回路31に供給される。検波回路31は、後述する検波領域毎に、輝度値や積分値などを算出し、WBアンプ32と輝度ピーク値算出回路33に、それぞれその回路で必要とされる値を出力する。
【0028】
WBアンプ32は、入力された各領域毎のR,G,B信号に対して、予め設定されている一定のゲインで、ホワイトバランスの調整を行い、色差計算回路34に出力する。この色差計算回路34は、色差計算回路19(図1)と同一の処理を行う。すなわち、入力された信号から、R−G信号とB−G信号を生成する。生成された信号は、WB値算出回路35に供給される。
【0029】
WB値算出回路35は、後述する各領域内に肌色が含まれているか否かを判断し、含まれている場合、その含まれている肌色が、この画像処理装置10を含むカメラで撮像された画像内で理想的な肌色になるようなホワイトバランスのゲインを算出する。
【0030】
一方、検波回路31からの出力は、輝度ピーク値算出回路33にも出力されるわけだが、この輝度ピーク値算出回路33は、輝度値を用いて、各領域内の画像は凹凸のある画像であるか否かを判断し、その結果を、WB値設定回路36に出力する。
【0031】
WB値設定回路36は、WB値算出回路35から供給される情報と、輝度ピーク値算出回路33から供給される情報に基づき、最終的に、WBアンプ17(図1)のゲインを補正するか否かを決定し、その決定に基づきWBアンプ17を制御する。
【0032】
図3乃至図7のフローチャートを参照して、WB調整回路18の動作について説明する。図4は、図3のステップS11で行われる領域内の色判別処理の詳細を説明するフローチャートである。図5は、図3のステップS12で行われる補正量の算出処理の詳細を説明するフローチャートである。図6は、図3のステップS13で行われる顔の部分の判別処理の詳細を説明するフローチャートである。図7は、図3のステップS14で行われる補正処理の詳細を説明するフローチャートである。
【0033】
WB調整回路18は、まず、ステップS11において、領域内の色判別の処理を行う。ここで、領域(検波領域)について説明する。図8は、領域について説明するための図である。レンズ11やCCD12の処理により撮像された1画像は、検波回路31により、図8に示したような複数の領域に分割される。図8に示した例では、1画像が7×7の領域に分けられている。各領域は、それぞれの領域が一意に区別が付くように番号が割り振られている。
【0034】
この場合、1画面が7×7個の領域に分割され、1領域は複数の画素から構成されている。WB調整回路18の検波回路31は、ステップS21(図4)において、この7×7領域毎に検波を行い、R,G,B信号をそれぞれWBアンプ32に出力する。
【0035】
WBアンプ32は、ステップS22において、7×7領域の各領域からの信号に対して、一定のゲインを乗算することによりホワイトバランスを調整する。このように、一定のゲインを乗算することにより仮のホワイトバランスを調整しておくことにより、後段の処理による詳細なホワイトバランスの調整を正確に行うことが可能となる。
【0036】
ステップS23において、WBアンプ32からの出力は、色差計算回路34に入力され、色差が計算されることにより、R―G信号とB―G信号がWB値算出回路35に出力される。WB値算出回路35は、ステップS24において、入力されたR―G信号とB―G信号を用いて、各領域内の色の判別を行い、その判別に基づく色情報を各領域毎に設定する。その色の判別について説明する。
【0037】
図9は、色の判別を行う際に用いられるデータについて説明するための図である。R―G信号とB―G信号により決定される1座標が、図9に示した円内のどの位置に存在するかにより、色が判別される。図9において、例えば、肌色と表記した円内は、人間がその円内の座標に位置するR―G信号とB―G信号により表される色を見たときに、肌色と判別する範囲を表している。
【0038】
範囲の大きさは、人間が、R―G信号とB―G信号により表される色を見たときに、例えば、肌色なら肌色と認識する範囲を表している。範囲が小さい場合、その色に対して人間は敏感であることを示し、範囲が大きい場合、その色に対して人間は比較的鈍感であることを示す。
【0039】
ステップS24における色情報の設定は、まず、R―G信号とB―G信号で一意的に決定される座標が、図9に示したような円内のどの位置に存在するかを判別し、その位置がどの範囲に含まれるかを判別することにより行われる。座標が存在する範囲の色が、色情報の設定対象となっている範囲の色として設定される。このようにして図9に示したような円で示される色情報が用いられるため、WB調整回路18は、図9に示したような円で示される色情報をデータとして保持しており、その保持されているデータが参照されることにより、処理対象となっている検波領域の色が判別される。
【0040】
色が判別された結果、色情報が各領域に設定されるわけだが、その色情報は、例えば、無彩色の場合“1”、肌色の場合“2”、空色の場合“3”、緑色の場合“4”、黄色の場合“5”などと設定される。このように、特徴となる色だけ設定され、その他の色は“0”と設定される。
【0041】
このような色情報の設定は、一例であり、これに限定されるものではない。例えば、後述する実施の形態においては、肌色の補正を主な目的としているため、肌色だけが設定されるようにしても良い。そのように肌色だけが設定されるようにした場合、単なる1または0により色情報の設定が行えるため、換言すれば、肌色であった場合フラグがたつといった情報として設定が行えるため、色情報に用いられるデータ量を少なくすることが可能となる。
【0042】
なお、ステップS21における検波処理において、RGBの各値が“000”や“FFF”という処理結果だった場合、その領域はエラー領域であると判断し、その後の処理を行わないようにしても良い。
【0043】
ステップS11(図3)において、領域内の色判別処理が終了すると、ステップS12において、補正量の算出処理が、WB値算出回路35において行われる。WB値算出回路35は、図5に示したようなフローチャートの処理に基づき、補正量の算出を行う。ここで、補正量とは、WBアンプ17(図1)におけるホワイトバランスの調整に用いられるゲインを決定する値であり、その時点で用いられているゲインをどの程度補正するかを示す値である。
【0044】
WB値算出回路35は、補正量の算出処理を行う前の段階で、7×7領域の各領域において、その領域の色を判別している。その色を判別した7×7領域のうち、4隅の領域に肌色と判断された領域があるか否かが、ステップS31(図5)において判断される。4隅とは、図8において斜線で示した領域であり、具体的には、左上の{[0][0],[0][1],[1][0]}、右上の{[0][6],[0][5],[1][6]}、右下の{[6][6],[5][6],[6][5]}、および左下の{[6][0],[5][0],[6][1]}の各領域である。
【0045】
4隅の領域に肌色と判断された領域があるか否かを判断するステップを設けるのは、以下のような理由からである。すなわち、1画面の4隅に肌色が存在する画像とは、顔だけが画面全体に写っている画像であり顔が見切れた状態である場合などと考えられるが、そのような画像はまれである。また、4隅に肌色が存在する画像は、その四隅に存在する画像自体は顔ではなく、顔以外の肌色の物体であると判断する方が、顔であると判断するより正確な判断である場合が多い。
【0046】
このような理由から、撮像された画像の4隅に肌色と判断される領域が存在するか否かを判断し、4隅に肌色と判断される領域がある場合、その画像は、顔ではなく物体であると判断し、肌色の補正、この場合、ホワイトバランスの補正を行わないようにする。一方、ステップS31において、4隅に肌色と判断される領域が存在しないと判断された場合、ステップS32に進み、肌色領域の平均値の算出が行われる。
【0047】
平均値が算出される肌色領域とは、7×7個の領域のうち、中央の9領域(図8において中央に位置し、斜線で示した領域)のうちの、肌色という色情報が設定されている領域である。このように、1画像の中心部分だけを処理対象とするのは、通常、顔は画面の中央付近に存在していることが多いからである。
【0048】
勿論、画像の中央付近以外のところに、顔が存在することはあるが、そのような場合、顔をメインにしているのではないと考えられる状況が多い。また、画像の中央付近以外のところに顔が存在する場合、風景と顔(人物)を同時にメインにして撮像している場合が多く、そのような画像では、風景に対して、顔の割合は比較的小さくなっていると考えられる。
【0049】
このような状況を考慮し、画像の中央部分に顔が存在すると判断される場合、その顔の肌色を理想的な肌色になるようにホワイトバランスを調整するようにする。従って、ここでは、画像の中央に位置する9領域の肌色の検波値の平均値が、ステップS32において算出される。ステップS32において肌色の領域の検波値の平均値が算出されると、ステップS33において、WB値の目標値が設定される。
【0050】
このWB値の目標値の設定は、以下のように設定される。ここでは、G(緑)を基準とした場合を例に挙げて説明する。ここで、上述した画像の中央に位置する9領域のうち、肌色の領域であると判断される領域のR信号をRr信号、B信号をBr信号、および、G信号をGr信号とする。これらのRr信号、Br信号、および、Gr信号は、それぞれ、検波回路31から出力される信号である。
【0051】
Rr信号、Br信号、および、Gr信号を、それぞれ加算し、加算した枠数で除算した値、すなわち、それぞれの信号の平均値をRr’値、Br’値、および、Gr’値とする。ここで、G信号にかけられるホワイトバランスのゲインのGgainを固定とすると、まず、Gw=Gr×Ggainが成り立つ。Gwの平均値をGw’とすると、以下の式が成り立つ。
Rgain=((R−G)i+Gw’)/Rr’
Bgain=((B−G)i+Gw’)/Br’
【0052】
上記した式において、(R−G)iと(B−G)iは、それぞれ、好ましい肌色を実現する際に、経験的(実験的)に取得された値である。これらの値は、例えば、このWB調整回路18を含むカメラの仕向地などにより、その仕向地に合った値を設定しておくことが可能である。これは、仕向地により好まれる肌色が異なる場合があり、そのような場合に適合するようにするためである。
【0053】
このような式により理想となる(目標となる)WB値が算出されると、図5に示したフローチャートの処理(図3のステップS12の処理)は終了され、ステップS13に進み、顔の部分の判別処理が実行される。図6のフローチャートを参照して、顔の部分の判別処理について説明する。顔の部分の判別処理は、輝度ピーク値算出回路33により行われる。
【0054】
この顔の部分の判別処理は、図8に示したように、7×7個の領域に分けられた各領域において後述する処理を行うことにより行われるが、実際に処理が実行される領域は、図10に示したように、画像の中央に位置する5×5の25個の領域、換言すれば、外周をのぞく領域である。
【0055】
ステップS41において、25領域の各領域毎に、輝度値のピーク値が算出される。そして、ステップS42において、所定の領域(処理対象とされた領域)の周囲の8領域に肌色の領域が1以上存在するか否かが判断される。肌色の領域であるか否かの色情報は、WB値算出回路35から供給されるようにしても良い。
【0056】
ステップS42において、処理対象とされている領域に対して周囲に位置する8個の領域のうち、肌色の領域が1以上存在すると判断された場合、ステップS43に進み、存在していないと判断された場合、ステップS47に進む。ステップS43において、輝度値のピーク値の差分が算出される。差分を算出する対象となる領域は、処理対象となっている領域と、肌色であると判断された領域である。
【0057】
ステップS44において、ステップS43において算出された輝度値のピーク値の差分値が、所定の値以下であるか否かが判断される。輝度値のピーク値の差分値が、所定の値以下であると判断された場合、ステップS45に進み、その処理対象とされている領域は、平坦な領域(以下、F領域とする)として設定され、輝度値のピーク値の差分値が、所定の値以下ではないと判断された場合、ステップS46に進み、その処理対象とされている領域は、平坦ではない領域(以下、D領域とする)として設定される。
【0058】
このように、処理対象とされている領域と、その周りの8領域のうちの1領域との輝度値のピーク値の差分が大きい場合、顔などの凹凸のある物体が撮像されている領域であると判断することが可能である。従って、上述したように、輝度値の差分値により、平坦な領域(F領域)と平坦ではない領域(D領域)に区分することができる。
【0059】
ステップS47において、処理対象とされる全ての領域、この場合、25領域に対して、F領域またはD領域の設定が終了したか否かが判断される。ステップS47において、25領域に対してF領域またはD領域の設定が終了したと判断された場合、図6に示した顔の部分の判別処理は終了し、図3のステップS14に進み、まだ設定は終了していないと判断された場合、ステップS42に戻り、それ以降の処理が繰り返される。
【0060】
ステップS14(図3)における補正処理について、図7のフローチャートを参照して説明する。図7に示す補正処理は、WB値設定回路36において行われる。この補正処理は、主に、顔の大きさが大きいか否かを判断し、顔と判断される領域が大きい場合には、ホワイトバランスの調整を行い、顔が比較的小さいと判断される場合には、ホワイトバランスの調整を行わないとするという処理である。
【0061】
このように、顔の大きさを判断し、ホワイトバランスの調整を行うか否かを決定するのは、本実施の形態においては、顔の肌色が理想的な肌色になるようにホワイトバランスの調整を行うからである。撮像された画像のうち、顔の領域が小さいときに、その顔の肌色に合わせてホワイトバランスの調整を行うようにすると、その小さい顔の肌色には合った色調であっても、画像全体としては、好ましくないホワイトバランスの調整が行われた画像となってしまうことが考えられ、そのようなことを防ぐために、顔の大きさを判断する。
【0062】
すなわち、本実施の形態においては、撮像されている顔の大きさが、1画面のうちの所定領域を占めていなければ、その顔の肌色に合うようなホワイトバランスの調整を実行しない。このようにすることで、顔の色を好ましい肌色とすることができるとともに、画像全体の色調がおかしくなってしまうようなことを防ぐことができる。
【0063】
WB値設定回路36は、ステップS51において、F領域がD領域よりも少ないか否かが判断され、少ないと判断される場合、ステップS55に進み、少なくはない(多い)と判断される場合、ステップS52に進む。ステップS52において、F領域とD領域が同数であるか否かが判断され、同数であると判断された場合、ステップS54に進み、同数でないと判断された場合、ステップS53に進む。
【0064】
ステップS51からステップS52、そして、ステップS53に処理が進んだ場合、F領域の方がD領域より多い(F領域>D領域)と判断された場合であり、換言すれば、顔の部分と判断される領域より顔ではないと判断される領域の方が多い場合であるので、ステップS53においては、ホワイトバランスの調整の処理を実行しない(補正処理の中止)という決定がされる。この補正処理の中止とは、その時点で、WBアンプ17(図1)において用いられているゲインをそのまま継続して用いるということである。
【0065】
一方、ステップS52において、F領域とD領域が同数であると判断された場合、ステップS54に進み、肌色の領域が9領域以内であるか否かが判断される。この判断は、顔と判断される領域と顔ではないと判断される領域が同数であると判断された場合、肌色の領域が9領域以内であるとき、ステップS56に進み、ホワイトバランスの調整の処理を実行し、9領域以上であるとき、ステップS53に進み、ホワイトバランスの調整の処理を実行しないというものである。
【0066】
F領域とD領域が同数の場合、基本的には補正処理を中止するが、肌色の領域が9領域以内である場合は例外的に補正処理を実行するのは、肌色の領域が9領域以内であれば、判断精度が低くなり、また、肌色の領域の数が少なくなると、補正量(ホワイトバランスのゲインの変化量)も小さいので、仮に誤った判断のもとホワイトバランスの調整が行われたとしても、ホワイトバランスのずれは少なくてすむと考えられるからである。
【0067】
肌色の領域の数が少ないと補正量が小さくなるというのは、肌色を補正するためのゲイン(Rgain、Bgain)を算出する際、画面内の肌色の領域数(=面積)に応じて、WBアンプ17(図1)において用いられているゲインと、上述した理想の肌色に設定するためのゲインの加重平均値をRgain、Bgainとして用いるためである。これは、肌色が少ない場合、補正を余りかけない方が画面全体の色バランスが崩れないためである。
【0068】
ステップS54において、肌色の領域が9領域以内であると判断された場合、ステップS56に進み、上述した処理により既に算出されている理想とされる肌色にするためのホワイトバランスのゲインにするように、WB値設定回路36からWBアンプ17に対して指示が出される。この指示が出されることにより、ホワイトバランスの調整(補正)が行われる。
【0069】
一方、ステップS51において、F領域がD領域よりも少ないと判断された場合、換言すれば、顔ではないと判断される領域の方が、顔であると判断される領域よりも少ないと判断された場合、ステップS55に進む。ステップS55において、1画像の中央に位置する9領域(図8に示した領域のうち、中央で斜線が引いてある領域)の輝度値の平均値が所定の値以下であるか否かが判断される。
【0070】
この判断は、輝度値のリミッター処理としての役割をはたす。すなわち、上述したように、理想の肌色にするためのホワイトバランスのゲイン(Rgain、Bgain)を算出する際にR−G信号とB−G信号を用いており、輝度値が大きくなると、ゲインの計算結果の誤差が大きくなるため、そのような誤差が大きくなるような状況を防ぐために行われる。従って、ステップS55の処理は、理想の肌色にするためのホワイトバランスのゲイン(Rgain、Bgain)を算出する際に、R/GやB/Gといった値を用いて算出するようにした場合には、省略することが可能なステップである。
【0071】
この場合、ゲインの計算にR−G信号とB―G信号を用いているため、ステップS55の処理が行われる。なお、一般的に、除算を行って、R/GやB/Gの値を算出するより、減算によりR−GやB−Gを算出する方が、処理が簡便になり、回路構成も簡便になることが多いため、ここでは、減算処理を行うことにしている。
【0072】
ステップS55において、中央の9領域の輝度値の平均値が所定の値以下であると判断された場合、ステップS56に進み、補正処理が実行され、所定の値以上であると判断された場合、ステップS53に進み、補正処理は中止される。
【0073】
このようにしてWBアンプ17(図1)において行われるホワイトバランスの調整のためのゲインが決定される。
【0074】
このように、まず、肌色である領域を判断し、肌色の領域が存在している画像に対しては理想の肌色となるように、ホワイトバランスの調整を行うようにしたので、撮像された画像のうち特に人間の肌色は理想的な(好ましい)色にすることができる。
【0075】
また、顔の大きさを判断し、その大きさによりホワイトバランスの調整を実行するか否かを判断するので、画像に占める顔の割合が小さいときに、その顔の色に合わせられたホワイトバランスの調整が行われ、全体として好ましくない色調になってしまうような補正が行われるようなことを防ぐことができる。
【0076】
すなわち、本発明を適用することにより、簡便でありながら、静止画像、動画像の区別なく、好ましい肌色を実現することが可能となるだけでなく、画像内の肌色の領域(面積)を考慮することにより、背景の画像への影響も問題ない範囲で処理できるようになる。また、広角な画で、肌色が少ないときには補正量が小さいため、背景の色も正しく再現され、逆に、顔を大写しにしたようなときには補正量が大きく、適切な肌色の再現が行われるため、さまざまな状況に対応した好ましい画像が得られることになる。
【0077】
上述した実施の形態においては、好ましい肌色を再現するようにしたが、空色や緑色など、他の色を好ましい色として再現するようにしても良い。例えば、画像処理装置10を含むカメラに、空色モードなどと称されるモードを設け、そのモードに設定された場合には、空色が最も好ましい色になるように、ホワイトバランスが調整されるようにしても良い。このように、肌色以外の他の色が好ましい色として再現されるようにした場合でも、本発明を適用できることはいうまでもない。なお、肌色以外の色を補正する対象とした場合、上述した各設定を、対象とする色に合わせた設定とすることが好ましい。
【0078】
なお、撮像された画像の見た目を良くするために、ホワイトバランスをずらすような場合、例えば、夕焼け時の撮影や日陰のところでの撮影などで、そのときの状況を効果的に再現するためにホワイトバランスをずらすような場合、色差信号が変化するために、白と肌色については、図9に示したような色の判断のために用いられるデータを、別に用意しておき、その別に用意されているデータを用いて色の判断を行うようにしても良い。
【0079】
また、上述した実施の形態においては、補色のCCD12を用いた場合を例に挙げて説明したが、原色CCDや、3枚、単板を問わず、同様の手法により、色の調整を行うことが可能である。
【0080】
上述した一連の処理は、換言すれば、図2に示したようなWB調整回路18の各回路が行う処理を、ハードウェア的に構成して実行させるようにしても良いし、ソフトウェア的に構成して実行させるようにしても良い。一連の処理をソフトウェアにより実行させる場合には、そのソフトウェアを構成するプログラムが専用のハードウェアに組み込まれているコンピュータ、または、各種のプログラムをインストールすることで、各種の機能を実行することが可能な、例えば汎用のパーソナルコンピュータなどに、記録媒体からインストールされる。
【0081】
記録媒体について説明する前に、汎用のパーソナルコンピュータについて簡単に説明する。図11は、汎用のパーソナルコンピュータの内部構成例を示す図である。パーソナルコンピュータのCPU(Central Processing Unit)111は、ROM(Read Only Memory)112に記憶されているプログラムに従って各種の処理を実行する。RAM(Random Access Memory)113には、CPU111が各種の処理を実行する上において必要なデータやプログラムなどが適宜記憶される。入出力インタフェース115は、キーボードやマウスから構成される入力部116が接続され、入力部116に入力された信号をCPU111に出力する。また、入出力インタフェース115には、ディスプレイやスピーカなどから構成される出力部117も接続されている。
【0082】
さらに、入出力インタフェース115には、ハードディスクなどから構成される記憶部118、および、インターネットなどのネットワークを介して他の装置とデータの授受を行う通信部119も接続されている。ドライブ120は、磁気ディスク131、光ディスク132、光磁気ディスク133、半導体メモリ134などの記録媒体からデータを読み出したり、データを書き込んだりするときに用いられる。
【0083】
記録媒体は、図11に示すように、パーソナルコンピュータとは別に、ユーザにプログラムを提供するために配布される、プログラムが記録されている磁気ディスク131(フレキシブルディスクを含む)、光ディスク132(CD-ROM(Compact Disc-Read Only Memory),DVD(Digital Versatile Disc)を含む)、光磁気ディスク133(MD(Mini-Disc)(登録商標)を含む)、若しくは半導体メモリ134などよりなるパッケージメディアにより構成されるだけでなく、コンピュータに予め組み込まれた状態でユーザに提供される、プログラムが記憶されているROM112や記憶部118が含まれるハードディスクなどで構成される。
【0084】
なお、本明細書において、媒体により提供されるプログラムを記述するステップは、記載された順序に従って、時系列的に行われる処理は勿論、必ずしも時系列的に処理されなくとも、並列的あるいは個別に実行される処理をも含むものである。
【0085】
以上の如く本発明の画像処理装置および方法、並びにプログラムによれば撮像された画像の所定の色、例えば、肌色がユーザの好む色に簡便に調整することが可能となる。
【図面の簡単な説明】
【図1】本発明を適用した画像処理装置の一実施の形態の構成を示す図である。
【図2】WB調整回路18の内部構成例を示す図である。
【図3】WB調整回路18の動作を説明するフローチャートである。
【図4】ステップS11の領域内の色判別処理について説明するフローチャートである。
【図5】ステップS12の補正量の算出処理について説明するフローチャートである。
【図6】ステップS13の顔の部分の判別処理について説明するフローチャートである。
【図7】ステップS14の補正処理について説明するフローチャートである。
【図8】色の判別に用いられるデータについて説明する図である。
【図9】色の判別に用いられる領域について説明する図である。
【図10】顔の部分の判別に用いられる領域について説明する図である。
【図11】媒体を説明する図である。
【符号の説明】
10 画像処理装置, 11 レンズ, 12 CCD, 13 S/H回路, 14 AGC回路, 15 A/D変換回路, 16 RGBマトリクス回路, 17 WBアンプ, 18 WB調整回路, 19 色差計算回路, 20 色差マトリクス回路, 31 検波回路, 32 WBアンプ, 33 輝度ピーク値算出回路, 34 色差計算回路, 35 WB値算出回路, 36WB値設定回路
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an image processing apparatus and method, a recording medium, and a program, and is particularly suitable for application to an apparatus that adjusts the color of an entire image so that a specific color becomes a desired color by adjusting white balance. The present invention relates to an image processing apparatus and method, a recording medium, and a program.
[0002]
[Prior art]
Cameras that handle color images, both digital and analog, such as video cameras and still cameras, are widespread, but the colors captured by these cameras differ from those seen by the human eye. There is a case. This is because, for example, there is a light source with a strong red color or a light source with a strong green color due to the spectral distribution of the light source, and the color balance of the reflected light from the subject that has received light from the light source is lost. However, in a digital camera or the like using a light receiving element, the cause of sensing the color of the light source is an example. As a result, there are cases where the image is reddish or greenish as a whole.
[0003]
To prevent this, the digital camera has a function to adjust the color balance so that the color of the subject image captured by the light receiving element is adjusted to the same color as the subject seen by the human eye. ing. Such color balance adjustment is generally called white balance adjustment in the sense that the color under a white light source with appropriate color balance is reproduced. This is performed using the intensity ratio of the three primary colors of R (red), G (green), and B (blue) under a light source.
[0004]
[Problems to be solved by the invention]
As described above, when adjusting the color tone of a subject captured by a digital camera so that the color tone is the same as that of a subject seen by the human eye, various situations, for example, shooting in sunlight, indoors There is a problem that it is difficult to always perform the optimum adjustment under different circumstances such as shooting with the camera.
[0005]
Even if the color tone is adjusted by adjusting the white balance or the like, there is a possibility that the wrong adjustment is made based on an erroneous determination, which may give an uncomfortable feeling to a person who views the image. In particular, humans are characterized in that judgments about memory colors such as skin color, green color, and sky blue color are more sensitive than other colors. For this reason, in an image in which these colors are captured, there is a problem that if the color tone of the subject recognized by the user is different from that of the other colors, it reacts more sensitively and feels uncomfortable. It was.
[0006]
Even if the color tone of the captured image faithfully reproduces the color tone of the subject, the reproduction may cause the user to feel uncomfortable. For example, as described above, although humans are sensitive to skin color, it may be preferable for the skin color that the image acquired by the camera is different from the color of the actual image. For example, even if a white person actually has a reddish skin color, when he sees an image that faithfully reproduces that color, he or she feels that the skin color should be white. Experience has shown that it can be uncomfortable. Therefore, there is a problem that it is not always desirable to faithfully reproduce actual colors.
[0007]
In addition, in a close-up image of a person's face, there is a problem that it is difficult to distinguish white under a light source with a low color temperature. For this reason, an erroneous determination is made, and based on the determination, color correction, etc. Since the process has been executed, there is a problem that the skin color is reproduced as pale.
[0008]
If the user does not like the color tone of the image acquired by the digital camera, the user can change (process) the color tone of the image using predetermined software. However, with respect to still images, there is a problem that even if such processing can be performed, it cannot be applied to moving images, or even if it can be performed.
[0009]
In addition, correction using such software strongly reflects the taste and sense of the user who made the correction, so it may be far from the actual color tone and reproduce the actual color tone. There was a problem that the situation was not so favorable in the sense of doing.
[0010]
The present invention has been made in view of such a situation, and an object thereof is to reproduce a desired color such as a skin color as a preferable color by adjusting white balance.
[0011]
[Means for Solving the Problems]
An image processing apparatus according to the present invention is based on an imaging unit that captures an image, a determination unit that divides an image captured by the imaging unit into a plurality of regions, and determines colors in the region, and a determination result by the determination unit. And a predetermined number of areas corresponding to the four corners of the image are set in advance as processing targets. Skin color A determination means for determining whether or not there is an area that is determined to be Skin color Target value calculating means for calculating a target value for white balance adjustment when it is determined that there is no area determined to be A difference value calculating means for calculating a difference value between a luminance value of a first area of the plurality of areas and a luminance value of a second area located around the first area, and a difference value calculating means The number of first areas where the calculated difference value is greater than or equal to a predetermined value is greater than the number of first areas where the calculated difference value is less than or equal to the predetermined value, and the average of the luminance values of areas located at predetermined positions in the image If the value is less than or equal to a predetermined value, or the number of first regions where the difference value calculated by the difference value calculation means is greater than or equal to the predetermined value is equal to the number of first regions that are less than or equal to the predetermined value And an adjustment means for adjusting white balance using the target value calculated by the target value calculation means when the number of skin color areas in the image is within a predetermined number. It is characterized by providing.
[0014]
The image processing method according to the present invention divides a captured image into a plurality of regions, determines colors in the regions, and determines in advance a predetermined number of regions corresponding to the four corners of the image based on the determination results. Is set as Skin color Determine whether there is an area that is determined to be Skin color If it is determined that there is no area determined to be, the target value for white balance adjustment is calculated. Then, a difference value between the luminance value of the first area of the plurality of areas and the luminance value of the second area located around the first area is calculated, and the calculated difference value is a predetermined value. When the number of the first areas is larger than the number of the first areas which are equal to or less than the predetermined value, and the average value of the luminance values of the areas located at the predetermined positions of the image is equal to or less than the predetermined value Alternatively, the number of first areas where the calculated difference value is equal to or greater than a predetermined value is equal to the number of first areas where the calculated difference value is equal to or less than the predetermined value, and the number of skin color areas within the predetermined number is within the predetermined number. If there is, adjust the white balance using the calculated target value. Including steps.
[0015]
The recording medium program of the present invention divides a captured image into a plurality of regions, determines colors in the regions, and processes in advance into a predetermined number of regions corresponding to the four corners of the image based on the determination result. It is set as target Skin color Determine whether there is an area that is determined to be Skin color If it is determined that there is no area determined to be, the target value for white balance adjustment is calculated. Then, a difference value between the luminance value of the first area of the plurality of areas and the luminance value of the second area located around the first area is calculated, and the calculated difference value is a predetermined value. When the number of the first areas is larger than the number of the first areas which are equal to or less than the predetermined value, and the average value of the luminance values of the areas located at the predetermined positions of the image is equal to or less than the predetermined value Alternatively, the number of first areas where the calculated difference value is equal to or greater than a predetermined value is equal to the number of first areas where the calculated difference value is equal to or less than the predetermined value, and the number of skin color areas within the predetermined number is within the predetermined number. If there is, adjust the white balance using the calculated target value. Including steps.
[0016]
The program of the present invention divides a captured image into a plurality of areas, determines colors in the areas, and sets in advance a predetermined number of areas corresponding to the four corners of the image as processing targets based on the determination results. Has been Skin color Determine whether there is an area that is determined to be Skin color If it is determined that there is no area determined to be, the target value for white balance adjustment is calculated. Then, a difference value between the luminance value of the first area of the plurality of areas and the luminance value of the second area located around the first area is calculated, and the calculated difference value is a predetermined value. When the number of the first areas is larger than the number of the first areas which are equal to or less than the predetermined value, and the average value of the luminance values of the areas located at the predetermined positions of the image is equal to or less than the predetermined value Alternatively, the number of first areas where the calculated difference value is equal to or greater than a predetermined value is equal to the number of first areas where the calculated difference value is equal to or less than the predetermined value, and the number of skin color areas within the predetermined number is within the predetermined number. If there is, adjust the white balance using the calculated target value. A program that causes a computer to execute steps.
[0017]
In the image processing apparatus, method, and program of the present invention, a captured image is divided into a plurality of regions, the colors in the regions are determined, and a predetermined number of regions corresponding to the four corners of the image are processed in advance. Is set as Skin color If it is determined that there is no area, the target value for white balance adjustment is calculated. The difference value between the luminance value of the first region of the plurality of regions and the luminance value of the second region located around the first region is calculated, and the calculated difference value is equal to or greater than a predetermined value. The number of the first areas is greater than the number of the first areas that are equal to or less than the predetermined value, and the average value of the luminance values of the areas located at the predetermined positions of the image is equal to or less than the predetermined value The number of first areas where the calculated difference value is equal to or greater than a predetermined value is equal to the number of first areas where the calculated difference value is equal to or less than the predetermined value, and the number of skin color areas within the predetermined number is within the predetermined number. If the calculated target value is used, the white balance is adjusted. Is done.
[0018]
DETAILED DESCRIPTION OF THE INVENTION
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a diagram showing the configuration of an embodiment of an image processing apparatus to which the present invention is applied. An image processing apparatus 10 illustrated in FIG. 1 is an apparatus that is provided in a digital video camera or a still camera and corrects a color of a captured image (video).
[0019]
A subject image (light) is received by a CCD (Charge Coupled Devices) 12 via a lens 11 of the image processing apparatus 10. The CCD 12 converts the intensity of the received light into an electric signal and supplies it to an S / H (Sampling / Hold) circuit 13. The S / H circuit 13 samples an input electric signal based on a predetermined sampling frequency, and temporarily holds the sampled value.
[0020]
The held value (signal) is supplied to an AGC (Automatic Gain Control) circuit 14. The AGC circuit 14 converts the input signal to an appropriate signal level for subsequent signal processing, and supplies the signal to an A / D (Analog / Digital) conversion circuit 15. The A / D conversion circuit 15 converts the input RGB color analog signal into a digital signal and outputs the digital signal to the RGB matrix circuit 16.
[0021]
The RGB matrix circuit 16 converts the input RGB color digital signals into digital signals of respective components of R (red), G (green), and B (blue), and a WB (white balance) amplifier 17 and WB. Output to the adjustment circuit 18. The WB adjustment circuit 18 is a circuit for adjusting the gain in the WB amplifier 17, and its detailed configuration is shown in FIG. 2 and will be described later.
[0022]
The WB amplifier 17 adjusts the white balance by multiplying the input R, G, B digital signals by a gain based on an instruction from the WB adjustment circuit 18 and supplies the white balance to the color difference calculation circuit 19. .
[0023]
Here, the white balance will be briefly described. When R (red), G (green), and B (blue) are added (R + G + B, where R = G = B), white is generated. For example, when papers that humans recognize as white are compared to images taken under clear sky and images taken under cloudy skies without white balance processing, the white paper in those images is , They are not recognized as the same whiteness. That is, white is not necessarily captured as a color that is necessarily recognized as white, depending on shooting conditions and the like.
[0024]
In view of this, white balance adjustment is basically performed on the signal of the imaged image so that white is recognized as white, regardless of the situation of the imaged image.
[0025]
The color difference calculation circuit 19 generates a color difference signal using the R signal, the G signal, and the B signal whose white balance has been adjusted. The generated color difference signals are an RG signal and a BG signal. In order to express R (red) and B (blue) with G (green) as a reference, such a color difference is calculated.
[0026]
Further, the color difference matrix circuit 20 converts the signal into an RY signal and a BY signal. Here, Y represents a luminance signal (luminance value). This Y signal is supplied from a circuit not shown.
[0027]
FIG. 2 is a diagram illustrating an internal configuration example of the WB adjustment circuit 18. The WB adjustment circuit 18 is supplied with the R signal, the G signal, and the B signal from the RGB matrix circuit 16, respectively, and these signals are supplied to the detection circuit 31. The detection circuit 31 calculates a luminance value, an integral value, and the like for each detection region described later, and outputs values necessary for the circuit to the WB amplifier 32 and the luminance peak value calculation circuit 33, respectively.
[0028]
The WB amplifier 32 adjusts the white balance with respect to the inputted R, G, and B signals for each region with a predetermined constant gain, and outputs the result to the color difference calculation circuit 34. The color difference calculation circuit 34 performs the same processing as the color difference calculation circuit 19 (FIG. 1). That is, an RG signal and a BG signal are generated from the input signal. The generated signal is supplied to the WB value calculation circuit 35.
[0029]
The WB value calculation circuit 35 determines whether or not a skin color is included in each area described later. If included, the included skin color is captured by a camera including the image processing apparatus 10. The white balance gain is calculated so that an ideal skin color is obtained in the obtained image.
[0030]
On the other hand, the output from the detection circuit 31 is also output to the luminance peak value calculation circuit 33. The luminance peak value calculation circuit 33 uses the luminance value, and the image in each region is an uneven image. It is determined whether or not there is, and the result is output to the WB value setting circuit 36.
[0031]
The WB value setting circuit 36 finally corrects the gain of the WB amplifier 17 (FIG. 1) based on the information supplied from the WB value calculation circuit 35 and the information supplied from the luminance peak value calculation circuit 33. The WB amplifier 17 is controlled based on the determination.
[0032]
The operation of the WB adjustment circuit 18 will be described with reference to the flowcharts of FIGS. FIG. 4 is a flowchart for explaining the details of the color discrimination processing in the region performed in step S11 of FIG. FIG. 5 is a flowchart for explaining details of the correction amount calculation processing performed in step S12 of FIG. FIG. 6 is a flowchart for explaining the details of the face portion discrimination process performed in step S13 of FIG. FIG. 7 is a flowchart for explaining the details of the correction process performed in step S14 of FIG.
[0033]
In step S11, the WB adjustment circuit 18 first performs color discrimination processing within the area. Here, the region (detection region) will be described. FIG. 8 is a diagram for explaining a region. One image picked up by the processing of the lens 11 and the CCD 12 is divided into a plurality of regions as shown in FIG. In the example shown in FIG. 8, one image is divided into 7 × 7 areas. Each area is assigned a number so that each area can be uniquely distinguished.
[0034]
In this case, one screen is divided into 7 × 7 areas, and one area is composed of a plurality of pixels. In step S21 (FIG. 4), the detection circuit 31 of the WB adjustment circuit 18 performs detection for each 7 × 7 region and outputs R, G, and B signals to the WB amplifier 32, respectively.
[0035]
In step S22, the WB amplifier 32 adjusts the white balance by multiplying a signal from each of the 7 × 7 areas by a certain gain. In this way, by adjusting the provisional white balance by multiplying by a constant gain, it is possible to accurately perform the detailed white balance adjustment by the subsequent processing.
[0036]
In step S 23, the output from the WB amplifier 32 is input to the color difference calculation circuit 34, and the RG signal and the BG signal are output to the WB value calculation circuit 35 by calculating the color difference. In step S24, the WB value calculation circuit 35 determines the color in each area using the input RG signal and BG signal, and sets color information based on the determination for each area. . The color discrimination will be described.
[0037]
FIG. 9 is a diagram for explaining data used when color determination is performed. The color is determined depending on where in the circle shown in FIG. 9 one coordinate determined by the RG signal and the BG signal exists. In FIG. 9, for example, a circle indicated as skin color indicates a range that is discriminated as skin color when a human sees a color represented by an RG signal and a BG signal located at coordinates in the circle. Represents.
[0038]
The size of the range represents a range in which, for example, a skin color is recognized as a skin color when a human sees the color represented by the RG signal and the BG signal. A small range indicates that a person is sensitive to that color, and a large range indicates that a person is relatively insensitive to that color.
[0039]
In step S24, the color information is set by first determining where the coordinates uniquely determined by the RG signal and the BG signal exist in the circle as shown in FIG. This is done by determining in which range the position is included. The color in the range where the coordinates exist is set as the color in the range that is the target of color information setting. Since the color information indicated by the circle as shown in FIG. 9 is used in this way, the WB adjustment circuit 18 holds the color information indicated by the circle as shown in FIG. 9 as data. By referring to the stored data, the color of the detection area to be processed is determined.
[0040]
As a result of the color discrimination, color information is set in each area. For example, the color information is “1” for an achromatic color, “2” for a skin color, “3” for a sky blue, “4” is set in the case of yellow, “5” is set in the case of yellow. Thus, only the characteristic color is set, and the other colors are set to “0”.
[0041]
Such setting of color information is an example, and the present invention is not limited to this. For example, in the embodiment to be described later, since the main purpose is to correct the skin color, only the skin color may be set. When only the skin color is set in this way, the color information can be set by simply 1 or 0. In other words, when the skin color is set, the flag information can be set and information can be set. It is possible to reduce the amount of data used.
[0042]
In the detection processing in step S21, if each RGB value is a processing result of “000” or “FFF”, it is determined that the region is an error region, and the subsequent processing may not be performed. .
[0043]
In step S11 (FIG. 3), when the color discrimination process in the region is completed, a correction amount calculation process is performed in the WB value calculation circuit 35 in step S12. The WB value calculation circuit 35 calculates the correction amount based on the processing of the flowchart as shown in FIG. Here, the correction amount is a value that determines a gain used for white balance adjustment in the WB amplifier 17 (FIG. 1), and is a value that indicates how much the gain used at that time is corrected. .
[0044]
The WB value calculation circuit 35 discriminates the color of each of the 7 × 7 areas before performing the correction amount calculation process. In step S31 (FIG. 5), it is determined whether or not there is an area determined to be a skin color in the four corner areas of the 7 × 7 area where the color is determined. The four corners are regions indicated by hatching in FIG. 8, and specifically, {[0] [0], [0] [1], [1] [0]} in the upper left and {[ 0] [6], [0] [5], [1] [6]}, lower right {[6] [6], [5] [6], [6] [5]}, and lower left {[6] [0], [5] [0], [6] [1]}.
[0045]
The reason for determining whether there is an area determined to be skin color in the four corner areas is as follows. That is, an image having skin color at the four corners of one screen is considered to be an image in which only the face is reflected on the entire screen and the face is completely cut off, but such an image is rare. . In addition, for an image having skin colors in the four corners, it is more accurate to determine that the image itself in the four corners is not a face but a skin-colored object other than the face, rather than a face. There are many cases.
[0046]
For this reason, it is determined whether there are areas determined to be skin color at the four corners of the captured image. If there are areas determined to be skin color at the four corners, the image is not a face. It is determined that the object is an object, and skin color correction, in this case, white balance correction is not performed. On the other hand, if it is determined in step S31 that there are no areas determined to be skin color at the four corners, the process proceeds to step S32, and the average value of the skin color area is calculated.
[0047]
The skin color area for which the average value is calculated is set as color information called skin color in the center 9 areas (area shown in the middle and hatched in FIG. 8) among the 7 × 7 areas. It is an area. As described above, the reason why only the central part of one image is processed is that the face usually exists near the center of the screen.
[0048]
Of course, a face may exist in a place other than the vicinity of the center of the image, but in such a case, there are many situations where the face is not mainly used. In addition, when there is a face other than near the center of the image, the landscape and the face (person) are often mainly captured at the same time. In such an image, the ratio of the face to the landscape is It seems to be relatively small.
[0049]
In consideration of such a situation, when it is determined that a face exists in the center portion of the image, the white balance is adjusted so that the skin color of the face becomes an ideal skin color. Therefore, here, the average value of the detection values of the skin color of the nine regions located in the center of the image is calculated in step S32. When the average value of the detection values of the skin color area is calculated in step S32, the target value of the WB value is set in step S33.
[0050]
The target value of the WB value is set as follows. Here, a case where G (green) is used as a reference will be described as an example. Here, among the nine regions located at the center of the image described above, the R signal of the region determined to be a skin color region is the Rr signal, the B signal is the Br signal, and the G signal is the Gr signal. These Rr signal, Br signal, and Gr signal are signals output from the detection circuit 31, respectively.
[0051]
The Rr signal, Br signal, and Gr signal are respectively added, and the value obtained by dividing by the added frame number, that is, the average value of each signal is defined as the Rr ′ value, Br ′ value, and Gr ′ value. Here, if Ggain of the white balance gain applied to the G signal is fixed, first, Gw = Gr × Ggain is established. When the average value of Gw is Gw ′, the following expression is established.
Rgain = ((RG) i + Gw ') / Rr'
Bgain = ((B−G) i + Gw ′) / Br ′
[0052]
In the above formula, (R−G) i and (B−G) i are values obtained empirically (experimental) when realizing a preferable skin color. These values can be set in accordance with the destination of the camera including the WB adjustment circuit 18, for example. This is because the preferred skin color may differ depending on the destination, so that it can be adapted to such a case.
[0053]
When the ideal (target) WB value is calculated by such an expression, the process of the flowchart shown in FIG. 5 (the process of step S12 in FIG. 3) is terminated, and the process proceeds to step S13, where the face portion is determined. The discrimination process is executed. With reference to the flowchart of FIG. 6, the face part discrimination process will be described. The determination processing of the face portion is performed by the luminance peak value calculation circuit 33.
[0054]
As shown in FIG. 8, this face portion discrimination process is performed by performing the process described later in each of the areas divided into 7 × 7 areas. As shown in FIG. 10, 25 areas of 5 × 5 located at the center of the image, in other words, areas excluding the outer periphery.
[0055]
In step S41, the peak value of the luminance value is calculated for each of the 25 areas. In step S42, it is determined whether or not one or more skin-colored areas exist in the eight areas around the predetermined area (the area to be processed). The color information indicating whether or not it is a skin color region may be supplied from the WB value calculation circuit 35.
[0056]
If it is determined in step S42 that one or more skin-colored areas are present among the eight areas located around the area to be processed, the process proceeds to step S43 and is determined not to exist. If YES, go to step S47. In step S43, the difference between the peak values of the luminance values is calculated. The areas for which the difference is calculated are the area to be processed and the area determined to be the skin color.
[0057]
In step S44, it is determined whether or not the difference value between the peak values of the luminance values calculated in step S43 is equal to or less than a predetermined value. When it is determined that the difference value between the peak values of the luminance values is equal to or less than the predetermined value, the process proceeds to step S45, and the area to be processed is set as a flat area (hereinafter referred to as F area). If it is determined that the difference value between the peak values of the luminance values is not equal to or smaller than the predetermined value, the process proceeds to step S46, and the area to be processed is a non-flat area (hereinafter referred to as D area). ) Is set.
[0058]
As described above, when the difference in the peak value of the luminance value between the region to be processed and one of the surrounding eight regions is large, the region in which an uneven object such as a face is imaged. It can be determined that there is. Therefore, as described above, it can be divided into a flat region (F region) and a non-flat region (D region) based on the difference value of the luminance values.
[0059]
In step S47, it is determined whether or not the setting of the F area or the D area has been completed for all areas to be processed, in this case, 25 areas. If it is determined in step S47 that the setting of the F area or the D area has been completed for the 25 areas, the face portion discrimination process shown in FIG. 6 is completed, and the process proceeds to step S14 in FIG. If it is determined that has not been completed, the process returns to step S42, and the subsequent processing is repeated.
[0060]
The correction process in step S14 (FIG. 3) will be described with reference to the flowchart of FIG. The correction process shown in FIG. 7 is performed in the WB value setting circuit 36. This correction processing mainly determines whether or not the face size is large. When the area determined to be a face is large, white balance adjustment is performed and the face is determined to be relatively small. In the process, white balance adjustment is not performed.
[0061]
In this embodiment, the determination of the face size and the determination of whether or not to adjust the white balance is performed in this embodiment by adjusting the white balance so that the skin color of the face becomes an ideal skin color. It is because it performs. If the white balance is adjusted according to the skin color of the face when the face area is small in the captured image, even if the color tone matches the skin color of the small face, Is considered to be an image in which an unfavorable white balance adjustment has been performed. In order to prevent such an image, the size of the face is determined.
[0062]
That is, in this embodiment, if the size of the face being imaged does not occupy a predetermined area of one screen, white balance adjustment that matches the skin color of the face is not executed. By doing so, it is possible to make the face color a preferable skin color and to prevent the color tone of the entire image from becoming strange.
[0063]
In step S51, the WB value setting circuit 36 determines whether or not the F area is smaller than the D area. If it is determined that the F area is small, the WB value setting circuit 36 proceeds to step S55. Proceed to step S52. In step S52, it is determined whether the F area and the D area are the same number. If it is determined that the number is the same, the process proceeds to step S54. If it is determined that the number is not the same, the process proceeds to step S53.
[0064]
When the process proceeds from step S51 to step S52 and then to step S53, it is determined that the F region is larger than the D region (F region> D region), in other words, it is determined to be a face portion. Since there are more areas determined not to be the face than the area to be processed, in step S53, it is determined not to execute the white balance adjustment process (stop the correction process). The cancellation of the correction processing means that the gain used in the WB amplifier 17 (FIG. 1) is continuously used as it is.
[0065]
On the other hand, if it is determined in step S52 that there are the same number of F regions and D regions, the process proceeds to step S54, and it is determined whether the skin color region is within nine regions. If it is determined that the number of areas determined to be faces and the number of areas determined to be non-faces is the same, when the number of skin color areas is within nine areas, the process proceeds to step S56 and white balance adjustment is performed. If the process is executed and there are nine areas or more, the process proceeds to step S53, and the white balance adjustment process is not executed.
[0066]
When the F area and the D area are the same number, the correction process is basically stopped. However, when the skin color area is within 9 areas, the correction process is executed exceptionally when the skin color area is within 9 areas. If this is the case, the accuracy of judgment will be low, and if the number of skin color areas decreases, the correction amount (the amount of change in white balance gain) will also be small, so the white balance will be adjusted based on a false judgment. This is because it is considered that there is little white balance deviation.
[0067]
When the number of skin color areas is small, the correction amount is small. When calculating gains (Rgain, Bgain) for correcting skin colors, the number of skin color areas (= area) in the screen is calculated according to WB. This is because the gain used in the amplifier 17 (FIG. 1) and the weighted average value of the gain for setting the ideal skin color described above are used as Rgain and Bgain. This is because when the skin color is small, the color balance of the entire screen will not be lost if correction is not made much.
[0068]
If it is determined in step S54 that the skin color area is within 9 areas, the process proceeds to step S56 so as to obtain a white balance gain for obtaining the ideal skin color already calculated by the above-described processing. An instruction is issued from the WB value setting circuit 36 to the WB amplifier 17. When this instruction is issued, white balance adjustment (correction) is performed.
[0069]
On the other hand, if it is determined in step S51 that the F area is smaller than the D area, in other words, the area determined not to be a face is determined to be less than the area determined to be a face. If YES, go to step S55. In step S55, it is determined whether or not the average value of the luminance values of nine regions located in the center of one image (the region shown in FIG. 8 that is hatched in the center) is equal to or less than a predetermined value. Is done.
[0070]
This determination serves as a luminance value limiter process. That is, as described above, the RG signal and the BG signal are used when calculating the white balance gains (Rgain, Bgain) for obtaining an ideal skin color. Since the error of the calculation result becomes large, this is performed to prevent such a situation where the error becomes large. Accordingly, when the white balance gain (Rgain, Bgain) for obtaining the ideal skin color is calculated using the values such as R / G and B / G, the process of step S55 is performed. This is a step that can be omitted.
[0071]
In this case, since the RG signal and the BG signal are used for gain calculation, the process of step S55 is performed. In general, it is easier to calculate RG and BG by subtraction than to calculate the values of R / G and B / G by dividing, and the circuit configuration is simple. In this case, the subtraction process is performed here.
[0072]
In step S55, when it is determined that the average value of the luminance values of the nine central regions is equal to or less than the predetermined value, the process proceeds to step S56, and when correction processing is performed and it is determined that the average value is equal to or greater than the predetermined value, In step S53, the correction process is stopped.
[0073]
In this way, the gain for white balance adjustment performed in the WB amplifier 17 (FIG. 1) is determined.
[0074]
As described above, first, an area that is a skin color is determined, and white balance adjustment is performed so that an image having the skin color area has an ideal skin color. Of these, the human skin color can be an ideal (preferred) color.
[0075]
Also, since the size of the face is determined and whether or not white balance adjustment is executed is determined based on the size, when the proportion of the face in the image is small, the white balance matched to the color of the face Thus, it is possible to prevent such a correction that an unfavorable color tone is obtained as a whole.
[0076]
That is, by applying the present invention, it is possible to realize a preferable skin color without distinguishing between a still image and a moving image while being simple, and also consider a skin color region (area) in the image. As a result, the background image can be processed within a range where there is no problem. In addition, since the correction amount is small when the skin color is small in a wide-angle image, the background color is also reproduced correctly. Thus, preferable images corresponding to various situations can be obtained.
[0077]
In the embodiment described above, a preferable skin color is reproduced. However, other colors such as sky blue and green may be reproduced as preferable colors. For example, the camera including the image processing apparatus 10 is provided with a mode called a sky blue mode, and when the mode is set, the white balance is adjusted so that the sky blue is the most preferable color. May be. Thus, it goes without saying that the present invention can be applied even when colors other than the skin color are reproduced as preferable colors. In addition, when it is set as the object which correct | amends colors other than skin color, it is preferable to set each setting mentioned above as the setting matched with the object color.
[0078]
Note that when the white balance is shifted to improve the appearance of the captured image, for example, when shooting at sunset or shooting in the shade, white can be used to effectively reproduce the situation at that time. When the balance is shifted, the color difference signal changes. For white and skin color, data used for color determination as shown in FIG. 9 is prepared separately and prepared separately. The color may be determined using existing data.
[0079]
In the above-described embodiment, the case where the complementary color CCD 12 is used has been described as an example. However, the color adjustment is performed by the same method regardless of the primary color CCD, three sheets, or a single plate. Is possible.
[0080]
In other words, the series of processes described above may be configured to be executed by hardware in the processes performed by each circuit of the WB adjustment circuit 18 as shown in FIG. You may make it run. When a series of processing is executed by software, various functions can be executed by installing a computer in which the programs that make up the software are installed in dedicated hardware, or by installing various programs. For example, it is installed from a recording medium in a general-purpose personal computer or the like.
[0081]
Before describing the recording medium, a general-purpose personal computer will be briefly described. FIG. 11 is a diagram illustrating an internal configuration example of a general-purpose personal computer. A CPU (Central Processing Unit) 111 of the personal computer executes various processes according to a program stored in a ROM (Read Only Memory) 112. A RAM (Random Access Memory) 113 appropriately stores data and programs necessary for the CPU 111 to execute various processes. The input / output interface 115 is connected to an input unit 116 including a keyboard and a mouse, and outputs a signal input to the input unit 116 to the CPU 111. The input / output interface 115 is also connected to an output unit 117 including a display and a speaker.
[0082]
In addition, a storage unit 118 constituted by a hard disk or the like and a communication unit 119 that exchanges data with other devices via a network such as the Internet are connected to the input / output interface 115. The drive 120 is used when data is read from or written to a recording medium such as the magnetic disk 131, the optical disk 132, the magneto-optical disk 133, and the semiconductor memory 134.
[0083]
As shown in FIG. 11, the recording medium is distributed to provide a program to the user separately from the personal computer, and a magnetic disk 131 (including a flexible disk) on which the program is recorded, an optical disk 132 (CD- Consists of package media including ROM (Compact Disc-Read Only Memory), DVD (including Digital Versatile Disc), magneto-optical disc 133 (including MD (Mini-Disc) (registered trademark)), or semiconductor memory 134 In addition, it is configured by a hard disk including a ROM 112 that stores programs and a storage unit 118 that are provided to the user in a state of being pre-installed in a computer.
[0084]
In this specification, the steps for describing the program provided by the medium are performed in parallel or individually in accordance with the described order, as well as the processing performed in time series, not necessarily in time series. The process to be executed is also included.
[0085]
As described above, according to the image processing apparatus and method, and the program of the present invention, , It becomes possible to easily adjust a predetermined color of the captured image, for example, a skin color to a color preferred by the user.
[Brief description of the drawings]
FIG. 1 is a diagram showing a configuration of an embodiment of an image processing apparatus to which the present invention is applied.
FIG. 2 is a diagram illustrating an internal configuration example of a WB adjustment circuit 18;
FIG. 3 is a flowchart for explaining the operation of the WB adjustment circuit 18;
FIG. 4 is a flowchart for describing color discrimination processing in an area in step S11.
FIG. 5 is a flowchart illustrating correction amount calculation processing in step S12.
FIG. 6 is a flowchart for explaining a face portion discrimination process in step S13;
FIG. 7 is a flowchart illustrating the correction process in step S14.
FIG. 8 is a diagram for explaining data used for color determination;
FIG. 9 is a diagram illustrating a region used for color determination.
FIG. 10 is a diagram illustrating a region used for discrimination of a face portion.
FIG. 11 is a diagram illustrating a medium.
[Explanation of symbols]
DESCRIPTION OF SYMBOLS 10 Image processing apparatus, 11 Lens, 12 CCD, 13 S / H circuit, 14 AGC circuit, 15 A / D conversion circuit, 16 RGB matrix circuit, 17 WB amplifier, 18 WB adjustment circuit, 19 Color difference calculation circuit, 20 Color difference matrix Circuit, 31 detection circuit, 32 WB amplifier, 33 luminance peak value calculation circuit, 34 color difference calculation circuit, 35 WB value calculation circuit, 36 WB value setting circuit

Claims (4)

画像を撮像する撮像手段と、
前記撮像手段により撮像された前記画像を複数の領域に分割し、その領域内の色を判別する判別手段と、
前記判別手段による判別結果に基づいて、前記画像の四隅に対応する所定数の領域に、予め処理対象として設定されている肌色であると判別される領域があるか否かを判断する判断手段と、
前記判断手段により前記肌色であると判別された領域がないと判断された場合、ホワイトバランスの調整を行うための目標値を算出する目標値算出手段と
前記複数の領域のうちの第1の領域の輝度値と、前記第1の領域の周囲に位置する第2の領域の輝度値との差分値を算出する差分値算出手段と、
前記差分値算出手段により算出された前記差分値が所定の値以上である前記第1の領域の数が、前記所定の値以下である前記第1の領域の数よりも多く、前記画像の所定の位置に位置する領域の輝度値の平均値が所定の値以下である場合か、前記差分値算出手段により算出された前記差分値が所定の値以上である前記第1の領域の数が、前記所定の値以下である前記第1の領域の数と同等であり、前記画像内で肌色の領域が所定数以内である場合、前記目標値算出手段により算出された前記目標値を用いて、ホワイトバランスを調整する調整手段と
を備えることを特徴とする画像処理装置。
An imaging means for capturing an image;
A determination unit that divides the image captured by the imaging unit into a plurality of regions, and determines colors in the regions;
Determining means for determining whether or not there is an area determined in advance as a skin color set as a processing target in a predetermined number of areas corresponding to the four corners of the image, based on a determination result by the determining means; ,
A target value calculation unit that calculates a target value for adjusting white balance when it is determined that there is no region determined to be the skin color by the determination unit ;
A difference value calculating means for calculating a difference value between a luminance value of a first area of the plurality of areas and a luminance value of a second area located around the first area;
The number of the first areas where the difference value calculated by the difference value calculating means is greater than or equal to a predetermined value is greater than the number of the first areas less than or equal to the predetermined value, and the predetermined value of the image When the average value of the luminance values of the area located at the position is equal to or less than a predetermined value, or the number of the first areas where the difference value calculated by the difference value calculating means is equal to or greater than a predetermined value, When the skin color area is equal to or less than the predetermined number in the image, the target value calculated by the target value calculating means is used. An image processing apparatus comprising: adjusting means for adjusting white balance .
撮像された前記画像を複数の領域に分割し、その領域内の色を判別し、
判別結果に基づいて、前記画像の四隅に対応する所定数の領域に、予め処理対象として設定されている肌色であると判別される領域があるか否かを判断し、
前記肌色であると判別された領域がないと判断された場合、ホワイトバランスの調整を行うための目標値を算出し、
前記複数の領域のうちの第1の領域の輝度値と、前記第1の領域の周囲に位置する第2の領域の輝度値との差分値を算出し、
算出された前記差分値が所定の値以上である前記第1の領域の数が、前記所定の値以下である前記第1の領域の数よりも多く、前記画像の所定の位置に位置する領域の輝度値の平均値が所定の値以下である場合か、算出された前記差分値が所定の値以上である前記第1の領域の数が、前記所定の値以下である前記第1の領域の数と同等であり、前記画像内で肌色の領域が所定数以内である場合、算出された前記目標値を用いて、ホワイトバランスを調整する
ステップを含むことを特徴とする画像処理方法。
Dividing the captured image into a plurality of regions, determining colors in the regions,
Based on the determination result, it is determined whether or not the predetermined number of areas corresponding to the four corners of the image includes an area that is determined to be a skin color that is set in advance as a processing target;
When it is determined that there is no area determined to be the skin color , a target value for adjusting white balance is calculated ,
Calculating a difference value between a luminance value of a first region of the plurality of regions and a luminance value of a second region located around the first region;
An area located at a predetermined position of the image, wherein the number of the first areas where the calculated difference value is equal to or greater than a predetermined value is greater than the number of the first areas which are equal to or less than the predetermined value. The first area where the average value of the luminance values is less than or equal to a predetermined value, or the number of the first areas where the calculated difference value is greater than or equal to the predetermined value is less than or equal to the predetermined value And adjusting the white balance using the calculated target value when the skin color area is within a predetermined number in the image.
撮像された前記画像を複数の領域に分割し、その領域内の色を判別し、
判別結果に基づいて、前記画像の四隅に対応する所定数の領域に、予め処理対象として設定されている肌色であると判別される領域があるか否かを判断し、
前記肌色であると判別された領域がないと判断された場合、ホワイトバランスの調整を行うための目標値を算出し、
前記複数の領域のうちの第1の領域の輝度値と、前記第1の領域の周囲に位置する第2の領域の輝度値との差分値を算出し、
算出された前記差分値が所定の値以上である前記第1の領域の数が、前記所定の値以下である前記第1の領域の数よりも多く、前記画像の所定の位置に位置する領域の輝度値の平均値が所定の値以下である場合か、算出された前記差分値が所定の値以上である前記第1の領域の数が、前記所定の値以下である前記第1の領域の数と同等であり、前記画像内で肌色の領域が所定数以内である場合、算出された前記目標値を用いて、ホワイトバランスを調整する
ステップを含むことを特徴とするコンピュータが読み取り可能なプログラムが記録されている記録媒体。
Dividing the captured image into a plurality of regions, determining colors in the regions,
Based on the determination result, it is determined whether or not the predetermined number of areas corresponding to the four corners of the image includes an area that is determined to be a skin color that is set in advance as a processing target;
When it is determined that there is no area determined to be the skin color , a target value for adjusting white balance is calculated ,
Calculating a difference value between a luminance value of a first region of the plurality of regions and a luminance value of a second region located around the first region;
An area located at a predetermined position of the image, wherein the number of the first areas where the calculated difference value is equal to or greater than a predetermined value is greater than the number of the first areas which are equal to or less than the predetermined value. The first area where the average value of the luminance values is less than or equal to a predetermined value, or the number of the first areas where the calculated difference value is greater than or equal to the predetermined value is less than or equal to the predetermined value And when the skin color region is within a predetermined number in the image, the computer-readable method includes a step of adjusting white balance using the calculated target value. A recording medium on which the program is recorded.
撮像された前記画像を複数の領域に分割し、その領域内の色を判別し、
判別結果に基づいて、前記画像の四隅に対応する所定数の領域に、予め処理対象として設定されている肌色であると判別される領域があるか否かを判断し、
前記肌色であると判別された領域がないと判断された場合、ホワイトバランスの調整を行うための目標値を算出し、
前記複数の領域のうちの第1の領域の輝度値と、前記第1の領域の周囲に位置する第2の領域の輝度値との差分値を算出し、
算出された前記差分値が所定の値以上である前記第1の領域の数が、前記所定の値以下である前記第1の領域の数よりも多く、前記画像の所定の位置に位置する領域の輝度値の平均値が所定の値以下である場合か、算出された前記差分値が所定の値以上である前記第1の領域の数が、前記所定の値以下である前記第1の領域の数と同等であり、前記画像内で肌色の領域が所定数以内である場合、算出された前記目標値を用いて、ホワイトバランスを調整する
ステップをコンピュータに実行させるプログラム。
Dividing the captured image into a plurality of regions, determining colors in the regions,
Based on the determination result, it is determined whether or not the predetermined number of areas corresponding to the four corners of the image includes an area that is determined to be a skin color that is set in advance as a processing target;
When it is determined that there is no area determined to be the skin color , a target value for adjusting white balance is calculated ,
Calculating a difference value between a luminance value of a first region of the plurality of regions and a luminance value of a second region located around the first region;
An area located at a predetermined position of the image, wherein the number of the first areas where the calculated difference value is equal to or greater than a predetermined value is greater than the number of the first areas which are equal to or less than the predetermined value. The first area where the average value of the luminance values is less than or equal to a predetermined value, or the number of the first areas where the calculated difference value is greater than or equal to the predetermined value is less than or equal to the predetermined value A program for causing a computer to execute a step of adjusting white balance using the calculated target value when the skin color area is within a predetermined number in the image .
JP2002136535A 2002-05-13 2002-05-13 Image processing apparatus and method, recording medium, and program Expired - Fee Related JP4052001B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002136535A JP4052001B2 (en) 2002-05-13 2002-05-13 Image processing apparatus and method, recording medium, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002136535A JP4052001B2 (en) 2002-05-13 2002-05-13 Image processing apparatus and method, recording medium, and program

Publications (2)

Publication Number Publication Date
JP2003333618A JP2003333618A (en) 2003-11-21
JP4052001B2 true JP4052001B2 (en) 2008-02-27

Family

ID=29698525

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002136535A Expired - Fee Related JP4052001B2 (en) 2002-05-13 2002-05-13 Image processing apparatus and method, recording medium, and program

Country Status (1)

Country Link
JP (1) JP4052001B2 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4752381B2 (en) * 2005-08-02 2011-08-17 コニカミノルタオプト株式会社 Imaging device
JP4244063B2 (en) 2006-11-06 2009-03-25 ソニー株式会社 Image processing apparatus, image processing method, and program
JP5067852B2 (en) * 2007-08-10 2012-11-07 キヤノン株式会社 Image processing method and image processing apparatus
JP5828632B2 (en) * 2010-12-17 2015-12-09 キヤノン株式会社 Imaging apparatus and video processing method
JP5237480B2 (en) * 2012-04-09 2013-07-17 キヤノン株式会社 Image processing apparatus and method, and imaging apparatus
JP5744945B2 (en) * 2013-03-25 2015-07-08 キヤノン株式会社 Image processing apparatus and method, and imaging apparatus

Also Published As

Publication number Publication date
JP2003333618A (en) 2003-11-21

Similar Documents

Publication Publication Date Title
KR101243335B1 (en) Image processing apparatus, method, program and image pickup apparatus
US7583403B2 (en) Image processing device
US8514293B2 (en) Moving image processing device and method for performing different image processings to moving object region and still object region
JP4244063B2 (en) Image processing apparatus, image processing method, and program
EP2426928B1 (en) Image processing apparatus, image processing method and program
CN102474628B (en) Image processing method and device
TWI243610B (en) Image pickup apparatus
JP2007110576A (en) Color correction device for subject image data and control method thereof
JP2007036462A (en) Image processing apparatus
JP4274383B2 (en) Image processing device
JPH11331738A (en) Method and device for processing image
JP6904788B2 (en) Image processing equipment, image processing methods, and programs
CN113850738B (en) Correction device and method for purple fringing of image
US20060215034A1 (en) Imaging device
JP4052001B2 (en) Image processing apparatus and method, recording medium, and program
JP3652902B2 (en) White balance adjustment device
JP5106311B2 (en) White balance control device, imaging device using the same, and white balance control method
JP3384916B2 (en) Imaging device
JP2001036924A (en) Automatic white balance adjusting device and its method
KR20070070669A (en) Apparatus and method for compensating of lens shading
JP2004096444A (en) Image processor and method thereof
JPH11220619A (en) Image processing method and device therefor
KR101536191B1 (en) Apparatus and method for reproducting color
JP2004165765A (en) Image processing apparatus and means
JP2003143427A (en) Image pick-up device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050407

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20070706

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070717

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070906

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20071002

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20071022

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20071113

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20071126

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

Free format text: PAYMENT UNTIL: 20101214

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20101214

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees