Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP4053764B2 - Subject extraction device and photographing device - Google Patents
[go: Go Back, main page]

JP4053764B2 - Subject extraction device and photographing device - Google Patents

Subject extraction device and photographing device Download PDF

Info

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
Application number
JP2001357985A
Other languages
Japanese (ja)
Other versions
JP2003163827A (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 JP2001357985A priority Critical patent/JP4053764B2/en
Publication of JP2003163827A publication Critical patent/JP2003163827A/en
Application granted granted Critical
Publication of JP4053764B2 publication Critical patent/JP4053764B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

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】

Figure 0004053764
【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】
Figure 0004053764
【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】
Figure 0004053764
【0082】
【数4】
Figure 0004053764
【0083】
図17は、「CIE 1976 UCS色度図」の簡略図である。図17において領域RHは予め計測等によって設定される肌色領域である。このため、上記数3及び数4の式によって求められる色度u’,v’を次の条件式にあてはめれば各画素が肌色画素であるか否かを判定することができる。
【0084】
【数5】
Figure 0004053764
【0085】
【数6】
Figure 0004053764
【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のサイズは、画素間引き数に応じて変化し、画素間引き処理後の画像G,G(図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 claim 1 is a subject extraction device that detects a specific subject from an image, and performs the extraction process of the specific subject according to the subject magnification at the time of the main photographing operation. When doingFor the imageProcessing content change means for changing the processing content, and subject extraction means for extracting the specific subject from the image based on the processing content.
[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 digital camera 1 as an example of a photographing apparatus according to 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 1. Inside the photographic lens 11, a CCD imaging device 30 is provided as an imaging means for photoelectrically converting a subject image incident through the photographic lens 11 and generating image data (data composed of an array of pixel data for each pixel). It has been.
[0020]
The photographing lens 11 includes a focusing lens that can move along the optical axis direction. By driving the focusing lens, the in-focus state of the image formed on the CCD image sensor 30 can be varied. It is configured as follows.
[0021]
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 1. 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 for showing the user the current setting contents in the digital camera 1. The setting key 14 is a key switch for performing selection setting of a shooting mode according to the subject.
[0022]
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 1, and an exchangeable recording medium such as a memory card is formed. 9 can be mounted.
[0023]
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 1.
[0024]
FIG. 2 is a block diagram showing the internal configuration of the digital camera 1. In FIG. 2, solid arrows indicate the flow of control signals, and hatched arrows indicate the flow of image signals.
[0025]
As shown in FIG. 2, the digital camera 1 includes a shooting function unit 20 that realizes a shooting function when shooting a subject, and a main subject (specific subject) is detected 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.
[0026]
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.
[0027]
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.
[0028]
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 area to the focused state, a processing content change unit 44 that changes the setting state in the subject extraction unit 45 according to the subject magnification, and an image A subject extraction unit 45 that takes in image data from the memory 31 and performs a main subject (specific subject) extraction process based on the processing content set by the processing content change unit 44 is configured.
[0029]
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.
[0030]
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. Change the in-focus state of the image. 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 with the main subject in focus on the CCD image sensor 30.
[0031]
FIG. 3 is a diagram showing an initial state of a focus evaluation area preset in the digital camera 1. 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 sets the position and size of the focus evaluation region FR1 shown in FIG. Instruct.
[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 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.
[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 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.
[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 digital camera 1 according to this embodiment, the subject extraction 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.
[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 content changing unit 44 inputs information regarding the lens position of the focusing lens 12 and information regarding the focusing state of the focusing evaluation area from the focusing control unit 43, and the photographing lens 11 from the overall control unit 18. The focal length information and the shooting mode information are input. Then, the processing content changing unit 44 obtains the subject magnification based on the information, and determines the processing content in the subject extraction unit 45 according to the subject magnification.
[0044]
In the subject extraction unit 45, subject extraction processing is performed such that the skin color component of the image is extracted and the region in which the skin color component is distributed is recognized as the main subject region. The number of pixels is changed according to the subject magnification. In the subject extracting unit 45, subject extraction processing is performed by performing block determination of the image and performing shape determination in a state where the flesh color blocks are gathered. The processing content changing unit 44 is an evaluation target at that time. The number of blocks is changed according to the subject magnification, and the shape determination reference in the shape determination is changed according to the subject magnification. In other words, when the subject magnification is high, the setting is changed so that a relatively rough subject extraction process is performed and the main subject is efficiently extracted. When the subject magnification is low, a precise subject extraction process is performed. The setting is changed to perform highly accurate subject extraction processing. Then, the subject extraction unit 45 performs a main subject extraction process from the image obtained from the image memory 31 based on the processing content determined according to the subject magnification.
[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 digital camera 1 is improved as compared with the case where fine subject extraction processing is performed.
[0046]
The processing procedure of the digital camera 1 in this embodiment will be described below. 7 to 10 are flowcharts showing the processing procedure of the digital camera 1 in the first embodiment. In particular, in FIGS. 7 and 8, the main photographing operation is performed after the shutter button 8 is pressed halfway. FIG. 9 and FIG. 10 show the detailed processing procedure of the subject extraction processing, and FIG. 10 shows the detailed processing procedure of the subject magnification detection processing in particular. Yes.
[0047]
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.
[0048]
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 direct. 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.
[0049]
Then, the processing content change unit 44 and the subject extraction unit 45 function to perform subject extraction processing (step S104).
[0050]
Reference is made to the flowchart of FIG. When the process proceeds to the subject extraction process (step S104), the process content changing unit 44 first performs a subject magnification detection process (step S401).
[0051]
Refer to the flowchart of FIG. When proceeding to the subject magnification detection process (step S401), the processing content changing unit 44 first inputs information on the focus state of the focus evaluation area from the focus control unit 43, and the focus state of the focus evaluation area is determined. It is determined whether or not it is realized (step S420). However, the focus state of the focus evaluation area at this time does not need to be a complete focus state. For example, if the evaluation value shown in FIG. To be judged.
[0052]
If the in-focus state of the focus evaluation area is realized, the process proceeds to step S421, and the processing content changing unit 44 inputs information on the current lens position of the focusing lens 12 from the focus control unit 43, thereby focusing. The lens position of the lens 12 is detected (step S421).
[0053]
In step S422, the processing content changing unit 44 inputs information on the focal length of the photographic lens 11 from the overall control unit 18, and thereby detects the focal length of the photographic lens 11. If the photographing lens 11 has a variable focal length such as a zoom lens, the focal length set at that time is detected.
[0054]
Then, the processing content changing unit 44 performs subject magnification calculation processing (step S423). In general, the subject magnification β can be obtained from the lens position x of the focusing lens 12 and the focal length f of the photographing lens 11 by the following equation.
[0055]
[Expression 1]
Figure 0004053764
[0056]
However, the subject magnification β is appropriately obtained by the above equation 1 when the focus evaluation area is almost in focus. That is, the lens position x of the focusing lens 12 in the equation 1 is the lens position in the focused state. However, when the subject extraction process is first executed, it cannot be said that the in-focus evaluation area is still in focus, but rather the focusing lens 12 is often located at a lens position far from the in-focus position. Conceivable. In such a case, even if the processing content changing unit 44 performs the calculation by substituting the lens position of the focusing lens 12 input from the focusing control unit 43 into the equation (1), the subject magnification obtained thereby is calculated. β is not accurate.
[0057]
Therefore, in this embodiment, when the processing content changing unit 44 determines whether or not the in-focus state in the in-focus evaluation area is realized in step S420, and it is determined that the in-focus state is substantially realized. Is configured to perform the operations of Steps S421, S422, and S423 so as to perform the calculation according to Equation 1 and accurately obtain the subject magnification β. On the other hand, when the processing content changing unit 44 determines in step S420 that the in-focus state of the in-focus evaluation area has not been realized, the exact subject distance cannot be obtained, so the processing in steps S424, S425, and S426 is performed. Thus, the process proceeds to a process for estimating the subject distance.
[0058]
The digital camera 1 is provided with a plurality of shooting modes, and the user selects and sets a desired shooting mode from among a plurality of shooting modes with the setting key 14 before shooting. Shooting mode information related to the selected shooting mode is given from the overall control unit 18 to the processing content changing unit 44, and the processing content changing unit 44 estimates the subject magnification according to the shooting mode information.
[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 content changing unit 44 sets the subject magnification to the predetermined value MA because the subject magnification is considered to be relatively large when the photographing mode is the portrait mode. On the other hand, in other shooting modes, the person image is considered to be included in a relatively small size on the screen, so the subject magnification is set to a predetermined value MB. The relationship between the predetermined values MA and MB is MA> MB.
[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 digital camera 1, the active method and the phase difference are illustrated. When an automatic focus detection mechanism such as a method is provided, the subject distance can be detected by these functions, and the subject magnification may be calculated using the subject distance. In this case, the subject magnification β is obtained from the focal length f and the subject distance d of the photographic lens 11.
[0063]
[Expression 2]
Figure 0004053764
[0064]
It can be calculated by the following formula.
[0065]
Next, the process proceeds to step S402 in the flowchart of FIG.
[0066]
The subject extraction unit 45 is configured to perform pixel thinning processing and block division processing as pre-processing of the main subject extraction processing, and to perform color determination processing and shape determination processing as actual main subject extraction processing. ing. Then, the process content changing unit 44 changes the pixel thinning number in the pixel thinning process, the block division number in the block division process, and the shape determination reference in the shape determination process according to the subject magnification obtained in step S401.
[0067]
First, the processing content changing unit 44 sets a pixel thinning number according to the subject magnification (step S402). FIG. 11 is a diagram illustrating the relationship between subject magnification and pixel thinning number. As shown in FIG. 11, the relationship between the subject magnification and the pixel thinning number is set so that the pixel thinning number increases in proportion to the increase in the subject magnification. That is, when the subject magnification is small and the image component of the main subject in the image is relatively small, the pixel thinning number is set to a small value. Conversely, when the subject magnification is large and the image component of the main subject in the image is relatively large, the pixel thinning number is set to a large value.
[0068]
In step S402, the pixel extraction number set by the processing content change unit 44 is further instructed to the subject extraction unit 45, and the subject extraction unit 45 is obtained from the image memory 31 based on the instructed pixel thinning number. Pixel thinning processing is performed on the image.
[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 subject extraction unit 45 changes the image size of the image to be processed before performing the process of extracting the main subject such as the skin color determination process, the efficiency is improved when the subject magnification is large. Thus, the main subject can be extracted, while the main subject can be accurately extracted when the subject magnification is low.
[0071]
  Next, the processing content changing unit 44 sets the number of block divisions according to the subject magnification (step S403). FIG. 13 is a diagram illustrating the relationship between the subject magnification and the number of block divisions. As shown in FIG. 13, the relationship between the subject magnification and the number of block divisions is proportional to the subject magnification.Number of block divisionsIs set to decrease. That is, when the subject magnification is small and the image component of the main subject in the image is relatively small, the block division number is set to a large value. Conversely, when the subject magnification is large and the image component of the main subject in the image is relatively large, the block division number is set to a small value.
[0072]
In step S403, the subject extraction unit 45 is further instructed by the number of block divisions set by the processing content changing unit 44. Based on the designated number of block divisions, the subject extraction unit 45 performs image size reduction by pixel thinning processing. The block division process is executed on the changed image.
[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 subject extraction unit 45 performs block division processing so that a relatively small number of blocks are generated. When the subject magnification is small, the subject extraction unit 45 The block division processing is performed so that a relatively large number of blocks are generated in step S2.
[0075]
In this manner, the subject extraction unit 45 divides the image to be processed into blocks before performing the processing for extracting the main subject such as the skin color determination processing, so that the processing after the grouping processing (step S407) described later is performed. Thus, it is possible to perform processing in units of blocks in order to improve processing efficiency. In particular, when the subject magnification is relatively large, the main subject can be extracted efficiently by reducing the number of block divisions, while when the subject magnification is relatively small, block division is possible. It becomes possible to accurately extract the main subject by increasing the number.
[0076]
Next, the processing content changing unit 44 sets a shape determination criterion according to the subject magnification (step S404). For example, in this embodiment, the subject extraction unit 45 is configured to determine whether or not the flesh color block aggregate has a shape similar to a human face shape. Specifically, it sets the aspect ratio of the reference shape that is the shape determination reference, determines whether the collection of skin color blocks is within the range of the aspect ratio, and if so, the skin color An aggregate of blocks is specified as the main subject. Therefore, the processing content changing unit 44 sets an aspect ratio as a shape determination reference according to the subject magnification, and instructs the subject extracting unit 45 to set it. Here, the aspect ratio means the ratio of the distribution length in the vertical direction when the distribution length in the horizontal direction of the flesh color block aggregate is 1.
[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 subject extraction unit 45 can determine the face shape even when the subject magnification is relatively small, and the face shape can be determined even when the subject magnification is large. It can be carried out.
[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 subject extraction unit 45 performs a skin color pixel extraction process for extracting skin color pixels from the pixel-thinned image. In other words, this skin color pixel extraction process is a color determination process. In the skin color pixel extraction process, chromaticities u ′ and v ′ that are not affected by luminance are calculated from the RGB values of the pixel data, and the chromaticities u ′ and v ′ are within a specific area of the “CIE 1976 UCS chromaticity diagram”. The flesh color pixel is extracted depending on whether or not it exists. In addition, when calculating chromaticity u 'and v' from the RGB value of a certain pixel, it can be calculated by the following equations (3) and (4).
[0081]
[Equation 3]
Figure 0004053764
[0082]
[Expression 4]
Figure 0004053764
[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 above equations 3 and 4 to the following conditional expression.
[0084]
[Equation 5]
Figure 0004053764
[0085]
[Formula 6]
Figure 0004053764
[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 subject extraction unit 45 performs a flesh color block extraction process. Here, it is determined whether or not the flesh color pixels are included in a predetermined ratio or more for each block divided by the block division processing in step S403, and if the flesh color pixels are included in a predetermined ratio or more, the block is determined to be a flesh color block. As specified. On the other hand, when the number of skin color pixels included in one block is less than a predetermined ratio, it is determined that the block is not extracted as a skin color block and does not constitute a main subject.
[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 digital camera 1, when the shutter button 8 is half-pressed, it is required to quickly bring the main subject into the focused state in order not to miss the photo opportunity. Each process has an important significance. At the same time, since a block in which a predetermined proportion of flesh-color pixels exists is used as a flesh-color block, the reliability of the flesh-color block is also improved.
[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 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.
[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 subject extraction unit 45 performs a shape determination process of the flesh color block aggregate formed by the grouping process of step S407. Generally, skin tone from the imageblockWhen finding an aggregate, not only the skin part of the person is extracted, but the skin color is also applied to objects other than the person's skin, such as walls and tree skin, which actually show skin color.blockAggregates can be formed. The hands and feet of peopleblockAggregates can be formed. Thus, in this embodiment, the subject extraction unit 45 further performs shape determination processing so that a flesh color group aggregate having a shape distribution close to a human face shape is recognized as a main subject. .
[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 subject extraction unit 45 performs shape determination processing, whereby a block including a person's face portion is specified as the main subject region.
[0099]
Next, proceeding to step S409, when a plurality of main subjects are specified by the shape determination process, the subject extraction unit 45 specifies a face, 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.
[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 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. .
[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 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 S410). 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.
[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 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.
[0105]
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.
[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 lens 12. However, the subject extraction process is executed in a state where the subject magnification is estimated by the shooting mode, so 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.
[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 lens 12, In addition, since the subject extraction process based on the accurate subject magnification is executed, the main subject region can be specified with high accuracy.
[0110]
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.
[0111]
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. 7), 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. 8).
[0112]
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).
[0113]
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. Since the digital camera 1 is fully depressed when the shutter button 8 is fully depressed, if the shutter button 8 is not fully depressed, in order to cope with a change in framing, step S102 ( Returning to FIG. 7), the processing after the shutter button 8 is half-pressed is repeated.
[0114]
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.
[0115]
Thus, the processing procedure of the digital camera 1 from when the shutter button 8 is half-pressed to when the main photographing operation is completed is completed. In the main photographing operation, the main subject exists in any part of the image. Even in such a case, it is possible to photograph the main subject in a focused state.
[0116]
In the digital camera 1 of this embodiment, when the main subject focusing control unit 40 that also functions as a subject extracting device performs the main subject extraction process according to the shooting conditions such as the subject magnification and the shooting mode. Since the main subject is extracted from the image based on the processing content, the processing efficiency is emphasized when the proportion of the main subject in the image is large. If the ratio of the main subject in the image is small, it is possible to set the processing content that emphasizes the reliability of subject extraction.
[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 focus control unit 43 drives the focusing lens 12 stepwise at a predetermined pitch, and the focus evaluation unit 42 calculates the evaluation value at each lens position. The process is executed before the focusing lens 12 is driven stepwise and after the focusing evaluation area reaches the in-focus state. Therefore, if 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, that subject The operation for guiding the included focus evaluation area to the focused state is wasted.
[0120]
For this reason, in this embodiment, the subject extraction process is executed even while the focusing lens 12 is moved stepwise, thereby eliminating unnecessary operations and more efficiently focusing the main subject accurately. A form to be led to will be described.
[0121]
20 and 21 are flowcharts showing the processing procedure of the digital camera 1 in the second embodiment, and in particular, the overall processing from when the shutter button 8 is half-pressed until the actual photographing operation is performed. The procedure is shown.
[0122]
First, when the shutter button 8 is pressed halfway by the user (step S301), the overall control unit 18 causes the main subject focusing control unit 40 and the imaging function unit 20 to function.
[0123]
Then, the focusing control unit 43 controls the lens driving unit 50 to move the focusing lens 12 to the farthest side (step S302). When the process of step S302 is executed after the next time, the focusing control unit 43 performs a control operation for moving the focusing lens 12 by a predetermined pitch in the near side direction.
[0124]
Next, a focus evaluation area setting process is performed (step S303). 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 S303 is performed for the first time after the shutter button 8 is half-pressed, the subject extraction process (step S308) is not yet 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.
[0125]
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 S304) and performs evaluation value calculation processing (step S305). At this time, the focus evaluation unit 42 calculates an evaluation value based on the image component of the focus evaluation region specified from the focus evaluation region setting unit 41 in step S303, and the evaluation value calculated as a result is the focus value. This is given to the focus control unit 43.
[0126]
  Then, the processing content changing unit 44 determines whether or not to execute subject extraction processing (step S306). In this embodiment, when the focusing lens 12 is moved stepwise at a predetermined pitch, the subject extraction process can be executed at each lens position, but every time the lens is driven at the predetermined pitch. If the subject extraction processing is executed, it takes a long time to lead the main subject to the focused state. For this reason, the processing content changing unit 44 of this embodiment not only has a function of changing the processing content in the subject extracting unit 45 but also the subject extracting unit 45.OhA function of adjusting the execution frequency of the subject extraction process.
[0127]
There are several methods for the processing content changing unit 44 to adjust the execution frequency of the subject extraction processing. 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.
[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 content changing unit 44 adjusts the execution frequency of the subject extraction processing 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.
[0130]
If the processing content changing unit 44 determines that the subject extraction process is to be executed by counting the number of lens driving operations, the process proceeds to the subject extraction process in step S308. On the other hand, if it is determined that the subject extraction process is not to be executed, the process proceeds to a process for skipping the subject extraction process (step S308) and performing the focus determination, that is, step S310 (the flowchart in FIG. 21).
[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 subject extraction unit 45 to the focus evaluation region setting unit 41.
[0133]
In step S309, the focus evaluation area setting unit 41 compares the focus evaluation area so far 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 S303, 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 S308. 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 S310 (FIG. 21).
[0134]
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 is determined. Determine whether it has been 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 S302 (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 S311 to permit the main control unit 18 to perform the main photographing operation.
[0135]
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 S312). 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 S302 (FIG. 20) in order to cope with the case where the framing is changed. 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.
[0136]
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 S313), and the image processing unit 32 performs predetermined image processing. After performing (Step S314), the recording process to the recording medium 9 (Step S315) is performed.
[0137]
As described above, in the digital camera 1 according to the second embodiment, the processing procedure from when the shutter button 8 is pressed halfway down until the main shooting operation is completed is completed. In any part of the image, the main subject can be photographed in a focused state.
[0138]
In the digital camera 1 of this embodiment as well, when the main subject focusing control unit 40 that also functions as a subject extracting device performs main subject extraction processing according to shooting conditions such as subject magnification and shooting mode. Since the main subject is extracted from the image based on the processing content, the processing efficiency is emphasized when the proportion of the main subject in the image is large. If the ratio of the main subject in the image is small, it is possible to set the processing content that emphasizes the reliability of subject extraction.
[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 digital camera 1 of this embodiment, since the subject extraction process is executed even in the lens driving stage for performing the focusing operation, the focusing operation is performed with a portion that is not the main subject as an evaluation target. Since the progress is avoided, a more efficient focusing operation is realized.
[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 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.
[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 shutter button 8 is described. However, the present invention is not limited to this, for example, a state in which a live view image is displayed Also, the above-described focusing operation may be performed.
[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:
請求項1に記載の被写体抽出装置において、
前記被写体抽出手段は、前記特定被写体の抽出処理にあたって、画素間引き処理、又は、ブロック分割処理を行うように構成され、
前記処理内容変更手段は、前記画素間引き処理における間引き数、又は、前記ブロック分割処理におけるブロック分割数を前記被写体倍率に応じて変更することを特徴とする被写体抽出装置。
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.
請求項2に記載の被写体抽出装置において、
前記処理内容変更手段は、前記被写体倍率が小さくなるにつれて、前記間引き数を減少させ、又は前記ブロック分割数を増加させることにより、前記処理内容の変更を行うことを特徴とする被写体抽出装置。
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.
JP2001357985A 2001-11-22 2001-11-22 Subject extraction device and photographing device Expired - Fee Related JP4053764B2 (en)

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)

* Cited by examiner, † Cited by third party
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

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