JP6415139B2 - Focus detection apparatus, imaging apparatus, focus detection method, and focus detection program - Google Patents

Focus detection apparatus, imaging apparatus, focus detection method, and focus detection program Download PDF

Info

Publication number
JP6415139B2
JP6415139B2 JP2014136466A JP2014136466A JP6415139B2 JP 6415139 B2 JP6415139 B2 JP 6415139B2 JP 2014136466 A JP2014136466 A JP 2014136466A JP 2014136466 A JP2014136466 A JP 2014136466A JP 6415139 B2 JP6415139 B2 JP 6415139B2
Authority
JP
Japan
Prior art keywords
focus detection
color
defocus amount
pair
light
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.)
Expired - Fee Related
Application number
JP2014136466A
Other languages
Japanese (ja)
Other versions
JP2016014753A (en
Inventor
洋平 堀川
洋平 堀川
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP2014136466A priority Critical patent/JP6415139B2/en
Publication of JP2016014753A publication Critical patent/JP2016014753A/en
Application granted granted Critical
Publication of JP6415139B2 publication Critical patent/JP6415139B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Studio Devices (AREA)
  • Focusing (AREA)
  • Automatic Focus Adjustment (AREA)

Description

本発明は、デジタルビデオカメラやデジタルスチルカメラ等の撮像装置に用いられる焦点検出装置に関し、特に位相差検出方式による焦点検出を行う装置に関する。   The present invention relates to a focus detection apparatus used in an imaging apparatus such as a digital video camera or a digital still camera, and more particularly to an apparatus that performs focus detection by a phase difference detection method.

位相差検出方式による焦点検出では、撮像光学系の射出瞳のうち互いに異なる領域(以下、瞳領域という)からの光束により形成される一対の被写体像を光電変換して得られる一対の像信号の位相差を算出し、該位相差から撮像光学系のデフォーカス量を算出する。射出瞳からの光束を互いに異なる瞳領域からの光束(一対の被写体像)に分割して光電変換することを、瞳分割という。   In focus detection by the phase difference detection method, a pair of image signals obtained by photoelectrically converting a pair of subject images formed by light beams from different areas (hereinafter referred to as pupil areas) of the exit pupil of the imaging optical system. A phase difference is calculated, and a defocus amount of the imaging optical system is calculated from the phase difference. Dividing the luminous flux from the exit pupil into luminous fluxes (a pair of subject images) from different pupil regions and performing photoelectric conversion is called pupil division.

このような瞳分割を行う位相差検出方式による焦点検出装置としては、例えば特許文献1にて開示されたものがある。この焦点検出装置では、受光素子(撮像素子)の焦点検出画素ごとにマイクロレンズ(以下、MLいう)を設け、1つの焦点検出画素内にマイクロレンズの光軸に対してそれぞれ偏心した一対の光電変換部(以下、PDという)を設けることで、瞳分割を可能としている。   As a focus detection device based on a phase difference detection method for performing such pupil division, for example, there is one disclosed in Patent Document 1. In this focus detection device, a microlens (hereinafter referred to as ML) is provided for each focus detection pixel of a light receiving element (imaging element), and a pair of photoelectric sensors each decentered with respect to the optical axis of the microlens in one focus detection pixel. By providing a conversion unit (hereinafter referred to as PD), pupil division is possible.

ただし、従来の位相差検出方式では、表面に光沢のある被写体を撮像する際に、その表面にて反射した光のうち鏡面反射光の成分(以下、鏡面反射成分という)が焦点検出装置に入射することで、正確な焦点検出ができない場合がある。この問題に対して、特許文献2には、偏光フィルタにより鏡面反射成分を低減させた光束を用いた焦点検出を行うことで、鏡面反射成分による影響を受けにくい焦点検出装置が開示されている。   However, in the conventional phase difference detection method, when a glossy subject is imaged on the surface, the component of the specular reflection light (hereinafter referred to as the specular reflection component) of the light reflected on the surface enters the focus detection device. As a result, accurate focus detection may not be possible. With respect to this problem, Patent Document 2 discloses a focus detection device that is less affected by the specular reflection component by performing focus detection using a light beam whose specular reflection component is reduced by a polarizing filter.

また、特許文献3には、撮像により得られた画像の画素値のうち平均より明るい画素値とこれより暗い画素値との差分の積分結果を鏡面反射成分とみなして光源色を推定し、該光源色を白色に近づけるようにホワイトバランスゲインを求める方法が開示されている。   Further, Patent Document 3 estimates a light source color by regarding an integration result of a difference between a pixel value brighter than the average and a pixel value darker than the average pixel value of an image obtained by imaging as a specular reflection component, A method for obtaining a white balance gain so that the light source color is close to white is disclosed.

特開2007−133087号公報JP 2007-133087 A 特開2012−247356号公報JP 2012-247356 A 特開第2007−013415号公報JP 2007-013415 A

しかしながら、特許文献2にて開示された焦点検出装置では、鏡面反射成分を低減させるために偏光フィルタという特別な光学素子を用意する必要がある。また、特許文献3にて開示された方法では、得られた差分値の積分結果を鏡面反射成分(光源色)として推定するに過ぎず、鏡面反射成分が存在する位置を特定するものではない。   However, in the focus detection device disclosed in Patent Document 2, it is necessary to prepare a special optical element called a polarization filter in order to reduce the specular reflection component. Further, the method disclosed in Patent Document 3 merely estimates the integration result of the obtained difference values as a specular reflection component (light source color), and does not specify the position where the specular reflection component exists.

本発明は、特別な光学素子を用いることなく、鏡面反射成分の影響を低減した高精度の焦点検出を行えるようにした焦点検出装置およびこれを備えた撮像装置、さらには焦点検出方法を提供する。   The present invention provides a focus detection apparatus, an imaging apparatus including the focus detection apparatus, and a focus detection method capable of performing high-precision focus detection with reduced influence of a specular reflection component without using a special optical element. .

本発明の一側面としての焦点検出装置は、物体からの光のうち光学系の射出瞳における互いに異なる領域を通過した光束により形成された一対の物体像を光電変換する光電変換素子からの出力を用いて生成された一対の像信号に対する相関演算を行ってデフォーカス量を算出する演算手段と、物体を撮像して得られた信号を用いて物体を照らす光源の色に関する情報を取得する光源色取得手段と、を有し、演算手段は、光源の色に関する情報が示す色と一対の像信号における差分が示す色とを比較した結果から、該差分の物体からの鏡面反射光成分を判定し、該判定結果基づいてデフォーカス量を算出することを特徴とする。 A focus detection apparatus according to one aspect of the present invention outputs an output from a photoelectric conversion element that photoelectrically converts a pair of object images formed by light beams that have passed through different regions of an exit pupil of an optical system, out of light from an object. A light source color that obtains information about the color of a light source that illuminates an object using a signal obtained by imaging the object using a calculation unit that calculates a defocus amount by performing a correlation operation on a pair of generated image signals comprising an acquisition unit, a calculation means, from the result of comparing the color indicated by the difference in color and a pair image signal indicating information about the color of the light source, determining a specular reflection light component from the object of said difference The defocus amount is calculated based on the determination result .

また、本発明の他の一側面としての焦点検出装置は、物体からの光のうち光学系の射出瞳における互いに異なる領域を通過した光束により形成された一対の物体像をそれぞれ光電変換する複数の光電変換素子からの出力を用いて生成された一対の像信号に対する相関演算を行って複数の相関評価値を生成し、該相関評価値を用いて光学系のデフォーカス量を算出する演算手段と、物体を撮像して得られた信号を用いて物体を照らす光源の色に関する情報を取得する光源色取得手段と、を有し、演算手段は、光源の色に関する情報と一対の像信号とを用いて、物体からの鏡面反射光による出力に対応する相関評価値の重みを下げてデフォーカス量を算出することを特徴とするIn addition, a focus detection apparatus according to another aspect of the present invention includes a plurality of object images that photoelectrically convert a pair of object images formed by light beams that have passed through different regions in an exit pupil of an optical system, out of light from an object. Calculating means for performing a correlation operation on a pair of image signals generated using an output from the photoelectric conversion element to generate a plurality of correlation evaluation values, and calculating a defocus amount of the optical system using the correlation evaluation values; A light source color acquisition means for acquiring information relating to the color of the light source that illuminates the object using a signal obtained by imaging the object, and the computing means includes information relating to the color of the light source and a pair of image signals. And the defocus amount is calculated by reducing the weight of the correlation evaluation value corresponding to the output by the specular reflection light from the object .

なお、上記焦点検出装置を有する撮像装置も、本発明の他の一側面を構成する。   An imaging device having the focus detection device also constitutes another aspect of the present invention.

また、本発明の他の一側面としての焦点検出方法は、物体からの光のうち光学系の射出瞳における互いに異なる領域を通過した光束により形成された一対の物体像を光電変換する光電変換素子からの出力を用いてデフォーカス量を算出し、物体を撮像して得られた信号を用いて物体を照らす光源の色に関する情報を取得し、デフォーカス量の算出では、光源の色に関する情報が示す色と一対の像信号における差分が示す色とを比較した結果から、該差分の物体からの鏡面反射光成分を判定し、該判定結果基づいてデフォーカス量を算出させることを特徴とする。 The focus detection method according to another aspect of the present invention includes a photoelectric conversion element that photoelectrically converts a pair of object images formed by light beams that have passed through different regions in an exit pupil of an optical system among light from an object. using the output from the calculating a defocus amount, to obtain information about the color of the light source illuminating the object with a signal obtained by imaging an object, in the calculation of the defocus amount, information regarding the color of the light source from the results of comparing the color indicated by the difference in color and a pair image signal indicating determines specular reflection light component from the object of said difference, and characterized in that to calculate a defocus amount based on the determination result To do.

また、本発明の他の一側面としての焦点検出方法は、物体からの光のうち光学系の射出瞳における互いに異なる領域を通過した光束により形成された一対の物体像をそれぞれ光電変換する複数の光電変換素子からの出力を用いて生成された一対の像信号に対する相関演算を行って複数の相関評価値を生成し、該相関評価値を用いて光学系のデフォーカス量を算出し、物体を撮像して得られた信号を用いて物体を照らす光源の色に関する情報を取得し、デフォーカス量の算出では、光源の色に関する情報と一対の像信号とを用いて、物体からの鏡面反射光による出力に対応する相関評価値の重みを下げてデフォーカス量を算出することを特徴とする
In addition, a focus detection method according to another aspect of the present invention includes a plurality of object images photoelectrically converted from a pair of object images formed by light beams that have passed through different regions in an exit pupil of an optical system, out of light from an object. A correlation calculation is performed on a pair of image signals generated using the output from the photoelectric conversion element to generate a plurality of correlation evaluation values, and the defocus amount of the optical system is calculated using the correlation evaluation values, Information on the color of the light source that illuminates the object is obtained using the signal obtained by imaging, and in calculating the defocus amount, the specular reflected light from the object is obtained using the information on the color of the light source and a pair of image signals. The defocus amount is calculated by lowering the weight of the correlation evaluation value corresponding to the output of .

なお、上記焦点検出方法に相当する処理をコンピュータに実行させるコンピュータプログラムである焦点検出プログラムも、本発明の他の一側面を構成する。   A focus detection program that is a computer program that causes a computer to execute processing corresponding to the focus detection method also constitutes another aspect of the present invention.

本発明によれば、特別な光学素子を用いることなく、物体体からの鏡面反射光の影響を低減した高精度なデフォーカス量の算出を行うことができる。したがって、このデフォーカス量を用いることで高い合焦精度が得られ、高画質の撮影画像を得ることができる。   According to the present invention, it is possible to calculate a defocus amount with high accuracy while reducing the influence of specular reflection light from an object without using a special optical element. Therefore, by using this defocus amount, high focusing accuracy can be obtained, and a high-quality captured image can be obtained.

本発明の実施例1である撮像装置の構成を示すブロック図。1 is a block diagram illustrating a configuration of an imaging apparatus that is Embodiment 1 of the present invention. 実施例1にて用いられる撮像素子の単位画素セルの正面図。2 is a front view of a unit pixel cell of an image sensor used in Embodiment 1. FIG. 実施例1における分割PDの画素値を用いた焦点検出の原理を示す図。FIG. 4 is a diagram illustrating a principle of focus detection using pixel values of divided PDs according to the first embodiment. 実施例1において鏡面反射光を相関演算の差分から得る原理を示す図。FIG. 3 is a diagram illustrating a principle of obtaining specular reflection light from a difference of correlation calculation in the first embodiment. 実施例1における画素ブロックの分割例を示す図。FIG. 3 is a diagram illustrating an example of pixel block division in the first embodiment. 実施例1におけるSAD値の例を示す図。FIG. 6 is a diagram illustrating an example of SAD values in the first embodiment. 実施例1にて用いられる撮像素子を示す正面図。FIG. 2 is a front view showing an image sensor used in Embodiment 1. 実施例1におけるA,B像信号とこれらの差分を示す図。FIG. 3 is a diagram illustrating A and B image signals and differences between them in the first embodiment. 実施例1における焦点検出処理を示すフローチャート。3 is a flowchart illustrating focus detection processing according to the first embodiment. 本発明の実施例2である撮像装置の構成を示すブロック図。FIG. 3 is a block diagram illustrating a configuration of an imaging apparatus that is Embodiment 2 of the present invention. 実施例2における焦点検出領域の選択例を示す図。FIG. 10 is a diagram illustrating an example of selecting a focus detection area in the second embodiment. 実施例2における焦点検出処理を示すフローチャート。10 is a flowchart illustrating focus detection processing according to the second embodiment.

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

図1には、本発明の実施例1である、デジタルビデオカメラやデジタルスチルカメラ等撮像装置100の構成を示す。光学ユニット101は、焦点調節を行うためのフォーカスレンズを含む複数のレンズ、シャッタおよび絞りにより構成される撮像光学系と、該撮像光学系の動作を制御するレンズ制御部とを有する。駆動制御部112は、後述する焦点検出部108からの出力に応じて光学ユニット101に含まれるフォーカスレンズの駆動(オートフォーカス:AF)を制御する信号を出力する。   FIG. 1 shows a configuration of an imaging apparatus 100 such as a digital video camera or a digital still camera, which is Embodiment 1 of the present invention. The optical unit 101 includes an imaging optical system including a plurality of lenses including a focus lens for performing focus adjustment, a shutter, and a diaphragm, and a lens control unit that controls the operation of the imaging optical system. The drive control unit 112 outputs a signal for controlling driving of a focus lens (autofocus: AF) included in the optical unit 101 in accordance with an output from a focus detection unit 108 described later.

光電変換素子としての撮像素子102は、単位画素セルが2次元マトリクス状に配列されたCMOSセンサにより構成されている。光学ユニット101に含まれるシャッタによって撮像素子102の露光量が制御される。撮像光学系は、被写体(物体)からの光束に被写体像(物体像)を形成させる。この被写体像は撮像素子102により光電変換され、光電変換によって各単位画素セル内に構成された後述する一対の光電変換部に蓄積された電荷がアナログ信号としてA/D変換部103に出力される。   The image sensor 102 as a photoelectric conversion element is configured by a CMOS sensor in which unit pixel cells are arranged in a two-dimensional matrix. The exposure amount of the image sensor 102 is controlled by a shutter included in the optical unit 101. The imaging optical system forms a subject image (object image) on a light beam from the subject (object). This subject image is photoelectrically converted by the image sensor 102, and the electric charge accumulated in a pair of photoelectric conversion units (described later) configured in each unit pixel cell by the photoelectric conversion is output to the A / D conversion unit 103 as an analog signal. .

図2には、撮像素子102における1つの単位画素セル1を示している。単位画素セル1は、1つのマイクロレンズ(以下、MLという)2と、このML2の光軸に対してそれぞれ反対側に偏心配置された一対の光電変換部(以下、分割PDという)1a,1bとを有する。分割PD1a,1bは、共通のML2を通して撮像光学系の射出瞳における互いに異なる瞳領域を通過した光束を受光することで瞳分割を行う。言い換えれば、分割PD1a,1bは、ML2を介して視差をもって被写体を見る画素として機能する。撮像素子102には、このような単位画素セルが図7に示すように複数配列されている。   FIG. 2 shows one unit pixel cell 1 in the image sensor 102. The unit pixel cell 1 includes one microlens (hereinafter referred to as ML) 2 and a pair of photoelectric conversion units (hereinafter referred to as divided PDs) 1a and 1b that are eccentrically arranged on the opposite sides with respect to the optical axis of ML2. And have. The division PDs 1a and 1b perform pupil division by receiving light beams that have passed through different pupil regions in the exit pupil of the imaging optical system through the common ML2. In other words, the divided PDs 1a and 1b function as pixels that view the subject with parallax via ML2. In the image sensor 102, a plurality of such unit pixel cells are arranged as shown in FIG.

撮像素子102上の複数の単位画素セルは、ベイヤー配列された赤(R)、緑(G)および青(B)用のカラーフィルター付き単位画素セルをそれぞれ複数含んでいる。ベイヤー配列では、水平2個×垂直2個の単位画素セルのうち一方の対角位置に2つのG用単位画素セルが配置され、他方の対角位置に1つずつR用およびB用の単位画素セルが配置されている。   The plurality of unit pixel cells on the image sensor 102 includes a plurality of unit pixel cells with color filters for red (R), green (G), and blue (B) arranged in a Bayer array. In the Bayer array, two G unit pixel cells are arranged at one diagonal position among two horizontal × vertical unit pixel cells, and one unit for R and one at the other diagonal position. Pixel cells are arranged.

複数(RGB)の単位画素セル1における分割PD1aは位相差検出方式による焦点検出用の一対の被写体像のうちA像を光電変換するA像用画素群として用いられ、分割PD1bは一対の被写体像のうちB像を光電変換するB像用画素群として用いられる。このように撮像素子に設けられたA像用およびB像用画素群を用いて位相差検出方式の焦点検出を行うAFを、撮像面位相差AFという。   The divided PD 1a in the plural (RGB) unit pixel cells 1 is used as an A image pixel group that photoelectrically converts the A image among the pair of subject images for focus detection by the phase difference detection method, and the divided PD 1b is a pair of subject images. Are used as a group of B image pixels for photoelectrically converting the B image. The AF that performs focus detection by the phase difference detection method using the A-image and B-image pixel groups provided in the image sensor in this manner is referred to as an imaging surface phase difference AF.

なお、本実施例では、焦点検出用の光電変換素子として後述するように撮影画像の取得も可能な撮像素子102を用いるが、このような撮像素子とは別に設けられた焦点検出専用の光電変換素子(AFセンサ等)を用いてもよい。   In this embodiment, as described later, an image sensor 102 capable of acquiring a captured image is used as a focus detection photoelectric conversion element. However, a photoelectric conversion dedicated to focus detection provided separately from such an image sensor. An element (such as an AF sensor) may be used.

A/D変換部103は、撮像素子102から出力されたアナログ信号をデジタル信号(画素信号)に変換してキャプチャー部104に出力する。A/D変換部103は、ノイズを低減するCDS回路やデジタル信号への変換前のアナログ信号を増幅する非線形増幅回路等を含む。   The A / D conversion unit 103 converts the analog signal output from the image sensor 102 into a digital signal (pixel signal) and outputs the digital signal to the capture unit 104. The A / D converter 103 includes a CDS circuit that reduces noise, a non-linear amplifier circuit that amplifies an analog signal before conversion into a digital signal, and the like.

キャプチャー部(撮像部)104は、A/D変換部103から出力されたRGBの色ごとのA像用画素群に対応する画素信号から該色ごとのA像信号を生成し、RGBの色ごとのB像用画素群に対応する画素信号から該色ごとのB像信号を生成する。キャプチャー部104は、これら色ごとのA像およびB像信号をWB算出補正部109と焦点検出部108に出力する。A像信号とB像信号は互いに視差を有する一対の視差画像ということもできる。以下の説明では、A像信号とB像信号をまとめて一対のAF像信号ともいう。   The capture unit (imaging unit) 104 generates an A image signal for each color from the pixel signals corresponding to the A image pixel group for each RGB color output from the A / D conversion unit 103, and for each RGB color A B image signal for each color is generated from pixel signals corresponding to the B image pixel group. The capture unit 104 outputs the A image and B image signals for each color to the WB calculation correction unit 109 and the focus detection unit 108. It can also be said that the A image signal and the B image signal are a pair of parallax images having parallax. In the following description, the A image signal and the B image signal are collectively referred to as a pair of AF image signals.

また、キャプチャー部104は、A/D変換部103から出力されたRGBのA像用およびB像用画素群からの画素信号の合成信号としての該色ごとの撮像画素信号を生成し、これら撮像画素信号をWB算出補正部109に出力する。RGBの撮像画素信号は、撮影画像(ライブビュー画像および記録用画像)を生成するために用いられる。なお、撮像画素信号も上記一対のAF像信号も、被写体を撮像(被写体像を光電変換)して得られた信号である。   In addition, the capture unit 104 generates an imaging pixel signal for each color as a composite signal of pixel signals from the RGB A image and B image pixel groups output from the A / D conversion unit 103, and The pixel signal is output to the WB calculation correction unit 109. The RGB imaging pixel signals are used to generate a captured image (live view image and recording image). The imaging pixel signal and the pair of AF image signals are signals obtained by imaging a subject (photographing the subject image).

光源色取得手段としてのWB算出補正部109は、RGBの撮像画素信号または一対のAF像信号のうち少なくとも一方から、後述するホワイトバランス評価値(以下、WB評価値という)を取得し、該WB評価値に基づいてホワイトバランスゲインを算出する。そして、WB評価値を焦点検出部108に出力する一方、ホワイトバランスゲインを用いた撮像画素信号の補正(以下、WB補正という)を行い、該WB補正後の撮像画素信号を同時化処理部110に出力する。   A WB calculation correction unit 109 serving as a light source color acquisition unit acquires a white balance evaluation value (hereinafter referred to as a WB evaluation value) to be described later from at least one of RGB imaging pixel signals or a pair of AF image signals. A white balance gain is calculated based on the evaluation value. Then, while outputting the WB evaluation value to the focus detection unit 108, the imaging pixel signal is corrected using the white balance gain (hereinafter referred to as WB correction), and the imaging pixel signal after the WB correction is synchronized processing unit 110. Output to.

ここで、WB評価値について説明する。WB評価値は、様々な光源下で白色を正確に白く撮像できるように用いられる値であり、撮像時の光源下での白色被写体の色味を表す値である。一般的には、白色と推定される被写体を含む撮像領域を検出し、該撮像領域でのR,G,Bの値を積分してWB評価値を算出する方法がある。また、特許文献3にて開示されているように撮像により得られた画像の画素値のうち平均より明るい画素値とこれより暗い画素値との差分の積分結果を鏡面反射成分とみなし、被写体を照らす光源の色を推定してWB評価値を算出する方法もある。このうち本実施例では特許文献3にて開示された後者の方法を用いるが、他の方法でWB評価値を算出してもよい。本実施例では、このWB評価値を後述する焦点検出部108にて分割設定される画素ブロックごとに算出する。   Here, the WB evaluation value will be described. The WB evaluation value is a value used so that white can be accurately captured under various light sources, and is a value representing the color of a white subject under the light source during imaging. In general, there is a method of calculating an WB evaluation value by detecting an imaging region including a subject estimated to be white and integrating R, G, and B values in the imaging region. Further, as disclosed in Patent Document 3, the integration result of the difference between the pixel value brighter than the average and the pixel value darker than the pixel value of the image obtained by imaging is regarded as a specular reflection component, and the subject is There is also a method for calculating the WB evaluation value by estimating the color of the illuminating light source. Among these, although the latter method disclosed in Patent Document 3 is used in the present embodiment, the WB evaluation value may be calculated by other methods. In the present embodiment, this WB evaluation value is calculated for each pixel block that is divided and set by the focus detection unit 108 described later.

焦点検出部108は、撮像光学系の焦点状態を示すデフォーカス量を検出(算出)する焦点検出処理を行う。具体的には、焦点検出部108は、キャプチャー部104から入力されたA像信号とB像信号に対してSAD(Sum of Absolute Difference)法等の相関演算を行って相関評価値を生成する。さらに、焦点検出部108は、相関評価値に対してWB算出補正部109から入力されたWB評価値を用いて、後述する補正を行う。なお、相関演算の方法は、SSD(Sum of Squared Difference)法等、他の方法であってもよい。そして、該補正後の相関評価値を用いて撮像光学系のデフォーカス量を算出し、その結果を駆動制御部112に出力する。WB算出補正部109および焦点検出部108により焦点検出装置が構成される。   The focus detection unit 108 performs focus detection processing for detecting (calculating) a defocus amount indicating the focus state of the imaging optical system. Specifically, the focus detection unit 108 performs a correlation operation such as a SAD (Sum of Absolute Difference) method on the A image signal and the B image signal input from the capture unit 104 to generate a correlation evaluation value. Furthermore, the focus detection unit 108 performs correction described later on the correlation evaluation value using the WB evaluation value input from the WB calculation correction unit 109. The correlation calculation method may be another method such as an SSD (Sum of Squared Difference) method. Then, the defocus amount of the imaging optical system is calculated using the corrected correlation evaluation value, and the result is output to the drive control unit 112. The WB calculation correction unit 109 and the focus detection unit 108 constitute a focus detection device.

同時化処理部110は、WB算出補正部109から入力されたWB補正後のRGBの撮像画素信号に対して同時化処理(デモザイキング)を行ってカラー撮影画像を生成する。そして、同時化処理部110は、カラー撮影画像のデータを、ノイズリダクションやJPEGに代表される画像圧縮を行った後に外部記録装置111に出力する。   The synchronization processing unit 110 performs a synchronization process (demosaicing) on the RGB pixel signal after WB correction input from the WB calculation correction unit 109 to generate a color photographed image. The synchronization processing unit 110 outputs the color photographed image data to the external recording device 111 after performing image reduction represented by noise reduction and JPEG.

外部記録装置111は、同時化処理部110から出力されたカラー撮影画像をSDカード等に代表されるメモリカードに記録する。   The external recording device 111 records the color photographed image output from the synchronization processing unit 110 on a memory card represented by an SD card or the like.

次に、焦点検出部108が行う焦点検出処理について、図9のフローチャートを併せ用いて詳しく説明する。図1に示すように、焦点検出部108は、相関演算部105と、相関蓄積バッファ106と、鏡面反射補正部107と、デフォーカス量算出部115とを含む。相関演算部105およびデフォーカス量算出部115は演算手段を構成し、鏡面反射補正部107は補正手段を構成する。焦点検出部108は、コンピュータとして、コンピュータプログラムである焦点検出プログラムに従って、図9に示すステップS11〜S17の焦点検出処理を行う。   Next, focus detection processing performed by the focus detection unit 108 will be described in detail with reference to the flowchart of FIG. As shown in FIG. 1, the focus detection unit 108 includes a correlation calculation unit 105, a correlation accumulation buffer 106, a specular reflection correction unit 107, and a defocus amount calculation unit 115. The correlation calculation unit 105 and the defocus amount calculation unit 115 constitute a calculation unit, and the specular reflection correction unit 107 constitutes a correction unit. As a computer, the focus detection unit 108 performs focus detection processing in steps S11 to S17 shown in FIG. 9 according to a focus detection program that is a computer program.

相関演算部105は、ステップS11において、図5に示すように、撮像素子102上の全画素を複数(ここでは例として64個)の画素ブロックに分割する。各画素ブロックは、複数の画素(単位画素セル)を含む。そして、相関演算部105は、ステップS12において、キャプチャー部104から得られた画素ブロックごとのA像信号とB像信号に対して、1画素ずつの画素ずらしを行いながら相関演算を行う。このとき、相関演算部105は、ステップS13において、1画素ずらしごとの相関演算結果を相関蓄積バッファ106に出力する。相関蓄積バッファ106は、これら1画素ずらし量ごとの相関評価値を記憶(蓄積)する。   In step S <b> 11, the correlation calculation unit 105 divides all pixels on the image sensor 102 into a plurality (64 in this example) of pixel blocks as shown in FIG. 5. Each pixel block includes a plurality of pixels (unit pixel cells). Then, in step S12, the correlation calculation unit 105 performs correlation calculation while shifting the pixels of the A image signal and B image signal for each pixel block obtained from the capture unit 104 by one pixel. At this time, the correlation calculation unit 105 outputs the correlation calculation result for each one-pixel shift to the correlation accumulation buffer 106 in step S13. The correlation accumulation buffer 106 stores (accumulates) the correlation evaluation value for each one-pixel shift amount.

図3を用いて、相関演算の内容および相関演算により得られる相関評価値と撮像光学系の焦点状態との関係について説明する。ここでは、相関演算を上述したSAD法で行う場合について説明し、SAD法で行う相関演算をSAD演算といい、SAD演算により得られた相関評価値をSAD評価値という。   The relationship between the content of the correlation calculation and the correlation evaluation value obtained by the correlation calculation and the focus state of the imaging optical system will be described with reference to FIG. Here, the case where the correlation calculation is performed by the above-described SAD method will be described. The correlation calculation performed by the SAD method is called an SAD calculation, and the correlation evaluation value obtained by the SAD calculation is called an SAD evaluation value.

図3には、撮像素子102のうち、それぞれ図2に示した一対の分割PD1a,1bを含む単位画素セルに相当する13個の単位画素セルP1〜P13を水平方向(垂直方向であってもよい)に一列に並べて示している。ここでは、これら13個の単位画素セルP1〜P13がRGBの色ごとに設けられているものとする。各単位画素セルは、撮像光学系の射出瞳に対する瞳分割を行う。   FIG. 3 shows 13 unit pixel cells P1 to P13 corresponding to the unit pixel cell including the pair of divided PDs 1a and 1b shown in FIG. It is shown in a line. Here, it is assumed that these 13 unit pixel cells P1 to P13 are provided for each color of RGB. Each unit pixel cell performs pupil division on the exit pupil of the imaging optical system.

前述したキャプチャー部104は、同色の単位画素セルP1〜P13の分割PD1a,1bからの出力を用いて同色のA像信号とB像信号を生成する。つまり、RのA像信号とB像信号、GのA像信号とB像信号およびBのA像信号とB像信号を生成する。相関演算部105は、これら色ごとのA像信号とB像信号における対応点(対応単位画素セル)間のSAD評価値Cを、次式(1)に示すSAD演算によって求める。
C=Σ|YAn−YBm| …(1)
ただし、YAn,YBmはそれぞれ、A像信号とB像信号の信号値のうちn,m番目(n,m=1〜13)の単位画素セルから得られる信号値(画素値)である。YAnとYBmとが互いにほぼ一致してSAD評価値Cが最小となる、すなわち相関度が最も高くなったときのA像信号とB像信号のずれ量(位相差)n−mから撮像光学系のデフォーカス量(デフォーカス方向を含む)を算出することができる。
The capture unit 104 described above generates an A image signal and a B image signal of the same color using outputs from the divided PDs 1a and 1b of the unit pixel cells P1 to P13 of the same color. That is, the A image signal and B image signal of R, the A image signal and B image signal of G, and the A image signal and B image signal of B are generated. The correlation calculation unit 105 obtains the SAD evaluation value C between corresponding points (corresponding unit pixel cells) in the A image signal and the B image signal for each color by the SAD calculation represented by the following equation (1).
C = Σ | YAn−YBm | (1)
YAn and YBm are signal values (pixel values) obtained from the nth and mth (n, m = 1 to 13) unit pixel cells of the signal values of the A image signal and the B image signal, respectively. YAn and YBm substantially coincide with each other, and the SAD evaluation value C is minimized, that is, the amount of deviation (phase difference) nm between the A image signal and the B image signal when the degree of correlation is the highest, and the imaging optical system The defocus amount (including the defocus direction) can be calculated.

図3(a)に示すように、合焦状態では、撮影光学系からの光束によってA像およびB像がともに単位画素セルP5上に形成される。このため、単位画素セルP5(n,m=5)のA像用およびB像用画素群(分割PD1a,1b)からの出力より生成されるA像信号とB像信号がほぼ一致する。このとき、A像信号とB像信号のずれ量、すなわちA像とB像の像ずれ量d(a)は、ほぼ0(単位画素セルP5内の分割PD1a,1bの間隔である基線長に相当する値)になる。   As shown in FIG. 3A, in the in-focus state, both the A image and the B image are formed on the unit pixel cell P5 by the light flux from the photographing optical system. For this reason, the A image signal and the B image signal generated from the output from the pixel group for A image and the pixel group for B image (divided PD1a, 1b) of the unit pixel cell P5 (n, m = 5) substantially coincide. At this time, the shift amount between the A image signal and the B image signal, that is, the image shift amount d (a) between the A image and the B image is substantially 0 (baseline length that is the interval between the divided PDs 1a and 1b in the unit pixel cell P5). Equivalent value).

撮像光学系が後ピンの状態では、撮像光学系の結像位置は、A像については単位画素セルP5(n=5)上に、B像については単位画素セルP9(m=9)上に形成される。このとき、SAD演算により求められる像ずれ量d(b)は、0ではない値(n−m=−4)を持つ。さらに、撮像光学系が前ピンの状態では、A像については単位画素セルP9(n=9)上に、B像については単位画素セルP5(m=5)上に形成される。このとき、SAD演算により求められる像ずれ量d(c)は、像ずれ量d(b)と大きさは同じであるが符号が異なる(n−m=4)。   When the imaging optical system is in the rear pin state, the imaging position of the imaging optical system is on the unit pixel cell P5 (n = 5) for the A image and on the unit pixel cell P9 (m = 9) for the B image. It is formed. At this time, the image shift amount d (b) obtained by the SAD calculation has a non-zero value (n−m = −4). Further, when the imaging optical system is in the front pin state, the A image is formed on the unit pixel cell P9 (n = 9), and the B image is formed on the unit pixel cell P5 (m = 5). At this time, the image shift amount d (c) obtained by the SAD calculation is the same as the image shift amount d (b) but has a different sign (nm = 4).

これは、A像用画素群およびB像用画素群は、合焦状態では同一の被写体を見ているが、後ピン状態および前ピン状態では像ずれ量d(b),d(c)だけずれた被写体を見ているためである。   This is because the A image pixel group and the B image pixel group see the same subject in the focused state, but only the image shift amounts d (b) and d (c) in the rear pin state and the front pin state. This is because the subject that is displaced is viewed.

ステップS12,13では、相関演算部105および相関蓄積バッファ106は、上記SAD演算とSAD評価値の蓄積とをRGBの色ごとに行う。そして、デフォーカス量算出部115は、後述するステップS14〜S16を経た後、最終的にはステップS17において、色ごとのSAD評価値の合算値が最小となる像ずれ量dと上記基線長とを用いた公知の演算方法により撮像光学系のデフォーカス量を算出する。ここにいうデフォーカス量には、デフォーカスの方向も含む。その後、デフォーカス量算出部115は、算出したデフォーカス量を駆動制御部112に出力する。駆動制御部112は、該デフォーカス量からフォーカスレンズの移動量(移動方向を含む)を算出し、その算出結果に応じてフォーカスレンズを移動させる。これにより、合焦状態が得られる。   In steps S12 and S13, the correlation calculation unit 105 and the correlation accumulation buffer 106 perform the SAD calculation and the accumulation of the SAD evaluation value for each RGB color. The defocus amount calculation unit 115 passes through steps S14 to S16 to be described later, and finally, in step S17, the image shift amount d that minimizes the sum of the SAD evaluation values for each color and the above-described baseline length. The defocus amount of the imaging optical system is calculated by a known calculation method using. The defocus amount here includes the defocus direction. Thereafter, the defocus amount calculation unit 115 outputs the calculated defocus amount to the drive control unit 112. The drive control unit 112 calculates the movement amount (including the movement direction) of the focus lens from the defocus amount, and moves the focus lens according to the calculation result. Thereby, a focused state is obtained.

SAD評価値について、図8(a)および図6を用いてさらに詳しく説明する。図8(a)には、A像用画素群(およびB像用画素群)における一次元方向での画素値として得られるA像信号(およびB像信号)を示しており、横軸は画素位置を、縦位置は画素値を示す。A像用およびB像用画素群は、理想的には同一の被写体像を見る。このため、これらの画素群が受光する光に鏡面反射光の成分(以下、鏡面反射成分という)が含まれていたり被写体像にオクリュージョン領域が存在したりしない理想状態では、A像用およびB像用画素群上には画素位置がずれた同じA像とB像が形成される。   The SAD evaluation value will be described in more detail with reference to FIG. 8A and FIG. FIG. 8A shows an A image signal (and B image signal) obtained as a pixel value in a one-dimensional direction in the A image pixel group (and B image pixel group), and the horizontal axis represents the pixel. The position and the vertical position indicate pixel values. The A image and B image pixel groups ideally see the same subject image. For this reason, in an ideal state where the light received by these pixel groups does not include a component of specular reflection light (hereinafter referred to as a specular reflection component) or an occlusion region does not exist in the subject image, On the B image pixel group, the same A image and B image having different pixel positions are formed.

図6には、画素ずらし量(横軸)ごとに式(1)により算出され、相関蓄積バッファ106に蓄積されるSAD評価値(縦軸)を示している。実線は、鏡面反射成分が無い状態でのA像とB像の画素ずらし量ごとのSAD評価値を示している。この実線では、点A(画素ずらし量8)でSAD評価値が最小となっている。このとき、デフォーカス量算出部115は、点Aでの像ずれ量dに基づいてデフォーカス量を算出する。   FIG. 6 shows the SAD evaluation value (vertical axis) calculated by Equation (1) for each pixel shift amount (horizontal axis) and accumulated in the correlation accumulation buffer 106. The solid line indicates the SAD evaluation value for each pixel shift amount of the A image and the B image in the state where there is no specular reflection component. In this solid line, the SAD evaluation value is minimum at the point A (pixel shift amount 8). At this time, the defocus amount calculation unit 115 calculates the defocus amount based on the image shift amount d at the point A.

鏡面反射補正部107は、ステップS14において、色ごとのA像およびB像信号の差分値(以下、AF像差分値という)の色比を求める。そして、鏡面反射補正部107は、ステップS15において、AF像差分値の色比がWB算出補正部109から取得したWB評価値の色比(光源の色に関する情報)と近いか否かを判定する。AF像差分値の色比がWB評価値の色比と近い場合、鏡面反射補正部107は、ステップS16において、色ごとのSAD評価値の合算値に対して鏡面反射成分に関する補正を行う。この補正は、SAD評価値(合算値)から鏡面反射成分の影響を低減(望ましくは除去)するためのものであり、以下の説明では、鏡面反射補正という。AF像差分値の色比とWB評価値の色比については、後に詳しく説明する。   In step S14, the specular reflection correction unit 107 obtains the color ratio of the difference value between the A image and B image signals for each color (hereinafter referred to as AF image difference value). In step S15, the specular reflection correction unit 107 determines whether the color ratio of the AF image difference value is close to the color ratio of the WB evaluation value acquired from the WB calculation correction unit 109 (information on the color of the light source). . When the color ratio of the AF image difference value is close to the color ratio of the WB evaluation value, the specular reflection correction unit 107 corrects the specular reflection component with respect to the sum value of the SAD evaluation values for each color in step S16. This correction is for reducing (preferably removing) the influence of the specular reflection component from the SAD evaluation value (summed value), and is referred to as specular reflection correction in the following description. The color ratio of the AF image difference value and the color ratio of the WB evaluation value will be described in detail later.

ここで、SAD評価値に対して鏡面反射補正を行うことが好ましい場合について、図8(b)〜(d)を用いて具体的に説明する。図8(b)は、図8(a)とは対照的に、鏡面反射成分を含むA像を受光したA像用画素群から得られるA像信号を示し、図8(c)は、同様に、鏡面反射成分を含むB像を受光したB像用画素群から得られるB像信号を示している。また、図8(d)は、合焦状態において図8(b),(c)に示したA像およびB像信号(ただし、位置合わせした状態)における差分を示している。   Here, the case where it is preferable to perform the specular reflection correction on the SAD evaluation value will be specifically described with reference to FIGS. FIG. 8B, in contrast to FIG. 8A, shows an A image signal obtained from an A image pixel group that receives an A image including a specular reflection component, and FIG. 5 shows a B image signal obtained from a B image pixel group that receives a B image including a specular reflection component. FIG. 8D shows the difference in the A image and B image signals (however, in the aligned state) shown in FIGS. 8B and 8C in the focused state.

本来、合焦状態では、A像およびB像信号は互いに一致しているため、それらの差分は0となるはずである。しかし、A像およびB像に鏡面反射成分が含まれているために、図8(d)に示すように、A像およびB像信号に差分が現れる。図8(b),(c)に示したA像およびB像信号に対してSAD評価値を算出すると、図6に破線で示すように、本来の合焦位置に対応する点AでのSAD評価値よりも点BでのSAD評価値の方が小さい。このため、焦点検出部108は、点Bに対する像ずれ量に基づいてデフォーカス量を算出する。つまり、デフォーカス量を誤算出する。   Originally, in the in-focus state, the A image and B image signals coincide with each other, so the difference between them should be zero. However, since a specular reflection component is included in the A and B images, a difference appears in the A and B image signals as shown in FIG. When the SAD evaluation values are calculated for the A and B image signals shown in FIGS. 8B and 8C, the SAD at the point A corresponding to the original in-focus position as shown by the broken line in FIG. The SAD evaluation value at point B is smaller than the evaluation value. Therefore, the focus detection unit 108 calculates the defocus amount based on the image shift amount with respect to the point B. That is, the defocus amount is erroneously calculated.

図8(d)に示す差分は、詳しくは後述するが、鏡面反射成分を表しており、言い換えれば被写体を照らす光源の色(以下、光源色という)を表している。A像信号とB像信号の差分を表す差分値をRGBの色ごとに取得し、各色の差分値をWB評価値に対応する光源色と比較することで、A像およびB像信号における差分が鏡面反射成分により生じたのか焦点が合っていないために生じたのかを判別することが可能である。   The difference shown in FIG. 8D represents a specular reflection component, which will be described in detail later, in other words, the color of the light source that illuminates the subject (hereinafter referred to as the light source color). A difference value representing the difference between the A image signal and the B image signal is obtained for each RGB color, and the difference value of each color is compared with the light source color corresponding to the WB evaluation value, whereby the difference between the A image signal and the B image signal is obtained. It is possible to determine whether it is caused by a specular reflection component or because it is out of focus.

次に、AF像差分値の色比およびWB評価値の色比の算出方法と、これらの色比の比較方法について説明する。   Next, a method for calculating the color ratio of the AF image difference value and the color ratio of the WB evaluation value and a method for comparing these color ratios will be described.

まず、鏡面反射補正部107は、ステップS14において、RとBのAF像差分値ΔR,ΔBのGのAF像差分値ΔGに対する比(色比)Rr1,Br1を画素位置ごとに式(2),(3)により算出する。
Rr1=ΔR/ΔG ・・・(2)
Br1=ΔB/ΔG ・・・(3)
また、鏡面反射補正部107は、同ステップにおいて、RとBのWB評価値WBR,WBBのGのWB評価値WBGに対する色比Rr2,Br2を画素位置ごとに式(4),(5)により算出する。
Rr2=WBR/WBG ・・・(4)
Br2=WBB/WBG ・・・(5)
次に、鏡面反射補正部107は、同ステップにおいて、同じ各画素位置でのRr1,Br1とRr2,Br2から、式(6)により比較値を求める。
√{(Rr1−Rr2)+(Br1−Br2)} ・・・(6)
そして、鏡面反射補正部107は、ステップS15において、この比較値が所定値以下であるときに、AF像差分値が光源色に近い、すなわち鏡面反射成分により生じたものである判定する。この場合、鏡面反射補正部107は、ステップS16にて、比較値に応じてSAD評価値(合算値)に補正係数を乗ずることで、SAD評価値における鏡面反射成分の影響を低減する鏡面反射補正を行う。
First, in step S14, the specular reflection correction unit 107 calculates the ratios (color ratios) Rr1 and Br1 of the AF image difference values ΔR and ΔB of R and B to the AF image difference value ΔG of R and B for each pixel position (2). , (3).
Rr1 = ΔR / ΔG (2)
Br1 = ΔB / ΔG (3)
Further, in the same step, the specular reflection correction unit 107 calculates the color ratios Rr2 and Br2 of the R and B WB evaluation values WBR and WBB with respect to the G WB evaluation value WBG for each pixel position according to equations (4) and (5). calculate.
Rr2 = WBR / WBG (4)
Br2 = WBB / WBG (5)
Next, in the same step, the specular reflection correcting unit 107 obtains a comparison value from the Rr1, Br1 and Rr2, Br2 at the same pixel position by the equation (6).
√ {(Rr1-Rr2) 2 + (Br1-Br2) 2} ··· (6)
In step S15, the specular reflection correction unit 107 determines that the AF image difference value is close to the light source color, that is, is caused by the specular reflection component, when the comparison value is equal to or smaller than the predetermined value. In this case, in step S16, the specular reflection correction unit 107 multiplies the SAD evaluation value (total value) by a correction coefficient in accordance with the comparison value, thereby reducing the specular reflection correction in the SAD evaluation value. I do.

ここで、式(6)の値が小さいほどSAD評価値の信頼性が低いことを意味する。補正係数は、これをSAD評価値に乗じた結果を本来のSAD評価値よりも大きくするような値(1以上の値)を有する。式(6)の値に応じて1以上の補正係数を選択するテーブルを用意してもよい。   Here, the smaller the value of Equation (6), the lower the reliability of the SAD evaluation value. The correction coefficient has a value (a value of 1 or more) that makes the result of multiplying this by the SAD evaluation value larger than the original SAD evaluation value. A table for selecting one or more correction coefficients may be prepared according to the value of Expression (6).

なお、上記比較値が所定値より大きいときは、AF像差分値は鏡面反射成分により生じたものではないとして、デフォーカス量算出部115が、ステップS17にて、鏡面反射補正を行わないSAD評価値を用いてデフォーカス量を算出する。   When the comparison value is larger than the predetermined value, it is determined that the AF image difference value is not caused by the specular reflection component, and the defocus amount calculation unit 115 does not perform the specular reflection correction in step S17. The defocus amount is calculated using the value.

このように、本実施例では、AF像差分値が鏡面反射成分により生じたものであるか否かをWB評価値との比較によって判定し、鏡面反射成分により生じたとの判定に応じて、SAD評価値に対して鏡面反射補正を行う。これにより、高い信頼性を有するSAD評価値を用いてデフォーカス量を算出することができる。言い換えれば、デフォーカス量の信頼性を高めることができる。   Thus, in this embodiment, whether or not the AF image difference value is caused by the specular reflection component is determined by comparison with the WB evaluation value, and the SAD is determined according to the determination that the AF image difference value is caused by the specular reflection component. Specular reflection correction is performed on the evaluation value. Thereby, the defocus amount can be calculated using the SAD evaluation value having high reliability. In other words, the reliability of the defocus amount can be increased.

図6中の点線は、鏡面反射補正後のSAD評価値を示している。この補正後SAD評価値では、本来の合焦位置に対応する点AでのSAD評価値が点BでのSAD評価値よりも小さくなっている。このため、デフォーカス量算出部115は、点Aに対する像ずれ量に基づいてデフォーカス量を算出する。これにより、鏡面反射成分の影響によるデフォーカス量の誤算出が回避される。   The dotted line in FIG. 6 indicates the SAD evaluation value after specular reflection correction. In this corrected SAD evaluation value, the SAD evaluation value at point A corresponding to the original in-focus position is smaller than the SAD evaluation value at point B. For this reason, the defocus amount calculation unit 115 calculates the defocus amount based on the image shift amount with respect to the point A. Thereby, erroneous calculation of the defocus amount due to the influence of the specular reflection component is avoided.

次に、SAD演算によって鏡面反射成分がAF像差分値となって現れる原理について説明する。物体からの反射光には、反射方向性を持たず物体の色を反映する乱反射光(以下、乱反射成分という)と、反射方向性を有して物体の色を反映せずに光源色を反映する鏡面反射成分とが存在する。具体的には、図4に示すように、光源400から被写体401に入射した光の一部は乱反射成分(図中の細実線および細点線で示す)として全方向に反射され、残りは鏡面反射成分(図中の太実線および太点線で示す)として主として正反射方向に反射される。   Next, the principle that a specular reflection component appears as an AF image difference value by SAD calculation will be described. Reflected light from the object reflects diffusely reflected light that reflects the color of the object without reflection direction (hereinafter referred to as diffuse reflection component) and reflects the light source color without reflecting the color of the object with reflection directionality And a specular reflection component. Specifically, as shown in FIG. 4, a part of the light incident on the subject 401 from the light source 400 is reflected in all directions as diffuse reflection components (indicated by thin solid lines and thin dotted lines in the figure), and the rest is specularly reflected. It is reflected mainly in the regular reflection direction as a component (indicated by a thick solid line and a thick dotted line in the figure).

図4では、撮像装置402,403が互いに空間的に異なる位置から被写体401を撮像している。被写体401から撮像装置402の方向に反射される乱反射成分を細実線で、鏡面反射成分を太実線で示している。また、撮像装置403の方向に反射される乱反射成分406を細点線で、鏡面反射成分407を太点線で示している。   In FIG. 4, the imaging devices 402 and 403 image the subject 401 from spatially different positions. The irregular reflection component reflected from the subject 401 in the direction of the imaging device 402 is indicated by a thin solid line, and the specular reflection component is indicated by a thick solid line. Further, the irregular reflection component 406 reflected in the direction of the imaging device 403 is indicated by a thin dotted line, and the specular reflection component 407 is indicated by a thick dotted line.

上述したように被写体の色を表す乱反射成分は全方向に進むので、この乱反射成分を互いに異なる位置に配置された撮像装置402,403から撮像しても差は生じない。一方、鏡面反射成分は、その反射角が光源400からの入射角と等しい正反射方向において最も高い強度を有する。例えば、被写体401上の点404で反射した鏡面反射成分406は、撮像装置402に向かう正反射方向において最も高い強度を有し、点405で反射した鏡面反射成分407は、撮像装置403に向かう正反射方向において最も高い強度を有する。逆に、撮像装置403に対して点404からはほぼ乱反射成分しか入射せず、撮像装置402に対して点405からはほぼ乱反射成分しか入射しない。つまり、被写体上での光の反射位置に対する撮像装置の空間的な位置に応じて、該撮像装置により観測できる鏡面反射成分の強度(光量)が変化する。   As described above, since the irregular reflection component representing the color of the subject travels in all directions, no difference occurs even if the irregular reflection component is imaged from the imaging devices 402 and 403 arranged at different positions. On the other hand, the specular reflection component has the highest intensity in the regular reflection direction whose reflection angle is equal to the incident angle from the light source 400. For example, the specular reflection component 406 reflected by the point 404 on the subject 401 has the highest intensity in the regular reflection direction toward the imaging device 402, and the specular reflection component 407 reflected by the point 405 is the positive reflection toward the imaging device 403. It has the highest intensity in the reflection direction. On the contrary, almost only the irregular reflection component is incident on the imaging device 403 from the point 404, and only the irregular reflection component is incident on the imaging device 402 from the point 405. That is, the intensity (light quantity) of the specular reflection component that can be observed by the imaging apparatus changes according to the spatial position of the imaging apparatus with respect to the reflection position of the light on the subject.

ここで、撮像装置402,403によって点404からの反射光を観測したときの該反射光の強度をそれぞれA1,A2とするとき、A1,A2はそれぞれ以下の式(7),(8)により表される。
A1=I1+D ・・・(7)
A2=I2+D ・・・(8)
ただし、I1は点404から撮像装置402に入射する鏡面反射成分、I2は点404から撮像装置403に入射する鏡面反射成分であり、Dは点404から撮像装置402,403に入射する乱反射成分である。被写体401上の同一点404からの乱反射成分Dは、撮像装置402,403の位置によらず同一とみなすことができる。
Here, when the intensity of the reflected light when the reflected light from the point 404 is observed by the imaging devices 402 and 403 are respectively A1 and A2, A1 and A2 are expressed by the following equations (7) and (8), respectively. expressed.
A1 = I1 + D (7)
A2 = I2 + D (8)
However, I1 is a specular reflection component incident on the imaging device 402 from the point 404, I2 is a specular reflection component incident on the imaging device 403 from the point 404, and D is a diffuse reflection component incident on the imaging devices 402 and 403 from the point 404. is there. The irregular reflection components D from the same point 404 on the subject 401 can be regarded as the same regardless of the positions of the imaging devices 402 and 403.

ここで、I1,I2をそれぞれ、フォングの反射モデルによって式(9),(10)で表す。
I1=iW(α)cosθ1 ・・・(9)
I2=iW(α)cosθ2 ・・・(10)
ただし、iは入射光の強度であり、W(α)は被写体の正反射方向への鏡面反射率であり、θ1およびθ2は正反射方向からの撮像装置402,403のずれ角である。式(9),(10)において、入射光の強度iは光源400から照射される同一光の強度であり、W(α)は被写体の同一点における反射率であるので、それぞれ撮像装置402,403の位置によらず同一である。一方、ずれ角θ1,θ2は撮像装置402,403の位置によって変化する。このため、cosθ1,cosθ2の値は撮像装置402,403からの撮像により得られた画像間において同じ点(対応点)であるにも関わらず変化する。
Here, I1 and I2 are expressed by equations (9) and (10), respectively, according to Fong's reflection model.
I1 = iW (α) cos θ1 (9)
I2 = iW (α) cos θ2 (10)
Here, i is the intensity of the incident light, W (α) is the specular reflectance in the regular reflection direction of the subject, and θ1 and θ2 are deviation angles of the imaging devices 402 and 403 from the regular reflection direction. In the equations (9) and (10), the intensity i of the incident light is the intensity of the same light emitted from the light source 400, and W (α) is the reflectance at the same point of the subject. It is the same regardless of the position of 403. On the other hand, the shift angles θ1 and θ2 vary depending on the positions of the imaging devices 402 and 403. Therefore, the values of cos θ1 and cos θ2 change between the images obtained by imaging from the imaging devices 402 and 403 even though they are the same point (corresponding point).

式(7)〜(10)を用いてA1−A2を計算すると、以下の式(11)が得られる。
A1−A2=iW(α)(cosθ1−cosθ2) ・・・(11)
式(11)より、空間的に位置が異なる撮像装置402,403により観測される点404からの反射光は、光源400からの入射光の倍数となることが分かる。これはすなわち、A1−A2の値から光源400からの入射光と同一の特性が得られることを表している。式(11)の結果は色によらず同じであるため、撮像装置402,403をRGBの色ごとのA像用およびB像用画素群に置き換えて色ごとのAF像差分値を得ることで、光源400からの入射光の色比(つまりは光源色)を得ることが可能となる。
When A1-A2 is calculated using the equations (7) to (10), the following equation (11) is obtained.
A1-A2 = iW (α) (cos θ1-cos θ2) (11)
From equation (11), it can be seen that the reflected light from the point 404 observed by the imaging devices 402 and 403 having different spatial positions is a multiple of the incident light from the light source 400. This means that the same characteristics as the incident light from the light source 400 can be obtained from the value of A1-A2. Since the result of Expression (11) is the same regardless of the color, the image pickup devices 402 and 403 are replaced with pixel groups for A image and B image for each RGB color to obtain AF image difference values for each color. The color ratio of incident light from the light source 400 (that is, the light source color) can be obtained.

以上説明したように、本実施例では、WB評価値を用いてAF像差分値が鏡面反射成分により生じたものであると判定した上でSAD評価値に対して鏡面反射成分(光源色)の影響を低減する補正を行うことで、信頼性の高い補正後SAD評価値を得ることができる。つまり、偏光フィルタ等の特別な光学素子を用いることなく、鏡面反射成分の影響が低減された補正後SAD評価値を得ることができる。このため、該補正後SAD評価値を用いてデフォーカス量を算出することで、デフォーカス量の算出精度、ひいてはAFの精度を高めることができる。   As described above, in this embodiment, the WB evaluation value is used to determine that the AF image difference value is caused by the specular reflection component, and then the specular reflection component (light source color) of the SAD evaluation value is determined. By performing correction to reduce the influence, it is possible to obtain a corrected SAD evaluation value with high reliability. That is, the corrected SAD evaluation value in which the influence of the specular reflection component is reduced can be obtained without using a special optical element such as a polarizing filter. Therefore, by calculating the defocus amount using the post-correction SAD evaluation value, it is possible to improve the defocus amount calculation accuracy, and hence the AF accuracy.

実施例1では、分割設定された全て(64個)の画素ブロックでの相関演算の結果(SAD評価値)に対して、ホワイトバランス(WB)評価値を用いて判定した鏡面反射成分の影響を低減する補正を行ってSAD評価値の精度を向上させる場合について説明した。これに対して、本発明の実施例2では、相関演算の対象として鏡面反射成分を受光している画素ブロックを除外することで、デフォーカス量の算出に用いられるSAD評価値の精度を高める場合について説明する。   In the first embodiment, the influence of the specular reflection component determined using the white balance (WB) evaluation value on the result of correlation calculation (SAD evaluation value) in all (64) pixel blocks that are divided and set. The case where the correction to be reduced is performed to improve the accuracy of the SAD evaluation value has been described. On the other hand, in the second embodiment of the present invention, the accuracy of the SAD evaluation value used for calculating the defocus amount is increased by excluding the pixel block receiving the specular reflection component as the target of the correlation calculation. Will be described.

図10には、本実施例における撮像装置900の構成を示している。図10において、実施例1(図1)の構成要素と共通する構成要素には、実施例1と同符号を付してその説明を省略する。   FIG. 10 shows the configuration of the imaging apparatus 900 in the present embodiment. In FIG. 10, the same reference numerals as those in the first embodiment are given to the same components as those in the first embodiment (FIG. 1), and the description thereof is omitted.

撮像装置900は、実施例1の撮像装置100に対して、信頼性評価部901と、焦点検出領域判定部905とが追加されている。また、焦点検出部906は、実施例1の焦点検出部108とは後述する差異を有し、演算手段を構成する。   In the imaging apparatus 900, a reliability evaluation unit 901 and a focus detection area determination unit 905 are added to the imaging apparatus 100 of the first embodiment. Further, the focus detection unit 906 has a difference described later from the focus detection unit 108 of the first embodiment, and constitutes a calculation unit.

実施例1と同様に、撮像素子102から出力されたアナログ信号はA/D変換部103でデジタル信号に変換されてキャプチャー部104に入力される。キャプチャー部104は、A/D変換部103から出力されたRGBの色ごとのA像用画素群に対応する画素信号から該色ごとのA像信号を生成し、RGBの色ごとのB像用画素群に対応する画素信号から該色ごとのB像信号を生成する。キャプチャー部104は、これら色ごとのA像およびB像信号をWB算出補正部109、信頼性評価部901および焦点検出部906に出力する。また、キャプチャー部104は、A/D変換部103から出力されたRGBの色ごとのA像用およびB像用画素群からの画素信号の合成信号としての該色ごとの撮像画素信号を生成し、これら撮像画素信号をWB算出補正部109に出力する。   As in the first embodiment, the analog signal output from the image sensor 102 is converted into a digital signal by the A / D conversion unit 103 and input to the capture unit 104. The capture unit 104 generates an A image signal for each color from the pixel signals corresponding to the A image pixel group for each RGB color output from the A / D conversion unit 103, and for the B image for each RGB color A B image signal for each color is generated from pixel signals corresponding to the pixel group. The capture unit 104 outputs the A and B image signals for each color to the WB calculation correction unit 109, the reliability evaluation unit 901, and the focus detection unit 906. Further, the capture unit 104 generates an imaging pixel signal for each color as a composite signal of pixel signals from the A and B image pixel groups for each RGB color output from the A / D conversion unit 103. These image pickup pixel signals are output to the WB calculation correction unit 109.

信頼性評価部901は、後述する焦点検出領域で得られる画素信号の信頼性を、WB算出補正部109の出力を用いて評価する。信頼性評価部901は、差分算出部902と、差分値比較部903と、鏡面反射カウント部904とを含む。差分算出部902と差分値比較部903とにより、鏡面反射検出手段が構成される。また、WB算出補正部109、信頼性評価部901および焦点検出部906により焦点検出装置が構成される。   The reliability evaluation unit 901 evaluates the reliability of the pixel signal obtained in the focus detection area described later using the output of the WB calculation correction unit 109. The reliability evaluation unit 901 includes a difference calculation unit 902, a difference value comparison unit 903, and a specular reflection count unit 904. The difference calculation unit 902 and the difference value comparison unit 903 constitute a specular reflection detection unit. The WB calculation correction unit 109, the reliability evaluation unit 901, and the focus detection unit 906 constitute a focus detection device.

次に、信頼性評価部901と焦点検出部906が行う焦点検出処理について、図12のフローチャートを併せ用いて詳しく説明する。信頼性評価部901と焦点検出部906は、コンピュータとして、コンピュータプログラムである焦点検出プログラムに従って、図12に示すステップS21〜S30の焦点検出処理を行う。   Next, focus detection processing performed by the reliability evaluation unit 901 and the focus detection unit 906 will be described in detail with reference to the flowchart of FIG. The reliability evaluation unit 901 and the focus detection unit 906 perform focus detection processing in steps S21 to S30 illustrated in FIG. 12 according to a focus detection program that is a computer program as a computer.

差分算出部902は、ステップS21において、実施例1にて図5を用いて説明した複数(64個)の画素ブロックのうちユーザにより任意に又は所定のアルゴリズムに従って自動的に選択された2以上の画素ブロックを含む焦点検出領域を設定する。そして、差分算出部902は、ステップS22において、焦点検出領域内の画素ブロックのうち特定画素ブロックで得られるRGBの画素信号を色ごとに積分する。また、差分算出部902は、同ステップにおいて、焦点検出領域内にて上記特定画素ブロックに隣接する画素ブロック(以下、隣接画素ブロックという)で得られるRGBの画素信号を色ごとに積分する。   In step S21, the difference calculation unit 902 selects two or more selected arbitrarily or automatically according to a predetermined algorithm from the plurality (64) of pixel blocks described in FIG. A focus detection area including a pixel block is set. In step S22, the difference calculation unit 902 integrates the RGB pixel signals obtained by the specific pixel block among the pixel blocks in the focus detection area for each color. Further, in the same step, the difference calculation unit 902 integrates RGB pixel signals obtained in pixel blocks adjacent to the specific pixel block (hereinafter referred to as adjacent pixel blocks) in the focus detection region for each color.

続いて、差分算出部902は、ステップS23において、特定画素ブロックでの画素信号の積分値と隣接画素ブロックでの画素信号の積分値との色ごとの差分値を求め、該色ごとの差分値を差分値比較部903に出力する。以下の説明において、各画素ブロックでの画素信号の積分値を各画素ブロックの出力ともいい、特定画素ブロックの出力と隣接画素ブロックの出力との差分値を、ブロック出力差分値という。   Subsequently, in step S23, the difference calculation unit 902 obtains a difference value for each color between the integration value of the pixel signal in the specific pixel block and the integration value of the pixel signal in the adjacent pixel block, and the difference value for each color. Is output to the difference value comparison unit 903. In the following description, the integrated value of the pixel signal in each pixel block is also referred to as the output of each pixel block, and the difference value between the output of the specific pixel block and the output of the adjacent pixel block is referred to as a block output difference value.

差分値比較部903は、ステップS24において、ブロック出力差分値の色比を算出し、さらに該ブロック出力差分値の色比とWB算出補正部109から出力されたWB評価値の色比との比較値を算出する。このときのWB評価値は、ブロック出力差分値を算出した特定および隣接画素ブロックが属する焦点検出領域内の値を用いることが望ましい。差分値比較部903は、ステップS25において、該比較値が第1の所定値を超えているか否かを判定する。所定値以下の場合には、特定画素ブロックは鏡面反射成分を受光していると判定する。このような鏡面反射成分の判定方法は、特許文献3にて開示されている。   In step S24, the difference value comparison unit 903 calculates the color ratio of the block output difference value, and further compares the color ratio of the block output difference value with the color ratio of the WB evaluation value output from the WB calculation correction unit 109. Calculate the value. As the WB evaluation value at this time, it is desirable to use a value in the focus detection region to which the specific and adjacent pixel block to which the block output difference value is calculated belongs. In step S25, the difference value comparison unit 903 determines whether or not the comparison value exceeds a first predetermined value. When the value is equal to or smaller than the predetermined value, it is determined that the specific pixel block receives the specular reflection component. Such a specular reflection component determination method is disclosed in Patent Document 3.

ここで、差分値比較部903がステップS24,S25にて行う、ブロック出力差分値の色比およびWB評価値の色比の算出と、これらの色比の比較の方法について説明する。   Here, the calculation of the color ratio of the block output difference value and the color ratio of the WB evaluation value performed by the difference value comparison unit 903 in steps S24 and S25 and a method of comparing these color ratios will be described.

まず、差分値比較部903は、差分算出部902から出力されたRとBのブロック出力差分値のGのブロック出力差分値に対する色比を、実施例1で示した式(2),(3)と同様に算出する。また、差分値比較部903は、RとBのWB評価値のGのWB評価値に対する色比を、式(4),(5)により算出する。そして、本実施例では、差分値比較部903は、RとBのWB評価値の色比をRr1,Br1とし、RとBのブロック出力差分値の色比をRr2,Br2として、実施例1で示した式(6)を用いて比較値を算出する。差分値比較部903は、この比較値が第1の所定値以下であれば特定画素ブロックは鏡面反射成分を受光していると判定し、第1の所定値を上回っていれば鏡面反射成分を受光していないと判定する。前者の場合は、差分値比較部903は、ステップS26において鏡面反射カウント部904に対してインクリメント出力を行う。後者の場合は、ブロック出力差分値は、被写体のテクスチャによる差分を示すと考えることができ、インクリメント出力は行わずに、ステップS28に進む。   First, the difference value comparison unit 903 calculates the color ratio of the R and B block output difference values output from the difference calculation unit 902 to the G block output difference value using the equations (2) and (3) shown in the first embodiment. ). Also, the difference value comparison unit 903 calculates the color ratio of the R and B WB evaluation values to the G WB evaluation value by using equations (4) and (5). In this embodiment, the difference value comparison unit 903 sets the color ratio of the R and B WB evaluation values to Rr1 and Br1, and sets the color ratio of the R and B block output difference values to Rr2 and Br2. The comparison value is calculated using equation (6) shown in FIG. The difference value comparison unit 903 determines that the specific pixel block receives the specular reflection component if the comparison value is equal to or less than the first predetermined value, and determines the specular reflection component if it exceeds the first predetermined value. It is determined that no light is received. In the former case, the difference value comparison unit 903 performs an increment output to the specular reflection count unit 904 in step S26. In the latter case, it can be considered that the block output difference value indicates a difference due to the texture of the subject, and the process proceeds to step S28 without performing increment output.

鏡面反射カウント部904は、ステップS27において、差分値比較部903のインクリメント出力に応じて、鏡面反射成分を受光している画素ブロック(第1の画素ブロック:以下、鏡面反射画素ブロックという)の数を1つインクリメントする。そして、インクリメント後の鏡面反射画素ブロック数を焦点検出領域判定部905に出力する。   In step S27, the specular reflection counting unit 904 counts the number of pixel blocks that receive the specular reflection component (first pixel block: hereinafter referred to as specular reflection pixel block) according to the increment output of the difference value comparison unit 903. Is incremented by one. Then, the number of specular reflection pixel blocks after the increment is output to the focus detection area determination unit 905.

次に、焦点検出領域判定部905は、ステップS28において、鏡面反射カウント部904から出力された鏡面反射画素ブロック数に基づいて、焦点検出領域がデフォーカス量の算出(焦点検出)に適しているか否かを判定する。そして、その判定結果を焦点検出部906に出力する。   Next, in step S28, the focus detection area determination unit 905 determines whether the focus detection area is suitable for calculating the defocus amount (focus detection) based on the number of specular reflection pixel blocks output from the specular reflection count unit 904. Determine whether or not. The determination result is output to the focus detection unit 906.

図11には、焦点検出領域の例を示している。この図では、64個の画素ブロックのうち9個の画素ブロック19,20,21,27,28,29,35,36,37を含む焦点検出領域を太線で囲んで示している。焦点検出領域内においてハッチングした3つの画素ブロック21,28,37は、鏡面反射画素ブロックである。焦点検出領域判定部905は、この焦点検出領域での焦点検出の適否を、鏡面反射カウント部904から出力された鏡面反射画素ブロック数と第2の所定値との比較(第2の所定値以下か否か)で判定する。   FIG. 11 shows an example of the focus detection area. In this figure, a focus detection area including nine pixel blocks 19, 20, 21, 27, 28, 29, 35, 36, and 37 out of 64 pixel blocks is indicated by being surrounded by a bold line. The three pixel blocks 21, 28 and 37 hatched in the focus detection area are specular reflection pixel blocks. The focus detection area determination unit 905 compares the number of specular reflection pixel blocks output from the specular reflection count unit 904 with a second predetermined value (whether the second predetermined value or less). Or not).

焦点検出領域での焦点検出が「適」と判定された(例えば鏡面反射画素ブロック数が第2の所定値「6」以下であった)場合は、焦点検出部906は、ステップS29の処理を行う。ステップS29では、焦点検出部906は、該焦点検出領域の鏡面反射画素ブロック21,28,37とは異なる画素ブロック(第2の画素ブロック)ごとに相関演算を行う。そして、焦点検出部906は、相関演算の結果(SAD評価値の最小点)でのA像およびB像(信号)の像ずれ量を用いてデフォーカス量を算出し、その結果を駆動制御部112に出力する。   When it is determined that the focus detection in the focus detection area is “suitable” (for example, the number of specular reflection pixel blocks is equal to or smaller than the second predetermined value “6”), the focus detection unit 906 performs the process of step S29. Do. In step S29, the focus detection unit 906 performs correlation calculation for each pixel block (second pixel block) different from the specular reflection pixel blocks 21, 28, and 37 in the focus detection area. The focus detection unit 906 calculates the defocus amount using the image shift amount of the A image and the B image (signal) in the correlation calculation result (minimum point of the SAD evaluation value), and the result is calculated as a drive control unit. To 112.

一方、焦点検出領域での焦点検出が「不適」と判定された場合(例えば鏡面反射画素ブロック数が第2の所定値「6」より多い場合)は、焦点検出部906は、ステップS30において、その焦点検出領域での焦点検出が不可能との警告を表示または音声により行う。   On the other hand, when it is determined that the focus detection in the focus detection region is “unsuitable” (for example, when the number of specular reflection pixel blocks is larger than the second predetermined value “6”), the focus detection unit 906, in step S30, A warning that the focus cannot be detected in the focus detection area is displayed or by voice.

以上説明したように、本実施例では、偏光フィルタ等の特別な光学素子を用いることなく、鏡面反射成分を受光している鏡面反射画素ブロックを検出して焦点検出に用いる画素ブロックから除外する。これにより、鏡面反射成分の影響によってデフォーカス量が誤算出され、AF精度が低下することを回避することができる。言い換えれば、デフォーカス量の算出精度およびAF精度を高めることができる。しかも、WB評価値を用いて画素ブロックごとの出力が鏡面反射成分による出力であると判定した上で除外する鏡面反射画素ブロックを特定するので、鏡面反射画素ブロックの特性に対する信頼性を向上させることができる。   As described above, in this embodiment, a specular reflection pixel block receiving a specular reflection component is detected and excluded from the pixel block used for focus detection without using a special optical element such as a polarizing filter. Thereby, it can be avoided that the defocus amount is erroneously calculated due to the influence of the specular reflection component and the AF accuracy is lowered. In other words, the defocus amount calculation accuracy and AF accuracy can be improved. Moreover, since the specular reflection pixel block to be excluded is specified after determining that the output for each pixel block is an output by the specular reflection component using the WB evaluation value, the reliability of the specular reflection pixel block characteristics is improved. Can do.

また、本実施例では、ユーザ等により選択された焦点検出領域内で鏡面反射画素ブロック数が第2の所定値より多い場合はその焦点検出領域での焦点検出を制限するので、デフォーカス量の算出精度およびAF精度の低下を防止することができる。   Further, in this embodiment, when the number of specular reflection pixel blocks is larger than the second predetermined value in the focus detection area selected by the user or the like, focus detection in the focus detection area is limited. A decrease in calculation accuracy and AF accuracy can be prevented.

なお、本実施例では、差分算出部902で得たブロック出力差分値ごとにWB評価値との比較を行って焦点検出領域内の鏡面反射画素ブロックを特定し、該鏡面反射画素ブロック数によって焦点検出領域での焦点検出の適否を判定する場合について説明した。しかし、焦点検出領域内の全ての画素ブロックの出力を積分した値とWB評価値とを比較した結果に応じて、その焦点検出領域での焦点検出の適否を判定してもよい。   In this embodiment, each block output difference value obtained by the difference calculation unit 902 is compared with the WB evaluation value to identify the specular reflection pixel block in the focus detection area, and the focal point is determined based on the number of specular reflection pixel blocks. The case where the suitability of focus detection in the detection area is determined has been described. However, the suitability of focus detection in the focus detection area may be determined according to the result of comparing the value obtained by integrating the outputs of all the pixel blocks in the focus detection area with the WB evaluation value.

また、本実施例では、鏡面反射画素ブロックを特定するために、画素ブロックごとの画素信号の積分値の差分値を用いる場合について説明したが、実施例1のように、位置合わせを行ったA像およびB像信号の差分値を用いてもよい。また、これら以外でも、鏡面反射画素ブロックを特定できる演算方法であればどのような方法を用いてもよい。   Further, in the present embodiment, the case where the difference value of the integral value of the pixel signal for each pixel block is used to specify the specular reflection pixel block has been described. However, as in the first embodiment, the alignment A is performed. A difference value between the image and the B image signal may be used. In addition to these methods, any calculation method may be used as long as it can specify the specular reflection pixel block.

さらに、上記各実施例では、位相差検出方式による焦点検出結果(デフォーカス量)のみを用いてAFを行う場合について説明したが、コントラスト検出方式による焦点検出結果を合わせ用いてAFを行ってもよい。   Further, in each of the above-described embodiments, the case where AF is performed using only the focus detection result (defocus amount) by the phase difference detection method has been described. However, even if AF is performed using the focus detection result by the contrast detection method. Good.

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

101 光学ユニット
1 単位画素セル
2 マイクロレンズ
1a,1b 分割PD
108,906 焦点検出部
101 Optical unit 1 Unit pixel cell 2 Microlenses 1a and 1b Split PD
108,906 Focus detection unit

Claims (12)

物体からの光のうち光学系の射出瞳における互いに異なる領域を通過した光束により形成された一対の物体像を光電変換する光電変換素子からの出力を用いて生成された一対の像信号に対する相関演算を行ってデフォーカス量を算出する演算手段と、
前記物体を撮像して得られた信号を用いて前記物体を照らす光源の色に関する情報を取得する光源色取得手段と、を有し、
前記演算手段は、前記光源の色に関する情報が示す色前記一対の像信号における差分が示す色とを比較した結果から、前記差分の前記物体からの鏡面反射光成分を判定し、該判定結果基づいて前記デフォーカス量を算出することを特徴とする焦点検出装置。
Correlation calculation for a pair of image signals generated using the output from a photoelectric conversion element that photoelectrically converts a pair of object images formed by light beams that have passed through different areas in the exit pupil of the optical system among the light from the object calculating means for calculating a defocus amount performed,
Light source color acquisition means for acquiring information relating to the color of the light source that illuminates the object using a signal obtained by imaging the object ;
It said computing means from the result of comparing the color indicated by the difference in color between the pair of image signals indicating information about the color of the light source, to determine the specular reflection light component from the object of the difference, the determination result The defocus amount is calculated based on the focus detection device.
前記演算手段は、前記相関演算によって相関評価値を生成し、該相関評価値を用いて前記デフォーカス量を算出することを特徴とする請求項1に記載の焦点検出装置。The focus detection apparatus according to claim 1, wherein the calculation unit generates a correlation evaluation value by the correlation calculation, and calculates the defocus amount using the correlation evaluation value. 前記演算手段は、複数の前記光電変換素子からの出力を用いて複数の相関評価値を生成し、前記鏡面反射光成分に対応する相関評価値の重みを下げて前記複数の相関評価値から前記デフォーカス量を算出することを特徴とする請求項2に記載の焦点検出装置。The calculation means generates a plurality of correlation evaluation values using outputs from the plurality of photoelectric conversion elements, reduces the weight of the correlation evaluation value corresponding to the specular reflection light component, and calculates the correlation evaluation values from the plurality of correlation evaluation values. The focus detection apparatus according to claim 2, wherein a defocus amount is calculated. 前記演算手段は、複数の前記光電変換素子からの出力を用いて複数の相関評価値を生成し、前記鏡面反射光成分に対応する相関評価値のみを用いて前記デフォーカス量を算出することを特徴とする請求項2または3に記載の焦点検出装置。The computing means generates a plurality of correlation evaluation values using outputs from the plurality of photoelectric conversion elements, and calculates the defocus amount using only the correlation evaluation values corresponding to the specular reflection light component. The focus detection apparatus according to claim 2, wherein the focus detection apparatus is a focus detection apparatus. 前記演算手段は、複数の光電変換素子からの出力にそれぞれ対応する複数の画素ブロックのうち2以上の画素ブロックを含む焦点検出領域において、前記鏡面反射成分に対応する第1の画素ブロックの数が所定値以下である場合に、該焦点検出領域に含まれる前記第1の画素ブロックと異なる第2の画素ブロックからの出力を用いて生成された前記一対の像信号を用いて前記デフォーカス量を算出することを特徴とする請求項1からのいずれか一項に記載の焦点検出装置。 In the focus detection region including two or more pixel blocks among the plurality of pixel blocks respectively corresponding to the outputs from the plurality of photoelectric conversion elements, the calculation unit has a number of first pixel blocks corresponding to the specular reflection component. When the value is equal to or less than a predetermined value, the defocus amount is calculated using the pair of image signals generated using an output from a second pixel block different from the first pixel block included in the focus detection area. focus detecting apparatus according to any one of be calculated from claim 1, wherein 4. 前記演算手段は、前記焦点検出領域において、前記第1の画素ブロックの数が前記所定値より多い場合は、該焦点検出領域に含まれる前記第2の画素ブロックからの出力を用いた前記デフォーカス量の算出を制限することを特徴とする請求項に記載の焦点検出装置。 When the number of the first pixel blocks is greater than the predetermined value in the focus detection area, the calculation means uses the output from the second pixel block included in the focus detection area. 6. The focus detection apparatus according to claim 5 , wherein calculation of the amount is limited. 請求項1からのいずれか一項に記載の焦点検出装置と、
複数の前記光電変換素子とを有することを特徴とする撮像装置。
The focus detection device according to any one of claims 1 to 6 ,
An imaging apparatus comprising a plurality of the photoelectric conversion elements.
物体からの光のうち光学系の射出瞳における互いに異なる領域を通過した光束により形成された一対の物体像を光電変換する光電変換素子からの出力を用いてデフォーカス量を算出し、
前記物体を撮像して得られた信号を用いて前記物体を照らす光源の色に関する情報を取得し、
前記デフォーカス量の算出では、前記光源の色に関する情報が示す色前記一対の像信号における差分が示す色とを比較した結果から、前記差分の前記物体からの鏡面反射光成分を判定し、該判定結果基づいて前記デフォーカス量を算出させることを特徴とする焦点検出方法。
Calculates a defocus amount using an output from the photoelectric conversion element for photoelectrically converting a pair of object images formed by light beams passing through different regions in the exit pupil of the optical system of the light from the object,
Obtaining information about the color of the light source that illuminates the object using a signal obtained by imaging the object;
Wherein the defocus amount calculated from the result of comparing the color indicated by the difference in color between the pair of image signals indicating information about the color of the light source, to determine the specular reflection light component from said object of said difference, A focus detection method that calculates the defocus amount based on the determination result .
物体からの光のうち光学系の射出瞳における互いに異なる領域を通過した光束により形成された一対の物体像をそれぞれ光電変換する複数の光電変換素子からの出力を用いて生成された一対の像信号に対する相関演算を行って複数の相関評価値を生成し、該相関評価値を用いて前記光学系のデフォーカス量を算出する演算手段と、A pair of image signals generated using outputs from a plurality of photoelectric conversion elements that respectively photoelectrically convert a pair of object images formed by light beams that have passed through different regions in the exit pupil of the optical system among light from the object Calculating means for calculating a defocus amount of the optical system using the correlation evaluation value;
前記物体を撮像して得られた信号を用いて前記物体を照らす光源の色に関する情報を取得する光源色取得手段と、を有し、Light source color acquisition means for acquiring information relating to the color of the light source that illuminates the object using a signal obtained by imaging the object;
前記演算手段は、前記光源の色に関する情報と前記一対の像信号とを用いて、前記物体からの鏡面反射光による出力に対応する相関評価値の重みを下げて前記デフォーカス量を算出することを特徴とする焦点検出装置。The calculation means calculates the defocus amount by reducing the weight of the correlation evaluation value corresponding to the output by the specular reflection light from the object, using the information on the color of the light source and the pair of image signals. A focus detection device.
物体からの光のうち光学系の射出瞳における互いに異なる領域を通過した光束により形成された一対の物体像をそれぞれ光電変換する複数の光電変換素子からの出力を用いて生成された一対の像信号に対する相関演算を行って複数の相関評価値を生成し、該相関評価値を用いて前記光学系のデフォーカス量を算出し、A pair of image signals generated using outputs from a plurality of photoelectric conversion elements that respectively photoelectrically convert a pair of object images formed by light beams that have passed through different regions in the exit pupil of the optical system among light from the object To generate a plurality of correlation evaluation values by calculating a defocus amount of the optical system using the correlation evaluation values,
前記物体を撮像して得られた信号を用いて前記物体を照らす光源の色に関する情報を取得し、Obtaining information about the color of the light source that illuminates the object using a signal obtained by imaging the object;
前記デフォーカス量の算出では、前記光源の色に関する情報と前記一対の像信号とを用いて、前記物体からの鏡面反射光による出力に対応する相関評価値の重みを下げて前記デフォーカス量を算出することを特徴とする焦点検出方法。In the calculation of the defocus amount, the information on the color of the light source and the pair of image signals are used to reduce the weight of the correlation evaluation value corresponding to the output by the specularly reflected light from the object, thereby reducing the defocus amount. A focus detection method characterized by calculating.
コンピュータに、以下の処理を行わせるコンピュータプログラムであって、
物体からの光のうち光学系の射出瞳における互いに異なる領域を通過した光束により形成された一対の物体像を光電変換する光電変換素子からの出力を用いてデフォーカス量を算出させ、
前記物体を撮像して得られた信号を用いて前記物体を照らす光源の色に関する情報を取得させ、
前記デフォーカス量の算出では、前記光源の色に関する情報が示す色と前記一対の像信号における差分が示す色とを比較した結果から、前記差分の前記物体からの鏡面反射光成分を判定し、該判定結果基づいて前記デフォーカス量を算出させることを特徴とする焦点検出プログラム。
A computer program that causes a computer to perform the following processing:
It is the defocus amount is calculated using the output from the photoelectric conversion element for photoelectrically converting a pair of object images formed by light beams passing through different regions in the exit pupil of the optical system of the light from the object,
Obtaining information on the color of the light source that illuminates the object using a signal obtained by imaging the object;
In the calculation of the defocus amount, the specular reflection component from the object of the difference is determined from the result of comparing the color indicated by the information on the color of the light source and the color indicated by the difference in the pair of image signals , A focus detection program that calculates the defocus amount based on the determination result .
コンピュータに、以下の処理を行わせるコンピュータプログラムであって、
物体からの光のうち光学系の射出瞳における互いに異なる領域を通過した光束により形成された一対の物体像をそれぞれ光電変換する複数の光電変換素子からの出力を用いて生成された一対の像信号に対する相関演算を行って複数の相関評価値を生成し、該相関評価値を用いて前記光学系のデフォーカス量を算出させ、
前記物体を撮像して得られた信号を用いて前記物体を照らす光源の色に関する情報を取得させ
前記光源の色に関する情報と前記一対の像信号とを用いて、前記物体からの鏡面反射光による出力に対応する相関評価値の重みを下げて前記デフォーカス量を算出させることを特徴とする焦点検出プログラム。
A computer program that causes a computer to perform the following processing:
A pair of image signals generated using outputs from a plurality of photoelectric conversion elements that respectively photoelectrically convert a pair of object images formed by light beams that have passed through different regions in the exit pupil of the optical system among light from the object A plurality of correlation evaluation values are generated by performing a correlation calculation on the optical system, and the defocus amount of the optical system is calculated using the correlation evaluation values.
Obtaining information on the color of the light source that illuminates the object using a signal obtained by imaging the object ;
Using the information on the color of the light source and the pair of image signals, the defocus amount is calculated by reducing the weight of the correlation evaluation value corresponding to the output by the specular reflection light from the object. Detection program.
JP2014136466A 2014-07-02 2014-07-02 Focus detection apparatus, imaging apparatus, focus detection method, and focus detection program Expired - Fee Related JP6415139B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014136466A JP6415139B2 (en) 2014-07-02 2014-07-02 Focus detection apparatus, imaging apparatus, focus detection method, and focus detection program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014136466A JP6415139B2 (en) 2014-07-02 2014-07-02 Focus detection apparatus, imaging apparatus, focus detection method, and focus detection program

Publications (2)

Publication Number Publication Date
JP2016014753A JP2016014753A (en) 2016-01-28
JP6415139B2 true JP6415139B2 (en) 2018-10-31

Family

ID=55230983

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014136466A Expired - Fee Related JP6415139B2 (en) 2014-07-02 2014-07-02 Focus detection apparatus, imaging apparatus, focus detection method, and focus detection program

Country Status (1)

Country Link
JP (1) JP6415139B2 (en)

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000330002A (en) * 1999-05-20 2000-11-30 Olympus Optical Co Ltd Range finder
JP4447520B2 (en) * 2005-06-29 2010-04-07 株式会社市川ソフトラボラトリー Image processing apparatus and image processing method
JP5084322B2 (en) * 2007-03-29 2012-11-28 キヤノン株式会社 Imaging apparatus and control method thereof
JP2013258675A (en) * 2012-05-16 2013-12-26 Canon Inc Image processing apparatus, image processing method and program, and image pick-up device

Also Published As

Publication number Publication date
JP2016014753A (en) 2016-01-28

Similar Documents

Publication Publication Date Title
US8531583B2 (en) Image capturing apparatus and image processing method
US20110007176A1 (en) Image processing apparatus and image processing method
JP5000413B2 (en) Imaging system and image signal processing program
US9615017B2 (en) Focus detection apparatus and method, method of controlling focus detection apparatus, and image capturing apparatus
US20120057057A1 (en) Image capturing apparatus
US10530994B2 (en) Image capture apparatus, control method for image capture apparatus and non-transitory recording medium for combining image
JP2009008928A (en) Imaging device and image signal processing program
US20160094776A1 (en) Imaging apparatus and imaging method
JP5737929B2 (en) Image processing apparatus and image processing method
US10362214B2 (en) Control apparatus, image capturing apparatus, control method, and non-transitory computer-readable storage medium
JP2014032214A (en) Imaging apparatus and focus position detection method
JP2017158018A (en) Image processing apparatus, control method of the same, and imaging apparatus
JP5289105B2 (en) Image processing apparatus, control method therefor, and imaging apparatus
JP2015142364A (en) Image processing device, imaging apparatus and image processing method
US20160080635A1 (en) Image capture apparatus and method for controlling the same
JP2017032646A (en) Image-capturing device and method for controlling the same
JP7446804B2 (en) Imaging device, its control method, and program
JP7479831B2 (en) Imaging device, control method thereof, and program
JP6974599B2 (en) Image pickup device, distance measurement method, distance measurement program and recording medium
JP6559021B2 (en) Imaging apparatus and control program therefor
JP7057090B2 (en) Distance measuring device and distance measuring method
JP6071761B2 (en) Imaging apparatus and control method thereof
JP6678505B2 (en) Imaging device, control method therefor, program, and storage medium
JP6415139B2 (en) Focus detection apparatus, imaging apparatus, focus detection method, and focus detection program
JP2015014788A (en) Ranging device, image capturing device, and method of controlling ranging device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20170616

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20180123

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20180130

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20180323

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20180904

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20181002

R151 Written notification of patent or utility model registration

Ref document number: 6415139

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

LAPS Cancellation because of no payment of annual fees