JP2016194665A - Focus detection device, optical instrument, focus detection program - Google Patents
Focus detection device, optical instrument, focus detection program Download PDFInfo
- Publication number
- JP2016194665A JP2016194665A JP2015075598A JP2015075598A JP2016194665A JP 2016194665 A JP2016194665 A JP 2016194665A JP 2015075598 A JP2015075598 A JP 2015075598A JP 2015075598 A JP2015075598 A JP 2015075598A JP 2016194665 A JP2016194665 A JP 2016194665A
- Authority
- JP
- Japan
- Prior art keywords
- amount
- focus detection
- detection
- area
- image
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Landscapes
- Studio Devices (AREA)
- Focusing (AREA)
- Automatic Focus Adjustment (AREA)
Abstract
Description
本発明は、デジタルカメラ等の光学機器において位相差検出方式によるオートフォーカス(位相差AF)のための焦点検出を行う焦点検出技術に関する。 The present invention relates to a focus detection technique for performing focus detection for autofocus (phase difference AF) by a phase difference detection method in an optical apparatus such as a digital camera.
位相差AFは、被写体から撮影光学系に入射した光を分割して一対の被写体像を形成し、該一対の被写体像を受光センサにより光電変換して得られた一対の像信号の位相差からデフォーカス量を求め、該デフォーカス量を用いてフォーカス制御を行うAF方式である。また、このような位相差AFとして、撮影画像を取得するための撮像を行う撮像素子を受光センサとして用いる、いわゆる撮像面位相差AFがある。撮像面位相差AFでは、撮像素子に設けられたそれぞれマイクロレンズを有する複数の画素により一対の被写体像を形成し、これらを光電変換して一対の像信号を得る。 Phase difference AF divides the light incident on the photographing optical system from the subject to form a pair of subject images, and from the phase difference between the pair of image signals obtained by photoelectrically converting the pair of subject images by the light receiving sensor. This is an AF method in which a defocus amount is obtained and focus control is performed using the defocus amount. In addition, as such phase difference AF, there is so-called imaging plane phase difference AF in which an imaging element that performs imaging for acquiring a captured image is used as a light receiving sensor. In the imaging surface phase difference AF, a pair of subject images are formed by a plurality of pixels each having a microlens provided in the imaging device, and these are photoelectrically converted to obtain a pair of image signals.
これら位相差AFでは、図13(a),(b)に示すように撮像画面内のAF領域に互いに距離が異なる複数の被写体が含まれる場合、すなわち被写体の遠近競合が生じている場合に、近側の被写体と遠側の被写体のいずれにも合焦せずにAFが完了することがある。特許文献1には、AF領域での位相差検出により被写体の遠近競合があると判定した場合に、そのAF領域を含むように複数の小AF領域を新設し、該小AF領域ごとに再度位相差検出を行うことで、遠近競合による不完全なAFを回避する方法が開示されている。 In these phase difference AFs, as shown in FIGS. 13A and 13B, when a plurality of subjects having different distances are included in the AF area in the imaging screen, that is, when subject perspective conflicts occur, AF may be completed without focusing on either the near subject or the far subject. In Patent Document 1, when it is determined that there is a subject's perspective conflict by detecting the phase difference in the AF area, a plurality of small AF areas are newly added so as to include the AF area, and each small AF area is positioned again. A method for avoiding incomplete AF due to perspective conflict by performing phase difference detection is disclosed.
しかしながら、特許文献1にて開示された方法のように位相差検出の結果から遠近競合を判定するごとに新たな小AF領域を設定し直して再度位相差を検出するのでは、AFが完了するまでに要する時間が長くなる。また、小AF領域を新設して再度位相差を検出しても、小AF領域の位置や大きさによっては必ずしも遠近競合を回避できるとは限らない。さらに、もとのAF領域よりも小さい小AF領域の設定によって、動きのある被写体に対する位相差AFの追従ができなくなる可能性もある。 However, AF is completed when a new small AF area is set again and the phase difference is detected again every time a distance conflict is determined from the phase difference detection result as in the method disclosed in Patent Document 1. It takes longer time to complete. Further, even if a small AF area is newly established and a phase difference is detected again, it is not always possible to avoid distance conflict depending on the position and size of the small AF area. Furthermore, there is a possibility that the phase difference AF cannot be tracked with respect to a moving subject by setting a small AF area smaller than the original AF area.
本発明は、被写体の遠近競合が生じても高速かつ良好な位相差検出方式での焦点検出を行うことができるようにした焦点検出装置およびこれを備えた光学機器等を提供する。 The present invention provides a focus detection apparatus capable of performing focus detection by a high-speed and good phase difference detection method even if subject collision occurs, and an optical apparatus equipped with the focus detection apparatus.
本発明の一側面としての焦点検出装置は、撮影光学系により形成された被写体像を撮像する撮像素子のうち焦点検出領域から得られる一対の像信号の位相差および該位相差に基づく撮影光学系のデフォーカス量のうち一方である検出量を演算する。該焦点検出装置は、焦点検出領域内に複数の第1の領域を設け、該第1の領域ごとに検出量を演算する第1の演算手段と、複数の第1の領域から基準領域を選択し、該基準領域の検出量を基準検出量として設定する基準設定手段と、複数の第1の領域のうち基準検出量に対する差が所定閾値より小さい第1の領域を第2の領域として基準領域を含めて複数選択し、該複数の第2の領域の検出量を用いて焦点検出領域の検出量を演算する第2の演算手段とを有することを特徴とする。 A focus detection apparatus according to an aspect of the present invention includes a phase difference between a pair of image signals obtained from a focus detection region of an image sensor that captures a subject image formed by a shooting optical system, and a shooting optical system based on the phase difference. The detected amount which is one of the defocus amounts is calculated. The focus detection apparatus includes a plurality of first areas in a focus detection area, a first calculation unit that calculates a detection amount for each first area, and a reference area selected from the plurality of first areas A reference setting unit that sets the detection amount of the reference region as a reference detection amount, and a first region in which a difference from the reference detection amount is smaller than a predetermined threshold among the plurality of first regions as a second region And a second calculation means for calculating the detection amount of the focus detection region using the detection amounts of the plurality of second regions.
なお、上記焦点検出装置と、該焦点検出装置により得られた検出量を用いてフォーカス制御を行う制御手段とを有する光学機器も、本発明の他の一側面を構成する。 Note that an optical apparatus including the focus detection device and a control unit that performs focus control using the detection amount obtained by the focus detection device also constitutes another aspect of the present invention.
また、本発明の他の一側面としての焦点検出プログラムは、撮影光学系により形成された被写体像を撮像する撮像素子のうち焦点検出領域から得られる一対の像信号の位相差および該位相差に基づく撮影光学系のデフォーカス量のうち一方である検出量を演算する焦点検出処理をコンピュータに実行させるコンピュータプログラムである。そして、焦点検出処理は、焦点検出領域内に複数の第1の領域を設け、該第1の領域ごとに検出量を演算する処理と、複数の第1の領域から基準領域を選択し、該基準領域の検出量を基準検出量として設定する処理と、複数の第1の領域のうち基準検出量に対する差が所定閾値より小さい第1の領域を第2の領域として基準領域を含めて複数選択する処理と、複数の第2の領域の検出量を用いて焦点検出領域の検出量を演算する処理とを有することを特徴とする。 In addition, a focus detection program according to another aspect of the present invention includes a phase difference between a pair of image signals obtained from a focus detection region of an imaging element that captures a subject image formed by a photographing optical system, and the phase difference. It is a computer program for causing a computer to execute a focus detection process for calculating a detection amount which is one of the defocus amounts of a photographing optical system based thereon. The focus detection process includes providing a plurality of first areas in the focus detection area, calculating a detection amount for each first area, selecting a reference area from the plurality of first areas, A process of setting the detection amount of the reference area as the reference detection amount, and a plurality of first areas including a reference area including a reference area, the first area having a difference from the reference detection amount smaller than a predetermined threshold is selected. And processing for calculating the detection amount of the focus detection region using the detection amounts of the plurality of second regions.
本発明によれば、位相差検出方式において、被写体の遠近競合が生じても高速かつ良好な焦点検出を行うことができる。 According to the present invention, in the phase difference detection method, high-speed and good focus detection can be performed even when subject perspective conflict occurs.
以下、本発明の実施例について図面を参照しながら説明する。 Embodiments of the present invention will be described below with reference to the drawings.
図1には、本発明の実施例1である光学機器としてのレンズ交換型撮像装置(以下、単にカメラという)20の構成を示している。カメラ20には、交換レンズ10が取り外し可能に装着される。カメラ20と交換レンズ10によりカメラシステムが構成される。 FIG. 1 shows the configuration of a lens-interchangeable image pickup apparatus (hereinafter simply referred to as a camera) 20 as an optical apparatus that is Embodiment 1 of the present invention. The interchangeable lens 10 is detachably attached to the camera 20. The camera 20 and the interchangeable lens 10 constitute a camera system.
まず、交換レンズ10の構成について説明する。交換レンズ10には、固定レンズ101、絞り102およびフォーカスレンズ103を含む撮影光学系が収容されている。絞り102は、レンズ制御部106により制御される絞り駆動部104により駆動され、後述する撮像素子201への入射光量を制御する。フォーカスレンズ103は、レンズ制御部106により制御されるフォーカスレンズ駆動部105により駆動され、フォーカスレンズ103を撮影光学系の光軸方向に移動させる。 First, the configuration of the interchangeable lens 10 will be described. The interchangeable lens 10 houses a photographic optical system including a fixed lens 101, a diaphragm 102, and a focus lens 103. The diaphragm 102 is driven by a diaphragm driving unit 104 controlled by the lens control unit 106, and controls the amount of light incident on the image sensor 201 described later. The focus lens 103 is driven by a focus lens driving unit 105 controlled by the lens control unit 106, and moves the focus lens 103 in the optical axis direction of the photographing optical system.
レンズ操作部107は、AF(オートフォーカス)モードとMF(マニュアルフォーカス)モードの切り替え、撮影距離範囲の設定および防振(像振れ補正)のオン/オフ設定等、ユーザが交換レンズ10に関する各種設定を行うためのスイッチ等の操作部材を含む。レンズ操作部107が操作されると、その操作に応じた操作信号がレンズ制御部106に入力され、レンズ制御部106が該操作信号に応じた制御を行う。 The lens operation unit 107 allows the user to perform various settings related to the interchangeable lens 10 such as switching between AF (autofocus) mode and MF (manual focus) mode, setting of a shooting distance range, and on / off setting of image stabilization (image blur correction). An operation member such as a switch for performing the operation is included. When the lens operation unit 107 is operated, an operation signal corresponding to the operation is input to the lens control unit 106, and the lens control unit 106 performs control according to the operation signal.
レンズ制御部106は、マイクロコンピュータにより構成され、後述するカメラ制御部212から受信した制御命令に応じて絞り駆動部104やフォーカスレンズ駆動部105を制御し、また、交換レンズ10の各種情報をカメラ制御部212に送信する。 The lens control unit 106 is configured by a microcomputer, and controls the aperture driving unit 104 and the focus lens driving unit 105 in accordance with a control command received from a camera control unit 212 (to be described later). It transmits to the control part 212.
次に、カメラ20の構成について説明する。撮像素子201は、CCDセンサやCMOSセンサにより構成されている。被写体から撮影光学系を通ってカメラ20内に入射した光は撮像素子201の受光面上に被写体像を形成する。撮像素子201は、被写体像を受光面上に配列された複数の画素のそれぞれに設けられたフォトダイオードにより光電変換(撮像)して電荷を蓄積する。各フォトダイオードに蓄積された電荷は、カメラ制御部212の指令に応じてタイミングジェネレータ215が出力するタイミング信号ごとに電圧信号として読み出される。 Next, the configuration of the camera 20 will be described. The image sensor 201 is constituted by a CCD sensor or a CMOS sensor. Light incident on the camera 20 from the subject through the photographing optical system forms a subject image on the light receiving surface of the image sensor 201. The image sensor 201 photoelectrically converts (images) a subject image by a photodiode provided in each of a plurality of pixels arranged on the light receiving surface, and accumulates electric charges. The electric charge accumulated in each photodiode is read as a voltage signal for each timing signal output from the timing generator 215 in accordance with an instruction from the camera control unit 212.
本実施例で用いられる撮像素子201の各画素は、2つ(一対)のフォトダイオードA,Bとこれら一対のフォトダイオードA,Bに対して設けられた1つのマイクロレンズとより構成されている。各画素は、入射する光をマイクロレンズで分割して一対のフォトダイオードA,B上に一対の光学像を形成し、該一対のフォーダイオードA,Bから後述するAF用信号に用いられる一対の画素信号(A信号およびB信号)を出力する。また、一対のフォトダイオードA,Bの出力を加算することで、撮像用信号(A+B信号)を得ることができる。 Each pixel of the image sensor 201 used in this embodiment is composed of two (a pair) of photodiodes A and B and one microlens provided for the pair of photodiodes A and B. . Each pixel divides incident light by a microlens to form a pair of optical images on the pair of photodiodes A and B, and the pair of photodiodes A and B uses a pair of AF signals to be described later. Pixel signals (A signal and B signal) are output. Further, by adding the outputs of the pair of photodiodes A and B, an imaging signal (A + B signal) can be obtained.
複数の画素から出力された複数のA信号と複数のB信号をそれぞれ合成することで、撮像面位相差検出方式によるAF(以下、撮像面位相差AFという)に用いられるAF用信号(言い換えれば、焦点検出用信号)としての一対の像信号が得られる。後述するAF信号処理部204は、該一対の像信号に対する相関演算を行って、これら一対の像信号のずれ量である位相差(以下、像ずれ量という)を算出し、さらに該像ずれ量から撮影光学系のデフォーカス量(およびデフォーカス方向)を算出する。 By combining a plurality of A signals and a plurality of B signals output from a plurality of pixels, respectively, an AF signal (in other words, an imaging surface phase difference AF) used for AF (hereinafter referred to as imaging surface phase difference AF) is used. A pair of image signals as a focus detection signal) is obtained. An AF signal processing unit 204 described later performs a correlation operation on the pair of image signals, calculates a phase difference (hereinafter referred to as an image shift amount) that is a shift amount of the pair of image signals, and further calculates the image shift amount. From this, the defocus amount (and defocus direction) of the photographing optical system is calculated.
図2(a)には撮像面位相差AFに対応していない画素構成を、図2(b)は撮像面位相差AFに対応した画素構成を示している。いずれの図においても、ベイヤー配列が用いられており、Rは赤のカラーフィルタを、Bは青のカラーフィルタを、Gr,Gbは緑のカラーフィルタを示している。撮像面位相差AFに対応する図2(b)に示す画素構成では、図2(a)に示した撮像面位相AFに非対応の画素構成における1画素(実線で囲んで示す)に相当する画素内に、図の水平方向に2分割された2つのフォトダイオードA,Bが設けられている。なお、図2(b)に示した画素の分割方法は例に過ぎず、図の垂直方向に分割したり、水平および垂直方向に2分割ずつ(計4分割)したりしてもよい。また、同じ撮像素子内において互いに異なる分割方法で分割された複数種類の画素が含まれてもよい。 2A shows a pixel configuration not corresponding to the imaging plane phase difference AF, and FIG. 2B shows a pixel configuration corresponding to the imaging plane phase difference AF. In any of the figures, a Bayer array is used, where R indicates a red color filter, B indicates a blue color filter, and Gr and Gb indicate green color filters. The pixel configuration shown in FIG. 2B corresponding to the imaging plane phase difference AF corresponds to one pixel (enclosed by a solid line) in the pixel configuration not corresponding to the imaging plane phase AF shown in FIG. In the pixel, two photodiodes A and B divided into two in the horizontal direction in the figure are provided. Note that the pixel dividing method illustrated in FIG. 2B is merely an example, and the pixel may be divided in the vertical direction in the drawing, or may be divided into two in the horizontal and vertical directions (total of 4 divisions). In addition, a plurality of types of pixels that are divided by different division methods in the same image sensor may be included.
CDS/AGC/ADコンバータ202は、撮像素子201から読み出されたAF用信号および撮像用信号に対して、リセットノイズを除去するための相関二重サンプリング、ゲイン調節およびAD変換を行う。該コンバータ202は、これらの処理を行った撮像用信号およびAF用信号をそれぞれ、画像入力コントローラ203およびAF信号処理部204に出力する。 The CDS / AGC / AD converter 202 performs correlated double sampling, gain adjustment, and AD conversion for removing reset noise on the AF signal and the imaging signal read from the imaging element 201. The converter 202 outputs the imaging signal and the AF signal that have undergone these processes to the image input controller 203 and the AF signal processing unit 204, respectively.
画像入力コントローラ203は、コンバータ202から出力された撮像用信号をバス21を介してSDRAM209に画像信号として格納する。SDRAM209に格納された画像信号は、バス21を介して表示制御部205によって読み出され、表示部206に表示される。また、画像信号の記録を行う録画モードでは、SDRAM209に格納された画像信号は記録媒体制御部207によって半導体メモリ等の記録媒体208に記録される。 The image input controller 203 stores the imaging signal output from the converter 202 as an image signal in the SDRAM 209 via the bus 21. The image signal stored in the SDRAM 209 is read by the display control unit 205 via the bus 21 and displayed on the display unit 206. In the recording mode in which the image signal is recorded, the image signal stored in the SDRAM 209 is recorded on the recording medium 208 such as a semiconductor memory by the recording medium control unit 207.
ROM210には、カメラ制御部212が実行する制御プログラムや処理プログラムおよびこれらの実行に必要な各種データ等が格納されている。フラッシュROM211には、ユーザにより設定されたカメラ20の動作に関する各種設定情報等が格納されている。 The ROM 210 stores a control program and a processing program executed by the camera control unit 212 and various data necessary for the execution. The flash ROM 211 stores various setting information relating to the operation of the camera 20 set by the user.
焦点検出装置としてのAF信号処理部204は、コンバータ202から出力されたAF用信号である一対の像信号に対して相関演算を行い、これら一対の像信号の像ずれ量や信頼度を算出する。信頼度は、後述する2像一致度と相関変化量の急峻度を用いて算出される。また、AF信号処理部204は、撮像画面内で焦点検出およびAFを行う領域であるAF領域(焦点検出領域)の位置および大きさの設定を行う。AF信号処理部204は、AF領域で算出した像ずれ量(検出量)および信頼度の情報をカメラ制御部212に出力する。 An AF signal processing unit 204 as a focus detection device performs a correlation operation on a pair of image signals which are AF signals output from the converter 202, and calculates an image shift amount and reliability of the pair of image signals. . The reliability is calculated using two-image coincidence described later and the steepness of the correlation change amount. The AF signal processing unit 204 sets the position and size of an AF area (focus detection area) that is an area for performing focus detection and AF within the imaging screen. The AF signal processing unit 204 outputs information on the image shift amount (detection amount) and reliability calculated in the AF area to the camera control unit 212.
AF信号処理部204は、遠近競合判定部213を有する。遠近競合判定部213は、AF信号処理部204により設定されたAF領域に互いに距離が異なる複数の被写体が存在する遠近競合が生じている状態か否かを判定し、その判定結果に応じて像ずれ量の算出方法を変更する。これにより、遠近競合の影響を抑えた撮像面位相差AFを可能とする。 The AF signal processing unit 204 includes a perspective conflict determination unit 213. The perspective conflict determination unit 213 determines whether or not there is a perspective conflict in which a plurality of subjects having different distances exist in the AF area set by the AF signal processing unit 204, and an image is determined according to the determination result. Change the calculation method of the deviation amount. As a result, it is possible to perform imaging surface phase difference AF that suppresses the influence of perspective conflict.
カメラ制御部212は、AF信号処理部204および遠近競合判定部213が求めた像ずれ量、信頼度および交換レンズ10とカメラ20の状態を示す情報に基づいて、必要に応じてAF信号処理部204または遠近競合判定部213の設定を変更する。例えば、AF信号処理部204に対して像ずれ量が所定量以上である場合には相関演算を行う領域を広く設定したり、一対の像信号のコントラストに応じてバンドパスフィルタの種類を変更したりする。また、遠近競合判定部213に対して、カメラ20において設定されたAF領域の位置や交換レンズ10の絞り102の情報に応じて、遠近競合判定に用いる閾値を変更する。相関演算の詳細については後述する。 The camera control unit 212 performs an AF signal processing unit as necessary based on the information indicating the image shift amount, the reliability, and the state of the interchangeable lens 10 and the camera 20 obtained by the AF signal processing unit 204 and the perspective conflict determination unit 213. 204 or the setting of the perspective conflict determination unit 213 is changed. For example, when the image shift amount is greater than or equal to a predetermined amount with respect to the AF signal processing unit 204, the correlation calculation region is set wide, or the type of the bandpass filter is changed according to the contrast of the pair of image signals. Or Further, the threshold used for the perspective conflict determination is changed for the perspective conflict determination unit 213 according to the position of the AF area set in the camera 20 and the information of the aperture 102 of the interchangeable lens 10. Details of the correlation calculation will be described later.
なお、本実施例では撮像用信号およびAF用信号である一対の像信号の計3つの信号を撮像素子201から取得する。ただし、撮像素子201の負荷を考慮して、例えば撮像用信号と1つのAF用像信号の計2つの信号を取り出し、取り出した撮像用信号とAF用像信号の差分をもう1つのAF用像信号として用いてもよい。 In this embodiment, a total of three signals, that is, a pair of image signals that are imaging signals and AF signals, are acquired from the imaging element 201. However, considering the load on the image sensor 201, for example, a total of two signals, that is, an imaging signal and one AF image signal are extracted, and the difference between the extracted imaging signal and the AF image signal is calculated as another AF image. It may be used as a signal.
カメラ制御部212は、カメラ20内の各部と情報をやり取りしながらこれらを制御する。また、カメラ制御部212は、ユーザ操作に基づくカメラ操作部214からの入力に応じて、電源のON/OFF、各種設定の変更、撮像処理、AF処理、記録画像の再生処理等、ユーザ操作に対応する様々な処理を実行する。さらに、カメラ制御部212は、交換レンズ10(レンズ制御部106)に対する制御命令やカメラ20の情報をレンズ制御部106に送信したり、交換レンズ10の情報をレンズ制御部106から取得したりする。カメラ制御部212は、マイクロコンピュータにより構成され、ROM210に記憶されたコンピュータプログラムを実行することで、交換レンズ10を含むカメラシステム全体の制御を司る。 The camera control unit 212 controls these while exchanging information with each unit in the camera 20. In addition, the camera control unit 212 performs user operations such as power ON / OFF, change of various settings, imaging processing, AF processing, and recorded image reproduction processing in response to input from the camera operation unit 214 based on user operations. Various corresponding processes are executed. Furthermore, the camera control unit 212 transmits a control command for the interchangeable lens 10 (lens control unit 106) and information about the camera 20 to the lens control unit 106, and acquires information about the interchangeable lens 10 from the lens control unit 106. . The camera control unit 212 is configured by a microcomputer, and controls the entire camera system including the interchangeable lens 10 by executing a computer program stored in the ROM 210.
カメラ制御部212は、AF信号処理部204にて算出されたAF領域での像ずれ量を用いてデフォーカス量を算出し、該デフォーカス量に基づいてレンズ制御部106を通じてフォーカスレンズ103の駆動を制御する。ここにいう特定のAF領域は、ユーザがカメラ操作部214を通じて設定した位置を中央として配置される領域である。 The camera control unit 212 calculates a defocus amount using the image shift amount in the AF area calculated by the AF signal processing unit 204, and drives the focus lens 103 through the lens control unit 106 based on the defocus amount. To control. The specific AF area here is an area arranged with the position set by the user through the camera operation unit 214 as the center.
なお、本実施例ではユーザがカメラ操作部214を通じてAF領域を設定(配置)するが、カメラ20が撮像画面内から特定の被写体(例えば、人物の顔)を検出する機能を備えている場合にその検出結果に基づいてAF領域を設定するようにしてもよい。 In this embodiment, the user sets (places) the AF area through the camera operation unit 214, but the camera 20 has a function of detecting a specific subject (for example, a human face) from the imaging screen. The AF area may be set based on the detection result.
図13(a),(b)を用いて被写体の遠近競合について説明する。位相差AFでは、捉えている被写体に遠近競合が発生していると、近側の被写体と遠側の被写体のどちらにも合焦していない状態であるにもかかわらず、合焦した状態であると誤判定してAFを完了する場合がある。これは、相関演算を行う際に、近側と遠側の被写体の距離のどちらかに対応する相関量ではなく、それらの間の距離(中間距離)に対応する相関量が最も大きくなるためである。さらに、中間距離に対応する位置にフォーカスレンズが位置するとき、その中間距離よりも近側と遠側にそれぞれデフォーカス方向が異なる被写体が存在することによって相関量の均衡がとれてデフォーカス量が小さくなり、合焦状態と誤判定するためである。 The subject perspective conflict will be described with reference to FIGS. In phase difference AF, if there is a perspective conflict with the subject being captured, it is in focus even though neither the near subject nor the far subject is in focus. There is a case where AF is completed by erroneously determining that there is. This is because when performing a correlation calculation, the correlation amount corresponding to the distance (intermediate distance) between them is the largest, not the correlation amount corresponding to either the near-side or far-side subject distance. is there. Furthermore, when the focus lens is located at a position corresponding to the intermediate distance, there is a subject with different defocus directions on the near side and the far side from the intermediate distance, so that the correlation amount is balanced and the defocus amount is This is because it becomes smaller and erroneously determined to be in focus.
この問題を解決するために、本実施例では、AF領域内に互いに距離が異なる複数の被写体が存在する場合でも、撮像素子201におけるAF領域内の画素ラインごとに算出した像ずれ量の中から特定の1つの距離の被写体に対する像ずれ量のみを使用する。具体的には、遠近競合判定部213は、遠近競合が発生しているAF領域内で主被写体と判定できる1つの被写体を選択し、該選択被写体に対する像ずれ量のみを使用してデフォーカス量を算出し、AFを行う。これにより、従来であれば合焦状態と誤判定してぼけが生じていた主被写体に対して合焦状態を得ることができる。この遠近競合判定部213が行う処理(以下、遠近競合回避処理という)については後述する。 In order to solve this problem, in this embodiment, even when there are a plurality of subjects having different distances in the AF area, the image shift amount calculated from each image line in the AF area of the image sensor 201 is selected. Only the image shift amount for a subject at a specific distance is used. Specifically, the perspective conflict determination unit 213 selects one subject that can be determined as the main subject in the AF area where the perspective conflict has occurred, and uses only the image shift amount with respect to the selected subject to determine the defocus amount. Is calculated and AF is performed. As a result, it is possible to obtain a focused state for a main subject that has been erroneously determined as a focused state and has been blurred. The processing performed by the perspective conflict determination unit 213 (hereinafter referred to as perspective conflict avoidance processing) will be described later.
以下、カメラ20で行われる処理について説明する。カメラ制御部212は、コンピュータプログラムである撮像処理プログラムに従って以下の処理を行う。 Hereinafter, processing performed by the camera 20 will be described. The camera control unit 212 performs the following processing according to an imaging processing program that is a computer program.
図3のフローチャートには、撮像処理の手順を示している。Sはステップを意味する。 The flowchart of FIG. 3 shows the procedure of the imaging process. S means a step.
S301において、カメラ制御部212は、各種設定の初期化処理を行う。 In step S301, the camera control unit 212 performs initialization processing for various settings.
S302では、カメラ制御部212は、カメラ20の撮像モードが動画撮像モードか静止画撮像モードかを判定する。カメラ制御部212は、動画撮像モードである場合はS303に、静止画撮像モードである場合はS304に進む。 In S302, the camera control unit 212 determines whether the imaging mode of the camera 20 is the moving image imaging mode or the still image imaging mode. The camera control unit 212 proceeds to S303 when in the moving image capturing mode and proceeds to S304 when in the still image capturing mode.
S303では、カメラ制御部212は、動画撮像処理を行い、S305に進む。S304では、カメラ制御部212は、静止画撮像処理を行い、S305に進む。遠近競合回避処理は動画撮像モードと静止画撮像モードのいずれでも行うことは可能であるが、本実施例では静止画撮像モードで遠近競合回避処理を行う場合について説明する。本実施例では、動画撮像処理についての説明は省略する。 In S303, the camera control unit 212 performs a moving image capturing process, and the process proceeds to S305. In S304, the camera control unit 212 performs a still image capturing process, and proceeds to S305. Although the perspective conflict avoidance process can be performed in either the moving image capturing mode or the still image capturing mode, a case will be described in the present embodiment where the perspective conflict avoiding process is performed in the still image capturing mode. In this embodiment, the description of the moving image imaging process is omitted.
S305では、カメラ制御部212は、撮像処理が停止されたか否かを判定する。撮像処理が停止されたときとは、カメラ操作部214を通じてカメラ20の電源がオフされたときや、ユーザによる設定処理や、撮影画像を確認するための再生処理等、撮像処理以外の動作が行われたときである。撮像処理が停止されていない場合はS306に進み、停止された場合は撮像処理を終了する。 In step S305, the camera control unit 212 determines whether the imaging process has been stopped. When the imaging process is stopped, operations other than the imaging process are performed, such as when the power of the camera 20 is turned off through the camera operation unit 214, a setting process by a user, and a reproduction process for confirming a captured image. It is time when If the imaging process has not been stopped, the process proceeds to S306. If the imaging process has been stopped, the imaging process is terminated.
S306では、カメラ制御部212は、撮像モードが変更されたか否かを判定する。変更された場合は、カメラ制御部212はS301に戻り、初期化処理を行った上で変更された撮像モードでの撮像処理を行う。一方、撮像モードが変更されていない場合は、カメラ制御部212はS302に戻り、現在の撮像モードでの処理を継続して行う。 In S306, the camera control unit 212 determines whether or not the imaging mode has been changed. If changed, the camera control unit 212 returns to S301 and performs the imaging process in the changed imaging mode after performing the initialization process. On the other hand, if the imaging mode has not been changed, the camera control unit 212 returns to S302 and continues processing in the current imaging mode.
次に、図3におけるS304で行われる静止画撮像処理について、図4のフローチャートを用いて説明する。 Next, the still image capturing process performed in S304 in FIG. 3 will be described using the flowchart in FIG.
S401では、カメラ制御部212は、AF信号処理部204(遠近競合判定部213を含む)に焦点検出処理を行わせる。焦点検出処理は、撮像面位相差AFを行うためのデフォーカス量と信頼度の情報を取得する処理であり、その詳細については後述する。 In S401, the camera control unit 212 causes the AF signal processing unit 204 (including the perspective conflict determination unit 213) to perform focus detection processing. The focus detection process is a process of acquiring information on the defocus amount and reliability for performing the imaging plane phase difference AF, and details thereof will be described later.
次にS402では、カメラ制御部212は、カメラ操作部214からAF処理の開始指示(以下、AF指示という)が入力(オン)されたか否かを判定する。AF指示は、カメラ20に設けられたシャッターボタンが半押し操作された場合や、AFを実行させるAFONボタンが押された場合等にカメラ操作部214から出力される。カメラ制御部212は、AF指示が入力された場合はS403に進み、AF指示が入力されていない場合はS404に進む。 In step S <b> 402, the camera control unit 212 determines whether an AF process start instruction (hereinafter referred to as an AF instruction) is input (turned on) from the camera operation unit 214. The AF instruction is output from the camera operation unit 214 when a shutter button provided on the camera 20 is pressed halfway, or when an AFON button for executing AF is pressed. If the AF instruction is input, the camera control unit 212 proceeds to S403, and if the AF instruction is not input, the camera control unit 212 proceeds to S404.
S403では、カメラ制御部212は、AF処理を行う。このAF処理については後述する。 In S403, the camera control unit 212 performs AF processing. This AF processing will be described later.
S404では、カメラ制御部212は、カメラ操作部214から撮像処理の開始指示(以下、撮像指示という)が入力(オン)されたか否かを判定する。撮像指示はシャッターボタンが全押し操作さけた場合等にカメラ操作部214から出力される。カメラ制御部212は、撮像指示が入力された場合はS405に進み、撮像指示が入力されていない場合はS407に進む。 In step S <b> 404, the camera control unit 212 determines whether an imaging processing start instruction (hereinafter referred to as an imaging instruction) is input (turned on) from the camera operation unit 214. The imaging instruction is output from the camera operation unit 214 when the shutter button is pressed fully. The camera control unit 212 proceeds to S405 when an imaging instruction is input, and proceeds to S407 when an imaging instruction is not input.
S405では、カメラ制御部212は、S403でのAF処理によって現在、合焦停止状態にあるか否かを判定する。合焦停止状態とは、撮影光学系が合焦状態となってフォーカスレンズ103が停止した状態である。合焦停止状態でない場合は、カメラ制御部212はS403に進み、AF処理を開始または継続することで合焦状態を得る。合焦停止状態である場合は、カメラ制御部212はS406に進み、撮像処理を行い、記録媒体制御部207を介して記録媒体208に撮影画像(記録画像)を保存してS407に進む。 In S405, the camera control unit 212 determines whether or not the focus is currently stopped by the AF process in S403. The in-focus stop state is a state in which the focus lens 103 is stopped when the photographing optical system is in a focus state. If it is not in the focus stop state, the camera control unit 212 proceeds to S403, and obtains the focus state by starting or continuing the AF process. If the in-focus state is in effect, the camera control unit 212 proceeds to S406, performs an imaging process, stores the captured image (recorded image) in the recording medium 208 via the recording medium control unit 207, and proceeds to S407.
S407では、カメラ制御部212は、合焦停止状態を解除して静止画撮像処理を終了する。 In step S407, the camera control unit 212 releases the focus stop state and ends the still image capturing process.
次に、図5のフローチャートを用いて、図4のS401にてAF信号処理部204が行う焦点検出処理について説明する。AF信号処理部204は、マイクロコンピュータにより構成され、コンピュータプログラムとしての焦点検出プログラム(撮像処理プログラムの一部であってもよい)に従って焦点検出処理を行う。 Next, the focus detection process performed by the AF signal processing unit 204 in S401 of FIG. 4 will be described using the flowchart of FIG. The AF signal processing unit 204 is configured by a microcomputer, and performs focus detection processing according to a focus detection program (which may be a part of an imaging processing program) as a computer program.
まず、S501では、AF信号処理部204は、撮像画面(つまりは撮像素子201)上においてAFの対象となるAF領域(焦点検出領域)の設定を行う。AF領域の設定は、前述したようにユーザによるカメラ操作部214を通じた指示に基づいて又は特定の被写体の検出結果に基づいて行われる。 First, in S501, the AF signal processing unit 204 sets an AF area (focus detection area) to be an AF target on the imaging screen (that is, the imaging element 201). As described above, the AF area is set based on an instruction from the user through the camera operation unit 214 or based on a detection result of a specific subject.
次にS502では、AF信号処理部204は、撮像素子201におけるAF領域に含まれる複数の画素からAF用信号としての一対の像信号を取得する。 In step S <b> 502, the AF signal processing unit 204 acquires a pair of image signals as AF signals from a plurality of pixels included in the AF area of the image sensor 201.
次にS503では、AF信号処理部204は、取得した一対の像信号を1画素(1ビット)ずつ相対的にシフトさせながらこれら一対の像信号の相関量を算出する。相関量の算出は、AF領域内(焦点検出領域内)に設けた複数の画素ライン(第1の領域:以下、走査ラインという)のそれぞれにおいて後述するように行う。なお、この後のS504からS507までの処理も同様に走査ラインごとに行われる。 In step S503, the AF signal processing unit 204 calculates a correlation amount between the pair of image signals while relatively shifting the acquired pair of image signals by one pixel (1 bit). The calculation of the correlation amount is performed as described later in each of a plurality of pixel lines (first area: hereinafter referred to as scanning lines) provided in the AF area (in the focus detection area). The subsequent processing from S504 to S507 is similarly performed for each scanning line.
図14には、AF領域における走査ラインの例を示す。この例では、矩形のAF領域内に、水平方向に延びる9本の走査ライン1〜9が垂直方向に互いに隣接して並ぶように設けられている。なお、走査ラインの本数や延びる方向はこれに限らない。 FIG. 14 shows an example of scanning lines in the AF area. In this example, nine scanning lines 1 to 9 extending in the horizontal direction are provided in the rectangular AF area so as to be adjacent to each other in the vertical direction. The number of scanning lines and the extending direction are not limited to this.
次にS504では、AF信号処理部204は、S503で算出した走査ラインごとの相関量から相関変化量を求める。相関変化量の算出方法については、後述する。 In step S504, the AF signal processing unit 204 obtains a correlation change amount from the correlation amount for each scanning line calculated in step S503. A method of calculating the correlation change amount will be described later.
そして、S505では、AF信号処理部204は、S504で算出した相関変化量を用いて走査ラインごとの像ずれ量を算出する。像ずれ量の算出方法については後述する。 In step S505, the AF signal processing unit 204 calculates an image shift amount for each scanning line using the correlation change amount calculated in step S504. A method for calculating the image shift amount will be described later.
さらに、S506では、AF信号処理部204は、S505で算出された像ずれ量の信頼性の高さを表す信頼度を走査ラインごとに算出する。信頼度の算出方法については後述する。AF信号処理部204は、第1の演算手段および信頼度算出手段に相当する。 Further, in S506, the AF signal processing unit 204 calculates a reliability indicating the reliability of the image shift amount calculated in S505 for each scanning line. A method for calculating the reliability will be described later. The AF signal processing unit 204 corresponds to first calculation means and reliability calculation means.
次にS507では、遠近競合判定部213は、S505で算出された走査ラインごとの像ずれ量とS506で算出された走査ラインごとの信頼度とに基づいて、AF領域内のどの走査ラインの像ずれ量をデフォーカス量の算出に使用するかを決定する。ここでの処理である使用像ずれ量設定処理は、遠近競合の影響を抑えたAF領域の像ずれ量の算出に使用する像ずれ量を設定する処理であり、その詳細については後述する。遠近競合判定部213は、基準設定手段および第2の演算手段に相当する。 In step S507, the perspective conflict determination unit 213 determines which scan line image in the AF area based on the image shift amount for each scan line calculated in step S505 and the reliability for each scan line calculated in step S506. It is determined whether the shift amount is used for calculating the defocus amount. The used image shift amount setting process, which is a process here, is a process for setting the image shift amount used for calculating the image shift amount in the AF area in which the influence of perspective conflict is suppressed, and details thereof will be described later. The perspective conflict determination unit 213 corresponds to a reference setting unit and a second calculation unit.
次にS508では、AF信号処理部204は、S507で最終的に算出されたAF領域の像ずれ量を用いて該AF領域のデフォーカス量を算出し、焦点検出処理を終了する。 In step S508, the AF signal processing unit 204 calculates the defocus amount of the AF area using the image shift amount of the AF area finally calculated in step S507, and ends the focus detection process.
次に、焦点検出処理について詳細に説明する。図7には、焦点検出処理において撮像素子201の画素アレイ701上でのAF領域702の例を示している。AF領域702の両側のシフト領域703は、相関演算に必要な領域である。このため、AF域702とシフト領域703とを合わせた領域704が相関演算に必要な画素領域である。図中のp,q,s,tはそれぞれ、水平方向(x軸方向)での座標を表し、pとqはそれぞれ画素領域704の始点と終点のx座標を、sとtはそれぞれAF領域702の始点と終点のx座標を示している。 Next, the focus detection process will be described in detail. FIG. 7 shows an example of the AF area 702 on the pixel array 701 of the image sensor 201 in the focus detection process. Shift areas 703 on both sides of the AF area 702 are areas necessary for correlation calculation. Therefore, a region 704 obtained by combining the AF region 702 and the shift region 703 is a pixel region necessary for the correlation calculation. In the figure, p, q, s, and t represent the coordinates in the horizontal direction (x-axis direction), p and q represent the x-coordinates of the start and end points of the pixel area 704, and s and t represent the AF areas, respectively. The x coordinate of the start point and end point of 702 is shown.
図8は、図7に示したAF領域702に含まれる複数の画素から取得したAF用の一対の像信号の例を示す。実線801が一方の像信号Aであり、破線802が他方の像信号Bである。図8(a)はシフト前の像信号A,Bを示し、図8(b),(c)はそれぞれ、像信号A,Bを図8(a)の状態からプラス方向およびマイナス方向にシフトした状態を示している。一対の像信号A801,B802の相関量を算出する際には、像信号A801,B802の両方を矢印の方向に1ビットずつシフトする。 FIG. 8 shows an example of a pair of image signals for AF acquired from a plurality of pixels included in the AF area 702 shown in FIG. A solid line 801 is one image signal A, and a broken line 802 is the other image signal B. 8A shows the image signals A and B before the shift, and FIGS. 8B and 8C respectively shift the image signals A and B in the plus direction and the minus direction from the state of FIG. 8A. Shows the state. When calculating the correlation amount between the pair of image signals A801 and B802, both the image signals A801 and B802 are shifted by one bit in the direction of the arrow.
次に、相関量の算出方法について説明する。まず、図8(b),(c)に示すように像信号A801,B802をそれぞれ1ビットずつシフトして、像信号A801,B802の差の絶対値の和を算出する。シフト量をiとし、最小シフト量をp−sとし、最大シフト量をq−tとし、xをAF領域702の開始座標とし、yをAF領域702の終了座標とするとき、相関量CORは以下の式(1)によって算出することができる。 Next, a method for calculating the correlation amount will be described. First, as shown in FIGS. 8B and 8C, the image signals A801 and B802 are shifted by 1 bit, respectively, and the sum of the absolute values of the differences between the image signals A801 and B802 is calculated. When the shift amount is i, the minimum shift amount is p-s, the maximum shift amount is qt, x is the start coordinate of the AF area 702, and y is the end coordinate of the AF area 702, the correlation amount COR is It can be calculated by the following equation (1).
図9(a)には、シフト量と相関量CORとの関係の例を示している。横軸はシフト量を示し、縦軸は相関量CORを示す。シフト量とともに変化する相関量901における極値付近902,903のうち、より小さい相関量に対応するシフト量において一対の像信号A,Bの一致度が最も高くなる。 FIG. 9A shows an example of the relationship between the shift amount and the correlation amount COR. The horizontal axis indicates the shift amount, and the vertical axis indicates the correlation amount COR. Among the extreme values 902 and 903 in the correlation amount 901 that changes with the shift amount, the degree of coincidence between the pair of image signals A and B becomes the highest in the shift amount corresponding to the smaller correlation amount.
次に、相関変化量の算出方法について説明する。図9(a)に示した相関量901の波形における1シフトおきの相関量の差を相関変化量として算出する。シフト量をiとし、最小シフト量をp−sとし、最大シフト量をq−tとすると、相関変化量ΔCORは以下の式(2)によって算出することができる。 Next, a method for calculating the correlation change amount will be described. The difference in the correlation amount at every other shift in the waveform of the correlation amount 901 shown in FIG. 9A is calculated as the correlation change amount. When the shift amount is i, the minimum shift amount is ps, and the maximum shift amount is qt, the correlation change amount ΔCOR can be calculated by the following equation (2).
図10(a)には、シフト量と相関変化量ΔCORとの関係の例を示している。横軸はシフト量を示し、縦軸は相関変化量ΔCORを示す。シフト量とともに変化する相関変化量1001は、1002,1003の部分でプラスからマイナスになる。相関変化量が0となる状態をゼロクロスと呼び、一対の像信号A,Bの一致度が最も高くなる。したがって、ゼロクロスを与えるシフト量が像ずれ量となる。 FIG. 10A shows an example of the relationship between the shift amount and the correlation change amount ΔCOR. The horizontal axis indicates the shift amount, and the vertical axis indicates the correlation change amount ΔCOR. The correlation change amount 1001 that changes with the shift amount changes from plus to minus at the portions 1002 and 1003. A state in which the correlation change amount is 0 is called zero crossing, and the degree of coincidence between the pair of image signals A and B is the highest. Therefore, the shift amount giving the zero cross becomes the image shift amount.
図10(b)には、図10(a)中の1002で示した部分を拡大して示す。1004は相関変化量1001の一部分である。この図10(b)を用いて像ずれ量PRDの算出方法について説明する。 FIG. 10B is an enlarged view of a portion indicated by 1002 in FIG. Reference numeral 1004 denotes a part of the correlation change amount 1001. A method for calculating the image shift amount PRD will be described with reference to FIG.
ゼロクロスを与えるシフト量(k−1+α)は、整数部分β(=k−1)と小数部分αとに分けられる。小数部分αは、図中の三角形ABCと三角形ADEとの相似の関係から、以下の式(3)によって算出することができる。 The shift amount (k−1 + α) giving the zero cross is divided into an integer part β (= k−1) and a decimal part α. The decimal part α can be calculated by the following equation (3) from the similar relationship between the triangle ABC and the triangle ADE in the figure.
整数部分βは、図10(b)から以下の式(4)によって算出することができる。 The integer part β can be calculated from the following equation (4) from FIG.
β=k−1 (4)
そして、αとβの和から像ずれ量PRDを算出することができる。
β = k−1 (4)
Then, the image shift amount PRD can be calculated from the sum of α and β.
図10(a)に示したように相関変化量ΔCORのゼロクロスが複数存在する場合は、その付近での相関変化量ΔCORの変化の急峻性がより大きい方を第1のゼロクロスとする。この急峻性はAFの行い易さを示す指標であり、値が大きいほど精度良いAFを行い易い点であることを示す。急峻性maxderは、以下の式(5)によって算出することができる。 As shown in FIG. 10 (a), when there are a plurality of zero crossings of the correlation change amount ΔCOR, the one having the larger steepness of the change in the correlation change amount ΔCOR in the vicinity thereof is set as the first zero cross. This steepness is an index indicating the ease of AF, and the larger the value, the easier the AF is performed. The steepness maxder can be calculated by the following equation (5).
このように、本実施例では、相関変化量のゼロクロスが複数存在する場合は、その急峻性によって第1のゼロクロスを決定し、この第1のゼロクロスを与えるシフト量を像ずれ量とする。 Thus, in this embodiment, when there are a plurality of correlation change amount zero crosses, the first zero cross is determined by the steepness, and the shift amount giving the first zero cross is defined as the image shift amount.
次に、像ずれ量の信頼度の算出方法について説明する。像ずれ量の信頼度は、一対の像信号A,Bの一致度(以下、2像一致度という)fnclvlと上述した相関変化量の急峻性によって定義することができる。2像一致度は、像ずれ量の精度を表す指標であり、本実施例における相関演算手法ではその値が小さいほど精度が良いことを示す。 Next, a method for calculating the reliability of the image shift amount will be described. The reliability of the image shift amount can be defined by the matching degree (hereinafter, referred to as two-image matching degree) fnclvl of the pair of image signals A and B and the steepness of the correlation change amount described above. The degree of coincidence of two images is an index representing the accuracy of the image shift amount. In the correlation calculation method in this embodiment, the smaller the value, the better the accuracy.
図9(b)には、図9(a)中の902で示した部分を拡大したもので、904が相関量901の一部分である。2像一致度fnclvlは、図9(b)から分かるように、以下の式(6)によって算出することができる。 FIG. 9B is an enlarged view of the portion indicated by 902 in FIG. 9A, and 904 is a part of the correlation amount 901. As can be seen from FIG. 9B, the two-image coincidence degree fnclvl can be calculated by the following equation (6).
次に、図6のフローチャートを用いて、図5のS507で遠近競合判定部213が行う使用像ずれ量設定処理について説明する。 Next, the use image shift amount setting process performed by the perspective conflict determination unit 213 in S507 of FIG. 5 will be described using the flowchart of FIG.
S601では、遠近競合判定部213は、AF領域内で信頼度が所定値より高い走査ラインがないか否かを判定する。遠近競合判定部213は、そのような走査ラインがない場合はS602に進み、そのような走査ラインがある場合はS603に進む。ここでの信頼度に対する所定値としては、それよりも高ければ像ずれ量から算出されるデフォーカス量が信用できる又はデフォーカス方向だけは信用できるとみなせる値を設定するのが望ましい。 In step S601, the perspective conflict determination unit 213 determines whether or not there is a scan line having a reliability higher than a predetermined value in the AF area. The perspective conflict determination unit 213 proceeds to S602 when there is no such scan line, and proceeds to S603 when there is such a scan line. As the predetermined value for the reliability here, it is desirable to set a value that can be considered reliable if the defocus amount calculated from the image shift amount is higher than that, or only in the defocus direction.
S602では、遠近競合判定部213は、AF領域内の複数の走査ラインのそれぞれから算出された像ずれ量のすべてを平均した値を「使用像ずれ量」として決定し、本処理を終了する。AF領域内の走査ラインに信頼度の高いものがない場合、すなわちデフォーカス量やデフォーカス方向が信用できない場合には、そもそもそのデフォーカス量を用いてAFを行うことができない。このため、このAF領域で決定する像ずれ量はあまり意味をなさない可能性が高いため、本実施例では遠近競合回避のための走査ラインの選択を行わずにすべての走査ラインを用いる。 In step S <b> 602, the perspective conflict determination unit 213 determines a value obtained by averaging all the image shift amounts calculated from each of the plurality of scanning lines in the AF area as the “used image shift amount”, and ends this processing. If there is no highly reliable scanning line in the AF area, that is, if the defocus amount and the defocus direction are not reliable, AF cannot be performed using the defocus amount in the first place. For this reason, since there is a high possibility that the image shift amount determined in this AF area does not make much sense, in this embodiment, all scan lines are used without selecting scan lines for avoiding perspective conflict.
一方、S603では、遠近競合判定部213は、AF領域内の中央または中央により近い位置にあり、かつ信頼度が上記所定値(第1の信頼度)より高い走査ラインを基準走査ライン(基準領域)として選択する。 On the other hand, in step S <b> 603, the perspective conflict determination unit 213 selects a scan line that is located at the center of the AF area or at a position closer to the center and has a higher reliability than the predetermined value (first reliability) as a reference scan line (reference area). ) To select.
次にS604では、遠近競合判定部213は、S603で選択した基準走査ラインが複数存在するか否かを判定する。すなわち、S603において、信頼度が所定値より高く、AF領域内の中央からの距離が同じ複数の基準走査ラインを選択したか否かを判定する。遠近競合判定部213は、例えば図15(a),(b)に示すように選択した基準走査ラインが複数存在する場合はS605に進み、図15(c)に示すように選択した基準走査ラインが1つである場合はS606に進む。 In step S604, the perspective conflict determination unit 213 determines whether there are a plurality of reference scanning lines selected in step S603. That is, in S603, it is determined whether or not a plurality of reference scanning lines having a reliability higher than a predetermined value and the same distance from the center in the AF area are selected. For example, when there are a plurality of selected reference scan lines as shown in FIGS. 15A and 15B, the perspective conflict determination unit 213 proceeds to S605 and selects the selected reference scan line as shown in FIG. 15C. If there is one, the process proceeds to S606.
S605では、遠近競合判定部213は、変数Xに、選択した基準走査ラインで得られた像ずれ量の平均値を設定する。そして、S607に進む。一方、S606では、遠近競合判定部213は、変数Xに、選択した基準走査ラインで得られた像ずれ量を設定する。S605およびS606では、変数Xとして、遠近競合判定(または遠近競合処理)を行うための基準となる像ずれ量である基準像ずれ量(基準検出量)を設定する。すなわち、基準走査ラインが1つであればその基準走査ラインで得られた像ずれ量を基準像ずれ量(X)として設定し、基準走査ラインが複数であればそれら基準走査ラインで得られた像ずれ量の平均値を基準像ずれ量(X)として設定する。 In step S <b> 605, the perspective conflict determination unit 213 sets the average value of the image shift amounts obtained from the selected reference scanning line as the variable X. Then, the process proceeds to S607. On the other hand, in S <b> 606, the perspective conflict determination unit 213 sets the image displacement amount obtained by the selected reference scanning line as the variable X. In S605 and S606, as a variable X, a reference image shift amount (reference detection amount), which is a reference image shift amount for performing perspective conflict determination (or perspective conflict processing), is set. That is, if there is one reference scan line, the image shift amount obtained with the reference scan line is set as the reference image shift amount (X), and if there are a plurality of reference scan lines, the image is obtained with those reference scan lines. An average value of image shift amounts is set as a reference image shift amount (X).
本実施例では、ユーザがピントを合わせたい主被写体がAF領域の中央付近に存在する可能性が高いという前提で、AF領域の中央または所定の中央近傍範囲内(例えば中央から1走査ライン内)の走査ラインをS603で優先的に基準走査ラインとして選択する。 In this embodiment, on the assumption that the main subject that the user wants to focus on is likely to exist near the center of the AF area, it is within the center of the AF area or within a predetermined center vicinity (for example, within one scanning line from the center). Are preferentially selected as reference scanning lines in S603.
こうして遠近競合判定を行うための基準像ずれ量を設定した後、遠近競合判定部213は、S607からS617で遠近競合判定を行い、AF領域内での遠近競合を考慮した「使用像ずれ量」を算出する。 After setting the reference image shift amount for performing the perspective conflict determination in this manner, the perspective conflict determination unit 213 performs the perspective conflict determination from S607 to S617, and “use image shift amount” considering the perspective conflict in the AF area. Is calculated.
まず、S607では、遠近競合判定部213は、変数P,M,Nにそれぞれ、0,1,0の初期値を設定して、S608に進む。変数Pは像ずれ量の保持用変数であり、変数MはAF領域内の走査ラインの番号を示す変数である。変数NはAF領域内の使用像ずれ量の算出に用いる走査ライン数を保持するための変数である。 First, in S607, the perspective conflict determination unit 213 sets initial values of 0, 1, and 0 to the variables P, M, and N, respectively, and proceeds to S608. The variable P is an image shift amount holding variable, and the variable M is a variable indicating the number of the scanning line in the AF area. The variable N is a variable for holding the number of scanning lines used for calculating the used image shift amount in the AF area.
次にS608では、遠近競合判定部213は、像ずれ量差閾値(所定閾値)を設定する。遠近競合判定部213は、後述する遠近競合判定処理において基準像ずれ量と各走査ラインから得られる像ずれ量との差分を計算し、その差分の大小を判定するために像ずれ量差閾値を設定する。像ずれ量差閾値は、カメラ20のパラメータや交換レンズ10のパラメータに応じて設定する。像ずれ量差閾値の設定処理の詳細は後述する。 In step S <b> 608, the perspective conflict determination unit 213 sets an image shift amount difference threshold (predetermined threshold). A perspective conflict determination unit 213 calculates a difference between a reference image shift amount and an image shift amount obtained from each scanning line in a perspective conflict determination process described later, and sets an image shift amount difference threshold value to determine the magnitude of the difference. Set. The image shift amount difference threshold is set according to the parameters of the camera 20 and the parameters of the interchangeable lens 10. Details of the image deviation amount difference threshold setting process will be described later.
次にS609では、遠近競合判定部213は、変数Mがこの後の処理の対象となるAF領域内の走査ライン数以下であるか否かを判定し、変数Mが走査ライン数以下である場合はS610に進み、そうでない場合はS615に進む。ここでは、後述するループ処理で変数Mをカウントアップしていき、変数MがAF領域内の走査ライン数を上回ると全走査ラインに対する処理が完了したとしてS615に移行する。 In step S609, the perspective conflict determination unit 213 determines whether the variable M is equal to or less than the number of scanning lines in the AF area to be processed later. If the variable M is equal to or less than the number of scanning lines. Proceeds to S610, otherwise proceeds to S615. Here, the variable M is counted up in a loop process to be described later, and when the variable M exceeds the number of scanning lines in the AF area, the process for all the scanning lines is completed, and the process proceeds to S615.
S610では、遠近競合判定部213は、AF領域内のM番目の走査ラインから得られた像ずれ量と基準像ずれ量Xとの差分を算出し、その差分がS608で設定した像ずれ量差閾値以下(より小さい)か否かを判定する。遠近競合判定部213は、上記差分が像ずれ量差閾値以下であればS611に進み、閾値以下でない場合はS614に進む。 In step S610, the perspective conflict determination unit 213 calculates the difference between the image shift amount obtained from the Mth scanning line in the AF area and the reference image shift amount X, and the difference is the image shift amount difference set in step S608. It is determined whether or not it is below the threshold value (smaller). The perspective conflict determination unit 213 proceeds to S611 if the difference is equal to or less than the image shift amount difference threshold value, and proceeds to S614 if it is not equal to or less than the threshold value.
S611では、遠近競合判定部213は、M番目の走査ラインの信頼度が所定値(第2の信頼度)より高いか否かを判定する。ここでの所定値も、S601およびS603で用いた所定値と同じとする。ただし、この第2の所定値をS601およびS603で用いた第1の所定値と異ならせてもよい。 In S611, the perspective conflict determination unit 213 determines whether or not the reliability of the Mth scanning line is higher than a predetermined value (second reliability). The predetermined value here is also the same as the predetermined value used in S601 and S603. However, the second predetermined value may be different from the first predetermined value used in S601 and S603.
遠近競合判定部213は、上述したS610およびS611の処理によりM番目の走査ラインに遠近競合の影響があるか否かを判定している。すなわち、S610においてM番目の走査ラインの像ずれ量が基準像ずれ量Xに対して一致する又は近い(像ずれ量差閾値以下の差分しか持たない)か否かを判定する。M番目の走査ラインの像ずれ量が基準像ずれ量Xに一致する又は近ければ、そのM番目の走査ラインが、主被写体を捉えていると想定した基準走査ラインとほぼ同じ距離の被写体を捉えている可能性が高い。一方、M番目の走査ラインの像ずれ量が基準像ずれ量Xから遠ければ、そのM番目の走査ラインが、基準走査ラインが捉えている主被写体とは異なる距離の被写体を捉えている可能性が高い。そして、S611において、そもそもM番目の走査ラインの像ずれ量が信頼できるものであるか否かを判定するために信頼度を確認する。信頼度が所定値より高い、すなわちこの像ずれ量から算出されるデフォーカス量またはデフォーカス方向が信頼できれば、S610で基準像ずれ量に一致する又は近いM番目の走査ラインの像ずれ量を用いてAFを行える。 The perspective conflict determination unit 213 determines whether or not there is an effect of perspective conflict on the Mth scan line by the processing of S610 and S611 described above. That is, in S610, it is determined whether or not the image shift amount of the Mth scanning line matches or is close to the reference image shift amount X (has only a difference equal to or less than the image shift amount difference threshold). If the image shift amount of the M-th scan line matches or is close to the reference image shift amount X, the M-th scan line captures a subject that is approximately the same distance as the reference scan line that is assumed to capture the main subject. There is a high possibility. On the other hand, if the image shift amount of the Mth scan line is far from the reference image shift amount X, the Mth scan line may capture a subject at a different distance from the main subject captured by the reference scan line. Is expensive. In step S611, the reliability is checked in order to determine whether the image shift amount of the Mth scan line is reliable in the first place. If the reliability is higher than a predetermined value, that is, if the defocus amount or defocus direction calculated from this image shift amount is reliable, the image shift amount of the Mth scanning line that matches or is close to the reference image shift amount is used in S610. AF can be performed.
このように、遠近競合判定部213は、S610およびS611にてM番目の走査ラインの像ずれ量が遠近競合の影響を受けておらず、AFに使用することができると判定できた場合はS612に進む。像ずれ量がAFに使用することができると判定された走査ラインを、以下、使用走査ライン(第2の領域)という。一方、M番目の走査ラインの像ずれ量が遠近競合の影響を受けており、AFに使用できないと判定した場合はS614に進む。 As described above, when the perspective conflict determination unit 213 determines in S610 and S611 that the image shift amount of the M-th scanning line is not affected by the perspective conflict and can be used for AF, the distance conflict determination unit 213 determines in S612. Proceed to Hereinafter, the scanning line in which it is determined that the image shift amount can be used for AF is referred to as a used scanning line (second region). On the other hand, if it is determined that the image shift amount of the Mth scanning line is affected by perspective conflict and cannot be used for AF, the process proceeds to S614.
次にS612では、遠近競合判定部213は、変数Pに、変数PとM番目の走査ライン(使用走査ライン)の像ずれ量とを加算した値を代入する。変数Pは使用走査ラインの像ずれ量の和を示す。 In step S <b> 612, the perspective conflict determination unit 213 substitutes a value obtained by adding the variable P and the image shift amount of the Mth scanning line (used scanning line) to the variable P. A variable P represents the sum of image shift amounts of the used scanning lines.
次にS613では、遠近競合判定部213は、変数Nに、変数Nに1を加えた値を代入する。S612で遠近競合の影響を受けていない像ずれ量を変数Pに保持しつつ、後述する処理で正規化を行うために、遠近競合の影響を受けていない使用走査ラインの番号をS614で変数Mに保持しておく。 Next, in S613, the perspective conflict determination unit 213 substitutes a value obtained by adding 1 to the variable N to the variable N. In order to perform normalization in the process described later while holding the image shift amount that is not affected by the perspective conflict in S612, the number of the used scan line that is not affected by the perspective conflict is set to the variable M in S614. To keep.
次にS614では、遠近競合判定部213は、AF領域の走査ラインの番号Mをカウントアップする。そして、S609に戻る。こうして、S609で変数MがAF領域内の走査ライン数に達するまで、S610からS614の処理が繰り返され、全ての走査ラインに対して像ずれ量が遠近競合の影響を受けていないか否かの判定を行うようにループ処理をする。これにより、使用走査ラインが、基準走査ラインを含めて複数選択されるか若しくは基準走査ラインの1つのみが選択される。 In step S614, the perspective conflict determination unit 213 counts up the number M of scanning lines in the AF area. Then, the process returns to S609. In this way, the processing from S610 to S614 is repeated until the variable M reaches the number of scanning lines in the AF area in S609, and whether or not the image shift amount is affected by the perspective conflict for all the scanning lines. A loop process is performed to make the determination. As a result, a plurality of use scan lines including the reference scan line are selected, or only one of the reference scan lines is selected.
S609からS615に進むと、遠近競合判定部213は、S612で保持した使用走査ラインの像ずれ量の和PをS613で使用走査ラインの数Nで除することで正規化を行い、この正規化された像ずれ量を使用像ずれ量として設定して、本処理を終了する。 When the process proceeds from S609 to S615, the perspective conflict determination unit 213 performs normalization by dividing the sum P of image shift amounts of the used scanning lines held in S612 by the number N of used scanning lines in S613. The image shift amount thus set is set as the use image shift amount, and this processing is terminated.
図16に、使用像ずれ量設定処理において設定された使用ずれ量を用いてAF領域における遠近競合を回避する例を示す。図16には、現在のフォーカスレンズ103が合焦している位置よりも近側の被写体1(合焦状態を得たい主被写体)と遠側の被写体2とが撮像画面内に設定されたAF領域に含まれている状態を示している。また、図16の例ではAF領域内に9本の走査ライン1〜9が存在し、これら走査ラインのそれぞれに対して図中に記載した信頼度と像ずれ量とを得られたものとする。なお、図16中の信頼度が「OK」とはその像ずれ量を用いて算出されたデフォーカス量を信用できると判定されたことを意味し、「NG」とはそうでないことを意味する。また、像ずれ量について、+は至近側への像ずれ量を示し、−は無限遠側への像ずれ量を表す。さらに、像ずれ量差閾値は±0.3画素とする。 FIG. 16 shows an example of avoiding perspective conflicts in the AF area using the used shift amount set in the used image shift amount setting process. FIG. 16 shows an AF in which the subject 1 (the main subject from which the focus state is desired to be obtained) and the subject 2 on the far side are set in the imaging screen from the position where the current focus lens 103 is in focus. The state included in the area is shown. In the example of FIG. 16, nine scan lines 1 to 9 exist in the AF area, and the reliability and the image shift amount described in the figure are obtained for each of these scan lines. . Note that the reliability in FIG. 16 is “OK” means that the defocus amount calculated using the image shift amount is determined to be reliable, and “NG” means not. . Regarding the image shift amount, + indicates the image shift amount toward the close side, and-indicates the image shift amount toward the infinity side. Further, the image shift amount difference threshold is set to ± 0.3 pixels.
図16において、走査ライン1,2は被写体1ではなく、被写体2を捉えている。また、走査ライン3は、被写体1と被写体2の双方を捉えている。この状況で走査ライン1〜9のすべての像ずれ量を加算して平均した値を使用像ずれ量とした場合、被写体2を捉えている走査ライン1〜3の影響で、被写体1に対する良好な合焦状態を得ることができず、被写体1がぼけた状態となる。 In FIG. 16, scanning lines 1 and 2 capture not the subject 1 but the subject 2. The scanning line 3 captures both the subject 1 and the subject 2. In this situation, when the average value obtained by adding all the image shift amounts of the scanning lines 1 to 9 is used as the used image shift amount, the scan line 1 to 3 that captures the subject 2 has an excellent effect on the subject 1. The in-focus state cannot be obtained, and the subject 1 is blurred.
これに対して、上述した使用像ずれ量設定処理では、遠近競合判定部213は、まずAF領域の中央に位置して信頼度がOKである走査ライン5を基準走査ラインとして選択する(S603)。そして、該基準走査ライン5の像ずれ量+3画素を基準像ずれ量として設定する(S606)。 On the other hand, in the used image shift amount setting process described above, the perspective conflict determination unit 213 first selects the scan line 5 positioned at the center of the AF area and having a reliability of OK as the reference scan line (S603). . Then, the image shift amount of the reference scanning line 5 + 3 pixels is set as the reference image shift amount (S606).
次に、遠近競合判定部213は、基準像ずれ量(X)と全ての走査ライン1〜9の像ずれ量とを比較する。そして、基準像ずれ量の+3画素に対する差が像ずれ量差閾値±0.3画素以下である、+2.7画素〜+3.3画素の像ずれ量を有する走査ライン4,5,7,8,9を使用走査ラインの候補として選択する(S610)。 Next, the perspective conflict determination unit 213 compares the reference image shift amount (X) with the image shift amounts of all the scanning lines 1 to 9. Then, the scanning lines 4, 5, 7, and 8 having an image shift amount of +2.7 pixels to +3.3 pixels, in which the difference of the reference image shift amount from +3 pixels is equal to or less than the image shift amount difference threshold ± 0.3 pixel. , 9 are selected as candidates for use scanning lines (S610).
さらに、遠近競合判定部213は、使用走査ラインの候補である走査ラインのうち信頼度がOKである走査ライン4,5,7,8,9のみを使用走査ラインとして選択する(S611)。これらの使用走査ライン4,5,7,8,9は被写体1を捉えており、しかもそれらの像ずれ量の信頼度が高い(OKである)。このため、これらの像ずれ量を加算平均して算出した像ずれ量を使用像ずれ量として用いてデフォーカス量を算出することで、AF領域内に被写体2が含まれていても、被写体2の影響を受けずに被写体1に対する合焦状態を得ることができる。 Further, the near / far conflict determination unit 213 selects only the scan lines 4, 5, 7, 8, and 9 having reliability OK among the scan lines that are candidates for the use scan line (S611). These use scanning lines 4, 5, 7, 8, and 9 capture the subject 1, and the reliability of the image shift amount is high (OK). Therefore, by calculating the defocus amount using the image shift amount calculated by adding and averaging these image shift amounts as the used image shift amount, the subject 2 is included even if the subject 2 is included in the AF area. It is possible to obtain a focused state with respect to the subject 1 without being affected by the above.
なお、図16に示したAF領域内の走査ライン数や像ずれ量差閾値は例にすぎず、他の走査ライン数や像ずれ量差閾値を用いてもよい。 Note that the number of scan lines and the image shift amount difference threshold in the AF area shown in FIG. 16 are merely examples, and other scan line numbers and image shift amount difference thresholds may be used.
次に、図11のフローチャートを用いて、図6のS608で遠近競合判定部213が行う像ずれ量差閾値の設定処理について説明する。 Next, an image shift amount difference threshold setting process performed by the perspective conflict determination unit 213 in S608 of FIG. 6 will be described using the flowchart of FIG.
S1101では、遠近競合判定部213は、図5のS501で設定したAF領域の像高(位置)が所定像高より低い像高であるか否かを判定し、所定像高より低い像高であればS1102に進み、そうでない(所定像高より高い)場合はS1105に進む。 In S1101, the perspective conflict determination unit 213 determines whether or not the image height (position) of the AF area set in S501 in FIG. 5 is lower than a predetermined image height, and the image height is lower than the predetermined image height. If there is, the process proceeds to S1102, and if not (higher than the predetermined image height), the process proceeds to S1105.
S1102では、遠近競合判定部213は、撮像素子201の出力に適用するゲイン(センサゲイン)が所定ゲインより小さいか否かを判定し、所定ゲインより小さい場合はS1103に進み、そうでない(所定ゲインより大きい)場合はS1105に進む。 In S1102, the perspective competition determination unit 213 determines whether or not the gain (sensor gain) applied to the output of the image sensor 201 is smaller than the predetermined gain. If smaller than the predetermined gain, the process proceeds to S1103, otherwise (predetermined gain). If greater than, the process proceeds to S1105.
S1103では、遠近競合判定部213は、図6のS603で選択した基準走査ラインのコントラスト量が所定コントラスト量より高いか否かを判定する。そして、所定コントラスト量より高い場合はS1104に進み、そうでない(所定コントラスト量より低い)場合はS1105に進む。コントラスト量としては、例えば、相関演算を行う一対の像信号A,Bのそれぞれの最大信号値と最小信号値との差のうちより小さい方の差を用いる。また、S603で基準走査ラインが複数存在する場合は、複数の基準走査ラインの中で最も小さい差を用いる。より小さいコントラスト量を用いるのは、ワーストケースを想定してのことである。ただし、これは例であり、他の定義および方法でコントラスト量を求めてもよい。 In S1103, the perspective conflict determination unit 213 determines whether or not the contrast amount of the reference scanning line selected in S603 of FIG. 6 is higher than a predetermined contrast amount. If it is higher than the predetermined contrast amount, the process proceeds to S1104. If not (lower than the predetermined contrast amount), the process proceeds to S1105. As the contrast amount, for example, the smaller difference of the differences between the maximum signal value and the minimum signal value of the pair of image signals A and B for which the correlation calculation is performed is used. If there are a plurality of reference scan lines in S603, the smallest difference among the plurality of reference scan lines is used. The use of a smaller amount of contrast assumes the worst case. However, this is an example, and the contrast amount may be obtained by another definition and method.
S1104では、遠近競合判定部213は、像ずれ量差閾値をαに設定して本処理を終了する。一方、S1105では、遠近競合判定部213は、像ずれ量差閾値をβに設定して本処理を終了する。なお、像ずれ量差閾値α,βはα<βとなるように設定される。S1104でより小さい像ずれ量閾値αを設定するのは、像ずれ量の精度が高く検出されるケースを想定するためである。像ずれ量の精度が高く検出される場合は、図6に示した使用像ずれ量設定処理で遠近競合の影響を受けた像ずれ量をできるだけ厳しく除外するために、像ずれ量素閾値αを小さく設定する。これに対して、S1105では像ずれ量の精度が良くないケースを想定し、像ずれ量のばらつきを考慮してより大きい像ずれ量差閾値βを設定する。 In step S1104, the perspective conflict determination unit 213 sets the image shift amount difference threshold value to α and ends the present process. On the other hand, in S1105, the perspective conflict determination unit 213 sets the image shift amount difference threshold value to β, and ends the present process. The image deviation amount difference threshold values α and β are set so that α <β. The reason why the smaller image shift amount threshold value α is set in S1104 is to assume a case where the image shift amount is detected with high accuracy. When the accuracy of the image shift amount is detected with high accuracy, in order to exclude the image shift amount affected by the perspective conflict in the used image shift amount setting process shown in FIG. Set smaller. On the other hand, in S1105, assuming a case where the accuracy of the image shift amount is not good, a larger image shift amount difference threshold β is set in consideration of variations in the image shift amount.
本実施例では、像ずれ量の精度が劣化するケースとして3つを想定している。まず、S1101ではAF領域の像高を判定している。これは、図2(b)に示した撮像面位相差AFに対応した画素構成では、像高が高い画素ほどフォトダイオードA,Bに入射する光量の差が大きくなる傾向があり、一対の像信号A,Bの一致度が低下して像ずれ量の精度が低下する可能性が高くなるためである。 In this embodiment, three cases are assumed as the case where the accuracy of the image shift amount deteriorates. First, in S1101, the image height of the AF area is determined. This is because, in the pixel configuration corresponding to the imaging surface phase difference AF shown in FIG. 2B, the difference in the amount of light incident on the photodiodes A and B tends to increase as the image height increases. This is because there is a high possibility that the degree of coincidence between the signals A and B is lowered and the accuracy of the image shift amount is lowered.
また、S1102ではセンサゲインの大きさを判定している。これはセンサゲインが大きくなるほど一対の像信号A,Bのノイズ成分が大きくなり、像ずれ量の精度が低下する可能性が高くなるためである。 In S1102, the magnitude of the sensor gain is determined. This is because the noise component of the pair of image signals A and B increases as the sensor gain increases, and the possibility that the accuracy of the image shift amount decreases.
さらに、S1103では像信号AまたはBから得られるコントラスト量の大きさを判定している。これは、コントラスト量が小さいほど像ずれ量の精度が低下する可能性が高くなるためである。 Further, in S1103, the magnitude of the contrast amount obtained from the image signal A or B is determined. This is because the possibility that the accuracy of the image shift amount decreases as the contrast amount decreases.
このように、本実施例では、像ずれ量の精度が高いと想定できる場合は像ずれ量差閾値を小さく設定してより厳しく遠近競合判定を行い、像ずれ量の精度が低い想定できる場合は、像ずれ量のばらつきを考慮して像ずれ量差閾値を大きく設定する。 As described above, in the present embodiment, when it can be assumed that the accuracy of the image shift amount is high, the image shift amount difference threshold is set to be small, and the perspective conflict determination is performed more strictly, and when the accuracy of the image shift amount can be assumed to be low. The image deviation amount difference threshold value is set to a large value in consideration of variations in the image deviation amount.
次に、図12のフローチャートを用いて、図4のS403にてカメラ制御部212が行うAF処理について説明する。 Next, the AF process performed by the camera control unit 212 in S403 of FIG. 4 will be described using the flowchart of FIG.
S1201では、カメラ制御部212は、現在AFが完了して合焦停止状態にあるか否かを判定し、合焦停止状態でない場合はS1202に進み、合焦停止状態の場合はS1209に進む。 In step S1201, the camera control unit 212 determines whether the AF is currently completed and is in a focus stop state. If the focus stop state is not set, the process proceeds to step S1202, and if the focus stop state is set, the process proceeds to step S1209.
S1202では、カメラ制御部212は、S401での焦点検出処理(S508)で算出されたデフォーカス量の信頼度が所定信頼度より高いか否かを判定する。ここにいう信頼度は、前述した2像一致度や像ずれ量の急峻性により求められるものであり、算出されたデフォーカス量だけでなくデフォーカス方向も信頼できない信頼度範囲の最高値を所定信頼度と設定するのが望ましい。なお、信頼度は、2像一致度と像ずれ量の急峻性の両方を用いて求めてもよいし、一方のみを用いて求めてもよい。また、2像の信号レベル等の他の指標を用いてもよい。デフォーカス量の所定信頼度より高い場合はS1203に進み、そうでない場合はS1207に進む。 In S1202, the camera control unit 212 determines whether the reliability of the defocus amount calculated in the focus detection process (S508) in S401 is higher than a predetermined reliability. The reliability here is obtained from the above-mentioned two-image coincidence and the steepness of the image shift amount, and the maximum value of the reliability range in which not only the calculated defocus amount but also the defocus direction is unreliable is predetermined. It is desirable to set it as reliability. The reliability may be obtained by using both the two-image coincidence and the steepness of the image shift amount, or may be obtained by using only one of them. Other indicators such as the signal levels of the two images may be used. If the defocus amount is higher than the predetermined reliability, the process proceeds to S1203. Otherwise, the process proceeds to S1207.
S1203では、カメラ制御部212は、信頼度が高いデフォーカス量を用いてAFを行うため、まずはデフォーカス量が焦点深度内か否かを判断し、焦点深度内である場合はS1204に進み、焦点深度内でない場合はS1205に進む。 In step S1203, since the camera control unit 212 performs AF using a defocus amount with high reliability, the camera control unit 212 first determines whether the defocus amount is within the focal depth. If the defocus amount is within the focal depth, the process proceeds to S1204. If it is not within the depth of focus, the process proceeds to S1205.
S1204では、カメラ制御部212は、デフォーカス量が焦点深度内にある合焦状態とであるとみなして合焦停止状態に移行し、AF処理を終了する。 In step S1204, the camera control unit 212 considers that the defocus amount is in the in-focus state within the focal depth, shifts to the in-focus stop state, and ends the AF process.
一方、S1205では、カメラ制御部212は、まだ合焦状態が得られていないとみなして、デフォーカス量に基づいてフォーカスレンズ103を駆動するためのレンズ駆動設定を行い、S1206に進む。レンズ駆動設定とは、フォーカスレンズ103の駆動速度や、デフォーカス量の誤差を考慮したデフォーカス量に適用するゲイン等の設定である。 On the other hand, in S1205, the camera control unit 212 considers that the in-focus state has not yet been obtained, performs lens drive setting for driving the focus lens 103 based on the defocus amount, and proceeds to S1206. The lens driving setting is a setting such as a gain applied to the defocus amount in consideration of the driving speed of the focus lens 103 and an error in the defocus amount.
S1206では、カメラ制御部212は、デフォーカス量およびS1205で設定したレンズ駆動設定の情報に基づいて、レンズ制御部106に対してフォーカスレンズ103の制御命令を送信する。すなわち、フォーカス制御を行う。これにより、AF処理を終了する。 In step S1206, the camera control unit 212 transmits a control command for the focus lens 103 to the lens control unit 106 based on the defocus amount and the lens drive setting information set in step S1205. That is, focus control is performed. Thereby, the AF process is terminated.
一方、S1207では、S508で算出したデフォーカス量を使用できない。このため、カメラ制御部212は、信頼度が高いデフォーカス量が得られるフォーカスレンズ103の位置を検出するためにフォーカスレンズ103をその可動端に向かって移動させながらデフォーカス量を算出するサーチ駆動を行う。このため、カメラ制御部212は、まず、サーチ駆動用のレンズ駆動設定を行う。サーチ駆動用のレンズ駆動設定とは、フォーカスレンズ103の駆動速度や駆動を開始する方向等の設定である。 On the other hand, in S1207, the defocus amount calculated in S508 cannot be used. For this reason, the camera control unit 212 calculates the defocus amount while moving the focus lens 103 toward the movable end in order to detect the position of the focus lens 103 at which a highly reliable defocus amount is obtained. I do. For this reason, the camera control unit 212 first performs lens drive settings for search drive. The lens driving settings for search driving are settings such as the driving speed of the focus lens 103 and the direction in which driving is started.
続いてS1208では、カメラ制御部212は、S1207で設定したサーチ駆動用のレンズ駆動設定に基づいて、レンズ制御部106に対してフォーカスレンズ103の制御命令を送信する。そして、AF処理を終了する。なお、本実施例では、撮像素子201の出力信号を用いる撮像面位相差AFのみを行えるカメラ20について説明した。しかし、撮像素子201の出力信号を用いてコントラストAFを行える場合には、S1202でデフォーカス量の信頼度が低いと判定した場合にコントラストAFを行うようにしてもよい。 Subsequently, in S1208, the camera control unit 212 transmits a control command for the focus lens 103 to the lens control unit 106 based on the lens drive setting for search driving set in S1207. Then, the AF process ends. In the present embodiment, the camera 20 that can perform only the imaging surface phase difference AF using the output signal of the imaging device 201 has been described. However, when contrast AF can be performed using the output signal of the image sensor 201, contrast AF may be performed when it is determined in S1202 that the reliability of the defocus amount is low.
S1209では、カメラ制御部212は、合焦停止状態を保持し、AF処理を終了する。 In step S1209, the camera control unit 212 holds the focus stop state and ends the AF process.
本実施例では、AF領域の中央に主被写体が存在するとの前提で、主被写体を捉えていると想定される走査ライン(基準走査ライン)の像ずれ量(基準像ずれ量)に一致する又は近い像ずれ量を有する走査ライン(使用走査ライン)を選択する。そして、選択された使用走査ラインの像ずれ量(使用像ずれ量)のみを用いてデフォーカス量を算出する。これにより、AF領域内での被写体の遠近競合の影響を抑えて、主被写体に対する良好な合焦状態を得ることができる。すなわち、遠側と近側に被写体が存在する場合にいずれの被写体にも合焦せず、ぼけたままAFが完了することを回避し、かつ主被写体に対する合焦状態を得ることができる。 In this embodiment, on the assumption that the main subject is present in the center of the AF area, it coincides with the image shift amount (reference image shift amount) of the scanning line (reference scan line) assumed to capture the main subject or A scanning line having a close image shift amount (used scanning line) is selected. Then, the defocus amount is calculated using only the image shift amount (used image shift amount) of the selected used scan line. As a result, it is possible to obtain an excellent focus state with respect to the main subject while suppressing the influence of the perspective conflict of the subject in the AF area. That is, when a subject exists on the far side and the near side, neither subject is focused, it is possible to avoid the AF being completed while being blurred, and to obtain a focused state with respect to the main subject.
また、本実施例では、遠近競合を検出した際にAF領域を再設定して再び焦点検出処理を行うという時間を要する処理を行わないため、短時間でかつスムーズに主被写体に対する合焦状態を得ることができる。 Further, in this embodiment, when the perspective conflict is detected, the AF area is reset and the time-consuming process of performing the focus detection process again is not performed, so that the focus state of the main subject can be smoothly set in a short time. Can be obtained.
なお、本実施例では、図2(b)に示すように水平方向において相関演算を行える画素構成を用い、図16に示したようにAF領域内の垂直方向に互いに距離が異なる被写体が存在する場合の遠近競合を検出する場合について説明した。しかし、図17(a)に示すように垂直方向において相関演算を行える画素構成を用い、AF領域内の水平方向に互いに距離が異なる被写体が存在する場合の遠近競合を検出できるようにしてもよい。また、図17(b),(c)に示すように水平/垂直の両方向において相関演算を行える画素構成を用い、垂直/水平のいずれの方向でも遠近競合を検出できるようにしてもよい。 In this embodiment, as shown in FIG. 2B, a pixel configuration capable of performing correlation calculation in the horizontal direction is used, and there are subjects having different distances in the vertical direction in the AF area as shown in FIG. The case of detecting the perspective conflict in the case has been described. However, as shown in FIG. 17A, a pixel configuration that can perform correlation calculation in the vertical direction may be used so that a perspective conflict can be detected when there are subjects with different distances in the horizontal direction in the AF area. . In addition, as shown in FIGS. 17B and 17C, a pixel configuration that can perform correlation calculation in both the horizontal and vertical directions may be used so that perspective conflict can be detected in either the vertical or horizontal directions.
図17(a)では、水平および垂直方向の2×2画素における対角2画素に垂直方向に2分割されたフォトダイオードA,Bを設けている。図17(b)では、水平および垂直方向の2×2画素における対角2画素のうち一方の画素に垂直方向に2分割されたフォトダイオードA,Bを設け、他方の画素と水平方向に2分割されたフォトダイオードA,Bを設けている。図17(c)では、1画素に4分割されたフォトダイオードA〜Dを設けて、各画素において水平および垂直方向での遠近競合を検出できるようにしている。 In FIG. 17A, photodiodes A and B that are divided in two in the vertical direction are provided in two diagonal pixels in 2 × 2 pixels in the horizontal and vertical directions. In FIG. 17B, photodiodes A and B divided in two in the vertical direction are provided in one of the two diagonal pixels in the horizontal and vertical 2 × 2 pixels, and 2 in the horizontal direction with the other pixel. Divided photodiodes A and B are provided. In FIG. 17 (c), photodiodes A to D divided into four are provided for each pixel so that each pixel can detect horizontal and vertical competition.
次に、本発明の実施例2について説明する。実施例1では、AF領域の中央の走査ラインから求めた像ずれ量に一致する又は近い像ずれ量を有する走査ラインを使用走査ラインとして選択した。これに対して、実施例2では、図5のS505で得られた像ずれ量に基づいて算出したデフォーカス量(検出量)に基づいて使用走査ラインを選択する。 Next, a second embodiment of the present invention will be described. In Example 1, a scan line having an image shift amount that matches or is close to the image shift amount obtained from the center scan line of the AF area is selected as a use scan line. On the other hand, in the second embodiment, the scanning line to be used is selected based on the defocus amount (detection amount) calculated based on the image shift amount obtained in S505 of FIG.
本実施例における交換レンズおよびカメラからなるレンズ交換式カメラシステムの構成は、実施例1で図1に示した構成と同じである。また、本実施例における撮像処理、静止画撮像処理およびAF処理は、実施例1において図3、図4および図12に示したものと同じである。また、本実施例において、実施例1と共通する構成要素には、実施例1と同符号を付す。 The configuration of the interchangeable lens camera system including the interchangeable lens and the camera in this embodiment is the same as that shown in FIG. In addition, the imaging process, the still image imaging process, and the AF process in the present embodiment are the same as those illustrated in FIGS. 3, 4, and 12 in the first embodiment. In the present embodiment, the same reference numerals as those in the first embodiment are given to the constituent elements common to the first embodiment.
図18のフローチャートを用いて、図4のS401にてAF信号処理部204が行う焦点検出処理について説明する。S1801からS1806までの処理は、図5におけるS501からS506までの処理と同じである。また、S1807の処理はS508の処理と同じである。 The focus detection process performed by the AF signal processing unit 204 in S401 of FIG. 4 will be described using the flowchart of FIG. The processing from S1801 to S1806 is the same as the processing from S501 to S506 in FIG. Further, the processing in S1807 is the same as the processing in S508.
S1807では、遠近競合判定部213は、S1805で算出された走査ラインごとの像ずれ量から走査ラインごとのデフォーカス量を算出する。 In step S1807, the perspective conflict determination unit 213 calculates the defocus amount for each scanning line from the image shift amount for each scanning line calculated in step S1805.
次にS1808では、遠近競合判定部213は、S1807で算出した各走査ラインのデフォーカス量とS1806で求めた各走査ラインの像ずれ量の信頼度から使用走査ラインを選択し、その使用走査ラインのデフォーカス量を使用デフォーカス量として設定する。そして、焦点検出処理を終了する。 In step S1808, the perspective conflict determination unit 213 selects a scan line to be used based on the defocus amount of each scan line calculated in step S1807 and the reliability of the image shift amount obtained in step S1806. The defocus amount is set as the used defocus amount. Then, the focus detection process ends.
図19のフローチャートには、図18のS1808で遠近競合判定部213が行う使用デフォーカス量設定処理を示している。図19に示す使用デフォーカス量設定処理は、図6に示した使用像ずれ量設定処理での「像ずれ量」を「デフォーカス量」に読み替えたものと同じである。 The flowchart in FIG. 19 shows a used defocus amount setting process performed by the perspective conflict determination unit 213 in S1808 in FIG. The used defocus amount setting process shown in FIG. 19 is the same as the “image shift amount” in the used image shift amount setting process shown in FIG.
次に、図20のフローチャートを用いて、図19のS1908で遠近競合判定部213が行うデフォーカス量差閾値(所定閾値)の設定処理について説明する。S2001からS2003の処理は図11におけるS1101からS1103までの処理と同じである。 Next, the defocus amount difference threshold (predetermined threshold) setting process performed by the perspective conflict determination unit 213 in S1908 of FIG. 19 will be described using the flowchart of FIG. The processing from S2001 to S2003 is the same as the processing from S1101 to S1103 in FIG.
S2003では、遠近競合判定部213は、図19のS1903で選択した基準走査ラインのコントラスト量が所定コントラスト量より高いか否かを判定する。そして、所定コントラスト量より高い場合はS2004に進み、そうでない(所定コントラスト量より低い)場合はS2007に進む。 In S2003, the perspective conflict determination unit 213 determines whether or not the contrast amount of the reference scanning line selected in S1903 in FIG. 19 is higher than a predetermined contrast amount. If it is higher than the predetermined contrast amount, the process proceeds to S2004. If not (lower than the predetermined contrast amount), the process proceeds to S2007.
S2004では、遠近競合判定部213は、絞り102が所定絞り値より開いているか否かを判定する。遠近競合判定部213は、絞り102が所定絞り値より開いている場合はS2005に進み、そうでない(所定絞り値より絞られている)場合はS2007に進む。 In S2004, the perspective conflict determination unit 213 determines whether or not the aperture 102 is larger than a predetermined aperture value. The perspective conflict determination unit 213 proceeds to S2005 when the aperture 102 is larger than the predetermined aperture value, and proceeds to S2007 when it is not (the aperture aperture is smaller than the predetermined aperture value).
S2005では、遠近競合判定部213は、撮影光学系の射出瞳距離が所定距離より長いか否かを判定し、所定距離より長い場合はS2006に進み、そうでない(所定距離より短い)場合はS2007に進む。 In S2005, the perspective conflict determination unit 213 determines whether or not the exit pupil distance of the photographing optical system is longer than a predetermined distance. If the distance is longer than the predetermined distance, the process proceeds to S2006, otherwise (S2007). Proceed to
S2006では、遠近競合判定部213は、デフォーカス量差閾値をαに設定して本処理を終了する。S2007では、遠近競合判定部213は、デフォーカス量差閾値をβに設定して本処理を終了する。本実施例では、以下に説明する理由により、デフォーカス量差閾値α,βをα<βとなるように設定する。 In step S2006, the perspective conflict determination unit 213 sets the defocus amount difference threshold value to α and ends this process. In S2007, the perspective conflict determination unit 213 sets the defocus amount difference threshold value to β and ends the present process. In this embodiment, the defocus amount difference thresholds α and β are set to satisfy α <β for the reason described below.
デフォーカス量は、像ずれ量に換算係数KGを乗じることで算出できるが、換算係数KGが大きくなるほど像ずれ量の変化に対して敏感になり、デフォーカス量のばらつきが大きくなる。撮像面位相差AFでは、一般的に絞りを絞り込むと、絞り羽根によるケラレが生じて一対の被写体像間の基線長が短くなり、換算係数KGが大きくなる。また、撮像素子(像面)201から撮影光学系の射出瞳までの距離である射出瞳距離が短い場合も同様に換算係数KGの値が大きくなる傾向がある。このように、換算係数KGが小さいと想定される条件では、S2006においてより小さいデフォーカス量差閾値αを設定して、より厳しく精度が良いデフォーカス量のみが使用デフォーカス量として設定されるようにする。一方、換算係数KGが大きくなると想定される条件では、S2007においてより大きいデフォーカス量差閾値βを設定し、デフォーカス量のばらつきを考慮して使用デフォーカス量が設定されるようにする。 The defocus amount can be calculated by multiplying the image shift amount by the conversion coefficient KG. However, as the conversion coefficient KG increases, the defocus amount becomes more sensitive to changes in the image shift amount, and the defocus amount variation increases. In the imaging plane phase difference AF, generally, when the aperture is narrowed, vignetting occurs due to aperture blades, the base line length between a pair of subject images is shortened, and the conversion coefficient KG is increased. Similarly, when the exit pupil distance, which is the distance from the image sensor (image plane) 201 to the exit pupil of the photographing optical system, is short, the value of the conversion coefficient KG also tends to increase. As described above, under the condition that the conversion coefficient KG is assumed to be small, a smaller defocus amount difference threshold value α is set in S2006, and only a more severe and accurate defocus amount is set as the used defocus amount. To. On the other hand, under conditions where the conversion factor KG is assumed to be large, a larger defocus amount difference threshold β is set in S2007 so that the used defocus amount is set in consideration of variations in the defocus amount.
なお、基準走査ラインで得られる基準デフォーカス量が大きいほど(所定デフォーカス量より大きい場合に)デフォーカス量差閾値を大きく設定してもよい。 Note that the defocus amount difference threshold value may be set to be larger as the reference defocus amount obtained in the reference scan line is larger (when the defocus amount is larger than the predetermined defocus amount).
本実施例では、デフォーカス量差閾値を2つ設けたが、条件に応じて3つ以上設けてもよい。 In this embodiment, two defocus amount difference threshold values are provided, but three or more threshold values may be provided depending on conditions.
本実施例でも、AF領域の中央に主被写体が存在するとの前提で、主被写体を捉えていると想定される走査ラインのデフォーカス量に一致する又は近いデフォーカス量を与える走査ラインのデフォーカス量のみを用いて使用デフォーカス量を算出する。これにより、AF領域内での被写体の遠近競合の影響を抑えて、主被写体に対する良好な合焦状態を得ることができる。すなわち、遠側と近側に被写体が存在する場合にいずれの被写体にも合焦せず、ぼけたままAFが完了することを回避し、かつ主被写体に対する合焦状態を得ることができる。 Also in this embodiment, on the assumption that the main subject exists in the center of the AF area, the defocusing of the scanning line that gives a defocusing amount that matches or is close to the defocusing amount of the scanning line that is assumed to capture the main subject. The use defocus amount is calculated using only the amount. As a result, it is possible to obtain an excellent focus state with respect to the main subject while suppressing the influence of the perspective conflict of the subject in the AF area. That is, when a subject exists on the far side and the near side, neither subject is focused, it is possible to avoid the AF being completed while being blurred, and to obtain a focused state with respect to the main subject.
また、本実施例でも、遠近競合を検出した際にAF領域を再設定して再び焦点検出処理を行うという時間を要する処理を行わないため、短時間でかつスムーズに主被写体に対する合焦状態を得ることができる。 Also in this embodiment, when the distance conflict is detected, the AF area is reset and the time-consuming process of performing the focus detection process again is not performed. Can be obtained.
なお、上記各実施例ではレンズ交換型撮像装置について説明したが、本発明の光学機器は、レンズ一体型撮像装置も他の実施例として含む。また、光学機器としての交換レンズにAF信号処理部204を搭載し、カメラ20からAF領域の一対の像信号を受け取って実施例1,2で説明した焦点検出処理を行ってもよい。
(その他の実施例)
本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサーがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。
In each of the above embodiments, the interchangeable lens imaging device has been described. However, the optical apparatus of the present invention includes a lens integrated imaging device as another embodiment. Further, the AF signal processing unit 204 may be mounted on an interchangeable lens as an optical device, and a pair of image signals in the AF area may be received from the camera 20 and the focus detection processing described in the first and second embodiments may be performed.
(Other examples)
The present invention supplies a program that realizes one or more functions of the above-described embodiments to a system or apparatus via a network or a storage medium, and one or more processors in a computer of the system or apparatus read and execute the program This process can be realized. It can also be realized by a circuit (for example, ASIC) that realizes one or more functions.
以上説明した各実施例は代表的な例にすぎず、本発明の実施に際しては、各実施例に対して種々の変形や変更が可能である。 Each embodiment described above is only a representative example, and various modifications and changes can be made to each embodiment in carrying out the present invention.
103 フォーカスレンズ
204 AF信号処理部
212 カメラ制御部
213 遠近競合判定部
103 focus lens 204 AF signal processing unit 212 camera control unit 213 perspective conflict determination unit
Claims (12)
前記焦点検出領域内に複数の第1の領域を設け、該第1の領域ごとに前記検出量を演算する第1の演算手段と、
前記複数の第1の領域から基準領域を選択し、該基準領域の前記検出量を基準検出量として設定する基準設定手段と、
前記複数の第1の領域のうち前記基準検出量に対する差が所定閾値より小さい第1の領域を第2の領域として前記基準領域を含めて複数選択し、該複数の第2の領域の前記検出量を用いて前記焦点検出領域の前記検出量を演算する第2の演算手段とを有することを特徴とする焦点検出装置。 A detection amount that is one of a phase difference between a pair of image signals obtained from a focus detection region and a defocus amount of the photographing optical system based on the phase difference among image pickup elements that capture a subject image formed by the photographing optical system. A focus detection device for calculating
A plurality of first areas in the focus detection area, and a first calculation means for calculating the detection amount for each of the first areas;
A reference setting unit that selects a reference region from the plurality of first regions and sets the detection amount of the reference region as a reference detection amount;
Among the plurality of first regions, a plurality of first regions including the reference region are selected as a second region having a difference from the reference detection amount smaller than a predetermined threshold, and the detection of the plurality of second regions is performed. And a second calculating means for calculating the detection amount of the focus detection area using the amount.
前記基準設定手段は、前記複数の第1の領域のうち前記信頼度が第1の信頼度より高い第1の領域を前記基準領域として選択することを特徴とする請求項1または2に記載の焦点検出装置。 A reliability calculation means for calculating the reliability of the detection amount for each of the first regions;
3. The reference setting unit according to claim 1, wherein the reference setting unit selects, as the reference region, a first region having the reliability higher than the first reliability among the plurality of first regions. Focus detection device.
前記第2の演算手段は、前記複数の第1の領域のうち前記基準検出量に対する差が前記所定閾値より小さく、かつ前記信頼度が第2の信頼度より高い第1の領域を前記複数の第2の領域として選択することを特徴とする請求項1から3のいずれか一項に記載の焦点検出装置。 A reliability calculation means for calculating the reliability of the detection amount for each of the first regions;
The second calculating means determines the first region of the plurality of first regions that has a difference with respect to the reference detection amount smaller than the predetermined threshold and the reliability is higher than a second reliability. The focus detection device according to claim 1, wherein the focus detection device is selected as the second region.
前記第2の演算手段は、前記撮影光学系の絞りが絞られているほど前記所定閾値を大きく設定することを特徴とする請求項1から7のいずれか一項に記載の焦点検出装置。 The detected amount is the defocus amount,
8. The focus detection apparatus according to claim 1, wherein the second calculation unit sets the predetermined threshold value larger as a diaphragm of the photographing optical system is narrowed. 9.
前記第2の演算手段は、前記撮像素子から前記撮影光学系の射出瞳までの距離が短いほど前記所定閾値を大きく設定することを特徴とする請求項1から8のいずれか一項に記載の焦点検出装置。 The detected amount is the defocus amount,
The said 2nd calculating means sets the said predetermined threshold value large, so that the distance from the said image pick-up element to the exit pupil of the said imaging optical system is short, It is characterized by the above-mentioned. Focus detection device.
前記第2の演算手段は、前記基準検出量が大きいほど前記所定閾値を大きく設定することを特徴とする請求項1から9のいずれか一項に記載の焦点検出装置。 The detected amount is the defocus amount,
10. The focus detection apparatus according to claim 1, wherein the second calculation unit sets the predetermined threshold value to be larger as the reference detection amount is larger.
該焦点検出装置により得られた前記検出量を用いてフォーカス制御を行う制御手段とを有することを特徴とする光学機器。 The focus detection apparatus according to any one of claims 1 to 10,
An optical apparatus comprising: control means for performing focus control using the detection amount obtained by the focus detection device.
前記焦点検出処理は、
前記焦点検出領域内に複数の第1の領域を設け、該第1の領域ごとに前記検出量を演算する処理と、
前記複数の第1の領域から基準領域を選択し、該基準領域の前記検出量を基準検出量として設定する処理と、
前記複数の第1の領域のうち前記基準検出量に対する差が所定閾値より小さい第1の領域を第2の領域として前記基準領域を含めて複数選択する処理と、
前記複数の第2の領域の前記検出量を用いて前記焦点検出領域の前記検出量を演算する処理とを有することを特徴とする焦点検出プログラム。
A detection amount that is one of a phase difference between a pair of image signals obtained from a focus detection region and a defocus amount of the photographing optical system based on the phase difference among image pickup elements that capture a subject image formed by the photographing optical system. A computer program for causing a computer to execute a focus detection process for calculating
The focus detection process includes
A process of providing a plurality of first regions in the focus detection region and calculating the detection amount for each of the first regions;
A process of selecting a reference area from the plurality of first areas and setting the detection amount of the reference area as a reference detection amount;
A process of selecting a plurality of first areas including the reference area as a second area, wherein the difference between the plurality of first areas and the reference detection amount is smaller than a predetermined threshold;
And a process of calculating the detection amount of the focus detection region using the detection amounts of the plurality of second regions.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2015075598A JP2016194665A (en) | 2015-04-02 | 2015-04-02 | Focus detection device, optical instrument, focus detection program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2015075598A JP2016194665A (en) | 2015-04-02 | 2015-04-02 | Focus detection device, optical instrument, focus detection program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2016194665A true JP2016194665A (en) | 2016-11-17 |
Family
ID=57322802
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2015075598A Pending JP2016194665A (en) | 2015-04-02 | 2015-04-02 | Focus detection device, optical instrument, focus detection program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2016194665A (en) |
-
2015
- 2015-04-02 JP JP2015075598A patent/JP2016194665A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6506560B2 (en) | Focus control device and method therefor, program, storage medium | |
US10638033B2 (en) | Focus control apparatus, focus control method and storage medium | |
JP6614783B2 (en) | Automatic focusing apparatus and control method thereof | |
JP2015018205A (en) | Focus detection unit, method therefor, and image capturing device | |
JP6182681B2 (en) | Focus control device, focus control method, focus control program, lens device, imaging device | |
JP6300670B2 (en) | Focus adjustment apparatus, focus adjustment method and program, and imaging apparatus | |
JP2016197231A (en) | Display control device and method, and imaging device | |
JP7034585B2 (en) | Focus control device, image pickup device, focus control method and focus control program | |
JP6682319B2 (en) | Focus detection apparatus and method, imaging apparatus, program, storage medium | |
JP2016142999A (en) | Imaging device and control method of the same | |
JP6833405B2 (en) | Focus detection device, focus adjustment device, imaging device and focus detection method | |
JP2019168479A (en) | Controller, imaging device, method for control, program, and, and storage medium | |
JP2019101320A (en) | Focus adjustment apparatus, control method thereof, program and imaging apparatus | |
JP2016142924A (en) | Imaging apparatus, method of controlling the same, program, and storage medium | |
JP6305017B2 (en) | Focus control device and control method thereof | |
JP7179509B2 (en) | Imaging device and imaging device control method | |
JP2016156950A (en) | Automatic focus adjustment device and control method of the same | |
JP5564961B2 (en) | Imaging device | |
JP2016057421A (en) | Focus adjustment device and focus adjustment method | |
JP6305016B2 (en) | FOCUS CONTROL DEVICE, FOCUS CONTROL DEVICE CONTROL METHOD, AND IMAGING DEVICE | |
JP2018010245A (en) | Signal processor and control method therefor | |
JP5446720B2 (en) | Focus detection device, imaging device | |
JP7023673B2 (en) | Focus control device, focus control method, and image pickup device | |
JP2016194665A (en) | Focus detection device, optical instrument, focus detection program | |
JP6645690B2 (en) | Automatic focus adjustment device, imaging device, and automatic focus adjustment method |