JP4039147B2 - Imaging device - Google Patents

Imaging device Download PDF

Info

Publication number
JP4039147B2
JP4039147B2 JP2002194610A JP2002194610A JP4039147B2 JP 4039147 B2 JP4039147 B2 JP 4039147B2 JP 2002194610 A JP2002194610 A JP 2002194610A JP 2002194610 A JP2002194610 A JP 2002194610A JP 4039147 B2 JP4039147 B2 JP 4039147B2
Authority
JP
Japan
Prior art keywords
image
subject
skin color
processing
main subject
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
JP2002194610A
Other languages
Japanese (ja)
Other versions
JP2004040462A (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.)
Konica Minolta Opto Inc
Original Assignee
Konica Minolta Opto Inc
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 Konica Minolta Opto Inc filed Critical Konica Minolta Opto Inc
Priority to JP2002194610A priority Critical patent/JP4039147B2/en
Publication of JP2004040462A publication Critical patent/JP2004040462A/en
Application granted granted Critical
Publication of JP4039147B2 publication Critical patent/JP4039147B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、固有色が表れる特定被写体を含む画像において固有色を検出することにより特定被写体を抽出する撮像装置に関する。
【0002】
【従来の技術】
デジタルカメラ(撮像装置)においては、画像に含まれる肌色を検出して人物(主被写体)を抽出する技術が提案されている。かかる人物抽出技術では、高精度に人物像の検出を行うことを主眼としているため、対象となる画像がどのような状態の画像であっても、人物像を検出するために一定の処理が行われる。
【0003】
【発明が解決しようとする課題】
しかしながら、上述したデジタルカメラでは、WB(ホワイトバランス)処理が適正に行われていない場合には、色かぶりなどの影響により実際の人物の肌色が画像に再現されないため、正確な人物抽出が困難である。また、夕景やタングステン光などの場合には、一般に赤みを残すWB処理を行うため、正確な人物検知が行えない。
【0004】
また、上述したデジタルカメラでは、露出制御が適正に行われていない場合には、露出オーバーやアンダーなどの影響により画像で色情報が失われるため、正確な人物抽出が困難である。
【0005】
本発明は、上記課題に鑑みてなされたものであり、画像から主被写体を精度良く抽出できる撮像装置を提供することを目的とする。
【0006】
【課題を解決するための手段】
上記の課題を解決するため、請求項1の発明は、撮像装置であって、(a)固有色が表れる特定被写体を含む画像において、前記固有色を検出することにより前記特定被写体を抽出する抽出手段と、(b)前記画像に係るホワイトバランス情報を取得する取得手段とを備え、前記抽出手段は、(a-1)前記ホワイトバランス情報に応じて、前記固有色の検出を実行するか否かを決定する決定手段を有する。
【0008】
また、請求項2の発明は、撮像装置であって、(a)固有色が表れる特定被写体を含む画像において、前記固有色を検出することにより前記特定被写体を抽出する抽出手段と、(b)ホワイトバランス処理に係る処理パラメータを設定する設定手段と、(c)前記処理パラメータに基づき、前記画像に対して前記ホワイトバランス処理を行う処理手段とを備え、前記設定手段は、(b-1)前記画像に基づき第1パラメータを求める手段と、(b-2)前記第1パラメータが所定範囲内である場合には、前記第1パラメータを前記処理パラメータとして設定する手段と、(b-3)前記第1パラメータが前記所定範囲から外れる場合には、前記第1パラメータと異なる第2パラメータを前記処理パラメータとして設定する手段と、を有するとともに、前記抽出手段は、(a-1)前記第2パラメータに基づき前記画像に前記ホワイトバランス処理が施される場合には、前記第1パラメータに基づき前記固有色の検出を行う手段を有する。
【0011】
【発明の実施の形態】
<第1実施形態>
<デジタルカメラ1の要部構成>
図1は、本発明の第1実施形態に係る撮影装置の一例としてのデジタルカメラ1Aを示す斜視図である。図1に示すように、デジタルカメラ1Aの前面側には、撮影レンズ11とファインダ窓2とが設けられている。撮影レンズ11の内側には撮影レンズ11を介して入射する被写体像を光電変換して画像データ(画素ごとの画素データの配列からなるデータ)を生成するためのCCD撮像素子30が設けられている。
【0012】
撮影レンズ11には、光軸方向に沿って移動可能なフォーカシングレンズが含まれており、フォーカシングレンズを駆動することにより、CCD撮像素子30に結像される画像の合焦状態を可変することができるように構成されている。
【0013】
また、デジタルカメラ1Aの上面側には、シャッタボタン8と、カメラ状態表示器13と、設定キー14とが配置されている。シャッタボタン8は被写体の撮影を行うときにユーザが押し込み操作するボタンであり、半押し状態と全押し状態との2段階を検知することができるように構成される。カメラ状態表示器13は、例えばセグメント表示タイプの液晶表示器によって構成され、デジタルカメラ1Aにおける現在の設定内容等をユーザに示すために設けられている。また、設定キー14は、被写体に応じた撮影モードの選択設定等を行うためのキースイッチである。
【0014】
また、デジタルカメラ1Aの側面部には本撮影動作によって生成される画像データを記録するための記録メディア9を装着する装着部15が形成されており、メモリカード等のような交換可能な記録メディア9を装着することができる。
【0015】
なお、図1における図示は省略するが、デジタルカメラ1Aの背面側には、CCD撮像素子30で撮影された画像等を表示するための液晶表示部が設けられる。
【0016】
図2は、デジタルカメラ1Aの内部構成を示すブロック図である。なお、図2において実線矢印は制御信号の流れを示しており、斜線地矢印は画像信号の流れを示している。
【0017】
図2に示すように、デジタルカメラ1Aは、被写体を撮影する際の撮影機能を実現する撮影機能部20と、合焦制御時に主被写体(特定被写体)を検出してその主被写体が合焦状態となるような制御を行う主被写体合焦制御部40と、撮影レンズ11に含まれるフォーカシングレンズ12を駆動してCCD撮像素子30に結像される画像の合焦状態を変更するレンズ駆動部50と、上述のシャッタボタン8及び設定キー14を含む操作部16と、操作部16の操作内容に応じて撮影機能部20及び主被写体合焦制御部40を制御する全体制御部18とを備えて構成される。
【0018】
撮影機能部20は、撮影レンズ11、CCD撮像素子30、CCD撮像素子30からの画像データを一時的に格納するための画像メモリ31、画像メモリ31から得られる画像データに対して画像圧縮等の所定の画像処理を行う画像処理部32、画像処理部32において画像表示用の画像処理が施された表示用画像を表示する液晶表示部33、及び、画像処理部32において画像記録用の画像処理が施された撮影画像を記録する記録メディア9を備えて構成される。
【0019】
撮影機能部20は、全体制御部18の制御によって、本撮影前にライブビュー画像を液晶表示部33に表示させるためのライブビュー動作と、シャッタボタン8が全押しされたときに記録メディア9に記録するための画像撮影を行う本撮影動作とを行うように構成される。また、液晶表示部33がオフ状態であったとしても、少なくとも合焦制御時にはCCD撮像素子30による撮影動作が行われる。
【0020】
また、主被写体合焦制御部40は、画像全体における合焦状態を評価するための合焦評価領域を設定する合焦評価領域設定部41、画像メモリ31から画像データを取り込み、合焦評価領域設定部41から指定される合焦評価領域の部分画像データから合焦状態を評価するための評価値を求める合焦評価部42、合焦評価部42で求められる評価値に基づいてレンズ駆動部50に駆動信号を与え、合焦評価領域の被写体像を合焦状態に導く合焦制御部43、ホワイトバランス(WB)ゲインに応じて色空間において肌色領域を設定する肌色領域設定部44、及び、画像メモリ31から画像データを取り込み、肌色領域設定部44で設定される色空間の肌色検出領域に基づいて主被写体(人物)の抽出処理を行う被写体抽出部45を備えて構成される。
【0021】
全体制御部18は、例えばシャッタボタン8が半押し状態にされたときに主被写体が適切な合焦状態となるように主被写体合焦制御部40を機能させ、全押し状態にされたときに撮影機能部20において本撮影動作を行うように制御する。また、全体制御部18は本撮影前にはライブビュー動作として撮影機能部20において逐次画像撮影を行わせ、逐次更新される画像を液晶表示部33に表示させたり、主被写体合焦制御部40に与えるように制御する。
【0022】
レンズ駆動部50は、合焦制御動作時に合焦制御部43から与えられる駆動信号に基づいてフォーカシングレンズ12を遠側から近側に向けて所定ピッチで移動させ、CCD撮像素子30に結像される画像の合焦状態を変化させる。そして、主被写体合焦制御部40において主被写体が合焦状態となるレンズ位置(合焦位置)が特定され、合焦制御部43よりそのレンズ位置が指定された場合には、レンズ駆動部50は、その指定されたレンズ位置にフォーカシングレンズ12を移動させて主被写体が合焦した状態の画像をCCD撮像素子30に結像させる。
【0023】
図3は、デジタルカメラ1Aに予め設定される合焦評価領域の初期状態を示す図である。図3に示すように、合焦評価領域設定部41には、合焦評価領域の初期状態として、画像メモリ31から取得する画像G1のほぼ中央部分に合焦評価領域FR1が設定されており、主被写体合焦制御部40が機能して最初の合焦評価を行う際には、合焦評価領域設定部41は、図3に示す合焦評価領域FR1の位置及びサイズを合焦評価部42に指示する。
【0024】
合焦評価部42は、画像メモリ31から画像G1を取得し、そのうちから合焦評価領域FR1についての画像成分を抽出する。そして、合焦評価領域FR1の画像成分の合焦状態を評価するための評価値を求める。評価値の算出方法には、いくつかの方法がある。例えば、第1の方法として、合焦評価領域FR1に含まれる画像成分をバンドパスフィルタに通し、それによって抽出される画像信号の高周波成分の強度を評価値とする方法があり、また、第2の方法として、合焦評価領域FR1に含まれる画像成分の隣接画素間での輝度値の差分値を求め、その差分値を合焦評価領域FR1内で累積した値を評価値とする方法がある。また、第3の方法として、合焦評価領域FR1に含まれる画像成分に対して微分フィルタ等を用いたエッジ抽出処理を施し、その結果抽出されるエッジの幅(ぼけ幅)を評価値とする方法もある。
【0025】
第1及び第2の方法は、被写体を撮影した場合、画像がぼけている状態では高周波成分のレベルは小さく、また隣接画素間の輝度差の累積値も小さなものとなるのに対し、焦点が合ってくる(合焦状態に近づく)にしたがって高周波成分のレベルは大きく、また隣接画素間の輝度差の累積値も大きなものとなることを検出する方法である。
【0026】
このため、フォーカシングレンズ12を遠側から近側に次第に移動させた場合、第1及び第2の方法で得られる評価値は、図4に示すように変化する。フォーカシングレンズ12を移動させつつ、各レンズ位置で撮影された画像から評価値を求めると、図4に示すように評価値が変化し、レンズ位置PXで評価値が最大値を示す。このため、フォーカシングレンズ12をレンズ位置PXに移動させれば、合焦評価領域FR1に含まれる画像成分が合焦状態になると判明し、合焦制御部43がフォーカシングレンズ12をレンズ位置PXに移動させて合焦状態を実現する。
【0027】
一方、第3の方法は、被写体を撮影した場合、画像がぼけている状態ではエッジ幅は大きくなるのに対し、焦点が合ってくるにしたがってエッジ幅が小さくなることを検出する方法である。このため、フォーカシングレンズ12を遠側から近側に次第に移動させた場合、第3の方法で得られる評価値は、合焦位置で最小値を示すこととなり、合焦制御部43がその最小値を示すレンズ位置にフォーカシングレンズ12を移動させて合焦状態を実現する。
【0028】
なお、合焦評価部42において適用される評価値の算出方法は、上記第1ないし第3の方法のいずれを採用してもよく、またその他の算出方法を採用してもよい。
【0029】
ところで、合焦評価領域FR1が画像G1に対して常に固定された領域に設定されると、上述したようにその合焦評価領域FR1中にユーザの意図する主被写体が含まれていない場合には、ユーザの意図とは異なった領域で焦点検出が行われることとなり、その結果ユーザが撮影したかった主被写体がぼけた画像で撮影される。
【0030】
そのため、本実施形態のデジタルカメラ1Aでは、被写体抽出部45が画像メモリ31から画像を取得してその画像のうちから主被写体を抽出する処理を行う。そして、合焦評価領域設定部41が主被写体であると判断された画像部分に合焦評価領域を変更設定し、合焦評価部42はその主被写体が含まれる合焦評価領域について評価値の算出を行う。すなわち、合焦評価領域が、初期状態の領域から主被写体として認識された画像領域に修正され、その主被写体の被写体像が合焦状態となるように合焦制御が行われる。
【0031】
これにより、本撮影動作が行われると、主被写体が合焦状態となった適切な画像が撮影されることになる。
【0032】
被写体抽出部45においては、肌色領域設定部44で設定された色空間の肌色領域に基づいて、画像の肌色成分を抽出してその肌色成分が分布する領域を主被写体領域として認識するような被写体抽出処理が行われる。
【0033】
<デジタルカメラ1Aの処理>
以下、デジタルカメラ1Aの処理手順について説明する。図5ないし図7は、デジタルカメラ1Aの処理手順を示すフローチャートであり、特に図5及び図6はシャッタボタン8が半押し状態とされてから本撮影動作が行われるまでの全体的な処理手順を示しており、また、図7は、被写体抽出処理の詳細な処理手順を示している。
【0034】
まず、ユーザによってシャッタボタン8が半押し状態にされると(ステップS101)、全体制御部18が主被写体合焦制御部40と撮影機能部20とを機能させる。このとき、全体制御部18は主被写体合焦制御部40によってフォーカシングレンズ12を最も遠側に移動させるとともに、撮影機能部20を制御してフォーカシングレンズ12が最も遠側に移動した状態で画像撮影を行わせる。
【0035】
そして、主被写体合焦制御部40は画像メモリ31に格納された画像を取り込み(ステップS102)、評価値の算出処理を行う(ステップS103)。このとき、合焦評価領域設定部41は、画像G1の中央部分に予め設定された初期状態の合焦評価領域FR1を評価値算出対象の合焦評価領域とすべきことを合焦評価部42に対して指示する。合焦評価部42では、ほぼ画面中央に設定される合焦評価領域FR1(図3参照)に含まれる画像成分に基づいて評価値の算出が行われ、算出された評価値は合焦制御部43に与えられる。
【0036】
そして肌色領域設定部44及び被写体抽出部45が機能し、被写体抽出処理が行われる(ステップS104)。
【0037】
図7のフローチャートを参照する。被写体抽出処理(ステップS104)に進むと、まず、肌色領域設定部44は、全体制御部18から、ホワイトバランス情報であるWBゲイン値を取得する(ステップS201)。
【0038】
WBゲイン値とは、白い物体が白色に再現されるように画像を調整するために設定される、G(緑)色成分の画像信号に対するR(赤)およびB(青)色成分の画像信号のレベル比である。また、本実施形態のデジタルカメラ1Aを含めて一般には、特殊な光源色下で被写体(例えば、夕景やタングステン光下の赤味がかった被写体)で過度に色補正され色再現性が損なわれないよう、RおよびBの色成分に関するWBゲイン値に一定の制限(以下では「リミッタ制限」という)が施される。このリミッタ制限では、画像から算出されたWBゲイン値が所定の閾値を超過した場合には、例えばこの所定の閾値と、画像から全体制御部18で算出されたWBゲイン値(第1パラメータ:以下では「制限前WBゲイン」という)との平均値にWBゲイン値(第2パラメータ:以下では「制限WBゲイン」という)が設定される。なお、リミッタ制限では、算出されたWBゲイン値が所定の閾値を超過した場合には、所定の閾値にWBゲイン値を制限しても良い。
【0039】
次に、ステップS201で取得したWBゲイン値が、撮影画像に基づき肌色検出可能なWBゲイン値であるかを判定する(ステップS202)。これは、人物(主被写体)に表れる固有色である肌色を利用した主被写体検出において、不適正なWBゲイン値によるWB処理が行われた画像に基づいては、精度の良い肌色検出が困難であり、また不適切なWB処理が施された画像から強引に主被写体検出を行うと人物でない画像領域を人物と誤認するため、これを除外するための処理となる。すなわち、WB情報に応じて肌色検出を実行するか否かが決定される。この具体的な判定方法について、以下で説明する。
【0040】
WBゲイン値について、画像に基づき算出されたRゲインおよびBゲインをGRおよびGBとし、リミッタ制限により制限された制限Rゲインおよび制限BゲインをGR'およびGB'とすると、以下の式(1)〜(6)の少なくとも一つを満足する場合、つまり各ゲイン値GR、GR'、GB、GB'の相対的関係が所定範囲内となる場合(換言すれば所定条件を満足する場合)には、肌色検出可能でないと判定し、肌色の検出を実行しないで処理を完了する。
【0041】
【数1】

Figure 0004039147
【0042】
ここで、GRB_High、GRB_Low、GR'B'_High、GR'B'_Low、GR_EXCESS、GB_EXCESSは所定の定数である。なお、これらの定数は、例えば太陽光時の標準的なWBゲイン値であるGR=1.67、GB=1.30を考慮して求めるのが好ましい。
【0043】
上記の式(1)および式(2)に示す条件判定の概念を図示すると、図8のようになる。図8の横軸は、GR−GBを示している。ここで、平行斜線部が肌色検出可能で適正な範囲となるが、それ以外については、GRが過剰であったりGBが過剰であるため、不適切な範囲として除外されることとなる。
【0044】
そして、被写体抽出部45で主被写体を検出するために基準とする肌色検出領域を設定する(ステップS203)。すなわち、画像から肌色が表れる主被写体を検出する場合において、色空間において肌色と見なす対応領域(以下では「肌色検出領域」という)を設定する。
【0045】
肌色検出領域とは、画素データのRGB値から輝度の影響を受けない色度u',v'で表現された「CIE 1976 UCS色度図」の特定領域を指している。ここで、ある画素のRGB値から色度u',v'を算出する際には、以下の式(7)及び式(8)で算出することができる。
【0046】
【数2】
Figure 0004039147
【0047】
【数3】
Figure 0004039147
【0048】
図9は、「CIE 1976 UCS色度図」の簡略図である。図9において領域RHは予め設定されるデフォルトの肌色検出領域である。すなわち、上記式(7)及び式(8)によって求められる色度u'、v'を次の条件式にあてはめれば各画素が肌色画素であるか否かを判定することができる。
【0049】
【数4】
Figure 0004039147
【0050】
【数5】
Figure 0004039147
【0051】
上記の式(7)によって算出される色度u'が条件式(9)を満たし、かつ、式(8)によって算出される色度v'が条件式(10)を満たす場合には、当該画素は肌色画素であることが判明する。
【0052】
しかし、デフォルトの肌色検出領域RHを使用するだけでは、例えばリミッタ制限によって画像が赤気味である場合に、正確な肌色検出が困難である。このような場合には、以下で説明するように、肌色検出領域を赤色側にシフトさせ、肌色の検出方法を変更することとする。
【0053】
図10は、肌色検出領域のシフトを説明するための図である。図10の横軸は、Rゲイン(GR)を示しており、縦軸は色度図のu'成分を示している。また、図中の折れ線Frは、上記のu'_minの値を表している。
【0054】
夕景やタングステン光などの赤みを残すリミッタ制御が行われると、算出された制限前WBゲイン値(GR)に代わり制限WBゲイン値(GR')でWB処理が行われる。
【0055】
そこで、このように赤みを残すように制限WBゲインが設定される場合、すなわちリミッタ制限が行われるGR≧thdの場合には、直線Fr2に示すようにGRの値に応じてu'_minの値を増加させる。例えば、閾値thdより大きいGR1の場合にはu'_min=0.23となる。一方、リミッタ制限が行われていないGR<thdの場合には、直線Fr1に示すように、デフォルトのu'_min=0.22を使用する。また、u'_maxについても同様に、例えば閾値thdより大きいGR1の場合にはu'_max=0.28に変更する。
【0056】
上記のGR1の場合には、u'_minが0.23に、u'_maxが0.28にシフトすることとなるが、これにより変更された肌色検出領域RHsを図9に示す。このように、ホワイトバランス情報に応じて色空間で肌色検出領域を変更するため、精度の良い人物検出が可能となる。
【0057】
次に、ステップS204に進み、被写体抽出部45は肌色領域設定部44で設定された肌色領域に基づき肌色画素を抽出する肌色画素抽出処理を行う。換言すれば、この肌色画素抽出処理は色判定処理を行うことである。
【0058】
具体的には、画像の全画素に関して、図9に示すUCS色度図を利用して肌色画素を特定する。ここで、リミッタ制限がない場合には、領域RHに基づき肌色画素が検出されるとともに、リミッタ制限がある場合には、デフォルトの領域RHをシフトした領域RHsなどに基づき、肌色画素が検出される。
【0059】
このようにUCS色度図を利用して肌色画素を特定することにより、輝度の影響を受けることがなく、正確に肌色画素の特定を行うことが可能になるとともに、RGB値から色度u',v'への変換が比較的簡単な演算であるため、効率的に演算処理を行うことも可能である。
【0060】
なお、この肌色画素抽出では、肌色と判定された画素に対して、さらに輝度の判定条件を付加しても良い。具体的には、次の式(11)で算出される輝度レベルyが、式(12)で示す条件を満足する画素のみ肌色画素と判定する。
【0061】
【数6】
Figure 0004039147
【0062】
これにより、実際の被写体で肌色となっていない箇所が、高輝度や低輝度のために肌色と判定されるのを防止できる。
【0063】
次に、ステップS205に進み、被写体抽出部45は肌色ブロック抽出処理を行う。具体的には、図11に示すように、撮影画像においてn×n画素(nは自然数)の集合を1のブロックBLとし、このブロックBLを構成する画素群のうち肌色画素が所定割合以上含まれているブロックBLを、肌色ブロックとして特定する。これに対し、ブロックBLの中に含まれる肌色画素数が所定割合未満である場合には、そのブロックBLは肌色ブロックとしては抽出されず、主被写体を構成するものでないと判断される。
【0064】
このように肌色ブロックを抽出し、以後の処理をブロック単位で実行していくことにより、画素単位で処理を進めていく場合に比べて処理速度の高速化を図ることができる。特にデジタルカメラ1Aの場合にはシャッタボタン8が半押し状態とされると、シャッタチャンスを逃さないためにも迅速に主被写体を合焦状態に導くことが求められるため、上記のようなブロック単位ごとの処理とすることは重要な意義を有する。また同時に、所定割合の肌色画素が存在するブロックを肌色ブロックとするため、肌色ブロックの信頼性を高めると同時に、最終的には主被写体抽出の信頼性を高めることにもなる。
【0065】
次に、ステップS206に進み、被写体抽出部45は肌色ブロックとして特定されたブロックのグループ化処理を行う。グループ化とは、縦方向又は横方向に連続して分布する肌色ブロックを連結して肌色ブロックの集合体を形成させる処理である。このため、1個の肌色ブロックが他の肌色ブロックに接することなく孤立して存在する場合には、当該肌色ブロックはグループ化処理によって肌色ブロックの集合体形成から排除される。換言すれば、このグループ化処理により、主被写体としてありえないような小さな肌色ブロックは、主被写体を構成しないものとして取り扱われる。
【0066】
また、ここでは、グループ化処理によって形成される肌色ブロックの集合体のグループ情報も生成される。グループ情報とは、肌色ブロックの集合体ごとに生成され、集合体を構成する縦方向及び横方向のブロック数とその集合体の重心位置とを含む情報である。このグループ情報は、後に行われる形状判定処理(ステップS207)及び顔の特定処理(ステップS208)において用いられる。
【0067】
次に、ステップS207に進み、被写体抽出部45はステップS206のグループ化処理によって形成された肌色ブロック集合体の形状判定処理を行う。一般に、画像から肌色グループ集合体を求めると、人物の肌部分だけが抽出される訳ではなく、事実上肌色を示す壁や樹木肌等の人物の肌以外の物体も肌色グループ集合体を形成し得る。また人物の手や足も肌色グループ集合体を形成し得る。そこで、本実施形態では、被写体抽出部45においてさらに形状判定処理を行うことで、人物の顔形状に近い形状分布をしている肌色グループ集合体を主被写体として認識するように実現されている。
【0068】
ここでの形状判定処理は、所定の縦横比の範囲内に肌色ブロックの集合体が含まれるか否かを判断することにより行われる。具体的には、ステップS206で生成されたグループ情報に含まれる縦方向及び横方向のブロック数を取得し、肌色ブロック集合体の縦方向及び横方向の縦横比(K:1)を求める。そして、例えばK≧2の関係が成立すれば、当該肌色ブロック集合体は人物の顔部分を撮影した画像成分であると判断する。
【0069】
なお、肌色ブロック集合体の最大縦横比の交差位置や、肌色ブロック集合体の重心位置などの情報によって、人物の顔部分を判断しても良い。
【0070】
図12は、形状判定処理(ステップS207)において主被写体であると認識される領域を示す図である。なお、図12では、主被写体であると認識される領域を黒塗りで示している。図12に示すように、被写体抽出部45が形状判定処理を行うことにより、人物の顔部分が含まれるブロックが主被写体の領域であるものとして特定されることになる。
【0071】
次に、ステップS208に進み、被写体抽出部45は形状判定処理によって複数の主被写体が特定された場合に、そのうちから一の主被写体を特定するために顔の特定処理、すなわち主被写体の特定処理を行う。被写体抽出部45には予め画面に対する重み付け係数が設定されており、主被写体として特定された肌色ブロック集合体の重心位置に基づいて当該肌色ブロック集合体についての重み付け係数を特定する。
【0072】
図13は、画面に対する重み付け係数の一例を示す図である。図13に示すように画面G5が複数の領域に分割されており、各領域にその領域の重み付け係数が定義されている。そして、肌色ブロック集合体の重心位置が画面G5のどの位置に位置するかを特定し、その特定結果に基づいて重み付け係数を特定する。例えば、図13において、主被写体として特定された黒塗りの肌色ブロック集合体について考えると、その重心位置は図13において位置P1にあるため、重み付け係数は「10」と特定される。そして、被写体抽出部45は、当該肌色ブロック集合体の面積(例えば、肌色ブロック集合体を構成するブロック数)と、特定された重み付け係数の積を算出し、肌色ブロック集合体の主被写体適合値(主被写体らしさを示す値)とする。そして、複数の肌色ブロック集合体のそれぞれについて主被写体適合値を算出すると、各主被写体適合値を比較し、最大値を示す肌色ブロック集合体を主被写体となる人物の顔部分であると認定する。
【0073】
このように、複数の主被写体が特定された場合には、画面の中央寄りに主被写体がフレーミングされるであろうとの前提にたって、画面上の位置に対する重み付け係数を用いて主被写体適合値を求めることにより、一の主被写体を正確に特定することができる。また、小さく写っている物体よりも大きく写っている物体の方が主被写体である可能性が高いため、重み付け係数を用いた計算を行う際には、肌色ブロック集合体の面積を考慮に入れることにより、正確に主被写体を特定することが可能になる。
【0074】
なお、最大値を示す主被写体適合値から所定範囲内の値を示す複数の主被写体適合値を採用してもよい。この場合、主被写体領域として複数の領域が特定されることになるので、いわゆるマルチエリアの合焦制御を適用することになる。
【0075】
以上のようにして主被写体が特定されると、被写体抽出部45は全体制御部18に対して主被写体領域を指示することにより、全体制御部18が液晶表示部33の表示状態を更新し、主被写体領域が液晶表示部33にも表示されることになる(ステップS209)。例えば、特定された主被写体領域を赤線枠で囲むような表示が行われる。これにより、ユーザは、画像のどの部分が主被写体と認識され、合焦制御がなされるかを容易に把握することができる。また、被写体抽出部45は、上記のような処理を行うことによって特定した主被写体領域を合焦評価領域設定部41に指示する。
【0076】
図5のフローチャートに戻り、ステップS104の被写体抽出処理が終了すると、ステップS105に進む。そして合焦評価領域設定部41は合焦評価部42が評価値を算出するための合焦評価領域を被写体抽出部45によって指示された被写体領域に設定変更する。この結果、合焦評価部42において次回の評価値算出が行われる際には、主被写体の画像成分について評価値算出を行うことが可能になる。
【0077】
次に合焦制御部43によって所定ピッチでのフォーカシングレンズ12のレンズ駆動が行われ(ステップS106)、そのレンズ位置での画像取り込みが行われて(ステップS107)、合焦評価部42による評価値算出処理が行われる(ステップS108)。ステップS108において合焦評価部42は、ステップS105の合焦評価領域の変更設定処理で設定された合焦評価領域の画像成分に基づいて評価値を算出する。
【0078】
以後、評価値が最大値(又は最小値)を示すまでステップS106〜S108の処理を繰り返し、評価値が最大値(又は最小値)を示すレンズ位置を特定することができた場合、すなわちステップS109において合焦評価領域の合焦状態が実現された場合に、図6のフローチャートに進む。
【0079】
そして、合焦評価領域の合焦状態が実現された段階で再度被写体抽出処理を実行する(ステップS110)。ここでの被写体抽出処理(ステップS110)も、図7を参照して説明した上記ステップS104の被写体抽出処理と同様である。
【0080】
ただし、ステップS104の段階では、合焦評価領域の画像成分がぼけた状態で主被写体の抽出処理が行われるため、その精度は低い。そのため、合焦評価領域の画像成分がぼけた状態で主被写体の抽出処理が行われ、それによって特定された主被写体領域が合焦状態と判定されたとしても、その合焦評価領域には実際の主被写体が含まれていない可能性がある。
【0081】
そのため、本実施形態ではステップS110において再度被写体抽出処理を行うこととしている。そしてステップS110の段階では、合焦評価領域の画像成分が合焦状態であると判断された状態であるため、主被写体領域を高精度に特定することが可能である。
【0082】
そして被写体抽出処理(ステップS110)が行われて、信頼性の高い主被写体領域が特定されると、被写体抽出部45は前回同様に合焦評価領域設定部41に対して特定された主被写体領域を指示する。
【0083】
これにより、合焦評価領域設定部41は、ステップS108において採用されていた合焦評価領域と、ステップS110の被写体抽出処理において特定された被写体領域とが一致するか否かを判断する(ステップS111)。つまり、この処理は、ステップS106〜S108の繰り返し処理で評価対象とされていた合焦評価領域が正確な主被写体領域であったのかどうかを確認するための処理である。その結果、合焦評価領域と、特定された主被写体領域とが一致しない場合には、ステップS105(図5)に戻り、合焦評価領域設定部41は合焦評価領域を、ステップS110の被写体抽出処理で特定された主被写体領域に設定変更する。よって、合焦評価部42において次回の評価値算出が行われる際には、信頼性の高い主被写体領域の画像成分について評価値算出を行うことが可能になり、ステップS106以降の処理が行われる。その一方、合焦評価領域と、特定された主被写体領域とが一致する場合には、ステップS112(図6)に進む。
【0084】
合焦評価領域設定部41が、合焦評価領域と、特定された主被写体領域とが一致すると判断した場合には、全体制御部18に対して本撮影動作の許可を行う(ステップS112)。
【0085】
全体制御部18は、本撮影動作の許可が与えられると、まず、ユーザによってシャッタボタン8が全押し状態とされたか否かを判断する。デジタルカメラ1Aではシャッタボタン8の全押し状態が本撮影動作の条件となっているため、シャッタボタン8が全押し状態でない場合には、フレーミングが変更された場合に対処するために、ステップS102(図5)に戻ってシャッタボタン8が半押し状態とされた以降の処理を繰り返す。
【0086】
また、シャッタボタン8が全押し状態とされた場合には、全体制御部18が撮影機能部20を制御して本撮影動作を行い(ステップS114)、画像処理部32において所定の画像処理(ステップS115)を行った後、記録メディア9への記録処理(ステップS116)が行われる。
【0087】
以上のデジタルカメラ1Aの動作により、WBゲイン値に応じて肌色検出を行わなかったり、色空間における肌色検出領域を変更するため、画像から主被写体を精度良く抽出できる。
【0088】
なお、上記のステップS202における肌色検出可能か否かの判定については、以下で説明するように輝度情報を利用して判定しても良い。
【0089】
WB処理は、一般に太陽光下で高性能を発揮できるが、室内光下では様々な光源が存在するため信頼性が低下する傾向にある。すなわち、太陽光下の可能性が大きい高輝度の場合には、WB処理の信頼性が高く、室内光下の可能性が大きい低輝度の場合には、WB処理の信頼性が低くなると考えられる。そこで、上記の式(11)に基づき算出される輝度レベルYが、以下の式(13)〜(18)を満足する場合には、肌色検出可能でないと判定し、肌色検出を実行しない。
【0090】
【数7】
Figure 0004039147
【0091】
ここで、GRB_High、GRB_Low、GR'B'_High、GR'B'_Low、GR_EXCESS、GB_EXCESSは、上記の式(1)〜(6)と同じ値であり、nは所定の定数である。
【0092】
また、上記のステップS203における肌色検出領域の設定については、図14のフローチャートに示す処理手順を行うようにしても良い。以下で本処理を説明する。
【0093】
まず、GBゲイン値が所定値αより大きいかを判定する(ステップS301)。ここで、GBゲイン値が所定値αより大きい場合には、ステップS302に進み、大きくない場合には、ステップS303に進む。
【0094】
ステップS302では、GRゲインが所定値βより大きいかを判定する。ここで、GRゲイン値が所定値βより大きい場合には、制限前WBゲイン値(GB、GR)と制限WBゲイン値(GB'、GR')との差ΔGB、ΔGRを算出する(ステップS304)。一方、GRゲイン値が所定値β以下である場合には、制限前GBゲイン値(GB)と制限GBゲイン値(GB')との差ΔGBを算出するとともに、ΔGRに0を代入する(ステップS305)。
【0095】
ステップS303でも、GRゲインが所定値βより大きいかを判定する。ここで、GRゲイン値が所定値βより大きい場合には、制限前GRゲイン値(GR)と制限GRゲイン値(GR')との差ΔGRを算出するとともにΔGBに0を代入する(ステップS306)。一方、GRゲイン値が所定値β以下である場合には、ΔGBおよびΔGRに0を代入する(ステップS307)。
【0096】
次に、ステップS304〜S307で設定されたΔGBをn倍した値をGBから減算してGB''を算出するとともに、ΔGRをn倍した値をGRから減算してGR''を算出する(ステップS308)。そして、ステップS308で算出されたGB''、GR''に基づき、色空間での肌色検出領域を設定する。
【0097】
以上の処理により、ステップS304を経てステップS308で算出されたGB''とGBおよびGB'との関係は、例えば図15に示すようになる。このように、制限前WBゲイン値と制限WBゲイン値との中間的な値GB''、GR''に基づき肌色検出領域を設定できるため、肌色検出領域を適切に設定できる。
【0098】
<第2実施形態>
本発明の第2実施形態に係るデジタルカメラ1Bは、図1および図2に示す第1実施形態のデジタルカメラ1Aと類似の構成となっているが、肌色領域設定部44と被写体抽出部45との構成が相違している。
【0099】
すなわち、肌色領域設定部44および被写体抽出部45は、以下で説明する被写体抽出処理を行うための機能構成を具備している。
【0100】
<デジタルカメラ1Bの処理>
デジタルカメラ1Bの処理については、図5および図6のフローチャートに示す処理と類似であるが、ステップS104およびステップS110の被写体抽出処理が異なっている。この被写体抽出処理を以下で説明する。
【0101】
図16は、デジタルカメラ1Bの被写体抽出処理を示すフローチャートである。
【0102】
まず、肌色領域設定部44は、全体制御部18から輝度情報を取得する(ステップS401)。この輝度情報とは、上記の式(11)に基づきRGBの各画素値から算出される輝度の情報である。なお、ステップS401では、画像のG成分だけに基づく輝度情報を取得しても良い。
【0103】
次に、ステップS401で取得した輝度情報に基づき、肌色検出可能な輝度であるかを判定する(ステップS402)。ライブビュー撮影では、動画的態様で画像を取得するため、最大露光時間が決まっている。したがって、被写体の照度が低い場合には、露光時間に限度があるため取得された画像の輝度が低くなり、肌色検出が精度良く行えない。そこで、ステップS402では、所定の輝度レベルより低輝度の画像を、肌色検出不可能な画像として除外するための処理が行われる。したがって、この場合には肌色検出は行わない。
【0104】
そして、図7のステップS203と同様に、被写体抽出部45で主被写体を検出するために基準とする肌色検出領域を設定する(ステップS403)。この肌色検出領域の設定では、WBゲイン値を利用する第1実施形態と異なり輝度レベルを利用して行われる。すなわち、露出が適正の場合には、上記の式(9)および式(10)に示すデフォルトの肌色検出領域を設定するが、露出がオーバー(高輝度)気味の場合には、肌色検出領域を白色側にシフトさせる。また、露出がアンダー(低輝度)気味の場合には、肌色検出領域を黒色側にシフトさせる。この処理について、以下で具体的に説明する。
【0105】
図17は、肌色検出領域のシフトを説明するための図である。図17の横軸は、輝度レベルを示しており、縦軸は色度図のv'成分を示している。また、図中の折れ線Fqは、上記式(10)に示すv'_minの値を表している。
【0106】
高輝度、具体的には閾値thd1より輝度レベルが大きい場合には、線分Fq2に示すように輝度レベルに応じてv'_minの値を増減させる。例えば、閾値thd1より大きい輝度レベルY1の場合にはv'_min=0.48に変更する。また、低輝度、具体的には閾値thd2より輝度レベルが小さい場合には、線分Fq3に示すように輝度レベルに応じてv'_minの値を増減させる。例えば閾値thd2より小さい輝度レベルY2の場合にはv'_min=0.46に変更する。それ以外の場合には、デフォルトのv'_min=0.47を使用する。また、v'_maxについても同様に、輝度レベルY1の場合にはv'_max=0.52に、輝度レベルY2の場合にはv'_max=0.50に変更し、それ以外の場合には、デフォルトのv'_max=0.51を使用する。
【0107】
上記のY1の場合には、v'_minが0.48に、v'_maxが0.52にシフトすることとなるが、これにより変更された肌色検出領域RHaを図18に示す。また、上記のY2の場合には、v'_minが0.46に、v'_maxが0.50にシフトすることとなるが、これにより変更された肌色検出領域RHbを図18に示す。このように、輝度情報に応じて色空間で肌色検出領域を変更するため、精度の良い主被写体検出が可能となる。
【0108】
以降のステップS404〜S409については、図7のステップS204〜S209と同様の処理を行う。
【0109】
以上のデジタルカメラ1Bの動作により、輝度レベルに応じて肌色検出を行わなかったり、色空間における肌色検出領域を変更するため、画像から主被写体を精度良く抽出できる。
【0110】
なお、図16のフローチャートに示す被写体抽出処理においては、図19のフローチャートに示す肌色画素再抽出処理を追加しても良い。この再抽出処理は、図16のステップS404とS405との間に挿入される。以下で、この処理を詳しく説明する。
【0111】
まず、輝度レベルが所定値γより大きいかを判定する(ステップS501)。ここで、輝度レベルが所定値γより大きい場合には、ステップS502に進み、大きくない場合には、ステップS503に進む。
【0112】
ステップS502では、ステップS404で抽出された肌色画素の周辺が白色になっているかを判定する。人物の顔の一部が白飛びしている場合には、肌色から徐々に白色に変化する傾向があり、この変化を検出することで誤判定防止を図る。ここで、白色になっている場合には、露光時間を短縮する(ステップS504)。これにより、輝度を低下させることができる。なお、露光時間を短縮する代わりに、絞りを絞っても良い。
【0113】
ステップS503では、輝度レベルが所定値δより小さいかを判定する(ステップS503)。ここで、輝度レベルが所定値δより小さい場合には、ステップS505に進む。そして、上述した白色と同様の理由により、ステップS404で抽出された肌色画素の周辺が黒色になっているかを判定する(ステップS505)。ここで、黒色になっている場合には、露光時間を延長する(ステップS506)。これにより、輝度を向上させることができる。なお、露光時間を延長する代わりに、絞りを開放しても良い。
【0114】
そして、CCD撮像素子30で取得された画像を再度取り込み(ステップS507)、ステップS404と同様の肌色画素抽出処理を再び行う(ステップS508)。これにより、適正輝度の画像を利用できるため、確実な肌色画素検出を行えることとなる。
【0115】
以上の肌色画素再抽出処理を行うことによって、より信頼性の高い肌色検出が行えることとなる。
【0116】
<第3実施形態>
次に、本発明の第3実施形態に係るデジタルカメラ1Cについて説明する。なお、デジタルカメラ1Cの装置構成については、第1実施形態のデジタルカメラ1Aと同様である(図1、図2参照)。ただし、デジタルカメラ1Cの全体制御部18は、後述する動作を制御するための機能構成となっている点で異なっている。
【0117】
上記のデジタルカメラ1Aでは、合焦制御部43が所定ピッチでフォーカシングレンズ12を段階的に駆動させつつ、合焦評価部42において各レンズ位置での評価値が算出されるが、被写体抽出処理が実行されるのは、フォーカシングレンズ12を段階的に駆動させる前と合焦評価領域が合焦状態に達した後である。そのため、フォーカシングレンズ12を段階的に駆動させる前に実行される被写体抽出処理(ステップS104)によって実際には主被写体と全く異なる被写体が主被写体であると特定されていた場合には、その被写体が含まれる合焦評価領域を合焦状態に導くための動作が無駄になる。
【0118】
このため、本実施形態では、フォーカシングレンズ12を段階的に移動させる最中にも、被写体抽出処理を実行することにより、無駄な動作を省いてさらに効率的に主被写体を正確に合焦状態に導く形態について説明する。
【0119】
図20及び図21は、デジタルカメラ1Cの処理手順を示すフローチャートであり、特にシャッタボタン8が半押し状態とされてから本撮影動作が行われるまでの全体的な処理手順を示している。
【0120】
まず、ユーザによってシャッタボタン8が半押し状態にされると(ステップS601)、全体制御部18が主被写体合焦制御部40と撮影機能部20とを機能させる。
【0121】
そして、合焦制御部43がレンズ駆動部50を制御してフォーカシングレンズ12を最も遠側に移動させる(ステップS602)。なお、ステップS602の処理が次回以降実行される場合には、合焦制御部43がフォーカシングレンズ12を近側方向に所定ピッチ分移動させる制御動作を行うことになる。
【0122】
次に、合焦評価領域の設定処理が行われる(ステップS603)。合焦評価領域設定部41は、被写体抽出部45から主被写体領域が指定されている場合はその指定された主被写体領域を合焦評価領域に設定する。ただし、シャッタボタン8が半押し状態にされてから最初にステップS603の処理が行われる際には、未だ被写体抽出処理(ステップS608)は実行されていない。このため、未だ被写体抽出部45から主被写体領域が指定されていない場合、合焦評価領域設定部41は画像の中央部分に予め設定された初期状態の合焦評価領域FR1(図3参照)を評価値算出対象の合焦評価領域として設定する。これに対し、既に被写体抽出処理が何回か実行されている場合には、合焦評価領域設定部41は前回指定された最新の主被写体領域を評価値算出対象の合焦評価領域として設定する。そして、合焦評価領域設定部41は合焦評価領域を合焦評価部42に対して指示する。
【0123】
そして、全体制御部18はフォーカシングレンズ12が現在のレンズ位置にあるときに撮影機能部20における撮影動作を行わせる。そして、合焦評価部42は画像メモリ31に格納された画像を取り込み(ステップS604)、評価値の算出処理を行う(ステップS605)。このとき、合焦評価部42は、ステップS603において合焦評価領域設定部41から指定された合焦評価領域の画像成分に基づいて評価値の算出を行い、その結果算出された評価値は合焦制御部43に与えられる。
【0124】
そして、肌色領域設定部44は、被写体抽出処理を実行するか否かの判定を行う(ステップS606)。このデジタルカメラ1Cでは、フォーカシングレンズ12を所定ピッチで段階的に移動させる際に、各レンズ位置で被写体抽出処理を実行することができるように構成されるが、所定ピッチでのレンズ駆動ごとに毎回被写体抽出処理を実行するように構成すると、主被写体を合焦状態に導くまでに長時間を要することになる。そのため、このデジタルカメラ1Cの主被写体合焦制御部40は、被写体抽出処理の実行頻度を調整する機能をも備える。
【0125】
主被写体合焦制御部40が被写体抽出処理の実行頻度を調整する方法には、いくつかの方法がある。まず、第1に、所定ピッチでのフォーカシングレンズ12のレンズ駆動が所定回数行われるごとに被写体抽出処理を1回実行する方法がある。これにより、レンズ駆動が行われる度に毎回被写体抽出処理が行われることを回避することができるので、効率的な合焦動作を実現することができる。
【0126】
また、第2に、合焦評価部42で求められる評価値を参酌して合焦評価領域の画像成分が合焦状態に近づくにつれて被写体抽出処理の実行頻度を増加させる方法がある。例えば、評価値が合焦位置で最大値を示す場合には、評価値が第1の閾値未満の場合はレンズ駆動が10回行われるごとに1回被写体抽出処理を実行し、第1の閾値以上第2の閾値未満の場合はレンズ駆動が5回行われるごとに1回被写体抽出処理を実行し、第2の閾値以上の場合はレンズ駆動が2回行われるごとに1回被写体抽出処理を実行するというように、合焦評価部42における評価結果に基づいて被写体抽出処理の実行頻度を調整するのである。このように構成することにより、合焦評価領域の画像成分が合焦状態に近づくにつれて、主被写体を抽出するための処理が増加する。合焦評価領域の画像成分が合焦状態に近い場合には比較的高精度に主被写体の特定が行われるので、この第2の方法は、主被写体を合焦状態に導くためには効果的な方法となる。
【0127】
ただし、主被写体合焦制御部40が被写体抽出処理の実行頻度を調整する方法は、上記第1又は第2の方法に限定されるものではなく、他の方法を採用してもよい。また、主被写体合焦制御部40における処理速度が十分に速い場合には、レンズ駆動後の毎回の画像取り込み時に被写体抽出処理を実行するようにしてもよい。
【0128】
そして、主被写体合焦制御部40がレンズ駆動回数をカウントして被写体抽出処理を実行すると判定した場合には、ステップS608の被写体抽出処理に進む。これに対し、被写体抽出処理を実行しないと判断した場合には、被写体抽出処理(ステップS608)をスキップさせて合焦判定を行う処理、すなわちステップS610(図21のフローチャート)に進むことになる。
【0129】
本実施形態においても、被写体抽出処理(ステップS608)の詳細は、図7に示すフローチャートと同様である。すなわち、WBゲイン値に応じた肌色検出により被写体抽出が行われる。
【0130】
そして、被写体抽出処理(ステップS608)において主被写体の領域が特定されると、その主被写体領域が被写体抽出部45から合焦評価領域設定部41に伝えられる。
【0131】
ステップS609に進み、合焦評価領域設定部41は、それまでの合焦評価領域と、被写体抽出処理によって特定された主被写体領域とを比較し、両者が一致するか否かを判断する。この処理は、それまで評価対象とされていた合焦評価領域が正確な主被写体領域であったのかどうかを確認するための処理である。そして、一致しない場合には、ステップS603に戻り、合焦評価領域設定部41は以後の合焦評価領域を、ステップS608の被写体抽出処理で特定された主被写体領域に設定変更する。よって、合焦評価部42において次回の評価値算出が行われる際には、前回よりも信頼性の高い主被写体領域の画像成分について評価値算出を行うことが可能になる。その一方、合焦評価領域と、特定された主被写体領域とが一致する場合には、ステップS610(図21)に進む。
【0132】
そして、合焦制御部43は、図4に示すような評価値が最大値(又は最小値)を示すレンズ位置PXを特定することができたか否か、すなわち、合焦評価領域の合焦状態が実現されたか否かを判断する。ここで、未だ合焦評価領域の合焦状態が実現されていないと判断された場合には、ステップS602(図20)に戻って所定ピッチでのレンズ駆動、評価値算出処理等を繰り返す。その結果、最終的に合焦評価領域の合焦状態が実現された場合には、ステップS611に進み、全体制御部18に対して本撮影動作の許可を行う。
【0133】
全体制御部18は、本撮影動作の許可が与えられると、まず、ユーザによってシャッタボタン8が全押し状態とされたか否かを判断する(ステップS612)。シャッタボタン8が全押し状態でない場合には、フレーミングが変更された場合に対処するために、ステップS602(図20)に戻ってシャッタボタン8が半押し状態とされた以降の処理を繰り返す。なお、このとき、合焦制御部43は合焦制御を最初から行うことが必要になるので、フォーカシングレンズ12を最も遠側の位置に移動させることになる。
【0134】
これに対し、シャッタボタン8が全押し状態とされた場合には、全体制御部18が撮影機能部20を制御して本撮影動作を行い(ステップS613)、画像処理部32において所定の画像処理(ステップS614)を行った後、記録メディア9への記録処理(ステップS615)が行われる。
【0135】
以上のデジタルカメラ1Cの動作により、シャッタボタン8が半押し状態とされてから本撮影動作が完了するまでの処理手順が終了することで、本撮影動作においては、主被写体が画像のどの部分に存在する場合であっても、その主被写体を合焦状態として撮影することが可能である。
【0136】
そして、デジタルカメラ1Cにおいても、主被写体合焦制御部40が、WBゲイン値に応じて主被写体の抽出処理を行う際の肌色検出領域を設定し、その肌色検出領域に基づいて画像から主被写体の抽出処理を行うように構成されているため、精度良く被写体抽出を行えることとなる。
【0137】
なお、図20のステップS608に示す被写体抽出処理については、図7に示す第1実施形態の処理に限らず、図16の第2実施形態に示す輝度に基づく処理を行っても良い。この場合にも、上記と同様の効果が期待できる。
【0138】
<変形例>
◎上記の各実施形態における肌色検出領域の変更については、WBゲイン値と輝度レベルとを組合わせても良い。この場合、WBゲイン値に応じてUCS色度図のu'(横)方向へのシフトが行われるとともに、輝度レベルに応じてUCS色度図のv'(縦)方向へのシフトが行われる。これにより、デフォルトの肌色検出領域RHから例えば図22に示す領域RHcのように、肌色検出領域が斜め方向にシフトすることとなる。
【0139】
◎上記の第1実施形態において、画像中で無色彩に近い色の画素を検出し、その画素が無色彩となるようにWBゲイン値を設定する場合には、検出される画素が所定数より少ないときに、人物検出を行わないようにしても良い。
【0140】
◎上記の各実施形態における肌色検出領域RH(図9参照)については、四角形の領域として設定されるのは必須でなく、UCS色度図のu'v'空間において例えば台形や楕円形の領域として設定しても良い。
【0141】
◎上記の第1実施形態については、WBゲイン値を参照して肌色検出に適した肌色検出領域を設定するのは必須でなく、WBゲイン値に応じて肌色検出に適したWBゲイン値を再設定しても良い。
【0142】
すなわち、ライブビュー画像とは別に被写体検出専用の画像処理を行い、夕景など赤みを残すリミッタ制御が実行される場合には、例えばリミッタ制限される前の制限前WBゲイン値で再設定する。そして、制限前WBゲイン値に基づくWB処理で生成された画像から被写体検出を行う。これにより、精度の良い被写体検出が可能となる。
【0143】
また、制限WBゲイン値と、制限前WBゲイン値とに基づき肌色検出用のWBゲイン値(例えば平均値)を算出し、WBゲイン値として再設定する。この再設定されたWBゲイン値に基づくWB処理で生成された画像から被写体検出を行う。これにより、上記と同様に、精度の良い主被写体の抽出が可能となる。
【0144】
◎上記の各実施形態のデジタルカメラには、デジタルスチルカメラとデジタルビデオカメラの双方が含まれる。また、撮影装置の一例としてデジタルカメラ1を例示して述べたが、この発明はデジタルカメラ以外の撮影装置に対しても適用することが可能である。
【0145】
◎上記の各実施形態については、主被写体(すなわち特定被写体)が人物の顔部分である場合について述べた。これは、一般的に写真撮影を行う場合、人物を被写体として撮影することが多いことに鑑みたものであるが、主被写体は人物の顔部分であることに限定されるものではない。このため、主被写体を構成する色成分(例えば赤色の衣服)に関する情報をユーザが自由に設定入力することができるようにすれば、ユーザが意図する主被写体を適切に特定することが可能になる。
【0146】
◎上記の各実施形態については、抽出された主被写体をフォーカス制御に利用しているが、抽出された主被写体を露出制御に利用しても良い。
【0147】
◎上述した具体的実施形態には、以下の構成を有する発明が含まれている。
【0148】
(1)ホワイトバランス処理に係る処理パラメータを制限する制限手段と、前記処理パラメータが制限される場合には、所定の色空間で特定被写体の固有色に対応する対応領域を変更する手段とを備えることを特徴とする撮像装置。
【0149】
これにより、被写体抽出の信頼性が向上する。
【0150】
(2)ホワイトバランス処理に係る処理パラメータが所定範囲から外れる場合には、所定の色空間で特定被写体の固有色に対応する対応領域を変更する手段を備えることを特徴とする撮像装置。
【0151】
これにより、主被写体抽出の信頼性が向上する。
【0152】
(3)ホワイトバランス処理に係る処理パラメータを制限する制限手段と、前記処理パラメータが制限される場合には、固有色の検出処理を禁止する手段と、
を備えることを特徴とする撮像装置。
【0153】
これにより、主被写体抽出の信頼性が向上する。
【0154】
(4)ホワイトバランス処理に係る処理パラメータが所定範囲から外れる場合には、固有色の検出を禁止する手段を備えることを特徴とする撮像装置。
【0155】
これにより、主被写体抽出の信頼性が向上する。
【0156】
(5)請求項3の発明において、ホワイトバランス処理に係る処理パラメータを制限する制限手段と、前記処理パラメータが制限される場合で、第2パラメータにより画像にホワイトバランス処理が施される場合には、第1パラメータに基づき固有色の検出を行う手段とを備えることを特徴とする撮像装置。
【0157】
これにより、主被写体抽出の信頼性が向上する。
【0158】
(6)請求項3の発明において、ホワイトバランス処理に係る処理パラメータが所定範囲から外れる場合で、第2パラメータにより画像にホワイトバランス処理が施される場合には、第1パラメータに基づき固有色の検出を行う手段を備えることを特徴とする撮像装置。
【0159】
これにより、主被写体抽出の信頼性が向上する。
【0160】
(7)抽出手段により抽出された特定被写体についてフォーカス制御を行う手段を備えることを特徴とする撮像装置。
【0161】
これにより、適切なフォーカス制御を行える。
【0162】
(8)抽出手段により抽出された特定被写体について露出制御を行う手段を備えることを特徴とする撮像装置。
【0163】
これにより、適切な露出制御を行える。
【0164】
【発明の効果】
以上説明したように、請求項1の発明によれば、ホワイトバランス情報に応じて、特定被写体に表れる固有色の検出を実行するか否かを決定するため、画像から主被写体を精度良く抽出できる。
【0166】
また、請求項2の発明によれば、ホワイトバランス処理に係る第2パラメータにより画像にホワイトバランス処理が施される場合には、第1パラメータに基づき固有色の検出を行うため、画像から主被写体を精度良く抽出できる。
【図面の簡単な説明】
【図1】本発明の第1実施形態に係る撮影装置の一例としてのデジタルカメラ1Aを示す斜視図である。
【図2】デジタルカメラ1Aの内部構成を示すブロック図である。
【図3】デジタルカメラ1Aに予め設定される合焦評価領域の初期状態を示す図である。
【図4】レンズ位置に対する評価値変化の一例を示す図である。
【図5】デジタルカメラ1Aの処理手順を示すフローチャートである。
【図6】デジタルカメラ1Aの処理手順を示すフローチャートである。
【図7】被写体抽出処理の詳細な処理手順を示すフローチャートである。
【図8】肌色検出可能なWBゲイン値の範囲を説明するための図である。
【図9】CIE 1976 UCS色度図の簡略図である。
【図10】肌色検出領域のシフトを説明するための図である。
【図11】肌色ブロック抽出処理を説明するための図である。
【図12】形状判定処理において主被写体であると認識される領域を示す図である。
【図13】画面に対する重み付け係数の一例を示す図である。
【図14】肌色検出領域の設定に関する処理手順を示すフローチャートである。
【図15】算出されたGB''とGBおよびGB'との関係の一例を示す図である。
【図16】本発明の第2実施形態に係るデジタルカメラ1Bの被写体抽出処理を示すフローチャートである。
【図17】肌色検出領域のシフトを説明するための図である。
【図18】肌色検出領域のシフトを説明するための図である。
【図19】被写体再抽出処理の処理手順を示すフローチャートである。
【図20】本発明の第3実施形態に係るデジタルカメラ1Cの処理手順を示すフローチャートである。
【図21】本発明の第3実施形態に係るデジタルカメラ1Cの処理手順を示すフローチャートである。
【図22】本発明の変形例に係る肌色検出領域のシフトを説明するための図である。
【符号の説明】
1A、1B、1C デジタルカメラ(撮像装置)
8 シャッタボタン
11 撮影レンズ
12 フォーカシングレンズ
18 全体制御部
20 撮影機能部
30 CCD撮像素子
31 画像メモリ
40 主被写体合焦制御部
41 合焦評価領域設定部
42 合焦評価部
43 合焦制御部
44 肌色領域設定部
45 被写体抽出部
50 レンズ駆動部
RH、RHa、RHb、RHc、RHs 肌色検出領域[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an imaging apparatus that extracts a specific subject by detecting a specific color in an image including the specific subject in which the unique color appears.
[0002]
[Prior art]
In a digital camera (imaging device), a technique for detecting a skin color included in an image and extracting a person (main subject) has been proposed. Since this person extraction technique is mainly intended to detect a human image with high accuracy, no matter what state the target image is, a certain process is performed to detect the human image. Is called.
[0003]
[Problems to be solved by the invention]
However, in the above-described digital camera, when the WB (white balance) processing is not properly performed, the skin color of the actual person is not reproduced in the image due to the influence of color cast or the like, so that accurate person extraction is difficult. is there. Further, in the case of sunset scenes, tungsten light, etc., since a WB process that generally leaves red is performed, accurate person detection cannot be performed.
[0004]
Further, in the above-described digital camera, when exposure control is not properly performed, color information is lost in the image due to the influence of overexposure and underexposure, and thus accurate person extraction is difficult.
[0005]
The present invention has been made in view of the above problems, and an object of the present invention is to provide an imaging apparatus capable of accurately extracting a main subject from an image.
[0006]
[Means for Solving the Problems]
In order to solve the above-described problem, the invention of claim 1 is an imaging apparatus, wherein (a) an extraction including extracting a specific subject by detecting the specific color in an image including the specific subject in which the specific color appears Means, and (b) acquisition means for acquiring white balance information relating to the image, the extraction means (a-1) according to the white balance information, Determining means for determining whether or not to perform the detection of the unique color Have
[0008]
Also, Claim 2 The invention relates to an imaging device, wherein (a) an extraction unit that extracts the specific subject by detecting the specific color in an image including the specific subject in which the specific color appears, and (b) relates to white balance processing Setting means for setting a processing parameter; and (c) a processing means for performing the white balance processing on the image based on the processing parameter, wherein the setting means is (b-1) based on the image. Means for obtaining one parameter; (b-2) means for setting the first parameter as the processing parameter when the first parameter is within a predetermined range; and (b-3) the first parameter being Means for setting, as the processing parameter, a second parameter different from the first parameter when outside the predetermined range, and the extraction means includes (a-1) the second parameter When the white balance processing on the image based is subjected, comprises means for performing said specific color detection based on the first parameter.
[0011]
DETAILED DESCRIPTION OF THE INVENTION
<First Embodiment>
<Configuration of essential parts of digital camera 1>
FIG. 1 is a perspective view showing a digital camera 1A as an example of a photographing apparatus according to the first embodiment of the present invention. As shown in FIG. 1, a photographing lens 11 and a finder window 2 are provided on the front side of the digital camera 1A. Inside the photographic lens 11 is provided a CCD image sensor 30 for photoelectrically converting a subject image incident through the photographic lens 11 to generate image data (data consisting of an array of pixel data for each pixel). .
[0012]
The photographing lens 11 includes a focusing lens that can move along the optical axis direction. By driving the focusing lens, the focusing state of an image formed on the CCD image sensor 30 can be changed. It is configured to be able to.
[0013]
A shutter button 8, a camera status indicator 13, and a setting key 14 are arranged on the upper surface side of the digital camera 1A. The shutter button 8 is a button that is pressed by the user when photographing a subject, and is configured to detect two stages of a half-pressed state and a fully-pressed state. The camera status indicator 13 is composed of, for example, a segment display type liquid crystal display, and is provided to show the user the current setting contents in the digital camera 1A. The setting key 14 is a key switch for performing selection setting of a shooting mode according to the subject.
[0014]
Further, a mounting portion 15 for mounting a recording medium 9 for recording image data generated by the main photographing operation is formed on the side surface portion of the digital camera 1A, and an exchangeable recording medium such as a memory card or the like. 9 can be mounted.
[0015]
Although not shown in FIG. 1, a liquid crystal display unit for displaying an image taken by the CCD image sensor 30 is provided on the back side of the digital camera 1A.
[0016]
FIG. 2 is a block diagram showing an internal configuration of the digital camera 1A. In FIG. 2, solid arrows indicate the flow of control signals, and hatched arrows indicate the flow of image signals.
[0017]
As shown in FIG. 2, the digital camera 1A includes a shooting function unit 20 that realizes a shooting function when shooting a subject, and detects a main subject (specific subject) during focus control, and the main subject is in focus. A main subject focusing control unit 40 that performs control such that the focusing lens 12 included in the photographing lens 11 is driven to change the focusing state of an image formed on the CCD image pickup device 30. And an operation unit 16 including the shutter button 8 and the setting key 14 described above, and an overall control unit 18 that controls the photographing function unit 20 and the main subject focusing control unit 40 according to the operation content of the operation unit 16. Composed.
[0018]
The imaging function unit 20 includes an imaging lens 11, a CCD imaging device 30, an image memory 31 for temporarily storing image data from the CCD imaging device 30, and image compression obtained from the image data obtained from the image memory 31. An image processing unit 32 that performs predetermined image processing, a liquid crystal display unit 33 that displays a display image subjected to image processing for image display in the image processing unit 32, and image processing for image recording in the image processing unit 32 Is provided with a recording medium 9 for recording a photographed image subjected to.
[0019]
Under the control of the overall control unit 18, the shooting function unit 20 controls the live view operation for displaying the live view image on the liquid crystal display unit 33 before the main shooting, and the recording medium 9 when the shutter button 8 is fully pressed. And a main photographing operation for photographing an image for recording. Even if the liquid crystal display unit 33 is in the off state, the photographing operation by the CCD image pickup device 30 is performed at least during focusing control.
[0020]
Further, the main subject focusing control unit 40 fetches image data from the focusing evaluation region setting unit 41 and the image memory 31 for setting a focusing evaluation region for evaluating the focusing state in the entire image, and the focusing evaluation region. A focus evaluation unit 42 for obtaining an evaluation value for evaluating the in-focus state from the partial image data in the focus evaluation area specified by the setting unit 41, and a lens driving unit based on the evaluation value obtained by the focus evaluation unit 42 50, a focus control unit 43 that guides the subject image in the focus evaluation region to a focused state, a skin color region setting unit 44 that sets a skin color region in the color space according to the white balance (WB) gain, And a subject extraction unit 45 that takes in the image data from the image memory 31 and performs a main subject (person) extraction process based on the skin color detection region of the color space set by the skin color region setting unit 44. .
[0021]
For example, when the shutter button 8 is half-pressed, the overall control unit 18 causes the main subject focus control unit 40 to function so that the main subject is in an appropriate focus state, and when the shutter button 8 is fully pressed. The photographing function unit 20 is controlled to perform the main photographing operation. In addition, the overall control unit 18 causes the imaging function unit 20 to sequentially capture images as a live view operation before the actual imaging, and displays the sequentially updated images on the liquid crystal display unit 33, or the main subject focusing control unit 40. Control to give to.
[0022]
The lens driving unit 50 moves the focusing lens 12 at a predetermined pitch from the far side to the near side based on the drive signal given from the focusing control unit 43 during the focusing control operation, and forms an image on the CCD image pickup device 30. The focus state of the image to be changed is changed. When the lens position (focus position) at which the main subject is in focus is specified in the main subject focus control unit 40 and the lens position is designated by the focus control unit 43, the lens drive unit 50 Moves the focusing lens 12 to the designated lens position, and forms an image on the CCD image pickup device 30 with the main subject in focus.
[0023]
FIG. 3 is a diagram showing an initial state of a focus evaluation area preset in the digital camera 1A. As shown in FIG. 3, in the focus evaluation area setting unit 41, as the initial state of the focus evaluation area, a focus evaluation area FR1 is set at a substantially central portion of the image G1 acquired from the image memory 31, When the main subject focus control unit 40 functions to perform the first focus evaluation, the focus evaluation region setting unit 41 determines the position and size of the focus evaluation region FR1 shown in FIG. To instruct.
[0024]
The focus evaluation unit 42 acquires the image G1 from the image memory 31, and extracts an image component for the focus evaluation region FR1 therefrom. Then, an evaluation value for evaluating the focus state of the image component in the focus evaluation area FR1 is obtained. There are several methods for calculating the evaluation value. For example, as a first method, there is a method in which an image component included in the focus evaluation region FR1 is passed through a bandpass filter, and the intensity of a high-frequency component of an image signal extracted thereby is used as an evaluation value. As a method, there is a method in which a difference value of luminance values between adjacent pixels of an image component included in the focus evaluation area FR1 is obtained, and a value obtained by accumulating the difference values in the focus evaluation area FR1 is used as an evaluation value. . Further, as a third method, edge extraction processing using a differential filter or the like is performed on the image component included in the focus evaluation area FR1, and the width of the edge extracted as a result (blur width) is used as the evaluation value. There is also a method.
[0025]
In the first and second methods, when the subject is photographed, the level of the high-frequency component is small when the image is blurred, and the cumulative value of the luminance difference between adjacent pixels is small. This is a method for detecting that the level of the high-frequency component increases as it comes in close (approaching the in-focus state), and the cumulative value of the luminance difference between adjacent pixels also increases.
[0026]
For this reason, when the focusing lens 12 is gradually moved from the far side to the near side, the evaluation values obtained by the first and second methods change as shown in FIG. When the evaluation value is obtained from the image captured at each lens position while moving the focusing lens 12, the evaluation value changes as shown in FIG. 4, and the evaluation value shows the maximum value at the lens position PX. Therefore, if the focusing lens 12 is moved to the lens position PX, it is found that the image component included in the focusing evaluation area FR1 is in a focused state, and the focusing control unit 43 moves the focusing lens 12 to the lens position PX. To achieve the in-focus state.
[0027]
On the other hand, the third method is a method of detecting that when the subject is photographed, the edge width increases when the image is blurred, but the edge width decreases as the focus is achieved. Therefore, when the focusing lens 12 is gradually moved from the far side to the near side, the evaluation value obtained by the third method shows the minimum value at the in-focus position, and the focus control unit 43 sets the minimum value. The focusing lens 12 is moved to a lens position indicating the in-focus state.
[0028]
Note that the evaluation value calculation method applied in the focus evaluation unit 42 may employ any of the first to third methods described above, and may employ other calculation methods.
[0029]
By the way, if the focus evaluation area FR1 is set to an area that is always fixed with respect to the image G1, as described above, the focus evaluation area FR1 does not include the main subject intended by the user. Thus, focus detection is performed in a region different from the user's intention, and as a result, the main subject that the user wanted to photograph is photographed as a blurred image.
[0030]
Therefore, in the digital camera 1A of the present embodiment, the subject extracting unit 45 acquires an image from the image memory 31 and performs a process of extracting the main subject from the image. Then, the focus evaluation area setting unit 41 changes and sets the focus evaluation area for the image portion determined to be the main subject, and the focus evaluation section 42 sets the evaluation value for the focus evaluation area including the main subject. Perform the calculation. That is, the focus evaluation area is corrected from the initial state area to the image area recognized as the main subject, and focus control is performed so that the subject image of the main subject is in focus.
[0031]
Thus, when the main photographing operation is performed, an appropriate image in which the main subject is in focus is photographed.
[0032]
The subject extraction unit 45 extracts a skin color component of the image based on the skin color region of the color space set by the skin color region setting unit 44 and recognizes the region where the skin color component is distributed as the main subject region An extraction process is performed.
[0033]
<Processing of digital camera 1A>
The processing procedure of the digital camera 1A will be described below. FIGS. 5 to 7 are flowcharts showing the processing procedure of the digital camera 1A. In particular, FIGS. 5 and 6 show the overall processing procedure from when the shutter button 8 is half-pressed until the actual photographing operation is performed. Further, FIG. 7 shows a detailed processing procedure of the subject extraction processing.
[0034]
First, when the user presses the shutter button 8 halfway (step S101), the overall control unit 18 causes the main subject focusing control unit 40 and the photographing function unit 20 to function. At this time, the overall control unit 18 moves the focusing lens 12 to the farthest side by the main subject focusing control unit 40 and controls the photographing function unit 20 to take an image while the focusing lens 12 has moved to the farthest side. To do.
[0035]
Then, the main subject focusing control unit 40 takes in the image stored in the image memory 31 (step S102) and performs evaluation value calculation processing (step S103). At this time, the focus evaluation area setting unit 41 determines that the focus evaluation area FR1 in the initial state set in advance in the center portion of the image G1 should be the focus evaluation area to be evaluated. To instruct. The focus evaluation unit 42 calculates an evaluation value based on an image component included in the focus evaluation region FR1 (see FIG. 3) set almost at the center of the screen, and the calculated evaluation value is the focus control unit. 43.
[0036]
The skin color area setting unit 44 and the subject extraction unit 45 function to perform subject extraction processing (step S104).
[0037]
Reference is made to the flowchart of FIG. When the process proceeds to the subject extraction process (step S104), the skin color area setting unit 44 first acquires a WB gain value, which is white balance information, from the overall control unit 18 (step S201).
[0038]
The WB gain value is an image signal of R (red) and B (blue) color components that is set to adjust an image so that a white object is reproduced as white. Is the level ratio. In general, including the digital camera 1A of the present embodiment, the color reproducibility is not deteriorated by excessively color correcting a subject (for example, a reddish subject under sunset light or tungsten light) under a special light source color. As described above, a certain restriction (hereinafter referred to as “limiter restriction”) is applied to the WB gain values relating to the R and B color components. In this limiter restriction, when the WB gain value calculated from the image exceeds a predetermined threshold, for example, the predetermined threshold and the WB gain value calculated by the overall control unit 18 from the image (first parameter: below) Then, the WB gain value (second parameter: hereinafter referred to as “restricted WB gain”) is set to the average value with “pre-restricted WB gain”. In the limiter limitation, when the calculated WB gain value exceeds a predetermined threshold, the WB gain value may be limited to the predetermined threshold.
[0039]
Next, it is determined whether the WB gain value acquired in step S201 is a WB gain value that allows skin color detection based on the captured image (step S202). This is because it is difficult to detect flesh color with high accuracy based on an image subjected to WB processing with an inappropriate WB gain value in main subject detection using a flesh color that is a unique color appearing in a person (main subject). In addition, if the main subject is forcibly detected from an image that has been subjected to inappropriate WB processing, an image area that is not a person is mistaken as a person, and this is a process for excluding this. That is, whether to perform skin color detection is determined according to the WB information. This specific determination method will be described below.
[0040]
Assuming that the R gain and the B gain calculated based on the images are GR and GB and the limited R gain and the limited B gain limited by the limiter limitation are GR ′ and GB ′, the following formula (1) When at least one of (6) is satisfied, that is, when the relative relationship between the gain values GR, GR ′, GB, GB ′ is within a predetermined range (in other words, when a predetermined condition is satisfied). Then, it is determined that the skin color cannot be detected, and the processing is completed without executing the skin color detection.
[0041]
[Expression 1]
Figure 0004039147
[0042]
Here, GRB_High, GRB_Low, GR′B′_High, GR′B′_Low, GR_EXCESS, and GB_EXCESS are predetermined constants. These constants are preferably obtained in consideration of, for example, GR = 1.67 and GB = 1.30 which are standard WB gain values during sunlight.
[0043]
The concept of the condition determination shown in the above formulas (1) and (2) is illustrated in FIG. The horizontal axis in FIG. 8 indicates GR-GB. Here, the parallel oblique line portion is an appropriate range in which skin color can be detected, but in other cases, since GR is excessive or GB is excessive, it is excluded as an inappropriate range.
[0044]
Then, a skin color detection region as a reference for detecting the main subject by the subject extraction unit 45 is set (step S203). That is, when detecting a main subject whose skin color appears from an image, a corresponding region (hereinafter referred to as “skin color detection region”) that is regarded as a skin color in the color space is set.
[0045]
The skin color detection area refers to a specific area of the “CIE 1976 UCS chromaticity diagram” expressed by chromaticity u ′, v ′ that is not affected by luminance from the RGB value of pixel data. Here, when calculating the chromaticity u ′, v ′ from the RGB value of a certain pixel, it can be calculated by the following equations (7) and (8).
[0046]
[Expression 2]
Figure 0004039147
[0047]
[Equation 3]
Figure 0004039147
[0048]
FIG. 9 is a simplified diagram of the “CIE 1976 UCS Chromaticity Diagram”. In FIG. 9, a region RH is a default skin color detection region set in advance. That is, if the chromaticities u ′ and v ′ obtained by the above equations (7) and (8) are applied to the following conditional expression, it can be determined whether or not each pixel is a skin color pixel.
[0049]
[Expression 4]
Figure 0004039147
[0050]
[Equation 5]
Figure 0004039147
[0051]
When the chromaticity u ′ calculated by the above expression (7) satisfies the conditional expression (9) and the chromaticity v ′ calculated by the expression (8) satisfies the conditional expression (10), It turns out that the pixel is a skin color pixel.
[0052]
However, using only the default skin color detection region RH makes it difficult to accurately detect the skin color when, for example, the image is reddish due to limiter limitations. In such a case, as described below, the skin color detection region is shifted to the red side, and the skin color detection method is changed.
[0053]
FIG. 10 is a diagram for explaining the shift of the skin color detection region. The horizontal axis of FIG. 10 indicates the R gain (GR), and the vertical axis indicates the u ′ component of the chromaticity diagram. A broken line Fr in the figure represents the value of the above u′_min.
[0054]
When limiter control for leaving redness such as sunset or tungsten light is performed, WB processing is performed with the limited WB gain value (GR ′) instead of the calculated pre-limit WB gain value (GR).
[0055]
Therefore, when the limited WB gain is set so as to leave red as described above, that is, when GR ≧ thd in which the limiter is limited, the value of u′_min according to the value of GR as indicated by the straight line Fr2. Increase. For example, in the case of GR1 larger than the threshold thd, u′_min = 0.23. On the other hand, when GR <thd where the limiter is not limited, the default u′_min = 0.22 is used as shown by the straight line Fr1. Similarly, u′_max is changed to u′_max = 0.28 in the case of GR1 larger than the threshold thd, for example.
[0056]
In the case of the above GR1, u′_min is shifted to 0.23 and u′_max is shifted to 0.28. FIG. 9 shows the skin color detection region RHs changed by this. As described above, since the skin color detection area is changed in the color space in accordance with the white balance information, it is possible to accurately detect a person.
[0057]
In step S204, the subject extraction unit 45 performs a skin color pixel extraction process for extracting a skin color pixel based on the skin color region set by the skin color region setting unit 44. In other words, this skin color pixel extraction process is a color determination process.
[0058]
Specifically, for all the pixels of the image, skin color pixels are specified using the UCS chromaticity diagram shown in FIG. Here, when there is no limiter limitation, a skin color pixel is detected based on the region RH, and when there is a limiter limitation, a skin color pixel is detected based on the region RHs shifted from the default region RH. .
[0059]
Thus, by specifying the skin color pixel using the UCS chromaticity diagram, it becomes possible to specify the skin color pixel accurately without being influenced by the luminance, and the chromaticity u ′ can be determined from the RGB value. , V ′ is a comparatively simple calculation, so that the calculation process can be performed efficiently.
[0060]
In this skin color pixel extraction, a luminance determination condition may be further added to a pixel determined to be a skin color. Specifically, only a pixel whose luminance level y calculated by the following equation (11) satisfies the condition shown by the equation (12) is determined to be a skin color pixel.
[0061]
[Formula 6]
Figure 0004039147
[0062]
As a result, it is possible to prevent a portion that is not a skin color in an actual subject from being determined to be a skin color due to high brightness or low brightness.
[0063]
In step S205, the subject extraction unit 45 performs a flesh color block extraction process. Specifically, as shown in FIG. 11, a set of n × n pixels (n is a natural number) in a photographed image is set as one block BL, and skin color pixels included in a pixel group constituting the block BL include a predetermined ratio or more. The identified block BL is specified as a skin color block. On the other hand, when the number of skin color pixels included in the block BL is less than a predetermined ratio, it is determined that the block BL is not extracted as a skin color block and does not constitute a main subject.
[0064]
By extracting the flesh color block in this way and executing the subsequent processing in units of blocks, the processing speed can be increased as compared with the case where the processing is performed in units of pixels. In particular, in the case of the digital camera 1A, when the shutter button 8 is half-pressed, it is required to quickly bring the main subject into focus so as not to miss the shutter chance. Each process has an important significance. At the same time, since a block having a predetermined proportion of flesh-color pixels is used as a flesh-color block, the reliability of the flesh-color block is improved, and at the same time, the reliability of main subject extraction is finally improved.
[0065]
Next, proceeding to step S206, the subject extraction unit 45 performs a grouping process for blocks identified as skin color blocks. Grouping is a process in which flesh color blocks distributed continuously in the vertical direction or the horizontal direction are connected to form an aggregate of flesh color blocks. For this reason, when one flesh-color block exists in isolation without touching another flesh-color block, the flesh-color block is excluded from the formation of the flesh-color block aggregate by the grouping process. In other words, by this grouping process, a small flesh color block that cannot be a main subject is treated as not constituting the main subject.
[0066]
Further, here, group information of a collection of flesh color blocks formed by the grouping process is also generated. The group information is information that is generated for each aggregate of skin color blocks and includes the number of blocks in the vertical and horizontal directions constituting the aggregate and the barycentric position of the aggregate. This group information is used in shape determination processing (step S207) and face identification processing (step S208) to be performed later.
[0067]
Next, proceeding to step S207, the subject extraction unit 45 performs a shape determination process of the flesh color block aggregate formed by the grouping process of step S206. In general, when a skin color group aggregate is obtained from an image, only the skin portion of the person is not extracted, but objects other than the skin of the person such as walls and tree skin that actually show the skin color also form the skin color group aggregate. obtain. Human hands and feet can also form a flesh-colored group aggregate. Therefore, in the present embodiment, the subject extraction unit 45 further performs shape determination processing so as to recognize a skin color group aggregate having a shape distribution close to a human face shape as a main subject.
[0068]
The shape determination process here is performed by determining whether or not an aggregate of skin color blocks is included within a predetermined aspect ratio range. Specifically, the numbers of vertical and horizontal blocks included in the group information generated in step S206 are acquired, and the vertical and horizontal aspect ratios (K: 1) of the flesh color block aggregate are obtained. For example, if a relationship of K ≧ 2 is established, it is determined that the flesh color block aggregate is an image component obtained by photographing a human face portion.
[0069]
The face portion of the person may be determined based on information such as the intersection position of the maximum aspect ratio of the flesh color block aggregate and the gravity center position of the flesh color block aggregate.
[0070]
FIG. 12 is a diagram showing an area recognized as the main subject in the shape determination process (step S207). In FIG. 12, the area recognized as the main subject is shown in black. As illustrated in FIG. 12, the subject extraction unit 45 performs shape determination processing, so that a block including a person's face portion is identified as the main subject region.
[0071]
Next, the process proceeds to step S208, and when a plurality of main subjects are specified by the shape determination process, the subject extraction unit 45 specifies a face specification process, that is, a main subject specification process, in order to specify one of the main subjects. I do. A weighting coefficient for the screen is set in advance in the subject extraction unit 45, and the weighting coefficient for the flesh color block aggregate is identified based on the barycentric position of the flesh color block aggregate identified as the main subject.
[0072]
FIG. 13 is a diagram illustrating an example of a weighting coefficient for the screen. As shown in FIG. 13, the screen G5 is divided into a plurality of areas, and a weighting coefficient for each area is defined for each area. Then, the position of the center of gravity of the flesh color block aggregate is specified on the screen G5, and the weighting coefficient is specified based on the specification result. For example, in FIG. 13, when considering a black-colored flesh color block aggregate specified as a main subject, the center of gravity is located at position P1 in FIG. 13, and thus the weighting coefficient is specified as “10”. Then, the subject extraction unit 45 calculates the product of the area of the skin color block aggregate (for example, the number of blocks constituting the skin color block aggregate) and the specified weighting coefficient, and the main subject fitness value of the skin color block aggregate (Value indicating the likelihood of being a main subject). Then, when the main subject suitability value is calculated for each of the plurality of skin color block aggregates, the main subject suitability values are compared, and the skin color block aggregate showing the maximum value is recognized as the face portion of the person who is the main subject. .
[0073]
Thus, when a plurality of main subjects are identified, the main subject fitness value is calculated using the weighting coefficient for the position on the screen on the assumption that the main subject will be framed closer to the center of the screen. By determining, one main subject can be specified accurately. Also, the object that appears larger than the object that appears larger is more likely to be the main subject, so the area of the flesh color block aggregate must be taken into account when performing calculations using the weighting coefficient. Thus, the main subject can be accurately specified.
[0074]
It should be noted that a plurality of main subject adaptation values indicating values within a predetermined range from the main subject adaptation value indicating the maximum value may be employed. In this case, since a plurality of areas are specified as the main subject area, so-called multi-area focusing control is applied.
[0075]
When the main subject is specified as described above, the subject extraction unit 45 instructs the main control unit 18 on the main subject region, so that the general control unit 18 updates the display state of the liquid crystal display unit 33, and The main subject area is also displayed on the liquid crystal display unit 33 (step S209). For example, display is performed so that the identified main subject region is surrounded by a red line frame. Accordingly, the user can easily grasp which part of the image is recognized as the main subject and the focus control is performed. In addition, the subject extraction unit 45 instructs the focus evaluation region setting unit 41 on the main subject region identified by performing the processing as described above.
[0076]
Returning to the flowchart of FIG. 5, when the subject extraction process in step S104 is completed, the process proceeds to step S105. The focus evaluation area setting unit 41 changes the setting of the focus evaluation area for the focus evaluation unit 42 to calculate the evaluation value to the subject area instructed by the subject extraction unit 45. As a result, when the next evaluation value calculation is performed in the focus evaluation unit 42, the evaluation value can be calculated for the image component of the main subject.
[0077]
Next, the focus control unit 43 drives the focusing lens 12 at a predetermined pitch (step S106), the image is captured at the lens position (step S107), and the evaluation value by the focus evaluation unit 42 is obtained. A calculation process is performed (step S108). In step S108, the focus evaluation unit 42 calculates an evaluation value based on the image component of the focus evaluation area set in the focus evaluation area change setting process in step S105.
[0078]
Thereafter, the processing of steps S106 to S108 is repeated until the evaluation value shows the maximum value (or minimum value), and when the lens position where the evaluation value shows the maximum value (or minimum value) can be specified, that is, step S109. If the in-focus state of the in-focus evaluation area is realized, the process proceeds to the flowchart of FIG.
[0079]
Then, the subject extraction process is executed again at the stage where the in-focus state of the in-focus evaluation area is realized (step S110). The subject extraction process (step S110) here is also the same as the subject extraction process in step S104 described with reference to FIG.
[0080]
However, since the main subject extraction process is performed in a state where the image component in the focus evaluation area is blurred at the stage of step S104, the accuracy is low. Therefore, even if the main subject extraction process is performed in a state where the image component of the focus evaluation area is blurred, and the main subject area specified thereby is determined to be in focus, the focus evaluation area does not The main subject may not be included.
[0081]
Therefore, in this embodiment, the subject extraction process is performed again in step S110. In step S110, since the image component of the focus evaluation area is determined to be in focus, the main subject area can be specified with high accuracy.
[0082]
When subject extraction processing (step S110) is performed and a highly reliable main subject region is specified, the subject extraction unit 45 determines the main subject region specified for the focus evaluation region setting unit 41 as in the previous time. Instruct.
[0083]
Thereby, the focus evaluation area setting unit 41 determines whether or not the focus evaluation area used in step S108 matches the subject area specified in the subject extraction process in step S110 (step S111). ). That is, this process is a process for confirming whether or not the focus evaluation area that has been the object of evaluation in the repetitive processes of steps S106 to S108 is an accurate main subject area. As a result, when the focus evaluation area does not match the identified main subject area, the process returns to step S105 (FIG. 5), and the focus evaluation area setting unit 41 sets the focus evaluation area as the subject in step S110. The setting is changed to the main subject area specified by the extraction process. Therefore, when the next evaluation value calculation is performed in the focus evaluation unit 42, it is possible to perform the evaluation value calculation for the image component of the main subject region with high reliability, and the processing after step S106 is performed. . On the other hand, if the focus evaluation area matches the identified main subject area, the process proceeds to step S112 (FIG. 6).
[0084]
When the focus evaluation area setting unit 41 determines that the focus evaluation area matches the identified main subject area, the main control section 18 is permitted to perform the main photographing operation (step S112).
[0085]
The overall control unit 18 first determines whether or not the shutter button 8 has been fully pressed by the user when permission for the main photographing operation is given. In the digital camera 1A, the fully depressed state of the shutter button 8 is a condition for the actual photographing operation. Therefore, when the shutter button 8 is not fully depressed, in order to cope with a change in framing, step S102 ( Returning to FIG. 5), the processing after the shutter button 8 is half-pressed is repeated.
[0086]
When the shutter button 8 is fully pressed, the overall control unit 18 controls the shooting function unit 20 to perform the actual shooting operation (step S114), and the image processing unit 32 performs predetermined image processing (step S114). After performing S115), the recording process to the recording medium 9 (step S116) is performed.
[0087]
With the above-described operation of the digital camera 1A, skin color detection is not performed according to the WB gain value, or the skin color detection area in the color space is changed, so that the main subject can be accurately extracted from the image.
[0088]
Note that the determination of whether or not the skin color can be detected in step S202 described above may be performed using luminance information as described below.
[0089]
In general, the WB treatment can exhibit high performance under sunlight, but since there are various light sources under room light, the reliability tends to decrease. That is, it is considered that the reliability of the WB process is high when the luminance is high and the possibility of being under sunlight is high, and the reliability of the WB process is low when the luminance is low and the possibility of being indoor is large. . Therefore, when the luminance level Y calculated based on the above equation (11) satisfies the following equations (13) to (18), it is determined that the skin color cannot be detected, and the skin color detection is not executed.
[0090]
[Expression 7]
Figure 0004039147
[0091]
Here, GRB_High, GRB_Low, GR′B′_High, GR′B′_Low, GR_EXCESS, and GB_EXCESS are the same values as in the above equations (1) to (6), and n is a predetermined constant.
[0092]
Further, regarding the setting of the skin color detection area in step S203, the processing procedure shown in the flowchart of FIG. 14 may be performed. This process will be described below.
[0093]
First, it is determined whether the GB gain value is larger than a predetermined value α (step S301). If the GB gain value is larger than the predetermined value α, the process proceeds to step S302. If not, the process proceeds to step S303.
[0094]
In step S302, it is determined whether the GR gain is greater than a predetermined value β. Here, if the GR gain value is larger than the predetermined value β, differences ΔGB and ΔGR between the pre-restriction WB gain values (GB, GR) and the restriction WB gain values (GB ′, GR ′) are calculated (step S304). ). On the other hand, if the GR gain value is less than or equal to the predetermined value β, the difference ΔGB between the pre-limit GB gain value (GB) and the limit GB gain value (GB ′) is calculated, and 0 is substituted into ΔGR (step) S305).
[0095]
Also in step S303, it is determined whether the GR gain is greater than a predetermined value β. If the GR gain value is larger than the predetermined value β, the difference ΔGR between the pre-restriction GR gain value (GR) and the restriction GR gain value (GR ′) is calculated and 0 is substituted into ΔGB (step S306). ). On the other hand, if the GR gain value is less than or equal to the predetermined value β, 0 is substituted for ΔGB and ΔGR (step S307).
[0096]
Next, the value obtained by multiplying ΔGB set in Steps S304 to S307 by n is subtracted from GB to calculate GB ″, and the value obtained by multiplying ΔGR by n is subtracted from GR to calculate GR ″ ( Step S308). Then, based on GB ″ and GR ″ calculated in step S308, a skin color detection region in the color space is set.
[0097]
With the above processing, the relationship between GB ″ calculated in step S308 through step S304, and GB and GB ′ is as shown in FIG. 15, for example. As described above, the skin color detection region can be set based on the intermediate values GB ″ and GR ″ between the pre-restriction WB gain value and the restriction WB gain value, and thus the skin color detection region can be appropriately set.
[0098]
Second Embodiment
A digital camera 1B according to the second embodiment of the present invention has a configuration similar to that of the digital camera 1A according to the first embodiment shown in FIGS. 1 and 2, but a skin color area setting unit 44, a subject extraction unit 45, and the like. The configuration of is different.
[0099]
That is, the skin color area setting unit 44 and the subject extraction unit 45 have a functional configuration for performing subject extraction processing described below.
[0100]
<Processing of digital camera 1B>
The processing of the digital camera 1B is similar to the processing shown in the flowcharts of FIGS. 5 and 6, but the subject extraction processing in steps S104 and S110 is different. This subject extraction process will be described below.
[0101]
FIG. 16 is a flowchart showing subject extraction processing of the digital camera 1B.
[0102]
First, the skin color area setting unit 44 acquires luminance information from the overall control unit 18 (step S401). The luminance information is luminance information calculated from the RGB pixel values based on the above equation (11). In step S401, luminance information based only on the G component of the image may be acquired.
[0103]
Next, based on the luminance information acquired in step S401, it is determined whether the luminance is capable of detecting skin color (step S402). In live view shooting, the maximum exposure time is determined in order to acquire an image in a moving image manner. Therefore, when the illuminance of the subject is low, the brightness of the acquired image is low because the exposure time is limited, and skin color detection cannot be performed with high accuracy. Therefore, in step S402, processing for excluding an image having a luminance lower than a predetermined luminance level as an image incapable of detecting skin color is performed. Therefore, skin color detection is not performed in this case.
[0104]
Then, similarly to step S203 in FIG. 7, the subject extraction unit 45 sets a skin color detection region as a reference for detecting the main subject (step S403). Unlike the first embodiment that uses the WB gain value, the skin color detection area is set using a luminance level. That is, when the exposure is appropriate, the default skin color detection area shown in the above formulas (9) and (10) is set. When the exposure is overexposed (high brightness), the skin color detection area is set. Shift to the white side. When the exposure is under (low brightness), the skin color detection area is shifted to the black side. This process will be specifically described below.
[0105]
FIG. 17 is a diagram for explaining the shift of the skin color detection region. The horizontal axis of FIG. 17 indicates the luminance level, and the vertical axis indicates the v ′ component of the chromaticity diagram. A broken line Fq in the figure represents the value of v′_min shown in the above equation (10).
[0106]
When the brightness level is higher than the threshold thd1, specifically, the value of v′_min is increased or decreased according to the brightness level as indicated by a line segment Fq2. For example, in the case of the luminance level Y1 larger than the threshold thd1, it is changed to v′_min = 0.48. Further, when the luminance level is low, specifically, when the luminance level is smaller than the threshold value thd2, the value of v′_min is increased or decreased according to the luminance level as indicated by a line segment Fq3. For example, in the case of the luminance level Y2 smaller than the threshold thd2, it is changed to v′_min = 0.46. Otherwise, the default v'_min = 0.47 is used. Similarly, v′_max is changed to v′_max = 0.52 in the case of the luminance level Y1, v′_max = 0.50 in the case of the luminance level Y2, and the default v in other cases. Use '_max = 0.51.
[0107]
In the case of Y1 above, v′_min is shifted to 0.48 and v′_max is shifted to 0.52. FIG. 18 shows the skin color detection region RHa changed by this. In the case of Y2, v′_min is shifted to 0.46 and v′_max is shifted to 0.50. FIG. 18 shows the skin color detection region RHb changed by this. Thus, since the skin color detection area is changed in the color space according to the luminance information, it is possible to detect the main subject with high accuracy.
[0108]
About subsequent step S404-S409, the process similar to step S204-S209 of FIG. 7 is performed.
[0109]
With the above-described operation of the digital camera 1B, skin color detection is not performed according to the luminance level, or the skin color detection area in the color space is changed, so that the main subject can be accurately extracted from the image.
[0110]
In the subject extraction process shown in the flowchart of FIG. 16, the flesh color pixel re-extraction process shown in the flowchart of FIG. 19 may be added. This re-extraction process is inserted between steps S404 and S405 in FIG. This process will be described in detail below.
[0111]
First, it is determined whether the luminance level is greater than a predetermined value γ (step S501). If the luminance level is greater than the predetermined value γ, the process proceeds to step S502. If not, the process proceeds to step S503.
[0112]
In step S502, it is determined whether the periphery of the skin color pixel extracted in step S404 is white. When a part of a person's face is white-out, there is a tendency to gradually change from flesh color to white. By detecting this change, erroneous determination is prevented. Here, when the color is white, the exposure time is shortened (step S504). Thereby, the luminance can be reduced. Instead of shortening the exposure time, the aperture may be reduced.
[0113]
In step S503, it is determined whether the luminance level is smaller than a predetermined value δ (step S503). If the luminance level is smaller than the predetermined value δ, the process proceeds to step S505. Then, for the same reason as the white color described above, it is determined whether the periphery of the flesh color pixel extracted in step S404 is black (step S505). Here, if the color is black, the exposure time is extended (step S506). Thereby, a brightness | luminance can be improved. The aperture may be opened instead of extending the exposure time.
[0114]
Then, the image acquired by the CCD image sensor 30 is captured again (step S507), and the same skin color pixel extraction processing as that in step S404 is performed again (step S508). As a result, since an image with appropriate luminance can be used, reliable skin color pixel detection can be performed.
[0115]
By performing the above skin color pixel re-extraction process, more reliable skin color detection can be performed.
[0116]
<Third Embodiment>
Next, a digital camera 1C according to a third embodiment of the present invention will be described. The device configuration of the digital camera 1C is the same as that of the digital camera 1A of the first embodiment (see FIGS. 1 and 2). However, the overall control unit 18 of the digital camera 1C is different in that it has a functional configuration for controlling operations to be described later.
[0117]
In the digital camera 1A, the focus control unit 43 drives the focusing lens 12 stepwise at a predetermined pitch, and the focus evaluation unit 42 calculates evaluation values at each lens position. What is executed is before the focusing lens 12 is driven stepwise and after the focusing evaluation area reaches the in-focus state. For this reason, when the subject extraction process (step S104) executed before the focusing lens 12 is driven stepwise has actually been identified as a main subject that is completely different from the main subject, the subject is The operation for guiding the included focus evaluation area to the focused state is wasted.
[0118]
For this reason, in the present embodiment, the subject extraction process is executed while the focusing lens 12 is being moved stepwise, so that unnecessary operations are eliminated and the main subject is more accurately focused accurately. The guiding form will be described.
[0119]
20 and 21 are flowcharts showing the processing procedure of the digital camera 1C, and in particular, show the overall processing procedure from when the shutter button 8 is pressed halfway down until the actual photographing operation is performed.
[0120]
First, when the shutter button 8 is pressed halfway by the user (step S601), the overall control unit 18 causes the main subject focusing control unit 40 and the imaging function unit 20 to function.
[0121]
Then, the focusing control unit 43 controls the lens driving unit 50 to move the focusing lens 12 to the farthest side (step S602). When the process of step S602 is executed from the next time onward, the focusing control unit 43 performs a control operation for moving the focusing lens 12 by a predetermined pitch in the near side direction.
[0122]
Next, a focus evaluation area setting process is performed (step S603). When the main subject region is designated by the subject extraction unit 45, the focus evaluation region setting unit 41 sets the designated main subject region as the focus evaluation region. However, when the process of step S603 is performed for the first time after the shutter button 8 is half-pressed, the subject extraction process (step S608) has not yet been executed. For this reason, when the main subject area has not yet been designated by the subject extraction unit 45, the focus evaluation area setting unit 41 uses the initial focus evaluation area FR1 (see FIG. 3) set in advance in the center of the image. It is set as a focus evaluation area for evaluation value calculation. On the other hand, when the subject extraction process has already been performed several times, the focus evaluation area setting unit 41 sets the latest main subject area designated last time as the focus evaluation area to be evaluated. . Then, the focus evaluation area setting unit 41 instructs the focus evaluation part 42 about the focus evaluation area.
[0123]
Then, the overall control unit 18 causes the photographing function unit 20 to perform a photographing operation when the focusing lens 12 is at the current lens position. Then, the focus evaluation unit 42 takes in the image stored in the image memory 31 (step S604), and performs evaluation value calculation processing (step S605). At this time, the focus evaluation unit 42 calculates an evaluation value based on the image component of the focus evaluation region designated from the focus evaluation region setting unit 41 in step S603, and the calculated evaluation value is the focus value. This is given to the focus control unit 43.
[0124]
Then, the skin color area setting unit 44 determines whether or not to execute subject extraction processing (step S606). The digital camera 1C is configured so that subject extraction processing can be executed at each lens position when the focusing lens 12 is moved stepwise at a predetermined pitch, but every time the lens is driven at a predetermined pitch. If the subject extraction processing is executed, it takes a long time to lead the main subject to the focused state. Therefore, the main subject focusing control unit 40 of the digital camera 1C also has a function of adjusting the execution frequency of the subject extraction process.
[0125]
There are several methods by which the main subject focus control unit 40 adjusts the execution frequency of the subject extraction process. First, there is a method in which the subject extraction process is executed once every time the lens driving of the focusing lens 12 at a predetermined pitch is performed a predetermined number of times. Accordingly, it is possible to avoid subject extraction processing from being performed every time lens driving is performed, and thus an efficient focusing operation can be realized.
[0126]
Second, there is a method of increasing the execution frequency of the subject extraction process as the image component in the focus evaluation area approaches the focus state by taking into account the evaluation value obtained by the focus evaluation unit 42. For example, when the evaluation value indicates the maximum value at the in-focus position, when the evaluation value is less than the first threshold value, the subject extraction process is executed once every time the lens is driven ten times, and the first threshold value is set. When the value is less than the second threshold, the subject extraction process is executed once every time the lens is driven five times. When the value is equal to or greater than the second threshold, the subject extraction process is performed once every time the lens is driven twice. The execution frequency of the subject extraction process is adjusted on the basis of the evaluation result in the focus evaluation unit 42 so as to execute. With this configuration, the processing for extracting the main subject increases as the image component in the focus evaluation area approaches the focused state. When the image component in the focus evaluation area is close to the focus state, the main subject is identified with relatively high accuracy, so this second method is effective for leading the main subject to the focus state. Method.
[0127]
However, the method by which the main subject focus control unit 40 adjusts the execution frequency of the subject extraction process is not limited to the first or second method, and other methods may be adopted. Further, when the processing speed in the main subject focusing control unit 40 is sufficiently high, the subject extraction process may be executed at the time of image capture every time after driving the lens.
[0128]
If the main subject focusing control unit 40 determines to execute the subject extraction process by counting the number of times of lens driving, the process proceeds to the subject extraction process in step S608. On the other hand, if it is determined that the subject extraction process is not to be executed, the process proceeds to a process of skipping the subject extraction process (step S608) and performing the focus determination, that is, step S610 (flowchart in FIG. 21).
[0129]
Also in the present embodiment, the details of the subject extraction process (step S608) are the same as those in the flowchart shown in FIG. That is, subject extraction is performed by skin color detection corresponding to the WB gain value.
[0130]
When the main subject region is specified in the subject extraction process (step S608), the main subject region is transmitted from the subject extraction unit 45 to the focus evaluation region setting unit 41.
[0131]
In step S609, the focus evaluation area setting unit 41 compares the previous focus evaluation area with the main subject area specified by the subject extraction process, and determines whether or not they match. This process is a process for confirming whether or not the focus evaluation area that has been the object of evaluation so far is an accurate main subject area. If they do not match, the process returns to step S603, and the focus evaluation area setting unit 41 changes the setting of the subsequent focus evaluation area to the main subject area specified by the subject extraction process in step S608. Therefore, when the next evaluation value calculation is performed in the focus evaluation unit 42, it is possible to calculate the evaluation value for the image component of the main subject region with higher reliability than the previous time. On the other hand, if the focus evaluation area matches the identified main subject area, the process proceeds to step S610 (FIG. 21).
[0132]
Then, the focus control unit 43 determines whether or not the lens position PX having the maximum (or minimum) evaluation value as shown in FIG. 4 has been identified, that is, the focus state of the focus evaluation area. It is determined whether or not is realized. Here, if it is determined that the in-focus state of the in-focus evaluation area has not yet been realized, the process returns to step S602 (FIG. 20) to repeat lens driving at a predetermined pitch, evaluation value calculation processing, and the like. As a result, when the in-focus state of the in-focus evaluation area is finally realized, the process proceeds to step S611, where the main control operation 18 is permitted for the main photographing operation.
[0133]
When the main photographing operation is permitted, the overall control unit 18 first determines whether or not the shutter button 8 has been fully pressed by the user (step S612). If the shutter button 8 is not in the fully depressed state, the process after the shutter button 8 is half depressed is repeated to return to step S602 (FIG. 20) in order to cope with the change in framing. At this time, since the focus control unit 43 needs to perform focus control from the beginning, the focusing lens 12 is moved to the farthest position.
[0134]
On the other hand, when the shutter button 8 is fully pressed, the overall control unit 18 controls the imaging function unit 20 to perform the actual imaging operation (step S613), and the image processing unit 32 performs predetermined image processing. After performing (Step S614), the recording process to the recording medium 9 (Step S615) is performed.
[0135]
With the above-described operation of the digital camera 1C, the processing procedure from when the shutter button 8 is pressed halfway down until the main photographing operation is completed is completed. Even if it exists, it is possible to photograph the main subject in a focused state.
[0136]
Also in the digital camera 1 </ b> C, the main subject focusing control unit 40 sets a skin color detection area when performing main subject extraction processing according to the WB gain value, and the main subject is extracted from the image based on the skin color detection area. Therefore, subject extraction can be performed with high accuracy.
[0137]
Note that the subject extraction process shown in step S608 of FIG. 20 is not limited to the process of the first embodiment shown in FIG. 7, but may be a process based on the luminance shown in the second embodiment of FIG. In this case, the same effect as described above can be expected.
[0138]
<Modification>
For changing the skin color detection area in each of the above embodiments, the WB gain value and the luminance level may be combined. In this case, the UCS chromaticity diagram is shifted in the u ′ (horizontal) direction according to the WB gain value, and the UCS chromaticity diagram is shifted in the v ′ (vertical) direction according to the luminance level. . As a result, the skin color detection region is shifted in an oblique direction from the default skin color detection region RH, for example, a region RHc shown in FIG.
[0139]
In the first embodiment, when a pixel having a color close to colorless is detected in the image and the WB gain value is set so that the pixel becomes colorless, the number of detected pixels is larger than a predetermined number. When the number is small, the person detection may not be performed.
[0140]
The skin color detection region RH (see FIG. 9) in each of the above embodiments does not necessarily have to be set as a rectangular region. For example, a trapezoidal or elliptical region in the u'v 'space of the UCS chromaticity diagram May be set as
[0141]
For the first embodiment described above, it is not essential to set a skin color detection region suitable for skin color detection by referring to the WB gain value, and the WB gain value suitable for skin color detection is regenerated according to the WB gain value. May be set.
[0142]
That is, image processing dedicated to subject detection is performed separately from the live view image, and when limiter control for leaving redness such as a sunset scene is executed, for example, the WB gain value is set again before the limit is limited. Then, subject detection is performed from the image generated by the WB process based on the pre-limit WB gain value. Thereby, it is possible to detect the subject with high accuracy.
[0143]
Also, a skin color detection WB gain value (for example, an average value) is calculated based on the limit WB gain value and the pre-limit WB gain value, and is reset as the WB gain value. Subject detection is performed from an image generated by WB processing based on the reset WB gain value. As a result, the main subject can be extracted with high accuracy as described above.
[0144]
The digital camera of each of the above embodiments includes both a digital still camera and a digital video camera. Although the digital camera 1 has been described as an example of the photographing apparatus, the present invention can also be applied to photographing apparatuses other than the digital camera.
[0145]
In each of the above embodiments, the case where the main subject (that is, the specific subject) is a human face portion has been described. This is because, in general, when taking a picture, a person is often taken as a subject. However, the main subject is not limited to being the face portion of a person. For this reason, if the user can freely set and input information on color components (for example, red clothes) constituting the main subject, the main subject intended by the user can be appropriately specified. .
[0146]
In each of the above embodiments, the extracted main subject is used for focus control, but the extracted main subject may be used for exposure control.
[0147]
The specific embodiment described above includes an invention having the following configuration.
[0148]
(1) Restricting means for restricting a processing parameter relating to white balance processing, and means for changing a corresponding area corresponding to a specific color of a specific subject in a predetermined color space when the processing parameter is restricted. An imaging apparatus characterized by that.
[0149]
This improves the reliability of subject extraction.
[0150]
(2) An imaging apparatus comprising: means for changing a corresponding area corresponding to a specific color of a specific subject in a predetermined color space when a processing parameter relating to white balance processing is out of a predetermined range.
[0151]
This improves the reliability of main subject extraction.
[0152]
(3) limiting means for limiting processing parameters relating to white balance processing, and means for prohibiting the detection processing of unique colors when the processing parameters are limited;
An imaging apparatus comprising:
[0153]
This improves the reliability of main subject extraction.
[0154]
(4) An image pickup apparatus comprising means for prohibiting detection of a unique color when a processing parameter relating to white balance processing is out of a predetermined range.
[0155]
This improves the reliability of main subject extraction.
[0156]
(5) In the invention of claim 3, when the white balance processing is applied to the image by the second parameter when the processing parameter is limited and the limiting means for limiting the processing parameter related to the white balance processing An image pickup apparatus comprising: means for detecting a unique color based on the first parameter.
[0157]
This improves the reliability of main subject extraction.
[0158]
(6) In the invention of claim 3, when the processing parameter relating to the white balance processing is out of a predetermined range and the image is subjected to the white balance processing by the second parameter, the unique color is determined based on the first parameter. An image pickup apparatus comprising means for performing detection.
[0159]
This improves the reliability of main subject extraction.
[0160]
(7) An imaging apparatus comprising means for performing focus control on the specific subject extracted by the extraction means.
[0161]
Thereby, appropriate focus control can be performed.
[0162]
(8) An imaging apparatus comprising means for performing exposure control on a specific subject extracted by the extraction means.
[0163]
Thereby, appropriate exposure control can be performed.
[0164]
【The invention's effect】
As described above, according to the first aspect of the present invention, detection of a unique color appearing on a specific subject according to the white balance information. Decide whether to execute Therefore, the main subject can be accurately extracted from the image.
[0166]
Also, Claim 2 According to the invention, when the image is subjected to the white balance process using the second parameter relating to the white balance process, the unique color is detected based on the first parameter, so that the main subject can be accurately extracted from the image. .
[Brief description of the drawings]
FIG. 1 is a perspective view showing a digital camera 1A as an example of a photographing apparatus according to a first embodiment of the present invention.
FIG. 2 is a block diagram showing an internal configuration of the digital camera 1A.
FIG. 3 is a diagram illustrating an initial state of a focus evaluation area set in advance in the digital camera 1A.
FIG. 4 is a diagram illustrating an example of an evaluation value change with respect to a lens position.
FIG. 5 is a flowchart showing a processing procedure of the digital camera 1A.
FIG. 6 is a flowchart showing a processing procedure of the digital camera 1A.
FIG. 7 is a flowchart showing a detailed processing procedure of subject extraction processing;
FIG. 8 is a diagram for explaining a range of a WB gain value in which skin color can be detected.
FIG. 9 is a simplified diagram of a CIE 1976 UCS chromaticity diagram.
FIG. 10 is a diagram for explaining a shift of a skin color detection region.
FIG. 11 is a diagram for explaining skin color block extraction processing;
FIG. 12 is a diagram showing an area recognized as a main subject in the shape determination process.
FIG. 13 is a diagram illustrating an example of a weighting coefficient for a screen.
FIG. 14 is a flowchart illustrating a processing procedure relating to setting of a skin color detection region.
FIG. 15 is a diagram illustrating an example of a relationship between calculated GB ″ and GB and GB ′.
FIG. 16 is a flowchart showing subject extraction processing of the digital camera 1B according to the second embodiment of the present invention;
FIG. 17 is a diagram for explaining a shift of a skin color detection region.
FIG. 18 is a diagram for explaining a shift of a skin color detection region.
FIG. 19 is a flowchart illustrating a processing procedure for subject re-extraction processing;
FIG. 20 is a flowchart showing a processing procedure of the digital camera 1C according to the third embodiment of the present invention.
FIG. 21 is a flowchart showing a processing procedure of the digital camera 1C according to the third embodiment of the present invention.
FIG. 22 is a diagram for explaining a shift of a skin color detection area according to a modified example of the present invention.
[Explanation of symbols]
1A, 1B, 1C Digital camera (imaging device)
8 Shutter button
11 Shooting lens
12 Focusing lens
18 Overall control unit
20 Shooting function section
30 CCD image sensor
31 Image memory
40 Main subject focus control unit
41 Focus evaluation area setting section
42 Focus evaluation section
43 Focus control unit
44 Skin color area setting section
45 Subject extraction unit
50 Lens drive unit
RH, RHa, RHb, RHc, RHs Skin color detection area

Claims (2)

撮像装置であって、
(a)固有色が表れる特定被写体を含む画像において、前記固有色を検出することにより前記特定被写体を抽出する抽出手段と、
(b)前記画像に係るホワイトバランス情報を取得する取得手段と、
を備え、
前記抽出手段は、
(a-1)前記ホワイトバランス情報に応じて、前記固有色の検出を実行するか否かを決定する決定手段
を有することを特徴とする撮像装置。
An imaging device,
(a) in an image including a specific subject in which a specific color appears, an extraction unit that extracts the specific subject by detecting the specific color;
(b) acquisition means for acquiring white balance information relating to the image;
With
The extraction means includes
(a-1) determining means for determining whether to perform detection of the unique color according to the white balance information;
An imaging device comprising:
撮像装置であって、
(a)固有色が表れる特定被写体を含む画像において、前記固有色を検出することにより前記特定被写体を抽出する抽出手段と、
(b)ホワイトバランス処理に係る処理パラメータを設定する設定手段と、
(c) 前記処理パラメータに基づき、前記画像に対して前記ホワイトバランス処理を行う処理手段と、
を備え、
前記設定手段は、
(b-1) 前記画像に基づき第1パラメータを求める手段と、
(b-2) 前記第1パラメータが所定範囲内である場合には、前記第1パラメータを前記処理パラメータとして設定する手段と、
(b-3) 前記第1パラメータが前記所定範囲から外れる場合には、前記第1パラメータと異なる第2パラメータを前記処理パラメータとして設定する手段と、
を有するとともに、
前記抽出手段は、
(a-1) 前記第2パラメータに基づき前記画像に前記ホワイトバランス処理が施される場合には、前記第1パラメータに基づき前記固有色の検出を行う手段、
を有することを特徴とする撮像装置。
An imaging device comprising:
(a) in an image including a specific subject in which a specific color appears, an extraction unit that extracts the specific subject by detecting the specific color;
(b) setting means for setting processing parameters relating to white balance processing;
(c) processing means for performing the white balance processing on the image based on the processing parameters;
With
The setting means includes
(b-1) means for obtaining a first parameter based on the image;
(b-2) if the first parameter is within a predetermined range, means for setting the first parameter as the processing parameter;
(b-3) means for setting a second parameter different from the first parameter as the processing parameter when the first parameter is out of the predetermined range;
And having
The extraction means includes
(a-1) means for detecting the unique color based on the first parameter when the white balance processing is performed on the image based on the second parameter;
An imaging device comprising:
JP2002194610A 2002-07-03 2002-07-03 Imaging device Expired - Fee Related JP4039147B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002194610A JP4039147B2 (en) 2002-07-03 2002-07-03 Imaging device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002194610A JP4039147B2 (en) 2002-07-03 2002-07-03 Imaging device

Publications (2)

Publication Number Publication Date
JP2004040462A JP2004040462A (en) 2004-02-05
JP4039147B2 true JP4039147B2 (en) 2008-01-30

Family

ID=31703266

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002194610A Expired - Fee Related JP4039147B2 (en) 2002-07-03 2002-07-03 Imaging device

Country Status (1)

Country Link
JP (1) JP4039147B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI383673B (en) * 2009-09-01 2013-01-21 Quanta Comp Inc Method and device for adjusting weighting values in light metering

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4082383B2 (en) * 2004-05-20 2008-04-30 ソニー株式会社 Imaging apparatus, image processing method, and color area setting program
US8035721B2 (en) 2004-08-05 2011-10-11 Panasonic Corporation Imaging apparatus
JP5318321B2 (en) * 2004-08-05 2013-10-16 パナソニック株式会社 Imaging device
JP4645413B2 (en) * 2005-11-01 2011-03-09 株式会社ニコン Imaging device
US8107762B2 (en) * 2006-03-17 2012-01-31 Qualcomm Incorporated Systems, methods, and apparatus for exposure control
JP4782600B2 (en) * 2006-03-30 2011-09-28 富士フイルム株式会社 Face detection method and photographing apparatus using the same
JP4629002B2 (en) * 2006-06-21 2011-02-09 三菱電機株式会社 Imaging device
US7847830B2 (en) * 2006-11-21 2010-12-07 Sony Ericsson Mobile Communications Ab System and method for camera metering based on flesh tone detection
CN102023456B (en) * 2009-09-22 2012-11-21 广达电脑股份有限公司 Light metering weight regulating method and device thereof
JP5825796B2 (en) * 2011-02-03 2015-12-02 キヤノン株式会社 White balance control device, imaging device using the same, and white balance control method
JP5821214B2 (en) * 2011-02-28 2015-11-24 ソニー株式会社 Image processing apparatus, image processing method, and program
JP5501393B2 (en) * 2012-02-13 2014-05-21 キヤノン株式会社 Image processing device
JP5987376B2 (en) * 2012-03-13 2016-09-07 株式会社ニコン Imaging device
JP6790611B2 (en) * 2016-09-02 2020-11-25 富士通株式会社 Bioimage processing device, bioimage processing method, and bioimage processing program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI383673B (en) * 2009-09-01 2013-01-21 Quanta Comp Inc Method and device for adjusting weighting values in light metering

Also Published As

Publication number Publication date
JP2004040462A (en) 2004-02-05

Similar Documents

Publication Publication Date Title
JP4639271B2 (en) camera
JP3541820B2 (en) Imaging device and imaging method
JP3468231B2 (en) Image processing apparatus, image quality control method, program, and recording medium
US7916181B2 (en) Method and device for creating high dynamic range pictures from multiple exposures
JP4826028B2 (en) Electronic camera
JP4039147B2 (en) Imaging device
KR101633460B1 (en) Method and Apparatus for controlling multi-exposure
JP3760846B2 (en) Subject extraction device and photographing device
US8248484B2 (en) Imaging apparatus and method
JP3675412B2 (en) Imaging device
JP5169318B2 (en) Imaging apparatus and imaging method
JP6521776B2 (en) Image processing apparatus, image processing method
JP2003179810A (en) System and method for simulating fill flash in photography
JP2006254229A (en) Imaging apparatus, imaging method and imaging program
JP4053764B2 (en) Subject extraction device and photographing device
KR100819805B1 (en) Camera
JP2007180892A (en) Camera
JP4796007B2 (en) Imaging device
JP2019029833A (en) Imaging apparatus
JP2008054031A (en) Digital camera and display control method
JP2009033386A (en) Photographing device and method
JP2010026039A (en) Photographing apparatus, and control method and program of photographing apparatus
JP2008199522A (en) Imaging apparatus and imaging method
JP2006157342A (en) Imaging apparatus
JP2010119051A (en) Imaging device and imaging method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20040917

A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20040917

RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20041217

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20061211

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070109

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070131

A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A711

Effective date: 20070827

TRDD Decision of grant or rejection written
RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20070914

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20071016

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20071029

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

Free format text: PAYMENT UNTIL: 20101116

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20111116

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20111116

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20121116

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20121116

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20131116

Year of fee payment: 6

LAPS Cancellation because of no payment of annual fees