JP5666044B2 - Automatic focusing device, control method therefor, and imaging device - Google Patents

Automatic focusing device, control method therefor, and imaging device Download PDF

Info

Publication number
JP5666044B2
JP5666044B2 JP2014114355A JP2014114355A JP5666044B2 JP 5666044 B2 JP5666044 B2 JP 5666044B2 JP 2014114355 A JP2014114355 A JP 2014114355A JP 2014114355 A JP2014114355 A JP 2014114355A JP 5666044 B2 JP5666044 B2 JP 5666044B2
Authority
JP
Japan
Prior art keywords
control unit
evaluation value
focus
lens
focus evaluation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2014114355A
Other languages
Japanese (ja)
Other versions
JP2014197213A (en
Inventor
正晃 上西
正晃 上西
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP2014114355A priority Critical patent/JP5666044B2/en
Publication of JP2014197213A publication Critical patent/JP2014197213A/en
Application granted granted Critical
Publication of JP5666044B2 publication Critical patent/JP5666044B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Description

本発明は、自動合焦装置及びその制御方法に関し、特にフォーカスレンズの位置の調整を連続的に行う自動合焦装置及びその制御方法に関する。本発明は、また、このような自動合焦装置を備える撮像装置に関する。   The present invention relates to an automatic focusing device and a control method thereof, and more particularly, to an automatic focusing device that continuously adjusts the position of a focus lens and a control method thereof. The present invention also relates to an imaging apparatus provided with such an automatic focusing device.

従来より、電子スチルカメラなどでは、CCDなどの撮像素子から得られる輝度信号に基づいてフォーカスレンズ位置を動かすことで、被写体に焦点を合わせるオートフォーカス(AF)方式の自動合焦装置が用いられている。この自動合焦装置では、撮像画面内に設定された測距領域内における信号の高周波成分を積分することで、測距領域内のコントラストを示す焦点評価値を算出する。そして、フォーカスレンズを駆動してフォーカスレンズ位置ごとの焦点評価値を取得するAFスキャンを行って、最も焦点評価値の高いフォーカスレンズ位置を検出して合焦点としている。また、このAF方式の自動合焦装置では、AFスキャンを繰り返して行うことで、動く被写体に対しても追随して合焦することが可能となっている。   2. Description of the Related Art Conventionally, in an electronic still camera or the like, an autofocus (AF) type automatic focusing device that focuses on a subject by moving a focus lens position based on a luminance signal obtained from an image sensor such as a CCD has been used. Yes. In this automatic focusing device, the focus evaluation value indicating the contrast in the distance measurement area is calculated by integrating the high-frequency component of the signal in the distance measurement area set in the imaging screen. Then, an AF scan is performed to drive the focus lens and acquire a focus evaluation value for each focus lens position, and the focus lens position with the highest focus evaluation value is detected and set as the focal point. Also, with this AF type automatic focusing device, it is possible to follow a moving subject by following AF scanning repeatedly.

動く被写体に対しても追随して合焦する自動合焦装置に関する技術としては、特許文献1、2が知られている。特許文献1には、撮影前にレンズ駆動によるAFスキャンを繰り返して、被写体にAF追従させる自動合焦装置を備えた撮像装置が提案されている。また、特許文献2には、連続撮影などにおいて、撮影毎にAFスキャンを行った後の合焦位置を記憶しておき、記憶している過去の合焦位置に基づいて、次回の撮影前の合焦位置を予測し、AFスキャンする範囲を決定する技術が提案されている。   Patent Documents 1 and 2 are known as techniques related to an automatic focusing device that focuses on a moving subject. Patent Document 1 proposes an imaging apparatus including an automatic focusing device that repeats AF scanning by driving a lens before shooting to cause AF to follow a subject. Further, in Patent Document 2, the focus position after AF scan is stored for each shooting in continuous shooting or the like, and based on the stored past focus position, the previous focus before shooting is stored. A technique for predicting the in-focus position and determining the AF scanning range has been proposed.

特開2004−212556号公報JP 2004-212556 A 特開2007−206433号公報JP 2007-206433 A

しかしながら、上記従来技術では、被写体が静止するなどして自装置と被写体との間の距離が変化しない場合であっても、AFスキャンが連続的に行われてフォーカスレンズが逐次駆動される。このために、常にピント変動があり、被写体への追従性が低下する虞があった。特に連続した撮影画像を用いるEVF(電子ビューファインダ)表示などにおいては、ピントずれのコマが発生することにより見栄えが悪くなる。また、フォーカスレンズが逐次駆動されることで、電池消耗量が大きくなる。   However, in the above conventional technique, even when the distance between the subject apparatus and the subject does not change because the subject is stationary, the AF lens is continuously performed and the focus lens is sequentially driven. For this reason, there is always a fluctuation in focus, and there is a concern that the followability to the subject may be reduced. In particular, in an EVF (electronic viewfinder) display using continuous captured images, the appearance deteriorates due to the occurrence of out-of-focus frames. In addition, the battery consumption is increased by sequentially driving the focus lens.

本発明は、このような従来技術の課題を解決することを目的としてなされたものである。本発明は、フォーカスレンズの位置の調整を連続的に行って被写体に合焦させる際に、自装置と被写体との間の距離が変化しない場合であっても、被写体への追従性が低下することを防止できる自動合焦装置及びその制御方法を提供することを目的とする。   The present invention has been made for the purpose of solving such problems of the prior art. In the present invention, when the focus lens position is continuously adjusted to focus on the subject, even if the distance between the subject apparatus and the subject does not change, the followability to the subject is reduced. It is an object of the present invention to provide an automatic focusing device that can prevent this and a control method therefor.

上述の目的は、フォーカスレンズを含む撮像光学系で結像された被写体の画像を撮像して画像データを出力する撮像素子と、フォーカスレンズを予め設定された所定範囲の全域を測距範囲として一方向に移動させることで得られた画像データに基づいて、焦点検出領域における被写体に合焦する最大焦点評価値を検出し、最大焦点評価値に対応するレンズ位置にフォーカスレンズを移動させる第1の合焦動作を連続的に行う第1の焦点調整手段と、を有する撮像装置であって、フォーカスレンズの測距範囲は、フォーカスレンズの可動範囲の一部に限定された範囲であり、測距範囲の前回の中心位置に対する前回の最大焦点評価値に対応するレンズ位置の方向と測距範囲の今回の中心位置に対する今回の最大焦点評価値に対応するレンズ位置の方向が同じ方向である場合、第1の合焦動作を連続的に行うことで検出された最大焦点評価値に対応するレンズ位置を用いた予測演算により測距範囲の次回の中心位置を算出し、測距範囲の前回の中心位置に対する前回の最大焦点評価値に対応するレンズ位置の方向と測距範囲の今回の中心位置に対する今回の最大焦点評価値に対応するレンズ位置の方向が同じ方向でない場合、今回の最大焦点評価値に対応するレンズ位置を測距範囲の次回の中心位置とすることを特徴とする撮像装置によって達成される。 The above-described object is to provide an imaging device that captures an image of a subject imaged by an imaging optical system including a focus lens and outputs image data, and a focus lens with a predetermined range as a whole ranging range. A first focus evaluation value for focusing on a subject in the focus detection area is detected based on image data obtained by moving in the direction, and the focus lens is moved to a lens position corresponding to the maximum focus evaluation value. An imaging apparatus having a first focus adjustment unit that continuously performs a focusing operation, wherein a focus lens ranging range is limited to a part of a movable range of the focus lens; The direction of the lens position corresponding to the previous maximum focus evaluation value for the previous center position of the range and the lens position corresponding to the current maximum focus evaluation value for the current center position of the distance measurement range If the direction is the same direction, and calculates the next center position of the distance measurement range by the prediction calculation using the lens position corresponding to the maximum focus evaluation value detected by performing first focus operation continuously The direction of the lens position corresponding to the previous maximum focus evaluation value for the previous center position of the distance measurement range and the direction of the lens position corresponding to the current maximum focus evaluation value for the current center position of the distance measurement range are not the same direction. In this case, the image pickup apparatus is characterized in that the lens position corresponding to the current maximum focus evaluation value is set as the next center position of the distance measurement range .

また、上述の目的は、フォーカスレンズを含む撮像光学系で結像された被写体の画像を撮像して画像データを出力する撮像工程と、フォーカスレンズを予め設定された所定範囲の全域を測距範囲として一方向に移動させることで得られた画像データに基づいて焦点検出領域における被写体に合焦する最大焦点評価値を検出し、被写体が合焦する位置にフォーカスレンズを移動させる第1の合焦動作を連続的に行う第1の焦点調整工程と、を有する撮像装置の制御方法であって、フォーカスレンズの測距範囲は、フォーカスレンズの可動範囲の一部に限定された範囲であり、測距範囲の前回の中心位置に対する前回の最大焦点評価値に対応するレンズ位置の方向と測距範囲の今回の中心位置に対する今回の最大焦点評価値に対応するレンズ位置の方向が同じ方向である場合、第1の合焦動作を連続的に行うことで検出された最大焦点評価値に対応するレンズ位置を用いた予測演算により測距範囲の次回の中心位置を算出し、測距範囲の前回の中心位置に対する前回の最大焦点評価値に対応するレンズ位置の方向と測距範囲の今回の中心位置に対する今回の最大焦点評価値に対応するレンズ位置の方向が同じ方向でない場合、今回の最大焦点評価値に対応するレンズ位置を測距範囲の次回の中心位置とすることを特徴とする撮像装置の制御方法によっても達成される。 In addition, the above-described object is to capture an image of a subject imaged by an imaging optical system including a focus lens and output image data, and to measure the entire range of a predetermined range in which the focus lens is set in advance. First focus evaluation value for detecting the maximum focus evaluation value for focusing on the subject in the focus detection area based on the image data obtained by moving in one direction, and moving the focus lens to the position where the subject is in focus. And a first focus adjustment step in which the operation is continuously performed. The focus lens ranging range is limited to a part of the movable range of the focus lens, The direction of the lens position corresponding to the previous maximum focus evaluation value for the previous center position of the distance range and the lens position corresponding to the current maximum focus evaluation value for the current center position of the distance measurement range If the direction is the same direction, and calculates the next center position of the distance measurement range by the prediction calculation using the lens position corresponding to the maximum focus evaluation value detected by performing first focus operation continuously The direction of the lens position corresponding to the previous maximum focus evaluation value for the previous center position of the distance measurement range and the direction of the lens position corresponding to the current maximum focus evaluation value for the current center position of the distance measurement range are not the same direction. In this case, it is also achieved by the control method of the imaging apparatus, wherein the lens position corresponding to the current maximum focus evaluation value is set as the next center position of the distance measurement range .

本発明によれば、フォーカスレンズの位置の調整を連続的に行って被写体に対して合焦させる際に、自装置と被写体との間の距離が変化しない場合であっても、被写体への追従性が低下することを防止できる。   According to the present invention, when the focus lens position is continuously adjusted to focus on the subject, the subject can be tracked even if the distance between the subject apparatus and the subject does not change. It can prevent that property falls.

本実施形態に係る撮像装置の構成を示すブロック図である。It is a block diagram which shows the structure of the imaging device which concerns on this embodiment. 撮像装置の動作を示すフローチャートである。It is a flowchart which shows operation | movement of an imaging device. ContinuousAFのサブルーチンを示すフローチャートである。It is a flowchart which shows the subroutine of ContinuousAF. ServoAFのサブルーチンを示すフローチャートである。It is a flowchart which shows the subroutine of ServoAF. 山登りAFのサブルーチンを示すフローチャートである。It is a flowchart which shows the subroutine of mountain climbing AF. 被写体距離変化判定のサブルーチンを示すフローチャートである。It is a flowchart which shows the subroutine of object distance change determination. 通常AF動作のサブルーチンを示すフローチャートである。It is a flowchart which shows the subroutine of normal AF operation | movement. Servo中AF動作のサブルーチンを示すフローチャートである。It is a flowchart which shows the subroutine of AF operation | movement during Servo. 予測可能判定のサブルーチンを示すフローチャートである。It is a flowchart which shows the subroutine of a predictable determination. 被写***置予測のサブルーチンを示すフローチャートである。10 is a flowchart showing a subject position prediction subroutine. 被写***置予測の計算を説明するための概念図であり、(a)は、2点で被写***置予測の計算を行うことを示す概念図であり、(b)は、3点で被写***置予測の計算を行うことを示す概念図である。It is a conceptual diagram for explaining calculation of subject position prediction, (a) is a conceptual diagram showing that calculation of subject position prediction is performed at two points, and (b) is a subject position prediction calculation at three points. It is a conceptual diagram which shows performing calculation. スキャンのサブルーチンを示すフローチャートである。It is a flowchart which shows the subroutine of a scan. 焦点評価値とフォーカスレンズ位置との関係を示すグラフである。It is a graph which shows the relationship between a focus evaluation value and a focus lens position. 合焦判定のサブルーチンを示すフローチャートである。It is a flowchart which shows the subroutine of a focus determination. 無限遠方向の単調減少のチェックを示すフローチャートである。It is a flowchart which shows the check of the monotone decrease of an infinite direction. 至近端方向の単調減少のチェックを示すフローチャートである。It is a flowchart which shows the check of the monotone decrease of a near end direction. 撮影動作のサブルーチンを示すフローチャートである。It is a flowchart which shows the subroutine of imaging | photography operation | movement.

以下、この発明の実施の形態について図を参照して説明するが、この発明は以下の実施の形態に限定されない。また、この発明の実施の形態は発明の最も好ましい形態を示すものであり、発明の範囲を限定するものではない。   Hereinafter, embodiments of the present invention will be described with reference to the drawings. However, the present invention is not limited to the following embodiments. Further, the embodiment of the present invention shows the most preferable mode of the invention, and does not limit the scope of the invention.

図1は、本実施形態に係る撮像装置1の構成を示すブロック図である。図1に示すように、撮像装置1は、撮影レンズ101、絞り及びシャッター102、フォーカスレンズ104などの撮影光学系を介して結像される画像を撮像素子108で撮影する電子スチルカメラである。また、撮像装置1は、制御部115の制御の下でフォーカスレンズ104を駆動させるAF処理部105を含み、撮像素子108で撮像された画像データに基づいてフォーカスレンズ104を駆動させて焦点調整を行う自動合焦装置も含む構成である。   FIG. 1 is a block diagram illustrating a configuration of an imaging apparatus 1 according to the present embodiment. As illustrated in FIG. 1, the imaging apparatus 1 is an electronic still camera that captures an image formed with an imaging element 108 via an imaging optical system such as an imaging lens 101, an aperture and shutter 102, and a focus lens 104. The imaging apparatus 1 also includes an AF processing unit 105 that drives the focus lens 104 under the control of the control unit 115, and drives the focus lens 104 based on image data captured by the imaging element 108 to perform focus adjustment. It is the structure also including the automatic focusing apparatus to perform.

撮影レンズ101は、ズーム機構などを含む光学レンズである。絞り及びシャッター102は、AE処理部103(AE:自動露光)の制御に従って被写体からの光量を制御する。AE処理部103は、制御部115の制御の下、絞り及びシャッター102の絞り量やシャッタースピードを制御する。フォーカスレンズ104は、AF処理部105の制御に従って駆動するアクチュエータ(特に図示しない)により光軸に沿って移動されることで、撮像素子108に結像される画像の焦点調整を行う。焦点調整手段としてのAF処理部105は、制御部115の制御の下、フォーカスレンズ104の移動を制御する(詳細は後述する)。従って、撮像素子108には、被写体からの反射光が撮影レンズ101から入射された後に絞り及びシャッター102を介して露光量が調節され、フォーカスレンズ104により結像される。   The photographing lens 101 is an optical lens including a zoom mechanism. The aperture and shutter 102 controls the amount of light from the subject according to the control of the AE processing unit 103 (AE: automatic exposure). The AE processing unit 103 controls the aperture amount and shutter speed of the aperture and shutter 102 under the control of the control unit 115. The focus lens 104 is moved along the optical axis by an actuator (not shown) that is driven according to the control of the AF processing unit 105, thereby adjusting the focus of the image formed on the image sensor 108. The AF processing unit 105 serving as a focus adjustment unit controls the movement of the focus lens 104 under the control of the control unit 115 (details will be described later). Therefore, after the reflected light from the subject is incident on the image sensor 108 from the photographing lens 101, the exposure amount is adjusted via the aperture and the shutter 102, and an image is formed by the focus lens 104.

ストロボ106は、EF処理部107(EF:フラッシュプリ発光)の制御に従って被写体へ補助光を照射する。EF処理部107は、制御部115の制御の下、ストロボ106の発光を制御する。例えば、EF処理部107は、制御部115の制御の下で行われる撮像素子108による本撮影の前にストロボ106にプリ発光を行わせ、被写体からの反射光量をセンサ(図示しない)で検出して本発光時の発光量を計算する。次いで、本撮影時において、EF処理部107は、計算された発光量でストロボ106を発光させることで、被写体を適正に露光させる。   The strobe 106 irradiates the subject with auxiliary light according to the control of the EF processing unit 107 (EF: flash pre-emission). The EF processing unit 107 controls light emission of the strobe 106 under the control of the control unit 115. For example, the EF processing unit 107 causes the strobe 106 to perform pre-flash before the actual photographing by the image sensor 108 performed under the control of the control unit 115, and detects the amount of reflected light from the subject with a sensor (not shown). To calculate the amount of light emitted during main flash. Next, at the time of actual photographing, the EF processing unit 107 causes the strobe 106 to emit light with the calculated light emission amount, thereby appropriately exposing the subject.

撮像素子108は、フォーカスレンズ104により結像される画像を、光電変換によりアナログ電気信号に変換した画像データとして出力する。具体的には、撮像素子108は、CCDやCMOSイメージセンサなどである。A/D変換部109は、撮像素子108から出力されるアナログ画像データをデジタル画像データに変換する。なお、A/D変換部109は、撮像素子108の出力ノイズを除去するCDS(Correlated Double Sampling:相関二重サンプリング)回路やA/D変換前に行う非線形増幅回路を含む構成であってよい。   The image sensor 108 outputs the image formed by the focus lens 104 as image data converted into an analog electric signal by photoelectric conversion. Specifically, the image sensor 108 is a CCD, a CMOS image sensor, or the like. The A / D conversion unit 109 converts analog image data output from the image sensor 108 into digital image data. The A / D conversion unit 109 may include a CDS (Correlated Double Sampling) circuit that removes output noise of the image sensor 108 and a non-linear amplification circuit that is performed before A / D conversion.

画像処理部110は、A/D変換部109より出力されたディジタル画像データに対して各種の画像処理を行い、処理済みのディジタル画像データを出力する。WB処理部111は、画像処理部110より出力された画像処理済みのデジタル画像データに対してホワイトバランス処理を行う。フォーマット変換部112は、画像処理部110から出力された画像処理済みのデジタル画像データのデータフォーマットをJPEG(Joint Photographic Experts Group)などの所定の画像形式へ変換する。   The image processing unit 110 performs various types of image processing on the digital image data output from the A / D conversion unit 109 and outputs processed digital image data. The WB processing unit 111 performs white balance processing on the image-processed digital image data output from the image processing unit 110. The format conversion unit 112 converts the data format of the image-processed digital image data output from the image processing unit 110 into a predetermined image format such as JPEG (Joint Photographic Experts Group).

DRAM113(Dynamic Random Access Memory)は、フォーマット変換部112により所定の画像形式に変換された画像データを一時記憶する。また、DRAM113は、制御部115の作業領域や画像データの圧縮伸長における作業領域として使用されてもよい。画像記録部114は、メモリーカードなどの記録媒体とそのインターフェース(いずれも図示しない)などである。画像記録部114は、制御部115の制御の下、撮像素子108で撮像されてDRAM113に一時記憶されたデジタル画像データを記録媒体に記録する。なお、画像記録部114の記録媒体は、インターフェースにより撮像装置1に対して着脱可能であってよい。   A DRAM 113 (Dynamic Random Access Memory) temporarily stores the image data converted into a predetermined image format by the format conversion unit 112. The DRAM 113 may also be used as a work area for the control unit 115 and a work area for image data compression / decompression. The image recording unit 114 is a recording medium such as a memory card and its interface (neither is shown). The image recording unit 114 records digital image data captured by the image sensor 108 and temporarily stored in the DRAM 113 on a recording medium under the control of the control unit 115. Note that the recording medium of the image recording unit 114 may be detachable from the imaging apparatus 1 through an interface.

制御手段としての制御部115は、撮像装置1の各部の動作を中央制御する。具体的には、制御部115は、CPU(Central Processing Unit)、ROM(Read Only Memory)などで構成される。制御部115は、CPUがROMに記憶されたプログラムデータを読み出して画像記録部114の作業領域に展開し、そのプログラムデータを順次実行することで、上記中央制御を実現する。例えば、制御部115は、撮像素子108による撮影シーケンスなどのシステム処理を操作部118や撮影モードSW119で設定された動作モードに従って制御する。   The control unit 115 as a control unit centrally controls the operation of each unit of the imaging device 1. Specifically, the control unit 115 includes a CPU (Central Processing Unit), a ROM (Read Only Memory), and the like. In the control unit 115, the CPU reads the program data stored in the ROM, develops the program data in the work area of the image recording unit 114, and executes the program data in sequence, thereby realizing the central control. For example, the control unit 115 controls system processing such as a photographing sequence by the image sensor 108 according to the operation mode set by the operation unit 118 or the photographing mode SW119.

VRAM116(Video RAM)は、操作表示部117の表示用として制御部115から出力された画像データを一時記憶する。操作表示部117は、制御部115の制御の下で画像を表示するLCDなどの表示用デバイスである。操作表示部117は、操作補助のための表示や撮像装置1の状態表示の他、撮影時にはEVFによる撮影画面やその撮影画面において予め設定された測距領域の表示などを行う。   A VRAM 116 (Video RAM) temporarily stores the image data output from the control unit 115 for display on the operation display unit 117. The operation display unit 117 is a display device such as an LCD that displays an image under the control of the control unit 115. The operation display unit 117 displays not only a display for assisting operations and a status display of the imaging apparatus 1 but also a shooting screen by EVF and a distance measurement area set in advance on the shooting screen during shooting.

操作部118は、ユーザからの操作指示を受け付けて制御部115に操作信号を出力するボタンや操作表示部117の画面上に配置されたタッチパネルなどである。具体的には、操作部118は、撮像装置1の撮影機能や画像再生時の設定などの各種設定を行うメニュースイッチ、撮影レンズ101のズーム動作を指示するズームレバー、撮影モードと再生モードの動作モード切換えスイッチなどがある。撮影モードSW119は、撮像装置1の撮影モードの切り替え指示をユーザから受け付けて制御部115へ出力するスイッチである。例えば、撮影モードSW119は、撮影画像から顔検出を行う顔検出モードのON又はOFFの切り替え指示をユーザから受け付ける。また、撮影モードSW119は、AFモードの切り替え指示をユーザから受け付けてもよい。   The operation unit 118 is a button that receives an operation instruction from the user and outputs an operation signal to the control unit 115, a touch panel arranged on the screen of the operation display unit 117, or the like. Specifically, the operation unit 118 includes a menu switch for performing various settings such as a shooting function of the imaging apparatus 1 and settings for image playback, a zoom lever for instructing a zoom operation of the shooting lens 101, and operations in the shooting mode and playback mode There are mode change switches. The shooting mode SW 119 is a switch that receives an instruction to switch the shooting mode of the imaging apparatus 1 from the user and outputs the instruction to the control unit 115. For example, the shooting mode SW 119 receives from the user an instruction to switch the face detection mode for detecting a face from a captured image. The shooting mode SW 119 may accept an instruction to switch the AF mode from the user.

メインスイッチ120は、電源のON/OFFをユーザから受け付けて制御部115へ出力するスイッチである。第1スイッチ121は、AF処理やAE処理を予め開始する等の撮影スタンバイ動作の開始指示をユーザから受け付けて制御部115へ出力するスイッチである。第2スイッチ122は、第1スイッチ121の操作後に撮影の開始指示をユーザから受け付けて制御部115へ出力するスイッチである。なお、第1スイッチ121、第2スイッチ122は、シャッターボタン(図示しない)の半押しにより第1スイッチ121がONされ、シャッターボタンの全押しにより第2スイッチ122がONされる構成であってもよい。   The main switch 120 is a switch that receives power ON / OFF from the user and outputs it to the control unit 115. The first switch 121 is a switch that receives from the user an instruction to start a shooting standby operation, such as starting AF processing or AE processing in advance, and outputs the instruction to the control unit 115. The second switch 122 is a switch that receives a shooting start instruction from the user after the operation of the first switch 121 and outputs it to the control unit 115. The first switch 121 and the second switch 122 may be configured such that the first switch 121 is turned on by half-pressing a shutter button (not shown) and the second switch 122 is turned on by fully pressing the shutter button. Good.

顔検出モジュール123は、画像処理部110により出力された画像処理済みのデジタル画像データから人物の顔領域の検出を行い、検出した一つ又は複数の顔情報(顔領域の位置、そのサイズ、信頼度など)を制御部115へ出力する(顔検出手段)。人物の顔検出方法は、公知の技術を適用可能であり、本発明と直接関係しないため、詳細な説明は省略する。   The face detection module 123 detects a human face area from the image-processed digital image data output from the image processing unit 110, and detects one or more pieces of detected face information (the position of the face area, its size, reliability). Degree etc.) is output to the control unit 115 (face detection means). Since a known technique can be applied to the human face detection method and is not directly related to the present invention, detailed description thereof is omitted.

なお、公知の顔検出技術としては、ニューラルネットワークなどを利用した学習に基づく手法、テンプレートマッチングを用いて目、鼻、口等の形状に特徴のある部位を画像から探し出し、類似度が高ければ顔とみなす手法などがある。また、他にも、肌の色や目の形といった画像特徴量を検出し、統計的解析を用いた手法等、多数提案されている。一般的には、これらの手法を複数組み合わせ、顔検出の精度を向上させている。具体的な例としては特開2002−251380号公報に記載されるような、ウエーブレット変換と画像特徴量を利用して顔検出する方法などが挙げられる。   It should be noted that as a known face detection technique, a method based on learning using a neural network or the like, template matching is used to search a part having features in the shape of eyes, nose, mouth, etc. from an image. There is a method to consider that. In addition, many other methods have been proposed, such as a method that detects image feature amounts such as skin color and eye shape and uses statistical analysis. In general, a plurality of these methods are combined to improve face detection accuracy. As a specific example, there is a method of detecting a face using wavelet transform and image feature amount as described in JP-A-2002-251380.

動体検出部124は、撮像素子108で連続的に撮影された複数の撮影画像を互いに比較することで、被写体及び背景が動いているか否かを検出してその動体情報を制御部115へ出力する(第1の動き量検出手段)。具体的には、動体検出部124は、画像処理部110により出力された画像処理済みのデジタル画像データのうち、時系列的に並んだ2枚の撮影画像を比較し、その差分情報から被写体や背景の動体情報(動き量、位置、範囲)を検出して制御部115へ出力する。   The moving body detection unit 124 detects whether or not the subject and the background are moving by comparing a plurality of captured images continuously captured by the image sensor 108 and outputs the moving body information to the control unit 115. (First motion amount detection means). Specifically, the moving object detection unit 124 compares two photographed images arranged in time series in the digital image data that has been subjected to image processing and output from the image processing unit 110. Background moving body information (motion amount, position, range) is detected and output to the control unit 115.

角速度センサ部125は、撮像装置1自体の動き(角速度)を検出してその動き情報(動き量)を制御部115へ出力する(第2の動き量検出手段)。具体的には、角速度センサ部125は、円い空洞の中の球体の位置を検出して鉛直方向に対する撮像装置1の姿勢を検出する重力センサやジャイロセンサ等であってよい。   The angular velocity sensor unit 125 detects the movement (angular velocity) of the imaging apparatus 1 itself and outputs the movement information (movement amount) to the control unit 115 (second movement amount detection unit). Specifically, the angular velocity sensor unit 125 may be a gravity sensor, a gyro sensor, or the like that detects the position of a sphere in a circular cavity and detects the posture of the imaging device 1 with respect to the vertical direction.

次に、制御部115の制御の下で行われる撮像装置1の動作について、図2〜図17を参照して説明する。ここで、図2は、撮像装置1の動作を示すフローチャートである。なお、制御部115は、以下に示すフローチャートにおいて、DRAM113の作業領域に動作用の変数情報を格納し、各ステップでその変数情報の読み出しや更新を行いながら処理を実行している。DRAM113の作業領域に格納される変数情報としては、フラグデータや算出値やカウンタ値などの数値データなどがある。   Next, the operation of the imaging apparatus 1 performed under the control of the control unit 115 will be described with reference to FIGS. Here, FIG. 2 is a flowchart showing the operation of the imaging apparatus 1. In the flowchart shown below, the control unit 115 stores variable information for operation in the work area of the DRAM 113, and executes processing while reading and updating the variable information in each step. The variable information stored in the work area of the DRAM 113 includes numerical data such as flag data, calculated values, and counter values.

[変数情報について]
フラグデータとしては、合焦フラグ、ピーク検出フラグ、距離変化フラグ、同方向移動フラグ、顔検出フラグなどがある。合焦フラグは、合焦判定における判定結果を示すフラグデータであり、TRUEである場合に被写体に合焦されていることを示し、FALSEである場合に被写体に合焦されていないことを示す。顔検出フラグは、顔検出モジュール123において顔検出したか否かを示すフラグデータであり、TRUEである場合に顔検出していることを示し、FALSEである場合に顔検出していないことを示す。ピーク検出フラグは、山登りAF(AFスキャン)において焦点評価値が最大となるピークが検出されたことを示すフラグデータである。ピーク検出フラグがTRUEである場合にはピークが検出されたことを示し、FALSEである場合にはピークが検出されていないことを示す。距離変化フラグは、自装置である撮像装置1と被写体との間の被写体距離が変化したことを示すフラグデータである。距離変化フラグがTRUEである場合には被写体距離が変化したことを示し、FALSEである場合には被写体距離が変化していないことを示す。同方向移動フラグは、今回のAFスキャンにおけるスキャン中心位置に対するピーク位置の方向と、前回のAFスキャンにおけるスキャン中心位置に対するピーク位置の方向とが同方向であるか否かを示すフラグデータである。同方向移動フラグがTRUEである場合には同方向であることを示し、FALSEである場合には同方向でないことを示す。
[About variable information]
The flag data includes an in-focus flag, a peak detection flag, a distance change flag, a same direction movement flag, a face detection flag, and the like. The in-focus flag is flag data indicating a determination result in the in-focus determination, and indicates that the subject is focused when TRUE, and indicates that the subject is not focused when FALSE. The face detection flag is flag data indicating whether or not a face is detected by the face detection module 123, and indicates that the face is detected when TRUE, and indicates that no face is detected when FALSE. . The peak detection flag is flag data indicating that a peak having the maximum focus evaluation value is detected in hill-climbing AF (AF scan). When the peak detection flag is TRUE, it indicates that a peak has been detected, and when it is FALSE, it indicates that no peak has been detected. The distance change flag is flag data indicating that the subject distance between the imaging device 1 that is the subject device and the subject has changed. When the distance change flag is TRUE, it indicates that the subject distance has changed, and when it is FALSE, it indicates that the subject distance has not changed. The same direction movement flag is flag data indicating whether or not the direction of the peak position with respect to the scan center position in the current AF scan and the direction of the peak position with respect to the scan center position in the previous AF scan are the same direction. When the same direction movement flag is TRUE, it indicates that the direction is the same, and when it is FALSE, it indicates that the direction is not the same.

また、数値データとしては、前述した焦点評価値、取得カウンタ、増加カウンタ、顔検出サイズ変化回数、輝度値変化回数、焦点評価値変化回数、カメラ動作回数、被写体動作回数、×count値、StCount値などがある。取得カウンタは、フォーカスレンズ104の現在位置を取得した回数を示す数値データである。増加カウンタは、山登りAFにおいて、直近の処理で取得した焦点評価値がその前の処理で取得した焦点評価値より大きいこと(その回数など)を示す数値データである。顔検出サイズ変化回数は、AF枠の画像領域において顔検出モジュール123で検出した顔のサイズが変化した回数を示す数値データである。輝度値変化回数は、AF枠の画像領域において輝度値が変化した回数を示す数値データである。焦点評価値変化回数は、AF枠の画像領域において焦点評価値が変化した回数を示す数値データである。カメラ動作変化回数は、撮像装置1の動作量(動き量)が予め設定された所定値以上変化した回数を示す数値データである。被写体動作変化回数は、被写体の動作量が予め設定された所定値以上変化した回数を示す数値データである。×count値は、合焦判定が連続して○判定でなかった回数(×判定の回数)を示す数値データである。StCount値は、ピーク位置とスキャン中心位置との差が所定値より連続して小さくなった回数を示す数値データである。   The numerical data includes the focus evaluation value, acquisition counter, increase counter, face detection size change count, brightness value change count, focus evaluation value change count, camera operation count, subject motion count, × count value, StCount value. and so on. The acquisition counter is numerical data indicating the number of times the current position of the focus lens 104 has been acquired. The increase counter is numerical data indicating that in hill-climbing AF, the focus evaluation value acquired in the most recent process is larger than the focus evaluation value acquired in the previous process (such as the number of times). The face detection size change count is numerical data indicating the number of changes in the size of the face detected by the face detection module 123 in the image area of the AF frame. The number of changes in luminance value is numerical data indicating the number of times the luminance value has changed in the image area of the AF frame. The focus evaluation value change count is numerical data indicating the number of times the focus evaluation value has changed in the image area of the AF frame. The number of camera operation changes is numerical data indicating the number of times that the operation amount (motion amount) of the imaging apparatus 1 has changed by a predetermined value or more. The subject motion change count is numerical data indicating the number of times that the motion amount of the subject has changed by a predetermined value or more. The × count value is numerical data indicating the number of times that the in-focus determination has not been continuously determined as “good” (× the number of determinations). The StCount value is numerical data indicating the number of times that the difference between the peak position and the scan center position is continuously smaller than a predetermined value.

[メインルーチンについて]
図2に示すように、撮像装置1は、メインスイッチ120がONとなり電源が投入されることで、制御部115が制御して行う処理を開始する。処理が開始されると、S201で制御部115は、画像記録部114における記録媒体の残容量を調べ、残容量が0であればS202へと進み、残容量が0でなければS203へと進む。なお、S201では、残容量の検出に先立って、画像記録部114における記録媒体の有無を検出し、記録媒体が接続されていない場合にS201へ処理を進めてもよい。
[Main routine]
As illustrated in FIG. 2, the imaging apparatus 1 starts processing performed by the control unit 115 when the main switch 120 is turned on and the power is turned on. When the process is started, the control unit 115 checks the remaining capacity of the recording medium in the image recording unit 114 in S201. If the remaining capacity is 0, the process proceeds to S202. If the remaining capacity is not 0, the process proceeds to S203. . In S201, prior to detection of the remaining capacity, the presence or absence of a recording medium in the image recording unit 114 may be detected, and the process may proceed to S201 when the recording medium is not connected.

画像記録部114の記憶媒体の残容量が0である場合、制御部115は、S202において画像記録部114の残容量が0であることを操作表示部117に警告表示してS201へと戻る。なお、S202では、アンプ及びスピーカから構成された音声出力部(図示しない)から警告音を出力してもよいし、操作表示部117による警告表示と音声出力部による警告音の出力の両方を行ってもよい。   When the remaining capacity of the storage medium of the image recording unit 114 is 0, the control unit 115 displays a warning on the operation display unit 117 that the remaining capacity of the image recording unit 114 is 0 in S202, and returns to S201. In S202, a warning sound may be output from a sound output unit (not shown) including an amplifier and a speaker, or both a warning display by the operation display unit 117 and a warning sound output by the sound output unit are performed. May be.

S203で制御部115は、AFモードがContinuousAFモードであるかSingleAFモードであるかを調べる。制御部115は、ContinuousAFモードであればステップS204へと処理を進め、SingleAFモードであればステップS207へと処理を進める。上述したAFモードは、撮影モードSW119を介したユーザからの指示により予め設定される。なお、SingleAFモードは撮影の直前に一回AFスキャンを行って被写体への合焦させるAFモードである。ContinuousAFモードは、撮影前からAFスキャンを繰り返し行って被写体へ合焦させるAFモードである。ContinuousAFモードには、EVF表示の見栄えよりもAFスキャンを優先して行うServoAFモードがある。すなわち、ContinuousAFモード又はServoAFモードがフォーカスレンズの位置の調整を連続的に行う動作モードである。   In S203, the control unit 115 checks whether the AF mode is the ContinuousAF mode or the SingleAF mode. If the continuous AF mode is selected, the control unit 115 proceeds to step S204. If the single AF mode is selected, the control unit 115 proceeds to step S207. The AF mode described above is set in advance by an instruction from the user via the shooting mode SW119. The SingleAF mode is an AF mode in which an AF scan is performed once immediately before shooting to focus on the subject. The ContinuousAF mode is an AF mode in which AF scanning is repeatedly performed before shooting to focus on the subject. The ContinuousAF mode includes a ServoAF mode in which AF scanning is given priority over the appearance of EVF display. That is, the ContinuousAF mode or ServoAF mode is an operation mode for continuously adjusting the position of the focus lens.

S204で制御部115は、操作部118を介したユーザからの指示において、EVF表示の見栄えを優先するかAFスキャンを繰り返し行うAF追従を優先するかを調べる。制御部115は、EVF表示の見栄えを優先する場合はS205へと処理を進め、AF追従を優先する場合はS206へと処理を進める。   In step S <b> 204, the control unit 115 checks whether priority is given to the appearance of the EVF display or AF tracking in which AF scanning is repeatedly performed in accordance with an instruction from the user via the operation unit 118. If priority is given to the appearance of the EVF display, the control unit 115 proceeds to S205, and if priority is given to AF tracking, the control unit 115 proceeds to S206.

S205で制御部115は、後述する図3のフローチャートに従ってContinuousAFを行い、S207へと処理を進める。S206で制御部115は、後述する図4のフローチャートに従ってServoAFを行い、S207へと処理を進める。   In S205, the control unit 115 performs Continuous AF according to the flowchart of FIG. 3 described later, and advances the process to S207. In S206, the control unit 115 performs ServoAF according to the flowchart of FIG. 4 to be described later, and proceeds to S207.

S207で制御部115は、第1スイッチ121の状態を調べ、ONであればS208へと処理を進め、ONでなければS201へと処理を進める。S208で制御部115は、AE処理部103で画像処理部110の出力からAE処理を行ってS209へと処理を進める。S209で制御部115は、合焦フラグの状態を調べ、合焦フラグがTRUEであればS211へと処理を進め、合焦フラグがFALSEであればS210へと処理を進める。   In step S207, the control unit 115 checks the state of the first switch 121. If it is ON, the control unit 115 proceeds to step S208. If not, the control unit 115 proceeds to step S201. In step S208, the control unit 115 performs AE processing from the output of the image processing unit 110 in the AE processing unit 103, and advances the processing to step S209. In S209, the control unit 115 checks the state of the focus flag. If the focus flag is TRUE, the control unit 115 proceeds to S211. If the focus flag is FALSE, the control unit 115 proceeds to S210.

S210で制御部115は、後述する図7のフローチャートに従って、通常AF動作を行ってS211へと処理を進める。S211で制御部115は、ServoAFモードに設定されているか否かを調べる。制御部115は、ServoAFモードに設定されていればS212へと処理を進め、ServoAFモードに設定されていなければS213へと処理を進める。S212で制御部115は、後述する図4に従って、ServoAFを行ってS213へと処理を進める。   In S210, the control unit 115 performs a normal AF operation according to the flowchart of FIG. In S211, the control unit 115 checks whether the ServoAF mode is set. The control unit 115 advances the process to S212 if the ServoAF mode is set, and advances the process to S213 if the ServoAF mode is not set. In S212, the control unit 115 performs ServoAF according to FIG. 4 described later, and advances the process to S213.

S213で制御部115は、第1スイッチ121の状態を調べ、ONであればS214へと処理を進め、ONでなければS201へと処理を進める。S214で制御部115は、第2スイッチ122の状態を調べ、ONであればS215へと処理を進め、ONでなければS211へと処理を進める。S215で制御部115は、後述する図17のフローチャートに従って、撮影動作を行ってS201へと処理を進める。   In step S213, the control unit 115 checks the state of the first switch 121. If it is ON, the control unit 115 proceeds to step S214. If not, the control unit 115 proceeds to step S201. In S214, the control unit 115 checks the state of the second switch 122. If it is ON, the process proceeds to S215, and if not ON, the process proceeds to S211. In S215, the control unit 115 performs a shooting operation according to the flowchart of FIG. 17 described later, and advances the process to S201.

上述した処理により、撮像装置1では、電源が投入されて第1スイッチ121がONされるまではS201〜S207の処理がループして行われることとなる。また、撮像装置1では、第1スイッチ121がONされるとS208〜S213までの処理が行われ、第1スイッチ121がONのままで第2スイッチ122がOFFの状態ではS211〜S213の処理がループして行われることとなる。そして、第1スイッチ121がONの状態で第2スイッチ122がONされると撮影が行われることとなる。   With the above-described processing, in the imaging apparatus 1, the processing from S201 to S207 is performed in a loop until the first switch 121 is turned on after the power is turned on. Further, in the imaging apparatus 1, when the first switch 121 is turned on, the processing from S208 to S213 is performed, and when the first switch 121 is on and the second switch 122 is off, the processing of S211 to S213 is performed. It will be done in a loop. When the second switch 122 is turned on while the first switch 121 is on, shooting is performed.

[ContinuousAFについて]
次に、図2のフローチャートにおけるS205のContinuousAFのサブルーチンについて、図3のフローチャートを参照しながら説明する。図3に示すように、ContinuousAFが開始されると、S301で制御部115は、顔検出モジュール123において顔検出したか否かを調べる。制御部115は、顔検出していればS302へと処理を進め、顔検出していなければS304へと処理を進める。
[About ContinuousAF]
Next, the ContinuousAF subroutine of S205 in the flowchart of FIG. 2 will be described with reference to the flowchart of FIG. As shown in FIG. 3, when Continuous AF is started, the control unit 115 checks whether or not a face is detected in the face detection module 123 in S <b> 301. If the face is detected, the control unit 115 advances the process to S302. If the face is not detected, the control unit 115 advances the process to S304.

S302で制御部115は、顔検出モジュール123で検出した顔位置・顔サイズなどの顔情報を取得してS303へと処理を進める。S303で制御部115は、顔検出していることを示す顔検出フラグをTRUEにしてS304へと処理を進める。   In step S302, the control unit 115 acquires face information such as the face position and face size detected by the face detection module 123, and advances the processing to step S303. In S303, the control unit 115 sets the face detection flag indicating that the face is detected to TRUE, and advances the process to S304.

S304で制御部115は、顔検出フラグの状態を調べる。制御部115は、顔検出フラグがTRUEであればS305へと処理を進め、顔検出フラグがFALSEであればS306へと処理を進める。   In step S304, the control unit 115 checks the state of the face detection flag. If the face detection flag is TRUE, the control unit 115 advances the process to S305, and if the face detection flag is FALSE, the control unit 115 advances the process to S306.

S305で制御部115は、顔検出モジュール123で検出された最新の顔検出位置にAF枠(焦点検出領域)を設定してS307へと処理を進める。ここで、顔検出されているときのAF枠のサイズは、ROMなどに予め設定された所定のサイズに設定してもよいし、顔検出モジュール123で検出した顔サイズに応じたサイズに設定してもよい。S306で制御部115は、中央領域などの予め設定された所定位置にAF枠を設定してS307へと処理を進める。S307で制御部115は、S305、又は、S306で設定したAF枠内の画像領域における焦点評価値(コントラスト値)及び輝度値を取得してS308へと処理を進める(輝度取得手段)。   In step S305, the control unit 115 sets an AF frame (focus detection area) at the latest face detection position detected by the face detection module 123, and proceeds to step S307. Here, the size of the AF frame when the face is detected may be set to a predetermined size preset in a ROM or the like, or set to a size corresponding to the face size detected by the face detection module 123. May be. In step S306, the control unit 115 sets an AF frame at a predetermined position such as the center area, and advances the process to step S307. In step S307, the control unit 115 acquires the focus evaluation value (contrast value) and the luminance value in the image area within the AF frame set in step S305 or S306, and advances the processing to step S308 (luminance acquisition unit).

S308で制御部115は、後述するS309の山登りAFにおいてピークが検出されたことを示す、ピーク検出フラグの状態を調べる。制御部115は、ピーク検出フラグがTRUEであればS310へと処理を進め、ピーク検出フラグがFALSEであればS309へと処理を進める。S309で制御部115は、後述する図5のフローチャートに従って山登りAFを行った後にContinuousAFのサブルーチンを終了し、S207へ処理を進める。   In step S308, the control unit 115 checks the state of a peak detection flag indicating that a peak has been detected in hill climbing AF in step S309 described later. If the peak detection flag is TRUE, the control unit 115 proceeds to S310, and if the peak detection flag is FALSE, the control unit 115 proceeds to S309. In step S309, the control unit 115 performs hill-climbing AF according to the flowchart of FIG. 5 to be described later, ends the ContinuousAF subroutine, and advances the process to step S207.

S310で制御部115は、後述する図6のフローチャートに従って被写体距離変化判定を行って、ステップS311へと処理を進める。S311で制御部115は、被写体距離が変化したことを示す距離変化フラグの状態を調べる。制御部115は、距離変化フラグがTRUEであればステップS312へと処理を進め、距離変化フラグがFALSEであればS313へと処理を進める。   In step S310, the control unit 115 performs subject distance change determination according to the flowchart of FIG. 6 described later, and proceeds to step S311. In step S311, the control unit 115 checks the state of the distance change flag indicating that the subject distance has changed. If the distance change flag is TRUE, the control unit 115 proceeds to step S312. If the distance change flag is FALSE, the control unit 115 proceeds to step S313.

S312で制御部115は、ピーク検出フラグ及び距離変化フラグをFALSEにしてリセットする。また、制御部115は、S309の山登りAFのサブルーチンで用いる焦点評価値の最大値、ピーク位置、焦点評価値の増加を示す増加カウンタをリセットしてS313へと処理を進める。S313で制御部115は、フォーカスレンズをそのまま停止させてS207へと処理を進める。   In step S312, the control unit 115 resets the peak detection flag and the distance change flag to FALSE. In addition, the control unit 115 resets the increase counter indicating the maximum focus evaluation value, the peak position, and the increase in focus evaluation value used in the hill-climbing AF subroutine of S309 and advances the process to S313. In step S313, the control unit 115 stops the focus lens as it is and proceeds to step S207.

[ServoAFについて]
次に、図2のフローチャートにおけるS206やS212のServoAFのサブルーチンについて、図4のフローチャートを参照しながら説明する。図4に示すように、ServoAFが開始されると、S401で制御部115は、顔検出モジュール123において顔検出したか否かを調べる。制御部115は、顔検出していればS402へと処理を進め、顔検出していなければS404へと処理を進める。
[About ServoAF]
Next, the ServoAF subroutine of S206 and S212 in the flowchart of FIG. 2 will be described with reference to the flowchart of FIG. As shown in FIG. 4, when ServoAF is started, the control unit 115 checks whether or not a face is detected by the face detection module 123 in S401. If the face is detected, the control unit 115 advances the process to S402. If the face is not detected, the control unit 115 advances the process to S404.

S402で制御部115は、顔検出モジュール123で検出した顔位置・顔サイズなどの顔情報を取得してS403へと処理を進める。S403で制御部115は、顔検出していることを示す顔検出フラグをTRUEにしてS404へと処理を進める。   In step S402, the control unit 115 acquires face information such as the face position and face size detected by the face detection module 123, and advances the process to step S403. In S403, the control unit 115 sets the face detection flag indicating that the face is detected to TRUE, and advances the process to S404.

S404で制御部115は、顔検出フラグの状態を調べる。制御部115は、顔検出フラグがTRUEであればS405へと処理を進め、顔検出フラグがFALSEであればS406へと処理を進める。   In step S404, the control unit 115 checks the state of the face detection flag. If the face detection flag is TRUE, the control unit 115 advances the process to S405, and if the face detection flag is FALSE, the control unit 115 advances the process to S406.

S405で制御部115は、顔検出モジュール123で検出された最新の顔検出位置にAF枠を設定してS407へと処理を進める。ここで、顔検出されているときのAF枠のサイズは、予め設定された所定のサイズに設定してもよいし、検出した顔サイズに応じたサイズに設定してもよい。S406で制御部115は、中央領域などの予め設定された所定位置にAF枠を設定してS407へと処理を進める。S407で制御部115は、S405、又は、S406で設定したAF枠内の画像領域における焦点評価値及び輝度値を取得してS408へと処理を進める(輝度取得手段)。   In step S405, the control unit 115 sets an AF frame at the latest face detection position detected by the face detection module 123, and advances the process to step S407. Here, the size of the AF frame when the face is detected may be set to a predetermined size set in advance, or may be set to a size according to the detected face size. In step S406, the control unit 115 sets an AF frame at a predetermined position such as the center area, and advances the process to step S407. In step S407, the control unit 115 acquires the focus evaluation value and the luminance value in the image area within the AF frame set in step S405 or S406, and advances the processing to step S408 (luminance acquisition unit).

S408で制御部115は、後述するS409の山登りAFにおいてピークが検出されたことを示す、ピーク検出フラグの状態を調べる。制御部115は、ピーク検出フラグがTRUEであればS410へと処理を進め、ピーク検出フラグがFALSEであればS409へと処理を進める。S409で制御部115は、後述する図5のフローチャートに従って山登りAFを行った後にServoAFのサブルーチンを終了し、S207又はS213へ処理を進める。   In step S408, the control unit 115 checks the state of a peak detection flag indicating that a peak has been detected in hill-climbing AF in step S409, which will be described later. If the peak detection flag is TRUE, the control unit 115 proceeds to S410, and if the peak detection flag is FALSE, the control unit 115 proceeds to S409. In step S409, the control unit 115 terminates the ServoAF subroutine after performing hill-climbing AF according to the flowchart of FIG. 5 described later, and advances the process to step S207 or S213.

S410で制御部115は、被写体距離が変化したことを示す距離変化フラグの状態を調べる。制御部115は、距離変化フラグがTUREであればS412へと処理を進め、距離変化フラグがFALSEであればS411へと処理を進める。S411で制御部115は、合焦フラグがTRUEであるか否かを調べる。制御部115は、合焦フラグがTRUEであればS413へと処理を進め、合焦フラグがFALSEであればS412へと処理を進める。   In step S410, the control unit 115 checks the state of the distance change flag indicating that the subject distance has changed. If the distance change flag is TURE, the control unit 115 advances the process to S412. If the distance change flag is FALSE, the control unit 115 advances the process to S411. In S411, the control unit 115 checks whether or not the focus flag is TRUE. If the focus flag is TRUE, the control unit 115 advances the process to S413, and if the focus flag is FALSE, the control unit 115 advances the process to S412.

S412で制御部115は、後述する図8のフローチャートに従って、Servo中AF動作を行った後にServoAFのサブルーチンを終了し、S207又はS213へ処理を進める。S413で制御部115は、後述する図6のフローチャートに従って被写体距離変化判定を行った後にServoAFのサブルーチンを終了し、S207又はS213へ処理を進める。   In step S412, the control unit 115 ends the ServoAF subroutine after performing the Servo AF operation in accordance with the flowchart of FIG. 8 described later, and advances the process to S207 or S213. In step S413, the control unit 115 performs subject distance change determination according to the flowchart of FIG. 6 to be described later, ends the ServoAF subroutine, and advances the process to step S207 or S213.

[山登りAFについて]
次に、図3のフローチャートにおけるS309、図4のフローチャートにおけるS409の山登りAFのサブルーチンについて、図5のフローチャートを参照しながら説明する。図5に示すように、山登りAFが開始されると、S501で制御部115は、フォーカスレンズ104の現在位置を取得してS502へと処理を進める。
[About mountain climbing AF]
Next, the hill-climbing AF subroutine of S309 in the flowchart of FIG. 3 and S409 in the flowchart of FIG. 4 will be described with reference to the flowchart of FIG. As shown in FIG. 5, when the hill-climbing AF is started, the control unit 115 acquires the current position of the focus lens 104 in S501 and advances the process to S502.

S502で制御部115は、設定されたAF枠内の画像領域における焦点評価値・輝度値の取得し、フォーカスレンズ104の現在位置の取得をカウントするための取得カウンタをインクリメントしてS503へと処理を進める。なお、取得カウンタは、初期化動作(図示しない)において予め0(又はNULL値)に設定されているものとする。   In step S502, the control unit 115 acquires a focus evaluation value / brightness value in the set image area in the AF frame, increments an acquisition counter for counting acquisition of the current position of the focus lens 104, and performs the processing in step S503. To proceed. It is assumed that the acquisition counter is set to 0 (or a NULL value) in advance in an initialization operation (not shown).

S503で制御部115は、取得カウンタの値が1か否かを調べる。制御部115は、取得カウンタの値が1ならばS506へと処理を進め、取得カウンタの値が1でなければS504へと処理を進める。   In step S503, the control unit 115 checks whether the value of the acquisition counter is 1. If the value of the acquisition counter is 1, the control unit 115 advances the process to S506. If the value of the acquisition counter is not 1, the control unit 115 advances the process to S504.

S504で制御部115は、直近の処理で取得した「今回の焦点評価値」がその前の処理で取得した「前回の焦点評価値」よりも大きいか否かを調べる。制御部115は、「今回の焦点評価値」が「前回の焦点評価値」よりも大きければS505へと処理を進め、それ以下であればS512へと処理を進める。   In step S <b> 504, the control unit 115 checks whether the “current focus evaluation value” acquired in the most recent process is larger than the “previous focus evaluation value” acquired in the previous process. If the “current focus evaluation value” is larger than the “previous focus evaluation value”, the control unit 115 advances the process to S505, and if less than that, advances the process to S512.

S505で制御部115は、「今回の焦点評価値」が「前回の焦点評価値」よりも大きいことを示す増加カウンタに1を加えてS505へと処理を進める。この増加カウンタは、前述した初期化動作において予め0(又はNULL値)に設定されているものとする。   In step S <b> 505, the control unit 115 adds 1 to an increase counter indicating that “current focus evaluation value” is larger than “previous focus evaluation value”, and advances the process to step S <b> 505. This increment counter is set to 0 (or a NULL value) in advance in the initialization operation described above.

S506で制御部115は、今回の焦点評価値を焦点評価値の最大値(ピーク評価値)として制御部115に内臓される演算メモリ(図示しない)に記憶して、S507へと処理を進める。S507で制御部115は、フォーカスレンズ104の現在の位置を焦点評価値のピーク位置として制御部115に内臓される演算メモリに記憶して、S508へと処理を進める。S508で制御部115は、今回の焦点評価値を前回の焦点評価値として制御部115に内臓される演算メモリに記憶して、S509へと処理を進める。   In step S506, the control unit 115 stores the current focus evaluation value as a maximum focus evaluation value (peak evaluation value) in a calculation memory (not shown) built in the control unit 115, and proceeds to step S507. In step S507, the control unit 115 stores the current position of the focus lens 104 as a peak position of the focus evaluation value in a calculation memory built in the control unit 115, and proceeds to step S508. In step S508, the control unit 115 stores the current focus evaluation value as the previous focus evaluation value in a calculation memory built in the control unit 115, and proceeds to step S509.

S509で制御部115は、フォーカスレンズ104の現在位置が予め設定された測距範囲の端にあるか否かを調べる。制御部115は、測距範囲の端にあればS510へと処理を進め、測距範囲の端になければS511へと処理を進める。なお、測距範囲は、後述する処理により設定されるフォーカスレンズ104の駆動範囲であり、標準状態ではフォーカスレンズ104の可動範囲が予め設定されているものとする。山登りAF等のスキャンは、設定された測距範囲内(駆動範囲内)でフォーカスレンズ104を駆動することで行われる。   In step S509, the control unit 115 checks whether or not the current position of the focus lens 104 is at the end of a preset distance measurement range. The control unit 115 advances the process to S510 if it is at the end of the distance measurement range, and advances the process to S511 if it is not at the end of the distance measurement range. The distance measurement range is a drive range of the focus lens 104 set by processing to be described later, and the movable range of the focus lens 104 is set in advance in the standard state. Scanning such as hill-climbing AF is performed by driving the focus lens 104 within a set distance measuring range (within a driving range).

S510で制御部115は、フォーカスレンズ104の移動方向を反転してS511へと処理を進める。S511で制御部115は、フォーカスレンズ104を予め設定された所定量移動した後に後に山登りAFのサブルーチンを終了する。   In S510, the control unit 115 reverses the moving direction of the focus lens 104 and advances the process to S511. In step S511, the control unit 115 moves the focus lens 104 by a predetermined amount, and then ends the hill-climbing AF subroutine.

S512で制御部115は、演算メモリに記憶されたピーク評価値を読み出し、「ピーク評価値−今回の焦点評価値」が予め設定された所定量(閾値)より大きいか否かを調べる。制御部115は、所定量より大きければS513へと処理を進め、所定量以下であればS508へと処理を進める。ここで、「ピーク評価値−今回の焦点評価値」が所定量より大きく、ピーク評価値から所定量減少していれば、そのピーク評価値を被写体へ合焦している際の焦点評価値とみなす。すなわち、フォーカスレンズ104を測距範囲内で駆動した際に、焦点評価値が増加から減少に転じる変曲点が被写体へ合焦している焦点評価値とみなされることとなる。   In step S512, the control unit 115 reads the peak evaluation value stored in the calculation memory, and checks whether “peak evaluation value−current focus evaluation value” is greater than a predetermined amount (threshold value) set in advance. The control unit 115 advances the process to S513 if it is larger than the predetermined amount, and advances the process to S508 if it is less than the predetermined amount. Here, if “peak evaluation value−current focus evaluation value” is larger than a predetermined amount and is decreased by a predetermined amount from the peak evaluation value, the focus evaluation value when the peak evaluation value is focused on the subject I reckon. That is, when the focus lens 104 is driven within the distance measuring range, the inflection point at which the focus evaluation value turns from increasing to decreasing is regarded as the focus evaluation value at which the subject is focused.

S513で制御部115は、増加カウンタが0より大きいか否かを調べる。制御部115は、増加カウンタが0より大きければS514へと処理を進め、増加カウンタが0以下であればS508へと処理を進める。   In S513, the control unit 115 checks whether or not the increase counter is greater than zero. The control unit 115 advances the process to S514 if the increase counter is greater than 0, and advances the process to S508 if the increase counter is 0 or less.

S514で制御部115は、フォーカスレンズ104をS507で記憶した焦点評価値が最大値となったピーク位置へ移動させて、S515へと処理を進める。S515で制御部115は、ピーク検出フラグをTRUEにしてS516へと処理を進める。S516で制御部115は、取得カウンタを0としてS207へと処理を進める。   In step S514, the control unit 115 moves the focus lens 104 to the peak position where the focus evaluation value stored in step S507 is the maximum value, and proceeds to step S515. In S515, the control unit 115 sets the peak detection flag to TRUE and advances the process to S516. In step S516, the control unit 115 sets the acquisition counter to 0 and advances the process to step S207.

[被写体距離変化判定について]
次に、図3のフローチャートにおけるS310、及び、図4のフローチャートにおけるS413の被写体距離変化判定のサブルーチンについて、図6のフローチャートを参照しながら説明する。図6に示すように、被写体距離変化判定が開始されると、S601で制御部115は、顔検出モジュール123において顔検出したか否かを調べる。制御部115は、顔検出していればS602へと処理を進め、顔検出していなければS606へと処理を進める。
[Subject distance change judgment]
Next, the subject distance change determination subroutine of S310 in the flowchart of FIG. 3 and S413 of the flowchart of FIG. 4 will be described with reference to the flowchart of FIG. As illustrated in FIG. 6, when the subject distance change determination is started, the control unit 115 checks whether or not the face detection module 123 has detected a face in S <b> 601. If the face is detected, the control unit 115 advances the process to S602, and if the face is not detected, advances the process to S606.

S602で制御部115は、今回の処理で検出した顔サイズが前回の処理で検出した顔サイズに対して予め設定された所定割合以上変化したか否かを調べる。すなわち、S602では、フォーカスレンズの位置の調整を連続的に行う動作モード時において、連続的に取得された人物の顔領域のサイズ変化が所定割合以上変化したか否かにより被写体との距離の変化の有無を検出している。制御部115は、所定割合以上変化していればS603へと処理を進め、所定割合以上変化していなければS606へと処理を進める。S603で制御部115は、顔検出サイズ変化回数をインクリメントしてS604へと処理を進める。S604で制御部115は、顔サイズ変化回数が予め設定された閾値以上であるか否かを調べ、閾値以上であればS605へと処理を進め、閾値未満であればS606へと処理を進める。S605で制御部115は、合焦フラグをFALSEにし、距離変化フラグをTRUEにして被写体距離変化判定のサブルーチンを終了する。   In step S602, the control unit 115 checks whether or not the face size detected in the current process has changed by a predetermined ratio or more with respect to the face size detected in the previous process. That is, in S602, in the operation mode in which the position of the focus lens is continuously adjusted, the change in the distance to the subject is determined depending on whether the size change of the face area of the person acquired continuously has changed by a predetermined ratio or more. The presence or absence of is detected. The control unit 115 advances the process to S603 if it has changed by a predetermined ratio or more, and advances the process to S606 if it has not changed by a predetermined ratio or more. In step S603, the control unit 115 increments the face detection size change count and advances the process to step S604. In step S604, the control unit 115 checks whether or not the number of face size changes is equal to or greater than a preset threshold value. If it is equal to or greater than the threshold value, the control unit 115 proceeds to step S605, and if less than the threshold value, proceeds to step S606. In step S605, the control unit 115 sets the focus flag to FALSE, sets the distance change flag to TRUE, and ends the subject distance change determination subroutine.

S606で制御部115は、前回の処理で取得した輝度値に対して、今回の処理で取得した輝度値が予め設定された所定値以上変化したか否かを調べる。すなわち、S606では、フォーカスレンズの位置の調整を連続的に行う動作モード時において、連続的に取得された輝度値の変化量が所定値以上変化したか否かにより被写体との距離の変化の有無を検出している。制御部115は、所定値以上変化していればS607へと処理を進め、所定値以上変化していなければS609へと処理を進める。S607で制御部115は、輝度値変化回数をインクリメントしてS608へと処理を進める。S608で制御部115は、輝度値変化回数が予め設定された閾値以上か否かを調べ、閾値以上であればS605へと処理を進め、閾値未満であればS609へと処理を進める。   In S606, the control unit 115 checks whether or not the luminance value acquired in the current process has changed by a predetermined value or more with respect to the luminance value acquired in the previous process. That is, in S606, whether or not there is a change in the distance to the subject depending on whether or not the continuously obtained luminance value change amount has changed by a predetermined value or more in the operation mode in which the focus lens position is continuously adjusted. Is detected. The control unit 115 advances the process to S607 if it has changed by a predetermined value or more, and advances the process to S609 if it has not changed by a predetermined value or more. In step S607, the control unit 115 increments the number of changes in luminance value and advances the process to step S608. In step S608, the control unit 115 checks whether the number of changes in luminance value is equal to or greater than a preset threshold value. If the threshold value is equal to or greater than the threshold value, the control unit 115 proceeds to step S605, and if less than the threshold value, proceeds to step S609.

S609で制御部115は、前回の処理で取得した焦点評価値に対して、今回の処理で取得した焦点評価値が予め設定された所定値以上変化したか否かを調べる。すなわち、S609では、フォーカスレンズの位置の調整を連続的に行う動作モード時において、連続的に取得された焦点評価値の変化量が所定値以上変化したか否かにより被写体との距離の変化の有無を検出している。制御部115は、所定値以上変化していればS610へと処理を進め、所定値以上変化していなければS612へと処理を進める。S610で制御部115は、焦点評価値変化回数をインクリメントしてS611へと処理を進める。S611で制御部115は、焦点評価値変化回数が予め設定された閾値以上か否かを調べ、閾値以上であればS605へと処理を進め、閾値未満であればS612へと処理を進める。   In step S609, the control unit 115 checks whether the focus evaluation value acquired in the current process has changed by a predetermined value or more with respect to the focus evaluation value acquired in the previous process. That is, in S609, in the operation mode in which the position of the focus lens is continuously adjusted, the change in the distance to the subject is changed depending on whether or not the amount of change in the focus evaluation value acquired continuously has changed by a predetermined value or more. The presence or absence is detected. The control unit 115 advances the process to S610 if it has changed by a predetermined value or more, and advances the process to S612 if it has not changed by a predetermined value or more. In step S610, the control unit 115 increments the focus evaluation value change count and advances the process to step S611. In step S611, the control unit 115 checks whether the focus evaluation value change count is equal to or greater than a preset threshold value. If the focus evaluation value change number is equal to or greater than the threshold value, the control unit 115 proceeds to step S605.

S612で制御部115は、角速度センサ部125で検出した撮像装置1の動作量が予め設定された所定値以上変化したか否かを調べる。すなわち、S612では、フォーカスレンズの位置の調整を連続的に行う動作モード時において、自装置の動作量により被写体との距離の変化の有無を検出している。制御部115は、所定値以上変化していればS613へと処理を進め、所定値以上変化していなければS615へと処理を進める。S613で制御部115は、カメラ動作回数をインクリメントしてS614へと処理を進める。S614で制御部115は、カメラ動作回数が予め設定された閾値以上か否かを調べ、閾値以上であればS605へと処理を進め、閾値未満であればS615へと処理を進める。   In S612, the control unit 115 checks whether or not the operation amount of the imaging apparatus 1 detected by the angular velocity sensor unit 125 has changed by a predetermined value or more. That is, in S612, whether or not there is a change in the distance to the subject is detected based on the amount of operation of the own apparatus in the operation mode in which the position of the focus lens is continuously adjusted. The control unit 115 advances the process to S613 if it has changed by a predetermined value or more, and advances the process to S615 if it has not changed by a predetermined value or more. In step S613, the control unit 115 increments the number of camera operations and advances the process to step S614. In step S614, the control unit 115 checks whether or not the number of camera operations is greater than or equal to a preset threshold value. If it is greater than or equal to the threshold value, the control unit 115 proceeds to step S605, and if less than the threshold value, proceeds to step S615.

S615で制御部115は、動体検出部124で検出した被写体の動作量が予め設定された所定値以上であるか否かを調べる。すなわち、S615では、フォーカスレンズの位置の調整を連続的に行う動作モード時において、被写体の動作量により被写体との距離の変化の有無を検出している。制御部115は、所定値以上であればS616へと処理を進め、所定値以上でなければS618へと処理を進める。S616で制御部115は、被写体動作回数をインクリメントしてS617へと処理を進める。S617で制御部115は、被写体動作回数が予め設定された閾値以上か否かを調べ、閾値以上であればS605へと処理を進め、閾値未満であればS618へと処理を進める。   In step S615, the control unit 115 checks whether the movement amount of the subject detected by the moving body detection unit 124 is equal to or greater than a predetermined value set in advance. That is, in S615, whether or not there is a change in the distance to the subject is detected based on the amount of movement of the subject in the operation mode in which the focus lens position is continuously adjusted. If it is equal to or greater than the predetermined value, control unit 115 advances the process to S616, and if not greater than the predetermined value, advances to S618. In step S616, the control unit 115 increments the subject motion count and advances the process to step S617. In S617, the control unit 115 checks whether or not the subject motion count is equal to or greater than a preset threshold value. If it is equal to or greater than the threshold value, the process proceeds to S605, and if it is less than the threshold value, the process proceeds to S618.

S618で制御部115は、顔検出サイズ・輝度値・焦点評価値のいずれの評価値も変化しておらず、カメラ動作量、被写体動作量が所定値以上となっていないか否かを調べる。制御部115は、いずれの評価値も変化しておらず、いずれの動作量も所定値以上となっていなければS619へと処理を進める。また、制御部115は、どれかの評価値が変化している、又は、どれかの動作量が所定値以上となっていれば、被写体距離変化判定のサブルーチンを終了する。S619で制御部115は、顔サイズ変化回数・輝度値変化回数・焦点評価値変化回数、カメラ動作回数、被写体動作回数の全てを0(又はNULL値)にして被写体距離変化判定のサブルーチンを終了する。   In step S618, the control unit 115 checks whether any evaluation values of the face detection size, the luminance value, and the focus evaluation value have not changed, and whether the camera motion amount and the subject motion amount are equal to or greater than a predetermined value. If any evaluation value has not changed and any movement amount is not equal to or greater than the predetermined value, the control unit 115 advances the process to S619. Further, the control unit 115 ends the subject distance change subroutine if any of the evaluation values has changed or if any of the movement amounts is equal to or greater than a predetermined value. In step S619, the control unit 115 sets all of the face size change count, the luminance value change count, the focus evaluation value change count, the camera operation count, and the subject motion count to 0 (or a NULL value) and ends the subject distance change determination subroutine. .

上述したように、距離変化検出手段としての制御部115は、ContinuousAFモード又はServoAFモード時において、被写体と自装置との距離変化を有無を検出する被写体距離変化判定のサブルーチンを行う。これにより、撮像装置1では、フォーカスレンズの位置の調整を連続的に行う動作モード時に、被写体と自装置との距離変化の有無を検出した検出結果である距離変化フラグを下に、フォーカスレンズの駆動を制御することが可能となる。例えば、被写体と自装置との距離が変化した際には、距離変化フラグをTRUEとすることで、停止していたフォーカスレンズの駆動を再開させることが可能となる。   As described above, the control unit 115 serving as a distance change detection unit performs a subject distance change determination subroutine for detecting whether or not there is a change in the distance between the subject and the subject apparatus in the ContinuousAF mode or the ServoAF mode. Thereby, in the imaging device 1, in the operation mode in which the adjustment of the position of the focus lens is continuously performed, the distance change flag that is the detection result of detecting the presence / absence of the change in the distance between the subject and the own device is set downward. The drive can be controlled. For example, when the distance between the subject and the device changes, the focus lens that has been stopped can be restarted by setting the distance change flag to TRUE.

[通常AF動作について]
次に、図2のフローチャートにおけるS210の通常AF動作のサブルーチンについて、図7のフローチャートを参照しながら説明する。図7に示すように、通常AF動作が開始されると、S701で制御部115は、顔検出モジュール123において顔検出したか否かを調べる。制御部115は、顔検出していればS702へと処理を進め、顔検出していなければS704へと処理を進める。
[Normal AF operation]
Next, the normal AF operation subroutine of S210 in the flowchart of FIG. 2 will be described with reference to the flowchart of FIG. As shown in FIG. 7, when the normal AF operation is started, the control unit 115 checks in step S <b> 701 whether the face detection module 123 has detected a face. If the face is detected, the control unit 115 advances the process to S702, and if the face is not detected, advances the process to S704.

S702で制御部115は、顔検出モジュール123で検出した顔位置・顔サイズなどの顔情報を取得してS703へと処理を進める。S703で制御部115は、顔検出していることを示す顔検出フラグをTRUEにしてS704へと処理を進める。   In step S702, the control unit 115 acquires face information such as the face position and face size detected by the face detection module 123, and advances the processing to step S703. In step S703, the control unit 115 sets the face detection flag indicating that the face is detected to TRUE, and advances the process to step S704.

S704で制御部115は、顔検出フラグの状態を調べる。制御部115は、顔検出フラグがTRUEであればS705へと処理を進め、顔検出フラグがFALSEであればS706へと処理を進める。   In step S704, the control unit 115 checks the state of the face detection flag. If the face detection flag is TRUE, the control unit 115 advances the process to S705, and if the face detection flag is FALSE, the control unit 115 advances the process to S706.

S705で制御部115は、最新の顔検出位置にAF枠を設定してS707へと処理を進める。ここで、顔検出されているときのAF枠のサイズは、予め設定された所定のサイズに設定してもよいし、検出した顔サイズに応じたサイズに設定してもよい。S706で制御部115は、中央領域などの予め設定された所定位置にAF枠を設定してS707へと処理を進める。   In step S705, the control unit 115 sets an AF frame at the latest face detection position and advances the process to step S707. Here, the size of the AF frame when the face is detected may be set to a predetermined size set in advance, or may be set to a size according to the detected face size. In step S706, the control unit 115 sets an AF frame at a predetermined position such as the center area, and advances the process to step S707.

S707で制御部115は、撮影モードSW119により設定されたAFモードがContinuousAFであるか、又は、SingleAFモードであるかを調べる。制御部115は、ContinuousAFモードであればS708へと進み、SingleAFモードであればステップS710へと進む。   In step S <b> 707, the control unit 115 checks whether the AF mode set by the shooting mode SW <b> 119 is ContinuousAF or SingleAF mode. If it is the ContinuousAF mode, the control unit 115 proceeds to S708, and if it is the SingleAF mode, the control unit 115 proceeds to Step S710.

S708で制御部115は、ピーク検出フラグがTRUEかどうかを調べる。制御部115は、ピーク検出フラグがTRUEであればS711へと処理を進め、ピーク検出フラグがFALSEであればS710へと処理を進める。S710で制御部115は、測距範囲をフォーカスレンズ104の可動範囲の全域(第1の範囲)に設定してS712へと処理を進める。S711で制御部115は、フォーカスレンズ104の現在位置を中心として予め設定された所定範囲(第2の範囲)を測距範囲として設定してS712へと進む。   In step S708, the control unit 115 checks whether the peak detection flag is TRUE. If the peak detection flag is TRUE, the control unit 115 advances the process to S711, and if the peak detection flag is FALSE, the control unit 115 advances the process to S710. In step S710, the control unit 115 sets the distance measurement range to the entire movable range (first range) of the focus lens 104, and proceeds to step S712. In step S711, the control unit 115 sets a predetermined range (second range) centered on the current position of the focus lens 104 as a distance measurement range, and proceeds to step S712.

S711では、被写体へ合焦しているピーク評価値が検出されているため、そのピーク評価値となるフォーカスレンズ104のレンズ位置を中心とし、第1の範囲よりも狭く絞り込んだ第2の範囲が測距範囲として設定される。従って、撮像装置1では、S711による測距範囲の設定により、通常AF動作時におけるスキャン(AFスキャン)をより効率的に行うことが可能となる。   In S711, since the peak evaluation value focused on the subject is detected, the second range is narrowed down more narrowly than the first range with the lens position of the focus lens 104 serving as the peak evaluation value as the center. It is set as a ranging range. Therefore, in the imaging apparatus 1, it is possible to more efficiently perform a scan (AF scan) during the normal AF operation by setting the distance measurement range in S711.

S712で制御部115は、後述する図12のフローチャートに従ってスキャンを行って、S713へと処理を進める。S713で制御部115は、後述する図13のフローチャートに従って合焦判定を行って、S714へと処理を進める。   In step S712, the control unit 115 performs scanning according to the flowchart of FIG. 12 to be described later, and proceeds to step S713. In step S713, the control unit 115 performs in-focus determination according to the flowchart of FIG. 13 described later, and advances the process to step S714.

S714で制御部115は、S713における合焦判定(詳細は後述する)の結果が○判定か否かを調べる。制御部115は、○判定であればS715へと処理を進め、×判定であればS717へと処理を進める。   In S714, the control unit 115 checks whether or not the result of the focus determination in S713 (details will be described later) is a ◯ determination. The control unit 115 advances the process to S715 if the determination is ○, and advances the process to S717 if the determination is ×.

S715で制御部115は、フォーカスレンズ104をS712でのスキャンで計算したピーク位置へ移動してS716へと処理を進める。S716で制御部115は、ピーク検出フラグ及び合焦フラグをTRUEにし、距離変化フラグをFALSEにして通常AF動作のサブルーチンを終了する。   In step S715, the control unit 115 moves the focus lens 104 to the peak position calculated in the scan in step S712, and proceeds to step S716. In step S716, the control unit 115 sets the peak detection flag and the focusing flag to TRUE, sets the distance change flag to FALSE, and ends the normal AF operation subroutine.

S717で制御部115は、フォーカスレンズ104を予め設定されている位置(定点)へと移動してS718へと処理を進める。ここで、定点は被写体の存在確率の高い距離に設定する。顔が検出されていれば、顔サイズより人物の距離を推定して算出した距離に設定してもよい。S718で制御部115は、ピーク検出フラグ及び距離変化フラグをFALSEにして通常AF動作のサブルーチンを終了する。   In step S717, the control unit 115 moves the focus lens 104 to a preset position (fixed point), and proceeds to step S718. Here, the fixed point is set to a distance with a high probability of existence of the subject. If a face is detected, the distance calculated by estimating the distance of the person from the face size may be set. In step S718, the control unit 115 sets the peak detection flag and the distance change flag to FALSE, and ends the normal AF operation subroutine.

[Servo中AF動作について]
次に、図4のフローチャートにおけるS412のServo中AF動作のサブルーチンについて、図8のフローチャートを参照しながら説明する。図8に示すように、S801で制御部115は、RTC部(Real Time Clock(図示しない))から現在の時刻を取得し、次回のスキャン(後述するS810のスキャン)にかかる時間を算出する。次いで、制御部115は、次回のスキャンにおいてフォーカスレンズ104の位置が測距範囲の中心に位置するときの時刻(予測時刻)、を算出してPreTimeとし、S802へと処理を進める。S802で制御部115は、後述する図9のフローチャートに従って予測可能判定を行って、S803へと処理を進める。
[About AF operation during Servo]
Next, the subroutine for AF operation during Servo of S412 in the flowchart of FIG. 4 will be described with reference to the flowchart of FIG. As shown in FIG. 8, in step S801, the control unit 115 obtains the current time from the RTC unit (Real Time Clock (not shown)), and calculates the time required for the next scan (scan in S810 described later). Next, the control unit 115 calculates the time (predicted time) when the position of the focus lens 104 is located at the center of the distance measurement range in the next scan, sets it as PreTime, and advances the process to S802. In step S802, the control unit 115 performs predictability determination according to the flowchart of FIG. 9 described later, and advances the process to step S803.

S803で制御部115は、S802の予測可能判定における予測可能判定結果が予測可能か否かを調べる。制御部115は、予測可能であればS804へと処理を進め、予測可能でなければS805へと処理を進める。   In step S803, the control unit 115 checks whether the predictability determination result in the predictability determination in step S802 is predictable. If predictable, the control unit 115 advances the process to S804, and if not predictable, advances the process to S805.

S804で制御部115は、後述する図10のフローチャートに従って被写***置予測を行って、S807へと処理を進める。S805で制御部115は、後述する過去の動体予測用のデータScanTime[0]〜ScanTime[i-1]及びHokanPeak[0]〜HokanPeak[i-1]をクリアする。さらに、制御部115は、連続して予測可能判定となった回数を示す変数iを0にしてS806へと処理を進める。S806で制御部115は、フォーカスレンズ104の現在位置をスキャン中心位置に設定して、S807へと処理を進める。   In step S804, the control unit 115 performs subject position prediction according to the flowchart of FIG. 10 described later, and advances the process to step S807. In step S805, the control unit 115 clears past moving object prediction data ScanTime [0] to ScanTime [i-1] and HokanPeak [0] to HokanPeak [i-1] to be described later. Further, the control unit 115 sets the variable i indicating the number of times that the determination is continuously possible to 0, and advances the processing to S806. In step S806, the control unit 115 sets the current position of the focus lens 104 as the scan center position, and proceeds to step S807.

S807で制御部115は、合焦フラグがTRUEかどうかを調べ、合焦フラグがTRUEであればS808へと処理を進め、合焦フラグがFALSEであればS809へと処理を進める。S808で制御部115は、測距範囲を予め設定された所定範囲(第3の範囲)に設定してS810へと処理を進める。S809で制御部115は、S808で設定する第3の範囲よりも広い範囲(第4の範囲)に測距範囲を設定してS810へと処理を進める。S809では、被写体へ合焦しているピーク評価値が検出されていないことが合焦フラグから明らかであるため、第3の範囲よりも広い第4の範囲に測距範囲を設定してスキャンを行うことで、被写体へ合焦を的確に行わせる。   In S807, the control unit 115 checks whether or not the focus flag is TRUE. If the focus flag is TRUE, the control unit 115 proceeds to S808, and if the focus flag is FALSE, the control unit 115 proceeds to S809. In step S808, the control unit 115 sets the distance measurement range to a predetermined range (third range) set in advance, and proceeds to step S810. In step S809, the control unit 115 sets the distance measurement range to a range (fourth range) wider than the third range set in step S808, and proceeds to step S810. In S809, since it is clear from the focus flag that the peak evaluation value focused on the subject has not been detected, the distance measurement range is set to a fourth range wider than the third range, and scanning is performed. By doing so, the subject is accurately focused.

S810で制御部115は、後述する図12のフローチャートに従ってスキャンを行って、S811へと処理を進める。S811で制御部115は、後述する図13のフローチャートに従って合焦判定を行って、S812へと処理を進める。   In step S810, the control unit 115 performs scanning according to the flowchart of FIG. 12 described later, and advances the process to step S811. In step S811, the control unit 115 performs in-focus determination according to the flowchart of FIG. 13 described later, and advances the process to step S812.

S812で制御部115は、S811で判定した合焦判定結果が○判定か否かを調べる。制御部115は、○判定であればS813へと処理を進め、×判定であればS825へと処理を進める。   In step S812, the control unit 115 checks whether the focus determination result determined in step S811 is a “good” determination. If YES, the control unit 115 advances the process to S813, and if X, the process advances to S825.

S813で制御部115は、合焦フラグをTRUEにしてS814へと処理を進める。S814で制御部115は、連続して合焦判定が○判定でなかった回数(×判定の回数)を示す×countを0にしてS815へと処理を進める。   In step S813, the control unit 115 sets the in-focus flag to TRUE and advances the process to step S814. In step S814, the control unit 115 sets xcount indicating the number of times that the in-focus determination is not a “good” determination (the number of determination times) to 0, and advances the process to step S815.

S815で制御部115は、S810におけるスキャン結果(ピーク位置)とスキャン中心位置の差が予め設定された所定値より小さいか否かを調べる。制御部115は、、所定値より小さければS816へと処理を進め、所定値より小さくなければS819へと処理を進める。   In S815, the control unit 115 checks whether the difference between the scan result (peak position) in S810 and the scan center position is smaller than a predetermined value set in advance. If it is smaller than the predetermined value, the control unit 115 proceeds to S816, and if not smaller than the predetermined value, the control unit 115 proceeds to S819.

S816で制御部115は、S810におけるピーク位置とスキャン中心位置との差が所定値より連続して小さくなった回数を示すStCountに1をインクリメントしてS817へと処理を進める。S817で制御部115は、StCountが予め設定された閾値以上であるか否かを調べ、閾値以上であればS818へと処理を進め、閾値未満であればS820へと処理を進める。すなわち、制御部115は、Servo中AF動作によるフォーカスレンズ104の調整結果に基づいて決定した基準位置(スキャン中心位置)に対して、予め設定された範囲内に焦点評価値が最大となるフォーカスレンズ位置が含まれるか否かを判定する。そして、制御部115は、予め設定された範囲内に焦点評価値が最大となるフォーカスレンズ位置が含まれることが、予め設定された回数繰り返されるか否かを判定して、距離変化の有無を検出している距離変化検出手段である。   In S816, the control unit 115 increments StCount indicating the number of times that the difference between the peak position and the scan center position in S810 is continuously smaller than a predetermined value, and advances the process to S817. In step S817, the control unit 115 checks whether or not StCount is greater than or equal to a preset threshold value. If it is greater than or equal to the threshold value, the control unit 115 proceeds to step S818, and if less than the threshold value, proceeds to step S820. That is, the control unit 115 has the focus evaluation value that maximizes the focus evaluation value within a preset range with respect to the reference position (scan center position) determined based on the adjustment result of the focus lens 104 by the AF operation during Servo. It is determined whether or not a position is included. Then, the control unit 115 determines whether or not the focus lens position where the focus evaluation value is maximized within the preset range is repeated a preset number of times, and determines whether or not there is a change in distance. It is the distance change detection means which is detecting.

S818で制御部115は、被写体の距離変化がなくなったと判断して、距離変化フラグをFALSEにする。S818aで制御部115は、フォーカスレンズ104の駆動を停止させて、Servo中AF動作のサブルーチンを終了する。これにより、撮像装置1では、ServoAF時においても、被写体距離が変化しない場合にはフォーカスレンズを停止させることで、ServoAFにおけるスキャンが無駄に繰り返されることを無くすことができる。   In S818, the control unit 115 determines that the distance change of the subject has disappeared, and sets the distance change flag to FALSE. In step S818a, the control unit 115 stops driving the focus lens 104 and ends the subroutine for AF operation during Servo. Thereby, in the imaging apparatus 1, even when ServoAF is used, if the subject distance does not change, the focus lens is stopped, so that the scan in ServoAF can be prevented from being repeated unnecessarily.

S819で制御部115は、StCountを0にクリアしてS820へと処理を進める。S820で制御部115は、S810における今回のスキャン中心位置に対する今回のピーク位置の方向と、前回のスキャン中心位置に対する前回のピーク位置の方向とが同方向であるか否かを調べる。制御部115は、同方向であればS821へ処理を進め、同方向でなければS822へと処理を進める。   In step S819, the control unit 115 clears StCount to 0 and advances the process to step S820. In S820, the control unit 115 checks whether or not the direction of the current peak position with respect to the current scan center position in S810 and the direction of the previous peak position with respect to the previous scan center position are the same direction. If the direction is the same, the control unit 115 advances the process to S821. If not, the control unit 115 advances the process to S822.

S821で制御部115は、同方向移動フラグをTRUEにしてS823へと処理を進める。S822で制御部115は、同方向移動フラグをFALSEにしてS823へと処理を進める。   In step S821, the control unit 115 sets the same direction movement flag to TRUE and advances the process to step S823. In step S822, the control unit 115 sets the same direction movement flag to FALSE and advances the process to step S823.

S823で制御部115は、今回のスキャンにおいてフォーカスレンズ104の位置が測距範囲の中心に位置した時刻をScanTime[i]とし、今回のスキャンにおけるピーク位置をHokanPeak[i]としてS824へと処理を進める。S824で制御部115は、iをインクリメントしてServo中AF動作のサブルーチンを終了する。   In S823, the control unit 115 sets ScanTime [i] as the time when the position of the focus lens 104 is located at the center of the distance measurement range in the current scan, and sets the peak position in the current scan as HokanPeak [i]. Proceed. In step S824, the control unit 115 increments i and ends the subroutine for AF operation during Servo.

S825で制御部115は、合焦フラグをFALSEにしてS826へと処理を進める。S826で制御部115は×CountをインクリメントしてS827へと処理を進める。   In step S825, the control unit 115 sets the focus flag to FALSE and advances the process to step S826. In step S826, the control unit 115 increments xCount and proceeds to step S827.

S827で制御部115は、×Countが予め設定された所定値よりも大きいか否かを調べる。制御部115は、所定値より大きければS828へと処理を進め、所定値より大きくなければServo中AF動作のサブルーチンを終了する。S828で制御部115は、ピーク検出フラグ及び距離変化フラグをFALSEにしてServo中AF動作のサブルーチンを終了する。   In S827, the control unit 115 checks whether xCount is larger than a predetermined value set in advance. If greater than the predetermined value, control unit 115 advances the process to S828, and if not greater than the predetermined value, ends the subroutine for AF operation during Servo. In step S828, the control unit 115 sets the peak detection flag and the distance change flag to FALSE, and ends the subroutine for AF operation during Servo.

[予測可能判定について]
次に、図8のフローチャートにおけるS802の予測可能判定のサブルーチンについて、図9のフローチャートを参照しながら説明する。図9に示すように、S901で制御部115は、Servo中AF動作における変数iについて、i=0か否かを調べる。制御部115は、iが0であればS905へと処理を進め、iが0でなければS902へと処理を進める。
[About predictability judgment]
Next, the predictable determination subroutine of S802 in the flowchart of FIG. 8 will be described with reference to the flowchart of FIG. As shown in FIG. 9, in step S901, the control unit 115 checks whether or not i = 0 for the variable i in the AF operation during Servo. If i is 0, control unit 115 advances the process to S905, and if i is not 0, advances the process to S902.

S902で制御部115は、PreTimeとScanTime[i-1]の差が予め設定された所定時間よりも短いか否かを調べる。制御部115は、所定時間よりも短ければS903へと処理を進め、所定時間よりも長ければS905へと処理を進める。これより、前回のスキャンから今回のスキャンまでの間の時間が分かり、前回のスキャン結果を使用した予測の信頼性があるのかどうかを判断することができる。例えば、所定時間よりも長く時間がかかる場合には、予測の信頼性がないとすることができる。   In step S902, the control unit 115 checks whether the difference between PreTime and ScanTime [i-1] is shorter than a predetermined time set in advance. The control unit 115 advances the process to S903 if the time is shorter than the predetermined time, and advances the process to S905 if the time is longer than the predetermined time. Thus, the time from the previous scan to the current scan is known, and it can be determined whether or not the prediction using the previous scan result is reliable. For example, when it takes longer than a predetermined time, it can be assumed that the reliability of the prediction is not present.

S903で制御部115は、同方向移動フラグがTRUEかどうかを調べ、同方向移動フラグがTRUEであればS904へと処理を進め、同方向移動フラグがFALSEであればS905へと処理を進める。これにより、被写体が距離方向で同方向に移動していると判断したときにのみ予測の信頼性があるとすることで、誤測距の結果を使用することによる誤った予測を低減することができる。   In step S903, the control unit 115 checks whether the same direction movement flag is TRUE. If the same direction movement flag is TRUE, the control unit 115 proceeds to step S904. If the same direction movement flag is FALSE, the control unit 115 proceeds to step S905. As a result, it is possible to reduce erroneous prediction by using the result of erroneous distance measurement, by assuming that the prediction is reliable only when it is determined that the subject is moving in the same direction in the distance direction. it can.

S904で制御部115は、予測可能判定の結果を予測可能として、予測可能判定のサブルーチンを終了し、S803へと処理を進める。S905で制御部115は、予測可能判定の結果を予測不可能として、予測可能判定のサブルーチンを終了し、S803へと処理を進める。   In step S904, the control unit 115 determines that the result of the predictability determination is predictable, ends the predictable determination subroutine, and advances the process to step S803. In step S905, the control unit 115 determines that the predictable determination result is unpredictable, ends the predictable determination subroutine, and advances the process to step S803.

[被写***置予測について]
次に、図8のフローチャートにおけるS804の被写***置予測のサブルーチンについて、図10のフローチャート、及び、図11(a)、(b)の説明図を参照しながら説明する。図10に示すように、S1001で制御部115は、Servo中AF動作における変数iについて、iが2より小さいか否かを調べる。制御部115は、iが2より小さければS1002へと処理を進め、iが2以上であればS1003へと処理を進める。S1002で制御部115は、スキャン中心位置を前回のスキャンのピーク位置に設定して被写***置予測のサブルーチンを終了し、S807へと処理を進める。
[Subject position prediction]
Next, the subject position prediction subroutine of S804 in the flowchart of FIG. 8 will be described with reference to the flowchart of FIG. 10 and the explanatory diagrams of FIGS. 11 (a) and 11 (b). As shown in FIG. 10, in step S1001, the control unit 115 checks whether or not i is smaller than 2 for the variable i in the Servo AF operation. The controller 115 advances the process to S1002 if i is smaller than 2, and advances the process to S1003 if i is 2 or more. In step S1002, the control unit 115 sets the scan center position to the peak position of the previous scan, ends the subject position prediction subroutine, and advances the process to step S807.

S1003で制御部115は、i=2であるか否かを調べる。すなわち、S1003では、動体予測用のデータが2点であるか否かを調べ、2点である場合と、3点以上ある場合とを判定している。制御部115は、i=2であればS1004へと処理を進め、iが2より大きければS1006へと処理を進める。   In step S1003, the control unit 115 checks whether i = 2. That is, in S1003, it is determined whether or not the moving object prediction data is two points, and it is determined whether there are two points or three or more points. The control unit 115 advances the process to S1004 if i = 2, and advances the process to S1006 if i is larger than 2.

S1004で制御部115は、図11(a)に示すように、次に示す第1の動体予測式(1)を使って、2点分の動体予測用のデータから被写体の予測位置を算出して、S1005へと処理を進める。具体的には、(ScanTime[0],HokanPeak[0])と、(ScanTime[1],HokanPeak[1])の2点より、PreTime時の被写体の予測位置PrePositionを算出する。
PrePosition = (PreTime - ScanTime[0])×(HokanPeak[1] - HokanPeak[0])/(ScanTime[1] - ScanTime[0]) + HokanPeak[0] ……(1)
In S1004, as shown in FIG. 11A, the control unit 115 calculates the predicted position of the subject from the data for moving object prediction for two points, using the following first moving object prediction formula (1). Then, the process proceeds to S1005. Specifically, the predicted position PrePosition of the subject at PreTime is calculated from two points (ScanTime [0], HokanPeak [0]) and (ScanTime [1], HokanPeak [1]).
PrePosition = (PreTime-ScanTime [0]) x (HokanPeak [1]-HokanPeak [0]) / (ScanTime [1]-ScanTime [0]) + HokanPeak [0] ...... (1)

S1005で制御部115は、S1004で算出した被写体の予測位置PrePositionをスキャン中心位置に設定して被写***置予測のサブルーチンを終了し、S807へと処理を進める。   In step S1005, the control unit 115 sets the subject predicted position PrePosition calculated in step S1004 as the scan center position, ends the subject position prediction subroutine, and advances the process to step S807.

S1006で制御部115は、図11(b)に示すように、次に示す第2の動体予測式(2)を使って、3点分の動体予測用のデータから被写体の予測位置を算出して、S1007へと処理を進める。3点分の動体予測用のデータは、(ScanTime[i-2],HokanPeak[i-2])、(ScanTime[i-1],HokanPeak[i-1])、(ScanTime[i],HokanPeak[i])である。従って、上述した3点より、PreTime時の被写体の予測位置PrePositionを算出する。
PrePosition = ( t3 / t2 )×{ (t3 - t2)×(t2×Pos1 - t1×Pos2)
/t1/(t1 - t2) + Pos2 } + HokanPeak[i-2] ……(2)
なお、
t1 = ScanTime[i-1] - ScanTime[i-2]
t2 = ScanTime[i] - ScanTime[i-2]
t3 = PreTime - ScanTime[i-2]
Pos1 = HokanPeak[i-1] - HokanPeak[i-2]
Pos2 = HokanPeak[i] - HokanPeak[i-2]
とする。
In S1006, as shown in FIG. 11B, the control unit 115 calculates the predicted position of the subject from the three points of moving object prediction data using the second moving object prediction formula (2) shown below. Then, the process proceeds to S1007. The data for moving object prediction for three points are (ScanTime [i-2], HokanPeak [i-2]), (ScanTime [i-1], HokanPeak [i-1]), (ScanTime [i], HokanPeak [i]). Therefore, the predicted position PrePosition of the subject at PreTime is calculated from the above three points.
PrePosition = (t3 / t2) × {(t3-t2) × (t2 × Pos1-t1 × Pos2)
/ t1 / (t1-t2) + Pos2} + HokanPeak [i-2] ...... (2)
In addition,
t1 = ScanTime [i-1]-ScanTime [i-2]
t2 = ScanTime [i]-ScanTime [i-2]
t3 = PreTime-ScanTime [i-2]
Pos1 = HokanPeak [i-1]-HokanPeak [i-2]
Pos2 = HokanPeak [i]-HokanPeak [i-2]
And

S1007で制御部115は、S1006で算出した被写体の予測位置PrePositionをスキャン中心位置に設定して被写***置予測のサブルーチンを終了し、S807へと処理を進める。   In step S1007, the control unit 115 sets the subject predicted position PrePosition calculated in step S1006 as the scan center position, ends the subject position prediction subroutine, and advances the process to step S807.

次に、図7のフローチャートにおけるS712、及び、図8のフローチャートにおけるS810のスキャンのサブルーチンを、図12のフローチャートを参照しながら説明する。図12に示すように、S1201で制御部115は、フォーカスレンズ104をスキャン開始位置に移動する。なお、スキャン開始位置は設定された測距範囲の一端に設定される。   Next, the scanning subroutine of S712 in the flowchart of FIG. 7 and S810 in the flowchart of FIG. 8 will be described with reference to the flowchart of FIG. As shown in FIG. 12, in step S1201, the control unit 115 moves the focus lens 104 to the scan start position. Note that the scan start position is set at one end of the set distance measurement range.

S1202で制御部115は、撮影画面内におけるAF枠に応じた画像領域の焦点評価値とフォーカスレンズ104の位置を制御部115に内蔵された演算メモリに記憶し、S1203へと処理を進める。   In step S1202, the control unit 115 stores the focus evaluation value of the image area corresponding to the AF frame in the shooting screen and the position of the focus lens 104 in a calculation memory built in the control unit 115, and the process proceeds to step S1203.

S1203で制御部115は、フォーカスレンズ104のレンズ位置がスキャン終了位置にあるか否かを調べる。制御部115は、レンズ位置が終了位置であればS1205へ処理を進め、レンズ位置が終了位置でなければS1204へ処理を進める。なお、スキャン終了位置は、スキャン開始位置として設定された測距範囲の一端とは反対側の測距範囲の他端に設定される。   In step S1203, the control unit 115 checks whether the lens position of the focus lens 104 is at the scan end position. If the lens position is the end position, the control unit 115 advances the process to S1205, and if the lens position is not the end position, the control unit 115 advances the process to S1204. The scan end position is set at the other end of the distance measurement range opposite to one end of the distance measurement range set as the scan start position.

S1204で制御部115は、予め設定された所定の方向へ所定量だけフォーカスレンズ104を移動させてS1202へと処理を進める。S1205で制御部115は、S1202で演算メモリに記憶した焦点評価値とそのレンズ位置を順次読み出して焦点評価値のピーク位置を計算し、スキャンのサブルーチンを終了する。   In step S1204, the control unit 115 moves the focus lens 104 by a predetermined amount in a predetermined direction set in advance, and advances the process to step S1202. In step S1205, the control unit 115 sequentially reads the focus evaluation value and the lens position stored in the calculation memory in step S1202, calculates the peak position of the focus evaluation value, and ends the scanning subroutine.

[合焦判定について]
次に、図7のフローチャートにおけるS713、及び、図8のフローチャートにおけるS811の合焦判定のサブルーチンを、図13〜図16を参照しながら説明する。
[About in-focus detection]
Next, the focus determination subroutine of S713 in the flowchart of FIG. 7 and S811 in the flowchart of FIG. 8 will be described with reference to FIGS.

焦点評価値は遠近競合などの特殊な場合を除けば、横軸にフォーカスレンズ位置、縦軸に焦点評価値をとるとそのグラフは、図13に示すような山状になる。そこで撮像装置1では、焦点評価値が山状になっているか否かを、焦点評価値の最大値と最小値の差、一定値(SlopeThr)以上の傾きで傾斜している部分の長さ、傾斜している部分の勾配から判断することにより、合焦判定を行うことができる。合焦判定における判定結果は、次に示すように○×で出力される。
○判定:焦点評価値のピーク位置から、被写体の焦点調節が可能である。
×判定:被写体のコントラストが不十分、もしくはスキャンした距離範囲外の距離に被写体が位置する。
Except for special cases such as perspective competition, the focus evaluation value takes the focus lens position on the horizontal axis and the focus evaluation value on the vertical axis, and the graph becomes a mountain shape as shown in FIG. Therefore, in the imaging apparatus 1, whether or not the focus evaluation value is mountain-shaped is determined by the difference between the maximum value and the minimum value of the focus evaluation value, the length of the inclined portion with a slope equal to or greater than a certain value (SlopeThr), By determining from the gradient of the inclined portion, it is possible to perform in-focus determination. The determination result in the in-focus determination is output as ○ × as shown below.
○ Judgment: The focus of the subject can be adjusted from the peak position of the focus evaluation value.
X: The subject contrast is insufficient, or the subject is located at a distance outside the scanned distance range.

ここで図13に示すように、山の頂上(A点)から傾斜が続いていると認められる点をD点、E点とし、D点とE点の幅を山の幅L、A点とD点の焦点評価値の差SL1とA点とE点の焦点評価値の差SL2の和SL1+SL2をSLとする。   Here, as shown in FIG. 13, points that are recognized to be inclined from the top of the mountain (point A) are point D and point E, and the width of point D and point E is the width of mountain L and point A. The sum SL1 + SL2 of the focus evaluation value difference SL1 at point D and the focus evaluation value difference SL2 between point A and point E is SL.

図14は、合焦判定のサブルーチンを示すフローチャートである。図14に示すように、S1301において、制御部115は、焦点評価値の最大値と最小値、及び、最大値を与えるスキャンポイントioを前述したスキャンの結果から求めてS1302へと処理を進める。   FIG. 14 is a flowchart illustrating a focus determination subroutine. As shown in FIG. 14, in step S1301, the control unit 115 obtains the maximum and minimum focus evaluation values and the scan point io that gives the maximum value from the scan result described above, and advances the process to step S1302.

次に、S1302で制御部115は、焦点評価値の山の幅を表す変数L、山の勾配を表す変数SLなどの変数をともに零に初期化してS1303へと処理を進める。S1303で制御部115は、最大値を与えるスキャンポイントioがスキャンを行った測距範囲における遠側端の位置か否かを調べる。制御部115は、遠側端位置でないならばS1304へ処理を進め、無限遠方向への単調減少を調べる。また、制御部115は、遠側端位置であったならば、S1304の処理をスキップしS1305へ処理を進める。   Next, in S1302, the control unit 115 initializes variables such as a variable L representing the peak width of the focus evaluation value and a variable SL representing the slope of the mountain to zero, and proceeds to S1303. In step S1303, the control unit 115 checks whether or not the scan point io giving the maximum value is the position of the far end in the distance measurement range in which scanning is performed. If it is not the far end position, the control unit 115 advances the processing to S1304 and checks for a monotonic decrease in the infinity direction. If it is the far end position, the control unit 115 skips the process of S1304 and advances the process to S1305.

ここで、S1304における無限遠方向への単調減少を調べる処理について説明する。図15に示すように、まずS1401において、制御部115は、カウンタ用の変数iをioに初期化してS1402へと処理を進める。   Here, the processing for checking the monotonic decrease toward infinity in S1304 will be described. As shown in FIG. 15, first in step S1401, the control unit 115 initializes a counter variable i to io, and proceeds to step S1402.

S1402で制御部115は、スキャンポイントiにおける焦点評価値の値d[i]と、iより1スキャンポイント分無限遠よりのスキャンポイントi−1における焦点評価値の値d[i−1]の差を予め設定された所定値SlopeThrと比較する。制御部115は、d[i]−d[i−1]>=SlopeThrであれば、無限遠方向への単調減少が生じていると判断し、S1403へ処理を進める。一方、制御部115は、d[i]−d[i−1]>=SlopeThrでなければ、無限遠方向への単調減少は生じていないと判断し、無限遠方向への単調減少を調べる処理を終了し、S1305へ処理を進める。   In step S1402, the control unit 115 sets the focus evaluation value d [i] at the scan point i and the focus evaluation value d [i-1] at the scan point i-1 that is one scan point away from i. The difference is compared with a predetermined value SlopeThr set in advance. If d [i] −d [i−1]> = SlopeThr, the control unit 115 determines that a monotonic decrease in the infinity direction has occurred, and advances the process to S1403. On the other hand, if d [i] −d [i−1]> = SlopeThr, the control unit 115 determines that there is no monotonic decrease in the infinity direction, and checks the monotonic decrease in the infinity direction. And the process proceeds to S1305.

無限遠方向への単調減少をチェックする処理を継続する場合、制御部115はS1403へと処理を進める。S1403で制御部115は、焦点評価値が一定値以上の傾きで傾斜している部分の長さ(山の幅)を表す変数L、単調減少区間における減少量を表す変数SLを次の式に従い更新してS1404へと処理を進める。
L = L+1
SL= SL+(d[i]−d[i−1])
When continuing the process of checking the monotonic decrease toward the infinity direction, the control unit 115 advances the process to S1403. In step S1403, the control unit 115 sets a variable L representing the length (mountain width) of the portion where the focus evaluation value is inclined at a certain value or more, and a variable SL representing the amount of decrease in the monotonically decreasing section according to the following equations. Update and proceed to S1404.
L = L + 1
SL = SL + (d [i] -d [i-1])

S1404で制御部115は、i=i−1として、検出をする点を1スキャンポイント無限遠側に移してS1405へと処理を進める。S1405で制御部115は、カウンタiがスキャンを行った所定の測距範囲における遠側端位置の値(=0)になったか否かをチェックする。制御部115は、カウンタiの値が0、すなわち単調減少を検出する開始点がスキャンを行った所定の測距範囲における遠側端位置に達したならば、無限遠方向への単調減少を調べる処理を終了し、S1305へ処理を進める。以上のようにして、撮像装置1は、i=ioから無限遠方向への焦点評価値の単調減少をチェックする。   In S1404, the control unit 115 sets i = i−1, moves the point to be detected to the one scan point infinity side, and advances the process to S1405. In step S <b> 1405, the control unit 115 checks whether or not the counter i has reached the value (= 0) of the far end position in the predetermined distance measurement range that has been scanned. When the value of the counter i is 0, that is, when the start point for detecting the monotonic decrease reaches the far end position in the predetermined distance measurement range in which scanning is performed, the control unit 115 checks the monotonic decrease in the infinity direction. The process ends, and the process proceeds to S1305. As described above, the imaging apparatus 1 checks the monotonic decrease in the focus evaluation value from i = io to infinity.

図14に戻って、合焦判定のサブルーチンの続きを説明する。S1305で制御部115は、最大値を与えるスキャンポイントioがスキャンを行った所定の測距範囲における至近端の位置か否かを調べる。制御部115は、至近端位置でないならばS1306へ処理を進め、至近端方向への単調減少を調べる。また、制御部115は、至近端位置であったならば、S1306の処理をスキップしS1307へ処理を進める。   Returning to FIG. 14, the continuation of the focus determination subroutine will be described. In step S1305, the control unit 115 checks whether or not the scan point io giving the maximum value is the position of the closest end in the predetermined distance measurement range in which scanning is performed. If it is not the closest end position, the control unit 115 advances the processing to S1306 and checks for a monotonic decrease in the close end direction. If it is the closest end position, the control unit 115 skips the process of S1306 and advances the process to S1307.

ここで、S1306における至近端方向への単調減少を調べる処理について説明する。図16に示すように、まずS1501において、制御部115は、カウンタ変数iをioに初期化してS1502へと処理を進める。   Here, the processing for checking the monotonic decrease toward the closest end in S1306 will be described. As shown in FIG. 16, first in step S1501, the control unit 115 initializes the counter variable i to io and advances the process to step S1502.

S1502で制御部115は、スキャンポイントiにおける焦点評価値の値d[i]と、iより1スキャンポイント分至近端よりのスキャンポイントi+1における焦点評価値の値d[i+1]の差を所定値SlopeThrと比較する。制御部115は、d[i]−d[i+1]>=SlopeThrであれば、至近端方向への単調減少が生じていると判断し、S1503へ処理を進める。一方、制御部115は、d[i]−d[i+1]>=SlopeThrでなければ、至近端方向への単調減少は生じていないと判断し、至近端方向への単調減少を調べる処理を終了し、S1307へ処理を進める。   In step S1502, the control unit 115 determines a difference between the focus evaluation value d [i] at the scan point i and the focus evaluation value d [i + 1] at the scan point i + 1 from the nearest end by one scan point from i. Compare with the value SlopeThr. If d [i] −d [i + 1]> = SlopeThr, the control unit 115 determines that a monotonic decrease in the closest end direction has occurred, and advances the process to S1503. On the other hand, if d [i] −d [i + 1]> = SlopeThr, the control unit 115 determines that no monotonic decrease in the closest end direction has occurred, and checks the monotonic decrease in the close end direction. And the process proceeds to S1307.

至近端方向への単調減少をチェックする処理を継続する場合、制御部115はS1503へと処理を進める。S1503で制御部115は、焦点評価値が一定値以上の傾きで傾斜している部分の長さ(山の幅)を表す変数L、単調減少区間における減少量を表す変数SLを次の式に従い更新してS1504へと処理を進める。
L = L+1
SL= SL+(d[i]−d[i+1])
When the process of checking the monotonic decrease toward the near end is continued, the control unit 115 advances the process to S1503. In step S1503, the control unit 115 calculates a variable L that represents the length (mountain width) of the portion where the focus evaluation value is inclined at a certain value or more, and a variable SL that represents the amount of decrease in the monotonically decreasing section according to the following equations. Update and proceed to S1504.
L = L + 1
SL = SL + (d [i] -d [i + 1])

S1504で制御部115は、i=i+1として、検出をする点を1スキャンポイント至近端側に移してS1505へと処理を進める。S1505で制御部115は、カウンタiがスキャンを行った所定の測距範囲における至近端位置の値(=N)になったか否かをチェックする。制御部115は、カウンタiの値がN、すなわち単調減少を検出する開始点がスキャンを行った所定の測距範囲における至近端位置に達したならば、至近端方向への単調減少をチェックする処理を終了し、S1307へ処理を進める。以上のようにして、撮像装置1は、i=ioから至近端方向への焦点評価値の単調減少をチェックする。   In step S1504, the control unit 115 sets i = i + 1, moves the point to be detected to the one scan point closest end, and advances the process to step S1505. In step S <b> 1505, the control unit 115 checks whether or not the counter i has reached the closest end position value (= N) in the predetermined distance measurement range in which scanning has been performed. When the value of the counter i is N, that is, when the start point for detecting the monotonic decrease reaches the closest end position in the predetermined distance measurement range in which scanning is performed, the control unit 115 performs the monotonic decrease in the near end direction. The checking process is terminated, and the process proceeds to S1307. As described above, the imaging apparatus 1 checks the monotonic decrease in the focus evaluation value from i = io toward the closest end.

図14に戻って、合焦判定のサブルーチンの続きを説明する。合焦判定では、無限遠方向および至近端方向への単調減少をチェックする上記処理が終了したならば、得られた焦点評価値が山状になっているか否か、諸係数をそれぞれのしきい値と比較し、○×の判定を行う。具体的には、以下に説明するS1307〜S1309の処理により、○×の判定が行われる。   Returning to FIG. 14, the continuation of the focus determination subroutine will be described. In the in-focus determination, when the above processing for checking the monotonic decrease in the infinity direction and the close-up direction is completed, whether or not the obtained focus evaluation value has a mountain shape is determined. Compare with the threshold value and make a judgment of ○ ×. Specifically, the determination of “×” is made by the processing of S1307 to S1309 described below.

S1307において、制御部115は、焦点評価値の最大値を与えるスキャンポイントioがスキャンを行った所定の測距範囲における至近端であるか否かを調べる。至近端である場合は、至近端スキャンポイントnにおける焦点評価値の値d[n]と、nより1スキャンポイント分無限遠よりのスキャンポイントn−1における焦点評価値の値d[n−1]の差が、所定値SlopeThr以上であるか否かを調べる。制御部115は、至近端であり、かつ所定値SlopeThr以上である場合、S1311へ処理を進め、その条件を満たさない場合、S1308へ処理を進める。   In step S1307, the control unit 115 checks whether or not the scan point io that gives the maximum focus evaluation value is the closest end in the predetermined distance measurement range in which scanning is performed. In the case of the closest end, the focus evaluation value d [n] at the closest end scan point n and the focus evaluation value d [n] at the scan point n-1 that is one scan point away from n. −1] is checked whether or not the difference is equal to or greater than a predetermined value SlopeThr. The control unit 115 advances the process to S1311 if it is the closest end and is equal to or greater than the predetermined value SlopeThr, and advances the process to S1308 if the condition is not satisfied.

S1308で制御部115は、焦点評価値の最大値を与えるスキャンポイントioがスキャンを行った所定の測距範囲における遠側端であるか否かを調べる。遠側端である場合は、遠側端スキャンポイント0における焦点評価値の値d[0]と、0より1スキャンポイント分至近端よりのスキャンポイント1における焦点評価値の値d[1]の差が、所定値SlopeThr以上であるか否かを調べる。制御部115は、遠側端であり、かつ所定値SlopeThr以上である場合、S1311へ処理を進め、その条件を満たさない場合、S1309へ処理を進める。   In step S1308, the control unit 115 checks whether or not the scan point io that gives the maximum focus evaluation value is the far end in the predetermined distance measurement range in which scanning is performed. In the case of the far end, the focus evaluation value d [0] at the far end scan point 0 and the focus evaluation value d [1] at the scan point 1 from the nearest end from 0 by one scan point. It is checked whether or not the difference is equal to or greater than a predetermined value SlopeThr. The control unit 115 advances the process to S1311 when it is the far end and is equal to or larger than the predetermined value SlopeThr, and advances the process to S1309 when the condition is not satisfied.

S1309で制御部115は、一定値以上の傾きで傾斜している部分の長さLが予め設定された所定値Lo以上であるか否かを調べる。所定値Lo以上である場合は、傾斜している部分の傾斜の平均値SL/Lが予め設定された所定値SLo/Lo以上であり、かつ焦点評価値の最大値と最小値の差が予め設定された所定値以上であるか否かを調べる。制御部115は、傾斜している部分の長さLが所定値Lo以上、かつ傾斜している部分の傾斜の平均値SL/Lが所定値SLo/Lo以上、かつ焦点評価値の最大値と最小値の差が所定値以上である場合にS1310へ処理を進める。一方、制御部115は、上記の条件を満たさない場合、S1311へ処理を進める。   In step S1309, the control unit 115 checks whether or not the length L of the portion inclined at an inclination of a certain value or more is greater than or equal to a predetermined value Lo set in advance. When the value is equal to or greater than the predetermined value Lo, the average value SL / L of the inclined portion is equal to or greater than a predetermined value SLo / Lo set in advance, and the difference between the maximum value and the minimum value of the focus evaluation value is determined in advance. It is checked whether or not the value is equal to or greater than a predetermined value. The control unit 115 determines that the length L of the inclined portion is equal to or larger than the predetermined value Lo, the average value SL / L of the inclined portion is equal to or larger than the predetermined value SLo / Lo, and the maximum focus evaluation value is If the difference between the minimum values is greater than or equal to the predetermined value, the process proceeds to S1310. On the other hand, if the above condition is not satisfied, the control unit 115 advances the process to S1311.

S1310で制御部115は、S1307〜S1309の判定条件をすべて満たしており、得られた焦点評価値が山状となっていて、被写体の焦点調節が可能であるため判定結果を○判定としている。S1311で制御部115は、S1307〜S1309の判定条件のいずれかを満たさずに、得られた焦点評価値が山状となっておらず、被写体への焦点調節が不可能であるため判定結果を×判定としている。以上のようにして、撮像装置1は、図7のフローチャートにおけるS713、及び、図8のフローチャートにおけるS811の合焦判定を行う。   In S1310, the control unit 115 satisfies all the determination conditions of S1307 to S1309, and the obtained focus evaluation value has a mountain shape, so that the focus of the subject can be adjusted, and the determination result is set as “good”. In step S1311, the control unit 115 does not satisfy any of the determination conditions in steps S1307 to S1309, the obtained focus evaluation value is not mountain-shaped, and the focus adjustment to the subject is impossible. × Determined. As described above, the imaging apparatus 1 performs the focus determination in S713 in the flowchart of FIG. 7 and S811 in the flowchart of FIG.

次に、図2のフローチャートにおけるS215の撮影動作のサブルーチンについて、図17のフローチャートを参照しながら説明する。図17に示すように、S1701で制御部115は、被写体輝度を測定してS1701へと処理を進める。S1702で制御部115は、S1701で測定した被写体輝度に応じてAE処理部103を制御し、撮像素子108への露光を行ってS1703へと処理を進める。   Next, the subroutine of the photographing operation of S215 in the flowchart of FIG. 2 will be described with reference to the flowchart of FIG. As shown in FIG. 17, in step S1701, the control unit 115 measures subject brightness and advances the process to step S1701. In step S1702, the control unit 115 controls the AE processing unit 103 according to the subject brightness measured in step S1701, performs exposure on the image sensor 108, and advances the process to step S1703.

S1702における露光により、撮像素子108の撮像面に結像された被写体像は光電変換されてアナログ信号(アナログ画像データ)としてA/D変換部109へ出力される。S1703にて、A/D変換部109では、撮像素子108からのアナログ画像データを、撮像素子108の出力ノイズ除去や非線形処理などの前処理の後にデジタル画像データへ変換して出力する。   The subject image formed on the imaging surface of the image sensor 108 by the exposure in S1702 is photoelectrically converted and output to the A / D converter 109 as an analog signal (analog image data). In S1703, the A / D conversion unit 109 converts analog image data from the image sensor 108 into digital image data after pre-processing such as output noise removal and nonlinear processing of the image sensor 108, and outputs the digital image data.

S1704で制御部115は、A/D変換部109から出力されたデジタル画像データを、WB処理部111のホワイトバランス調整や画像処理部110の画像処理などにより、適正なデジタル画像データへ変換して、S1705へと処理を進める。S1705で制御部115は、適正に変換されたデジタル画像データをフォーマット変換部112でJPEGフォーマット等への画像フォーマット変換を行った後、DRAM113に一時的に記憶してS1706へと処理を進める。S1706で制御部115は、DRAM113内のデータを画像記録部114でメモリカードなどの記録媒体へと記憶して、撮影動作のサブルーチンを終了する。   In step S <b> 1704, the control unit 115 converts the digital image data output from the A / D conversion unit 109 into appropriate digital image data through white balance adjustment of the WB processing unit 111 and image processing of the image processing unit 110. , The process proceeds to S1705. In step S <b> 1705, the control unit 115 performs image format conversion of the appropriately converted digital image data into the JPEG format or the like in the format conversion unit 112, temporarily stores it in the DRAM 113, and advances the processing to step S <b> 1706. In step S1706, the control unit 115 stores the data in the DRAM 113 in a recording medium such as a memory card in the image recording unit 114, and ends the shooting operation subroutine.

以上、説明したように、本実施形態では、被写体が距離方向に動いていないと判断した場合に、次に被写体が動いて被写体との距離が変化するまでフォーカスレンズを停止させることで、無駄なレンズ駆動を軽減させることができる。このため、EVF表示の見栄えの低下や、電池消耗を軽減させることができる。また、本実施形態では、信頼性の低い合焦位置または誤った合焦位置が求められてしまった場合に、被写***置予測を行わないようにすることで、被写体へ追従した合焦が不能となることを軽減できる。   As described above, in the present embodiment, when it is determined that the subject is not moving in the distance direction, the focus lens is stopped until the subject moves and the distance from the subject changes, and this is wasteful. Lens driving can be reduced. Therefore, it is possible to reduce the appearance of EVF display and battery consumption. Further, in the present embodiment, when a focus position with low reliability or an incorrect focus position is obtained, it is impossible to focus on the subject by not performing the subject position prediction. Can be reduced.

なお、上述した実施の形態における記述は、一例を示すものであり、これに限定するものではない。上述した実施の形態における構成及び動作に関しては、適宜変更が可能である。   Note that the description in the above-described embodiment shows an example, and the present invention is not limited to this. The configuration and operation in the embodiment described above can be changed as appropriate.

(他の実施形態)
上述の実施形態は、システム或は装置のコンピュータ(或いはCPU、MPU等)によりソフトウェア的に実現することも可能である。従って、上述の実施形態をコンピュータで実現するために、該コンピュータに供給されるコンピュータプログラム自体も本発明を実現するものである。つまり、上述の実施形態の機能を実現するためのコンピュータプログラム自体も本発明の一つである。
(Other embodiments)
The above-described embodiment can also be realized in software by a computer of a system or apparatus (or CPU, MPU, etc.). Therefore, the computer program itself supplied to the computer in order to implement the above-described embodiment by the computer also realizes the present invention. That is, the computer program itself for realizing the functions of the above-described embodiments is also one aspect of the present invention.

なお、上述の実施形態を実現するためのコンピュータプログラムは、コンピュータで読み取り可能であれば、どのような形態であってもよい。例えば、オブジェクトコード、インタプリタにより実行されるプログラム、OSに供給するスクリプトデータ等で構成することができるが、これらに限るものではない。上述の実施形態を実現するためのコンピュータプログラムは、記憶媒体又は有線/無線通信によりコンピュータに供給される。プログラムを供給するための記憶媒体としては、例えば、フレキシブルディスク、ハードディスク、磁気テープ等の磁気記憶媒体、MO、CD、DVD等の光/光磁気記憶媒体、不揮発性の半導体メモリなどがある。   The computer program for realizing the above-described embodiment may be in any form as long as it can be read by a computer. For example, it can be composed of object code, a program executed by an interpreter, script data supplied to the OS, but is not limited thereto. A computer program for realizing the above-described embodiment is supplied to a computer via a storage medium or wired / wireless communication. Examples of the storage medium for supplying the program include a magnetic storage medium such as a flexible disk, a hard disk, and a magnetic tape, an optical / magneto-optical storage medium such as an MO, CD, and DVD, and a nonvolatile semiconductor memory.

有線/無線通信を用いたコンピュータプログラムの供給方法としては、コンピュータネットワーク上のサーバを利用する方法がある。この場合、本発明を形成するコンピュータプログラムとなりうるデータファイル(プログラムファイル)をサーバに記憶しておく。プログラムファイルとしては、実行形式のものであっても、ソースコードであっても良い。そして、このサーバにアクセスしたクライアントコンピュータに、プログラムファイルをダウンロードすることによって供給する。この場合、プログラムファイルを複数のセグメントファイルに分割し、セグメントファイルを異なるサーバに分散して配置することも可能である。つまり、上述の実施形態を実現するためのプログラムファイルをクライアントコンピュータに提供するサーバ装置も本発明の一つである。   As a computer program supply method using wired / wireless communication, there is a method of using a server on a computer network. In this case, a data file (program file) that can be a computer program forming the present invention is stored in the server. The program file may be an executable format or a source code. Then, the program file is supplied by downloading to a client computer that has accessed the server. In this case, the program file can be divided into a plurality of segment files, and the segment files can be distributed and arranged on different servers. That is, a server apparatus that provides a client computer with a program file for realizing the above-described embodiment is also one aspect of the present invention.

また、上述の実施形態を実現するためのコンピュータプログラムを暗号化して格納した記憶媒体を配布し、所定の条件を満たしたユーザに、暗号化を解く鍵情報を供給し、ユーザの有するコンピュータへのインストールを許可してもよい。鍵情報は、例えばインターネットを介してホームページからダウンロードさせることによって供給することができる。また、上述の実施形態を実現するためのコンピュータプログラムは、すでにコンピュータ上で稼働するOSの機能を利用するものであってもよい。さらに、上述の実施形態を実現するためのコンピュータプログラムは、その一部をコンピュータに装着される拡張ボード等のファームウェアで構成してもよいし、拡張ボード等が備えるCPUで実行するようにしてもよい。   In addition, a storage medium in which the computer program for realizing the above-described embodiment is encrypted and distributed is distributed, and key information for decrypting is supplied to a user who satisfies a predetermined condition, and the user's computer Installation may be allowed. The key information can be supplied by being downloaded from a homepage via the Internet, for example. Further, the computer program for realizing the above-described embodiment may use an OS function already running on the computer. Further, a part of the computer program for realizing the above-described embodiment may be configured by firmware such as an expansion board attached to the computer, or may be executed by a CPU provided in the expansion board. Good.

1 撮像装置
101 撮影レンズ
102 絞り及びシャッター
103 AE処理部
104 フォーカスレンズ
105 AF処理部
106 ストロボ
107 EF処理部
108 撮像素子
109 A/D変換部
110 画像処理部
111 WB処理部
112 フォーマット変換部
113 DRAM
114 画像記録部
115 制御部
116 VRAM
117 操作表示部
118 操作部
119 撮影モードSW
120 メインスイッチ
121 第1スイッチ
122 第2スイッチ
123 顔検出モジュール
124 動体検出部
125 角速度センサ部
DESCRIPTION OF SYMBOLS 1 Imaging device 101 Shooting lens 102 Aperture and shutter 103 AE processing unit 104 Focus lens 105 AF processing unit 106 Strobe 107 EF processing unit 108 Image sensor 109 A / D conversion unit 110 Image processing unit 111 WB processing unit 112 Format conversion unit 113 DRAM
114 Image recording unit 115 Control unit 116 VRAM
117 Operation display section 118 Operation section 119 Shooting mode SW
120 Main switch 121 First switch 122 Second switch 123 Face detection module 124 Moving object detection unit 125 Angular velocity sensor unit

Claims (3)

フォーカスレンズを含む撮像光学系で結像された被写体の画像を撮像して画像データを出力する撮像素子と、
前記フォーカスレンズを予め設定された所定範囲の全域を測距範囲として一方向に移動させることで得られた前記画像データに基づいて、焦点検出領域における前記被写体に合焦する最大焦点評価値を検出し、前記最大焦点評価値に対応するレンズ位置に前記フォーカスレンズを移動させる第1の合焦動作を連続的に行う第1の焦点調整手段と、
を有する撮像装置であって、
前記フォーカスレンズの測距範囲は、前記フォーカスレンズの可動範囲の一部に限定された範囲であり、
前記測距範囲の前回の中心位置に対する前回の最大焦点評価値に対応するレンズ位置の方向と前記測距範囲の今回の中心位置に対する今回の最大焦点評価値に対応するレンズ位置の方向が同じ方向である場合、前記第1の合焦動作を連続的に行うことで検出された最大焦点評価値に対応するレンズ位置を用いた予測演算により前記測距範囲の次回の中心位置を算出し、
前記測距範囲の前回の中心位置に対する前回の最大焦点評価値に対応するレンズ位置の方向と前記測距範囲の今回の中心位置に対する今回の最大焦点評価値に対応するレンズ位置の方向が同じ方向でない場合、前記今回の最大焦点評価値に対応するレンズ位置を前記測距範囲の次回の中心位置とすることを特徴とする撮像装置。
An image sensor that captures an image of a subject imaged by an imaging optical system including a focus lens and outputs image data; and
Based on the image data obtained by moving the focus lens in one direction with a predetermined range as a whole ranging range, a maximum focus evaluation value for focusing on the subject in the focus detection area is detected. A first focus adjusting unit that continuously performs a first focusing operation for moving the focus lens to a lens position corresponding to the maximum focus evaluation value;
An imaging device having
The distance measurement range of the focus lens is a range limited to a part of the movable range of the focus lens,
The direction of the lens position corresponding to the previous maximum focus evaluation value for the previous center position of the distance measurement range is the same as the direction of the lens position corresponding to the current maximum focus evaluation value for the current center position of the distance measurement range. If it is, it calculates the next center position of the distance measuring range by the prediction calculation using the lens position corresponding to the maximum focus evaluation value detected by performing a pre-Symbol first focusing operation continuously,
The direction of the lens position corresponding to the previous maximum focus evaluation value for the previous center position of the distance measurement range is the same as the direction of the lens position corresponding to the current maximum focus evaluation value for the current center position of the distance measurement range. Otherwise, the lens position corresponding to the current maximum focus evaluation value is set as the next center position of the distance measuring range .
前記測距範囲の前回の中心位置に対する前回の最大焦点評価値に対応するレンズ位置の方向と前記測距範囲の今回の中心位置に対する今回の最大焦点評価値に対応するレンズ位置の方向が同じ方向である場合、前記第1の合焦動作を連続的に行うことで検出された前記前回の最大焦点評価値に対応するレンズ位置に加え、前記今回の最大焦点評価値に対応するレンズ位置を用いた予測演算により前記測距範囲の次回の中心位置を算出することを特徴とする請求項1に記載の撮像装置。 The direction of the lens position corresponding to the previous maximum focus evaluation value for the previous center position of the distance measurement range is the same as the direction of the lens position corresponding to the current maximum focus evaluation value for the current center position of the distance measurement range. In this case, in addition to the lens position corresponding to the previous maximum focus evaluation value detected by continuously performing the first focusing operation, the lens position corresponding to the current maximum focus evaluation value is used. The imaging apparatus according to claim 1, wherein a next center position of the distance measurement range is calculated by a predicted calculation. フォーカスレンズを含む撮像光学系で結像された被写体の画像を撮像して画像データを出力する撮像工程と、
前記フォーカスレンズを予め設定された所定範囲の全域を測距範囲として一方向に移動させることで得られた前記画像データに基づいて焦点検出領域における前記被写体に合焦する最大焦点評価値を検出し、前記被写体が合焦する位置に前記フォーカスレンズを移動させる第1の合焦動作を連続的に行う第1の焦点調整工程と、
を有する撮像装置の制御方法であって、
前記フォーカスレンズの測距範囲は、前記フォーカスレンズの可動範囲の一部に限定された範囲であり、
前記測距範囲の前回の中心位置に対する前回の最大焦点評価値に対応するレンズ位置の方向と前記測距範囲の今回の中心位置に対する今回の最大焦点評価値に対応するレンズ位置の方向が同じ方向である場合、前記第1の合焦動作を連続的に行うことで検出された最大焦点評価値に対応するレンズ位置を用いた予測演算により前記測距範囲の次回の中心位置を算出し、
前記測距範囲の前回の中心位置に対する前回の最大焦点評価値に対応するレンズ位置の方向と前記測距範囲の今回の中心位置に対する今回の最大焦点評価値に対応するレンズ位置の方向が同じ方向でない場合、前記今回の最大焦点評価値に対応するレンズ位置を前記測距範囲の次回の中心位置とすることを特徴とする撮像装置の制御方法。
An imaging step of capturing an image of a subject imaged by an imaging optical system including a focus lens and outputting image data;
A maximum focus evaluation value for focusing on the subject in a focus detection area is detected based on the image data obtained by moving the focus lens in one direction with a predetermined range as a whole ranging range. A first focus adjustment step of continuously performing a first focusing operation for moving the focus lens to a position where the subject is focused;
A method for controlling an imaging apparatus having:
The distance measurement range of the focus lens is a range limited to a part of the movable range of the focus lens,
The direction of the lens position corresponding to the previous maximum focus evaluation value for the previous center position of the distance measurement range is the same as the direction of the lens position corresponding to the current maximum focus evaluation value for the current center position of the distance measurement range. If it is, it calculates the next center position of the distance measuring range by the prediction calculation using the lens position corresponding to the maximum focus evaluation value detected by performing a pre-Symbol first focusing operation continuously,
The direction of the lens position corresponding to the previous maximum focus evaluation value for the previous center position of the distance measurement range is the same as the direction of the lens position corresponding to the current maximum focus evaluation value for the current center position of the distance measurement range. Otherwise, the lens position corresponding to the current maximum focus evaluation value is set as the next center position of the distance measuring range .
JP2014114355A 2014-06-02 2014-06-02 Automatic focusing device, control method therefor, and imaging device Expired - Fee Related JP5666044B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014114355A JP5666044B2 (en) 2014-06-02 2014-06-02 Automatic focusing device, control method therefor, and imaging device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014114355A JP5666044B2 (en) 2014-06-02 2014-06-02 Automatic focusing device, control method therefor, and imaging device

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2012244803A Division JP5607701B2 (en) 2012-11-06 2012-11-06 Imaging apparatus and control method thereof

Publications (2)

Publication Number Publication Date
JP2014197213A JP2014197213A (en) 2014-10-16
JP5666044B2 true JP5666044B2 (en) 2015-02-04

Family

ID=52357980

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014114355A Expired - Fee Related JP5666044B2 (en) 2014-06-02 2014-06-02 Automatic focusing device, control method therefor, and imaging device

Country Status (1)

Country Link
JP (1) JP5666044B2 (en)

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3302003B2 (en) * 2000-03-08 2002-07-15 三洋電機株式会社 Imaging device having autofocus function
JP2003107328A (en) * 2001-09-28 2003-04-09 Nikon Corp Camera
JP2003244520A (en) * 2002-02-20 2003-08-29 Minolta Co Ltd Photographing device
JP2007052061A (en) * 2005-08-15 2007-03-01 Sharp Corp Imaging device, focusing operation control method, and electronic information apparatus
JP2007065290A (en) * 2005-08-31 2007-03-15 Nikon Corp Automatic focusing device
JP2006091915A (en) * 2005-12-01 2006-04-06 Konica Minolta Photo Imaging Inc Imaging apparatus

Also Published As

Publication number Publication date
JP2014197213A (en) 2014-10-16

Similar Documents

Publication Publication Date Title
JP5134476B2 (en) Imaging apparatus and control method thereof
JP5004649B2 (en) Focus adjustment device, imaging device, and focus adjustment method
JP2014038196A (en) Imaging device and control method therefor
JP2016143022A (en) Imaging device and imaging method
JP2017129828A (en) Imaging device and imaging method
JP5607701B2 (en) Imaging apparatus and control method thereof
US8600226B2 (en) Focusing methods and apparatus, and recording media for recording the methods
JP6445887B2 (en) Focus adjustment apparatus, imaging apparatus, control method therefor, and program
US20160080636A1 (en) Focusing control device and controlling method of the same
JP5871463B2 (en) Image processing apparatus, control method therefor, program, and storage medium
JP5666044B2 (en) Automatic focusing device, control method therefor, and imaging device
JP6105917B2 (en) Focus adjustment apparatus and method, and imaging apparatus
JP2016148823A (en) Focus detection device and control method of the same, imaging device, program and recording medium
JP6274779B2 (en) Focus adjustment device, imaging device, and focus adjustment method
JP2010008711A (en) Imaging apparatus, imaging method, and program
JP6335503B2 (en) Imaging apparatus, control method therefor, program, and storage medium
JP6032884B2 (en) IMAGING DEVICE, IMAGING DEVICE CONTROL METHOD, PROGRAM
JP6069853B2 (en) Focus detection device
JP5868163B2 (en) IMAGING DEVICE, IMAGING DEVICE CONTROL METHOD, PROGRAM
JP4235416B2 (en) Automatic focusing device, control method thereof, program and recording medium
JP2006330160A (en) Autofocus camera
JP7249174B2 (en) IMAGING DEVICE AND CONTROL METHOD THEREOF, PROGRAM, STORAGE MEDIUM
JP5323243B2 (en) Image processing apparatus and control method thereof
JP5772849B2 (en) Imaging device
JP6463053B2 (en) Automatic focusing device and automatic focusing method

Legal Events

Date Code Title Description
A975 Report on accelerated examination

Free format text: JAPANESE INTERMEDIATE CODE: A971005

Effective date: 20140725

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140801

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140930

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: 20141110

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20141209

R151 Written notification of patent or utility model registration

Ref document number: 5666044

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

LAPS Cancellation because of no payment of annual fees