JP3555584B2 - Digital imaging device and recording medium - Google Patents

Digital imaging device and recording medium Download PDF

Info

Publication number
JP3555584B2
JP3555584B2 JP2001014716A JP2001014716A JP3555584B2 JP 3555584 B2 JP3555584 B2 JP 3555584B2 JP 2001014716 A JP2001014716 A JP 2001014716A JP 2001014716 A JP2001014716 A JP 2001014716A JP 3555584 B2 JP3555584 B2 JP 3555584B2
Authority
JP
Japan
Prior art keywords
image
lens
edge
evaluation value
mode
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
JP2001014716A
Other languages
Japanese (ja)
Other versions
JP2002214524A (en
Inventor
真一 藤井
Original Assignee
ミノルタ株式会社
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 ミノルタ株式会社 filed Critical ミノルタ株式会社
Priority to JP2001014716A priority Critical patent/JP3555584B2/en
Publication of JP2002214524A publication Critical patent/JP2002214524A/en
Application granted granted Critical
Publication of JP3555584B2 publication Critical patent/JP3555584B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、デジタルデータとして画像を取得する際のオートフォーカス技術に関する。
【0002】
【従来の技術】
従来より、デジタルスチルカメラやビデオカメラ等のようにCCD(Charge Coupled Device)等の撮像素子を用いて画像を取得する撮像装置において、画像からエッジを検出し、エッジの幅のヒストグラムからフォーカスレンズの合焦位置を推測する技術が提案されている。
【0003】
例えば、ビデオカメラに関する特開平5−219418号公報では、光学系が合焦状態にある場合にヒストグラムの重心に対応するエッジ幅が所定の値になるという原理を利用し、フォーカスレンズの複数の位置に対応するエッジ幅のヒストグラムを求めておき、複数のヒストグラムからフォーカスレンズの合焦位置が予測される。このような手法はフォーカスレンズの合焦位置を迅速に求めることができるという特徴を有する。
【0004】
【発明が解決しようとする課題】
一方、デジタルスチルカメラでは、画像処理の手法に応じた複数の撮影モードを設け、撮影モードを使い分けることで被写体に応じた処理効果を与えることがなされている。例えば、人物、風景、テキスト等の被写体に応じた撮影モードを設け、被写体の特性ごとに解像感の変更が行われる。
【0005】
ところが、撮影モードが変更されると画像処理によって鮮鋭度が変更されるため、画像内における被写体のエッジの幅が変化してしまう。したがって、上述のようなエッジの幅を利用するオートフォーカスの場合、適切に実行することが困難になるという問題があった。
【0006】
本発明は上記課題に鑑みなされたものであり、画像から検出されるエッジの幅を利用するオートフォーカス制御(以下、適宜「AF制御」と略す。)を撮影モードを考慮しつつ迅速かつ適切に行うことを主たる目的としている。
【0007】
【課題を解決するための手段】
請求項1に記載の発明は、デジタル撮像装置であって、フォーカスの調整が可能な光学系と、前記光学系を介して被写体の画像をデジタルデータとして取得する撮像手段と、前記画像のエッジを検出し、前記エッジの幅のヒストグラムの代表値に対応するエッジ幅をフォーカスの程度を示す評価値として求める演算手段と、複数の撮影モードから一の撮影モードの指定を受け付ける指定手段と、前記一の撮影モードに応じて、前記光学系のレンズが合焦位置に位置すると推測される際の前記評価値としての基準値を設定する設定手段と、前記レンズが第1の位置に位置する際の第1の評価値、前記レンズが第2の位置に位置する際の第2の評価値、および、前記基準値から前記レンズの合焦位置を算出し、算出した合焦位置へと前記レンズを移動させる制御手段とを備える。
【0008】
請求項2に記載の発明は、請求項1に記載のデジタル撮像装置であって、前記設定手段が、前記画像に施される処理における高周波成分のゲイン設定に応じて前記基準値を変更する。
【0009】
請求項3に記載の発明は、請求項1に記載のデジタル撮像装置であって、前記複数の撮影モードに応じて異なる強調の度合いを設定し、前記強調の度合いに従って前記画像の高周波成分を強調する手段、をさらに備え、前記評価値は、前記高周波成分が強調された画像に基づいて求められる
【0010】
請求項4に記載の発明は、請求項1ないし3のいずれかに記載のデジタル撮像装置であって、前記複数の撮影モードがポートレートモードを含み、前記ポートレートモードにおいて設定される基準値が他の撮影モードにおいて設定される基準値よりも大きい。
【0011】
請求項5に記載の発明は、請求項1ないし4のいずれかに記載のデジタル撮像装置であって、前記複数の撮影モードがテキストモードを含み、前記テキストモードにおいて設定される基準値が他の撮影モードにおいて設定される基準値よりも小さい。
【0012】
請求項6に記載の発明は、請求項5に記載のデジタル撮像装置であって、前記複数の撮影モードがポートレートモード、風景モードおよびテキストモードを含む。
【0013】
請求項7に記載の発明は、デジタルデータとして画像を取得する際に、光学系を制御させるプログラムを記録した記録媒体であって、前記プログラムの制御装置による実行は、前記制御装置に、前記光学系のレンズを第1の位置に位置させる工程と、画像のエッジを検出し、前記エッジの幅のヒストグラムの代表値に対応するエッジ幅をフォーカスの程度を示す評価値として求め、第1の評価値とする工程と、前記光学系のレンズを第2の位置に位置させる工程と、画像のエッジを検出し、前記エッジの幅のヒストグラムの代表値に対応するエッジ幅を前記評価値として求め、第2の評価値とする工程と、複数の撮影モードから指定された一の撮影モードに応じて、前記レンズが合焦位置に位置すると推測される際の前記評価値としての基準値を設定する工程と、前記第1の評価値、前記第2の評価値および前記基準値から前記レンズの合焦位置を算出する工程と、算出した前記合焦位置へと前記レンズを移動させる工程とを実行させる。
請求項8に記載の発明は、請求項7に記載の記録媒体であって、前記プログラムの制御装置による実行は、前記制御装置に、前記複数の撮影モードに応じて異なる強調の度合いを設定し、前記強調の度合いに従って前記画像の高周波成分を強調する工程、をさらに実行させ、前記評価値は、前記高周波成分が強調された画像に基づいて求められる。
【0014】
【発明の実施の形態】
<1. デジタルカメラの構成>
図1ないし図4は、静止画像をデジタルデータとして取得するデジタルスチルカメラ(以下、「デジタルカメラ」という。)1の外観構成の一例を示す図であり、図1は正面図、図2は背面図、図3は側面図、図4は底面図である。
【0015】
デジタルカメラ1は、図1に示すように、箱型のカメラ本体部2と直方体状の撮像部3とから構成されている。
【0016】
撮像部3の前面側には、撮影レンズであるマクロ機能付きズームレンズ301が設けられるとともに、銀塩レンズシャッターカメラと同様に、被写体からのフラッシュ光の反射光を受光する調光センサ305および光学ファインダ31が設けられる。
【0017】
カメラ本体部2の前面側には左端部にグリップ部4、そのグリップ部4の上部側に外部器機と赤外線通信を行うためのIRDA(Infrared Data Association)インターフェイス236、および中央上部に内蔵フラッシュ5が設けられ、上面側にはシャッタボタン8が設けられている。シャッタボタン8は、銀塩カメラで採用されているような半押し状態と全押し状態とが検出可能な2段階スイッチになっている。
【0018】
一方、図2に示すように、カメラ本体部2の背面側には、略中央に撮影画像のモニタ表示(ビューファインダに相当)、記録画像の再生表示等を行うための液晶ディスプレイ(LCD:Liquid Crystal Display)10が設けられている。また、LCD10の下方に、デジタルカメラ1の操作を行うキースイッチ群221〜226および電源スイッチ227が設けられる。デジタルカメラ1では、キースイッチ群221〜226が適宜操作されることにより、複数の撮影モードから撮影に適した一の撮影モードの指定が受け付けられる。複数の撮影モードは、ポートレートモード、風景モード、テキストモード等を含む。電源スイッチ227の左側には、電源がオン状態で点灯するLED228およびメモリカードへのアクセス中である旨を表示するLED229が配置される。
【0019】
さらに、カメラ本体部2の背面側には、「撮影」と「再生」との間でカメラの動作モードを切り替える動作切替スイッチ14が設けられる。動作モードが「撮影」に設定されると写真撮影を行って被写体に関する画像を生成することが可能とされ、動作モードが「再生」に設定されるとメモリカードに記録された画像が読み出されてLCD10に再生される。
【0020】
動作切替スイッチ14は2接点のスライドスイッチであり、下方位置にスライドセットすると動作モードが「撮影」となり、上方位置にスライドセットすると動作モードが「再生」となる。
【0021】
また、カメラ背面右側には、4連スイッチ230が設けられ、動作モードが「撮影」の際にはボタン231,232を押すことによりズーミング倍率の変更が行われ、ボタン233,234を押すことによって露出補正が行われる。
【0022】
撮像部3の背面には、図2に示すように、LCD10をオン/オフさせるためのLCDボタン321およびマクロボタン322が設けられる。LCDボタン321が押されるとLCD表示のオン/オフが切り替わる。例えば、専ら光学ファインダ31のみを用いて撮影するときには、節電の目的でLCD表示をオフにする。マクロ撮影(接写)時には、マクロボタン322を押すことにより、撮像部3においてマクロ撮影が可能な状態になる。
【0023】
カメラ本体部2の側面には、図3に示すように端子部235が設けられており、端子部235にはDC入力端子235aと、LCD10に表示されている内容を外部のビデオモニタに出力するためのビデオ出力端子235bとが設けられている。
【0024】
カメラ本体部2の底面には、図4に示すように、電池装填室18とカードスロット(カード装填室)17とが設けられる。カードスロット17は、撮影された画像等を記録するための着脱自在なメモリカード91等を装填するためのものである。カードスロット17および電池装填室18は、クラムシェルタイプの蓋15により開閉自在になっている。なお、このデジタルカメラ1では、4本の単三形乾電池を電池装填室18に装填することにより、これらを直列接続してなる電源電池を駆動源としている。また、図3に示すDC入力端子235aにアダプタを装着することで外部から電力を供給して使用することも可能である。
【0025】
<2. デジタルカメラの内部構成>
次に、デジタルカメラ1における構成についてさらに詳細に説明する。図5は撮像部3における各構成の配置の概略を示す図である。また、図6はデジタルカメラ1の構成を示すブロック図である。
【0026】
図5に示すように、撮像部3におけるズームレンズ301の後方位置の適所にはCCD303を備えた撮像回路が設けられている。また、撮像部3の内部には、ズームレンズ301のズーム比の変更と収容位置、撮像位置間のレンズ移動を行うためのズームモータM1、自動的に合焦を行うためにズームレンズ301内のフォーカスレンズ311を移動させるオートフォーカスモータ(AFモータ)M2、ズームレンズ301内に設けられた絞り302の開口径を調整するための絞りモータM3とが設けられている。
【0027】
図6に示すように、ズームモータM1、AFモータM2、絞りモータM3は、カメラ本体部2に設けられたズームモータ駆動回路203、AFモータ駆動回路204、絞りモータ駆動回路205によってそれぞれ駆動される。また、各駆動回路203〜205はカメラ本体部2の全体制御部211から与えられる制御信号に基づいて各モータM1〜M3を駆動する。
【0028】
CCD303は、ズームレンズ301によって結像された被写体の光像を、R(赤)、G(緑)、B(青)の色成分の画像信号(各画素で受光された画素信号の信号列からなる信号)に光電変換して出力する。
【0029】
撮像部3における露出制御は、絞り302の調整と、CCD303の露光量、すなわちシャッタスピードに相当するCCD303の電荷蓄積時間とを調整して行われる。被写体のコントラストが低いために適切な絞りおよびシャッタースピードが設定できない場合には、CCD303から出力される画像信号のレベル調整を行うことにより露光不足による不適正露出が補正される。すなわち、低コントラスト時は、絞りとシャッタースピードとゲイン調整とを組み合わせて露出レベルが適正レベルとなるように制御が行われる。なお、画像信号のレベル調整は、信号処理回路313内のAGC(Auto Gain Control)回路313bのゲイン調整により行われる。
【0030】
タイミングジェネレータ314は、カメラ本体部2のタイミング制御回路202から送信される基準クロックに基づきCCD303の駆動制御信号を生成するものである。タイミングジェネレータ314は、例えば、積分開始/終了(露出開始/終了)のタイミング信号、各画素の受光信号の読出制御信号(水平同期信号、垂直同期信号、転送信号等)等のクロック信号を生成し、CCD303に出力する。
【0031】
信号処理回路313は、CCD303から出力される画像信号(アナログ信号)に所定のアナログ信号処理を施すものである。信号処理回路313は、CDS(相関二重サンプリング)回路313aとAGC回路313bとを有し、CDS回路313aにより画像信号のノイズの低減を行い、AGC回路313bでゲインを調整することにより画像信号のレベル調整を行う。
【0032】
調光回路304は、フラッシュ撮影における内蔵フラッシュ5の発光量を全体制御部211により設定された所定の発光量に制御するものである。フラッシュ撮影時には、露出開始と同時に被写体からのフラッシュ光の反射光が調光センサ305により受光され、この受光量が所定の発光量に達すると、調光回路304から発光停止信号が出力される。発光停止信号はカメラ本体部2に設けられた全体制御部211を介してフラッシュ制御回路206に導かれ、フラッシュ制御回路206はこの発光停止信号に応答して内蔵フラッシュ5の発光を強制的に停止し、これにより内蔵フラッシュ5の発光量が所定の発光量に制御される。
【0033】
次に、カメラ本体部2のブロックについて説明する。
【0034】
カメラ本体部2内において、A/D変換器201は、画像の各画素の信号を例えば10ビットのデジタル信号に変換するものである。A/D変換器201は、タイミング制御回路202から入力されるA/D変換用のクロックに基づいて各画素信号(アナログ信号)を10ビットのデジタル信号に変換する。
【0035】
タイミング制御回路202は、基準クロック、タイミングジェネレータ314、A/D変換器201に対するクロックを生成するように構成されている。タイミング制御回路202は、CPU(Central Processing Unit)を含む全体制御部211によって制御される。
【0036】
図7は、A/D変換器201からの信号が入力される画像処理部240の構成を示すブロック図である。黒レベル補正回路241は、A/D変換された画像の黒レベルを所定の基準レベルに補正するものである。また、WB(ホワイトバランス)回路242は、γ補正後にホワイトバランスも併せて調整されるように、画素のR、G、Bの各色成分のレベル変換を行うものである。WB回路242は、全体制御部211から入力されるレベル変換テーブルを用いて画素のR、G、Bの各色成分のレベルを変換する。なお、レベル変換テーブルの各色成分の変換係数(特性の傾き)は全体制御部211により撮影画像ごとに設定される。
【0037】
γ補正回路243は、画像のγ特性を補正するものである。アパーチャコンバータ処理部244は、アパーチャ効果を補償する補償回路となっているとともに、コアリング処理部245を有し、画像のノイズを除去しつつ高周波成分を強調して画像の解像感を高める処理を行う。
【0038】
画像メモリ207は、画像処理部240から出力される画像のデータを記憶するメモリである。画像メモリ207は、1フレーム分の記憶容量を有している。すなわち、画像メモリ207は、CCD303がn行m列の画素を有している場合、n×m画素分のデータの記憶容量を有し、各画素のデータが対応するアドレスに記憶される。なお、画像処理部240からの処理済みのデータはAF制御のために全体制御部211にも入力される。
【0039】
図6に示すVRAM(ビデオRAM)208は、LCD10に再生表示される画像のバッファメモリである。VRAM208は、LCD10の画素数に対応した画像データを格納することが可能な記憶容量を有している。
【0040】
動作モードが「撮影」の際の撮影待機状態では、LCDボタン321(図2参照)によってLCD表示がオン状態となっているときに、LCD10にライブビュー表示が行われる。具体的には、撮像部3から所定間隔ごとに得られる各画像に対して、A/D変換器201および画像処理部240において各種の信号処理を施した後、全体制御部211が画像メモリ207に格納される画像を取得し、それをVRAM208に転送することで、LCD10に撮影された画像を表示する。そして、LCD10に表示される画像を所定時間ごとに更新することで、ライブビュー表示が行われる。ライブビュー表示により、撮影者はLCD10に表示された画像により被写体を視認することができる。なお、LCD10において画像を表示する際には、全体制御部211の制御によりバックライト16が点灯する。
【0041】
また、動作モードが「再生」の場合、メモリカード91から読み出された画像が全体制御部211で所定の信号処理が施された後、VRAM208に転送され、LCD10に再生表示される。
【0042】
フラッシュ制御回路206は、内蔵フラッシュ5の発光を制御する回路であり、全体制御部211からの制御信号に基づいて内蔵フラッシュ5を発光させる一方、既述の発光停止信号に基づいて内蔵フラッシュ5の発光を停止させる。
【0043】
RTC(リアルタイムクロック)回路209は、撮影日時を管理するための時計回路である。
【0044】
カードインターフェイス210は、カードスロット17を介してメモリカード91への画像の書き込みおよび読み出しを行うためのインターフェイスである。
【0045】
また、全体制御部211にはIRDAインターフェイス236が接続され、IRDAインターフェイス236を介してコンピュータ500や他のデジタルカメラといった外部器機と赤外線無線通信を行い、画像の無線転送等を行うことが可能となっている。
【0046】
操作部250は、上述した、各種スイッチ、ボタンを包括するものであり、ユーザによって操作入力される情報は、操作部250を介して全体制御部211に伝達される。
【0047】
全体制御部211は、上述した撮像部3内およびカメラ本体部2内の各部材の駆動を有機的に制御し、デジタルカメラ1の全体動作を司る。
【0048】
また、全体制御部211は、自動焦点合わせを効率的に行うための動作制御を行うAF(オートフォーカス)制御部211aと、自動露出を行うためのAE(オートエクスポージャ)演算部211bとを備えている。
【0049】
AF制御部211aには画像処理部240から出力される画像が入力され、オートフォーカスに用いるための評価値を求め、この評価値を用いて各部を制御することで、ズームレンズ301により形成される像の位置をCCD303の撮像面に一致させる。
【0050】
AE演算部211bには、図示を省略しているが画像処理部240の黒レベル補正回路241から出力される画像が入力され、所定のプログラムに基づいて、シャッタスピードと絞り302との適正値を演算する。AE演算部211bは、被写体のコントラストに基づいて、シャッタスピードと絞り302との適正値を所定のプログラムに従って演算する。
【0051】
さらに、全体制御部211は動作モードが「撮影」の際にシャッタボタン8により撮影が指示されると、画像メモリ207に取り込まれた画像のサムネイル画像と操作部250に含まれるスイッチから設定入力された圧縮率によりJPEG方式で圧縮された圧縮画像とを生成し、撮影画像に関するタグ情報(コマ番号、露出値、シャッタスピード、圧縮率、撮影日、撮影時のフラッシュのオンオフのデータ、シーン情報、画像の判定結果等の情報)とともに両画像をメモリカード91に記憶する。
【0052】
「撮影」および「再生」の動作モードを切り替えるための動作切替スイッチ14を「再生」に設定したときには、例えばメモリカード91内のコマ番号の最も大きな画像データが読み出され、全体制御部211にてデータ伸張され、その画像がVRAM208に転送されることにより、LCD10にはコマ番号の最も大きな画像、すなわち最後に撮影された画像が表示される。
【0053】
図8は、アパーチャコンバータ処理部244の構成を示すブロック図である。図8中の符号SG1〜SG5は、各部に対して入力または出力される信号を示す。図8に示すように、アパーチャコンバータ処理部244は、入力される画像信号SG1の高周波成分を抽出する(すなわち、エッジ成分を抽出する)ハイパスフィルタ246、信号SG1の低周波成分を抽出する(すなわち、信号を平滑化する)ローパスフィルタ247、ハイパスフィルタ246からの信号SG2にコアリング処理を行うコアリング処理部245、並びに、コアリング処理部245からの信号SG3およびローパスフィルタ247からの信号SG4を加算して信号SG5を生成する加算器248から構成される。
【0054】
図9は、コアリング処理部245における入力信号SG2と出力信号SG3との関係を示す図である。符号601、602、603にて示す折れ線は、それぞれ撮影モードがテキストモード、風景モード、ポートレートモードである場合の入力信号SG2と出力信号SG3との関係を示す。
【0055】
コアリング処理部245への入力信号SG2は、画像信号の高周波成分であることから、画像信号に含まれるノイズ成分を多く含んでいる。一般にノイズ成分は、有効なエッジ成分よりも小さな値であり、コアリング量Cを適宜設定することによりノイズ成分が適切に除去される。
【0056】
符号601〜603にて示す折れ線の傾斜部分の傾きは、高周波成分のゲインに相当する。すなわち、符号601にて示すように折れ線の傾斜部分の傾きが大きい場合には強調の度合いの大きい信号SG3が生成され、符号603にて示すように傾きが小さい場合には強調の度合いが小さい信号SG3が生成される。
【0057】
アパーチャコンバータ処理部244から出力される信号は、信号SG3と信号SG4とを加算した信号SG5であることから、テキストモードでは最も高周波成分が強調された画像となり、ポートレートモードでは高周波成分の強調の度合いが低く抑えられる。すなわち、テキストモードで画像中のエッジが最も強調され、以下、風景モード、ポートレートモードの順でエッジの強調の度合いが抑えられる。
【0058】
このように、デジタルカメラ1では、指定された撮影モードに応じてコアリング処理部245のゲインの大小を変更することにより、エッジ成分の強弱を調整し、画像の解像感が調整される。
【0059】
<3. デジタルカメラの動作の概略>
次に、デジタルカメラ1の動作の概略について説明する。図10はデジタルカメラ1の動作の概略を示す図である。
【0060】
動作切替スイッチ14によりデジタルカメラ1の動作モードが「撮影」に設定されると、シャッタボタン8の半押しを待機する状態となる(ステップS11)。シャッタボタン8が半押しされると、半押しを示す信号が全体制御部211に入力され、全体制御部211によりAE演算(ステップS12)およびAF制御(ステップS13)が実行される。すなわち、シャッタボタン8により全体制御部211への撮影準備の指示が行われる。
【0061】
AE演算では、AE演算部211bにより露出時間および絞り値が求められ、AF制御では、AF制御部211aによりズームレンズ301が合焦状態とされる。その後、シャッタボタン8の全押しを待機する状態へと移行する(ステップS14)。
【0062】
シャッタボタン8が全押しされると、CCD303からの信号がデジタル信号に変換された後、画像メモリ207に画像データとして記憶される(ステップS15)。これにより、被写体の画像が取得される。
【0063】
撮影動作の終了後、または、シャッタボタン8の半押しの後に全押しされることがなかった場合(ステップS16)、最初の段階へと戻る。
【0064】
<4. オートフォーカス制御>
次に、AF制御部211aの構成およびAF制御について説明する。
【0065】
図11は図6に示すAF制御部211aの構成を周辺の構成とともに示すブロック図である。AF制御部211aは、画像処理部240から画像が入力されるヒストグラム生成回路251を有し、さらに、全体制御部211内のCPU261およびROM262がAF制御部211aとしての機能の一部を担う。
【0066】
ヒストグラム生成回路251は、画像中のエッジを検出し、エッジ幅のヒストグラムを生成する。ヒストグラム生成回路251の構成の詳細については後述する。
【0067】
CPU261は操作部250からの操作入力およびROM262内のプログラム262aに従って動作を行うことにより、オートフォーカス動作の一部を行うとともにAFモータ駆動回路204に制御信号を送出する。プログラム262aはデジタルカメラ1を製造した際にROM262に記憶されていてもよく、プログラムを記録した記録媒体としてメモリカード91を利用し、メモリカード91からROM262にプログラムが転送されてもよい。
【0068】
図12は、オートフォーカスの際のCPU261の機能を他の構成とともにブロックにて示す図である。図12において、ヒストグラム生成回路251にて生成されたヒストグラムからノイズ成分を除去するノイズ除去部263、ヒストグラムからフォーカスの程度を示す評価値を求めるヒストグラム評価部264、フォーカスレンズ311の位置を変更するためのAFモータM2の駆動量を求める駆動量決定部265、ヒストグラム評価部264からの評価値を用いてAFモータM2の駆動方向(すなわち、フォーカスレンズ311の駆動(移動)方向)を決定する駆動方向決定部266、光学系が合焦状態であるか否かを検出する合焦検出部267、AFモータM2への制御信号を生成してAFモータ駆動回路204に与える制御信号生成部268、および、操作部250からの使用者による指定入力に従って撮影モードを設定する撮影モード設定部269が、CPU261が演算処理を行うことにより実現される機能に相当する。レンズの駆動制御は実質的には駆動量決定部265、駆動方向決定部266および合焦検出部267により実行される。
【0069】
図13はヒストグラム生成回路251におけるエッジ検出の様子を説明するための図である。図13において横軸は水平方向に関する画素の位置に対応し、縦軸の上段は画素の輝度に対応する。縦軸の下段はエッジ幅の検出値に対応する。
【0070】
図13において左から右へとエッジの検出が行われる場合、隣接する画素の輝度差がしきい値Th1以下の場合には、エッジは存在しないと判定される。一方、輝度差がしきい値Th1を超える場合には、エッジの開始端が存在すると判定される。左から右へとしきい値Th1を超える輝度差が連続する場合、エッジ幅検出値が上昇する。
【0071】
エッジ開始端の検出後、輝度差がしきい値Th1以下になるとエッジの終端が存在すると判定される。このとき、エッジの開始端に相当する画素と終端に相当する画素との輝度の差がしきい値Th2以下の場合には、適切なエッジではないと判定され、しきい値Th2を超える場合には適切なエッジであると判定される。
【0072】
以上の処理を画像中の水平方向に並ぶ画素配列に対して行うことにより、画像中の水平方向のエッジの幅の値が検出される。
【0073】
図14は、ヒストグラム生成回路251の具体的構成を示す図であり、図15ないし図17はヒストグラム生成回路251の動作の流れを示す図である。以下、これらの図を参照しながらヒストグラムの生成についてさらに詳しく説明する。ただし、図18に示すように画像400の中央にオートフォーカスを行うための領域(以下、「AFエリア」という。)401が予め設定されているものとし、図19に示すようにAFエリア401内の座標(i,j)の画素の輝度をD(i,j)と表現する。
【0074】
画像処理部240から画像信号が入力されるヒストグラム生成回路251は、図14に示すように第1微分フィルタ271が設けられる左側の構造と第2微分フィルタ272が設けられる右側の構造とが対称となっており、画像中を左から右へと走査した際に、輝度の立上がりに対応するエッジが第1微分フィルタ271側の構成により検出され、輝度の立下がり対応するエッジが第2微分フィルタ272側の構成により検出される。
【0075】
ヒストグラム生成回路251では、まず、各種変数が初期化された後(ステップS101)、第1微分フィルタ271により隣接する画素間の輝度差(D(i+1,j)−D(i,j))が求められ、比較器273により輝度差がしきい値Th1を超えるか否かが確認される(ステップS102)。ここで、輝度差がしきい値Th1以下の場合には、エッジは存在しないものと判定される。
【0076】
一方、第2微分フィルタ272により隣接する画素間の輝度差(D(i,j)−D(i+1,j))も求められ、比較器273により輝度差がしきい値Th1を超えるか否かが確認される(ステップS105)。輝度差がしきい値Th1以下の場合には、エッジは存在しないものと判定される。
【0077】
その後、iを増加させつつステップS102およびステップS105が繰り返される(図17:ステップS121,S122)。
【0078】
ステップS102において、輝度差がしきい値Th1を超える場合には、エッジの開始端(輝度信号の立ち上がり)が検出されたものと判定され、第1微分フィルタ271側のエッジ幅カウンタ276によりエッジ幅を示すエッジ幅検出値C1(初期値0)がインクリメントされ、かつ、エッジ幅を検出中であることを示すフラグCF1が1にセットされる(ステップS103)。さらに、検出開始時の輝度がラッチ274に記憶される。
【0079】
以後、ステップS102において輝度差がしきい値Th1以下となるまでエッジ幅検出値C1が増加し(ステップS102,S103,S121,S122)、輝度差がしきい値Th1以下となると、フラグCF1が0にリセットされ、このときの輝度がラッチ275に記憶される(ステップS102,S104)。
【0080】
フラグCF1が0にリセットされると、ラッチ274およびラッチ275に記憶されている輝度の差Dd1が比較器277に与えられ、輝度差Dd1がしきい値Th2を超えるか否かが確認される(図16:ステップS111)。輝度差Dd1がしきい値Th2を超える場合には、適切なエッジが検出されたものと判定され、エッジ幅カウンタ276からエッジ幅検出値C1がヒストグラム生成部278に与えられ、エッジ幅がC1であるエッジの度数H[C1]がインクリメントされる(ステップS112)。これにより、エッジ幅がC1である1つのエッジの検出が完了する。
【0081】
その後、エッジ幅検出値C1が0にリセットされる(ステップS115,S116)。
【0082】
ステップS105において輝度差がしきい値Th1を超える場合も同様に、エッジの開始端(輝度信号の立ち下がり)が検出されたものと判定され、第2微分フィルタ272側のエッジ幅カウンタ276によりエッジ幅を示すエッジ幅検出値C2(初期値0)がインクリメントされ、かつ、エッジ幅を検出中であることを示すフラグCF2が1にセットされて検出開始時の輝度がラッチ274に記憶される(ステップS105,S106)。
【0083】
以後、ステップS105において輝度差がしきい値Th1以下となるまでエッジ幅検出値C2が増加し(ステップS105,S106,S121,S122)、輝度差がしきい値Th1以下となると、フラグCF2が0にリセットされ、このときの輝度がラッチ275に記憶される(ステップS105,S107)。
【0084】
フラグCF2が0にリセットされると、ラッチ274およびラッチ275に記憶されている輝度の差Dd2が比較器277に与えられ、輝度差Dd2がしきい値Th2を超えるか否かが確認される(ステップS113)。輝度差Dd2がしきい値Th2を超える場合には、ヒストグラム生成部278においてエッジ幅がC2であるエッジの度数H[C2]がインクリメントされ(ステップS114)、エッジ幅がC2である1つのエッジの検出が完了する。
【0085】
その後、エッジ幅検出値C2が0にリセットされる(ステップS117,S118)。
【0086】
以上のエッジ検出処理を繰り返し、変数iがAFエリア401外の値となると(正確には、(i+1)がAFエリア401外の値となると)、変数j以外が初期化されるとともに変数jがインクリメントされる(図17:ステップS122〜S124)。これにより、AFエリア401内の次の水平方向の画素配列に対してエッジ検出が行われる。水平方向のエッジ検出を繰り返し、やがて変数jがAFエリア401外の値になると、エッジ検出が終了する(ステップS125)。これにより、ヒストグラム生成部278にはエッジ幅と度数との関係を示すヒストグラムが生成される。
【0087】
図20ないし図22は、デジタルカメラ1におけるAF制御(図10:ステップS13)の全体の流れを示す図である。以下、図20ないし図22、並びに、図12を参照しながらオートフォーカスの際の動作について説明する。なお、以下の説明においてオートフォーカスの際に駆動されるフォーカスレンズ311を適宜、「レンズ」と略し、光学系が合焦状態となるフォーカスレンズ311の位置を「合焦位置」と呼ぶ。
【0088】
まず、制御信号生成部268の制御により、レンズが基準位置P2から所定量(例えば、4Fδ:Fは光学系のFナンバーであり、δはCCD303の画素間のピッチ(間隔)に対応する許容散乱円の直径であり、Fδは焦点深度に相当する。)だけ最近接側(最近接する被写体に焦点を合わせる位置側)の位置P1へと移動し、ノイズ除去部263およびヒストグラム評価部264がフォーカスの程度を示す評価値を求め、駆動方向決定部266へと出力する(ステップS201)。
【0089】
ヒストグラム評価部264では、ヒストグラム生成回路251により作成されたエッジ幅のヒストグラムの代表値に対応するエッジ幅が評価値として求められる。ヒストグラムの代表値としては、デジタルカメラ1ではヒストグラムの重心に対応するエッジ幅(以下、「重心エッジ幅」という。)Vewが利用される。ヒストグラムの代表値としては他の統計学的値が利用されてもよく、例えば、最大度数に対応するエッジ幅、エッジ幅のメジアン等が利用可能である。
【0090】
図23は、ノイズ除去部263およびヒストグラム評価部264が重心エッジ幅を求める処理の詳細を示す流れ図である。また、図24および図25はノイズ除去部263の動作の様子を説明するための図である。
【0091】
ノイズ除去部263によるノイズの除去では、まず、ヒストグラムからエッジ幅が1(すなわち、1画素)の部分が削除される(ステップS301)。図24に示すようにヒストグラム410はエッジ幅が1の部分411が突出した形状となっている。これは、AFエリア401中の高周波ノイズが幅1のエッジとして検出されるためである。したがって、エッジ幅が1の部分411を削除することにより、重心エッジ幅の精度向上が実現される。
【0092】
次に、ヒストグラム410において度数が所定値Th3以下の部分412,413が削除される(ステップS302)。ヒストグラム410において度数が低い部分は、一般に主被写体像以外のエッジを多く含むためである。換言すれば、ヒストグラムから度数が所定値よりも高い部分が抽出される。
【0093】
さらに、図25に示すように、度数が最大となるエッジ幅Eが検出され(ステップS303)、エッジ幅Eを中心として所定範囲内(図25においてエッジ幅が(E−E1)から(E+E1)の範囲内)の部分を抽出した新たなヒストグラム414が求められる(ステップS304)。なお、図24および図25では図示されていないが、ヒストグラムの形状によっては図24において削除される部分412,413は図25において削除される部分に必ず含まれるとは限らない。そこで、ステップS302の後にさらにステップS304が実行される。
【0094】
ステップS304における抽出範囲の中心となるエッジ幅Eは、ステップS302後のヒストグラムの重心に対応するエッジ幅であってもよい。処理を簡略化するために、単に、所定値以下のエッジ幅の部分、あるいは、所定値以上のエッジ幅の部分をヒストグラムから除去するという手法が採用されてもよい。主被写体像のエッジ(すなわち、背景像から導かれるノイズ成分を含まないエッジ)の幅は所定の範囲内に通常収まることから、このような簡略化された処理であっても主被写体像におよそ対応するヒストグラムが求められる。
【0095】
そして、ステップS304で求められた、ヒストグラムの重心に対応するエッジ幅を重心エッジ幅Vewとして求める(ステップS305)。
【0096】
図20中のステップS201においてレンズが位置P1に位置する際の重心エッジ幅Vew1が求められると、続いて、レンズが基準位置P2へと戻って重心エッジ幅Vew2が求められ(ステップS202)、さらに無限遠側(無限遠の被写体に焦点を合わせる位置側)へと所定量(例えば、4Fδ)だけ移動した位置P3にて重心エッジ幅Vew3が求められる(ステップS203)。
【0097】
ここで、画像から検出されるエッジの幅はレンズが合焦位置に近づくほど小さくなり、重心エッジ幅Vewも小さな値となることから、駆動方向決定部266では、重心エッジ幅Vew1,Vew2,Vew3が条件(Vew1≦Vew2≦Vew3)を満たすか否かを確認し(ステップS204)、満たされる場合には駆動方向を最近接側に向かう方向に決定し、満たされない場合には駆動方向を無限遠側に向かう方向に決定する(ステップS205,S206)。
【0098】
次に、レンズが位置P3に位置する状態にてヒストグラム生成回路251により検出されたエッジの個数(以下、「エッジ数」という。)Venがヒストグラム評価部264により取得される(図21:ステップS211)。
【0099】
取得されたエッジ数Venが0の場合、駆動量決定部265により駆動量(レンズの移動量)が16Fδに設定され(ステップS212、S213)、エッジ数Venが0ではないが所定値(例えば、20)以下の場合にはレンズの移動量が12Fδに設定される(ステップS214、S215)。
【0100】
ステップS213またはステップS215が実行された場合には、設定された駆動方向に設定された移動量だけレンズが移動し(ステップS216)、ステップS211へと戻る。そして、移動量の設定およびレンズ移動、並びに、エッジ数Venの算出が繰り返されることにより、エッジ数Venが所定値を超えるレンズ位置(以下、「位置L1」と呼ぶ。)までレンズが移動する。
【0101】
このように、AF制御部211aではエッジ数Venを用いてレンズの駆動量を決定するようになっている。なぜならば、エッジ数はフォーカスの程度を示す評価値として利用することができる値であり、フォーカスの程度が低い、すなわち、合焦位置からレンズが遠く離れているほど、1回の駆動でレンズを大きく移動させることが許容されるからである。
【0102】
図26は、エッジ数Venがフォーカスに関する評価値として利用可能であることを説明するための図である。図26において横軸はレンズの位置に対応し、縦軸は検出されるエッジの総数(すなわち、エッジ数Ven)に対応する。図26においてレンズ位置が4の場合にレンズが合焦位置に位置する。このとき、エッジ数は最大となる。そして、レンズ位置が合焦位置から離れるほどエッジ数が減少する。このようにエッジ数はフォーカスの程度を示す評価値として利用することができる。
【0103】
デジタルカメラ1の場合、予め実験により、エッジ数Venが0である場合に16Fδ、エッジ数Venが所定値(例えば、20)以下の場合には12Fδだけレンズを移動させてもレンズが合焦位置を通り過ぎないことが確認されている。以上の理由により、図21に示すステップS211〜S216によるレンズの駆動制御が行われる。
【0104】
位置L1が定まるとステップS217において、ヒストグラム評価部264により位置L1における重心エッジ幅Vew21が求められる。その後、重心エッジ幅Vew21が駆動量決定部265に記憶されるとともに設定された駆動方向に予め定められた移動量だけレンズが大きく駆動される(ステップS218)。移動後の位置(以下、「位置L2」と呼ぶ。)では、重心エッジ幅Vew22が再度求められ、駆動量決定部265に転送される(ステップS219)。
【0105】
次に、駆動量決定部265が撮影モード設定部269により予め設定されている撮影モードを取得する(図22:ステップS221)。駆動量決定部265は、指定された撮影モードがポートレートモードであれば合焦位置の算出に利用する基準エッジ幅VewfをPort(画素数5)に設定し(ステップS222、S223)、風景モードであれば基準エッジ幅VewfをScene(画素数4)に設定し(ステップS224、S225)、テキストモードであれば基準エッジ幅VewfをText(画素数3)に設定する(ステップS226、S227)。
【0106】
その後、位置L1,L2、並びに、重心エッジ幅Vew21,Vew22および基準エッジ幅Vewfを用いて後述の手法によりおよその合焦位置が求められる(ステップS228)。すなわち、合焦位置が推測される。レンズは求められた合焦位置へと速やかに移動される(ステップS229)。
【0107】
さらに、ヒストグラム評価部264が重心エッジ幅Vewを求めつつレンズが微振動され、合焦検出部267および駆動量決定部265の制御の下、重心エッジ幅Vewが最小となるようにレンズ位置が微調整される(ステップS230)。これにより、レンズが合焦位置に正確に位置する。
【0108】
次に、ステップS228にて合焦位置を算出する原理および手法の詳細について説明する。
【0109】
図27は、レンズが合焦位置に近づくにつれてエッジ幅のヒストグラムが変化する様子を示す図である。符号421はレンズが合焦位置から大きく離れている場合のヒストグラムを示し、符号422はヒストグラム421の場合よりもレンズが合焦位置に近い場合のヒストグラムを示す。符号423はレンズが合焦位置に位置する場合の重心エッジ幅を示す。また、符号Vew11,Vew12はそれぞれ、ヒストグラム421,422の重心エッジ幅である。
【0110】
図27に示すように、重心エッジ幅Vewはレンズが合焦位置に近づくにつれて小さくなる。重心エッジ幅Vewの最小値は、光学系のMTF(Modulation Transfer Function:光学系が空間周波数に対して像のコントラストをどの程度再現することができるのかを示す指標値)、被写体等によって若干変化するが、同一の撮影モードにおいては、画像の空間周波数特性がおおよそ定まるため、レンズが合焦位置に位置する際の最小の重心エッジ幅Vewを一定の値とみなすことが可能である。ステップS222〜S227にて設定される基準エッジ幅Vewfは、一定値とみなすことができる最小の重心エッジ幅Vew(すなわち、レンズが合焦位置に位置する際の評価値)に相当する。
【0111】
図28は、レンズ位置と重心エッジ幅との関係を示す図であり、レンズ位置L1,L2に対応する重心エッジ幅がVew21,Vew22であり、合焦位置Lfに対応する基準エッジ幅がVewfである。図28に示すように、一般に、レンズ位置と重心エッジ幅とは線形の関係にあるとみなすことができる。したがって、レンズ位置L1,L2に対応する重心エッジ幅Vew21,Vew22が求められると、基準エッジ幅Vewfを利用して数1により合焦位置Lfを求めることができる。
【0112】
【数1】

Figure 0003555584
【0113】
なお、重心エッジ幅に代えて、エッジ幅の平均値、ヒストグラムのピークに対応するエッジ幅、メジアン等の統計学的値を合焦位置を求める際に利用することも可能である。
【0114】
また、図28に示す手法では、少なくとも2つのレンズ位置において重心エッジ幅を求めることにより合焦位置Lfを求めることが可能であるが、より精度を高めるために、各レンズ位置L1,L2から所定距離aFδだけ前後の位置(L1±aFδ),(L2±aFδ)での重心エッジ幅を用いてレンズ位置L1,L2における重心エッジ幅の精度が高められてもよい。具体的には、位置(L1−aFδ),L1,(L1+aFδ)における重心エッジ幅がVew31,Vew32,Vew33である場合には、数2によりこれらの値にローパスフィルタを作用させた値Vew3がレンズ位置L1の重心エッジ幅として求められる。
【0115】
【数2】
Figure 0003555584
【0116】
同様に、位置(L2−aFδ),L2,(L2+aFδ)における重心エッジ幅がVew41,Vew42,Vew43である場合には、数3により値Vew4がレンズ位置L2の重心エッジ幅として求められる。
【0117】
【数3】
Figure 0003555584
【0118】
もちろん、3以上の任意のレンズ位置にて重心エッジ幅を求め、最小二乗法を用いてレンズ位置と重心エッジ幅との関係を示す直線が求められてもよい。
【0119】
図29は、光学系を合焦状態とし、同一の被写体を異なる撮影モードで撮影した際に得られるエッジ幅のヒストグラムを例示する図である。図29においてヒストグラム431,432,433はそれぞれテキストモード、風景モード、ポートレートモードにおける合焦時のヒストグラムを示している。
【0120】
図9に示すようにコアリング処理部245ではテキストモードの場合に最も画像の高周波成分が強調され、ポートレートモードの場合には高周波成分の強調の度合いが最も抑えられる。したがって、テキストモードではエッジの幅が全体的に小さくなり、ポートレートモードではエッジの幅が全体的に大きくなる。その結果、合焦時の重心エッジ幅Vewはテキストモードの場合に最も小さくなり、ポートレートモードの場合に最も大きくなる。
【0121】
このような理由により、ステップS222〜S227にて設定される基準エッジ幅Vewfは、テキストモードにおいて最も小さく設定され、ポートレートモードにおいて最も大きく設定される。すなわち、画像に施される処理における高周波成分のゲイン設定に応じて基準エッジ幅Vewfが変更される。
【0122】
以上のように、デジタルカメラ1におけるAF制御では、第1の位置L1および第2の位置L2にて重心エッジ幅Vewが求められ、2つの重心エッジ幅および基準エッジ幅から合焦位置が求められる。したがって、フォーカスレンズ311を迅速に合焦位置へと移動させることができる。そして、合焦位置の算出の際に用いられる基準エッジ幅Vewfが撮影モードに応じて変更されるため、撮影モードに応じて適切な合焦位置の算出が行われる。その結果、AF制御を迅速かつ適切に行うことができる。また、重心エッジ幅を用いつつ微調整も行われるため、最終的にはレンズは合焦位置へと正確に位置する。
【0123】
なお、正確には、2つの重心エッジ幅および基準エッジ幅とともに第1および第2の位置L1,L2が合焦位置の算出に利用されるが、第1および第2の位置L1,L2は予め定められてデジタルカメラ1内に準備されてもよい。
【0124】
<5. 変形例>
以上、本発明の一の実施の形態について説明してきたが、本発明は上記実施の形態に限定されるものではなく様々な変形が可能である。
【0125】
例えば、上記実施の形態では、光学系を有する撮像部3と、光学系を制御するカメラ本体部2とが分離可能となっており、カメラ本体部2が光学系に対する制御装置となっているが、光学系と制御系とを一体的に有するデジタルカメラであってもよい。また、光学系と制御装置とをケーブルを用いて接続した構成であってもよい。この場合、制御装置としては汎用のコンピュータが利用されてもよく、コンピュータには光ディスク、磁気ディスク、光磁気ディスク等の記録媒体を介して予め光学系制御用のプログラムがインストールされる。
【0126】
デジタルカメラ1では、図8に示すようにAF制御部211aにおける処理が、専用の回路による処理とCPUによるソフトウェア的処理とに分担されているが、全てCPUにより実行することも可能である。この場合、プログラムをCPUが実行することにより上記実施の形態にて説明したAF制御の全てが実行されることとなる。逆に、AF制御部211aにおける処理の全てを専用の回路により実現することも可能である。
【0127】
上記実施の形態におけるエッジ検出処理は一例にすぎず、他の手法によりエッジが検出されてもよい。また、上記実施の形態におけるエッジ検出は水平方向に対してのみ行われるが、垂直方向に対してエッジが検出されてもよく、双方向からエッジ検出が行われてもよい。
【0128】
上記実施の形態では、重心エッジ幅Vewを評価値として用いてレンズの駆動方向が決定される。しかしながら、重心エッジ幅Vewに代えてコントラストを用いてレンズの駆動方向を決定することも可能である。同様に、レンズを合焦位置に正確に合わせる際も重心エッジ幅Vewに代えてコントラストを利用することが可能である。
【0129】
また、一般に、フォーカスの程度を示す高度な評価値をエッジから求めるためにはエッジ幅のヒストグラムが求められ、ヒストグラムの代表値が評価値として利用されることが好ましい。ヒストグラムの代表値は演算技術を考慮した場合、統計学的値として与えられることが好ましく、統計学的値としては平均値、メジアン、ピークに相当するエッジ幅等も利用可能である。デジタルカメラ1では、評価値の信頼性および演算量を比較考慮し、ヒストグラムの重心に対応するエッジ幅(すなわち、エッジ幅の平均値)が代表値として利用される。
【0130】
さらに、エッジに関する評価値としてはさらに他のものも利用可能であり、例えば、基準エッジ幅に近い幅3,4程度のエッジの度数が単純に評価値として利用されてもよく、基準エッジ幅を含む所定のエッジ幅の範囲内におけるエッジの度数が全度数に占める割合を評価値として利用することも可能である。この場合、度数が高いほどフォーカスの程度が高くなり、合焦位置の算出に用いられる基準値は基準エッジ幅に代えて合焦時の幅3,4程度のエッジの度数となる。このように、評価値および基準値としては、重心エッジ幅および基準エッジ幅以外のものが利用されてもよい。
【0131】
なお、基準値は合焦時の評価値に厳密に一致している必要はなく、合焦時の評価値とみなすことができる値、あるいは、合焦時の評価値に近い値とされてもよい。
【0132】
デジタルカメラ1では、フォーカスレンズの位置を制御することによりAF制御が行われるため、レンズ位置という言葉を用いてAF制御を説明したが、複数のレンズを駆動してAF制御を行う場合であっても上記実施の形態に係るAF制御を利用することができる。すなわち、上記実施の形態におけるレンズ位置は、少なくとも1つのレンズの配置に対応付けることが可能である。
【0133】
撮像のための少なくとも1つのレンズもズームレンズでなくてもよく、フォーカスの調整が可能な光学系であればよい。
【0134】
また、デジタルカメラ1では、オートフォーカス用の評価値を求めるために画像処理部240のアパーチャコンバータ処理部244から画像信号を全体制御部211に入力するが、他の部分から全体制御部211に入力されてもよい。例えば、黒レベル補正回路241からの画像信号がAF制御部211aへと入力されてもよい。この場合、ポートレートモードではテキストモードよりもレンズが合焦位置から外れることとなるが、ポートレートモードではレンズを合焦位置に正確に位置する必要がないため問題は生じない。
【0135】
また、上記実施の形態では、合焦位置を予測する演算においてポートレートモード、風景モード、テキストモードの基準エッジ幅Vewfをそれぞれ画素数5、4、3として演算しているが、この数値に限られるものではない。デジタルカメラ1の撮影モードもポートレートモード、風景モード、テキストモードに限られるものではなく、撮影の状況に合わせて他のモードを有していてもよい。その場合には、追加される撮影モードに合わせて基準エッジ幅Vewfが予め準備される。
【0136】
また、上記実施の形態における第1の位置L1と第2の位置L2との間の距離は、予め一定の値に定められていてもよいが、位置L1におけるエッジ数Venや重心エッジ幅Vewに応じて変更されてもよい。すなわち、合焦位置の推測を適切に行うためにこれらの評価値が示すフォーカスの程度が低いほど、位置L1と位置L2との間の距離が大きく設定されてもよい。
【0137】
上記実施の形態では、エッジを利用することにより高速なAF制御を実現するため静止画像の取得に特に適しているが、上記実施の形態における様々な技術は動画像の取得に応用することもでき、様々なデジタル撮像装置に利用することができる。
【0138】
【発明の効果】
請求項1ないしの発明では、評価値としてヒストグラムの重心に対応するエッジ幅を用い、撮影モードに応じて、レンズが合焦位置に位置すると推測される際の評価値としての基準値を設定することにより、撮影モードに応じた適切なオートフォーカス制御を迅速に行うことができる。
【0139】
請求項2の発明では、撮影モードに応じて変更されるゲイン設定に基づいて基準値を変更することにより、適切なオートフォーカス制御を行うことができる。
【0141】
請求項4ないし6の発明では、各種撮影モードに応じて適切なAF制御を行うことができる。
【図面の簡単な説明】
【図1】デジタルカメラの正面図である。
【図2】デジタルカメラの背面図である。
【図3】デジタルカメラの側面図である。
【図4】デジタルカメラの底面図である。
【図5】撮像部の内部構成を示す図である。
【図6】デジタルカメラの構成を示すブロック図である。
【図7】画像処理部の構成を示すブロック図である。
【図8】アパーチャコンバータ処理部の構成を示すブロック図である。
【図9】コアリング処理部における入力と出力の関係を示す図である。
【図10】デジタルカメラの動作の概略を示す流れ図である。
【図11】AF制御部の構成を示すブロック図である。
【図12】AF制御部の機能構成を示すブロック図である。
【図13】エッジ検出の様子を説明するための図である。
【図14】ヒストグラム生成回路の構成を示すブロック図である。
【図15】ヒストグラム生成の流れを示す図である。
【図16】ヒストグラム生成の流れを示す図である。
【図17】ヒストグラム生成の流れを示す図である。
【図18】AFエリアを示す図である。
【図19】AFエリアの画素配列を示す図である。
【図20】AF制御の流れを示す図である。
【図21】AF制御の流れを示す図である。
【図22】AF制御の流れを示す図である。
【図23】重心エッジ幅の算出の流れを示す図である。
【図24】ヒストグラムからノイズ成分を除去する様子を示す図である。
【図25】ヒストグラムからノイズ成分を除去する様子を示す図である。
【図26】レンズ位置とエッジ数との関係を示す図である。
【図27】レンズ位置の変化によるヒストグラムの変化を示す図である。
【図28】レンズ位置と重心エッジ幅との関係を示す図である。
【図29】撮影モード毎のヒストグラムを示す図である。
【符号の説明】
1 デジタルカメラ
2 カメラ本体部
91 メモリカード
204 AFモータ駆動回路
250 操作部
251 ヒストグラム生成回路
261 CPU
262 ROM
262a プログラム
264 ヒストグラム評価部
265 駆動量決定部
268 制御信号生成部
269 撮影モード設定部
301 ズームレンズ
303 CCD
311 フォーカスレンズ
S211〜S219,S221〜S229 ステップ[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to an autofocus technique for acquiring an image as digital data.
[0002]
[Prior art]
2. Description of the Related Art Conventionally, in an imaging apparatus such as a digital still camera or a video camera that acquires an image using an imaging device such as a CCD (Charge Coupled Device), an edge is detected from the image, and a focus lens of a focus lens is detected from a histogram of the width of the edge. Techniques for estimating the in-focus position have been proposed.
[0003]
For example, Japanese Patent Application Laid-Open No. 5-219418 related to a video camera utilizes a principle that an edge width corresponding to the center of gravity of a histogram becomes a predetermined value when an optical system is in focus, and a plurality of positions of a focus lens are used. Is obtained, and the in-focus position of the focus lens is predicted from a plurality of histograms. Such a method has a feature that the focus position of the focus lens can be quickly obtained.
[0004]
[Problems to be solved by the invention]
On the other hand, in a digital still camera, a plurality of shooting modes are provided according to an image processing method, and a processing effect corresponding to a subject is given by selectively using the shooting modes. For example, a shooting mode is provided according to a subject such as a person, a landscape, or a text, and the resolution is changed for each characteristic of the subject.
[0005]
However, when the shooting mode is changed, the sharpness is changed by the image processing, so that the width of the edge of the subject in the image changes. Therefore, in the case of the autofocus using the width of the edge as described above, there has been a problem that it is difficult to appropriately execute it.
[0006]
SUMMARY OF THE INVENTION The present invention has been made in view of the above problems, and performs autofocus control (hereinafter, abbreviated as "AF control" as appropriate) using the width of an edge detected from an image quickly and appropriately while taking a shooting mode into consideration. The main purpose is to do.
[0007]
[Means for Solving the Problems]
The invention according to claim 1 is a digital imaging apparatus, comprising: an optical system capable of adjusting a focus; an imaging unit configured to acquire an image of a subject as digital data via the optical system; Detect and width of said edgeThe edge width corresponding to the representative value of the histogram ofEvaluation value indicating the degree of focusAsCalculating means for obtaining, specifying means for receiving designation of one shooting mode from a plurality of shooting modes, andThe evaluation value when the lens of the optical system is presumed to be located at the in-focus position.Setting means for setting a reference value;NoteA first evaluation value when the lens is located at the first position, a second evaluation value when the lens is located at the second position, and the in-focus position of the lens from the reference value.Calculated, calculatedControl means for moving the lens to a focus position.
[0008]
The invention according to claim 2 is the digital imaging device according to claim 1, wherein the setting unit changes the reference value according to a gain setting of a high-frequency component in a process performed on the image.
[0009]
The invention described in claim 3 is the claimIn oneA digital imaging device according to claim 1,Means for setting different degrees of emphasis in accordance with the plurality of shooting modes, and means for emphasizing high-frequency components of the image according to the degree of emphasis, wherein the evaluation value is based on the image in which the high-frequency components are emphasized. Required.
[0010]
The invention described in claim 4 is the claim.Any of 1 to 33. The digital imaging device according to item 1, wherein the plurality of shooting modes include a portrait mode, and a reference value set in the portrait mode is larger than a reference value set in another shooting mode.
[0011]
The invention described in claim 5 is the claimAny of 1 to 43. The digital imaging device according to item 1, wherein the plurality of shooting modes include a text mode, and a reference value set in the text mode is smaller than a reference value set in another shooting mode.
[0012]
The invention according to claim 6 is the digital imaging device according to claim 5, wherein the plurality of shooting modes include a portrait mode, a landscape mode, and a text mode.
[0013]
The invention according to claim 7 is a recording medium that stores a program for controlling an optical system when acquiring an image as digital data, wherein the execution of the program by the control device is performed by the control device. Locating a lens of the system at a first position; detecting edges of the image;The edge width corresponding to the representative value of the histogram ofIndicates the degree of focusCalculated as an evaluation value,First evaluation valueTo beLocating a lens of the optical system at a second position; detecting an edge of the image;Determine the edge width corresponding to the representative value of the histogram as the evaluation value,Second evaluation valueTo beDepending on the process and one shooting mode specified from multiple shooting modes, When the lens is estimated to be located at the in-focus position,Setting a reference value; and determining a focus position of the lens from the first evaluation value, the second evaluation value, and the reference value.calculateProcess andCalculatedMoving the lens to the in-focus position.
The invention according to claim 8 is the recording medium according to claim 7, wherein the execution of the program by the control device sets different degrees of emphasis in the control device according to the plurality of shooting modes. And a step of enhancing a high-frequency component of the image according to the degree of enhancement, and the evaluation value is obtained based on the image in which the high-frequency component is enhanced.
[0014]
BEST MODE FOR CARRYING OUT THE INVENTION
<1. Digital Camera Configuration>
1 to 4 are views showing an example of an external configuration of a digital still camera (hereinafter, referred to as a "digital camera") 1 for acquiring a still image as digital data. FIG. 1 is a front view, and FIG. FIG. 3 is a side view, and FIG. 4 is a bottom view.
[0015]
As shown in FIG. 1, the digital camera 1 includes a box-shaped camera body 2 and a rectangular parallelepiped imaging unit 3.
[0016]
A zoom lens 301 with a macro function, which is a photographing lens, is provided on the front side of the imaging unit 3, and a dimming sensor 305 for receiving reflected light of flash light from a subject and an optical system similar to a silver halide shutter camera. A finder 31 is provided.
[0017]
On the front side of the camera body 2, a grip 4 is provided at the left end, an IRDA (Infrared Data Association) interface 236 for performing infrared communication with an external device is provided above the grip 4, and a built-in flash 5 is provided at the upper center. The shutter button 8 is provided on the upper surface side. The shutter button 8 is a two-stage switch capable of detecting a half-pressed state and a fully-pressed state as employed in a silver halide camera.
[0018]
On the other hand, as shown in FIG. 2, a liquid crystal display (LCD: Liquid) for displaying a captured image on a monitor (corresponding to a viewfinder), reproducing and displaying a recorded image, etc., is provided substantially at the center on the rear side of the camera body 2. (Crystal Display) 10 is provided. Further, below the LCD 10, key switches 221 to 226 for operating the digital camera 1 and a power switch 227 are provided. In the digital camera 1, by appropriately operating the key switch groups 221 to 226, designation of one shooting mode suitable for shooting from a plurality of shooting modes is received. The plurality of shooting modes include a portrait mode, a landscape mode, a text mode, and the like. On the left side of the power switch 227, an LED 228 that lights up when the power is on and an LED 229 that indicates that the memory card is being accessed are arranged.
[0019]
Further, on the back side of the camera body 2, an operation changeover switch 14 for switching the operation mode of the camera between "shooting" and "playback" is provided. When the operation mode is set to “shooting”, it is possible to take a picture and generate an image related to the subject, and when the operation mode is set to “playback”, the image recorded on the memory card is read out. Is reproduced on the LCD 10.
[0020]
The operation changeover switch 14 is a two-contact slide switch. When the slide switch is set to the lower position, the operation mode is set to "shooting", and when the slide switch is set to the upper position, the operation mode is set to "play".
[0021]
Further, on the right side of the back of the camera, a quad switch 230 is provided. When the operation mode is “shooting”, the zooming magnification is changed by pressing the buttons 231 and 232, and by pressing the buttons 233 and 234. Exposure compensation is performed.
[0022]
As shown in FIG. 2, an LCD button 321 for turning on / off the LCD 10 and a macro button 322 are provided on the rear surface of the imaging unit 3. When the LCD button 321 is pressed, on / off of the LCD display is switched. For example, when photographing is performed using only the optical viewfinder 31, the LCD display is turned off for the purpose of saving power. At the time of macro shooting (close-up shooting), pressing the macro button 322 causes the imaging unit 3 to be in a state where macro shooting is possible.
[0023]
As shown in FIG. 3, a terminal unit 235 is provided on a side surface of the camera body 2, and the terminal unit 235 outputs a DC input terminal 235a and contents displayed on the LCD 10 to an external video monitor. And a video output terminal 235b.
[0024]
As shown in FIG. 4, a battery loading chamber 18 and a card slot (card loading chamber) 17 are provided on the bottom surface of the camera body 2. The card slot 17 is for loading a detachable memory card 91 or the like for recording a captured image or the like. The card slot 17 and the battery loading chamber 18 can be opened and closed by a clamshell type lid 15. In this digital camera 1, four AA batteries are loaded into the battery loading chamber 18, and a power supply battery connected in series is used as a driving source. In addition, by attaching an adapter to the DC input terminal 235a shown in FIG. 3, it is also possible to supply power from the outside and use it.
[0025]
<2. Internal structure of digital camera>
Next, the configuration of the digital camera 1 will be described in more detail. FIG. 5 is a diagram schematically illustrating an arrangement of each component in the imaging unit 3. FIG. 6 is a block diagram showing a configuration of the digital camera 1.
[0026]
As shown in FIG. 5, an image pickup circuit including a CCD 303 is provided at an appropriate position behind the zoom lens 301 in the image pickup section 3. Further, inside the imaging unit 3, a zoom motor M1 for changing the zoom ratio of the zoom lens 301 and moving the lens between the accommodation position and the imaging position, and a zoom motor M1 for automatically focusing are provided. An autofocus motor (AF motor) M2 for moving the focus lens 311 and an aperture motor M3 for adjusting the aperture diameter of the aperture 302 provided in the zoom lens 301 are provided.
[0027]
As shown in FIG. 6, the zoom motor M1, the AF motor M2, and the aperture motor M3 are driven by a zoom motor drive circuit 203, an AF motor drive circuit 204, and an aperture motor drive circuit 205 provided in the camera body 2, respectively. . Each of the driving circuits 203 to 205 drives each of the motors M1 to M3 based on a control signal given from the overall control unit 211 of the camera body 2.
[0028]
The CCD 303 converts the light image of the subject formed by the zoom lens 301 into image signals of R (red), G (green), and B (blue) color components (from a signal train of pixel signals received by each pixel). ) And output.
[0029]
The exposure control in the imaging unit 3 is performed by adjusting the aperture 302 and adjusting the exposure amount of the CCD 303, that is, the charge accumulation time of the CCD 303 corresponding to the shutter speed. If an appropriate aperture and shutter speed cannot be set due to a low contrast of the subject, an improper exposure due to insufficient exposure is corrected by adjusting the level of an image signal output from the CCD 303. That is, at the time of low contrast, control is performed so that the exposure level becomes an appropriate level by combining the aperture, the shutter speed, and the gain adjustment. Note that the level adjustment of the image signal is performed by adjusting the gain of an AGC (Auto Gain Control) circuit 313b in the signal processing circuit 313.
[0030]
The timing generator 314 generates a drive control signal for the CCD 303 based on the reference clock transmitted from the timing control circuit 202 of the camera body 2. The timing generator 314 generates clock signals such as integration start / end (exposure start / end) timing signals and light-receiving signal readout control signals (horizontal synchronization signal, vertical synchronization signal, transfer signal, etc.) for each pixel. , To the CCD 303.
[0031]
The signal processing circuit 313 performs predetermined analog signal processing on an image signal (analog signal) output from the CCD 303. The signal processing circuit 313 includes a CDS (correlated double sampling) circuit 313a and an AGC circuit 313b. The noise of the image signal is reduced by the CDS circuit 313a, and the gain of the image signal is adjusted by the AGC circuit 313b. Perform level adjustment.
[0032]
The dimming circuit 304 controls the light emission amount of the built-in flash 5 during flash photography to a predetermined light emission amount set by the overall control unit 211. At the time of flash photography, the reflected light of the flash light from the subject is received by the light control sensor 305 at the same time as the start of exposure, and when the amount of received light reaches a predetermined light emission amount, the light control circuit 304 outputs a light emission stop signal. The flash stop signal is guided to the flash control circuit 206 via the overall control unit 211 provided in the camera body 2, and the flash control circuit 206 forcibly stops the flash of the built-in flash 5 in response to the flash stop signal. Thus, the light emission amount of the built-in flash 5 is controlled to a predetermined light emission amount.
[0033]
Next, the blocks of the camera body 2 will be described.
[0034]
In the camera body 2, the A / D converter 201 converts a signal of each pixel of an image into a digital signal of, for example, 10 bits. The A / D converter 201 converts each pixel signal (analog signal) into a 10-bit digital signal based on an A / D conversion clock input from the timing control circuit 202.
[0035]
The timing control circuit 202 is configured to generate a reference clock, a timing generator 314, and a clock for the A / D converter 201. The timing control circuit 202 is controlled by an overall control unit 211 including a CPU (Central Processing Unit).
[0036]
FIG. 7 is a block diagram illustrating a configuration of the image processing unit 240 to which a signal from the A / D converter 201 is input. The black level correction circuit 241 corrects the black level of the A / D converted image to a predetermined reference level. The WB (white balance) circuit 242 performs level conversion of each color component of R, G, and B of the pixel so that the white balance is also adjusted after the γ correction. The WB circuit 242 converts the levels of the R, G, and B color components of the pixel using the level conversion table input from the overall control unit 211. The conversion coefficient (gradient of the characteristic) of each color component in the level conversion table is set by the overall control unit 211 for each captured image.
[0037]
The γ correction circuit 243 corrects γ characteristics of an image. The aperture converter processing unit 244 is a compensation circuit that compensates for the aperture effect, and has a coring processing unit 245, and enhances high-frequency components while removing noise of the image to enhance the resolution of the image. I do.
[0038]
The image memory 207 is a memory for storing image data output from the image processing unit 240. The image memory 207 has a storage capacity for one frame. That is, when the CCD 303 has n rows and m columns of pixels, the image memory 207 has a storage capacity for data of n × m pixels, and the data of each pixel is stored at a corresponding address. The processed data from the image processing unit 240 is also input to the overall control unit 211 for AF control.
[0039]
A VRAM (video RAM) 208 shown in FIG. 6 is a buffer memory for images reproduced and displayed on the LCD 10. The VRAM 208 has a storage capacity capable of storing image data corresponding to the number of pixels of the LCD 10.
[0040]
In the shooting standby state when the operation mode is “shooting”, the live view display is performed on the LCD 10 when the LCD display is turned on by the LCD button 321 (see FIG. 2). Specifically, the A / D converter 201 and the image processing unit 240 perform various kinds of signal processing on each image obtained at predetermined intervals from the imaging unit 3, and then the overall control unit 211 By acquiring the image stored in the VRAM 208 and transferring it to the VRAM 208, the captured image is displayed on the LCD 10. Then, the live view display is performed by updating the image displayed on the LCD 10 every predetermined time. With the live view display, the photographer can visually recognize the subject from the image displayed on the LCD 10. When an image is displayed on the LCD 10, the backlight 16 is turned on under the control of the overall control unit 211.
[0041]
When the operation mode is “playback”, the image read from the memory card 91 is subjected to predetermined signal processing by the overall control unit 211, transferred to the VRAM 208, and played back and displayed on the LCD 10.
[0042]
The flash control circuit 206 is a circuit for controlling the light emission of the built-in flash 5. The flash control circuit 206 makes the built-in flash 5 emit light based on a control signal from the overall control unit 211, and also controls the built-in flash 5 based on the light emission stop signal described above. Turn off the light emission.
[0043]
An RTC (real-time clock) circuit 209 is a clock circuit for managing shooting date and time.
[0044]
The card interface 210 is an interface for writing and reading an image to and from the memory card 91 via the card slot 17.
[0045]
Further, an IRDA interface 236 is connected to the overall control unit 211, and infrared wireless communication with an external device such as the computer 500 or another digital camera can be performed via the IRDA interface 236 to perform wireless transfer of images and the like. ing.
[0046]
The operation unit 250 includes the various switches and buttons described above, and information input by the user is transmitted to the overall control unit 211 via the operation unit 250.
[0047]
The general control unit 211 organically controls the driving of each member in the image capturing unit 3 and the camera main unit 2, and controls the overall operation of the digital camera 1.
[0048]
The overall control unit 211 includes an AF (autofocus) control unit 211a that performs operation control for efficiently performing automatic focusing, and an AE (autoexposure) calculation unit 211b that performs automatic exposure. ing.
[0049]
An image output from the image processing unit 240 is input to the AF control unit 211a, an evaluation value for use in autofocus is obtained, and each unit is controlled using the evaluation value, thereby forming an image by the zoom lens 301. The position of the image is made to coincide with the imaging surface of the CCD 303.
[0050]
Although not shown, an image output from the black level correction circuit 241 of the image processing unit 240 is input to the AE calculation unit 211b, and an appropriate value of the shutter speed and the aperture 302 is determined based on a predetermined program. Calculate. The AE calculation unit 211b calculates an appropriate value of the shutter speed and the aperture value 302 according to a predetermined program based on the contrast of the subject.
[0051]
Further, when the photographing is instructed by the shutter button 8 when the operation mode is “shooting”, the overall control unit 211 sets and inputs the thumbnail image of the image taken into the image memory 207 and a switch included in the operation unit 250. A compressed image compressed by the JPEG method is generated according to the compression ratio, and tag information (frame number, exposure value, shutter speed, compression ratio, shooting date, flash on / off data at shooting, scene information, Both images are stored in the memory card 91 together with information such as image determination results).
[0052]
When the operation changeover switch 14 for switching the operation mode between “shooting” and “reproduction” is set to “reproduction”, for example, the image data with the largest frame number in the memory card 91 is read out, and Then, the image is transferred to the VRAM 208, and the image having the largest frame number, that is, the image captured last is displayed on the LCD 10.
[0053]
FIG. 8 is a block diagram illustrating a configuration of the aperture converter processing unit 244. Symbols SG1 to SG5 in FIG. 8 indicate signals input or output to each unit. As shown in FIG. 8, the aperture converter processing unit 244 extracts a high-frequency component of the input image signal SG1 (ie, extracts an edge component), and extracts a low-frequency component of the signal SG1 (ie, extracts the low-frequency component). A signal SG2 from the high-pass filter 246, a coring processing unit 245 that performs coring processing on the signal SG2 from the high-pass filter 246, and a signal SG3 from the coring processing unit 245 and a signal SG4 from the low-pass filter 247. It comprises an adder 248 that adds the signals SG5.
[0054]
FIG. 9 is a diagram illustrating a relationship between the input signal SG2 and the output signal SG3 in the coring processing unit 245. The polygonal lines denoted by reference numerals 601, 602, and 603 indicate the relationship between the input signal SG2 and the output signal SG3 when the shooting mode is the text mode, the landscape mode, and the portrait mode, respectively.
[0055]
Since the input signal SG2 to the coring processing unit 245 is a high-frequency component of the image signal, it contains many noise components included in the image signal. Generally, the noise component has a smaller value than the effective edge component, and the noise component is appropriately removed by appropriately setting the coring amount C.
[0056]
The inclination of the inclined portion of the polygonal line indicated by reference numerals 601 to 603 corresponds to the gain of the high frequency component. That is, when the inclination of the inclined portion of the polygonal line is large as indicated by reference numeral 601, a signal SG3 with a large degree of enhancement is generated, and when the inclination is small as indicated by reference numeral 603, a signal with a small degree of enhancement is generated. SG3 is generated.
[0057]
Since the signal output from the aperture converter processing unit 244 is a signal SG5 obtained by adding the signal SG3 and the signal SG4, the image is an image in which the highest frequency component is emphasized in the text mode, and is emphasized in the portrait mode. The degree can be kept low. That is, edges in an image are most emphasized in the text mode, and the degree of edge enhancement is reduced in the order of the landscape mode and the portrait mode.
[0058]
As described above, in the digital camera 1, the magnitude of the edge component is adjusted by changing the magnitude of the gain of the coring processing unit 245 according to the designated shooting mode, and the resolution of the image is adjusted.
[0059]
<3. Overview of Digital Camera Operation>
Next, an outline of the operation of the digital camera 1 will be described. FIG. 10 is a diagram schematically illustrating the operation of the digital camera 1.
[0060]
When the operation mode of the digital camera 1 is set to "shooting" by the operation changeover switch 14, the camera enters a state of waiting for half-pressing of the shutter button 8 (step S11). When the shutter button 8 is half-pressed, a signal indicating that the shutter button 8 is half-pressed is input to the overall control unit 211, and the AE calculation (step S12) and the AF control (step S13) are executed by the overall control unit 211. That is, the shutter button 8 instructs the general control unit 211 to prepare for shooting.
[0061]
In the AE calculation, the exposure time and the aperture value are obtained by the AE calculation unit 211b, and in the AF control, the zoom lens 301 is brought into a focused state by the AF control unit 211a. Thereafter, the state shifts to a state of waiting for the full depression of the shutter button 8 (step S14).
[0062]
When the shutter button 8 is fully pressed, the signal from the CCD 303 is converted into a digital signal and then stored in the image memory 207 as image data (step S15). Thus, an image of the subject is obtained.
[0063]
After the photographing operation is completed, or when the shutter button 8 is not fully pressed after being pressed halfway (step S16), the process returns to the initial stage.
[0064]
<4. Auto Focus Control>
Next, the configuration of the AF control unit 211a and the AF control will be described.
[0065]
FIG. 11 is a block diagram showing a configuration of the AF control unit 211a shown in FIG. 6 together with peripheral components. The AF control unit 211a has a histogram generation circuit 251 to which an image is input from the image processing unit 240, and the CPU 261 and the ROM 262 in the overall control unit 211 play a part of the function as the AF control unit 211a.
[0066]
The histogram generation circuit 251 detects an edge in the image and generates a histogram of the edge width. Details of the configuration of the histogram generation circuit 251 will be described later.
[0067]
The CPU 261 performs a part of the autofocus operation and sends a control signal to the AF motor drive circuit 204 by performing an operation according to an operation input from the operation unit 250 and a program 262 a in the ROM 262. The program 262a may be stored in the ROM 262 when the digital camera 1 is manufactured, or the program may be transferred from the memory card 91 to the ROM 262 by using the memory card 91 as a recording medium on which the program is recorded.
[0068]
FIG. 12 is a block diagram showing functions of the CPU 261 at the time of autofocus, together with other components. 12, a noise removing unit 263 that removes a noise component from the histogram generated by the histogram generating circuit 251, a histogram evaluating unit 264 that obtains an evaluation value indicating the degree of focus from the histogram, and a position of the focus lens 311 are changed. A drive direction for determining the drive direction of the AF motor M2 (that is, the drive (movement) direction of the focus lens 311) using the evaluation value from the drive amount determination unit 265 for obtaining the drive amount of the AF motor M2 and the histogram evaluation unit 264. A determination unit 266, a focus detection unit 267 that detects whether the optical system is in focus, a control signal generation unit 268 that generates a control signal to the AF motor M2, and provides the control signal to the AF motor drive circuit 204; A shooting mode for setting a shooting mode according to a user's designated input from the operation unit 250. Setting unit 269 corresponds to functions implemented by the CPU261 to perform processing. The drive control of the lens is substantially executed by the drive amount determination unit 265, the drive direction determination unit 266, and the focus detection unit 267.
[0069]
FIG. 13 is a diagram for explaining the appearance of edge detection in the histogram generation circuit 251. In FIG. 13, the horizontal axis corresponds to the position of the pixel in the horizontal direction, and the upper part of the vertical axis corresponds to the luminance of the pixel. The lower part of the vertical axis corresponds to the detected value of the edge width.
[0070]
In FIG. 13, when an edge is detected from left to right, if the luminance difference between adjacent pixels is equal to or smaller than a threshold Th1, it is determined that no edge exists. On the other hand, when the luminance difference exceeds the threshold Th1, it is determined that the start end of the edge exists. When the luminance difference exceeding the threshold value Th1 continues from left to right, the edge width detection value increases.
[0071]
When the luminance difference becomes equal to or smaller than the threshold Th1 after detecting the edge start end, it is determined that the end of the edge exists. At this time, if the difference in luminance between the pixel corresponding to the start end of the edge and the pixel corresponding to the end is equal to or smaller than the threshold value Th2, it is determined that the edge is not an appropriate edge. Is determined to be an appropriate edge.
[0072]
By performing the above processing on the pixel array arranged in the horizontal direction in the image, the value of the width of the horizontal edge in the image is detected.
[0073]
FIG. 14 is a diagram illustrating a specific configuration of the histogram generation circuit 251. FIGS. 15 to 17 are diagrams illustrating a flow of operation of the histogram generation circuit 251. Hereinafter, generation of a histogram will be described in more detail with reference to these drawings. However, it is assumed that an area (hereinafter, referred to as an “AF area”) 401 for performing autofocus is set in advance in the center of the image 400 as shown in FIG. Is represented by D (i, j).
[0074]
The histogram generation circuit 251 to which the image signal is input from the image processing unit 240 has a symmetric structure between the left structure provided with the first differential filter 271 and the right structure provided with the second differential filter 272 as shown in FIG. When the image is scanned from left to right, the edge corresponding to the rising edge of the luminance is detected by the configuration of the first differential filter 271, and the edge corresponding to the falling edge of the luminance is detected by the second differential filter 272. Detected by the side configuration.
[0075]
In the histogram generation circuit 251, first, after various variables are initialized (step S101), the luminance difference (D (i + 1, j) -D (i, j)) between adjacent pixels is calculated by the first differential filter 271. Then, the comparator 273 checks whether or not the luminance difference exceeds the threshold value Th1 (step S102). Here, when the luminance difference is equal to or smaller than the threshold Th1, it is determined that no edge exists.
[0076]
On the other hand, the luminance difference (D (i, j) -D (i + 1, j)) between adjacent pixels is also obtained by the second differential filter 272, and the comparator 273 determines whether the luminance difference exceeds the threshold Th1. Is confirmed (step S105). If the luminance difference is equal to or smaller than the threshold Th1, it is determined that no edge exists.
[0077]
Thereafter, steps S102 and S105 are repeated while increasing i (FIG. 17: steps S121 and S122).
[0078]
If the luminance difference exceeds the threshold value Th1 in step S102, it is determined that the start edge of the edge (rising edge of the luminance signal) has been detected, and the edge width counter 276 on the first differential filter 271 side detects the edge width. Is incremented, and the flag CF1 indicating that the edge width is being detected is set to 1 (step S103). Further, the luminance at the start of detection is stored in the latch 274.
[0079]
Thereafter, the edge width detection value C1 increases until the luminance difference becomes equal to or less than the threshold value Th1 in step S102 (steps S102, S103, S121, S122). When the luminance difference becomes equal to or less than the threshold value Th1, the flag CF1 becomes 0. And the luminance at this time is stored in the latch 275 (steps S102 and S104).
[0080]
When the flag CF1 is reset to 0, the luminance difference Dd1 stored in the latch 274 and the latch 275 is supplied to the comparator 277, and it is checked whether the luminance difference Dd1 exceeds the threshold Th2 ( (FIG. 16: Step S111). If the luminance difference Dd1 exceeds the threshold Th2, it is determined that an appropriate edge has been detected, and an edge width detection value C1 is given from the edge width counter 276 to the histogram generation unit 278, and the edge width is C1. The frequency H [C1] of a certain edge is incremented (step S112). Thus, detection of one edge having the edge width of C1 is completed.
[0081]
Thereafter, the edge width detection value C1 is reset to 0 (Steps S115 and S116).
[0082]
Similarly, when the luminance difference exceeds the threshold value Th1 in step S105, it is determined that the start edge of the edge (falling edge of the luminance signal) is detected, and the edge width counter 276 on the second differential filter 272 side detects the edge. The edge width detection value C2 (initial value 0) indicating the width is incremented, the flag CF2 indicating that the edge width is being detected is set to 1, and the luminance at the start of the detection is stored in the latch 274 ( Steps S105 and S106).
[0083]
Thereafter, the edge width detection value C2 increases until the luminance difference becomes equal to or less than the threshold value Th1 in step S105 (steps S105, S106, S121, S122). When the luminance difference becomes equal to or less than the threshold value Th1, the flag CF2 becomes 0. And the luminance at this time is stored in the latch 275 (steps S105 and S107).
[0084]
When the flag CF2 is reset to 0, the luminance difference Dd2 stored in the latch 274 and the latch 275 is supplied to the comparator 277, and it is confirmed whether the luminance difference Dd2 exceeds the threshold Th2 ( Step S113). If the luminance difference Dd2 exceeds the threshold Th2, the frequency H [C2] of the edge having the edge width of C2 is incremented by the histogram generation unit 278 (step S114), and the frequency of one edge having the edge width of C2 is increased. Detection is complete.
[0085]
Thereafter, the edge width detection value C2 is reset to 0 (steps S117, S118).
[0086]
When the above-described edge detection processing is repeated and the variable i becomes a value outside the AF area 401 (correctly, (i + 1) becomes a value outside the AF area 401), variables other than the variable j are initialized and the variable j becomes It is incremented (FIG. 17: steps S122 to S124). As a result, edge detection is performed for the next horizontal pixel array in the AF area 401. The edge detection in the horizontal direction is repeated, and when the variable j eventually becomes a value outside the AF area 401, the edge detection ends (step S125). As a result, a histogram indicating the relationship between the edge width and the frequency is generated in the histogram generation unit 278.
[0087]
FIGS. 20 to 22 are diagrams showing the entire flow of the AF control (FIG. 10: step S13) in the digital camera 1. Hereinafter, the operation at the time of autofocus will be described with reference to FIGS. 20 to 22 and FIG. In the following description, the focus lens 311 driven at the time of auto-focusing is appropriately abbreviated as “lens”, and the position of the focus lens 311 at which the optical system is in a focused state is referred to as “focused position”.
[0088]
First, under the control of the control signal generation unit 268, the lens moves from the reference position P2 by a predetermined amount (for example, 4Fδ: F is the F number of the optical system, and δ is the allowable scattering corresponding to the pitch (interval) between the pixels of the CCD 303). Is the diameter of the circle, and Fδ is equivalent to the depth of focus), and moves to the position P1 on the closest side (the side on which the closest subject is focused), and the noise removing unit 263 and the histogram evaluation unit 264 move the focus. An evaluation value indicating the degree is obtained and output to the driving direction determination unit 266 (step S201).
[0089]
In the histogram evaluation unit 264, an edge width corresponding to a representative value of the histogram of the edge width created by the histogram generation circuit 251 is obtained as an evaluation value. As the representative value of the histogram, the digital camera 1 uses an edge width (hereinafter, referred to as “centroid edge width”) Vew corresponding to the center of gravity of the histogram. As the representative value of the histogram, another statistical value may be used. For example, an edge width corresponding to the maximum frequency, a median of the edge width, or the like can be used.
[0090]
FIG. 23 is a flowchart showing the details of the processing in which the noise removal unit 263 and the histogram evaluation unit 264 obtain the center-of-gravity edge width. FIGS. 24 and 25 are diagrams for explaining the operation of the noise removing unit 263. FIG.
[0091]
In the noise removal by the noise removing unit 263, first, a portion having an edge width of 1 (that is, one pixel) is deleted from the histogram (step S301). As shown in FIG. 24, the histogram 410 has a shape in which a portion 411 having an edge width of 1 protrudes. This is because high-frequency noise in the AF area 401 is detected as an edge having a width of 1. Therefore, the accuracy of the center-of-gravity edge width is improved by removing the portion 411 having the edge width of 1.
[0092]
Next, portions 412 and 413 of the histogram 410 whose frequency is equal to or less than the predetermined value Th3 are deleted (step S302). This is because a portion having a low frequency in the histogram 410 generally includes many edges other than the main subject image. In other words, a part whose frequency is higher than a predetermined value is extracted from the histogram.
[0093]
Further, as shown in FIG. 25, the edge width E having the maximum frequency is detected (step S303), and is within a predetermined range around the edge width E (in FIG. 25, the edge width is (E−E1) to (E + E1)). Is obtained (step S304). Although not shown in FIGS. 24 and 25, the portions 412 and 413 deleted in FIG. 24 are not always included in the portions deleted in FIG. 25 depending on the shape of the histogram. Therefore, step S304 is further performed after step S302.
[0094]
The edge width E at the center of the extraction range in step S304 may be an edge width corresponding to the center of gravity of the histogram after step S302. In order to simplify the processing, a method of simply removing a portion having an edge width equal to or less than a predetermined value or a portion having an edge width equal to or more than a predetermined value from the histogram may be adopted. Since the width of the edge of the main subject image (that is, the edge that does not include the noise component derived from the background image) usually falls within a predetermined range, even with such simplified processing, the width of the main subject image is approximately equal to that of the main subject image. A corresponding histogram is determined.
[0095]
Then, the edge width corresponding to the barycenter of the histogram obtained in step S304 is obtained as a barycenter edge width Vew (step S305).
[0096]
When the center-of-gravity edge width Vew1 when the lens is located at the position P1 is obtained in step S201 in FIG. 20, subsequently, the lens returns to the reference position P2 and the center-of-gravity edge width Vew2 is obtained (step S202). The center-of-gravity edge width Vew3 is obtained at a position P3 shifted by a predetermined amount (for example, 4Fδ) to the infinity side (a position where the in-focus subject is focused) (step S203).
[0097]
Here, the width of the edge detected from the image decreases as the lens approaches the in-focus position, and the center-of-gravity edge width Vew also has a small value. Therefore, the driving direction determination unit 266 determines the center-of-gravity edge widths Vew1, Vew2, and Vew3. Is satisfied (step S204), the driving direction is determined to be the direction toward the closest side, and if not, the driving direction is set to infinity. (Steps S205, S206).
[0098]
Next, the histogram evaluation unit 264 obtains the number of edges (hereinafter, referred to as “edge number”) Ven detected by the histogram generation circuit 251 in a state where the lens is located at the position P3 (FIG. 21: step S211). ).
[0099]
When the acquired edge number Ven is 0, the drive amount (movement amount of the lens) is set to 16Fδ by the drive amount determination unit 265 (steps S212 and S213), and the edge number Ven is not 0 but is a predetermined value (for example, 20) In the following cases, the movement amount of the lens is set to 12Fδ (steps S214, S215).
[0100]
If step S213 or step S215 has been executed, the lens moves by the set amount of movement in the set drive direction (step S216), and the process returns to step S211. Then, by repeating the setting of the movement amount, the movement of the lens, and the calculation of the number of edges Ven, the lens moves to a lens position where the number of edges Ven exceeds a predetermined value (hereinafter, referred to as “position L1”).
[0101]
As described above, the AF control unit 211a determines the lens driving amount using the edge number Ven. This is because the number of edges is a value that can be used as an evaluation value indicating the degree of focus, and the lower the degree of focus, that is, the farther the lens is from the in-focus position, the more the lens is driven by one drive. This is because a large movement is allowed.
[0102]
FIG. 26 is a diagram for explaining that the edge number Ven can be used as an evaluation value related to focus. In FIG. 26, the horizontal axis corresponds to the position of the lens, and the vertical axis corresponds to the total number of detected edges (ie, the number of edges Ven). In FIG. 26, when the lens position is 4, the lens is located at the in-focus position. At this time, the number of edges becomes maximum. The number of edges decreases as the lens position moves away from the in-focus position. Thus, the number of edges can be used as an evaluation value indicating the degree of focus.
[0103]
In the case of the digital camera 1, the in-focus position is determined by experiments in advance when the edge number Ven is 0, 16Fδ, and when the edge number Ven is less than a predetermined value (for example, 20), the lens is moved by 12Fδ. Has not been confirmed. For the above reasons, the drive control of the lens in steps S211 to S216 shown in FIG. 21 is performed.
[0104]
When the position L1 is determined, in step S217, the histogram evaluating unit 264 obtains the center-of-gravity edge width Vew21 at the position L1. Thereafter, the center-of-gravity edge width Vew21 is stored in the drive amount determination unit 265, and the lens is driven larger by a predetermined movement amount in the set drive direction (step S218). At the position after the movement (hereinafter, referred to as “position L2”), the center-of-gravity edge width Vew22 is obtained again and transferred to the drive amount determination unit 265 (step S219).
[0105]
Next, the drive amount determination unit 265 acquires a shooting mode preset by the shooting mode setting unit 269 (FIG. 22: step S221). If the designated shooting mode is the portrait mode, the drive amount determination unit 265 sets the reference edge width Vewf used for calculating the in-focus position to Port (5 pixels) (steps S222 and S223), and sets the landscape mode If it is, the reference edge width Vewf is set to Scene (the number of pixels is 4) (steps S224 and S225), and in the text mode, the reference edge width Vewf is set to Text (the number of pixels is 3) (steps S226 and S227).
[0106]
Thereafter, using the positions L1 and L2, and the center-of-gravity edge widths Vew21 and Vew22 and the reference edge width Vewf, an approximate in-focus position is obtained by a method described later (step S228). That is, the in-focus position is estimated. The lens is quickly moved to the obtained focus position (step S229).
[0107]
Further, the lens is slightly vibrated while the histogram evaluation unit 264 obtains the center-of-gravity edge width Vew, and under the control of the focus detection unit 267 and the driving amount determination unit 265, the lens position is finely adjusted so that the center-of-gravity edge width Vew becomes minimum. The adjustment is performed (step S230). As a result, the lens is accurately located at the in-focus position.
[0108]
Next, details of the principle and method of calculating the focus position in step S228 will be described.
[0109]
FIG. 27 is a diagram illustrating how the histogram of the edge width changes as the lens approaches the in-focus position. Reference numeral 421 indicates a histogram when the lens is far away from the in-focus position, and reference numeral 422 indicates a histogram when the lens is closer to the in-focus position than in the case of the histogram 421. Reference numeral 423 indicates the center-of-gravity edge width when the lens is located at the in-focus position. Reference numerals Vew11 and Vew12 are the center-of-gravity edge widths of the histograms 421 and 422, respectively.
[0110]
As shown in FIG. 27, the center-of-gravity edge width Vew decreases as the lens approaches the in-focus position. The minimum value of the center-of-gravity edge width Vew slightly varies depending on the MTF (Modulation Transfer Function: an index value indicating how much the optical system can reproduce the contrast of the image with respect to the spatial frequency) of the optical system, the subject, and the like. However, in the same photographing mode, since the spatial frequency characteristics of the image are roughly determined, the minimum center-of-gravity edge width Vew when the lens is located at the in-focus position can be regarded as a constant value. The reference edge width Vewf set in steps S222 to S227 corresponds to the minimum center-of-gravity edge width Vew that can be regarded as a constant value (that is, the evaluation value when the lens is located at the in-focus position).
[0111]
FIG. 28 is a diagram showing the relationship between the lens position and the center-of-gravity edge width. The center-of-gravity edge widths corresponding to the lens positions L1 and L2 are Vew21 and Vew22, and the reference edge width corresponding to the focus position Lf is Vewf. is there. As shown in FIG. 28, generally, it can be considered that the lens position and the center-of-gravity edge width have a linear relationship. Therefore, when the center-of-gravity edge widths Vew21 and Vew22 corresponding to the lens positions L1 and L2 are obtained, the in-focus position Lf can be obtained from Equation 1 using the reference edge width Vewf.
[0112]
(Equation 1)
Figure 0003555584
[0113]
Note that, instead of the center-of-gravity edge width, a statistical value such as an average value of the edge width, an edge width corresponding to the peak of the histogram, or a median may be used when the in-focus position is obtained.
[0114]
Further, in the method shown in FIG. 28, it is possible to obtain the focus position Lf by obtaining the center-of-gravity edge width at at least two lens positions. The accuracy of the center-of-gravity edge width at the lens positions L1 and L2 may be increased using the center-of-gravity edge widths at positions (L1 ± aFδ) and (L2 ± aFδ) before and after the distance aFδ. Specifically, when the center-of-gravity edge widths at the positions (L1−aFδ), L1 and (L1 + aFδ) are Vew31, Vew32, and Vew33, a value Vew3 obtained by applying a low-pass filter to these values according to Equation 2 is a lens. It is obtained as the center-of-gravity edge width of the position L1.
[0115]
(Equation 2)
Figure 0003555584
[0116]
Similarly, when the center-of-gravity edge widths at the positions (L2-aFδ), L2, and (L2 + aFδ) are Vew41, Vew42, and Vew43, the value Vew4 is obtained as the center-of-gravity edge width of the lens position L2 by Expression 3.
[0117]
(Equation 3)
Figure 0003555584
[0118]
Of course, the center-of-gravity edge width may be obtained at three or more arbitrary lens positions, and a straight line indicating the relationship between the lens position and the center-of-gravity edge width may be obtained using the least squares method.
[0119]
FIG. 29 is a diagram exemplifying a histogram of an edge width obtained when the same object is photographed in different photographing modes with the optical system in focus. In FIG. 29, histograms 431, 432, and 433 indicate histograms at the time of focusing in the text mode, the landscape mode, and the portrait mode, respectively.
[0120]
As shown in FIG. 9, the coring processing unit 245 emphasizes the high-frequency components of the image most in the text mode, and minimizes the degree of emphasis of the high-frequency components in the portrait mode. Therefore, in the text mode, the width of the edge becomes smaller as a whole, and in the portrait mode, the width of the edge becomes larger as a whole. As a result, the center-of-gravity edge width Vew at the time of focusing is the smallest in the text mode and the largest in the portrait mode.
[0121]
For such a reason, the reference edge width Vewf set in steps S222 to S227 is set to be the smallest in the text mode and set to the largest in the portrait mode. That is, the reference edge width Vewf is changed according to the gain setting of the high-frequency component in the processing performed on the image.
[0122]
As described above, in the AF control in the digital camera 1, the center-of-gravity edge width Vew is obtained at the first position L1 and the second position L2, and the focus position is obtained from the two center-of-gravity edge widths and the reference edge width. . Therefore, the focus lens 311 can be quickly moved to the focus position. Then, since the reference edge width Vewf used in calculating the focus position is changed according to the shooting mode, an appropriate focus position is calculated according to the shooting mode. As a result, the AF control can be performed quickly and appropriately. In addition, since fine adjustment is performed using the center-of-gravity edge width, the lens is finally accurately positioned at the in-focus position.
[0123]
To be precise, the first and second positions L1 and L2 are used for calculating the in-focus position together with the two center-of-gravity edge widths and the reference edge width, but the first and second positions L1 and L2 are set in advance. It may be determined and prepared in the digital camera 1.
[0124]
<5. Modification>
As described above, one embodiment of the present invention has been described, but the present invention is not limited to the above embodiment, and various modifications are possible.
[0125]
For example, in the above embodiment, the imaging unit 3 having the optical system and the camera main unit 2 for controlling the optical system can be separated, and the camera main unit 2 is a control device for the optical system. Alternatively, a digital camera integrally having an optical system and a control system may be used. Further, the configuration may be such that the optical system and the control device are connected using a cable. In this case, a general-purpose computer may be used as the control device, and a program for controlling an optical system is installed in the computer in advance via a recording medium such as an optical disk, a magnetic disk, and a magneto-optical disk.
[0126]
In the digital camera 1, as shown in FIG. 8, the processing in the AF control unit 211a is divided into processing by a dedicated circuit and software processing by the CPU, but all of them can be executed by the CPU. In this case, when the CPU executes the program, all of the AF control described in the above embodiment is executed. Conversely, all the processing in the AF control section 211a can be realized by a dedicated circuit.
[0127]
The edge detection processing in the above embodiment is only an example, and the edge may be detected by another method. Further, although the edge detection in the above embodiment is performed only in the horizontal direction, an edge may be detected in the vertical direction, or edge detection may be performed in both directions.
[0128]
In the above embodiment, the driving direction of the lens is determined using the center-of-gravity edge width Vew as the evaluation value. However, it is also possible to determine the driving direction of the lens using contrast instead of the center-of-gravity edge width Vew. Similarly, it is possible to use contrast instead of the center-of-gravity edge width Vew when the lens is accurately adjusted to the focus position.
[0129]
In general, it is preferable that a histogram of the edge width is obtained to obtain a high evaluation value indicating the degree of focus from the edge, and a representative value of the histogram is used as the evaluation value. The representative value of the histogram is preferably given as a statistical value in consideration of an arithmetic technique, and an average value, a median, an edge width corresponding to a peak, or the like can be used as the statistical value. In the digital camera 1, the edge width corresponding to the center of gravity of the histogram (that is, the average value of the edge widths) is used as a representative value in consideration of the reliability of the evaluation value and the amount of calculation.
[0130]
Further, other evaluation values for the edge can be used. For example, the frequency of an edge having a width of about 3 or 4 close to the reference edge width may be simply used as the evaluation value. It is also possible to use, as the evaluation value, the ratio of the frequency of the edge within the range of the predetermined edge width to the total frequency. In this case, the higher the frequency, the higher the degree of focus, and the reference value used for calculating the in-focus position is the frequency of an edge having a width of about 3 or 4 at the time of focusing instead of the reference edge width. As described above, values other than the center of gravity edge width and the reference edge width may be used as the evaluation value and the reference value.
[0131]
Note that the reference value does not need to exactly match the evaluation value at the time of focusing, and may be a value that can be regarded as the evaluation value at the time of focusing, or a value close to the evaluation value at the time of focusing. Good.
[0132]
In the digital camera 1, since AF control is performed by controlling the position of the focus lens, the AF control is described using the term lens position. However, the AF control is performed by driving a plurality of lenses. Also, the AF control according to the above embodiment can be used. That is, the lens position in the above embodiment can be associated with the arrangement of at least one lens.
[0133]
At least one lens for imaging need not be a zoom lens, and may be any optical system that can adjust focus.
[0134]
In the digital camera 1, an image signal is input from the aperture converter processing unit 244 of the image processing unit 240 to the overall control unit 211 in order to obtain an evaluation value for autofocus. May be done. For example, an image signal from the black level correction circuit 241 may be input to the AF control unit 211a. In this case, in the portrait mode, the lens is more out of focus than in the text mode. However, in the portrait mode, there is no problem because the lens does not need to be accurately positioned at the focus position.
[0135]
Further, in the above-described embodiment, in the calculation for predicting the in-focus position, the reference edge width Vewf in the portrait mode, the landscape mode, and the text mode is calculated with the number of pixels being 5, 4, and 3, respectively. It is not something that can be done. The shooting mode of the digital camera 1 is not limited to the portrait mode, the landscape mode, and the text mode, but may have another mode according to the shooting situation. In that case, the reference edge width Vewf is prepared in advance in accordance with the additional shooting mode.
[0136]
In addition, the distance between the first position L1 and the second position L2 in the above embodiment may be set to a constant value in advance, but the distance Ven and the center-of-gravity edge width Vew at the position L1 are different. It may be changed accordingly. That is, the distance between the position L1 and the position L2 may be set to be larger as the degree of focus indicated by these evaluation values is lower in order to appropriately estimate the focus position.
[0137]
In the above embodiment, high speed AF control is realized by using an edge, which is particularly suitable for obtaining a still image. However, various techniques in the above embodiment can also be applied to obtaining a moving image. Can be used for various digital imaging devices.
[0138]
【The invention's effect】
Claims 1 to8In the invention ofUsing the edge width corresponding to the center of gravity of the histogram as the evaluation value,Depending on the shooting mode, As an evaluation value when it is assumed that the lens is located at the in-focus position.By setting the reference value, it is possible to quickly perform appropriate autofocus control according to the shooting mode.
[0139]
According to the second aspect of the present invention, appropriate autofocus control can be performed by changing the reference value based on the gain setting changed according to the shooting mode.
[0141]
According to the fourth to sixth aspects of the present invention, appropriate AF control can be performed according to various shooting modes.
[Brief description of the drawings]
FIG. 1 is a front view of a digital camera.
FIG. 2 is a rear view of the digital camera.
FIG. 3 is a side view of the digital camera.
FIG. 4 is a bottom view of the digital camera.
FIG. 5 is a diagram illustrating an internal configuration of an imaging unit.
FIG. 6 is a block diagram illustrating a configuration of a digital camera.
FIG. 7 is a block diagram illustrating a configuration of an image processing unit.
FIG. 8 is a block diagram illustrating a configuration of an aperture converter processing unit.
FIG. 9 is a diagram illustrating a relationship between an input and an output in a coring processing unit.
FIG. 10 is a flowchart showing an outline of the operation of the digital camera.
FIG. 11 is a block diagram illustrating a configuration of an AF control unit.
FIG. 12 is a block diagram illustrating a functional configuration of an AF control unit.
FIG. 13 is a diagram illustrating a state of edge detection.
FIG. 14 is a block diagram illustrating a configuration of a histogram generation circuit.
FIG. 15 is a diagram showing a flow of histogram generation.
FIG. 16 is a diagram showing a flow of generating a histogram.
FIG. 17 is a diagram showing a flow of histogram generation.
FIG. 18 is a diagram showing an AF area.
FIG. 19 is a diagram showing a pixel array in an AF area.
FIG. 20 is a diagram showing a flow of AF control.
FIG. 21 is a diagram showing a flow of AF control.
FIG. 22 is a diagram showing a flow of AF control.
FIG. 23 is a diagram showing a flow of calculating a center-of-gravity edge width.
FIG. 24 is a diagram illustrating a state where noise components are removed from a histogram.
FIG. 25 is a diagram illustrating a state where noise components are removed from a histogram.
FIG. 26 is a diagram illustrating a relationship between a lens position and the number of edges.
FIG. 27 is a diagram illustrating a change in a histogram due to a change in a lens position.
FIG. 28 is a diagram illustrating a relationship between a lens position and a center-of-gravity edge width.
FIG. 29 is a diagram showing a histogram for each shooting mode.
[Explanation of symbols]
1 Digital camera
2 Camera body
91 Memory Card
204 AF motor drive circuit
250 operation unit
251 Histogram generation circuit
261 CPU
262 ROM
262a program
264 Histogram evaluation unit
265 Drive amount determination unit
268 control signal generator
269 Shooting mode setting section
301 zoom lens
303 CCD
311 Focus lens
S211 to S219, S221 to S229 Step

Claims (8)

デジタル撮像装置であって、
フォーカスの調整が可能な光学系と、
前記光学系を介して被写体の画像をデジタルデータとして取得する撮像手段と、
前記画像のエッジを検出し、前記エッジの幅のヒストグラムの代表値に対応するエッジ幅をフォーカスの程度を示す評価値として求める演算手段と、
複数の撮影モードから一の撮影モードの指定を受け付ける指定手段と、
前記一の撮影モードに応じて、前記光学系のレンズが合焦位置に位置すると推測される際の前記評価値としての基準値を設定する設定手段と、
記レンズが第1の位置に位置する際の第1の評価値、前記レンズが第2の位置に位置する際の第2の評価値、および、前記基準値から前記レンズの合焦位置を算出し、算出した前記合焦位置へと前記レンズを移動させる制御手段と、
を備えることを特徴とするデジタル撮像装置。
A digital imaging device,
An optical system that can adjust the focus,
Imaging means for acquiring an image of a subject as digital data via the optical system,
A calculating means for calculating an evaluation value for detecting the edge of the image, indicating the degree of focus corresponding edge width representative value of the histogram of the width of the edge,
Designation means for receiving designation of one shooting mode from a plurality of shooting modes;
Setting means for setting a reference value as the evaluation value when it is estimated that the lens of the optical system is located at a focus position according to the one shooting mode;
Before the first evaluation value when a sharp lens is located in the first position, the second evaluation value when the lens is located in the second position, and in-focus position of the lens from the reference value Control means for moving the lens to the calculated in- focus position,
A digital imaging device comprising:
請求項1に記載のデジタル撮像装置であって、
前記設定手段が、前記画像に施される処理における高周波成分のゲイン設定に応じて前記基準値を変更することを特徴とするデジタル撮像装置。
The digital imaging device according to claim 1,
A digital imaging apparatus, wherein the setting unit changes the reference value according to a gain setting of a high-frequency component in a process performed on the image.
請求項1に記載のデジタル撮像装置であって、
前記複数の撮影モードに応じて異なる強調の度合いを設定し、前記強調の度合いに従って前記画像の高周波成分を強調する手段、
をさらに備え、
前記評価値は、前記高周波成分が強調された画像に基づいて求められることを特徴とするデジタル撮像装置。
The digital imaging device according to claim 1 ,
Means for setting different degrees of emphasis according to the plurality of shooting modes, and for emphasizing high-frequency components of the image according to the degree of emphasis;
Further comprising
The digital imaging device , wherein the evaluation value is obtained based on an image in which the high-frequency component is emphasized .
請求項1ないし3のいずれかに記載のデジタル撮像装置であって、
前記複数の撮影モードがポートレートモードを含み、
前記ポートレートモードにおいて設定される基準値が他の撮影モードにおいて設定される基準値よりも大きいことを特徴とするデジタル撮像装置。
The digital imaging device according to claim 1 , wherein:
The plurality of shooting modes include a portrait mode,
A digital imaging device wherein a reference value set in the portrait mode is larger than a reference value set in another shooting mode.
請求項1ないし4のいずれかに記載のデジタル撮像装置であって、
前記複数の撮影モードがテキストモードを含み、
前記テキストモードにおいて設定される基準値が他の撮影モードにおいて設定される基準値よりも小さいことを特徴とするデジタル撮像装置。
The digital imaging device according to claim 1 , wherein
The plurality of shooting modes include a text mode,
A digital imaging device, wherein a reference value set in the text mode is smaller than a reference value set in another shooting mode.
請求項5に記載のデジタル撮像装置であって、
前記複数の撮影モードがポートレートモード、風景モードおよびテキストモードを含むことを特徴とするデジタル撮像装置。
The digital imaging device according to claim 5,
A digital imaging device, wherein the plurality of shooting modes include a portrait mode, a landscape mode, and a text mode.
デジタルデータとして画像を取得する際に、光学系を制御させるプログラムを記録した記録媒体であって、前記プログラムの制御装置による実行は、前記制御装置に、
前記光学系のレンズを第1の位置に位置させる工程と、
画像のエッジを検出し、前記エッジの幅のヒストグラムの代表値に対応するエッジ幅をフォーカスの程度を示す評価値として求め、第1の評価値とする工程と、
前記光学系のレンズを第2の位置に位置させる工程と、
画像のエッジを検出し、前記エッジの幅のヒストグラムの代表値に対応するエッジ幅を前記評価値として求め、第2の評価値とする工程と、
複数の撮影モードから指定された一の撮影モードに応じて、前記レンズが合焦位置に位置すると推測される際の前記評価値としての基準値を設定する工程と、
前記第1の評価値、前記第2の評価値および前記基準値から前記レンズの合焦位置を算出する工程と、
算出した前記合焦位置へと前記レンズを移動させる工程と、
を実行させることを特徴とする記録媒体。
When acquiring an image as digital data, a recording medium that records a program for controlling an optical system, execution of the program by the control device, the control device,
Positioning the lens of the optical system at a first position;
Detecting edges of the image, obtains an edge width corresponding to the representative values of the histogram of the width of the edge as an evaluation value indicating the degree of focus, a step of the first evaluation value,
Positioning the lens of the optical system at a second position;
Detecting edges of the image, it obtains an edge width corresponding to the representative values of the histogram of the width of the edge as the evaluation value, a step of the second evaluation values,
A step of setting a reference value as the evaluation value when the lens is estimated to be located at a focus position according to one shooting mode designated from a plurality of shooting modes,
Calculating a focus position of the lens from the first evaluation value, the second evaluation value, and the reference value;
Moving the lens to the calculated focus position;
A recording medium characterized by executing the following.
請求項7に記載の記録媒体であって、前記プログラムの制御装置による実行は、前記制御装置に、The recording medium according to claim 7, wherein execution of the program by the control device includes:
前記複数の撮影モードに応じて異なる強調の度合いを設定し、前記強調の度合いに従って前記画像の高周波成分を強調する工程、Setting different degrees of emphasis according to the plurality of shooting modes, and emphasizing high-frequency components of the image according to the degree of emphasis;
をさらに実行させ、Is executed further,
前記評価値は、前記高周波成分が強調された画像に基づいて求められることを特徴とする記録媒体。The recording medium according to claim 1, wherein the evaluation value is obtained based on an image in which the high-frequency component is emphasized.
JP2001014716A 2001-01-23 2001-01-23 Digital imaging device and recording medium Expired - Fee Related JP3555584B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001014716A JP3555584B2 (en) 2001-01-23 2001-01-23 Digital imaging device and recording medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001014716A JP3555584B2 (en) 2001-01-23 2001-01-23 Digital imaging device and recording medium

Publications (2)

Publication Number Publication Date
JP2002214524A JP2002214524A (en) 2002-07-31
JP3555584B2 true JP3555584B2 (en) 2004-08-18

Family

ID=18881368

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001014716A Expired - Fee Related JP3555584B2 (en) 2001-01-23 2001-01-23 Digital imaging device and recording medium

Country Status (1)

Country Link
JP (1) JP3555584B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008079123A (en) * 2006-09-22 2008-04-03 Olympus Corp Imaging apparatus and focus control program
GB2475983B (en) 2009-12-07 2013-03-13 Hiok Nam Tay Auto-focus image system
US9065999B2 (en) 2011-03-24 2015-06-23 Hiok Nam Tay Method and apparatus for evaluating sharpness of image
JP5883141B2 (en) * 2012-02-02 2016-03-09 アセルサン・エレクトロニク・サナイ・ヴェ・ティジャレット・アノニム・シルケティAselsan Elektronik Sanayi veTicaret Anonim Sirketi System and method for focusing an electronic imaging system

Also Published As

Publication number Publication date
JP2002214524A (en) 2002-07-31

Similar Documents

Publication Publication Date Title
US8797423B2 (en) System for and method of controlling a parameter used for detecting an objective body in an image and computer program
US20020114015A1 (en) Apparatus and method for controlling optical system
JP3468231B2 (en) Image processing apparatus, image quality control method, program, and recording medium
JP3541820B2 (en) Imaging device and imaging method
KR101342477B1 (en) Imaging apparatus and imaging method for taking moving image
US8629915B2 (en) Digital photographing apparatus, method of controlling the same, and computer readable storage medium
US20040061796A1 (en) Image capturing apparatus
US20010035910A1 (en) Digital camera
JP4787180B2 (en) Imaging apparatus and imaging method
US20060204106A1 (en) Imaging device, imaging method and imaging program
US20070230933A1 (en) Device and method for controlling flash
US8391597B2 (en) Image capturing apparatus, method for capturing image, and program
US7796163B2 (en) System for and method of taking image based on objective body in a taken image
JP2002214513A (en) Optical system controller, optical system control method, and recording medium
JP2002209135A (en) Digital image pickup device and recording medium
JP3530908B2 (en) Digital camera and image display device
JP2003244520A (en) Photographing device
JP3555583B2 (en) Optical system control device, optical system control method, recording medium, and imaging device
JP2005055746A (en) Imaging apparatus, focusing control method and program
JP2003319407A (en) Imaging apparatus
JP3555584B2 (en) Digital imaging device and recording medium
JP3943470B2 (en) Digital camera
US8514305B2 (en) Imaging apparatus
JP2002207162A (en) Digital camera
JP2004110059A (en) Optical system control device and method, and recording medium

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20031225

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040106

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040301

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20040420

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20040503

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

Free format text: PAYMENT UNTIL: 20090521

Year of fee payment: 5

LAPS Cancellation because of no payment of annual fees