JP4053764B2 - Subject extraction device and photographing device - Google Patents
Subject extraction device and photographing device Download PDFInfo
- Publication number
- JP4053764B2 JP4053764B2 JP2001357985A JP2001357985A JP4053764B2 JP 4053764 B2 JP4053764 B2 JP 4053764B2 JP 2001357985 A JP2001357985 A JP 2001357985A JP 2001357985 A JP2001357985 A JP 2001357985A JP 4053764 B2 JP4053764 B2 JP 4053764B2
- Authority
- JP
- Japan
- Prior art keywords
- subject
- image
- processing
- focus
- magnification
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
- 238000000605 extraction Methods 0.000 title claims description 142
- 238000012545 processing Methods 0.000 claims description 182
- 230000007423 decrease Effects 0.000 claims description 6
- 230000003247 decreasing effect Effects 0.000 claims description 3
- 238000011156 evaluation Methods 0.000 description 156
- 238000000034 method Methods 0.000 description 108
- 230000008569 process Effects 0.000 description 61
- 238000010586 diagram Methods 0.000 description 31
- 230000006870 function Effects 0.000 description 24
- 238000004364 calculation method Methods 0.000 description 18
- 238000001514 detection method Methods 0.000 description 18
- 230000008859 change Effects 0.000 description 12
- 238000003384 imaging method Methods 0.000 description 11
- 239000004973 liquid crystal related substance Substances 0.000 description 8
- 230000000994 depressogenic effect Effects 0.000 description 4
- 238000013459 approach Methods 0.000 description 3
- 230000006978 adaptation Effects 0.000 description 2
- 230000001186 cumulative effect Effects 0.000 description 2
- 239000000284 extract Substances 0.000 description 2
- 238000009432 framing Methods 0.000 description 2
- 230000005484 gravity Effects 0.000 description 2
- 238000005259 measurement Methods 0.000 description 2
- 230000015572 biosynthetic process Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 230000006835 compression Effects 0.000 description 1
- 238000007906 compression Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000002955 isolation Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
- 238000003825 pressing Methods 0.000 description 1
- 230000003252 repetitive effect Effects 0.000 description 1
- 238000005549 size reduction Methods 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
Images
Landscapes
- Automatic Focus Adjustment (AREA)
- Image Processing (AREA)
- Studio Devices (AREA)
- Image Analysis (AREA)
Description
【0001】
【発明の属する技術分野】
この発明は、画像から特定被写体を抽出する被写体抽出技術に関する。
【0002】
【従来の技術】
従来のカメラ等において自動合焦制御(オートフォーカス制御)を行う場合、画面のどの領域で焦点検出を行うかは予め決められていた。例えば、画像の中央に設定された合焦評価領域で自動焦点検出を行ったり、複数の合焦評価領域のうちから最も被写体距離の近い領域を特定し、その領域で自動焦点検出を行っている。
【0003】
また、画像処理の技術分野では、画像から人物像を検出する技術が提案されている。かかる技術での人物像抽出処理では、常に高精度に人物像の検出を行うことを主眼としているため、対象となる画像がどのような状態の画像であっても、常に高精度に人物像を検出するための処理が行われる。
【0004】
【発明が解決しようとする課題】
しかしながら、従来の自動合焦制御においては、予め決められた画面中の領域で自動焦点検出を行うだけであるため、その領域中にユーザの意図する主被写体が含まれていない場合には、ユーザの意図とは異なった領域で焦点検出が行われることとなり、その結果ユーザが撮影したかった主被写体がぼけた画像で撮影されるという問題があった。
【0005】
また、画像処理の分野で提案されている人物像検出技術を適用して、画像から人物を検出し、その人物像を主被写体と特定して焦点検出を行うことも考えられるが、どのような画像であっても同様に全画面の情報を用いて人物像抽出処理を行うとすると、処理時間が長くなるという問題が発生する。また、その反面、処理効率を重視して粗雑な人物抽出処理を行うと正確な人物検出を行うことが出来なくなるという問題が発生する。
【0006】
特に、電子カメラ等の撮影装置において、主被写体を検出し、その主被写体が適切に合焦状態となった状態で撮影動作を行うように実現する場合、主被写体を抽出する処理を効率化するだけでなく、同時に正確性を向上させることも望まれる。
【0007】
そこで、この発明は、上記課題に鑑みてなされたものであって、処理効率が向上するとともに、正確に主被写体を抽出することの可能な被写体抽出装置を提供することを目的とし、また、そのような被写体抽出技術の適用された撮影装置を提供することをも目的とする。
【0008】
【課題を解決するための手段】
上記目的を達成するために、請求項1に記載の発明は、画像から特定被写体の検出を行う被写体抽出装置であって、本撮影動作時の被写体倍率に応じて、前記特定被写体の抽出処理を行う際の前記画像に対する処理内容を変更する処理内容変更手段と、前記処理内容に基づいて前記画像のうちから前記特定被写体の抽出処理を行う被写体抽出手段と、を備えている。
【0009】
請求項2に記載の発明は、請求項1に記載の被写体抽出装置において、前記被写体抽出手段は、前記特定被写体の抽出処理にあたって、画素間引き処理、又は、ブロック分割処理を行うように構成され、前記処理内容変更手段は、前記画素間引き処理における間引き数、又は、前記ブロック分割処理におけるブロック分割数を前記被写体倍率に応じて変更することを特徴としている。
【0010】
請求項3に記載の発明は、請求項2に記載の被写体抽出装置において、前記処理内容変更手段は、前記被写体倍率が小さくなるにつれて、前記間引き数を減少させ、又は前記ブロック分割数を増加させることにより、前記処理内容の変更を行うことを特徴としている。
【0018】
【発明の実施の形態】
以下、この発明の実施の形態について図面を参照しつつ詳細に説明する。なお、以下においてはデジタルカメラを例に挙げて説明することとする。
【0019】
<1.第1の実施の形態>
まず、第1の実施の形態について説明する。図1はこの発明にかかる撮影装置の一例としてのデジタルカメラ1を示す斜視図である。図1に示すように、デジタルカメラ1の前面側には、撮影レンズ11とファインダ窓2とが設けられている。撮影レンズ11の内側には撮影レンズ11を介して入射する被写体像を光電変換して画像データ(画素ごとの画素データの配列からなるデータ)を生成するための撮像手段としてCCD撮像素子30が設けられている。
【0020】
撮影レンズ11には光軸方向に沿って移動可能なフォーカシングレンズが含まれており、フォーカシングレンズを駆動することにより、CCD撮像素子30に結像される画像の合焦状態を可変することができるように構成されている。
【0021】
また、デジタルカメラ1の上面側には、シャッタボタン8と、カメラ状態表示器13と、設定キー14とが配置されている。シャッタボタン8は被写体の撮影を行うときにユーザが押し込み操作するボタンであり、半押し状態と全押し状態との2段階を検知することができるように構成される。カメラ状態表示器13は例えばセグメント表示タイプの液晶表示器によって構成され、デジタルカメラ1における現在の設定内容等をユーザに示すために設けられている。また、設定キー14は、被写体に応じた撮影モードの選択設定等を行うためのキースイッチである。
【0022】
また、デジタルカメラ1の側面部には本撮影動作によって生成される画像データを記録するための記録メディア9を装着する装着部15が形成されており、メモリカード等のような交換可能な記録メディア9を装着することができる。
【0023】
なお、図1における図示は省略するが、デジタルカメラ1の背面側には、CCD撮像素子30で撮影された画像等を表示するための液晶表示部が設けられる。
【0024】
図2はデジタルカメラ1の内部構成を示すブロック図である。なお、図2において実線矢印は制御信号の流れを示しており、斜線地矢印は画像信号の流れを示している。
【0025】
図2に示すように、デジタルカメラ1は、被写体を撮影する際の撮影機能を実現する撮影機能部20と、合焦制御時に主被写体(特定被写体)を検出してその主被写体が合焦状態となるような制御を行う主被写体合焦制御部40と、撮影レンズ11に含まれるフォーカシングレンズ12を駆動してCCD撮像素子30に結像される画像の合焦状態を変更するレンズ駆動部50と、上述のシャッタボタン8及び設定キー14を含む操作部16と、操作部16の操作内容に応じて撮影機能部20及び主被写体合焦制御部40を制御する全体制御部18とを備えて構成される。
【0026】
撮影機能部20は、撮影レンズ11、CCD撮像素子30、CCD撮像素子30からの画像データを一時的に格納するための画像メモリ31、画像メモリ31から得られる画像データに対して画像圧縮等の所定の画像処理を行う画像処理部32、画像処理部32において画像表示用の画像処理が施された表示用画像を表示する液晶表示部33、及び、画像処理部32において画像記録用の画像処理が施された撮影画像を記録する記録メディア9を備えて構成される。
【0027】
撮影機能部20は、全体制御部18の制御によって、本撮影前にライブビュー画像を液晶表示部33に表示させるためのライブビュー動作と、シャッタボタン8が全押しされたときに記録メディア9に記録するための画像撮影を行う本撮影動作とを行うように構成される。また、液晶表示部33がオフ状態であったとしても、少なくとも合焦制御時にはCCD撮像素子30による撮影動作が行われる。
【0028】
また、主被写体合焦制御部40は、画像全体における合焦状態を評価するための合焦評価領域を設定する合焦評価領域設定部41、画像メモリ31から画像データを取り込み、合焦評価領域設定部41から指定される合焦評価領域の部分画像データから合焦状態を評価するための評価値を求める合焦評価部42、合焦評価部42で求められる評価値に基づいてレンズ駆動部50に駆動信号を与え、合焦評価領域の被写体像を合焦状態に導く合焦制御部43、被写体倍率に応じて被写体抽出部45における設定状態を変更する処理内容変更部44、及び、画像メモリ31から画像データを取り込み、処理内容変更部44から設定される処理内容に基づいて主被写体(特定被写体)の抽出処理を行う被写体抽出部45、を備えて構成される。
【0029】
全体制御部18は、例えばシャッタボタン8が半押し状態にされたときに主被写体が適切な合焦状態となるように主被写体合焦制御部40を機能させ、全押し状態にされたときに撮影機能部20において本撮影動作を行うように制御する。また、全体制御部18は本撮影前にはライブビュー動作として撮影機能部20において逐次画像撮影を行わせ、逐次更新される画像を液晶表示部33に表示させたり、主被写体合焦制御部40に与えるように制御する。
【0030】
レンズ駆動部50は合焦制御動作時に合焦制御部43から与えられる駆動信号に基づいてフォーカシングレンズ12を遠側から近側に向けて所定ピッチで移動させ、CCD撮像素子30に結像される画像の合焦状態を変化させる。そして、主被写体合焦制御部40において主被写体が合焦状態となるレンズ位置(合焦位置)が特定され、合焦制御部43よりそのレンズ位置が指定された場合には、レンズ駆動部50はその指定されたレンズ位置にフォーカシングレンズ12を移動させて主被写体が合焦した状態の画像をCCD撮像素子30に結像させる。
【0031】
図3はデジタルカメラ1に予め設定される合焦評価領域の初期状態を示す図である。図3に示すように、合焦評価領域設定部41には、合焦評価領域の初期状態として、画像メモリ31から取得する画像G1のほぼ中央部分に合焦評価領域FR1が設定されており、主被写体合焦制御部40が機能して最初の合焦評価を行う際には、合焦評価領域設定部41は図3に示す合焦評価領域FR1の位置及びサイズを合焦評価部42に指示する。
【0032】
合焦評価部42は、画像メモリ31から画像G1を取得し、そのうちから合焦評価領域FR1についての画像成分を抽出する。そして、合焦評価領域FR1の画像成分の合焦状態を評価するための評価値を求める。評価値の算出方法には、いくつかの方法がある。例えば、第1の方法として、合焦評価領域FR1に含まれる画像成分をバンドパスフィルタに通し、それによって抽出される画像信号の高周波成分の強度を評価値とする方法があり、また、第2の方法として、合焦評価領域FR1に含まれる画像成分の隣接画素間での輝度値の差分値を求め、その差分値を合焦評価領域FR1内で累積した値を評価値とする方法がある。また、第3の方法として、合焦評価領域FR1に含まれる画像成分に対して微分フィルタ等を用いたエッジ抽出処理を施し、その結果抽出されるエッジの幅(ぼけ幅)を評価値とする方法もある。
【0033】
第1及び第2の方法は、被写体を撮影した場合、画像がぼけている状態では高周波成分のレベルは小さく、また隣接画素間の輝度差の累積値も小さなものとなるのに対し、焦点が合ってくる(合焦状態に近づく)にしたがって高周波成分のレベルは大きく、また隣接画素間の輝度差の累積値も大きなものとなることを検出する方法である。
【0034】
このため、フォーカシングレンズ12を遠側から近側に次第に移動させた場合、第1及び第2の方法で得られる評価値は、図4に示すように変化する。フォーカシングレンズ12を移動させつつ、各レンズ位置で撮影された画像から評価値を求めると、図4に示すように評価値が変化し、レンズ位置PXで評価値が最大値を示す。このため、フォーカシングレンズ12をレンズ位置PXに移動させれば、合焦評価領域FR1に含まれる画像成分が合焦状態になると判明し、合焦制御部43がフォーカシングレンズ12をレンズ位置PXに移動させて合焦状態を実現する。
【0035】
一方、第3の方法は、被写体を撮影した場合、画像がぼけている状態ではエッジ幅は大きくなるのに対し、焦点が合ってくるにしたがってエッジ幅が小さくなることを検出する方法である。このため、フォーカシングレンズ12を遠側から近側に次第に移動させた場合、第3の方法で得られる評価値は、合焦位置で最小値を示すこととなり、合焦制御部43がその最小値を示すレンズ位置にフォーカシングレンズ12を移動させて合焦状態を実現する。
【0036】
なお、合焦評価部42において適用される評価値の算出方法は、上記第1乃至第3の方法のいずれを採用してもよく、またその他の算出方法を採用してもよい。ところで、合焦評価領域FR1が画像G1に対して常に固定された領域に設定されると、上述したようにその合焦評価領域FR1中にユーザの意図する主被写体が含まれていない場合には、ユーザの意図とは異なった領域で焦点検出が行われることとなり、その結果ユーザが撮影したかった主被写体がぼけた画像で撮影される。
【0037】
そのため、この実施の形態のデジタルカメラ1では、被写体抽出部45が画像メモリ31から画像を取得してその画像のうちから主被写体を抽出する処理を行う。そして、合焦評価領域設定部41が主被写体であると判断された画像部分に合焦評価領域を変更設定し、合焦評価部42はその主被写体が含まれる合焦評価領域について評価値の算出を行う。すなわち、合焦評価領域が、初期状態の領域から主被写体として認識された画像領域に修正され、その主被写体の被写体像が合焦状態となるように合焦制御が行われる。
【0038】
これにより、本撮影動作が行われると、主被写体が合焦状態となった適切な画像が撮影されることになる。
【0039】
しかし、撮影時の被写体倍率が異なると、画像に含まれる主被写体のサイズが変化するため、主被写体を良好に検出することができなくなる場合がある。例えば、被写体倍率が小さい場合には、一般的に画像に含まれる主被写体のサイズは小さくなり、緻密な被写体抽出処理を行わないと、良好に主被写体を検出することができない。一方、被写体倍率が大きい場合には、一般的に画像に含まれる主被写体のサイズは大きくなるため、比較的粗雑な被写体抽出処理を行ったとしても、良好に主被写体を検出することは可能である。
【0040】
図5は被写体倍率が小さい場合の撮影画像を示す図である。図5に示すように、被写体倍率が小さい場合、画像全体に占める主被写体(この実施の形態では人物の顔部分)のサイズが小さくなる。このため、画像を構成する複数の画素のうち、多くの画素を評価しなければ、主被写体を精度良く検出することができない。
【0041】
これに対し、図6は被写体倍率が大きい場合の撮影画像を示す図である。図6に示すように、被写体倍率が大きい場合、画像全体に占める主被写体のサイズが大きくなる。このため、画像を構成する複数の画素のうち、比較的少ない画素を評価するだけでも主被写体を精度良く検出することが可能である。
【0042】
そのため、この実施の形態では、被写体倍率が小さい場合には、比較的緻密な被写体抽出処理を行うことで主被写体を高精度に特定するように構成され、被写体倍率が大きい場合には、比較的粗雑な被写体抽出処理を行うことで主被写体を抽出するための処理効率を向上させるように構成される。すなわち、被写体倍率に応じた被写体抽出処理を行うように構成されるのである。
【0043】
具体的には、処理内容変更部44は、合焦制御部43からフォーカシングレンズ12のレンズ位置に関する情報、及び合焦評価領域の合焦状態に関する情報を入力し、全体制御部18から撮影レンズ11の焦点距離情報及び撮影モード情報を入力する。そして、処理内容変更部44は、それらの情報に基づいて被写体倍率を求め、その被写体倍率に応じて被写体抽出部45における処理内容を決定する。
【0044】
被写体抽出部45においては、画像の肌色成分を抽出してその肌色成分が分布する領域を主被写体領域として認識するような被写体抽出処理が行われるが、処理内容変更部44はこのときの評価対象とする画素数を被写体倍率に応じて変化させる。また、被写体抽出部45においては、画像のブロック分割を行って肌色ブロックが集合した状態の形状判定を行うことで被写体抽出処理が行われるが、処理内容変更部44はそのときの評価対象とするブロック数を被写体倍率に応じて変化させたり、また、形状判定における形状判定基準を被写体倍率に応じて変化させる。つまり、被写体倍率が大きな状態にあるときには比較的粗雑な被写体抽出処理を行って効率的に主被写体を抽出するように設定変更し、被写体倍率が小さな状態にあるときには緻密な被写体抽出処理を行って高精度な被写体抽出処理を行うように設定変更するのである。そして、被写体抽出部45は、被写体倍率に応じて決定された処理内容に基づいて、画像メモリ31から得られる画像から主被写体の抽出処理を行う。
【0045】
これにより、被写体倍率が比較的大きいときは効率的に主被写体を抽出することができ、被写体倍率が比較的小さいときは高精度に主被写体を抽出することができる。なお、被写体倍率が小さいときは精細な被写体抽出処理が行われるので被写体倍率が大きいときに比べて処理効率は低下するが、被写体倍率が大きいときには処理効率が向上するので、いかなる場合にも同様の精細な被写体抽出処理を行う場合に比して、デジタルカメラ1の全体的な処理効率が向上することは明らかである。
【0046】
以下、この実施の形態におけるデジタルカメラ1の処理手順について説明する。図7乃至図10は、第1の実施の形態におけるデジタルカメラ1の処理手順を示すフローチャートであり、特に図7及び図8はシャッタボタン8が半押し状態とされてから本撮影動作が行われるまでの全体的な処理手順を示しており、また、図9及び図10は被写体抽出処理の詳細な処理手順を示しており、そのうち図10は特に被写体倍率検出処理の詳細な処理手順を示している。
【0047】
まず、ユーザによってシャッタボタン8が半押し状態にされると(ステップS101)、全体制御部18が主被写体合焦制御部40と撮影機能部20とを機能させる。このとき、全体制御部18は主被写体合焦制御部40によってフォーカシングレンズ12を最も遠側に移動させるとともに、撮影機能部20を制御してフォーカシングレンズ12が最も遠側に移動した状態で画像撮影を行わせる。
【0048】
そして、主被写体合焦制御部40は画像メモリ31に格納された画像を取り込み(ステップS102)、評価値の算出処理を行う(ステップS103)。このとき、合焦評価領域設定部41は、画像G1の中央部分に予め設定された初期状態の合焦評価領域FR1を評価値算出対象の合焦評価領域とすべきことを合焦評価部42に対して指示する。合焦評価部42では、ほぼ画面中央に設定される合焦評価領域FR1(図3参照)に含まれる画像成分に基づいて評価値の算出が行われ、算出された評価値は合焦制御部43に与えられる。
【0049】
そして処理内容変更部44及び被写体抽出部45が機能し、被写体抽出処理が行われる(ステップS104)。
【0050】
図9のフローチャートを参照する。被写体抽出処理(ステップS104)に進むと、まず、処理内容変更部44は被写体倍率検出処理を行う(ステップS401)。
【0051】
図10のフローチャートを参照する。被写体倍率検出処理(ステップS401)に進むと、処理内容変更部44は、まず、合焦制御部43から合焦評価領域の合焦状態に関する情報を入力し、合焦評価領域の合焦状態が実現されているか否かを判断する(ステップS420)。ただし、このときの合焦評価領域の合焦状態は、完全な合焦状態である必要はなく、例えば図4に示す評価値がある閾値以上を示していれば、ステップS420の判断においてYESと判断される。
【0052】
そして合焦評価領域の合焦状態が実現されている場合はステップS421に進み、処理内容変更部44は合焦制御部43から現在のフォーカシングレンズ12のレンズ位置に関する情報を入力し、それによってフォーカシングレンズ12のレンズ位置を検出する(ステップS421)。
【0053】
次にステップS422に進み、処理内容変更部44は全体制御部18から撮影レンズ11の焦点距離に関する情報を入力し、それによって撮影レンズ11の焦点距離を検出する。なお、撮影レンズ11がズームレンズ等の焦点距離可変である場合は、その時点で設定されている焦点距離が検出されることになる。
【0054】
そして処理内容変更部44は被写体倍率の算出処理を行う(ステップS423)。一般に被写体倍率βは、フォーカシングレンズ12のレンズ位置x及び撮影レンズ11の焦点距離fから、以下の式によって求めることができる。
【0055】
【数1】
【0056】
ところが、上記数1の式によって被写体倍率βが適切に求められるのは、合焦評価領域がほぼ合焦状態にある場合である。すなわち、上記数1の式におけるフォーカシングレンズ12のレンズ位置xは合焦状態におけるレンズ位置である。ところが、最初に被写体抽出処理が実行されるときには、未だ合焦評価領域は合焦状態にあるとは言えず、むしろ合焦位置から遠く離れたレンズ位置にフォーカシングレンズ12が位置する場合が多いと考えられる。そのような場合には、処理内容変更部44が合焦制御部43から入力するフォーカシングレンズ12のレンズ位置を上記数1の式に代入して演算を行ったとしても、それによって求められる被写体倍率βは正確なものではない。
【0057】
そこで、この実施の形態では、ステップS420において合焦評価領域の合焦状態が実現されているか否かを処理内容変更部44が判定し、ほぼ合焦状態が実現されていると判断した場合には、ステップS421,S422,S423の処理を行うことで、数1の式による演算を行い、被写体倍率βを正確に求めるように構成される。一方、ステップS420において処理内容変更部44が合焦評価領域の合焦状態が実現されていないと判断した場合には、厳密な被写体距離を求めることができないので、ステップS424,S425,S426の処理によって被写体距離を推定するための処理に進むことになる。
【0058】
デジタルカメラ1には複数の撮影モードが用意されており、ユーザは撮影前に撮影シーンに応じて複数の撮影モードのうちから所望する撮影モードを設定キー14より選択設定する。その選択設定された撮影モードに関する撮影モード情報は全体制御部18より、処理内容変更部44に与えられ、処理内容変更部44はその撮影モード情報に応じて被写体倍率を推定する。
【0059】
例えば、撮影モードには、ポートレートモード、スナップモード、風景モード等がある。このうちポートレートモードは人物像を画面中に所定サイズ以上で撮影するモードである。
【0060】
このため、処理内容変更部44は、撮影モードがポートレートモードの場合には被写体倍率が比較的大きいと考えられるため、被写体倍率を所定値MAに設定する。これに対し、他の撮影モードの場合には人物像は画面中に比較的小さいサイズで含まれると考えられるため、被写体倍率を所定値MBに設定する。なお、所定値MA,MBの関係はMA>MBである。
【0061】
このようにして被写体倍率が検出されると、図10に示すフローチャートの処理手順を終了する。
【0062】
なお、図10の被写体倍率検出処理では、合焦評価領域の合焦状態が実現されていない場合に撮影モードから被写体倍率の推定を行う例を示したが、デジタルカメラ1においてアクティブ方式や位相差方式等の自動焦点検出機構が設けられている場合には、それらの機能によって被写体距離を検知することができるので、その被写体距離を用いて被写体倍率を算出するようにしてもよい。この場合、被写体倍率βは、撮影レンズ11の焦点距離f及び被写体距離dから、
【0063】
【数2】
【0064】
の式によって求めることができる。
【0065】
次に、図9のフローチャートのステップS402に進む。
【0066】
被写体抽出部45は、主被写体を抽出する処理の前処理として画素間引き処理とブロック分割処理とを行い、実際に主被写体を抽出する処理として色判定処理と形状判定処理とを行うように構成されている。そして処理内容変更部44は、画素間引き処理における画素間引き数、ブロック分割処理におけるブロック分割数、及び、形状判定処理における形状判定基準を、ステップS401で求められた被写体倍率に応じて変更する。
【0067】
まず、処理内容変更部44は、被写体倍率に応じて画素間引き数を設定する(ステップS402)。図11は、被写体倍率と画素間引き数との関係を示す図である。図11に示すように、被写体倍率と画素間引き数との関係は被写体倍率の増加に比例して画素間引き数が増加するように設定されている。つまり、被写体倍率が小さく、画像中に占める主被写体の画像成分が比較的小さく写っている場合には、画素間引き数は小さな値に設定される。逆に、被写体倍率が大きく、画像中に占める主被写体の画像成分が比較的大きく写っている場合には、画素間引き数は大きな値に設定される。
【0068】
そしてステップS402においては、さらに処理内容変更部44で設定される画素間引き数が被写体抽出部45に指示され、その指示された画素間引き数に基づいて、被写体抽出部45が画像メモリ31から得られる画像に対して画素間引き処理を実行する。
【0069】
図12は画素間引き処理の概念を示す図である。図12に示すように、被写体倍率が大きいときには、画素間引き数が大きな値に設定されるので、画像G1(画像メモリ31から得られるオリジナル画像)から間引かれる画素数が多くなり、画像サイズの比較的小さな画像G2が得られる。これに対し、被写体倍率が小さいときには、画素間引き数が小さな値に設定されるので、画像G1から間引かれる画素数が少なくなり、画像サイズの比較的大きな画像G3が得られる。
【0070】
このように被写体抽出部45において、肌色判定処理等の主被写体を抽出する処理を行う前に処理対象となる画像の画像サイズを変更しておくことで、被写体倍率が大きい状態にあるときには、効率的に主被写体の抽出を行うことが可能になる一方、被写体倍率が小さい状態にあるときには、正確に主被写体の抽出を行うことが可能になる。
【0071】
次に、処理内容変更部44は、被写体倍率に応じてブロック分割数を設定する(ステップS403)。図13は、被写体倍率とブロック分割数との関係を示す図である。図13に示すように、被写体倍率とブロック分割数との関係は被写体倍率に比例してブロック分割数が減少するように設定されている。つまり、被写体倍率が小さく、画像中に占める主被写体の画像成分が比較的小さく写っている場合には、ブロック分割数は大きな値に設定される。逆に、被写体倍率が大きく、画像中に占める主被写体の画像成分が比較的大きく写っている場合には、ブロック分割数は小さな値に設定される。
【0072】
そしてステップS403においては、さらに処理内容変更部44で設定されるブロック分割数が被写体抽出部45に指示され、その指示されたブロック分割数に基づいて、被写体抽出部45が画素間引き処理によって画像サイズの変更された画像に対してブロック分割処理を実行する。
【0073】
図14及び図15はブロック分割処理の概念を示す図であり、図14は被写体倍率が大きい場合を示しており、図15は被写体倍率が小さい場合、すなわち画像中の主被写体が占める割合が小さい場合を示している。
【0074】
図14及び図15に示すように、被写体倍率が大きいときには、被写体抽出部45において比較的少ない数のブロックが生成されるようにブロック分割処理が行われ、被写体倍率が小さいときには、被写体抽出部45において比較的多く数のブロックが生成されるようにブロック分割処理が行われる。
【0075】
このように被写体抽出部45において、肌色判定処理等の主被写体を抽出する処理を行う前に処理対象となる画像をブロック分割しておくことで、後述するグループ化処理(ステップS407)以降の処理においてブロック単位で処理を行うことが可能となり、処理の効率化を図ることができる。特に、被写体倍率が比較的大きい状態にあるときに、ブロック分割数を少なくすることで効率的に主被写体の抽出を行うことが可能になる一方、被写体倍率が比較的小さい状態にあるときにはブロック分割数を増加させて正確に主被写体の抽出を行うことが可能になる。
【0076】
次に、処理内容変更部44は、被写体倍率に応じて形状判定基準を設定する(ステップS404)。例えば、この実施の形態において被写体抽出部45は、肌色ブロックの集合体が、人物の顔形状に類似した形状を有しているか否かを判断するように構成されている。具体的には、形状判定基準となる基準形状の縦横比を設定し、肌色ブロックの集合体がその縦横比の範囲内に収まっているか否かを判断し、収まっている場合には、その肌色ブロックの集合体を主被写体として特定する。そのため、処理内容変更部44は、被写体倍率に応じて形状判定基準となる縦横比を設定し、それを被写体抽出部45に指示する。なお、ここでの縦横比とは、肌色ブロックの集合体の横方向の分布長さを1としたときの縦方向の分布長さの比をいう。
【0077】
図16は、被写体倍率と縦横比との関係を示す図である。図16に示すように、被写体倍率と縦横比との関係は被写体倍率に比例して縦横比が増加するように設定されている。つまり、被写体倍率が小さい場合には、ブロックの集合体の横方向の分布長さを1としたときの縦方向の分布長さの比が小さくなるように設定されるのに対し、被写体倍率が大きい場合には、ブロックの集合体の横方向の分布長さを1としたときの縦方向の分布長さの比が大きくなるように設定される。
【0078】
なお、人物の顔形状を主被写体として特定する場合、縦横比の最小値は、縦:横=1.5:1程度とすることが好ましく、また、その最大値は、縦:横=2:1程度とすることが好ましい。このように設定することで、被写体倍率が比較的小さい状態にあるときでも、被写体抽出部45において顔形状の判定を行うことができるとともに、被写体倍率が大きい状態にあるときでも顔形状の判定を行うことができる。
【0079】
なお、被写体倍率にかかわらず、常に一定の判定基準を適用して顔形状の判定を行うように構成してもよい。
【0080】
次に、ステップS405に進み、被写体抽出部45は画素間引き処理された画像から肌色画素を抽出する肌色画素抽出処理を行う。換言すれば、この肌色画素抽出処理は色判定処理を行うことである。肌色画素抽出処理においては、画素データのRGB値から輝度の影響を受けない色度u’,v’を算出し、色度u’,v’が「CIE 1976 UCS色度図」の特定領域内にあるか否かで肌色画素の抽出が行われる。なお、ある画素のRGB値から色度u’,v’を算出する際には、以下の数3及び数4の式で算出することができる。
【0081】
【数3】
【0082】
【数4】
【0083】
図17は、「CIE 1976 UCS色度図」の簡略図である。図17において領域RHは予め計測等によって設定される肌色領域である。このため、上記数3及び数4の式によって求められる色度u’,v’を次の条件式にあてはめれば各画素が肌色画素であるか否かを判定することができる。
【0084】
【数5】
【0085】
【数6】
【0086】
すなわち、上記数3の式によって算出される色度u’が上記数5の条件式を満たし、かつ、上記数4の式によって算出される色度v’が上記数6の条件式を満たす場合には、当該画素は肌色画素であることが判明する。そしてUCS色度図を利用して肌色画素を特定することにより、輝度値の影響を受けることがなく、正確に肌色画素の特定を行うことが可能になるとともに、RGB値から色度u’,v’への変換が比較的簡単な演算であるため、効率的に演算処理を行うことも可能である。
【0087】
なお、図17においては一例として肌色領域RHが四角形の領域として定義される場合を例示したが、例えばUCS色度図のu’v’空間において台形や楕円形の肌色領域を設定するようにしてもよい。
【0088】
そして、この肌色画素抽出処理を画素ごとに行う場合、上述したように被写体倍率が大きい状態にあるときには、画像サイズが小さく画素数が比較的少ないので、迅速に肌色画素の抽出処理を行うことが可能である。これに対し、被写体倍率が小さい状態にあるときには、画像サイズが大きく画素数が比較的多いので、サンプル数が増加し、正確に被写体抽出を行うことが可能になる。
【0089】
次に、ステップS406に進み、被写体抽出部45は肌色ブロック抽出処理を行う。ここではステップS403のブロック分割処理によって分割された個々のブロックごとに肌色画素が所定割合以上含まれているか否かを判断し、所定割合以上肌色画素が含まれている場合に当該ブロックを肌色ブロックとして特定する。これに対し、1個のブロック中に含まれる肌色画素数が所定割合未満である場合には、そのブロックは肌色ブロックとしては抽出されず、主被写体を構成するものでないと判断される。
【0090】
このように肌色ブロックを抽出し、以後の処理をブロック単位で実行していくことにより、画素単位で処理を進めていく場合に比べて処理速度の高速化を図ることができる。特にデジタルカメラ1の場合にはシャッタボタン8が半押し状態とされると、シャッタチャンスを逃さないためにも迅速に主被写体を合焦状態に導くことが求められるため、上記のようなブロック単位ごとの処理とすることは重要な意義を有する。また同時に、所定割合の肌色画素が存在するブロックを肌色ブロックとするため、肌色ブロックの信頼性を高めることにもなる。
【0091】
また、被写体倍率が大きい状態にあるときには、ブロック分割数は比較的少なく、その結果肌色ブロックとして特定されるブロックも少なくなるので、以後の処理をさらに効率的に行うことが可能である。
【0092】
これに対し、被写体倍率が小さい状態にあるときには、ブロック分割数は比較的多く、その結果肌色ブロックとして特定されるブロック数も多くなるので、以後の形状判定等の処理においても正確に主被写体を抽出することが可能になる。すなわち、被写体倍率が小さい場合(画像中に主被写体が小さく写っている場合)でも、ブロック数が多いので、主被写体を複数のブロックがカバーすることとなるので、肌色ブロックを良好に認識することができ、主被写体を正確に抽出することが可能になるのである。
【0093】
次に、ステップS407に進み、被写体抽出部45は肌色ブロックとして特定されたブロックのグループ化処理を行う。グループ化とは、縦方向又は横方向に連続して分布する肌色ブロックを連結して肌色ブロックの集合体を形成させる処理である。このため、1個の肌色ブロックが他の肌色ブロックに接することなく孤立して存在する場合には、当該肌色ブロックはグループ化処理によって肌色ブロックの集合体形成から排除される。換言すれば、このグループ化処理により、主被写体としてありえないような小さな肌色ブロックは、主被写体を構成しないものとして取り扱われる。
【0094】
また、ここでは、グループ化処理によって形成される肌色ブロックの集合体のグループ情報も生成される。グループ情報とは、肌色ブロックの集合体ごとに生成され、集合体を構成する縦方向及び横方向のブロック数とその集合体の重心位置とを含む情報である。このグループ情報は、後に行われる形状判定処理(ステップS408)及び顔の特定処理(ステップS409)において用いられる。
【0095】
次に、ステップS408に進み、被写体抽出部45はステップS407のグループ化処理によって形成された肌色ブロック集合体の形状判定処理を行う。一般に、画像から肌色ブロック集合体を求めると、人物の肌部分だけが抽出される訳ではなく、事実上肌色を示す壁や樹木肌等の人物の肌以外の物体も肌色ブロック集合体を形成し得る。また人物の手や足も肌色ブロック集合体を形成し得る。そこで、この実施の形態では、被写体抽出部45においてさらに形状判定処理を行うことで、人物の顔形状に近い形状分布をしている肌色グループ集合体を主被写体として認識するように実現されている。
【0096】
ここでの形状判定処理は、ステップS404で設定された縦横比の範囲内に肌色ブロックの集合体が含まれるか否かを判断することにより行われる。具体的には、ステップS407で生成されたグループ情報に含まれる縦方向及び横方向のブロック数を取得し、肌色ブロック集合体の縦方向及び横方向の縦横比(M:1)を求める。そしてステップS404で設定された縦横比がK:1である場合、M≦Kの関係が成立すれば、当該肌色ブロック集合体は人物の顔部分を撮影した画像成分であると判断する。
【0097】
なお、M≦Kの関係だけでは、横方向一列状に分布する肌色ブロック集合体も人物の顔部分であると判断されるので、そのような事態を避けるために、Mの値に下限値Lを設定してもよい。すなわち、L≦M≦Kの関係が成立すれば当該肌色ブロック集合体は人物の顔部分を撮影した画像成分であると判断するようにしてもよい。
【0098】
図18は、形状判定処理(ステップS408)において主被写体であると認識される領域を示す図である。なお、図18では、主被写体であると認識される領域を黒塗りで示している。図18に示すように、被写体抽出部45が形状判定処理を行うことにより、人物の顔部分が含まれるブロックが主被写体の領域であるものとして特定されることになる。
【0099】
次に、ステップS409に進み、被写体抽出部45は形状判定処理によって複数の主被写体が特定された場合に、そのうちから一の主被写体を特定するために顔の特定処理、すなわち主被写体の特定処理を行う。被写体抽出部45には予め画面に対する重み付け係数が設定されており、主被写体として特定された肌色ブロック集合体の重心位置に基づいて当該肌色ブロック集合体についての重み付け係数を特定する。
【0100】
図19は画面に対する重み付け係数の一例を示す図である。図19に示すように画面G5が複数の領域に分割されており、各領域にその領域の重み付け係数が定義されている。なお、画面G5のサイズは、画素間引き数に応じて変化し、画素間引き処理後の画像G2,G3(図12参照)の画像サイズと一致するように調整される。そして、肌色ブロック集合体の重心位置が画面G5のどの位置に位置するかを特定し、その特定結果に基づいて重み付け係数を特定する。例えば、図18において、主被写体として特定された黒塗りの肌色ブロック集合体について考えると、その重心位置は図19において位置P1にあるため、重み付け係数は「10」と特定される。そして、被写体抽出部45は、当該肌色ブロック集合体の面積(例えば、肌色ブロック集合体を構成するブロック数)と、特定された重み付け係数の積を算出し、肌色ブロック集合体の主被写体適合値(主被写体らしさを示す値)とする。そして、複数の肌色ブロック集合体のそれぞれについて主被写体適合値を算出すると、各主被写体適合値を比較し、最大値を示す肌色ブロック集合体を主被写体となる人物の顔部分であると認定する。
【0101】
このように、複数の主被写体が特定された場合には、画面の中央寄りに主被写体がフレーミングされるであろうとの前提にたって、画面上の位置に対する重み付け係数を用いて主被写体適合値を求めることにより、一の主被写体を正確に特定することができる。また、小さく写っている物体よりも大きく写っている物体の方が主被写体である可能性が高いため、重み付け係数を用いた計算を行う際には、肌色ブロック集合体の面積を考慮に入れることにより、正確に主被写体を特定することが可能になる。
【0102】
なお、最大値を示す主被写体適合値から所定範囲内の値を示す複数の主被写体適合値を採用してもよい。この場合、主被写体領域として複数の領域が特定されることになるので、いわゆるマルチエリアの合焦制御を適用することになる。
【0103】
以上のようにして主被写体が特定されると、被写体抽出部45は全体制御部18に対して主被写体領域を指示することにより、全体制御部18が液晶表示部33の表示状態を更新し、主被写体領域が液晶表示部33にも表示されることになる(ステップS410)。例えば、特定された主被写体領域を赤線枠で囲むような表示が行われる。これにより、ユーザは、画像のどの部分が主被写体と認識され、合焦制御がなされるかを容易に把握することができる。また、被写体抽出部45は、上記のような処理を行うことによって特定した主被写体領域を合焦評価領域設定部41に指示する。
【0104】
図7のフローチャートに戻り、ステップS104の被写体抽出処理が終了すると、ステップS105に進む。そして合焦評価領域設定部41は合焦評価部42が評価値を算出するための合焦評価領域を被写体抽出部45によって指示された被写体領域に設定変更する。この結果、合焦評価部42において次回の評価値算出が行われる際には、主被写体の画像成分について評価値算出を行うことが可能になる。
【0105】
次に合焦制御部43によって所定ピッチでのフォーカシングレンズ12のレンズ駆動が行われ(ステップS106)、そのレンズ位置での画像取り込みが行われて(ステップS107)、合焦評価部42による評価値算出処理が行われる(ステップS108)。ステップS108において合焦評価部42は、ステップS105の合焦評価領域の変更設定処理で設定された合焦評価領域の画像成分に基づいて評価値を算出する。
【0106】
以後、評価値が最大値(又は最小値)を示すまでステップS106〜S108の処理を繰り返し、評価値が最大値(又は最小値)を示すレンズ位置を特定することができた場合、すなわちステップS109において合焦評価領域の合焦状態が実現された場合に、図8のフローチャートに進む。
【0107】
そして、合焦評価領域の合焦状態が実現された段階で再度被写体抽出処理を実行する(ステップS110)。ここでの被写体抽出処理(ステップS110)も、図9及び図10を参照して説明した上記ステップS104の被写体抽出処理と同様である。
【0108】
ただし、ステップS104の段階では、合焦評価領域の画像成分がぼけた状態で主被写体の抽出処理が行われるため、実際のフォーカシングレンズ12のレンズ位置を用いた演算処理によって被写体倍率が正確に求められた訳ではなく、撮影モードによって被写体倍率を推定した状態で被写体抽出処理が実行されるので、その精度は低い。そのため、合焦評価領域の画像成分がぼけた状態で主被写体の抽出処理が行われ、それによって特定された主被写体領域が合焦状態と判定されたとしても、その合焦評価領域には実際の主被写体が含まれていない可能性がある。
【0109】
そのため、この実施の形態ではステップS110において再度被写体抽出処理を行うこととしている。そしてステップS110の段階では、合焦評価領域の画像成分が合焦状態であると判断された状態であるため、実際のフォーカシングレンズ12のレンズ位置に基づく演算処理によって正確な被写体倍率が求められ、かつ、その正確な被写体倍率に基づいた被写体抽出処理が実行されるので、主被写体領域を高精度に特定することが可能である。
【0110】
そして被写体抽出処理(ステップS110)が行われて、信頼性の高い主被写体領域が特定されると、被写体抽出部45は前回同様に合焦評価領域設定部41に対して特定された主被写体領域を指示する。
【0111】
これにより、合焦評価領域設定部41は、ステップS108において採用されていた合焦評価領域と、ステップS110の被写体抽出処理において特定された被写体領域とが一致するか否かを判断する(ステップS111)。つまり、この処理は、ステップS106〜S108の繰り返し処理で評価対象とされていた合焦評価領域が正確な主被写体領域であったのかどうかを確認するための処理である。その結果、合焦評価領域と、特定された主被写体領域とが一致しない場合には、ステップS105(図7)に戻り、合焦評価領域設定部41は合焦評価領域を、ステップS110の被写体抽出処理で特定された主被写体領域に設定変更する。よって、合焦評価部42において次回の評価値算出が行われる際には、信頼性の高い主被写体領域の画像成分について評価値算出を行うことが可能になり、ステップS106以降の処理が行われる。その一方、合焦評価領域と、特定された主被写体領域とが一致する場合には、ステップS112(図8)に進む。
【0112】
合焦評価領域設定部41が、合焦評価領域と、特定された主被写体領域とが一致すると判断した場合には、全体制御部18に対して本撮影動作の許可を行う(ステップS112)。
【0113】
全体制御部18は、本撮影動作の許可が与えられると、まず、ユーザによってシャッタボタン8が全押し状態とされたか否かを判断する。デジタルカメラ1ではシャッタボタン8の全押し状態が本撮影動作の条件となっているため、シャッタボタン8が全押し状態でない場合には、フレーミングが変更された場合に対処するために、ステップS102(図7)に戻ってシャッタボタン8が半押し状態とされた以降の処理を繰り返す。
【0114】
また、シャッタボタン8が全押し状態とされた場合には、全体制御部18が撮影機能部20を制御して本撮影動作を行い(ステップS114)、画像処理部32において所定の画像処理(ステップS115)を行った後、記録メディア9への記録処理(ステップS116)が行われる。
【0115】
以上で、シャッタボタン8が半押し状態とされてから本撮影動作が完了するまでのデジタルカメラ1の処理手順が終了することとなり、本撮影動作においては、主被写体が画像のどの部分に存在する場合であってもその主被写体を合焦状態として撮影することが可能である。
【0116】
そして、この実施の形態のデジタルカメラ1においては、被写体抽出装置としても機能する主被写体合焦制御部40が、被写体倍率や撮影モード等の撮影条件に応じて、主被写体の抽出処理を行う際の処理内容を変更し、その処理内容に基づいて画像のうちから主被写体の抽出処理を行うように構成されているため、画像中における主被写体の占める割合が大きい場合には、処理効率を重視した処理内容を設定することができ、また、画像中における主被写体の占める割合が小さい場合には、被写体抽出の信頼性を重視した処理内容を設定することができる。
【0117】
その結果、全体的な処理効率が向上するとともに、画像に対していかなる状態で主被写体が含まれていても正確に主被写体を抽出することが可能になる。
【0118】
<2.第2の実施の形態>
次に、第2の実施の形態について説明する。なお、この実施の形態においても、装置構成については第1の実施の形態で説明したものと同様である(図2等参照)。
【0119】
上記第1の実施の形態では、合焦制御部43が所定ピッチでフォーカシングレンズ12を段階的に駆動させつつ、合焦評価部42において各レンズ位置での評価値が算出されるが、被写体抽出処理が実行されるのは、フォーカシングレンズ12を段階的に駆動させる前と合焦評価領域が合焦状態に達した後である。そのため、フォーカシングレンズ12を段階的に駆動させる前に実行される被写体抽出処理(ステップS104)によって実際には主被写体と全く異なる被写体が主被写体であると特定されていた場合には、その被写体が含まれる合焦評価領域を合焦状態に導くための動作が無駄になる。
【0120】
このため、この実施の形態では、フォーカシングレンズ12を段階的に移動させる最中にも、被写体抽出処理を実行することにより、無駄な動作を省いてさらに効率的に主被写体を正確に合焦状態に導く形態について説明する。
【0121】
図20及び図21は、第2の実施の形態におけるデジタルカメラ1の処理手順を示すフローチャートであり、特にシャッタボタン8が半押し状態とされてから本撮影動作が行われるまでの全体的な処理手順を示している。
【0122】
まず、ユーザによってシャッタボタン8が半押し状態にされると(ステップS301)、全体制御部18が主被写体合焦制御部40と撮影機能部20とを機能させる。
【0123】
そして合焦制御部43がレンズ駆動部50を制御してフォーカシングレンズ12を最も遠側に移動させる(ステップS302)。なお、ステップS302の処理が次回以降実行される場合には、合焦制御部43がフォーカシングレンズ12を近側方向に所定ピッチ分移動させる制御動作を行うことになる。
【0124】
次に、合焦評価領域の設定処理が行われる(ステップS303)。合焦評価領域設定部41は、被写体抽出部45から主被写体領域が指定されている場合はその指定された主被写体領域を合焦評価領域に設定する。ただし、シャッタボタン8が半押し状態にされてから最初にステップS303の処理が行われる際には、未だ被写体抽出処理(ステップS308)は実行されていない。このため、未だ被写体抽出部45から主被写体領域が指定されていない場合、合焦評価領域設定部41は画像の中央部分に予め設定された初期状態の合焦評価領域FR1(図3参照)を評価値算出対象の合焦評価領域として設定する。これに対し、既に被写体抽出処理が何回か実行されている場合には、合焦評価領域設定部41は前回指定された最新の主被写体領域を評価値算出対象の合焦評価領域として設定する。そして、合焦評価領域設定部41は合焦評価領域を合焦評価部42に対して指示する。
【0125】
そして、全体制御部18はフォーカシングレンズ12が現在のレンズ位置にあるときに撮影機能部20における撮影動作を行わせる。そして、合焦評価部42は画像メモリ31に格納された画像を取り込み(ステップS304)、評価値の算出処理を行う(ステップS305)。このとき、合焦評価部42は、ステップS303において合焦評価領域設定部41から指定された合焦評価領域の画像成分に基づいて評価値の算出を行い、その結果算出された評価値は合焦制御部43に与えられる。
【0126】
そして処理内容変更部44は、被写体抽出処理を実行するか否かの判定を行う(ステップS306)。この実施の形態では、フォーカシングレンズ12を所定ピッチで段階的に移動させる際に、各レンズ位置で被写体抽出処理を実行することができるように構成されるが、所定ピッチでのレンズ駆動ごとに毎回被写体抽出処理を実行するように構成すると、主被写体を合焦状態に導くまでに長時間を要することになる。そのため、この実施の形態の処理内容変更部44は、被写体抽出部45における処理内容を変更する機能だけでなく、被写体抽出部45における被写体抽出処理の実行頻度を調整する機能をも備える。
【0127】
処理内容変更部44が被写体抽出処理の実行頻度を調整する方法には、いくつかの方法がある。まず、第1に、所定ピッチでのフォーカシングレンズ12のレンズ駆動が所定回数行われるごとに被写体抽出処理を1回実行する方法がある。これにより、レンズ駆動が行われる度に毎回被写体抽出処理が行われることを回避することができるので、効率的な合焦動作を実現することができる。
【0128】
また、第2に、合焦評価部42で求められる評価値を参酌して合焦評価領域の画像成分が合焦状態に近づくにつれて被写体抽出処理の実行頻度を増加させる方法がある。例えば、評価値が合焦位置で最大値を示す場合には、評価値が第1の閾値未満の場合はレンズ駆動が10回行われるごとに1回被写体抽出処理を実行し、第1の閾値以上第2の閾値未満の場合はレンズ駆動が5回行われるごとに1回被写体抽出処理を実行し、第2の閾値以上の場合はレンズ駆動が2回行われるごとに1回被写体抽出処理を実行するというように、合焦評価部42における評価結果に基づいて被写体抽出処理の実行頻度を調整するのである。このように構成することにより、合焦評価領域の画像成分が合焦状態に近づくにつれて、主被写体を抽出するための処理が増加する。合焦評価領域の画像成分が合焦状態に近い場合には比較的高精度に主被写体の特定が行われるので、この第2の方法は、主被写体を合焦状態に導くためには効果的な方法となる。
【0129】
ただし、処理内容変更部44が被写体抽出処理の実行頻度を調整する方法は、上記第1又は第2の方法に限定されるものではなく、他の方法を採用してもよい。また、主被写体合焦制御部40における処理速度が十分に速い場合には、レンズ駆動後の毎回の画像取り込み時に被写体抽出処理を実行するようにしてもよい。
【0130】
そして、処理内容変更部44がレンズ駆動回数をカウントして被写体抽出処理を実行すると判定した場合には、ステップS308の被写体抽出処理に進む。これに対し、被写体抽出処理を実行しないと判断した場合には、被写体抽出処理(ステップS308)をスキップさせて合焦判定を行う処理、すなわちステップS310(図21のフローチャート)に進むことになる。
【0131】
この実施の形態においても、被写体抽出処理(ステップS308)の詳細は、図9及び図10に示すフローチャートと同様である。したがって、被写体倍率が比較的大きな状態にあるときは処理効率を重視した被写体抽出処理が行われ、被写体倍率が比較的小さな状態にあるときには被写体抽出処理によって特定される主被写体の信頼性を向上させるために、高精度な被写体抽出処理が実行されることになる。
【0132】
そして被写体抽出処理(ステップS308)において主被写体の領域が特定されるとその主被写体領域が被写体抽出部45から合焦評価領域設定部41に伝えられる。
【0133】
ステップS309に進み、合焦評価領域設定部41は、それまでの合焦評価領域と、被写体抽出処理によって特定された主被写体領域とを比較し、両者が一致するか否かを判断する。この処理は、それまで評価対象とされていた合焦評価領域が正確な主被写体領域であったのかどうかを確認するための処理である。そして、一致しない場合には、ステップS303に戻り、合焦評価領域設定部41は以後の合焦評価領域を、ステップS308の被写体抽出処理で特定された主被写体領域に設定変更する。よって、合焦評価部42において次回の評価値算出が行われる際には、前回よりも信頼性の高い主被写体領域の画像成分について評価値算出を行うことが可能になる。その一方、合焦評価領域と、特定された主被写体領域とが一致する場合には、ステップS310(図21)に進む。
【0134】
そして合焦制御部43は、図4に示すような評価値が最大値(又は最小値)を示すレンズ位置PXを特定することができたか否か、すなわち、合焦評価領域の合焦状態が実現されたか否かを判断する。ここで、未だ合焦評価領域の合焦状態が実現されていないと判断された場合には、ステップS302(図20)に戻って所定ピッチでのレンズ駆動、評価値算出処理等を繰り返す。その結果、最終的に合焦評価領域の合焦状態が実現された場合には、ステップS311に進み、全体制御部18に対して本撮影動作の許可を行う。
【0135】
全体制御部18は、本撮影動作の許可が与えられると、まず、ユーザによってシャッタボタン8が全押し状態とされたか否かを判断する(ステップS312)。シャッタボタン8が全押し状態でない場合には、フレーミングが変更された場合に対処するために、ステップS302(図20)に戻ってシャッタボタン8が半押し状態とされた以降の処理を繰り返す。なお、このとき、合焦制御部43は合焦制御を最初から行うことが必要になるので、フォーカシングレンズ12を最も遠側の位置に移動させることになる。
【0136】
これに対し、シャッタボタン8が全押し状態とされた場合には、全体制御部18が撮影機能部20を制御して本撮影動作を行い(ステップS313)、画像処理部32において所定の画像処理(ステップS314)を行った後、記録メディア9への記録処理(ステップS315)が行われる。
【0137】
以上で、第2の実施の形態のデジタルカメラ1において、シャッタボタン8が半押し状態とされてから本撮影動作が完了するまでの処理手順が終了することとなり、本撮影動作においては、主被写体が画像のどの部分に存在する場合であってもその主被写体を合焦状態として撮影することが可能である。
【0138】
そして、この実施の形態のデジタルカメラ1においても、被写体抽出装置としても機能する主被写体合焦制御部40が、被写体倍率や撮影モード等の撮影条件に応じて、主被写体の抽出処理を行う際の処理内容を変更し、その処理内容に基づいて画像のうちから主被写体の抽出処理を行うように構成されているため、画像中における主被写体の占める割合が大きい場合には、処理効率を重視した処理内容を設定することができ、また、画像中における主被写体の占める割合が小さい場合には、被写体抽出の信頼性を重視した処理内容を設定することができる。
【0139】
その結果、全体的な処理効率が向上するとともに、画像に対していかなる状態で主被写体が含まれていても正確に主被写体を抽出することが可能になる。
【0140】
また、この実施の形態のデジタルカメラ1では、合焦動作を行うためのレンズ駆動段階でも被写体抽出処理が実行されるように構成されているので、主被写体でない部分を評価対象として合焦動作を進められることが回避されるので、さらに効率的な合焦動作が実現される。
【0141】
さらに、合焦評価領域の画像成分が合焦状態に近づくにつれて、被写体抽出処理の実行頻度が増加するように構成することで、より正確に主被写体を抽出することができ、その信頼性の高い主被写体を迅速に合焦状態に導くことが可能になる。
【0142】
<3.変形例>
以上、この発明の実施の形態について説明したが、この発明は上記説明した内容のものに限定されるものではない。
【0143】
例えば、上記説明におけるデジタルカメラには、デジタルスチルカメラとデジタルビデオカメラの双方が含まれる。また、撮影装置の一例としてデジタルカメラ1を例示して述べたが、この発明はデジタルカメラ以外の撮影装置に対しても適用することが可能である。
【0144】
また、上記説明においては、いわゆる山登り方式等と呼ばれるような合焦制御を行う場合について述べたが、アクティブ方式や位相差方式等と呼ばれる自動焦点検出方式、さらに複数の測距エリアで測距を行う自動焦点検出方式等の制御方式であっても、この発明を適用することは可能である。
【0145】
また、上記説明においては、合焦動作を開始させるタイミングがシャッタボタン8の半押し後である場合について述べたが、それに限定されるものではなく、例えば、ライブビュー画像の表示を行っている状態においても上述した合焦動作を行うようにしてもよい。
【0146】
また、上記説明においては、画素間引き数、ブロック分割数、及び形状判定基準と、被写体倍率とは連続的な関係を示すものであったが、被写体倍率の変化に対して、画素間引き数、ブロック分割数、及び形状判定基準のそれぞれが段階的に変化するようにしてもよい。
【0147】
また、上記説明においては、主被写体(すなわち特定被写体)が人物の顔部分である場合について述べた。これは、一般的に写真撮影を行う場合、人物を被写体として撮影することが多いことに鑑みたものであるが、この発明の本質としては、主被写体は人物の顔部分であることに限定されるものではない。このため、主被写体を構成する色成分や形状等に関する情報をユーザが自由に設定入力することができるようにすれば、ユーザが意図する主被写体を適切に特定することが可能になる。
【0148】
さらに、上記説明においては、被写体抽出処理が主被写体を合焦状態に導くために行われる場合について説明したが、被写体抽出処理の結果によって画像中から主被写体領域が特定されることに鑑みれば、被写体抽出処理を自動合焦制御のために実行するだけでなく、主被写体領域の画像成分に対して特別な画像処理を施すために実行することも可能である。つまり、上述した被写体抽出技術は、主被写体を合焦状態に導くために適用されるものに限定されるものではない。
【0149】
【発明の効果】
以上説明したように、請求項1に記載の発明によれば、本撮影動作時の被写体倍率に応じて、特定被写体の抽出処理を行う際の前記画像に対する処理内容を変更し、その処理内容に基づいて画像のうちから特定被写体の抽出処理を行うように構成されるため、画像中における特定被写体の占める割合が大きい場合には、処理効率を重視した処理内容を設定することができ、また、画像中における特定被写体の占める割合が小さい場合には、被写体抽出の信頼性を重視した処理内容を設定することができる。その結果、全体的な処理効率が向上するとともに、画像に対していかなる状態で特定被写体が含まれていても正確に特定被写体を抽出することが可能になる。
【0150】
請求項2に記載の発明は、特定被写体の抽出処理にあたって、画素間引き処理、又は、ブロック分割処理を行うように構成されており、画素間引き処理における間引き数、又は、ブロック分割処理におけるブロック分割数を被写体倍率に応じて変更するため、被写体倍率に応じて処理対象となる画像サイズやブロック数を調整することができ、特定被写体の抽出処理における処理効率を向上させたり、抽出される特定被写体の信頼性を向上させることが可能になる。
【0151】
請求項3に記載の発明は、被写体倍率が小さくなるにつれて、間引き数を減少させ、又はブロック分割数を増加させることにより、処理内容の変更を行うため、画像中における特定被写体の占める割合が小さくなると、特定被写体の抽出処理が高精細な処理内容となり、抽出される特定被写体の信頼性を向上させることができる。
【図面の簡単な説明】
【図1】撮影装置の一例としてのデジタルカメラを示す斜視図である。
【図2】デジタルカメラの内部構成を示すブロック図である。
【図3】デジタルカメラに予め設定される合焦評価領域の初期状態を示す図である。
【図4】レンズ位置に対する評価値変化の一例を示す図である。
【図5】被写体倍率が小さい場合の撮影画像を示す図である。
【図6】被写体倍率が大きい場合の撮影画像を示す図である。
【図7】第1の実施の形態におけるデジタルカメラの処理手順を示すフローチャートである。
【図8】第1の実施の形態におけるデジタルカメラの処理手順を示すフローチャートである。
【図9】被写体抽出処理の詳細な処理手順を示すフローチャートである。
【図10】被写体倍率検出処理の詳細な処理手順を示すフローチャートである。
【図11】被写体倍率と画素間引き数との関係を示す図である。
【図12】画素間引き処理の概念を示す図である。
【図13】被写体倍率とブロック分割数との関係を示す図である。
【図14】被写体倍率が大きい場合のブロック分割処理の概念を示す図である。
【図15】被写体倍率が小さい場合のブロック分割処理の概念を示す図である。
【図16】被写体倍率と、形状判定基準である縦横比との関係を示す図である。
【図17】CIE 1976 UCS色度図の簡略図である。
【図18】形状判定処理において主被写体であると認識される領域を示す図である。
【図19】画面に対する重み付け係数の一例を示す図である。
【図20】第2の実施の形態におけるデジタルカメラの処理手順を示すフローチャートである。
【図21】第2の実施の形態におけるデジタルカメラの処理手順を示すフローチャートである。
【符号の説明】
1 デジタルカメラ(撮影装置)
8 シャッタボタン
11 撮影レンズ
12 フォーカシングレンズ
18 全体制御部
20 撮影機能部
30 CCD撮像素子
31 画像メモリ
40 主被写体合焦制御部(被写体抽出装置)
41 合焦評価領域設定部
42 合焦評価部
43 合焦制御部
44 処理内容変更部
45 被写体抽出部
50 レンズ駆動部[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a subject extraction technique for extracting a specific subject from an image.
[0002]
[Prior art]
When automatic focusing control (autofocus control) is performed in a conventional camera or the like, in which region of the screen the focus detection is performed is determined in advance. For example, automatic focus detection is performed in the focus evaluation area set in the center of the image, or an area with the closest subject distance is specified from among a plurality of focus evaluation areas, and automatic focus detection is performed in that area. .
[0003]
In the technical field of image processing, a technique for detecting a human image from an image has been proposed. In the human image extraction process using such a technique, since the main object is always to detect human images with high accuracy, no matter what the target image is, the human image is always detected with high accuracy. Processing for detection is performed.
[0004]
[Problems to be solved by the invention]
However, in the conventional automatic focusing control, only automatic focus detection is performed in a predetermined area in the screen. Therefore, when the main subject intended by the user is not included in the area, the user As a result, focus detection is performed in an area different from the intention of the user, and as a result, there is a problem that the main subject that the user wanted to shoot is shot with a blurred image.
[0005]
It is also possible to apply a human image detection technique proposed in the field of image processing to detect a person from an image, specify the human image as a main subject, and perform focus detection. Similarly, if a person image extraction process is performed using information on the entire screen even for an image, there is a problem that the processing time becomes long. On the other hand, if a rough person extraction process is performed with an emphasis on processing efficiency, there is a problem that accurate person detection cannot be performed.
[0006]
In particular, in a photographing apparatus such as an electronic camera, when the main subject is detected and the photographing operation is performed in a state where the main subject is properly focused, the process of extracting the main subject is made efficient. It is also desirable to improve accuracy at the same time.
[0007]
Accordingly, the present invention has been made in view of the above problems, and has an object to provide a subject extraction device capable of improving the processing efficiency and accurately extracting the main subject. Another object of the present invention is to provide a photographing apparatus to which such subject extraction technology is applied.
[0008]
[Means for Solving the Problems]
In order to achieve the above object, the invention according to
[0009]
According to a second aspect of the present invention, in the subject extraction device according to the first aspect,The subject extraction means is configured to perform pixel thinning processing or block division processing in the extraction processing of the specific subject, and the processing content changing means is a thinning number in the pixel thinning processing or the block division The number of block divisions in the processing depends on the subject magnificationIt is characterized by changing.
[0010]
The invention according to claim 3Claim 2In the subject extraction device described inThe processing content changing means changes the processing content by decreasing the thinning number or increasing the block division number as the subject magnification decreases.It is characterized by that.
[0018]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. Hereinafter, a digital camera will be described as an example.
[0019]
<1. First Embodiment>
First, the first embodiment will be described. FIG. 1 is a perspective view showing a
[0020]
The photographing
[0021]
A
[0022]
Further, a
[0023]
Although not shown in FIG. 1, a liquid crystal display unit for displaying an image taken by the
[0024]
FIG. 2 is a block diagram showing the internal configuration of the
[0025]
As shown in FIG. 2, the
[0026]
The imaging function unit 20 includes an
[0027]
Under the control of the
[0028]
Further, the main subject focusing
[0029]
For example, when the
[0030]
The
[0031]
FIG. 3 is a diagram showing an initial state of a focus evaluation area preset in the
[0032]
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.
[0033]
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, whereas the focus is low. 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.
[0034]
For this reason, when the focusing
[0035]
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
[0036]
Note that the calculation method of the evaluation value applied in the focus evaluation unit 42 may employ any of the first to third methods, and may employ other calculation methods..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.
[0037]
Therefore, in the
[0038]
Thus, when the main photographing operation is performed, an appropriate image in which the main subject is in focus is photographed.
[0039]
However, if the subject magnification at the time of shooting differs, the size of the main subject included in the image changes, so that the main subject may not be detected well. For example, when the subject magnification is low, the size of the main subject included in the image is generally small, and the main subject cannot be detected well unless precise subject extraction processing is performed. On the other hand, when the subject magnification is large, the size of the main subject included in the image generally increases. Therefore, even if a relatively rough subject extraction process is performed, it is possible to detect the main subject satisfactorily. is there.
[0040]
FIG. 5 is a diagram showing a captured image when the subject magnification is small. As shown in FIG. 5, when the subject magnification is small, the size of the main subject (in this embodiment, the human face) in the entire image is small. For this reason, the main subject cannot be accurately detected unless a large number of pixels are evaluated among the plurality of pixels constituting the image.
[0041]
On the other hand, FIG. 6 is a diagram showing a captured image when the subject magnification is large. As shown in FIG. 6, when the subject magnification is large, the size of the main subject in the entire image increases. Therefore, it is possible to detect the main subject with high accuracy only by evaluating a relatively small number of pixels among a plurality of pixels constituting the image.
[0042]
For this reason, in this embodiment, when the subject magnification is small, the main subject is specified with high accuracy by performing a relatively precise subject extraction process. By performing rough subject extraction processing, the processing efficiency for extracting the main subject is improved. That is, it is configured to perform subject extraction processing according to subject magnification.
[0043]
Specifically, the processing
[0044]
In the
[0045]
Thus, the main subject can be extracted efficiently when the subject magnification is relatively large, and the main subject can be extracted with high accuracy when the subject magnification is relatively small. When the subject magnification is small, a fine subject extraction process is performed, so the processing efficiency is lower than when the subject magnification is large. However, when the subject magnification is large, the processing efficiency is improved. It is clear that the overall processing efficiency of the
[0046]
The processing procedure of the
[0047]
First, when the user presses the
[0048]
Then, the main subject focusing
[0049]
Then, the processing
[0050]
Reference is made to the flowchart of FIG. When the process proceeds to the subject extraction process (step S104), the process
[0051]
Refer to the flowchart of FIG. When proceeding to the subject magnification detection process (step S401), the processing
[0052]
If the in-focus state of the focus evaluation area is realized, the process proceeds to step S421, and the processing
[0053]
In step S422, the processing
[0054]
Then, the processing
[0055]
[Expression 1]
[0056]
However, the subject magnification β is appropriately obtained by the
[0057]
Therefore, in this embodiment, when the processing
[0058]
The
[0059]
For example, the shooting mode includes a portrait mode, a snap mode, a landscape mode, and the like. Among these, the portrait mode is a mode in which a person image is photographed on a screen with a predetermined size or more.
[0060]
Therefore, the processing
[0061]
When the subject magnification is detected in this way, the processing procedure of the flowchart shown in FIG.
[0062]
In the subject magnification detection process of FIG. 10, the example in which the subject magnification is estimated from the shooting mode when the in-focus state of the focus evaluation area is not realized is shown. However, in the
[0063]
[Expression 2]
[0064]
It can be calculated by the following formula.
[0065]
Next, the process proceeds to step S402 in the flowchart of FIG.
[0066]
The
[0067]
First, the processing
[0068]
In step S402, the pixel extraction number set by the processing
[0069]
FIG. 12 is a diagram showing the concept of pixel thinning processing. As shown in FIG. 12, when the subject magnification is large, the pixel thinning number is set to a large value, so that the number of pixels thinned out from the image G1 (original image obtained from the image memory 31) increases, and the image size is reduced. A relatively small image G2 is obtained. On the other hand, when the subject magnification is small, the pixel thinning number is set to a small value, so that the number of pixels thinned out from the image G1 is reduced, and an image G3 having a relatively large image size is obtained.
[0070]
As described above, when the
[0071]
Next, the processing
[0072]
In step S403, the
[0073]
14 and 15 are diagrams showing the concept of block division processing. FIG. 14 shows a case where the subject magnification is large, and FIG. 15 shows a case where the subject magnification is small, that is, the proportion of the main subject in the image is small. Shows the case.
[0074]
As shown in FIGS. 14 and 15, when the subject magnification is large, the
[0075]
In this manner, the
[0076]
Next, the processing
[0077]
FIG. 16 is a diagram illustrating the relationship between the subject magnification and the aspect ratio. As shown in FIG. 16, the relationship between the subject magnification and the aspect ratio is set so that the aspect ratio increases in proportion to the subject magnification. In other words, when the subject magnification is small, the ratio of the distribution length in the vertical direction when the horizontal distribution length of the block aggregate is set to 1 is set to be small, whereas the subject magnification is When the distribution length is large, the ratio of the distribution lengths in the vertical direction when the horizontal distribution length of the block aggregate is set to 1 is set to be large.
[0078]
When the face shape of a person is specified as the main subject, the minimum aspect ratio is preferably about vertical: horizontal = 1.5: 1, and the maximum value is vertical: horizontal = 2: Preferably, it is about 1. With this setting, the
[0079]
Note that the face shape may be determined by always applying a fixed determination criterion regardless of the subject magnification.
[0080]
In step S405, the
[0081]
[Equation 3]
[0082]
[Expression 4]
[0083]
FIG. 17 is a simplified diagram of the “CIE 1976 UCS Chromaticity Diagram”. In FIG. 17, a region RH is a skin color region set in advance by measurement or the like. Therefore, whether or not each pixel is a flesh color pixel can be determined by applying the chromaticities u ′ and v ′ obtained by the
[0084]
[Equation 5]
[0085]
[Formula 6]
[0086]
That is, when the chromaticity u ′ calculated by the equation (3) satisfies the conditional equation (5) and the chromaticity v ′ calculated by the equation (4) satisfies the conditional equation (6). Is found to be a skin color pixel. By specifying the skin color pixel using the UCS chromaticity diagram, it becomes possible to specify the skin color pixel accurately without being affected by the luminance value, and the chromaticity u ′, Since the conversion to v ′ is a relatively simple calculation, it is possible to efficiently perform the calculation process.
[0087]
In FIG. 17, the skin color region RH is exemplified as a rectangular region as an example. However, for example, a trapezoid or a trapezoid in the u′v ′ space of the UCS chromaticity diagram is used.OvalA circular skin color region may be set.
[0088]
When this skin color pixel extraction process is performed for each pixel, as described above, when the subject magnification is large, the image size is small and the number of pixels is relatively small. Is possible. On the other hand, when the subject magnification is low, the image size is large and the number of pixels is relatively large. Therefore, the number of samples increases, and the subject can be accurately extracted.
[0089]
In step S406, the
[0090]
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
[0091]
Further, when the subject magnification is high, the number of block divisions is relatively small, and as a result, the number of blocks specified as flesh-colored blocks is also small, so that the subsequent processing can be performed more efficiently.
[0092]
On the other hand, when the subject magnification is low, the number of block divisions is relatively large, and as a result, the number of blocks specified as flesh-colored blocks increases, so that the main subject can be accurately selected in subsequent processing such as shape determination. It becomes possible to extract. That is, even when the subject magnification is small (when the main subject appears small in the image), since the number of blocks is large, the main subject is covered by a plurality of blocks, so that the skin color block can be recognized well. Thus, the main subject can be accurately extracted.
[0093]
Next, proceeding to step S407, the
[0094]
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 a shape determination process (step S408) and a face identification process (step S409) performed later.
[0095]
Next, proceeding to step S408, the
[0096]
The shape determination process here is performed by determining whether or not an aggregate of skin color blocks is included in the range of the aspect ratio set in step S404. Specifically, the numbers of vertical and horizontal blocks included in the group information generated in step S407 are acquired, and the vertical and horizontal aspect ratios (M: 1) of the flesh color block aggregate are obtained. When the aspect ratio set in step S404 is K: 1, if the relationship of M ≦ K is established, it is determined that the flesh color block aggregate is an image component obtained by photographing a human face portion.
[0097]
Note that the skin color block aggregate distributed in a row in the horizontal direction is also determined to be a human face part only by the relationship of M ≦ K. Therefore, in order to avoid such a situation, the lower limit L is added to the value of M. May be set. That is, if the relationship of L ≦ M ≦ K is established, it may be determined that the flesh color block aggregate is an image component obtained by photographing a human face portion.
[0098]
FIG. 18 is a diagram showing an area recognized as the main subject in the shape determination process (step S408). In FIG. 18, the area recognized as the main subject is shown in black. As shown in FIG. 18, the
[0099]
Next, proceeding to step S409, when a plurality of main subjects are specified by the shape determination process, the
[0100]
FIG. 19 is a diagram showing an example of weighting coefficients for the screen. As shown in FIG. 19, the screen G5 is divided into a plurality of areas, and a weighting coefficient for each area is defined for each area. Note that the size of the screen G5 changes according to the pixel thinning number, and the image G after the pixel thinning processing is performed.2, G3Adjustment is made so as to match the image size (see FIG. 12). 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. 18, when considering a black-colored flesh color block aggregate specified as the main subject, the center of gravity is located at position P1 in FIG. 19, and thus the weighting coefficient is specified as “10”. Then, the
[0101]
As described above, when a plurality of main subjects are specified, 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.
[0102]
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.
[0103]
When the main subject is specified as described above, the
[0104]
Returning to the flowchart of FIG. 7, when the subject extraction process in step S104 is completed, the process proceeds to step S105. The focus evaluation
[0105]
Next, the
[0106]
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. When the in-focus state in the in-focus evaluation area is realized, the process proceeds to the flowchart of FIG.
[0107]
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 above with reference to FIGS.
[0108]
However, at the stage of step S104, the main subject extraction process is performed in a state where the image component of the focus evaluation area is blurred, so the subject magnification is accurately obtained by the arithmetic process using the actual lens position of the focusing
[0109]
Therefore, in this embodiment, subject extraction processing is performed again in step S110. In step S110, since the image component in the focus evaluation area is determined to be in a focused state, an accurate subject magnification is obtained by arithmetic processing based on the actual lens position of the focusing
[0110]
When subject extraction processing (step S110) is performed and a highly reliable main subject region is specified, the
[0111]
Thereby, the focus evaluation
[0112]
When the focus evaluation
[0113]
The
[0114]
When the
[0115]
Thus, the processing procedure of the
[0116]
In the
[0117]
As a result, overall processing efficiency is improved, and the main subject can be accurately extracted regardless of the state of the main subject in the image.
[0118]
<2. Second Embodiment>
Next, a second embodiment will be described. In this embodiment, the apparatus configuration is the same as that described in the first embodiment (see FIG. 2 and the like).
[0119]
In the first embodiment, the
[0120]
For this reason, in this embodiment, the subject extraction process is executed even while the focusing
[0121]
20 and 21 are flowcharts showing the processing procedure of the
[0122]
First, when the
[0123]
Then, the focusing
[0124]
Next, a focus evaluation area setting process is performed (step S303). When the main subject region is designated by the
[0125]
Then, the
[0126]
Then, the processing
[0127]
There are several methods for the processing
[0128]
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.
[0129]
However, the method by which the processing
[0130]
If the processing
[0131]
Also in this embodiment, the details of the subject extraction process (step S308) are the same as those in the flowcharts shown in FIGS. Therefore, subject extraction processing that emphasizes processing efficiency is performed when the subject magnification is relatively large, and the reliability of the main subject specified by the subject extraction processing is improved when the subject magnification is relatively small. Therefore, highly accurate subject extraction processing is executed.
[0132]
When the main subject region is specified in the subject extraction process (step S308), the main subject region is transmitted from the
[0133]
In step S309, the focus evaluation
[0134]
Then, the
[0135]
When the main photographing operation is permitted, the
[0136]
On the other hand, when the
[0137]
As described above, in the
[0138]
In the
[0139]
As a result, overall processing efficiency is improved, and the main subject can be accurately extracted regardless of the state of the main subject in the image.
[0140]
Further, in the
[0141]
Furthermore, the main subject can be extracted more accurately by configuring the frequency of subject extraction processing to increase as the image component in the focus evaluation area approaches the focused state, and its reliability is high. The main subject can be quickly brought into focus.
[0142]
<3. Modification>
Although the embodiments of the present invention have been described above, the present invention is not limited to the contents described above.
[0143]
For example, the digital camera in the above description includes both a digital still camera and a digital video camera. Although the
[0144]
In the above description, the focus control such as the so-called hill-climbing method is described. However, the auto focus detection method called the active method or the phase difference method, and the distance measurement is performed in a plurality of distance measuring areas. The present invention can be applied even to a control method such as an automatic focus detection method.
[0145]
In the above description, the case where the timing for starting the focusing operation is after halfway pressing of the
[0146]
In the above description, the pixel thinning number, the number of block divisions, the shape determination standard, and the subject magnification indicate a continuous relationship. Each of the number of divisions and the shape determination criterion may be changed step by step.
[0147]
In the above description, 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 essence of the present invention is that the main subject is limited to the face of a person. It is not something. For this reason, if the user can freely set and input information on the color components, shapes, etc. constituting the main subject, the main subject intended by the user can be appropriately specified.
[0148]
Furthermore, in the above description, the case where the subject extraction process is performed to guide the main subject to the in-focus state has been described, but in view of the fact that the main subject region is specified from the image according to the result of the subject extraction process, The subject extraction processing can be executed not only for automatic focusing control but also for performing special image processing on the image components of the main subject region. That is, the subject extraction technique described above is not limited to the one applied to guide the main subject to the focused state.
[0149]
【The invention's effect】
As described above, according to the first aspect of the present invention, the specific subject extraction process is performed according to the subject magnification at the time of the main photographing operation.For the imageSince the processing content is changed and the specific subject is extracted from the image based on the processing content, when the proportion of the specific subject in the image is large, processing that emphasizes processing efficiency The content can be set, and when the proportion of the specific subject in the image is small, the processing content that emphasizes the reliability of subject extraction can be set. As a result, the overall processing efficiency is improved, and the specific subject can be accurately extracted regardless of the state in which the specific subject is included in the image.
[0150]
The invention described in claim 2In the extraction process of the specific subject, pixel thinning processing or block division processing is performed, and the thinning number in the pixel thinning processing or the block division number in the block division processing is changed in accordance with the subject magnification. The image size and the number of blocks to be processed can be adjusted according to the subject magnification, so that it is possible to improve the processing efficiency in the extraction process of the specific subject and improve the reliability of the extracted specific subject Become.
[0151]
The invention according to claim 3As the subject magnification decreases, the processing content is changed by decreasing the number of thinnings or increasing the number of block divisions, so if the proportion of the specific subject in the image decreases, the extraction processing of the specific subject increases. The details of processing can be improved, and the reliability of the extracted specific subject can be improved.
[Brief description of the drawings]
FIG. 1 is a perspective view showing a digital camera as an example of a photographing apparatus.
FIG. 2 is a block diagram showing an internal configuration of the digital camera.
FIG. 3 is a diagram illustrating an initial state of a focus evaluation area set in advance in the digital camera.
FIG. 4 is a diagram illustrating an example of an evaluation value change with respect to a lens position.
FIG. 5 is a diagram illustrating a captured image when the subject magnification is low.
FIG. 6 is a diagram illustrating a captured image when the subject magnification is large.
FIG. 7 is a flowchart illustrating a processing procedure of the digital camera according to the first embodiment.
FIG. 8 is a flowchart illustrating a processing procedure of the digital camera according to the first embodiment.
FIG. 9 is a flowchart showing a detailed processing procedure of subject extraction processing;
FIG. 10 is a flowchart showing a detailed processing procedure of subject magnification detection processing;
FIG. 11 is a diagram illustrating a relationship between a subject magnification and a pixel thinning number.
FIG. 12 is a diagram illustrating a concept of pixel thinning processing.
FIG. 13 is a diagram illustrating the relationship between subject magnification and the number of block divisions.
FIG. 14 is a diagram illustrating a concept of block division processing when the subject magnification is large.
FIG. 15 is a diagram illustrating a concept of block division processing when the subject magnification is small.
FIG. 16 is a diagram illustrating a relationship between a subject magnification and an aspect ratio as a shape determination criterion.
FIG. 17 is a simplified diagram of a CIE 1976 UCS chromaticity diagram.
FIG. 18 is a diagram showing an area recognized as a main subject in the shape determination process.
FIG. 19 is a diagram illustrating an example of a weighting coefficient for a screen.
FIG. 20 is a flowchart illustrating a processing procedure of the digital camera according to the second embodiment.
FIG. 21 is a flowchart illustrating a processing procedure of the digital camera according to the second embodiment.
[Explanation of symbols]
1 Digital camera (shooting 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 (Subject extraction device)
41 Focus evaluation area setting section
42 Focus evaluation section
43 Focus control unit
44 Processing content change section
45 Subject extraction unit
50 Lens drive unit
Claims (3)
本撮影動作時の被写体倍率に応じて、前記特定被写体の抽出処理を行う際の前記画像に対する処理内容を変更する処理内容変更手段と、
前記処理内容に基づいて前記画像のうちから前記特定被写体の抽出処理を行う被写体抽出手段と、
を備える被写体抽出装置。A subject extraction device that detects a specific subject from an image,
Processing content changing means for changing the processing content of the image when performing the extraction processing of the specific subject according to the subject magnification at the time of the main photographing operation;
Subject extracting means for extracting the specific subject from the image based on the processing content;
A subject extraction device comprising:
前記被写体抽出手段は、前記特定被写体の抽出処理にあたって、画素間引き処理、又は、ブロック分割処理を行うように構成され、
前記処理内容変更手段は、前記画素間引き処理における間引き数、又は、前記ブロック分割処理におけるブロック分割数を前記被写体倍率に応じて変更することを特徴とする被写体抽出装置。The subject extraction device according to claim 1,
The subject extraction means is configured to perform pixel thinning processing or block division processing in the extraction processing of the specific subject,
The subject extraction device characterized in that the processing content changing means changes a thinning number in the pixel thinning processing or a block division number in the block division processing in accordance with the subject magnification.
前記処理内容変更手段は、前記被写体倍率が小さくなるにつれて、前記間引き数を減少させ、又は前記ブロック分割数を増加させることにより、前記処理内容の変更を行うことを特徴とする被写体抽出装置。The subject extraction device according to claim 2,
The processing content changing unit changes the processing content by decreasing the thinning number or increasing the block division number as the subject magnification decreases.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2001357985A JP4053764B2 (en) | 2001-11-22 | 2001-11-22 | Subject extraction device and photographing device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2001357985A JP4053764B2 (en) | 2001-11-22 | 2001-11-22 | Subject extraction device and photographing device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2003163827A JP2003163827A (en) | 2003-06-06 |
| JP4053764B2 true JP4053764B2 (en) | 2008-02-27 |
Family
ID=19169245
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2001357985A Expired - Fee Related JP4053764B2 (en) | 2001-11-22 | 2001-11-22 | Subject extraction device and photographing device |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP4053764B2 (en) |
Families Citing this family (20)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP3918788B2 (en) | 2003-08-06 | 2007-05-23 | コニカミノルタフォトイメージング株式会社 | Imaging apparatus and program |
| JP4158750B2 (en) * | 2003-08-26 | 2008-10-01 | ソニー株式会社 | Autofocus control method, autofocus control device, and image processing device |
| JP2005128291A (en) * | 2003-10-24 | 2005-05-19 | Nikon Corp | Focus detection device and camera |
| JP2005215750A (en) | 2004-01-27 | 2005-08-11 | Canon Inc | Face detection device and face detection method |
| JP4914045B2 (en) * | 2005-09-07 | 2012-04-11 | キヤノン株式会社 | IMAGING DEVICE AND IMAGING DEVICE CONTROL METHOD |
| JP4645413B2 (en) * | 2005-11-01 | 2011-03-09 | 株式会社ニコン | Imaging device |
| JP2008287064A (en) | 2007-05-18 | 2008-11-27 | Sony Corp | Imaging device |
| JP2008311921A (en) * | 2007-06-14 | 2008-12-25 | Fujifilm Corp | Imaging device |
| EP3462727B1 (en) | 2007-06-14 | 2020-05-13 | FUJIFILM Corporation | Photographing apparatus |
| JP2008311922A (en) * | 2007-06-14 | 2008-12-25 | Fujifilm Corp | Imaging device |
| JP5101993B2 (en) * | 2007-11-01 | 2012-12-19 | キヤノン株式会社 | Information processing apparatus and information processing method |
| JP5515295B2 (en) * | 2009-01-16 | 2014-06-11 | 株式会社ニコン | Photometric device and imaging device |
| JP5093178B2 (en) * | 2009-04-06 | 2012-12-05 | 株式会社ニコン | Electronic camera |
| JP5171723B2 (en) * | 2009-04-27 | 2013-03-27 | アルプス電気株式会社 | Obstacle detection device and vehicle equipped with the device |
| JP5375943B2 (en) * | 2011-12-26 | 2013-12-25 | カシオ計算機株式会社 | Imaging apparatus and program thereof |
| JP5561392B2 (en) * | 2013-02-01 | 2014-07-30 | カシオ計算機株式会社 | Imaging apparatus, focusing method, and program |
| JP6748477B2 (en) * | 2016-04-22 | 2020-09-02 | キヤノン株式会社 | Imaging device, control method thereof, program, and storage medium |
| JP6406340B2 (en) * | 2016-11-30 | 2018-10-17 | 株式会社ニコン | Image processing apparatus and imaging apparatus |
| JP7410675B2 (en) * | 2019-09-06 | 2024-01-10 | キヤノン株式会社 | Imaging device and its control method |
| JP7159371B2 (en) * | 2020-04-22 | 2022-10-24 | キヤノン株式会社 | Control device, its control method, and program |
-
2001
- 2001-11-22 JP JP2001357985A patent/JP4053764B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2003163827A (en) | 2003-06-06 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP4053764B2 (en) | Subject extraction device and photographing device | |
| JP3760846B2 (en) | Subject extraction device and photographing device | |
| CN1604621B (en) | Image sensing apparatus and its control method | |
| US8395694B2 (en) | Apparatus and method for blurring image background in digital image processing device | |
| US7978253B2 (en) | Image pickup device using blur processing and control method thereof | |
| JP3541820B2 (en) | Imaging device and imaging method | |
| JP5036599B2 (en) | Imaging device | |
| JP3555607B2 (en) | Auto focus device | |
| EP1522952B1 (en) | Digital camera | |
| JP3675412B2 (en) | Imaging device | |
| JP5247076B2 (en) | Image tracking device, focus adjustment device, and imaging device | |
| CN107645632B (en) | Focus adjustment device, focus adjustment method, imaging device, and storage medium | |
| US20080025604A1 (en) | System for and method of taking image and computer program | |
| US20100007759A1 (en) | Image processor, imaging apparatus including the same, and image processing method | |
| US20110043666A1 (en) | Image processing apparatus, image processing method, and computer program storage medium | |
| CN101072301A (en) | Method for displaying face detection frame, method for displaying character information, and image-taking device | |
| JP2013005091A (en) | Imaging apparatus and distance information acquisition method | |
| EP2171685A1 (en) | Image processor, image processing method, digital camera, and imaging apparatus | |
| US20080100721A1 (en) | Method of detecting specific object region and digital camera | |
| JP4039147B2 (en) | Imaging device | |
| JP2004325517A (en) | Imaging device | |
| JP4460560B2 (en) | Imaging apparatus and imaging method | |
| JP2009055125A (en) | IMAGING DEVICE AND IMAGING DEVICE CONTROL METHOD | |
| JP3555583B2 (en) | Optical system control device, optical system control method, recording medium, and imaging device | |
| JP2009081636A (en) | Image recording apparatus and photographing method |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20040907 |
|
| A711 | Notification of change in applicant |
Free format text: JAPANESE INTERMEDIATE CODE: A712 Effective date: 20041029 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20041104 |
|
| RD03 | Notification of appointment of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7423 Effective date: 20041104 |
|
| A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20050419 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20050617 |
|
| A911 | Transfer to examiner for re-examination before appeal (zenchi) |
Free format text: JAPANESE INTERMEDIATE CODE: A911 Effective date: 20050622 |
|
| A912 | Re-examination (zenchi) completed and case transferred to appeal board |
Free format text: JAPANESE INTERMEDIATE CODE: A912 Effective date: 20060127 |
|
| A711 | Notification of change in applicant |
Free format text: JAPANESE INTERMEDIATE CODE: A711 Effective date: 20070827 |
|
| RD03 | Notification of appointment of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7423 Effective date: 20070914 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20071206 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20101214 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: 20111214 Year of fee payment: 4 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20121214 Year of fee payment: 5 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20131214 Year of fee payment: 6 |
|
| S111 | Request for change of ownership or part of ownership |
Free format text: JAPANESE INTERMEDIATE CODE: R313111 |
|
| R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
| LAPS | Cancellation because of no payment of annual fees |