JP2016066015A - Focus detector, control method thereof, program, and memory medium - Google Patents

Focus detector, control method thereof, program, and memory medium Download PDF

Info

Publication number
JP2016066015A
JP2016066015A JP2014195808A JP2014195808A JP2016066015A JP 2016066015 A JP2016066015 A JP 2016066015A JP 2014195808 A JP2014195808 A JP 2014195808A JP 2014195808 A JP2014195808 A JP 2014195808A JP 2016066015 A JP2016066015 A JP 2016066015A
Authority
JP
Japan
Prior art keywords
image
focus detection
image signal
pixel
phase difference
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2014195808A
Other languages
Japanese (ja)
Inventor
勇希 吉村
Yuki Yoshimura
勇希 吉村
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 JP2014195808A priority Critical patent/JP2016066015A/en
Publication of JP2016066015A publication Critical patent/JP2016066015A/en
Pending legal-status Critical Current

Links

Landscapes

  • Focusing (AREA)
  • Automatic Focus Adjustment (AREA)
  • Transforming Light Signals Into Electric Signals (AREA)
  • Studio Devices (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a focus detector capable of improving accuracy in focus detection of a phase difference detection method in which an output of an imaging device is used, and a control method of the focus detector.SOLUTION: The focus detector has: a first calculation part that detects a first phase difference between a first image signal based on a luminous flux passing through a part of region of an exit pupil of a photographic optical system, and a third image signal based on the luminous flux passing through a whole region of the exit pupil; a second calculation part that calculates a second phase difference between a second image signal based on the luminous flux passing through another part of region different from the part of the exit pupil, and a fourth image signal based on the luminous flux passing through the whole region of the exit pupil; and a defocus amount calculation part that calculates a defocus amount of the photographic optical system by using a sum obtained by multiplying the first phase difference and the second phase difference by weighting factors and adding the phase differences together.SELECTED DRAWING: Figure 12

Description

本発明は、焦点検出装置およびその制御方法に関し、特には撮像素子の出力に基づいて位相差検出方式の焦点検出を行う焦点検出装置およびその制御方法に関する。   The present invention relates to a focus detection apparatus and a control method thereof, and more particularly to a focus detection apparatus that performs phase difference detection type focus detection based on an output of an image sensor and a control method thereof.

2次元配置された画素の各々にマイクロレンズが形成された撮像素子を用い、瞳分割方式の焦点検出を行う装置が特許文献1に開示されている。この装置では、各画素の光電変換部が、撮影レンズの射出瞳の異なる領域を通過した光束をマイクロレンズを介して受光する、2つの領域に分割されている。分割領域ごとに複数の画素から生成した1対の出力信号に対して相関演算を行って1対の出力信号の位相差(ずれ量)を算出し、位相差からデフォーカス量を算出することができる。   Patent Document 1 discloses an apparatus that performs focus detection by pupil division using an imaging element in which a microlens is formed in each of two-dimensionally arranged pixels. In this apparatus, the photoelectric conversion unit of each pixel is divided into two regions that receive light beams that have passed through different regions of the exit pupil of the photographing lens through the microlens. A correlation operation is performed on a pair of output signals generated from a plurality of pixels for each divided region to calculate a phase difference (shift amount) between the pair of output signals, and a defocus amount is calculated from the phase difference. it can.

また、特許文献1の図24,図25や特許文献2には、一部の画素を、瞳分割方式の焦点検出を行うための焦点検出用画素とした撮像素子が開示されている。焦点検出画素の出力を通常の画素の出力として用いるには補正が必要だが、各画素の光電変換部を分割する構成よりも焦点検出信号として読みだす信号が少ないため、撮像素子の製造コストや信号処理の演算コストを抑えることができる。   Further, FIGS. 24 and 25 of Patent Document 1 and Patent Document 2 disclose an imaging device in which some pixels are focus detection pixels for performing pupil division focus detection. Correction is necessary to use the output of the focus detection pixel as the output of the normal pixel, but the number of signals to be read out as the focus detection signal is smaller than the configuration in which the photoelectric conversion unit of each pixel is divided. Processing cost of processing can be suppressed.

特開2008−52009号公報JP 2008-52009 A 特許第3592147号公報Japanese Patent No. 3592147

焦点検出用画素を用いる構成では、撮影レンズの射出瞳の異なる領域を通過した光束をマイクロレンズを介して受光する1対の光電変換部が、互いに異なる画素に配置されている。つまり、位相差を検出するための1対の出力信号(A像、B像)の生成に用いられる画素群の位置がA像とB像とで異なるため、被写体像のパターンによってはA像とB像の類似度が低くなる場合があり、そのような場合には、焦点検出の精度が低下する。   In the configuration using the focus detection pixels, a pair of photoelectric conversion units that receive light beams that have passed through different regions of the exit pupil of the photographing lens through the microlens are arranged in different pixels. That is, the position of the pixel group used for generating a pair of output signals (A image and B image) for detecting the phase difference differs between the A image and the B image. In some cases, the similarity of the B image becomes low, and in such a case, the accuracy of focus detection decreases.

また、焦点検出用画素の配置間隔が広い場合には、被写体光学像の高周波帯域の周波数成分を取得できない場合がある。そのため、A像とB像それぞれに異なる折り返しノイズが発生し、焦点検出誤差が発生してしまう。   Further, when the focus detection pixel arrangement interval is wide, it may be impossible to acquire the frequency component in the high frequency band of the subject optical image. Therefore, different aliasing noises are generated in the A image and the B image, and a focus detection error occurs.

また、各画素に複数の光電変換部を設ける構成では、各光電変換部からの読み出しに加え、通常の画像信号を生成するための加算が必要となり、読み出し処理や演算処理の負荷が大きくなる。そのため、一方の光電変換部の出力の読み出しと、両方の光電変換部の出力の加算読み出しとを行い、他方の光電変換部の出力は減算によって生成することで、負荷の軽減を図ることが考えられる。しかし、減算によって誤差が発生するため、位相差検出精度が低下する懸念がある。   In addition, in a configuration in which a plurality of photoelectric conversion units are provided in each pixel, in addition to reading from each photoelectric conversion unit, addition for generating a normal image signal is necessary, which increases the load of reading processing and arithmetic processing. Therefore, it is considered to reduce the load by reading out the output of one photoelectric conversion unit and adding and reading the outputs of both photoelectric conversion units, and generating the output of the other photoelectric conversion unit by subtraction. It is done. However, since an error occurs due to the subtraction, there is a concern that the phase difference detection accuracy is lowered.

本発明はこのような従来技術の課題の少なくとも1つを改善することを目的とする。具体的には、本発明は、撮像素子の出力を用いた位相差検出方式の焦点検出の精度を向上させることが可能な焦点検出装置およびその制御方法を提供することを目的とする。   The present invention aims to improve at least one of the problems of the prior art. Specifically, an object of the present invention is to provide a focus detection apparatus and a control method thereof that can improve the accuracy of focus detection by a phase difference detection method using the output of an image sensor.

本発明に係わる焦点検出装置は、撮影光学系の射出瞳の一部の領域を通過した光束に基づく第1の像信号と、前記射出瞳の全領域を通過した光束に基づく第3の像信号との第1の位相差を検出する第1の算出手段と、前記射出瞳の前記一部の領域とは異なる一部の領域を通過した光束に基づく第2の像信号と、前記射出瞳の全領域を通過した光束に基づく第4の像信号との第2の位相差を検出する第2の算出手段と、前記第1の位相差および前記第2の位相差に重みづけ係数を掛けて加えた和を用いて、前記撮影光学系のデフォーカス量を算出するデフォーカス量算出手段と、を有することを特徴とする。   The focus detection apparatus according to the present invention includes a first image signal based on a light beam that has passed through a partial area of an exit pupil of a photographing optical system, and a third image signal based on a light beam that has passed through the entire area of the exit pupil. A first calculating means for detecting a first phase difference between the first pupil and the second pupil, and a second image signal based on a light beam that has passed through a partial area different from the partial area of the exit pupil, A second calculating means for detecting a second phase difference with the fourth image signal based on the light flux that has passed through the entire area; and multiplying the first phase difference and the second phase difference by a weighting coefficient. Defocus amount calculation means for calculating the defocus amount of the photographing optical system using the added sum.

このような構成により、本発明によれば、撮像素子の出力を用いた位相差検出方式の焦点検出の精度を向上させることが可能な焦点検出装置およびその制御方法を提供することができる。   With such a configuration, according to the present invention, it is possible to provide a focus detection apparatus capable of improving the accuracy of focus detection by the phase difference detection method using the output of the image sensor and a control method thereof.

実施形態に係る焦点調節装置を備える撮像装置の一例としてのカメラシステムの機能構成例を示すブロック図。1 is a block diagram illustrating an example of a functional configuration of a camera system as an example of an imaging apparatus including a focus adjustment device according to an embodiment. 第1の実施形態における撮像素子の構成例を示す図。FIG. 3 is a diagram illustrating a configuration example of an image sensor according to the first embodiment. 第1の実施形態における光電変換領域と射出瞳との関係を示す図。The figure which shows the relationship between the photoelectric conversion area | region and exit pupil in 1st Embodiment. 実施形態における、焦点検出領域とAF用信号に用いられる画素の関係例を示す図。4 is a diagram illustrating an example of a relationship between a focus detection area and pixels used for AF signals in the embodiment. FIG. 実施形態における焦点調節動作を示すフローチャート。6 is a flowchart illustrating a focus adjustment operation in the embodiment. 第1の実施形態におけるデフォーカス量の算出方法を示すフローチャート。6 is a flowchart illustrating a defocus amount calculation method according to the first embodiment. 第2の実施形態における撮像素子の構成例を示す図。FIG. 6 is a diagram illustrating a configuration example of an image sensor according to a second embodiment. 第2の実施形態における光電変換領域と射出瞳との関係を示す図。The figure which shows the relationship between the photoelectric conversion area | region and exit pupil in 2nd Embodiment. 第3の実施形態におけるデフォーカス量の算出方法を示すフローチャート。10 is a flowchart illustrating a defocus amount calculation method according to the third embodiment. 撮影レンズの射出瞳距離と焦点検出用画素が見ている瞳位置の関係を示した図。The figure which showed the relationship between the exit pupil distance of a photographic lens, and the pupil position which the focus detection pixel is looking at. 像高が高い場合に、AF用A像信号とAF用B像信号で、瞳のケラレ方が大きく異なることを説明した図。The figure explaining that the vignetting of the pupil differs greatly between the A image signal for AF and the B image signal for AF when the image height is high. 第4の実施形態におけるデフォーカス量の算出サブルーチンを示すフローチャート。14 is a flowchart illustrating a defocus amount calculation subroutine according to the fourth embodiment. 図12におけるステップS7041の詳細な処理を示すフローチャート。The flowchart which shows the detailed process of step S7041 in FIG. 図12におけるステップS7041の詳細な処理を示すフローチャート。The flowchart which shows the detailed process of step S7041 in FIG.

●(第1の実施形態)
以下、本発明の例示的な実施形態を添付図面を参照して詳細に説明する。
● (first embodiment)
Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings.

図1は、本発明の実施形態に係る焦点検出装置を備える撮像装置の一例としての、撮影レンズを交換可能なカメラと撮影レンズからなるカメラシステムの構成例を示す図である。図1において、カメラシステムはカメラ100と、交換可能な撮影レンズ300とから構成される。   FIG. 1 is a diagram illustrating a configuration example of a camera system including a camera and a photographic lens in which a photographic lens can be exchanged, as an example of an imaging device including a focus detection device according to an embodiment of the present invention. In FIG. 1, the camera system includes a camera 100 and an interchangeable photographic lens 300.

撮影レンズ300を通過した光束は、レンズマウント106を通過し、メインミラー130により上方へ反射されて光学ファインダ104に入射する。光学ファインダ104により、撮影者は被写体光学像を観察しながら撮影できる。光学ファインダ104内には、表示部54の一部の機能、例えば、合焦表示、手振れ警告表示、絞り値表示、露出補正表示等が設置されている。   The light beam that has passed through the photographing lens 300 passes through the lens mount 106, is reflected upward by the main mirror 130, and enters the optical viewfinder 104. The optical viewfinder 104 allows the photographer to shoot while observing the subject optical image. In the optical viewfinder 104, some functions of the display unit 54, for example, focus display, camera shake warning display, aperture value display, exposure correction display, and the like are installed.

メインミラー130の一部は半透過性のハーフミラーで構成され、メインミラー130に入射する光束のうち一部はこのハーフミラー部分を通過し、サブミラー131で下方へ反射されて焦点検出装置105へ入射する。焦点検出装置105は、2次結像光学系とラインセンサを有する位相差検出方式の焦点検出装置であり、1対の像信号をAF部(オートフォーカス部)42に出力する。AF部42では、1対の像信号に対して位相差検出演算を行い、撮影レンズ300のデフォーカス量および方向を求める。この演算結果に基づき、システム制御部50が、撮影レンズ300のフォーカス制御部342(後述)に対して、焦点調節処理などの制御を行う。本実施形態では、焦点検出結果の補正もAF部42で行う。   A part of the main mirror 130 is composed of a semi-transmissive half mirror, and a part of the light beam incident on the main mirror 130 passes through the half mirror part and is reflected downward by the sub mirror 131 to the focus detection device 105. Incident. The focus detection device 105 is a phase difference detection type focus detection device having a secondary imaging optical system and a line sensor, and outputs a pair of image signals to an AF unit (autofocus unit) 42. The AF unit 42 performs a phase difference detection calculation for a pair of image signals, and obtains the defocus amount and direction of the photographing lens 300. Based on the calculation result, the system control unit 50 controls the focus control unit 342 (described later) of the taking lens 300, such as a focus adjustment process. In this embodiment, the AF detection unit 42 also corrects the focus detection result.

撮影レンズ300の焦点調節処理が終了して静止画撮影を行う場合や、電子ファインダ表示を行う場合、動画撮影を行う場合には、不図示のクイックリターン機構によりメインミラー130とサブミラー131を光路外に退避させる。そうすると、撮影レンズ300を通過してカメラ100に入射する光束は、露光量を制御するためのシャッター12を介して、撮像素子14に入射可能になる。撮像素子14による撮影動作終了後には、メインミラー130とサブミラー131は図示する様な位置に戻る。   When the focus adjustment processing of the photographic lens 300 is completed and still image shooting is performed, when an electronic viewfinder display is performed, or when moving image shooting is performed, the main mirror 130 and the sub mirror 131 are moved out of the optical path by a quick return mechanism (not shown). Evacuate. Then, the light beam that passes through the photographing lens 300 and enters the camera 100 can enter the image sensor 14 via the shutter 12 for controlling the exposure amount. After the photographing operation by the image sensor 14 is completed, the main mirror 130 and the sub mirror 131 return to the positions as shown in the figure.

撮像素子14はCCDまたはCMOSイメージセンサであり、複数の画素が2次元的に配置された構成を有し、被写体光学像を画素ごとに光電変換して電気信号を出力する。撮像素子14にて光電変換された電気信号はA/D変換器16へ送られ、アナログ信号出力がデジタル信号(画像データ)に変換される。タイミング発生回路18は、撮像素子14、A/D変換器16、D/A変換器26にクロック信号や制御信号を供給する。タイミング発生回路18はメモリ制御部22及びシステム制御部50により制御される。画像処理部20は、A/D変換器16からの画像データ或いはメモリ制御部22からの画像データに対して画素補間処理、ホワイトバランス調整処理、色変換処理などの所定の処理を適用する。   The image sensor 14 is a CCD or CMOS image sensor, has a configuration in which a plurality of pixels are two-dimensionally arranged, photoelectrically converts a subject optical image for each pixel, and outputs an electrical signal. The electrical signal photoelectrically converted by the image sensor 14 is sent to the A / D converter 16, and the analog signal output is converted into a digital signal (image data). The timing generation circuit 18 supplies a clock signal and a control signal to the image sensor 14, the A / D converter 16, and the D / A converter 26. The timing generation circuit 18 is controlled by the memory control unit 22 and the system control unit 50. The image processing unit 20 applies predetermined processing such as pixel interpolation processing, white balance adjustment processing, and color conversion processing to the image data from the A / D converter 16 or the image data from the memory control unit 22.

本実施形態に係る撮像素子14は一部の画素が焦点検出用画素として構成されており、クイックリターン機構によりメインミラー130とサブミラー131が光路外に退避した状態においても位相差検出方式の焦点検出を可能にしている。撮像素子14で得られた画像データのうち、焦点検出用信号の生成に用いられる画素のデータは、画像処理部20で焦点検出用データに変換される。その後、焦点検出用データはシステム制御部50を介してAF部42へ送られ、AF部42は焦点検出用データに基づいて撮影レンズ300の焦点調節を行う。   In the imaging device 14 according to the present embodiment, some pixels are configured as focus detection pixels, and even when the main mirror 130 and the sub mirror 131 are retracted out of the optical path by the quick return mechanism, focus detection by the phase difference detection method is performed. Is possible. Of the image data obtained by the image sensor 14, pixel data used for generating a focus detection signal is converted into focus detection data by the image processing unit 20. Thereafter, the focus detection data is sent to the AF unit 42 via the system control unit 50, and the AF unit 42 adjusts the focus of the photographing lens 300 based on the focus detection data.

なお、撮像素子14で撮影した画像データから画像処理部20でコントラスト評価値を演算し、システム制御部50が、撮影レンズ300のフォーカス制御部342に対して焦点合わせを行うコントラスト方式のAFも可能である。このように、本実施形態のカメラ100は、ライブビュー表示時や動画撮影時のようにメインミラー130とサブミラー131が光路外に退避していても、撮像素子14で得られる画像データから位相差検出方式AFとコントラスト方式AFの両方が可能である。また、本実施形態のカメラ100は、メインミラー130とサブミラー131が光路内にある通常の静止画撮影では、焦点検出装置105による位相差検出方式AFが可能である。従って、静止画撮影時、ライブビュー表示時、動画撮影時のどの状態においても焦点調節が可能である。   Note that contrast-based AF is also possible in which the image processing unit 20 calculates a contrast evaluation value from image data captured by the image sensor 14 and the system control unit 50 performs focusing on the focus control unit 342 of the imaging lens 300. It is. As described above, the camera 100 according to the present embodiment has a phase difference from the image data obtained by the image sensor 14 even when the main mirror 130 and the sub mirror 131 are retracted from the optical path as in live view display or moving image shooting. Both detection AF and contrast AF are possible. In addition, the camera 100 according to the present embodiment can perform phase difference detection AF using the focus detection device 105 in normal still image shooting in which the main mirror 130 and the sub mirror 131 are in the optical path. Therefore, focus adjustment is possible in any state during still image shooting, live view display, and moving image shooting.

メモリ制御部22は、A/D変換器16、タイミング発生回路18、画像処理部20、画像表示メモリ24、D/A変換器26、メモリ30、圧縮伸長部32を制御する。そして、A/D変換器16のデータが画像処理部20およびメモリ制御部22を介して、あるいはメモリ制御部22のみを介して、画像表示メモリ24あるいはメモリ30に書き込まれる。画像表示メモリ24に書き込まれた表示用の画像データは、D/A変換器26を介して液晶モニタ等から構成される画像表示部28に表示される。撮像素子14で撮影した動画像を画像表示部28に逐次表示することで、電子ファインダ機能(ライブビュー表示)を実現できる。画像表示部28は、システム制御部50の指示により表示をON/OFFすることが可能であり、表示をOFFにした場合にはカメラ100の電力消費を大幅に低減できる。   The memory control unit 22 controls the A / D converter 16, the timing generation circuit 18, the image processing unit 20, the image display memory 24, the D / A converter 26, the memory 30, and the compression / decompression unit 32. Then, the data of the A / D converter 16 is written into the image display memory 24 or the memory 30 through the image processing unit 20 and the memory control unit 22 or only through the memory control unit 22. Display image data written in the image display memory 24 is displayed on an image display unit 28 including a liquid crystal monitor or the like via a D / A converter 26. An electronic viewfinder function (live view display) can be realized by sequentially displaying a moving image captured by the image sensor 14 on the image display unit 28. The image display unit 28 can turn on / off the display according to an instruction from the system control unit 50. When the display is turned off, the power consumption of the camera 100 can be greatly reduced.

また、メモリ30は、撮影した静止画像や動画像の一時記憶に用いられ、所定枚数の静止画像や所定時間の動画像を記憶するのに十分な記憶容量を備えている。これにより、連射撮影やパノラマ撮影の場合にも、高速かつ大量の画像書き込みをメモリ30に対して行うことができる。また、メモリ30はシステム制御部50の作業領域としても使用できる。圧縮伸長部32は、適応離散コサイン変換(ADCT)等により画像データを圧縮伸長する機能を有し、メモリ30に記憶された画像を読み込んで圧縮処理或いは伸長処理を行い、処理を終えた画像データをメモリ30に書き戻す。   The memory 30 is used for temporary storage of captured still images and moving images, and has a storage capacity sufficient to store a predetermined number of still images and moving images for a predetermined time. Thereby, even in the case of continuous shooting or panoramic shooting, a large amount of image writing can be performed on the memory 30 at high speed. The memory 30 can also be used as a work area for the system control unit 50. The compression / decompression unit 32 has a function of compressing / decompressing image data by adaptive discrete cosine transform (ADCT) or the like, reads an image stored in the memory 30, performs compression processing or decompression processing, and finishes the processed image data Is written back to the memory 30.

シャッター制御部36は、測光部46からの測光情報に基づいて、撮影レンズ300の絞り312を制御する絞り制御部344と連携しながら、シャッター12を制御する。インターフェース部38とコネクタ122は、カメラ100と撮影レンズ300とを電気的に接続する。これらは、カメラ100と撮影レンズ300との間で制御信号、状態信号、データ信号等を伝え合うと共に、各種電圧の電流を供給する機能も備えている。また、電気通信のみならず、光通信、音声通信等を伝達する構成としてもよい。   The shutter control unit 36 controls the shutter 12 based on the photometric information from the photometric unit 46 in cooperation with the aperture control unit 344 that controls the aperture 312 of the photographing lens 300. The interface unit 38 and the connector 122 electrically connect the camera 100 and the photographing lens 300. These have functions of transmitting control signals, status signals, data signals, and the like between the camera 100 and the photographing lens 300 and supplying currents of various voltages. Moreover, it is good also as a structure which transmits not only electrical communication but optical communication, audio | voice communication, etc.

測光部46は、自動露出制御(AE)処理を行う。撮影レンズ300を通過した光束を、レンズマウント106、メインミラー130、そして不図示の測光用レンズを介して、測光部46に入射させることにより、被写体光学像の輝度を測定できる。被写体輝度と露出条件とを対応付けたプログラム線図などを用いて、測光部46は露出条件を決定することができる。また、測光部46は、フラッシュ48と連携することで調光処理機能も有する。なお、画像処理部20による撮像素子14の画像データを演算した演算結果に基づき、システム制御部50が、シャッター制御部36と撮影レンズ300の絞り制御部344に対してAE制御を行うことも可能である。フラッシュ48は、AF補助光の投光機能、フラッシュ調光機能も有する。   The photometry unit 46 performs automatic exposure control (AE) processing. The light flux that has passed through the photographic lens 300 is incident on the photometric unit 46 via the lens mount 106, the main mirror 130, and a photometric lens (not shown), whereby the luminance of the subject optical image can be measured. The photometry unit 46 can determine the exposure condition by using a program diagram in which the subject brightness and the exposure condition are associated with each other. The photometry unit 46 also has a light control processing function in cooperation with the flash 48. The system control unit 50 can also perform AE control on the shutter control unit 36 and the aperture control unit 344 of the photographic lens 300 based on the calculation result obtained by calculating the image data of the image sensor 14 by the image processing unit 20. It is. The flash 48 also has an AF auxiliary light projecting function and a flash light control function.

システム制御部50は例えばCPUやMPUなどのプログラマブルプロセッサを有し、予め記憶されたプログラムを実行することによりカメラシステム全体の動作を制御する。不揮発性のメモリ52はシステム制御部50の動作用の定数、変数、プログラム等を記憶する。表示部54はシステム制御部50でのプログラムの実行に応じて、文字、画像、音声等を用いて動作状態やメッセージ等を表示する、例えば液晶表示装置である。表示部54はカメラ100の操作部近辺の視認し易い位置に単数或いは複数設置され、例えばLCDやLED等の組み合わせにより構成される。表示部54の表示内容のうち、LCD等に表示するものとしては、記録枚数や残撮影可能枚数等の撮影枚数に関する情報や、シャッタースピード、絞り値、露出補正、フラッシュ等の撮影条件に関する情報等がある。その他、電池残量や日付・時刻等も表示される。また、表示部54は、前述した様にその一部の機能が光学ファインダ104内に設置されている。   The system control unit 50 includes a programmable processor such as a CPU or MPU, and controls the operation of the entire camera system by executing a program stored in advance. The nonvolatile memory 52 stores constants, variables, programs, etc. for operating the system control unit 50. The display unit 54 is, for example, a liquid crystal display device that displays an operation state, a message, and the like using characters, images, sounds, and the like in accordance with execution of a program by the system control unit 50. One or a plurality of display units 54 are installed at positions in the vicinity of the operation unit of the camera 100 that are easily visible, and are configured by a combination of an LCD, an LED, and the like. Among the display contents of the display unit 54, what is displayed on the LCD or the like includes information on the number of shots such as the number of recorded sheets and the number of remaining shots, information on shooting conditions such as shutter speed, aperture value, exposure correction, and flash. There is. In addition, the remaining battery level, date / time, and the like are also displayed. Further, as described above, a part of the display unit 54 is installed in the optical viewfinder 104.

不揮発性メモリ56は、電気的に消去・記録可能なメモリであり、例えばEEPROM等が用いられる。60,62,64,66,68及び70は、システム制御部50の各種の動作指示を入力するための操作部であり、スイッチやダイアル、タッチパネル、視線検知によるポインティング、音声認識装置等の単数或いは複数の組み合わせで構成される。   The nonvolatile memory 56 is an electrically erasable / recordable memory, and for example, an EEPROM or the like is used. Reference numerals 60, 62, 64, 66, 68, and 70 are operation units for inputting various operation instructions of the system control unit 50, such as a switch, a dial, a touch panel, pointing by gaze detection, a voice recognition device, or the like. Consists of multiple combinations.

モードダイアル60は、電源オフ、オート撮影モード、マニュアル撮影モード、再生モード、PC接続モード等の各機能モードを切り替え設定できる。シャッタースイッチSW1である62は、不図示のシャッターボタンが半押しされるとONとなり、AF処理、AE処理、AWB処理、EF処理等の動作開始を指示する。シャッタースイッチSW2である64は、シャッターボタンが全押しされるとONとなり、撮影に関する一連の処理の動作開始を指示する。撮影に関する一連の処理とは、露光処理、現像処理及び記録処理等のことである。露光処理では、撮像素子14から読み出した信号をA/D変換器16、メモリ制御部22を介してメモリ30に画像データとして書き込む。現像処理では、画像処理部20やメモリ制御部22での演算を用いた現像を行う。記録処理では、メモリ30から画像データを読み出し、圧縮伸長部32で圧縮を行い、記録媒体200或いは210に画像データとして書き込む。   The mode dial 60 can switch and set each function mode such as power-off, auto shooting mode, manual shooting mode, playback mode, and PC connection mode. A shutter switch SW1 62 is turned on when a shutter button (not shown) is half-pressed, and instructs to start operations such as AF processing, AE processing, AWB processing, and EF processing. The shutter switch SW2 64 is turned on when the shutter button is fully pressed, and instructs the start of a series of processing related to photographing. A series of processing related to photographing is exposure processing, development processing, recording processing, and the like. In the exposure process, the signal read from the image sensor 14 is written as image data in the memory 30 via the A / D converter 16 and the memory control unit 22. In the development process, development is performed using computations in the image processing unit 20 and the memory control unit 22. In the recording process, image data is read from the memory 30, compressed by the compression / decompression unit 32, and written as image data on the recording medium 200 or 210.

画像表示ON/OFFスイッチ66は、画像表示部28のON/OFFを設定できる。この機能により、光学ファインダ104を用いて撮影を行う際に、液晶モニタ等から成る画像表示部28への電流供給を遮断することにより、省電力を図ることができる。クイックレビューON/OFFスイッチ68は、撮影した画像データを撮影直後に自動再生するクイックレビュー機能を設定する。操作部70は、各種ボタンやタッチパネル等からなる。各種ボタンには、メニューボタン、フラッシュ設定ボタン、単写/連写/セルフタイマー切り替えボタン、露出補正ボタン等がある。   The image display ON / OFF switch 66 can set ON / OFF of the image display unit 28. With this function, when photographing using the optical viewfinder 104, power supply can be saved by cutting off the current supply to the image display unit 28 including a liquid crystal monitor or the like. The quick review ON / OFF switch 68 sets a quick review function for automatically reproducing captured image data immediately after shooting. The operation unit 70 includes various buttons and a touch panel. The various buttons include a menu button, a flash setting button, a single shooting / continuous shooting / self-timer switching button, an exposure correction button, and the like.

電源制御部80は、電池検出回路、DC/DCコンバータ、通電するブロックを切り替えるスイッチ回路等により構成されている。電池の装着の有無、電池の種類、電池残量の検出を行い、検出結果及びシステム制御部50の指示に基づいてDC/DCコンバータを制御し、必要な電圧を必要な期間、記録媒体を含む各部へ供給する。コネクタ82及び84は、アルカリ電池やリチウム電池等の一次電池やNiCd電池やNiMH電池、リチウムイオン電池等の二次電池、ACアダプタ等からなる電源部86をカメラ100と接続する。   The power supply control unit 80 is configured by a battery detection circuit, a DC / DC converter, a switch circuit that switches blocks to be energized, and the like. The presence / absence of a battery, the type of battery, and the remaining battery level are detected, the DC / DC converter is controlled based on the detection result and the instruction of the system control unit 50, and a necessary voltage is included for a necessary period and a recording medium. Supply to each part. The connectors 82 and 84 connect the camera 100 with a power supply unit 86 including a primary battery such as an alkaline battery or a lithium battery, a secondary battery such as a NiCd battery, a NiMH battery, or a lithium ion battery, or an AC adapter.

インターフェース90及び94は、メモリカードやハードディスク等の記録媒体との接続機能を有し、コネクタ92及び96は、メモリカードやハードディスク等の記録媒体と物理的接続を行う。記録媒体着脱検知部98は、コネクタ92または96に記録媒体が装着されているかどうかを検知する。なお、本実施形態では、記録媒体を取り付けるインターフェース及びコネクタを2系統持つものとして説明しているが、インターフェース及びコネクタは、単数あるいは複数、いずれの系統数を備える構成としても構わない。また、異なる規格のインターフェース及びコネクタを組み合わせて備える構成としても構わない。更に、インターフェース及びコネクタにLANカード等の各種通信カードを接続することで、コンピュータやプリンタ等の他の周辺機器との間で画像データや画像データに付属した管理情報を転送し合うことができる。   The interfaces 90 and 94 have a connection function with a recording medium such as a memory card or a hard disk, and the connectors 92 and 96 make a physical connection with a recording medium such as a memory card or a hard disk. The recording medium attachment / detachment detection unit 98 detects whether or not a recording medium is attached to the connector 92 or 96. Although the present embodiment has been described as having two systems of interfaces and connectors for attaching the recording medium, the interface and connectors may have a single system or a plurality of systems. Moreover, it is good also as a structure provided with combining the interface and connector of a different standard. Furthermore, by connecting various communication cards such as a LAN card to the interface and connector, it is possible to transfer image data and management information attached to the image data to and from other peripheral devices such as a computer and a printer.

通信部110は、有線通信、無線通信等の各種通信機能を有する。コネクタ112は、通信部110によりカメラ100を他の機器と接続し、無線通信の場合はアンテナである。記録媒体200及び210は、メモリカードやハードディスク等である。記録媒体200及び210は、半導体メモリや磁気ディスク等から構成される記録部202,212、カメラ100とのインターフェース204,214、カメラ100と接続を行うコネクタ206,216を備えている。   The communication unit 110 has various communication functions such as wired communication and wireless communication. The connector 112 connects the camera 100 to other devices via the communication unit 110, and is an antenna in the case of wireless communication. The recording media 200 and 210 are a memory card, a hard disk, or the like. The recording media 200 and 210 include recording units 202 and 212 configured by a semiconductor memory, a magnetic disk, and the like, interfaces 204 and 214 with the camera 100, and connectors 206 and 216 for connecting with the camera 100.

次に、撮影レンズ300について説明する。撮影レンズ300は、レンズマウント306をカメラ100のレンズマウント106に係合させることによりにカメラ100と機械的並びに電気的に結合される。電気的な結合はレンズマウント106及びレンズマウント306に設けられたコネクタ122及びコネクタ322によって実現される。レンズ311には撮影レンズ300の合焦距離を調節するためのフォーカスレンズが含まれ、フォーカス制御部342はフォーカスレンズを光軸に沿って駆動することで撮影レンズ300の焦点調節を行う。絞り312はカメラ100に入射する被写体光の量と角度を調節する。   Next, the photographing lens 300 will be described. The taking lens 300 is mechanically and electrically coupled to the camera 100 by engaging the lens mount 306 with the lens mount 106 of the camera 100. Electrical coupling is realized by the connector 122 and the connector 322 provided on the lens mount 106 and the lens mount 306. The lens 311 includes a focus lens for adjusting the focusing distance of the photographic lens 300, and the focus control unit 342 adjusts the focus of the photographic lens 300 by driving the focus lens along the optical axis. The diaphragm 312 adjusts the amount and angle of subject light incident on the camera 100.

コネクタ322及びインターフェース338は、撮影レンズ300をカメラ100のコネクタ122と電気的に接続する。そして、コネクタ322は、カメラ100と撮影レンズ300との間で制御信号、状態信号、データ信号等を伝え合うと共に、各種電圧の電流を供給される機能も備えている。コネクタ322は電気通信のみならず、光通信、音声通信等を伝達する構成としてもよい。   The connector 322 and the interface 338 electrically connect the photographing lens 300 to the connector 122 of the camera 100. The connector 322 has a function of transmitting a control signal, a status signal, a data signal, and the like between the camera 100 and the photographing lens 300 and supplying currents of various voltages. The connector 322 may be configured to transmit not only electrical communication but also optical communication, voice communication, and the like.

ズーム制御部340はレンズ311の変倍レンズを駆動し、撮影レンズ300の焦点距離(画角)を調整する。撮影レンズ300が単焦点レンズであればズーム制御部340は存在しない。絞り制御部344は、測光部46からの測光情報に基づいて、シャッター12を制御するシャッター制御部36と連携しながら、絞り312を制御する。   The zoom control unit 340 drives the variable power lens of the lens 311 and adjusts the focal length (view angle) of the photographing lens 300. If the taking lens 300 is a single focus lens, the zoom control unit 340 does not exist. The aperture control unit 344 controls the aperture 312 in cooperation with the shutter control unit 36 that controls the shutter 12 based on the photometry information from the photometry unit 46.

レンズシステム制御部346は例えばCPUやMPUなどのプログラマブルプロセッサを有し、予め記憶されたプログラムを実行することにより撮影レンズ300全体の動作を制御する。そして、レンズシステム制御部346は、撮影レンズの動作用の定数、変数、プログラム等を記憶するメモリの機能を備えている。不揮発性メモリ348は、撮影レンズ固有の番号等の識別情報、管理情報、開放絞り値や最小絞り値、焦点距離等の機能情報、現在や過去の各設定値などを記憶する。   The lens system control unit 346 has a programmable processor such as a CPU or an MPU, for example, and controls the entire operation of the photographing lens 300 by executing a program stored in advance. The lens system control unit 346 has a memory function for storing constants, variables, programs, and the like for operating the photographing lens. The nonvolatile memory 348 stores identification information such as a number unique to the photographing lens, management information, function information such as an open aperture value, a minimum aperture value, and a focal length, and current and past setting values.

本実施形態においては、撮影レンズ300の状態に応じたレンズ枠情報も記憶されている。このレンズ枠情報は、撮影レンズを通過する光束を決定する枠開口の半径の情報と、撮像素子14から枠開口までの距離の情報である。絞り312は、撮影レンズを通過する光束を決定する枠に含まれ、他にもレンズを保持するレンズ枠部品の開口などが枠に該当する。また、撮影レンズを通過する光束を決定する枠は、レンズ311のフォーカス位置やズーム位置によって異なるため、レンズ枠情報はレンズ311のフォーカス位置やズーム位置に対応して複数用意されている。そして、カメラ100が、焦点検出手段を用いて焦点検出を行う際には、レンズ311のフォーカス位置とズーム位置に対応した最適なレンズ枠情報が選択され、カメラ100にコネクタ322を通じて送られる。   In the present embodiment, lens frame information corresponding to the state of the photographing lens 300 is also stored. This lens frame information is information on the radius of the frame opening that determines the light beam passing through the photographing lens and information on the distance from the image sensor 14 to the frame opening. The diaphragm 312 is included in a frame that determines a light beam that passes through the photographing lens, and an opening of a lens frame component that holds the lens corresponds to the frame. In addition, since the frame for determining the light flux that passes through the photographing lens differs depending on the focus position and zoom position of the lens 311, a plurality of pieces of lens frame information are prepared corresponding to the focus position and zoom position of the lens 311. When the camera 100 performs focus detection using the focus detection means, optimal lens frame information corresponding to the focus position and zoom position of the lens 311 is selected and sent to the camera 100 through the connector 322.

以上が、カメラ100と撮影レンズ300からなる本実施形態のカメラシステムの構成である。   The above is the configuration of the camera system according to this embodiment including the camera 100 and the photographing lens 300.

次に、撮像素子14を用いた位相差検出方式の焦点検出動作について説明する。   Next, the focus detection operation of the phase difference detection method using the image sensor 14 will be described.

図2(A)は本実施形態における撮像素子14の画素配列の例を模式的に示した図で、CMOSイメージセンサに2次元配置された画素群のうち、縦(Y軸方向)6行と横(X軸方向)8列の範囲を、撮影レンズ300側から観察した状態を示している。撮像素子14はベイヤー配列のカラーフィルタを有し、偶数行の画素には左から順に緑(Green)と赤(Red)のカラーフィルタが、奇数行の画素には左から順に青(Blue)と緑(Green)のカラーフィルタが、それぞれ交互に設けられる。ただし、本実施形態の撮像素子14では、焦点検出用の光電変換部を有する画素については、本来の青のカラーフィルタに代えて緑のカラーフィルタを設けている。なお、以下の説明において、青(または緑、赤)のカラーフィルタが設けられた画素を青画素(または緑画素、赤画素)と呼ぶ場合がある。   FIG. 2A is a diagram schematically showing an example of the pixel arrangement of the image sensor 14 in the present embodiment. Among the pixel groups arranged two-dimensionally in the CMOS image sensor, the vertical (Y-axis direction) is 6 rows. A state in which a range of 8 rows (in the X-axis direction) is observed from the photographing lens 300 side is shown. The image sensor 14 has a Bayer array color filter. The even-numbered pixels have green and red color filters in order from the left, and the odd-numbered pixels have blue in order from the left. Green color filters are alternately provided. However, in the image sensor 14 of the present embodiment, a green color filter is provided instead of the original blue color filter for the pixel having the photoelectric conversion unit for focus detection. In the following description, a pixel provided with a blue (or green, red) color filter may be referred to as a blue pixel (or green pixel, red pixel).

また、各画素にはオンチップマイクロレンズ211iが設けられ、オンチップマイクロレンズ211i内の矩形はそれぞれ光電変換部の受光領域を模式的に示している。焦点検出用の光電変換部311a,311bは、画素の中心から横方向に偏倚して配置されている。なお、以下の説明において、焦点検出用の光電変換部311a,311bが設けられた画素を、焦点検出用画素と呼ぶことがある。また、焦点検出用の光電変換部311a,311bは、本来の青(Blue)画素に代えて設けられた緑画素に配置されている。これは、青(Blue)画素の出力が、最も画質に対して影響度が低いためである。なお、本発明は撮像素子が有するカラーフィルタのパターンには依存しない。このように、本実施形態の撮像素子14は、焦点検出用画素を含め、各画素に1つの光電変換部が設けられているため、1つの画素からは1つの光電変換信号が読み出される。   Each pixel is provided with an on-chip microlens 211i, and the rectangle in the on-chip microlens 211i schematically shows the light receiving area of the photoelectric conversion unit. The focus detection photoelectric conversion units 311a and 311b are arranged laterally offset from the center of the pixel. In the following description, a pixel provided with focus detection photoelectric conversion units 311a and 311b may be referred to as a focus detection pixel. The focus detection photoelectric conversion units 311a and 311b are arranged in green pixels provided in place of the original blue pixels. This is because the output of the blue pixel has the lowest influence on the image quality. Note that the present invention does not depend on the color filter pattern of the image sensor. As described above, since the image sensor 14 of this embodiment includes one photoelectric conversion unit for each pixel including the focus detection pixel, one photoelectric conversion signal is read from one pixel.

ここで、位相差検出方式の焦点検出に用いる像信号の生成について説明する。本実施形態では4種類の像信号を生成する。後述するように、本実施形態においては、マイクロレンズ211iと、偏倚位置が異なる光電変換部311a及び311bとを用いて撮影光学系(撮影レンズ300)の射出瞳を分割する。そして、同一画素行(X軸方向)に配置された画素211の出力のうち、複数の光電変換部311aの出力をつなぎ合わせて編成したものをA像、複数の光電変換部311bの出力をつなぎ合わせて編成したものをB像とする。図2(A)に示したように、A像およびB像は、X軸方向に2画素ピッチで隣接する複数の青画素位置(の緑画素)から得ることができる。   Here, generation of an image signal used for focus detection by the phase difference detection method will be described. In this embodiment, four types of image signals are generated. As will be described later, in the present embodiment, the exit pupil of the imaging optical system (imaging lens 300) is divided using the microlens 211i and the photoelectric conversion units 311a and 311b having different bias positions. Then, among the outputs of the pixels 211 arranged in the same pixel row (X-axis direction), an output obtained by connecting the outputs of the plurality of photoelectric conversion units 311a and connecting the outputs of the A image and the plurality of photoelectric conversion units 311b is connected. A B image is obtained by knitting together. As shown in FIG. 2A, the A image and the B image can be obtained from a plurality of blue pixel positions (green pixels) adjacent to each other at a two-pixel pitch in the X-axis direction.

また、図2(A)の1行目の複数の緑画素である光電変換部311cは光電変換部311aと図2(A)中のX軸方向にそれぞれ隣接しているが、この光電変換部311cの出力をつなぎあわせて編成したものをGA像とする。また、図2(A)の5行目の複数の緑画素である光電変換部311cは光電変換部311bと図2(A)中のX軸方向にそれぞれ隣接しているが、この光電変換部311cの出力をつなぎあわせて編成したものをGB像とする。光電変換部311a,311bが、撮影光学系(撮影レンズ300)の射出瞳の一部の領域を通過した光束に基づく信号を出力するのに対し、光電変換部311cは、撮影光学系(撮影レンズ300)の射出瞳の全領域を通過した光束に基づく信号を出力する。このように、A像(光電変換部311aの出力),B像(光電変換部311bの出力),GA像(光電変換部311cの出力),GB像(光電変換部311cの出力)を同色画素群から得ることにより、精度の良い位相差検出が可能である。   Further, the photoelectric conversion units 311c that are the plurality of green pixels in the first row in FIG. 2A are adjacent to the photoelectric conversion unit 311a in the X-axis direction in FIG. A GA image is formed by connecting the outputs of 311c. In addition, the photoelectric conversion units 311c that are the plurality of green pixels in the fifth row in FIG. 2A are adjacent to the photoelectric conversion unit 311b in the X-axis direction in FIG. A GB image is formed by connecting the outputs of 311c and knitting them. The photoelectric conversion units 311a and 311b output a signal based on the light beam that has passed through a partial region of the exit pupil of the imaging optical system (imaging lens 300), whereas the photoelectric conversion unit 311c has an imaging optical system (imaging lens). 300), a signal based on the light flux that has passed through the entire area of the exit pupil is output. Thus, the A color image (output of the photoelectric conversion unit 311a), the B image (output of the photoelectric conversion unit 311b), the GA image (output of the photoelectric conversion unit 311c), and the GB image (output of the photoelectric conversion unit 311c) are the same color pixels. By obtaining from the group, it is possible to detect the phase difference with high accuracy.

なお、A像,B像,GA像,GB像を生成するために用いる画素の位置及び数は、焦点検出領域に応じて定まるものとする。   Note that the positions and the number of pixels used for generating the A image, the B image, the GA image, and the GB image are determined according to the focus detection area.

詳細は後述するが、このように生成されたA像とGA像は同じ行の画素から得られた像であるため、A像とGA像の相対的な像ずれ量から、本来求めたいA像とB像の像ずれ量の1/2が正確に求められる。同様に、B像とGB像は同じ行の画素から得られた像であるため、B像とGB像の相対的な像ずれ量から、本来求めたいA像とB像の像ずれ量の残りの1/2が正確に求められる。そしてこれらを加え合わせて相関演算をすることにより、A像とB像の所定領域での焦点ずれ量、すなわちデフォーカス量を検出することができる。本実施形態では、位置が画素の中央から偏倚していない光電変換領域311cを有する画素(以下の説明では撮影用画素と呼ぶことがある)からは通常の画素信号が得られる。撮影画像を生成する際には、焦点検出用画素に対応する位置の通常の画素信号を、周囲の画素の出力を用いて生成(補完)する。なお、通常の画素信号を生成する際には、対象となる焦点検出用画素の出力を用いてもよいし、用いなくてもよい。   Although details will be described later, since the A image and the GA image generated in this way are images obtained from pixels in the same row, the A image to be originally obtained from the relative image shift amount between the A image and the GA image. And 1/2 of the image shift amount of the B image can be accurately obtained. Similarly, since the B image and the GB image are images obtained from pixels in the same row, the remaining image displacement amount of the A image and the B image that is originally obtained from the relative image displacement amount between the B image and the GB image. Of 1/2 is accurately obtained. Then, by adding these together and performing a correlation calculation, it is possible to detect a defocus amount, that is, a defocus amount in a predetermined area of the A image and the B image. In the present embodiment, a normal pixel signal is obtained from a pixel having a photoelectric conversion region 311c whose position is not deviated from the center of the pixel (which may be referred to as a photographic pixel in the following description). When a captured image is generated, a normal pixel signal at a position corresponding to a focus detection pixel is generated (complemented) using the output of surrounding pixels. Note that, when generating a normal pixel signal, the output of the target focus detection pixel may or may not be used.

以下、A像(第1の像信号)の生成に用いられる光電変換部311aが設けられた複数の画素を第1の画素群と呼び、B像(第2の像信号)の生成に用いられる光電変換部311bが設けられた複数の画素を第2の画素群と呼ぶ。また、GA像(第3の像信号)の生成に用いられる、光電変換部311cが設けられた複数の画素を第3の画素群と呼び、GB像(第4の像信号)の生成に用いられる、光電変換部311cが設けられた複数の画素を第4の画素群と呼ぶ。   Hereinafter, the plurality of pixels provided with the photoelectric conversion unit 311a used for generating the A image (first image signal) are referred to as a first pixel group, and are used for generating the B image (second image signal). A plurality of pixels provided with the photoelectric conversion unit 311b is referred to as a second pixel group. A plurality of pixels provided with the photoelectric conversion unit 311c, which are used for generating a GA image (third image signal), are referred to as a third pixel group, and are used for generating a GB image (fourth image signal). A plurality of pixels provided with the photoelectric conversion unit 311c is referred to as a fourth pixel group.

なお、本実施形態では第3の画素群および第4の画素群を第1の画素群および第2の画素群にX軸方向で隣接する画素群としている。しかし、第3の画素群および第4の画素群を第1の画素群および第2の画素群にY軸方向で隣接する画素群としてもよい。あるいは、他の画素から得られる画素値を用いてGA像およびGB像を生成してもよい。例えば、GA像を、第1の画素群の各画素について、隣接する複数(例えば4つ)の画素の平均値として算出された画素値から生成してもよい。   In the present embodiment, the third pixel group and the fourth pixel group are pixel groups adjacent to the first pixel group and the second pixel group in the X-axis direction. However, the third pixel group and the fourth pixel group may be pixel groups adjacent to the first pixel group and the second pixel group in the Y-axis direction. Alternatively, a GA image and a GB image may be generated using pixel values obtained from other pixels. For example, the GA image may be generated from the pixel value calculated as the average value of a plurality of adjacent (for example, four) pixels for each pixel of the first pixel group.

基本的には、位相差検出方向に直交する方向において、第1の画素群と第2の画素群とが離間している距離よりも、第1の画素群と第3の画素群との距離が短くなるように、第3の画素群を選択すれば本発明の効果は得られる。第4の画素群についても同様に、第1の画素群と第2の画素群との距離よりも、第2の画素群と第4の画素群との距離が短くなるように選択すればよい。他の画素値から第3および第4の画素群の画素値を生成する場合には、第3及び第4の画素群の各画素の仮想画素位置を同様にして選択すればよい。   Basically, in the direction orthogonal to the phase difference detection direction, the distance between the first pixel group and the third pixel group is greater than the distance between the first pixel group and the second pixel group. If the third pixel group is selected so as to shorten the length, the effect of the present invention can be obtained. Similarly, the fourth pixel group may be selected so that the distance between the second pixel group and the fourth pixel group is shorter than the distance between the first pixel group and the second pixel group. . When the pixel values of the third and fourth pixel groups are generated from other pixel values, the virtual pixel positions of the pixels of the third and fourth pixel groups may be selected in the same manner.

図2(B)は本実施形態の撮像素子14の読み出し回路の構成例を示す図である。撮像素子14は水平走査回路151と垂直走査回路153を有しており、各画素の境界には、水平走査ライン252と、垂直走査ライン254が配線されている。各光電変換部311a,311b,311cで生成された信号は、水平走査ライン252および垂直走査ライン254を介して外部に読み出される。   FIG. 2B is a diagram illustrating a configuration example of a readout circuit of the image sensor 14 of the present embodiment. The image sensor 14 has a horizontal scanning circuit 151 and a vertical scanning circuit 153, and a horizontal scanning line 252 and a vertical scanning line 254 are wired at the boundary of each pixel. Signals generated by the photoelectric conversion units 311a, 311b, and 311c are read out through the horizontal scanning line 252 and the vertical scanning line 254.

図3は、撮影レンズ300の射出瞳面と、撮像素子14の像面中央近傍に配置された画素211の光電変換部311a,311bとの共役関係を説明する図である。撮像素子14内の光電変換部311a、311bと撮影レンズ300の射出瞳面は、オンチップマイクロレンズ211iによって共役関係となるように設計される。そして撮影レンズ300の射出瞳面は、光量調節用の虹彩絞りが設けられる面とほぼ一致するのが一般的である。   FIG. 3 is a diagram for explaining a conjugate relationship between the exit pupil plane of the imaging lens 300 and the photoelectric conversion units 311a and 311b of the pixel 211 disposed in the vicinity of the center of the image plane of the imaging device 14. The exit pupil planes of the photoelectric conversion units 311a and 311b and the imaging lens 300 in the image sensor 14 are designed to have a conjugate relationship by the on-chip microlens 211i. In general, the exit pupil plane of the photographing lens 300 substantially coincides with the plane on which the iris diaphragm for adjusting the light amount is provided.

一方、本実施形態の撮影レンズ300は変倍機能を有したズームレンズである。ズームレンズには、変倍操作を行なうと、射出瞳の大きさや、像面から射出瞳までの距離(射出瞳距離)が変化するものがある。図3では、撮影レンズ300の焦点距離が広角端と望遠端の中央にある状態を示している。この状態における射出瞳距離Zepを標準値として、オンチップマイクロレンズの形状や、像高に応じた偏心パラメータの最適設計がなされる。   On the other hand, the photographing lens 300 of the present embodiment is a zoom lens having a zooming function. Some zoom lenses change the size of the exit pupil and the distance from the image plane to the exit pupil (exit pupil distance) when a zooming operation is performed. FIG. 3 shows a state where the focal length of the photographic lens 300 is at the center between the wide-angle end and the telephoto end. Using the exit pupil distance Zep in this state as a standard value, the optimum design of the eccentric parameter according to the shape of the on-chip microlens and the image height is performed.

図3において、撮影レンズ300は、第1レンズ群101、第1レンズ群を保持する鏡筒部材101b、第3レンズ群105、および第3レンズ群を保持する鏡筒部材105bを有している。また、撮影レンズ300は、絞り102と、絞り開放時の開口径を規定する開口板102a、および絞り込み時の開口径を調節するための絞り羽根102bを有している。なお、図3において、撮影レンズ300を通過する光束の制限部材として作用する101b,102a,102b,105bは、像面から観察した場合の光学的な虚像を示している。また、絞り102の近傍における合成開口を撮影レンズ300の射出瞳と定義し、射出瞳距離Zepを有している。   In FIG. 3, the photographic lens 300 includes a first lens group 101, a lens barrel member 101b that holds the first lens group, a third lens group 105, and a lens barrel member 105b that holds the third lens group. . The photographic lens 300 includes an aperture 102, an aperture plate 102a that defines an aperture diameter when the aperture is open, and an aperture blade 102b for adjusting the aperture diameter when the aperture is closed. In FIG. 3, reference numerals 101b, 102a, 102b, and 105b that act as limiting members for the light flux passing through the photographing lens 300 indicate optical virtual images when observed from the image plane. Further, the synthetic aperture in the vicinity of the stop 102 is defined as the exit pupil of the photographing lens 300, and has an exit pupil distance Zep.

画素211の最下層には、光電変換部311a(図3(A))もしくは光電変換部311b(図3(B))もしくは光電変換部311c(不図示)が配置される。光電変換部311a〜311cの上層には、配線層211e〜211g、カラーフィルタ211h、及びオンチップマイクロレンズ211iが設けられる。光電変換部311a〜311cは、オンチップマイクロレンズ211iによって撮影レンズ300の射出瞳面に投影される。換言すれば、射出瞳が、オンチップマイクロレンズ211iを介して、光電変換部311a〜311cの表面に投影される。   In the lowest layer of the pixel 211, a photoelectric conversion unit 311a (FIG. 3A), a photoelectric conversion unit 311b (FIG. 3B), or a photoelectric conversion unit 311c (not shown) is arranged. On the upper layers of the photoelectric conversion units 311a to 311c, wiring layers 211e to 211g, a color filter 211h, and an on-chip microlens 211i are provided. The photoelectric conversion units 311a to 311c are projected onto the exit pupil plane of the photographing lens 300 by the on-chip microlens 211i. In other words, the exit pupil is projected onto the surfaces of the photoelectric conversion units 311a to 311c via the on-chip microlens 211i.

図3(C)は、射出瞳面上における、光電変換部311a,311bの投影像EP1a,EP1bを示している。なお、光電変換部311cに対する投影像EP1cは、EP1aとEP1bの和におおむね等しい。   FIG. 3C shows projection images EP1a and EP1b of the photoelectric conversion units 311a and 311b on the exit pupil plane. The projected image EP1c for the photoelectric conversion unit 311c is substantially equal to the sum of EP1a and EP1b.

図3(A),(B)には、撮影レンズ300を通過する光束の最外部をLで示している。光束の最外部Lは絞りの開口板102aで規制されており、投影像EP1a及びEP1bは撮影レンズ300でケラレがほぼ発生していない。図3(C)では、図3(A)および図3(B)における光束の最外部Lが射出面で形成する円TLを示している。光電変換部311a,311bの投影像EP1a,EP1bの大部分が円TLの内部に存在することからも、ケラレがほぼ発生していないことがわかる。光束の最外部Lは、絞りの開口板102aで規定されるため、TL=102aと言い換えることができる。この際、像面中央では各投影像EP1aないしEP1bのケラレ状態は光軸に対して対称となり、各光電変換部311a及び311bの受光量は等しい。このように、本実施形態の撮像素子14は撮影機能だけではなく、位相差検出方式の焦点検出に用いる信号を生成する装置としての機能も有している。   3A and 3B, the outermost part of the light beam passing through the photographing lens 300 is indicated by L. The outermost L of the light beam is regulated by the aperture plate 102a of the diaphragm, and the vignetting of the projection images EP1a and EP1b hardly occurs in the photographing lens 300. FIG. 3C shows a circle TL formed on the exit surface by the outermost L of the light beam in FIGS. 3A and 3B. Since most of the projection images EP1a and EP1b of the photoelectric conversion units 311a and 311b are present inside the circle TL, it can be seen that almost no vignetting occurs. Since the outermost L of the light beam is defined by the aperture plate 102a of the stop, it can be paraphrased as TL = 102a. At this time, the vignetting state of the projection images EP1a to EP1b is symmetric with respect to the optical axis at the center of the image plane, and the received light amounts of the photoelectric conversion units 311a and 311b are equal. As described above, the imaging device 14 according to the present embodiment has not only an imaging function but also a function as a device that generates a signal used for focus detection by the phase difference detection method.

図4(a)は、撮影範囲400に設定された焦点検出領域401の例を示す図である。撮像素子14が有する画素の出力を用いた焦点検出を行う場合、コントラスト検出方式、位相差検出方式のいずれにおいても、焦点検出領域401に対応する撮像素子14の領域内に含まれる画素の出力を用いる。従って、焦点検出領域401は撮像素子14に設定されているとも言え、以下では説明及び理解を容易にするため、焦点検出領域401を撮像素子14の画素領域として説明する。   FIG. 4A is a diagram illustrating an example of the focus detection area 401 set in the shooting range 400. When focus detection is performed using the output of the pixels of the image sensor 14, the output of the pixels included in the area of the image sensor 14 corresponding to the focus detection area 401 is output in both the contrast detection method and the phase difference detection method. Use. Therefore, it can be said that the focus detection area 401 is set in the image sensor 14. Hereinafter, the focus detection area 401 will be described as a pixel area of the image sensor 14 for ease of explanation and understanding.

ここでは、焦点検出領域401内の画素に、図2(A)に示したような規則で光電変換部311a〜311cが設けられているものとする。画素の中央から水平(X軸)方向に偏倚した光電変換部311a,311bを有する焦点検出用画素を用いるため、焦点検出領域401内の画像の水平方向のコントラスト差によって像信号の位相差を検出する。   Here, it is assumed that the photoelectric conversion units 311a to 311c are provided in the pixels in the focus detection area 401 according to the rules shown in FIG. Since a focus detection pixel having photoelectric conversion units 311a and 311b deviated in the horizontal (X-axis) direction from the center of the pixel is used, the phase difference of the image signal is detected based on the contrast difference in the horizontal direction of the image in the focus detection area 401. To do.

ここで検出される位相差は、1対の光束の進行角度の差によって発生し、単位デフォーカス量当たりの位相差は、1対の像信号を生成する光束の射出瞳面上の領域内の重心間隔と比例する。上述の通り、光電変換部311cに対する投影像EP1cは、投影像EP1aとEP1bの和に概ね等しい。従って、投影像EP1cの重心位置は、投影像EP1a,EP1bの1対の重心位置の中央に存在する。そのため、光電変換部311a,311bから得られる1対の像信号(A像、B像)の位相差は、光電変換部311a(311b),311cから得られた1対の像信号(A像(B像)、GA像(GB像))の位相差の約2倍となる。   The phase difference detected here is generated by the difference in the traveling angle of the pair of light beams, and the phase difference per unit defocus amount is within the region on the exit pupil plane of the light beam that generates the pair of image signals. It is proportional to the center of gravity interval. As described above, the projection image EP1c for the photoelectric conversion unit 311c is substantially equal to the sum of the projection images EP1a and EP1b. Therefore, the barycentric position of the projection image EP1c exists at the center of the pair of barycentric positions of the projection images EP1a and EP1b. Therefore, the phase difference between the pair of image signals (A image and B image) obtained from the photoelectric conversion units 311a and 311b is the same as the pair of image signals (A image (A image (B)) obtained from the photoelectric conversion units 311a (311b) and 311c. B image) and GA image (GB image)) are approximately twice the phase difference.

投影像EP1cはGA像とGB像に共通するため、GA像を生成する光束とGB像を生成する光束は射出面上での重心位置は等しい。従って、光電変換部311a,311cの出力から得られるA像とGA像の位相差と、光電変換部311b,311cの出力から得られるB像とGB像の位相差の和は、光電変換部311a,311bの出力から得られるA像とB像の位相差と概ね等しくなる。   Since the projection image EP1c is common to the GA image and the GB image, the light beam for generating the GA image and the light beam for generating the GB image have the same barycentric position on the exit surface. Accordingly, the sum of the phase difference between the A image and the GA image obtained from the outputs of the photoelectric conversion units 311a and 311c and the phase difference between the B image and the GB image obtained from the outputs of the photoelectric conversion units 311b and 311c is the photoelectric conversion unit 311a. , 311b is approximately equal to the phase difference between the A and B images obtained from the output.

図4(b)は、焦点検出領域401内に含まれる画素のうち、AF用の像信号の生成に用いられる画素を抜き出し、各画素の出力でどの像信号が生成されるかを示した図である。図4(b)においては、同種の像信号を生成する画素群(第1〜第4の画素群)ごとに、i行上のj個目の画素を「像信号の種類」と(i,j)(ただしi,jは1〜Nの整数)で示している。例えば、A像を生成する第1の画素群のうち、1行目で1個目の画素をA(1,1)と表す。なお、図4(b)における光電変換部の色分けは、同種の像信号を生成する画素群を分かりやすくするためのものである。   FIG. 4B is a diagram showing pixels used for generating an AF image signal out of the pixels included in the focus detection area 401 and which image signal is generated by the output of each pixel. It is. In FIG. 4B, for each pixel group (first to fourth pixel groups) that generate the same type of image signal, the j-th pixel on the i-th row is referred to as “image signal type” (i, j) (where i and j are integers from 1 to N). For example, in the first pixel group that generates the A image, the first pixel in the first row is represented as A (1,1). Note that the color coding of the photoelectric conversion units in FIG. 4B is intended to facilitate understanding of pixel groups that generate the same type of image signal.

なお、図4(b)では、焦点検出領域401内の画素のうち、AF用信号の生成に用いられる画素が2行2N列分である場合を示したが、行数、列数はこれに限らない。行数は2行以上であればよく、列数についても一般的に位相差が検出できる範囲で適宜設定すればよい。なお、位相差が検出できない場合や精度が低いと判断される場合に、動的に列数を増やすようにしてもよい。   FIG. 4B shows a case where the pixels used for generating the AF signal among the pixels in the focus detection area 401 are 2 rows and 2 N columns. Not exclusively. The number of rows may be two or more, and the number of columns may be appropriately set within a range in which a phase difference can generally be detected. Note that the number of columns may be dynamically increased when the phase difference cannot be detected or when it is determined that the accuracy is low.

次に、カメラ100における焦点調節動作について、図5に示すフローチャートを用いて説明する。なお、図5に示す処理は、メインミラー130とサブミラー131が光路外へ退避(ミラーアップ)した状態、より具体的にはライブビュー表示時(表示用動画撮影時)もしくは動画記録時(記録用動画撮影時)において実施される処理である。なお、ここでは撮像素子14の出力を用いた位相差検出方式の自動焦点検出を行うものとして説明するが、上述の通り、コントラスト検出方式の自動焦点検出を行うこともできる。   Next, the focus adjustment operation in the camera 100 will be described using the flowchart shown in FIG. Note that the processing shown in FIG. 5 is a state in which the main mirror 130 and the sub mirror 131 are retracted from the optical path (mirror-up), more specifically, during live view display (when displaying a moving image for display) or during moving image recording (for recording). This is a process that is performed at the time of video shooting. Although the description is given here assuming that the phase difference detection type automatic focus detection using the output of the image sensor 14 is performed, as described above, the contrast detection type automatic focus detection can also be performed.

S501でシステム制御部50は、SW1(62)や操作部70などの操作により、焦点検出開始指示が入力されたか判別し、入力されていると判別された場合に処理をS502へ進め、入力されていると判別されなければ待機する。なお、システム制御部50は、焦点検出開始指示の入力に限らず、ライブビュー表示や動画記録の開始をトリガとして処理をS502に進めてもよい。   In step S501, the system control unit 50 determines whether a focus detection start instruction has been input by operating the SW1 (62), the operation unit 70, and the like. If it is determined that the focus detection start instruction has been input, the process proceeds to step S502. If it is not determined that it is, it waits. Note that the system control unit 50 is not limited to the input of the focus detection start instruction, and the process may proceed to S502 with the start of live view display or moving image recording as a trigger.

S502でシステム制御部50は、撮影レンズ300のレンズ枠情報やフォーカスレンズ位置などの各種レンズ情報を、インターフェース部38,338およびコネクタ122,322を介してレンズシステム制御部346から取得する。   In step S <b> 502, the system control unit 50 acquires various lens information such as the lens frame information and the focus lens position of the photographing lens 300 from the lens system control unit 346 via the interface units 38 and 338 and the connectors 122 and 322.

S503でシステム制御部50は、逐次読み出されているフレーム画像データの、焦点検出領域内の画素データから、AF用の像信号(A像、B像、GA像、GB像)を生成するように画像処理部20に指示する。AF用の像信号はAF部42へ送られ、焦点検出用画素と撮影用画素とで光電変換部の大きさが異なることによる信号レベルの差を補正する処理などが行われる。   In step S503, the system control unit 50 generates AF image signals (A image, B image, GA image, and GB image) from the pixel data in the focus detection area of the frame image data that is sequentially read out. To the image processing unit 20. The AF image signal is sent to the AF unit 42, and processing for correcting a difference in signal level caused by the size of the photoelectric conversion unit being different between the focus detection pixel and the imaging pixel is performed.

S504でAF部42は、A像とGA像、B像とGB像の2対の像信号に対して公知の相関演算などを適用して像のずれ量を算出し、デフォーカス量に変換する。この処理の詳細は、後述する。AF部42は、デフォーカス量をシステム制御部50に出力する。   In S <b> 504, the AF unit 42 calculates a shift amount of the image by applying a known correlation calculation or the like to the two pairs of image signals of the A image and the GA image, and the B image and the GB image, and converts it to a defocus amount. . Details of this processing will be described later. The AF unit 42 outputs the defocus amount to the system control unit 50.

S505でシステム制御部50は、S504でAF部42から得られたデフォーカス量に基づき、撮影レンズ300のレンズ駆動量を算出する。   In S505, the system control unit 50 calculates the lens driving amount of the photographing lens 300 based on the defocus amount obtained from the AF unit 42 in S504.

S506でシステム制御部50は、インターフェース部38,338、コネクタ122,322を介して、レンズ駆動量および駆動方向の情報を撮影レンズ300のフォーカス制御部342に送信する。フォーカス制御部342は、受信したレンズ駆動量と駆動方向の情報に基づいて、フォーカスレンズを駆動する。これにより、撮影レンズ300の焦点調節が行われる。なお、図5の動作は次フレーム以降の動画データが読み出された際にも継続的に実施されてよい。   In step S <b> 506, the system control unit 50 transmits information on the lens driving amount and the driving direction to the focus control unit 342 of the photographing lens 300 via the interface units 38 and 338 and the connectors 122 and 322. The focus control unit 342 drives the focus lens based on the received lens driving amount and driving direction information. Thereby, the focus of the photographic lens 300 is adjusted. Note that the operation of FIG. 5 may be continuously performed even when moving image data after the next frame is read.

次に、図5のS504でAF部42が行うデフォーカス量の算出処理について、図6に示すフローチャートを用いてさらに説明する。S5041で第1の算出手段としてのAF部42は、同じ画素行(m行目とする)から生成したA像とGA像の相関演算を行う。相関演算に用いる相関量COR1(k)は、例えば下記の式(1)で算出することができる。   Next, the defocus amount calculation processing performed by the AF unit 42 in S504 of FIG. 5 will be further described with reference to the flowchart shown in FIG. In S5041, the AF unit 42 as the first calculating unit performs a correlation operation between the A image and the GA image generated from the same pixel row (m-th row). The correlation amount COR1 (k) used for the correlation calculation can be calculated by the following equation (1), for example.

式(1)で用いる変数kは、相関演算時のシフト量で、−kmax以上kmax以下の整数である。AF部42は各シフト量kについての相関量COR1(k)を求めた後、A像とGA像の相関が最も高くなるシフト量k、すなわち、相関量COR1が最小となるシフト量kの値を求める。なお、相関量COR1(k)の算出時におけるシフト量kは整数とするが、相関量COR1(k)が最小となるシフト量kを求める場合には、デフォーカス量の精度を向上させるため、適宜補間処理を行いサブピクセル単位の値(実数値)を求める。   The variable k used in the equation (1) is a shift amount at the time of correlation calculation, and is an integer from −kmax to kmax. After the AF unit 42 obtains the correlation amount COR1 (k) for each shift amount k, the shift amount k that maximizes the correlation between the A image and the GA image, that is, the value of the shift amount k that minimizes the correlation amount COR1. Ask for. Note that the shift amount k at the time of calculating the correlation amount COR1 (k) is an integer, but when obtaining the shift amount k that minimizes the correlation amount COR1 (k), in order to improve the accuracy of the defocus amount, Interpolation processing is performed as appropriate to obtain a value (real value) in units of subpixels.

本実施形態では、相関量COR1の差分値の符号が変化するシフト量dkを、相関量COR1(k)が最小となるシフト量kとして算出する。   In the present embodiment, the shift amount dk at which the sign of the difference value of the correlation amount COR1 changes is calculated as the shift amount k that minimizes the correlation amount COR1 (k).

まず、AF部42は、相関量の差分値DCOR1を以下の式(2)に従って算出する。   First, the AF unit 42 calculates the difference value DCOR1 of the correlation amount according to the following equation (2).

DCOR1(k)=COR1(k)-COR1(k-1) ...(2)
そして、AF部42は、相関量の差分値DCOR1を用いて、差分量の符号が変化するシフト量dk1を求める。差分量の符号が変化する直前のkの値をk1、符号が変化したkの値をk2(k2=k1+1)とすると、AF部42はシフト量dk1を、以下の式(3)に従って算出する。
DCOR1 (k) = COR1 (k) -COR1 (k-1) ... (2)
Then, the AF unit 42 obtains the shift amount dk1 in which the sign of the difference amount changes using the correlation amount difference value DCOR1. If the value of k immediately before the sign of the difference amount changes is k1, and the value of k where the sign changes is k2 (k2 = k1 + 1), the AF unit 42 calculates the shift amount dk1 according to the following equation (3). .

dk1=k1+ |DCOR1(k1)|/|DCOR1(k1)-DCOR1(k2)| ...(3)
以上のようにして第1の算出手段としてのAF部42は、A像とGA像の相関量が最大となるシフト量dk1をサブピクセル単位で算出し、S5041の処理を終える。なお、2つの1次元像信号の位相差を算出する方法は、ここで説明したものに限らず、公知の任意の方法を用いることができる。
dk1 = k1 + | DCOR1 (k1) | / | DCOR1 (k1) -DCOR1 (k2) | ... (3)
As described above, the AF unit 42 serving as the first calculating unit calculates the shift amount dk1 that maximizes the correlation amount between the A image and the GA image in units of subpixels, and ends the process of S5041. The method for calculating the phase difference between the two one-dimensional image signals is not limited to that described here, and any known method can be used.

S5042で第2の算出手段としてのAF部42は、同じ画素行(m+1行目)から生成したB像とGB像について、S5041と同様の方法で、相関が最大となるシフト量dk2を算出する。   In S5042, the AF unit 42 as the second calculation unit calculates the shift amount dk2 that maximizes the correlation for the B image and the GB image generated from the same pixel row (m + 1) by the same method as in S5041. .

S5043でAF部42は、2種のシフト量dk1、dk2の和dk_sumを算出する。この和dk_sumがA像とB像の位相差に相当することは上述した通りである。そのため、AF部42はシフト量の和dk_sumに予め例えば不揮発性メモリ56に記憶された敏感度を乗じることで、シフト量の和dk_sumをデフォーカス量DEFに換算する。デフォーカス量DEFの算出を終えると、デフォーカス量算出処理を終了する。   In S5043, the AF unit 42 calculates the sum dk_sum of the two types of shift amounts dk1 and dk2. As described above, the sum dk_sum corresponds to the phase difference between the A image and the B image. Therefore, the AF unit 42 converts the shift amount sum dk_sum into the defocus amount DEF by multiplying the sum of shift amounts dk_sum by, for example, the sensitivity stored in advance in the nonvolatile memory 56. When the calculation of the defocus amount DEF ends, the defocus amount calculation process ends.

本実施形態では、撮影光学系の射出瞳上の異なる領域を通る光束を光電変換し得られる信号であるA像とB像を、位相差検出方向(X軸方向)と直交する方向(Y軸方向)に離れて位置する画素群から生成している。そのため、A像とB像がサンプリングしている被写体光学像の位置が異なり、A像とB像の類似度が高いことは保証されない。2つの信号間の位相差を相関量に基づいて求める場合、2つの信号の類似度が高いほうが、高精度の位相差が得られる。本実施形態では、被写体光学像上で、A像と概ね同じ位置をサンプリングできるGA像を生成し、A像とGA像の位相差を算出する。さらに、同様にB像とGB像の位相差を算出する。そして、これら2つの位相差算出結果を合計することでA像とB像の位相差を高精度に算出することができる。   In this embodiment, an A image and a B image, which are signals obtained by photoelectrically converting light beams passing through different areas on the exit pupil of the photographing optical system, are orthogonal to the phase difference detection direction (X axis direction) (Y axis). The pixel group is located away from (direction). For this reason, the positions of the subject optical images sampled by the A and B images are different, and it is not guaranteed that the similarity between the A and B images is high. When obtaining the phase difference between two signals based on the amount of correlation, the higher the degree of similarity between the two signals, the higher the phase difference can be obtained. In the present embodiment, a GA image that can sample substantially the same position as the A image is generated on the subject optical image, and the phase difference between the A image and the GA image is calculated. Further, similarly, the phase difference between the B image and the GB image is calculated. Then, by summing up these two phase difference calculation results, the phase difference between the A image and the B image can be calculated with high accuracy.

また、A像とGA像の位相差と、B像とGB像の位相差を合計してA像とB像の位相差を算出するため、単位デフォーカス量当たりの位相差が、A像とGA像(またはB像とGB像)の位相差よりも大きくなる。そのため、位相差検出結果に含まれるノイズの影響を低減し、高精度な位相差検出を行うことができる。   Further, since the phase difference between the A image and the GA image and the phase difference between the B image and the GB image are summed to calculate the phase difference between the A image and the B image, the phase difference per unit defocus amount is It becomes larger than the phase difference between the GA image (or B image and GB image). Therefore, the influence of noise included in the phase difference detection result can be reduced, and highly accurate phase difference detection can be performed.

このように構成することにより、A像とB像の類似度が低い場合でも、A像とB像との位相差を高精度に求めることが可能になる。そのため、A像の信号を生成する画素群(第1の画素群)とB像の信号を生成する画素群(第2の画素群)の配置の自由度が向上し、撮像用の信号を生成する際に補正の行いやすい位置に焦点検出用画素を配置するといったことが可能になる。その結果、焦点検出用画素に対応する画素値の補正精度が向上し、高画質化を実現することができる。   With this configuration, even when the similarity between the A image and the B image is low, the phase difference between the A image and the B image can be obtained with high accuracy. Therefore, the degree of freedom of arrangement of the pixel group (first pixel group) that generates the A image signal and the pixel group (second pixel group) that generates the B image signal is improved, and a signal for imaging is generated. In this case, it is possible to arrange the focus detection pixels at positions where correction can be easily performed. As a result, the correction accuracy of the pixel value corresponding to the focus detection pixel is improved, and high image quality can be realized.

なお、本実施形態では、A像とGA像の相関量を用いて得られる位相差dk1(第1の位相差)と、B像とGB像の相関量を用いて得られる位相差dk2(第2の位相差)とを算出し、位相差dk1とdk2の和をデフォーカス量に変換した。しかし、デフォーカス量の算出方法は、これに限らない。例えば、同じシフト量kに対応するA像とGA像の相関量(第1の相関量)とB像とGB像の相関量(第2の相関量)の和を算出し、2つの相関量の和が最小となるシフト量dkからデフォーカス量を算出してもよい。この場合、A像とB像から検出される位相差は少なくなってしまうが、相関量の差分を大きくすることができるため、シフト量の検出精度が向上する。   In this embodiment, the phase difference dk1 (first phase difference) obtained using the correlation amount between the A image and the GA image, and the phase difference dk2 (first phase difference) obtained using the correlation amount between the B image and the GB image. 2), and the sum of the phase differences dk1 and dk2 is converted into a defocus amount. However, the defocus amount calculation method is not limited to this. For example, the sum of the correlation amount (first correlation amount) between the A image and the GA image corresponding to the same shift amount k (first correlation amount) and the correlation amount between the B image and GB image (second correlation amount) is calculated, and two correlation amounts are calculated. The defocus amount may be calculated from the shift amount dk that minimizes the sum of. In this case, the phase difference detected from the A image and the B image is reduced, but the difference in the correlation amount can be increased, so that the detection accuracy of the shift amount is improved.

また、シフト量からデフォーカス量を算出する際に、位相差dk1とdk2の和に対して、敏感度を乗じた。しかし、予め不揮発性メモリ56に位相差dk1用と位相差dk2用の各々の敏感度を記憶しておき、個々の位相差に敏感度を乗じた後に合計してデフォーカス量を算出してもよい。敏感度の記憶に必要な容量は増えるが、より精度のよい焦点検出を行うことが可能となる。
●(第2の実施形態)
次に、本発明の第2の実施形態について説明する。第1の実施形態との主な違いは、撮像素子の画素配列である。第1の実施形態の撮像素子は、撮影用画素と2種類の焦点検出用画素とを配列し、1つの画素が1つの光電変換部を有する構成であった。本発明をこのような撮像素子を用いた撮像装置に適用した場合、焦点検出精度を向上できることは第1の実施形態で説明した。しかし、本発明は全画素に2つの光電変換部を設け、全画素からA像とB像の出力信号を得ることができる撮像素子を用いる撮像装置にも適用可能である。
Further, when calculating the defocus amount from the shift amount, the sensitivity is multiplied to the sum of the phase differences dk1 and dk2. However, the sensitivity for each of the phase difference dk1 and the phase difference dk2 is stored in advance in the nonvolatile memory 56, and the defocus amount is calculated by summing the individual phase differences after multiplying the sensitivity. Good. Although the capacity required for storing the sensitivity increases, more accurate focus detection can be performed.
● (Second Embodiment)
Next, a second embodiment of the present invention will be described. The main difference from the first embodiment is the pixel arrangement of the image sensor. The imaging device of the first embodiment has a configuration in which shooting pixels and two types of focus detection pixels are arranged, and one pixel has one photoelectric conversion unit. As described in the first embodiment, when the present invention is applied to an image pickup apparatus using such an image pickup device, the focus detection accuracy can be improved. However, the present invention can also be applied to an imaging apparatus using an imaging device in which two photoelectric conversion units are provided in all pixels and output signals of A and B images can be obtained from all the pixels.

なお、第1の実施形態で説明した撮像装置の構成(図1)、焦点検出領域(図4(a))、焦点調節動作やデフォーカス量算出処理(図5、図6)に関しては、本実施形態においても共通するため、説明は省略する。   The configuration of the imaging apparatus described in the first embodiment (FIG. 1), the focus detection region (FIG. 4A), the focus adjustment operation and the defocus amount calculation processing (FIGS. 5 and 6) are as follows. Since it is common also in embodiment, description is abbreviate | omitted.

本実施形態における撮像素子14の構成を、図7〜図8を用いて説明する。なお、図7〜図8において、図2〜図3と同様の構成には同じ参照数字を付して重複する説明を省略する。   The configuration of the image sensor 14 in the present embodiment will be described with reference to FIGS. 7 to 8, the same components as those in FIGS. 2 to 3 are denoted by the same reference numerals, and redundant description is omitted.

図7(a)は図2(a)と同様に、本実施形態における撮像素子14に2次元配置された画素群のうち、縦(Y軸方向)6行と横(X軸方向)8列の範囲を、撮影レンズ300側から観察した状態を示している。ただし、本実施形態の撮像素子14では、カラーフィルタの配列はベイヤー配列通りである。つまり、第1の実施形態とは異なり、青の位置の画素にはすべて青のカラーフィルタが設けられている。本実施形態では、同じ画素からA(B)像とGA(GB)像が得られるため、フィルタの色を変更する必要がない。   7A is similar to FIG. 2A, among the pixel groups arranged two-dimensionally on the image sensor 14 in the present embodiment, 6 rows in the vertical (Y-axis direction) and 8 columns in the horizontal (X-axis direction). This range is observed from the photographic lens 300 side. However, in the image sensor 14 of the present embodiment, the arrangement of the color filters is the same as the Bayer arrangement. That is, unlike the first embodiment, a blue color filter is provided for all the pixels in the blue position. In this embodiment, since an A (B) image and a GA (GB) image are obtained from the same pixel, there is no need to change the color of the filter.

本実施形態では、すべての画素211は、X軸方向に2分割された光電変換部211a,211bを有し、一方の光電変換領域の出力信号と、両方の光電変換領域の出力信号の和とを別個に読み出し可能に構成されている。そして、他方の光電変換領域の出力信号に相当する信号は、両方の光電変換領域の出力信号の和と一方の光電変換領域の出力信号との差分として得ることができる。分割された光電変換領域の出力信号は、後述する方法で位相差検出方式の焦点検出に用いることができるほか、1対の視差画像から構成される3D(3−Dimensional)画像の生成に用いることもできる。一方、両方の光電変換領域の出力信号の和は、通常の撮影用画素の出力信号として用いることができる。   In the present embodiment, all the pixels 211 have photoelectric conversion units 211a and 211b that are divided into two in the X-axis direction. The output signal of one photoelectric conversion region and the sum of the output signals of both photoelectric conversion regions are Are separately readable. A signal corresponding to the output signal of the other photoelectric conversion region can be obtained as a difference between the sum of the output signals of both photoelectric conversion regions and the output signal of one photoelectric conversion region. The output signal of the divided photoelectric conversion region can be used for focus detection of a phase difference detection method by a method described later, and also used for generating a 3D (3-Dimensional) image composed of a pair of parallax images. You can also. On the other hand, the sum of the output signals of both photoelectric conversion regions can be used as an output signal of a normal photographing pixel.

ここで、位相差検出方式の焦点検出に用いる像信号の生成について説明する。本実施形態においては、図7(a)のマイクロレンズ211iと、分割された光電変換部211a及び211bで、撮影レンズ300の射出瞳を分割する。そして、焦点検出領域内の同一画素行(X軸方向)に配置された複数の画素211における光電変換部211aの出力をつなぎ合わせて編成したものをA像、光電変換部211bの出力をつなぎ合わせて編成したものをB像とする。上述の通り、本実施形態の撮像素子は2つの光電変換領域の一方については出力を直接読み出すことができない。従って、直接読み出しできない光電変換領域の出力信号を必要とする像信号は、2つの光電変換領域の出力信号の和と、直接読み出しできる光電変換領域の出力信号との差分として得ることができる。   Here, generation of an image signal used for focus detection by the phase difference detection method will be described. In the present embodiment, the exit pupil of the photographing lens 300 is divided by the microlens 211i in FIG. 7A and the divided photoelectric conversion units 211a and 211b. Then, the A image obtained by connecting the outputs of the photoelectric conversion units 211a in the plurality of pixels 211 arranged in the same pixel row (X-axis direction) within the focus detection region, and the output of the photoelectric conversion unit 211b are connected. A B image is obtained by knitting. As described above, the image sensor of this embodiment cannot directly read the output of one of the two photoelectric conversion regions. Therefore, an image signal that requires an output signal of the photoelectric conversion region that cannot be directly read out can be obtained as a difference between the sum of the output signals of the two photoelectric conversion regions and the output signal of the photoelectric conversion region that can be directly read out.

また、本実施形態においてGA像とGB像は、A像とB像の生成に用いる画素から読み出される、2つの光電変換領域の出力信号の和から生成する。   In the present embodiment, the GA image and the GB image are generated from the sum of the output signals of the two photoelectric conversion regions read from the pixels used for generating the A image and the B image.

このように生成したA像とGA像の相対的な像ずれ量、B像とGB像の相対的な像ずれ量を相関演算により検出することで、焦点検出領域の焦点ずれ量、すなわちデフォーカス量を検出することができる。基本的な方法は第1の実施形態で説明したとおりである。   By detecting the relative image shift amount between the A image and the GA image generated in this way and the relative image shift amount between the B image and the GB image by correlation calculation, the defocus amount of the focus detection region, that is, defocusing. The amount can be detected. The basic method is as described in the first embodiment.

以下、A像(第1の像信号)の生成に用いられる光電変換部211aが設けられた複数の画素を第1の画素群と呼び、B像(第2の像信号)の生成に用いられる光電変換部211bが設けられた複数の画素を第2の画素群と呼ぶ。本実施形態では、第1の画素群はGA像(第3の像信号)の生成にも用いられ、第2の画素群はGB像(第4の像信号)の生成にも用いられる。   Hereinafter, a plurality of pixels provided with the photoelectric conversion unit 211a used for generating an A image (first image signal) are referred to as a first pixel group, and are used for generating a B image (second image signal). A plurality of pixels provided with the photoelectric conversion unit 211b is referred to as a second pixel group. In the present embodiment, the first pixel group is also used for generating a GA image (third image signal), and the second pixel group is also used for generating a GB image (fourth image signal).

図7(b)は本実施形態の撮像素子14における読み出し回路の構成例を示す図である。撮像素子14は水平走査回路151と垂直走査回路153を有しており、各画素の境界には、水平走査ライン152a及び152bと、垂直走査ライン154a及び154bが配線されている。光電変換部の一方の出力と、両方の加算出力は、これらの走査ラインを介して外部に読み出される。   FIG. 7B is a diagram illustrating a configuration example of a readout circuit in the image sensor 14 of the present embodiment. The imaging device 14 includes a horizontal scanning circuit 151 and a vertical scanning circuit 153, and horizontal scanning lines 152a and 152b and vertical scanning lines 154a and 154b are wired at the boundaries between the pixels. One output of the photoelectric conversion unit and both addition outputs are read out to the outside through these scanning lines.

本実施形態では、奇数行の画素からはA像とGA像の出力が読みだされ、偶数行の画素からはB像とGB像の出力が読みだされるものとする。   In the present embodiment, it is assumed that the outputs of the A image and the GA image are read from the pixels in the odd rows, and the outputs of the B image and the GB image are read from the pixels in the even rows.

図8は、撮影レンズ300の射出瞳面と、撮像素子14の像面中央近傍に配置された画素211の光電変換部211a,211bとの共役関係を説明する図である。画素211内の光電変換部211a,211bと撮影レンズ300の射出瞳面は、オンチップマイクロレンズ211iによって共役関係となるように設計される。本実施形態における構成は、各画素が図3(A)および(B)に示した構成の両方を有している点を除き、第1の実施形態と同様であるため、重複する説明は省略する。   FIG. 8 is a diagram for explaining a conjugate relationship between the exit pupil plane of the photographing lens 300 and the photoelectric conversion units 211 a and 211 b of the pixel 211 disposed in the vicinity of the center of the image plane of the image sensor 14. The photoelectric conversion units 211a and 211b in the pixel 211 and the exit pupil plane of the photographing lens 300 are designed to have a conjugate relationship by the on-chip microlens 211i. The configuration of this embodiment is the same as that of the first embodiment except that each pixel has both of the configurations shown in FIGS. 3A and 3B, and thus a duplicate description is omitted. To do.

次に、本実施形態における、撮像素子14の出力を用いた位相差検出方式の焦点検出方法について説明する。本実施形態においても第1の実施形態と同様に、A像とGA像、B像とGB像の各々の組み合わせについて位相差を検出する。本実施形態では、奇数画素行からは光電変換部211a,211bの出力の和であるGA像(撮影信号)と光電変換部211aの出力であるA像とを読み出す。また、偶数画素行からは光電変換部211a,211bの出力の和であるGB像(撮影信号)と光電変換部211bの出力であるB像とを読み出す。   Next, the focus detection method of the phase difference detection method using the output of the image sensor 14 in this embodiment will be described. Also in the present embodiment, as in the first embodiment, the phase difference is detected for each combination of the A image and the GA image, and the B image and the GB image. In the present embodiment, a GA image (shooting signal) that is the sum of the outputs of the photoelectric conversion units 211a and 211b and an A image that is the output of the photoelectric conversion unit 211a are read from the odd-numbered pixel rows. Further, a GB image (shooting signal) that is the sum of the outputs of the photoelectric conversion units 211a and 211b and a B image that is the output of the photoelectric conversion unit 211b are read from the even pixel rows.

奇数画素行におけるB像と、偶数画素行におけるA像はそれぞれ、GA像とA像の差とGB像とB像の差として算出することができるが、演算を伴うため、得られる信号のS/Nは直接読み出した場合よりも低下する。そのため、高精度の位相差検出を行うには、差分として求めた像信号を用いない方がよい。したがって、本実施形態では、読み出しが可能な一方の光電変換部の出力と、両方の光電変換部の出力和とを用いて位相差を検出する。   The B image in the odd-numbered pixel row and the A image in the even-numbered pixel row can be calculated as the difference between the GA image and the A image and the difference between the GB image and the B image, respectively. / N is lower than when reading directly. Therefore, it is better not to use the image signal obtained as the difference in order to detect the phase difference with high accuracy. Therefore, in this embodiment, the phase difference is detected using the output of one photoelectric conversion unit that can be read and the sum of the outputs of both photoelectric conversion units.

第1の実施形態の場合と異なり、撮像信号とAF用の片方の像信号は、同じ画素から得られる。そのため、図4(c)に示すように、焦点検出領域401内に配置された2行N列の画素から、A像(A(i,j))、B像(B(i,j))、GA像(GA(i,j))およびGB像(GB(i,j))(1≦i≦2、1≦j≦N)を得ることができる。そして、第1の実施形態と同様にして、A像とGA像、B像とGB像のそれぞれの組み合わせについて、シフト量dk1,dk2を求め、その和dk_sumに基づいてデフォーカス量を求める。   Unlike the case of the first embodiment, the imaging signal and one image signal for AF are obtained from the same pixel. Therefore, as shown in FIG. 4C, from the 2 rows and N columns of pixels arranged in the focus detection area 401, A image (A (i, j)), B image (B (i, j)) GA image (GA (i, j)) and GB image (GB (i, j)) (1 ≦ i ≦ 2, 1 ≦ j ≦ N) can be obtained. Similarly to the first embodiment, the shift amounts dk1 and dk2 are obtained for each combination of the A image and the GA image, and the B image and the GB image, and the defocus amount is obtained based on the sum dk_sum.

本実施形態によれば、各画素の光電変換領域が分割されている構成の撮像素子を用いた場合に、各光電変換領域の個別読み出しよりも処理負荷を軽減しながら、精度の良い位相差検出を行うことができ、焦点検出精度を向上させることができる。
●(第3の実施形態)
次に、本発明の第3の実施形態について説明する。第1の実施形態との主な違いは、デフォーカス量算出方法の違いである。第1の実施形態では、A像とGA像の位相差検出結果と、B像とGB像の位相差検出結果を用いてデフォーカス量の算出を行うことで、A像の生成に用いられる画素とB像の生成に用いられる画素が離れていても、精度のよいデフォーカス量の検出を実現した。しかし、デフォーカス量が大きい場合には、A像とGA像(撮像信号)とでボケ方が異なり、2つの像信号の一致度が低下する。これは、それぞれの像信号の生成に用いられる光電変換部の大きさや配置の相違により、2つの像信号に含まれる光束のF値が異なるためである。そのため、デフォーカス量が大きくなるにつれ、焦点検出精度が悪化する。
According to the present embodiment, when an image sensor having a configuration in which the photoelectric conversion area of each pixel is divided is used, the phase difference can be detected with high accuracy while reducing the processing load compared to the individual reading of each photoelectric conversion area. Thus, focus detection accuracy can be improved.
● (Third embodiment)
Next, a third embodiment of the present invention will be described. The main difference from the first embodiment is the difference in the defocus amount calculation method. In the first embodiment, the defocus amount is calculated using the phase difference detection result between the A image and the GA image and the phase difference detection result between the B image and the GB image. Even if the pixels used for generating the B image are far apart, accurate defocus amount detection was realized. However, when the defocus amount is large, the blurring differs between the A image and the GA image (imaging signal), and the degree of coincidence between the two image signals decreases. This is because the F values of the light beams included in the two image signals differ depending on the size and arrangement of the photoelectric conversion units used for generating the respective image signals. Therefore, the focus detection accuracy deteriorates as the defocus amount increases.

本実施形態では、デフォーカス量が大きいと推定される場合にはA像とB像の位相差検出結果を用いることを特徴とする。これはデフォーカス量が大きい場合には、A像の生成に用いられる画素とB像の生成に用いられる画素が離れていても、被写体光学像のボケが大きいため、A像とB像の一致度が高まるためである。つまり、デフォーカス量が大きい場合には、A像とB像のサンプリング位置の相違が焦点検出結果に与える影響が小さいことを利用したものである。   In the present embodiment, when the defocus amount is estimated to be large, the phase difference detection result between the A image and the B image is used. This is because when the defocus amount is large, even if the pixels used to generate the A image and the pixels used to generate the B image are far apart, the subject optical image is largely blurred, so the A image and the B image match. This is because the degree increases. In other words, when the defocus amount is large, the fact that the difference in the sampling positions of the A image and the B image has a small influence on the focus detection result is used.

なお、第1の実施形態で説明した撮像装置の構成(図1)、撮像素子14の構成(図2、図3)、焦点検出領域(図4(a))、焦点調節動作(図5)に関しては、本実施形態においても共通するため、説明は省略する。   The configuration of the imaging apparatus described in the first embodiment (FIG. 1), the configuration of the imaging device 14 (FIGS. 2 and 3), the focus detection region (FIG. 4A), and the focus adjustment operation (FIG. 5). Since the same applies to this embodiment, the description thereof is omitted.

以下、図9に示すフローチャートを用いて、本実施形態におけるデフォーカス量算出方法について説明する。このデフォーカス量算出処理は、図5のS504において実施することができる。また、図9において、第1の実施形態と同様の動作については図6と同じ参照数字を付してある。   Hereinafter, the defocus amount calculation method according to the present embodiment will be described with reference to the flowchart shown in FIG. This defocus amount calculation processing can be performed in S504 of FIG. In FIG. 9, the same reference numerals as those in FIG. 6 are assigned to the same operations as those in the first embodiment.

まずS6041でAF部42は、現在のデフォーカス量が所定の閾値より大きいか否かを判定する。現時点でのデフォーカス量は、焦点調節動作の開始以前に得られたデフォーカス量や、焦点検出を繰り返し行っている場合には前回検出したデフォーカス量と、その後のレンズ駆動量などから算出することができる推定値である。焦点調節動作の開始以前にデフォーカス量を得る場合には、図5のS501において、焦点検出開始の条件が満たされる以前から、一定間隔で焦点検出を行うようにしてもよい。なお、ここで用いられる閾値は、予め実験等を通じて定めることができる。   First, in S6041, the AF unit 42 determines whether or not the current defocus amount is larger than a predetermined threshold value. The current defocus amount is calculated from the defocus amount obtained before the start of the focus adjustment operation, or when the focus detection is repeatedly performed, the previously detected defocus amount and the subsequent lens drive amount. Is an estimate that can be. When the defocus amount is obtained before the start of the focus adjustment operation, focus detection may be performed at regular intervals before the focus detection start condition is satisfied in S501 of FIG. The threshold value used here can be determined in advance through experiments or the like.

AF部42は、現在のデフォーカス量が所定の閾値より大きいと判定された場合には処理をS6042へ進める。また、現在のデフォーカス量が所定の閾値以下と判定された場合、AF部42はS5041、S5042を実行して第1の実施形態と同様にしてシフト量dk1,dk2を求め、処理をS6044に進める。   If it is determined that the current defocus amount is greater than the predetermined threshold, the AF unit 42 advances the process to S6042. If it is determined that the current defocus amount is equal to or smaller than the predetermined threshold value, the AF unit 42 executes S5041 and S5042 to obtain the shift amounts dk1 and dk2 in the same manner as in the first embodiment, and the process proceeds to S6044. Proceed.

S6042でAF部42は、異なる画素行に存在する焦点検出用画素(第1の画素群および第2の画素群)から得られるA像とB像を用いた相関演算を行う。相関演算は、第1の実施形態で説明した、A像とGA像との相関演算におけるGA像をB像として実施することができる。そして、相関量(COR3とする)が最小になるシフト量dk3を、相関量の差分DCOR3に基づいて、第1の実施形態と同様に算出する。   In S6042, the AF unit 42 performs a correlation calculation using the A image and the B image obtained from the focus detection pixels (first pixel group and second pixel group) present in different pixel rows. In the correlation calculation, the GA image in the correlation calculation between the A image and the GA image described in the first embodiment can be performed as the B image. Then, the shift amount dk3 that minimizes the correlation amount (COR3) is calculated in the same manner as in the first embodiment, based on the correlation amount difference DCOR3.

次に、S6043でAF部42は、A像と同じ画素行から得られるGA像と、B像と同じ画素行から得られるGB像を用いた相関演算を行う。AF部42はS6042と同様にして相関量(COR4とする)が最小となるシフト量dk4を、相関量の差分DCOR4に基づいて算出し、処理をS6044へ進める。   Next, in S6043, the AF unit 42 performs a correlation calculation using a GA image obtained from the same pixel row as the A image and a GB image obtained from the same pixel row as the B image. As in S6042, the AF unit 42 calculates the shift amount dk4 that minimizes the correlation amount (COR4) based on the correlation amount difference DCOR4, and the process advances to S6044.

S6044でAF部42は、デフォーカス量の算出を行う。シフト量dk1、dk2が算出されている場合、AF部42は第1の実施形態と同様に、シフト量dk1、dk2の和dk_sumを算出し、予め不揮発性メモリ56に記憶された敏感度を乗じることで、シフト量をデフォーカス量DEFに換算する。   In S6044, the AF unit 42 calculates the defocus amount. When the shift amounts dk1 and dk2 are calculated, the AF unit 42 calculates the sum dk_sum of the shift amounts dk1 and dk2 and multiplies the sensitivity stored in advance in the nonvolatile memory 56, as in the first embodiment. Thus, the shift amount is converted into the defocus amount DEF.

一方で、シフト量dk3、dk4が算出されている場合、AF部42は、シフト量dk3、dk4の差dk_dif=dk3−dk4を算出し、予め不揮発性メモリ56に記憶された敏感度を乗じることで、シフト量をデフォーカス量DEFに換算する。   On the other hand, when the shift amounts dk3 and dk4 are calculated, the AF unit 42 calculates the difference dk_dif = dk3−dk4 between the shift amounts dk3 and dk4 and multiplies the sensitivity stored in the nonvolatile memory 56 in advance. Thus, the shift amount is converted into the defocus amount DEF.

デフォーカス量DEFの算出を終えると、AF部42はデフォーカス量算出サブルーチンを終了する。   When the calculation of the defocus amount DEF is finished, the AF unit 42 ends the defocus amount calculation subroutine.

ここで、シフト量dk3からシフト量dk4を減算する理由について説明する。シフト量dk3は、A像とB像のシフト量である。A像を生成する第1の画素群とB像を生成する第2の画素群は、位相差を検出する方向(ここではX軸方向)と直交する方向(Y軸方向)に離間しているため、被写体光学像をサンプリングする位置が異なる。そのため、斜め方向にコントラスト(明暗差)があるエッジを有する被写体を焦点検出する場合には、デフォーカス量とは関係のない位相差が、焦点検出誤差としてA像とB像との間に発生する。この焦点検出誤差は、GA像とGB像との間にも同様の理由で発生するが、GA像とGB像の位相差(シフト量dk4)は、デフォーカス量によって増減しない。このことを利用して、dk3からdk4を減算することにより、被写体によって発生する焦点検出誤差を低減することができる。   Here, the reason why the shift amount dk4 is subtracted from the shift amount dk3 will be described. The shift amount dk3 is a shift amount between the A image and the B image. The first pixel group that generates the A image and the second pixel group that generates the B image are separated in a direction (Y-axis direction) orthogonal to the direction in which the phase difference is detected (here, the X-axis direction). Therefore, the position where the subject optical image is sampled is different. Therefore, when focus detection is performed on an object having an edge with contrast (brightness difference) in an oblique direction, a phase difference unrelated to the defocus amount occurs between the A image and the B image as a focus detection error. To do. This focus detection error also occurs between the GA image and the GB image for the same reason, but the phase difference (shift amount dk4) between the GA image and the GB image does not increase or decrease depending on the defocus amount. By utilizing this fact and subtracting dk4 from dk3, it is possible to reduce the focus detection error caused by the subject.

このように、本実施形態によれば、デフォーカス量の大小に応じて相関演算を行う1対の像信号を変更することにより、デフォーカス量の大きさに適した焦点検出結果を得ることができる。
●(第4の実施形態)
以下、本発明の第4の実施形態について説明する。第1の実施形態との主な違いは、デフォーカス量算出方法の違いである。上述の実施形態では、デフォーカス量の算出は常に、AF用A像信号と撮影信号(GA像信号)の位相差検出結果とAF用B像信号と撮影信号(GB像信号)の位相差検出結果を用いて行った。これにより、AF用A像信号を得る画素とAF用B像信号を得る画素の配置が離れていた場合でも、精度よく焦点検出を行うことができる。しかし、焦点検出を行う像高が高く、更に絞り値が大きい(絞り径が小さい)場合には、AF用A像信号とGA像信号(撮影信号)、もしくはAF用B像信号とGB像信号(撮影信号)のどちらかの基線長が短くなる。これは、像高が高いと、AF用A像信号とAF用B像信号で、瞳のケラレ方が大きく異なるためである。
As described above, according to the present embodiment, the focus detection result suitable for the magnitude of the defocus amount can be obtained by changing the pair of image signals for performing the correlation calculation according to the magnitude of the defocus amount. it can.
● (Fourth embodiment)
The fourth embodiment of the present invention will be described below. The main difference from the first embodiment is the difference in the defocus amount calculation method. In the embodiment described above, the defocus amount is always calculated by detecting the phase difference between the AF A image signal and the shooting signal (GA image signal), and detecting the phase difference between the AF B image signal and the shooting signal (GB image signal). The results were used. Thereby, even when the pixel for obtaining the AF A image signal and the pixel for obtaining the AF B image signal are distant from each other, focus detection can be performed with high accuracy. However, when the image height for focus detection is high and the aperture value is large (diaphragm diameter is small), the AF A image signal and GA image signal (shooting signal), or the AF B image signal and GB image signal. The baseline length of either (shooting signal) is shortened. This is because when the image height is high, the vignetting of the pupil is greatly different between the AF A image signal and the AF B image signal.

図10は、撮影レンズの射出瞳距離と焦点検出用画素が見ている瞳位置の関係を示した図である。   FIG. 10 is a diagram showing the relationship between the exit pupil distance of the photographing lens and the pupil position viewed by the focus detection pixels.

1601aはAF用A像信号の瞳、1601bはAF用B像信号の瞳をそれぞれ表している。図10は、焦点検出の像高が−x1にあるとき、センサの入射瞳面のX2を見て、焦点検出を行うことを説明している。この図を見ればわかるように、撮影レンズの射出瞳距離ZLがセンサの入射瞳距離Zsに近くなるほど、X2は光軸に近くなる。すると、x1が変化しても、X2は常に光軸付近にあるため、AF用A像信号とGA像信号(撮影信号)の基線長と、AF用B像信号とGB像信号(撮影信号)の基線長でどちらかが一方だけ極端に短くなることはなくなる。   1601a represents the pupil of the AF A image signal, and 1601b represents the pupil of the AF B image signal. FIG. 10 illustrates that focus detection is performed by looking at X2 on the entrance pupil plane of the sensor when the image height of focus detection is −x1. As can be seen from this figure, the closer the exit pupil distance ZL of the taking lens is to the entrance pupil distance Zs of the sensor, the closer X2 is to the optical axis. Then, even if x1 changes, since X2 is always near the optical axis, the base lengths of the AF A image signal and the GA image signal (shooting signal), the AF B image signal, and the GB image signal (shooting signal) One of the base line lengths will not become extremely short.

逆に、撮影レンズの射出瞳距離ZLがセンサの入射瞳距離Zsから遠くなるほど、|-x1|が大きくなると、X2も大きな値をとる。そのため、AF用A像信号とGA像信号(撮影信号)の基線長、もしくはAF用B像信号とGB像信号(撮影信号)の基線長のどちらかが極端に短くなりやすくなる。図10の場合、ZLがZsより小さく、x1がマイナス像高にあるため、AF用B像信号とGB像信号(撮影信号)の基線長が短い。一方、ZLがZsよりも長く、x1がマイナス像高にある場合はX2がマイナス側に反転するため、AF用A像信号とGA像信号(撮影信号)の基線長が短くなる。   Conversely, as the exit pupil distance ZL of the photographic lens becomes farther from the entrance pupil distance Zs of the sensor, as | −x1 | increases, X2 also takes a larger value. For this reason, either the baseline length of the AF A image signal and the GA image signal (shooting signal) or the baseline length of the AF B image signal and the GB image signal (shooting signal) tends to become extremely short. In the case of FIG. 10, since ZL is smaller than Zs and x1 is a negative image height, the baseline lengths of the AF B image signal and the GB image signal (shooting signal) are short. On the other hand, when ZL is longer than Zs and x1 is at a negative image height, X2 is inverted to the negative side, so that the baseline lengths of the AF A image signal and the GA image signal (shooting signal) are shortened.

図11は、像高が高い場合(図10に示すX2が破線で示される円の位置にあるとき)に、AF用A像信号とAF用B像信号で、瞳のケラレ方が大きく異なることを説明した図である。図11(a)は、AF用A像信号の瞳(センサの入射瞳。以下「瞳」と省略)が、枠(レンズ枠や絞り枠の総称)でケラレている様子、図11(b)は、AF用B像信号の瞳が、枠でケラレている様子を示している。また、図11(c)は、撮影用GA像信号(もしくはGB像信号)の瞳が、枠でケラレている様子を示している。さらに、図11(d)は、枠によるケラレを考慮したAF用A像信号、AF用B像信号、撮影用GA像信号(もしくはGB像信号)のそれぞれの線像の様子を示している。   FIG. 11 shows that when the image height is high (when X2 shown in FIG. 10 is in the position of a circle indicated by a broken line), the vignetting of the pupil is greatly different between the AF A image signal and the AF B image signal. FIG. FIG. 11A shows a state in which the pupil of the AF A image signal (the entrance pupil of the sensor; hereinafter abbreviated as “pupil”) is vignetted by a frame (a general term for a lens frame and a diaphragm frame), and FIG. Shows a state in which the pupil of the AF B image signal is vignetted by the frame. FIG. 11C shows a state in which the pupil of the shooting GA image signal (or GB image signal) is vignetted by the frame. Further, FIG. 11D shows the state of each line image of the AF A image signal, the AF B image signal, and the shooting GA image signal (or GB image signal) in consideration of vignetting due to the frame.

1401aはAF用A像信号の瞳、1401bはAF用B像信号の瞳、1401cは撮像用GA像信号(もしくはGB像信号)の瞳、1402aはAF用A像信号の線像、1402bはAF用B像信号の線像、1402cは撮影用GA像信号(もしくはGB像信号)の線像を示している。また、1403aはAF用A像信号の線像の光軸(線像の重心位置)、1403bはAF用B像信号の線像の光軸、1403cは撮影用GA像信号(もしくはGB像信号)の線像の光軸を示している。   1401a is the pupil of the AF A image signal, 1401b is the pupil of the AF B image signal, 1401c is the pupil of the imaging GA image signal (or GB image signal), 1402a is the line image of the AF A image signal, and 1402b is AF A line image 1402c of the B image signal for image is a line image of the GA image signal for shooting (or GB image signal). 1403a is the optical axis of the line image of the AF A image signal (the center of gravity of the line image), 1403b is the optical axis of the line image of the AF B image signal, and 1403c is the GA image signal for shooting (or the GB image signal). The optical axis of the line image is shown.

図11は、焦点検出を行う像高がAF用A像信号の瞳の山がある場合を示したものであるが、この場合はAF用A像信号とAF用GA像信号で焦点検出を行った場合、基線長が短いため敏感度が高く、焦点検出精度は低下してしまう。これに対して、AF用B像信号とGB像信号で焦点検出を行った場合、基線長は長く取れるため、焦点検出精度は良い。よって、AF用A像信号とGA像信号の焦点検出結果とAF用B像信号とGB像信号の焦点検出結果を加算して焦点検出結果を出すよりも、AF用B像信号とGB像信号の焦点検出結果だけを用いる方が焦点検出精度は高い。図11とは逆の像高で、焦点検出を行う像高がAF用B像信号の瞳の山がある場合は、上記とは逆で、AF用A像信号とGA像信号の焦点検出結果だけを用いる方が焦点検出精度は高い。   FIG. 11 shows a case where the image height at which focus detection is performed has a pupil peak of the AF A image signal. In this case, focus detection is performed using the AF A image signal and the AF GA image signal. In this case, since the baseline length is short, the sensitivity is high, and the focus detection accuracy is lowered. On the other hand, when focus detection is performed using the AF B image signal and the GB image signal, the base line length is long and the focus detection accuracy is good. Therefore, rather than adding the focus detection results of the AF A image signal and the GA image signal and the focus detection results of the AF B image signal and the GB image signal to obtain the focus detection result, the AF B image signal and the GB image signal are output. The focus detection accuracy is higher when only the focus detection result is used. When the image height is the reverse of that in FIG. 11 and the image height for focus detection is the peak of the pupil of the AF B image signal, the focus detection result of the AF A signal and the GA image signal is opposite to the above. The focus detection accuracy is higher when using only.

図12は、デフォーカス量の算出サブルーチンを示すフローチャートである。このサブルーチンでは、第1の実施形態の図6に示す動作と同じ動作を行うステップがあるため、そのステップには図6と同じステップ番号を付す。   FIG. 12 is a flowchart illustrating a defocus amount calculation subroutine. In this subroutine, there is a step for performing the same operation as the operation shown in FIG. 6 of the first embodiment, and therefore the same step number as that in FIG.

第1の実施形態の図5に示すメインルーチンのステップS504から当サブルーチンに進むと、ステップS7041に進み、現時点でのデフォーカス量が所定の閾値より小さいか否かを判定する。現時点でのデフォーカス量は、焦点検出開始以前に得られたデフォーカス量の情報や、焦点検出を繰り返し行っている場合には前回検出したデフォーカス量を用い、その後のレンズ駆動量などを考慮して算出される値である。焦点検出開始以前にデフォーカス量を得る場合には、図5のステップS501で焦点検出を開始する以前から、常に一定間隔で焦点検出を行っていればよい。   When the process proceeds from step S504 of the main routine shown in FIG. 5 of the first embodiment to this subroutine, the process proceeds to step S7041 to determine whether or not the current defocus amount is smaller than a predetermined threshold value. As for the current defocus amount, information on the defocus amount obtained before the start of focus detection, or if the focus detection is repeated, use the defocus amount detected last time, and consider the subsequent lens drive amount, etc. It is a value calculated as follows. When the defocus amount is obtained before the start of focus detection, it is only necessary to always perform focus detection at regular intervals before the focus detection is started in step S501 in FIG.

ステップS7041では、A像とGA像の相関演算と、B像とGB像の相関演算の両方を使用するか片方を使用するかを判定する。A像とGA像の相関演算と、B像とGB像の相関演算の両方を使用すると判定されると、第1の実施形態で説明したステップS5041、ステップS5042と同じ動作を行う処理に進み、シフト量dk1、dk2を算出する。   In step S7041, it is determined whether to use both the correlation calculation between the A image and the GA image and the correlation calculation between the B image and the GB image. If it is determined that both the correlation calculation between the A image and the GA image and the correlation calculation between the B image and the GB image are used, the process proceeds to the process of performing the same operation as that in steps S5041 and S5042 described in the first embodiment. The shift amounts dk1 and dk2 are calculated.

ステップS7041でA像とGA像の相関演算と、B像とGB像の相関演算の片方を使用すると判定されると、ステップS7042に進む。ステップS7042では、A像とGA像の相関演算と、B像とGB像の相関演算のどちらを使用するかを判定する。A像とGA像の相関演算を使用すると判定されれば、第1の実施形態で説明したステップS5041と同じ動作を行う処理へ進みシフト量dk1を算出する。また、B像とGB像の相関演算を使用すると判定されれば第1の実施形態で説明したステップS5042と同じ動作を行う処理へ進みシフト量dk2を算出する。相関演算が行われなかった方のシフト量には0を代入する。   If it is determined in step S7041 that one of the correlation calculation between the A image and the GA image and the correlation calculation between the B image and the GB image are used, the process proceeds to step S7042. In step S7042, it is determined which one of the correlation calculation between the A image and the GA image and the correlation calculation between the B image and the GB image is used. If it is determined that the correlation calculation between the A image and the GA image is to be used, the process proceeds to the process of performing the same operation as step S5041 described in the first embodiment, and the shift amount dk1 is calculated. If it is determined that the correlation calculation between the B image and the GB image is to be used, the process proceeds to the process of performing the same operation as step S5042 described in the first embodiment, and the shift amount dk2 is calculated. 0 is substituted for the shift amount for which the correlation calculation has not been performed.

ここで、ステップS7041の、A像とGA像の相関演算と、B像とGB像の相関演算の両方を使用するか片方のみを使用するかの判定方法としてはいくつかの方法が考えられる。この判定は、撮影レンズの光学条件に関連して行われる。   Here, there are several possible methods for determining whether to use both the correlation calculation of the A image and the GA image and the correlation calculation of the B image and the GB image or only one of them in step S7041. This determination is made in relation to the optical conditions of the taking lens.

まず考えられる方法としては、焦点検出の敏感度を用いる方法がある。図11で説明したように、焦点検出を行う場合の基線長が短くなると、焦点検出の敏感度が高くなる。敏感度が高すぎると、焦点検出精度の信頼性が低下するため、敏感度が所定閾値を超えた場合は、その敏感度を用いてデフォーカス量を算出する相関演算をしない手法は有効である。この方法は、敏感度以外に条件分岐する必要がないため、システム規模を抑えることができる。   As a first conceivable method, there is a method using the sensitivity of focus detection. As described with reference to FIG. 11, the sensitivity of focus detection increases as the baseline length for focus detection decreases. If the sensitivity is too high, the reliability of the focus detection accuracy decreases, so if the sensitivity exceeds a predetermined threshold, a method that does not perform correlation calculation that calculates the defocus amount using that sensitivity is effective. . Since this method does not require conditional branching other than sensitivity, the system scale can be reduced.

次の方法としては、焦点検出の像高である。図11で説明したように、焦点検出を行う像高が高い場合、dk1とdk2で演算精度の差が大きくなる。そのため、焦点検出を行う像高に閾値を設け、焦点検出を行う像高が所定閾値を超えた場合はdk1、dk2のいずれかのみを使用し、所定閾値未満の場合はdk1、dk2の両方を使用する方法がある。ただし、焦点検出の像高だけでは、dk1とdk2の両方を使うか片方を使うかの切り替えが頻繁になってしまう可能性がある。そのため、これを避けたい場合(サーボAFで被写体追従し、AF方式を固定したい場合等)、絞り値や、撮影レンズの射出瞳距離を条件に加える方法が考えられる。絞り値が大きい場合、dk1とdk2の差が大きくなりやすいため、絞り値が所定閾値より大きい場合、上記で説明した像高による切り替えを行うとする。また、撮影レンズの射出瞳距離が短い場合、dk1用の敏感度と、dk2用の敏感度を比較し、所定以上の差(比や差分値等)がある場合、片方を用いて焦点検出を行うとする。このように、A像とGA像の相関演算と、B像とGB像の相関演算の両方を使用するか片方のみを使用するかの判定方法は複数考えられるが、これは要求仕様に応じて使い分ければよい。   The next method is the image height for focus detection. As described with reference to FIG. 11, when the image height for focus detection is high, the difference in calculation accuracy between dk1 and dk2 increases. For this reason, a threshold is set for the image height for focus detection. If the image height for focus detection exceeds a predetermined threshold, only one of dk1 and dk2 is used, and if it is less than the predetermined threshold, both dk1 and dk2 are used. There is a method to use. However, if only the image height for focus detection is used, there is a possibility that switching between using both dk1 and dk2 or using one is frequent. Therefore, when it is desired to avoid this (for example, when the subject is followed by servo AF and the AF method is fixed), a method of adding the aperture value and the exit pupil distance of the photographing lens to the condition can be considered. When the aperture value is large, the difference between dk1 and dk2 tends to be large. Therefore, when the aperture value is larger than the predetermined threshold value, the switching based on the image height described above is performed. Also, when the exit pupil distance of the photographing lens is short, the sensitivity for dk1 is compared with the sensitivity for dk2, and when there is a difference (ratio, difference value, etc.) that exceeds a predetermined value, focus detection is performed using one of them. Suppose you do. As described above, there can be a plurality of methods for determining whether to use both the correlation calculation between the A image and the GA image and the correlation calculation between the B image and the GB image or only one of them. This depends on the required specifications. Use it properly.

図13は、図12におけるステップS7041の詳細な処理を示すフローチャートであり、撮影レンズの射出瞳距離、絞り値、像高を用いて、A像とGAの相関演算と、B像とGB像の相関演算の両方を使用するか片方のみを使用するかの判定を行った場合を示している。   FIG. 13 is a flowchart showing the detailed processing of step S7041 in FIG. 12, and uses the exit pupil distance, aperture value, and image height of the taking lens to calculate the correlation between the A image and the GA, and the B image and the GB image. A case is shown in which it is determined whether to use both of the correlation operations or only one of them.

まず、ステップS70411で撮影レンズの射出瞳距離ZLと、センサの入射瞳距離Zsを比較する。そして、差が所定の値Zlimitより小さければデフォーカス量を加算する、すなわちA像とGA像の相関演算と、B像とGB像の相関演算の両方を使用すると判定してリターンへ進む。一方、差がZlimit以上である場合はステップS70412へ進む。   First, in step S70411, the exit pupil distance ZL of the photographing lens is compared with the entrance pupil distance Zs of the sensor. If the difference is smaller than the predetermined value Zlimit, the defocus amount is added, that is, it is determined that both the correlation calculation between the A image and the GA image and the correlation calculation between the B image and the GB image are used, and the process proceeds to return. On the other hand, if the difference is greater than or equal to Zlimit, the process proceeds to step S70412.

ステップS70412では絞り値Fが所定の閾値Flimitより小さければデフォーカス量を加算すると判定してリターンへ進み、Flimit以上の場合はステップS70413へ進む。ステップS70413ではx1の絶対値が所定の閾値Xlimitより小さければデフォーカス量を加算すると判定してリターンへ進み、Xlimit以上の場合はステップS70414へ進む。   In step S70412, if the aperture value F is smaller than the predetermined threshold value Flimit, it is determined that the defocus amount is added, and the process proceeds to return, and if it is greater than Flimit, the process proceeds to step S70413. In step S70413, if the absolute value of x1 is smaller than the predetermined threshold value Xlimit, it is determined that the defocus amount is added, and the process proceeds to return, and if it is equal to or greater than Xlimit, the process proceeds to step S70414.

ステップS70414では撮影レンズの射出瞳距離ZLとセンサの入射瞳距離Zsを比較し、ZLがZs以上であれば、ステップS70415へ進み、Zsより小さい場合はステップS70416へ進む。ステップS70415ではx1がゼロか正であればステップS70418へ進み、負であればステップS70418へ進む。ステップS70416ではx1がゼロか正であればステップS70417へ進み、負であればステップS70418へ進む。   In step S70414, the exit pupil distance ZL of the photographic lens is compared with the entrance pupil distance Zs of the sensor. If ZL is equal to or greater than Zs, the process proceeds to step S70415, and if smaller than Zs, the process proceeds to step S70416. In step S70415, if x1 is zero or positive, the process proceeds to step S70418, and if negative, the process proceeds to step S70418. In step S70416, if x1 is zero or positive, the process proceeds to step S70417. If x1 is negative, the process proceeds to step S70418.

ステップS70417では、AF用B像信号とGB像信号(撮像信号)のシフト量のみを使用するために敏感度K1=0とする。ステップS70418では、AF用A像信号とGA像信号(撮像信号)のシフト量のみを使用するために敏感度K2=0とする。   In step S70417, since only the shift amount of the AF B image signal and the GB image signal (imaging signal) is used, the sensitivity is set to K1 = 0. In step S70418, the sensitivity K2 = 0 is set in order to use only the shift amounts of the AF A image signal and the GA image signal (imaging signal).

図14は、図12におけるステップS7041の詳細な処理を示すフローチャートであり、敏感度Kを用いて、A像とGA像の相関演算と、B像とGB像の相関演算の両方を使用するか片方のみを使用するかの判定を行った場合を示している。   FIG. 14 is a flowchart showing the detailed processing of step S7041 in FIG. 12, and uses both the correlation calculation between the A image and the GA image and the correlation calculation between the B image and the GB image using the sensitivity K. The case where it is determined whether only one of them is used is shown.

まず、ステップS70419aで敏感度K1が所定の閾値K_limitより小さいか否かを判定する。そして、K_limitよりも小さければデフォーカス量を加算するのでリターンへ進み、K_limit以上の場合はステップS70417へ進む。ステップS70417では、AF用B像信号とGB像信号(撮像信号)のシフト量のみを使用するために敏感度K1=0とする。   First, in step S70419a, it is determined whether or not the sensitivity K1 is smaller than a predetermined threshold K_limit. If it is smaller than K_limit, the defocus amount is added, so the process proceeds to RETURN, and if it is greater than K_limit, the process proceeds to step S70417. In step S70417, since only the shift amount of the AF B image signal and the GB image signal (imaging signal) is used, the sensitivity is set to K1 = 0.

次に、ステップS70419bでは、敏感度K2が所定の閾値K_limitより小さいか否かを判定する。そして、K_limitより小さければデフォーカス量を加算するのでリターンへ進み、K_limit以上の場合はステップS70418へ進む。ステップS70418では、AF用A像信号とGA像信号(撮像信号)のシフト量のみを使用するために敏感度K2=0とする。以上がS7041における処理の詳細な説明である。   Next, in step S70419b, it is determined whether or not the sensitivity K2 is smaller than a predetermined threshold value K_limit. If it is smaller than K_limit, the defocus amount is added, so the process proceeds to return, and if it is greater than K_limit, the process proceeds to step S70418. In step S70418, the sensitivity K2 = 0 is set in order to use only the shift amounts of the AF A image signal and the GA image signal (imaging signal). The above is the detailed description of the processing in S7041.

次に、図12のステップS7042について説明する。ステップS7042では、どちらの相関演算を行うかの判定を行う。ステップS7042で、ステップS7041で設定された敏感度K1=0でない場合はステップS5041へ進み、シフト量dk1を算出する。敏感度K1=0の場合はステップS5042へ進み、dk2を算出する。   Next, step S7042 in FIG. 12 will be described. In step S7042, it is determined which correlation calculation is performed. In step S7042, if the sensitivity K1 set in step S7041 is not 0, the process proceeds to step S5041, and the shift amount dk1 is calculated. If the sensitivity K1 = 0, the process proceeds to step S5042, and dk2 is calculated.

また、図12のステップS7043では、デフォーカス量の算出を行う。算出されたシフト量dk1、dk2に、予め不揮発性メモリ56に記憶された値(もしくはデフォーカス量の加算判定で設定された0)を敏感度K1、K2(デフォーカス量換算係数)として掛けて、下記の式を演算することで、シフト量をデフォーカス量Defに換算する。   In step S7043 in FIG. 12, the defocus amount is calculated. Multiply the calculated shift amounts dk1 and dk2 by the values stored in the nonvolatile memory 56 in advance (or 0 set in the defocus amount addition determination) as the sensitivity K1 and K2 (defocus amount conversion coefficient). The shift amount is converted into the defocus amount Def by calculating the following equation.

Def=K1×dk1+K2×dk2 ...(4)
なお、本実施形態では、式(4)を用いてデフォーカス量を算出したが、式(5)のように重みづけ係数G1,G2を用いて算出してもよい。
Def = K1 × dk1 + K2 × dk2 (4)
In this embodiment, the defocus amount is calculated using Expression (4), but may be calculated using weighting coefficients G1 and G2 as shown in Expression (5).

Def=G1×K1×dk1+G2×K2×dk2 ...(5)
デフォーカス量Defの算出を終えると、デフォーカス量の算出サブルーチンを終了する。
Def = G1 * K1 * dk1 + G2 * K2 * dk2 (5)
When the calculation of the defocus amount Def ends, the defocus amount calculation subroutine ends.

以上のように相関演算を行う対の像信号を選択することにより、常に精度のよい焦点検出結果を得ることができる。
(その他の実施形態)
上述の実施形態は発明の理解を容易にするための例示であり、本発明はこれらの実施形態に記載した特定の構成に限定されない。本発明の範囲は特許請求の範囲の記載によって規定され、その範囲内で種々の変形及び変更が可能である。
As described above, by selecting a pair of image signals for which correlation calculation is performed, it is possible to always obtain a focus detection result with high accuracy.
(Other embodiments)
The above-described embodiments are examples for facilitating understanding of the present invention, and the present invention is not limited to the specific configurations described in these embodiments. The scope of the present invention is defined by the description of the claims, and various modifications and changes can be made within the scope.

また、本発明は、以下の処理を実行することによっても実現される。即ち、上述した実施形態の機能を実現するソフトウェア(プログラム)を、ネットワーク又は各種記憶媒体を介してシステム或いは装置に供給し、そのシステム或いは装置のコンピュータ(またはCPUやMPU等)がプログラムを読み出して実行する処理である。   The present invention can also be realized by executing the following processing. That is, software (program) that realizes the functions of the above-described embodiments is supplied to a system or apparatus via a network or various storage media, and a computer (or CPU, MPU, or the like) of the system or apparatus reads the program. It is a process to be executed.

Claims (13)

撮影光学系の射出瞳の一部の領域を通過した光束に基づく第1の像信号と、前記射出瞳の全領域を通過した光束に基づく第3の像信号との第1の位相差を検出する第1の算出手段と、
前記射出瞳の前記一部の領域とは異なる一部の領域を通過した光束に基づく第2の像信号と、前記射出瞳の全領域を通過した光束に基づく第4の像信号との第2の位相差を検出する第2の算出手段と、
前記第1の位相差および前記第2の位相差に重みづけ係数を掛けて加えた和を用いて、前記撮影光学系のデフォーカス量を算出するデフォーカス量算出手段と、
を有することを特徴とする焦点検出装置。
Detecting a first phase difference between a first image signal based on a light beam that has passed through a partial area of the exit pupil of the imaging optical system and a third image signal based on a light beam that has passed through the entire area of the exit pupil. First calculating means for
A second image signal based on a light beam that has passed through a partial area different from the partial area of the exit pupil and a second image signal based on a light beam that has passed through the entire area of the exit pupil. Second calculating means for detecting a phase difference between
Defocus amount calculation means for calculating a defocus amount of the photographing optical system, using a sum of the first phase difference and the second phase difference multiplied by a weighting coefficient;
A focus detection apparatus comprising:
前記デフォーカス量算出手段は、焦点検出のための基線長に関連する光学条件に基づいて、前記重みづけ係数を決定することを特徴とする請求項1に記載の焦点検出装置。   The focus detection apparatus according to claim 1, wherein the defocus amount calculation unit determines the weighting coefficient based on an optical condition related to a baseline length for focus detection. 前記基線長に関連する光学条件は、焦点検出の像高、瞳距離、絞り値、デフォーカス量換算係数のうちの少なくとも1つを含むことを特徴とする請求項2に記載の焦点検出装置。   The focus detection apparatus according to claim 2, wherein the optical condition related to the baseline length includes at least one of an image height for focus detection, a pupil distance, an aperture value, and a defocus amount conversion coefficient. 前記基線長に関連する光学条件は、デフォーカス量換算係数を用いることを特徴とする請求項3に記載の焦点検出装置。   The focus detection apparatus according to claim 3, wherein a defocus amount conversion coefficient is used as the optical condition related to the baseline length. 前記1の像信号の生成に用いられる第1の画素群と、前記第2の像信号の生成に用いられる第2の画素群とが、撮像素子において、前記第1および第2の位相差を検出する方向と直交する方向に離間していることを特徴とする請求項1乃至4のいずれか1項に記載の焦点検出装置。   The first pixel group used for generating the first image signal and the second pixel group used for generating the second image signal have the first and second phase differences in the image sensor. The focus detection apparatus according to claim 1, wherein the focus detection apparatus is separated in a direction orthogonal to a direction to be detected. 前記第1の画素群と、前記3の像信号の生成に用いられる第3の画素群との、前記直交する方向における距離は、前記第1の画素群と、前記第2の画素群との、前記直交する方向における距離より小さく、
前記第2の画素群と、前記4の像信号の生成に用いられる第4の画素群との、前記直交する方向における距離は、前記第1の画素群と前記第2の画素群との、前記直交する方向における距離より小さい、
ことを特徴とする請求項5に記載の焦点検出装置。
The distance in the orthogonal direction between the first pixel group and the third pixel group used for generating the third image signal is the distance between the first pixel group and the second pixel group. Smaller than the distance in the orthogonal direction,
The distance in the orthogonal direction between the second pixel group and the fourth pixel group used for generating the four image signals is the distance between the first pixel group and the second pixel group. Smaller than the distance in the orthogonal direction,
The focus detection apparatus according to claim 5.
前記第3の画素群の各画素と、前記第1の画素群の各画素とが隣接する画素であり、前記第4の画素群の各画素と、前記第2の画素群の各画素とが隣接する画素であることを特徴とする請求項6に記載の焦点検出装置。   Each pixel of the third pixel group is adjacent to each pixel of the first pixel group, and each pixel of the fourth pixel group and each pixel of the second pixel group are The focus detection apparatus according to claim 6, wherein the focus detection apparatus is an adjacent pixel. 前記第3の像信号および前記第4の像信号が、複数の画素値に基づいて生成された画素値によって生成されることを特徴とする請求項6に記載の焦点検出装置。   The focus detection apparatus according to claim 6, wherein the third image signal and the fourth image signal are generated by pixel values generated based on a plurality of pixel values. 前記第1の像信号と前記第3の像信号が、同一の画素群の出力に基づいて生成され、
前記第2の像信号と前記第4の像信号が、同一の画素群の出力に基づいて生成される、
ことを特徴とする請求項6に記載の焦点検出装置。
The first image signal and the third image signal are generated based on the output of the same pixel group;
The second image signal and the fourth image signal are generated based on the output of the same pixel group.
The focus detection apparatus according to claim 6.
撮影光学系の射出瞳の一部の領域を通過した光束に基づく像信号と、前記射出瞳の全領域を通過した光束に基づく像信号とを読み出し可能な撮像素子と、
請求項1乃至9のいずれか1項に記載の焦点検出装置と、
を有することを特徴とする撮像装置。
An image sensor that can read out an image signal based on a light beam that has passed through a partial area of the exit pupil of the imaging optical system, and an image signal based on a light beam that has passed through the entire area of the exit pupil;
The focus detection apparatus according to any one of claims 1 to 9,
An imaging device comprising:
撮影光学系の射出瞳の一部の領域を通過した光束に基づく第1の像信号と、前記射出瞳の全領域を通過した光束に基づく第3の像信号との第1の位相差を検出する第1の算出工程と、
前記射出瞳の前記一部の領域とは異なる一部の領域を通過した光束に基づく第2の像信号と、前記射出瞳の全領域を通過した光束に基づく第4の像信号との第2の位相差を検出する第2の算出工程と、
前記第1の位相差および前記第2の位相差に重みづけ係数を掛けて加えた和を用いて、前記撮影光学系のデフォーカス量を算出するデフォーカス量算出工程と、
を有することを特徴とする焦点検出装置の制御方法。
Detecting a first phase difference between a first image signal based on a light beam that has passed through a partial area of the exit pupil of the imaging optical system and a third image signal based on a light beam that has passed through the entire area of the exit pupil. A first calculating step,
A second image signal based on a light beam that has passed through a partial area different from the partial area of the exit pupil and a second image signal based on a light beam that has passed through the entire area of the exit pupil. A second calculation step of detecting the phase difference of
A defocus amount calculation step of calculating a defocus amount of the photographing optical system using a sum obtained by multiplying the first phase difference and the second phase difference by a weighting coefficient;
A method for controlling a focus detection apparatus, comprising:
コンピュータに、請求項11に記載の制御方法の各工程を実行させるためのプログラム。   The program for making a computer perform each process of the control method of Claim 11. コンピュータに、請求項11に記載の制御方法の各工程を実行させるためのプログラムを記憶したコンピュータが読み取り可能な記憶媒体。   A computer-readable storage medium storing a program for causing a computer to execute each step of the control method according to claim 11.
JP2014195808A 2014-09-25 2014-09-25 Focus detector, control method thereof, program, and memory medium Pending JP2016066015A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014195808A JP2016066015A (en) 2014-09-25 2014-09-25 Focus detector, control method thereof, program, and memory medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014195808A JP2016066015A (en) 2014-09-25 2014-09-25 Focus detector, control method thereof, program, and memory medium

Publications (1)

Publication Number Publication Date
JP2016066015A true JP2016066015A (en) 2016-04-28

Family

ID=55805515

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014195808A Pending JP2016066015A (en) 2014-09-25 2014-09-25 Focus detector, control method thereof, program, and memory medium

Country Status (1)

Country Link
JP (1) JP2016066015A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107370939A (en) * 2016-05-12 2017-11-21 佳能株式会社 Focus detection device and its control method, picture pick-up device and computer-readable medium
JP2020013083A (en) * 2018-07-20 2020-01-23 株式会社ニコン Focus detector, imaging device, and interchangeable lens

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107370939A (en) * 2016-05-12 2017-11-21 佳能株式会社 Focus detection device and its control method, picture pick-up device and computer-readable medium
US10523860B2 (en) 2016-05-12 2019-12-31 Canon Kabushiki Kaisha Focus detection device, control method thereof, and image capture apparatus
CN107370939B (en) * 2016-05-12 2020-06-12 佳能株式会社 Focus detection apparatus, control method thereof, image pickup apparatus, and computer readable medium
JP2020013083A (en) * 2018-07-20 2020-01-23 株式会社ニコン Focus detector, imaging device, and interchangeable lens
JP7279313B2 (en) 2018-07-20 2023-05-23 株式会社ニコン Focus detection device and imaging device

Similar Documents

Publication Publication Date Title
JP6405243B2 (en) Focus detection apparatus and control method thereof
JP6289017B2 (en) Imaging apparatus, control method therefor, program, and storage medium
US8988585B2 (en) Focus adjustment apparatus
US9137436B2 (en) Imaging apparatus and method with focus detection and adjustment
US10187564B2 (en) Focus adjustment apparatus, imaging apparatus, focus adjustment method, and recording medium storing a focus adjustment program thereon
JP6906360B2 (en) Focus detector and its control method
US9602716B2 (en) Focus-detection device, method for controlling the same, and image capture apparatus
US9060119B2 (en) Image capturing apparatus and control method for image capturing apparatus
US9900493B2 (en) Focus detecting apparatus, and method of prediction for the same
US9888165B2 (en) Image capturing apparatus, control method therefor and storage medium
JP6960755B2 (en) Imaging device and its control method, program, storage medium
JP2016066015A (en) Focus detector, control method thereof, program, and memory medium
JP6941011B2 (en) Imaging device and its control method, program, storage medium
JP2016099432A (en) Focus detection device, and method, program and storage medium
KR20170087029A (en) Imaging apparatus and control method thereof
JP6234094B2 (en) Focus detection apparatus and imaging apparatus
JP6395790B2 (en) IMAGING DEVICE, IMAGING DEVICE CONTROL METHOD, AND FOCUS CONTROL PROGRAM
JP5773659B2 (en) Imaging apparatus and control method
JP7066458B2 (en) Imaging device and its control method, program
JP2016218157A (en) Focus detection device and method for controlling the same
JP7005313B2 (en) Imaging device and its control method, program, storage medium
JP6613065B2 (en) FOCUS DETECTION DEVICE, ITS CONTROL METHOD, AND IMAGING DEVICE
JP5865417B2 (en) Imaging apparatus and image processing method
JP2016122950A (en) Imaging apparatus
JP2014186343A (en) Imaging device