JP2018004706A - Focus detection device, focus detection method, and program - Google Patents

Focus detection device, focus detection method, and program Download PDF

Info

Publication number
JP2018004706A
JP2018004706A JP2016126972A JP2016126972A JP2018004706A JP 2018004706 A JP2018004706 A JP 2018004706A JP 2016126972 A JP2016126972 A JP 2016126972A JP 2016126972 A JP2016126972 A JP 2016126972A JP 2018004706 A JP2018004706 A JP 2018004706A
Authority
JP
Japan
Prior art keywords
phase shift
correlation
amount
focus detection
unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2016126972A
Other languages
Japanese (ja)
Inventor
瓦田 昌大
Masahiro Kawarada
昌大 瓦田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP2016126972A priority Critical patent/JP2018004706A/en
Publication of JP2018004706A publication Critical patent/JP2018004706A/en
Pending legal-status Critical Current

Links

Images

Abstract

PROBLEM TO BE SOLVED: To provide a focus detection device capable of performing focus detection while reducing the influence of noise.SOLUTION: The focus detection device includes: first acquiring means (219) for performing a correlation operation while shifting a pair of parallax image signals in a first phase shift range and acquiring a correlation operation curve; replacing means (230) for replacing, of the correlation operation curve acquired by the first acquiring means, a correlation operation curve in a second phase shift range, which is a range sandwiching the position at which the pair of parallax image signals are not shifted and a range sandwiched between the minimum values having a high correlation of the pair of parallax image signals; and second acquiring means (222) for acquiring a defocus amount from the correlation operation curve whose a part is replaced by the replacing means.SELECTED DRAWING: Figure 16

Description

本発明は、位相差検出方式を用いた焦点検出装置、焦点検出方法、及びプログラムに関する。   The present invention relates to a focus detection apparatus, a focus detection method, and a program using a phase difference detection method.

従来、被写体像の光束を射出瞳面で分割して、それぞれを2次元の撮像素子における一対の画素列の各々に結像させ、一対の画素列で光電変換された各像信号の位相差に基づいて焦点検出を行う方法が位相差検出方式の焦点検出方法として知られている。   Conventionally, the luminous flux of the subject image is divided on the exit pupil plane, and each is imaged on each of a pair of pixel rows in a two-dimensional image sensor, and the phase difference of each image signal photoelectrically converted by the pair of pixel rows is calculated. A method of performing focus detection based on this is known as a phase difference detection type focus detection method.

特許文献1には、各画素にマイクロレンズが形成された2次元の撮像素子を用いて位相差検出方式の焦点検出を行う撮像装置の記載がある。この撮像装置において、各画素は瞳分割された一方の像を光電変換するフォトダイオードA、他方の像を光電変換するフォトダイオードB、フォトダイオードAおよびBからの電荷を一時的に保持するフローティングディフュージョン領域を有する。フォトダイオードAおよびBからフローティングディフュージョン領域への電荷の転送制御は、はじめにフォトダイオードAの電荷のみを転送して電圧変換することで、瞳分割された一方の像信号(以後、A像信号と呼ぶ。)を得ることができる。また、ここでフローティングディフュージョン領域をリセットすることなく、つづけてフォトダイオードBの電荷をフローティングディフュージョン領域に転送して電圧変換することで、瞳分割前の像信号(以後、A+B像信号と呼ぶ。)を得ることができる。   Patent Document 1 describes an imaging apparatus that performs phase difference detection type focus detection using a two-dimensional imaging element in which a microlens is formed in each pixel. In this imaging apparatus, each pixel has a photodiode A that photoelectrically converts one of the pupil-divided images, a photodiode B that photoelectrically converts the other image, and a floating diffusion that temporarily holds charges from the photodiodes A and B. Has a region. In the transfer control of the charges from the photodiodes A and B to the floating diffusion region, only the charge of the photodiode A is first transferred and converted into a voltage, whereby one image signal divided into pupils (hereinafter referred to as an A image signal). .) Can be obtained. Further, here, without resetting the floating diffusion region, the charge of the photodiode B is transferred to the floating diffusion region for voltage conversion, so that the image signal before pupil division (hereinafter referred to as A + B image signal). Can be obtained.

瞳分割された他方の像が入射するフォトダイオードBに対応する像信号(以後、B像信号と呼ぶ。)は、A+B像信号からA像信号を差し引くことで、電気的に求められる。このようにして求められた一対のA像信号とB像信号の画像信号は視差画像信号であるため、A像信号とB像信号に対して、その位相差を公知の相関演算で求めることにより、被写体の焦点位置を検出することができる。また、A+B像信号は撮像装置による撮像画像の生成に用いる。このように、特許文献1に記載の撮像装置は、A像、B像、A+B像という3種類の像信号を、2回の読み出しで取得することができる。加えて、フローティングディフュージョン領域で電荷を混合してA+B像信号を生成するため、A像信号とB像信号とを読み出し、A像信号とB像信号とを加算するよりもノイズの少ないA+B像信号が得られる。これは、A像信号とB像信号とを読みだすと、それぞれの信号にノイズが含まれるため、信号を加算することでノイズも加算されるためである。   An image signal corresponding to the photodiode B on which the other pupil-divided image is incident (hereinafter referred to as a B image signal) is obtained electrically by subtracting the A image signal from the A + B image signal. Since the image signal of the pair of A image signal and B image signal thus obtained is a parallax image signal, the phase difference of the A image signal and the B image signal is obtained by a known correlation calculation. The focus position of the subject can be detected. The A + B image signal is used to generate a captured image by the imaging device. As described above, the imaging apparatus described in Patent Document 1 can acquire three types of image signals, that is, an A image, a B image, and an A + B image, by two readings. In addition, since the A + B image signal is generated by mixing charges in the floating diffusion region, the A + B image signal is less noise than reading out the A image signal and the B image signal and adding the A image signal and the B image signal. Is obtained. This is because when the A image signal and the B image signal are read out, noise is included in each signal, and noise is also added by adding the signals.

特開2014−89260号公報JP 2014-89260 A

特許文献1に記載されているような、光電変換の回路構成において、フローティングディフュージョン領域に光ショットノイズや暗電流ノイズが混入する。したがって、フォトダイオードから転送された電荷には、フローティングディフュージョン領域で一時的に保持されるタイミングによって、異なる電荷量のノイズが混入する。特に、瞳分割された一対の像をそれぞれ光電変換する場合、フローティングディフュージョン領域にて上述したA像信号を一時的に保持するタイミングと、同じく上述したA+B像信号を一時的に保持するタイミングとで、異なる電荷量のノイズが混入する。よって、A+B像信号からA像信号を減じて生成したB像信号は、A像信号に含まれるノイズ成分と正負が逆の信号成分(逆波形ノイズと呼ぶ)を含む。   In the circuit configuration of photoelectric conversion as described in Patent Document 1, light shot noise and dark current noise are mixed in the floating diffusion region. Therefore, the charge transferred from the photodiode is mixed with noise having different charge amounts depending on the timing temporarily held in the floating diffusion region. In particular, when photoelectrically converting a pair of pupil-divided images, the timing at which the A image signal is temporarily held in the floating diffusion region and the timing at which the A + B image signal is similarly temporarily held are also provided. , Noise of different charge amount is mixed. Therefore, the B image signal generated by subtracting the A image signal from the A + B image signal includes a signal component (referred to as inverse waveform noise) whose polarity is opposite to that of the noise component included in the A image signal.

一対の画素列において、A像信号に表れたノイズの座標に対して、B像信号に表れる逆波形ノイズの座標は同一である。ノイズの影響がなければ合焦時は位相シフト量(位相差)=0の時に相関量が最も小さくなるが、このようにA+B像信号とA像信号の差分をB像信号とすると、位相シフト量=0の時に他のシフト量のときよりもノイズの影響が大きくなる。その結果、位相シフト量=0のときよりも小さい相関量をとる位相差が存在し、その位相差を合焦位置の位相差であると認識して誤測距やハンチングが起きる可能性がある。焦点検出状態にかかわらず位相差ゼロとなる演算時の相関が悪化するため、特に位相差ゼロの近傍で画素列が高い相関を示すことになる合焦位置近傍での焦点検出の際、相関が悪化することにより、焦点検出に誤差が生じてしまう可能性があった。また、被写体が特に低輝度または低コントラストである場合、本来の被写体に起因する像信号の振幅が小さくなるため、上述したノイズの影響度が相対的に高くなり、位相差ゼロの演算時だけでなく、その近傍の位相差の演算時においても、相関が悪化してしまう。   In the pair of pixel columns, the coordinates of the inverse waveform noise appearing in the B image signal are the same as the coordinates of the noise appearing in the A image signal. If there is no influence of noise, the amount of correlation becomes the smallest when the phase shift amount (phase difference) = 0 at the time of focusing. However, if the difference between the A + B image signal and the A image signal is thus set as the B image signal, the phase shift When the amount = 0, the influence of noise is larger than when other shift amounts are used. As a result, there is a phase difference that takes a smaller amount of correlation than when the phase shift amount = 0, and the phase difference may be recognized as the phase difference of the in-focus position, and erroneous ranging or hunting may occur. . Correlation at the time of calculation where the phase difference is zero deteriorates regardless of the focus detection state, so the correlation is particularly great when focus detection is performed in the vicinity of the in-focus position where the pixel row shows high correlation near the phase difference zero. As a result of deterioration, an error may occur in focus detection. In addition, when the subject is particularly low-luminance or low-contrast, the amplitude of the image signal caused by the original subject is small, so the influence of the noise is relatively high, and only when calculating the phase difference zero. In other words, the correlation deteriorates even when calculating the phase difference in the vicinity thereof.

また、像信号対に含まれるノイズ成分が相関を有するのは、B像信号をA+B像信号とA像信号との差分から取得する場合だけに限らない。例えば、A像信号とB像信号とが同じアンプで増幅される場合など、信号経路中のノイズ源を共有する場合にも、像信号対を構成する信号列間(A像信号とB像信号)のノイズ成分は相関を有する。   Further, the noise components included in the image signal pair have a correlation not only when the B image signal is acquired from the difference between the A + B image signal and the A image signal. For example, even when a noise source in the signal path is shared, such as when the A image signal and the B image signal are amplified by the same amplifier, the signal trains constituting the image signal pair (A image signal and B image signal) ) Have a correlation.

そこで、本発明は上述した課題に鑑みてなされたものであり、その目的の一つは、ノイズの影響を低減して焦点検出を行うことを可能にする焦点検出装置を提供することにある。   Accordingly, the present invention has been made in view of the above-described problems, and one of its purposes is to provide a focus detection apparatus that can perform focus detection while reducing the influence of noise.

上記目的を達成するために、本発明の焦点検出装置は、一対の視差画像信号を第1の位相シフト範囲でシフトしながら相関演算をおこない相関演算曲線を取得する第1の取得手段と、前記第1の取得手段が取得した前記第1の位相シフト範囲の前記相関演算曲線のうち、前記一対の視差画像信号をシフトしない位置を挟んだ範囲で、且つ前記一対の視差画像信号の相関が高くなる極小値に挟まれた範囲である第2の位相シフト範囲の前記相関演算曲線を置換する置換手段と、前記置換手段により一部が置換された前記相関演算曲線から、デフォーカス量を取得する第2の取得手段と、を備えることを特徴とする。   To achieve the above object, the focus detection apparatus of the present invention includes a first acquisition unit that performs a correlation calculation while shifting a pair of parallax image signals within a first phase shift range, and acquires a correlation calculation curve; Of the correlation calculation curve of the first phase shift range acquired by the first acquisition means, the correlation between the pair of parallax image signals is high in a range sandwiching a position where the pair of parallax image signals is not shifted. The defocus amount is acquired from a replacement unit that replaces the correlation calculation curve in the second phase shift range that is between the minimum values, and the correlation calculation curve that is partially replaced by the replacement unit. A second acquisition unit.

本発明によれば、ノイズの影響を低減して焦点検出を行うことが可能な焦点検出装置を提供できる。   ADVANTAGE OF THE INVENTION According to this invention, the focus detection apparatus which can reduce the influence of noise and can perform focus detection can be provided.

本発明の実施形態に係るデジタルカメラの概略構成を示す図である。1 is a diagram illustrating a schematic configuration of a digital camera according to an embodiment of the present invention. 撮像部の画素面を入射光側から見た模式図である。It is the schematic diagram which looked at the pixel surface of the image pick-up part from the incident light side. 撮像部の画素の回路構成を示す図である。It is a figure which shows the circuit structure of the pixel of an imaging part. 画素の回路における駆動タイミングチャートである。It is a drive timing chart in the circuit of a pixel. 撮像部の画素の構造を示す図である。It is a figure which shows the structure of the pixel of an imaging part. 合焦時の第1の副画素S1と第2の副画素S2の像信号の位相差を示す図である。It is a figure which shows the phase difference of the image signal of 1st subpixel S1 and 2nd subpixel S2 at the time of focusing. 非合焦時の第1の副画素S1と第2の副画素S2の像信号の位相差を示す図である。It is a figure which shows the phase difference of the image signal of 1st subpixel S1 and 2nd subpixel S2 at the time of a non-focusing. 一対の像信号の位相シフト量とデフォーカス量との関係を示す図である。It is a figure which shows the relationship between the phase shift amount and defocus amount of a pair of image signal. デフォーカス量が小さいときに副画素列に投影される被写体像を表した模式図である。FIG. 6 is a schematic diagram illustrating a subject image projected on a sub-pixel row when a defocus amount is small. デフォーカス量が大きいときに副画素列に投影される被写体像を表した模式図である。It is a schematic diagram showing a subject image projected on a sub-pixel row when the defocus amount is large. 像信号に表れるノイズの説明に用いるパターン被写体である。This is a pattern subject used to explain noise appearing in an image signal. パターン被写体に対する第1および第2の副画素列の像信号およびその加算信号を示したグラフ(ノイズ混入なし)である。It is a graph (no noise mixing) showing the image signals of the first and second subpixel columns and the addition signal thereof for the pattern subject. パターン被写体に対する第1および第2の副画素列の像信号およびその加算信号を示したグラフ(ノイズ混入あり)である。It is the graph (with noise mixing) which showed the image signal of the 1st and 2nd subpixel row | line with respect to a pattern subject, and its addition signal. 図13における像信号対の相関量を位相シフト量ごとに示したグラフである。It is the graph which showed the correlation amount of the image signal pair in FIG. 13 for every phase shift amount. 図14における像信号対の相関量を位相シフト量ごとに示したグラフである。It is the graph which showed the correlation amount of the image signal pair in FIG. 14 for every phase shift amount. 本発明の実施形態に係るデジタルカメラの焦点検出動作の流れを示すフローチャートである。It is a flowchart which shows the flow of the focus detection operation | movement of the digital camera which concerns on embodiment of this invention. 本発明の実施形態に係る相関量置換後の相関量と位相シフト量との関係を示すイメージ図である。It is an image figure which shows the relationship between the correlation amount and phase shift amount after correlation amount substitution which concerns on embodiment of this invention.

以下、本発明の実施の形態について説明をする。ここでは、本発明にかかる焦点検出装置を、レンズ交換式のデジタル一眼レフカメラに適用した実施形態について説明をする。しかしながら、本発明にかかる焦点検出装置は、位相差検出方式の焦点検出に用いる信号を生成可能な撮像素子を有する任意の電子機器に適用可能である。電子機器としては、レンズ交換できないタイプのデジタルカメラや、ビデオカメラの他、カメラを備えた携帯電話機、パーソナルコンピュータ、ゲーム機、家電機器などが例として挙げられる。   Hereinafter, embodiments of the present invention will be described. Here, an embodiment in which the focus detection apparatus according to the present invention is applied to a lens interchangeable digital single-lens reflex camera will be described. However, the focus detection apparatus according to the present invention can be applied to any electronic device having an image sensor that can generate a signal used for phase difference detection focus detection. Examples of the electronic device include a digital camera of a type in which a lens cannot be exchanged, a video camera, a mobile phone equipped with a camera, a personal computer, a game machine, and a home appliance.

本実施形態の焦点検出装置は、像面位相差方式の焦点検出を行う焦点検出装置であり、一対の視差画像信号(A像信号とB像信号)を用い、A像信号に対するB像信号の位相シフト量(位相差ともいう)を変化させて相関演算を行い、相関演算曲線を取得する。そして、相関量が最小値をとる(つまり、相関が最大となる)位相差を探索し、探索結果に基づいてデフォーカス量を取得する。尚、B像信号はA+B像信号とA像信号との差分から取得する。その際、逆波形ノイズの影響を受けやすい範囲において取得した相関量を別の値で置き換え、置き換えた後の相関量を用いて相関量が最小値をとる位相差を探索する。置き換える値は、取得した相関量から逆波形ノイズの影響を低減した値であり、これにより逆波形ノイズの影響を低減して焦点検出を行うことができる。   The focus detection apparatus of the present embodiment is a focus detection apparatus that performs focus detection by an image plane phase difference method, and uses a pair of parallax image signals (A image signal and B image signal), and the B image signal with respect to the A image signal. A correlation calculation is performed by changing a phase shift amount (also referred to as a phase difference) to obtain a correlation calculation curve. Then, the phase difference having the minimum correlation amount (that is, the correlation is maximized) is searched, and the defocus amount is acquired based on the search result. The B image signal is obtained from the difference between the A + B image signal and the A image signal. At this time, the correlation amount acquired in a range susceptible to the influence of the inverse waveform noise is replaced with another value, and the phase difference at which the correlation amount takes the minimum value is searched using the correlation amount after the replacement. The replacement value is a value obtained by reducing the influence of the inverse waveform noise from the acquired correlation amount, whereby the focus detection can be performed while reducing the influence of the inverse waveform noise.

以下、本実施形態について、図面を参照して詳細に説明する。   Hereinafter, the present embodiment will be described in detail with reference to the drawings.

<デジタルカメラシステムの構成>
図1は、本実施形態に係る撮像装置の一例であるデジタルカメラシステムの概略構成を示す図である。
<Configuration of digital camera system>
FIG. 1 is a diagram illustrating a schematic configuration of a digital camera system which is an example of an imaging apparatus according to the present embodiment.

図1において、デジタルカメラシステムは、レンズ部100とカメラ部200を備える。レンズ部100は、不図示のマウント部のレンズ装着機構を介してカメラ部200に着脱可能に取り付けられている。マウント部には、電気接点ユニット108が設けられている。この電気接点ユニット108には、通信クロックライン、データ送信ライン、データ受信ラインなどからなる通信バスライン用の端子がある。これらにより、レンズ部100とカメラ部200が通信可能になっている。   In FIG. 1, the digital camera system includes a lens unit 100 and a camera unit 200. The lens unit 100 is detachably attached to the camera unit 200 via a lens mounting mechanism of a mount unit (not shown). An electrical contact unit 108 is provided on the mount portion. The electrical contact unit 108 has a communication bus line terminal including a communication clock line, a data transmission line, a data reception line, and the like. As a result, the lens unit 100 and the camera unit 200 can communicate with each other.

レンズ部100には、撮像光学系を構成し、フォーカスレンズやズームレンズを有するレンズ群101、及び入射光線を制御する絞り102が設けられている。また、レンズ群101のズームやフォーカスを行うためのステッピングモータからなる駆動系(不図示)、及び駆動系を制御するレンズ駆動ユニット103が設けられている。レンズ駆動ユニット103と駆動系は焦点調節手段を構成する。   The lens unit 100 includes a lens group 101 that forms an imaging optical system and includes a focus lens and a zoom lens, and a diaphragm 102 that controls incident light. In addition, a drive system (not shown) including a stepping motor for performing zoom and focus of the lens group 101 and a lens drive unit 103 for controlling the drive system are provided. The lens driving unit 103 and the driving system constitute a focus adjusting unit.

また、レンズ部100には、絞り102の開口を制御する絞り制御ユニット104と、レンズ群101のズーム、フォーカス、絞りの各種光学設計値が記録された光学情報記録部106が設けられている。   In addition, the lens unit 100 includes an aperture control unit 104 that controls the aperture of the aperture 102 and an optical information recording unit 106 that records various optical design values of the zoom, focus, and aperture of the lens group 101.

レンズ駆動ユニット103、絞り制御ユニット104、および光学情報記録部106は、レンズ部100全体の動作を制御するCPUからなるレンズコントローラ105に接続されている。   The lens driving unit 103, the aperture control unit 104, and the optical information recording unit 106 are connected to a lens controller 105 that includes a CPU that controls the operation of the entire lens unit 100.

また、レンズ部100には、レンズ駆動ユニット103に内包されたステッピングモータの位相波形を、レンズ駆動ユニット103からレンズコントローラ105を通じて取得してレンズの位置情報を検出するレンズ位置検出部107が設けられている。   In addition, the lens unit 100 is provided with a lens position detection unit 107 that acquires the phase waveform of the stepping motor included in the lens driving unit 103 from the lens driving unit 103 through the lens controller 105 and detects lens position information. ing.

カメラ部200は、レンズ部100と電気接点ユニット108を介して通信を行い、レンズ群101のズームやフォーカス、絞り102の開口について制御要求を送信し、制御結果を受信する。   The camera unit 200 communicates with the lens unit 100 via the electrical contact unit 108, transmits a control request for the zoom and focus of the lens group 101, and the aperture of the diaphragm 102, and receives a control result.

入射光線は、レンズ群101及び絞り102を介して、カメラ部200内における不図示の撮像素子及び現像演算を行うプロセッサからなる撮像部213へ導かれる。撮像部213では、入射した被写体像を光電変換して現像演算することで撮像データが得られる。   The incident light beam is guided through the lens group 101 and the diaphragm 102 to an image capturing unit 213 that includes an image sensor (not shown) and a processor that performs a development operation in the camera unit 200. In the imaging unit 213, imaging data is obtained by photoelectrically converting an incident subject image and performing development calculation.

また、カメラ部200には、カメラ部200へ操作入力を行うための操作スイッチ214が設けられている。操作スイッチ214は、2段ストロークタイプのスイッチで構成されている。1段目のスイッチ(SW1)は、撮像信号を用いた測光や焦点検出など撮影準備動作を開始させるためのスイッチである。2段目のスイッチ(SW2)は、静止画を取得するため、撮像部213で電荷蓄積及び電荷読み出しといった撮影動作を開始させるためのスイッチである。   In addition, the camera unit 200 is provided with an operation switch 214 for performing an operation input to the camera unit 200. The operation switch 214 is a two-stage stroke type switch. The first-stage switch (SW1) is a switch for starting a shooting preparation operation such as photometry or focus detection using an imaging signal. The second-stage switch (SW2) is a switch for starting an imaging operation such as charge accumulation and charge reading in the imaging unit 213 in order to acquire a still image.

撮像部213は、光電変換部を有する画素を複数有する撮像素子と、撮像素子から出力されたアナログ信号である電気信号を、デジタルデータである像信号に変換するA/D変換器とを備える。撮像素子としては、例えばCCDイメージセンサーやCMOSイメージセンサーを用いることができる。また、A/D変換器は撮像素子に組み込まれていても良い。尚、本明細書では、画素が像信号に対応する電気信号を出力することを、単に、画素が像信号を出力するということがある。撮像素子が有する画素のうち、少なくとも一部の画素は焦点検出のために用いる像信号を出力可能である。画素で光電変換して得られた焦点検出用の像信号は、カメラコントローラ215と接続されているメモリ216に一時記憶される。メモリ216に一時記憶された一対の視差画像信号(以下、単に一対の像信号と呼ぶことがある)は、カメラコントローラ215と接続されている画素加算部217へ送られる。   The imaging unit 213 includes an imaging device having a plurality of pixels each including a photoelectric conversion unit, and an A / D converter that converts an electrical signal that is an analog signal output from the imaging device into an image signal that is digital data. As the image sensor, for example, a CCD image sensor or a CMOS image sensor can be used. Further, the A / D converter may be incorporated in the image sensor. In this specification, a pixel may output an electric signal corresponding to an image signal, and a pixel may simply output an image signal. Of the pixels included in the image sensor, at least some of the pixels can output an image signal used for focus detection. An image signal for focus detection obtained by photoelectric conversion at the pixel is temporarily stored in a memory 216 connected to the camera controller 215. A pair of parallax image signals (hereinafter simply referred to as a pair of image signals) temporarily stored in the memory 216 is sent to the pixel addition unit 217 connected to the camera controller 215.

画素加算部217は、一対の視差画像信号に対して、位置的に対応する画素から得られた像信号を、加算カウンタ218でカウントされた回数が所定回数に達するまで加算する。加算された一対の像信号は、カメラコントローラ215と接続されている相関量取得手段である相関演算部219へ送られ、相関演算部219は相関演算により一対の像信号の位相シフト量ごとの相関量を取得し、相関演算曲線を取得する。この相関演算は第1の位相シフト範囲で行うものとする。取得された相関量は、後述する所定条件において、相関量を置換する置換手段である相関量補間部230で、一部の相関量(第2の位相シフト範囲の相関量)の置換を行う。相関量補間部の詳細な動作は別途詳細に後述するが、相関量を置換する範囲における相関量を、相関量を置換しない範囲における相関量から補間する要領で置換後の相関量を取得するため、本実施形態では置換手段を相関量補間部230と呼ぶものとする。相関量補間部230から出力された相関量は、カメラコントローラ215と接続されている相関量加算部220で、加算カウンタ218でカウントされた回数が所定回数に達するまで加算される。加算された相関量は、位相差検出部221へ送られ、最も相関量が高くなる位相差(相関量が最小値を示す位相差)が取得される。   The pixel addition unit 217 adds the image signal obtained from the positionally corresponding pixel to the pair of parallax image signals until the number of times counted by the addition counter 218 reaches a predetermined number. The added pair of image signals is sent to a correlation calculation unit 219 which is a correlation amount acquisition unit connected to the camera controller 215, and the correlation calculation unit 219 performs correlation for each phase shift amount of the pair of image signals. Get the quantity and get the correlation calculation curve. This correlation calculation is performed in the first phase shift range. The acquired correlation amount is subjected to replacement of a part of the correlation amount (correlation amount in the second phase shift range) by a correlation amount interpolation unit 230 which is a replacement unit for replacing the correlation amount under a predetermined condition described later. The detailed operation of the correlation amount interpolation unit will be described later in detail. In order to acquire the correlation amount after replacement in the manner of interpolating the correlation amount in the range in which the correlation amount is replaced from the correlation amount in the range in which the correlation amount is not replaced. In this embodiment, the replacement means is referred to as a correlation amount interpolation unit 230. The correlation amount output from the correlation amount interpolation unit 230 is added by the correlation amount addition unit 220 connected to the camera controller 215 until the number of times counted by the addition counter 218 reaches a predetermined number. The added correlation amount is sent to the phase difference detection unit 221 to obtain the phase difference having the highest correlation amount (phase difference indicating the minimum correlation amount).

デフォーカス量取得手段であるデフォーカス量検出部222は、位相差検出部221で取得された位相差とレンズ部100の光学特性に基づいて、公知の位相差検出方式によりデフォーカス量を取得する。算出されたデフォーカス量は、デフォーカス量加算部223へ送られ、加算カウンタ218でカウントされた回数が所定回数に達するまで加算される。   A defocus amount detection unit 222 that is a defocus amount acquisition unit acquires a defocus amount by a known phase difference detection method based on the phase difference acquired by the phase difference detection unit 221 and the optical characteristics of the lens unit 100. . The calculated defocus amount is sent to the defocus amount addition unit 223, and is added until the number of times counted by the addition counter 218 reaches a predetermined number.

尚、相関量取得手段のことを第1の取得手段、デフォーカス量取得手段を第2の取得手段と呼ぶことがある。   The correlation amount acquisition unit may be referred to as a first acquisition unit, and the defocus amount acquisition unit may be referred to as a second acquisition unit.

カメラコントローラ215は、電気接点ユニット108を介してレンズコントローラ105と制御情報を送受信し、デフォーカス量検出部222またはデフォーカス量加算部223で算出されたデフォーカス量に基づいて、レンズ群101の焦点位置を制御する。   The camera controller 215 transmits / receives control information to / from the lens controller 105 via the electrical contact unit 108, and based on the defocus amount calculated by the defocus amount detection unit 222 or the defocus amount addition unit 223, Control the focal position.

本実施形態におけるデジタルカメラは、撮像部213で撮像された被写体像や各種の操作状況を表示する表示部224と、撮像部213の動作を後述する2つの動作モード、ライブビューモードあるいは動画記録モードに切り替えるための操作部225を備える。また、デジタルカメラでは、電源投入とともにライブビューモードが自動で設定され、撮像部213で撮像を開始して、撮像した被写体像が現像演算されて表示部224で表示される。撮像部213で撮像された静止画や動画は、所定のデータフォーマットで記録部226に記録される。   The digital camera according to the present embodiment includes a display unit 224 that displays a subject image captured by the imaging unit 213 and various operation situations, and two operation modes, a live view mode or a moving image recording mode, which will be described later. An operation unit 225 for switching to is provided. Further, in the digital camera, the live view mode is automatically set when the power is turned on, the imaging unit 213 starts imaging, the captured subject image is developed and displayed on the display unit 224. Still images and moving images captured by the imaging unit 213 are recorded in the recording unit 226 in a predetermined data format.

また、デジタルカメラは、撮像部213の温度を計測する温度測定部227と、撮像部213からの像信号を用いて、相関演算部219による相関演算の対象となる視差画像信号対を生成する画像処理手段とを備える。本実施形態のデジタルカメラは、画像処理手段として、撮像部213からの2つの像信号を入力して一方の像信号から他方を減算する画素減算部228と、像信号に1次元のローパスフィルタリング(LPF)を行うLPF処理部229を備える。   In addition, the digital camera uses a temperature measurement unit 227 that measures the temperature of the imaging unit 213 and an image signal from the imaging unit 213 to generate a parallax image signal pair that is a target of correlation calculation by the correlation calculation unit 219. And processing means. The digital camera of the present embodiment has, as image processing means, a pixel subtraction unit 228 that inputs two image signals from the imaging unit 213 and subtracts the other from one image signal, and one-dimensional low-pass filtering ( LPF processing unit 229 for performing (LPF).

次に、撮像素子の構成について、図2〜7を用いて説明をする。   Next, the configuration of the image sensor will be described with reference to FIGS.

図2は、撮像素子の受光面を入射光側から見た模式図である。撮像素子が備える画素のそれぞれは、射出瞳面で分割された一対の光線がそれぞれ入射する第1の副画素S1および第2の副画素S2を備える。第1の副画素S1には、射出瞳の第1の瞳領域を通過する光束が入射し、第2の副画素S2には、射出瞳の第2の瞳領域を通過する光束が入射する。第1の副画素S1および第2の副画素S2の前面には、集光用にマイクロレンズMLが配置されている。撮像素子の受光面には、第1の副画素S1、第2の副画素S2、およびマイクロレンズMLを組とする画素が、水平方向にh画素、垂直方向にv画素配置されている。第1及び第2の副画素S1、S2からの像信号は焦点検出用に、単位画素からの像信号は撮像用に用いることができる。また、同じ画素を構成する第1の副画素と第2の副画素のことを、対をなす副画素ということがある。対をなす副画素同士には、同一のマイクロレンズMLを通過した光束が入射する。   FIG. 2 is a schematic view of the light receiving surface of the image sensor as viewed from the incident light side. Each of the pixels included in the imaging device includes a first sub-pixel S1 and a second sub-pixel S2 into which a pair of light beams divided on the exit pupil plane respectively enter. A light beam passing through the first pupil region of the exit pupil is incident on the first subpixel S1, and a light beam passing through the second pupil region of the exit pupil is incident on the second subpixel S2. Microlenses ML are disposed on the front surfaces of the first subpixel S1 and the second subpixel S2 for condensing light. On the light receiving surface of the image sensor, pixels each including the first sub-pixel S1, the second sub-pixel S2, and the micro lens ML are arranged in the horizontal direction as h pixels and in the vertical direction as v pixels. The image signals from the first and second subpixels S1 and S2 can be used for focus detection, and the image signal from the unit pixel can be used for imaging. In addition, the first subpixel and the second subpixel that constitute the same pixel may be referred to as a subpixel that forms a pair. Light beams that have passed through the same microlens ML are incident on the sub-pixels forming a pair.

図3は、画素の回路構成を示す図である。画素300は、第1のフォトダイオード301A、第2のフォトダイオード301B、第1の転送スイッチ302A、第2の転送スイッチ302B、フローティングディフュージョン領域303を備える。さらに、画素300は、増幅部304、リセットスイッチ305、選択スイッチ306を備える。符号308は共通電源VDDである。尚、第1のフォトダイオード301Aと第1の転送スイッチ302Aは第1の副画素S1を構成し、第2のフォトダイオード301Bと第2の転送スイッチ302Bは第2の副画素S2を構成する。   FIG. 3 is a diagram illustrating a circuit configuration of a pixel. The pixel 300 includes a first photodiode 301A, a second photodiode 301B, a first transfer switch 302A, a second transfer switch 302B, and a floating diffusion region 303. Further, the pixel 300 includes an amplifying unit 304, a reset switch 305, and a selection switch 306. Reference numeral 308 denotes a common power supply VDD. The first photodiode 301A and the first transfer switch 302A constitute the first subpixel S1, and the second photodiode 301B and the second transfer switch 302B constitute the second subpixel S2.

第1と第2のフォトダイオード301Aおよび301Bは、同一のマイクロレンズMLを通過してそれぞれに入射する光線を光電変換する。第1および第2の転送スイッチ302Aおよび302Bは、それぞれ第1と第2のフォトダイオード301Aおよび301Bで発生した電荷を、選択的に共通のフローティングディフュージョン領域303へ転送するよう制御する。第1と第2の転送スイッチ302Aおよび302Bは、それぞれ第1および第2の転送パルス信号PTXAおよびPTXBによって制御される。フローティングディフュージョン領域303は、第1と第2のフォトダイオード301Aおよび301Bからそれぞれ転送された電荷を一時的に保持する。このフローティングディフュージョン領域303は、保持した電荷を電圧信号に変換する作用をもたらす。増幅部304は、ソースフォロワMOSトランジスタで構成され、フローティングディフュージョン領域303に保持された電荷に基づく電圧信号を増幅して、画素信号として出力する。リセットスイッチ305は、フローティングディフュージョン領域303の電位を基準電位VDDにリセットする。リセットスイッチ305は、リセットパルス信号PRESにより制御される。選択スイッチ306は、増幅部304から垂直出力線307への画素信号の出力を制御する。選択スイッチ306は、垂直選択パルス信号PSELにより制御される。   The first and second photodiodes 301A and 301B photoelectrically convert light rays that pass through the same microlens ML and are incident on each. The first and second transfer switches 302A and 302B control to selectively transfer charges generated in the first and second photodiodes 301A and 301B to the common floating diffusion region 303, respectively. The first and second transfer switches 302A and 302B are controlled by first and second transfer pulse signals PTXA and PTXB, respectively. The floating diffusion region 303 temporarily holds the charges transferred from the first and second photodiodes 301A and 301B, respectively. The floating diffusion region 303 has an effect of converting the retained charge into a voltage signal. The amplifying unit 304 is composed of a source follower MOS transistor, amplifies a voltage signal based on the charge held in the floating diffusion region 303, and outputs it as a pixel signal. The reset switch 305 resets the potential of the floating diffusion region 303 to the reference potential VDD. The reset switch 305 is controlled by a reset pulse signal PRES. The selection switch 306 controls the output of the pixel signal from the amplification unit 304 to the vertical output line 307. The selection switch 306 is controlled by a vertical selection pulse signal PSEL.

図4は、画素300の回路の駆動を示すタイミングチャートである。   FIG. 4 is a timing chart showing driving of the circuit of the pixel 300.

はじめに、時刻t1乃至t2の間において、リセットパルス信号PRESがHighの状態で、第1と第2の転送パルス信号PTXAおよびPTXBをHighにすることにより、第1と第2のフォトダイオード301Aおよび301Bをリセットする。   First, between time t1 and t2, the first and second photodiodes 301A and 301B are set by setting the first and second transfer pulse signals PTXA and PTXB to High while the reset pulse signal PRES is High. To reset.

時刻t2において、第1と第2の転送パルス信号PTXAおよびPTXBをLowにすることで、第1と第2のフォトダイオード301Aおよび301Bでの電荷の蓄積を開始する。   At time t2, the first and second transfer pulse signals PTXA and PTXB are set to Low to start accumulation of electric charges in the first and second photodiodes 301A and 301B.

所望の露光量に基づく必要時間だけ電荷蓄積を行った後、時刻t3において、垂直選択パルス信号PSELをHighにすることで、選択スイッチ306をONにする。つづいて時刻t4において、リセットパルス信号PRESをLowにすることで、フローティングディフュージョン領域303のリセットを解除する。   After the charge is accumulated for a necessary time based on the desired exposure amount, the vertical selection pulse signal PSEL is set to High at time t3 to turn on the selection switch 306. Subsequently, at time t4, the reset pulse signal PRES is set to Low to release the reset of the floating diffusion region 303.

時刻t5乃至t6の間において、第1の転送パルス信号PTXAをHighにすることで、第1の転送スイッチ302AをONにして、第1のフォトダイオード301Aの電荷をフローティングディフュージョン領域303へ転送する。   Between time t5 and time t6, the first transfer pulse signal PTXA is set to High, thereby turning on the first transfer switch 302A and transferring the charge of the first photodiode 301A to the floating diffusion region 303.

時刻t6において、第1の転送パルス信号PTXAをLowにすることで、第1のフォトダイオード301Aに蓄積された電荷がフローティングディフュージョン領域303に読み出される。電荷が読み出されることで、電位の変化に応じた電圧信号が増幅部304と選択スイッチ306を経て、第1の焦点検出画素信号として垂直出力線307に出力される。   At time t6, the first transfer pulse signal PTXA is set to Low, so that the charge accumulated in the first photodiode 301A is read to the floating diffusion region 303. By reading the charge, a voltage signal corresponding to the change in potential is output to the vertical output line 307 as the first focus detection pixel signal via the amplifier 304 and the selection switch 306.

時刻t7乃至t8の間において、第1の転送パルス信号PTXAをHighにすると同時に第2の転送パルス信号PTXBもHighにすることで、第1と第2の転送スイッチ302Aおよび302BをONにする。これにより、第1と第2のフォトダイオード301Aおよび301Bの電荷が、同時にフローティングディフュージョン領域303へ転送される。   Between time t7 and time t8, the first and second transfer switches 302A and 302B are turned ON by setting the first transfer pulse signal PTXA to High and simultaneously setting the second transfer pulse signal PTXB to High. As a result, the charges of the first and second photodiodes 301 </ b> A and 301 </ b> B are simultaneously transferred to the floating diffusion region 303.

時刻t8において、第1と第2の転送パルス信号PTXAおよびPTXBをLowにすることで、転送された電荷がフローティングディフュージョン領域303に読み出される。電荷が読み出されることで、電位の変化に応じた電圧信号が増幅部304と選択スイッチ306を経て、第1と第2の焦点検出画素信号の加算信号として垂直出力線307に出力される。   At time t8, the first and second transfer pulse signals PTXA and PTXB are set to Low, so that the transferred charges are read to the floating diffusion region 303. By reading the charge, a voltage signal corresponding to the change in potential is output to the vertical output line 307 as an addition signal of the first and second focus detection pixel signals through the amplifier 304 and the selection switch 306.

時刻t9において、リセットパルス信号PRESをHighにすることにより、フローティングディフュージョン領域303をリセットする。   At time t9, the reset pulse signal PRES is set to High to reset the floating diffusion region 303.

以上の動作が単位画素ごとに順次行われ、第1の副画素の画素列から取得される像信号と、第1と第2の副画素の画素列から取得される像信号の加算信号の読み出しが完了する。尚、本明細書では、第1の副画素の画素列から取得される像信号をA像信号、第2の副画素の画素列から取得される像信号をB像信号とし、第1と第2の副画素の画素列から取得される像信号をA+B像信号とする。   The above operation is sequentially performed for each unit pixel, and an image signal acquired from the pixel column of the first subpixel and an addition signal of the image signal acquired from the pixel column of the first and second subpixels are read out. Is completed. In this specification, an image signal acquired from the pixel row of the first subpixel is an A image signal, and an image signal acquired from the pixel row of the second subpixel is a B image signal. An image signal acquired from the pixel row of the second sub-pixel is assumed to be an A + B image signal.

読み出されたA像信号およびA+B像信号は、画素減算部228に入力され、これらの像信号の差分をとることで、電気的に第2の副画素の画素列の像信号(B像信号)が生成される。尚、本発明および本明細書においては、本実施形態のように、実際にはB像信号のみの読み出しをせず、間接的にB像信号を取得する場合であっても、B像信号は第2の副画素又は第2のフォトダイオード301Bから得られるとする。   The read A image signal and A + B image signal are input to the pixel subtracting unit 228, and by taking a difference between these image signals, an image signal (B image signal) of the pixel column of the second sub-pixel is electrically obtained. ) Is generated. In the present invention and the present specification, as in the present embodiment, even when the B image signal is indirectly acquired without actually reading out only the B image signal, It is assumed that it is obtained from the second subpixel or the second photodiode 301B.

図5は図2における単位画素の構造を示す断面図である。図5において、第1の副画素S1及び第2の副画素S2の光入射側には、マイクロレンズMLが配置されている。符号501は、マイクロレンズMLを配置するための平面を構成する平滑層である。遮光層502の下流には、第1及び第2のフォトダイオード301A、301Bが配置されており、射出瞳の第1の瞳領域を通過する光束は第1のフォトダイオード301Aへ、射出瞳の第2の瞳領域を通過する光束は第2のフォトダイオード301Bへ入射する。単位画素がこのような構成を有することにより、撮像光学系の瞳が対称に分割され、分割されたそれぞれの光束に対応する像信号が取得できる。   FIG. 5 is a cross-sectional view showing the structure of the unit pixel in FIG. In FIG. 5, a microlens ML is disposed on the light incident side of the first subpixel S1 and the second subpixel S2. Reference numeral 501 denotes a smooth layer that forms a plane on which the microlenses ML are arranged. Downstream of the light shielding layer 502, the first and second photodiodes 301A and 301B are arranged, and the light beam passing through the first pupil region of the exit pupil is directed to the first photodiode 301A. The light beam that passes through the second pupil region enters the second photodiode 301B. When the unit pixel has such a configuration, the pupil of the imaging optical system is divided symmetrically, and image signals corresponding to the divided light beams can be acquired.

<第1と第2の副画素の画素列から取得される像信号を用いた焦点検出>
図2において、対をなす第1の副画素の列と第2の副画素の列とから取得される像信号は、副画素列を構成する副画素の数が多くなるにつれて近似した2像となる。撮像光学系が被写体に対してピントが合っている状態では、第1の副画素S1の画素列から出力されるA像信号と、第2の副画素S2の画素列から出力されるB像信号は互いにほぼ一致する。これに対して、撮像光学系のピントがずれていると、A像信号とB像信号には、位相差が生じる。そして、その位相差の方向は前ピン状態と後ピン状態とで逆になる。
<Focus detection using image signals acquired from the pixel rows of the first and second sub-pixels>
In FIG. 2, an image signal acquired from the first subpixel column and the second subpixel column that form a pair includes two images approximated as the number of subpixels constituting the subpixel column increases. Become. When the imaging optical system is in focus with respect to the subject, the A image signal output from the pixel column of the first subpixel S1 and the B image signal output from the pixel column of the second subpixel S2 Are almost identical to each other. On the other hand, if the imaging optical system is out of focus, a phase difference occurs between the A image signal and the B image signal. The direction of the phase difference is reversed between the front pin state and the rear pin state.

図6は、ピントが合ったときの第1の副画素S1と第2の副画素S2の像信号の位相差を示す図である。一方、図7は、ピントが合っていないときの第1の副画素S1と第2の副画素S2の像信号の位相差を示す図である。   FIG. 6 is a diagram illustrating the phase difference between the image signals of the first subpixel S1 and the second subpixel S2 when in focus. On the other hand, FIG. 7 is a diagram showing the phase difference between the image signals of the first subpixel S1 and the second subpixel S2 when the image is out of focus.

被写体上の特定の点からの光束は、副画素S1に対応する分割瞳である第1の瞳領域を通って該副画素S1に入射する光束ΦLaと、副画素S2に対応する分割瞳である第2の瞳領域を通って該副画素S2に入射する光束ΦLbとに分割される。光束ΦLaは第1のフォトダイオード301Aに、光束ΦLbは、第2のフォトダイオード301Bにそれぞれ入射する。これら2つの光束は、被写体上の同一点から入射しているため、撮像光学系のピントが合った状態では、図6に示すように、同一のマイクロレンズMLを通過して撮像素子上の隣り合う副画素S1S2に到達する。したがって、第1の副画素S1の列から出力される一列の像信号と、第2の副画素S2の列から出力される一列の像信号は互いにほぼ一致する。 A light flux from a specific point on the subject is a light flux ΦLa that enters the subpixel S1 through the first pupil region that is a split pupil corresponding to the subpixel S1, and a split pupil corresponding to the subpixel S2. The light beam ΦLb is incident on the sub-pixel S2 through the second pupil region. The light flux ΦLa is incident on the first photodiode 301A, and the light flux ΦLb is incident on the second photodiode 301B. Since these two light beams are incident from the same point on the subject, when the imaging optical system is in focus, the two light beams pass through the same microlens ML as shown in FIG. The matching sub-pixels S1 and S2 are reached. Accordingly, the image signal of one column output from the column of the first sub-pixel S1 and the image signal of one column output from the column of the second sub-pixel S2 are substantially coincident with each other.

しかしながら、図7に示すように、xだけピントがずれている状態では、光束ΦLa,ΦLbのマイクロレンズへの入射角の変化分だけ両光束ΦLa,ΦLbの到達位置が互いにずれる。よって、被写体上の同一点からの光は異なるマイクロレンズMLを通過して撮像素子上で離れた副画素S1S2に到達し、それぞれが有する第1及び第2のフォトダイオード301A、301Bに入射する。したがって、第1の副画素S1の列から出力される一列の像信号と、第2の副画素S2の列から出力される一列の像信号には、位相差が生じる。 However, as shown in FIG. 7, in a state where the focus is shifted by x, the arrival positions of the two light beams ΦLa and ΦLb are shifted from each other by the change in the incident angle of the light beams ΦLa and ΦLb to the microlens. Therefore, light from the same point on the subject passes through different microlenses ML and reaches the subpixels S1 and S2 separated on the image sensor, and is incident on the first and second photodiodes 301A and 301B that each has. To do. Therefore, a phase difference is generated between the image signal of one column output from the column of the first subpixel S1 and the image signal of one column output from the column of the second subpixel S2.

<位相差とデフォーカス量の関係>
図8は、副画素S1の列及び副画素S2の列からなる一対の副画素列における像信号の位相シフト量とレンズ群101の焦点位置のデフォーカス量との関係を示す図である。図8に示すように、像信号の位相シフト量(横軸)が大きくなるにつれてデフォーカス量(縦軸)が単調に増加する。また、位相シフトの向きとデフォーカス量の向き(至近側/無限側)が対応する。
<Relationship between phase difference and defocus amount>
FIG. 8 is a diagram illustrating a relationship between the phase shift amount of the image signal and the defocus amount of the focal position of the lens group 101 in a pair of subpixel columns including the subpixel S1 column and the subpixel S2 column. As shown in FIG. 8, the defocus amount (vertical axis) monotonously increases as the phase shift amount (horizontal axis) of the image signal increases. Further, the direction of the phase shift corresponds to the direction of the defocus amount (closest side / infinite side).

図9は、デフォーカス量が小さいときの像信号を表した模式図、図10は、デフォーカス量が大きいときの像信号を表した模式図である。   FIG. 9 is a schematic diagram showing an image signal when the defocus amount is small, and FIG. 10 is a schematic diagram showing an image signal when the defocus amount is large.

瞳面で分割された光線が画素列上に2次結像された被写体像のうち、副画素S1の画素列で取得された像信号に基づく像をA像、副画素S2の画素列で取得された像信号に基づく像をB像と呼ぶものとする。尚、A像及びB像はそれぞれ、副画素S1、S2の列の光軸中心位置に対してオフセットを持って結像している。また、A像とB像の各オフセットは光軸中心に対して対称である。   Of the subject image in which the light beam divided on the pupil plane is secondarily formed on the pixel column, an image based on the image signal acquired in the pixel column of the subpixel S1 is acquired in the pixel column of the A pixel and the subpixel S2. An image based on the obtained image signal is referred to as a B image. The A image and the B image are formed with an offset with respect to the optical axis center position of the sub-pixels S1 and S2. Further, each offset of the A image and the B image is symmetric with respect to the optical axis center.

図9はデフォーカス量が小さい場合を示しており、図10はデフォーカス量が大きい場合を示している。図10における光軸中心位置に対するオフセットが、図10のそれに比べて大きくなっている。このように、レンズ群101の焦点位置のデフォーカス量に応じて、副画素S1の列と副画素S2の列のそれぞれに結像される2つの被写体像の位相差が変化する。位相差は、公知の手法によりデフォーカス量に変換することができ、さらにデフォーカス量とレンズ群101の倍率関係に基づき、公知の手法により被写体までの距離を算出することもできる。   FIG. 9 shows a case where the defocus amount is small, and FIG. 10 shows a case where the defocus amount is large. The offset with respect to the optical axis center position in FIG. 10 is larger than that in FIG. As described above, the phase difference between the two subject images formed on the column of the subpixel S1 and the column of the subpixel S2 changes according to the defocus amount of the focal position of the lens group 101. The phase difference can be converted into a defocus amount by a known method, and the distance to the subject can be calculated by a known method based on the relationship between the defocus amount and the magnification ratio of the lens group 101.

<デフォーカス量の加算平均による信頼性向上>
次に、位相差検出方式による焦点検出結果を加算平均することによる、焦点検出結果の信頼性向上について説明する。
<Improving reliability by averaging the defocus amount>
Next, improvement in the reliability of the focus detection result by averaging the focus detection results by the phase difference detection method will be described.

位相差検出方式による焦点検出では、カメラのフォーカス状態と被写体像の合焦位置との差分が検出される。例えば低輝度で十分な信号が得られていない場合、被写体像の信号に含まれるノイズの比率が高まるために信号に歪みが生じて、位相差を算出する際の相関演算に誤差が生じる。その結果、デフォーカス量にばらつきが生じて誤差が生じる。例えば、ノイズレベルより被写体像の信号レベルの方が大きい場合、焦点検出画素で得られる被写体像の信号は、ノイズによる変形が軽微なため、一対の視差画像信号に基づくデフォーカス量は比較的正確に求められる。この場合、同一条件で複数回デフォーカス量を取得し、取得した複数のデフォーカス量の結果を加算平均することで、デフォーカス量のばらつきを抑えることができ、焦点検出精度を向上できる。一方、被写体像の信号レベルよりノイズレベルの方が大きい場合、焦点検出画素で得られる被写体像の信号は、ノイズによる変形が著しく、一対の視差画像信号に基づくデフォーカス量は、被写体像に無関係の誤った結果を示すことが多い。この場合、同一条件で複数のデフォーカス量を取得し、その結果を加算平均しても、被写体像によらない結果の平均をとることとなる。よって、結果サンプルをいくら増やしても焦点検出精度の向上は見込めない。   In focus detection by the phase difference detection method, the difference between the focus state of the camera and the focus position of the subject image is detected. For example, when a sufficient signal is not obtained with low luminance, the ratio of noise included in the signal of the subject image increases, so that the signal is distorted, and an error occurs in the correlation calculation when calculating the phase difference. As a result, the defocus amount varies and an error occurs. For example, when the signal level of the subject image is higher than the noise level, the signal of the subject image obtained by the focus detection pixel is not significantly deformed by noise, so the defocus amount based on the pair of parallax image signals is relatively accurate. Is required. In this case, by obtaining the defocus amount a plurality of times under the same condition and averaging the obtained results of the plurality of defocus amounts, variations in the defocus amount can be suppressed, and focus detection accuracy can be improved. On the other hand, when the noise level is higher than the signal level of the subject image, the subject image signal obtained by the focus detection pixel is significantly deformed by noise, and the defocus amount based on the pair of parallax image signals is irrelevant to the subject image. Often show incorrect results. In this case, even if a plurality of defocus amounts are acquired under the same conditions and the results are added and averaged, the average of the results not depending on the subject image is taken. Therefore, no matter how many result samples are added, the focus detection accuracy cannot be improved.

そこで、本実施形態では、ノイズレベルより被写体像の信号レベルが低くなる低輝度といった被写体条件において、後述する相関量の置き換えを行うことにより、焦点検出精度を向上させる。尚、デフォーカス量の加算平均と相関量の置き換えとを併用することも可能である。   Therefore, in the present embodiment, the focus detection accuracy is improved by replacing the correlation amount described later under the subject condition such as low luminance where the signal level of the subject image is lower than the noise level. It is also possible to use both the defocus amount addition average and the correlation amount replacement.

<瞳分割した一方の像信号にノイズが混入することによる他方の像信号への影響>
次に、第1あるいは第2の副画素列にノイズが混入した場合の、像信号と相関量について説明する。
<Influence on the other image signal when noise is mixed in one image signal obtained by pupil division>
Next, the image signal and the correlation amount when noise is mixed in the first or second subpixel column will be described.

図11は、説明用に分かりやすい図形パターンで示したパターン被写体1200である。パターン被写体1200は、灰色部1201と白色部1202で構成されている。図11において、説明用に着目する、焦点検出に用いる画素列の領域(いわゆる焦点検出領域)を1203とする。   FIG. 11 shows a pattern subject 1200 shown in a graphic pattern that is easy to understand for explanation. The pattern subject 1200 includes a gray portion 1201 and a white portion 1202. In FIG. 11, an area of a pixel column used for focus detection (so-called focus detection area), which is focused on for explanation, is 1203.

図12は、図11に示すパターン被写体1200に対するA像信号(b)、B像信号(c)、及びA+B像信号(a)を示したグラフである。なお、レンズ群101の焦点は合焦状態で、A像信号とB像信号とに位相差が生じていないものとする。   FIG. 12 is a graph showing an A image signal (b), a B image signal (c), and an A + B image signal (a) for the pattern subject 1200 shown in FIG. It is assumed that the focus of the lens group 101 is in focus and no phase difference occurs between the A image signal and the B image signal.

図12(a)は加算信号であるA+B像信号のグラフであり、水平方向のX座標がX乃至Xの区間とX乃至Xの区間における輝度の低い灰色部1201の像信号出力がYで示されている。また、X乃至Xの区間における輝度の高い白色部1202の像信号出力がYで示されている。撮像部213で発生する暗電流の影響により、入射光量の無い状態でも一定の信号値が加わるため、その信号レベルがOBで示されている
図12(b)は第1の副画素列の像信号であるA像信号を示すグラフであり、図12(c)は第2の副画素列の像信号であるB信号を示すグラフである。図12(b)と(c)において、水平方向のX座標がX乃至Xの区間とX乃至Xの区間における輝度の低い灰色部1201の像信号出力がYで示されている。また、X乃至Xの区間における輝度の高い白色部1202の像信号出力がYで示されている。ここで、第1と第2の副画素列の像信号出力Yは、その加算された像信号出力YとOBの中間値である。また、第1と第2の副画素列の像信号出力Yは、その加算された像信号出力YとOBの中間値である。
FIG. 12A is a graph of an A + B image signal that is an addition signal, and the image signal output of the gray portion 1201 having a low luminance in the interval where the X coordinate in the horizontal direction is X 0 to X 1 and the interval X 2 to X 3. Is indicated by Y 2 . Further, the image signal output of the white portion 1202 having a high luminance in the section from X 1 to X 2 is indicated by Y 4 . Since a constant signal value is added even in the absence of incident light quantity due to the influence of dark current generated in the imaging unit 213, the signal level is indicated by OB. FIG. 12B shows an image of the first sub-pixel column. FIG. 12C is a graph showing a B signal which is an image signal of the second sub-pixel column. In FIGS. 12B and 12C, the image signal output of the gray portion 1201 having a low luminance in the interval where the X coordinate in the horizontal direction is X 0 to X 1 and the interval X 2 to X 3 is indicated by Y 1. Yes. Further, the image signal output of the white portion 1202 having a high luminance in the section from X 1 to X 2 is indicated by Y 3 . Here, first the image signal output Y 1 of the second sub-pixel columns is an intermediate value of the summed image signal output Y 2 and OB. The first and the image signal output Y 3 of the second sub-pixel columns is an intermediate value of the summed image signal output Y 4 and OB.

図13は、図12で示した第1の副画素列の像信号(b)と、第1と第2の副画素列の像信号の加算信号(a)とにおいて、それぞれ独立したノイズが混入した場合における、第2の副画素列の像信号(c)を示したグラフである。   FIG. 13 shows that independent noise is mixed in the image signal (b) of the first subpixel column and the addition signal (a) of the image signals of the first and second subpixel columns shown in FIG. It is the graph which showed the image signal (c) of the 2nd subpixel row | line in the case where it did.

本実施形態の撮像部213は、フローティングディフュージョン領域303において、第1の副画素列のみの電荷を電圧変換するタイミングと、第1と第2の副画素列の加算信号の電荷を電圧変換するタイミングが異なっている。このため、双方に加わるノイズは必ずしも一致しない。このため、図13では、それぞれ独立したノイズが混入している場合を示している。   In the floating diffusion region 303, the imaging unit 213 according to the present embodiment performs voltage conversion on the charge of only the first subpixel column and voltage conversion on the charge of the addition signal of the first and second subpixel columns. Are different. For this reason, the noise added to both does not necessarily match. For this reason, FIG. 13 shows a case where independent noises are mixed.

図13(a)は加算信号(A+B像信号)にノイズが混入した様子を示すグラフであり、水平方向のX座標がX乃至Xの区間に、模式的にノイズΔNABが示されている。図13(b)は第1の副画素列の像信号(A像信号)にノイズが混入した様子を示すグラフであり、水平方向のX座標がX乃至Xの区間に、模式的にノイズΔNが示されている。図13(c)は第2の副画素列の像信号にノイズが混入した様態を示すグラフであり、水平方向のX座標がX乃至Xの区間に、模式的にノイズΔNが示されている。ここで第2の副画素列の像信号は、第1と第2の副画素列の像信号の加算信号から第1の副画素列の像信号を、電気的に差し引くことで求められる。このため、第2の副画素列の像信号(B+ΔN)は、下記の式1に示す信号となる。
B+ΔN=(A+B+ΔNab)−(A+ΔN
=B+ΔNab−ΔN
∴ΔN=ΔNab−ΔN…(式1)
A:第1のフォトダイオードで生成された電荷に基づく信号(A像信号からノイズを引いた信号)
B:第2のフォトダイオードで生成された電荷に基づく信号(B像信号からノイズを引いた信号)
ΔNab:加算信号に重畳するノイズ
ΔN:A像信号に重畳するノイズ
ΔN:B像信号に重畳するノイズ
13 (a) is a graph showing how the noise is mixed in the addition signal (A + B image signal), in the horizontal direction of the X coordinate of the X 1 to X 2 interval, is schematically noise .DELTA.N AB is shown Yes. FIG. 13B is a graph showing a state in which noise is mixed in the image signal (A image signal) of the first sub-pixel row, and schematically shows a region where the horizontal X coordinate is X 1 to X 2. noise .DELTA.N A is shown. FIG. 13 (c) is a graph showing the manner in which the noise on the image signal is mixed in the second sub-pixel columns, the horizontal direction of the X coordinate of the X 1 to X 2 interval, schematically noise .DELTA.N B is shown Has been. Here, the image signal of the second subpixel column is obtained by electrically subtracting the image signal of the first subpixel column from the addition signal of the image signals of the first and second subpixel columns. For this reason, the image signal (B + ΔN B ) of the second subpixel column is a signal represented by the following Expression 1.
B + ΔN b = (A + B + ΔN ab ) − (A + ΔN a )
= B + ΔN ab −ΔN a
∴ΔN b = ΔN ab −ΔN a (Expression 1)
A: A signal based on the charge generated by the first photodiode (a signal obtained by subtracting noise from the A image signal)
B: A signal based on the charge generated by the second photodiode (a signal obtained by subtracting noise from the B image signal)
ΔN ab : Noise superimposed on the addition signal ΔN a : Noise superimposed on the A image signal ΔN b : Noise superimposed on the B image signal

図13の(b)と(c)を比べると、ΔNとΔNが正負逆向きに生じており、ノイズ混入の無い図12の(b)と(c)の様態と比べて、像信号の相関が悪化していること分かる。 Comparing (b) and (c) in FIG. 13, ΔN a and ΔN b are generated in the opposite direction, and the image signal is compared with the state of (b) and (c) in FIG. It can be seen that the correlation is worse.

図14は、図12における第1および第2の副画素列の像信号(A像信号とB像信号)の相関を、位相シフト量ごとに示したグラフである。図12において、レンズ群101の焦点は合焦状態で、第1と第2の副画素列の像信号に位相差が生じていないものとしているため、位相シフト量がゼロの場合に、2像の差分が最小値のCとなっていて、最も相関が高くなっている。 FIG. 14 is a graph showing the correlation between the image signals (A image signal and B image signal) of the first and second subpixel columns in FIG. 12 for each phase shift amount. In FIG. 12, since the focus of the lens group 101 is in focus and there is no phase difference between the image signals of the first and second subpixel columns, two images are obtained when the phase shift amount is zero. they become a difference of the C 1 minimum, highest correlation is high.

図15は、図12にノイズが混入した場合である、図13における第1および第2の副画素列の像信号(A像信号とB像信号)の相関を、位相シフト量ごとに示したグラフである。図15において、図13の(b)と(c)を用いて説明した通り、第1および第2の副画素列の像信号にそれぞれノイズΔNとΔNが混入している。このノイズの混入により、位相シフト量がゼロを挟んだ値±Pの範囲で2像の差分が増加している。2像の差分は位相シフト量が値±PにおいてCだったが、ノイズΔNとΔNの影響により位相シフト量ゼロで2像の差分がΔC悪化してしまい値Cまで増加してしまっている。このような相関量が得られてしまうと、本来は図14に示すように位相シフト量ゼロが最も相関が高いと判断すべきところが、図15に示すような位相シフト量−Pあるいは+Pが最も相関が高いと判断して誤差が生じてしまう。このように相関量に誤差が生じてしまうと、如いては焦点検出の精度が悪化してしまうことがある。 FIG. 15 shows the correlation between the image signals (A image signal and B image signal) of the first and second subpixel columns in FIG. 13 for each phase shift amount when noise is mixed in FIG. It is a graph. 15, as described with reference to FIG. 13 (b) and (c), respectively on the image signal noise .DELTA.N B and .DELTA.N a first and second sub-pixel columns are mixed. Due to the mixing of noise, the difference between the two images increases in the range of the value ± P with the phase shift amount sandwiching zero. Although the difference between the two images is the amount of phase shift was C 2 in value ± P, the difference between the two images in the phase shift amount zero due to noise .DELTA.N B and .DELTA.N a is increased to [Delta] C N worsening would value C 3 It has been. If such a correlation amount is obtained, the phase shift amount -P or + P as shown in FIG. 15 is most likely to be judged as having the highest correlation when the phase shift amount is zero as shown in FIG. An error occurs when it is determined that the correlation is high. If an error occurs in the correlation amount in this way, the accuracy of focus detection may be deteriorated.

そこで本実施形態では、取得された相関演算結果における一部の範囲の相関量を、相関量補間部230により置換し、置換後の相関量を用いて相関量が最小値をとる位相差を取得し、デフォーカス量を取得する。相関量補間部230による相関量補間(相関量の置換)の詳細は、以下のデジタルカメラシステムの動作の説明と共に説明をする。   Therefore, in this embodiment, the correlation amount in a part of the acquired correlation calculation result is replaced by the correlation amount interpolation unit 230, and the phase difference at which the correlation amount has the minimum value is acquired using the correlation amount after replacement. And get the defocus amount. Details of the correlation amount interpolation (replacement of correlation amount) by the correlation amount interpolation unit 230 will be described together with the following description of the operation of the digital camera system.

<デジタルカメラシステムの動作>
図16は、本実施形態におけるデジタルカメラシステムの焦点検出動作の流れを示すフローチャートである。本動作は、カメラコントローラ215が各部を制御することにより実現される。
<Operation of digital camera system>
FIG. 16 is a flowchart showing a flow of focus detection operation of the digital camera system in the present embodiment. This operation is realized by the camera controller 215 controlling each unit.

本実施形態のデジタルカメラシステムでは、電源投入後に動作モードがライブビューモードに自動的に設定され、撮像部213で撮像を連続的に行いつつ、第1の副画素列の像信号(A像信号)と、2像の加算信号(A+B像信号)が生成されているものとする。また、加算信号を用いて、撮像された被写体像が表示部224で表示されているものとする。   In the digital camera system according to the present embodiment, the operation mode is automatically set to the live view mode after the power is turned on, and the image signal (A image signal) of the first subpixel column is continuously captured by the imaging unit 213. ) And two image addition signals (A + B image signals) are generated. In addition, it is assumed that the captured subject image is displayed on the display unit 224 using the addition signal.

まず、操作スイッチ214のSW1が押下されて、焦点検出命令が発生することにより焦点検出動作が開始される。   First, the focus detection operation is started when SW1 of the operation switch 214 is pressed and a focus detection command is generated.

ステップS1701では、カメラコントローラ215は、第1の副画素列の像信号と、第1と第2の副画素列の像信号の加算信号を、撮像部213から画素減算部228へ転送する。(以降、第1と第2の副画素列の像信号を、2像と呼ぶ。)画素減算部228は、2像の加算信号から、第1の副画素列の像信号を電気的に減算することで、第2の副画素列の像信号(B像信号)を算出する。これにより、第1と第2の副画素列のそれぞれ独立した像信号を取得する。取得後、ステップS1702へ進む。   In step S <b> 1701, the camera controller 215 transfers the image signal of the first subpixel column and the addition signal of the image signals of the first and second subpixel columns from the imaging unit 213 to the pixel subtraction unit 228. (Hereinafter, the image signals of the first and second subpixel columns are referred to as two images.) The pixel subtracting unit 228 electrically subtracts the image signal of the first subpixel column from the addition signal of the two images. As a result, the image signal (B image signal) of the second sub-pixel row is calculated. Thereby, independent image signals of the first and second subpixel columns are obtained. After acquisition, the process proceeds to step S1702.

ステップS1702では、カメラコントローラ215は、2像に対してそれぞれ独立して、黒レベル補正や撮像光学系に起因する周辺光量落ちなど、各種の信号レベル変動を抑える補正処理を行う。信号レベルが変動する要因は、被写体像を射出瞳面で光線分割したことにより、第1の副画素列と第2の副画素列に、角度の異なる光線が入射するためである。補正処理後、ステップS1703へ進む。   In step S <b> 1702, the camera controller 215 performs correction processing for suppressing various signal level fluctuations such as black level correction and a drop in peripheral light amount caused by the imaging optical system, independently for each of the two images. The reason why the signal level fluctuates is that light rays having different angles are incident on the first subpixel row and the second subpixel row by dividing the subject image into light rays on the exit pupil plane. After the correction process, the process proceeds to step S1703.

ステップS1703では、カメラコントローラ215は、2像を画素減算部228から相関演算部219へ転送する。相関演算部219では、焦点を検出するデフォーカス範囲に基づいて設定される、位相シフト量ゼロ(一対の視差画像信号をシフトしない位置ともいう)を含む第1の位相シフト範囲において、シフト量ごとの2像の差分を相関量として算出する。この相関量は、2像の不一致度を示すもので、不一致度が低いほど2像の相関が高いことを表す。算出後、ステップS1704へ進む。   In step S <b> 1703, the camera controller 215 transfers the two images from the pixel subtraction unit 228 to the correlation calculation unit 219. The correlation calculation unit 219 sets each shift amount in the first phase shift range including zero phase shift amount (also referred to as a position where the pair of parallax image signals are not shifted) set based on the defocus range in which the focus is detected. The difference between the two images is calculated as a correlation amount. This correlation amount indicates the degree of mismatch between the two images, and the lower the mismatch degree, the higher the correlation between the two images. After the calculation, the process proceeds to step S1704.

ステップS1704乃至ステップS1710は、算出された相関量に対して必要に応じて一部の相関量を周辺の相関量から補間する本実施形態の特徴的な動作であり、以下詳細に説明する。   Steps S1704 to S1710 are characteristic operations of the present embodiment in which a part of the correlation amount is interpolated from the surrounding correlation amounts as necessary with respect to the calculated correlation amount, and will be described in detail below.

ステップS1704では、カメラコントローラ215は、2像を相関量補間部230へ転送する。相関量補間部230は、2像の含まれる画素信号の最高値と最低値からその高低差(いわゆるコントラスト)を算出する。この高低差が小さくなるにつれて、2像の波形による相関量の変化に対して、ノイズによる相関量の変化が無視できなくなる可能性が高くなるため、後述する補間処理を行うことが好ましい。このため、本ステップにて高低差を算出する。算出後、ステップS1705へ進む。   In step S1704, the camera controller 215 transfers the two images to the correlation amount interpolation unit 230. The correlation amount interpolation unit 230 calculates the height difference (so-called contrast) from the highest value and the lowest value of the pixel signals included in the two images. As the difference in height decreases, it becomes more likely that the change in the correlation amount due to the noise cannot be ignored with respect to the change in the correlation amount due to the waveform of the two images. For this reason, the height difference is calculated in this step. After the calculation, the process proceeds to step S1705.

ステップS1705では、相関量補間部230は、ステップS1704で算出した高低差が所定の閾値未満か否かを判断する。閾値未満であった場合は、後段ステップで説明する補間処理を行うため、ステップS1706へ進む。閾値以上であった場合は、補間処理を行わなくて差し支えないと判断し、ステップS1711へ進む。   In step S1705, the correlation amount interpolation unit 230 determines whether or not the height difference calculated in step S1704 is less than a predetermined threshold value. If it is less than the threshold value, the process proceeds to step S1706 to perform the interpolation processing described in the subsequent step. If it is equal to or greater than the threshold value, it is determined that the interpolation process may be omitted, and the process proceeds to step S1711.

ステップS1706では、相関量補間部230は、相関量を置換する範囲である第2の位相シフト範囲を決定する。本ステップにおける第2の位相シフト範囲の決定方法について説明する。まず、相関量補間部230は、図15における、位相シフト量±Pを探す動作を行う。つまり、位相シフト量ゼロを挟んだ正負の両方向において、絶対値がなるべく小さく、且つ、相関量が極小値をとる位相シフト量を探索する。そして、探索された正負の位相シフト量に挟まれた位相シフト範囲(図15における−Pより大きく、+Pより小さい範囲)を、相関量補間部230は補間対象の位相シフト範囲(第2の位相シフト範囲)として決定する。決定後、ステップS1707へ進む。   In step S1706, the correlation amount interpolation unit 230 determines a second phase shift range that is a range for replacing the correlation amount. A method for determining the second phase shift range in this step will be described. First, the correlation amount interpolation unit 230 performs an operation of searching for the phase shift amount ± P in FIG. In other words, in both positive and negative directions with the phase shift amount zero interposed therebetween, a phase shift amount in which the absolute value is as small as possible and the correlation amount takes a minimum value is searched. Then, the correlation amount interpolation unit 230 sets the phase shift range (a range larger than −P and smaller than + P in FIG. 15) sandwiched between the detected positive and negative phase shift amounts to the phase shift range (second phase) to be interpolated. Shift range). After determination, the process proceeds to step S1707.

ステップS1707では、相関量補間部230は、相関量が極小となる位相シフト条件を探索し、さらにその中で相関量が最小となる条件を抽出し、その位相シフト条件での相関量の微分値を、相関急峻度として算出する。算出後、ステップS1708へ進む。   In step S1707, the correlation amount interpolating unit 230 searches for a phase shift condition that minimizes the correlation amount, extracts a condition that minimizes the correlation amount, and differentiates the correlation amount under the phase shift condition. Is calculated as the correlation steepness. After the calculation, the process proceeds to step S1708.

ステップS1708では、相関量補間部230は、ステップS1707で算出した相関急峻度が所定の閾値以上か否かを判断する。閾値以上であった場合は、少しの位相シフト変動で相関量が急峻に変化していることが分かる。この場合、後段ステップで相関量を補間する際に、補間対象とする位相シフト量の範囲に隣接するシフト量の相関量で補間してしまうと、相関量の急峻な変化を再現できなくなってしまう。如いては、最も相関の高い位相シフト量の判定に誤差が生じてしまい、補間した相関量を用いて行われる焦点検出の精度を向上させることが難しい。このような不具合を避けるために、相関の急峻な変化を踏まえた補間を後段(S1709)で行わせる。そこで、閾値以上であった場合は、重い演算負荷ながら相関の急峻な変化を踏まえて補間するステップS1709へ進む。相関急峻度が閾値未満であった場合は、軽い演算負荷で簡易的な補間を行うステップS1710へ進む。   In step S1708, the correlation amount interpolation unit 230 determines whether the correlation steepness calculated in step S1707 is equal to or greater than a predetermined threshold. If it is equal to or greater than the threshold value, it can be seen that the correlation amount changes sharply with a slight phase shift fluctuation. In this case, when interpolating the correlation amount in the subsequent step, if the interpolation is performed with the correlation amount of the shift amount adjacent to the range of the phase shift amount to be interpolated, a sharp change in the correlation amount cannot be reproduced. . Thus, an error occurs in the determination of the phase shift amount with the highest correlation, and it is difficult to improve the accuracy of focus detection performed using the interpolated correlation amount. In order to avoid such a problem, interpolation based on a sharp change in correlation is performed in the subsequent stage (S1709). Therefore, if it is equal to or greater than the threshold value, the process advances to step S1709 for interpolation based on a steep change in correlation with a heavy calculation load. If the correlation steepness is less than the threshold, the process advances to step S1710 where simple interpolation is performed with a light calculation load.

ステップS1709では、相関量の置換を行わないシフト範囲における相関量と位相シフト量との関係に基づいて相関量と位相シフト量との関係を表す数式を取得する。そして、この数式を用いて取得した第2の位相シフト範囲における相関量を、第2の位相シフト範囲の相関量とする(第1の補間方法)。具体的な処理について説明をする。相関量補間部230は、ステップS1706で探索された位相シフト量(±P)を起点に、位相シフト量ゼロと反対側の方向に所定シフト量だけの範囲を、補間元の位相シフト範囲(第3の位相シフト範囲と呼ぶことがある)として決定する。そして、相関量補間部230は、この第3の位相シフト範囲の位相シフト量と相関量との関係を用いてスプライン補間あるいは最小二乗法といった公知の補間方法を用いて、補間に用いる数式(補間式と呼ぶことがある)を取得する。数式は、高次式とすることが好ましい。第3の位相シフト範囲の幅は相関量と位相シフト量とのグラフの傾き、像信号の大きさ(S/N比)、取得する補間式の精度と演算付加のバランス等に応じて適宜設定することができる。例えば、ステップS1706で探索された位相シフト量(±P)を起点に、グラフの傾きが所定の値以上をとる範囲までを第3の位相シフト範囲としても良い。補間式の取得後、補間先の位相シフト量範囲である第2の位相シフト範囲に対して、取得した補間式を適用して補間処理を行い、第2の位相シフト範囲における相関量を取得する。そして、第2の位相シフト範囲における相関量を、ステップS1703で取得した相関量からステップS1709で取得した取得結果(補間処理によって取得した相関量)で置換することで、相関演算部219により取得した相関演算曲線の一部を置換する。置換後、ステップS1711へ進む。   In step S1709, a mathematical expression representing the relationship between the correlation amount and the phase shift amount is acquired based on the relationship between the correlation amount and the phase shift amount in the shift range where the correlation amount is not replaced. Then, the correlation amount in the second phase shift range acquired using this mathematical formula is set as the correlation amount in the second phase shift range (first interpolation method). Specific processing will be described. The correlation amount interpolation unit 230 sets the range of the predetermined shift amount in the direction opposite to the phase shift amount zero from the phase shift amount (± P) searched in step S1706 as the starting phase shift range (first shift). 3 may be referred to as a phase shift range of 3). Then, the correlation amount interpolation unit 230 uses a known interpolation method such as spline interpolation or least square method using the relationship between the phase shift amount of the third phase shift range and the correlation amount, and uses a mathematical expression (interpolation). (Sometimes called an expression). The mathematical formula is preferably a higher order formula. The width of the third phase shift range is appropriately set according to the slope of the graph of the correlation amount and the phase shift amount, the magnitude of the image signal (S / N ratio), the accuracy of the interpolation formula to be acquired, the balance of calculation addition, etc. can do. For example, the third phase shift range may be a range from the phase shift amount (± P) searched in step S1706 to a range where the slope of the graph takes a predetermined value or more. After the interpolation formula is acquired, the interpolation process is performed by applying the acquired interpolation formula to the second phase shift range that is the phase shift amount range of the interpolation destination, and the correlation amount in the second phase shift range is acquired. . Then, the correlation calculation unit 219 acquires the correlation amount in the second phase shift range by replacing the correlation amount acquired in step S1703 with the acquisition result acquired in step S1709 (correlation amount acquired by the interpolation process). Replace part of the correlation calculation curve. After the replacement, the process proceeds to step S1711.

ステップS1710では、ステップS1709よりも軽い演算負荷で簡易的な補間を行うステップであり、第2の位相シフト範囲の相関量を相関量の極小値で置き換える(第2の補間方法)。具体的な処理について説明をする。相関量補間部230は、ステップS1706で決定した第2の位相シフト範囲を、第2の位相シフト範囲の境界となる位相シフト量の相関量(+Pにおける相関量と−Pにおける相関量)のうち、小さい方の相関量で置換する。これにより、相関演算部219により取得した相関演算曲線の一部を置換する。   In step S1710, simple interpolation is performed with a lighter calculation load than in step S1709, and the correlation amount in the second phase shift range is replaced with the minimum value of the correlation amount (second interpolation method). Specific processing will be described. The correlation amount interpolating unit 230 uses the second phase shift range determined in step S1706 as the phase shift amount correlation amount (correlation amount at + P and correlation amount at −P) serving as the boundary of the second phase shift range. Replace with the smaller correlation amount. Thereby, a part of the correlation calculation curve acquired by the correlation calculation unit 219 is replaced.

第2の位相シフト範囲の境界となる位相シフト量とは、置換を行う範囲と行わない範囲との境界となる位相シフト範囲のことを指し、ステップS1706で探索された相関量が極小値をとる位相シフト量と一致する。置換後、ステップS1711へ進む。   The phase shift amount serving as the boundary of the second phase shift range refers to the phase shift range serving as the boundary between the range where replacement is performed and the range where replacement is not performed, and the correlation amount searched in step S1706 takes a minimum value. It matches the phase shift amount. After the replacement, the process proceeds to step S1711.

図17(a)は、ステップS1709による第1の補間方法を行うことにより取得される、相関量と位相シフト量とのグラフである。また、図17(b)は、ステップS1710による第2の補間方法を行うことにより取得される、相関量と位相シフト量とのグラフである。それぞれのグラフにおいて、点線は補間前の相関量と位相シフト量との関係を示し、実線は補間後の相関量と位相シフト量との関係を示す。図17((a)、(b))に示すように、補間前は±Pの範囲において図15に示したグラフと同様にノイズの影響が現れるが、第1又は第2の補間方法を行うことにより、±Pの範囲に現れていたノイズの影響を軽減することができる。   FIG. 17A is a graph of the correlation amount and the phase shift amount obtained by performing the first interpolation method in step S1709. FIG. 17B is a graph of the correlation amount and the phase shift amount obtained by performing the second interpolation method in step S1710. In each graph, the dotted line indicates the relationship between the correlation amount before interpolation and the phase shift amount, and the solid line indicates the relationship between the correlation amount after interpolation and the phase shift amount. As shown in FIGS. 17 (a) and 17 (b), before the interpolation, the influence of noise appears in the range of ± P as in the graph shown in FIG. 15, but the first or second interpolation method is performed. As a result, it is possible to reduce the influence of noise appearing in the range of ± P.

ステップS1711では、カメラコントローラ215が相関演算曲線に基づいて、最も相関量の小さくなる最相関シフト量を算出する。ステップS1709又はステップS1710による補間を行う条件下において、カメラコントローラ215が用いる相関演算曲線は、相関量補間部230により一部が置換された相関演算曲線である。一方、ステップS1705から直接ステップS1711へ進む条件下においては、カメラコントローラ215が用いる相関演算曲線は、相関演算部219が取得した相関演算曲線である。最相関シフト量は、自然数である1シフト量単位では焦点検出に用いる精度としては粗いため、少なくとも小数点第3位、できれば小数点第5位程度まで、上記の補間式から求めることが好ましい。第2の補間方法を用いると相関量が置換される第2の位相シフト範囲で相関量が等しくなる。第2の位相シフト範囲における相関量が、相関量を算出する範囲である第1の位相シフト範囲における相関量の最小値をとる場合、第2の位相シフト範囲の中央値を最相関シフト量とすることができる。   In step S1711, the camera controller 215 calculates the maximum correlation shift amount with the smallest correlation amount based on the correlation calculation curve. The correlation calculation curve used by the camera controller 215 under the conditions for performing the interpolation in step S1709 or step S1710 is a correlation calculation curve partially replaced by the correlation amount interpolation unit 230. On the other hand, under the condition of proceeding directly from step S1705 to step S1711, the correlation calculation curve used by the camera controller 215 is the correlation calculation curve acquired by the correlation calculation unit 219. Since the maximum correlation shift amount is rough as the accuracy used for focus detection in the unit of one shift amount, which is a natural number, it is preferable to obtain at least the third decimal point and preferably the fifth decimal point from the above interpolation formula. When the second interpolation method is used, the correlation amount becomes equal in the second phase shift range where the correlation amount is replaced. When the correlation amount in the second phase shift range takes the minimum value of the correlation amount in the first phase shift range, which is a range for calculating the correlation amount, the median value of the second phase shift range is set as the maximum correlation shift amount. can do.

最相関シフト量の算出後、ステップS1712へ進む。   After calculating the maximum correlation shift amount, the process proceeds to step S1712.

ステップS1712では、カメラコントローラ215は、ステップS1711で算出された最相関シフト量とレンズ部100の光学特性に基づいて、デフォーカス量を算出する。算出後、ステップS1713へ進む。   In step S1712, the camera controller 215 calculates a defocus amount based on the most correlated shift amount calculated in step S1711 and the optical characteristics of the lens unit 100. After calculation, the process proceeds to step S1713.

ステップS1713では、カメラコントローラ215は、算出されたデフォーカス量に基づいて、レンズコントローラ105を介して、レンズ群101の焦点位置が制御される。制御が完了することで焦点検出動作が終了となる。   In step S1713, the camera controller 215 controls the focal position of the lens group 101 via the lens controller 105 based on the calculated defocus amount. When the control is completed, the focus detection operation ends.

本実施形態によれば、第1の副画素列の像信号と、第1と第2の副画素列の像信号の加算信号から、電気的に第2の副画素列の像信号を取得して焦点検出する構成において、ノイズの影響を低減して、高精度な焦点検出を行うことができる。   According to this embodiment, the image signal of the second subpixel column is electrically acquired from the image signal of the first subpixel column and the addition signal of the image signals of the first and second subpixel columns. Therefore, the focus detection can be performed with high accuracy by reducing the influence of noise.

(変形例)
ここで、ステップS1704乃至ステップS1705に対する変形例を説明する。
(Modification)
Here, a modified example of steps S1704 to S1705 will be described.

ステップS1704にて、相関量補間部230は、2像における最高値と最低値を算出し、ステップS1705での条件判断を行っていた。しかし、これに限らず、各種撮像条件によってステップS1705での条件判断を行ってもよい。例えば、撮像により得られた画像信号に含まれる、ノイズに対する信号の大きさ(S/N比)に関する情報を用いることができる。信号の大きさに関する情報として、相関量補間部230が2像の信号波形を2次微分した結果の最大値である2次微分値の最大値、あるいは信号波形の隣接差分値を算出して、ステップS1705での条件判断に用いることができる。尚、信号波形の隣接差分値とは、信号波形を構成する複数の信号のそれぞれと、それぞれに隣り合う信号との差分をとった値(局所的な微分値)のことを指す。例えば、2次微分の最大値(2次微分最大値と呼ぶことがある)や隣接差分値が所定の閾値未満であった場合、2像の波形による相関量の変化に対して、ノイズによる相関量の変化が無視できなくなる可能性がある。この場合、ノイズの影響による第3の位相シフト範囲から取得する補間式の精度が低くなる可能性があるため、ステップS1709で説明した第1の補間方法よりも、ステップS1710で説明した第2の補間方法を行うことが好ましい。   In step S1704, the correlation amount interpolation unit 230 calculates the highest value and the lowest value in the two images, and performs the condition determination in step S1705. However, the present invention is not limited to this, and the condition determination in step S1705 may be performed according to various imaging conditions. For example, information regarding the magnitude (S / N ratio) of a signal with respect to noise included in an image signal obtained by imaging can be used. As information on the magnitude of the signal, the correlation amount interpolation unit 230 calculates the maximum value of the secondary differential value that is the maximum value of the result of second-order differentiation of the signal waveform of the two images, or the adjacent difference value of the signal waveform, It can be used for condition determination in step S1705. The adjacent difference value of the signal waveform refers to a value (local differential value) obtained by taking the difference between each of the plurality of signals constituting the signal waveform and the adjacent signals. For example, when the maximum value of the second derivative (sometimes referred to as the second derivative maximum value) or the adjacent difference value is less than a predetermined threshold, the correlation due to noise is correlated with the change in the correlation amount due to the waveform of the two images. Changes in quantity may not be negligible. In this case, since the accuracy of the interpolation formula acquired from the third phase shift range due to the influence of noise may be lowered, the second interpolation method described in step S1710 is more than the first interpolation method described in step S1709. It is preferable to perform an interpolation method.

また、これに限らず、各種撮像条件として、撮像手段の各種設定を用いてもよい。例えば、カメラコントローラ215が、デジタルカメラの露出設定であるISO感度設定や露出補正量を相関量補間部230へ出力し、相関量補間部230がこれらの値に基づいてステップS1705での条件判断を行ってもよい。例えば、ISO感度設定が所定の閾値以上である場合や、露出補正量が適正露出を下回る設定である場合は、露光アンダーにより2像の波形が小さくなり、2像の波形による相関量の変化に対して、ノイズによる相関量の変化が無視できなくなる可能性がある。この場合も、ノイズの影響により補間式の精度が低くなる可能性があるため、第1の補間方法よりも、第2の補間方法を行うことが好ましい。   Further, the present invention is not limited to this, and various settings of the imaging means may be used as various imaging conditions. For example, the camera controller 215 outputs the ISO sensitivity setting, which is the exposure setting of the digital camera, and the exposure correction amount to the correlation amount interpolation unit 230, and the correlation amount interpolation unit 230 determines the condition in step S1705 based on these values. You may go. For example, when the ISO sensitivity setting is a predetermined threshold value or more, or when the exposure correction amount is set to be lower than the appropriate exposure, the waveform of the two images becomes smaller due to underexposure, and the correlation amount changes due to the waveform of the two images. On the other hand, there is a possibility that a change in correlation amount due to noise cannot be ignored. Also in this case, since the accuracy of the interpolation formula may be lowered due to the influence of noise, it is preferable to perform the second interpolation method rather than the first interpolation method.

また、これに限らず、各種撮像条件として、撮像手段の温度を用いてもよい。例えば、撮像部213の温度を測定する温度測定手段がその測定結果である温度情報を相関量補間部230へ出力し、相関量補間部230が温度に基づいてステップS1705での条件判断を行ってもよい。撮像部213の温度が上昇するにつれて熱雑音が増加するため、像信号にノイズが混入しやすくなり、2像の波形による相関量の変化に対して、ノイズによる相関量の変化が無視できなくなる可能性があるためである。この場合この場合も、ノイズの影響により補間式の精度が低くなる可能性があるため、第1の補間方法よりも、第2の補間方法を行うことが好ましい。   In addition, the temperature of the imaging unit may be used as various imaging conditions. For example, a temperature measurement unit that measures the temperature of the imaging unit 213 outputs temperature information that is the measurement result to the correlation amount interpolation unit 230, and the correlation amount interpolation unit 230 performs the condition determination in step S1705 based on the temperature. Also good. Since thermal noise increases as the temperature of the imaging unit 213 rises, noise is likely to be mixed into the image signal, and the change in the correlation amount due to the noise cannot be ignored with respect to the change in the correlation amount due to the waveform of the two images. It is because there is sex. In this case, since the accuracy of the interpolation formula may be lowered due to the influence of noise, it is preferable to perform the second interpolation method rather than the first interpolation method.

また、これに限らず、各種撮像条件として、撮像により得られた画像信号に含まれる所定の空間周波数成分の大きさを用いてもよい。例えば、デジタルカメラの各電気部品から高周波のノイズとして発せられる電流変動に起因して、撮像部213に縦縞ノイズが発生することがある。これを念頭に、特定の空間周波数成分を抽出する不図示のBPF部を設ける。BPF部の出力が所定の閾値以上であれば、2像に縦縞ノイズが位相差ゼロで混入していて、上記と同様に無視できなくなる可能性がある。この場合も、ノイズの影響により補間式の精度が低くなる可能性があるため、第1の補間方法よりも、第2の補間方法を行うことが好ましい。   In addition, the size of a predetermined spatial frequency component included in an image signal obtained by imaging may be used as various imaging conditions. For example, vertical stripe noise may occur in the imaging unit 213 due to current fluctuations generated as high-frequency noise from each electrical component of the digital camera. With this in mind, a BPF unit (not shown) that extracts a specific spatial frequency component is provided. If the output of the BPF part is equal to or greater than a predetermined threshold value, vertical stripe noise is mixed in the two images with a phase difference of zero, and there is a possibility that it cannot be ignored in the same manner as described above. Also in this case, since the accuracy of the interpolation formula may be lowered due to the influence of noise, it is preferable to perform the second interpolation method rather than the first interpolation method.

また、ここで、ステップS1702に対する変形例を説明する。   Here, a modified example of step S1702 will be described.

ステップS12702にて、カメラコントローラ215は、2像に対してそれぞれ独立して、黒レベル補正や撮像光学系に起因する周辺光量落ちなど、各種の信号レベル変動を抑える補正処理を行っていた。しかし、これに限らず、上記補正処理に加えて、焦点検出領域を垂直方向に広げて、画素加算部217が第1と第2の焦点検出画素列の像信号を水平方向の座標ごとに複数ライン分加算して、ノイズを低減させても良い。   In step S12702, the camera controller 215 performs correction processing for suppressing various signal level fluctuations, such as black level correction and a decrease in peripheral light amount caused by the imaging optical system, independently for each of the two images. However, the present invention is not limited to this, and in addition to the above correction processing, the focus detection area is expanded in the vertical direction, and the pixel adder 217 generates a plurality of image signals of the first and second focus detection pixel arrays for each horizontal coordinate. Noise may be reduced by adding lines.

また、これに限らず、上記補正処理に加えて、LPF処理部229が2像に対して水平方向にLPF処理を行い、ノイズを低減させても良い。しかし、あまりに低周波過ぎると、被写体像が持つエッジ成分を鈍らせて、如いては相関演算の精度を落としてしまう恐れがあるため、例えば隣接平均といった軽度のLPFが好ましい。   In addition to this, in addition to the above correction processing, the LPF processing unit 229 may perform LPF processing on two images in the horizontal direction to reduce noise. However, if the frequency is too low, the edge component of the subject image may be dulled, which may reduce the accuracy of the correlation calculation. For example, a light LPF such as an adjacent average is preferable.

また、これに限らず、ステップS1705にてステップS1706へ進むと判断した場合に限り、上記のLPF処理を行うようにしても良い。   The present invention is not limited to this, and the above-described LPF processing may be performed only when it is determined in step S1705 that the process proceeds to step S1706.

上述したような動作を行うことにより、ノイズ対策の動作を行うか否かを適切に判断することができる。   By performing the operation as described above, it is possible to appropriately determine whether or not to perform the noise countermeasure operation.

また、ここで、ステップS1703に対する変形例を説明する。   Here, a modified example of step S1703 will be described.

ステップS1703にて、相関演算部219では、焦点の検出デフォーカス範囲に基づいた、位相シフト量ゼロを含む所定の位相シフト量の範囲において、シフト量ごとの2像の差分を相関量として算出していた。しかし、これに限らず、上記補正処理に加えて、焦点検出領域を垂直方向に広げて、相関量加算部220が、相関演算部219で算出された複数ライン分の相関量を、位相シフト量ごとに加算して、相関量のバラツキを低減させても良い。   In step S1703, the correlation calculation unit 219 calculates the difference between the two images for each shift amount as a correlation amount within a predetermined phase shift amount range including zero phase shift amount based on the focus detection defocus range. It was. However, the present invention is not limited to this, and in addition to the correction processing described above, the focus detection area is expanded in the vertical direction, and the correlation amount adding unit 220 calculates the correlation amounts for a plurality of lines calculated by the correlation calculation unit 219 as phase shift amounts. It is also possible to reduce the variation in the correlation amount by adding each time.

また、これに限らず、相関演算部219が奇数の位相シフト量の相関量のみ演算あるいは出力させても良い。偶数(ゼロを含む)の位相シフト量を出力させないことで、ノイズの影響が強く表れやすい位相シフト量ゼロの相関量を簡易的に出力させないようにできる。この場合、ステップS1703の前にノイズ対策を行う条件か否かを判断し、ノイズ対策を行う条件である場合に、奇数の位相シフト量の相関量のみ演算あるいは出力することが好ましい。位相シフト量ゼロを含む偶数の位相シフト量における相関量は、奇数の位相シフト量における相関量を用いて、ステップS1709、またはステップS1710の方法を用いて補間することができる。この場合、偶数の位相シフト量における相関量は補間前には出力されないため、図17に示した点線であらわす相関量を実線であらわす相関量で置換するわけではない。しかしながら、相関演算により取得した相関量の代わりに補間により取得した相関量を用いてデフォーカス量を取得するため、相関演算により取得した相関量を補間により取得した相関量で置換しているとみなすものとする。このように、相関演算部219が奇数の位相シフト量の相関量のみを出力する場合、第2の位相シフト範囲は±1に挟まれた範囲となるが、必要に応じてそのほかの範囲(例えば+1と+3に挟まれた範囲など)も置換の対象として補間を行ってもよい。   Further, the present invention is not limited to this, and the correlation calculation unit 219 may calculate or output only the correlation amount of the odd phase shift amount. By not outputting even (including zero) phase shift amounts, it is possible to simply prevent the output of a zero phase shift correlation amount that is strongly influenced by noise. In this case, before step S1703, it is determined whether or not the condition for noise countermeasure is satisfied. If the condition is for noise countermeasure, it is preferable to calculate or output only the correlation amount of the odd phase shift amount. The correlation amount in even-numbered phase shift amounts including zero phase shift amount can be interpolated using the correlation amount in odd-numbered phase shift amounts using the method of step S1709 or step S1710. In this case, since the correlation amount at the even phase shift amount is not output before the interpolation, the correlation amount represented by the dotted line shown in FIG. 17 is not replaced with the correlation amount represented by the solid line. However, since the defocus amount is acquired using the correlation amount acquired by interpolation instead of the correlation amount acquired by correlation calculation, it is considered that the correlation amount acquired by correlation calculation is replaced with the correlation amount acquired by interpolation. Shall. As described above, when the correlation calculation unit 219 outputs only the correlation amount of the odd number of phase shift amounts, the second phase shift range is a range between ± 1, but other ranges (for example, if necessary) (for example, The range between +1 and +3) may also be interpolated as a replacement target.

また、上述の実施形態では、相関量補間部230は複数の補間方法を実行可能であり、相関量と位相シフト量との関係に応じて実行する補間方法を選択しているが、相関量補間部は補間方法を1つのみ実行してもよい。加えて、上述の実施形態では、撮像素子の画素を2分割(副画素S1、S2)することで焦点検出を行う場合について述べたが、画素の分割数は特に問わない。   In the above-described embodiment, the correlation amount interpolation unit 230 can execute a plurality of interpolation methods, and selects an interpolation method to be executed according to the relationship between the correlation amount and the phase shift amount. The unit may execute only one interpolation method. In addition, in the above-described embodiment, the case where focus detection is performed by dividing the pixels of the image sensor into two (sub-pixels S1 and S2) has been described, but the number of divided pixels is not particularly limited.

本実施形態は、図16に示した各処理の全部又は一部の機能を、専用のハードウェアにより実現してもよいし、各処理の機能を実現する為のプログラムを記憶媒体に記録して、このプログラムを焦点検出装置に読み込ませ、実行させることにより実現してもよい。また、上記プログラムは、このプログラムを記憶装置等に格納したコンピュータシステムから、伝送媒体を介して、あるいは、伝送媒体中の伝送波により他のコンピュータシステムに伝送されてもよい。ここで、プログラムを伝送する「伝送媒体」は、インターネット等のネットワーク(通信網)や電話回線等の通信回線(通信線)のように情報を伝送する機能を有する媒体のことをいう。   In the present embodiment, all or a part of the functions shown in FIG. 16 may be realized by dedicated hardware, or a program for realizing the functions of each process may be recorded on a storage medium. The program may be read by the focus detection device and executed. The program may be transmitted from a computer system storing the program in a storage device or the like to another computer system via a transmission medium or by a transmission wave in the transmission medium. Here, the “transmission medium” for transmitting the program refers to a medium having a function of transmitting information, such as a network (communication network) such as the Internet or a communication line (communication line) such as a telephone line.

また、上記プログラムは、前述した機能の一部を実現する為のものであっても良い。さらに、前述した機能をコンピュータシステムに既に記録されているプログラムとの組合せで実現できるもの、いわゆる差分ファイル(差分プログラム)であっても良い。   The program may be for realizing a part of the functions described above. Furthermore, what can implement | achieve the function mentioned above in combination with the program already recorded on the computer system, and what is called a difference file (difference program) may be sufficient.

また、上記のプログラムを記録したコンピュータ読み取り可能な記録媒体等のプログラムプロダクトも本発明の実施形態として適用することができる。上記のプログラム、記録媒体、伝送媒体およびプログラムプロダクトは、本発明の範疇に含まれる。   A program product such as a computer-readable recording medium in which the above program is recorded can also be applied as an embodiment of the present invention. The above program, recording medium, transmission medium, and program product are included in the scope of the present invention.

以上、本発明の好ましい実施形態について説明したが、本発明はこれらの実施形態に限定されず、その要旨の範囲内で種々の変形及び変更が可能である。   As mentioned above, although preferable embodiment of this invention was described, this invention is not limited to these embodiment, A various deformation | transformation and change are possible within the range of the summary.

以上、本発明の好ましい実施形態について説明したが、本発明はこれらの実施形態に限定されず、その要旨の範囲内で種々の変形及び変更が可能である。   As mentioned above, although preferable embodiment of this invention was described, this invention is not limited to these embodiment, A various deformation | transformation and change are possible within the range of the summary.

100 レンズ部
101 レンズ群
102 絞り
108 電気接点ユニット
200 カメラ部
213 撮像部
214 操作スイッチ
224 表示部
230 相関量補間部
ML マイクロレンズ
S1 第1の焦点検出画素
S2 第2の焦点検出画素
501 平滑層
502 遮光層
PRES リセットパルス信号
PTXA 第1の転送パルス信号
PTXB 第2の転送パルス信号
PSEL 垂直選択パルス信号
1200 パターン被写体
1201 パターン被写体の灰色部
1202 パターン被写体の白色部
1203 焦点検出領域
301A 第1のフォトダイオード
301B 第2のフォトダイオード
302A 第1の転送スイッチ
302B 第2の転送スイッチ
303 フローティングディフュージョン領域
304 増幅部
305 リセットスイッチ
306 選択スイッチ
DESCRIPTION OF SYMBOLS 100 Lens part 101 Lens group 102 Diaphragm | restriction 108 Electric contact unit 200 Camera part 213 Imaging part 214 Operation switch 224 Display part 230 Correlation amount interpolation part ML Micro lens S1 1st focus detection pixel S2 2nd focus detection pixel 501 Smooth layer 502 Light shielding layer PRES Reset pulse signal PTXA First transfer pulse signal PTXB Second transfer pulse signal PSEL Vertical selection pulse signal 1200 Pattern subject 1201 Gray portion of pattern subject 1202 White portion of pattern subject 1203 Focus detection area 301A First photodiode 301B Second photodiode 302A First transfer switch 302B Second transfer switch 303 Floating diffusion region 304 Amplifying unit 305 Reset switch 306 Selection Switch

Claims (11)

一対の視差画像信号を第1の位相シフト範囲でシフトしながら相関演算をおこない相関演算曲線を取得する第1の取得手段と、
前記第1の取得手段が取得した前記第1の位相シフト範囲の前記相関演算曲線のうち、前記一対の視差画像信号をシフトしない位置を挟んだ範囲で、且つ前記一対の視差画像信号の相関が高くなる極小値に挟まれた範囲である第2の位相シフト範囲の前記相関演算曲線を置換する置換手段と、
前記置換手段により一部が置換された前記相関演算曲線から、デフォーカス量を取得する第2の取得手段と、を備えることを特徴とする焦点検出装置。
A first acquisition means for performing a correlation calculation while shifting a pair of parallax image signals within a first phase shift range and acquiring a correlation calculation curve;
Among the correlation calculation curves of the first phase shift range acquired by the first acquisition means, the correlation between the pair of parallax image signals is within a range sandwiching positions where the pair of parallax image signals are not shifted. Replacement means for replacing the correlation calculation curve in the second phase shift range, which is a range sandwiched between minimum values to be increased;
And a second acquisition unit that acquires a defocus amount from the correlation calculation curve partially replaced by the replacement unit.
前記置換手段は、
前記第2の位相シフト範囲の境界となる位相シフト量における相関量の値を前記第2の位相シフト範囲の相関量とすることで前記第2の位相シフト範囲における前記相関量を置換することを特徴とする請求項1に記載の焦点検出装置。
The replacement means includes
Replacing the correlation amount in the second phase shift range by setting the value of the correlation amount in the phase shift amount serving as the boundary of the second phase shift range as the correlation amount in the second phase shift range. The focus detection apparatus according to claim 1, wherein
前記置換手段は、
前記第1の位相シフト範囲のうち、前記第2の位相シフト範囲ではない第3の位相シフト範囲における前記相関量と位相シフト量との関係に基づいて取得した数式を用いて前記第2の位相シフト範囲における相関量を取得し、
取得結果を用いて前記第2の位相シフト範囲における相関量を置換することを特徴とする請求項1に記載の焦点検出装置。
The replacement means includes
Of the first phase shift range, the second phase is calculated using an equation obtained based on the relationship between the correlation amount and the phase shift amount in a third phase shift range that is not the second phase shift range. Get the correlation amount in the shift range,
The focus detection apparatus according to claim 1, wherein a correlation amount in the second phase shift range is replaced using an acquisition result.
前記置換手段は、
前記第1の位相シフト範囲における前記相関量と位相シフト量との関係に基づいて、前記第2の位相シフト範囲における相関量の置換方法を選択することを特徴とする請求項1乃至3のいずれか1項に記載の焦点検出装置。
The replacement means includes
4. The method of replacing a correlation amount in the second phase shift range is selected based on a relationship between the correlation amount and the phase shift amount in the first phase shift range. The focus detection apparatus according to claim 1.
前記一対の視差画像信号が取得された撮像条件に応じて、
前記置換手段による前記置換を行うか否かを決定する制御手段を備え、
前記制御手段により前記置換手段が前記置換を行わないと決定されたとき、前記第2の取得手段は前記置換えを行っていない相関演算曲線を用いてデフォーカス量を取得することを特徴とする請求項1乃至4のいずれか1項に記載の焦点検出装置。
According to the imaging conditions under which the pair of parallax image signals are acquired,
Control means for determining whether or not to perform the replacement by the replacement means;
When the control unit determines that the replacement unit does not perform the replacement, the second acquisition unit acquires a defocus amount using a correlation calculation curve that has not been replaced. Item 5. The focus detection apparatus according to any one of Items 1 to 4.
前記置換手段は、前記一対の視差画像信号が取得された撮像条件に応じて前記第2の位相シフト範囲を決定することを特徴とする請求項1乃至5のいずれか1項に記載の焦点検出装置。   6. The focus detection according to claim 1, wherein the replacement unit determines the second phase shift range in accordance with an imaging condition from which the pair of parallax image signals are acquired. apparatus. 前記撮像条件とは、撮像手段におけるISO感度、前記一対の視差画像信号に含まれる信号の最大値、前記一対の視差画像信号に含まれる信号の最大値と最小値との差、前記一対の視差画像信号に含まれる信号の2次微分値の最大値、前記一対の視差画像信号に含まれる信号の隣接差分値の最大値、撮像手段における露出設定、撮像手段の温度を測定する温度測定手段による測定結果、前記一対の視差画像信号に含まれる所定の空間周波数成分の大きさ、の少なくともいずれかであることを特徴とする請求項5または6に記載の焦点検出装置。   The imaging conditions include ISO sensitivity in the imaging means, a maximum value of signals included in the pair of parallax image signals, a difference between a maximum value and a minimum value of signals included in the pair of parallax image signals, and the pair of parallaxes By the maximum value of the second derivative value of the signal included in the image signal, the maximum value of the adjacent difference value of the signal included in the pair of parallax image signals, the exposure setting in the imaging unit, and the temperature measurement unit that measures the temperature of the imaging unit The focus detection apparatus according to claim 5, wherein the focus detection apparatus is at least one of a measurement result and a magnitude of a predetermined spatial frequency component included in the pair of parallax image signals. 撮像光学系の射出瞳の第1の瞳領域を通過する光束を受光する第1の光電変換部と、前記撮像光学系の射出瞳の第2の瞳領域を通過する光束を受光する第2の光電変換部とを有する画素を複数有する撮像手段と、
複数の前記第1の光電変換部から得られる第1の像信号と、複数の前記第2の光電変換部から得られる第2の像信号とから、前記一対の視差画像信号を生成する画像処理装置とを備えることを特徴とする請求項1乃至7のいずれか1項に記載の焦点検出装置。
A first photoelectric converter that receives a light beam that passes through a first pupil region of an exit pupil of the imaging optical system; and a second that receives a light beam that passes through a second pupil region of the exit pupil of the imaging optical system. An imaging means having a plurality of pixels each having a photoelectric conversion unit;
Image processing for generating the pair of parallax image signals from first image signals obtained from the plurality of first photoelectric conversion units and second image signals obtained from the plurality of second photoelectric conversion units. The focus detection apparatus according to claim 1, further comprising: an apparatus.
前記撮像手段は、複数の前記第1の光電変換部から得られる第1の像信号と、複数の前記第1の光電変換部と複数の前記第2の光電変換部とから得られる加算信号と、を出力し、
前記画像処理手段は、前記加算信号と前記第1の像信号との差分をとることで、複数の前記第2の光電変換部から得られる第2の像信号を取得することを特徴とする請求項8に記載の焦点検出装置。
The imaging means includes a first image signal obtained from the plurality of first photoelectric conversion units, an addition signal obtained from the plurality of first photoelectric conversion units and the plurality of second photoelectric conversion units, and , Output
The image processing means acquires a second image signal obtained from a plurality of the second photoelectric conversion units by taking a difference between the addition signal and the first image signal. Item 9. The focus detection apparatus according to Item 8.
一対の視差画像信号を第1の位相シフト範囲でシフトしながら相関演算をおこない相関演算曲線を取得する工程と、
前記相関演算曲線のうち、前記一対の視差画像信号をシフトしない位置を挟んで位置する、前記一対の視差画像信号の相関が高くなる一対の極小値に挟まれた第2の位相シフト範囲の前記相関演算曲線を置換する工程と、
一部が置換された前記相関演算曲線から、デフォーカス量を取得する工程と、を有することを特徴とする焦点検出方法。
Obtaining a correlation calculation curve by performing a correlation calculation while shifting a pair of parallax image signals within a first phase shift range;
Of the correlation calculation curve, the second phase shift range of the second phase shift range located between a pair of local minimum values where the correlation between the pair of parallax image signals is high and is located across the position where the pair of parallax image signals is not shifted. Replacing the correlation calculation curve; and
And a step of acquiring a defocus amount from the correlation calculation curve partially replaced.
請求項10に記載の焦点検出方法を焦点検出装置に実行させるためのコンピュータに読み取り可能なプログラム。   A computer-readable program for causing a focus detection apparatus to execute the focus detection method according to claim 10.
JP2016126972A 2016-06-27 2016-06-27 Focus detection device, focus detection method, and program Pending JP2018004706A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2016126972A JP2018004706A (en) 2016-06-27 2016-06-27 Focus detection device, focus detection method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016126972A JP2018004706A (en) 2016-06-27 2016-06-27 Focus detection device, focus detection method, and program

Publications (1)

Publication Number Publication Date
JP2018004706A true JP2018004706A (en) 2018-01-11

Family

ID=60948855

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016126972A Pending JP2018004706A (en) 2016-06-27 2016-06-27 Focus detection device, focus detection method, and program

Country Status (1)

Country Link
JP (1) JP2018004706A (en)

Similar Documents

Publication Publication Date Title
US9602713B2 (en) Imaging apparatus and method for controlling the same
US9736410B2 (en) Image pickup apparatus capable of selectively using one of correction values to correct image signals, image pickup system, signal processing method, and non-transitory computer-readable storage medium
JP6296887B2 (en) Focus adjustment apparatus and control method thereof
US10015376B2 (en) Imaging apparatus with phase difference focus detection and method for controlling same
JP5000413B2 (en) Imaging system and image signal processing program
US10200593B2 (en) Image capturing apparatus and control method thereof
US9407813B2 (en) Image capturing apparatus, control method of image capturing apparatus, and image capturing system
JP2014089260A (en) Imaging apparatus and driving method therefor
JP2016038414A (en) Focus detection device, control method thereof, and imaging apparatus
JP6381274B2 (en) Imaging device, control method thereof, and control program
US20140267843A1 (en) Focus detecting apparatus, control method thereof, and image-pickup apparatus
US10362214B2 (en) Control apparatus, image capturing apparatus, control method, and non-transitory computer-readable storage medium
CN108429873B9 (en) Focus detection apparatus and image pickup apparatus
JPWO2020017642A1 (en) Focus detector, image pickup device, and interchangeable lens
JP6748477B2 (en) Imaging device, control method thereof, program, and storage medium
JP6171110B2 (en) Focus control device, focus control method, focus control program, lens device, imaging device
JP6017641B1 (en) Imaging apparatus, signal processing method, signal processing program
JP2018004706A (en) Focus detection device, focus detection method, and program
JP2008015353A (en) Imaging device
JP2018185354A (en) Controller, imaging device, control method, program, and storage medium
US10460430B2 (en) Image processing apparatus and method for detecting and reducing an unnecessary light component in an image based on multiple viewpoints
WO2020017641A1 (en) Focus detection device, image capture device and interchangeable lens
JP2013055560A (en) Imaging apparatus, control method of the same, and program
JP2016009024A (en) Focus detector, control method of the same, and imaging apparatus
JP2018197771A (en) Control device, imaging apparatus, control method, program, and storage medium