JP2014038151A - Imaging apparatus and phase difference detection method - Google Patents
Imaging apparatus and phase difference detection method Download PDFInfo
- 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
Links
Images
Abstract
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
特許文献1には、ステレオマッチングを行う所定サイズを設定し、その設定したサイズで相関値を求め、その求めた相関値に基づいて、ステレオマッチングを行うサイズを再設定し、これを繰り返して最終的に設定したサイズで相関演算を行うことにより、相関幅を適応的に設定して相関演算を行う手法が開示されている。
In
特許文献2には、基準視差を設定し、その基準視差を与える画像点を基準にステレオマッチングの探索範囲を特定し、その探索範囲においてステレオマッチングを行うことにより、相関演算を行う探索範囲を絞り込む手法が開示されている。
In
上記のような相関演算により位相差を検出する手法は、例えば、検出した位相差を用いてフォーカス制御を行う位相差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
本発明の幾つかの態様によれば、合焦度合いに応じて相関幅を適応的に変化させることが可能な撮像装置及び位相差検出方法等を提供できる。 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.
以下、本発明の好適な実施の形態について詳細に説明する。なお以下に説明する本実施形態は特許請求の範囲に記載された本発明の内容を不当に限定するものではなく、本実施形態で説明される構成の全てが本発明の解決手段として必須であるとは限らない。 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
そこで本実施形態では、図3等に示すように、相関演算において2つの位相差画像を近づけるシフト量δを順次大きくしていくと共に、そのシフト量δに応じて相関幅Wを大きくしていく。そして、相関値が最大となるシフト量δkを位相差として検出する。 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.
シフト量δkのとき相関幅はWkであり、シフト量δkは検出対象位置での合焦度合いに対応する。そのため本実施形態では、合焦度合いに対して適応的に相関幅Wkが変化することとなり、適切な相関幅Wkで位相差を検出することが可能となる。また本実施形態では、相関ピークを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は、透過率特性fRを有する右瞳フィルタFL1(第1フィルタ)と、fRとは異なる透過率特性fLを有する左瞳フィルタ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を透過した結像光には、右瞳を通過した被写体像と左瞳を通過した被写体像が含まれる。撮像素子は、これらの被写体像を含む結像光束を画像として撮像する。そして、左右瞳の透過率特性fR、fLが明確に帯域分離されていることを用いて、撮像画像から右瞳画像(第1画像)の画素値IR(x)と左瞳画像(第2画像)の画素値IL(x)を求める。なお、撮像素子上の任意の画素は、2次元のアドレスで表記すべきだが、ここでは便宜上撮像素子上の1方向の位置における画素値により説明するものとする。また、IR(x)、IL(x)は位置xにおける画素値を表すが、画像全体を表す符号としても適宜IR(x)、IL(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.
なお、IR(x)、IL(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に撮像素子のセンサ面がある場合には、右瞳画像IR(x)と左瞳画像IL(x)は視差方向にずれておらず、位置が一致している。一方、デフォーカス位置Dr、Dfに撮像素子のセンサ面がある場合には、右瞳画像IR(x)と左瞳画像IL(x)は視差方向にずれる。具体的には、デフォーカス位置Dfでは、フォーカスが撮像素子のセンサ面よりも後ろ側にある後ピント状態であり、右瞳画像IR(x)が右側(+x方向)にずれ、左瞳画像IL(x)が左側(−x方向)にずれる。一方、デフォーカス位置Drは、フォーカスが撮像素子のセンサ面よりも前側にある前ピント状態であり、右瞳画像IR(x)が左側にずれ、左瞳画像IL(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でのIR(x)、IL(x)を例として図示しており、IR(x)、IL(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.位相差検出手法
次に、右瞳画像IR(x)と左瞳画像IL(x)の位相差を検出する手法について説明する。なお、以下では後ピント状態でのIR(x)、IL(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に示すように、右瞳画像IR(x)と左瞳画像IL(x)の波形を近づけるシフト量をδ0、δ1、δ2、・・・と変化させ、各シフト量について右瞳画像IR(x)と左瞳画像IL(x)の画素値の積和をとる。ここでδjはj回目(jは0以上の整数)の演算ステップにおけるシフト量を表し、δ0=0、δj<δ(j+1)である。後ピント状態では、右瞳画像IR(x)を左側(−x方向)にδjだけシフトさせ、左瞳画像IL(x)を右側(+x方向)にδjだけシフトさせる。 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).
シフト量δjでの積和は、シフト量δjに対応して設定された相関幅Wjで行い、その相関幅Wjは、画像上において相関値を求めたい位置xi(以下では適宜、「注目位置」と呼ぶ)を中心として設定される。具体的には、下式(1)、(2)により位置xiでの相関値C(δj)を求める。
図3に、シフト量δjに対する相関幅Wjの特性WDと、シフト量δjに対する相関値C(δj)の特性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に示すように、相関幅Wjは、シフト量δjを大きくするのと連動して大きくなる。基本的にはWj<W(j+1)となるように設定するが、必ずしも全てのδjに対してWj<W(j+1)である必要はなく、例えばδ0の近傍(図3の例ではδ0〜δ2)においてWj=W(j+1)であってもよい。この相関幅Wjとシフト量δjの関係は、例えば画像の位相差とボケ具合の関係から予め設定しておけばよい。即ち、画像の位相差が大きくなるほど画像がボケることから、シフト量δjに連動して相関幅Wjを大きくする。この点については、図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に示すように、シフト量をδ0、δ1、δ2、・・・と変化させながら相関値C(δj)を求めると、シフト量δjが注目位置xiでの位相差に一致したときにピークとなる。このときのシフト量をδk(kは自然数)で表し、相関幅をWkで表し、相関値のピーク値をC(δk)=Cmaxで表す。本実施形態では、この相関ピークを検出することにより位相差を検出する。検出される位相差は2δkである。相関ピークの検出手法としては、例えば相関値C(δj)に対してピークホールド処理を行えばよい。 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を用いて、シフト量δjに連動して相関幅Wjを大きくする点について原理的に説明する。なお、以下では後ピント状態を例にとり説明する。 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)をコンボリューションしたものである。右瞳と左瞳のポイントスプレッドファンクションをそれぞれPSFR(x)、PSFL(x)とすると、右瞳画像はIR(x)=f(x)*PSFR(x)で得られ、右瞳画像はIL(x)=f(x)*PSFL(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.
PSFR(x)とPSFL(x)の重心位置は異なっているため、それに応じてIR(x)とIL(x)は、左右にシフトする。後ピント状態では、図4(A)に示すようにIR(x)が右側にシフトし、IL(x)が左側にシフトする。フォーカス位置の近傍では、PSFR(x)とPSFL(x)の重心位置の間隔が狭いので、IR(x)とIL(x)の位相差δは小さい。また、PSFR(x)とPSFL(x)の分布が狭いので、IR(x)とIL(x)も比較的狭い幅Wの範囲に分布する。IR(x)とIL(x)は、注目位置xiでのポイントスプレッドファンクションによってf(x)がぼかされたものなので、IR(x)とIL(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.
このIR(x)とIL(x)から相関値を求めるとき、仮に相関幅を幅Wよりも広くしすぎると、相関幅の中にIR(x)やIL(x)の画素値のピークが複数含まれてしまい、実際には対応しないピークが重なったときに相関ピークが発生する可能性がある。一方、相関幅を幅Wより狭くしすぎると、相関幅の中にIR(x)やIL(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近傍における位相差画像を模式的に示す。デフォーカス位置では、PSFR(x)とPSFL(x)の重心位置の間隔が広いので、IR(x)とIL(x)の位相差δ’は、フォーカス位置での位相差δよりも大きい。また、PSFR(x)とPSFL(x)の分布が広いので、IR(x)とIL(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).
上記のようなIR(x)とIL(x)に対して本実施形態の相関演算を適用した場合、図5に示すように、シフト量δjが大きくなるとともにIR(x)とIL(x)の間隔は2(δk−δ0)、2(δk−δ1)、・・・と小さくなっていき、相関幅はW0、W1、・・・と大きくなっていく。IR(x)とIL(x)の間隔が2(δk−δk)=0となり、IR(x)とIL(x)が一致したとき、相関値がピーク値となる。このときの相関幅Wkは、上述のようにIR(x)とIL(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.
このように、シフト量δjに連動して相関幅Wjを設定することにより、IR(x)とIL(x)の合焦度合い(即ち位相差2δk)に対して適切な相関幅Wkで相関ピークを検出することが可能となる。 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に示すように、シフト量δkだけシフトさせた右瞳画像IR(x+δk)と左瞳画像IL(x−δk)の間に、φのずれが残っているとする。シフト量δkは、図3等で説明したように、積和による相関演算で求めたIR(x)とIL(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)により係数AL、BL、AR(d)、BR(d)を求める。係数AL、BLは、角周波数ωでのIL(x−δk)のフーリエ係数に相当する。また、係数AR(d)、BR(d)は、角周波数ωでのIR(x+δk)のフーリエ係数に相当し、積和の範囲をdだけシフトさせたものである。
ここで、角周波数ωは、位相差2δkを検出したときの相関幅Wkで決まり、ω=π/Wkである。cos(ωx)とsin(ωx)は、図6に示すようにxiを中心とする幅Wkの範囲で定義された関数である。この関数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{BL/AL}は、係数AL、BLの偏角であり、tan−1{BR(d)/AR(d)は、係数AR(d)、BR(d)の偏角である。偏角差分Δθは、それらの差分である。
Δθ=tan−1{BL/AL}−tan−1{BR(d)/AR(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のようにIR(x+δk)とIL(x−δk)のずれ量がφの場合には、検出される位相差はd=φとなる。最終的な位相差は、IR(x)とIL(x)の積和で求めた位相差2δkとサブピクセルの位相差φから、2δk+φと求められる。 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δkを求めた後に微小な位相差φが残っている場合であっても、その位相差φをサブピクセルの精度で検出できる。また、偏角差分Δθを求める角周波数ωを、積和による相関演算で位相差2δkを検出したときの相関幅Wkに応じて決定(ω=π/Wk)することで、画像がもつ周波数に対応した偏角差分Δθを求めることができる。即ち、図4(A)等で説明したように、画像のもつ代表的な周波数は位相差2δk(即ちボケ具合)に応じて決まっており、その周波数の波を例えば1つ程度含むように相関幅Wkが決まっている。これは、角周波数ω=π/Wkの周波数成分が画像に豊富に含まれることを意味しており、その角周波数ωでフーリエ係数を求めることにより、絶対値の大きなフーリエ係数を求め、精度良く偏角差分Δθを決定することができる。 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を求めたが、本実施形態ではこれに限定されず、差分[{BL/AL}−{BR(d)/AR(d)}](AL=0又はAR(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
撮像部10は、撮像素子と撮像処理部を含むことができる。撮像素子は、結像レンズLNS及び光学フィルタFLTによって結像された被写体を撮像する。撮像処理部は、撮像動作の制御や、アナログの画素信号をA/D変換する処理などを行う。
The
位相差画像生成部20は、撮像部10により撮像された画像に基づいて、右瞳画像IRと左瞳画像ILを生成する。この2画像を位相差画像とする。位相差画像の生成手法としては、例えば既知の手法(例えば特開2001−174696号公報や、特開平10−276964号公報に記載の手法)など、種々の手法を採用することが可能である。或は、第3実施形態で説明するマルチバンド推定処理により位相差画像を生成してもよい。
Phase
位相差検出部82は、位相差画像IR、ILに対して、上述の位相差検出手法を適用し、位相差を検出する。
The phase
フォーカス制御部80は、検出された位相差の情報に基づいてオートフォーカス制御を行う。即ちフォーカス制御部80は、位相差の情報と位相差画像IR、ILのずれ方向の情報に基づいてフォーカス制御量(結像レンズLNSの移動量と移動方向)を算出し、そのフォーカス制御量に基づいてフォーカスレンズを移動させる制御を行う。位相差画像IR、ILのずれ方向は、例えば相関演算において探索的に決定すればよい。
The
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
次に、位相差画像生成部20が位相差画像IR、ILを取得する(ステップS2)。次に、位相差検出部82が、相関幅Wj=W0とシフト量δj=δ0=0を設定する(ステップS3)。次に、位相差検出部82が、ステップS3で設定したシフト量δjで位相差画像IR、ILを近づける(ステップS4)。次に、位相差検出部82が、ステップS3で設定した相関幅Wjで、ポイントxiでの相関値C(δj)を算出する(ステップS5)。次に、位相差検出部82は、相関値C(δj)がピーク値であるか否かを判定する(ステップS6)。
Next, the phase difference
相関値C(δj)がピーク値でないと判定した場合には、位相差検出部82は、相関幅Wj=Wj+1とシフト量δj=δj+1を設定し(ステップS7)、ステップS4を再び実行する。一方、相関値C(δj)がピーク値であると判定した場合には、位相差検出部82は、シフト量δjに基づいて位相差2δj=2δkを出力し(ステップS8)、位相差検出処理を終了する。なお、位相差の情報としては、位相差2δkそのものに限らず、シフト量δkを出力してもよい。
When it is determined that the correlation value C (δ j ) is not a peak value, the phase
図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(δj)がピーク値であると判定した場合には、位相差検出部82は、サブピクセル精度の位相差を検出するか否かを決定する(ステップS28)。例えば、ユーザーからの設定情報に基づいて決定してもよいし、或は、相関値C(δj)の大きさに基づいて決定してもよい。
If it is determined in step S26 that the correlation value C (δ j ) is a peak value, the phase
サブピクセル精度の位相差を検出しないと決定した場合には、位相差検出部82は、シフト量δjに基づいて位相差2δj=2δkを出力し、位相差検出処理を終了する。サブピクセル精度の位相差を検出すると決定した場合には、位相差検出部82は、シフト量dにおける位相差画像IR、ILの偏角差分Δθを求める(ステップS29)。dの初期値は例えばd=0である。次に、位相差検出部82は、偏角差分Δθが最小値であるか否かを判定する(ステップS30)。
When it is determined not to detect the phase difference with sub-pixel accuracy, the phase
偏角差分Δθが最小値でない場合には、位相差検出部82は、シフト量d=d+αを設定し(ステップS31)、ステップS29を再び実行する。ここでαは、シフト量dを変化させるときの変化量(刻み)であり、サブピクセルの位相差を検出する精度に応じて設定される。一方、偏角差分Δθが最小値である場合には、位相差検出部82は、シフト量δj、dに基づいて位相差2δj+d=2δk+φを出力し(ステップS32)、位相差検出処理を終了する。
If the declination difference Δθ is not the minimum value, the phase
以上の実施形態によれば、図9で説明したように、撮像装置は撮像素子(撮像部10)と位相差画像生成部20と位相差検出部82とを備える。撮像素子は、第1被写体像と、第1被写体像に対して視差を有する第2被写体像とを撮像し、撮像画像を取得する。位相差画像生成部20は、その撮像画像に基づいて、第1被写体像に対応する第1画像IR(x)(右瞳画像)と第2被写体像に対応する第2画像IL(x)(左瞳画像)とを生成する。位相差検出部82は、第1画像IR(x)と第2画像IL(x)を相対的にシフトさせながら相関演算を行い、第1画像IR(x)と第2画像IL(x)の位相差を検出する。このとき、位相差検出部82は、相関演算の積和を行う領域幅である相関幅Wjを、シフトのシフト量δjに応じて設定する。
According to the above embodiment, as described in FIG. 9, the imaging device includes the imaging element (imaging unit 10), the phase difference
例えば本実施形態では、撮像光学系(結像レンズ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δk(図3のδk)は画像の合焦度合いを表すことから、シフト量δjと相関幅Wjを連動させることで、その合焦度合いに応じた適切な相関幅Wkで位相差2δkを検出できる。 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δ k (δ k 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は、シフト量δjを順次大きくするとともに相関幅Wjを順次広くしながら相関演算を繰り返し行って相関値C(δj)を求め、その相関値C(δj)が最大値Cmaxとなるときのシフト量δkを位相差として検出する。
In the present embodiment, as described with reference to FIG. 3, the phase
図4(A)等で説明したように、位相差2δkが大きいほど画像がボケており、相関幅Wkを大きくする必要がある。この点、本実施形態によれば、シフト量δjとともに相関幅Wjを大きくするので、画像のボケ具合(画像の代表的な周波数成分)に応じた相関幅Wkで位相差2δkを検出できる。また、注目位置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は、シフト量δjを順次大きくしながら相関値C(δj)を求めたときに、相関値C(δj)の最初のピーク値Cmaxに対応するシフト量δkを位相差として検出する。
In the present embodiment, as described with reference to FIG. 3, when the phase
図3等で説明したように、相関幅Wjの中に位相差画像IL(x)、IR(x)のピークが複数含まれるような場合、実際には対応しないピークが重なったときに相関ピークを検出する可能性がある。この点、本実施形態によれば、最初の相関ピークを位相差として検出するので、位相差画像IL(x)、IR(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実施形態では、右瞳画像IR(x)と左瞳画像IL(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は、位相差画像IR、ILに対して、後述する合焦方向判定手法を適用し、合焦方向を判定する。そして、その判定した合焦方向に基づいて、相関演算における位相差画像IR、ILのシフト方向を決定する。
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
3.2.合焦方向判定手法
次に、本実施形態の合焦方向判定手法について詳細に説明する。図12(A)、図12(B)に示すように、撮像画像I(x)、右瞳画像IR(x)、左瞳画像IL(x)の画素値のDC成分(幅Wでの平均値)をゼロレベルにして基準を合わせ、比較用画素値I(x)’、IR(x)’、IL(x)’を求める。図12(A)には、後ピント状態での比較用画素値を示し、図12(B)には、前ピント状態での比較用画素値を示す。これらの比較用画素値は下式(6)により求められる。なお以下では適宜、「比較用画素値」を単に「画素値」とも呼ぶ。
ここで、幅Wは、例えば実験等により予め求めた所定の平均演算区間であり、位置xを中心とする幅である。図12(A)、図12(B)では、x=xiの場合を例に幅Wを図示している。また、I(x)’、IR(x)’、IL(x)’の間には、下式(7)の関係が成り立つ。
I’(x)=[IL’(x)+IR’(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)’、IR(x)’、IL(x)’の交点(比較用画素値が一致(略一致を含む)する位置)のうち、xiに最も近い交点の位置x0、x1を求める。位置x0は、注目画素よりも左側の交点であり、位置x1は、注目画素よりも右側の交点である。そして、下式(8)を満たす場合には、注目画素が増加区間Raに属すると判定し、下式(9)を満たす場合には、注目画素が増加区間Raに属すると判定する。例えば図12(A)では、注目画素の位置xiは減少区間Faに属すると判定される。
[I’(x0)−I’(x1)]<0 (8)
[I’(x0)−I’(x1)]>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)
なお、[IL’(x0)−IL’(x1)]<0又は[IR’(x0)−IR’(x1)]<0を満たす場合に、注目画素が増加区間Raに属すると判定してもよい。また、[IL’(x0)−IL’(x1)]>0又は[IR’(x0)−IR’(x1)]>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)とIL’(x)の上下関係に基づいて、注目画素が前ピント状態であるか後ピント状態であるかを判定する。具体的には、下式(10)により、注目画素が属する区間でのI’(x)とIL’(x)の差分値ELを求め、その差分値ELの符号に基づいて合焦方向を判定する。図12(A)、図12(B)に示すように、増加区間Raと減少区間Faでは、I’(x)とIL’(x)の上下関係が異なるので、その上下関係と合焦方向との対応が異なっている。即ち、増加区間Raにおいては、下式(11)により合焦方向を判定し、減少区間Faにおいては、下式(12)により合焦方向を判定する。
なお、I’(x)とIR’(x)の上下関係に基づいて合焦方向を判定してもよいことは言うまでもない。 Needless to say, the in-focus direction may be determined based on the vertical relationship between I ′ (x) and I R ′ (x).
判定した合焦方向が後ピント状態であった場合には、IR(x)が右側(+x方向)にシフトし、IL(x)が左側(−x方向)にシフトしていると判断される。この場合、IR(x)を左側へ、IL(x)を右側へシフトさせて相関演算を行う。一方、判定した合焦方向が前ピント状態であった場合には、IR(x)が左側(−x方向)にシフトし、IL(x)が右側(+x方向)にシフトしていると判断される。この場合、IR(x)を右側へ、IL(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画像IR(x)及び第2画像IL(x)のうち少なくとも一方である比較画像(例えばIL(x))の画素値とを比較することにより、撮像光学系の合焦方向を判定する。位相差検出部82は、その判定した合焦方向に基づいて、相関演算において第2画像IL(x)を第1画像IR(x)に対してシフトさせるシフト方向を設定する。
According to the above embodiment, the phase
このようにすれば、前ピント状態であるか後ピント状態であるかを判定することができ、その判定結果に対応して、第1画像IR(x)と第2画像IL(x)のずれ方向を知ることができる。これにより、どの方向に第1画像IR(x)と第2画像IL(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画像IR(x)と第2画像IL(x)が視差によりずれる方向を視差方向(+x方向)とする場合に、撮像画像I(x)の画素値が視差方向に増加又は減少する領域(Ra又はFa)を特定する。上式(10)〜(12)で説明したように、位相差検出部82は、その特定した領域における撮像画像I(x)の画素値と比較画像IL(x)の画素値との大小関係に基づいて、撮像光学系から見て被写体よりも近い位置にフォーカスが合った状態である前ピント状態であるか、撮像光学系から見て被写体よりも遠い位置にフォーカスが合った状態である前ピント状態であるかを判定する。
In the present embodiment, as described with reference to FIG. 12A and the like, the phase
このようにすれば、撮像画像I(x)の画素値と比較画像IL(x)の画素値とを比較することにより、撮像光学系の合焦方向を判定できる。また、図12(A)等で説明したように、撮像画像I(x)の画素値が増加する領域Raと減少する領域Faでは、撮像画像I(x)の画素値と比較画像IL(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バンドの画像のうち、右瞳に対応するバンドの画像から右瞳画像IRを生成し、左瞳に対応するバンドの画像から左瞳画像ILを生成する。なお、第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
撮像部10は、撮像素子と撮像処理部を含むことができる。撮像素子は、例えばRGB3原色の撮像素子であり、結像レンズLNS及び光学フィルタFLTによって結像された被写体を撮像する。撮像処理部は、撮像動作の制御や、アナログの画素信号をA/D変換する処理、ベイヤ画像に対するデモザイキング処理などを行う。
The
分光特性記憶部50は、撮像素子がもつカラーフィルタの分光特性のデータを記憶しており、そのデータをマルチバンド推定部70に出力する。ここで、撮像されるRGB成分は、厳密にはカラーフィルタのみならず撮像素子の分光感度特性や、結像レンズLNSの分光特性によって決まるものである。即ち、分光特性記憶部50は、撮像素子や結像レンズLNSの分光特性を含んだ分光特性のデータを記憶する。
The spectral
マルチバンド推定部70は、撮像画像と分光特性のデータとに基づいてマルチバンド推定処理を行う。具体的には、図13に示すように、撮像センサのカラーフィルタがもつ波長域を5バンド{rL,rR,g,bL,bR}に分割する。光学フィルタFLTの右瞳は帯域{rR,g,bR}を透過し、左瞳は帯域{rL,g,bL}を透過する。マルチバンド推定部70は、撮像画像I(x)のRGB画素値から5バンド{rL,rR,g,bL,bR}の画素値を推定する。
The
位相差画像生成部20は、5バンド{rL,rR,g,bL,bR}の画素値から、右瞳画像IR={rR,g,bR}と左瞳画像IL={rL,g,bL}を生成する。この2画像を位相差画像とする。
The phase difference
位相差検出部82は、位相差画像IR、ILの同色成分{rR,rL}(即ち、IR、ILのR画素値)に対して、上述の位相差検出手法を適用し、位相差を検出する。なお、位相差画像IR、ILの同色成分として{bR,bL}(即ち、IR、ILのB画素値)を用いてもよい。また位相差検出部82は、第2実施形態で説明した合焦方向判定を行い、相関演算における位相差画像IR、ILのシフト方向を決定してもよい。なお本実施形態ではこれに限定されず、相関演算において位相差画像IR、ILをシフトさせる方向を、探索的に決定してもよい。
The phase
このようにして、シフト量δ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のデフォーカス量を算出し、そのデフォーカス量と位相差画像IR、ILのずれ方向の情報に基づいてフォーカス制御量(結像レンズLNSの移動量と移動方向)を算出する。フォーカスレンズ駆動制御部86は、結像レンズLNSの移動量及び移動方向に基づいてフォーカスレンズを移動させる制御を行う。
The
表示画像生成部30は、5バンド{rL,rR,g,bL,bR}の画素値から表示用のRGB画像を生成する。例えば{rR,g,bR}の画素値をRGB画像とする。モニタ表示部40は、表示画像生成部30が生成した画像を表示する。
The display
出力部25は、位相差画像生成部20が生成した位相差画像IR、ILや、位相差検出部82が検出した位相差の情報や合焦方向の情報を、出力する処理を行う。出力処理としては、例えば外部記憶装置への保存や、外部モニタへの表示、外部情報処理装置への出力などが想定される。外部情報処理装置では、例えば、位相差の情報や合焦方向の情報に基づいて被写体の3次元情報を求める。また、出力部25がその3次元情報を求めてモニタ表示部40に表示させてもよい。
The
データ圧縮部90は、撮像部10からのRGB画像を圧縮する処理を行う。データ記録部100は、圧縮されたRGB画像データと、カラーフィルタの分光特性データとを記録する。これらの記録データは、撮影後の事後処理においてマルチバンド推定処理や位相差検出処理に用いることが可能である。なお、この事後処理は、撮像装置と別体に構成された情報処理装置で行ってもよい。
The
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バンドの成分bR、bL、g、rR、rLは、撮像系の分光特性に応じて定まる成分である。図14には、撮像系の分光特性として、撮像センサのカラーフィルタの透過率特性FR、FG、FBを示すが、厳密には、撮像系の分光特性は、例えばカラーフィルタを除いた撮像センサがもつ分光特性や、光学系のもつ分光特性等も含んでいる。以下では説明を簡単にするため、撮像センサ等の分光特性が、図14に示すカラーフィルタの透過率特性FR、FG、FBに含まれるものとする。 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に示すように、青色フィルタの透過率特性FBと緑色フィルタの透過率特性FGとの重なり部分に対応するバンドの成分がbLであり、青色フィルタの透過率特性FBの非重なり部分に対応するバンドの成分がbRである。また、赤色フィルタの透過率特性FRと緑色フィルタの透過率特性FGとの重なり部分に対応するバンドの成分がrRであり、赤色フィルタの透過率特性FRの非重なり部分に対応するバンドの成分がrLである。また、緑色フィルタの透過率特性FGの非重なり部分に対応するバンドの成分が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は、透過率特性FR、FG、FBの形状や重なり具合などに応じて決定すればよく、透過率特性の帯域や重なり部分の帯域そのものである必要はない。例えば、透過率特性FG、FBの重なり部分の帯域は、およそ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には、透過波長域fRとしてバンド{bR,g,rR}を割り当て、左瞳フィルタFL2には、透過波長域fLとしてバンド{bL,g,rL}を割り当てる。図14に示すように、右瞳を通過した波長分割光{bR,g,rR}と、左瞳を通過した波長分割光{bL,g,rL}は、波長帯域が明確に分離されている。一方、撮像素子のカラーフィルタの分光特性{FR,FG,FB}は、隣接する分光特性の波長帯域が重複した特性となっている。この重複状態を考慮すると、デモザイキング処理後の各画素における赤色、緑色、青色の画素値R、G、Bを、下式(13)のようにモデル化することができる。
R=gR+rR R+rL R,
G=bL G+gG+rR G,
B=bR B+bL B+gB (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)に示すように、成分{bR B,bL B,gB}は、分光特性FBの青色フィルタを通過した波長分割光{bR,bL,g}に対応する。図15(D)に示すように、成分{bL G,gG,rR G}は、分光特性FGの緑色フィルタを通過した波長分割光{bL,g,rR}に対応する。また、図17(D)に示すように、成分{gR,rR R,rL R}は、分光特性FRの赤色フィルタを通過した波長分割光{g,rR,rL}に対応する。各成分を表す符号の上付きサフィックスは、右瞳「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.{bR,bL,(g+rR)}の推定処理
次に、図15(A)〜図16を用いて、画素値{R,G,B}から成分{bR B,bL B,gB}、{bL G,gG,rR G}、{gR,rR R,rL 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}で重複している波長帯域{bL,g}を、画素値{B,G}の差分に基づいて取り除き、成分bRと成分[g+rR]の関係を求めることにより成分{bR,bL,(g+rR)}の関係式を導き出す処理を行う。 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)に示すように、波長帯域bLに対応するのは画素値Bの成分bL B及び画素値Gの成分bL Gであるが、成分bL B、bL Gには、分光特性FB、FGの相対ゲインが乗じられていることである。そのため、成分bL B、bL Gは、相対ゲインの分だけ異なる値であり、成分bL B、bL Gが等しくなるように補正する必要がある。 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」)として、(bL B+gB)の成分比をkB1とし、bL Gの成分比をkB2とすると、下式(14)が成り立つ。ここで、kB1/kB2は、例えば帯域bLにおける分光特性FB、FGのゲイン比である。
bL B+gB=(kB1/kB2)×bL G (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)
帯域bL、gにおける分光特性FBのゲインを考慮すると、成分gBは成分bL Bよりも十分小さいと考えられるため、成分bL B、bL Gを等しくするためには、成分(bL B+gB)と成分bL Gがほぼ等しくなればよい。成分(bL B+gB)を補正した値を(bL B’+gB’)とすると、上式(14)を用いて下式(15)に示す補正を行えばよい。
bL B’+gB’≒bL G=(kB2/kB1)×(bL B+gB) (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)
成分(bL B+gB)は画素値Bに含まれるため、成分(bL B+gB)を補正するためには、結局、画素値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’の成分{bR B’,bL B’,gB’}は下式(17)となる。
bR B’=(kB2/kB1)×bR B,
bL B’+gB’≒bL G (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を成分{bR B’,bL G,gG,rR G}を用いて表すと、下式(18)のようになる。
B’=bR B’+(bL B’+gB’)=bR B’+bL G,
G =bL G+(gG+rR G) (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の差分を取ることにより、重複した成分bLを取り除く。また上式(18)より下式(20)が成り立つ。
B’−G=[bR B’+bL G]−[bL G+gG+rR G]
=bR B’−(gG+rR G) (19)
bL G=B’−bR 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)
bR B’を未知数(支配変数)とすると、上式(19)、(20)より{bR B’,bL G,(gG+rR G)}の関係式を下式(21)のように求められる。
bR B’=未知数(支配変数)
bL G=B’−bR B’
gG+rR G=bR 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)に基づき未知数bR B’が決まれば、{bR B’,bL G,(gG+rR G)}が全て決まることになる。即ち、{bR B’,bL G,(gG+rR G)}の尤度パターンを特定することができる。 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に示すように、未知数bR B’として、{bR B’,bL G,(gG+rR G)}と{B’/2,G/2}の誤差が最小になる値を求める。即ち、下式(22)に示す誤差の評価値EBGが最小になる場合のbR B’を求め、求めたbR B’を上式(21)に代入することにより、{bR B’,bL G,(gG+rR G)}の値を決定する。
eB=(B’/2−bR B’)2+(B’/2−bL G)2,
eG=(G/2−bL G)2+(G/2−(gG+rR G))2,
EBG=eB+eG (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}から成分{bR B’,bL G,(gG+rR G)}を推定することができる。 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.
なお、上記では{bR B’,bL G,(gG+rR G)}と{B’/2,G/2}の誤差が最小となる場合のbR B’を求めたが、本実施形態では、{bR B’,bL G,(gG+rR G)}と{αBB’,αGbG}の誤差が最小となる場合のbR B’を求めてもよい。ここで、αB、αGbは、下式(23)を満たす値である。αBは、B’に対する{bR B’,bL G}の平均的な値を算出するためのものであり、αGbは、Gに対する{bL G,(gG+rR G)}の平均的な値を算出するためのものである。これらは、図13に示すような撮像素子のカラーフィルタ特性から{bR B’,bL G}及び{bL G,(gG+rR G)}の成分比を考慮して決定すればよい。
0<αB≦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.{(bL+g),rR,rL}の推定処理
次に、画素値{G,R}から成分{(bL+g),rR,rL}を推定する処理について説明する。
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,rR}を、画素値{G,R}の差分に基づいて取り除き、成分[bL+g]と成分rLの関係を求めることにより成分{(bL+g),rR,rL}の関係式を導き出す処理を行う。 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)に示すように、波長帯域rRに対応するのは画素値Gの成分rR G及び画素値Rの成分rR Rであるが、成分rR G、rR Rには、分光特性FG、FRの相対ゲインが乗じられている。そのため、成分rR G、rR Rは、相対ゲインの分だけ異なる値であり、成分rR G、rR 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」)として、(gR+rR R)の成分比をkR1とし、rR Gの成分比をkR2とすると、下式(24)が成り立つ。kR1/kR2は、例えば帯域rRにおける分光特性FG、FRのゲイン比である。
gR+rR R=(kR2/kR1)×rR G (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、rRにおける分光特性FRのゲインを考慮すると、成分gRは成分rR Rよりも十分小さいと考えられるため、成分rR G、rR Rを等しくするためには、成分(gR+rR R)と成分rR Gがほぼ等しくなればよい。成分(gR+rR R)を補正した値を(gR’+rR R’)とすると、上式(24)を用いて下式(25)に示す補正を行えばよい。
gR’+rR R’≒rR G=(kR2/kR1)×(gR+rR 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)
成分(gR+rR R)は画素値Rに含まれるため、成分(gR+rR 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’の成分{gR’,rR R’,rL R’}は下式(27)となる。
gR’+rR R’≒rR G,
rL R’=(kR2/kR1)×rL 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’を成分{bL G,gG,rR G,rL R’}を用いて表すと、下式(28)のようになる。
G =bL G+(gG+rR G),
R’=(gR’+rR R’)+rL R’=rR G+rL 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’の差分を取ることにより、重複した成分rRを取り除く。また上式(28)より下式(30)が成り立つ。
G−R’=[bL G+gG+rR G)]−[rR G+rL R’]
=(bL G+gG)−rL R’ (29)
rR G=R’−rL 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)
rL R’を未知数(支配変数)とすると、上式(29)、(30)より{rL R’,rR G,(bL G+gG)}の関係式を下式(31)のように求められる。
rL R’=未知数(支配変数),
rR G=R’−rL R’,
bL G+gG=rL 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)に基づき未知数rL R’が決まれば、{rL R’,rR G,(bL G+gG)}が全て決まることになる。即ち、{rL R’,rR G,(bL G+gG)}の尤度パターンを特定することができる。 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に示すように、未知数rL R’として、{rL R’,rR G,(bL G+gG)}と{G/2,R’/2}の誤差が最小になる値を未知数rL R’として求める。即ち、下式(32)に示す誤差の評価値EGRが最小になる場合のrL R’を求め、求めたrL R’を上式(31)に代入することにより、{rL R’,rR G,(bL G+gG)}の値を決定する。
eG=(G/2−(bL G+gG))2+(G/2−rR G)2,
eG=(R’/2−rR G)2+(R’/2−(rL R’))2,
EGR=eG+eR (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’}から成分{rL R’,rR G,(bL G+gG)}を推定することができる。 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.
なお、上記では{rL R’,rR G,(bL G+gG)}と{G/2,R’/2}の誤差が最小となる場合のrL R’を求めたが、本実施形態では、{rL R’,rR G,(bL G+gG)}と{αGrG,αRR’}の誤差が最小となる場合のrL R’を求めてもよい。ここで、αR、αGrは、下式(33)を満たす値である。αRは、R’に対する{rL R’,rR G}の平均的な値を算出するためのものであり、αGrは、Gに対する{rR G,(bL G+gG)}の平均的な値を算出するためのものである。これらは、図14に示すような撮像素子のカラーフィルタ特性から{rL R’,rR G}及び{rR G,(bL G+gG)}の成分比を考慮して決定すればよい。
0<αR≦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.成分値の算出処理、右瞳画像と左瞳画像の取得処理
次に、上記で求めた値{bR B’,bL G,(gG+rR G)}、{rL R’,rR G,(bL G+gG)}を用いて、画素値Bを構成する成分{bR B,bL B}の値と、画素値Gを構成する成分{bL G,gG,rR G}の値と、画素値Rを構成する成分{rR R,rL 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}.
bR B,rL Rは、上式(17)、(27)より、下式(34)のように求められる。
bR B=(kB1/kB2)×bR B’,
rL R=(kR1/kR2)×rL 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)
bL B,rR Rは、gB≪bR B,gR≪rL Rであること及び上式(13)より、下式(35)のように求められる。
bL B=B−(bR B+gB)≒B−bR B,
rR R=R−(rL R+gR)≒R−rL 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)
bL G,rR Gは、上式(13)より、下式(36)のように求められる。
bL G=G−(gG+rR G),
rR G=G−(gG+bL G) (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)
gGは、上式(13)、(36)より、下式(37)のように求められる。
gG=G−(bL G+rR G) (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)
右瞳画像IRと左瞳画像ILのR、G、B成分は、上記で求めた成分から下式(38)のように分離する。
IR=(rR R,rR G,bR B),IL=(rL R,bL G,bL 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透過率特性FBを有する第1色(例えば青色)フィルタと、第2透過率特性FGを有する第2色(緑色)フィルタと、第3透過率特性FRを有する第3色(赤色)フィルタとを含む。マルチバンド推定部70は、第1〜第3透過率特性{FB,FG,FR}の重なり部分及び非重なり部分に対応する第1〜第5バンドBD1〜BD5を設定し、撮像画像を構成する第1〜第3色の画素値{R,G,B}に基づいて第1〜第5バンドの成分値{bR,bL,g,rR,rL}を推定する。位相差画像生成部20は、第1〜第5バンドBD1〜BD5のうち第1瞳の透過波長帯域に対応するバンドの成分値を第1画像(右瞳画像)IR=(rR R,rR G,bR B)として取得し、第1〜第5バンドのうち第2瞳の透過波長帯域に対応するバンドの成分値を第2画像(左瞳画像)IL=(rL R,bL G,bL 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
このようにすれば、第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透過率特性FBの非重なり部分に対応する第1バンドBD1と、第1透過率特性FBと第2透過率特性FGとの重なり部分に対応する第2バンドBD2と、第2透過率特性FGの非重なり部分に対応する第3バンドBD3と、第2透過率特性FGと第3透過率特性FRとの重なり部分に対応する第4バンドBD4と、第3透過率特性FRの非重なり部分に対応する第5バンドBD5とを設定する。
In this embodiment also, as described in FIG. 14, the
ここで、透過率特性の重なり部分とは、図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のバンド成分値{bR,bL,g,rR,rL}を推定することが可能となる。即ち、上式(13)で説明したように、透過率特性が隣り合う画素値(例えばB、G)には重なり部分の成分値(bL)が含まれる。この重なり部分の成分値(bL)を、上式(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 データ記録部、
AL,BL,AR(d),BR(d) 係数、
BD1〜BD5 第1〜第5バンド、C(δj) 相関値、
Cmax 相関値の最大値、Df,Dr デフォーカス位置、
FB,FG,FR 透過率特性、FL1 右瞳フィルタ、
FL2 左瞳フィルタ、FLT 光学フィルタ、FP フォーカス位置、
Fa 減少区間、G 画素値、I(x) 撮像画像、
IL(x) 左瞳画像、IR(x) 右瞳画像、LNS 結像レンズ、
Ra 増加区間、Wj 相関幅、
bR,bL,g,rR,rL 第1〜第5バンドの成分値、
d シフト量、fL,fR 透過率特性、x 位置、Δθ 偏角差分、
Δθmin 偏角差分の最小値、δj シフト量
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被写体像に対応する第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.
前記位相差検出部は、
前記シフト量を順次大きくするとともに前記相関幅を順次広くしながら前記相関演算を繰り返し行って相関値を求め、前記相関値が最大値となるときの前記シフト量を前記位相差として検出することを特徴とする撮像装置。 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.
前記位相差検出部は、
前記シフト量を順次大きくしながら前記相関値を求めたときに、前記相関値の最初のピーク値に対応する前記シフト量を前記位相差として検出することを特徴とする撮像装置。 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.
前記位相差検出部は、
前記最初のピーク値を検出したと判断した場合に、前記最初のピーク値を検出したと判断したときの前記シフト量よりも大きい前記シフト量について前記相関値を求めずに前記相関演算を終了することを特徴とする撮像装置。 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.
前記位相差検出部は、
前記位相差を検出したときの前記相関幅に対応した角周波数を設定し、前記角周波数における画素値のフーリエ係数を前記第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画像及び前記第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瞳と、前記第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被写体像に対応する第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.
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)
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 |
-
2012
- 2012-08-13 JP JP2012179321A patent/JP2014038151A/en active Pending
Cited By (7)
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 |