JP2004029105A - Autofocus device and af evaluated value acquiring method - Google Patents

Autofocus device and af evaluated value acquiring method Download PDF

Info

Publication number
JP2004029105A
JP2004029105A JP2002181334A JP2002181334A JP2004029105A JP 2004029105 A JP2004029105 A JP 2004029105A JP 2002181334 A JP2002181334 A JP 2002181334A JP 2002181334 A JP2002181334 A JP 2002181334A JP 2004029105 A JP2004029105 A JP 2004029105A
Authority
JP
Japan
Prior art keywords
pixel
pixels
value
contrast
evaluation value
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.)
Pending
Application number
JP2002181334A
Other languages
Japanese (ja)
Inventor
Hidetoshi Sumi
隅 秀敏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Casio Computer Co Ltd
Original Assignee
Casio Computer Co Ltd
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 Casio Computer Co Ltd filed Critical Casio Computer Co Ltd
Priority to JP2002181334A priority Critical patent/JP2004029105A/en
Publication of JP2004029105A publication Critical patent/JP2004029105A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Studio Devices (AREA)
  • Focusing (AREA)
  • Automatic Focus Adjustment (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide an autofocus device capable of realizing accurate focusing operation, and an AF evaluated value acquiring method. <P>SOLUTION: When an AF evaluated value is calculated in a specified cycle in the autofocus control of a contrast detecting system, a contrast value is calculated for respective pixels constituting a specified evaluation range on a subject image. On the basis of the calculated value, contrast vector (arrow in figure) showing the relative contrast relation of the respective pixels to their peripheral pixels in eight directions is calculated. Thereafter, the respective pixels are grouped according to the difference of the direction of the contrast vector, and the AF evaluated value is calculated by the elements (pixels at a painted-out spot in figure) of the vector group selected under a specified condition based on the contrast values of the pixels except the pixels (5 and 12) isolated in the group. The noise component of the subject image is prevented from being mixed with the AF evaluated value, and a probability that the noise component is mixed is restrained to be extremely low. <P>COPYRIGHT: (C)2004,JPO

Description

【0001】
【発明の属する技術分野】
本発明は、デジタルカメラ等のカメラ装置に用いて好適なオートフォーカス装置、及びAF評価値取得方法に関する。
【0002】
【従来の技術】
従来、CCD型やMOS型の固体撮像素子を用いて被写体を撮像し、それを画像データに変換し記録するデジタルカメラのオートフォーカス制御(AF制御)には、コントラスト検出方式が多く採用されている。かかる方式はデジタルビデオカメラや、CCDをセンサとして使用する銀塩カメラ等においても採用されている。
【0003】
コントラスト検出方式のAF制御では、フォーカスレンズを光軸方向に何点かに移動させ、各位置で撮像した被写体画像の所定範囲におけるコントラスト値(AF評価値)を算出する。例えば所定範囲の各画素について周囲の画素との輝度差であるコントラスト値を求め、それらの合計値を算出する。そして、複数点で算出したAF評価値の大小の比較や、変化するコントラスト値の傾きから、コントラスト値が最大となるピーク位置を判断し、そのピーク位置を合焦位置としてフォーカスレンズを移動させている。また、係るAF制御では、被写体画像における評価範囲、つまりAF評価値の算出対象となる範囲をスポットやワイド等のように、その大きさを予め設定された中から選択可能とする場合もある。
【0004】
【発明が解決しようとする課題】
しかしながら、従来のオートフォーカス方法にあっては、仮に評価範囲の大きさや位置を選択可能としても、評価範囲内の全てのコントラスト値が評価値に関わってくる。そのため、例えば低照度時のように被写体画像にノイズが多い場合には、そのノイズ成分がAF評価値に混入しやすく、そのピーク位置の検出精度が低下するという問題があった。
【0005】
また、ピーク位置の検出途中においては、評価範囲が被写体画像内である程度(評価範囲のコントラストの高い部分が評価範囲にあり続ける程度)位置固定されている必要がある。このため、ピーク位置の検出期間内に被写体が移動したり手ぶれ等で装置本体が動いたりした場合には、AF評価値が最大となるピーク位置と合焦位置とにズレが生じるという問題があった。
【0006】
本発明は、かかる従来の課題に鑑みてなされたものであり、精度の高いフォーカス動作が可能となるオートフォーカス装置、及びAF評価値取得方法、それらの実現に使用するプログラムを提供することを目的とする。
【0007】
【課題を解決するための手段】
前記課題を解決するために請求項1の発明にあっては、光学系を光軸方向に移動させながら被写体を撮像し、撮像した被写体画像の画素毎のコントラスト値に基づきAF評価値を取得し、取得したAF評価値に基づき光学系の合焦位置を判定するオートフォーカス装置において、前記被写体画像を構成する画素毎のコントラスト値に基づき、各画素について周辺画素とのコントラスト値の高低関係を方向で示すベクトルデータを取得する取得手段と、この取得手段により取得された複数画素のベクトルデータに基づき前記AF評価値の算出対象となる画素を決定する決定手段と、この決定手段により決められた画素のコントラスト値に基づき前記AF評価値を算出する算出手段とを備えたものとした。
【0008】
かかる構成において、光学系を光軸方向に移動させる間に逐次取得されるAF評価値は、被写体画像を構成する画素のうち、各々の画素に関する周辺画素とのコントラスト値の高低関係を方向で示すベクトルデータに応じて決められる所定の画素のみのコントラスト値に基づき算出される。したがって、光学系の合焦位置の判定に使用するAF評価値に、被写体画像のノイズ成分が混入することを阻止したり、ノイズ成分が混入する確率を極めて低くすることができる。
【0009】
また、請求項2の発明にあっては、前記決定手段は、AF評価値の算出対象となる画素の決定に際し、前記ベクトルデータにより示される方向が同一である画素のうち、互いに隣接しあう画素の数が所定数以下である画素、すなわち方向が同一である画素が全く隣接していないもの(孤立画素)と、方向が同一である画素が所定数以下だけ隣接しているもの(連結画素)とを除外するものとした。
【0010】
かかる構成においては、AF評価値が、被写体画像を構成する画素のうち、ノイズの影響を受けている可能性が高いものを除外された画素のみのコントラスト値に基づき算出される。したがって、AF評価値において被写体画像のノイズ成分の混入を阻止することができる。
【0011】
また、請求項3の発明にあっては、前記決定手段は、被写体画像を構成する画素を前記ベクトルデータの方向別のベクトルグループに分けるとともに、所定の条件に基づき選択したベクトルグループに含まれる画素を、AF評価値の算出対象となる画素として決定するものとした。
【0012】
かかる構成においては、AF評価値が、被写体画像を構成する画素のうち、光学系の合焦位置の判定に寄与する度合いが大きい画素のみのコントラスト値に基づき算出される。したがって、AF評価値に被写体画像のノイズ成分が混入する確率を極めて低くすることができる。
【0013】
また、請求項4の発明にあっては、前記所定の条件は、互いに隣接した前記ベクトルデータが同一である複数画素からなる集合体の大きさを含むであるものとした。
【0014】
かかる構成においても、AF評価値に被写体画像のノイズ成分が混入する確率を極めて低くすることができる。
また、請求項5の発明にあっては、前記所定の条件は、前記ベクトルデータにより示される方向が同一である画素の数を含むものとした。
【0015】
かかる構成においても、AF評価値に被写体画像のノイズ成分が混入する確率を極めて低くすることができる。
【0016】
また、請求項6の発明にあっては、前記所定の条件は、ベクトルグループ毎のコントラスト値の大きさを含むものとした。
【0017】
かかる構成においても、AF評価値に被写体画像のノイズ成分が混入する確率を極めて低くすることができる。
【0018】
また、請求項7の発明にあっては、前記決定手段は、所定の条件に基づき選択したベクトルグループに含まれる画素のうち、互いに隣接しあう画素が最も多い集合部分を構成している画素を、AF評価値の算出対象となる画素として決定するものとした。
【0019】
かかる構成においても、AF評価値に被写体画像のノイズ成分が混入する確率を極めて低くすることができる。
【0020】
また、請求項8の発明にあっては、前記取得手段は、前記被写体画像中のAF評価エリアに含まれる画素毎のコントラスト値に基づき、AF評価エリア内の各画素について周辺画素とのコントラスト値の高低関係を方向で示すベクトルデータを取得し、前記決定手段は、前記取得手段により取得された複数画素のベクトルデータに基づき、前記AF評価エリア内において前記AF評価値の算出対象となる画素を決定するものとした。
【0021】
かかる構成において、光学系を光軸方向に移動させる間に逐次取得されるAF評価値は、被写体画像中のAF評価エリアを構成する画素のうち、各々の画素に関する周辺画素とのコントラスト値の高低関係を方向で示すベクトルデータに応じて決められる所定の画素のみのコントラスト値に基づき算出される。したがって、光学系の合焦位置の判定に使用するAF評価値に、AF評価エリアのノイズ成分が混入することを阻止したり、ノイズ成分が混入する確率を極めて低くすることができる。
【0022】
また、請求項9の発明にあっては、前記被写体画像の画素毎のコントラスト値は、該画素の輝度値とその周辺画素の輝度値との差を示す値であるものとした。
【0023】
また、請求項10の発明にあっては、光学系を光軸方向に移動させながら被写体を撮像し、撮像した被写体画像の画素毎のコントラスト値に基づきAF評価値を取得し、取得したAF評価値に基づき光学系の合焦位置を判定するオートフォーカス装置において、前記被写体画像を構成する画素毎のコントラスト値に基づき、各画素について周辺画素とのコントラスト値の高低関係を方向で示すベクトルデータを取得する取得手段と、この取得手段により取得された複数画素のベクトルデータに基づき前記AF評価値の算出対象となる前記被写体画像のAF評価範囲を設定する設定手段と、この設定手段により設定された前記AF評価範囲の画素のコントラスト値に基づき前記AF評価値を算出する算出手段とを備えたものとした。
【0024】
かかる構成においては、光学系を光軸方向に移動させる間に被写体が相対的に移動するとき、被写体画像におけるAF評価範囲の位置が、被写体の移動に追随して設定つまり更新され、更新されたAF評価範囲の画素のコントラスト値に基づきAF評価値が算出される。
【0025】
また、請求項11の発明にあっては、前記設定手段は、被写体画像を構成する画素を前記ベクトルデータの方向別のベクトルグループに分けるとともに、所定の条件に基づき選択したベクトルグループに含まれる画素のうち、互いに隣接しあう画素が最も多い集合部分ををAF評価範囲として設定するものとした。
【0026】
かかる構成においては、被写体画像におけるAF評価範囲の位置を、被写体の移動に、より確実に追従させることができる。
【0027】
また、請求項12の発明にあっては、光学系を光軸方向に移動させながら被写体を撮像し、撮像した被写体画像の画素毎のコントラスト値に基づきAF評価値を取得し、取得したAF評価値に基づき光学系の合焦位置を判定するオートフォーカス制御において前記AF評価値を取得する方法であって、前記被写体画像を構成する画素毎のコントラスト値に基づき、各画素について周辺画素とのコントラスト値の高低関係を方向で示すベクトルデータを取得する工程と、取得した複数画素のベクトルデータに基づき前記AF評価値の算出対象となる画素を決める工程と、決めた画素のコントラスト値に基づき前記AF評価値を算出する工程とからなる方法とした。
【0028】
かかる方法によれば、光学系を光軸方向に移動させる間に逐次取得されるAF評価値は、被写体画像を構成する画素のうち、各々の画素に関する周辺画素とのコントラスト値の高低関係を方向で示すベクトルデータに応じて決められる所定の画素のみのコントラスト値に基づき算出される。したがって、光学系の合焦位置の判定に使用するAF評価値に、被写体画像のノイズ成分が混入することを阻止したり、ノイズ成分が混入する確率を極めて低くすることができる。
【0029】
また、請求項13の発明にあっては、光学系を光軸方向に移動させながら被写体を撮像し、撮像した被写体画像の画素毎のコントラスト値に基づきAF評価値を取得し、取得したAF評価値に基づき光学系の合焦位置を判定するオートフォーカス装置が有するコンピュータを、前記被写体画像を構成する画素毎のコントラスト値に基づき、各画素について周辺画素とのコントラスト値の高低関係を方向で示すベクトルデータを取得する取得手段と、この取得手段により取得された複数画素のベクトルデータに基づき前記AF評価値の算出対象となる画素を決定する決定手段と、この決定手段により決められた画素のコントラスト値に基づき前記AF評価値を算出する算出手段として機能させるためのプログラムとした。
【0030】
【発明の実施の形態】
以下、本発明の一実施の形態を図にしたがって説明する。
(第1の実施の形態)
図1は、本発明の一実施の形態を示すデジタルカメラ1のブロック図である。このデジタルカメラ1はAF機能を備えたものであって、フォーカスレンズ2、ズームレンズ3、CCD4、CDS/ADブロック5、TG(Timing Generator)6、CCDデータ前処理ブロック7、色処理(CP)ブロック8、JPEG符号化器9、DRAM10、ROM11、RAM12、CPU13、画像表示部14、キーブロック15、カード・インターフェイス16、モータ駆動ブロック17を備えており、カード・インターフェイス16には、図示しないカメラ本体のカードスロットに着脱自在に装着されたメモリカード18が接続されている。
【0031】
フォーカスレンズ2及びズームレンズ3はそれぞれが図示しないレンズ群から構成されるものである。モータ駆動ブロック17は、フォーカスレンズ2を光軸方向に駆動するフォーカスモータ170a、及びズームレンズ3を光軸方向に駆動するズームモータ170bと、CPU13から送られる制御信号に従いフォーカスモータ170a及びズームモータ170bをそれぞれ駆動するモータドライバ171a,171bとから構成されている。
【0032】
CCD4は、フォーカスレンズ2とズームレンズ3を介して投影された被写体像を光電変換し撮像信号として出力する。TG6は、所定周波数のタイミング信号を生成してCCD4を駆動する。CDS/ADブロック5は、CCD4からの出力信号をサンプリングしてノイズを除去しデジタル信号に変換する。CCDデータ前処理ブロック7は、デジタル信号に変換された撮像信号に対し輝度信号処理等のデータ処理を行う。色処理(CP)ブロック8は、輝度信号処理等が行われた画像信号に対して色分離等の色処理を行い、Y,Cb,Crの画像データを生成する。DRAM10は、色処理後のY,Cb,Crの画像データを逐次記憶する。
【0033】
画像表示部14は、カラーLCDと、それを駆動する駆動回路等からなり、撮影モードが設定された状態でシャッターキーが押されていない間(撮影待機状態)には、CCD4から取り込まれDRAM10に蓄積された1フレーム(画面)分の画像データに基づくスルー画像を表示し、再生モードが設定された状態では、メモリカード18から読み出されるとともに伸張された画像データに基づく記録画像を表示する。JPEG符号化器9は、画像記録時には、色処理(CP)ブロック8から入力した画像データをJPEG圧縮する。メモリカード18は、カード・インターフェイス16を介して送られた圧縮後の画像データを記録する。記録された画像データは、記録画像の再生時に読み出され、JPEG符号化器9により伸張された後、画像表示部14において表示される。また、キーブロック15は、撮影モードと再生モードとの動作切り替えに使用される切替キーや、シャッターキー等の各種の操作キーを含み、キー操作に応じた操作信号をCPU13へ送る。
【0034】
そして、ROM11には、CPU13によるデジタルカメラ1の制御、すなわちAF制御、AE制御、AWB制御等に必要なプログラムと各種データが格納されており、CPU13は、キーブロック15からの操作信号と前記プログラムに従いRAM12を作業用メモリとして動作することにより、本発明の取得手段、決定手段、算出手段、設定手段として機能する。
【0035】
なお、上記プログラムは、必ずしもROM11に格納されている必要はなく、例えば前記メモリカード18の所定領域に格納された構成であってもよい。また、前記メモリカード18以外にもEEPROM等の書き換え可能なメモリを備えた構成であれば、上記プログラムがそれらのメモリに他の装置から通信等の任意の方法で供給される構成としてもよい。
【0036】
次に、以上の構成からなるデジタルカメラ1の動作を説明する。図2は、デジタルカメラ1におけるAF処理の概略を示すフローチャートである。本実施の形態におけるAF処理は、従来技術で述べたコントラスト検出方式によるものであり、AF処理に際しては、フォーカスレンズの移動範囲を近接方向の端点から無限遠方向の端点までの全域とし、フォーカスレンズの移動、CCD等による撮像(露光)、画像信号の転送及びAD変換、AF評価値(コントラスト値)の算出といった一連の処理を繰り返し行う(ステップSA1〜SA4)。なお、図3は、その間における動作タイミングを示すタイミングチャートであり、上記一連の処理は図示したAF評価サイクルで行われる。そして、各ポイントについてAF評価値の算出が終了したら(ステップSA5でYES)、その時点でAF評価値が最大となるピーク位置を算出し(ステップSA6)、ピーク位置へフォーカスレンズを移動する(ステップSA7)。
【0037】
一方、図4は、AF評価サイクル毎に行われるAF評価値の算出処理(ステップSA4)の詳細を示すフローチャートである。以下、ステップSA2において図5に示したような画像(以下、元画像)100が撮像されたものとして説明する。係る処理では、まず元画像100から所定の位置及び大きさの(AFエリア)評価範囲(図で、画面中央部分)の画素データを切り出す(ステップSA101)。なお、この評価範囲(サーチエリア)は固定的に設定されているエリアや、予め用意されている複数エリアからユーザーにより(又は自動的に)選択されたエリアである。
【0038】
次に、図6(a)に示したような切り出した評価範囲の画像101(以下、評価画像)の各画素の輝度成分データに基づき、各画素のコントラスト値を算出する(ステップSA102)。具体的には、上記評価画像101をいったん白黒化(輝度信号のみを抽出)した後、各画素について周囲の画素との間の輝度差であるコントラスト値を算出し、さらに明暗比化によって各画素のコントラスト値の大小を輝度の明暗で表したコントラスト画像102を取得する。図6(b)は、評価画像101の一部(A部)に対応する上記コントラスト画像102の部分拡大図である。なお、明暗比化によりコントラスト画像102を取得するといった画像処理を行わず、単に各画素のコントラスト値を算出するのみでもよい。また、白黒化した画像からコントラスト値を算出せずに、他の方法によってコントラスト値を取得しても構わない。
【0039】
引き続き、ステップSA102で算出した、評価画像101における各画素のコントラスト値(コントラスト画像102)に基づき、コントラストベクトルを算出する(ステップSA103)。なお、コントラスト画像102に基づき、コントラストベクトルを算出することを考えた場合、コントラストベクトルは、各画素における周辺画素との相対的な輝度関係を方向(輝度方向)で示すデータであって、本実施の形態では、注目画素とその8近傍画素との輝度関係に基づき算出する。すなわち図7(a)は、3×3[(0,0)〜(2,2)]の画素エリアで、(1,1)の輝度が他の8近傍要素の輝度より高い場合における輝度方向(ベクトル)の表示規則を表したものであり、本実施の形態において、各画素の取り得る輝度方向は図示した8方向である。また、図8は、図6(b)に対応する領域内の各画素のコントラストベクトルを示した模式図であり、被写体のエッジ付近において互いに隣接する画素にあっては、それらのコントラストベクトルが同一方向となる傾向にある。
【0040】
次に、算出した各画素のコントラストベクトルをベクトル(輝度)方向別にグループ分けし(ステップSA104)、グループ分けした8つのベクトルグループの中で、その範囲が広く(同一方向のベクトルを有する画素数が多く)、且つコントラスト(グループ内の全画素のコントラスト値の合計)が高いベクトルグループを選択する(ステップSA105)。引き続き、選択したベクトルグループの要素(輝度方向が同一である各画素)の中に孤立点、つまり周辺に同一の輝度方向を有する画素が1つも存在しない孤立点があるか否かを判別する(ステップSA106)。
【0041】
なお、先に示した図8は、ステップSA105における選択条件と合致するベクトルグループの輝度方向が「左下」であったとき、そのベクトルグループの要素(画素)を塗りつぶしたものであり、図示した画素エリアでは(0,0)〜(18,18)の画素のうち(5,12)の画素が孤立点であり、かかる孤立点は、被写体のエッジ部分とは異なる部分で、かつノイズが存在する部分に現れることとなる。
【0042】
そして、上記の場合ように孤立点があれば(ステップSA106でYES)、孤立点となる画素のコントラスト値を、AF評価値の算出に用いるデータから除外し(ステップSA107)、ステップSA105で所定の選択条件に基づき選択したベクトルグループの(孤立点を除く)画素のコントラスト値を所定の条件式を用いて加算することによりAF評価値を算出する(ステップSA108)。また、孤立点がなければ(ステップSA106でNO)、選択したベクトルグループの全ての画素のコントラスト値を所定の条件式を用いて加算することによりAF評価値を算出する(ステップSA108)。
【0043】
以上のように本実施の形態においては、AF評価値の算出には、前述した条件で選択されたベクトルグループの要素で、かつそのグループ内で孤立点となる画素を除外した残りの画素のコントラスト値だけを使用するようにした。ここで、前記孤立点は、前述したように元画像100の評価範囲内において被写体のエッジ部分とは異なる部分で、かつノイズが存在する部分に現れることから、例えば低照度時のように元画像100にノイズが多く含まれている場合であっても、そのノイズ成分が算出したAF評価値に混入しにくくなる。よって、AF評価値のピーク位置を高精度で検出することができ、その結果、精度の高いフォーカス動作が可能となる。
【0044】
なお、本実施の形態では、図4に示したAF評価値の算出処理において、8種類のベクトルグループの中からAF評価値の算出対象となるベクトルグループを選択するとき(ステップSA105)、「範囲が広く、且つコントラストが高いベクトルグループ」を選択するようにしたが、例えば単純に「範囲が一番広いベクトルグループ」や「コントラストが一番高いベクトルグループ」を選択するようにしてもよい。また、「範囲の広さ」と「コントラストの高さ」の一方または双方を基準として各グループにランク付けを行い、ランクが上位側に位置する複数のベクトルグループを選択するようにしてもよく、双方の基準によるランク付けでは、一方の基準に重みをつけるようにしてもよい。さらには、ここで述べた以外の1又は複数の基準によって、AF評価値の算出対象となるベクトルグループを1又は複数選択するようにしてもよい。但し、複数のベクトルグループをAF評価値の算出対象とする場合には、各ベクトルグループについてステップSA107で説明した孤立画素の除外処理を行う必要がある。さらに、各ベクトルグループにおいて複数の画素(同一方向のコントラストベクトルを有する画素)が連続している範囲が最も広い集合部分を特定し、特定した各ベクトルグループの集合部分の大きさをそれぞれ比較し、一番大きい集合部分を有するベクトルグループを選択するようにしてもよい。
【0045】
また、最終的なAF評価値の算出に際しては、選択されたベクトルグループ内においてその周辺に同一の輝度方向を有する画素が1つも存在しない孤立点となる画素のコントラスト値を除外するようにしたが、その周辺(8周辺画素)に存在する同一の輝度方向を有する画素の数が所定数以下である画素、例えば同一の輝度方向を有する画素が2つ隣接したもの(2連結画素)や3つ隣接したもの(3連結画素)のコントラスト値を除外するようにしてもよい。
【0046】
また、図4に示したAF評価値の算出処理において、ステップSA106、SA107の処理を行なわないようにし、孤立点となる画素のコントラスト値を除外しないようにしてもよい。
【0047】
また、これとは別に、最終的なAF評価値の算出を、ステップSA106において所定の条件で選択されたベクトルグループについて複数の画素が連続している集合部分を確認し(なお、各々が接する方向は8方向のいずれでもよい)、それらの中で範囲が最も広い(画素が最も多い)最大集合部分を特定し、それを構成している画素のコントラスト値のみを用いて、最終的なAF評価値を算出するようにしてもよい。すなわち、図8に示した画素エリアを図5の元画像100の評価範囲と仮定した場合には、(4,0)と(12,8)とを対角点とする矩形領域内で塗りつぶされている部分が前述した集合部分であり、塗りつぶされている画素のコントラスト値のみを用いて最終的なAF評価値を算出するようにしてもよい。なお、その場合、前述したようにAF評価値の算出対象として複数のベクトルグループを選択するものでは、各ベクトルグループにおいて範囲が最も広い集合部分をそれぞれ構成している画素のコントラスト値を用いて最終的なAF評価値を算出することとなる。
【0048】
一方、ステップSA103で算出するコントラストベクトル(輝度方向のデータ)を図7(a)に示した8種類としたが、それを同図(b)に示した4種類としてもよい。すなわち同図(b)は、3×3[(0,0)〜(2,2)]の画素エリアで、(1,1)の輝度が他の4近傍要素の輝度より高い場合における輝度方向(ベクトル)の表示規則を表したものであり、このように各画素の取りうる輝度方向を4方向としてもよい。その場合には、AF評価値の算出処理に関するデータ処理量を削減することにより、AF制御時にかかるCPU13の負担を軽減させることができる。但し、その場合には前述したステップSA104では各画素のコントラストベクトルを4つのベクトルグループに分けた後、ステップSA105ではその4つのベクトルグループの中から所定のベクトルグループを選択することとなる。なお、その場合においても、前述した本実施の形態とは異なる選択条件(又は選択基準)を適用してもよい。
【0049】
また、本実施の形態においては、AF処理中に、AF評価サイクル(図3参照)毎にAF評価値の算出処理を実行するとき、AF評価値の算出対象とするベクトルグループの選択処理(図4のステップSA105)を毎回実行するようにしたが、2回目以降については選択処理を省いてもよい。すなわち、2回目以降については、1回目に選択(使用)したベクトルグループ(但し、その要素となる画素は変動する)を使用することにより、2回目以降にAF評価値の算出対象とするベクトルグループをロックするようにしてもよい。この場合、図4のステップSA104において、各画素のコントラストベクトルを8つのベクトルグループに分ける処理を行なう必要がなく、単に1回目に選択したベクトルグループの画素を抽出する処理のみ行なうようにすればよい。
【0050】
(第2の実施の形態)
次に第2の実施の形態について説明する。本実施の形態は前記デジタルカメラ1において、前述した図2のAF処理中に、第1の実施の形態とは異なるAF評価値の算出処理を行わせるためのプログラムがROM11に記録されているものである。
【0051】
以下、本実施の形態におけるAF評価値の算出処理を図9に示したフローチャートに従い説明すると、図2のステップSA2で撮像した元画像100から評価画像101を切り出し(ステップSA201)、切り出した評価画像101における各画素のコントラスト値を算出した後(ステップSA202)、各画素のコントラストベクトルを算出し(ステップSA203)、算出した各画素のコントラストベクトルをベクトル方向別にグループ分けする(ステップSA204)。ここまでは、第1の実施の形態で説明した図4のステップSA101〜ステップSA104の処理と同一である。
【0052】
次に、ステップSA204でグループ分けした8つのベクトルグループの各々について、その要素の中に、周辺に同一の輝度方向を有する画素が1つも存在しない孤立点があるか否かを判別する(ステップSA205)。そして、孤立点があれば(ステップSA206でYES)、各ベクトルグループで孤立点となる画素のコントラスト値を、AF評価値の算出に用いるデータから除外した後(ステップSA207)、全てのベクトルグループの(孤立点を除く)画素のコントラスト値、つまり評価画像101の全画素から各ベクトルグループ内で孤立点となる画素を除いた分の画素のコントラスト値を用いてAF評価値を算出する(ステップSA208)。また、全てのベクトルグループにおいて孤立点がなければ(ステップSA206でNO)、全てのベクトルグループの全ての画素のコントラスト値、すなわち評価画像101の全画素のコントラスト値を用いてAF評価値を算出する(ステップSA208)。
【0053】
以上のように本実施の形態においては、AF評価値の算出には、評価画像101の全画素(全てのベクトルグループの要素)から各ベクトルグループ内で孤立点となる画素を除いた分の画素のコントラスト値だけを使用するようにした。このため、第1の実施の形態と同様の理由により、例えば低照度時のように元画像100にノイズが多く含まれている場合であっても、そのノイズ成分が算出したAF評価値に混入しにくくなる。よって、AF評価値のピーク位置を高精度で検出することができ、その結果、精度の高いフォーカス動作が可能となる。
【0054】
なお、本実施の形態においても、最終的なAF評価値の算出に際して除外する孤立点(画素)を、同一ベクトルグループ内においてその周辺に同一の輝度方向を有する画素が1つも存在しないものとしたが、第1の実施の形態と同様に、その周辺に存在する同一のベクトル方向を有する画素が所定数(0乃至3つ等の少数)以下である画素としてもよい。
【0055】
また、これとは別に、最終的なAF評価値の算出に、全てのベクトルグループの(孤立点を除く)画素のコントラスト値を用いるようにしたが、各ベクトルグループの各々について複数の画素が連続している集合部分を確認し(なお、各々が接する方向は8方向のいずれでもよい)、それらの中で範囲が最も広い(画素が最も多い)最大集合部分を特定した後、各々のベクトルグループで最大集合部分を構成している画素のコントラスト値のみを用いて、最終的なAF評価値を算出するようにしてもよい。
【0056】
また、本実施の形態においても、第1の実施の形態で述べたように、ステップSA203で算出するコントラストベクトル(輝度方向のデータ)を8種類とし、ステップSA204では各画素のコントラストベクトルを8つのベクトルグループに分けるようにしたが、コントラストベクトルを4種類とし、各画素のコントラストベクトルを4つのベクトルグループに分け、それに基づきステップSA205以後の処理を行うようにしてもよい。その場合には、AF評価値の算出処理に関するデータ処理量を削減することにより、AF制御時にかかるCPU13の負担を軽減させることができる。
【0057】
(第3の実施の形態)
次に第3の実施の形態について説明する。本実施の形態は前記デジタルカメラ1において、前述した図2のAF処理中に、第1及び第2の実施の形態とは異なるAF評価値の算出処理を行わせるためのプログラムがROM11に記録されているものである。
【0058】
以下、本実施の形態におけるAF評価値の算出処理を図10に示したフローチャートに従い説明する。すなわち図2のステップSA2で撮像した元画像100の全領域について画素毎のコントラスト値を算出した後(ステップSA301)、画素毎のコントラストベクトルを算出し(ステップSA302)、算出した各画素のコントラストベクトルをベクトル方向別にグループ分けする(ステップSA303)。
【0059】
次に、元画像100の全領域の中で、同一方向のコントラストベクトルを有する画素が連続する範囲が広く、且つコントラスト(範囲内の全画素のコントラスト値の合計)が高い集合部分を選択し、その集合部分に対応する画素領域を評価範囲(サーチエリア)として決定する(ステップSA304)。しかる後、決定した評価範囲における全ての画素のコントラスト値を所定の条件式を用いて加算することによりAF評価値を算出する(ステップSA305)。
【0060】
以上のように本実施の形態においては、AF評価値の算出対象となる評価範囲を予め設定せずに、AF評価サイクル(図3参照)毎に評価範囲を設定し、その評価範囲の各画素のコントラスト値に基づきAF評価値を算出する。このため、AF処理の実行中に、被写体が移動したり手ぶれ等で装置本体が動いたりする場合であっても、評価範囲が被写体に追随することとなる。したがって、そのような場合であっても精度の高いフォーカス動作を行うことができる。
【0061】
なお、本実施の形態においては、AF評価サイクル毎にAF評価値の算出対象となる評価範囲を決定するとき(ステップSA304)、先にグループ分けした8つのベクトルグループ(元画像100の全領域)の中から、前述した所定の条件に応じたベクトルグループ(集合部分)を毎回選択するようにしたが、2回目以降についてはそれを省いてもよい。すなわち2回目以降については、1回目に選択した集合部分を有するベクトルグループ(但し、その要素となる画素により形成される画素領域は変動する)を使用することにより、2回目以降の評価範囲の決定に使用するベクトルグループをロックするようにしてもよい。例えば1回目のAF評価値の算出時に選択されたベクトルグループの輝度方向が「左下」であった場合、2回目以降は、「左下」のコントラストベクトルを有する画素のみによって構成される複数の集合部分の中で最も大きい集合部分を評価範囲(サーチエリア)として決定する。その場合には、AF制御の開始当初に捕捉した被写体に、AF評価値の算出対象とする評価範囲をより確実に追従させることができ、フォーカス動作の精度をより一層高めることができる。
【0062】
また、本実施の形態においても、第1及び第2の実施の形態で述べたように、ステップSA302で算出するコントラストベクトル(輝度方向のデータ)を8種類とし、ステップSA303では各画素のコントラストベクトルを8つのベクトルグループに分けるようにしたが、コントラストベクトルを4種類とし、各画素のコントラストベクトルを4つのベクトルグループに分けるようにしてもよい。その場合には、AF評価値の算出処理に関するデータ処理量を削減することにより、AF制御時にかかるCPU13の負担を軽減させることができる。
【0063】
また、以上説明した第1〜第3の実施の形態においては、CPU13がAF制御に際して、フォーカスレンズを近接方向から無限遠方向の全域で移動しAF評価値のピーク位置(合焦位置)をサーチする全域サーチを実施する場合について説明したが、かかる制御だけでなく、例えばAF時間の短縮化を目的として、フォーカスレンズを大きな移動間隔で近接方向から無限遠方向へ移動させて、いったんAF評価値のピーク付近を大まかに判定した後、そのピーク付近の狭い範囲でピーク位置を検出する場合や、サーチ範囲が狭い場合に行われるピークサーチにおいても本発明は有効である。
【0064】
すなわちピークサーチは、図11に示したように、フォーカスレンズを小さな間隔で移動させながら、CCD等による撮像、画像信号の転送及びAD変換、AF評価値の算出といった一連の処理を繰り返し行い(ステップSB1〜SB5)、その間にAF評価値のピークが検出できた時点で(ステップSB4でYES)、検出したピーク位置へフォーカスレンズを移動する(ステップSB6)、フォーカス動作であり、その間のステップSB3におけるAF評価値の算出に本発明を適用すればよい。
【0065】
また、以上説明した第1〜第3の実施の形態において用いられている「画素」は、必ずしもCCD4を構成する画素やメモリカード18に記録される画像データを構成する画素と一致しなくてもよく、例えば、CCD4を構成する複数の画素を1画素(1単位)として1つのコントラスト値及びコントラストベクトルを算出するようにしてもよい。
【0066】
また、以上の説明においては、主として静止画を撮影するデジタルカメラに本発明を採用した場合について説明したが、本発明は、CCD及びその他の撮像素子をセンサとして使用して、コントラスト検出方式のAF制御を行うムービーカメラ等の他のカメラ装置に採用してもよく、その場合においても前述した実施の形態と同様の効果を得ることができる。
【0067】
【発明の効果】
以上説明したように請求項1,8,9,12の発明においては、光学系の合焦位置の判定に使用するAF評価値に、被写体画像のノイズ成分が混入することを阻止したり、ノイズ成分が混入する確率を極めて低くすることができるようにした。よって、精度の高いフォーカス動作が可能となる。
【0068】
また、請求項2の発明においては、AF評価値において被写体画像のノイズ成分の混入を阻止することができるようにした。よって、精度の高いフォーカス動作が可能となる。
【0069】
また、請求項3,4,5,6,7の発明においては、AF評価値に被写体画像のノイズ成分が混入する確率を極めて低くすることができるようにした。よって、精度の高いフォーカス動作が可能となる。
【0070】
また、請求項10の発明においては、光学系を光軸方向に移動させる間に被写体が相対的に移動するとき、被写体画像におけるAF評価範囲の位置が、被写体の移動に追随して設定つまり更新され、更新されたAF評価範囲の画素のコントラスト値に基づきAF評価値が算出されるようにした。よって、被写体が相対的に移動する場合であっても精度の高いフォーカス動作が可能となる。
【0071】
また、請求項11の発明においては、被写体画像におけるAF評価範囲の位置を、被写体の移動に、より確実に追従させることができるようにした。よって、被写体が相対的に移動する場合におけるフォーカス動作の精度をより一層高めることができる。
【0072】
また、請求項13の発明においては、それを用いることにより、コンピュータを有するオートフォーカス装置において本発明の装置及び方法の実施が可能となる。また、既存の装置においてもそれが可能となる。
【図面の簡単な説明】
【図1】本発明の各実施の形態に共通するデジタルカメラの要部を示すブロック構成図である。
【図2】各実施の形態に共通するCPUによるAF処理手順を示すフローチャートである。
【図3】各実施の形態に共通するオートフォーカス制御に関する動作を示すタイミングチャートである。
【図4】第1の実施の形態におけるCPUによるAF評価値の算出処理手順を示すフローチャートである。
【図5】AF評価値の算出に際して使用される元画像、及びその評価範囲を示す図である。
【図6】(a)は元画像の評価範囲に相当する評価画像を示す図、(b)は評価画像から得られるコントラスト画像の一部を示す部分拡大図である。
【図7】(a)はコントラストベクトルの輝度方向の表示規則を示す図、(b)は他の表示規則を示す図である。
【図8】評価画像の一部における各画素のコントラストベクトルを示す図6(b)に対応する模式図である。
【図9】第2の実施の形態におけるCPUによるAF評価値の算出処理手順を示すフローチャートである。
【図10】第3の実施の形態におけるCPUによるAF評価値の算出処理手順を示すフローチャートである。
【図11】CPUによる他のAF処理手順を示すフローチャートである。
【符号の説明】
1  デジタルカメラ
2  フォーカスレンズ
4  CCD
11  ROM
12  RAM
13  CPU
18  メモリカード
100  元画像
101  評価画像
102  コントラスト画像
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to an autofocus device suitable for use in a camera device such as a digital camera and an AF evaluation value acquisition method.
[0002]
[Prior art]
2. Description of the Related Art Conventionally, a contrast detection method is often used for autofocus control (AF control) of a digital camera that captures an image of a subject using a CCD or MOS type solid-state imaging device, converts the image into image data, and records the image data. . Such a method is also employed in digital video cameras, silver halide cameras using a CCD as a sensor, and the like.
[0003]
In the AF control of the contrast detection method, the focus lens is moved to some points in the optical axis direction, and a contrast value (AF evaluation value) in a predetermined range of a subject image captured at each position is calculated. For example, for each pixel in a predetermined range, a contrast value that is a luminance difference from surrounding pixels is obtained, and a total value thereof is calculated. Then, based on the comparison of the AF evaluation values calculated at a plurality of points and the gradient of the changing contrast value, the peak position where the contrast value becomes maximum is determined, and the focus lens is moved with the peak position as the focus position. I have. In such AF control, the evaluation range in the subject image, that is, the range for which the AF evaluation value is to be calculated may be selectable from preset sizes such as spots and wides.
[0004]
[Problems to be solved by the invention]
However, in the conventional autofocus method, even if the size and position of the evaluation range can be selected, all the contrast values within the evaluation range are related to the evaluation value. Therefore, for example, when there is much noise in the subject image as in the case of low illuminance, the noise component tends to be mixed into the AF evaluation value, and the detection accuracy of the peak position is reduced.
[0005]
In addition, during the detection of the peak position, the evaluation range needs to be fixed to some extent in the subject image (to such an extent that a high-contrast portion of the evaluation range remains in the evaluation range). For this reason, when the subject moves or the apparatus body moves due to camera shake or the like during the detection period of the peak position, there is a problem that a deviation occurs between the peak position where the AF evaluation value is maximum and the focusing position. Was.
[0006]
The present invention has been made in view of such conventional problems, and has as its object to provide an autofocus apparatus capable of performing a highly accurate focus operation, an AF evaluation value acquisition method, and a program used for realizing them. And
[0007]
[Means for Solving the Problems]
In order to solve the above problem, according to the first aspect of the present invention, an image of a subject is taken while moving an optical system in an optical axis direction, and an AF evaluation value is obtained based on a contrast value for each pixel of the taken subject image. In an autofocus apparatus that determines a focus position of an optical system based on an acquired AF evaluation value, a direction of a height relationship between contrast values of each pixel and peripheral pixels is determined based on a contrast value of each pixel included in the subject image. Acquisition means for acquiring the vector data indicated by, a decision means for deciding a pixel for which the AF evaluation value is to be calculated based on the vector data of a plurality of pixels acquired by the acquisition means, and a pixel decided by the decision means And a calculating means for calculating the AF evaluation value based on the contrast value.
[0008]
In such a configuration, the AF evaluation value sequentially acquired while the optical system is moved in the optical axis direction indicates, in the direction, the level relationship of the contrast value of each pixel among the pixels constituting the subject image with the surrounding pixels. It is calculated based on the contrast value of only a predetermined pixel determined according to the vector data. Therefore, it is possible to prevent the noise component of the subject image from being mixed into the AF evaluation value used for determining the focus position of the optical system, or to extremely reduce the probability that the noise component is mixed.
[0009]
Further, in the invention according to claim 2, when determining a pixel for which an AF evaluation value is to be calculated, the determining unit determines, among pixels having the same direction indicated by the vector data, pixels which are adjacent to each other. Where the number of pixels is equal to or less than a predetermined number, that is, pixels having the same direction are not adjacent at all (isolated pixels) and pixels having the same direction are adjacent to each other by a predetermined number or less (connected pixels) And were excluded.
[0010]
In such a configuration, the AF evaluation value is calculated based on the contrast value of only pixels that exclude pixels that are likely to be affected by noise among the pixels that form the subject image. Therefore, it is possible to prevent the noise component of the subject image from being mixed in the AF evaluation value.
[0011]
Further, in the invention according to claim 3, the determining means divides the pixels constituting the subject image into vector groups for each direction of the vector data, and includes pixels included in the vector group selected based on a predetermined condition. Is determined as a pixel for which the AF evaluation value is to be calculated.
[0012]
In such a configuration, the AF evaluation value is calculated based on the contrast values of only the pixels that contribute to the determination of the focus position of the optical system among the pixels that form the subject image. Therefore, the probability that the noise component of the subject image is mixed in the AF evaluation value can be extremely reduced.
[0013]
In the invention according to claim 4, the predetermined condition includes a size of an aggregate composed of a plurality of pixels in which the vector data adjacent to each other are the same.
[0014]
Even in such a configuration, the probability that the noise component of the subject image is mixed in the AF evaluation value can be extremely reduced.
Further, in the invention according to claim 5, the predetermined condition includes the number of pixels whose directions indicated by the vector data are the same.
[0015]
Even in such a configuration, the probability that the noise component of the subject image is mixed in the AF evaluation value can be extremely reduced.
[0016]
Further, in the invention of claim 6, the predetermined condition includes a magnitude of a contrast value for each vector group.
[0017]
Even in such a configuration, the probability that the noise component of the subject image is mixed in the AF evaluation value can be extremely reduced.
[0018]
Further, in the invention according to claim 7, the deciding means decides, from among the pixels included in the vector group selected based on a predetermined condition, a pixel constituting an aggregate part in which pixels adjacent to each other are the largest. , Are determined as pixels for which AF evaluation values are calculated.
[0019]
Even in such a configuration, the probability that the noise component of the subject image is mixed in the AF evaluation value can be extremely reduced.
[0020]
Further, in the invention according to claim 8, the acquisition unit is configured to determine, based on a contrast value for each pixel included in the AF evaluation area in the subject image, a contrast value between each pixel in the AF evaluation area and a peripheral pixel. Obtaining vector data indicating the height relationship in the direction, wherein the determining unit determines a pixel to be calculated for the AF evaluation value in the AF evaluation area based on the vector data of a plurality of pixels obtained by the obtaining unit. It was decided.
[0021]
In such a configuration, the AF evaluation values sequentially acquired while the optical system is moved in the optical axis direction are different from the pixels constituting the AF evaluation area in the subject image in the level of the contrast value between each pixel and the surrounding pixels. It is calculated based on a contrast value of only a predetermined pixel determined according to vector data indicating a relationship in a direction. Therefore, it is possible to prevent the noise component in the AF evaluation area from being mixed into the AF evaluation value used for determining the focus position of the optical system, or to extremely reduce the probability that the noise component is mixed.
[0022]
In the ninth aspect of the invention, the contrast value of each pixel of the subject image is a value indicating a difference between the luminance value of the pixel and the luminance values of peripheral pixels.
[0023]
According to the tenth aspect of the present invention, an image of a subject is taken while moving the optical system in the optical axis direction, and an AF evaluation value is obtained based on a contrast value for each pixel of the taken subject image. In an autofocus device that determines a focus position of an optical system based on a value, based on a contrast value of each pixel forming the subject image, vector data indicating a direction of a height relationship of a contrast value between each pixel and a peripheral pixel is obtained. Acquiring means for acquiring, setting means for setting an AF evaluation range of the subject image for which the AF evaluation value is to be calculated based on the vector data of a plurality of pixels acquired by the acquiring means, and setting by the setting means Calculating means for calculating the AF evaluation value based on the contrast value of the pixel in the AF evaluation range.
[0024]
In such a configuration, when the subject relatively moves while the optical system is moved in the optical axis direction, the position of the AF evaluation range in the subject image is set or updated following the movement of the subject and updated. An AF evaluation value is calculated based on the contrast values of the pixels in the AF evaluation range.
[0025]
Further, in the invention according to claim 11, the setting unit divides the pixels constituting the subject image into vector groups for each direction of the vector data, and sets the pixels included in the vector group selected based on a predetermined condition. Of these, the set portion having the largest number of pixels adjacent to each other is set as the AF evaluation range.
[0026]
In such a configuration, the position of the AF evaluation range in the subject image can more reliably follow the movement of the subject.
[0027]
According to the twelfth aspect of the present invention, an image of a subject is taken while moving the optical system in the optical axis direction, and an AF evaluation value is obtained based on a contrast value for each pixel of the taken subject image. A method of acquiring the AF evaluation value in autofocus control for determining a focus position of an optical system based on a contrast value, wherein a contrast between each pixel and peripheral pixels is determined based on a contrast value of each pixel included in the subject image. A step of obtaining vector data indicating the direction of the height of the value, a step of determining a pixel for which the AF evaluation value is to be calculated based on the obtained vector data of a plurality of pixels, and a step of determining the AF based on the determined contrast value of the pixel. And a step of calculating an evaluation value.
[0028]
According to such a method, the AF evaluation value sequentially acquired while the optical system is moved in the optical axis direction is determined by the direction of the contrast value of each pixel among the pixels constituting the subject image with respect to the surrounding pixels. Is calculated based on the contrast value of only predetermined pixels determined in accordance with the vector data indicated by. Therefore, it is possible to prevent the noise component of the subject image from being mixed into the AF evaluation value used for determining the focus position of the optical system, or to extremely reduce the probability that the noise component is mixed.
[0029]
Further, according to the invention of claim 13, an image of a subject is taken while moving the optical system in the optical axis direction, an AF evaluation value is obtained based on a contrast value for each pixel of the taken subject image, and the obtained AF evaluation A computer having an autofocus device that determines an in-focus position of an optical system based on a value indicates a direction of a height relationship between contrast values of each pixel and peripheral pixels based on a contrast value of each pixel constituting the subject image. Obtaining means for obtaining vector data, determining means for determining a pixel for which the AF evaluation value is to be calculated based on vector data of a plurality of pixels obtained by the obtaining means, and contrast of the pixel determined by the determining means This is a program for functioning as a calculating means for calculating the AF evaluation value based on the value.
[0030]
BEST MODE FOR CARRYING OUT THE INVENTION
An embodiment of the present invention will be described below with reference to the drawings.
(First Embodiment)
FIG. 1 is a block diagram of a digital camera 1 showing an embodiment of the present invention. The digital camera 1 has an AF function, and includes a focus lens 2, a zoom lens 3, a CCD 4, a CDS / AD block 5, a TG (Timing Generator) 6, a CCD data pre-processing block 7, a color processing (CP). A block 8, a JPEG encoder 9, a DRAM 10, a ROM 11, a RAM 12, a CPU 13, an image display unit 14, a key block 15, a card interface 16, and a motor drive block 17 are provided. A memory card 18 detachably mounted in a card slot of the main body is connected.
[0031]
Each of the focus lens 2 and the zoom lens 3 is composed of a lens group (not shown). The motor drive block 17 includes a focus motor 170a for driving the focus lens 2 in the optical axis direction, a zoom motor 170b for driving the zoom lens 3 in the optical axis direction, and a focus motor 170a and a zoom motor 170b in accordance with a control signal sent from the CPU 13. And motor drivers 171a and 171b for driving the respective components.
[0032]
The CCD 4 photoelectrically converts the subject image projected via the focus lens 2 and the zoom lens 3 and outputs the image as an imaging signal. The TG 6 drives the CCD 4 by generating a timing signal of a predetermined frequency. The CDS / AD block 5 samples the output signal from the CCD 4, removes noise, and converts it into a digital signal. The CCD data pre-processing block 7 performs data processing such as luminance signal processing on the imaging signal converted into a digital signal. The color processing (CP) block 8 performs color processing such as color separation on the image signal on which the luminance signal processing and the like have been performed, and generates Y, Cb, and Cr image data. The DRAM 10 sequentially stores the Y, Cb, and Cr image data after the color processing.
[0033]
The image display unit 14 includes a color LCD, a driving circuit for driving the color LCD, and the like. When the shutter key is not pressed while the shooting mode is set (shooting standby state), the image is taken in from the CCD 4 and stored in the DRAM 10. A through image based on the stored image data for one frame (screen) is displayed, and in a state where the reproduction mode is set, a recorded image read from the memory card 18 and based on the expanded image data is displayed. When recording an image, the JPEG encoder 9 compresses the image data input from the color processing (CP) block 8 by JPEG. The memory card 18 records the compressed image data sent via the card interface 16. The recorded image data is read out when the recorded image is reproduced, decompressed by the JPEG encoder 9, and displayed on the image display unit 14. The key block 15 includes a switching key used for switching operations between a shooting mode and a reproduction mode, and various operation keys such as a shutter key, and sends an operation signal corresponding to a key operation to the CPU 13.
[0034]
The ROM 11 stores programs and various data necessary for control of the digital camera 1 by the CPU 13, that is, AF control, AE control, AWB control, and the like. The CPU 13 stores an operation signal from the key block 15 and the program. Operates as a working memory, thereby functioning as an acquisition unit, a determination unit, a calculation unit, and a setting unit of the present invention.
[0035]
Note that the program need not always be stored in the ROM 11, but may be stored in a predetermined area of the memory card 18, for example. In addition, as long as the program includes a rewritable memory such as an EEPROM in addition to the memory card 18, the program may be supplied to the memory from another device by an arbitrary method such as communication.
[0036]
Next, the operation of the digital camera 1 having the above configuration will be described. FIG. 2 is a flowchart showing an outline of the AF processing in the digital camera 1. The AF processing in the present embodiment is based on the contrast detection method described in the related art. In the AF processing, the moving range of the focus lens is set to the entire area from the end point in the close direction to the end point in the infinity direction. , A series of processes such as imaging (exposure) by a CCD or the like, transfer of an image signal, AD conversion, and calculation of an AF evaluation value (contrast value) are repeatedly performed (steps SA1 to SA4). FIG. 3 is a timing chart showing the operation timing during this period, and the above-described series of processing is performed in the illustrated AF evaluation cycle. When the calculation of the AF evaluation value for each point is completed (YES in step SA5), a peak position at which the AF evaluation value becomes maximum is calculated (step SA6), and the focus lens is moved to the peak position (step SA6). SA7).
[0037]
On the other hand, FIG. 4 is a flowchart showing details of the AF evaluation value calculation process (step SA4) performed for each AF evaluation cycle. Hereinafter, the description will be made assuming that the image (hereinafter, the original image) 100 as shown in FIG. In this process, first, pixel data in an (AF area) evaluation range (center of the screen in the figure) of a predetermined position and size is cut out from the original image 100 (step SA101). The evaluation range (search area) is an area that is fixedly set or an area that is selected (or automatically) by a user from a plurality of areas prepared in advance.
[0038]
Next, a contrast value of each pixel is calculated based on the luminance component data of each pixel of the image 101 (hereinafter referred to as an evaluation image) in the cut-out evaluation range as shown in FIG. 6A (step SA102). Specifically, after the evaluation image 101 is once converted to black and white (only the luminance signal is extracted), a contrast value, which is a luminance difference between each pixel and surrounding pixels, is calculated. To obtain a contrast image 102 in which the magnitude of the contrast value is expressed by the brightness. FIG. 6B is a partially enlarged view of the contrast image 102 corresponding to a part (A part) of the evaluation image 101. It should be noted that the image processing such as obtaining the contrast image 102 based on the contrast ratio may not be performed, and the contrast value of each pixel may be simply calculated. Instead of calculating the contrast value from the black and white image, the contrast value may be obtained by another method.
[0039]
Subsequently, a contrast vector is calculated based on the contrast value (contrast image 102) of each pixel in the evaluation image 101 calculated in step SA102 (step SA103). When calculating a contrast vector based on the contrast image 102, the contrast vector is data indicating a relative luminance relationship between each pixel and a peripheral pixel in a direction (luminance direction). In the embodiment, the calculation is performed based on the luminance relationship between the target pixel and its eight neighboring pixels. That is, FIG. 7A shows the luminance direction when the luminance of (1, 1) is higher than the luminance of the other eight neighboring elements in a pixel area of 3 × 3 [(0, 0) to (2, 2)]. This represents the display rule of (vector). In the present embodiment, the possible luminance directions of each pixel are the eight directions shown in the drawing. FIG. 8 is a schematic diagram showing the contrast vectors of the respective pixels in the region corresponding to FIG. 6B. In the pixels adjacent to each other near the edge of the subject, the contrast vectors are the same. Tends to be the direction.
[0040]
Next, the calculated contrast vectors of the respective pixels are grouped according to the vector (luminance) direction (step SA104), and, among the eight vector groups, the range is wide (the number of pixels having vectors in the same direction is large). A vector group having a large number and a high contrast (sum of the contrast values of all the pixels in the group) is selected (step SA105). Subsequently, it is determined whether or not there is an isolated point among the elements (each pixel having the same luminance direction) of the selected vector group, that is, an isolated point around which no pixel having the same luminance direction exists. Step SA106).
[0041]
Note that FIG. 8 shown above is a diagram in which, when the luminance direction of the vector group that matches the selection condition in step SA105 is “lower left”, the elements (pixels) of the vector group are painted out. In the area, pixels (5, 12) among the pixels (0, 0) to (18, 18) are isolated points, and the isolated points are different from the edge portions of the subject and have noise. Will appear in the part.
[0042]
If there is an isolated point as described above (YES in step SA106), the contrast value of the pixel serving as the isolated point is excluded from the data used for calculating the AF evaluation value (step SA107), and a predetermined value is determined in step SA105. The AF evaluation value is calculated by adding the contrast values of the pixels (excluding the isolated points) of the vector group selected based on the selection condition using a predetermined conditional expression (step SA108). If there is no isolated point (NO in step SA106), the AF evaluation value is calculated by adding the contrast values of all the pixels of the selected vector group using a predetermined conditional expression (step SA108).
[0043]
As described above, in the present embodiment, the calculation of the AF evaluation value uses the contrast of the remaining pixels excluding the elements of the vector group selected under the above-described conditions and excluding the pixels that are isolated points in the group. Use only values. Here, as described above, the isolated point appears in a portion different from the edge portion of the subject and in a portion where noise exists in the evaluation range of the original image 100, and thus, for example, as in the case of low illuminance, Even if 100 contains a lot of noise, it becomes difficult for that noise component to be mixed into the calculated AF evaluation value. Therefore, the peak position of the AF evaluation value can be detected with high accuracy, and as a result, a highly accurate focus operation can be performed.
[0044]
In the present embodiment, when selecting a vector group for which an AF evaluation value is to be calculated from the eight types of vector groups in the AF evaluation value calculation process shown in FIG. Although a vector group having a wide range and a high contrast is selected, for example, a vector group having the widest range and a vector group having the highest contrast may be simply selected. In addition, each group may be ranked based on one or both of “extent of the range” and “height of the contrast”, and a plurality of vector groups having higher ranks may be selected. In ranking based on both criteria, one of the criteria may be weighted. Further, one or a plurality of vector groups for which an AF evaluation value is to be calculated may be selected based on one or more criteria other than those described above. However, when a plurality of vector groups are to be calculated for the AF evaluation value, it is necessary to perform the isolated pixel exclusion processing described in step SA107 for each vector group. Further, in each vector group, a set portion in which a plurality of pixels (pixels having a contrast vector in the same direction) are continuous is specified to be the largest, and the size of the set portion of each specified vector group is compared. The vector group having the largest aggregate part may be selected.
[0045]
Also, when calculating the final AF evaluation value, the contrast value of a pixel that is an isolated point in which no pixel having the same luminance direction exists around the selected vector group is excluded. A pixel in which the number of pixels having the same luminance direction existing therearound (eight peripheral pixels) is equal to or less than a predetermined number, for example, two adjacent pixels having the same luminance direction (two connected pixels) or three pixels Contrast values of adjacent pixels (three connected pixels) may be excluded.
[0046]
Further, in the calculation process of the AF evaluation value shown in FIG. 4, the processes of steps SA106 and SA107 may not be performed, and the contrast value of the pixel serving as an isolated point may not be excluded.
[0047]
Separately from this, the final AF evaluation value is calculated by confirming a set portion where a plurality of pixels are continuous in the vector group selected under the predetermined condition in step SA106 (note that the direction in which each pixel contacts each other). May be any of eight directions), and specifies the largest aggregate portion having the widest range (most pixels) among them, and uses only the contrast values of the pixels constituting the largest aggregate portion to determine the final AF evaluation The value may be calculated. That is, assuming that the pixel area shown in FIG. 8 is the evaluation range of the original image 100 in FIG. 5, the pixel area is filled in a rectangular area having (4, 0) and (12, 8) as diagonal points. The portion indicated by the dotted line is the above-described aggregated portion, and the final AF evaluation value may be calculated using only the contrast value of the filled pixel. In this case, as described above, in the case where a plurality of vector groups are selected as the calculation target of the AF evaluation value, the final value is determined using the contrast value of the pixel constituting each of the aggregate portions having the widest range in each vector group. A typical AF evaluation value is calculated.
[0048]
On the other hand, the eight types of contrast vectors (data in the luminance direction) calculated in step SA103 are shown in FIG. 7A, but may be four types shown in FIG. 7B. That is, FIG. 11B shows a luminance direction when the luminance of (1, 1) is higher than the luminance of the other four neighboring elements in a pixel area of 3 × 3 [(0, 0) to (2, 2)]. This is a display rule of (vector), and thus, the luminance direction that each pixel can take may be four directions. In this case, the load on the CPU 13 during the AF control can be reduced by reducing the amount of data processing related to the AF evaluation value calculation process. However, in this case, after the contrast vector of each pixel is divided into four vector groups in step SA104 described above, a predetermined vector group is selected from the four vector groups in step SA105. In this case, a selection condition (or selection criterion) different from the above-described embodiment may be applied.
[0049]
Further, in the present embodiment, during the AF process, when the calculation process of the AF evaluation value is executed for each AF evaluation cycle (see FIG. 3), the process of selecting the vector group for which the AF evaluation value is to be calculated (see FIG. The fourth step SA105) is executed every time, but the selection process may be omitted for the second and subsequent times. In other words, for the second and subsequent times, the vector group selected (used) for the first time (however, the element pixels vary) is used to calculate the vector group for which the AF evaluation value is to be calculated for the second and subsequent times. May be locked. In this case, in step SA104 in FIG. 4, it is not necessary to perform the process of dividing the contrast vector of each pixel into eight vector groups, and only the process of extracting the pixels of the first selected vector group may be performed. .
[0050]
(Second embodiment)
Next, a second embodiment will be described. In the present embodiment, a program for causing the digital camera 1 to perform an AF evaluation value calculation process different from that of the first embodiment during the AF process of FIG. It is.
[0051]
Hereinafter, the calculation process of the AF evaluation value in the present embodiment will be described with reference to the flowchart shown in FIG. 9. The evaluation image 101 is cut out from the original image 100 captured in step SA2 in FIG. 2 (step SA201), and the cut out evaluation image After calculating the contrast value of each pixel in 101 (step SA202), the contrast vector of each pixel is calculated (step SA203), and the calculated contrast vectors of each pixel are grouped by vector direction (step SA204). Up to this point, the processing is the same as the processing of steps SA101 to SA104 in FIG. 4 described in the first embodiment.
[0052]
Next, for each of the eight vector groups grouped in step SA204, it is determined whether or not there is an isolated point in the element where no pixel having the same luminance direction exists in the periphery (step SA205). ). If there is an isolated point (YES in step SA206), the contrast value of the pixel that becomes an isolated point in each vector group is excluded from the data used for calculating the AF evaluation value (step SA207), and then all of the vector groups are deleted. An AF evaluation value is calculated using a contrast value of a pixel (excluding an isolated point), that is, a contrast value of a pixel obtained by removing a pixel that becomes an isolated point in each vector group from all pixels of the evaluation image 101 (step SA208). ). If there are no isolated points in all the vector groups (NO in step SA206), the AF evaluation value is calculated using the contrast values of all the pixels of all the vector groups, that is, the contrast values of all the pixels of the evaluation image 101. (Step SA208).
[0053]
As described above, in the present embodiment, the calculation of the AF evaluation value is performed by subtracting pixels that are isolated points in each vector group from all pixels (elements of all vector groups) of the evaluation image 101. Only the contrast value of is used. For this reason, for the same reason as in the first embodiment, even if the original image 100 contains a lot of noise, for example, at low illuminance, the noise component is mixed in the calculated AF evaluation value. It becomes difficult to do. Therefore, the peak position of the AF evaluation value can be detected with high accuracy, and as a result, a highly accurate focus operation can be performed.
[0054]
Also in the present embodiment, the isolated points (pixels) to be excluded when calculating the final AF evaluation value are such that no pixel having the same luminance direction exists around the same point in the same vector group. However, as in the first embodiment, the number of pixels having the same vector direction existing therearound may be a predetermined number (a small number such as 0 to 3) or less.
[0055]
Separately from this, the contrast values of the pixels (excluding the isolated points) of all the vector groups are used in the calculation of the final AF evaluation value. After confirming the set parts that are in contact with each other (the directions in which they contact each other may be any of eight directions), and specifying the largest set part having the largest range (most pixels) among them, The final AF evaluation value may be calculated using only the contrast values of the pixels constituting the maximum aggregate part.
[0056]
Also in this embodiment, as described in the first embodiment, eight types of contrast vectors (data in the luminance direction) calculated in step SA203 are used, and in step SA204, eight contrast vectors are calculated for each pixel. Although the contrast vector is divided into four groups, the contrast vector of each pixel may be divided into four vector groups, and the processing after step SA205 may be performed based on the divided contrast vectors. In this case, the load on the CPU 13 during the AF control can be reduced by reducing the amount of data processing related to the AF evaluation value calculation process.
[0057]
(Third embodiment)
Next, a third embodiment will be described. In the present embodiment, a program for causing the digital camera 1 to perform an AF evaluation value calculation process different from the first and second embodiments during the above-described AF process of FIG. Is what it is.
[0058]
Hereinafter, the process of calculating the AF evaluation value in the present embodiment will be described with reference to the flowchart shown in FIG. That is, after calculating a contrast value for each pixel for the entire region of the original image 100 captured in step SA2 in FIG. 2 (step SA301), a contrast vector for each pixel is calculated (step SA302), and the calculated contrast vector for each pixel is calculated. Are grouped by vector direction (step SA303).
[0059]
Next, in the entire region of the original image 100, an aggregate portion in which the range in which pixels having the same direction of the contrast vector are continuous is wide and the contrast (the sum of the contrast values of all the pixels in the range) is high is selected. A pixel region corresponding to the set portion is determined as an evaluation range (search area) (step SA304). Thereafter, the AF evaluation value is calculated by adding the contrast values of all the pixels in the determined evaluation range using a predetermined conditional expression (step SA305).
[0060]
As described above, in the present embodiment, the evaluation range to be calculated for the AF evaluation value is not set in advance, but the evaluation range is set for each AF evaluation cycle (see FIG. 3), and each pixel in the evaluation range is set. The AF evaluation value is calculated based on the contrast value of. Therefore, even when the subject moves or the apparatus body moves due to camera shake during the execution of the AF process, the evaluation range follows the subject. Therefore, even in such a case, a highly accurate focus operation can be performed.
[0061]
In the present embodiment, when determining an evaluation range for which an AF evaluation value is to be calculated for each AF evaluation cycle (step SA304), the eight vector groups (the entire area of the original image 100) that have been previously grouped are used. , The vector group (set part) according to the above-mentioned predetermined condition is selected each time, but it may be omitted for the second and subsequent times. In other words, for the second and subsequent times, the evaluation range for the second and subsequent times is determined by using the vector group having the set portion selected for the first time (however, the pixel area formed by the pixels as its elements fluctuates). May be locked. For example, if the luminance direction of the vector group selected at the time of the first calculation of the AF evaluation value is “lower left”, the second and subsequent times include a plurality of aggregate portions composed only of pixels having a “lower left” contrast vector. Is determined as the evaluation range (search area). In this case, the subject captured at the beginning of the AF control can more reliably follow the evaluation range for which the AF evaluation value is calculated, and the accuracy of the focus operation can be further improved.
[0062]
Also in the present embodiment, as described in the first and second embodiments, eight types of contrast vectors (data in the luminance direction) calculated in step SA302 are used, and in step SA303, the contrast vector of each pixel is calculated. Is divided into eight vector groups, but four types of contrast vectors may be used, and the contrast vector of each pixel may be divided into four vector groups. In this case, the load on the CPU 13 during the AF control can be reduced by reducing the amount of data processing related to the AF evaluation value calculation process.
[0063]
In the first to third embodiments described above, the CPU 13 moves the focus lens in the entire range from the approach direction to the infinity direction during the AF control, and searches for the peak position (focus position) of the AF evaluation value. The case where the entire area search is performed has been described. In addition to such control, for example, for the purpose of shortening the AF time, the focus lens is moved from the approach direction to the infinity direction at a large movement interval, and the AF evaluation value is temporarily set. The present invention is also effective in a case where after roughly determining the vicinity of the peak, a peak position is detected in a narrow range around the peak, or in a peak search performed when the search range is narrow.
[0064]
That is, in the peak search, as shown in FIG. 11, a series of processes such as imaging by a CCD or the like, transfer of an image signal, AD conversion, and calculation of an AF evaluation value are repeatedly performed while moving the focus lens at a small interval (step S1). SB1 to SB5), when a peak of the AF evaluation value can be detected during that time (YES in step SB4), the focus lens is moved to the detected peak position (step SB6), and the focus operation is performed. The present invention may be applied to the calculation of the AF evaluation value.
[0065]
Further, the “pixel” used in the first to third embodiments described above does not necessarily match the pixel forming the CCD 4 or the pixel forming the image data recorded on the memory card 18. For example, one contrast value and one contrast vector may be calculated using a plurality of pixels constituting the CCD 4 as one pixel (one unit).
[0066]
Further, in the above description, the case where the present invention is mainly applied to a digital camera for photographing a still image has been described. However, the present invention uses a CCD and another image sensor as a sensor to detect a contrast detection AF. The present invention may be applied to another camera device such as a movie camera that performs control, and in such a case, the same effect as in the above-described embodiment can be obtained.
[0067]
【The invention's effect】
As described above, according to the first, eighth, ninth, and twelfth aspects of the present invention, it is possible to prevent the noise component of the subject image from being mixed into the AF evaluation value used for determining the focus position of the optical system. The probability that components are mixed can be extremely reduced. Therefore, a highly accurate focus operation can be performed.
[0068]
According to the second aspect of the present invention, it is possible to prevent the noise component of the subject image from being mixed in the AF evaluation value. Therefore, a highly accurate focus operation can be performed.
[0069]
Further, in the third, fourth, fifth, sixth and seventh aspects of the present invention, the probability that the noise component of the subject image is mixed in the AF evaluation value can be made extremely low. Therefore, a highly accurate focus operation can be performed.
[0070]
According to the tenth aspect, when the subject relatively moves while moving the optical system in the optical axis direction, the position of the AF evaluation range in the subject image is set, that is, updated, following the movement of the subject. Then, the AF evaluation value is calculated based on the updated contrast value of the pixel in the AF evaluation range. Therefore, a highly accurate focusing operation is possible even when the subject relatively moves.
[0071]
In the invention of claim 11, the position of the AF evaluation range in the subject image can be made to more reliably follow the movement of the subject. Therefore, the accuracy of the focus operation when the subject relatively moves can be further improved.
[0072]
According to the invention of claim 13, by using the same, the apparatus and method of the present invention can be implemented in an autofocus apparatus having a computer. This is also possible with existing devices.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a main part of a digital camera common to each embodiment of the present invention.
FIG. 2 is a flowchart showing an AF processing procedure by a CPU common to the embodiments.
FIG. 3 is a timing chart showing an operation related to autofocus control common to the embodiments.
FIG. 4 is a flowchart illustrating a procedure for calculating an AF evaluation value by a CPU according to the first embodiment;
FIG. 5 is a diagram showing an original image used for calculating an AF evaluation value and an evaluation range thereof.
6A is a diagram illustrating an evaluation image corresponding to an evaluation range of an original image, and FIG. 6B is a partially enlarged view illustrating a part of a contrast image obtained from the evaluation image.
7A is a diagram illustrating a display rule of a contrast vector in a luminance direction, and FIG. 7B is a diagram illustrating another display rule.
FIG. 8 is a schematic diagram corresponding to FIG. 6B showing a contrast vector of each pixel in a part of the evaluation image.
FIG. 9 is a flowchart illustrating a procedure for calculating an AF evaluation value by a CPU according to the second embodiment;
FIG. 10 is a flowchart illustrating a procedure for calculating an AF evaluation value by a CPU according to the third embodiment;
FIG. 11 is a flowchart showing another AF processing procedure by the CPU.
[Explanation of symbols]
1 Digital camera
2 Focus lens
4 CCD
11 ROM
12 RAM
13 CPU
18 Memory card
100 original image
101 Evaluation image
102 Contrast image

Claims (13)

光学系を光軸方向に移動させながら被写体を撮像し、撮像した被写体画像の画素毎のコントラスト値に基づきAF評価値を取得し、取得したAF評価値に基づき光学系の合焦位置を判定するオートフォーカス装置において、
前記被写体画像を構成する画素毎のコントラスト値に基づき、各画素について周辺画素とのコントラスト値の高低関係を方向で示すベクトルデータを取得する取得手段と、
この取得手段により取得された複数画素のベクトルデータに基づき前記AF評価値の算出対象となる画素を決定する決定手段と、
この決定手段により決められた画素のコントラスト値に基づき前記AF評価値を算出する算出手段と
を備えたことを特徴とするオートフォーカス装置。
An image of a subject is taken while moving the optical system in the optical axis direction, an AF evaluation value is obtained based on a contrast value for each pixel of the taken subject image, and a focus position of the optical system is determined based on the obtained AF evaluation value. In an autofocus device,
An acquisition unit configured to acquire vector data indicating a direction of a height relationship of a contrast value between each pixel and peripheral pixels based on a contrast value of each pixel included in the subject image;
Determining means for determining a pixel for which the AF evaluation value is to be calculated based on the vector data of a plurality of pixels acquired by the acquiring means;
Calculating means for calculating the AF evaluation value based on the contrast value of the pixel determined by the determining means.
前記決定手段は、AF評価値の算出対象となる画素の決定に際し、前記ベクトルデータにより示される方向が同一である画素のうち、互いに隣接しあう画素の数が所定数以下である画素を除外することを特徴とする請求項1記載のオートフォーカス装置。The determining means excludes, when deciding a pixel for which an AF evaluation value is to be calculated, pixels in which the number of pixels adjacent to each other is equal to or less than a predetermined number among pixels having the same direction indicated by the vector data. The autofocus device according to claim 1, wherein: 前記決定手段は、被写体画像を構成する画素を前記ベクトルデータの方向別のベクトルグループに分けるとともに、所定の条件に基づき選択したベクトルグループに含まれる画素を、AF評価値の算出対象となる画素として決定することを特徴とする請求項1又は2記載のオートフォーカス装置。The deciding means divides the pixels constituting the subject image into vector groups for each direction of the vector data, and regards the pixels included in the vector group selected based on a predetermined condition as pixels for which an AF evaluation value is to be calculated. 3. The autofocus device according to claim 1, wherein the autofocus device is determined. 前記所定の条件は、互いに隣接した前記ベクトルデータが同一である複数画素からなる集合体の大きさを含むことを特徴とする請求項3記載のオートフォーカス装置。4. The autofocus apparatus according to claim 3, wherein the predetermined condition includes a size of an aggregate including a plurality of pixels in which the vector data adjacent to each other are the same. 前記所定の条件は、前記ベクトルデータにより示される方向が同一である画素の数を含むことを特徴とする請求項3又は4記載のオートフォーカス装置。The autofocus apparatus according to claim 3, wherein the predetermined condition includes a number of pixels whose directions indicated by the vector data are the same. 前記所定の条件は、ベクトルグループ毎のコントラスト値の大きさを含むことを特徴とする請求項3乃至5のいずれかに記載のオートフォーカス装置。6. The autofocus apparatus according to claim 3, wherein the predetermined condition includes a magnitude of a contrast value for each vector group. 前記決定手段は、所定の条件に基づき選択したベクトルグループに含まれる画素のうち、互いに隣接しあう画素が最も多い集合部分を構成している画素を、AF評価値の算出対象となる画素として決定することを特徴とする請求項3乃至6のいずれかに記載のオートフォーカス装置。The determining means determines, as pixels to be calculated for an AF evaluation value, a pixel included in a vector group selected based on a predetermined condition and which constitutes an aggregate portion having the largest number of pixels adjacent to each other. 7. The auto-focusing device according to claim 3, wherein 前記取得手段は、前記被写体画像中のAF評価エリアに含まれる画素毎のコントラスト値に基づき、AF評価エリア内の各画素について周辺画素とのコントラスト値の高低関係を方向で示すベクトルデータを取得し、
前記決定手段は、前記取得手段により取得された複数画素のベクトルデータに基づき、前記AF評価エリア内において前記AF評価値の算出対象となる画素を決定することを特徴とする請求項1乃至7のいずれかに記載のオートフォーカス装置。
The obtaining means obtains vector data indicating a direction of a height relationship of a contrast value between each pixel in the AF evaluation area and peripheral pixels based on a contrast value of each pixel included in the AF evaluation area in the subject image. ,
8. The method according to claim 1, wherein the determining unit determines a pixel for which the AF evaluation value is to be calculated in the AF evaluation area based on vector data of a plurality of pixels acquired by the acquiring unit. 9. The autofocus device according to any one of the above.
前記被写体画像の画素毎のコントラスト値は、該画素の輝度値とその周辺画素の輝度値との差を示す値であることを特徴とする請求項1乃至8のいずれかに記載のオートフォーカス装置。9. The autofocus apparatus according to claim 1, wherein the contrast value of each pixel of the subject image is a value indicating a difference between a luminance value of the pixel and luminance values of peripheral pixels. . 光学系を光軸方向に移動させながら被写体を撮像し、撮像した被写体画像の画素毎のコントラスト値に基づきAF評価値を取得し、取得したAF評価値に基づき光学系の合焦位置を判定するオートフォーカス装置において、
前記被写体画像を構成する画素毎のコントラスト値に基づき、各画素について周辺画素とのコントラスト値の高低関係を方向で示すベクトルデータを取得する取得手段と、
この取得手段により取得された複数画素のベクトルデータに基づき前記AF評価値の算出対象となる前記被写体画像のAF評価範囲を設定する設定手段と、
この設定手段により設定された前記AF評価範囲の画素のコントラスト値に基づき前記AF評価値を算出する算出手段と
を備えたことを特徴とするオートフォーカス装置。
An image of a subject is taken while moving the optical system in the optical axis direction, an AF evaluation value is obtained based on a contrast value for each pixel of the taken subject image, and a focus position of the optical system is determined based on the obtained AF evaluation value. In an autofocus device,
An acquisition unit configured to acquire vector data indicating a direction of a height relationship of a contrast value between each pixel and peripheral pixels based on a contrast value of each pixel included in the subject image;
Setting means for setting an AF evaluation range of the subject image for which the AF evaluation value is to be calculated based on the vector data of a plurality of pixels obtained by the obtaining means;
An auto-focusing device comprising: a calculating unit configured to calculate the AF evaluation value based on a contrast value of a pixel in the AF evaluation range set by the setting unit.
前記設定手段は、被写体画像を構成する画素を前記ベクトルデータの方向別のベクトルグループに分けるとともに、所定の条件に基づき選択したベクトルグループに含まれる画素のうち、互いに隣接しあう画素が最も多い集合部分ををAF評価範囲として設定することを特徴とする請求項10記載のオートフォーカス装置。The setting unit divides the pixels constituting the subject image into vector groups for each direction of the vector data, and sets a pixel having the largest number of adjacent pixels among the pixels included in the vector group selected based on a predetermined condition. The autofocus apparatus according to claim 10, wherein the portion is set as an AF evaluation range. 光学系を光軸方向に移動させながら被写体を撮像し、撮像した被写体画像の画素毎のコントラスト値に基づきAF評価値を取得し、取得したAF評価値に基づき光学系の合焦位置を判定するオートフォーカス制御において前記AF評価値を取得する方法であって、
前記被写体画像を構成する画素毎のコントラスト値に基づき、各画素について周辺画素とのコントラスト値の高低関係を方向で示すベクトルデータを取得する工程と、
取得した複数画素のベクトルデータに基づき前記AF評価値の算出対象となる画素を決める工程と、
決めた画素のコントラスト値に基づき前記AF評価値を算出する工程と
からなることを特徴とするAF評価値取得方法。
An image of a subject is taken while moving the optical system in the optical axis direction, an AF evaluation value is obtained based on a contrast value for each pixel of the taken subject image, and a focus position of the optical system is determined based on the obtained AF evaluation value. A method of acquiring the AF evaluation value in auto focus control,
Based on a contrast value for each pixel that constitutes the subject image, a step of obtaining vector data indicating a direction of a height relationship between contrast values of each pixel and peripheral pixels,
Determining a pixel to be a target for calculating the AF evaluation value based on the acquired vector data of a plurality of pixels;
Calculating the AF evaluation value based on the contrast value of the determined pixel.
光学系を光軸方向に移動させながら被写体を撮像し、撮像した被写体画像の画素毎のコントラスト値に基づきAF評価値を取得し、取得したAF評価値に基づき光学系の合焦位置を判定するオートフォーカス装置が有するコンピュータを、
前記被写体画像を構成する画素毎のコントラスト値に基づき、各画素について周辺画素とのコントラスト値の高低関係を方向で示すベクトルデータを取得する取得手段と、
この取得手段により取得された複数画素のベクトルデータに基づき前記AF評価値の算出対象となる画素を決定する決定手段と、
この決定手段により決められた画素のコントラスト値に基づき前記AF評価値を算出する算出手段と
して機能させるためのプログラム。
An image of a subject is taken while moving the optical system in the optical axis direction, an AF evaluation value is obtained based on a contrast value for each pixel of the taken subject image, and a focus position of the optical system is determined based on the obtained AF evaluation value. A computer included in the autofocus device,
An acquisition unit configured to acquire vector data indicating a direction of a height relationship of a contrast value between each pixel and peripheral pixels based on a contrast value of each pixel included in the subject image;
Determining means for determining a pixel for which the AF evaluation value is to be calculated based on the vector data of a plurality of pixels acquired by the acquiring means;
A program for functioning as calculating means for calculating the AF evaluation value based on the contrast value of the pixel determined by the determining means.
JP2002181334A 2002-06-21 2002-06-21 Autofocus device and af evaluated value acquiring method Pending JP2004029105A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002181334A JP2004029105A (en) 2002-06-21 2002-06-21 Autofocus device and af evaluated value acquiring method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002181334A JP2004029105A (en) 2002-06-21 2002-06-21 Autofocus device and af evaluated value acquiring method

Publications (1)

Publication Number Publication Date
JP2004029105A true JP2004029105A (en) 2004-01-29

Family

ID=31178204

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002181334A Pending JP2004029105A (en) 2002-06-21 2002-06-21 Autofocus device and af evaluated value acquiring method

Country Status (1)

Country Link
JP (1) JP2004029105A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005250127A (en) * 2004-03-04 2005-09-15 Fujinon Corp Autofocus system
JP2006258944A (en) * 2005-03-15 2006-09-28 Fujinon Corp Autofocus system
JP2011002690A (en) * 2009-06-19 2011-01-06 Casio Computer Co Ltd Imaging apparatus, focusing method and program
US8041205B2 (en) 2009-04-07 2011-10-18 Sanyo Electric Co., Ltd. Electronic camera
KR20140055016A (en) * 2012-10-30 2014-05-09 삼성전기주식회사 Apparatus and method for auto focusing
JP2017224923A (en) * 2016-06-14 2017-12-21 エイチエスティ・ビジョン株式会社 Autofocus device and autofocus program
JP2021502593A (en) * 2017-11-28 2021-01-28 ライカ バイオシステムズ イメージング インコーポレイテッドLeica Biosystems Imaging, Inc. Dual processor image processing

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005250127A (en) * 2004-03-04 2005-09-15 Fujinon Corp Autofocus system
JP2006258944A (en) * 2005-03-15 2006-09-28 Fujinon Corp Autofocus system
US8041205B2 (en) 2009-04-07 2011-10-18 Sanyo Electric Co., Ltd. Electronic camera
JP2011002690A (en) * 2009-06-19 2011-01-06 Casio Computer Co Ltd Imaging apparatus, focusing method and program
KR20140055016A (en) * 2012-10-30 2014-05-09 삼성전기주식회사 Apparatus and method for auto focusing
KR101709813B1 (en) 2012-10-30 2017-02-23 삼성전기주식회사 Apparatus and method for auto focusing
JP2017224923A (en) * 2016-06-14 2017-12-21 エイチエスティ・ビジョン株式会社 Autofocus device and autofocus program
JP2021502593A (en) * 2017-11-28 2021-01-28 ライカ バイオシステムズ イメージング インコーポレイテッドLeica Biosystems Imaging, Inc. Dual processor image processing

Similar Documents

Publication Publication Date Title
JP3752510B2 (en) Automatic subject detection method for images
US7515820B2 (en) Image capture device with automatic focusing function
JP4760742B2 (en) Digital camera, information display method, and information display control program
JP4341696B2 (en) Imaging device, face area detection program, and face area detection method
JP4896852B2 (en) Autofocus control circuit, autofocus control method, and imaging apparatus
JP2008289006A (en) Imaging device, face detecting method, and face detection control program
US20080025604A1 (en) System for and method of taking image and computer program
JP5237721B2 (en) Imaging device
JP2006201282A (en) Digital camera
JP2005037898A (en) Imaging apparatus, autofocus control method, and autofocus control program
JP2006058405A (en) Camera apparatus and automatic focusing control method
JP2004212556A (en) Imaging apparatus
JP2012049773A (en) Imaging apparatus and method, and program
US11593958B2 (en) Imaging device, distance measurement method, distance measurement program, and recording medium
JP2004029105A (en) Autofocus device and af evaluated value acquiring method
US8120668B2 (en) Electronic camera for adjusting a parameter for regulating an image quality based on the image data outputted from an image sensor
JP5257969B2 (en) Focus position control device, focus position control method, focus position control program
JP2006253970A (en) Imaging apparatus, shading correction data generating method, and program
JP2010134309A (en) Autofocus device, autofocus method and imaging apparatus
JP2010062987A (en) Imaging apparatus and method
JP2004341095A (en) Automatic focusing camera
JP2009077321A (en) Image recording device and image recording processing method
JP2006157604A (en) Camera apparatus and automatic photographing control program
JP2008028924A (en) Imaging apparatus and control method thereof
JP6645690B2 (en) Automatic focus adjustment device, imaging device, and automatic focus adjustment method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050223

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20070806

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070814

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20071003

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20071113