JP6464553B2 - Lens drive control device, electronic camera, and lens drive control program - Google Patents
Lens drive control device, electronic camera, and lens drive control program Download PDFInfo
- Publication number
- JP6464553B2 JP6464553B2 JP2013245992A JP2013245992A JP6464553B2 JP 6464553 B2 JP6464553 B2 JP 6464553B2 JP 2013245992 A JP2013245992 A JP 2013245992A JP 2013245992 A JP2013245992 A JP 2013245992A JP 6464553 B2 JP6464553 B2 JP 6464553B2
- Authority
- JP
- Japan
- Prior art keywords
- image
- lens
- focus
- drive control
- amount
- 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.)
- Active
Links
- 238000012545 processing Methods 0.000 claims description 43
- 238000001514 detection method Methods 0.000 claims description 34
- 238000004364 calculation method Methods 0.000 claims description 31
- 238000000605 extraction Methods 0.000 claims description 26
- 238000003708 edge detection Methods 0.000 claims description 13
- 238000003384 imaging method Methods 0.000 claims description 13
- 239000000284 extract Substances 0.000 claims description 9
- 238000002372 labelling Methods 0.000 claims description 7
- 238000003909 pattern recognition Methods 0.000 claims description 7
- 230000004075 alteration Effects 0.000 description 22
- 238000011156 evaluation Methods 0.000 description 19
- 238000000034 method Methods 0.000 description 15
- 238000010586 diagram Methods 0.000 description 12
- 230000003287 optical effect Effects 0.000 description 10
- 230000006870 function Effects 0.000 description 8
- 238000013459 approach Methods 0.000 description 2
- 238000006243 chemical reaction Methods 0.000 description 2
- NAWXUBYGYWOOIX-SFHVURJKSA-N (2s)-2-[[4-[2-(2,4-diaminoquinazolin-6-yl)ethyl]benzoyl]amino]-4-methylidenepentanedioic acid Chemical compound C1=CC2=NC(N)=NC(N)=C2C=C1CCC1=CC=C(C(=O)N[C@@H](CC(=C)C(O)=O)C(O)=O)C=C1 NAWXUBYGYWOOIX-SFHVURJKSA-N 0.000 description 1
- 230000000295 complement effect Effects 0.000 description 1
- 230000006835 compression Effects 0.000 description 1
- 238000007906 compression Methods 0.000 description 1
- 238000012937 correction Methods 0.000 description 1
- 230000007423 decrease Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 229910044991 metal oxide Inorganic materials 0.000 description 1
- 150000004706 metal oxides Chemical class 0.000 description 1
- 238000003825 pressing Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
Images
Landscapes
- Focusing (AREA)
- Automatic Focus Adjustment (AREA)
Description
本発明は、レンズ駆動制御装置、電子カメラ及びレンズ駆動制御プログラムに関する。 The present invention relates to a lens drive control device, an electronic camera, and a lens drive control program.
従来、フォーカスレンズを光軸方向に移動させつつ各位置における画像のコントラスト値を求め、コントラスト値が最も高くなるレンズ位置をフォーカス位置として検出するオートフォーカス装置が知られている(例えば、特許文献1参照)。 2. Description of the Related Art Conventionally, there is known an autofocus device that obtains a contrast value of an image at each position while moving a focus lens in the optical axis direction, and detects a lens position having the highest contrast value as a focus position (for example, Patent Document 1). reference).
しかしながら、従来のオートフォーカス装置では、フォーカスレンズを広範囲に亘って光軸方向に駆動させるため、フォーカス位置の検出に多大な時間を要するという問題があった。 However, the conventional autofocus device has a problem that it takes a long time to detect the focus position because the focus lens is driven in the optical axis direction over a wide range.
本発明は、このような事情に鑑みてなされたものであり、その目的は、画像を速やかに合焦させることができるレンズ駆動制御装置、電子カメラ及びレンズ駆動制御プログラムを提供することにある。 The present invention has been made in view of such circumstances, and an object thereof is to provide a lens drive control device, an electronic camera, and a lens drive control program capable of quickly focusing an image.
上記課題を解決するレンズ駆動制御装置は、画像から特定領域を抽出する領域抽出部と、前記領域抽出部が抽出した前記特定領域のエッジの色成分量に基づいて、前記特定領域の合焦状態を検出する合焦検出部と、前記合焦検出部によって検出された前記特定領域の合焦状態に基づいて、焦点調節を行うレンズの駆動を制御するレンズ駆動制御部と、前記特定領域を複数の分割領域に分割し、前記特定領域を含む分割領域の数に対する前記特定領域の前記エッジを含む前記分割領域の数の比に基づいて、前記合焦検出部による前記特定領域の合焦状態の検出結果の信頼度を算出する算出部とを備えた。 The lens drive control device that solves the above problems includes a region extraction unit that extracts a specific region from an image, and an in-focus state of the specific region based on a color component amount of an edge of the specific region extracted by the region extraction unit. A focus detection unit that detects a focus, a lens drive control unit that controls driving of a lens that performs focus adjustment based on a focus state of the specific region detected by the focus detection unit, and a plurality of the specific regions of divided into divided regions, based on the ratio of the number of the divided region including the edge of the specific area to the number of the divided region including the specific region, the focus state of the specific region by the focus detection unit And a calculation unit for calculating the reliability of the detection result.
また、上記レンズ駆動制御装置は、前記領域抽出部が抽出した前記特定領域の前記エッジを色成分毎に検出するエッジ検出部を更に備え、前記合焦検出部は、前記エッジ検出部が色成分毎に検出した前記特定領域の前記エッジの色成分量に基づいて前記特定領域の合焦状態を検出することが好ましい。 The lens drive control device further includes an edge detection unit that detects, for each color component, the edge of the specific region extracted by the region extraction unit, and the focus detection unit includes a color component that is detected by the edge detection unit. It is preferable to detect the in-focus state of the specific area based on the color component amount of the edge of the specific area detected every time.
また、上記レンズ駆動制御装置において、前記合焦状態は、画像が前記特定領域よりも近点側又は遠点側に合焦していることを示す方向指標を含み、前記レンズ駆動制御部は、前記合焦検出部によって検出された前記方向指標に基づいて前記レンズの駆動方向を設定することが好ましい。 Further, in the lens drive control device, the in-focus state includes a direction indicator indicating that the image is focused on the near point side or the far point side with respect to the specific region, and the lens drive control unit includes: It is preferable that the driving direction of the lens is set based on the direction indicator detected by the focus detection unit.
また、上記レンズ駆動制御装置において、前記合焦状態は、前記特定領域のデフォーカス量を更に含み、前記レンズ駆動制御部は、前記算出部が算出した値が所定の閾値以上である場合、前記合焦検出部によって検出された前記デフォーカス量に基づいて、前記レンズの駆動量を設定することが好ましい。 Further, in the lens drive control device, before Kigoase state further includes a defocus amount of the specific region, the lens driving control unit, if the value the calculation unit has calculated is not less than a predetermined threshold value, based on the defocus amount detected by the focus detection unit, it is preferable to set the drive amount of the lens.
また、上記レンズ駆動制御装置において、前記算出部が算出した値は、前記所定の閾値を第1の閾値とした場合、該第1の閾値よりも大きい閾値として第2の閾値が更に設定されており、前記レンズ駆動制御部は、前記算出部が算出した値が前記第2の閾値以上である場合、前記合焦検出部によって検出された前記デフォーカス量に基づいて、画像を前記特定領域において合焦させるレンズの目標駆動量を算出し、算出した目標駆動量を前記レンズの駆動量として設定することが好ましい。 In the lens drive control device, the value calculated by the calculation unit is further set to a second threshold value that is larger than the first threshold value when the predetermined threshold value is the first threshold value. And when the value calculated by the calculation unit is equal to or greater than the second threshold value , the lens drive control unit displays an image in the specific region based on the defocus amount detected by the focus detection unit. calculates a target drive amount of the lens focusing, it is preferable the calculated target driving amount to be set as the driving amount of said lens.
また、上記レンズ駆動制御装置において、前記レンズ駆動制御部は、前記算出部が算出した値が前記第1の閾値以上であって且つ前記第2の閾値未満である場合、前記目標駆動量よりも小さい値を前記レンズの駆動量として設定することが好ましい。 Further, in the lens drive control device, the lens drive control unit has a value greater than the target drive amount when the value calculated by the calculation unit is equal to or greater than the first threshold and less than the second threshold. it is preferable to set a smaller value as the drive amount of the lens.
また、上記レンズ駆動制御装置において、前記領域抽出部は、画像に対してラベリング処理を行うことにより前記特定領域を抽出することが好ましい。
また、上記レンズ駆動制御装置において、前記領域抽出部は、画像に対してパターン認識処理を行うことにより前記特定領域を抽出することが好ましい。
In the lens drive control device, it is preferable that the region extraction unit extracts the specific region by performing a labeling process on the image.
In the lens drive control device, it is preferable that the region extraction unit extracts the specific region by performing a pattern recognition process on the image.
また、上記レンズ駆動制御装置において、前記合焦検出部は、前記領域抽出部が画像から複数の前記特定領域を抽出した場合、複数の前記特定領域のうち画像の奥行方向において至近側に位置する前記特定領域の色成分量に基づいて前記特定領域の合焦状態を検出することが好ましい。 Further, in the lens drive control device, the focus detection unit is positioned on the closest side in the depth direction of the image among the plurality of specific regions when the region extraction unit extracts the plurality of specific regions from the image. It is preferable that the in-focus state of the specific area is detected based on the color component amount of the specific area.
また、上記課題を解決する電子カメラは、被写体を撮像する撮像部と、前記撮像部が撮像した被写体に応じた画像の焦点調節を行うレンズの駆動を制御する上記構成のレンズ駆動制御装置とを備えたことを特徴とする。 In addition, an electronic camera that solves the above problems includes an imaging unit that captures an image of a subject, and a lens drive control device configured as described above that controls driving of a lens that performs focus adjustment of an image corresponding to the subject imaged by the imaging unit. It is characterized by having.
また、上記課題を解決するレンズ駆動制御プログラムは、コンピュータに、画像から特定領域を抽出する領域抽出ステップと、前記領域抽出ステップにおいて抽出された前記特定領域のエッジの色成分量に基づいて、前記特定領域の合焦状態を検出する合焦検出ステップと、前記合焦検出ステップにおける前記特定領域の合焦状態の検出結果に基づいて、焦点調節を行うレンズの駆動を制御するレンズ駆動制御ステップと、前記特定領域を複数の分割領域に分割し、前記特定領域を含む分割領域の数に対する前記特定領域の前記エッジを含む前記分割領域の数の比に基づいて、前記合焦検出ステップにおいて検出された前記特定領域の合焦状態の検出結果の信頼度を算出する算出ステップとを実行させる。 Further, a lens drive control program for solving the above-described problem is obtained by performing, on a computer, an area extraction step for extracting a specific area from an image, and the color component amount of an edge of the specific area extracted in the area extraction step. A focus detection step for detecting a focus state of the specific area; and a lens drive control step for controlling the driving of the lens that performs focus adjustment based on the detection result of the focus state of the specific area in the focus detection step; The specific area is divided into a plurality of divided areas, and is detected in the focus detection step based on a ratio of the number of the divided areas including the edge of the specific area to the number of divided areas including the specific area. And a calculation step of calculating the reliability of the detection result of the in- focus state of the specific area.
本発明によれば、画像を速やかに合焦させることができる。 According to the present invention, an image can be focused quickly.
以下、本発明を具体化した一実施形態を図面に従って説明する。
図1に示すように、電子カメラの一種であるデジタルカメラ(以下、「カメラ10」という)は、焦点調節を行うレンズであるフォーカスレンズ11などの複数のレンズからなるレンズ部12(図1ではフォーカスレンズ11のみ図示)と、レンズ部12を通過した光をレンズ部12の像空間側において結像させて撮像する撮像部の一例としての撮像素子13とを備えている。なお、撮像素子13は、CMOS(Complementary Metal Oxide Semiconductor)型、又は、CCD(Charge Coupled Device)型のカラーイメージセンサからなる。
DESCRIPTION OF EXEMPLARY EMBODIMENTS Hereinafter, an embodiment of the invention will be described with reference to the drawings.
As shown in FIG. 1, a digital camera (hereinafter referred to as “
撮像素子13の出力側には、画像処理エンジン14がA/D変換回路15を介して接続されている。そして、撮像素子13からアナログ信号として出力される画素信号は、A/D変換回路15においてデジタル信号に変換された後に画像処理エンジン14に入力される。
An
画像処理エンジン14は、カメラ10の各種の動作を統括的に制御するMPU16(Micro Processing Unit)を備えている。そして、MPU16は、撮像素子13から入力された画素信号に対し、色補間処理、階調補正、ホワイトバランス処理及び輪郭補償等の画像処理を施すことにより所定の画像を生成する。
The
画像処理エンジン14には、フォーカス駆動回路17が接続されている。そして、画像処理エンジン14は、フォーカス駆動回路17を通じてAFモータ18を駆動制御することにより、フォーカスレンズ11を光軸方向に移動させる、その結果、被写体から射出された光がフォーカスレンズ11を通過して撮像素子13に結像される。
A
また、画像処理エンジン14には、データバス20を介して不揮発性メモリ21、バッファメモリ22、インターフェース部(以下、「I/F部23」という)及びモニタ24が接続されている。
In addition, a
不揮発性メモリ21は、画像処理エンジン14を動作させるためにMPU16が実行するプログラムを格納している。なお、本実施形態では、不揮発性メモリ21は、図8にフローチャートで示すレンズ駆動制御プログラムなどを格納している。そして、MPU16は、不揮発性メモリ21に格納されたレンズ駆動制御プログラムを実行することにより、主制御部25、画像処理部26及び合焦制御部27として機能する。また、MPU16がレンズ駆動制御プログラムを実行することにより、画像処理エンジン14がフォーカスレンズ11の駆動を制御するレンズ駆動制御装置として機能する。なお、画像処理部26は、画像中における人物の顔をパターン認識処理によって認識する顔認識部29を含んでいる。また、合焦制御部27は、領域抽出部31、エッジ検出部32、特徴量算出部33、信頼度算出部34及びレンズ駆動制御部35を含んでいる。
The
バッファメモリ22は、例えば、撮影画像、画像処理過程の画像、画像処理後の画像及び画像圧縮後の画像などを一時的に格納している。
I/F部23は、メモリカード38が着脱自在に装着されるカードスロット(図示略)を有している。そして、I/F部23は、画像処理エンジン14によって生成された画像をI/F部23に装着されたメモリカード38に出力したり、メモリカード38に記憶されている画像を画像処理エンジン14に出力したりする機能を有している。
For example, the
The I /
モニタ24には、バッファメモリ22に一時的に格納されている画像や、I/F部23に装着されたメモリカード38に格納されている画像が画像処理エンジン14によって出力されて表示される。
On the
また、画像処理エンジン14には、レリーズボタン39及び操作部40が接続されている。レリーズボタン39は、半押し操作又は全押し操作がなされた際に操作信号を画像処理エンジン14に入力する。操作部40は、メニューボタン、セレクトボタン、決定ボタン及び電源ボタン等により構成されており、押圧操作がなされた際に操作信号を画像処理エンジン14に入力する。
Further, a
次に、画像処理エンジン14が画像から検出された被写体のエッジにおける軸上色収差の色ずれを解析することにより、被写体のエッジの合焦状態を検出する原理の概要を説明する。
Next, an outline of the principle by which the
図2(a)には、画像が被写体Sの位置で合焦している状態が実線で示されるとともに、画像が被写体Sの位置よりも近点側で合焦している状態(以下、「前ピン状態」という)が一点鎖線で示されている。図2(a)に示すように、前ピン状態においては、被写体から射出される光がフォーカスレンズ11を通過して合焦する位置が撮像素子13よりも撮影者側(図2(a)では右側)に位置する。
In FIG. 2A, the state in which the image is in focus at the position of the subject S is indicated by a solid line, and the state in which the image is in focus on the near point side from the position of the subject S (hereinafter, “ The “front pin state” is indicated by a dashed line. As shown in FIG. 2A, in the front pin state, the position where the light emitted from the subject passes through the
一方、図2(b)には、画像が被写体Sの位置で合焦している状態が実線で示されるとともに、画像が被写体Sの位置よりも遠点側で合焦している状態(以下、「後ピン状態」という)が一点鎖線で示されている。図2(b)に示すように、後ピン状態においては、被写体から射出される光がフォーカスレンズ11を通過して合焦する位置が撮像素子13よりもフォーカスレンズ11側(図2(b)では左側)に位置する。
On the other hand, in FIG. 2B, the state in which the image is in focus at the position of the subject S is indicated by a solid line, and the state in which the image is in focus on the far point side from the position of the subject S (hereinafter referred to as “the subject S”) , Referred to as “rear pin state”). As shown in FIG. 2B, in the rear pin state, the position where the light emitted from the subject passes through the
図3には、被写体から射出された光がフォーカスレンズ11を通過する際に生じる軸上色収差の様子が示されている。図3に示すように、フォーカスレンズ11を通過した光には波長の違いによって軸上色収差が生じるため、光の波長成分ごとに焦点位置がずれる。具体的には、フォーカスレンズ11は、光の波長が短いほど光の屈折率が大きいため、青(B)の光、緑(B)の光、赤(R)の光の順に、フォーカスレンズ11を通過する際の屈折率が次第に小さくなり、フォーカスレンズ11を通過して合焦する焦点位置がフォーカスレンズ11から次第に遠くなる。そして、このような軸上色収差による色ずれを解析することにより、被写体のデフォーカス特徴量が被写体の合焦状態として算出(検出)される。
FIG. 3 shows the state of axial chromatic aberration that occurs when the light emitted from the subject passes through the
ここで、デフォーカス特徴量は、方向指標と、デフォーカス量を含んで構成されている。方向指標とは、画像が被写体に対して前ピン状態又は後ピン状態にあることを示す指標である。そして、方向指標及びデフォーカス量を算出するための評価値の一例としては、Edge Difference(以下、「Ed」という)が挙げられる。 Here, the defocus feature amount includes a direction index and a defocus amount. The direction index is an index indicating that the image is in the front pin state or the rear pin state with respect to the subject. An example of an evaluation value for calculating the direction index and the defocus amount is Edge Difference (hereinafter referred to as “Ed”).
次に、被写体における方向指標及びデフォーカス量をEdを用いて算出する原理の概要を説明する。
図4(a)に示すように、画像が被写体に対して前ピン状態にある場合には、被写体から射出された光は、フォーカスレンズ11を通過する際に生じる軸上色収差に起因して外側から赤(R)の光、緑(G)の光、青(B)の光の順に位置するように分光された状態で撮像素子13に導かれる。この場合、フォーカスレンズ11を通過した光が色成分ごとに撮像素子13に撮像する被写体のデフォーカス量は、青(B)の光、緑(G)の光、赤(R)の光の順に次第に大きくなる。
Next, an outline of the principle of calculating the direction index and the defocus amount in the subject using Ed will be described.
As shown in FIG. 4A, when the image is in the front pin state with respect to the subject, the light emitted from the subject is outside due to the longitudinal chromatic aberration generated when passing through the
一方、図4(b)に示すように、画像が被写体に対して後ピン状態にある場合には、被写体から射出された光は、フォーカスレンズ11を通過する際に生じる軸上色収差に起因して外側から赤(R)の光、緑(G)の光、青(B)の光の順に位置するように分光された状態で撮像素子13に導かれる。この場合、フォーカスレンズ11を通過した光が色成分ごとに撮像素子13に撮像する被写体のデフォーカス量は、赤(R)の光、緑(G)の光、青(B)の光の順に次第に大きくなる。
On the other hand, as shown in FIG. 4B, when the image is in the rear pin state with respect to the subject, the light emitted from the subject is caused by the axial chromatic aberration generated when passing through the
すなわち、画像が被写体に対して前ピン状態及び後ピン状態のうち何れの状態にあるかに応じて、フォーカスレンズ11を通過した光が色成分ごとに撮像素子13に撮像する被写体のデフォーカス量の大小関係は異なるものとなる。
In other words, depending on whether the image is in the front pin state or the rear pin state with respect to the subject, the defocus amount of the subject that the light passing through the
図5には、画像における被写体の一例として白黒チャートS1が示されている。また、図5では、横方向にX座標、縦方向にY座標が設定されており、X=qの位置に位置する白黒チャートS1のエッジE1がデフォーカス特徴量の算出対象として設定されている。 FIG. 5 shows a black and white chart S1 as an example of the subject in the image. In FIG. 5, the X coordinate is set in the horizontal direction and the Y coordinate is set in the vertical direction, and the edge E1 of the black and white chart S1 located at the position of X = q is set as the defocus feature amount calculation target. .
この場合、まず、エッジE1を横切る方向(図5ではX方向)においてRGBごとの画素値が取得される。このとき、1ピクセル行だけの画素値が取得されると、その1ピクセル行がノイズを含んでいる場合に誤った画素値が取得される虞がある。そのため、本実施形態では、以下の式(1)〜(3)に示すように、1ピクセル行の画素値がY方向にnピクセル幅に亘ってn本積算され、その積算値がnで除算された平均値が、x=qに位置するエッジE1が横切るRGBごとの画素値として取得される。 In this case, first, pixel values for each RGB are acquired in the direction crossing the edge E1 (X direction in FIG. 5). At this time, if a pixel value of only one pixel row is acquired, an erroneous pixel value may be acquired if the one pixel row includes noise. Therefore, in this embodiment, as shown in the following formulas (1) to (3), n pixel values in one pixel row are integrated over the width of n pixels in the Y direction, and the integrated value is divided by n. The average value thus obtained is acquired as a pixel value for each RGB crossed by the edge E1 located at x = q.
続いて、以下の式(4)〜(6)に示すように、r_ave(x)、g_ave(x)、b_ave(x)について、各々の最大値及び最小値を用いて正規化することにより、各々の正規化出力が算出される。 Subsequently, by normalizing r_ave (x), g_ave (x), and b_ave (x) using respective maximum values and minimum values as shown in the following equations (4) to (6), Each normalized output is calculated.
図6(a)には、画像が白黒チャートS1のエッジE1に対して前ピン状態である場合の、白黒チャートS1のエッジE1の近傍における各色成分の正規化出力が示されている。図6(a)に示すように、画像が白黒チャートS1のエッジE1に対して前ピン状態である場合には、青(B)、緑(G)、赤(R)の順に、白黒チャートS1のエッジE1における色成分量の勾配が次第に緩やかとなる。これは、画像が白黒チャートS1のエッジE1に対して前ピン状態である場合には、フォーカスレンズ11を通過した光が色成分ごとに撮像素子13に撮像する白黒チャートS1のエッジE1のデフォーカス量は、青(B)の光、緑(G)の光、赤(R)の光の順に次第に大きくなるためである。
FIG. 6A shows the normalized output of each color component in the vicinity of the edge E1 of the black and white chart S1 when the image is in the front pin state with respect to the edge E1 of the black and white chart S1. As shown in FIG. 6A, when the image is in the front pin state with respect to the edge E1 of the black and white chart S1, the black and white chart S1 in the order of blue (B), green (G), and red (R). The gradient of the color component amount at the edge E1 becomes gradually gentler. This is because, when the image is in the front pin state with respect to the edge E1 of the black and white chart S1, the light that has passed through the
一方、図6(b)には、画像が白黒チャートS1のエッジE1に対して後ピン状態である場合の、白黒チャートS1のエッジE1の近傍における各色成分の正規化出力が示されている。図6(b)に示すように、画像が白黒チャートS1のエッジE1に対して後ピン状態である場合には、赤(R)、緑(G)、青(B)の順に、白黒チャートS1のエッジE1における色成分量の勾配が次第に緩やかとなる。これは、画像が白黒チャートS1のエッジE1に対して後ピン状態である場合には、フォーカスレンズ11を通過した光が色成分ごとに撮像素子13に撮像する白黒チャートS1のエッジE1のデフォーカス量は、赤(R)の光、緑(G)の光、青(B)の光の順に次第に大きくなるためである。
On the other hand, FIG. 6B shows the normalized output of each color component in the vicinity of the edge E1 of the black and white chart S1 when the image is in the back pinned state with respect to the edge E1 of the black and white chart S1. As shown in FIG. 6B, when the image is in the rear pin state with respect to the edge E1 of the black and white chart S1, the black and white chart S1 in the order of red (R), green (G), and blue (B). The gradient of the color component amount at the edge E1 becomes gradually gentler. This is because, when the image is in a back-pin state with respect to the edge E1 of the black and white chart S1, defocusing of the edge E1 of the black and white chart S1 in which the light that has passed through the
すなわち、図7(a)に示すように、白黒チャートS1のエッジE1の近傍における各色成分量の勾配は、以下のようになる。画像が白黒チャートS1のエッジE1に対して前ピン状態である場合には、赤(R)の色成分量の勾配が緑(G)の色成分量の勾配よりも小さくなる。これに対し、画像が白黒チャートS1のエッジE1に対して後ピン状態である場合には、赤(R)の色成分量の勾配が緑(G)の色成分量の勾配よりも大きくなる。そのため、画像が白黒チャートS1のエッジE1に対して前ピン状態及び後ピン状態のうち何れの状態にあるかに応じて、白黒チャートS1のエッジE1における赤(R)の色成分量の勾配と緑(G)の色成分量の勾配との大小関係が逆転する。 That is, as shown in FIG. 7A, the gradient of each color component amount in the vicinity of the edge E1 of the black and white chart S1 is as follows. When the image is in the front pin state with respect to the edge E1 of the black and white chart S1, the gradient of the red (R) color component amount is smaller than the gradient of the green (G) color component amount. On the other hand, when the image is in the rear pin state with respect to the edge E1 of the black and white chart S1, the gradient of the red (R) color component amount is larger than the gradient of the green (G) color component amount. Therefore, the gradient of the red (R) color component amount at the edge E1 of the black and white chart S1 depends on whether the image is in the front pin state or the rear pin state with respect to the edge E1 of the black and white chart S1. The magnitude relationship with the gradient of the color component amount of green (G) is reversed.
したがって、赤(R)の色成分量と緑(G)の色成分量とに基づくEd(以下、「EdRG」という)を閾値と比較することにより、画像が白黒チャートS1のエッジE1に対して前ピン状態及び後ピン状態のうち何れの状態であるかについては、以下に示す式(7)、(8)に基づいて判定される。 Therefore, by comparing Ed (hereinafter referred to as “EdRG”) based on the red (R) color component amount and the green (G) color component amount with a threshold value, the image is compared with the edge E1 of the monochrome chart S1. Which of the front pin state and the rear pin state is determined is based on the following formulas (7) and (8).
そして、式(7)が成立する場合には、EdRGは、画像が白黒チャートS1のエッジE1に対して後ピン状態であることを示している。一方、式(8)が成立する場合には、EdRGは、画像が白黒チャートS1のエッジE1に対して前ピン状態であることを示している。また、EdRGと閾値である「1」との差分が、画像における白黒チャートS1のエッジE1のデフォーカス量を示している。 And when Formula (7) is materialized, EdRG has shown that an image is a back pin state with respect to the edge E1 of the black-and-white chart S1. On the other hand, when the formula (8) is established, EdRG indicates that the image is in the front pin state with respect to the edge E1 of the black and white chart S1. The difference between EdRG and the threshold value “1” indicates the defocus amount of the edge E1 of the black and white chart S1 in the image.
なお、画像が白黒チャートS1のエッジE1に対して前ピン状態及び後ピン状態のうち何れの状態であるかについては、以下に示す式(9)、(10)に基づいて判定されてもよい。 Note that whether the image is in the front pin state or the rear pin state with respect to the edge E1 of the black and white chart S1 may be determined based on the following equations (9) and (10). .
そして、式(9)が成立する場合には、EdRGは、画像が白黒チャートS1のエッジE1に対して前ピン状態であることを示している。一方、式(10)が成立する場合には、EdRGは、画像が白黒チャートS1のエッジE1に対して後ピン状態であることを示している。また、EdRGと閾値である「1」との差分が、画像における白黒チャートS1のエッジE1のデフォーカス量を示している。 And when Formula (9) is materialized, EdRG has shown that the image is a front pin state with respect to the edge E1 of the black-and-white chart S1. On the other hand, when the formula (10) is established, EdRG indicates that the image is in the rear pin state with respect to the edge E1 of the black and white chart S1. The difference between EdRG and the threshold value “1” indicates the defocus amount of the edge E1 of the black and white chart S1 in the image.
以上のように、上記の式(7)〜(10)では、赤(R)の色成分量と緑(G)の色成分量との比を用いて、画像が白黒チャートS1のエッジE1に対して前ピン状態及び後ピン状態のうち何れの状態であるかについて判定される。ただし、赤(R)の色成分量と緑(G)の色成分量との差を用いて、画像が白黒チャートS1のエッジE1に対して前ピン状態及び後ピン状態のうち何れの状態であるかについて判定してもよい。 As described above, in the above formulas (7) to (10), the image is applied to the edge E1 of the black and white chart S1 by using the ratio of the red (R) color component amount and the green (G) color component amount. On the other hand, it is determined which of the front pin state and the rear pin state. However, using the difference between the red (R) color component amount and the green (G) color component amount, the image is in either the front pin state or the rear pin state with respect to the edge E1 of the black and white chart S1. You may determine whether there is.
また同様に、図7(b)に示すように、画像が白黒チャートS1のエッジE1に対して前ピン状態である場合には、青(B)の色成分量の勾配が緑(G)の色成分量の勾配よりも大きくなる。これに対し、画像が白黒チャートS1のエッジE1に対して後ピン状態である場合には、青(B)の色成分量の勾配が緑(G)の色成分量の勾配よりも小さくなる。そのため、画像が前ピン状態及び後ピン状態のうち何れの状態にあるかに応じて、白黒チャートS1のエッジE1における青(B)の色成分量の勾配と緑(G)の色成分量の勾配との大小関係が逆転する。 Similarly, as shown in FIG. 7B, when the image is in the front pin state with respect to the edge E1 of the black and white chart S1, the gradient of the color component amount of blue (B) is green (G). It becomes larger than the gradient of the color component amount. On the other hand, when the image is in a back-pin state with respect to the edge E1 of the black and white chart S1, the gradient of the blue (B) color component amount is smaller than the gradient of the green (G) color component amount. Therefore, the gradient of the blue (B) color component amount and the green (G) color component amount at the edge E1 of the black-and-white chart S1 depending on whether the image is in the front pin state or the rear pin state. The magnitude relationship with the gradient is reversed.
したがって、青(B)の色成分量と緑(G)の色成分量とに基づくEd(以下、「EdBG」という)を閾値と比較することにより、画像が白黒チャートS1のエッジE1に対して前ピン状態及び後ピン状態のうち何れの状態であるかについては、以下に示す式(11)、(12)に基づいて判定される。 Therefore, by comparing Ed (hereinafter referred to as “EdBG”) based on the blue (B) color component amount and the green (G) color component amount with a threshold value, the image is compared with the edge E1 of the monochrome chart S1. Which of the front pin state and the rear pin state is determined is based on the following formulas (11) and (12).
そして、式(11)が成立する場合には、EdBGは、画像が白黒チャートS1のエッジE1に対して前ピン状態であることを示している。一方、式(12)が成立する場合には、EdBGは、画像が白黒チャートS1のエッジE1に対して後ピン状態であることを示している。また、EdBGと閾値である「1」との差分が、画像における白黒チャートS1のエッジE1のデフォーカス量を示している。 When the expression (11) is satisfied, EdBG indicates that the image is in a front pin state with respect to the edge E1 of the black and white chart S1. On the other hand, when the formula (12) is established, EdBG indicates that the image is in the rear pin state with respect to the edge E1 of the black and white chart S1. The difference between EdBG and the threshold value “1” indicates the defocus amount of the edge E1 of the black and white chart S1 in the image.
なお、画像が白黒チャートS1のエッジE1に対して前ピン状態及び後ピン状態のうち何れの状態であるかについては、以下に示す式(13)、(14)に基づいて判定されてもよい。 Note that whether the image is in the front pin state or the rear pin state with respect to the edge E1 of the black and white chart S1 may be determined based on the following equations (13) and (14). .
そして、式(13)が成立する場合には、EdBGは、画像が白黒チャートS1のエッジE1に対して後ピン状態であることを示している。一方、式(14)が成立する場合には、EdBGは、画像が白黒チャートS1のエッジE1に対して前ピン状態であることを示している。また、EdBGと閾値である「1」との差分が、画像における白黒チャートS1のエッジE1のデフォーカス量を示している。 When the formula (13) is established, EdBG indicates that the image is in a rear pin state with respect to the edge E1 of the black and white chart S1. On the other hand, when the formula (14) is established, EdBG indicates that the image is in the front pin state with respect to the edge E1 of the black and white chart S1. The difference between EdBG and the threshold value “1” indicates the defocus amount of the edge E1 of the black and white chart S1 in the image.
以上のように、上記の式(11)〜(14)では、青(B)の色成分量と緑(G)の色成分量との比を用いて、画像が白黒チャートS1のエッジE1に対して前ピン状態及び後ピン状態のうち何れの状態であるかについて判定される。ただし、青(B)の色成分量と緑(G)の色成分量との差を用いて、画像が白黒チャートS1のエッジE1に対して前ピン状態及び後ピン状態のうち何れの状態であるかについて判定してもよい。 As described above, in the above formulas (11) to (14), the image is applied to the edge E1 of the black-and-white chart S1 by using the ratio of the blue (B) color component amount and the green (G) color component amount. On the other hand, it is determined which of the front pin state and the rear pin state. However, using the difference between the color component amount of blue (B) and the color component amount of green (G), the image is in either the front pin state or the rear pin state with respect to the edge E1 of the black and white chart S1. You may determine whether there is.
なお、画像が白黒チャートS1のエッジE1に対して前ピン状態及び後ピン状態のうち何れの状態であるかについて判定するための評価値としては、Edに代えて、デフォーカス量参照値(Width of Subtraction)や線広がり関数(Line Spread Function)を採用してもよい。 Note that, as an evaluation value for determining whether the image is in the front pin state or the rear pin state with respect to the edge E1 of the black and white chart S1, instead of Ed, a defocus amount reference value (Width of Subtraction) or Line Spread Function may be employed.
次に、本実施形態の画像処理エンジン14のMPU16が画像の合焦位置を制御する際に実行するレンズ駆動制御処理ルーチンの概要を図8のフローチャートを参照しながら説明する。
Next, an outline of a lens drive control processing routine executed when the
さて、MPU16は、カメラ10が電源ON状態となると、図8に示すレンズ駆動制御処理ルーチンを開始する。そして、ステップS11において、MPU16の画像処理部26は、撮像素子13から出力された画素信号を取り込んでスルー画を生成し、生成したスルー画をモニタ24に表示させる。
Now, when the
続いて、ステップS12において、領域抽出ステップとして、MPU16の領域抽出部31は、先のステップS11において生成されたスルー画から特定領域の一例としてマスク領域を抽出する。この場合、スルー画に対してラベリング処理を行うことにより、スルー画からマスク領域が抽出される。ここで、ラベリング技術とは、スルー画から特徴量ごとに画素データを検出し、検出された画素データが互いに近接した画素領域のうち画像内での位置が隣接する画素領域を順次検出してグループ化することにより、スルー画からマスク領域を抽出する技術である。そして、本実施形態では、ラベリング処理に用いる特徴量としては、動きベクトル、色相、彩度、明度、テクスチャ(模様)、コントラスト等が含まれる。
Subsequently, in step S12, as a region extraction step, the region extraction unit 31 of the
なお、MPU16は、スルー画に対してパターン認識処理を行うことにより、スルー画からマスク領域を抽出してもよい。例えば、本実施形態では、MPU16の顔認識部29がパターン認識処理の一種である顔認識処理をスルー画に対して行うことによりスルー画から人物の顔を認識し、認識された人物の顔をマスク領域として抽出してもよい。この場合、MPU16の顔認識部29がスルー画からマスク領域を抽出する領域抽出部としても機能する。
Note that the
そして、MPU16の領域抽出部31は、スルー画から抽出されたマスク領域の画像を、例えばExif(Exchangeable Image File Format)形式でバッファメモリ22に格納する。
Then, the area extraction unit 31 of the
そして次に、ステップS13において、MPU16の領域抽出部31は、先のステップS12において抽出されたマスク領域の中からノイズマスクを除外する。ここで、ノイズマスクとは、細長いマスク領域、極端に小さいマスク領域、極端に大きいマスク領域など、スルー画において合焦の対象とはなり得ないマスク領域を意味している。これは、上記のマスク領域については、スルー画のうち人が注目することが想定される領域ではないためである。そして、MPU16の領域抽出部31は、合焦の対象から外れた旨を示すデータを、ノイズマスクの画像の付加情報としてバッファメモリ22に格納する。
Next, in step S13, the region extracting unit 31 of the
続いて、ステップS14において、MPU16の領域抽出部31は、先のステップS12において抽出されたマスク領域のうちノイズマスク以外のマスク領域について優先度を設定する。この優先度は、マスク領域の中で人がより注目することが想定される度合いを意味しており、マスク領域の特徴量ごとに算出される評点の合計値によって規定される。なお、マスク領域の優先度を規定する特徴量としては、動きベクトル、位置、色相、異質度等が含まれる。ここで、異質度とは、特徴量のヒストグラムにおける特異な分布の度合いを意味している。例えば、緑の背景に赤い花が咲いているときには、赤い色相が色相のヒストグラムにおいて特異に分布していることとなる。そのため、赤い花は、異質度が高いマスク領域として認識されることにより、異質度に関する評点が高く設定される。そして、MPU16の領域抽出部31は、マスク領域の特徴量ごとに算出された評点のデータを、マスク領域の画像の付加情報としてバッファメモリ22に格納する。
Subsequently, in step S14, the region extracting unit 31 of the
そして次に、ステップS15において、MPU16の領域抽出部31は、先のステップS15において優先度が最も高く設定されたマスク領域、即ち、マスク領域の特徴量ごとに算出された評点の合計値が最も高いマスク領域を、被写体マスクとして判定する。
Then, in step S15, the area extraction unit 31 of the
続いて、ステップS16において、MPU16の領域抽出部31は、先のステップS15において被写体マスクとして判定されたマスク領域が複数であるか否かを判定する。そして、MPU16の領域抽出部31は、複数のマスク領域が被写体マスクとして判定された場合(ステップS16=YES)、その処理をステップS17に移行する。
Subsequently, in step S16, the area extracting unit 31 of the
そして、ステップS17において、MPU16の領域抽出部31は、複数の被写体マスクのうち、スルー画の奥行方向において至近側に位置する被写体マスクを合焦の対象として設定する。なお、複数のマスク領域が被写体マスクとして判定された場合に、色相が肌色である被写体マスクや、一定時間以上静止している被写体マスクや、特徴量のヒストグラムが特異な分布をしている被写体マスクが合焦の対象として設定されてもよい。また、複数のマスク領域が被写体マスクとして判定された場合に、合焦の対象となる被写体マスクがマニュアルで選択されてもよい。
In step S <b> 17, the region extraction unit 31 of the
一方、MPU16の領域抽出部31は、被写体マスクとして判定されたマスク領域が一つのみである場合(ステップS16=NO)、その処理をステップS18に移行する。そして、ステップS18において、MPU16の領域抽出部31は、先のステップS15において判定された被写体マスクを合焦の対象として設定する。
On the other hand, if there is only one mask area determined as the subject mask (step S16 = NO), the area extraction unit 31 of the
そして次に、ステップS19において、MPU16のエッジ検出部32は、合焦の対象として設定された被写体マスクのエッジを検出する。
具体的には、図9に示すように、MPU16のエッジ検出部32は、スルー画のうち、合焦の対象として設定された被写体マスクS2の画像部分を微分フィルタによってスキャン(例えば、ラスタースキャン)する。その結果、被写体マスクS2の画像部分における明度、彩度及び色相等の特徴量が算出される。そして、MPU16のエッジ検出部32は、算出された特徴量が大きい部分を被写体マスクS2の輪郭部分のうち軸上色収差の評価に適したエッジE2として検出する。なお、図9に示す例では、MPU16のエッジ検出部32は、被写体マスクS2の輪郭部分の中から3つのエッジE2を検出している。
Next, in step S19, the
Specifically, as illustrated in FIG. 9, the
ここで、MPU16のエッジ検出部32が被写体マスクS2の画像部分における明度又は彩度について微分フィルタによってスキャンすることにより、被写体マスクS2のエッジE2を検出したとする。この場合、検出されたエッジE2における各色成分の色成分量のコントラストが十分に大きいとは限らない。そして、エッジE2における各色成分の色成分量のコントラストが小さいと、エッジE2における各色成分の色成分量の正規化出力としてシャープな波形を得ることができない。そのため、エッジE2における軸上色収差の評価値としてEdの値を正確に算出することができない。その結果、スルー画が被写体マスクS2に対して前ピン状態及び後ピン状態のうち何れの状態であるかについてEdを用いて判定することが困難となり、又、スルー画における被写体マスクS2のデフォーカス量の大きさをEdを用いて算出することも困難となる。すなわち、被写体マスクS2のデフォーカス特徴量をEdを用いて算出することが困難となる。なお、エッジE2における軸上色収差の評価値としてデフォーカス量参照値や線広がり関数を採用した場合にも、同様の問題が生じる。
Here, it is assumed that the
そのため、ステップS20において、MPU16の特徴量算出部33は、先のステップS19において検出されたエッジE2における軸上色収差の評価値に基づいて、被写体マスクS2のデフォーカス特徴量が算出可能であるか否かを判定する。そして、MPU16の特徴量算出部33は、被写体マスクS2のデフォーカス特徴量が算出可能ではないと判定した場合(ステップS20=NO)、その処理をステップS21に移行する。
Therefore, in step S20, the feature amount calculation unit 33 of the
そして次に、ステップS21において、MPU16のレンズ駆動制御部35は、通常のコントラストスキャンを行うことにより、スルー画を被写体マスクS2において合焦させるフォーカスレンズ11のレンズ位置となる合焦位置を検出する。この通常のコントラストスキャンおいては、MPU16のレンズ駆動制御部35は、まず、スルー画の合焦位置をスルー画の奥行方向における至近側から無限遠側にかけての全域に亘って移動させるように、フォーカスレンズ11を光軸方向に駆動させる。そして、MPU16のレンズ駆動制御部35は、各位置におけるスルー画の被写体マスクS2のコントラスト値を求め、被写体マスクS2のコントラスト値が最も高くなるフォーカスレンズ11のレンズ位置を合焦位置として検出する。
Next, in step S21, the lens drive control unit 35 of the
一方、MPU16の特徴量算出部33は、被写体マスクS2のデフォーカス特徴量が算出可能であると判定した場合(ステップS20=YES)、合焦検出ステップとして、エッジE2における軸上色収差の評価値に基づいて被写体マスクS2のデフォーカス特徴量を算出する。なお、図9に示す例では、MPU16の特徴量算出部33は、先のステップS19において検出された3つのエッジE2における軸上色収差の評価値の平均値に基づいて、被写体マスクS2のデフォーカス特徴量を算出する。
On the other hand, when the feature amount calculation unit 33 of the
そして次に、ステップS22において、MPU16のレンズ駆動制御部35は、先のステップS20において算出された被写体マスクS2のデフォーカス特徴量の方向指標に基づいて、フォーカスレンズ11の駆動方向を設定する。
In step S22, the lens drive control unit 35 of the
具体的には、MPU16のレンズ駆動制御部35は、被写体マスクS2のデフォーカス特徴量の方向指標が前ピン状態を示している場合、フォーカスレンズ11を光軸方向において撮像素子13から遠ざけるように、フォーカス駆動回路17によるAFモータ18の駆動方向を設定する。すなわち、MPU16のレンズ駆動制御部35は、スルー画が被写体マスクS2よりも近点側に合焦していると判断した場合には、スルー画の合焦位置をスルー画の奥行方向における無限遠側に移動させて被写体マスクS2の位置に合致させるように、フォーカス駆動回路17によるAFモータ18の駆動方向を設定する。
Specifically, the lens drive control unit 35 of the
一方、MPU16のレンズ駆動制御部35は、被写体マスクS2のデフォーカス特徴量の方向指標が後ピン状態を示している場合、フォーカスレンズ11を光軸方向において撮像素子13に近づけるように、フォーカス駆動回路17によるAFモータ18の駆動方向を設定する。すなわち、MPU16のレンズ駆動制御部35は、スルー画が被写体マスクS2よりも遠点側に合焦していると判断した場合には、スルー画の合焦位置をスルー画の奥行方向における至近側に移動させて被写体マスクS2の位置に合致させるように、フォーカス駆動回路17によるAFモータ18の駆動方向を設定する。
On the other hand, the lens drive control unit 35 of the
続いて、ステップS23において、MPU16の信頼度算出部34は、先のステップS20において算出された被写体マスクS2のデフォーカス特徴量の信頼度Nを算出する。
具体的には、図9に示すように、MPU16の信頼度算出部34は、まず、スルー画のうち被写体マスクS2の画像部分を複数の分割領域Rに格子状に分割する。そして次に、MPU16の信頼度算出部34は、先のステップS19において検出されたエッジE2を含む分割領域Rの数を算出する。なお、図9に示す例では、エッジE2を含む分割領域Rの数は8個となっている。
Subsequently, in step S23, the reliability calculation unit 34 of the
Specifically, as shown in FIG. 9, the reliability calculation unit 34 of the
そして、MPU16の信頼度算出部34は、分割領域Rの全体の数に対するエッジE2を含む分割領域Rの数の比率を信頼度Nとして算出する。すなわち、本実施形態では、デフォーカス特徴量を算出する際に軸上色収差の評価の対象となるエッジE2が、被写体マスクS2の全体に対してどの程度の比率で占めているかを算出している。そして、算出された比率を被写体マスクS2のデフォーカス特徴量の信頼度Nとして規定している。なお、図9に示す例では、分割領域Rの全体の数は64個であるため、分割領域Rの全体の数に対するエッジE2を含む分割領域Rの数の比率は1/8となっている。
Then, the reliability calculation unit 34 of the
そして次に、ステップS24において、MPU16のレンズ駆動制御部35は、先のステップS23において算出された信頼度Nが第1の閾値T1以上であるか否かを判定する。この第1の閾値T1は、MPU16のレンズ駆動制御部35が、先のステップS20において算出された被写体マスクS2のデフォーカス特徴量のデフォーカス量に基づいて、フォーカスレンズ11の駆動量を設定することが適切であるか否かを判断する際の基準値となっている。そのため、MPU16のレンズ駆動制御部35は、先のステップS23において算出された信頼度Nが第1の閾値T1未満である(ステップS24=NO)と判定した場合には、先のステップS20において算出された被写体マスクS2のデフォーカス特徴量のデフォーカス量に基づいて、フォーカスレンズ11の駆動量を設定することが適切ではないと判断する。
Next, in step S24, the lens drive control unit 35 of the
そして、ステップS25において、MPU16のレンズ駆動制御部35は、先のステップS22において設定された駆動方向に向けて現在のレンズ位置からフォーカスレンズ11を駆動させるようにフォーカス駆動回路17を駆動制御する。また、MPU16のレンズ駆動制御部35は、各位置でのスルー画における被写体マスクS2のコントラスト値を求め、被写体マスクS2のコントラスト値が最も高くなるフォーカスレンズ11のレンズ位置を合焦位置として検出する。
In step S25, the lens drive control unit 35 of the
一方、MPU16のレンズ駆動制御部35は、先のステップS23において算出された信頼度Nが第1の閾値T1以上である(ステップS24=YES)と判定した場合には、先のステップS20において算出された被写体マスクS2のデフォーカス特徴量のデフォーカス量に基づいて、フォーカスレンズ11の駆動量を設定することが適切であると判断する。
On the other hand, if the lens drive control unit 35 of the
そして、ステップS26において、MPU16のレンズ駆動制御部35は、まず、先のステップS20において算出された被写体マスクS2のデフォーカス特徴量のデフォーカス量に基づいて、フォーカスレンズ11の合焦位置を推定する。続いて、MPU16のレンズ駆動制御部35は、現在のレンズ位置から推定された合焦位置に至るまでのフォーカスレンズ11の駆動量を目標駆動量Xとして算出する。なお、目標駆動量Xは、現在のレンズ位置から推定された合焦位置に至るまでフォーカスレンズ11を駆動させるために必要とされるAFモータ18の駆動信号のパルス数で表される。
In step S26, the lens drive controller 35 of the
そして次に、ステップS27において、MPU16のレンズ駆動制御部35は、先のステップS23において算出された信頼度Nが第2の閾値T2以上であるか否かを判定する。第2の閾値T2は、MPU16のレンズ駆動制御部35が、先のステップS25において算出された目標駆動量Xを、現在のレンズ位置から合焦位置までのフォーカスレンズ11の駆動量として設定することが適切であるか否かを判断する際の基準値となっている。なお、目標駆動量Xを現在のレンズ位置から合焦位置までのフォーカスレンズ11の駆動量として設定するためには、被写体マスクS2のデフォーカス特徴量のデフォーカス量に基づいてフォーカスレンズ11の合焦位置を正確に推定することが求められる。この場合、被写体マスクS2のデフォーカス特徴量の信頼度Nを高くする必要があるため、第2の閾値T2は第1の閾値T1よりも大きい値として設定されている。
Next, in step S27, the lens drive control unit 35 of the
そして、MPU16のレンズ駆動制御部35は、先のステップS23において算出された信頼度Nが第2の閾値T2以上である(ステップS27=YES)と判定した場合には、先のステップS26において算出された目標駆動量Xを、現在のレンズ位置から合焦位置までのフォーカスレンズ11の駆動量として設定することが適切であると判断する。
When the lens drive control unit 35 of the
そして、ステップS28において、MPU16のレンズ駆動制御部35は、先のステップS26において算出された目標駆動量Xを、現在のレンズ位置から合焦位置までのフォーカスレンズ11の駆動量として設定する。
In step S28, the lens drive control unit 35 of the
続いて、ステップS29において、MPU16のレンズ駆動制御部35は、先のステップS22において設定された駆動方向に向けて現在のレンズ位置からフォーカスレンズ11を目標駆動量Xだけ駆動させるようにフォーカス駆動回路17を駆動制御する。その結果、フォーカスレンズ11のレンズ位置が合焦位置に移動することにより、スルー画が被写体マスクS2の位置において合焦された状態となる。
Subsequently, in step S29, the lens drive control unit 35 of the
一方、MPU16のレンズ駆動制御部35は、先のステップS23において算出された信頼度Nが第2の閾値T2未満である(ステップS27=NO)と判定した場合には、先のステップS26において算出された目標駆動量Xを、現在のレンズ位置から合焦位置までのフォーカスレンズ11の駆動量として設定することが適切でないと判断する。
On the other hand, if the lens drive control unit 35 of the
そして、ステップS30において、MPU16のレンズ駆動制御部35は、先のステップS26において算出された目標駆動量Xよりも小さい値を、現在のレンズ位置からのフォーカスレンズ11の駆動量として設定する。この場合、フォーカスレンズ11の駆動量は、目標駆動量Xに対して所定の比率を乗算した駆動量を設定してもよい。例えば、目標駆動量Xの80%の駆動量をフォーカスレンズ11の駆動量として設定してもよい。また、フォーカスレンズ11の駆動量は、先のステップS26において推定された合焦位置に対して所定の距離だけずれた位置に至るまでのフォーカスレンズ11の駆動量として設定してもよい。例えば、推定された合焦位置に対し、AFモータ18の駆動信号のパルス数として10パルス分に相当する距離だけずれた位置に至るまでの駆動量をフォーカスレンズ11の駆動量として設定してもよい。
In step S30, the lens drive control unit 35 of the
続いて、ステップS31において、MPU16のレンズ駆動制御部35は、先のステップS22において設定された駆動方向に向けて先のステップS30において設定された駆動量だけ現在のレンズ位置からフォーカスレンズ11を駆動させるようにフォーカス駆動回路17を駆動制御する。その結果、フォーカスレンズ11の位置が合焦位置の近傍まで移動する。
Subsequently, in step S31, the lens drive control unit 35 of the
そして次に、ステップS32において、MPU16のレンズ駆動制御部35は、先のステップS22において設定された駆動方向に向けて現在のレンズ位置からフォーカスレンズ11を駆動させるようにフォーカス駆動回路17を駆動制御する。また、MPU16のレンズ駆動制御部35は、各位置でのスルー画における被写体マスクS2のコントラスト値を求め、被写体マスクS2のコントラスト値が最も高くなるフォーカスレンズ11の位置を合焦位置として検出する。
Next, in step S32, the lens drive control unit 35 of the
続いて、ステップS33において、MPU16のレンズ駆動制御部35は、現在のレンズ位置から先のステップS32において検出された合焦位置までのフォーカスレンズ11の駆動量を算出する。そして、MPU16のレンズ駆動制御部35は、算出された駆動量だけフォーカスレンズ11を駆動させるようにフォーカス駆動回路17を駆動制御する。その結果、フォーカスレンズ11の位置が合焦位置に移動することにより、スルー画が被写体マスクS2の位置において合焦された状態となる。
Subsequently, in step S33, the lens drive control unit 35 of the
なお、ステップS33においては、MPU16のレンズ駆動制御部35は、先のステップS21又は先のステップS25において合焦位置が検出された場合と同様にして、現在のレンズ位置から合焦位置までのフォーカスレンズ11の駆動量を算出する。そして、MPU16のレンズ駆動制御部35は、算出された駆動量だけフォーカスレンズ11を駆動させるようにフォーカス駆動回路17を駆動制御する。その結果、フォーカスレンズ11の位置が合焦位置に移動することにより、スルー画が被写体マスクS2の位置において合焦された状態となる。
In step S33, the lens drive control unit 35 of the
そして次に、ステップS34において、MPU16は、撮影指示信号が入力されたか否かを判定する。この撮影指示信号は、レリーズボタン39が全押しされた際に画像処理エンジン14に操作信号として入力される。なお、モニタ24がタッチパネルである場合には、モニタ24が画像の撮影のためにタッチ操作された際に撮影指示信号が操作信号として画像処理エンジン14に入力される。そして、MPU16は、撮影指示信号が入力されていない(ステップS34=NO)と判定した場合、その処理をステップS11に戻し、撮影指示信号が入力されるまでステップS11〜ステップS33の処理を繰り返す。一方、MPU16は、撮影指示信号が入力された(ステップS34=YES)と判定した場合、その処理をステップS35に移行する。
Next, in step S34, the
そして、ステップS35において、MPU16の画像処理部26は、その時点で撮像素子13から出力された画素信号に基づいて生成している静止画を撮影画像として不揮発性メモリ21に格納する。
In step S35, the
次に、上記のように構成されたカメラ10の作用について、特に、MPU16が画像の一例としてスルー画の合焦位置を制御する際の作用に着目して以下説明する。
さて、スルー画における任意の画像部分からエッジE2を検出する場合、そのエッジE2がスルー画のうち人が注目することが想定される画像部分に位置するエッジE2とは限らない。そのため、検出されたエッジE2における軸上色収差の評価値を用いてスルー画の合焦位置を制御したとしても、スルー画を人が注目することが想定される画像部分において適切に合焦させることができない虞があった。
Next, the operation of the
When the edge E2 is detected from an arbitrary image portion in the through image, the edge E2 is not necessarily the edge E2 located in the image portion that is assumed to be noticed by the person in the through image. Therefore, even if the focus position of the live view image is controlled using the detected evaluation value of the axial chromatic aberration at the detected edge E2, the live view image is appropriately focused on an image portion that is expected to be noticed by a person. There was a possibility that I could not.
この点、本実施形態では、スルー画のうち人が注目することが想定される画像部分として被写体マスクS2が抽出された上で、抽出された被写体マスクS2の画像部分から軸上色収差の評価の対象となるエッジE2が検出される。そのため、このエッジE2における軸上色収差の評価値を用いてスルー画の合焦位置を制御することにより、スルー画は人が注目することが想定される画像部分において適切に合焦される。 In this regard, in the present embodiment, the subject mask S2 is extracted as an image portion that is assumed to be noticed by a person in the through image, and the axial chromatic aberration is evaluated from the image portion of the extracted subject mask S2. The target edge E2 is detected. Therefore, by controlling the focus position of the live view image using the evaluation value of the longitudinal chromatic aberration at the edge E2, the live view image is appropriately focused on the image portion that is expected to be noticed by a person.
また、本実施形態では、スルー画のうち何れの画像部分に被写体マスクS2が位置していたとしても、その被写体マスクS2の画像部分から軸上色収差の評価の対象となるエッジE2を検出することが可能である。そのため、スルー画における何れの位置に人が注目することが想定される画像部分が位置していたとしても、その画像部分においてスルー画が好適に合焦される。 Further, in the present embodiment, even if the subject mask S2 is located in any image portion of the through image, the edge E2 to be evaluated for the longitudinal chromatic aberration is detected from the image portion of the subject mask S2. Is possible. For this reason, even if an image portion assumed to be noticed by a person is located at any position in the through image, the through image is suitably focused on the image portion.
また、本実施形態では、スルー画から検出したエッジE2における軸上色収差の評価値を用いて被写体マスクS2のデフォーカス特徴量を算出している。そのため、被写体マスクS2のデフォーカス特徴量を算出するために、フォーカスレンズ11を光軸方向に移動させる必要がない。すなわち、本実施形態では、フォーカスレンズ11のレンズ位置が異なる複数の画像を用いて被写体マスクS2のデフォーカス特徴量を算出する構成や、フォーカスレンズ11を光軸方向に動かしながら撮影した一枚の画像を用いて被写体マスクS2のデフォーカス特徴量を算出する構成とは相違する。そのため、フォーカスレンズ11が光軸方向に移動することに起因してウォブリングを生じることがないため、モニタ24におけるスルー画の表示が乱れることが抑制される。
In this embodiment, the defocus feature amount of the subject mask S2 is calculated using the evaluation value of the axial chromatic aberration at the edge E2 detected from the through image. Therefore, it is not necessary to move the
また、本実施形態では、被写体マスクS2のデフォーカス特徴量の信頼度Nに応じて、現在のレンズ位置から合焦位置に向けてのフォーカスレンズ11の駆動態様が変更される。
In the present embodiment, the driving mode of the
すなわち、図10に示すように、被写体マスクS2のデフォーカス特徴量の信頼度Nが第1の閾値T1未満である場合には、スルー画が被写体マスクS2に対して前ピン状態又は後ピン状態の何れの状態であるかを判定することにより、AFモータ18の駆動方向が設定される。具体的には、スルー画が被写体マスクS2に対して前ピン状態である場合には、現在のレンズ位置から無限遠側にフォーカスレンズ11の駆動範囲が限定される。一方、スルー画が被写体マスクS2に対して後ピン状態である場合には、現在のレンズ位置から至近側にフォーカスレンズ11の駆動範囲が限定される。そのため、コントラストスキャンのスキャン範囲は、通常のコントラストスキャンの場合よりも狭くなるため、スルー画が被写体マスクS2の位置において迅速に合焦される。
That is, as shown in FIG. 10, when the reliability N of the defocus feature amount of the subject mask S2 is less than the first threshold T1, the through image is in the front pin state or the rear pin state with respect to the subject mask S2. By determining which state is, the driving direction of the
また、被写体マスクS2のデフォーカス特徴量の信頼度が第1の閾値T1以上であって第2の閾値T2未満である場合には、まず、被写体マスクS2のデフォーカス特徴量のデフォーカス量に基づいて合焦位置が推定される。そして、推定された合焦位置の近傍までフォーカスレンズ11が駆動された後に、推定された合焦位置を含むように合焦位置の前後両側に設定されるスキャン範囲内でコントラストスキャンが行われる。そのため、コントラストスキャンのスキャン範囲が更に狭くなるため、スルー画が被写体マスクS2の位置において更に迅速に合焦される。
When the reliability of the defocus feature amount of the subject mask S2 is equal to or higher than the first threshold T1 and less than the second threshold T2, first, the defocus feature amount of the subject mask S2 is set to the defocus amount. Based on this, the in-focus position is estimated. Then, after the
また、被写体マスクS2のデフォーカス特徴量の信頼度Nが第2の閾値T2以上である場合には、被写体マスクS2のデフォーカス特徴量のデフォーカス量に基づいて推定された合焦位置に向けて現在のレンズ位置からフォーカスレンズ11が直接駆動される。そのため、コントラストスキャンが行われることがないため、スルー画が被写体マスクS2の位置において更に迅速に合焦される。
When the reliability N of the defocus feature amount of the subject mask S2 is equal to or higher than the second threshold T2, the focus position is estimated based on the defocus amount of the defocus feature amount of the subject mask S2. Thus, the
上記実施形態によれば、以下に示す効果を得ることができる。
(1)画像から抽出された被写体マスクS2のエッジE2の色成分量に基づいて被写体マスクS2のデフォーカス特徴量を算出し、算出されたデフォーカス特徴量に基づいて、画像を被写体マスクS2の位置において合焦させる合焦位置が検出される。すなわち、合焦位置を検出する際に、焦点調節を行うフォーカスレンズ11を駆動させる駆動量が低減されるため、コントラストスキャン方式の場合と比較して、合焦位置がより迅速に検出される。したがって、この合焦位置の検出結果に基づいてフォーカスレンズ11を駆動させることにより、画像を被写体マスクS2の位置において速やかに合焦させることができる。
According to the above embodiment, the following effects can be obtained.
(1) The defocus feature amount of the subject mask S2 is calculated based on the color component amount of the edge E2 of the subject mask S2 extracted from the image, and the image of the subject mask S2 is calculated based on the calculated defocus feature amount. A focus position for focusing at the position is detected. That is, when the focus position is detected, the drive amount for driving the
(2)合焦位置を検出する際にフォーカスレンズ11を駆動させる駆動量が低減されるため、画像がウォブリングによってぶれてしまうことを抑制できる。
(3)画像の色成分量を解析することにより、画像から抽出された被写体マスクS2のデフォーカス特徴量を算出している。そのため、被写体マスクS2のデフォーカス特徴量を算出するための専用のセンサを設ける必要がない。したがって、被写体マスクS2のデフォーカス特徴量を簡易な構成で算出することができる。
(2) Since the driving amount for driving the
(3) The defocus feature amount of the subject mask S2 extracted from the image is calculated by analyzing the color component amount of the image. Therefore, it is not necessary to provide a dedicated sensor for calculating the defocus feature amount of the subject mask S2. Therefore, the defocus feature amount of the subject mask S2 can be calculated with a simple configuration.
(4)被写体マスクS2のエッジE2が撮像素子13の撮像面上における何れの位置に位置していた場合であっても、そのエッジE2の色成分量を解析することにより、画像から抽出された被写体マスクS2のデフォーカス特徴量を算出することができる。
(4) Regardless of the position of the edge E2 of the subject mask S2 on the imaging surface of the
(5)画像から人が注目することが想定される領域として被写体マスクS2を抽出し、その被写体マスクS2のエッジE2の色成分量に基づいて被写体マスクS2のデフォーカス特徴量を算出している。そのため、画像に含まれるエッジE2の中から人が注目することが想定される領域のエッジE2が選別される。したがって、画像の全体からエッジを検出する場合と比較して、画像を人が注目することが想定される領域において好適に合焦させることができる。 (5) The subject mask S2 is extracted from the image as a region expected to be noticed by a person, and the defocus feature amount of the subject mask S2 is calculated based on the color component amount of the edge E2 of the subject mask S2. . For this reason, the edge E2 of the region expected to be watched by a person is selected from the edges E2 included in the image. Therefore, compared with the case where an edge is detected from the entire image, the image can be suitably focused in a region where a person is expected to pay attention.
(6)画像から抽出された被写体マスクS2のエッジE2を検出し、検出されたエッジE2の色成分量に基づいて被写体マスクS2のデフォーカス特徴量を算出する。そして、算出されたデフォーカス特徴量に基づいて、画像を被写体マスクS2の位置において合焦させる合焦位置が検出される。したがって、この合焦位置の検出結果に基づいてフォーカスレンズ11を駆動させることにより、画像を被写体マスクS2の位置において速やかに合焦させることができる。
(6) The edge E2 of the subject mask S2 extracted from the image is detected, and the defocus feature amount of the subject mask S2 is calculated based on the detected color component amount of the edge E2. Then, based on the calculated defocus feature amount, a focus position for focusing the image at the position of the subject mask S2 is detected. Therefore, by driving the
(7)画像が被写体マスクS2のエッジE2に対して近点側及び遠点側のうち何れに合焦しているかに応じて、現在のレンズ位置からのフォーカスレンズ11の駆動方向が限定される。そのため、フォーカスレンズ11の可動域のうち至近側から無限側にかけての全域がコントラストスキャンのスキャン範囲である場合と比較して、コントラストスキャンのスキャン範囲が縮小される。したがって、画像を被写体マスクS2の位置においてより速やかに合焦させることができる。
(7) The driving direction of the
(8)被写体マスクS2のデフォーカス特徴量の信頼度Nが第1の閾値T1以上である場合には、現在のレンズ位置からのフォーカスレンズ11の駆動方向だけでなく、現在のレンズ位置からのフォーカスレンズ11の駆動量が設定される。そのため、現在のレンズ位置から一方の駆動方向へのフォーカスレンズ11の駆動を開始させると同時にコントラストスキャンを開始する場合と比較して、コントラストスキャンのスキャン範囲が縮小される。したがって、画像を被写体マスクS2の位置においてより速やかに合焦させることができる。
(8) When the reliability N of the defocus feature amount of the subject mask S2 is equal to or higher than the first threshold T1, not only the driving direction of the
(9)被写体マスクS2のデフォーカス特徴量の信頼度Nが第2の閾値T2以上である場合には、そのデフォーカス特徴量に含まれる被写体マスクS2のデフォーカス量に対応する目標駆動量Xだけ現在のレンズ位置からフォーカスレンズ11を駆動させる。その結果、画像を被写体マスクS2の位置において合焦させる合焦位置にフォーカスレンズ11が配置される。すなわち、コントラストスキャンが行われることなくフォーカスレンズが合焦位置に配置されるため、画像を被写体マスクS2の位置においてより速やかに合焦させることができる。
(9) When the reliability N of the defocus feature amount of the subject mask S2 is equal to or greater than the second threshold T2, the target drive amount X corresponding to the defocus amount of the subject mask S2 included in the defocus feature amount Only the
(10)被写体マスクS2のデフォーカス特徴量の信頼度Nが第1の閾値T1以上であって且つ第2の閾値T2未満である場合には、そのデフォーカス特徴量に含まれる被写体マスクS2のデフォーカス量に対応する目標駆動量Xよりも小さい駆動量だけ現在のレンズ位置からフォーカスレンズ11を駆動させる。その結果、画像を被写体マスクS2の位置において合焦させる合焦位置に向けて現在のレンズ位置からフォーカスレンズ11が接近する。そのため、その接近した位置からフォーカスレンズ11を駆動方向に更に駆動しつつ画像に対してコントラストスキャンが行われた場合に、フォーカスレンズ11が合焦位置に向けて接近した分だけ、コントラストスキャンのスキャン範囲が縮小される。したがって、画像を被写体マスクS2の位置においてより速やかに合焦させることができる。
(10) When the reliability N of the defocus feature amount of the subject mask S2 is equal to or higher than the first threshold T1 and less than the second threshold T2, the subject mask S2 included in the defocus feature amount The
(11)被写体マスクS2を含む分割領域Rの数に対する被写体マスクS2のエッジE2を含む分割領域Rの数の比が高い場合、このエッジE2の色成分量に基づいて算出される被写体マスクS2のデフォーカス特徴量の信頼度は高くなる。その一方で、被写体マスクS2を含む分割領域Rの数に対する被写体マスクS2のエッジE2を含む分割領域Rの数の比が低い場合、このエッジE2の色成分量に基づいて算出される被写体マスクS2のデフォーカス特徴量の信頼度は低くなる。そのため、被写体マスクS2を含む分割領域Rの数に対する被写体マスクS2のエッジE2を含む分割領域Rの数の比に基づいて、被写体マスクS2のデフォーカス特徴量の信頼度Nを算出することができる。 (11) When the ratio of the number of divided regions R including the edge E2 of the subject mask S2 to the number of divided regions R including the subject mask S2 is high, the subject mask S2 calculated based on the color component amount of the edge E2 The reliability of the defocus feature amount is increased. On the other hand, when the ratio of the number of divided areas R including the edge E2 of the subject mask S2 to the number of divided areas R including the subject mask S2 is low, the subject mask S2 calculated based on the color component amount of the edge E2 The reliability of the defocus feature amount is low. Therefore, the reliability N of the defocus feature amount of the subject mask S2 can be calculated based on the ratio of the number of the divided regions R including the edge E2 of the subject mask S2 to the number of the divided regions R including the subject mask S2. .
(12)画像に対してラベリング処理を行うことにより、画像から人が注目することが想定される領域である被写体マスクS2の候補となるマスク領域を抽出することができる。 (12) By performing a labeling process on the image, it is possible to extract a mask area that is a candidate for the subject mask S2, which is an area that a person is expected to pay attention to from the image.
(13)画像に対してパターン認識処理を行うことにより、画像から人が注目することが想定される領域である被写体マスクS2の候補となるマスク領域を抽出することができる。 (13) By performing pattern recognition processing on the image, it is possible to extract from the image a mask area that is a candidate for the subject mask S2, which is an area that a person is expected to pay attention to.
(14)画像から複数の被写体マスクS2が抽出された場合であっても、これらの被写体マスクS2のうち至近側に位置する被写体マスクS2を人がより注目することが想定される被写体マスクS2であると判定し、その被写体マスクS2において画像を好適に合焦させることができる。 (14) Even when a plurality of subject masks S2 are extracted from the image, the subject mask S2 that is assumed to attract more attention to the subject mask S2 located on the closest side among these subject masks S2 It can be determined that the image is present, and the image can be suitably focused on the subject mask S2.
なお、上記実施形態は、以下のような別の実施形態に変更してもよい。
・上記実施形態において、被写体マスクS2のデフォーカス特徴量の信頼度Nが第1の閾値T1未満である場合に、被写体マスクS2のデフォーカス特徴量のデフォーカス量に応じて現在のレンズ位置から合焦位置に向けてのフォーカスレンズ11の駆動態様が変更されてもよい。
In addition, you may change the said embodiment into another embodiment as follows.
In the above embodiment, when the reliability N of the defocus feature amount of the subject mask S2 is less than the first threshold T1, the current lens position is determined according to the defocus amount of the defocus feature amount of the subject mask S2. The driving mode of the
例えば、図11に示すように、被写体マスクS2のデフォーカス特徴量が閾値Dよりも小さいデフォーカス量D1である場合には、現在のレンズ位置から至近側にかけての領域の全体がコントラストスキャンのスキャン範囲として設定されてもよい。一方、被写体マスクS2のデフォーカス特徴量が閾値Dよりも大きいデフォーカス量D2である場合には、現在のレンズ位置から至近側にかけての領域のうち、至近側に位置する半分の領域がコントラストスキャンのスキャン範囲として設定されてもよい。この場合、現在のレンズ位置と至近位置との中間までフォーカスレンズ11が駆動された後に、スキャン範囲として設定された至近側の半分の領域内でコントラストスキャンが行われる。そのため、コントラストスキャンのスキャン範囲が更に狭くなるため、スルー画が被写体マスクS2の位置において更に迅速に合焦される。なお、図11に示す例では、閾値Dは、現在のレンズ位置から至近側にかけての領域の中間よりも至近側に偏った位置に位置する被写体マスクS2のデフォーカス量として設定されている。
For example, as shown in FIG. 11, when the defocus feature amount of the subject mask S2 is a defocus amount D1 smaller than the threshold value D, the entire region from the current lens position to the closest side is scanned by contrast scanning. It may be set as a range. On the other hand, when the defocus feature amount of the subject mask S2 is the defocus amount D2 larger than the threshold value D, half of the region located on the closest side out of the region from the current lens position to the close side is subjected to contrast scanning. May be set as the scan range. In this case, after the
・上記実施形態において、MPU16の特徴量算出部33は、被写体マスクS2の輪郭部分のうち軸上色収差の評価に適したエッジE2がエッジ検出部32によって複数検出された場合に、これらのエッジE2に優先順位を設定してもよい。そして、優先順位が最も高いエッジE2における軸上色収差の評価値を用いて被写体マスクS2のデフォーカス特徴量を算出してもよい。この場合、優先順位は、エッジの強度、エッジの色成分、エッジのコントラスト、エッジのSN比、エッジの波形において平坦になっている範囲の幅、エッジの長さ等に基づいて設定される。
In the above embodiment, the feature amount calculation unit 33 of the
・上記実施形態において、MPU16の信頼度算出部34は、被写体マスクS2のエッジE2が軸上収差の評価に適しているか否かを判定する基準となる評価値を算出し、算出されたエッジE2の評価値に基づいて被写体マスクS2のデフォーカス特徴量の信頼度を算出してもよい。この場合、例えば、エッジの強度、エッジの色成分、エッジのコントラスト、エッジのSN比、エッジの波形において平坦になっている範囲の幅、エッジの長さ等を評価項目としてエッジの評点をそれぞれ算出し、算出された評点の合計値がエッジE2の評価値として算出される。
In the above embodiment, the reliability calculation unit 34 of the
・上記実施形態において、MPU16のレンズ駆動制御部35は、被写体マスクS2のデフォーカス特徴量の信頼度Nが所定の閾値以上である場合に、目標駆動量Xを現在のレンズ位置から合焦位置までのフォーカスレンズ11の駆動量として一律に設定してもよい。また、MPU16のレンズ駆動制御部35は、被写体マスクS2のデフォーカス特徴量の信頼度Nが所定の閾値以上である場合に、目標駆動量Xよりも小さい値を現在のレンズ位置から合焦位置までのフォーカスレンズ11の駆動量として一律に設定してもよい。
In the above embodiment, the lens drive control unit 35 of the
・上記実施形態において、被写体マスクS2のデフォーカス特徴量が被写体マスクS2のデフォーカス量を含まなくてもよい。この場合、MPU16のレンズ駆動制御部35は、被写体マスクS2のデフォーカス特徴量に基づいて、フォーカスレンズ11の駆動量を設定することなくフォーカスレンズ11の駆動方向を設定する。
In the above embodiment, the defocus feature amount of the subject mask S2 may not include the defocus amount of the subject mask S2. In this case, the lens drive control unit 35 of the
・上記実施形態において、MPU16のエッジ検出部32が被写体マスクS2の画像部分を微分フィルタによってスキャンしない構成であってもよい。この場合、MPU16の特徴量算出部33は、ラベリング処理又はパターン認識処理によって抽出された被写体マスクS2の輪郭部分における軸上色収差の評価値に基づいて、被写体マスクS2のデフォーカス特徴量を算出する。
In the above embodiment, the
・上記実施形態において、MPU16は、動画の撮影時において、図8に示すレンズ駆動制御処理ルーチンと同様の処理を実行することにより、動画の合焦位置を制御してもよい。この場合、特に、動画の合焦位置を検出する際にフォーカスレンズ11を駆動させる駆動量が低減されるため、動画の画像内容がウォブリングによってぶれてしまうことを抑制できる。
In the above embodiment, the
・上記実施形態において、画像の撮影機能を搭載したカメラ10以外の電子機器に対し、焦点調節を行うレンズの駆動を制御するレンズ駆動制御装置として画像処理エンジン14が搭載されてもよい。なお、画像の撮影機能を搭載した電子機器としては、例えば、ビデオカメラ、パーソナルコンピュータ、携帯電話機、携帯ゲーム機等が挙げられる。
In the above-described embodiment, the
10…電子カメラの一例としてのデジタルカメラ、11…レンズの一例としてのフォーカスレンズ、13…撮像部の一例としての撮像素子、14…レンズ駆動制御装置の一例としての画像処理エンジン、31…領域抽出部、32…エッジ検出部、33…合焦検出部の一例としての特徴量算出部、34…信頼度算出部、35…レンズ駆動制御部、E2…エッジ、N…信頼度、R…分割領域、S2…特定領域の一例としての被写体マスク、T1…第1の閾値、T2…第2の閾値、X…目標駆動量。
DESCRIPTION OF
Claims (11)
前記領域抽出部が抽出した前記特定領域のエッジの色成分量に基づいて、前記特定領域の合焦状態を検出する合焦検出部と、
前記合焦検出部によって検出された前記特定領域の合焦状態に基づいて、焦点調節を行うレンズの駆動を制御するレンズ駆動制御部と
前記特定領域を複数の分割領域に分割し、前記特定領域を含む分割領域の数に対する前記特定領域の前記エッジを含む前記分割領域の数の比に基づいて、前記合焦検出部による前記特定領域の合焦状態の検出結果の信頼度を算出する算出部と
を備えたレンズ駆動制御装置。 An area extraction unit for extracting a specific area from an image;
A focus detection unit that detects a focus state of the specific region based on a color component amount of an edge of the specific region extracted by the region extraction unit;
A lens drive control unit that controls driving of a lens that performs focus adjustment based on a focus state of the specific region detected by the focus detection unit, and the specific region is divided into a plurality of divided regions, and the specific region based on the ratio of the number of the divided region including the edge of the specific area to the number of the divided regions including the calculation section for calculating a reliability of the detection result of the focus state of the specific region by the focus detection unit And a lens drive control device.
前記合焦検出部は、前記エッジ検出部が色成分毎に検出した前記特定領域の前記エッジの色成分量に基づいて前記特定領域の合焦状態を検出する
請求項1に記載のレンズ駆動制御装置。 An edge detection unit that detects, for each color component, the edge of the specific region extracted by the region extraction unit;
The lens drive control according to claim 1, wherein the focus detection unit detects a focus state of the specific region based on a color component amount of the edge of the specific region detected for each color component by the edge detection unit. apparatus.
前記レンズ駆動制御部は、前記合焦検出部によって検出された前記方向指標に基づいて前記レンズの駆動方向を設定する
請求項1又は請求項2に記載のレンズ駆動制御装置。 The in-focus state includes a direction indicator indicating that the image is in focus on the near point side or the far point side of the specific region,
The lens drive control device according to claim 1, wherein the lens drive control unit sets a drive direction of the lens based on the direction indicator detected by the focus detection unit.
前記レンズ駆動制御部は、前記算出部が算出した値が所定の閾値以上である場合、前記合焦検出部によって検出された前記デフォーカス量に基づいて、前記レンズの駆動量を設定する
請求項3に記載のレンズ駆動制御装置。 The in-focus state further includes a defocus amount of the specific area,
The lens drive control unit sets the drive amount of the lens based on the defocus amount detected by the focus detection unit when the value calculated by the calculation unit is equal to or greater than a predetermined threshold. 4. The lens drive control device according to 3.
前記レンズ駆動制御部は、前記算出部が算出した値が前記第2の閾値以上である場合、前記合焦検出部によって検出された前記デフォーカス量に基づいて、画像を前記特定領域において合焦させるレンズの目標駆動量を算出し、算出した目標駆動量を前記レンズの駆動量として設定する
請求項4に記載のレンズ駆動制御装置。 As for the value calculated by the calculation unit, when the predetermined threshold is the first threshold, a second threshold is further set as a threshold larger than the first threshold,
When the value calculated by the calculation unit is equal to or greater than the second threshold value, the lens drive control unit focuses the image in the specific region based on the defocus amount detected by the focus detection unit. The lens drive control device according to claim 4, wherein a target drive amount of the lens to be calculated is calculated, and the calculated target drive amount is set as the drive amount of the lens.
請求項5に記載のレンズ駆動制御装置。 When the value calculated by the calculation unit is greater than or equal to the first threshold value and less than the second threshold value, the lens drive control unit sets a value smaller than the target drive amount as the lens drive amount. The lens drive control device according to claim 5, wherein the lens drive control device is set.
請求項1〜請求項6のうち何れか一項に記載のレンズ駆動制御装置。 Said region extraction unit, the lens drive control device according to any one of claims 1 to 6 for extracting the specific region by performing labeling processing on the image.
請求項1〜請求項6のうち何れか一項に記載のレンズ駆動制御装置。 Said region extraction unit, the lens drive control device according to any one of claims 1 to 6 for extracting the specific region by performing pattern recognition processing on the image.
請求項1〜請求項8のうち何れか一項に記載のレンズ駆動制御装置。 When the region extraction unit extracts a plurality of the specific regions from the image, the focus detection unit is based on the color component amount of the specific region located on the closest side in the depth direction of the image among the plurality of specific regions. The lens drive control device according to any one of claims 1 to 8 , wherein an in-focus state of the specific region is detected.
前記撮像部が撮像した被写体に応じた画像の焦点調節を行うレンズの駆動を制御する請求項1〜請求項9のうち何れか一項に記載のレンズ駆動制御装置と
を備えた電子カメラ。 An imaging unit for imaging a subject;
An electronic camera comprising: the lens drive control device according to any one of claims 1 to 9 that controls driving of a lens that performs focus adjustment of an image according to a subject imaged by the imaging unit.
画像から特定領域を抽出する領域抽出ステップと、
前記領域抽出ステップにおいて抽出された前記特定領域のエッジの色成分量に基づいて、前記特定領域の合焦状態を検出する合焦検出ステップと、
前記合焦検出ステップにおける前記特定領域の合焦状態の検出結果に基づいて、焦点調節を行うレンズの駆動を制御するレンズ駆動制御ステップと、
前記特定領域を複数の分割領域に分割し、前記特定領域を含む分割領域の数に対する前記特定領域の前記エッジを含む前記分割領域の数の比に基づいて、前記合焦検出ステップにおいて検出された前記特定領域の合焦状態の検出結果の信頼度を算出する算出ステップと
を実行させるレンズ駆動制御プログラム。 On the computer,
An area extraction step for extracting a specific area from the image;
A focus detection step of detecting a focus state of the specific region based on the color component amount of the edge of the specific region extracted in the region extraction step;
A lens driving control step for controlling driving of a lens for performing focus adjustment based on a detection result of a focusing state of the specific area in the focusing detection step;
The specific area is divided into a plurality of divided areas, and detected in the focus detection step based on a ratio of the number of the divided areas including the edge of the specific area to the number of divided areas including the specific area. A lens driving control program for executing a calculation step of calculating a reliability of a detection result of an in- focus state of the specific region.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013245992A JP6464553B2 (en) | 2013-11-28 | 2013-11-28 | Lens drive control device, electronic camera, and lens drive control program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013245992A JP6464553B2 (en) | 2013-11-28 | 2013-11-28 | Lens drive control device, electronic camera, and lens drive control program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2015102855A JP2015102855A (en) | 2015-06-04 |
JP6464553B2 true JP6464553B2 (en) | 2019-02-06 |
Family
ID=53378548
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2013245992A Active JP6464553B2 (en) | 2013-11-28 | 2013-11-28 | Lens drive control device, electronic camera, and lens drive control program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6464553B2 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10798316B2 (en) * | 2017-04-04 | 2020-10-06 | Hand Held Products, Inc. | Multi-spectral imaging using longitudinal chromatic aberrations |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008046181A (en) * | 2006-08-11 | 2008-02-28 | Sony Corp | Focus controller, focus control method, imaging apparatus and program |
JP2008216828A (en) * | 2007-03-07 | 2008-09-18 | Fujifilm Corp | Digital camera and photographing method |
JP5463688B2 (en) * | 2009-02-27 | 2014-04-09 | 株式会社ニコン | Focus evaluation device, camera and program |
JP2011030008A (en) * | 2009-07-27 | 2011-02-10 | Canon Inc | Imaging apparatus |
JP5757099B2 (en) * | 2010-02-15 | 2015-07-29 | 株式会社ニコン | Focus adjustment device and focus adjustment program |
JP2013162174A (en) * | 2012-02-01 | 2013-08-19 | Nikon Corp | Imaging apparatus |
JP5917207B2 (en) * | 2012-03-14 | 2016-05-11 | キヤノン株式会社 | Focus adjustment device |
-
2013
- 2013-11-28 JP JP2013245992A patent/JP6464553B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2015102855A (en) | 2015-06-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9607240B2 (en) | Image processing apparatus, image capturing apparatus, image processing method, image capturing method, and non-transitory computer-readable medium for focus bracketing | |
US6738197B2 (en) | Autofocusing apparatus | |
JP5374119B2 (en) | Distance information acquisition device, imaging device, and program | |
JP5789091B2 (en) | IMAGING DEVICE AND IMAGING DEVICE CONTROL METHOD | |
US20120105590A1 (en) | Electronic equipment | |
US10395348B2 (en) | Image pickup apparatus, image processing apparatus, and control method of image pickup apparatus | |
JP4122865B2 (en) | Autofocus device | |
US20060291845A1 (en) | Apparatus and method for deciding in-focus position of imaging lens | |
US7614559B2 (en) | Apparatus and method for deciding in-focus position of imaging lens | |
US20100182495A1 (en) | Focusing measurement device, focusing measurement method, and program | |
US10311327B2 (en) | Image processing apparatus, method of controlling the same, and storage medium | |
JP2018163365A (en) | Image processing apparatus | |
JP5499531B2 (en) | Electronic camera | |
JP2010154306A (en) | Device, program and method for imaging control | |
JP5369729B2 (en) | Image processing apparatus, imaging apparatus, and program | |
JP6464553B2 (en) | Lens drive control device, electronic camera, and lens drive control program | |
JP2007258923A (en) | Image processing apparatus, image processing method, image processing program | |
JP6349703B2 (en) | Electronic camera and image processing program | |
JP5206300B2 (en) | Program, camera, image processing apparatus, and method for calculating focus degree of image | |
JP6467824B2 (en) | Imaging device | |
JP7458723B2 (en) | Image processing device, imaging device, control method, and program | |
US20230276127A1 (en) | Image processing apparatus and image processing method | |
JP2011147076A (en) | Image processing apparatus, image capturing apparatus and program | |
JP2004219461A (en) | Imaging apparatus and auto-focusing device | |
JP6314281B1 (en) | Image processing method and foreground region acquisition method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20161102 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20170731 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20170905 |
|
A601 | Written request for extension of time |
Free format text: JAPANESE INTERMEDIATE CODE: A601 Effective date: 20171106 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20180104 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20180626 |
|
A601 | Written request for extension of time |
Free format text: JAPANESE INTERMEDIATE CODE: A601 Effective date: 20180827 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20181025 |
|
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: 20181211 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20181224 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6464553 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |