JP6501512B2 - Focus control apparatus, focus control method and focus control program - Google Patents

Focus control apparatus, focus control method and focus control program Download PDF

Info

Publication number
JP6501512B2
JP6501512B2 JP2014254270A JP2014254270A JP6501512B2 JP 6501512 B2 JP6501512 B2 JP 6501512B2 JP 2014254270 A JP2014254270 A JP 2014254270A JP 2014254270 A JP2014254270 A JP 2014254270A JP 6501512 B2 JP6501512 B2 JP 6501512B2
Authority
JP
Japan
Prior art keywords
focus
contrast
phase difference
focus control
control
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2014254270A
Other languages
Japanese (ja)
Other versions
JP2016114836A (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 JP2014254270A priority Critical patent/JP6501512B2/en
Publication of JP2016114836A publication Critical patent/JP2016114836A/en
Application granted granted Critical
Publication of JP6501512B2 publication Critical patent/JP6501512B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Description

本発明は、デジタルスチルカメラやデジタルビデオカメラ等の撮像装置および交換レンズ等の光学機器におけるフォーカス制御に関し、特に撮像面位相差AFとコントラストAFを併用するフォーカス制御に関する。   The present invention relates to focus control in optical devices such as imaging devices such as digital still cameras and digital video cameras and interchangeable lenses, and more particularly to focus control using imaging surface phase difference AF and contrast AF in combination.

撮像面位相差AFでは、光学系により形成された被写体像を撮像するための撮像素子上に、該光学系と撮像素子からなる撮像系の焦点状態に応じたずれ量を有する一対の被写体像を形成させる。そして、該一対の被写体像を撮像素子により光電変換することで得られた一対の像信号のずれ量(位相差)から撮像系のデフォーカス量を求め、該デフォーカス量から算出される駆動量だけフォーカス素子を移動させることで撮像系の合焦状態を得る。   In the imaging plane phase difference AF, on an image pickup element for picking up an object image formed by an optical system, a pair of object images having a shift amount according to the focus state of an imaging system including the optical system and the image pickup element Let it form. Then, the defocus amount of the imaging system is obtained from the shift amount (phase difference) of the pair of image signals obtained by photoelectrically converting the pair of subject images by the image sensor, and the drive amount calculated from the defocus amount By moving the focusing element by only the focus state of the imaging system can be obtained.

一方、コントラストAFでは、被写体像を光電変換した撮像素子の出力から高周波成分を抽出して該被写体像のコントラスト状態を示すコントラスト評価値を取得する。そして、該コントラスト評価値が最大(ピーク)となる合焦位置にフォーカス素子を移動させることで合焦状態を得る。   On the other hand, in contrast AF, high frequency components are extracted from the output of the image pickup element obtained by photoelectrically converting an object image, and a contrast evaluation value indicating the contrast state of the object image is acquired. Then, the focusing element is moved to the focusing position where the contrast evaluation value becomes maximum (peak) to obtain the focusing state.

特許文献1には、位相差AFにより得られた焦点検出結果に基づいてフォーカスレンズを合焦状態が得られる位置の近傍まで移動させ、さらにその後にコントラストAFを行うことで高速かつ高精度に合焦状態が得られる撮像装置が開示されている。また、特許文献1の撮像装置では、位相差AFで得られた焦点検出結果の信頼性が高い場合は、より合焦状態に近づくまでその焦点検出結果に基づいてフォーカスレンズを移動させてからコントラストAFを行う。これにより、さらに高速に合焦状態が得られるようにしている。   In Patent Document 1, based on the focus detection result obtained by phase difference AF, the focus lens is moved to the vicinity of the position where the in-focus state can be obtained, and after that, the contrast AF is performed to achieve high speed and high accuracy. An imaging device capable of obtaining a focused state is disclosed. Further, in the imaging device of Patent Document 1, when the reliability of the focus detection result obtained by the phase difference AF is high, the focus lens is moved based on the focus detection result until the focus state is approached, and then the contrast is obtained. Perform AF. Thereby, the in-focus state can be obtained at a higher speed.

特開2010−256824号公報JP, 2010-256824, A

しかしながら、特許文献1にて開示されているように位相差AFを行った後にコントラストAFを行っても、被写体が蛍光灯により照明されている状況では該蛍光灯が発生するフリッカの影響により、合焦状態ではないのに誤って合焦状態と判定されるおそれがある。この結果、高速かつ高精度に合焦状態が得られない。   However, even if contrast AF is performed after phase difference AF is performed as disclosed in Patent Document 1, in the situation where the subject is illuminated by a fluorescent lamp, the effect of the flicker generated by the fluorescent lamp is sufficient. There is a possibility that the in-focus state may be erroneously determined although the in-focus state is not achieved. As a result, the in-focus state can not be obtained at high speed and with high accuracy.

本発明は、位相差AFとコントラストAFを併用する場合に、フリッカの影響を低減して高速かつ高精度に合焦状態が得られるようにしたフォーカス制御装置を提供する。 The present invention, when used in combination the phase difference AF and contrast AF, providing a focus control equipment which is adapted focus state is obtained at high speed and with high accuracy by reducing the influence of flicker.

本発明の一側面としてのフォーカス制御装置は、光学系により形成された被写体像を撮像素子により光電変換する撮像系において移動可能なフォーカス素子の駆動を制御する。該フォーカス制御装置は、撮像素子の出力を用いて生成された一対の像信号の位相差からデフォーカス量を算出する位相差焦点検出を行う第1の焦点検出手段と、フォーカス素子の駆動に伴い、撮像素子の出力を用いて被写体像のコントラストに対応するコントラスト評価値を生成する第2の焦点検出手段と、被写体の周期的な輝度変化を検出する輝度変化検出手段と、デフォーカス量に基づいてフォーカス素子の駆動を制御する位相差フォーカス制御およびコントラスト評価値を用いてフォーカス素子の駆動を制御するコントラストフォーカス制御を行う制御手段とを有する。そして、該制御手段は、上記輝度変化が検出された場合は、光学系の焦点状態、位相差焦点検出の信頼度およびデフォーカス量のうち少なくとも1つに関する所定の条件を満たすときにコントラストフォーカス制御を行い、該条件を満たさないときは位相差フォーカス制御を行うことを特徴とする。 A focus control apparatus according to one aspect of the present invention controls driving of a movable focus element in an imaging system that photoelectrically converts an object image formed by an optical system by an imaging device. The focus control apparatus includes a first focus detection means for performing phase difference focus detection calculating the phase difference or La Defense focus of a pair of image signals generated using the output of the image sensor, the driving of the focus element Accordingly, the second focus detection unit that generates a contrast evaluation value corresponding to the contrast of the subject image using the output of the imaging device, the luminance change detection unit that detects a periodic luminance change of the object, and the defocus amount It has a phase difference focus control which controls the drive of a focus element based on it, and a control means which performs contrast focus control which controls drive of a focus element using contrast evaluation value. Then, the control means performs contrast focus control when a predetermined condition regarding at least one of the focus state of the optical system, the reliability of phase difference focus detection, and the defocus amount is satisfied when the above-mentioned change in luminance is detected. When the above conditions are not satisfied, phase difference focus control is performed.

また、本発明の他の一側面としてのフォーカス制御方法は、光学系により形成された被写体像を撮像素子により光電変換する撮像系において移動可能なフォーカス素子の駆動を制御する方法である。該フォーカス制御方法は、撮像素子の出力を用いて生成された一対の像信号の位相差からデフォーカス量を算出する位相差焦点検出を行うステップと、フォーカス素子の駆動に伴い、撮像素子の出力を用いて被写体像のコントラストに対応するコントラスト評価値を生成するステップと、被写体の周期的な輝度変化を検出するステップと、デフォーカス量に基づいてフォーカス素子の駆動を制御する位相差フォーカス制御およびコントラスト評価値を用いてフォーカス素子の駆動を制御するコントラストフォーカス制御を行う制御ステップとを有する。そして、該制御ステップにおいて、上記輝度変化が検出された場合は、光学系の焦点状態、位相差焦点検出の信頼度およびデフォーカス量のうち少なくとも1つに関する所定の条件を満たすときにコントラストフォーカス制御を行い、該条件を満たさないときは位相差フォーカス制御を行うことを特徴とする。 A focus control method as another aspect of the present invention is a method of controlling driving of a movable focus element in an imaging system that photoelectrically converts an object image formed by an optical system by an imaging device. The focus control method includes the steps of performing phase difference focus detection calculating the phase difference or La Defense focus of a pair of image signals generated using the output of the image pickup device, with the driving of the focus element, the imaging element The step of generating a contrast evaluation value corresponding to the contrast of the subject image using the output, the step of detecting the periodic luminance change of the subject, and the phase difference focus control of controlling the drive of the focusing element based on the defocus amount. And a control step of performing contrast focus control to control driving of the focus element using the contrast evaluation value. Then, in the control step, when the change in the brightness is detected, the contrast focus control is performed when a predetermined condition regarding at least one of the focus state of the optical system, the reliability of phase difference focus detection and the defocus amount is satisfied. When the above conditions are not satisfied, phase difference focus control is performed.

また、本発明の他の一側面としてのフォーカス制御プログラムは、光学機器のコンピュータに、光学系により形成された被写体像を撮像素子により光電変換する撮像系において移動可能なフォーカス素子の駆動を制御させるコンピュータプログラムである。該フォーカス制御プログラムは、コンピュータに、撮像素子の出力を用いて生成された一対の像信号の位相差からデフォーカス量を算出する位相差焦点検出を行わせ、フォーカス素子の駆動に伴い、撮像素子の出力を用いて被写体像のコントラストに対応するコントラスト評価値を生成させ、被写体の周期的な輝度変化を検出させ、デフォーカス量に基づいてフォーカス素子の駆動を制御する位相差フォーカス制御およびコントラスト評価値を用いてフォーカス素子の駆動を制御するコントラストフォーカス制御を行う制御処理を行わせる。そして、上記輝度変化が検出された場合は、制御処理において、コンピュータに、光学系の焦点状態、位相差焦点検出の信頼度およびデフォーカス量のうち少なくとも1つに関する所定の条件を満たすときにコントラストフォーカス制御を行わせ、該条件を満たさないときは位相差フォーカス制御を行わせることを特徴とする。
A focus control program according to another aspect of the present invention causes a computer of an optical device to control driving of a movable focus element in an imaging system that photoelectrically converts an object image formed by an optical system by an imaging device. It is a computer program. The focus control program causes the computer to perform the phase difference focus detection calculating the phase difference or La Defense focus of a pair of image signals generated using the output of the image pickup device, with the drive of the focus element, imaging The phase difference focus control and contrast which generate the contrast evaluation value corresponding to the contrast of the subject image using the output of the element, detect the periodic luminance change of the subject, and control the drive of the focusing element based on the defocus amount. A control process is performed to perform contrast focus control to control the drive of the focus element using the evaluation value. Then, when the above-mentioned change in brightness is detected, in the control processing, when the computer satisfies a predetermined condition regarding at least one of the focus state of the optical system, the reliability of phase difference focus detection and the defocus amount, Focus control is performed, and when the condition is not satisfied, phase difference focus control is performed.

本発明によれば、被写体の周期的な輝度変化の影響によりコントラストフォーカス制御が正確に行われなくなることを回避することができるので、そのような輝度変化があっても高速かつ高精度に合焦状態を得ることができる。 According to the present invention, it is possible to avoid that contrast focus control is not performed accurately due to the influence of periodical luminance change of an object, so even if such luminance change occurs, focusing can be performed quickly and accurately. You can get the status.

本発明の実施例1におけるAF処理を説明するフローチャート。3 is a flowchart illustrating AF processing in Embodiment 1 of the present invention. 実施例1の撮像装置の構成を示すブロック図。FIG. 1 is a block diagram showing the configuration of an imaging device according to a first embodiment. 実施例1におけるフリッカ検出方法を説明する図。FIG. 6 is a diagram for explaining a flicker detection method in the first embodiment. コントラストAFを説明する図。The figure explaining contrast AF. レンズ駆動量のステップ幅の設定について説明する図である。It is a figure explaining setting of the step width of lens drive amount. 本発明の実施例2におけるAF処理を説明するフローチャート。6 is a flowchart illustrating AF processing in Embodiment 2 of the present invention. 実施例2における合焦度の算出処理を説明するフローチャート。10 is a flowchart for explaining calculation processing of the degree of focusing in the second embodiment. 実施例2におけるフリッカ検出時のピーク判定閾値について説明する図。FIG. 8 is a diagram for explaining a peak determination threshold at the time of flicker detection in the second embodiment. 実施例2における位相差焦点検出の信頼度閾値について説明する図。FIG. 8 is a diagram for explaining the reliability threshold value of phase difference focus detection in the second embodiment.

以下、本発明の実施例について図面を参照しながら説明する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings.

実施例1では、撮像装置として、交換レンズの着脱が可能な一眼レフデジタルカメラについて説明する。図2には、本実施例の一眼レフデジタルカメラの構成を示している。該カメラは、交換レンズユニット100とカメラ本体(光学機器)120とを有する。交換レンズユニット100は、図中に点線で示されるマウントMを介して、カメラ本体120と着脱可能に接続される。   In the first embodiment, a single-lens reflex digital camera in which an interchangeable lens can be attached and detached is described as an imaging device. FIG. 2 shows the configuration of the single-lens reflex digital camera of this embodiment. The camera has an interchangeable lens unit 100 and a camera body (optical apparatus) 120. The interchangeable lens unit 100 is detachably connected to the camera body 120 via a mount M shown by a dotted line in the figure.

交換レンズユニット100は、被写体側から順に第1レンズ群101、絞り兼用シャッタ102、第2レンズ群103およびフォーカスレンズ群(以下、単にフォーカスレンズという)104を含む撮像光学系と、後述するレンズ制御系とを有する。撮像光学系は、不図示の被写体からの光に被写体像を形成させる。   The interchangeable lens unit 100 includes an imaging optical system including a first lens group 101, a diaphragm shutter 102, a second lens group 103, and a focus lens group (hereinafter simply referred to as a focus lens) 104 in order from the object side, and lens control described later Have a system. The imaging optical system forms a subject image on light from a subject (not shown).

第1レンズ群101は、撮像光学系の光軸方向OAに移動可能に保持されている。絞り兼用シャッタ102は、その開口径を変化させることで光量調節を行うとともに、静止画撮像時にはシャッタとして機能する。絞り兼用シャッタ102と第2レンズ群103は一体で光軸方向OAに移動し、移動する第1レンズ群101とともに変倍を行う。フォーカス素子としてのフォーカスレンズ104は、光軸方向OAに移動して焦点調節を行う。   The first lens group 101 is movably held in the optical axis direction OA of the imaging optical system. The diaphragm / shutter 102 adjusts the amount of light by changing the diameter of the aperture, and functions as a shutter when capturing a still image. The aperture-shutter 102 and the second lens group 103 move integrally in the optical axis direction OA, and perform magnification change with the moving first lens group 101. A focusing lens 104 as a focusing element moves in the optical axis direction OA to perform focusing.

レンズ制御系は、ズームアクチュエータ111、絞りシャッタアクチュエータ112、フォーカスアクチュエータ113、ズーム駆動回路114、絞りシャッタ駆動回路115、フォーカス駆動回路116、レンズMPU117およびレンズメモリ118を含む。ズームアクチュエータ111は、変倍に際して第1レンズ群101および第2レンズ群103を光軸方向OAに移動させる。ズームアクチュエータ111は、第1および第2レンズ群101,103の現在位置(ズーム位置)を検出する不図示のズーム位置検出部を有する。絞りシャッタアクチュエータ112は、絞り兼用シャッタ102を開閉動作させる。フォーカスアクチュエータ113は、フォーカスレンズ104を光軸方向OAに移動させる。フォーカスアクチュエータ113は、フォーカスレンズ104の現在位置(フォーカス位置)を検出する不図示のフォーカス位置検出部を有する。   The lens control system includes a zoom actuator 111, an aperture shutter actuator 112, a focus actuator 113, a zoom drive circuit 114, an aperture shutter drive circuit 115, a focus drive circuit 116, a lens MPU 117, and a lens memory 118. The zoom actuator 111 moves the first lens group 101 and the second lens group 103 in the optical axis direction OA during zooming. The zoom actuator 111 has a zoom position detection unit (not shown) that detects the current position (zoom position) of the first and second lens groups 101 and 103. The aperture shutter actuator 112 opens and closes the aperture shutter 102. The focus actuator 113 moves the focus lens 104 in the optical axis direction OA. The focus actuator 113 has a focus position detection unit (not shown) that detects the current position (focus position) of the focus lens 104.

ズーム駆動回路114は、ユーザのズーム操作に応じてズームアクチュエータ111を駆動する。シャッタ駆動回路115は、絞りシャッタアクチュエータ112を駆動する。フォーカス駆動回路116は、フォーカスアクチュエータ113を駆動する。   The zoom drive circuit 114 drives the zoom actuator 111 according to the zoom operation of the user. The shutter drive circuit 115 drives the aperture shutter actuator 112. The focus drive circuit 116 drives the focus actuator 113.

レンズMPU117は、マウントMに設けられた通信端子を通じて後述するカメラMPU125との通信が可能である。レンズMPU117は、カメラMPU125からの指令に応じて、ズーム駆動回路114、シャッタ駆動回路115およびフォーカス駆動回路116を制御する。また、レンズMPU117は、現在のズーム位置やフォーカス位置を検出してカメラMPU125に通知する。レンズメモリ118は、オートフォーカス(AF)に必要な光学情報を記憶しており、レンズMPU117はカメラMPU125からの要求に応じて該光学情報をカメラMPU125に送信する。   The lens MPU 117 can communicate with a camera MPU 125 described later through a communication terminal provided on the mount M. The lens MPU 117 controls the zoom drive circuit 114, the shutter drive circuit 115, and the focus drive circuit 116 in accordance with an instruction from the camera MPU 125. The lens MPU 117 detects the current zoom position and focus position and notifies the camera MPU 125 of the detected zoom position and focus position. The lens memory 118 stores optical information necessary for auto focus (AF), and the lens MPU 117 transmits the optical information to the camera MPU 125 in response to a request from the camera MPU 125.

カメラ本体120は、光学ローパスフィルタ121、撮像素子122および後述するカメラ制御系を有する。光学ローパスフィルタ121は、撮像画像の偽色やモアレを軽減する。撮像素子122は、C−MOSセンサとその周辺回路で構成され、m画素(横方向)×n画素(縦方向)からなる複数の画素を有する。撮像素子122は、個々の画素から独立に出力が可能なように構成されている。   The camera body 120 includes an optical low pass filter 121, an imaging device 122, and a camera control system described later. The optical low pass filter 121 reduces false color and moiré of a captured image. The imaging element 122 is constituted by a C-MOS sensor and its peripheral circuit, and has a plurality of pixels consisting of m pixels (horizontal direction) × n pixels (vertical direction). The imaging element 122 is configured to be able to output independently from each pixel.

また、撮像素子122は、位相差検出方式による焦点検出演算を行うために用いられる位相差焦点検出用信号を出力する複数の画素を含む。位相差焦点検出用信号は、撮像光学系と撮像素子122からなる撮像系の焦点状態に応じてずれ量が変化する一対の光学像(被写体像)が光電変換されることで生成される信号である。この位相差焦点検出用信号を用いて、上記一対の光学像に対応する一対の像信号が生成される。   The imaging element 122 also includes a plurality of pixels that output a phase difference focus detection signal used to perform focus detection calculation according to the phase difference detection method. The phase difference focus detection signal is a signal generated by photoelectric conversion of a pair of optical images (object images) whose shift amount changes according to the focus state of the imaging system including the imaging optical system and the imaging device 122. is there. The phase difference focus detection signal is used to generate a pair of image signals corresponding to the pair of optical images.

撮像素子122としては、複数の撮像用画素とは別に、撮像光学系の射出瞳のうち互いに異なる領域を通過した光束を光電変換する複数対の位相差焦点検出用画素を有するものを用いることができる。複数対(またはその一部)の位相差焦点検出用画素からの出力を用いて一対の像信号を生成することができる。また、撮像素子122として、全画素のそれぞれがマイクロレンズと一対の光電変換部を有し、マイクロレンズで分割された2つの光束により形成された一対の光学像を一対の光電変換部で光電変換することで一対の像信号を生成できるものを用いてもよい。この構成を有する撮像素子では、各画素の一対の光電変換部の出力を合成することで撮像用の画素信号を取り出すことができる。   As the imaging element 122, it is possible to use one having a plurality of pairs of phase difference focus detection pixels for photoelectrically converting light fluxes which have passed through different regions of the exit pupil of the imaging optical system, in addition to the plurality of imaging pixels. it can. A pair of image signals can be generated using outputs from a plurality of (or part of) pairs of phase difference focus detection pixels. In addition, as the imaging element 122, each of all the pixels has a micro lens and a pair of photoelectric conversion portions, and a pair of optical images formed of two light beams divided by the micro lenses is photoelectrically converted It is also possible to use one that can generate a pair of image signals. In the imaging device having this configuration, a pixel signal for imaging can be extracted by combining the outputs of the pair of photoelectric conversion units of each pixel.

カメラ制御系は、撮像素子駆動回路123、画像処理回路124、カメラMPU125、表示器126、操作スイッチ群127、メモリ128を有する。さらに、カメラ制御系は、撮像面位相差焦点検出部(第1の焦点検出手段)129およびコントラスト焦点検出部(第2の焦点検出手段)130を有する。   The camera control system includes an imaging element drive circuit 123, an image processing circuit 124, a camera MPU 125, a display 126, an operation switch group 127, and a memory 128. Furthermore, the camera control system includes an imaging plane phase difference focus detection unit (first focus detection unit) 129 and a contrast focus detection unit (second focus detection unit) 130.

撮像素子駆動回路123は、撮像素子122に光電変換動作および画素信号読み出し動作を行わせるとともに、読み出した画素信号をA/D変換して画像処理回路124およびカメラMPU125に出力する。画像処理回路124は、デジタル画素信号に対してγ変換およびカラー補間等の画像処理を行って画像信号を生成し、さらに該画像信号に対して圧縮等の処理も行う。   The imaging device driving circuit 123 causes the imaging device 122 to perform a photoelectric conversion operation and a pixel signal reading operation, A / D converts the read pixel signal, and outputs it to the image processing circuit 124 and the camera MPU 125. The image processing circuit 124 performs image processing such as γ conversion and color interpolation on the digital pixel signal to generate an image signal, and further performs processing such as compression on the image signal.

カメラMPU125は、撮像素子駆動回路123、画像処理回路124、表示器126、操作SW127、メモリ128、撮像面位相差焦点検出部(以下、位相差焦点検出部という)129およびコントラスト焦点検出部130を制御する。また、カメラMPU125は、レンズMPU117に対して指令または要求を送信したり、レンズMPU117から交換レンズユニット100の光学情報を受信したりする。   The camera MPU 125 includes an imaging element driving circuit 123, an image processing circuit 124, a display 126, an operation SW 127, a memory 128, an imaging surface phase difference focus detection unit (hereinafter referred to as a phase difference focus detection unit) 129, and a contrast focus detection unit 130. Control. Also, the camera MPU 125 transmits a command or request to the lens MPU 117, and receives optical information of the interchangeable lens unit 100 from the lens MPU 117.

カメラMPU125は、位相差焦点検出部129およびコントラスト焦点検出部130を制御しつつフォーカス制御処理としてのAF処理を行う。また、カメラMPU125は、位相差焦点検出部129を制御しつつ行う撮像面位相差AFにおいて、焦点検出位置の像高が高いときのケラレの影響により位相差焦点検出部129による検出結果の信頼度が低下するため、それを補正する処理も行う。さらに、カメラMPU125は、撮像素子駆動回路123および画像処理回路124を制御しつつ撮像処理を行う。カメラMPU125は、カメラ本体120の各種動作を制御するコンピュータプログラムを格納したROM125a、各種演算に用いられる変数を記憶するRAM125bおよび各種制御に用いられるパラメータを記憶するEEPROM125cが内蔵されている。   The camera MPU 125 performs AF processing as focus control processing while controlling the phase difference focus detection unit 129 and the contrast focus detection unit 130. Further, in the imaging surface phase difference AF performed while controlling the phase difference focus detection unit 129, the camera MPU 125 has the reliability of the detection result by the phase difference focus detection unit 129 due to the influence of vignetting when the image height of the focus detection position is high. Because it decreases, it also processes to correct it. Furthermore, the camera MPU 125 performs imaging processing while controlling the imaging element driving circuit 123 and the image processing circuit 124. The camera MPU 125 incorporates a ROM 125a storing a computer program for controlling various operations of the camera body 120, a RAM 125b storing variables used for various calculations, and an EEPROM 125c storing parameters used for various controls.

表示器126は、LCD等により構成され、撮像モードに関する情報、記録用撮像前に生成されたプレビュー画像、記録用撮像により生成された記録用画像および焦点検出時の合焦状態等を表示する。   The display 126 is configured by an LCD or the like, and displays information regarding an imaging mode, a preview image generated before recording for recording, a recording image generated by recording for recording, and a focusing state at the time of focus detection.

操作スイッチ群127は、電源スイッチ、レリーズ(撮像トリガ)スイッチ、ズーム操作スイッチ、撮像モード選択スイッチ等を含む。メモリ128は、カメラ本体120に対して着脱可能なフラッシュメモリであり、記録用画像を記録する。   The operation switch group 127 includes a power switch, a release (imaging trigger) switch, a zoom operation switch, an imaging mode selection switch, and the like. A memory 128 is a flash memory that can be attached to and detached from the camera body 120, and records an image for recording.

位相差焦点検出部129は、位相差方式による焦点検出(位相差焦点検出)を行う。具体的には、位相差焦点検出部129は、撮像素子122からの出力を用いて生成された一対の像信号に対して相関演算を行うことで該一対の像信号のずれ量である位相差を算出する。そして、該位相差から撮像系(本実施例では撮像光学系)の焦点状態に相当するデフォーカス量を算出する。該デフォーカス量から撮像系を合焦状態とするフォーカスレンズ104の駆動量(位相差合焦駆動量:以下、単に合焦駆動量ともいう)を求めることができる。なお、撮像系の合焦状態とは、デフォーカス量が零の状態だけでなく零に近い状態も含む。つまり、撮像系の焦点状態が合焦状態とみなせる所定の範囲(合焦範囲)内にあることをいう。   The phase difference focus detection unit 129 performs focus detection (phase difference focus detection) by the phase difference method. Specifically, the phase difference focus detection unit 129 performs a correlation operation on a pair of image signals generated using the output from the image pickup device 122 to obtain a phase difference that is a shift amount of the pair of image signals. Calculate Then, the defocus amount corresponding to the focus state of the imaging system (in the present embodiment, the imaging optical system) is calculated from the phase difference. The driving amount of the focus lens 104 (phase difference focusing driving amount: hereinafter, also simply referred to as focusing driving amount) which brings the imaging system into focus can be obtained from the defocus amount. The in-focus state of the imaging system includes not only the state in which the defocus amount is zero but also the state in which the defocus amount is close to zero. That is, it means that the focus state of the imaging system is within a predetermined range (focusing range) that can be regarded as the in-focus state.

一方、コントラスト焦点検出部130は、TVAF方式とも称されるコントラスト検出方式による焦点検出(コントラスト焦点検出)を行う。具体的には、コントラスト焦点検出部130は、撮像素子122の出力を用いて画像処理回路124が生成した画像信号のうち高周波成分等を用いて該画像信号(つまりは被写体像)のコントラストに対応するコントラスト評価値(TVAF評価値)を生成する。このコントラスト評価値は、フォーカスレンズ104が所定駆動量(以下、AFピッチ量という)だけ駆動されるごとに生成される。コントラスト評価値が最大(ピーク)となるフォーカスレンズ104の位置が撮像系を合焦状態とする合焦位置(以下、コントラスト合焦位置という)である。詳しくは後述するが、AFピッチ量は、フォーカスレンズ104がコントラスト合焦位置から離れている状態では第1のピッチ量(第1の所定量)に設定される。そして、コントラスト合焦位置の近傍に位置すると、第1のピッチ量より小さい第2のピッチ量(第2の所定量)に変更される。   On the other hand, the contrast focus detection unit 130 performs focus detection (contrast focus detection) by a contrast detection method also referred to as a TVAF method. Specifically, the contrast focus detection unit 130 uses the high frequency component etc. of the image signal generated by the image processing circuit 124 using the output of the imaging device 122 to handle the contrast of the image signal (that is, the object image). To generate a contrast evaluation value (TVAF evaluation value). The contrast evaluation value is generated each time the focus lens 104 is driven by a predetermined drive amount (hereinafter, referred to as an AF pitch amount). The position of the focus lens 104 at which the contrast evaluation value is maximum (peak) is the in-focus position where the imaging system is in focus (hereinafter referred to as the contrast in-focus position). Although details will be described later, the AF pitch amount is set to a first pitch amount (a first predetermined amount) in a state where the focus lens 104 is away from the contrast in-focus position. And if it is located in the vicinity of the contrast focusing position, it is changed to a second pitch amount (second predetermined amount) smaller than the first pitch amount.

このように、本実施例のカメラ本体120は、撮像面位相差AF(位相差フォーカス制御)とコントラストAF(コントラストフォーカス制御)の双方を行うことが可能であり、これらを単独で用いたり組み合わせて用いたりして撮像系を合焦状態とする。   As described above, the camera body 120 of this embodiment can perform both imaging plane phase difference AF (phase difference focus control) and contrast AF (contrast focus control), and these can be used alone or in combination. Use this to bring the imaging system into focus.

次に、図1を参照して、カメラMPU125が行うAF処理について説明する。図1は、AF処理の内容を示すフローチャートである。コンピュータであるカメラMPU125は、コンピュータプログラムであるフォーカス制御プログラムに従って本処理を実行する。また、カメラMPU125は、輝度変化検出手段および制御手段として機能する。図1において、「S」はステップの略である。   Next, AF processing performed by the camera MPU 125 will be described with reference to FIG. FIG. 1 is a flowchart showing the contents of the AF process. The camera MPU 125, which is a computer, executes this process according to a focus control program, which is a computer program. The camera MPU 125 also functions as a luminance change detection unit and a control unit. In FIG. 1, "S" is an abbreviation of step.

ステップ100においてAF処理を開始したカメラMPU125は、ステップ101において撮像素子122の露光を行う。これにより、撮像面位相差AFに用いる一対の像信号やコントラストAFに用いるコントラスト評価値を取得するための撮像素子122からの出力信号を得ることができる。   The camera MPU 125, which has started the AF process in step 100, exposes the image sensor 122 in step 101. As a result, it is possible to obtain an output signal from the imaging element 122 for acquiring a pair of image signals used for imaging surface phase difference AF and a contrast evaluation value used for contrast AF.

次に、ステップ102において、カメラMPU125は、コントラスト焦点検出部130にコントラスト焦点検出を行わせる。すなわち、レンズMPUを介してフォーカスレンズ104を駆動しながら(移動させながら)コントラスト焦点検出部130にコントラスト評価値を生成させる。   Next, in step 102, the camera MPU 125 causes the contrast focus detection unit 130 to perform contrast focus detection. That is, the contrast focus detection unit 130 generates a contrast evaluation value while driving (moving) the focus lens 104 via the lens MPU.

続いて、ステップ103において、カメラMPU125は、位相差焦点検出部129に位相差焦点検出を行わせる。すなわち、位相差焦点検出部129に一対の像信号を生成させ、該一対の像信号に対して相関演算を行わせることでこれらの位相差を算出させ、さらに該位相差からデフォーカス量(以下、検出デフォーカス量という)を算出させる。   Subsequently, in step 103, the camera MPU 125 causes the phase difference focus detection unit 129 to perform phase difference focus detection. That is, the phase difference focus detection unit 129 generates a pair of image signals, and performs a correlation operation on the pair of image signals to calculate their phase difference, and further, based on the phase difference, the defocus amount (hereinafter , Detect defocus amount).

次に、カメラMPU125は、ステップ104において、位相差焦点検出部129による位相差焦点検出の信頼度を算出する。言い換えれば、位相差焦点検出により得られたデフォーカス量の信頼度を算出する。信頼度は、位相差焦点検出に用いられた一対の像信号の一致度だけでなく、該一対の像信号のコントラストに基づいて求められる。一対の像信号のコントラストを考慮するのは、高いコントラストを有する被写体から得られる一対の像信号の方が低いコントラストを有する被写体から得られる一対の像信号よりも一致度を正確に計算でき、その結果、それらの位相差も精度良く算出できるためである。   Next, in step 104, the camera MPU 125 calculates the reliability of phase difference focus detection by the phase difference focus detection unit 129. In other words, the reliability of the defocus amount obtained by the phase difference focus detection is calculated. The reliability is determined based on not only the degree of coincidence of the pair of image signals used for phase difference focus detection but also the contrast of the pair of image signals. The reason for considering the contrast of a pair of image signals is that a pair of image signals obtained from a subject with high contrast can calculate the coincidence more accurately than a pair of image signals obtained from a subject with low contrast, As a result, their phase differences can also be calculated with high accuracy.

具体的には、信頼度は、以下のように求められる。
まず、一対の像信号の一致度は、以下のように求められる。位相差焦点検出用画素から読み出された一対の像信号(a1〜an、b1〜bn:nはデータ数)に対して、式(1)に示す相関演算を行い、相関量Corr(l)を演算する。
Specifically, the reliability is obtained as follows.
First, the coincidence between the pair of image signals is obtained as follows. The correlation operation shown in equation (1) is performed on a pair of image signals (a1 to an, b1 to bn: n is the number of data) read out from the phase difference focus detection pixel, and the correlation amount Corr (l) Calculate

式(1)において、lは像ずらし量を表し、像をずらした際のデータ数はn−lに限定される。また、像ずらし量lは整数であり、データ列のデータ間隔を単位とした相対的なシフト量である。一対のデータの相関が最も高い場合に、相関量Corr(l)が極小となる。さらに、相関量Corr(m)(極小となるシフト量m)とmに近いシフト量において算出された相関量とを用いて、3点内挿の手法により連続的な相関量に対する極小値Corr(d)を与えるシフト量dを求める。一対の像信号の一致度FLVLは式(1)で算出した相関量Corr(l)に対して、相関性の最も高いときの値Corr(d)とする。 In equation (1), l represents the image shift amount, and the number of data when the image is shifted is limited to n−1. Further, the image shift amount l is an integer, and is a relative shift amount in units of data intervals of the data string. When the correlation between the pair of data is the highest, the correlation amount Corr (l) is minimized. Furthermore, using the correlation amount Corr (m) (the shift amount m which becomes the minimum) and the correlation amount calculated in the shift amount close to m, the local minimum value Corr (for the continuous correlation amount by the three-point interpolation method) d) Find the shift amount d that gives. The coincidence degree FLVL of the pair of image signals is set to a value Corr (d) at the highest degree of correlation with the correlation amount Corr (l) calculated by the equation (1).

デフォーカス量が大きいとき、A像およびB像の非対称性が大きくなるため、FLVLが大きく、信頼度が悪化する。一般的にデフォーカス量に対するFLVLはレンズの位置が合焦位置に近いほど低く演算され、信頼度が高い傾向となる。   When the defocus amount is large, the asymmetry of the A image and the B image becomes large, so the FLVL becomes large and the reliability deteriorates. Generally, FLVL for the defocus amount is calculated lower as the lens position is closer to the in-focus position, and the reliability tends to be high.

次に、一対の像信号のコントラストPBは以下にように求められる。amaxをa1〜anの最大値とし、aminをa1〜anの最小値とし、bmaxをb1〜bnの最大値、とし、bminをb1〜bnの最小値とする。この場合、
PBa=amax−amin (2)
PBb=bmax−bmin (3)
となる。一対の像信号のコントラストPBは式(2)および式(3)で算出されたPBaとPBbの小さい方の値とする。
Next, the contrast PB of the pair of image signals is determined as follows. Let amax be a maximum value of a1 to an, amin be a minimum value of a1 to an, bmax be a maximum value of b1 to bn, and bmin be a minimum value of b1 to bn. in this case,
PBa = amax-amin (2)
PBb = bmax-bmin (3)
It becomes. The contrast PB of the pair of image signals is set to the smaller value of PBa and PBb calculated by the equations (2) and (3).

信頼度は一対の像信号の一致度FLVLと一対の像信号のコントラストPBを正規化することによって算出し、FLVLおよびPBが高いほど信頼度も高くなる。   The reliability is calculated by normalizing the coincidence degree FLVL of the pair of image signals and the contrast PB of the pair of image signals, and the higher the FLVL and PB, the higher the reliability.

次に、ステップ105において、カメラMPU125は、フリッカの有無を判定する。ここにいうフリッカとは、被写体を照らす蛍光灯等の光源の輝度が周期的に変化することによる被写体の周期的な輝度変化である。フリッカ判定の方法について、蛍光灯下の被写体を撮像することにより得られた画像信号の輝度の時間変化を示す図3を用いて説明する。図3には、蛍光灯を点灯させる電源の周波数が50Hzであり、蛍光灯のフリッカの発生周波数が100Hz(フリッカ周期=約10ms)である場合の周期的な輝度変化をフリッカ波形として示している。カメラMPU125は、フリッカ判定のための輝度を、画像処理回路124により生成された撮影画面全体の画像信号のうち、コントラストAFにおける焦点検出対象領域であるコントラスト評価範囲(およびその近傍)の部分画像信号を用いて測定する。図3のフリッカ波形上に示したハッチングされた丸は、画像信号のフレームレートに対応した撮像素子122の動作周期が60fps(露光周期=約16.7ms)である場合の輝度の測定点を示している。   Next, in step 105, the camera MPU 125 determines the presence or absence of flicker. The flicker referred to herein is a periodic change in luminance of the subject due to a periodic change in luminance of a light source such as a fluorescent lamp that illuminates the subject. The method of flicker determination will be described with reference to FIG. 3 showing temporal change in luminance of an image signal obtained by imaging an object under a fluorescent lamp. In FIG. 3, the frequency of the power source for lighting the fluorescent lamp is 50 Hz, and a periodic luminance change is shown as a flicker waveform when the occurrence frequency of the flicker of the fluorescent lamp is 100 Hz (flicker cycle = about 10 ms). . The camera MPU 125 is a partial image signal of the contrast evaluation range (and its vicinity) which is a focus detection target area in the contrast AF among the image signals of the entire photographed screen generated by the image processing circuit 124 as the luminance for flicker determination. Measure using Hatched circles shown on the flicker waveform in FIG. 3 indicate measurement points of luminance when the operation cycle of the image sensor 122 corresponding to the frame rate of the image signal is 60 fps (exposure cycle = about 16.7 ms). ing.

カメラMPU125は、フリッカの判定を、例えば以下のように行う。まず、カメラMPU125は、撮像素子122の露光周期より十分長い時間をフリッカ測定範囲として設定し、露光周期ごとに上述した部分画像信号における輝度(以下、測定輝度という)を測定する。そして、カメラMPU125は、フリッカ測定範囲における測定輝度の最小値T11と最大値T12を検出し、これら最小値T11と最大値T12の差分が所定のフリッカ判定閾値(所定輝度差)より大きければフリッカが有ると判定する。フリッカ判定の精度を高めるために、複数のフリッカ測定範囲にてフリッカ判定を繰り返し行い、フリッカ有りの判定が所定回数以上なされた場合に最終的にフリッカ有りと判定するようにしてもよい。   The camera MPU 125 performs flicker determination, for example, as follows. First, the camera MPU 125 sets a time sufficiently longer than the exposure cycle of the image sensor 122 as the flicker measurement range, and measures the luminance (hereinafter referred to as measurement luminance) in the partial image signal described above for each exposure cycle. Then, the camera MPU 125 detects the minimum value T11 and the maximum value T12 of the measured luminance in the flicker measurement range, and if the difference between the minimum value T11 and the maximum value T12 is larger than a predetermined flicker determination threshold (predetermined luminance difference), flicker occurs. It determines that it exists. In order to improve the accuracy of the flicker determination, the flicker determination may be repeatedly performed in a plurality of flicker measurement ranges, and it may be finally determined that the flicker is present when the determination of the presence of the flicker is performed a predetermined number of times or more.

なお、ステップ105でのフリッカ判定の処理は、後述するステップ115からステップ101に戻ることで開始される次回以降のルーチンで毎回行うのではなく、所定の複数回のルーチンごと(つまりは所定周期ごと)に行う。1つの所定周期内では、その周期の最初のルーチンで行われたフリッカ判定の結果を保持する。   The process of flicker determination in step 105 is not performed every time in the next and subsequent routines started by returning from step 115 to step 101 described later, but every predetermined number of routines (that is, every predetermined period) To do). Within one predetermined period, the result of the flicker determination made in the first routine of that period is held.

また、ステップ101〜105の処理は、必ずしもAF処理の開始後に行う必要はなく、AF処理の開始前に行ってもよい。また、フリッカの有無を判定(検出)する方法は、図3に示した方法以外の方法、例えば、画像信号を用いずに直接被写体から反射光を受光する受光素子の出力を用いる方法であってもよい。   Further, the processes of steps 101 to 105 do not necessarily need to be performed after the start of the AF process, and may be performed before the start of the AF process. In addition, a method of determining (detecting) the presence or absence of flicker is a method other than the method shown in FIG. 3, for example, a method using the output of a light receiving element that directly receives reflected light from an object without using an image signal. It is also good.

ステップ106において、カメラMPU125は、ステップ104で算出した位相差焦点検出の信頼度が合焦可能閾値(第1の信頼度)より高いか否かを判定する。合焦可能閾値は、これよりも高い信頼度であれば、位相差焦点検出により得られたデフォーカス量に基づいて算出された合焦駆動量だけフォーカスレンズ104を駆動すれば少なくとも前述した合焦範囲内の焦点状態が得られる信頼度である。信頼度が合焦可能閾値より高い場合はステップ107に進む。   In step 106, the camera MPU 125 determines whether the reliability of phase difference focus detection calculated in step 104 is higher than the focusable threshold (first reliability). If the in-focus threshold is a reliability higher than this, at least the in-focus state described above can be obtained by driving the focusing lens 104 by the in-focus driving amount calculated based on the defocus amount obtained by phase difference focus detection. It is the degree of confidence that the in-range focus state can be obtained. If the degree of reliability is higher than the focusable threshold value, the process proceeds to step 107.

ステップ107において、カメラMPU125は、ステップ103で算出したデフォーカス量に対応したフォーカスレンズ104の駆動量(位相差合焦駆動量)を算出する。そして、ステップ108において、カメラMPU125は、算出した位相差合焦駆動量だけフォーカスレンズ104を駆動する。   In step 107, the camera MPU 125 calculates the drive amount (phase difference focus drive amount) of the focus lens 104 corresponding to the defocus amount calculated in step 103. Then, in step 108, the camera MPU 125 drives the focus lens 104 by the calculated phase difference focusing drive amount.

この後、カメラMPU125は、ステップ109にて、撮像素子122の露光を行い、再度、一対の像信号の位相差を求め、該位相差から検出デフォーカス量を求める。そして、本ステップにて、該検出デフォーカス量が合焦範囲内に収まっているか否か、つまりは合焦状態が得られたか否かを判定する。合焦状態が得られた場合は、カメラMPU125は、AF処理を終了する。合焦状態が得られていない場合には、カメラMPU125は、ステップ107に戻る。   Thereafter, in step 109, the camera MPU 125 exposes the image sensor 122, obtains the phase difference between the pair of image signals again, and obtains the detected defocus amount from the phase difference. Then, in this step, it is determined whether or not the detected defocus amount falls within the in-focus range, that is, whether or not the in-focus state is obtained. If the in-focus state is obtained, the camera MPU 125 ends the AF processing. If the in-focus state is not obtained, the camera MPU 125 returns to step 107.

なお、ここではステップ108でフォーカスレンズ104を駆動した後にステップ109で合焦状態が得られたかを確認する場合について説明したが、必ずしもこの確認を行う必要はない。例えば、ステップ107で算出された合焦駆動量が所定値より小さい場合には、検出デフォーカス量や合焦駆動量の誤差が小さいとみなして合焦状態の確認を省くことができる。   Here, although the case of confirming whether the in-focus state has been obtained in step 109 after driving the focus lens 104 in step 108 has been described, the confirmation is not necessarily required. For example, when the in-focus drive amount calculated in step 107 is smaller than a predetermined value, it is possible to consider that the error in the detected defocus amount and the in-focus drive amount is small and to omit confirmation of the in-focus state.

一方、ステップ106にて位相差焦点検出の信頼度が合焦可能閾値より低いと判定したカメラMPU125は、ステップ110において、ステップ105でフリッカ有りと判定されたか否かを判定する。   On the other hand, when it is determined in step 106 that the reliability of phase difference focus detection is lower than the in-focus threshold, the camera MPU 125 determines in step 110 whether or not it is determined in step 105 that flicker is present.

フリッカ有りと判定されなかった(フリッカ無しと判定された)場合には、カメラMPU125は、ステップ111に進み、コントラスト評価値のピークが検出されたか否かを判定する。図4(a)は、フリッカが発生していない場合のコントラストAFにおけるフォーカスレンズ104の位置(横軸)とコントラスト評価値(縦軸)との関係とを示す。フォーカスレンズ104がコントラストAF開始位置T1からAFピッチ量だけ駆動されるごとにコントラスト評価値が取得される。ハッチングした丸は、コントラスト評価値のピークが検出されるまでにコントラスト評価値が取得されるフォーカスレンズ104の位置(以下、コントラスト評価値取得位置という)を示す。カメラMPU125は、図4(a)に示すように、フォーカスレンズ104の駆動に伴うコントラスト評価値の変化が増加から減少に切り替わり、所定減少量であるピーク判定閾値以上の減少が生じたか否かを判定する。   If it is not determined that there is flicker (if it is determined that there is no flicker), the camera MPU 125 proceeds to step 111 and determines whether or not the peak of the contrast evaluation value has been detected. FIG. 4A shows the relationship between the position (horizontal axis) of the focus lens 104 and the contrast evaluation value (vertical axis) in contrast AF when no flicker occurs. Every time the focus lens 104 is driven from the contrast AF start position T1 by the AF pitch amount, a contrast evaluation value is acquired. The hatched circles indicate the position of the focus lens 104 at which the contrast evaluation value is acquired until the peak of the contrast evaluation value is detected (hereinafter referred to as the contrast evaluation value acquisition position). As shown in FIG. 4A, in the camera MPU 125, the change in the contrast evaluation value accompanying the driving of the focus lens 104 switches from an increase to a decrease, and a decrease equal to or more than a predetermined decrease amount, a peak determination threshold, occurs. judge.

ステップ111でピークが検出された場合は、カメラMPU125は、ステップ112において、フォーカスレンズ104をピークが検出されたコントラスト合焦位置に駆動するためのフォーカスレンズ104の駆動量を算出する。そして、カメラMPU125は、ステップ113にてレンズMPU117を通じてフォーカスレンズ104をコントラスト合焦位置に駆動する制御を行い、コントラストAF、さらにはAF処理を終了する。   If a peak is detected in step 111, the camera MPU 125 calculates the drive amount of the focus lens 104 for driving the focus lens 104 to the contrast in-focus position where the peak is detected in step 112. Then, the camera MPU 125 performs control to drive the focus lens 104 to the contrast in-focus position through the lens MPU 117 in step 113, and ends the contrast AF and further the AF processing.

一方、ステップ111でピークが検出されない場合は、カメラMPU125は、ステップ114に進み、後述する駆動量算出方法によりフォーカスレンズ104の駆動量を算出する。そして、カメラMPU125は、ステップ115にてレンズMPU117を通じてフォーカスレンズ104をステップ114で算出された駆動量だけ駆動する制御を行い、その後、ステップ101に戻る。   On the other hand, when a peak is not detected in step 111, the camera MPU 125 proceeds to step 114 and calculates the drive amount of the focus lens 104 by a drive amount calculation method described later. Then, the camera MPU 125 performs control to drive the focus lens 104 by the drive amount calculated in step 114 through the lens MPU 117 in step 115, and then returns to step 101.

ステップ110でフリッカ有りと判定された場合は、カメラMPU125は、コントラスト評価値のピークが検出されたか否かの判定(ステップ111)を行うことなく、ステップ114にて後述する駆動量算出方法でフォーカスレンズ104の駆動量を算出する。そして、カメラMPU125は、ステップ115にてレンズMPU117を通じてフォーカスレンズ104をステップ114で算出された駆動量だけ駆動する制御を行い、その後、ステップ101に戻る。   If it is determined in step 110 that there is flicker, the camera MPU 125 does not determine whether or not the peak of the contrast evaluation value is detected (step 111), and focuses on the driving amount calculation method described later in step 114. The driving amount of the lens 104 is calculated. Then, the camera MPU 125 performs control to drive the focus lens 104 by the drive amount calculated in step 114 through the lens MPU 117 in step 115, and then returns to step 101.

ここで、フリッカ有りと判定された場合にコントラスト評価値のピークが検出されたか否かの判定を行わない理由について説明する。図4(b)には、フリッカが発生している場合のコントラストAFにおけるフォーカスレンズ104の位置(横軸)とコントラスト評価値(縦軸)との関係とを示す。フォーカスレンズ104がコントラストAF開始位置T1からAFピッチ量だけ駆動されるごとにコントラスト評価値が取得される。ハッチングした丸は、図4(a)にも示したコントラスト評価値取得位置を示す。   Here, the reason why the determination as to whether or not the peak of the contrast evaluation value is detected when it is determined that there is flicker will be described. FIG. 4B shows the relationship between the position (horizontal axis) of the focus lens 104 and the contrast evaluation value (vertical axis) in the contrast AF when flicker is generated. Every time the focus lens 104 is driven from the contrast AF start position T1 by the AF pitch amount, a contrast evaluation value is acquired. The hatched circles indicate the contrast evaluation value acquisition positions shown in FIG. 4A.

一般に、コントラスト評価値は、被写体の明暗差であるコントラストが高いほど大きくなる。また、被写体は高輝度であるほどコントラストが高く、コントラスト評価値も大きくなる。このため、被写体のコントラストや輝度に応じてフォーカスレンズ104の駆動量(ピッチ量)に対するコントラスト評価値の変化量が異なる。   In general, the contrast evaluation value increases as the contrast, which is the contrast between the subject and the subject, increases. Also, the higher the luminance of the subject, the higher the contrast, and the higher the contrast evaluation value. Therefore, the amount of change in the contrast evaluation value with respect to the amount of driving (pitch amount) of the focus lens 104 differs according to the contrast and the luminance of the subject.

フリッカが発生している場合は画像信号の輝度が周期的に変化するため、フォーカスレンズ104の駆動に伴って得られるコントラスト評価値には、撮像系の焦点状態に対応する本来の評価値成分の変化だけでなく、フリッカによる周期的変化成分も含まれる。このような場合、図4(b)に示すように、真のコントラスト合焦位置T4よりも手前の位置T6において、増加から減少に転じたコントラスト評価値の減少量がピーク判定閾値以上となり、ピークが検出されたと誤判定される。この結果、コントラスト合焦位置として、真のコントラスト合焦位置T4とは異なる偽のコントラスト合焦位置T5が検出される。つまり、フォーカスレンズ104が偽のコントラスト合焦位置T5に駆動されても、撮像系の合焦状態は得られない。   Since the brightness of the image signal periodically changes when flicker occurs, the contrast evaluation value obtained as the focus lens 104 is driven includes the original evaluation value component corresponding to the focus state of the imaging system. Not only the change but also the periodically changing component due to the flicker is included. In such a case, as shown in FIG. 4B, at the position T6 before the true contrast in-focus position T4, the decrease amount of the contrast evaluation value which has turned from an increase to a decrease becomes equal to or higher than the peak determination threshold. Is falsely determined to have been detected. As a result, a false contrast in-focus position T5 different from the true contrast in-focus position T4 is detected as the contrast in-focus position. That is, even if the focus lens 104 is driven to the false contrast in-focus position T5, the in-focus state of the imaging system can not be obtained.

本実施例では、このような偽のコントラスト合焦位置の検出に基づくコントラストAFを回避するために、フリッカが発生している状態ではコントラスト評価値のピーク検出を行わない。つまり、コントラストAFを行わずに、ステップ103での位相差焦点検出により得られた検出デフォーカス量に基づく撮像面位相差AFを行う。撮像面位相差AFでは撮像素子122の1回の露光によって検出デフォーカス量を求めるため、フリッカの影響を受けにくいためである。   In this embodiment, in order to avoid the contrast AF based on the detection of such a false contrast in-focus position, the peak detection of the contrast evaluation value is not performed in the state where the flicker occurs. That is, the imaging plane phase difference AF based on the detected defocus amount obtained by the phase difference focus detection in step 103 is performed without performing the contrast AF. In the imaging plane phase difference AF, the detected defocus amount is obtained by one exposure of the imaging element 122, and therefore, it is difficult to be affected by the flicker.

次に、ステップ114でのフォーカスレンズ104の駆動量算出(設定)方法について説明する。フリッカが発生している状態ではコントラストAFによるフォーカスレンズ104の駆動は行わないが、本ステップでは前述したフォーカスレンズ104の駆動量としての第1のピッチ量または第2のピッチ量を設定する。   Next, a method of calculating (setting) the drive amount of the focus lens 104 at step 114 will be described. Although the focus lens 104 is not driven by the contrast AF in the state where the flicker occurs, in this step, the first pitch amount or the second pitch amount as the drive amount of the focus lens 104 described above is set.

図5には、第1および第2のピッチ量とコントラスト評価値との関係を示している。横軸はフォーカスレンズ104の位置を示し、縦軸はコントラスト評価値を示している。図5において、白丸を結んだグラフは、被写体が高コントラストで高輝度である場合のフォーカスレンズ104の駆動量に対するコントラスト評価値の変化の例を示している。黒丸を結んだグラフは、被写体が低コントラストで低輝度である場合のフォーカスレンズ104の駆動量に対するコントラスト評価値の変化の例を示している。白丸および黒丸は、コントラスト評価値を取得するフォーカスレンズ104の位置を示している。   FIG. 5 shows the relationship between the first and second pitch amounts and the contrast evaluation value. The horizontal axis indicates the position of the focus lens 104, and the vertical axis indicates the contrast evaluation value. In FIG. 5, a graph connecting white circles shows an example of a change in contrast evaluation value with respect to the driving amount of the focus lens 104 when the subject has high contrast and high luminance. The graph connecting the black circles shows an example of the change in the contrast evaluation value with respect to the drive amount of the focus lens 104 when the object has low contrast and low luminance. White circles and black circles indicate the position of the focus lens 104 for obtaining the contrast evaluation value.

被写体が高コントラストで高輝度である場合はフォーカスレンズ104の駆動量に対するコントラスト評価値の変化が大きいため、フォーカスレンズ104のAFピッチ量は第1のピッチ量R1より小さい第2のピッチ量R2に設定する。例えば、R2=1/2×R1とする。これにより、高精度にコントラスト評価値がピークとなる位置を検出することができる。   When the subject has high contrast and high luminance, the change in the contrast evaluation value with respect to the drive amount of the focus lens 104 is large, so the AF pitch amount of the focus lens 104 is set to a second pitch amount R2 smaller than the first pitch amount R1. Set For example, it is assumed that R2 = 1/2 × R1. Thereby, the position where the contrast evaluation value peaks can be detected with high precision.

一方、被写体が低コントラストで低輝度である場合は、フォーカスレンズ104の駆動量に対するコントラスト評価値の変化が小さい。このため、フォーカスレンズ104のAFピッチ量を狭い第2のピッチ量R2に設定すると、コントラスト評価値の明確な変化を検出することができない。一般に、コントラスト評価値は、被写体のコントラストに対応するコントラスト成分に加えて、信号のノイズや被写体の状況の変化によるノイズを含んでいる。このため、コントラスト評価値自体が低かったりフォーカスレンズ104の駆動ごとのコントラスト評価値の変化が小さかったりすると、上記ノイズの影響によってコントラスト評価値に被写体のコントラストに対応しない変化が生じるおそれがある。この結果、真のコントラスト合焦位置とは異なる方向にフォーカスレンズ104が駆動されてしまうおそれがある。したがって、被写体が低コントラストで低輝度である場合は、フォーカスレンズ104のAFピッチ量を第1のピッチ量R1として、正しいコントラスト評価値の変化を検出し易くする。   On the other hand, when the subject has low contrast and low luminance, the change in contrast evaluation value with respect to the driving amount of the focus lens 104 is small. Therefore, if the AF pitch amount of the focus lens 104 is set to the narrow second pitch amount R2, a clear change in the contrast evaluation value can not be detected. In general, the contrast evaluation value includes noise due to signal noise and change in the condition of the subject, in addition to the contrast component corresponding to the contrast of the subject. For this reason, when the contrast evaluation value itself is low or the change in the contrast evaluation value for each drive of the focus lens 104 is small, the contrast evaluation value may change due to the influence of the noise, which does not correspond to the subject's contrast. As a result, the focus lens 104 may be driven in a direction different from the true contrast in-focus position. Therefore, when the subject has low contrast and low luminance, the AF pitch amount of the focus lens 104 is set as the first pitch amount R1 to make it easy to detect a change in the correct contrast evaluation value.

また、本実施例では、カメラMPU125は、被写体が高コントラスト(かつ高輝度)であるか否かの判定を、前述したフリッカ判定のために測定される輝度と同様に、コントラスト評価範囲(およびその近傍)の部分画像信号を用いて行う。具体的には、部分画像信号を取得した部分画像範囲における隣接画素の出力差の和を被写体のコントラストとして計算する。そして、該被写体のコントラストが所定の閾値以上か否かによって被写体が高コントラストか否かを判定し、それぞれAFピッチ量を第2のピッチ量および第1のピッチ量に設定する。   Further, in the present embodiment, the camera MPU 125 determines whether the subject has high contrast (and high luminance), as in the case of the luminance measured for the above-described flicker determination. ) Using the partial image signal in the vicinity). Specifically, the sum of the output differences of adjacent pixels in the partial image range in which the partial image signal is acquired is calculated as the contrast of the subject. Then, it is determined whether or not the subject is high contrast depending on whether the contrast of the subject is equal to or more than a predetermined threshold value, and the AF pitch amount is set to the second pitch amount and the first pitch amount.

より簡単には、コントラスト評価範囲(およびその近傍)の部分画像信号の最大信号値が所定の閾値以上か否かによって被写体が高コントラストか否かを判定してもよい。さらに、事前にフォーカスレンズ104の位置が異なる複数回の撮像により複数の画像信号(撮像画像)が得られている場合は、それぞれの画像信号での隣接画素の出力差の2乗和が所定の閾値以上か否かによって被写体が高コントラストか否かを判定してもよい。   More simply, it may be determined whether the subject is in high contrast or not based on whether or not the maximum signal value of the partial image signal in the contrast evaluation range (and its vicinity) is equal to or more than a predetermined threshold. Furthermore, when a plurality of image signals (captured images) are obtained in advance by multiple times of imaging with different positions of the focus lens 104, the sum of squares of the output difference between adjacent pixels in each image signal is a predetermined value. Whether or not the subject is in high contrast may be determined based on whether it is equal to or greater than a threshold.

このようにして、ステップ114では、カメラMPU125は、フォーカスレンズ104の駆動量を第1のピッチ量または第2のピッチ量に設定する。   Thus, in step 114, the camera MPU 125 sets the drive amount of the focus lens 104 to the first pitch amount or the second pitch amount.

本実施例によれば、フリッカが発生している状態においてはコントラストAFを行わず、撮像面位相差AFのみを行うことにより、コントラストAFによる合焦状態(コントラス比評価値のピーク)の誤検出を防ぐことができる。これにより、フリッカの影響を低減して高速かつ高精度に合焦状態を得ることができる。   According to the present embodiment, the erroneous detection of the in-focus state (peak of the contrast ratio evaluation value) by the contrast AF is performed by performing only the imaging surface phase difference AF without performing the contrast AF in the state where the flicker is generated. You can prevent. As a result, it is possible to reduce the influence of flicker and obtain an in-focus state at high speed and with high accuracy.

次に、本発明の実施例2について説明する。実施例1ではフリッカが発生している場合はコントラストAFを行わないこととした。これに対して、本実施例ではフリッカが発生している場合でも所定の条件(後述する合焦近傍状態であること、位相差焦点検出の信頼度が低いこと又は検出デフォーカス量が小さいこと)を満たすときはコントラストAFを行う。   Next, a second embodiment of the present invention will be described. In the first embodiment, the contrast AF is not performed when the flicker occurs. On the other hand, in the present embodiment, even when flicker occurs, predetermined conditions (a state near the in-focus state described later, a low reliability of phase difference focus detection, or a small detection defocus amount) When the above condition is satisfied, contrast AF is performed.

本実施例におけるカメラ本体および交換レンズユニットの構成は実施例1と同じであり、実施例1と共通する構成要素には実施例1と同符号を付す。カメラMPU125が行うAF処理について説明する。図6は、AF処理の内容を示すフローチャートである。コンピュータであるカメラMPU125は、コンピュータプログラムであるフォーカス制御プログラムに従って本処理を実行する。また、カメラMPU125は、フリッカ検出手段、信頼度取得手段および制御手段として機能する。図6において、「S」はステップの略である。   The configurations of the camera body and the interchangeable lens unit in the present embodiment are the same as in Embodiment 1, and the components common to those in Embodiment 1 are assigned the same reference numerals as in Embodiment 1. The AF processing performed by the camera MPU 125 will be described. FIG. 6 is a flowchart showing the contents of the AF process. The camera MPU 125, which is a computer, executes this process according to a focus control program, which is a computer program. The camera MPU 125 also functions as a flicker detection unit, a reliability acquisition unit, and a control unit. In FIG. 6, "S" is an abbreviation of step.

ステップ201〜210までの処理は、実施例1(図1)におけるステップ101〜110の処理と同じであるため、その説明を省略する。   The processes of steps 201 to 210 are the same as the processes of steps 101 to 110 in the first embodiment (FIG. 1), and thus the description thereof will be omitted.

カメラMPU125は、カメラステップ210において、ステップ205でフリッカ有りと判定されたか否かを判定する。フリッカ有りと判定されなかった(フリッカ無しと判定された)場合には、カメラMPU125は、ステップ211に進み、実施例1のステップ111と同様に、コントラスト評価値のピークが検出されたか否かを判定する。   The camera MPU 125 determines in the camera step 210 whether or not it is determined in step 205 that there is flicker. If it is not determined that there is flicker (if it is determined that there is no flicker), the camera MPU 125 proceeds to step 211 and determines whether the peak of the contrast evaluation value is detected as in step 111 of the first embodiment. judge.

一方、ステップ210においてフリッカ有りと判定された場合は、カメラMPU125は、ステップ214に進み、コントラスト評価値を用いて、現在の焦点状態が合焦状態の近傍の状態(以下、合焦近傍状態という)か否かを判定する。カメラMPU125は、合焦近傍状態か否かの判定を、図7のフローチャートに示す処理により算出される合焦度(以下、PLという)を用いて行う。   On the other hand, if it is determined in step 210 that there is flicker, the camera MPU 125 proceeds to step 214 and uses the contrast evaluation value to determine that the current focus state is near the in-focus state (hereinafter referred to as in-focus state). It is determined whether or not The camera MPU 125 determines whether or not it is in the near in-focus state using the degree of focusing (hereinafter referred to as PL) calculated by the processing shown in the flowchart of FIG. 7.

図7において、ステップS501では、カメラMPU125は、コントラスト評価領域内の部分画像信号における輝度の最大値と最小値の差分(以下、MMPという)を取得する。このMMPを用いることで、合焦状態でなくてもコントラスト評価範囲内の被写体のコントラストをある程度推定することができる。   In FIG. 7, in step S501, the camera MPU 125 obtains the difference between the maximum value and the minimum value of luminance in the partial image signal in the contrast evaluation region (hereinafter referred to as MMP). By using this MMP, it is possible to estimate to some extent the contrast of the subject within the contrast evaluation range even if it is not in focus.

ステップS502では、カメラMPU125は、コントラスト評価値(以下、EVAともいう)を取得する。EVAは合焦状態に近づくほど大きくなる。そして、ステップ503では、カメラMPU125は、MMPとEVAとを用いて、以下の式によりPLを算出する。
PL(%)=(EVA/MMP)×100
PLは、被写体のコントラストに対する現在のコントラスト評価値の比率(%)を示す。このため、PLの大きさによって被写体像のぼけの度合い、言い換えれば被写体に対する撮像系の合焦度を求めることができる。そして、カメラMPU125は、合焦度が所定の閾値以上である場合に合焦近傍状態と判定する。
In step S502, the camera MPU 125 acquires a contrast evaluation value (hereinafter also referred to as EVA). EVA becomes larger as it gets closer to the in-focus state. Then, in step 503, the camera MPU 125 calculates PL according to the following equation using MMP and EVA.
PL (%) = (EVA / MMP) x 100
PL indicates the ratio (%) of the current contrast evaluation value to the contrast of the subject. Therefore, the degree of blurring of the subject image, that is, the degree of focusing of the imaging system with respect to the subject can be obtained according to the size of PL. Then, when the degree of focusing is equal to or higher than a predetermined threshold, the camera MPU 125 determines that the state is in the near in-focus state.

これとは異なる方法として、所定時間内におけるフォーカスレンズ104の所定の駆動量(AFピッチ量)に対するコントラスト評価値の増加量を評価値増加率(変化率)として算出し、該評価値増加率が所定の閾値以上である場合に合焦近傍状態と判定してもよい。   As a method different from this, an increase amount of the contrast evaluation value with respect to a predetermined drive amount (AF pitch amount) of the focus lens 104 within a predetermined time is calculated as an evaluation value increase rate (change rate). If it is equal to or higher than a predetermined threshold value, it may be determined as a near in-focus state.

ステップ214で合焦近傍状態と判定したカメラMPU125は、ステップ211に進み、コントラスト評価値のピークが検出されたか否かを判定する。一般に、合焦状態に近くなるにつれてコントラスト評価値の変化が大きくなるため、フリッカによる輝度変化の影響でコントラスト評価値に変動があってもピークの誤検出が生じ難くなる。このため、本実施例では、合焦近傍状態と判定された場合はピークの検出を行うこととにしている。ステップ211においてピークが検出された場合は、カメラMPU125は、ステップ212およびステップ213に進む。ステップ212およびステップ213の処理は、実施例1のステップ112およびステップ113の処理と同じであるので、その説明は省略する。   The camera MPU 125 that has determined in step 214 to be in the near in-focus state proceeds to step 211, and determines whether or not the peak of the contrast evaluation value is detected. In general, the change in the contrast evaluation value becomes larger as the focus state is approached, so that erroneous detection of the peak hardly occurs even if the contrast evaluation value changes due to the influence of the luminance change due to the flicker. For this reason, in the present embodiment, when it is determined to be in the near in-focus state, peak detection is performed. If a peak is detected in step 211, the camera MPU 125 proceeds to step 212 and step 213. The processes of step 212 and step 213 are the same as the processes of step 112 and step 113 of the first embodiment, and thus the description thereof is omitted.

一方、ステップ214で合焦近傍状態ではないと判定したカメラMPU125は、ステップ215に進む。ステップ215では、カメラMPU125は、ステップ204で得られた位相差焦点検出の信頼度が所定信頼度としてのデフォーカス使用可能閾値(第2の信頼度)より高いかどうか否かを判定する。デフォーカス使用可能閾値は、これよりも信頼度が高ければ、最終的な合焦状態はコントラストAFによって得ることを前提として、位相差焦点検出による検出デフォーカス量を補助的に使用することを許容できる信頼度である。このデフォーカス使用可能閾値は、実施例1のステップ106で説明した合焦可能閾値(本実施例ではステップ206で用いる)よりも低い信頼度である。   On the other hand, the camera MPU 125 that has determined in step 214 not to be in the near in-focus state proceeds to step 215. In step 215, the camera MPU 125 determines whether the reliability of phase difference focus detection obtained in step 204 is higher than the defocus usable threshold (second reliability) as the predetermined reliability. If the defocus enable threshold value is higher than this, it is permitted to use the detected defocus amount by phase difference focus detection as an aid, assuming that the final focus state is obtained by the contrast AF. It is the degree of reliability that can be done. This defocus usable threshold is lower in reliability than the focusable threshold described in step 106 of the first embodiment (in this embodiment, used in step 206).

ステップ215で信頼度がデフォーカス使用可能閾値より低いと場合は、カメラMPU125は、ステップ211に進み、コントラスト評価値のピークが検出されたか否かを判定する。これは、位相差焦点検出の信頼度が低い場合は合焦状態の近くかどうかを判定できないので、コントラスト評価値のピーク検出を行い、合焦不能となることを可能な限り回避するためである。   If it is determined in step 215 that the reliability is lower than the defocus available threshold value, the camera MPU 125 proceeds to step 211 and determines whether a peak of the contrast evaluation value is detected. This is because, when the reliability of phase difference focus detection is low, it can not be determined whether or not it is close to the in-focus state, and therefore peak detection of the contrast evaluation value is performed to avoid as much as possible non-focusability. .

ステップ215で信頼度がデフォーカス使用可能閾値より高い場合は、カメラMPU125は、ステップ216に進み、ステップ203で得られた検出デフォーカス量が所定デフォーカス量以上(又は所定デフォーカス量より大きい)か否かを判定する。検出デフォーカス量が所定デフォーカス量より小さい場合は、カメラMPU125は、ステップ211に進み、コントラスト評価値のピークが検出されたか否かを判定する。これは、検出デフォーカス量が小さい状態は合焦状態に近いと判定できるため、ピーク検出を行っても問題がないためである。   If the reliability is higher than the defocus usable threshold value in step 215, the camera MPU 125 proceeds to step 216 and the detected defocus amount obtained in step 203 is equal to or larger than the predetermined defocus amount (or larger than the predetermined defocus amount). It is determined whether or not. If the detected defocus amount is smaller than the predetermined defocus amount, the camera MPU 125 proceeds to step 211 and determines whether the peak of the contrast evaluation value is detected. This is because it can be determined that the state in which the detected defocus amount is small is close to the in-focus state, and therefore there is no problem in performing peak detection.

ステップ216で検出デフォーカス量が所定デフォーカス量以上である場合は、カメラMPU125は、ステップ211でコントラスト評価値のピークが検出されたか否かの判断は行うことなく、ステップ217に進む。   If it is determined in step 216 that the detected defocus amount is equal to or greater than the predetermined defocus amount, the camera MPU 125 proceeds to step 217 without determining whether or not the peak of the contrast evaluation value is detected in step 211.

ステップ217では、カメラMPU125は、ステップ203で得られた検出デフォーカス量に対応したフォーカスレンズ104の位相差合焦駆動量を算出する。そして、カメラMPU125は、該位相差合焦駆動量よりも所定駆動量少ない駆動量を算出する。この所定駆動量は、次回以降のルーチンで行われることになるコントラスト焦点検出においてフォーカスレンズ104を駆動しながらコントラスト評価値のピークまで取得するのに十分手前にフォーカスレンズ104が位置するように設定される。カメラMPU125は、所定駆動量を、デフォーカス量が大きいほど大きくなるように変更してもよい。   At step 217, the camera MPU 125 calculates the phase difference focusing drive amount of the focus lens 104 corresponding to the detected defocus amount obtained at step 203. Then, the camera MPU 125 calculates a drive amount smaller by a predetermined drive amount than the phase difference focusing drive amount. The predetermined drive amount is set so that the focus lens 104 is positioned sufficiently in front of the peak of the contrast evaluation value while driving the focus lens 104 in contrast focus detection to be performed in the subsequent and subsequent routines. Ru. The camera MPU 125 may change the predetermined drive amount so as to increase as the defocus amount increases.

そして、次のステップ218において、カメラMPU125は、ステップ217で算出した駆動量だけフォーカスレンズ104を駆動するよう制御する。この後、カメラMPU125は、ステップ101に戻る。   Then, in the next step 218, the camera MPU 125 controls the focus lens 104 to be driven by the drive amount calculated in step 217. Thereafter, the camera MPU 125 returns to step 101.

なお、本実施例において、フリッカが発生している状態でも所定の条件を満たすことでコントラスト評価値のピーク検出(ステップ211)を行うようにしたが、この際、ピーク判定閾値を、フリッカが発生していない場合よりも大きくすることが望ましい。これにより、フリッカの影響でコントラスト評価値の変動があっても、誤ったピーク検出を回避することが可能である。このことについて図8を用いて説明する。   In the present embodiment, the peak detection (step 211) of the contrast evaluation value is performed by satisfying a predetermined condition even in the state where flicker is occurring, but at this time, the peak judgment threshold is used as flicker. It is desirable to make it larger than when not doing it. This makes it possible to avoid erroneous peak detection even if the contrast evaluation value fluctuates due to the influence of flicker. This will be described with reference to FIG.

図8には、フリッカが発生している場合のコントラストAFにおけるフォーカスレンズ104の位置(横軸)とコントラスト評価値(縦軸)との関係とを示しており、図4(b)に比べてピーク判定閾値を大きくしている。フォーカスレンズ104がコントラストAF開始位置T1からAFピッチ量だけ駆動されるごとにコントラスト評価値が取得される。ハッチングした丸はコントラスト評価値取得位置を示す。   FIG. 8 shows the relationship between the position (horizontal axis) of the focus lens 104 and the contrast evaluation value (vertical axis) in contrast AF in the case where flicker is occurring, as compared with FIG. 4B. The peak determination threshold is increased. Every time the focus lens 104 is driven from the contrast AF start position T1 by the AF pitch amount, a contrast evaluation value is acquired. The hatched circles indicate the positions for obtaining the contrast evaluation value.

図8でも、図4(b)と同様に、真のコントラスト合焦位置T4よりも手前の位置T6で、それまで増加していたコントラスト評価値が減少に転じているが、その減少量はピーク判定閾値より小さい。このため、フォーカスレンズ104の駆動が継続され、真のコントラスト合焦位置T4を越えた位置T7にてピーク判定閾値以上のコントラスト評価値の減少が生じるため、該コントラスト評価値のピークが検出される。これにより、フリッカの影響による誤ったピーク検出を回避することができる。   In FIG. 8 as well as FIG. 4 (b), the contrast evaluation value which has been increasing up to that point is turned to decrease at a position T6 before the true contrast in-focus position T4, but the amount of decrease is a peak It is smaller than the judgment threshold. Therefore, the drive of the focus lens 104 is continued, and a decrease in the contrast evaluation value above the peak determination threshold occurs at the position T7 beyond the true contrast in-focus position T4, so that the peak of the contrast evaluation value is detected. . This makes it possible to avoid false peak detection due to the influence of flicker.

また、フリッカが発生している場合に、位相差焦点検出の信頼度に関する閾値をフリッカが発生していない場合とは変更してもよい。このことについて、図9を用いて説明する。図9(a)には、フリッカが発生していない場合における位相差焦点検出の信頼度に関する閾値である合焦可能閾値およびデフォーカス使用可能閾値を示している。図9(b)には、フリッカが発生している場合における合焦可能閾値およびデフォーカス使用可能閾値を示している。フリッカが発生している場合はコントラストAFによって正しい合焦状態が得られない可能性が高い。このため、図9(b)に示すように合焦可能閾値およびデフォーカス使用可能閾値をそれぞれ、図9(a)に示すフリッカが発生していない場合よりも低く設定することで、撮像面位相差AFが行われ易くすることができる。   In addition, when flicker occurs, the threshold value regarding the reliability of phase difference focus detection may be changed from the case where flicker does not occur. This will be described with reference to FIG. FIG. 9A shows a focusable threshold value and a defocus available threshold value, which are thresholds relating to the reliability of phase difference focus detection when no flicker occurs. FIG. 9B shows the focusable threshold value and the defocus available threshold value in the case where the flicker occurs. If flicker is occurring, there is a high possibility that the correct AF state can not be obtained by the contrast AF. Therefore, as shown in FIG. 9 (b), the focusable threshold and the defocus available threshold are set lower than in the case where the flicker shown in FIG. 9 (a) is not generated, respectively. The phase difference AF can be facilitated.

本実施例によれば、フリッカが発生している場合においてそのときの焦点状態、位相差焦点検出の信頼度およびデフォーカス量に関する所定の条件を満たすときに限りコントラストAFを行い、それ以外の場合は撮像面位相差AFを行う。合焦近傍状態ではないときにコントラストAFを行わないことで、フリッカの影響による合焦状態(コントラスト評価値のピーク)の誤検出を防止することができる。また、位相差焦点検出の信頼度がデフォーカス使用可能閾値より低い場合はコントラストAFを行うことで、合焦不能となるのを回避することができる。さらに、デフォーカス量が所定デフォーカス量より小さい場合はコントラストAFを許容することで、高速で合焦状態を得ることができる。以上により、精度と速度を両立したAF処理を行うことができる。   According to this embodiment, contrast AF is performed only when predetermined conditions regarding the focus state, the reliability of phase difference focus detection, and the defocus amount at the time of occurrence of flicker are satisfied, and in the other cases. Performs an imaging plane phase difference AF. By not performing the contrast AF when not in the in-focus state, it is possible to prevent erroneous detection of the in-focus state (peak of the contrast evaluation value) due to the influence of flicker. In addition, when the reliability of the phase difference focus detection is lower than the defocus available threshold value, performing the contrast AF can prevent the focusing failure. Furthermore, when the defocus amount is smaller than the predetermined defocus amount, the in-focus state can be obtained at high speed by permitting the contrast AF. As described above, it is possible to perform AF processing in which accuracy and speed are compatible.

なお、上記実施例では、被写体を照らす光源のフリッカを原因とした被写体の周期的な輝度変化を検出する場合について説明したが、それ以外の原因で被写体に周期的な輝度変化が生じている場合に上記実施例で説明したAF処理を適用してもよい。   In the above embodiment, the periodic luminance change of the subject caused by the flicker of the light source illuminating the subject is detected. However, the periodic luminance change occurs in the subject due to any other cause. The AF processing described in the above embodiment may be applied to

また、上記実施例では、フォーカス素子としてのフォーカスレンズ104を光軸方向に駆動して焦点調節を行う場合について説明したが、撮像素子122をフォーカス素子として光軸方向に駆動する(移動させる)ことで焦点調節を行ってもよい。   In the above embodiment, the focus adjustment is performed by driving the focus lens 104 as the focus element in the optical axis direction. However, the imaging element 122 is driven (moved) as the focus element in the optical axis direction. You may adjust the focus with

また、上記実施例では、レンズ交換タイプのカメラ本体(撮像素子を有する光学機器)120に設けられたカメラMPU125が位相差およびコントラストAFを行う場合について説明した。しかし、光学系を有する光学機器としての交換レンズユニット100に、位相差およびコントラストAFを行うための第1および第2の焦点検出手段、輝度変化検出手段、信頼度取得手段および制御手段を設けてもよい。また、レンズ一体型のカメラ(光学系および撮像素子を有する光学機器)に、第1および第2の焦点検出手段、輝度変化検出手段、信頼度取得手段および制御手段を設けてもよい。
(その他の実施例)
本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサーがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。
In the above embodiment, the case where the camera MPU 125 provided in the lens exchange type camera body (optical apparatus having an imaging device) 120 performs phase difference and contrast AF has been described. However, the interchangeable lens unit 100 as an optical apparatus having an optical system is provided with first and second focus detection means for performing phase difference and contrast AF, luminance change detection means, reliability acquisition means, and control means. It is also good. Further, the first and second focus detection means, the luminance change detection means, the reliability acquisition means, and the control means may be provided in a lens-integrated camera (optical apparatus having an optical system and an imaging device).
(Other embodiments)
The present invention supplies a program that implements one or more functions of the above-described embodiments to a system or apparatus via a network or storage medium, and one or more processors in a computer of the system or apparatus read and execute the program. Can also be realized. It can also be implemented by a circuit (eg, an ASIC) that implements one or more functions.

以上説明した各実施例は代表的な例にすぎず、本発明の実施に際しては、各実施例に対して種々の変形や変更が可能である。   The embodiments described above are only representative examples, and various modifications and changes can be made to the embodiments when the present invention is implemented.

100 撮像光学系
122 撮像素子
125 カメラMPU
129 撮像面位相差焦点検出部
130 コントラスト焦点検出部
100 imaging optical system 122 imaging device 125 camera MPU
129 Imaging plane phase difference focus detection unit 130 Contrast focus detection unit

Claims (10)

光学系により形成された被写体像を撮像素子により光電変換する撮像系において移動可能なフォーカス素子の駆動を制御するフォーカス制御装置であって、
前記撮像素子の出力を用いて生成された一対の像信号の位相差からデフォーカス量を算出する位相差焦点検出を行う第1の焦点検出手段と、
前記フォーカス素子の駆動に伴い、前記撮像素子の出力を用いて前記被写体像のコントラストに対応するコントラスト評価値を生成する第2の焦点検出手段と、
被写体の周期的な輝度変化を検出する輝度変化検出手段と、
前記デフォーカス量に基づいて前記フォーカス素子の駆動を制御する位相差フォーカス制御および前記コントラスト評価値を用いて前記フォーカス素子の駆動を制御するコントラストフォーカス制御を行う制御手段とを有し、
該制御手段は、前記輝度変化が検出された場合は、
光学系の焦点状態、前記位相差焦点検出の信頼度および前記デフォーカス量のうち少なくとも1つに関する所定の条件を満たすときに前記コントラストフォーカス制御を行い、該条件を満たさないときは前記位相差フォーカス制御を行うことを特徴とするフォーカス制御装置。
A focus control device that controls driving of a movable focus element in an imaging system that photoelectrically converts an object image formed by an optical system by an imaging device, comprising:
A first focus detection means for performing phase difference focus detection calculating the phase difference or La Defense focus of a pair of image signals generated using the output of the image sensor,
A second focus detection unit configured to generate a contrast evaluation value corresponding to the contrast of the subject image using the output of the imaging device as the focusing device is driven;
Luminance change detection means for detecting a periodic luminance change of an object;
Control means for performing phase difference focus control for controlling the drive of the focus element based on the defocus amount and contrast focus control for controlling the drive of the focus element using the contrast evaluation value;
When the change in luminance is detected, the control means
Focus state before Symbol optical system, the performs the contrast focus control when a predetermined condition is satisfied for at least one of the reliability and the defocus amount of the phase difference focus detection, the position when not satisfied the conditions A focus control apparatus characterized by performing phase difference focus control.
前記所定の条件は、焦点状態が所定の合焦近傍状態にあることであることを特徴とする請求項1に記載のフォーカス制御装置。 Wherein the predetermined condition is focal condition focus control device according to claim 1, characterized in that it is in a predetermined focus near state. 前記制御手段は、前記合焦近傍状態にあるか否かを、前記撮像素子の出力から生成された画像信号の最大値と最小値の差分と前記コントラスト評価値との比率または前記フォーカス素子の駆動に伴う前記コントラスト評価値の変化率を用いて判定することを特徴とする請求項2に記載のフォーカス制御装置。 Said control means, before whether the Kigoase near state, a ratio or the focus element of the difference between the contrast evaluation value of the maximum value and the minimum value of the image signal generated from the output of the image sensor The focus control device according to claim 2, wherein the determination is made using a change rate of the contrast evaluation value accompanying driving. 前記所定の条件は、前記信頼度が所定信頼度より低いことであることを特徴とする請求項1に記載のフォーカス制御装置。   The focus control device according to claim 1, wherein the predetermined condition is that the reliability is lower than a predetermined reliability. 前記制御手段は、前記輝度変化が検出された場合に前記所定信頼度を前記輝度変化が検出されていない場合よりも低くすることを特徴とする請求項4に記載のフォーカス制御装置。   5. The focus control apparatus according to claim 4, wherein the control unit makes the predetermined reliability lower than that in the case where the change in luminance is not detected when the change in luminance is detected. 前記所定の条件は、前記デフォーカス量が所定デフォーカス量より小さいことであることを特徴とする請求項1に記載のフォーカス制御装置。 The focus control device according to claim 1, wherein the predetermined condition is that the defocus amount is smaller than a predetermined defocus amount. 前記制御手段は、
前記フォーカス素子の駆動に伴う前記コントラスト評価値の変化が増加から減少に転じ、該減少の量が所定減少量より大きいことによって前記コントラスト評価値のピークを検出し、
前記所定の条件を満たすときに行う前記コントラストフォーカス制御において、前記輝度変化が検出された場合に前記所定減少量を前記輝度変化が検出されていない場合よりも大きくすることを特徴とする請求項1から6のいずれか一項に記載のフォーカス制御装置。
The control means
The peak of the contrast evaluation value is detected by the change of the contrast evaluation value from the increase to the decrease with the driving of the focusing element and the amount of the decrease being larger than the predetermined decrease amount;
In the contrast focus control performed when the predetermined condition is satisfied, when the change in luminance is detected, the predetermined amount of decrease is made larger than when the change in luminance is not detected. The focus control device according to any one of 6.
前記輝度変化検出手段は、前記撮像素子からの出力を用いて生成された画像信号から前記輝度変化を検出することを特徴とする請求項1から7のいずれか一項に記載のフォーカス制御装置。   The focus control apparatus according to any one of claims 1 to 7, wherein the luminance change detection unit detects the luminance change from an image signal generated using an output from the imaging device. 光学系により形成された被写体像を撮像素子により光電変換する撮像系において移動可能なフォーカス素子の駆動を制御するフォーカス制御方法であって、
前記撮像素子の出力を用いて生成された一対の像信号の位相差からデフォーカス量を算出する位相差焦点検出を行うステップと、
前記フォーカス素子の駆動に伴い、前記撮像素子の出力を用いて前記被写体像のコントラストに対応するコントラスト評価値を生成するステップと、
被写体の周期的な輝度変化を検出するステップと、
前記デフォーカス量に基づいて前記フォーカス素子の駆動を制御する位相差フォーカス制御および前記コントラスト評価値を用いて前記フォーカス素子の駆動を制御するコントラストフォーカス制御を行う制御ステップとを有し、
該制御ステップにおいて、前記輝度変化が検出された場合は、
光学系の焦点状態、前記位相差焦点検出の信頼度および前記デフォーカス量のうち少なくとも1つに関する所定の条件を満たすときに前記コントラストフォーカス制御を行い、該条件を満たさないときは前記位相差フォーカス制御を行うことを特徴とするフォーカス制御方法。
A focus control method for controlling driving of a movable focus element in an imaging system that photoelectrically converts an object image formed by an optical system by an imaging device, comprising:
And performing phase difference focus detection calculating the phase difference or La Defense focus of a pair of image signals were generated using the output of the image sensor,
Generating a contrast evaluation value corresponding to the contrast of the subject image using the output of the imaging device as the focusing device is driven;
Detecting a periodic luminance change of the subject;
It has a phase difference focus control for controlling the drive of the focus element based on the defocus amount, and a control step for performing the contrast focus control for controlling the drive of the focus element using the contrast evaluation value,
In the control step, when the change in luminance is detected,
Focus state before Symbol optical system, the performs the contrast focus control when a predetermined condition is satisfied for at least one of the reliability and the defocus amount of the phase difference focus detection, the position when not satisfied the conditions A focus control method characterized by performing phase difference focus control.
光学機器のコンピュータに、光学系により形成された被写体像を撮像素子により光電変換する撮像系において移動可能なフォーカス素子の駆動を制御させるコンピュータプログラムとしてのフォーカス制御プログラムであって、
前記コンピュータに、
前記撮像素子の出力を用いて生成された一対の像信号の位相差からデフォーカス量を算出する位相差焦点検出を行わせ、
前記フォーカス素子の駆動に伴い、前記撮像素子の出力を用いて前記被写体像のコントラストに対応するコントラスト評価値を生成させ、
被写体の周期的な輝度変化を検出させ、
前記デフォーカス量に基づいて前記フォーカス素子の駆動を制御する位相差フォーカス制御および前記コントラスト評価値を用いて前記フォーカス素子の駆動を制御するコントラストフォーカス制御を行う制御処理を行わせ、
前記輝度変化が検出された場合は、前記制御処理において、前記コンピュータに、
光学系の焦点状態、前記位相差焦点検出の信頼度および前記デフォーカス量のうち少なくとも1つに関する所定の条件を満たすときに前記コントラストフォーカス制御を行わせ、該条件を満たさないときは前記位相差フォーカス制御を行わせることを特徴とするフォーカス制御プログラム。
A focus control program as a computer program that causes a computer of an optical apparatus to control driving of a movable focus element in an imaging system that photoelectrically converts an object image formed by the optical system by an imaging device,
On the computer
To perform the phase difference focus detection calculating the phase difference or La Defense focus of a pair of image signals generated using the output of the image sensor,
With the drive of the focusing element, the output of the imaging element is used to generate a contrast evaluation value corresponding to the contrast of the subject image,
Detect periodic changes in luminance of the subject,
A control process is performed to perform phase difference focus control for controlling the drive of the focus element based on the defocus amount and contrast focus control for controlling the drive of the focus element using the contrast evaluation value.
When the change in luminance is detected, the control processing includes:
Focus state before Symbol optical system, to perform the contrast focus control when a predetermined condition is satisfied for at least one of the reliability and the defocus amount of the phase difference focus detection, the when not satisfied the conditions A focus control program characterized by performing phase difference focus control.
JP2014254270A 2014-12-16 2014-12-16 Focus control apparatus, focus control method and focus control program Active JP6501512B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014254270A JP6501512B2 (en) 2014-12-16 2014-12-16 Focus control apparatus, focus control method and focus control program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014254270A JP6501512B2 (en) 2014-12-16 2014-12-16 Focus control apparatus, focus control method and focus control program

Publications (2)

Publication Number Publication Date
JP2016114836A JP2016114836A (en) 2016-06-23
JP6501512B2 true JP6501512B2 (en) 2019-04-17

Family

ID=56141752

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014254270A Active JP6501512B2 (en) 2014-12-16 2014-12-16 Focus control apparatus, focus control method and focus control program

Country Status (1)

Country Link
JP (1) JP6501512B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPWO2018189829A1 (en) * 2017-04-12 2019-08-08 三菱電機株式会社 Imaging apparatus and AF control method
CN114567725B (en) * 2019-10-17 2024-03-05 电装波动株式会社 Image pickup apparatus having event camera

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000155256A (en) * 1998-11-19 2000-06-06 Olympus Optical Co Ltd Interchangeable photographing lens device, camera body and camera system
JP2003114377A (en) * 2001-10-05 2003-04-18 Nikon Gijutsu Kobo:Kk Camera
JP2009103800A (en) * 2007-10-22 2009-05-14 Sony Corp Automatic focusing device and method, and program
JP5535080B2 (en) * 2008-10-30 2014-07-02 パナソニック株式会社 Camera system
JP5183565B2 (en) * 2009-05-11 2013-04-17 キヤノン株式会社 Imaging device
JP2012168382A (en) * 2011-02-15 2012-09-06 Nikon Corp Imaging apparatus and program
JP5776210B2 (en) * 2011-02-17 2015-09-09 株式会社ニコン Focus adjustment device and imaging device
CN104797967B (en) * 2012-11-22 2017-05-24 富士胶片株式会社 Image pick-up device and focus control method
JP5821934B2 (en) * 2013-11-26 2015-11-24 株式会社ニコン Focus detection device, camera body, and camera

Also Published As

Publication number Publication date
JP2016114836A (en) 2016-06-23

Similar Documents

Publication Publication Date Title
JP5322783B2 (en) IMAGING DEVICE AND CONTROL METHOD OF IMAGING DEVICE
JP5895270B2 (en) Imaging device
JP5618712B2 (en) Automatic focusing device and imaging device
US9781330B2 (en) Focus detection apparatus and control method for focus detection apparatus
JP6154081B2 (en) Imaging device, imaging device body, and lens barrel
JP7289621B2 (en) Control device, imaging device, control method, and program
US10187564B2 (en) Focus adjustment apparatus, imaging apparatus, focus adjustment method, and recording medium storing a focus adjustment program thereon
JP6014452B2 (en) FOCUS DETECTION DEVICE, LENS DEVICE HAVING THE SAME, AND IMAGING DEVICE
JP2012234152A (en) Imaging apparatus and control method thereof
JP2011053379A (en) Imaging apparatus and control method thereof
JP5963552B2 (en) Imaging device
JP6381434B2 (en) FOCUS CONTROL DEVICE, OPTICAL DEVICE, AND FOCUS CONTROL METHOD
JP2015055635A (en) Imaging device and control method of the same
JP2015152749A (en) Imaging device and control method of the same
JP6501512B2 (en) Focus control apparatus, focus control method and focus control program
JP2013113857A (en) Imaging device, and control method therefor
JP6501536B2 (en) Imaging device, control method therefor, program, storage medium
US11924542B2 (en) Accuracy estimation apparatus, image capturing apparatus, accuracy estimation method, control method, and storage medium
US9924089B2 (en) Image capturing apparatus, method of displaying image, and storage medium storing program
JP2018010245A (en) Signal processor and control method therefor
JP7023673B2 (en) Focus control device, focus control method, and image pickup device
JP2016099432A (en) Focus detection device, and method, program and storage medium
JP2010072559A (en) Imaging apparatus and object area extracting method
JP6768372B2 (en) Imaging device, its control method, and program
JP6191131B2 (en) Imaging device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20171207

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20180614

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20180731

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20180927

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20190319

R151 Written notification of patent or utility model registration

Ref document number: 6501512

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151