JP2014038151A - Imaging apparatus and phase difference detection method - Google Patents

Imaging apparatus and phase difference detection method Download PDF

Info

Publication number
JP2014038151A
JP2014038151A JP2012179321A JP2012179321A JP2014038151A JP 2014038151 A JP2014038151 A JP 2014038151A JP 2012179321 A JP2012179321 A JP 2012179321A JP 2012179321 A JP2012179321 A JP 2012179321A JP 2014038151 A JP2014038151 A JP 2014038151A
Authority
JP
Japan
Prior art keywords
image
phase difference
correlation
value
shift amount
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2012179321A
Other languages
Japanese (ja)
Inventor
Shinichi Imaide
愼一 今出
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.)
Olympus Corp
Original Assignee
Olympus Corp
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 Olympus Corp filed Critical Olympus Corp
Priority to JP2012179321A priority Critical patent/JP2014038151A/en
Publication of JP2014038151A publication Critical patent/JP2014038151A/en
Pending legal-status Critical Current

Links

Images

Abstract

PROBLEM TO BE SOLVED: To provide an imaging apparatus and a phase difference detection method that can adaptively change a correlation width in accordance with a focusing degree.SOLUTION: The imaging apparatus includes: an imaging element; a phase difference image generation part 20; and a phase difference detection part 82. The imaging element images a first subject image and a second subject image having parallax with respect to the first subject image. The phase difference image generation part 20 generates a first image Icorresponding to the first subject image and a second image Icorresponding to the second subject image on the basis of the picked-up image. The phase difference detection part 82 performs correction calculation while relatively shifting the first image Iand the second image I, and detects a phase difference between the first image Iand the second image I. The phase difference detection part 82 sets a correlation width being an area width for performing a product sum of the correlation calculation in accordance with a shift amount of the shift.

Description

本発明は、撮像装置及び位相差検出方法等に関する。   The present invention relates to an imaging device, a phase difference detection method, and the like.

従来より、視差を有する2つの画像の位相差を相関演算によって検出する手法が知られている。このような手法としては、例えば特許文献1、2に記載される手法が知られている。   Conventionally, a method of detecting a phase difference between two images having parallax by correlation calculation is known. As such a method, for example, the methods described in Patent Documents 1 and 2 are known.

特許文献1には、ステレオマッチングを行う所定サイズを設定し、その設定したサイズで相関値を求め、その求めた相関値に基づいて、ステレオマッチングを行うサイズを再設定し、これを繰り返して最終的に設定したサイズで相関演算を行うことにより、相関幅を適応的に設定して相関演算を行う手法が開示されている。   In Patent Document 1, a predetermined size for performing stereo matching is set, a correlation value is obtained with the set size, and the size for performing stereo matching is reset based on the obtained correlation value, and this is repeated to obtain a final value. A method is disclosed in which correlation calculation is performed by adaptively setting a correlation width by performing correlation calculation with an automatically set size.

特許文献2には、基準視差を設定し、その基準視差を与える画像点を基準にステレオマッチングの探索範囲を特定し、その探索範囲においてステレオマッチングを行うことにより、相関演算を行う探索範囲を絞り込む手法が開示されている。   In Patent Document 2, a reference parallax is set, a search range for stereo matching is specified based on an image point that gives the reference parallax, and a stereo matching is performed in the search range, thereby narrowing down a search range for performing correlation calculation. A technique is disclosed.

特開2007−172500号公報JP 2007-172500 A 特開2010−128622号公報JP 2010-128622 A

上記のような相関演算により位相差を検出する手法は、例えば、検出した位相差を用いてフォーカス制御を行う位相差AF(Auto-Focus)や、被写体までの距離を求める立体計測等に用いられている。   The method of detecting the phase difference by the correlation calculation as described above is used, for example, for phase difference AF (Auto-Focus) for performing focus control using the detected phase difference, or for three-dimensional measurement for obtaining the distance to the subject. ing.

しかしながら、一般的な画像では、フォーカスが合った部分とフォーカスが合っていない部分が共存するため、その合焦度合いに応じて相関幅(相関演算において積和をとる幅)を適応的に変化させる必要があるという課題がある。例えば、相関幅を適応的に変化させなかったとすると、所定の相関幅で相関ピークを求める演算を、相関幅を順次変えながら繰り返すこととなるため、演算量が増加してしまう。上述の特許文献1では、適応的に相関幅を設定しているが、相関演算の前に相関幅の設定処理を行う必要があり、その分だけ演算量が増加するという課題がある。   However, in a general image, a focused part and a non-focused part coexist, so that the correlation width (the width of product sum in correlation calculation) is adaptively changed according to the degree of focus. There is a problem that it is necessary. For example, if the correlation width is not adaptively changed, the calculation for obtaining the correlation peak with a predetermined correlation width is repeated while sequentially changing the correlation width, so that the amount of calculation increases. In the above-mentioned Patent Document 1, the correlation width is adaptively set. However, it is necessary to perform the correlation width setting process before the correlation calculation, and there is a problem that the calculation amount increases accordingly.

本発明の幾つかの態様によれば、合焦度合いに応じて相関幅を適応的に変化させることが可能な撮像装置及び位相差検出方法等を提供できる。   According to some aspects of the present invention, it is possible to provide an imaging device, a phase difference detection method, and the like that can adaptively change the correlation width in accordance with the degree of focus.

本発明の一態様は、第1被写体像と前記第1被写体像に対して視差を有する第2被写体像とを撮像し、撮像画像を取得する撮像素子と、前記撮像画像に基づいて、前記第1被写体像に対応する第1画像と前記第2被写体像に対応する第2画像とを生成する位相差画像生成部と、前記第1画像と前記第2画像を相対的にシフトさせながら相関演算を行い、前記第1画像と前記第2画像の位相差を検出する位相差検出部と、を備え、前記位相差検出部は、前記相関演算の積和を行う領域幅である相関幅を、前記相関演算における前記第1画像と前記第2画像のシフト量に応じて設定する撮像装置に関係する。   According to one aspect of the present invention, an imaging element that captures a first subject image and a second subject image having a parallax with respect to the first subject image and obtains the captured image, and the first image based on the captured image. A phase difference image generation unit that generates a first image corresponding to one subject image and a second image corresponding to the second subject image; and a correlation calculation while relatively shifting the first image and the second image A phase difference detection unit that detects a phase difference between the first image and the second image, and the phase difference detection unit calculates a correlation width that is a region width for performing a product-sum of the correlation calculation, The present invention relates to an imaging device that is set according to the shift amount of the first image and the second image in the correlation calculation.

本発明の一態様によれば、視差を有する第1被写体像と第2被写体像が撮像され、第1被写体像に対応する第1画像と第2被写体像に対応する第2画像とが撮像画像から生成され、相関演算におけるシフト量に応じて相関幅が設定され、そのシフト量に応じた相関幅で相関演算が行われ、第1画像と第2画像の位相差が検出される。これにより、合焦度合いに応じて相関幅を適応的に変化させることが可能になる。   According to one aspect of the present invention, a first subject image and a second subject image having parallax are captured, and a first image corresponding to the first subject image and a second image corresponding to the second subject image are captured images. The correlation width is set according to the shift amount in the correlation calculation, the correlation calculation is performed with the correlation width according to the shift amount, and the phase difference between the first image and the second image is detected. Thereby, the correlation width can be adaptively changed according to the degree of focus.

また本発明の一態様では、前記位相差検出部は、前記シフト量を順次大きくするとともに前記相関幅を順次広くしながら前記相関演算を繰り返し行って相関値を求め、前記相関値が最大値となるときの前記シフト量を前記位相差として検出してもよい。   Also, in one aspect of the present invention, the phase difference detection unit obtains a correlation value by repeatedly performing the correlation calculation while sequentially increasing the shift amount and sequentially increasing the correlation width, and the correlation value is set to a maximum value. The shift amount at the time may be detected as the phase difference.

また本発明の一態様では、前記位相差検出部は、前記シフト量を順次大きくしながら前記相関値を求めたときに、前記相関値の最初のピーク値に対応する前記シフト量を前記位相差として検出してもよい。   In the aspect of the invention, the phase difference detection unit may calculate the shift amount corresponding to the first peak value of the correlation value when the correlation value is obtained while sequentially increasing the shift amount. You may detect as.

また本発明の一態様では、前記位相差検出部は、前記最初のピーク値を検出したと判断した場合に、前記最初のピーク値を検出したと判断したときの前記シフト量よりも大きい前記シフト量について前記相関値を求めずに前記相関演算を終了してもよい。   In the aspect of the invention, when the phase difference detection unit determines that the first peak value is detected, the shift larger than the shift amount when it is determined that the first peak value is detected. The correlation calculation may be terminated without obtaining the correlation value for the quantity.

また本発明の一態様では、前記位相差検出部は、前記位相差を検出したときの前記相関幅に対応した角周波数を設定し、前記角周波数における画素値のフーリエ係数を前記第1画像と前記第2画像について算出し、前記第1画像についての前記フーリエ係数の偏角と前記第2画像についての前記フーリエ係数の偏角との差分が最小となるときの前記シフト量を、サブピクセルの位相差として検出してもよい。   In the aspect of the invention, the phase difference detection unit sets an angular frequency corresponding to the correlation width when the phase difference is detected, and sets a Fourier coefficient of a pixel value at the angular frequency as the first image. The shift amount when the difference between the declination angle of the Fourier coefficient for the first image and the declination angle of the Fourier coefficient for the second image is minimized is calculated for the second image. You may detect as a phase difference.

また本発明の一態様では、前記位相差検出部は、前記撮像画像の画素値と、前記第1画像及び前記第2画像のうち少なくとも一方である比較画像の画素値とを比較することにより、撮像光学系の合焦方向を判定し、前記相関演算において前記第1画像と前記第2画像をシフトさせるシフト方向を、前記判定した前記合焦方向に基づいて設定してもよい。   Moreover, in one aspect of the present invention, the phase difference detection unit compares the pixel value of the captured image with the pixel value of a comparison image that is at least one of the first image and the second image, A focusing direction of the imaging optical system may be determined, and a shift direction for shifting the first image and the second image in the correlation calculation may be set based on the determined focusing direction.

また本発明の一態様では、マルチバンド推定部と、撮像光学系の瞳を、第1瞳と、前記第1瞳とは透過波長帯域が異なる第2瞳とに分割する光学フィルタと、を備え、前記撮像素子は、第1透過率特性を有する第1色フィルタと、第2透過率特性を有する第2色フィルタと、第3透過率特性を有する第3色フィルタとを有し、前記マルチバンド推定部は、前記第1〜第3透過率特性の重なり部分及び非重なり部分に対応する第1〜第5バンドを設定し、前記撮像画像を構成する第1〜第3色の画素値に基づいて前記第1〜第5バンドの成分値を推定し、前記位相差画像生成部は、前記第1〜第5バンドのうち前記第1瞳の透過波長帯域に対応するバンドの成分値を前記第1画像として取得し、前記第1〜第5バンドのうち前記第2瞳の透過波長帯域に対応するバンドの成分値を前記第2画像として取得してもよい。   In one aspect of the present invention, a multiband estimation unit, and an optical filter that divides a pupil of an imaging optical system into a first pupil and a second pupil having a transmission wavelength band different from that of the first pupil are provided. The imaging device includes a first color filter having a first transmittance characteristic, a second color filter having a second transmittance characteristic, and a third color filter having a third transmittance characteristic, The band estimation unit sets first to fifth bands corresponding to the overlapping portion and the non-overlapping portion of the first to third transmittance characteristics, and sets the first to third color pixel values constituting the captured image. The first to fifth band component values are estimated based on the phase difference image generation unit, and the phase difference image generation unit calculates the band component values corresponding to the transmission wavelength band of the first pupil among the first to fifth bands. Acquired as a first image and transmitted through the second pupil of the first to fifth bands The component values of the bands corresponding to the bands may be acquired as the second image.

また本発明の他の態様は、第1被写体像と前記第1被写体像に対して視差を有する第2被写体像とを撮像して、撮像画像を取得し、前記撮像画像に基づいて、前記第1被写体像に対応する第1画像と前記第2被写体像に対応する第2画像とを生成し、相関演算の積和を行う領域幅である相関幅を、前記相関演算における前記第1画像と前記第2画像のシフト量に応じて設定し、前記第1画像と前記第2画像との位相差を前記相関演算により検出する位相差検出方法に関係する。   According to another aspect of the present invention, a first subject image and a second subject image having a parallax with respect to the first subject image are captured to obtain a captured image, and the first subject image is obtained based on the captured image. A first image corresponding to one subject image and a second image corresponding to the second subject image are generated, and a correlation width, which is a region width for performing a product sum of correlation operations, is defined as the first image in the correlation operations. The present invention relates to a phase difference detection method that is set according to the shift amount of the second image and detects a phase difference between the first image and the second image by the correlation calculation.

撮像光学系の基本構成例。2 is a basic configuration example of an imaging optical system. 本実施形態の位相差検出手法についての説明図。Explanatory drawing about the phase difference detection method of this embodiment. シフト量に対する相関幅の特性例と、シフト量に対する相関値の特性例。A characteristic example of the correlation width with respect to the shift amount and a characteristic example of the correlation value with respect to the shift amount 図4(A)、図4(B)は、本実施形態の位相差検出手法についての原理的な説明図。FIG. 4A and FIG. 4B are explanatory diagrams showing the principle of the phase difference detection method of the present embodiment. 本実施形態の位相差検出手法についての原理的な説明図。FIG. 3 is a principle explanatory diagram of a phase difference detection method of the present embodiment. 本実施形態のサブピクセルの位相差検出手法についての説明図。Explanatory drawing about the phase difference detection method of the sub pixel of this embodiment. 偏角差分についての説明図。Explanatory drawing about a declination difference. 偏角差分からサブピクセルの位相差を検出する手法についての説明図。Explanatory drawing about the method of detecting the phase difference of a sub pixel from a declination difference. 第1実施形態における撮像装置の構成例。1 is a configuration example of an imaging apparatus according to a first embodiment. 位相差検出処理のフローチャート。The flowchart of a phase difference detection process. サブピクセルの位相差検出を行う場合の位相差検出処理のフローチャート。The flowchart of the phase difference detection process in the case of performing the phase difference detection of a sub pixel. 図12(A)、図12(B)は、第2実施形態における合焦方向判定手法についての説明図。FIG. 12A and FIG. 12B are explanatory diagrams of the focusing direction determination method in the second embodiment. 第3実施形態における撮像装置の構成例。The structural example of the imaging device in 3rd Embodiment. バンド分割手法についての説明図。Explanatory drawing about a band division | segmentation method. 図15(A)〜図15(F)は、マルチバンド推定処理についての説明図。FIGS. 15A to 15F are explanatory diagrams of multiband estimation processing. マルチバンド推定処理における未知数推定処理についての説明図。Explanatory drawing about the unknown number estimation process in a multiband estimation process. 図17(A)〜図17(F)は、マルチバンド推定処理についての説明図。FIGS. 17A to 17F are explanatory diagrams of multiband estimation processing. マルチバンド推定処理における未知数推定処理についての説明図。Explanatory drawing about the unknown number estimation process in a multiband estimation process.

以下、本発明の好適な実施の形態について詳細に説明する。なお以下に説明する本実施形態は特許請求の範囲に記載された本発明の内容を不当に限定するものではなく、本実施形態で説明される構成の全てが本発明の解決手段として必須であるとは限らない。   Hereinafter, preferred embodiments of the present invention will be described in detail. The present embodiment described below does not unduly limit the contents of the present invention described in the claims, and all the configurations described in the present embodiment are indispensable as means for solving the present invention. Not necessarily.

1.本実施形態の概要
位相差画像(視差画像)を撮像する装置として、例えば2眼式カメラによるステレオ画像撮像装置や瞳分割方式による1眼式カメラなどが知られている。このような装置により撮像した位相差画像により、例えば3次元画像の生成や立体形状計測、位相差式高速AF等が実現されている。特に立体形状計測や位相差式高速AFの場合には、位相差画像の特定位置における位相差(2つの位相差画像のずれ量)を検出し、3角測量の原理を用いて光軸方向の距離情報を求めるのが一般的である。このような位相差を検出するためには、位相差を検出したい位置の近傍の画像(画素値パターン)から対応点を相関演算により見つけ、その対応点の間のずれ量(即ち位相差)を求めるのが通常である。
1. Outline of this Embodiment As a device for capturing a phase difference image (parallax image), for example, a stereo image capturing device using a twin-lens camera, a single-lens camera using a pupil division method, and the like are known. For example, three-dimensional image generation, three-dimensional shape measurement, high-speed phase difference AF, and the like are realized by the phase difference image captured by such an apparatus. Particularly in the case of three-dimensional shape measurement and phase difference type high-speed AF, the phase difference (deviation amount of two phase difference images) at a specific position of the phase difference image is detected, and the optical axis direction is detected using the principle of triangulation. It is common to obtain distance information. In order to detect such a phase difference, a corresponding point is found by correlation calculation from an image (pixel value pattern) in the vicinity of the position where the phase difference is to be detected, and a deviation amount (that is, a phase difference) between the corresponding points is determined. It is normal to seek.

しかしながら、撮像装置で得られた位相差画像では、フォーカスが合っている領域とボケている領域とが共存しており、様々な合焦度合いの領域が混在している。例えば立体形状計測等のように、位相差画像の全ての領域において位相差を求める場合には、様々な合焦度合いの領域で位相差を検出する必要がある。そのため、その合焦度合いに応じて、相関演算において積和をとる幅(以下では適宜、「相関幅」と呼ぶ)を適応的に変化させる必要がある。例えば、フォーカスが合っている領域の画像では、相関幅が大きいと相関ピークが複数発生することに起因して真の位相差を求めることができないので、相関幅を小さく設定する必要がある。一方、ボケている領域の画像では、相関幅を小さく設定すると相関ピークが発生せず、やはり真の位相差を求めることができないので、相関幅を大きく設定する必要がある。   However, in the phase difference image obtained by the imaging device, the focused area and the blurred area coexist, and areas with various degrees of focus are mixed. For example, in the case where the phase difference is obtained in all regions of the phase difference image, such as in three-dimensional shape measurement, it is necessary to detect the phase difference in regions having various degrees of focus. Therefore, it is necessary to adaptively change the width of product sum in the correlation calculation (hereinafter referred to as “correlation width” as appropriate) in accordance with the degree of focusing. For example, in an image in a focused area, if the correlation width is large, a true phase difference cannot be obtained due to the occurrence of a plurality of correlation peaks. Therefore, it is necessary to set the correlation width small. On the other hand, in an image of a blurred area, if the correlation width is set to be small, no correlation peak occurs, and a true phase difference cannot be obtained. Therefore, it is necessary to set the correlation width to be large.

このように適切な相関幅が分からない場合の相関演算手法として、例えば、相関幅を変化させながら、1つ1つの相関幅について位相差画像のシフト量を異ならせて複数回の積和演算を行い、各相関幅について相関ピークを求め、その複数の相関ピークの中から最大値を求める手法がある。しかしながら、この手法では、積和の演算回数が膨大になるという課題がある。特に位相差画像の全て領域に対して相関演算を適用する場合には、演算を高速化する点において非現実的である。   As a correlation calculation method when an appropriate correlation width is not known in this manner, for example, while changing the correlation width, a plurality of product-sum calculations are performed by changing the shift amount of the phase difference image for each correlation width. There is a technique for obtaining a correlation peak for each correlation width and obtaining a maximum value from the plurality of correlation peaks. However, this method has a problem that the number of product-sum operations is enormous. In particular, when the correlation calculation is applied to all regions of the phase difference image, it is impractical in terms of speeding up the calculation.

例えば上述した特許文献1では、適応的に相関幅を設定できるものの、相関演算の前に相関幅の設定処理を行う必要があるため、演算量が増加するという課題がある。また上述した特許文献2では、相関演算を行う探索範囲を絞り込むことにより演算の高速化を図っているが、適応的に相関幅を設定できるわけではない。   For example, in Patent Document 1 described above, although the correlation width can be set adaptively, it is necessary to perform a correlation width setting process before the correlation calculation, which increases the amount of calculation. In Patent Document 2 described above, the calculation speed is increased by narrowing the search range for performing the correlation calculation, but the correlation width cannot be set adaptively.

そこで本実施形態では、図3等に示すように、相関演算において2つの位相差画像を近づけるシフト量δを順次大きくしていくと共に、そのシフト量δに応じて相関幅Wを大きくしていく。そして、相関値が最大となるシフト量δを位相差として検出する。 Therefore, in the present embodiment, as shown in FIG. 3 and the like, the shift amount δ for bringing the two phase difference images closer in the correlation calculation is sequentially increased, and the correlation width W is increased in accordance with the shift amount δ. . Then, the shift amount δ k that maximizes the correlation value is detected as a phase difference.

シフト量δのとき相関幅はWであり、シフト量δは検出対象位置での合焦度合いに対応する。そのため本実施形態では、合焦度合いに対して適応的に相関幅Wが変化することとなり、適切な相関幅Wで位相差を検出することが可能となる。また本実施形態では、相関ピークを1回求めるだけで位相差を検出することができるので、1つ1つの相関幅について相関ピークを求める手法に比べて、格段に積和演算の回数を減らすことができる。また、相関演算の中でシフト量δとともに相関幅Wが変化していくので、相関演算の前に相関幅Wを決める処理を行う必要がなく、相関演算を高速化できる。 When the shift amount is δ k, the correlation width is W k , and the shift amount δ k corresponds to the degree of focus at the detection target position. Therefore, in the present embodiment, the correlation width W k adaptively changes with the degree of focus, and the phase difference can be detected with an appropriate correlation width W k . Further, in this embodiment, since the phase difference can be detected only by obtaining the correlation peak once, the number of product-sum operations is significantly reduced compared to the method of obtaining the correlation peak for each correlation width. Can do. In addition, since the correlation width W changes with the shift amount δ in the correlation calculation, it is not necessary to perform a process of determining the correlation width W before the correlation calculation, and the correlation calculation can be speeded up.

2.第1実施形態
2.1.撮像光学系の基本構成
次に、本実施形態における位相差検出手法について詳細に説明する。まず、第1の実施形態について説明する。
2. First embodiment 2.1. Basic Configuration of Imaging Optical System Next, the phase difference detection method in the present embodiment will be described in detail. First, the first embodiment will be described.

図1に、本実施形態における撮像光学系の基本構成例を示す。図1に示すように、撮像光学系は、撮像素子のセンサ面に被写体を結像させる結像レンズLNSと、第1瞳と第2瞳で帯域を分離する光学フィルタFLTと、を含む。なお以下では、撮像センサの水平走査方向に瞳を分割し、第1瞳を右瞳とし、第2瞳を左瞳とする場合を例にとり説明する。また、左瞳から右瞳へ向かう瞳分割の方向を、適宜「視差方向」とも呼び、この視差方向(即ち水平走査方向)に沿った画素位置を位置xで表すものとする。なお本実施形態では、瞳の分離方向は水平走査方向に限定されず、撮像光学系の光軸に対して垂直な任意の方向に分離されていればよい。   FIG. 1 shows a basic configuration example of the imaging optical system in the present embodiment. As shown in FIG. 1, the imaging optical system includes an imaging lens LNS that forms an image of a subject on the sensor surface of the imaging device, and an optical filter FLT that separates a band between the first pupil and the second pupil. In the following description, an example in which the pupil is divided in the horizontal scanning direction of the imaging sensor, the first pupil is the right pupil, and the second pupil is the left pupil will be described. The direction of pupil division from the left pupil to the right pupil is also referred to as “parallax direction” as appropriate, and the pixel position along this parallax direction (that is, the horizontal scanning direction) is represented by a position x. In the present embodiment, the pupil separation direction is not limited to the horizontal scanning direction, and may be separated in any direction perpendicular to the optical axis of the imaging optical system.

光学フィルタFLTは、透過率特性fを有する右瞳フィルタFL1(第1フィルタ)と、fとは異なる透過率特性fを有する左瞳フィルタFL2(第2フィルタ)と、を有する。光学フィルタFLTは、撮像光学系の瞳位置(例えば絞りの設置位置)に設けられ、フィルタFL1、FL2がそれぞれ右瞳、左瞳に相当している。 The optical filter FLT has a right pupil filter FL1 having transmittance characteristics f R (first filter), and Hidarihitomi filter FL2 having different transmittance characteristics f L (second filter) and f R, a. The optical filter FLT is provided at the pupil position of the imaging optical system (for example, the diaphragm installation position), and the filters FL1 and FL2 correspond to the right pupil and the left pupil, respectively.

結像レンズLNS及び光学フィルタFLTを透過した結像光には、右瞳を通過した被写体像と左瞳を通過した被写体像が含まれる。撮像素子は、これらの被写体像を含む結像光束を画像として撮像する。そして、左右瞳の透過率特性f、fが明確に帯域分離されていることを用いて、撮像画像から右瞳画像(第1画像)の画素値I(x)と左瞳画像(第2画像)の画素値I(x)を求める。なお、撮像素子上の任意の画素は、2次元のアドレスで表記すべきだが、ここでは便宜上撮像素子上の1方向の位置における画素値により説明するものとする。また、I(x)、I(x)は位置xにおける画素値を表すが、画像全体を表す符号としても適宜I(x)、I(x)を用いる。 The imaging light transmitted through the imaging lens LNS and the optical filter FLT includes a subject image that passes through the right pupil and a subject image that passes through the left pupil. The image pickup device picks up an imaging light beam including these subject images as an image. Then, using the fact that the transmittance characteristics f R and f L of the left and right pupils are clearly band-separated, the pixel value I R (x) of the right pupil image (first image) and the left pupil image ( The pixel value I L (x) of the second image) is obtained. Note that an arbitrary pixel on the image sensor should be represented by a two-dimensional address, but here it will be described by a pixel value at a position in one direction on the image sensor for convenience. In addition, I R (x) and I L (x) represent pixel values at the position x, but I R (x) and I L (x) are appropriately used as codes representing the entire image.

なお、I(x)、I(x)を生成する手法の詳細については第3実施形態で後述するが、本実施形態における左右瞳画像の分離手法はこれに限定されない。即ち、位相差を有する2つの画像さえ取得できれば、その画像に対して本実施形態の相関演算の手法を適用できる。 Note that details of a method for generating I R (x) and I L (x) will be described later in the third embodiment, but the method of separating the left and right pupil images in the present embodiment is not limited to this. That is, as long as two images having a phase difference can be acquired, the correlation calculation method of this embodiment can be applied to the images.

図1に示すように、フォーカス位置FPに撮像素子のセンサ面がある場合には、右瞳画像I(x)と左瞳画像I(x)は視差方向にずれておらず、位置が一致している。一方、デフォーカス位置Dr、Dfに撮像素子のセンサ面がある場合には、右瞳画像I(x)と左瞳画像I(x)は視差方向にずれる。具体的には、デフォーカス位置Dfでは、フォーカスが撮像素子のセンサ面よりも後ろ側にある後ピント状態であり、右瞳画像I(x)が右側(+x方向)にずれ、左瞳画像I(x)が左側(−x方向)にずれる。一方、デフォーカス位置Drは、フォーカスが撮像素子のセンサ面よりも前側にある前ピント状態であり、右瞳画像I(x)が左側にずれ、左瞳画像I(x)が右側にずれる。 As shown in FIG. 1, when the sensor surface of the image sensor is at the focus position FP, the right pupil image I R (x) and the left pupil image I L (x) are not shifted in the parallax direction, and the position is Match. On the other hand, when the sensor surface of the image sensor is at the defocus positions Dr and Df, the right pupil image I R (x) and the left pupil image I L (x) are shifted in the parallax direction. Specifically, at the defocus position Df, the focus is in the rear focus state behind the sensor surface of the image sensor, the right pupil image I R (x) is shifted to the right (+ x direction), and the left pupil image I L (x) shifts to the left (−x direction). On the other hand, the defocus position Dr is a front focus state where the focus is on the front side of the sensor surface of the image sensor, the right pupil image I R (x) is shifted to the left side, and the left pupil image I L (x) is on the right side. Shift.

図1には、デフォーカス位置DrでのI(x)、I(x)を例として図示しており、I(x)、I(x)のずれ量をδで表す。本実施形態では、このずれ量δを相関演算により位相差として算出する。 In FIG. 1, I R (x) and I L (x) at the defocus position Dr are illustrated as examples, and the deviation amount of I R (x) and I L (x) is represented by δ. In the present embodiment, the shift amount δ is calculated as a phase difference by correlation calculation.

2.2.位相差検出手法
次に、右瞳画像I(x)と左瞳画像I(x)の位相差を検出する手法について説明する。なお、以下では後ピント状態でのI(x)、I(x)を例にとり説明するが、前ピント状態でも同様にして相関演算を行うことができる。
2.2. Phase Difference Detection Method Next, a method for detecting the phase difference between the right pupil image I R (x) and the left pupil image I L (x) will be described. In the following, I R (x) and I L (x) in the rear focus state will be described as an example, but the correlation calculation can be performed in the same manner in the front focus state.

図2に示すように、右瞳画像I(x)と左瞳画像I(x)の波形を近づけるシフト量をδ、δ、δ、・・・と変化させ、各シフト量について右瞳画像I(x)と左瞳画像I(x)の画素値の積和をとる。ここでδはj回目(jは0以上の整数)の演算ステップにおけるシフト量を表し、δ=0、δ<δ(j+1)である。後ピント状態では、右瞳画像I(x)を左側(−x方向)にδだけシフトさせ、左瞳画像I(x)を右側(+x方向)にδだけシフトさせる。 As shown in FIG. 2, the shift amount for bringing the waveforms of the right pupil image I R (x) and the left pupil image I L (x) closer to each other is changed to δ 0 , δ 1 , δ 2 ,. For the right pupil image I R (x) and the left pupil image I L (x). Here, δ j represents the shift amount in the j-th calculation step (j is an integer of 0 or more), and δ 0 = 0 and δ j(j + 1) . In the rear focus state, the right pupil image I R (x) is shifted by δ j to the left (−x direction), and the left pupil image I L (x) is shifted by δ j to the right (+ x direction).

シフト量δでの積和は、シフト量δに対応して設定された相関幅Wで行い、その相関幅Wは、画像上において相関値を求めたい位置xi(以下では適宜、「注目位置」と呼ぶ)を中心として設定される。具体的には、下式(1)、(2)により位置xiでの相関値C(δ)を求める。

Figure 2014038151
Figure 2014038151
Sum of products of the shift amount [delta] j is performed by the shift amount [delta] correlation width is set to correspond to the j W j, the correlation width W j is the position xi (hereinafter to be the correlation value on the image as appropriate, (Referred to as “attention position”). Specifically, the correlation value C (δ j ) at the position xi is obtained by the following expressions (1) and (2).
Figure 2014038151
Figure 2014038151

図3に、シフト量δに対する相関幅Wの特性WDと、シフト量δに対する相関値C(δ)の特性CVを示す。 FIG. 3 shows a characteristic WD of the correlation width W j with respect to the shift amount δ j and a characteristic CV of the correlation value C (δ j ) with respect to the shift amount δ j .

特性WDに示すように、相関幅Wは、シフト量δを大きくするのと連動して大きくなる。基本的にはW<W(j+1)となるように設定するが、必ずしも全てのδに対してW<W(j+1)である必要はなく、例えばδの近傍(図3の例ではδ〜δ)においてW=W(j+1)であってもよい。この相関幅Wとシフト量δの関係は、例えば画像の位相差とボケ具合の関係から予め設定しておけばよい。即ち、画像の位相差が大きくなるほど画像がボケることから、シフト量δに連動して相関幅Wを大きくする。この点については、図4等で詳細に後述する。 As indicated by the characteristic WD, the correlation width W j increases in conjunction with increasing the shift amount δ j . Is basically set so that W j <W (j + 1 ) , of not all W j <W (j + 1 ) need not be relative to [delta] j, for example near the [delta] 0 (Fig. 3 cases In this case, W j = W (j + 1) in δ 0 to δ 2 ). The relationship between the correlation width W j and the shift amount δ j may be set in advance, for example, from the relationship between the phase difference of the image and the degree of blur. That is, the larger the phase difference of the image, the more the image is blurred. Therefore, the correlation width W j is increased in conjunction with the shift amount δ j . This will be described in detail later with reference to FIG.

特性CVに示すように、シフト量をδ、δ、δ、・・・と変化させながら相関値C(δ)を求めると、シフト量δが注目位置xiでの位相差に一致したときにピークとなる。このときのシフト量をδ(kは自然数)で表し、相関幅をWで表し、相関値のピーク値をC(δ)=Cmaxで表す。本実施形態では、この相関ピークを検出することにより位相差を検出する。検出される位相差は2δである。相関ピークの検出手法としては、例えば相関値C(δ)に対してピークホールド処理を行えばよい。 As shown by the characteristic CV, when the correlation value C (δ j ) is obtained while changing the shift amount to δ 0 , δ 1 , δ 2 ,..., The shift amount δ j becomes the phase difference at the target position xi. Peak when matched. The shift amount at this time is represented by δ k (k is a natural number), the correlation width is represented by W k , and the peak value of the correlation value is represented by C (δ k ) = C max . In this embodiment, the phase difference is detected by detecting this correlation peak. Phase difference detection is 2.delta. K. As a correlation peak detection method, for example, peak hold processing may be performed on the correlation value C (δ j ).

E1に示すように、ピーク検出において1つ目の相関ピークを検出したと判断したら、それ以降の相関値を求めずに相関演算を終了する。例えば、ピークホールド処理でホールドしている相関値と新たに算出した相関値とを比較し、新たに算出した相関値の方が小さいという判定が所定回数だけ続いた場合に、相関演算を終了する。このようにすれば、誤った相関ピークを位相差として検出することを防止でき、また、相関演算を途中で終了するので処理を高速化できる。   As shown in E1, if it is determined that the first correlation peak has been detected in the peak detection, the correlation calculation is terminated without obtaining the subsequent correlation values. For example, the correlation value held in the peak hold process is compared with the newly calculated correlation value, and when the determination that the newly calculated correlation value is smaller continues for a predetermined number of times, the correlation calculation is terminated. . In this way, it is possible to prevent an erroneous correlation peak from being detected as a phase difference, and the correlation calculation is terminated midway, so that the processing speed can be increased.

次に図4(A)〜図5を用いて、シフト量δに連動して相関幅Wを大きくする点について原理的に説明する。なお、以下では後ピント状態を例にとり説明する。 Next, the principle of increasing the correlation width W j in conjunction with the shift amount δ j will be described in principle with reference to FIGS. In the following description, the rear focus state is taken as an example.

図4(A)には、図1のフォーカス位置FP近傍における位相差画像を模式的に示す。f(x)は、瞳が分割されておらずフォーカスが合った理想的な撮像系で撮像された画像を表し、図4(A)では、その撮像画像がもつ代表的な周波数で変化する1つのピークをf(x)としている。   FIG. 4A schematically shows a phase difference image in the vicinity of the focus position FP in FIG. f (x) represents an image captured by an ideal imaging system in which the pupil is not divided and is in focus. In FIG. 4A, 1 changes at a representative frequency of the captured image. Two peaks are denoted by f (x).

実際に撮像される画像は、このf(x)に対して、撮像光学系のポイントスプレッドファンクション(PSF: Point Spread Function)をコンボリューションしたものである。右瞳と左瞳のポイントスプレッドファンクションをそれぞれPSF(x)、PSF(x)とすると、右瞳画像はI(x)=f(x)*PSF(x)で得られ、右瞳画像はI(x)=f(x)*PSF(x)で得られる。ここで、“*”はコンボリューション演算を表す。 An actually captured image is a convolution of the point spread function (PSF) of the imaging optical system with respect to this f (x). If the point spread functions for the right and left pupils are PSF R (x) and PSF L (x), respectively, the right pupil image is obtained as I R (x) = f (x) * PSF R (x) The pupil image is obtained by I L (x) = f (x) * PSF L (x). Here, “*” represents a convolution operation.

PSF(x)とPSF(x)の重心位置は異なっているため、それに応じてI(x)とI(x)は、左右にシフトする。後ピント状態では、図4(A)に示すようにI(x)が右側にシフトし、I(x)が左側にシフトする。フォーカス位置の近傍では、PSF(x)とPSF(x)の重心位置の間隔が狭いので、I(x)とI(x)の位相差δは小さい。また、PSF(x)とPSF(x)の分布が狭いので、I(x)とI(x)も比較的狭い幅Wの範囲に分布する。I(x)とI(x)は、注目位置xiでのポイントスプレッドファンクションによってf(x)がぼかされたものなので、I(x)とI(x)の分布の広がりは、注目位置xiでの画像がもつ周波数に対応している。 Since the barycentric positions of PSF R (x) and PSF L (x) are different, I R (x) and I L (x) shift to the left and right accordingly. In the rear focus state, as shown in FIG. 4A, I R (x) shifts to the right side and I L (x) shifts to the left side. In the vicinity of the focus position, the interval between the gravity center positions of PSF R (x) and PSF L (x) is narrow, and therefore the phase difference δ between I R (x) and I L (x) is small. Further, since the distribution of PSF R (x) and PSF L (x) is narrow, I R (x) and I L (x) are also distributed in a relatively narrow range of width W. Since I R (x) and I L (x) are f (x) blurred by the point spread function at the target position xi, the spread of the distribution of I R (x) and I L (x) is , Corresponding to the frequency of the image at the target position xi.

このI(x)とI(x)から相関値を求めるとき、仮に相関幅を幅Wよりも広くしすぎると、相関幅の中にI(x)やI(x)の画素値のピークが複数含まれてしまい、実際には対応しないピークが重なったときに相関ピークが発生する可能性がある。一方、相関幅を幅Wより狭くしすぎると、相関幅の中にI(x)やI(x)の画素値のピークが含まれず、相関ピークを検出できなくなる。以上のことから、相関幅は幅Wの程度に設定することで、相関ピークを適切に検出できることが分かる。 When obtaining a correlation value from I R (x) and I L (x), if the correlation width is made too wide than the width W, pixels of I R (x) and I L (x) are included in the correlation width. A correlation peak may occur when a plurality of value peaks are included and peaks that do not actually correspond overlap. On the other hand, if the correlation width is made narrower than the width W, the peak of the pixel values of I R (x) and I L (x) is not included in the correlation width, and the correlation peak cannot be detected. From the above, it can be seen that the correlation peak can be appropriately detected by setting the correlation width to the width W.

図4(B)には、図1のデフォーカス位置Df近傍における位相差画像を模式的に示す。デフォーカス位置では、PSF(x)とPSF(x)の重心位置の間隔が広いので、I(x)とI(x)の位相差δ’は、フォーカス位置での位相差δよりも大きい。また、PSF(x)とPSF(x)の分布が広いので、I(x)とI(x)が分布する幅W’はフォーカス位置での幅Wよりも広い。この幅W’に対応して、デフォーカス位置ではフォーカス位置よりも相関幅を大きく設定する。また、位相差δ’が大きくなるほど幅W’も大きくなるため、位相差δ’が大きいほど(即ち注目位置xiでの画像がボケているほど)相関幅を大きくすればよいことが分かる。 FIG. 4B schematically shows a phase difference image in the vicinity of the defocus position Df in FIG. At the defocus position, the distance between the gravity center positions of PSF R (x) and PSF L (x) is wide, and therefore the phase difference δ ′ between I R (x) and I L (x) is the phase difference δ at the focus position. Bigger than. Further, since the distribution of PSF R (x) and PSF L (x) is wide, the width W ′ in which I R (x) and I L (x) are distributed is wider than the width W at the focus position. Corresponding to this width W ′, the correlation width is set larger at the defocus position than at the focus position. It can also be seen that the width W ′ increases as the phase difference δ ′ increases, so that the correlation width should be increased as the phase difference δ ′ increases (that is, the image at the position of interest xi is blurred).

上記のようなI(x)とI(x)に対して本実施形態の相関演算を適用した場合、図5に示すように、シフト量δが大きくなるとともにI(x)とI(x)の間隔は2(δ−δ)、2(δ−δ)、・・・と小さくなっていき、相関幅はW、W、・・・と大きくなっていく。I(x)とI(x)の間隔が2(δ−δ)=0となり、I(x)とI(x)が一致したとき、相関値がピーク値となる。このときの相関幅Wは、上述のようにI(x)とI(x)の分布幅程度に設定されており、相関ピークを適切に検出できる相関幅となっている。 When the correlation calculation of the present embodiment is applied to the above I R (x) and I L (x), as shown in FIG. 5, the shift amount δ j increases and I R (x) The interval of I L (x) decreases as 2 (δ k −δ 0 ), 2 (δ k −δ 1 ),..., And the correlation width increases as W 0 , W 1 ,. To go. When the interval between I R (x) and I L (x) is 2 (δ k −δ k ) = 0 and I R (x) and I L (x) match, the correlation value becomes the peak value. The correlation width W k at this time is set to about the distribution width of I R (x) and I L (x) as described above, and is a correlation width that can appropriately detect the correlation peak.

このように、シフト量δに連動して相関幅Wを設定することにより、I(x)とI(x)の合焦度合い(即ち位相差2δ)に対して適切な相関幅Wで相関ピークを検出することが可能となる。 Thus, by setting a correlation width W j in synchronization with the shift amount [delta] j, an appropriate correlation to focus degree of I R (x) and I L (x) (i.e. the phase difference 2.delta. K) it is possible to detect a correlation peak with a width W k.

2.3.サブピクセルの位相差検出手法
上述したような画素値の積和をとる手法では、画素の間隔よりも小さい精度(サブピクセル)で位相差を検出することは難しい。そこで本実施形態では、積和により位相差を検出した後、更に、サブピクセルの位相差検出を行ってもよい。以下では、このサブピクセルの位相差検出について説明する。
2.3. Sub-pixel phase difference detection method In the above-described method of calculating the product sum of pixel values, it is difficult to detect the phase difference with a smaller accuracy (sub-pixel) than the pixel interval. Therefore, in this embodiment, after detecting the phase difference by the product sum, the phase difference detection of the subpixel may be further performed. Hereinafter, the phase difference detection of the sub-pixel will be described.

図6に示すように、シフト量δだけシフトさせた右瞳画像I(x+δ)と左瞳画像I(x−δ)の間に、φのずれが残っているとする。シフト量δは、図3等で説明したように、積和による相関演算で求めたI(x)とI(x)の位相差である。また、ずれ量φは、画素の間隔よりも小さいずれ量である。本実施形態では、このずれ量φを検出する。 As illustrated in FIG. 6, it is assumed that a shift of φ remains between the right pupil image I R (x + δ k ) shifted by the shift amount δ k and the left pupil image I L (x−δ k ). The shift amount δ k is the phase difference between I R (x) and I L (x) obtained by the correlation calculation by the product sum as described with reference to FIG. The shift amount φ is any amount smaller than the pixel interval. In the present embodiment, this deviation amount φ is detected.

ずれ量φの検出処理では、まず下式(3)、(4)により係数A、B、A(d)、B(d)を求める。係数A、Bは、角周波数ωでのI(x−δ)のフーリエ係数に相当する。また、係数A(d)、B(d)は、角周波数ωでのI(x+δ)のフーリエ係数に相当し、積和の範囲をdだけシフトさせたものである。

Figure 2014038151
Figure 2014038151
In the detection process of the deviation amount φ, first, coefficients A L , B L , A R (d), and B R (d) are obtained by the following equations (3) and (4). The coefficients A L and B L correspond to the Fourier coefficient of I L (x−δ k ) at the angular frequency ω. The coefficients A R (d) and B R (d) correspond to the Fourier coefficient of I R (x + δ k ) at the angular frequency ω, and are obtained by shifting the product sum range by d.
Figure 2014038151
Figure 2014038151

ここで、角周波数ωは、位相差2δを検出したときの相関幅Wで決まり、ω=π/Wである。cos(ωx)とsin(ωx)は、図6に示すようにxiを中心とする幅Wの範囲で定義された関数である。この関数cos(ωx)、sin(ωx)のデータは、画素の間隔よりも狭い間隔で値をもっており、その間隔を狭くするほどφの検出精度を向上できる。 Here, the angular frequency ω is determined by the correlation width W k when the phase difference 2δ k is detected, and ω = π / W k . cos (ωx) and sin (ωx) are functions defined in a range of a width W k centered on xi as shown in FIG. The data of the functions cos (ωx) and sin (ωx) have values at intervals that are narrower than the interval between pixels, and the detection accuracy of φ can be improved as the interval is reduced.

次に、下式(5)により、偏角差分Δθを求める。図7に示すように、tan−1{B/A}は、係数A、Bの偏角であり、tan−1{B(d)/A(d)は、係数A(d)、B(d)の偏角である。偏角差分Δθは、それらの差分である。
Δθ=tan−1{B/A}−tan−1{B(d)/A(d)}] (5)
Next, the declination difference Δθ is obtained by the following equation (5). As shown in FIG. 7, tan −1 {B L / A L } is a declination of coefficients A L and B L , and tan −1 {B R (d) / A R (d) is a coefficient A R (d), which is the argument of B R (d). The declination difference Δθ is the difference between them.
Δθ = tan −1 {B L / A L } −tan −1 {B R (d) / A R (d)}] (5)

次に、図8に示すように、シフト量dを変化させ、偏角差分Δθの最小値Δθminを検出し、その最小値Δθminに対応するシフト量dをサブピクセルの位相差として検出する。図6のようにI(x+δ)とI(x−δ)のずれ量がφの場合には、検出される位相差はd=φとなる。最終的な位相差は、I(x)とI(x)の積和で求めた位相差2δとサブピクセルの位相差φから、2δ+φと求められる。 Next, as shown in FIG. 8, by changing the shift amount d, and detects the minimum value [Delta] [theta] min declination difference [Delta] [theta], detects the shift amount d corresponding to the minimum value [Delta] [theta] min as the phase difference of the sub-pixels . As shown in FIG. 6, when the shift amount between I R (x + δ k ) and I L (x−δ k ) is φ, the detected phase difference is d = φ. The final phase difference is obtained as 2δ k + φ from the phase difference 2δ k obtained by the product sum of I R (x) and I L (x) and the phase difference φ of the subpixel.

以上の実施形態によれば、積和による相関演算で位相差2δを求めた後に微小な位相差φが残っている場合であっても、その位相差φをサブピクセルの精度で検出できる。また、偏角差分Δθを求める角周波数ωを、積和による相関演算で位相差2δを検出したときの相関幅Wに応じて決定(ω=π/W)することで、画像がもつ周波数に対応した偏角差分Δθを求めることができる。即ち、図4(A)等で説明したように、画像のもつ代表的な周波数は位相差2δ(即ちボケ具合)に応じて決まっており、その周波数の波を例えば1つ程度含むように相関幅Wが決まっている。これは、角周波数ω=π/Wの周波数成分が画像に豊富に含まれることを意味しており、その角周波数ωでフーリエ係数を求めることにより、絶対値の大きなフーリエ係数を求め、精度良く偏角差分Δθを決定することができる。 According to the embodiment described above, even if a minute phase difference φ remains after the phase difference 2δ k is obtained by the correlation calculation by the product sum, the phase difference φ can be detected with sub-pixel accuracy. Further, the angular frequency ω for obtaining the deviation difference Δθ is determined (ω = π / W k ) according to the correlation width W k when the phase difference 2δ k is detected by the correlation calculation by the product sum, so that the image becomes The deviation angle difference Δθ corresponding to the possessed frequency can be obtained. That is, as described in FIG. 4A and the like, the representative frequency of the image is determined according to the phase difference 2δ k (that is, the degree of blur), and includes, for example, about one wave of that frequency. A correlation width W k is determined. This means that the frequency component of the angular frequency ω = π / W k is abundant in the image. By obtaining the Fourier coefficient at the angular frequency ω, the Fourier coefficient having a large absolute value is obtained, and the accuracy is obtained. The deviation angle difference Δθ can be determined well.

なお、上記の実施形態では偏角差分Δθが最小になるときのシフト量dを求めたが、本実施形態ではこれに限定されず、差分[{B/A}−{B(d)/A(d)}](A=0又はA(d)=0の場合は除く)が最小になるときのシフト量dを求めてもよい。 In the above-described embodiment, the shift amount d when the deviation angle difference Δθ is minimized is determined. However, the present embodiment is not limited to this, and the difference [{B L / A L } − {B R (d ) / A R (d)}] (except when A L = 0 or A R (d) = 0) may be obtained.

2.4.撮像装置
図9に、第1実施形態における撮像装置の構成例を示す。この撮像装置は、結像レンズLNS、光学フィルタFLT、撮像部10、位相差画像生成部20、フォーカス制御部80、位相差検出部82を含む。なお、本実施形態は図9の構成に限定されず、その構成要素の一部を省略(例えばフォーカス制御部80)したり、他の構成要素を追加したりする等の種々の変形実施が可能である。例えば図9では位相差AFを行う構成を示すが、例えば、検出した位相差により被写体の3次元情報を取得する構成としてもよい。
2.4. Imaging Device FIG. 9 shows a configuration example of the imaging device in the first embodiment. The imaging apparatus includes an imaging lens LNS, an optical filter FLT, an imaging unit 10, a phase difference image generation unit 20, a focus control unit 80, and a phase difference detection unit 82. Note that the present embodiment is not limited to the configuration shown in FIG. 9, and various modifications such as omitting some of the components (for example, the focus control unit 80) or adding other components are possible. It is. For example, FIG. 9 shows a configuration for performing the phase difference AF, but for example, a configuration in which the three-dimensional information of the subject is acquired based on the detected phase difference may be used.

撮像部10は、撮像素子と撮像処理部を含むことができる。撮像素子は、結像レンズLNS及び光学フィルタFLTによって結像された被写体を撮像する。撮像処理部は、撮像動作の制御や、アナログの画素信号をA/D変換する処理などを行う。   The imaging unit 10 can include an imaging device and an imaging processing unit. The imaging element images a subject imaged by the imaging lens LNS and the optical filter FLT. The imaging processing unit performs imaging operation control, A / D conversion processing of analog pixel signals, and the like.

位相差画像生成部20は、撮像部10により撮像された画像に基づいて、右瞳画像Iと左瞳画像Iを生成する。この2画像を位相差画像とする。位相差画像の生成手法としては、例えば既知の手法(例えば特開2001−174696号公報や、特開平10−276964号公報に記載の手法)など、種々の手法を採用することが可能である。或は、第3実施形態で説明するマルチバンド推定処理により位相差画像を生成してもよい。 Phase difference image generator 20, based on the image captured by the imaging unit 10, generates the right pupil images I R and Hidarihitomi image I L. These two images are referred to as phase difference images. As a method for generating a phase difference image, various methods such as a known method (for example, a method described in Japanese Patent Laid-Open No. 2001-174696 and Japanese Patent Laid-Open No. 10-276964) can be employed. Or you may produce | generate a phase difference image by the multiband estimation process demonstrated in 3rd Embodiment.

位相差検出部82は、位相差画像I、Iに対して、上述の位相差検出手法を適用し、位相差を検出する。 The phase difference detection unit 82 detects the phase difference by applying the above-described phase difference detection method to the phase difference images I R and I L.

フォーカス制御部80は、検出された位相差の情報に基づいてオートフォーカス制御を行う。即ちフォーカス制御部80は、位相差の情報と位相差画像I、Iのずれ方向の情報に基づいてフォーカス制御量(結像レンズLNSの移動量と移動方向)を算出し、そのフォーカス制御量に基づいてフォーカスレンズを移動させる制御を行う。位相差画像I、Iのずれ方向は、例えば相関演算において探索的に決定すればよい。 The focus control unit 80 performs autofocus control based on the detected phase difference information. That is, the focus control unit 80 calculates a focus control amount (a movement amount and a movement direction of the imaging lens LNS) based on the phase difference information and the information on the shift direction of the phase difference images I R and I L , and the focus control is performed. Control to move the focus lens based on the amount is performed. The shift direction of the phase difference images I R and I L may be determined exploratively, for example, in correlation calculation.

2.5.位相差検出処理
図10に、本実施形態の位相差検出処理のフローチャートを示す。この処理が開始されると、位相差を取得したいポイントxi(注目画素)を設定する(ステップS1)。例えば位相差AFを行う場合には、フォーカス制御部80が、撮像画像上でフォーカスを合わせたいポイントxiを設定する。
2.5. Phase Difference Detection Process FIG. 10 shows a flowchart of the phase difference detection process of this embodiment. When this process is started, a point xi (target pixel) for which a phase difference is to be acquired is set (step S1). For example, when performing phase difference AF, the focus control unit 80 sets a point xi to be focused on the captured image.

次に、位相差画像生成部20が位相差画像I、Iを取得する(ステップS2)。次に、位相差検出部82が、相関幅W=Wとシフト量δ=δ=0を設定する(ステップS3)。次に、位相差検出部82が、ステップS3で設定したシフト量δで位相差画像I、Iを近づける(ステップS4)。次に、位相差検出部82が、ステップS3で設定した相関幅Wで、ポイントxiでの相関値C(δ)を算出する(ステップS5)。次に、位相差検出部82は、相関値C(δ)がピーク値であるか否かを判定する(ステップS6)。 Next, the phase difference image generation unit 20 acquires phase difference images I R and I L (step S2). Next, the phase difference detection unit 82 sets the correlation width W j = W 0 and the shift amount δ j = δ 0 = 0 (step S3). Next, the phase difference detection unit 82 brings the phase difference images I R and I L close by the shift amount δ j set in step S3 (step S4). Next, the phase difference detection unit 82 calculates the correlation value C (δ j ) at the point xi with the correlation width W j set in step S3 (step S5). Next, the phase difference detection unit 82 determines whether or not the correlation value C (δ j ) is a peak value (step S6).

相関値C(δ)がピーク値でないと判定した場合には、位相差検出部82は、相関幅W=Wj+1とシフト量δ=δj+1を設定し(ステップS7)、ステップS4を再び実行する。一方、相関値C(δ)がピーク値であると判定した場合には、位相差検出部82は、シフト量δに基づいて位相差2δ=2δを出力し(ステップS8)、位相差検出処理を終了する。なお、位相差の情報としては、位相差2δそのものに限らず、シフト量δを出力してもよい。 When it is determined that the correlation value C (δ j ) is not a peak value, the phase difference detection unit 82 sets the correlation width W j = W j + 1 and the shift amount δ j = δ j + 1 (step S7), and step S4 Run again. On the other hand, when it is determined that the correlation value C (δ j ) is the peak value, the phase difference detection unit 82 outputs the phase difference 2δ j = 2δ k based on the shift amount δ j (step S8). The phase difference detection process ends. As the information of the phase difference is not limited to the phase difference 2.delta. K itself, may output the shift amount [delta] k.

図11に、サブピクセルの位相差検出処理を行う場合の位相差検出処理のフローチャートを示す。ステップS21〜S27は図10のステップS1〜S7と同一であるため、説明を省略する。   FIG. 11 shows a flowchart of the phase difference detection process when the sub-pixel phase difference detection process is performed. Steps S21 to S27 are the same as steps S1 to S7 in FIG.

ステップS26において、相関値C(δ)がピーク値であると判定した場合には、位相差検出部82は、サブピクセル精度の位相差を検出するか否かを決定する(ステップS28)。例えば、ユーザーからの設定情報に基づいて決定してもよいし、或は、相関値C(δ)の大きさに基づいて決定してもよい。 If it is determined in step S26 that the correlation value C (δ j ) is a peak value, the phase difference detection unit 82 determines whether or not to detect a phase difference with subpixel accuracy (step S28). For example, it may be determined based on setting information from the user, or may be determined based on the magnitude of the correlation value C (δ j ).

サブピクセル精度の位相差を検出しないと決定した場合には、位相差検出部82は、シフト量δに基づいて位相差2δ=2δを出力し、位相差検出処理を終了する。サブピクセル精度の位相差を検出すると決定した場合には、位相差検出部82は、シフト量dにおける位相差画像I、Iの偏角差分Δθを求める(ステップS29)。dの初期値は例えばd=0である。次に、位相差検出部82は、偏角差分Δθが最小値であるか否かを判定する(ステップS30)。 When it is determined not to detect the phase difference with sub-pixel accuracy, the phase difference detection unit 82 outputs the phase difference 2δ j = 2δ k based on the shift amount δ j and ends the phase difference detection process. When it is determined that the phase difference with sub-pixel accuracy is detected, the phase difference detection unit 82 obtains the deviation angle difference Δθ between the phase difference images I R and I L at the shift amount d (step S29). The initial value of d is, for example, d = 0. Next, the phase difference detection unit 82 determines whether or not the declination difference Δθ is a minimum value (step S30).

偏角差分Δθが最小値でない場合には、位相差検出部82は、シフト量d=d+αを設定し(ステップS31)、ステップS29を再び実行する。ここでαは、シフト量dを変化させるときの変化量(刻み)であり、サブピクセルの位相差を検出する精度に応じて設定される。一方、偏角差分Δθが最小値である場合には、位相差検出部82は、シフト量δ、dに基づいて位相差2δ+d=2δ+φを出力し(ステップS32)、位相差検出処理を終了する。 If the declination difference Δθ is not the minimum value, the phase difference detection unit 82 sets the shift amount d = d + α (step S31) and executes step S29 again. Here, α is a change amount (step) when the shift amount d is changed, and is set according to the accuracy of detecting the phase difference of the sub-pixels. On the other hand, when the declination difference Δθ is the minimum value, the phase difference detection unit 82 outputs the phase difference 2δ j + d = 2δ k + φ based on the shift amounts δ j , d (step S32). The detection process ends.

以上の実施形態によれば、図9で説明したように、撮像装置は撮像素子(撮像部10)と位相差画像生成部20と位相差検出部82とを備える。撮像素子は、第1被写体像と、第1被写体像に対して視差を有する第2被写体像とを撮像し、撮像画像を取得する。位相差画像生成部20は、その撮像画像に基づいて、第1被写体像に対応する第1画像I(x)(右瞳画像)と第2被写体像に対応する第2画像I(x)(左瞳画像)とを生成する。位相差検出部82は、第1画像I(x)と第2画像I(x)を相対的にシフトさせながら相関演算を行い、第1画像I(x)と第2画像I(x)の位相差を検出する。このとき、位相差検出部82は、相関演算の積和を行う領域幅である相関幅Wを、シフトのシフト量δに応じて設定する。 According to the above embodiment, as described in FIG. 9, the imaging device includes the imaging element (imaging unit 10), the phase difference image generation unit 20, and the phase difference detection unit 82. The imaging device captures a first subject image and a second subject image having a parallax with respect to the first subject image to obtain a captured image. Based on the captured image, the phase difference image generation unit 20 generates a first image I R (x) (right pupil image) corresponding to the first subject image and a second image I L (x corresponding to the second subject image). ) (Left pupil image). The phase difference detection unit 82 performs correlation calculation while relatively shifting the first image I R (x) and the second image I L (x), and performs the first image I R (x) and the second image I L. The phase difference of (x) is detected. At this time, the phase difference detection unit 82 sets a correlation width W j that is an area width for performing a product-sum of correlation calculations according to the shift amount δ j of the shift.

例えば本実施形態では、撮像光学系(結像レンズLNS、光学フィルタFLT)は、第1被写体像(右瞳を通過した被写体像)と、第1被写体像に対して視差を有する第2被写体像(左瞳を通過した被写体像)とを結像する。そして、その第1被写体像と第2被写体像とを撮像素子が撮像する。ここで「視差」とは、被写体と観測点(本実施形態では光学系の瞳)の相対的な位置の違いによって、結像の位置が変化する(ずれる)ことである。   For example, in this embodiment, the imaging optical system (imaging lens LNS, optical filter FLT) includes a first subject image (a subject image that has passed through the right pupil) and a second subject image that has parallax with respect to the first subject image. (Subject image that has passed through the left pupil). Then, the image sensor picks up the first subject image and the second subject image. Here, “parallax” means that the imaging position changes (shifts) due to the relative position difference between the subject and the observation point (in this embodiment, the pupil of the optical system).

このようにすれば、図4(A)等で説明したように、注目位置xiでの合焦度合いに応じて適切な相関幅で位相差を検出できる。即ち、位相差2δ(図3のδ)は画像の合焦度合いを表すことから、シフト量δと相関幅Wを連動させることで、その合焦度合いに応じた適切な相関幅Wで位相差2δを検出できる。 In this way, as described with reference to FIG. 4A and the like, the phase difference can be detected with an appropriate correlation width according to the degree of focus at the target position xi. That is, since the phase difference 2δ kk in FIG. 3) represents the degree of focusing of the image, an appropriate correlation width corresponding to the degree of focusing is obtained by linking the shift amount δ j and the correlation width W j. possible to detect a phase difference 2δ k in W k.

また本実施形態では、図3で説明したように、位相差検出部82は、シフト量δを順次大きくするとともに相関幅Wを順次広くしながら相関演算を繰り返し行って相関値C(δ)を求め、その相関値C(δ)が最大値Cmaxとなるときのシフト量δを位相差として検出する。 In the present embodiment, as described with reference to FIG. 3, the phase difference detection unit 82 repeatedly performs the correlation calculation while sequentially increasing the shift amount δ j and gradually increasing the correlation width W j, thereby calculating the correlation value C (δ j ) is obtained, and the shift amount δ k when the correlation value C (δ j ) reaches the maximum value C max is detected as a phase difference.

図4(A)等で説明したように、位相差2δが大きいほど画像がボケており、相関幅Wを大きくする必要がある。この点、本実施形態によれば、シフト量δとともに相関幅Wを大きくするので、画像のボケ具合(画像の代表的な周波数成分)に応じた相関幅Wで位相差2δを検出できる。また、注目位置xiがフォーカスの合っている部分である場合には、狭い相関幅、即ち少ない演算回数で相関ピークを求めることができる。これにより、位相差検出処理を高速化でき、例えば画像全体の位相差を演算するような場合(例えば形状計測)に特に処理負荷を低減できる。 As described with reference to FIG. 4A and the like, the larger the phase difference 2δ k is, the more blurred the image is, and the correlation width W k needs to be increased. In this regard, according to the present embodiment, the correlation width W j is increased together with the shift amount δ j , so that the phase difference 2δ k is set with the correlation width W k corresponding to the degree of image blur (a typical frequency component of the image). It can be detected. Further, when the target position xi is a focused part, the correlation peak can be obtained with a narrow correlation width, that is, with a small number of calculations. Thereby, the phase difference detection process can be speeded up, and the processing load can be reduced particularly when the phase difference of the entire image is calculated (for example, shape measurement).

また本実施形態では、図3で説明したように、位相差検出部82は、シフト量δを順次大きくしながら相関値C(δ)を求めたときに、相関値C(δ)の最初のピーク値Cmaxに対応するシフト量δを位相差として検出する。 In the present embodiment, as described with reference to FIG. 3, when the phase difference detection unit 82 obtains the correlation value C (δ j ) while sequentially increasing the shift amount δ j , the correlation value C (δ j ) The shift amount δ k corresponding to the first peak value C max is detected as a phase difference.

図3等で説明したように、相関幅Wjの中に位相差画像I(x)、I(x)のピークが複数含まれるような場合、実際には対応しないピークが重なったときに相関ピークを検出する可能性がある。この点、本実施形態によれば、最初の相関ピークを位相差として検出するので、位相差画像I(x)、I(x)の対応するピークが重なったときに正しく相関ピークを検出することができる。 As described in FIG. 3 and the like, when a plurality of peaks of the phase difference images I L (x) and I R (x) are included in the correlation width Wj, when peaks that do not actually correspond overlap each other There is a possibility of detecting a correlation peak. In this regard, according to the present embodiment, since the first correlation peak is detected as a phase difference, the correlation peak is correctly detected when the corresponding peaks of the phase difference images I L (x) and I R (x) overlap. can do.

3.第2実施形態
3.1.撮像装置
次に、第2実施形態について説明する。第2実施形態では、右瞳画像I(x)と左瞳画像I(x)を用いて合焦方向を判定し、その合焦方向の判定結果に基づいて、相関演算におけるシフト方向を決定する。なお、第1実施形態で説明した内容と同一の内容(例えば撮像光学系の基本構成や、位相差検出手法など)については、適宜説明を省略する。
3. Second Embodiment 3.1. Next, a second embodiment will be described. In the second embodiment, the focus direction is determined using the right pupil image I R (x) and the left pupil image I L (x), and the shift direction in the correlation calculation is determined based on the determination result of the focus direction. decide. Note that the description of the same content as that described in the first embodiment (for example, the basic configuration of the imaging optical system and the phase difference detection method) will be omitted as appropriate.

第2実施形態の撮像装置は、例えば、図9で説明した第1実施形態と同様の構成である。第1実施形態と同様の構成とした場合、第2実施形態では、位相差検出部82は、位相差画像I、Iに対して、後述する合焦方向判定手法を適用し、合焦方向を判定する。そして、その判定した合焦方向に基づいて、相関演算における位相差画像I、Iのシフト方向を決定する。 The imaging apparatus of the second embodiment has the same configuration as that of the first embodiment described with reference to FIG. When the configuration is the same as that of the first embodiment, in the second embodiment, the phase difference detection unit 82 applies a focusing direction determination method to be described later to the phase difference images I R and I L to focus. Determine the direction. Then, based on the determined in-focus direction, the shift direction of the phase difference images I R and I L in the correlation calculation is determined.

3.2.合焦方向判定手法
次に、本実施形態の合焦方向判定手法について詳細に説明する。図12(A)、図12(B)に示すように、撮像画像I(x)、右瞳画像I(x)、左瞳画像I(x)の画素値のDC成分(幅Wでの平均値)をゼロレベルにして基準を合わせ、比較用画素値I(x)’、I(x)’、I(x)’を求める。図12(A)には、後ピント状態での比較用画素値を示し、図12(B)には、前ピント状態での比較用画素値を示す。これらの比較用画素値は下式(6)により求められる。なお以下では適宜、「比較用画素値」を単に「画素値」とも呼ぶ。

Figure 2014038151
3.2. In-focus direction determination method Next, the in-focus direction determination method of the present embodiment will be described in detail. As shown in FIGS. 12A and 12B, the DC components (with width W) of the pixel values of the captured image I (x), the right pupil image I R (x), and the left pupil image I L (x) The reference value is adjusted by setting the average value) to zero level, and the comparison pixel values I (x) ′, I R (x) ′, and I L (x) ′ are obtained. FIG. 12A shows a comparison pixel value in the rear focus state, and FIG. 12B shows a comparison pixel value in the front focus state. These comparison pixel values are obtained by the following equation (6). Hereinafter, the “comparison pixel value” is also simply referred to as “pixel value” as appropriate.
Figure 2014038151

ここで、幅Wは、例えば実験等により予め求めた所定の平均演算区間であり、位置xを中心とする幅である。図12(A)、図12(B)では、x=xiの場合を例に幅Wを図示している。また、I(x)’、I(x)’、I(x)’の間には、下式(7)の関係が成り立つ。
I’(x)=[I’(x)+I’(x)]/2 (7)
Here, the width W is a predetermined average calculation section obtained in advance by experiments or the like, for example, and is a width centered on the position x. In FIGS. 12A and 12B, the width W is illustrated by taking x = xi as an example. Further, the relationship of the following expression (7) is established among I (x) ′, I R (x) ′, and I L (x) ′.
I ′ (x) = [I L ′ (x) + I R ′ (x)] / 2 (7)

次に、合焦方向を判定したい画素(以下では「注目画素」と呼ぶ)が、画素値I(x)’の増加区間Raに属するか減少区間Faに属するかを判定する。具体的には、注目画素の位置をx=xiとすると、I(x)’、I(x)’、I(x)’の交点(比較用画素値が一致(略一致を含む)する位置)のうち、xiに最も近い交点の位置x、xを求める。位置xは、注目画素よりも左側の交点であり、位置xは、注目画素よりも右側の交点である。そして、下式(8)を満たす場合には、注目画素が増加区間Raに属すると判定し、下式(9)を満たす場合には、注目画素が増加区間Raに属すると判定する。例えば図12(A)では、注目画素の位置xiは減少区間Faに属すると判定される。
[I’(x)−I’(x)]<0 (8)
[I’(x)−I’(x)]>0 (9)
Next, it is determined whether a pixel whose focus direction is to be determined (hereinafter referred to as a “target pixel”) belongs to the increase interval Ra or the decrease interval Fa of the pixel value I (x) ′. Specifically, if the position of the target pixel is x = xi, the intersection of I (x) ′, I R (x) ′, and I L (x) ′ (the pixel values for comparison match (including substantially matching)) Position x 0 , x 1 of the intersection closest to xi. Position x 0 is the intersection of the left side of the pixel of interest, the position x 1 is the right side of the intersection point than the pixel of interest. When the following expression (8) is satisfied, it is determined that the target pixel belongs to the increasing section Ra. When the following expression (9) is satisfied, it is determined that the target pixel belongs to the increasing section Ra. For example, in FIG. 12A, it is determined that the position xi of the target pixel belongs to the decrease section Fa.
[I ′ (x 0 ) −I ′ (x 1 )] <0 (8)
[I ′ (x 0 ) −I ′ (x 1 )]> 0 (9)

なお、[I’(x)−I’(x)]<0又は[I’(x)−I’(x)]<0を満たす場合に、注目画素が増加区間Raに属すると判定してもよい。また、[I’(x)−I’(x)]>0又は[I’(x)−I’(x)]>0を満たす場合に、注目画素が減少区間Faに属すると判定してもよい。 Note that the pixel of interest increases when [I L ′ (x 0 ) −I L ′ (x 1 )] <0 or [I R ′ (x 0 ) −I R ′ (x 1 )] <0 is satisfied. You may determine with belonging to area Ra. Further, when [I L ′ (x 0 ) −I L ′ (x 1 )]> 0 or [I R ′ (x 0 ) −I R ′ (x 1 )]> 0 is satisfied, the target pixel decreases. You may determine with belonging to the area Fa.

次に、I’(x)とI’(x)の上下関係に基づいて、注目画素が前ピント状態であるか後ピント状態であるかを判定する。具体的には、下式(10)により、注目画素が属する区間でのI’(x)とI’(x)の差分値Eを求め、その差分値Eの符号に基づいて合焦方向を判定する。図12(A)、図12(B)に示すように、増加区間Raと減少区間Faでは、I’(x)とI’(x)の上下関係が異なるので、その上下関係と合焦方向との対応が異なっている。即ち、増加区間Raにおいては、下式(11)により合焦方向を判定し、減少区間Faにおいては、下式(12)により合焦方向を判定する。

Figure 2014038151
Figure 2014038151
Figure 2014038151
Next, based on the vertical relationship between I ′ (x) and I L ′ (x), it is determined whether the pixel of interest is in the front focus state or the rear focus state. Specifically, a difference value E L between I ′ (x) and I L ′ (x) in a section to which the target pixel belongs is obtained by the following equation (10), and the sum is calculated based on the sign of the difference value E L. Determine the direction of focus. As shown in FIGS. 12 (A) and 12 (B), since the vertical relationship between I ′ (x) and I L ′ (x) is different in the increasing interval Ra and the decreasing interval Fa, the vertical relationship and the focus are in focus. Correspondence with direction is different. That is, in the increasing section Ra, the focusing direction is determined by the following expression (11), and in the decreasing section Fa, the focusing direction is determined by the following expression (12).
Figure 2014038151
Figure 2014038151
Figure 2014038151

なお、I’(x)とI’(x)の上下関係に基づいて合焦方向を判定してもよいことは言うまでもない。 Needless to say, the in-focus direction may be determined based on the vertical relationship between I ′ (x) and I R ′ (x).

判定した合焦方向が後ピント状態であった場合には、I(x)が右側(+x方向)にシフトし、I(x)が左側(−x方向)にシフトしていると判断される。この場合、I(x)を左側へ、I(x)を右側へシフトさせて相関演算を行う。一方、判定した合焦方向が前ピント状態であった場合には、I(x)が左側(−x方向)にシフトし、I(x)が右側(+x方向)にシフトしていると判断される。この場合、I(x)を右側へ、I(x)を左側へシフトさせて相関演算を行う。 If the determined in-focus direction is the rear focus state, it is determined that I R (x) is shifted to the right (+ x direction) and I L (x) is shifted to the left (−x direction). Is done. In this case, correlation calculation is performed by shifting I R (x) to the left and I L (x) to the right. On the other hand, when the determined in-focus direction is the front focus state, I R (x) is shifted to the left (−x direction), and I L (x) is shifted to the right (+ x direction). It is judged. In this case, correlation calculation is performed by shifting I R (x) to the right and I L (x) to the left.

以上の実施形態によれば、位相差検出部82は、撮像画像I(x)の画素値と、第1画像I(x)及び第2画像I(x)のうち少なくとも一方である比較画像(例えばI(x))の画素値とを比較することにより、撮像光学系の合焦方向を判定する。位相差検出部82は、その判定した合焦方向に基づいて、相関演算において第2画像I(x)を第1画像I(x)に対してシフトさせるシフト方向を設定する。 According to the above embodiment, the phase difference detection unit 82 compares the pixel value of the captured image I (x) with at least one of the first image I R (x) and the second image I L (x). The focusing direction of the imaging optical system is determined by comparing the pixel value of the image (for example, I L (x)). The phase difference detection unit 82 sets a shift direction for shifting the second image I L (x) with respect to the first image I R (x) in the correlation calculation based on the determined in-focus direction.

このようにすれば、前ピント状態であるか後ピント状態であるかを判定することができ、その判定結果に対応して、第1画像I(x)と第2画像I(x)のずれ方向を知ることができる。これにより、どの方向に第1画像I(x)と第2画像I(x)を動かせば相関値のピークを検出できるかが分かるため、効率的に相関演算できる。 In this way, it is possible to determine whether the focus state is the front focus state or the rear focus state, and the first image I R (x) and the second image I L (x) corresponding to the determination result. You can know the direction of displacement. Thus, since it can be understood in which direction the peak of the correlation value can be detected by moving the first image I R (x) and the second image I L (x), the correlation calculation can be performed efficiently.

また本実施形態では、図12(A)等で説明したように、位相差検出部82は、第1画像I(x)と第2画像I(x)が視差によりずれる方向を視差方向(+x方向)とする場合に、撮像画像I(x)の画素値が視差方向に増加又は減少する領域(Ra又はFa)を特定する。上式(10)〜(12)で説明したように、位相差検出部82は、その特定した領域における撮像画像I(x)の画素値と比較画像I(x)の画素値との大小関係に基づいて、撮像光学系から見て被写体よりも近い位置にフォーカスが合った状態である前ピント状態であるか、撮像光学系から見て被写体よりも遠い位置にフォーカスが合った状態である前ピント状態であるかを判定する。 In the present embodiment, as described with reference to FIG. 12A and the like, the phase difference detection unit 82 determines the direction in which the first image I R (x) and the second image I L (x) are shifted due to the parallax as the parallax direction. In the case of (+ x direction), a region (Ra or Fa) in which the pixel value of the captured image I (x) increases or decreases in the parallax direction is specified. As described in the above formulas (10) to (12), the phase difference detection unit 82 determines the magnitude of the pixel value of the captured image I (x) and the pixel value of the comparison image I L (x) in the specified region. Based on the relationship, the focus state is in a state where the focus is closer to the subject as viewed from the imaging optical system, or the focus is in a position farther than the subject as viewed from the imaging optical system. It is determined whether or not it is in the previous focus state.

このようにすれば、撮像画像I(x)の画素値と比較画像I(x)の画素値とを比較することにより、撮像光学系の合焦方向を判定できる。また、図12(A)等で説明したように、撮像画像I(x)の画素値が増加する領域Raと減少する領域Faでは、撮像画像I(x)の画素値と比較画像I(x)の大小関係が異なっている。この点、本実施形態によれば、合焦方向を判定したい位置が、増加領域Ra及び減少領域Faのいずれに属するのかを特定でき、その特定した領域での大小関係に基づいて合焦方向を判定できる。 In this way, the in-focus direction of the imaging optical system can be determined by comparing the pixel value of the captured image I (x) with the pixel value of the comparative image I L (x). Further, as described with reference to FIG. 12A and the like, in the region Ra where the pixel value of the captured image I (x) increases and the region Fa where the pixel value decreases, the pixel value of the captured image I (x) and the comparison image I L ( The magnitude relationship of x) is different. In this regard, according to the present embodiment, it is possible to specify whether the position where the in-focus direction is to be determined belongs to the increasing area Ra or the decreasing area Fa, and the in-focus direction is determined based on the magnitude relationship in the specified area. Can be judged.

4.第3実施形態
4.1.撮像装置
次に、第3実施形態について説明する。第3実施形態では、RGB画像から5バンドの画像を推定し、その5バンドの画像のうち、右瞳に対応するバンドの画像から右瞳画像Iを生成し、左瞳に対応するバンドの画像から左瞳画像Iを生成する。なお、第1実施形態や第2実施形態で説明した内容と同一の内容(例えば撮像光学系の基本構成や、位相差検出手法など)については、適宜説明を省略する。
4). Third Embodiment 4.1. Next, a third embodiment will be described. In the third embodiment estimates the image of five bands from RGB image, among the images of the five bands, from an image of the band corresponding to the right pupil generates a right pupil images I R, the bands corresponding to the left pupil generating a Hidarihitomi image I L from the image. Note that the description of the same contents as those described in the first embodiment and the second embodiment (for example, the basic configuration of the imaging optical system and the phase difference detection method) will be omitted as appropriate.

図13に、第3実施形態における撮像装置の構成例を示す。この撮像装置は、結像レンズLNS、光学フィルタFLT、撮像部10、位相差画像生成部20、出力部25、表示画像生成部30、モニタ表示部40、分光特性記憶部50、マルチバンド推定部70、フォーカス制御部80、位相差検出部82、データ圧縮部90、データ記録部100を含む。なお、本実施形態は図13の構成に限定されず、その構成要素の一部を省略(例えば出力部25、データ圧縮部90)したり、他の構成要素を追加したりする等の種々の変形実施が可能である。   FIG. 13 shows a configuration example of an imaging apparatus in the third embodiment. This imaging device includes an imaging lens LNS, an optical filter FLT, an imaging unit 10, a phase difference image generation unit 20, an output unit 25, a display image generation unit 30, a monitor display unit 40, a spectral characteristic storage unit 50, and a multiband estimation unit. 70, a focus control unit 80, a phase difference detection unit 82, a data compression unit 90, and a data recording unit 100. Note that the present embodiment is not limited to the configuration in FIG. 13, and various components such as omitting some of the components (for example, the output unit 25 and the data compression unit 90) and adding other components. Variations are possible.

撮像部10は、撮像素子と撮像処理部を含むことができる。撮像素子は、例えばRGB3原色の撮像素子であり、結像レンズLNS及び光学フィルタFLTによって結像された被写体を撮像する。撮像処理部は、撮像動作の制御や、アナログの画素信号をA/D変換する処理、ベイヤ画像に対するデモザイキング処理などを行う。   The imaging unit 10 can include an imaging device and an imaging processing unit. The imaging element is, for example, an imaging element of RGB three primary colors, and images a subject imaged by the imaging lens LNS and the optical filter FLT. The imaging processing unit performs control of imaging operations, A / D conversion processing of analog pixel signals, demosaicing processing for Bayer images, and the like.

分光特性記憶部50は、撮像素子がもつカラーフィルタの分光特性のデータを記憶しており、そのデータをマルチバンド推定部70に出力する。ここで、撮像されるRGB成分は、厳密にはカラーフィルタのみならず撮像素子の分光感度特性や、結像レンズLNSの分光特性によって決まるものである。即ち、分光特性記憶部50は、撮像素子や結像レンズLNSの分光特性を含んだ分光特性のデータを記憶する。   The spectral characteristic storage unit 50 stores spectral characteristic data of a color filter included in the image sensor, and outputs the data to the multiband estimation unit 70. Here, strictly speaking, the RGB components to be imaged are determined not only by the color filter but also by the spectral sensitivity characteristics of the imaging element and the spectral characteristics of the imaging lens LNS. That is, the spectral characteristic storage unit 50 stores spectral characteristic data including the spectral characteristics of the image sensor and the imaging lens LNS.

マルチバンド推定部70は、撮像画像と分光特性のデータとに基づいてマルチバンド推定処理を行う。具体的には、図13に示すように、撮像センサのカラーフィルタがもつ波長域を5バンド{r,r,g,b,b}に分割する。光学フィルタFLTの右瞳は帯域{r,g,b}を透過し、左瞳は帯域{r,g,b}を透過する。マルチバンド推定部70は、撮像画像I(x)のRGB画素値から5バンド{r,r,g,b,b}の画素値を推定する。 The multiband estimation unit 70 performs multiband estimation processing based on the captured image and spectral characteristic data. Specifically, as shown in FIG. 13, the wavelength range of the color filter of the image sensor is divided into five bands {r L , r R , g, b L , b R }. The right pupil of the optical filter FLT transmits the band {r R , g, b R }, and the left pupil transmits the band {r L , g, b L }. The multiband estimation unit 70 estimates pixel values of five bands {r L , r R , g, b L , b R } from the RGB pixel values of the captured image I (x).

位相差画像生成部20は、5バンド{r,r,g,b,b}の画素値から、右瞳画像I={r,g,b}と左瞳画像I={r,g,b}を生成する。この2画像を位相差画像とする。 The phase difference image generation unit 20 determines the right pupil image I R = {r R , g, b R } and the left pupil image I from the pixel values of the five bands {r L , r R , g, b L , b R }. L = {r L , g, b L } is generated. These two images are referred to as phase difference images.

位相差検出部82は、位相差画像I、Iの同色成分{r,r}(即ち、I、IのR画素値)に対して、上述の位相差検出手法を適用し、位相差を検出する。なお、位相差画像I、Iの同色成分として{b,b}(即ち、I、IのB画素値)を用いてもよい。また位相差検出部82は、第2実施形態で説明した合焦方向判定を行い、相関演算における位相差画像I、Iのシフト方向を決定してもよい。なお本実施形態ではこれに限定されず、相関演算において位相差画像I、Iをシフトさせる方向を、探索的に決定してもよい。 The phase difference detection unit 82 applies the above-described phase difference detection method to the same color components {r R , r L } of the phase difference images I R and I L (that is, R pixel values of I R and I L ). The phase difference is detected. Note that {b R , b L } (that is, B pixel values of I R and I L ) may be used as the same color components of the phase difference images I R and I L. The phase difference detection unit 82 may perform the in-focus direction determination described in the second embodiment, and may determine the shift direction of the phase difference images I R and I L in the correlation calculation. Note that the present embodiment is not limited to this, and the direction in which the phase difference images I R and I L are shifted in the correlation calculation may be determined exploratoryly.

このようにして、シフト量δkと相関幅Wkを連動させて相関演算を行うことにより、演算量を削減でき、演算効率を向上させることができる。また、合焦方向の判定を行う場合には、探索的にシフト方向を決める必要がなくなるため、更に演算効率を向上させることができる。   In this way, by performing the correlation calculation in conjunction with the shift amount δk and the correlation width Wk, the calculation amount can be reduced and the calculation efficiency can be improved. Further, when determining the in-focus direction, it is not necessary to determine the shift direction in a search, so that the calculation efficiency can be further improved.

フォーカス制御部80は、検出された位相差の情報に基づいてオートフォーカス制御を行う。具体的にはフォーカス制御部80は、フォーカス制御量算出部84、フォーカスレンズ駆動制御部86を含む。フォーカス制御量算出部84は、位相差の情報に基づいて結像レンズLNSのデフォーカス量を算出し、そのデフォーカス量と位相差画像I、Iのずれ方向の情報に基づいてフォーカス制御量(結像レンズLNSの移動量と移動方向)を算出する。フォーカスレンズ駆動制御部86は、結像レンズLNSの移動量及び移動方向に基づいてフォーカスレンズを移動させる制御を行う。 The focus control unit 80 performs autofocus control based on the detected phase difference information. Specifically, the focus control unit 80 includes a focus control amount calculation unit 84 and a focus lens drive control unit 86. Focus control amount calculating section 84 calculates the defocus amount of the imaging lens LNS on the basis of the information of the phase difference, the focus control based on the defocus amount and the phase difference image I R, the deviation direction of the information I L The amount (the moving amount and moving direction of the imaging lens LNS) is calculated. The focus lens drive control unit 86 performs control to move the focus lens based on the moving amount and moving direction of the imaging lens LNS.

表示画像生成部30は、5バンド{r,r,g,b,b}の画素値から表示用のRGB画像を生成する。例えば{r,g,b}の画素値をRGB画像とする。モニタ表示部40は、表示画像生成部30が生成した画像を表示する。 The display image generation unit 30 generates an RGB image for display from the pixel values of the five bands {r L , r R , g, b L , b R }. For example, a pixel value of {r R , g, b R } is an RGB image. The monitor display unit 40 displays the image generated by the display image generation unit 30.

出力部25は、位相差画像生成部20が生成した位相差画像I、Iや、位相差検出部82が検出した位相差の情報や合焦方向の情報を、出力する処理を行う。出力処理としては、例えば外部記憶装置への保存や、外部モニタへの表示、外部情報処理装置への出力などが想定される。外部情報処理装置では、例えば、位相差の情報や合焦方向の情報に基づいて被写体の3次元情報を求める。また、出力部25がその3次元情報を求めてモニタ表示部40に表示させてもよい。 The output unit 25 performs a process of outputting the phase difference images I R and I L generated by the phase difference image generation unit 20 and the information of the phase difference detected by the phase difference detection unit 82 and the information on the in-focus direction. As output processing, for example, saving to an external storage device, display on an external monitor, output to an external information processing device, and the like are assumed. In the external information processing apparatus, for example, three-dimensional information of a subject is obtained based on phase difference information and focus direction information. The output unit 25 may obtain the three-dimensional information and display it on the monitor display unit 40.

データ圧縮部90は、撮像部10からのRGB画像を圧縮する処理を行う。データ記録部100は、圧縮されたRGB画像データと、カラーフィルタの分光特性データとを記録する。これらの記録データは、撮影後の事後処理においてマルチバンド推定処理や位相差検出処理に用いることが可能である。なお、この事後処理は、撮像装置と別体に構成された情報処理装置で行ってもよい。   The data compression unit 90 performs processing for compressing the RGB image from the imaging unit 10. The data recording unit 100 records compressed RGB image data and color filter spectral characteristic data. These recorded data can be used for multiband estimation processing and phase difference detection processing in post processing after photographing. This post-processing may be performed by an information processing device configured separately from the imaging device.

4.2.マルチバンド推定処理
4.2.1.バンド分割手法
次に、撮像画像から位相差画像を取得するためのマルチバンド推定処理について詳細に説明する。なお以下では、RGBベイヤ配列の撮像素子を例に説明するが、本実施形態はこれに限定されず、カラーフィルタの透過率特性に重なり部分がある撮像素子でさえあればよい。
4.2. Multiband estimation process 4.2.1. Next, a multiband estimation process for obtaining a phase difference image from a captured image will be described in detail. In the following description, an RGB Bayer array image sensor will be described as an example. However, the present embodiment is not limited to this, and it is sufficient that the image sensor has an overlapping portion in the transmittance characteristics of the color filter.

図14にバンド分割についての説明図を示す。図14に示すように、5バンドの成分b、b、g、r、rは、撮像系の分光特性に応じて定まる成分である。図14には、撮像系の分光特性として、撮像センサのカラーフィルタの透過率特性F、F、Fを示すが、厳密には、撮像系の分光特性は、例えばカラーフィルタを除いた撮像センサがもつ分光特性や、光学系のもつ分光特性等も含んでいる。以下では説明を簡単にするため、撮像センサ等の分光特性が、図14に示すカラーフィルタの透過率特性F、F、Fに含まれるものとする。 FIG. 14 is an explanatory diagram for band division. As shown in FIG. 14, the five-band components b R , b L , g, r R , and r L are components that are determined according to the spectral characteristics of the imaging system. FIG. 14 shows the transmittance characteristics F R , F G , and F B of the color filter of the imaging sensor as the spectral characteristics of the imaging system. Strictly speaking, the spectral characteristics of the imaging system excludes, for example, the color filter. It also includes the spectral characteristics of the image sensor, the spectral characteristics of the optical system, and the like. In the following, for the sake of simplicity, it is assumed that spectral characteristics of the image sensor and the like are included in the transmittance characteristics F R , F G and F B of the color filter shown in FIG.

図14に示すように、青色フィルタの透過率特性Fと緑色フィルタの透過率特性Fとの重なり部分に対応するバンドの成分がbであり、青色フィルタの透過率特性Fの非重なり部分に対応するバンドの成分がbである。また、赤色フィルタの透過率特性Fと緑色フィルタの透過率特性Fとの重なり部分に対応するバンドの成分がrであり、赤色フィルタの透過率特性Fの非重なり部分に対応するバンドの成分がrである。また、緑色フィルタの透過率特性Fの非重なり部分に対応するバンドの成分がgである。ここで、非重なり部分とは、他の色フィルタの透過率特性と重なっていない部分のことである。 As shown in FIG. 14, the band component corresponding to the overlapping portion of the transmittance characteristic F B of the blue filter and the transmittance characteristic F G of the green filter is b L , and the non-existence of the transmittance characteristic F B of the blue filter component of the band corresponding to the overlapping portion is b R. Further, components of the band corresponding to the overlap between the transmittance characteristic F G of the transmittance characteristic F R and the green filters of the red filter is r R, corresponding to the non-overlapping portion of the transmission characteristic F R of the red filter component of the band is r L. Further, components of the band corresponding to non-overlapping portions of the transmission characteristic F G of the green filter is g. Here, the non-overlapping portion is a portion that does not overlap with the transmittance characteristics of other color filters.

5バンドの帯域BD1〜BD5は、透過率特性F、F、Fの形状や重なり具合などに応じて決定すればよく、透過率特性の帯域や重なり部分の帯域そのものである必要はない。例えば、透過率特性F、Fの重なり部分の帯域は、およそ450nm〜550nmであるが、帯域BD2は重なり部分に対応するものであればよく、450nm〜550nmである必要はない。 5-band of BD1~BD5, the transmittance characteristic F R, F G, may be determined depending on the shape and degree of overlap F B, need not be the band itself bandwidth and the overlapping portion of the transmission characteristic . For example, the band of the overlapping portion of the transmittance characteristics F G and F B is approximately 450 nm to 550 nm, but the band BD2 only needs to correspond to the overlapping portion, and does not need to be 450 nm to 550 nm.

第3実施形態では、図1の右瞳フィルタFL1には、透過波長域fとしてバンド{b,g,r}を割り当て、左瞳フィルタFL2には、透過波長域fとしてバンド{b,g,r}を割り当てる。図14に示すように、右瞳を通過した波長分割光{b,g,r}と、左瞳を通過した波長分割光{b,g,r}は、波長帯域が明確に分離されている。一方、撮像素子のカラーフィルタの分光特性{F,F,F}は、隣接する分光特性の波長帯域が重複した特性となっている。この重複状態を考慮すると、デモザイキング処理後の各画素における赤色、緑色、青色の画素値R、G、Bを、下式(13)のようにモデル化することができる。
R=g+r +r
G=b +g+r
B=b +b +g (13)
In the third embodiment, the band {b R , g, r R } is assigned to the right pupil filter FL1 in FIG. 1 as the transmission wavelength region f R , and the band {b is set to the transmission wavelength region f L to the left pupil filter FL2. Assign b L , g, r L }. As shown in FIG. 14, the wavelength division light {b R , g, r R } that has passed through the right pupil and the wavelength division light {b L , g, r L } that has passed through the left pupil have distinct wavelength bands. It is separated. On the other hand, the spectral characteristics {F R , F G , F B } of the color filter of the image sensor are characteristics in which the wavelength bands of adjacent spectral characteristics overlap. Considering this overlapping state, the red, green, and blue pixel values R, G, and B in each pixel after the demosaicing process can be modeled as in the following equation (13).
R = g R + r R R + r L R ,
G = b L G + g G + r R G,
B = b R B + b L B + g B (13)

図15(C)に示すように、成分{b ,b ,g}は、分光特性Fの青色フィルタを通過した波長分割光{b,b,g}に対応する。図15(D)に示すように、成分{b ,g,r }は、分光特性Fの緑色フィルタを通過した波長分割光{b,g,r}に対応する。また、図17(D)に示すように、成分{g,r ,r }は、分光特性Fの赤色フィルタを通過した波長分割光{g,r,r}に対応する。各成分を表す符号の上付きサフィックスは、右瞳「R」及び左瞳「L」のいずれを通過したかを表し、下付サフィックスは、赤色フィルタ「R」、緑色フィルタ「G」、青色フィルタ「B」のいずれを通過したかを表している。 As shown in FIG. 15C, the component {b R B , b L B , g B } corresponds to the wavelength-divided light {b R , b L , g} that has passed through the blue filter having the spectral characteristic F B. . As shown in FIG. 15D, the component {b L G , g G , r R G } corresponds to the wavelength-divided light {b L , g, r R } that has passed through the green filter having the spectral characteristic F G. . Further, as shown in FIG. 17 (D), the component {g R, r R R, r L R} is the spectral characteristics F wavelength division light passed through the red filter R {g, r R, r L} in Correspond. The superscript suffix for each component represents whether the right pupil “R” or the left pupil “L” has passed, and the subscript suffix represents the red filter “R”, the green filter “G”, and the blue filter It indicates which of “B” passed.

4.2.2.{b,b,(g+r)}の推定処理
次に、図15(A)〜図16を用いて、画素値{R,G,B}から成分{b ,b ,g}、{b ,g,r }、{g,r ,r }を推定する処理について説明する。
4.2.2. {B R , b L , (g + r R )} Estimation Processing Next, using FIG. 15A to FIG. 16, the component values {b R B , b L B , A process for estimating g B }, {b L G , g G , r R G }, and {g R , r R R , r L R } will be described.

まず上式(13)を用いて、画素値{B,G}で重複している波長帯域{b,g}を、画素値{B,G}の差分に基づいて取り除き、成分bと成分[g+r]の関係を求めることにより成分{b,b,(g+r)}の関係式を導き出す処理を行う。 First, using the above equation (13), the wavelength band {b L , g} overlapping with the pixel value {B, G} is removed based on the difference between the pixel values {B, G}, and the component b R and A process of deriving a relational expression of the components {b R , b L , (g + r R )} by obtaining the relationship of the component [g + r R ] is performed.

ここで注意しなければならないのは、図15(A)〜図15(D)に示すように、波長帯域bに対応するのは画素値Bの成分b 及び画素値Gの成分b であるが、成分b 、b には、分光特性F、Fの相対ゲインが乗じられていることである。そのため、成分b 、b は、相対ゲインの分だけ異なる値であり、成分b 、b が等しくなるように補正する必要がある。 It should be noted here that, as shown in FIGS. 15A to 15D, the component b L B of the pixel value B and the component b of the pixel value G correspond to the wavelength band b L. it is a L G, component b L B, the b L G, the spectral characteristics F B, is that the relative gain of F G is multiplied. Therefore, the components b L B and b L G are different values by the relative gain, and it is necessary to correct the components b L B and b L G to be equal.

図15(C)、図15(D)に示すように、画素値Gを基準(例えば「1」)として、(b +g)の成分比をkB1とし、b の成分比をkB2とすると、下式(14)が成り立つ。ここで、kB1/kB2は、例えば帯域bにおける分光特性F、Fのゲイン比である。
+g=(kB1/kB2)×b (14)
As shown in FIGS. 15C and 15D, the pixel value G is a reference (for example, “1”), the component ratio of (b L B + g B ) is k B1, and the component ratio of b L G If k B2 , the following equation (14) is established. Here, k B1 / k B2 is, for example, the gain ratio of the spectral characteristics F B and F G in the band b L.
b L B + g B = ( k B1 / k B2) × b L G (14)

帯域b、gにおける分光特性Fのゲインを考慮すると、成分gは成分b よりも十分小さいと考えられるため、成分b 、b を等しくするためには、成分(b +g)と成分b がほぼ等しくなればよい。成分(b +g)を補正した値を(b ’+g’)とすると、上式(14)を用いて下式(15)に示す補正を行えばよい。
’+g’≒b =(kB2/kB1)×(b +g) (15)
Considering the gain of the spectral characteristics F B in the bands b L and g, the component g B is considered to be sufficiently smaller than the component b L B. Therefore, in order to make the components b L B and b L G equal, the component ( b L B + g B ) and the component b L G should be substantially equal. If the value obtained by correcting the component (b L B + g B ) is (b L B '+ g B '), the correction shown in the following equation (15) may be performed using the above equation (14).
b L B '+ g B' ≒ b L G = (k B2 / k B1) × (b L B + g B) (15)

成分(b +g)は画素値Bに含まれるため、成分(b +g)を補正するためには、結局、画素値Bを補正することになる。この補正後のBをB’とすると、下式(16)の関係が得られる。
B’=(kB2/kB1)B (16)
Since the component (b L B + g B ) is included in the pixel value B, in order to correct the component (b L B + g B ), the pixel value B is eventually corrected. When this corrected B is B ′, the relationship of the following equation (16) is obtained.
B ′ = (k B2 / k B1 ) B (16)

上式(16)より、B’の成分{b ’,b ’,g’}は下式(17)となる。
’=(kB2/kB1)×b
’+g’≒b (17)
From the above equation (16), B 'components {b R B', b L B ', g B'} is the following equation (17).
b R B '= (k B2 / k B1) × b R B,
b L B '+ g B ' ≈b L G (17)

上式(13)、(17)より、画素値B’と画素値Gを成分{b ’,b ,g,r }を用いて表すと、下式(18)のようになる。
B’=b ’+(b ’+g’)=b ’+b
G =b +(g+r ) (18)
From the above equations (13) and (17), when the pixel value B ′ and the pixel value G are expressed using the components {b R B ′, b L G , g G , r R G }, the following equation (18) It becomes like this.
B '= b R B' + (b L B '+ g B') = b R B '+ b L G,
G = b L G + (g G + r R G) (18)

次に、下式(19)に示すように、補正後の画素値B’と画素値Gの差分を取ることにより、重複した成分bを取り除く。また上式(18)より下式(20)が成り立つ。
B’−G=[b ’+b ]−[b +g+r
=b ’−(g+r ) (19)
=B’−b ’ (20)
Next, as shown in the following equation (19), the difference between the corrected pixel value B ′ and the pixel value G is taken to remove the overlapping component b L. Further, the following equation (20) is established from the above equation (18).
B'-G = [b R B '+ b L G] - [b L G + g G + r R G]
= B R B '-(g G + r R G ) (19)
b L G = B'-b R B '(20)

’を未知数(支配変数)とすると、上式(19)、(20)より{b ’,b ,(g+r )}の関係式を下式(21)のように求められる。
’=未知数(支配変数)
=B’−b
+r =b ’−(B’−G) (21)
When b R B ′ is an unknown (dominant variable), the relational expression of {b R B ′, b L G , (g G + r R G )} is expressed by the following equation (21) from the above equations (19) and (20). It is required as follows.
b R B '= unknown number (dominant variable)
b L G = B'-b R B '
g G + r R G = b R B '- (B'-G) (21)

{B’,G}は検出された既知の値であるので、上式(21)に基づき未知数b ’が決まれば、{b ’,b ,(g+r )}が全て決まることになる。即ち、{b ’,b ,(g+r )}の尤度パターンを特定することができる。 Since {B ′, G} is a detected known value, if the unknown b R B ′ is determined based on the above equation (21), {b R B ′, b L G , (g G + r R G ) } Are all determined. That is, it is possible to identify {b R B ', b L G, (g G + r R G)} likelihood pattern.

図16に、この関係を原理的に表した図を示す。図16に示すように、未知数b ’として、{b ’,b ,(g+r )}と{B’/2,G/2}の誤差が最小になる値を求める。即ち、下式(22)に示す誤差の評価値EBGが最小になる場合のb ’を求め、求めたb ’を上式(21)に代入することにより、{b ’,b ,(g+r )}の値を決定する。
=(B’/2−b ’)+(B’/2−b
=(G/2−b +(G/2−(g+r ))
BG=e+e (22)
FIG. 16 is a diagram showing this relationship in principle. As shown in FIG. 16, as the unknown b R B ′, a value that minimizes the error between {b R B ′, b L G , (g G + r R G )} and {B ′ / 2, G / 2}. Ask for. That is, by obtaining b R B ′ when the error evaluation value E BG shown in the following equation (22) is minimized and substituting the obtained b R B ′ into the above equation (21), {b R B B ', b L G, determines the value of (g G + r R G) }.
e B = (B '/ 2 -b R B') 2 + (B '/ 2-b L G) 2,
e G = (G / 2- b L G) 2 + (G / 2- (g G + r R G)) 2,
E BG = e B + e G (22)

以上のようにして、各画素の2バンド画素値{B’,G}から成分{b ’,b ,(g+r )}を推定することができる。 As described above, the component {b R B ′, b L G , (g G + r R G )} can be estimated from the 2-band pixel values {B ′, G} of each pixel.

なお、上記では{b ’,b ,(g+r )}と{B’/2,G/2}の誤差が最小となる場合のb ’を求めたが、本実施形態では、{b ’,b ,(g+r )}と{αB’,αGbG}の誤差が最小となる場合のb ’を求めてもよい。ここで、α、αGbは、下式(23)を満たす値である。αは、B’に対する{b ’,b }の平均的な値を算出するためのものであり、αGbは、Gに対する{b ,(g+r )}の平均的な値を算出するためのものである。これらは、図13に示すような撮像素子のカラーフィルタ特性から{b ’,b }及び{b ,(g+r )}の成分比を考慮して決定すればよい。
0<α≦1,0<αGb≦1 (23)
In the above {b R B ', b L G, (g G + r R G)} and {B' has been sought / 2, G / 2} b R B when the error is minimized for ' in this embodiment, {b R B also seeking ', b L G, (g G + r R G)} and {α B B', α Gb G} b R B when the error of the minimum ' Good. Here, α B and α Gb are values satisfying the following expression (23). α B is for calculating an average value of {b R B ′, b L G } with respect to B ′, and α Gb is {b L G , (g G + r R G )} with respect to G It is for calculating the average value of. These are from the color filter characteristics of the imaging device shown in FIG. 13 {b R B ', b L G} and {b L G, (g G + r R G)} it is determined in consideration of the ratio of components Good.
0 <α B ≦ 1, 0 <α Gb ≦ 1 (23)

4.2.3.{(b+g),r,r}の推定処理
次に、画素値{G,R}から成分{(b+g),r,r}を推定する処理について説明する。
4.2.3. Processing for Estimating {(b L + g), r R , r L } Next, processing for estimating the component {(b L + g), r R , r L } from the pixel values {G, R} will be described.

上式(13)を用いて、画素値{G,R}で重複している波長帯域{g,r}を、画素値{G,R}の差分に基づいて取り除き、成分[b+g]と成分rの関係を求めることにより成分{(b+g),r,r}の関係式を導き出す処理を行う。 Using the above equation (13), the overlapping wavelength band {g, r R } with the pixel value {G, R} is removed based on the difference between the pixel values {G, R}, and the component [b L + g ] And the component r L to obtain a relational expression of the component {(b L + g), r R , r L }.

図17(A)〜図17(D)に示すように、波長帯域rに対応するのは画素値Gの成分r 及び画素値Rの成分r であるが、成分r 、r には、分光特性F、Fの相対ゲインが乗じられている。そのため、成分r 、r は、相対ゲインの分だけ異なる値であり、成分r 、r が等しくなるように補正する必要がある。 As shown in FIGS. 17A to 17D, the component r R G of the pixel value G and the component r R R of the pixel value R correspond to the wavelength band r R , but the component r R G , R R R are multiplied by the relative gains of the spectral characteristics F G , F R. Therefore, the components r R G and r R R have different values corresponding to the relative gain, and it is necessary to correct the components r R G and r R R to be equal.

図17(C)、図17(D)に示すように、画素値Gを基準(例えば「1」)として、(g+r )の成分比をkR1とし、r の成分比をkR2とすると、下式(24)が成り立つ。kR1/kR2は、例えば帯域rにおける分光特性F、Fのゲイン比である。
+r =(kR2/kR1)×r (24)
As shown in FIGS. 17C and 17D, the pixel value G is a reference (eg, “1”), the component ratio of (g R + r R R ) is k R1, and the component ratio of r R G If k R2 , the following equation (24) is established. k R1 / k R2 is, for example, the gain ratio of the spectral characteristics F G and F R in the band r R.
g R + r R R = ( k R2 / k R1) × r R G (24)

帯域g、rにおける分光特性Fのゲインを考慮すると、成分gは成分r よりも十分小さいと考えられるため、成分r 、r を等しくするためには、成分(g+r )と成分r がほぼ等しくなればよい。成分(g+r )を補正した値を(g’+r ’)とすると、上式(24)を用いて下式(25)に示す補正を行えばよい。
’+r ’≒r =(kR2/kR1)×(g+r ) (25)
Band g, considering the gain spectral characteristic F R in r R, since the components g R considered sufficiently smaller than the component r R R, in order to equalize component r R G, the r R R, the components ( g R + r R R ) and the component r R G may be substantially equal. If the value obtained by correcting the component (g R + r R R ) is (g R '+ r R R '), the correction shown in the following equation (25) may be performed using the above equation (24).
g R '+ r R R' ≒ r R G = (k R2 / k R1) × (g R + r R R) (25)

成分(g+r )は画素値Rに含まれるため、成分(g+r )を補正するためには、結局、画素値Rを補正することになる。この補正後のRをR’とすると、下式(26)の関係が得られる。
R’=(kR2/kR1)R (26)
Since the component (g R + r R R ) is included in the pixel value R, in order to correct the component (g R + r R R ), the pixel value R is eventually corrected. When this corrected R is R ′, the relationship of the following equation (26) is obtained.
R ′ = (k R2 / k R1 ) R (26)

上式(26)より、R’の成分{g’,r ’,r ’}は下式(27)となる。
’+r ’≒r
’=(kR2/kR1)×r (27)
From the above equation (26), the component {g R ′, r R R ′, r L R ′} of R ′ becomes the following equation (27).
g R '+ r R R ' ≈r R G ,
r L R '= (k R2 / k R1) × r L R (27)

上式(13)、(27)より、画素値Gと画素値R’を成分{b ,g,r ,r ’}を用いて表すと、下式(28)のようになる。
G =b +(g+r ),
R’=(g’+r ’)+r ’=r +r ’ (28)
From the above formulas (13) and (27), the pixel value G and the pixel value R ′ are expressed using the components {b L G , g G , r R G , r L R ′}. It becomes like this.
G = b L G + (g G + r R G),
R ′ = (g R ′ + r R R ′) + r L R ′ = r R G + r L R ′ (28)

次に、下式(29)に示すように、画素値Gと補正後の画素値R’の差分を取ることにより、重複した成分rを取り除く。また上式(28)より下式(30)が成り立つ。
G−R’=[b +g+r )]−[r +r ’]
=(b +g)−r ’ (29)
=R’−r ’ (30)
Next, as shown in the following equation (29), by taking the difference between the pixel value G and the corrected pixel value R ′, the overlapping component r R is removed. Further, the following expression (30) is established from the above expression (28).
G-R '= [b L G + g G + r R G)] - [r R G + r L R']
= (B L G + g G ) -r L R '(29)
r R G = R'-r L R '(30)

’を未知数(支配変数)とすると、上式(29)、(30)より{r ’,r ,(b +g)}の関係式を下式(31)のように求められる。
’=未知数(支配変数),
=R’−r ’,
+g=r ’+(G−R’) (31)
When r L R ′ is an unknown (dominant variable), the relational expression of {r L R ′, r R G , (b L G + g G )} is expressed by the following expression (31) from the above expressions (29) and (30). It is required as follows.
r L R '= unknown number (dominant variable),
r R G = R'-r L R ',
b L G + g G = r L R '+ (G−R ′) (31)

{G,R’}は検出された既知の値であるので、上式(31)に基づき未知数r ’が決まれば、{r ’,r ,(b +g)}が全て決まることになる。即ち、{r ’,r ,(b +g)}の尤度パターンを特定することができる。 Since {G, R ′} is a detected known value, if the unknown number r L R ′ is determined based on the above equation (31), {r L R ′, r R G , (b L G + g G ) } Are all determined. That is, it is possible to specify a likelihood pattern of {r L R ′, r R G , (b L G + g G )}.

図18に、この関係を原理的に表した図を示す。図18に示すように、未知数r ’として、{r ’,r ,(b +g)}と{G/2,R’/2}の誤差が最小になる値を未知数r ’として求める。即ち、下式(32)に示す誤差の評価値EGRが最小になる場合のr ’を求め、求めたr ’を上式(31)に代入することにより、{r ’,r ,(b +g)}の値を決定する。
=(G/2−(b +g))+(G/2−r
=(R’/2−r +(R’/2−(r ’))
GR=e+e (32)
FIG. 18 is a diagram showing this relationship in principle. As shown in FIG. 18, a value that minimizes an error between {r L R ′, r R G , (b L G + g G )} and {G / 2, R ′ / 2} as the unknown r L R ′. As an unknown r L R ′. That is, by obtaining r L R ′ when the error evaluation value E GR shown in the following equation (32) is minimized, and substituting the obtained r L R ′ into the above equation (31), {r L R ', r R G, determines the value of (b L G + g G) }.
e G = (G / 2- ( b L G + g G)) 2 + (G / 2-r R G) 2,
e G = (R '/ 2 -r R G) 2 + (R' / 2- (r L R ')) 2,
E GR = e G + e R (32)

以上のようにして、各画素の2バンド画素値{G,R’}から成分{r ’,r ,(b +g)}を推定することができる。 As described above, the component {r L R ′, r R G , (b L G + g G )} can be estimated from the 2-band pixel value {G, R ′} of each pixel.

なお、上記では{r ’,r ,(b +g)}と{G/2,R’/2}の誤差が最小となる場合のr ’を求めたが、本実施形態では、{r ’,r ,(b +g)}と{αGrG,αR’}の誤差が最小となる場合のr ’を求めてもよい。ここで、α、αGrは、下式(33)を満たす値である。αは、R’に対する{r ’,r }の平均的な値を算出するためのものであり、αGrは、Gに対する{r ,(b +g)}の平均的な値を算出するためのものである。これらは、図14に示すような撮像素子のカラーフィルタ特性から{r ’,r }及び{r ,(b +g)}の成分比を考慮して決定すればよい。
0<α≦1,0<αGr≦1 (33)
In the above {r L R ', r R G, (b L G + g G)} and {G / 2, R' is sought in the case where an error of / 2} is minimized r L R ', In the present embodiment, even if r L R ′ when the error between {r L R ′, r R G , (b L G + g G )} and {α Gr G, α R R ′} is minimized is obtained. Good. Here, α R and α Gr are values satisfying the following expression (33). alpha R is '{r L R for', r R G} R is for calculating an average value of, alpha Gr is for G {r R G, (b L G + g G)} It is for calculating the average value of. These can be determined by considering the component ratio of {r L R ′, r R G } and {r R G , (b L G + g G )} from the color filter characteristics of the image sensor as shown in FIG. Good.
0 <α R ≦ 1, 0 <α Gr ≦ 1 (33)

4.2.4.成分値の算出処理、右瞳画像と左瞳画像の取得処理
次に、上記で求めた値{b ’,b ,(g+r )}、{r ’,r ,(b +g)}を用いて、画素値Bを構成する成分{b ,b }の値と、画素値Gを構成する成分{b ,g,r }の値と、画素値Rを構成する成分{r ,r }の値とを算出する。
4.2.4. Component value calculation processing, right pupil image and left pupil image acquisition processing Next, the values {b R B ′, b L G , (g G + r R G )}, {r L R ′, r R G , (b L G + g G )} is used to determine the value of the component {b R B , b L B } constituting the pixel value B and the component {b L G , g G , r R G} values and component {r R R constituting the pixel values R, calculates the value of r L R}.

,r は、上式(17)、(27)より、下式(34)のように求められる。
=(kB1/kB2)×b ’,
=(kR1/kR2)×r ’ (34)
b R B and r L R are obtained from the above equations (17) and (27) as in the following equation (34).
b R B = (k B1 / k B2) × b R B ',
r L R = (k R1 / k R2) × r L R '(34)

,r は、g≪b ,g≪r であること及び上式(13)より、下式(35)のように求められる。
=B−(b +g)≒B−b
=R−(r +g)≒R−r (35)
b L B and r R R are obtained as in the following equation (35) from g B << b R B , g R << r L R and the above equation (13).
b L B = B− (b R B + g B ) ≈B−b R B ,
r R R = R- (r L R + g R) ≒ R-r L R (35)

,r は、上式(13)より、下式(36)のように求められる。
=G−(g+r ),
=G−(g+b ) (36)
b L G and r R G are obtained from the above equation (13) as in the following equation (36).
b L G = G- (g G + r R G),
r R G = G- (g G + b L G) (36)

は、上式(13)、(36)より、下式(37)のように求められる。
=G−(b +r ) (37)
g G is obtained from the above equations (13) and (36) as in the following equation (37).
g G = G- (b L G + r R G) (37)

右瞳画像Iと左瞳画像IのR、G、B成分は、上記で求めた成分から下式(38)のように分離する。
=(r ,r ,b ),I=(r ,b ,b ) (38)
R, G, B component of the right pupil images I R and Hidarihitomi image I L separates the following equation (38) from the component obtained above.
I R = (r R R , r R G , b R B ), I L = (r L R , b L G , b L B ) (38)

以上の実施形態によれば、光学フィルタFLTは、撮像光学系の瞳を、第1瞳(例えば右瞳)と、第1瞳とは透過波長帯域が異なる第2瞳(左瞳)とに分割する。図14で説明したように、撮像素子は、第1透過率特性Fを有する第1色(例えば青色)フィルタと、第2透過率特性Fを有する第2色(緑色)フィルタと、第3透過率特性Fを有する第3色(赤色)フィルタとを含む。マルチバンド推定部70は、第1〜第3透過率特性{F,F,F}の重なり部分及び非重なり部分に対応する第1〜第5バンドBD1〜BD5を設定し、撮像画像を構成する第1〜第3色の画素値{R,G,B}に基づいて第1〜第5バンドの成分値{b,b,g,r,r}を推定する。位相差画像生成部20は、第1〜第5バンドBD1〜BD5のうち第1瞳の透過波長帯域に対応するバンドの成分値を第1画像(右瞳画像)I=(r ,r ,b )として取得し、第1〜第5バンドのうち第2瞳の透過波長帯域に対応するバンドの成分値を第2画像(左瞳画像)I=(r ,b ,b )として取得する。 According to the above embodiment, the optical filter FLT divides the pupil of the imaging optical system into the first pupil (for example, the right pupil) and the second pupil (the left pupil) having a transmission wavelength band different from that of the first pupil. To do. As described in FIG. 14, the imaging device includes a first color (e.g., blue) filter having a first transmission characteristic F B, and the second color (green) filter having a second transmission characteristic F G, the third color having a third transmission rate characteristic F R and a (red) filter. The multiband estimation unit 70 sets the first to fifth bands BD1 to BD5 corresponding to the overlapping portion and the non-overlapping portion of the first to third transmittance characteristics {F B , F G , F R }, and the captured image The first to fifth band component values {b R , b L , g, r R , r L } are estimated based on the pixel values {R, G, B} of the first to third colors that constitute. The phase difference image generation unit 20 uses the component values of the band corresponding to the transmission wavelength band of the first pupil among the first to fifth bands BD1 to BD5 as the first image (right pupil image) I R = (r R R , r R G , b R B ), and the component value of the band corresponding to the transmission wavelength band of the second pupil among the first to fifth bands is expressed as the second image (left pupil image) I L = (r L R , B L G , b L B ).

このようにすれば、第1〜第3色の画素値で構成される画像から5バンドの成分値を推定し、その成分値を第1画像と第2画像に分離することができる。そして、その第1画像と第2画像に対して相関演算を行うことにより、位相差を検出できる。また、第1瞳と第2瞳でそれぞれ複数色を透過するように設定できるため、デフォーカス画像領域における色ずれの抑制や、色が偏った被写体における位相差検出精度の向上を、実現できる。   In this way, it is possible to estimate the 5-band component values from the image composed of the pixel values of the first to third colors, and to separate the component values into the first image and the second image. Then, the phase difference can be detected by performing a correlation operation on the first image and the second image. In addition, since a plurality of colors can be transmitted through each of the first pupil and the second pupil, it is possible to suppress color misregistration in the defocused image region and improve phase difference detection accuracy in a subject with a biased color.

また本実施形態では、図14で説明したように、マルチバンド推定部70は、第1透過率特性Fの非重なり部分に対応する第1バンドBD1と、第1透過率特性Fと第2透過率特性Fとの重なり部分に対応する第2バンドBD2と、第2透過率特性Fの非重なり部分に対応する第3バンドBD3と、第2透過率特性Fと第3透過率特性Fとの重なり部分に対応する第4バンドBD4と、第3透過率特性Fの非重なり部分に対応する第5バンドBD5とを設定する。 In this embodiment also, as described in FIG. 14, the multi-band estimator 70 includes a first band BD1 corresponding to the non-overlapping portions of the first transmission characteristic F B, the first transmittance characteristic F B No. a second band BD2 which corresponds to the overlapping portion of the two transmittance characteristics F G, the third band BD3 which corresponds to the non-overlapping portion of the second transmission characteristic F G, the second transmittance characteristic F G and third transmission setting a fourth band BD4 corresponding to the overlapping portion of the rate characteristic F R, and the fifth band BD5 corresponding to the non-overlapping portion of the third transmission characteristic F R.

ここで、透過率特性の重なり部分とは、図14に示すように波長軸に対して透過率特性を表した場合に、波長軸上で隣り合う透過率特性が重なっている領域のことである。重なり部分は、透過率特性が重なっている領域そのもの、あるいは透過率特性の帯域が重なっている帯域で表される。また、透過率特性の非重なり部分とは、他の透過率特性と重なっていない部分のことである。即ち、透過率特性から重なり部分を除いた部分のことである。なお、重なり部分又は非重なり部分に対応するバンドは、重なり部分又は非重なり部分の帯域そのものに限定されず、重なり部分又は非重なり部分に対応して設定されたバンドであればよい。例えば、所定の透過率と透過率特性が交わる波長でバンドを分割し、第1〜第5バンドを設定してもよい。   Here, the overlapping portion of the transmittance characteristics is a region where the transmittance characteristics adjacent to each other on the wavelength axis overlap when the transmittance characteristics are expressed with respect to the wavelength axis as shown in FIG. . The overlapping portion is represented by a region where the transmittance characteristics overlap or a band where the bandwidths of the transmittance characteristics overlap. Further, the non-overlapping portion of the transmittance characteristic is a portion that does not overlap with other transmittance characteristics. That is, the portion obtained by removing the overlapping portion from the transmittance characteristic. The band corresponding to the overlapping portion or the non-overlapping portion is not limited to the band itself of the overlapping portion or the non-overlapping portion, and may be any band set corresponding to the overlapping portion or the non-overlapping portion. For example, the first to fifth bands may be set by dividing a band at a wavelength at which a predetermined transmittance and transmittance characteristics intersect.

このようにすれば、撮像画像の第1〜第3色の画素値{R,G,B}から第1〜第5のバンド成分値{b,b,g,r,r}を推定することが可能となる。即ち、上式(13)で説明したように、透過率特性が隣り合う画素値(例えばB、G)には重なり部分の成分値(b)が含まれる。この重なり部分の成分値(b)を、上式(19)のように画素値の差分(B’−G)により消去することで、上式(21)のように成分値の関係式を求め、その関係式に基づいて成分値を推定することが可能となる。 By doing so, the first to fifth band component values {b R , b L , g, r R , r L } are obtained from the pixel values {R, G, B} of the first to third colors of the captured image. Can be estimated. That is, as described in the above equation (13), the pixel values (for example, B and G) having adjacent transmittance characteristics include the component value (b L ) of the overlapping portion. By deleting the component value (b L ) of this overlapping portion by the difference (B′−G) of the pixel value as in the above equation (19), the relational expression of the component values as in the above equation (21) is obtained. The component value can be estimated based on the relational expression.

なお、上記のように本実施形態について詳細に説明したが、本発明の新規事項および効果から実体的に逸脱しない多くの変形が可能であることは当業者には容易に理解できるであろう。従って、このような変形例はすべて本発明の範囲に含まれるものとする。例えば、明細書又は図面において、少なくとも一度、より広義又は同義な異なる用語と共に記載された用語は、明細書又は図面のいかなる箇所においても、その異なる用語に置き換えることができる。また撮像光学系、撮像装置等の構成・動作や、位相差検出手法、合焦方向判定手法、フォーカス制御手法、マルチバンド推定手法等も本実施形態で説明したものに限定に限定されず、種々の変形実施が可能である。   Although the present embodiment has been described in detail as described above, it will be easily understood by those skilled in the art that many modifications can be made without departing from the novel matters and effects of the present invention. Accordingly, all such modifications are intended to be included in the scope of the present invention. For example, a term described with a different term having a broader meaning or the same meaning at least once in the specification or the drawings can be replaced with the different term in any part of the specification or the drawings. In addition, the configuration and operation of the imaging optical system and the imaging apparatus, the phase difference detection method, the focusing direction determination method, the focus control method, the multiband estimation method, and the like are not limited to those described in this embodiment, and various Can be implemented.

10 撮像部、20 位相差画像生成部、25 出力部、
30 表示画像生成部、40 モニタ表示部、50 分光特性記憶部、
70 マルチバンド推定部、80 フォーカス制御部、82 位相差検出部、
84 フォーカス制御量算出部、86 フォーカスレンズ駆動制御部、
90 データ圧縮部、100 データ記録部、
,B,A(d),B(d) 係数、
BD1〜BD5 第1〜第5バンド、C(δ) 相関値、
max 相関値の最大値、Df,Dr デフォーカス位置、
,F,F 透過率特性、FL1 右瞳フィルタ、
FL2 左瞳フィルタ、FLT 光学フィルタ、FP フォーカス位置、
Fa 減少区間、G 画素値、I(x) 撮像画像、
(x) 左瞳画像、I(x) 右瞳画像、LNS 結像レンズ、
Ra 増加区間、W 相関幅、
,b,g,r,r 第1〜第5バンドの成分値、
d シフト量、f,f 透過率特性、x 位置、Δθ 偏角差分、
Δθmin 偏角差分の最小値、δ シフト量
10 imaging unit, 20 phase difference image generating unit, 25 output unit,
30 display image generation unit, 40 monitor display unit, 50 spectral characteristic storage unit,
70 multiband estimation unit, 80 focus control unit, 82 phase difference detection unit,
84 focus control amount calculation unit, 86 focus lens drive control unit,
90 data compression unit, 100 data recording unit,
A L , B L , A R (d), B R (d) coefficient,
BD1 to BD5 1st to 5th bands, C (δ j ) correlation value,
C max maximum correlation value, Df, Dr defocus position,
F B, F G, F R transmittance characteristics, FL1 right pupil filter,
FL2 Left pupil filter, FLT optical filter, FP focus position,
Fa decreasing section, G pixel value, I (x) captured image,
I L (x) Left pupil image, I R (x) Right pupil image, LNS imaging lens,
Ra increasing interval, W j correlation width,
b R , b L , g, r R , r L first to fifth band component values,
d shift amount, f L , f R transmittance characteristics, x position, Δθ declination difference,
Δθ min Minimum deviation angle difference, δ j shift amount

Claims (8)

第1被写体像と前記第1被写体像に対して視差を有する第2被写体像とを撮像し、撮像画像を取得する撮像素子と、
前記撮像画像に基づいて、前記第1被写体像に対応する第1画像と前記第2被写体像に対応する第2画像とを生成する位相差画像生成部と、
前記第1画像と前記第2画像を相対的にシフトさせながら相関演算を行い、前記第1画像と前記第2画像の位相差を検出する位相差検出部と、
を備え、
前記位相差検出部は、
前記相関演算の積和を行う領域幅である相関幅を、前記シフトのシフト量に応じて設定することを特徴とする撮像装置。
An imaging device that captures a first subject image and a second subject image having parallax with respect to the first subject image, and obtains a captured image;
A phase difference image generation unit that generates a first image corresponding to the first subject image and a second image corresponding to the second subject image based on the captured image;
A phase difference detection unit that performs a correlation operation while relatively shifting the first image and the second image, and detects a phase difference between the first image and the second image;
With
The phase difference detector is
An imaging apparatus, wherein a correlation width, which is a region width for performing a product sum of the correlation calculation, is set according to a shift amount of the shift.
請求項1において、
前記位相差検出部は、
前記シフト量を順次大きくするとともに前記相関幅を順次広くしながら前記相関演算を繰り返し行って相関値を求め、前記相関値が最大値となるときの前記シフト量を前記位相差として検出することを特徴とする撮像装置。
In claim 1,
The phase difference detector is
The correlation calculation is repeated by sequentially increasing the shift amount and gradually increasing the correlation width to obtain a correlation value, and detecting the shift amount when the correlation value becomes the maximum value as the phase difference. An imaging device that is characterized.
請求項2において、
前記位相差検出部は、
前記シフト量を順次大きくしながら前記相関値を求めたときに、前記相関値の最初のピーク値に対応する前記シフト量を前記位相差として検出することを特徴とする撮像装置。
In claim 2,
The phase difference detector is
An imaging apparatus, wherein when the correlation value is obtained while sequentially increasing the shift amount, the shift amount corresponding to the first peak value of the correlation value is detected as the phase difference.
請求項3において、
前記位相差検出部は、
前記最初のピーク値を検出したと判断した場合に、前記最初のピーク値を検出したと判断したときの前記シフト量よりも大きい前記シフト量について前記相関値を求めずに前記相関演算を終了することを特徴とする撮像装置。
In claim 3,
The phase difference detector is
When it is determined that the first peak value has been detected, the correlation calculation is terminated without obtaining the correlation value for the shift amount that is larger than the shift amount when it is determined that the first peak value has been detected. An imaging apparatus characterized by that.
請求項2乃至4のいずれかにおいて、
前記位相差検出部は、
前記位相差を検出したときの前記相関幅に対応した角周波数を設定し、前記角周波数における画素値のフーリエ係数を前記第1画像と前記第2画像について算出し、前記第1画像についての前記フーリエ係数の偏角と前記第2画像についての前記フーリエ係数の偏角との差分が最小となるときの前記シフト量を、サブピクセルの位相差として検出することを特徴とする撮像装置。
In any of claims 2 to 4,
The phase difference detector is
An angular frequency corresponding to the correlation width when the phase difference is detected is set, a Fourier coefficient of a pixel value at the angular frequency is calculated for the first image and the second image, and the first image is calculated for the first image. An imaging apparatus, wherein the shift amount when a difference between a deviation angle of a Fourier coefficient and a deviation angle of the Fourier coefficient of the second image is minimized is detected as a phase difference of subpixels.
請求項1乃至5のいずれかにおいて、
前記位相差検出部は、
前記撮像画像の画素値と、前記第1画像及び前記第2画像のうち少なくとも一方である比較画像の画素値とを比較することにより、撮像光学系の合焦方向を判定し、
前記相関演算において前記第1画像と前記第2画像をシフトさせるシフト方向を、前記判定した前記合焦方向に基づいて設定することを特徴とする撮像装置。
In any one of Claims 1 thru | or 5,
The phase difference detector is
By comparing the pixel value of the captured image with the pixel value of a comparison image that is at least one of the first image and the second image, the focusing direction of the imaging optical system is determined,
An imaging apparatus, wherein a shift direction for shifting the first image and the second image in the correlation calculation is set based on the determined in-focus direction.
請求項1乃至6のいずれかにおいて、
マルチバンド推定部と、
撮像光学系の瞳を、第1瞳と、前記第1瞳とは透過波長帯域が異なる第2瞳とに分割する光学フィルタと、
を備え、
前記撮像素子は、
第1透過率特性を有する第1色フィルタと、第2透過率特性を有する第2色フィルタと、第3透過率特性を有する第3色フィルタとを有し、
前記マルチバンド推定部は、
前記第1〜第3透過率特性の重なり部分及び非重なり部分に対応する第1〜第5バンドを設定し、前記撮像画像を構成する第1〜第3色の画素値に基づいて前記第1〜第5バンドの成分値を推定し、
前記位相差画像生成部は、
前記第1〜第5バンドのうち前記第1瞳の透過波長帯域に対応するバンドの成分値を前記第1画像として取得し、前記第1〜第5バンドのうち前記第2瞳の透過波長帯域に対応するバンドの成分値を前記第2画像として取得することを特徴とする撮像装置。
In any one of Claims 1 thru | or 6.
A multiband estimator;
An optical filter for dividing the pupil of the imaging optical system into a first pupil and a second pupil having a transmission wavelength band different from that of the first pupil;
With
The image sensor is
A first color filter having a first transmittance characteristic, a second color filter having a second transmittance characteristic, and a third color filter having a third transmittance characteristic,
The multiband estimator is
First to fifth bands corresponding to the overlapping portion and the non-overlapping portion of the first to third transmittance characteristics are set, and the first to third colors are configured based on the first to third color pixel values constituting the captured image. ~ Estimate the component value of the fifth band,
The phase difference image generation unit
The component value of the band corresponding to the transmission wavelength band of the first pupil among the first to fifth bands is acquired as the first image, and the transmission wavelength band of the second pupil among the first to fifth bands. A component value of a band corresponding to is acquired as the second image.
第1被写体像と前記第1被写体像に対して視差を有する第2被写体像とを撮像して、撮像画像を取得し、
前記撮像画像に基づいて、前記第1被写体像に対応する第1画像と前記第2被写体像に対応する第2画像とを生成し、
相関演算の積和を行う領域幅である相関幅を、前記相関演算における前記第1画像と前記第2画像のシフト量に応じて設定し、
前記第1画像と前記第2画像との位相差を前記相関演算により検出することを特徴とする位相差検出方法。
Capturing a first subject image and a second subject image having parallax with respect to the first subject image to obtain a captured image;
Generating a first image corresponding to the first subject image and a second image corresponding to the second subject image based on the captured image;
A correlation width that is a region width for performing a product-sum of correlation calculations is set according to a shift amount of the first image and the second image in the correlation calculation,
A phase difference detection method, wherein a phase difference between the first image and the second image is detected by the correlation calculation.
JP2012179321A 2012-08-13 2012-08-13 Imaging apparatus and phase difference detection method Pending JP2014038151A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012179321A JP2014038151A (en) 2012-08-13 2012-08-13 Imaging apparatus and phase difference detection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012179321A JP2014038151A (en) 2012-08-13 2012-08-13 Imaging apparatus and phase difference detection method

Publications (1)

Publication Number Publication Date
JP2014038151A true JP2014038151A (en) 2014-02-27

Family

ID=50286354

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012179321A Pending JP2014038151A (en) 2012-08-13 2012-08-13 Imaging apparatus and phase difference detection method

Country Status (1)

Country Link
JP (1) JP2014038151A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015082033A (en) * 2013-10-23 2015-04-27 オリンパス株式会社 Imaging device and phase difference detection method
JP2016009062A (en) * 2014-06-24 2016-01-18 キヤノン株式会社 Image-capturing device, control device, control method, program, and recording medium
WO2016042721A1 (en) * 2014-09-17 2016-03-24 Canon Kabushiki Kaisha Positional shift amount calculation apparatus and imaging apparatus
WO2017212577A1 (en) * 2016-06-08 2017-12-14 オリンパス株式会社 Imaging device, endoscope device, and imaging method
US10145994B2 (en) 2014-11-28 2018-12-04 Kabushiki Kaisha Toshiba Lens device and image capturing device for acquiring distance information at high accuracy
US10339665B2 (en) 2014-09-17 2019-07-02 Canon Kabushiki Kaisha Positional shift amount calculation apparatus and imaging apparatus

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015082033A (en) * 2013-10-23 2015-04-27 オリンパス株式会社 Imaging device and phase difference detection method
WO2015059970A1 (en) * 2013-10-23 2015-04-30 オリンパス株式会社 Imaging device and phase difference detection method
JP2016009062A (en) * 2014-06-24 2016-01-18 キヤノン株式会社 Image-capturing device, control device, control method, program, and recording medium
WO2016042721A1 (en) * 2014-09-17 2016-03-24 Canon Kabushiki Kaisha Positional shift amount calculation apparatus and imaging apparatus
US10339665B2 (en) 2014-09-17 2019-07-02 Canon Kabushiki Kaisha Positional shift amount calculation apparatus and imaging apparatus
US10145994B2 (en) 2014-11-28 2018-12-04 Kabushiki Kaisha Toshiba Lens device and image capturing device for acquiring distance information at high accuracy
WO2017212577A1 (en) * 2016-06-08 2017-12-14 オリンパス株式会社 Imaging device, endoscope device, and imaging method

Similar Documents

Publication Publication Date Title
US9798155B2 (en) Image processing apparatus, image processing method, and program for generating a three dimensional image to be stereoscopically viewed
US9247227B2 (en) Correction of the stereoscopic effect of multiple images for stereoscope view
CN107113370B (en) Image recording apparatus and method of recording image
JP5489897B2 (en) Stereo distance measuring device and stereo distance measuring method
US10567646B2 (en) Imaging apparatus and imaging method
JP2014038151A (en) Imaging apparatus and phase difference detection method
EP3015892B1 (en) Imaging device and imaging method
US11347133B2 (en) Image capturing apparatus, image processing apparatus, control method, and storage medium
JPWO2014024495A1 (en) Image processing apparatus, imaging apparatus, and control program for image processing apparatus
JP2013044844A (en) Image processing device and image processing method
WO2013005489A1 (en) Image capture device and image processing device
JP6173065B2 (en) Imaging apparatus, image processing apparatus, imaging method, and image processing method
JP7195801B2 (en) Image processing device and its control method, distance detection device, imaging device, program
US20190297267A1 (en) Control apparatus, image capturing apparatus, control method, and storage medium
JP5963611B2 (en) Image processing apparatus, imaging apparatus, and image processing method
JP2015046777A (en) Imaging apparatus and control method of imaging apparatus
JP6648916B2 (en) Imaging device
JP6005246B2 (en) Imaging apparatus, histogram display method, program, and image processing apparatus
JP6000738B2 (en) Imaging device and method of determining focusing direction of imaging device
JP2018074362A (en) Image processing apparatus, image processing method, and program
JP6625184B2 (en) Focus detection device, imaging device, focus detection method, and focus detection program
JP6598550B2 (en) Image processing apparatus, imaging apparatus, image processing method, and program
WO2013125398A1 (en) Imaging device and focus control method
Koh et al. Autofocus method using similarity measure based on inter-color channel correlation
JP2017118293A (en) Image processing apparatus, imaging apparatus, image processing method, image processing program, and storage medium