JP6890937B2 - Focus detector, image pickup device, and focus detection method - Google Patents

Focus detector, image pickup device, and focus detection method Download PDF

Info

Publication number
JP6890937B2
JP6890937B2 JP2016151419A JP2016151419A JP6890937B2 JP 6890937 B2 JP6890937 B2 JP 6890937B2 JP 2016151419 A JP2016151419 A JP 2016151419A JP 2016151419 A JP2016151419 A JP 2016151419A JP 6890937 B2 JP6890937 B2 JP 6890937B2
Authority
JP
Japan
Prior art keywords
focus detection
focus
correction value
phase difference
optical system
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.)
Active
Application number
JP2016151419A
Other languages
Japanese (ja)
Other versions
JP2018021971A (en
JP2018021971A5 (en
Inventor
優 稲垣
優 稲垣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP2016151419A priority Critical patent/JP6890937B2/en
Publication of JP2018021971A publication Critical patent/JP2018021971A/en
Publication of JP2018021971A5 publication Critical patent/JP2018021971A5/en
Application granted granted Critical
Publication of JP6890937B2 publication Critical patent/JP6890937B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Focusing (AREA)
  • Structure And Mechanism Of Cameras (AREA)
  • Automatic Focus Adjustment (AREA)
  • Studio Devices (AREA)

Description

本発明は焦点検出装置、撮像装置、および焦点検出方法に関し、特には自動焦点検出技術に関する。 The present invention is a focus detection apparatus, imaging apparatus, and relates to a focus detecting method and, more particularly, to an automatic focus detection technique.

撮像装置の自動焦点検出(AF)方式として、位相差焦点検出方式(位相差AF)が知られている。位相差AFは、ビデオカメラやデジタルスチルカメラで多く用いられるAFであり、撮像素子が焦点検出用センサとして用いられるものが存在する。位相差AFは、光学像を利用して焦点検出を行うため、光学像を結像する光学系の収差が焦点検出結果に誤差を与える場合があり、このような誤差を低減するための方法が提案されている。 A phase difference focus detection method (phase difference AF) is known as an automatic focus detection (AF) method for an image pickup apparatus. Phase-difference AF is AF that is often used in video cameras and digital still cameras, and there are some that use an image sensor as a focus detection sensor. Since phase-difference AF uses an optical image to detect the focus, the aberration of the optical system that forms the optical image may give an error to the focus detection result, and a method for reducing such an error is available. Proposed.

例えば、特許文献1には、合焦状態において一対の焦点検出光束が形成する一対の光学像の形状が、光学系の収差に起因して一致しなくなることによる焦点検出誤差を補正する方法が開示されている。 For example, Patent Document 1 discloses a method of correcting a focus detection error due to the shapes of a pair of optical images formed by a pair of focus detection light fluxes not matching due to aberration of an optical system in a focused state. Has been done.

特開2013−171251号公報Japanese Unexamined Patent Publication No. 2013-171251

しかしながら、従来の方法では、被写体の色、方向、空間周波数に依存する補正と、位相差AFに依存する補正をまとめて補正しているため、補正精度が十分でないことがある。また、特許文献1では、最良像面と予定焦点面との間のデフォーカス量を検知し補正している。そのため、被写体の色、方向、空間周波数に依存する補正と、位相差AFに依存する補正をまとめて補正することとなり、算出される補正値が大きくなる。このことから、補正値算出誤差の影響が大きくなり、補正精度が十分でない。 However, in the conventional method, the correction that depends on the color, direction, and spatial frequency of the subject and the correction that depends on the phase difference AF are collectively corrected, so that the correction accuracy may not be sufficient. Further, in Patent Document 1, the amount of defocus between the best image plane and the planned focal plane is detected and corrected. Therefore, the correction depending on the color, direction, and spatial frequency of the subject and the correction depending on the phase difference AF are collectively corrected, and the calculated correction value becomes large. For this reason, the influence of the correction value calculation error becomes large, and the correction accuracy is not sufficient.

本発明は、上記課題を鑑みて、被写体の色、方向、空間周波数に依存する補正と、位相差AFに依存する補正を分けて補正することで、位相差AFの焦点検出誤差を高精度に補正可能な焦点検出方法を提供することを目的とする。 In view of the above problems, the present invention makes the focus detection error of the phase difference AF highly accurate by separately correcting the correction depending on the color, direction, and spatial frequency of the subject and the correction depending on the phase difference AF. It is an object of the present invention to provide a correctable focus detection method.

上記の課題を解決するために、本発明の焦点検出装置は、撮像光学系の異なる瞳領域を通過した光束を光電変換して、一対の光電変換信号を出力することが可能な複数の画素を有する撮像手段と、撮影光学系の収差情報を取得する取得手段と、前記取得した収差情報から、画像の画像特性または評価特性から算出される撮像合焦位置と、焦点検出手段の焦点検出特性から算出される焦点検出合焦位置から第1補正値を算出し、一対の線像強度分布の形状が互いに異なることで生じる重心ずれ量差に応じた補正値であって、前記焦点検出合焦位置における前記撮像手段一対の光電変換部に対応した前記撮影光学系の線像強度分布に基づいて位相差焦点検出方式で検出される位相差焦点検出合焦位置から第2補正値を算出し、前記第1補正値と前記第2補正値から焦点検出補正値を算出する算出手段と、
を有する。
In order to solve the above problems, the focus detection device of the present invention photoelectrically converts light beams that have passed through different pupil regions of the imaging optical system, and outputs a plurality of pixels capable of outputting a pair of photoelectric conversion signals. From the image pickup means, the acquisition means for acquiring the aberration information of the photographing optical system, the imaging focus position calculated from the image characteristics or the evaluation characteristics of the image from the acquired aberration information, and the focus detection characteristics of the focus detection means. The first correction value is calculated from the calculated focus detection focus position, and is a correction value according to the difference in the amount of center of gravity shift caused by the shapes of the pair of line image intensity distributions being different from each other. calculating a second correction value from the pair of phase difference focus detection in-focus position which based on the line image intensity distribution of the photographing optical system corresponding to the photoelectric conversion unit is detected by the phase difference focus detection method of the image pickup means in and , A calculation means for calculating the focus detection correction value from the first correction value and the second correction value, and
Have.

本発明によれば、被写体の色、方向、空間周波数に依存する補正と、位相差AFに依存する補正を分けて補正することにより、光学系の収差による位相差AFの焦点検出誤差を精度良く補正可能な焦点検出方法を提供できる。 According to the present invention, the focus detection error of the phase difference AF due to the aberration of the optical system can be accurately corrected by separately correcting the correction depending on the color, direction, and spatial frequency of the subject and the correction depending on the phase difference AF. A correctable focus detection method can be provided.

撮像装置の一例としてデジタルカメラのブロック図である。It is a block diagram of a digital camera as an example of an image pickup apparatus. 撮像素子の構成例を示す図である。It is a figure which shows the structural example of the image sensor. 光電変換領域と射出瞳との関係を示す図である。It is a figure which shows the relationship between a photoelectric conversion region and an exit pupil. TVAF部の構成を示すブロック図である。It is a block diagram which shows the structure of a TVAF part. AF動作を示すフローチャートである。It is a flowchart which shows the AF operation. 焦点検出補正値を算出する処理を示すフローチャートである。It is a flowchart which shows the process of calculating a focus detection correction value. 焦点検出領域の一例を示す図である。It is a figure which shows an example of a focal point detection area. 撮影画像の合焦位置と焦点検出合焦位置との差分の算出処理を示す図である。It is a figure which shows the calculation process of the difference between the in-focus position of a photographed image, and the focus detection focus position. デフォーカスによる線像強度分布の重心ずれ量を説明する図である。It is a figure explaining the amount of the center of gravity shift of a line image intensity distribution by defocus. 重心ずれ量、相関演算結果の差が大きい場合の線像強度分布を示す図である。It is a figure which shows the line image intensity distribution when the difference between the amount of center of gravity shift and the correlation calculation result is large. 一対の線像強度分布の瞳ずれによるシェーディングを示す図である。It is a figure which shows the shading by the pupil deviation of a pair of line image intensity distributions. フィルタ周波数帯域の一例を示す図である。It is a figure which shows an example of a filter frequency band. 像面倒れに応じて第2補正値の製造誤差が変化することを示す図である。It is a figure which shows that the manufacturing error of the 2nd correction value changes according to the image plane tilt. 像面倒れに応じて第2補正値の製造誤差が変化することを示す図である。It is a figure which shows that the manufacturing error of the 2nd correction value changes according to the image plane tilt. 像面倒れに応じて第2補正値の製造誤差が変化することを示す図である。It is a figure which shows that the manufacturing error of the 2nd correction value changes according to the image plane tilt. 位相差AFの焦点検出誤差を高精度に補正できることを説明する図である。It is a figure explaining that the focus detection error of a phase difference AF can be corrected with high accuracy. 第2の実施形態に係る焦点検出補正値算出を示すフローチャートである。It is a flowchart which shows the focus detection correction value calculation which concerns on 2nd Embodiment.

以下、図面を参照しながら本発明の例示的な実施形態について説明する。なお、実施形態は発明の理解と説明を容易にするため、具体的かつ特定の構成を有するが、本発明はそのような特定の構成に限定されない。例えば、以下では本発明をレンズ交換可能な一眼レフタイプのデジタルカメラに適用した実施形態について説明するが、本発明はレンズ交換できないタイプのデジタルカメラや、ビデオカメラに対しても適用可能である。また、カメラを備えた任意の電子機器、例えば携帯電話機、パーソナルコンピュータ(ラップトップ、タブレット、デスクトップ型など)、ゲーム機などで実施することもできる。 Hereinafter, exemplary embodiments of the present invention will be described with reference to the drawings. The embodiment has a specific and specific configuration in order to facilitate understanding and explanation of the invention, but the present invention is not limited to such a specific configuration. For example, although the embodiment in which the present invention is applied to a single-lens reflex type digital camera with interchangeable lenses will be described below, the present invention can also be applied to a digital camera of a non-interchangeable lens type and a video camera. It can also be carried out on any electronic device equipped with a camera, such as a mobile phone, a personal computer (laptop, tablet, desktop type, etc.), a game machine, or the like.

(第1実施形態)
(撮像装置の構成の説明−レンズユニット)
図1は、本実施形態に係る撮像装置の一例としてデジタルカメラの機能構成を示すブロック図である。本実施形態のデジタルカメラは、レンズ交換式一眼レフカメラであり、レンズユニット100とカメラ本体120とを有する。レンズユニット100は、図中央の点線で示されるマウントMを介して、カメラ本体120に装着される。なお、本実施形態のデジタルカメラとしてレンズ交換式一眼レフカメラを例に説明するが、これに限定することなく、例えば、レンズ一体式のカメラであってもよい。
(First Embodiment)
(Explanation of the configuration of the imaging device-lens unit)
FIG. 1 is a block diagram showing a functional configuration of a digital camera as an example of an imaging device according to the present embodiment. The digital camera of the present embodiment is a single-lens reflex camera with interchangeable lenses, and has a lens unit 100 and a camera body 120. The lens unit 100 is attached to the camera body 120 via the mount M shown by the dotted line in the center of the figure. The digital camera of the present embodiment will be described by taking an interchangeable lens single-lens reflex camera as an example, but the present invention is not limited to this, and for example, a camera with an integrated lens may be used.

レンズユニット100は、光学系(第1レンズ群101、絞り102、第2レンズ群103、フォーカスレンズ群(以下、単に「フォーカスレンズ」という)104)、及び駆動/制御系を有する。本実施形態において、レンズユニット100は、フォーカスレンズ104を含み、被写体の光学像を形成する撮影レンズである。なお、本実施形態では、レンズユニット100は、制御手段を構成する。 The lens unit 100 includes an optical system (first lens group 101, aperture 102, second lens group 103, focus lens group (hereinafter, simply referred to as “focus lens”) 104), and a drive / control system. In the present embodiment, the lens unit 100 is a photographing lens that includes a focus lens 104 and forms an optical image of a subject. In this embodiment, the lens unit 100 constitutes a control means.

第1レンズ群101は、レンズユニット100の被写体側の先端に配置され、光軸方向OAに移動可能に保持される。絞り102は、撮影時の光量を調節する機能のほか、静止画撮影時には露出時間を制御するメカニカルシャッタとしても機能する。絞り102及び第2レンズ群103は、一体で光軸方向OAに移動可能であり、第1レンズ群101と連動して移動することによりズーム機能を実現する。フォーカスレンズ104も光軸方向OAに移動可能であり、位置に応じてレンズユニット100が合焦する被写体距離(合焦距離)が変化する。フォーカスレンズ104の光軸方向OAにおける位置を制御することにより、レンズユニット100の合焦距離を調節する焦点調節を行う。 The first lens group 101 is arranged at the tip of the lens unit 100 on the subject side and is movably held in the optical axis direction OA. The aperture 102 functions not only as a function of adjusting the amount of light during shooting, but also as a mechanical shutter for controlling the exposure time during shooting of a still image. The aperture 102 and the second lens group 103 can be integrally moved in the optical axis direction OA, and the zoom function is realized by moving in conjunction with the first lens group 101. The focus lens 104 can also be moved in the optical axis direction OA, and the subject distance (focusing distance) at which the lens unit 100 focuses changes depending on the position. By controlling the position of the focus lens 104 in the optical axis direction OA, the focus adjustment for adjusting the focusing distance of the lens unit 100 is performed.

駆動/制御系は、ズームアクチュエータ111、絞りアクチュエータ112、フォーカスアクチュエータ113、ズーム駆動回路114、絞り絞り駆動回路115、フォーカス駆動回路116、レンズMPU117、レンズメモリ118を有する。ズーム駆動回路114は、ズームアクチュエータ111を用いて第1レンズ群101や第3レンズ群103を光軸方向OAに駆動し、レンズユニット100の光学系の画角を制御する。絞りシャッタ駆動回路115は、絞りアクチュエータ112を用いて絞り102を駆動し、絞り102の開口径や開閉動作を制御する。フォーカス駆動回路116は、フォーカスアクチュエータ113を用いてフォーカスレンズ104を光軸方向OAに駆動し、レンズユニット100の光学系の合焦距離を制御する。また、フォーカス駆動回路116は、フォーカスアクチュエータ113を用いてフォーカスレンズ104の現在位置を検出する。 The drive / control system includes a zoom actuator 111, an aperture actuator 112, a focus actuator 113, a zoom drive circuit 114, an aperture aperture drive circuit 115, a focus drive circuit 116, a lens MPU 117, and a lens memory 118. The zoom drive circuit 114 drives the first lens group 101 and the third lens group 103 in the optical axis direction OA by using the zoom actuator 111, and controls the angle of view of the optical system of the lens unit 100. The aperture shutter drive circuit 115 drives the aperture 102 using the aperture actuator 112, and controls the aperture diameter and opening / closing operation of the aperture 102. The focus drive circuit 116 drives the focus lens 104 in the optical axis direction OA by using the focus actuator 113, and controls the focusing distance of the optical system of the lens unit 100. Further, the focus drive circuit 116 detects the current position of the focus lens 104 by using the focus actuator 113.

レンズMPU(プロセッサ)117は、レンズユニット100に係る全ての演算、制御を行い、ズーム駆動回路114、絞り駆動回路115、フォーカス駆動回路116を制御する。また、レンズMPU117は、マウントMを通じてカメラMPU125と接続され、コマンドやデータを通信する。例えば、レンズMPU117は、フォーカスレンズ104の位置を検出し、カメラMPU125からの要求に対してレンズ位置情報を通知する。このレンズ位置情報は、フォーカスレンズ104の光軸方向OAにおける位置、光学系が移動していない状態の射出瞳の光軸方向OAにおける位置および直径、射出瞳の光束を制限するレンズ枠の光軸方向OAにおける位置および直径などの情報を含む。また、レンズMPU117は、カメラMPU125からの要求に応じて、ズーム駆動回路114、絞り駆動回路115、フォーカス駆動回路116を制御する。レンズメモリ118は、自動焦点検出に必要な光学情報が予め記憶されている。カメラMPU125は、例えば、内蔵する不揮発性メモリやレンズメモリ118に記憶されているプログラムを実行することで、レンズユニット100の動作を制御する。 The lens MPU (processor) 117 performs all calculations and controls related to the lens unit 100, and controls the zoom drive circuit 114, the aperture drive circuit 115, and the focus drive circuit 116. Further, the lens MPU 117 is connected to the camera MPU 125 through the mount M to communicate commands and data. For example, the lens MPU 117 detects the position of the focus lens 104 and notifies the lens position information in response to a request from the camera MPU 125. This lens position information includes the position of the focus lens 104 in the optical axis direction OA, the position and diameter of the exit pupil in the optical axis direction OA when the optical system is not moving, and the optical axis of the lens frame that limits the light beam of the exit pupil. Includes information such as position and diameter in direction OA. Further, the lens MPU 117 controls the zoom drive circuit 114, the aperture drive circuit 115, and the focus drive circuit 116 in response to a request from the camera MPU 125. The lens memory 118 stores in advance optical information necessary for automatic focus detection. The camera MPU 125 controls the operation of the lens unit 100 by, for example, executing a program stored in the built-in non-volatile memory or the lens memory 118.

(撮像装置の構成の説明−カメラ本体)
カメラ本体120は、光学系(光学ローパスフィルタ121及び撮像素子122)と、駆動/制御系とを有する。レンズユニット100の第1レンズ群101、絞り102、第2レンズ群103、フォーカスレンズ104と、カメラ本体120の光学ローパスフィルタ121は、撮影光学系を構成する。
(Explanation of the configuration of the imaging device-camera body)
The camera body 120 has an optical system (optical low-pass filter 121 and an image sensor 122) and a drive / control system. The first lens group 101, the aperture 102, the second lens group 103, the focus lens 104 of the lens unit 100, and the optical low-pass filter 121 of the camera body 120 constitute a photographing optical system.

光学ローパスフィルタ121は、撮影画像の偽色やモアレを軽減する。撮像素子122は、CMOSイメージセンサと周辺回路で構成され、横方向m画素、縦方向n画素(n、mは2以上の整数)が配置される。本実施形態の撮像素子122は、瞳分割機能を有し、画像データを用いた位相差AFが可能である。画像処理回路124は、撮像素子122が出力する画像データから、位相差AF用のデータと、表示、記録、およびコントラスト焦点検出方式(コントラストAF、TVAF)用の画像データを生成する。 The optical low-pass filter 121 reduces false colors and moire of captured images. The image sensor 122 is composed of a CMOS image sensor and peripheral circuits, and is arranged with m pixels in the horizontal direction and n pixels in the vertical direction (n and m are integers of 2 or more). The image pickup device 122 of the present embodiment has a pupil division function, and can perform phase-difference AF using image data. The image processing circuit 124 generates data for phase difference AF and image data for display, recording, and contrast focus detection methods (contrast AF, TVAF) from the image data output by the image pickup element 122.

駆動/制御系は、撮像素子駆動回路123、画像処理回路124、カメラMPU125、表示器126、操作スイッチ群127、メモリ128、位相差AF部129、TVAF部130を有する。撮像素子駆動回路123は、撮像素子122の動作を制御するとともに、取得した画像信号をA/D変換してカメラMPU125に送信する。画像処理回路124は、撮像素子122が取得した画像データに対し、例えば、γ変換、ホワイトバランス調整処理、色補間処理、圧縮符号化処理など、デジタルカメラで行われる一般的な画像処理を行う。また、画像処理回路124は、位相差AF用の信号も生成する。 The drive / control system includes an image sensor drive circuit 123, an image processing circuit 124, a camera MPU 125, a display 126, an operation switch group 127, a memory 128, a phase difference AF unit 129, and a TVAF unit 130. The image sensor drive circuit 123 controls the operation of the image sensor 122, A / D converts the acquired image signal, and transmits the acquired image signal to the camera MPU 125. The image processing circuit 124 performs general image processing performed by a digital camera, such as γ conversion, white balance adjustment processing, color interpolation processing, and compression coding processing, on the image data acquired by the image pickup element 122. The image processing circuit 124 also generates a signal for phase difference AF.

カメラMPU(プロセッサ)125は、カメラ本体120に係る全ての演算、制御を行い、センサ駆動回路123、画像処理回路124、表示器126、操作スイッチ群127、メモリ128、位相差AF部129、TVAF部130を制御する。カメラMPU125は、マウントMの信号線を介してレンズMPU117と接続され、レンズMPU117とコマンドやデータを通信する。また、カメラMPU125は、レンズMPU117に対し、レンズ位置の取得要求や、所定の駆動量での絞り、フォーカスレンズ、ズーム駆動要求や、レンズユニット100に固有の光学情報の取得要求などを発行する。さらに、カメラMPU125には、カメラ動作を制御するプログラムを格納したROM125a、変数を記憶するRAM125b、諸パラメータを記憶するEEPROM125cが内蔵されている。 The camera MPU (processor) 125 performs all calculations and controls related to the camera body 120, and performs sensor drive circuit 123, image processing circuit 124, display 126, operation switch group 127, memory 128, phase difference AF unit 129, and TVAF. The unit 130 is controlled. The camera MPU 125 is connected to the lens MPU 117 via the signal line of the mount M, and communicates commands and data with the lens MPU 117. Further, the camera MPU 125 issues a lens position acquisition request, an aperture with a predetermined drive amount, a focus lens, a zoom drive request, a request for acquisition of optical information unique to the lens unit 100, and the like to the lens MPU 117. Further, the camera MPU 125 has a built-in ROM 125a that stores a program that controls camera operation, a RAM 125b that stores variables, and an EEPROM 125c that stores various parameters.

表示器126は、LCDなどから構成され、カメラの撮影モードに関する情報、撮影前のプレビュー画像と撮影後の確認用画像、焦点検出時の合焦状態表示画像などを表示する。操作スイッチ群127は、電源スイッチ、レリーズ(撮影トリガ)スイッチ、ズーム操作スイッチ、撮影モード選択スイッチ等で構成される。本実施形態の記録手段としてのメモリ128は、着脱可能なフラッシュメモリで、撮影済み画像を記録する。 The display 126 is composed of an LCD or the like, and displays information on a shooting mode of the camera, a preview image before shooting, a confirmation image after shooting, an in-focus state display image at the time of focus detection, and the like. The operation switch group 127 includes a power switch, a release (shooting trigger) switch, a zoom operation switch, a shooting mode selection switch, and the like. The memory 128 as the recording means of the present embodiment is a detachable flash memory for recording captured images.

位相差AF部129は、画像処理回路124により得られる焦点検出用データを用いて位相差AFで焦点検出処理を行う。より具体的には、画像処理回路124が、撮影光学系の一対の瞳領域を通過する光束で形成される一対の像データを焦点検出用データとして生成し、位相差AF部129は、この一対の像データのずれ量に基づいて焦点ずれ量を検出する。このように、本実施形態の位相差AF部129は、専用のAFセンサを用いず、撮像素子122の出力に基づく位相差AF(撮像面位相差AF)を行う。位相差AF部129の動作については後で詳細に説明する。 The phase difference AF unit 129 performs focus detection processing by phase difference AF using the focus detection data obtained by the image processing circuit 124. More specifically, the image processing circuit 124 generates a pair of image data formed by light beams passing through the pair of pupil regions of the photographing optical system as focus detection data, and the phase difference AF unit 129 is the pair. The amount of focus shift is detected based on the amount of shift of the image data of. As described above, the phase difference AF unit 129 of the present embodiment performs phase difference AF (imaging surface phase difference AF) based on the output of the image pickup device 122 without using a dedicated AF sensor. The operation of the phase difference AF unit 129 will be described in detail later.

TVAF部130は、画像処理回路124が生成するTVAF用評価値(画像データのコントラスト情報)に基づいてコントラストAFの焦点検出処理を行う。コントラストAFの焦点検出処理は、フォーカスレンズ104を移動して評価値がピークとなるフォーカスレンズ位置を合焦位置として検出する。このように、本実施形態のデジタルカメラは、位相差AFとコントラストAFの両方を実行可能であり、状況に応じて選択的に使用したり、組み合わせて使用したりすることができる。 The TVAF unit 130 performs focus detection processing of contrast AF based on the evaluation value for TVAF (contrast information of image data) generated by the image processing circuit 124. In the focus detection process of contrast AF, the focus lens 104 is moved to detect the focus lens position where the evaluation value peaks as the in-focus position. As described above, the digital camera of the present embodiment can execute both phase difference AF and contrast AF, and can be selectively used or used in combination depending on the situation.

(焦点検出動作の説明:位相差AF)
次に、位相差AF部129およびTVAF部130の動作についてさらに説明する。まず、位相差AF部129の動作について説明する。図2(A)は、本実施形態に係る撮像素子122の画素配列を示した図で、2次元C−MOSエリアセンサの縦(Y方向)6行と横(X方向)8列の範囲を、レンズユニット100側から観察した状態を示している。撮像素子122には、ベイヤー配列のカラーフィルタが設けられ、奇数行の画素には、左から順に緑(G)と赤(R)のカラーフィルタが交互に、偶数行の画素には、左から順に青(B)と緑(G)のカラーフィルタが交互に配置されている。画素211において、円211iは、オンチップマイクロレンズを表し、オンチップマイクロレンズの内側に配置された複数の矩形211a,211bは、それぞれ光電変換部である。
(Explanation of focus detection operation: phase difference AF)
Next, the operations of the phase difference AF unit 129 and the TVAF unit 130 will be further described. First, the operation of the phase difference AF unit 129 will be described. FIG. 2A is a diagram showing a pixel array of the image sensor 122 according to the present embodiment, and covers a range of 6 rows in the vertical direction (Y direction) and 8 columns in the horizontal direction (X direction) of the two-dimensional C-MOS area sensor. , The state observed from the lens unit 100 side is shown. The image pickup element 122 is provided with a Bayer array color filter, and green (G) and red (R) color filters are alternately applied to the pixels in the odd rows in order from the left, and the color filters in the even rows are from the left. Blue (B) and green (G) color filters are arranged alternately in this order. In the pixel 211, the circle 211i represents an on-chip microlens, and the plurality of rectangles 211a and 211b arranged inside the on-chip microlens are photoelectric conversion units, respectively.

本実施形態の撮像素子122は、すべての画素の光電変換部がX方向に2分割され、個々の光電変換部の光電変換信号と、光電変換信号の和が独立して読み出し可能である。また、光電変換信号の和から一方の光電変換部の光電変換信号を減じることで、他方の光電変換部の光電変換信号に相当する信号を得ることができる。個々の光電変換部における光電変換信号は位相差AF用のデータとして用いたり、3D(3−Dimensional)画像を構成する視差画像の生成に用いてもよい。また、光電変換信号の和は、通常の撮影画像データとして用いることができる。 In the image pickup device 122 of the present embodiment, the photoelectric conversion units of all the pixels are divided into two in the X direction, and the photoelectric conversion signal of each photoelectric conversion unit and the sum of the photoelectric conversion signals can be read out independently. Further, by subtracting the photoelectric conversion signal of one photoelectric conversion unit from the sum of the photoelectric conversion signals, a signal corresponding to the photoelectric conversion signal of the other photoelectric conversion unit can be obtained. The photoelectric conversion signal in each photoelectric conversion unit may be used as data for phase difference AF, or may be used for generating a parallax image constituting a 3D (3-Dimensional) image. Further, the sum of the photoelectric conversion signals can be used as normal captured image data.

ここで、位相差AFを行う場合の画素信号について説明する。後述するように、本実施形態においては、図2(A)のマイクロレンズ211iと、分割された光電変換部211a,211bで撮影光学系の射出光束を瞳分割する。そして、同一画素行に配置された所定範囲内の複数の画素211について、光電変換部211aの出力をつなぎ合わせて編成したものをAF用A像、光電変換部211bの出力をつなぎ合わせて編成したものをAF用B像とする。光電変換部211a、211bの出力は、カラーフィルタの単位配列に含まれる緑、赤、青、緑の出力を加算して算出した疑似的な輝度(Y)信号を用いる。但し、赤、青、緑の色ごとに、AF用A像、B像を編成してもよい。 Here, the pixel signal when performing phase difference AF will be described. As will be described later, in the present embodiment, the emission light flux of the photographing optical system is pupilly divided by the microlens 211i of FIG. 2A and the divided photoelectric conversion units 211a and 211b. Then, for a plurality of pixels 211 within a predetermined range arranged in the same pixel row, the outputs of the photoelectric conversion unit 211a are connected and organized, and the AF image A and the outputs of the photoelectric conversion unit 211b are connected and organized. Let the thing be a B image for AF. As the output of the photoelectric conversion units 211a and 211b, a pseudo luminance (Y) signal calculated by adding the outputs of green, red, blue, and green included in the unit array of the color filter is used. However, AF images A and B may be organized for each of the red, blue, and green colors.

このように生成したAF用A像とB像の相対的な像ずれ量を相関演算により検出することで、所定領域の焦点ずれ量(デフォーカス量)を検出することができる。本実施形態では、一方の光電変換部の出力と全光電変換部の出力の和を撮像素子122から読み出すものとする。例えば、光電変換部211aの出力と、光電変換部211a,211bの出力の和とが読み出される場合、光電変換部211bの出力は、和から光電変換部211aの出力を減じることで取得する。これにより、AF用A像とB像の両方を得ることができ、位相差AFが実現できる。このような撮像素子は、公知であるため、これ以上の詳細な説明は省略する。 By detecting the relative image shift amount of the AF image A and B generated in this way by the correlation calculation, the focus shift amount (defocus amount) in the predetermined region can be detected. In the present embodiment, the sum of the output of one photoelectric conversion unit and the output of all photoelectric conversion units is read from the image pickup element 122. For example, when the sum of the output of the photoelectric conversion unit 211a and the output of the photoelectric conversion units 211a and 211b is read, the output of the photoelectric conversion unit 211b is obtained by subtracting the output of the photoelectric conversion unit 211a from the sum. As a result, both the AF image A and the B image can be obtained, and phase-difference AF can be realized. Since such an image sensor is known, further detailed description thereof will be omitted.

図2(B)は、本実施形態の撮像素子122の読み出し回路の構成例を示す図である。水平走査回路151、垂直走査回路153の各画素の境界部には、水平走査ライン152a及び152bと、垂直走査ライン154a及び154bが配線され、各光電変換部は、これらの走査ラインを介して信号が外部に読み出される。 FIG. 2B is a diagram showing a configuration example of a readout circuit of the image pickup device 122 of the present embodiment. Horizontal scanning lines 152a and 152b and vertical scanning lines 154a and 154b are wired at the boundary between the pixels of the horizontal scanning circuit 151 and the vertical scanning circuit 153, and each photoelectric conversion unit signals through these scanning lines. Is read out to the outside.

なお、本実施形態の撮像素子は上述の画素内の読み出し方法に加え、以下の2種類の読み出しモード(第1の読み出しモード及び第2の読み出しモード)を有する。具体的には、第1の読み出しモードは、全画素読み出しモードと称するもので、高精細静止画を撮像するためのモードであり、この場合、全画素の信号が読み出される。 The image sensor of the present embodiment has the following two types of read modes (first read mode and second read mode) in addition to the above-mentioned in-pixel reading method. Specifically, the first read mode is called an all-pixel read mode, which is a mode for capturing a high-definition still image, and in this case, signals of all pixels are read.

第2の読み出しモードは、間引き読み出しモードと称するもので、動画記録、もしくはプレビュー画像の表示のみを行うためのモードである。この場合に必要な画素数は、全画素よりも少ないため、画素群は、X方向及びY方向ともに所定比率に間引いた画素のみ読み出す。また、高速に読み出す必要がある場合にも、同様に間引き読み出しモードを用いる。X方向に間引く際には、信号の加算を行いS/Nの改善を図り、Y方向に対する間引きは、間引かれる行の信号出力を無視する。位相差AFおよびコントラストAFも、通常、第2の読み出しモードで読み出された信号に基づいて行われる。 The second read mode is called a thinning read mode, and is a mode for only recording a moving image or displaying a preview image. Since the number of pixels required in this case is smaller than that of all pixels, the pixel group reads only the pixels thinned out to a predetermined ratio in both the X direction and the Y direction. Also, when it is necessary to read at high speed, the thinning read mode is used in the same manner. When thinning out in the X direction, signals are added to improve S / N, and when thinning out in the Y direction, the signal output of the line to be thinned out is ignored. Phase-difference AF and contrast AF are also usually performed based on the signals read in the second read mode.

図3は、本実施形態の撮像装置において、撮影光学系の射出瞳面と、像高ゼロ、すなわち像面中央近傍に配置された撮像素子の光電変換部の共役関係を説明する図である。撮像素子内の光電変換部と撮影光学系の射出瞳面は、オンチップマイクロレンズによって共役関係となるように設計される。そして、撮影光学系の射出瞳は、一般的に光量調節用の虹彩絞りが置かれる面とほぼ一致する。一方、本実施形態の撮影光学系は、変倍機能を有したズームレンズであるが、光学タイプによっては変倍操作を行うと、射出瞳の像面からの距離や大きさが変化する。図3では、レンズユニット100の焦点距離が広角端と望遠端の中央にある状態を示している。この状態における射出瞳距離Zepを標準値として、オンチップマイクロレンズの形状や、像高(X,Y座標)に応じた偏心パラメータの最適設計がなされる。 FIG. 3 is a diagram for explaining the conjugate relationship between the exit pupil surface of the photographing optical system and the photoelectric conversion unit of the image pickup device arranged at zero image height, that is, near the center of the image surface in the image pickup apparatus of the present embodiment. The photoelectric conversion unit in the image sensor and the exit pupil surface of the photographing optical system are designed to have a conjugate relationship by an on-chip microlens. The exit pupil of the photographing optical system generally coincides with the surface on which the iris diaphragm for adjusting the amount of light is placed. On the other hand, the photographing optical system of the present embodiment is a zoom lens having a scaling function, but depending on the optical type, the distance and size of the exit pupil from the image plane change when the scaling operation is performed. FIG. 3 shows a state in which the focal length of the lens unit 100 is at the center of the wide-angle end and the telephoto end. With the exit pupil distance Zep in this state as a standard value, the optimum design of the eccentricity parameter according to the shape of the on-chip microlens and the image height (X, Y coordinates) is made.

図3(A)において、レンズユニット100は、第1レンズ群101を保持する鏡筒部材101b、第3レンズ群105、フォーカスレンズ104を保持する鏡筒部材104bを含む。また、絞り102の開放時の開口径を規定する開口板102a、絞り込み時の開口径を調節するための絞り羽根102bを含む。なお、撮影光学系を通過する光束の制限部材として作用する虚像101b、102a、102b、及び104bは、像面から観察した場合の光学的な虚像を示している。また、絞り102の近傍における合成開口をレンズの射出瞳と定義し、前述したように像面からの距離をZepとしている。 In FIG. 3A, the lens unit 100 includes a lens barrel member 101b that holds the first lens group 101, a third lens group 105, and a lens barrel member 104b that holds the focus lens 104. It also includes an opening plate 102a that defines the opening diameter of the diaphragm 102 when it is open, and a diaphragm blade 102b for adjusting the aperture diameter when the diaphragm 102 is closed. The virtual images 101b, 102a, 102b, and 104b, which act as limiting members for the light flux passing through the photographing optical system, show an optical virtual image when observed from the image plane. Further, the synthetic aperture in the vicinity of the aperture 102 is defined as the exit pupil of the lens, and the distance from the image plane is defined as Zep as described above.

画素211は、像面中央近傍に配置されており、本実施形態では、中央画素と呼ぶ。中央画素211は、最下層より、光電変換部211a,211b、配線層211e〜211g、カラーフィルタ211h、及びオンチップマイクロレンズ211iの各部材で構成される。そして、2つの光電変換部は、オンチップマイクロレンズ211iによって撮影光学系の射出瞳面に投影される。すなわち、撮影光学系の射出瞳が、オンチップマイクロレンズ211iを介して、光電変換部の表面に投影される。 The pixel 211 is arranged near the center of the image plane, and is referred to as a central pixel in the present embodiment. From the bottom layer, the central pixel 211 is composed of photoelectric conversion units 211a and 211b, wiring layers 211e to 211g, color filters 211h, and on-chip microlens 211i. Then, the two photoelectric conversion units are projected onto the exit pupil surface of the photographing optical system by the on-chip microlens 211i. That is, the exit pupil of the photographing optical system is projected onto the surface of the photoelectric conversion unit via the on-chip microlens 211i.

図3(B)は、撮影光学系の射出瞳面上における、光電変換部の投影像を示したもので、光電変換部211a及び211bに対する投影像は、各々EP1a及びEP1bとなる。また、本実施形態では、撮像素子は、2つの光電変換部211aと211bのいずれか一方の出力と、両方の和の出力を得ることができる画素を有している。両方の和の出力は、撮影光学系のほぼ全瞳領域である投影像EP1a、EP1bの両方の領域を通過した光束を光電変換したものである。 FIG. 3B shows projected images of the photoelectric conversion unit on the exit pupil surface of the photographing optical system, and the projected images on the photoelectric conversion units 211a and 211b are EP1a and EP1b, respectively. Further, in the present embodiment, the image pickup device has a pixel capable of obtaining the output of either one of the two photoelectric conversion units 211a and 211b and the output of the sum of both. The output of the sum of both is a photoelectric conversion of the luminous flux that has passed through both the projection images EP1a and EP1b, which are almost the entire pupil region of the photographing optical system.

図3(A)で、撮影光学系を通過する光束の最外部をLで示すと、光束Lは、絞りの開口板102aで規制されており、投影像EP1a及びEP1bは、撮影光学系でケラレがほぼ発生していない。図3(B)では、図3(A)の光束Lを、TLで示している。TLで示す円の内部に、光電変換部の投影像EP1a、EP1bの大部分が含まれていることからも、ケラレがほぼ発生していないことがわかる。光束Lは、絞りの開口板102aでのみ制限されているため、TLは、102aと言い換えることができる。この際、像面中央では、各投影像EP1a及びEP1bのケラレ状態は、光軸に対して対称となり、各光電変換部211a及び211bが受光する光量は等しい。 In FIG. 3A, when the outermost light flux passing through the photographing optical system is indicated by L, the luminous flux L is regulated by the aperture plate 102a of the diaphragm, and the projected images EP1a and EP1b are vignetting in the photographing optical system. Has hardly occurred. In FIG. 3B, the luminous flux L in FIG. 3A is shown in TL. From the fact that most of the projected images EP1a and EP1b of the photoelectric conversion unit are included in the circle indicated by TL, it can be seen that vignetting is almost not generated. Since the luminous flux L is limited only by the aperture plate 102a of the diaphragm, the TL can be rephrased as 102a. At this time, at the center of the image plane, the vignetting states of the projected images EP1a and EP1b are symmetrical with respect to the optical axis, and the amount of light received by the photoelectric conversion units 211a and 211b is equal.

位相差AFを行う場合、カメラMPU125は、撮像素子122から上述した2種類の出力を読み出すようにセンサ駆動回路123を制御する。そして、カメラMPU125は、画像処理回路124に対して焦点検出領域の情報を与え、焦点検出領域内に含まれる画素の出力から、AF用A像およびB像のデータを生成して位相差AF部129に供給するよう命令する。画像処理回路124は、この命令に従ってAF用A像およびB像のデータを生成して位相差AF部129に出力する。また、画像処理回路124は、TVAF部130に対してRAW画像データを供給する。 When performing phase-difference AF, the camera MPU 125 controls the sensor drive circuit 123 so as to read the above-mentioned two types of outputs from the image sensor 122. Then, the camera MPU 125 gives information on the focus detection region to the image processing circuit 124, generates AF A image and B image data from the output of the pixels included in the focus detection region, and is a phase difference AF unit. Order 129 to supply. The image processing circuit 124 generates AF image A and B image data according to this command and outputs the data to the phase difference AF unit 129. Further, the image processing circuit 124 supplies RAW image data to the TVAF unit 130.

以上のように、撮像素子122は、位相差AFおよびコントラストAFの両方について、焦点検出装置の一部を構成している。なお、本実施形態では、一例として水平方向に射出瞳を2分割する構成を説明したが、撮像素子一部の画素については、垂直方向に射出瞳を2分割する構成としてもよい。また、水平および垂直の両方向に射出瞳を分割する構成としてもよい。垂直方向に射出瞳を分割する画素を設けることにより、水平だけでなく垂直方向の被写体のコントラストに対応した位相差AFが可能となる。 As described above, the image sensor 122 constitutes a part of the focus detection device for both the phase difference AF and the contrast AF. In the present embodiment, the configuration in which the exit pupil is divided into two in the horizontal direction has been described as an example, but the exit pupil may be divided into two in the vertical direction for some pixels of the image sensor. Further, the exit pupil may be divided in both the horizontal and vertical directions. By providing pixels that divide the exit pupil in the vertical direction, phase-difference AF corresponding to the contrast of the subject in the vertical direction as well as the horizontal direction becomes possible.

(焦点検出動作の説明:コントラストAF)
次に、図4を用いて、コントラストAF(TVAF)について説明する。コントラストAFは、カメラMPU125とTVAF部130が連携してフォーカスレンズの駆動と評価値の算出を繰り返し行うことで実現される。まず、画像処理回路124からRAW画像データがTVAF部130に入力されると、AF評価用信号処理回路401で、ベイヤー配列信号からの緑(G)信号の抽出と、低輝度成分を強調して高輝度成分を抑圧するガンマ補正処理が施される。本実施形態では、TVAFを緑(G)信号で行う場合を説明するが、赤(R)、青(B)、緑(G)の全ての信号を用いてもよい。また、RGB全色用いて輝度(Y)信号を生成してもよい。AF評価用信号処理回路401で生成される出力信号は、用いられた信号の種類によらず、以後の説明では、輝度信号Yと呼ぶ。
(Explanation of focus detection operation: Contrast AF)
Next, contrast AF (TVAF) will be described with reference to FIG. Contrast AF is realized by the camera MPU 125 and the TVAF unit 130 working together to repeatedly drive the focus lens and calculate the evaluation value. First, when RAW image data is input from the image processing circuit 124 to the TVAF unit 130, the AF evaluation signal processing circuit 401 extracts the green (G) signal from the Bayer array signal and emphasizes the low-luminance component. Gamma correction processing that suppresses high-brightness components is performed. In the present embodiment, the case where the TVAF is performed with the green (G) signal will be described, but all the red (R), blue (B), and green (G) signals may be used. Further, the luminance (Y) signal may be generated by using all RGB colors. The output signal generated by the AF evaluation signal processing circuit 401 is referred to as a luminance signal Y in the following description regardless of the type of signal used.

なお、カメラMPU125から、領域設定回路413に焦点検出領域が設定されているものとする。領域設定回路413は、設定された領域内の信号を選択するゲート信号を生成する。ゲート信号は、ラインピーク検出回路402、水平積分回路403、ライン最小値検出回路404、ラインピーク検出回路409、垂直積分回路406、410、垂直ピーク検出回路405、407、411の各回路に入力される。また、各焦点評価値が焦点検出領域内の輝度信号Yで生成されるように、輝度信号Yが各回路に入力するタイミングが制御される。なお、領域設定回路413には、焦点検出領域に合わせて複数の領域が設定可能である。 It is assumed that the focus detection region is set in the region setting circuit 413 from the camera MPU 125. The region setting circuit 413 generates a gate signal that selects a signal within the set region. The gate signal is input to each circuit of the line peak detection circuit 402, the horizontal integration circuit 403, the line minimum value detection circuit 404, the line peak detection circuit 409, the vertical integration circuits 406, 410, and the vertical peak detection circuits 405, 407, and 411. To. Further, the timing at which the luminance signal Y is input to each circuit is controlled so that each focal evaluation value is generated by the luminance signal Y in the focal detection region. In the area setting circuit 413, a plurality of areas can be set according to the focus detection area.

次に、Yピーク評価値の算出方法について説明する。ガンマ補正された輝度信号Yは、ラインピーク検出回路402へ入力され、領域設定回路413に設定された焦点検出領域内で水平ラインごとのYラインピーク値が求められる。ラインピーク検出回路402の出力は、垂直ピーク検出回路405において焦点検出領域内で垂直方向にピークホールドされ、Yピーク評価値が生成される。Yピーク評価値は、高輝度被写体や低照度被写体の判定に有効な指標である。 Next, a method of calculating the Y peak evaluation value will be described. The gamma-corrected luminance signal Y is input to the line peak detection circuit 402, and the Y line peak value for each horizontal line is obtained within the focus detection region set in the area setting circuit 413. The output of the line peak detection circuit 402 is vertically peak-held in the focus detection region in the vertical peak detection circuit 405, and a Y peak evaluation value is generated. The Y-peak evaluation value is an effective index for determining a high-luminance subject or a low-light subject.

次に、Y積分評価値の算出方法について説明する。ガンマ補正された輝度信号Yは、水平積分回路403へ入力され、焦点検出領域内で水平ラインごとにYの積分値が求められる。さらに、水平積分回路403の出力は、垂直積分回路406において焦点検出領域内で垂直方向に積分されて、Y積分評価値が生成される。Y積分評価値は、焦点検出領域内全体の明るさを判断する指標として用いることができる。 Next, a method of calculating the Y integral evaluation value will be described. The gamma-corrected luminance signal Y is input to the horizontal integration circuit 403, and the integrated value of Y is obtained for each horizontal line in the focus detection region. Further, the output of the horizontal integration circuit 403 is vertically integrated in the focus detection region in the vertical integration circuit 406 to generate a Y integration evaluation value. The Y integral evaluation value can be used as an index for determining the brightness of the entire focus detection region.

次に、Max−Min評価値の算出方法について説明する。ガンマ補正された輝度信号Yは、ラインピーク検出回路402に入力され、焦点検出領域内で水平ラインごとのYラインピーク値が求められる。また、ガンマ補正された輝度信号Yは、ライン最小値検出回路404に入力され、焦点検出領域内で水平ラインごとに輝度信号Yの最小値が検出される。検出された水平ラインごとの輝度信号Yのラインピーク値及び最小値は、減算器に入力され、(ラインピーク値−最小値)が垂直ピーク検出回路407に入力される。垂直ピーク検出回路407は、焦点検出領域内で垂直方向にピークホールドを行い、Max−Min評価値を生成する。Max−Min評価値は、低コントラスト・高コントラストの判定に有効な指標である。 Next, a method of calculating the Max-Min evaluation value will be described. The gamma-corrected luminance signal Y is input to the line peak detection circuit 402, and the Y line peak value for each horizontal line is obtained in the focus detection region. Further, the gamma-corrected luminance signal Y is input to the line minimum value detection circuit 404, and the minimum value of the luminance signal Y is detected for each horizontal line in the focus detection region. The line peak value and the minimum value of the luminance signal Y for each detected horizontal line are input to the subtractor, and (line peak value-minimum value) is input to the vertical peak detection circuit 407. The vertical peak detection circuit 407 vertically holds the peak in the focus detection region and generates a Max-Min evaluation value. The Max-Min evaluation value is an effective index for determining low contrast and high contrast.

次に、領域ピーク評価値の算出方法について説明する。ガンマ補正された輝度信号Yは、BPF408に通すことによって特定の周波数成分が抽出され焦点信号が生成される。この焦点信号は、ラインピーク検出回路409へ入力され、焦点検出領域内で水平ラインごとのラインピーク値が求められる。ラインピーク値は、垂直ピーク検出回路411によって焦点検出領域内でピークホールドされ、領域ピーク評価値が生成される。領域ピーク評価値は、焦点検出領域内で被写体が移動しても変化が少ないので、合焦状態から再度合焦点を探す処理に移行するかどうかを判定する再起動判定に有効な指標である。 Next, a method of calculating the region peak evaluation value will be described. The gamma-corrected luminance signal Y is passed through the BPF 408 to extract a specific frequency component and generate a focal signal. This focus signal is input to the line peak detection circuit 409, and the line peak value for each horizontal line is obtained in the focus detection region. The line peak value is peak-held in the focus detection region by the vertical peak detection circuit 411, and a region peak evaluation value is generated. Since the region peak evaluation value does not change much even if the subject moves within the focus detection region, it is an effective index for restart determination for determining whether or not to shift from the in-focus state to the process of searching for the in-focus again.

次に、全ライン積分評価値の算出方法について説明する。領域ピーク評価値と同様に、ラインピーク検出回路409は、焦点検出領域内で水平ラインごとのラインピーク値を求める。信号がラインピーク値を垂直積分回路410に入力し、焦点検出領域内で垂直方向に全水平走査ライン数について積分して全ライン積分評価値を生成する。高周波全ライン積分評価値は、積分の効果でダイナミックレンジが広く、感度が高いので、主要なAF評価値である。従って、本実施形態では、単に焦点評価値と記載した場合は、全ライン積分評価値を意味する。 Next, a method of calculating the total line integral evaluation value will be described. Similar to the region peak evaluation value, the line peak detection circuit 409 obtains the line peak value for each horizontal line in the focus detection region. The signal inputs the line peak value to the vertical integration circuit 410 and integrates the total number of horizontal scanning lines in the vertical direction within the focus detection region to generate the total line integration evaluation value. The high-frequency all-line integral evaluation value is a main AF evaluation value because the dynamic range is wide and the sensitivity is high due to the effect of integration. Therefore, in the present embodiment, when it is simply described as a focus evaluation value, it means an all-line integral evaluation value.

カメラMPU125のAF制御部151は、上述したそれぞれの焦点評価値を取得し、レンズMPU117を通じてフォーカスレンズ104を光軸方向に沿って所定方向に所定量移動させる。そして、新たに得られた画像データに基づいて上述した各種の評価値を算出し、全ライン積分評価値が最大値となるフォーカスレンズ位置を検出する。本実施形態では、各種のAF用評価値を水平ライン方向および垂直ライン方向で算出する。これにより、水平、垂直の直交する2方向の被写体のコントラスト情報に対して焦点検出を行うことができる。 The AF control unit 151 of the camera MPU 125 acquires each of the above-mentioned focus evaluation values, and moves the focus lens 104 in a predetermined direction along the optical axis direction through the lens MPU 117 by a predetermined amount. Then, various evaluation values described above are calculated based on the newly obtained image data, and the focus lens position where the total line integral evaluation value is the maximum value is detected. In the present embodiment, various AF evaluation values are calculated in the horizontal line direction and the vertical line direction. As a result, focus detection can be performed on the contrast information of the subject in two directions orthogonal to each other, horizontal and vertical.

(焦点検出処理の流れの説明)
次に、本実施形態のデジタルカメラにおける自動焦点検出(AF)動作について説明する。AF処理の概要を説明した後、詳細な説明を行う。本実施形態では、まず、カメラMPU125は、後述する焦点検出領域について、位相差AFもしくはコントラストAFを適用して焦点ずれ量(デフォーカス量)を求める。いずれかの方法により焦点検出を終えると、カメラMPU125は、自動焦点検出の結果を補正するための焦点検出補正値を算出し、焦点検出結果を補正する。そして、カメラMPU125は、補正後の焦点検出結果に基づいてフォーカスレンズ104を駆動する。
(Explanation of the flow of focus detection processing)
Next, the automatic focus detection (AF) operation in the digital camera of the present embodiment will be described. After explaining the outline of the AF process, a detailed explanation will be given. In the present embodiment, first, the camera MPU 125 obtains the amount of defocus (defocus amount) by applying phase difference AF or contrast AF to the focus detection region described later. When the focus detection is completed by any of the methods, the camera MPU 125 calculates the focus detection correction value for correcting the result of the automatic focus detection, and corrects the focus detection result. Then, the camera MPU 125 drives the focus lens 104 based on the corrected focus detection result.

次に、上述したAF処理の詳細を、図5および図6に示すフローチャートを用いて説明する。図5は、AF処理全体のフローを、図6は図5のステップS5における自動焦点検出の結果を補正するための焦点検出補正値を算出するフローを示している。以下のAF処理動作は、他の主体が明記されている場合を除き、カメラMPU125が主体となって実行される。また、カメラMPU125がレンズMPU117にコマンド等を送信することによってレンズユニット100の駆動や制御を行う場合、説明を簡潔にするために動作主体をカメラMPU125として記載する場合がある。 Next, the details of the AF process described above will be described with reference to the flowcharts shown in FIGS. 5 and 6. FIG. 5 shows the flow of the entire AF process, and FIG. 6 shows the flow of calculating the focus detection correction value for correcting the result of the automatic focus detection in step S5 of FIG. The following AF processing operations are mainly executed by the camera MPU 125, unless another subject is specified. Further, when the camera MPU 125 drives or controls the lens unit 100 by transmitting a command or the like to the lens MPU 117, the operating subject may be described as the camera MPU 125 for the sake of brevity.

まず、ステップS1で、カメラMPU125は、焦点検出領域を設定する。ここで設定される焦点検出領域219は、図7に示す主被写体220によって決められるものでもよく、予め設定された焦点検出領域でもよい。本実施形態では、焦点検出領域に対して、焦点検出領域219を代表する座標(x1、y1)を設定する。この時の代表座標(x1、y1)は、例えば、焦点検出領域219に対する重心位置に合わせてもよい。 First, in step S1, the camera MPU 125 sets the focus detection region. The focus detection area 219 set here may be determined by the main subject 220 shown in FIG. 7, or may be a preset focus detection area. In the present embodiment, the coordinates (x1, y1) representing the focus detection area 219 are set with respect to the focus detection area. The representative coordinates (x1, y1) at this time may be adjusted to, for example, the position of the center of gravity with respect to the focus detection region 219.

次に、ステップS2で、カメラMPU125は、自動焦点検出に用いる焦点検出信号を取得する。自動焦点検出が位相差AFの場合には、同一画素行に配置された所定範囲内の複数の画素211について、光電変換部211aの出力をつなぎ合わせて編成したAF用A像、光電変換部211bの出力をつなぎ合わせて編成したAF用B像を取得する。自動焦点検出がコントラストAFの場合には、画像処理回路124からRAW画像データをTVAF部130に入力する。そして、AF評価用信号処理回路401で、ベイヤー配列信号からの緑(G)信号の抽出と、低輝度成分を強調して高輝度成分を抑圧するガンマ補正処理が施した信号を取得する。 Next, in step S2, the camera MPU 125 acquires a focus detection signal used for automatic focus detection. When the automatic focus detection is phase-difference AF, the AF A image and the photoelectric conversion unit 211b are formed by connecting the outputs of the photoelectric conversion unit 211a for a plurality of pixels 211 within a predetermined range arranged in the same pixel row. The AF B image is acquired by connecting the outputs of. When the automatic focus detection is contrast AF, RAW image data is input to the TVAF unit 130 from the image processing circuit 124. Then, the AF evaluation signal processing circuit 401 acquires a signal that has been subjected to gamma correction processing that extracts the green (G) signal from the Bayer array signal and emphasizes the low-luminance component and suppresses the high-luminance component.

次に、ステップS3で、カメラMPU125は、上述した位相差AFまたはコントラストAFの処理に基づいて焦点検出を行う。次に、S4で、カメラMPU125は、焦点検出補正値の算出に必要な補正値算出条件を取得する。焦点検出補正値は、フォーカスレンズ104の位置、ズーム状態を示す第1レンズ群101の位置、焦点検出領域の位置座標(x1、y1)など、撮影光学系の変化や焦点検出光学系の変化に伴い変化する。そのため、カメラMPU125は、ステップS2で、例えば、フォーカスレンズ104の位置、ズーム状態を示す第1レンズ群101の位置、及び焦点検出領域の位置座標(x1、y1)などの情報を取得する。この他にも、焦点状態を評価するコントラストの方向(水平、垂直)と色(赤、緑、青)、空間周波数の各組み合わせに応じて焦点検出補正値は、変化する。そのため、後述の図8(D)に示すようなコントラストの方向(水平、垂直)と色(赤、緑、青)、空間周波数の各組み合わせに対する、重み付けの大きさなどの情報も取得する。 Next, in step S3, the camera MPU 125 performs focus detection based on the above-mentioned phase difference AF or contrast AF processing. Next, in S4, the camera MPU 125 acquires the correction value calculation conditions necessary for calculating the focus detection correction value. The focus detection correction value can be used for changes in the photographing optical system or changes in the focus detection optical system, such as the position of the focus lens 104, the position of the first lens group 101 indicating the zoom state, and the position coordinates (x1, y1) of the focus detection region. It changes with it. Therefore, in step S2, the camera MPU 125 acquires information such as, for example, the position of the focus lens 104, the position of the first lens group 101 indicating the zoom state, and the position coordinates (x1, y1) of the focus detection region. In addition to this, the focus detection correction value changes according to each combination of the contrast direction (horizontal, vertical), color (red, green, blue), and spatial frequency for evaluating the focal state. Therefore, information such as the magnitude of weighting for each combination of contrast direction (horizontal, vertical), color (red, green, blue), and spatial frequency as shown in FIG. 8D, which will be described later, is also acquired.

次に、ステップS5で、カメラMPU125は、自動焦点検出の結果を補正するための焦点検出補正値を演算する。具体的には、撮影画像の画像特性または評価特性から算出される撮像合焦位置と、焦点検出手段の焦点検出特性から算出される焦点検出合焦位置との差分と、位相差補正情報から算出される位相差焦点検出合焦位置とから、焦点検出補正値を演算する。撮影画像の画像特性または評価特性、焦点検出手段の焦点検出特性の詳細については後述する。なお、カメラMPU125は、焦点検出補正量算出手段として機能する。また、ステップS5における焦点検出補正値算出方法の詳細については、図6を用いて後述する。 Next, in step S5, the camera MPU 125 calculates a focus detection correction value for correcting the result of automatic focus detection. Specifically, it is calculated from the difference between the imaging in-focus position calculated from the image characteristics or evaluation characteristics of the captured image, the focus detection in-focus position calculated from the focus detection characteristics of the focus detection means, and the phase difference correction information. The focus detection correction value is calculated from the phase difference focus detection focusing position. Details of the image characteristics or evaluation characteristics of the captured image and the focus detection characteristics of the focus detection means will be described later. The camera MPU 125 functions as a focus detection correction amount calculation means. The details of the focus detection correction value calculation method in step S5 will be described later with reference to FIG.

次に、ステップS6で、カメラMPU125は、ステップS5で算出された自動焦点検出の結果を補正するための補正値(BP)を用いて以下の式により焦点検出結果DEF_0を補正し、補正後の焦点検出結果DEFを算出する。
DEF=DEF_0+BP
Next, in step S6, the camera MPU 125 corrects the focus detection result DEF_0 by the following formula using the correction value (BP) for correcting the result of the automatic focus detection calculated in step S5, and after the correction. The focus detection result DEF is calculated.
DEF = DEF_0 + BP

次に、ステップS7で、カメラMPU125は、補正後の焦点検出結果DEFの合焦位置へフォーカスレンズ104を駆動する。なお、カメラMPU125は、制御手段として機能する。次に、ステップS8で、カメラMPU125は合焦判定を行い、合焦でないと判定された場合(NO)、ステップS1へ処理を進め、合焦と判定された場合(YES)、AF処理を終了する。 Next, in step S7, the camera MPU 125 drives the focus lens 104 to the in-focus position of the corrected focus detection result DEF. The camera MPU 125 functions as a control means. Next, in step S8, the camera MPU 125 makes a focusing determination, and if it is determined that the camera is out of focus (NO), the process proceeds to step S1 and if it is determined that the camera is in focus (YES), the AF process ends. To do.

(焦点検出補正値算出の説明)
以下、図5を用いて上述したAF処理全体のフローのステップS5における自動焦点検出の結果を補正するための焦点検出補正値の算出について図6を用いて説明する。なお、ステップS101〜S104は、撮像合焦位置と焦点検出合焦位置との差分である第1補正値の算出に関する処理であり、ステップS107〜S111は、焦点検出合焦位置と位相差焦点検出合焦位の差分である第2補正値の算出に関する処理である。
(Explanation of focus detection correction value calculation)
Hereinafter, the calculation of the focus detection correction value for correcting the result of the automatic focus detection in step S5 of the flow of the entire AF process described above with reference to FIG. 5 will be described with reference to FIG. Steps S101 to S104 are processes related to calculation of the first correction value which is the difference between the imaging in-focus position and the focus detection in-focus position, and steps S107 to S111 are the focus detection in-focus position and the phase difference focus detection. This is a process related to the calculation of the second correction value, which is the difference in the in-focus position.

まず、ステップS101(取得工程)で、カメラMPU125は、収差情報を取得する。本実施形態での収差情報は、光学系の収差状態を表す情報であり、例えば、被写体の色、方向、空間周波数ごとの撮影光学系の結像位置に関する情報である。 First, in step S101 (acquisition step), the camera MPU 125 acquires aberration information. The aberration information in the present embodiment is information representing the aberration state of the optical system, and is, for example, information regarding the imaging position of the photographing optical system for each of the color, direction, and spatial frequency of the subject.

ここで、図8(A)、図8(B)を用いてレンズメモリ118に格納されている空間周波数収差情報について説明する。図8(A)は、撮影光学系のデフォーカスMTFを示している。横軸は、フォーカスレンズ104の位置を示しており、縦軸は、MTFの強度を示している。図8(A)に描かれている4種の曲線は、空間周波数ごとのMTF曲線で、MTF1、MTF2、MTF3、MTF4の順に、空間周波数が低い方から高い方に変化した場合を示している。空間周波数F1(lp/mm)のMTF曲線がMTF1と対応し、同様に、空間周波数F2、F3、F4(lp/mm)とMTF2、MTF3、MTF4が対応する。また、LP4、LP5、LP6、LP7は、各デフォーカスMTF曲線の極大値に対応するフォーカスレンズ104位置を示している。 Here, the spatial frequency aberration information stored in the lens memory 118 will be described with reference to FIGS. 8 (A) and 8 (B). FIG. 8A shows the defocus MTF of the photographing optical system. The horizontal axis represents the position of the focus lens 104, and the vertical axis represents the intensity of the MTF. The four types of curves drawn in FIG. 8A are MTF curves for each spatial frequency, and show the case where the spatial frequency changes from the lower to the higher in the order of MTF1, MTF2, MTF3, and MTF4. .. The MTF curve of the spatial frequency F1 (lp / mm) corresponds to the MTF1, and similarly, the spatial frequencies F2, F3, F4 (lp / mm) correspond to the MTF2, MTF3, MTF4. Further, LP4, LP5, LP6, and LP7 indicate the focus lens 104 positions corresponding to the maximum values of the defocus MTF curves.

図8(B)は、本実施形態における収差情報を示す図である。図8(B)は、図8(A)のデフォーカスMTFの極大値を示すフォーカスレンズ104位置の情報MTF_P_RHの式を示している。本実施形態での収差情報は、例えば、上述した色と方向との6通りの組み合わせの各々について、空間周波数fと撮像素子上の焦点検出領域の位置座標(x1,y1)を変数とした以下の式で表現される。
MTF_P_RH(f,x,y)=(rh(0)×x+rh(1)×y+rh(2))×f2+(rh(3)×x+rh(4)×y+rh(5))×f+(rh(6)×x+rh(7)×y+rh(8)) (1)
FIG. 8B is a diagram showing aberration information in this embodiment. FIG. 8B shows the equation of the information MTF_P_RH of the focus lens 104 position showing the maximum value of the defocus MTF of FIG. 8A. The aberration information in the present embodiment is described below, for example, for each of the above-mentioned six combinations of color and direction, with the spatial frequency f and the position coordinates (x1, y1) of the focus detection region on the image sensor as variables. It is expressed by the formula of.
MTF_P_RH (f, x, y) = (rh (0) x x + rh (1) x y + rh (2)) x f2 + (rh (3) x x + rh (4) x y + rh (5)) x f + (rh (6)) × x + rh (7) × y + rh (8)) (1)

なお、式(1)は、赤(R)色の信号について水平(H)方向に対応した空間周波数ごとのデフォーカスMTFの極大値を示すフォーカスレンズ104位置の情報MTF_P_RHの式を示しているが、他の組み合わせについても同様の式で表される。また、本実施形態において、rh(n)(0≦n≦8)は、レンズユニット100のレンズメモリ118にあらかじめ記憶され、カメラMPU125は、レンズMPU117に要求してrh(n)(0≦n≦8)を取得するものとする。しかし、rh(n)(0≦n≦8)は、カメラRAM125bの不揮発性領域に記憶されていてもよい。 The equation (1) shows the equation of the information MTF_P_RH of the focus lens 104 position indicating the maximum value of the defocus MTF for each spatial frequency corresponding to the horizontal (H) direction for the red (R) color signal. , Other combinations are also expressed by the same formula. Further, in the present embodiment, rh (n) (0 ≦ n ≦ 8) is stored in advance in the lens memory 118 of the lens unit 100, and the camera MPU 125 requests the lens MPU 117 to rh (n) (0 ≦ n ≦ n). ≤8) shall be acquired. However, rh (n) (0 ≦ n ≦ 8) may be stored in the non-volatile region of the camera RAM 125b.

また、第1補正値の製造誤差への対応として、rh(n)に対する第1補正値の製造誤差補正情報rhd(n)をレンズメモリ118またはカメラRAM125bの不揮発性領域に記憶する。第1補正値の製造誤差補正を行う場合には、レンズメモリ118またはカメラRAM125bの不揮発性領域よりrhd(n)を取得し、rh(n)にrhd(n)を加算し、製造誤差補正を行う。なお、カメラMPU125は、本実施形態の第1製造誤差補正手段として機能する。 Further, as a response to the manufacturing error of the first correction value, the manufacturing error correction information rhd (n) of the first correction value with respect to rh (n) is stored in the non-volatile region of the lens memory 118 or the camera RAM 125b. When performing manufacturing error correction of the first correction value, rhd (n) is acquired from the non-volatile region of the lens memory 118 or the camera RAM 125b, rhd (n) is added to rh (n), and manufacturing error correction is performed. Do. The camera MPU 125 functions as the first manufacturing error correction means of the present embodiment.

赤と垂直(MTF_P_RV)、緑と水平(MTF_P_GH)、緑と垂直(MTF_P_GV)、青と水平(MTF_P_BH)、青と垂直(MTF_P_BV)の各組み合わせにおける係数(rv,gh,gv,bh,bv)も同様に記憶、取得できる。このように、収差情報を関数化し、各項の係数を収差情報として記憶することでレンズメモリ118やカメラRAM125bのデータ量削減しつつ、撮影光学系の変化や焦点検出光学系の変化に対応した収差情報の記憶が可能になる。 Coefficients (rv, gh, gv, bh, bv) in each combination of red and vertical (MTF_P_RV), green and horizontal (MTF_P_GH), green and vertical (MTF_P_GV), blue and horizontal (MTF_P_BH), blue and vertical (MTF_P_BV) Can be memorized and acquired in the same way. In this way, by converting the aberration information into a function and storing the coefficients of each term as aberration information, the amount of data in the lens memory 118 and the camera RAM 125b can be reduced, and changes in the photographing optical system and the focus detection optical system can be dealt with. Aberration information can be stored.

また、図8(D)は、図5のステップS4で取得した補正値算出条件の焦点状態を評価するコントラストの方向(水平、垂直)と色(赤、緑、青)、空間周波数の各組み合わせに対する、重み付けの大きさに関する例を示す。図8(D)に示す条件は、撮影画像の画像特性もしくは評価特性から算出される撮像合焦位置、焦点検出手段の焦点検出特性から算出される焦点検出合焦位置の算出に用いる重み付け係数である。 Further, FIG. 8D shows a combination of contrast direction (horizontal, vertical), color (red, green, blue), and spatial frequency for evaluating the focal state of the correction value calculation condition acquired in step S4 of FIG. An example of the magnitude of the weighting is shown. The conditions shown in FIG. 8D are the weighting coefficient used to calculate the imaging in-focus position calculated from the image characteristics or evaluation characteristics of the captured image and the focus detection in-focus position calculated from the focus detection characteristics of the focus detection means. is there.

ここで、図6に戻って、ステップS102、ステップS103では、カメラMPU125は、ステップS4で取得した図8(D)に示す重みづけの係数と、ステップS101で取得された収差情報から、各合焦位置を算出する。つまり、撮影画像の画像特性または評価特性から算出される撮像合焦位置(P_IMG)、焦点検出手段の焦点検出特性から算出される焦点検出合焦位置(P_AF)を算出する。なお、カメラMPU125は、本実施形態の合焦位置算出手段として機能する。具体的には、まず、式(1)のx,yに焦点検出領域の位置情報(x1、y1)を代入する。この計算により式(1)は、以下の式(2)のような形式で表される。
MTF_P_RH(f)=Arh×f2+Brh×f+Crh (2)
Here, returning to FIG. 6, in step S102 and step S103, the camera MPU 125 is a combination of the weighting coefficient shown in FIG. 8 (D) acquired in step S4 and the aberration information acquired in step S101. Calculate the focus position. That is, the imaging in-focus position (P_IMG) calculated from the image characteristics or the evaluation characteristics of the captured image, and the focus detection in-focus position (P_AF) calculated from the focus detection characteristics of the focus detection means are calculated. The camera MPU 125 functions as a focusing position calculation means of the present embodiment. Specifically, first, the position information (x1, y1) of the focus detection region is substituted into x and y of the equation (1). By this calculation, the equation (1) is expressed in the form of the following equation (2).
MTF_P_RH (f) = Arh × f2 + Brh × f + Chr (2)

カメラMPU125は、MTF_P_RV(f)、MTF_P_GH(f)、MTF_P_GV(f)、MTF_P_BH(f)、MTF_P_BV(f)についても同様に計算する。図8(B)は、ステップS1で焦点検出領域の位置情報を代入した後の収差情報の例を示し、横軸は空間周波数を、縦軸は、デフォーカスMTFの極大値を示すフォーカスレンズ104の位置(ピーク位置)である。図示の通り、色収差が大きい場合には、色ごとの曲線が乖離し、縦横差が大きい場合には、図中の水平方向と垂直方向の曲線が乖離する。このように、本実施形態では、色(RGB)と評価方向(HとV)との組み合わせごとに、空間周波数に対応したデフォーカスMTF情報を有する。 The camera MPU 125 also calculates MTF_P_RV (f), MTF_P_GH (f), MTF_P_GV (f), MTF_P_BH (f), and MTF_P_BV (f) in the same manner. FIG. 8B shows an example of aberration information after substituting the position information of the focus detection region in step S1, where the horizontal axis represents the spatial frequency and the vertical axis represents the maximum value of the defocus MTF. Position (peak position). As shown in the figure, when the chromatic aberration is large, the curves for each color deviate, and when the vertical and horizontal differences are large, the horizontal and vertical curves in the figure deviate. As described above, in the present embodiment, the defocus MTF information corresponding to the spatial frequency is provided for each combination of the color (RGB) and the evaluation direction (H and V).

次に、カメラMPU125は、ステップS4で取得している補正値算出条件の合焦位置の算出に用いる重み付け係数を構成する係数(図8(D))で、収差情報を重み付けする。これにより、設定情報が、焦点検出、撮像で評価する色、方向に関して重み付けされる。具体的には、カメラMPU125は、焦点検出用の空間周波数特性MTF_P_AF(f)と撮影画像用の空間周波数特性MTF_P_IMG(f)を、式(3)および式(4)を用いて算出する。
MTF_P_AF(f)=
K_AF_R×K_AF_H×MTF_P_RH(f)
+K_AF_R×K_AF_V×MTF_P_RV(f)
+K_AF_G×K_AF_H×MTF_P_GH(f)
+K_AF_G×K_AF_V×MTF_P_GV(f)
+K_AF_B×K_AF_H×MTF_P_BH(f)
+K_AF_B×K_AF_V×MTF_P_BV(f) (3)
MTF_P_IMG(f)=
K_IMG_R×K_IMG_H×MTF_P_RH(f)
+K_IMG_R×K_IMG_V×MTF_P_RV(f)
+K_IMG_G×K_IMG_H×MTF_P_GH(f)
+K_IMG_G×K_IMG_V×MTF_P_GV(f)
+K_IMG_B×K_IMG_H×MTF_P_BH(f)
+K_IMG_B×K_IMG_V×MTF_P_BV(f) (4)
Next, the camera MPU 125 weights the aberration information with a coefficient (FIG. 8D) that constitutes a weighting coefficient used for calculating the focusing position of the correction value calculation condition acquired in step S4. As a result, the setting information is weighted with respect to the color and direction evaluated by focus detection and imaging. Specifically, the camera MPU 125 calculates the spatial frequency characteristic MTF_P_AF (f) for focus detection and the spatial frequency characteristic MTF_P_IMG (f) for captured images using equations (3) and (4).
MTF_P_AF (f) =
K_AF_R x K_AF_H x MTF_P_RH (f)
+ K_AF_R x K_AF_V x MTF_P_RV (f)
+ K_AF_G x K_AF_H x MTF_P_GH (f)
+ K_AF_G x K_AF_V x MTF_P_GV (f)
+ K_AF_B x K_AF_H x MTF_P_BH (f)
+ K_AF_B x K_AF_V x MTF_P_BV (f) (3)
MTF_P_IMG (f) =
K_IMG_R x K_IMG_H x MTF_P_RH (f)
+ K_IMG_R x K_IMG_V x MTF_P_RV (f)
+ K_IMG_G x K_IMG_H x MTF_P_GH (f)
+ K_IMG_G x K_IMG_V x MTF_P_GV (f)
+ K_IMG_B x K_IMG_H x MTF_P_BH (f)
+ K_IMG_B x K_IMG_V x MTF_P_BV (f) (4)

図8(C)には、離散的な空間周波数F1からF4について、式(3)に代入して得られるデフォーカスMTFがピーク(極大値)となるフォーカスレンズ位置(ピーク位置)LP4_AF、LP5_AF、LP6_AF、LP7_AFが縦軸に示されている。カメラMPU125は、撮影画像の画像特性または評価特性から算出される撮像合焦位置(P_IMG)と焦点検出手段の焦点検出特性から算出される焦点検出合焦位置(P_AF)を、以下の式(5)および(6)に従って算出する。 In FIG. 8C, focus lens positions (peak positions) LP4_AF, LP5_AF, in which the defocus MTF obtained by substituting the discrete spatial frequencies F1 to F4 into the equation (3) has a peak (maximum value), are shown. LP6_AF and LP7_AF are shown on the vertical axis. The camera MPU 125 uses the following equation (5) to express the imaging focus position (P_IMG) calculated from the image characteristics or evaluation characteristics of the captured image and the focus detection focus position (P_AF) calculated from the focus detection characteristics of the focus detection means. ) And (6).

焦点検出合焦位置の算出は、式(3)および式(4)で得た図8(C)で示す空間周波数ごとのデフォーカスMTFの極大値情報と、ステップS4でステップS4で得た撮影画像やAFの評価帯域で重みづけ加算する。すなわち、空間周波数ごとのデフォーカスMTFの極大値情報MTF_P_AF(f)、MTF_P_IMG(f)と、ステップS4で得た撮影画像やAFの評価帯域K_IMG_FQ(n),K_AF_FQ(n)で重みづけ加算する。
P_IMG=MTF_P_IMG(1)×K_IMG_FQ(1)+MTF_P_IMG(2)×K_IMG_FQ(2)+MTF_P_IMG(3)×K_IMG_FQ(3)+MTF_P_IMG(4)×K_IMG_FQ(4) (5)
P_AF=MTF_P_AF(1)×K_AF_FQ(1)+MTF_P_AF(2)×K_AF_FQ(2)+MTF_P_AF(3)×K_AF_FQ(3)+MTF_P_AF(4)×K_AF_FQ(4) (6)
The focus detection focusing position is calculated by using the maximum value information of the defocus MTF for each spatial frequency shown in FIGS. 8 (C) obtained by the equations (3) and (4) and the imaging obtained in step S4 in step S4. Weight and add in the evaluation band of the image and AF. That is, the maximum value information MTF_P_AF (f) and MTF_P_IMG (f) of the defocus MTF for each spatial frequency are weighted and added by the captured image obtained in step S4 and the evaluation band K_IMG_FQ (n) and K_AF_FQ (n) of AF. ..
P_IMG = MTF_P_IMG (1) x K_IMG_FQ (1) + MTF_P_IMG (2) x K_IMG_FQ (2) + MTF_P_IMG (3) x K_IMG_FQ (3) + MTF_P_IMG (4) x K_IMG_FQ (4) (5)
P_AF = MTF_P_AF (1) x K_AF_FQ (1) + MTF_P_AF (2) x K_AF_FQ (2) + MTF_P_AF (3) x K_AF_FQ (3) + MTF_P_AF (4) x K_AF_FQ (4) (6)

ここで、撮影画像の画像特性または評価特性、焦点検出手段の焦点検出特性について説明する。撮影画像の画像特性または評価特性は、撮影画像を評価する際の特性、つまり人の目で見る際の評価に対する特性を意味している。焦点検出手段の焦点検出特性は、焦点検出する際の特性、つまりAF処理の際に評価する特性を意味している。 Here, the image characteristics or evaluation characteristics of the captured image and the focus detection characteristics of the focus detection means will be described. The image characteristic or evaluation characteristic of the captured image means a characteristic when evaluating the captured image, that is, a characteristic for evaluation when viewed by the human eye. The focus detection characteristic of the focus detection means means a characteristic at the time of focus detection, that is, a characteristic to be evaluated at the time of AF processing.

具体的な例を以下に示す。図8(D)に示す焦点検出情報による重みづけの係数、K_AF_H、K_AF_V、K_IMG_H、K_IMG_Vに関して、焦点検出方向が図3(B)のような瞳分割形状で水平H方向のみの場合、
K_AF_H=1
K_AF_V=0
K_IMG_H=0.5
K_IMG_V=0.5
と設定する。これは、AF処理によるピント位置評価は水平方向Hによる収差に寄与するところが大きく、人の目で見る際のピント位置評価は水平方向Hと垂直方法Vを1:1で平均した収差状態でピント位置を判断することが一般的であるためである。
A specific example is shown below. Regarding the weighting coefficients K_AF_H, K_AF_V, K_IMG_H, and K_IMG_V based on the focus detection information shown in FIG. 8 (D), when the focus detection direction is the pupil division shape as shown in FIG.
K_AF_H = 1
K_AF_V = 0
K_IMG_H = 0.5
K_IMG_V = 0.5
And set. This is because the focus position evaluation by AF processing largely contributes to the aberration due to the horizontal direction H, and the focus position evaluation when viewed by the human eye is focused in the aberration state in which the horizontal direction H and the vertical method V are averaged at a ratio of 1: 1. This is because it is common to determine the position.

色の重みづけ係数K_AF_R、K_AF_G、K_AF_B、K_IMG_R、K_IMG_G、K_IMG_Bに関しては、例えば、
K_AF_R=0.25
K_AF_G=0.5
K_AF_B=0.25
K_IMG_R=0.3
K_IMG_G=0.5
K_IMG_B=0.2
と設定する。これは焦点検出時には、ベイヤー配列のセンサより取得した信号に基づきピント位置を評価するが、撮像画像は所望のホワイトバランス係数によって与えられた重みづけの各色の色収差による影響でピント位置が変動することに因る。
Regarding the color weighting coefficients K_AF_R, K_AF_G, K_AF_B, K_IMG_R, K_IMG_G, K_IMG_B, for example,
K_AF_R = 0.25
K_AF_G = 0.5
K_AF_B = 0.25
K_IMG_R = 0.3
K_IMG_G = 0.5
K_IMG_B = 0.2
And set. At the time of focus detection, the focus position is evaluated based on the signal acquired from the sensor of the Bayer array, but the captured image fluctuates due to the influence of the chromatic aberration of each weighted color given by the desired white balance coefficient. Due to.

空間周波数の重みづけ係数K_AF_fq(1)〜K_AF_fq(4)、K_IMG_fq(1)〜K_IMG_fq(4)に関しては、例えば、
AF_fq(1)=0.8
AF_fq(2)=0.2
AF_fq(3)=0
AF_fq(4)=0
K_IMG_fq(1)=0
K_IMG_fq(2)=0
K_IMG_fq(3)=0.5
K_IMG_fq(4)=0.5
と設定する。これは、一般的に、焦点検出時には、ピント位置を空間周波数の低い帯域で評価しており、撮像画像は、ピント位置を空間周波数の高い帯域で評価しているためである。
Regarding the spatial frequency weighting coefficients K_AF_fq (1) to K_AF_fq (4) and K_IMG_fq (1) to K_IMG_fq (4), for example,
AF_fq (1) = 0.8
AF_fq (2) = 0.2
AF_fq (3) = 0
AF_fq (4) = 0
K_IMG_fq (1) = 0
K_IMG_fq (2) = 0
K_IMG_fq (3) = 0.5
K_IMG_fq (4) = 0.5
And set. This is because, in general, the focus position is evaluated in the band having a low spatial frequency at the time of focus detection, and the focused image is evaluated in the band having a high spatial frequency in the captured image.

ここで、図6に戻って、ステップS104(第1算出工程)では、カメラMPU125は、焦点検出補正値(BP)の被写体の色、方向、空間周波数に依存する成分である第1補正値(BP1)を、以下の式(7)により算出する。
BP1=P_AF−P_IMG (7)
Here, returning to FIG. 6, in step S104 (first calculation step), the camera MPU 125 has a first correction value (BP) which is a component depending on the color, direction, and spatial frequency of the subject (focus detection correction value (BP)). BP1) is calculated by the following formula (7).
BP1 = P_AF-P_IMG (7)

本実施形態では、焦点検出領域の位置、評価信号の色やコントラスト方向に関する処理を、評価帯域に関する処理よりも先行して実行している。これは、撮影者が焦点検出領域の位置を設定により決定している場合、焦点検出領域の位置や、評価する色や方向に関する情報が変更される頻度が低いためである。一方で、信号の評価帯域については、撮像素子の読出しモードやAF評価信号のデジタルフィルタなどにより変更される頻度が高い。例えば、信号のS/Nが低下する低照度環境では、デジタルフィルタの帯域をより低帯域に変更することなどが考えられる。本実施形態では、このような場合に、変更の頻度が低い係数(ピーク係数)を算出した後に記憶し、変更の頻度の高い係数(評価帯域)のみを必要に応じて計算し、第1補正値算出を行う。これにより、撮影者が焦点検出領域の位置を設定している場合などには、演算量の低減を行うことができる。 In the present embodiment, the processing related to the position of the focus detection region, the color of the evaluation signal, and the contrast direction is executed prior to the processing related to the evaluation band. This is because when the photographer determines the position of the focus detection area by setting, the information regarding the position of the focus detection area and the color and direction to be evaluated is rarely changed. On the other hand, the signal evaluation band is frequently changed by the read mode of the image sensor, the digital filter of the AF evaluation signal, and the like. For example, in a low-light environment where the signal S / N decreases, it is conceivable to change the band of the digital filter to a lower band. In this embodiment, in such a case, a coefficient with a low frequency of change (peak coefficient) is calculated and then stored, and only a coefficient with a high frequency of change (evaluation band) is calculated as necessary, and the first correction is performed. Calculate the value. As a result, the amount of calculation can be reduced when the photographer has set the position of the focus detection region.

次に、ステップS105で、第1補正値の製造誤差補正情報をステート毎に保持し、焦点検出条件に応じた製造誤差補正情報を取得し製造誤差補正を行う。なお、第1補正値の製造誤差補正情報を、特定のステートでのみ保持し、保持していないステートに関しては、第1補正値のステート間での変化率から算出してもよい。 Next, in step S105, the manufacturing error correction information of the first correction value is held for each state, the manufacturing error correction information corresponding to the focus detection condition is acquired, and the manufacturing error correction is performed. The manufacturing error correction information of the first correction value may be held only in a specific state, and the state not held may be calculated from the rate of change between the states of the first correction value.

(焦点検出補正値算出の説明)
次に、ステップS106で、カメラMPU125は、焦点検出方式の判定を行い、ステップS3での焦点検出方式が位相差AFの場合(YES)、ステップS107へ進み、位相差AFでない場合(NO)、ステップS114に進む。つまり、焦点検出手段の焦点検出特性から算出される焦点検出合焦位置と位相差焦点検出(位相差AF)が検出する位相差焦点検出合焦位置の差分であるBP2を、BP2=0としてステップS114へ進む。このように、焦点検出方式を判定し焦点検出補正値を算出することで、焦点検出方式に応じてピントずれ量を高精度に補正することを可能としている。
(Explanation of focus detection correction value calculation)
Next, in step S106, the camera MPU 125 determines the focus detection method, and if the focus detection method in step S3 is phase-difference AF (YES), the process proceeds to step S107, and if it is not phase-difference AF (NO). The process proceeds to step S114. That is, BP2, which is the difference between the focus detection focus position calculated from the focus detection characteristic of the focus detection means and the phase difference focus detection focus position detected by the phase difference focus detection (phase difference AF), is set to BP2 = 0 and the step is performed. Proceed to S114. In this way, by determining the focus detection method and calculating the focus detection correction value, it is possible to correct the amount of focus shift with high accuracy according to the focus detection method.

次に、S107で、カメラMPU125は、補正値算出条件の判定を行う。そして、焦点検出手段の焦点検出特性から算出される焦点検出合焦位置(P_AF)と位相差AFが検出する位相差焦点検出合焦位置(P_AF2)の差分が小さい条件の場合(YES)、ステップS114へ進む。つまり、焦点検出手段の焦点検出特性から算出される焦点検出合焦位置と位相差AFが検出する位相差焦点検出合焦位置の差分であるBP2を、BP2=0としてステップS114へ進む。一方、小さい条件でない場合(NO)、ステップS108へ進む。 Next, in S107, the camera MPU 125 determines the correction value calculation condition. Then, when the difference between the focus detection focusing position (P_AF) calculated from the focus detection characteristic of the focus detection means and the phase difference focus detection focus position (P_AF2) detected by the phase difference AF is small (YES), the step. Proceed to S114. That is, BP2, which is the difference between the focus detection focus position calculated from the focus detection characteristic of the focus detection means and the phase difference focus detection focus position detected by the phase difference AF, is set to BP2 = 0 and the process proceeds to step S114. On the other hand, if the condition is not small (NO), the process proceeds to step S108.

以下、焦点検出手段の焦点検出特性から算出される焦点検出合焦位置(P_AF)と位相差AFが検出する位相差焦点検出合焦位置(P_AF2)の差分が小さい条件について説明する。位相差AFは、デフォーカスによる線像強度分布の重心ずれ量を検出し、合焦位置を算出する。ここで、図9は、デフォーカスによる線像強度分布の重心ずれ量を説明するための図である。図9は、重心ずれ量、相関演算結果(線像強度分布の位置ずれ量)の少なくとも1つに差を与える収差(以下コマ収差等の収差)、絞り102等によるケラレがない状態である。図9に示す状態の場合、焦点検出手段の焦点検出特性から算出される焦点検出合焦位置(P_AF)と位相差AFが検出する位相差焦点検出合焦位置(P_AF2)に差分が生じない。 Hereinafter, the condition that the difference between the focus detection focusing position (P_AF) calculated from the focus detection characteristic of the focus detection means and the phase difference focus detection focus position (P_AF2) detected by the phase difference AF is small will be described. The phase difference AF detects the amount of deviation of the center of gravity of the line image intensity distribution due to defocus and calculates the in-focus position. Here, FIG. 9 is a diagram for explaining the amount of deviation of the center of gravity of the line image intensity distribution due to defocus. FIG. 9 shows a state in which there is no vignetting due to the amount of deviation of the center of gravity, the aberration (hereinafter referred to as aberration such as coma) that gives a difference to at least one of the correlation calculation results (the amount of displacement of the line image intensity distribution), and the aperture 102. In the state shown in FIG. 9, there is no difference between the focus detection focusing position (P_AF) calculated from the focus detection characteristic of the focus detection means and the phase difference focus detection focusing position (P_AF2) detected by the phase difference AF.

デフォーカス位置1201_P、1202_Pはそれぞれ異なる位置を示す。一対の線像強度分布1201_A、1201_Bは、デフォーカス位置1201_Pにおける分割された光電変換部211a、211bに対応した一対の線像強度分布で示す。一対の線像強度分布1202_A、1202_Bは、デフォーカス位置1202_Pにおける分割された光電変換部211a、211bに対応した一対の線像強度分布を示す。また、重心位置1201_GA、1201_GBは、一対の線像強度分布1201_A、1201_Bの重心位置を示す。重心位置1202_GA、1202_GBは、一対の線像強度分布1202_A、1202_Bの重心位置示す。さらに、重心ずれ量1201_difGは、重心位置1201_GA、1201_GBの差分を、重心ずれ量1202_difGは、重心位置1202_GA、1202_GBの差分を示す。また、図9に示すように、コマ収差等の収差、絞り102等によるケラレがない場合には、デフォーカスに応じて、重心ずれ量1201_difG、1202_difGが大きくなる。これら重心ずれ量を検出することで、位相差AFはデフォーカス量を算出している。 The defocus positions 1201_P and 1202_P indicate different positions. The pair of line image intensity distributions 1201_A and 1201_B are shown by a pair of line image intensity distributions corresponding to the divided photoelectric conversion units 211a and 211b at the defocus position 1201_P. The pair of line image intensity distributions 1202_A and 1202_B indicate a pair of line image intensity distributions corresponding to the divided photoelectric conversion units 211a and 211b at the defocus position 1202_P. Further, the center-of-gravity positions 1201_GA and 1201_GB indicate the positions of the center of gravity of the pair of line image intensity distributions 1201_A and 1201_B. The center of gravity position 1202_GA and 1202_GB indicate the center of gravity position of the pair of line image intensity distributions 1202_A and 1202_B. Further, the center-of-gravity deviation amount 1201_difG indicates the difference between the center-of-gravity positions 1201_GA and 1201_GB, and the center-of-gravity deviation amount 1202_difG indicates the difference between the center-of-gravity positions 1202_GA and 1202_GB. Further, as shown in FIG. 9, when there is no aberration such as coma or vignetting due to the aperture 102 or the like, the amount of deviation of the center of gravity 1201_difG and 1202_difG increases according to the defocus. By detecting the amount of deviation of the center of gravity, the phase difference AF calculates the amount of defocus.

次に、撮影光学系のコマ収差等の収差、絞り102等によるケラレが大きい場合について説明する。図10に、撮影光学系のコマ収差等の収差、絞り102等によるケラレが大きい場合の一対の線像強度分布を示す。図10の点線で示す1301_Aは、光電変換部211aに対応する線像強度分布を、実線で示す1301_Bは、光電変換部211bに対応する線像強度分布を示す。また、一点鎖線G_Aが1301_Aの重心位置を、一点鎖線G_Bが1301_Bの重心位置を示す。図10に示すように線像強度分布1301_A、1301_Bは、光学系のコマ収差等の収差の影響を受け線像強度分布が片側に尾を引いたような非対称形状となっている。このように、線像強度分布が片側に尾を引いたような非対称形状の場合、線像強度分布の重心位置が尾を引いた側に引っ張られ、重心ずれが生じる。 Next, a case where aberrations such as coma of the photographing optical system and vignetting due to the diaphragm 102 and the like are large will be described. FIG. 10 shows a pair of line image intensity distributions when aberrations such as coma of the photographing optical system and vignetting due to the diaphragm 102 and the like are large. 1301_A shown by the dotted line in FIG. 10 shows the line image intensity distribution corresponding to the photoelectric conversion unit 211a, and 1301_B shown by the solid line shows the line image intensity distribution corresponding to the photoelectric conversion unit 211b. Further, the alternate long and short dash line G_A indicates the position of the center of gravity of 1301_A, and the alternate long and short dash line G_B indicates the position of the center of gravity of 1301_B. As shown in FIG. 10, the line image intensity distributions 1301_A and 1301_B have an asymmetrical shape in which the line image intensity distribution has a tail on one side due to the influence of aberrations such as coma of the optical system. In this way, when the line image intensity distribution has an asymmetrical shape with a tail on one side, the position of the center of gravity of the line image intensity distribution is pulled toward the tailed side, and the center of gravity shifts.

また、線像強度分布1301_Aおよび1301_Bは、撮影光学系の絞り102等によるケラレの影響を受け、線像強度分布間で光量差が生じる。そして、よりケラレの大きい線像強度分布1301_Aの方がコマ収差等の収差の影響を大きく受け、非対称度合いが大きくなる。このように、非対称度合いが線像強度分布1301_Aおよび線像強度分布1301_Bで異なることで、それぞれの重心位置G_AおよびG_Bのずれ量が異なり、重心ずれ量差が生じる。 Further, the line image intensity distributions 1301_A and 1301_B are affected by vignetting due to the aperture 102 of the photographing optical system and the like, and a light amount difference occurs between the line image intensity distributions. The line image intensity distribution 1301_A with larger vignetting is more affected by aberrations such as coma, and the degree of asymmetry is larger. As described above, when the degree of asymmetry is different between the line image intensity distribution 1301_A and the line image intensity distribution 1301_B, the deviation amounts of the respective center of gravity positions G_A and G_B are different, and the difference in the amount of deviation of the center of gravity occurs.

線像強度分布1301_IMGは、線像強度分布1301_Aおよび1301_Bを足し合わせた、光電変換部211a、211bの光電変換信号の和に対応した線像強度分布を示す。デフォーカス位置が異なり、点線で示す1302_Aの線像強度分布と、実線で示す1301_Bの線像強度分布の重心位置が一致した状態を表している。線像強度分布1302_IMGは、線像強度分布1302_Aおよび1302_Bを足し合わせた線像強度分布を表している。 The line image intensity distribution 1301_IMG shows a line image intensity distribution corresponding to the sum of the photoelectric conversion signals of the photoelectric conversion units 211a and 211b, which is the sum of the line image intensity distributions 1301_A and 1301_B. The defocus position is different, and the position of the center of gravity of the line image intensity distribution of 1302_A shown by the dotted line and the line image intensity distribution of 1301_B shown by the solid line match. The line image intensity distribution 1302_IMG represents a line image intensity distribution obtained by adding the line image intensity distributions 1302_A and 1302_B.

線像強度分布1301_IMGと線像強度分布1302_IMG比較すると、重心位置の異なる線像強度分布の和の1301_IMGの方が、重心位置が一致した線像強度分布の和の1302_IMGよりも線像強度分布形状がシャープであることがわかる。撮影画像の信号に対応する線像強度分布1301_IMG、1302_IMGの形状が最もシャープである位置が、合焦位置を意味している。そのため、重心位置の異なる状態が合焦位置であり、重心位置が一致した状態は合焦位置からデフォーカスした位置であるといえる。 Comparing the line image intensity distribution 1301_IMG and the line image intensity distribution 1302_IMG, the line image intensity distribution shape of 1301_IMG, which is the sum of the line image intensity distributions with different center of gravity positions, is larger than that of the line image intensity distribution sum 1302_IMG, which has the same center of gravity position. Can be seen to be sharp. The position where the shape of the line image intensity distribution 1301_IMG and 1302_IMG corresponding to the signal of the captured image is the sharpest means the in-focus position. Therefore, it can be said that the states in which the positions of the centers of gravity are different are the focusing positions, and the states in which the positions of the centers of gravity are the same are the positions defocused from the focusing positions.

このことから、非対称度合いが一対の線像強度分布間で異なり、重心ずれ量差が生じている場合には、重心位置が一致する位置が合焦位置とはならず、重心位置が異なる位置が合焦位置となる。以上のように、線像強度分布1301_Aおよび1301_Bのような撮影光学系のコマ収差等の収差、絞り102等によるケラレが大きい場合、デフォーカスによる重心ずれ量に加えて、線像強度分布の非対称度合いに起因した重心ずれ量差が生じる。これにより、本来合焦と検出するべきデフォーカス位置で、位相差AFは、ピントずれがあると検出してしまう。 From this, when the degree of asymmetry differs between the pair of line image intensity distributions and there is a difference in the amount of deviation of the center of gravity, the position where the positions of the centers of gravity match does not become the focusing position, and the positions where the positions of the centers of gravity differ are different. It will be in focus position. As described above, when aberrations such as coma of the photographing optical system such as the line image intensity distributions 1301_A and 1301_B and vignetting due to the aperture 102 and the like are large, the line image intensity distribution is asymmetric in addition to the amount of center of gravity shift due to defocus. There is a difference in the amount of center of gravity shift depending on the degree. As a result, the phase difference AF detects that there is an out-of-focus position at the defocus position that should be detected as in-focus.

また、位相差AFでピントずれ量を検出する際に用いられる相関演算においては、線像強度分布1301_Aおよび1301_Bのように形状差がある場合には検出誤差が生じる。形状差がない場合には一対の線像強度分布が完全に重なるところで、信号の一致度を表す相関量が0となる。しかしながら、形状差がある1301_Aおよび1301_Bのような場合には、1301_Aと1301_Bが完全に重なるところはなく、信号の一致度を表す相関量が0とはならず、少しずれたとことで相関量が極小値をとる。このように、一対の線像強度分布間に形状差がある場合には検出誤差が生じる。 Further, in the correlation calculation used when detecting the amount of focus shift by the phase difference AF, a detection error occurs when there is a shape difference such as the line image intensity distributions 1301_A and 1301_B. When there is no shape difference, the correlation amount representing the degree of coincidence of the signals becomes 0 where the pair of line image intensity distributions completely overlap. However, in the case of 1301_A and 1301_B having a shape difference, 1301_A and 1301_B do not completely overlap, and the correlation amount indicating the degree of signal matching does not become 0, and the correlation amount is slightly deviated. Take a minimum value. As described above, when there is a shape difference between the pair of line image intensity distributions, a detection error occurs.

以上のことから、焦点検出手段の焦点検出特性から算出される焦点検出合焦位置(P_AF)と位相差AFが検出する位相差焦点検出合焦位置(P_AF2)の差分が小さい条件は、撮影光学系のコマ収差等の収差、絞り102等によるケラレが小さい場合となる。また、焦点検出領域の位置座標(x1、y1)が中央像高付近の場合には、光学系のコマ収差等の収差が小さく、光学系の絞り102等によるケラレが小さいのが一般的である。そのため、焦点検出領域の位置座標(x1、y1)が中央像高付近の場合も、焦点検出手段の焦点検出特性から算出される焦点検出合焦位置(P_AF)と位相差AFが検出する位相差焦点検出合焦位置(P_AF2)の差分が小さい条件といえる。 From the above, the condition that the difference between the focus detection focus position (P_AF) calculated from the focus detection characteristic of the focus detection means and the phase difference focus detection focus position (P_AF2) detected by the phase difference AF is small is the imaging optics. This is a case where aberrations such as coma of the system and vignetting due to the aperture 102 and the like are small. Further, when the position coordinates (x1, y1) of the focus detection region are near the center image height, aberrations such as coma of the optical system are small, and vignetting due to the aperture 102 of the optical system is generally small. .. Therefore, even when the position coordinates (x1, y1) of the focus detection region are near the center image height, the focus detection focus position (P_AF) calculated from the focus detection characteristics of the focus detection means and the phase difference AF detects the phase difference. It can be said that the condition is that the difference between the focus detection focusing position (P_AF2) is small.

次に、図6に戻って、ステップS108で、カメラMPU125は、位相差補正情報を取得する。位相差補正情報は、位相差AFが検出する位相差焦点検出合焦位置に関連する情報である。本実施形態では、ステップS103で算出した、焦点検出手段の焦点検出特性から算出される焦点検出合焦位置(P_AF)における分割された光電変換部211a、211bに対応した撮影光学系の線像強度分布、LSF_A、LSF_Bを取得する。また、撮影光学系の線像強度分布は、デフォーカス状態を示すフォーカスレンズ104の位置、ズーム状態を示す第1レンズ群101の位置、焦点検出領域の位置座標(x1、y1)など、撮影光学系の変化や焦点検出光学系の変化に伴い変化する。そのため、取得する線像強度分布は、ステップS4で取得した、補正値算出条件に基づいて決定する。 Next, returning to FIG. 6, in step S108, the camera MPU 125 acquires the phase difference correction information. The phase difference correction information is information related to the phase difference focus detection focusing position detected by the phase difference AF. In the present embodiment, the line image intensity of the photographing optical system corresponding to the divided photoelectric conversion units 211a and 211b at the focus detection focusing position (P_AF) calculated from the focus detection characteristic of the focus detection means calculated in step S103. Obtain the distribution, LSF_A, LSF_B. The line image intensity distribution of the photographing optical system includes the position of the focus lens 104 indicating the defocus state, the position of the first lens group 101 indicating the zoom state, the position coordinates of the focus detection region (x1, y1), and the like. It changes with changes in the system and changes in the focus detection optical system. Therefore, the line image intensity distribution to be acquired is determined based on the correction value calculation condition acquired in step S4.

次に、ステップS109で、カメラMPU125は、ステップS108で取得したLSF_A、LSF_Bに、それぞれ、シェーディング補正処理(光学補正処理)を行う。ここで、図11に、撮像素子の周辺像高における光電変換部211aの第1瞳部分領域501、光電変換部211bの第2瞳部分領域502、および結像光学系の射出瞳400の関係を示す。瞳の水平方向をX軸、瞳の垂直方向をY軸としている。 Next, in step S109, the camera MPU 125 performs shading correction processing (optical correction processing) on LSF_A and LSF_B acquired in step S108, respectively. Here, FIG. 11 shows the relationship between the first pupil region 501 of the photoelectric conversion unit 211a, the second pupil region 502 of the photoelectric conversion unit 211b, and the exit pupil 400 of the imaging optical system at the peripheral image height of the imaging element. Shown. The horizontal direction of the pupil is the X-axis, and the vertical direction of the pupil is the Y-axis.

図11(A)は、結像光学系の射出瞳距離Dlと撮像素子の設定瞳距離Dsが同じ状態を示す図である。この場合、第1瞳部分領域501と第2瞳部分領域502により、結像光学系の射出瞳400が、概ね、均等に瞳分割される。これに対して、図11(B)に示した結像光学系の射出瞳距離Dlが撮像素子の設定瞳距離Dsより短い場合、撮像素子の周辺像高では、結像光学系の射出瞳と撮像素子の入射瞳の瞳ずれを生じ、結像光学系の射出瞳400が、不均一に瞳分割されてしまう。同様に、図11(C)に示した結像光学系の射出瞳距離Dlが撮像素子の設定瞳距離Dsより長い場合、撮像素子の周辺像高では、結像光学系の射出瞳と撮像素子の入射瞳の瞳ずれを生じ、結像光学系の射出瞳400が、不均一に瞳分割されてしまう。周辺像高で瞳分割が不均一になるのに伴い、LSF_A、LSF_Bの強度も不均一になり、LSF_A、LSF_Bのいずれか一方の強度が大きくなり、他方の強度が小さくなるシェーディングが生じる。 FIG. 11A is a diagram showing a state in which the exit pupil distance Dl of the imaging optical system and the set pupil distance Ds of the image sensor are the same. In this case, the exit pupil 400 of the imaging optical system is substantially evenly divided by the first pupil region 501 and the second pupil region 502. On the other hand, when the exit pupil distance Dl of the imaging optical system shown in FIG. 11B is shorter than the set pupil distance Ds of the imaging element, the peripheral image height of the imaging element is the exit pupil of the imaging optical system. The entrance pupil of the image pickup element is displaced, and the exit pupil 400 of the imaging optical system is unevenly divided into pupils. Similarly, when the exit pupil distance Dl of the imaging optical system shown in FIG. 11C is longer than the set pupil distance Ds of the imaging element, the exit pupil of the imaging optical system and the imaging element are measured at the peripheral image height of the imaging element. The exit pupil 400 of the imaging optical system is unevenly divided into pupils due to the pupil shift of the entrance pupil. As the pupil division becomes non-uniform at the peripheral image height, the intensities of LSF_A and LSF_B also become non-uniform, and shading occurs in which the intensity of either LSF_A or LSF_B increases and the intensity of the other decreases.

図6に戻って、ステップS109では、焦点検出領域の像高と、撮像レンズ(結像光学系)のF値、射出瞳距離に応じて、LSF_Aの第1シェーディング補正係数と、LSF_Bの第2シェーディング補正係数を、それぞれ生成する。第1シェーディング補正係数をLSF_Aに乗算し、第2シェーディング補正係数をLSF_Bに乗算して、LSF_AとLSF_Bのシェーディング補正処理(光学補正処理)を行う。 Returning to FIG. 6, in step S109, the first shading correction coefficient of LSF_A and the second shading correction coefficient of LSF_B are determined according to the image height of the focus detection region, the F value of the imaging lens (imaging optical system), and the exit pupil distance. Shading correction coefficients are generated respectively. The first shading correction coefficient is multiplied by LSF_A, the second shading correction coefficient is multiplied by LSF_B, and shading correction processing (optical correction processing) of LSF_A and LSF_B is performed.

本実施形態では、LSF_AとLSF_Bの相関(信号の一致度)を基に、第2補正値の算出を行う。瞳ずれによるシェーディングが生じるとLSF_AとLSF_Bの相関(信号の一致度)が低下する場合がある。瞳ずれによるシェーディングが生じるとLSF_AとLSF_Bの相関(信号の一致度)が低下する場合がある。従って、LSF_AとLSF_Bの相関(信号の一致度)を改善し、焦点検出性能を良好とするために、シェーディング補正処理(光学補正処理)を行うことが望ましい。 In the present embodiment, the second correction value is calculated based on the correlation between LSF_A and LSF_B (the degree of signal matching). When shading occurs due to pupil displacement, the correlation between LSF_A and LSF_B (the degree of signal matching) may decrease. When shading occurs due to pupil displacement, the correlation between LSF_A and LSF_B (the degree of signal matching) may decrease. Therefore, it is desirable to perform shading correction processing (optical correction processing) in order to improve the correlation (signal matching degree) between LSF_A and LSF_B and improve the focus detection performance.

次に、ステップS110で、カメラMPU125は、LSF_AとLSF_Bに、フィルタ処理を行う。ここで、本実施形態のフィルタ処理の通過帯域の一例を、図12に示す。横軸は空間周波数、縦軸はフィルタ係数を表している。本実施形態では、位相差AFの焦点検出の評価帯域に応じて、焦点検出時のフィルタ処理の通過帯域を、図12の実線または1点鎖線のように、調整するのが望ましい。 Next, in step S110, the camera MPU 125 filters LSF_A and LSF_B. Here, an example of the pass band of the filtering process of the present embodiment is shown in FIG. The horizontal axis represents the spatial frequency and the vertical axis represents the filter coefficient. In the present embodiment, it is desirable to adjust the pass band of the filter processing at the time of focus detection according to the evaluation band of the focus detection of the phase difference AF as shown by the solid line or the alternate long and short dash line in FIG.

次に、ステップS111では、カメラMPU125は、フィルタ処理後のLSF_AとLSF_Bを相対的に瞳分割方向にシフトさせるシフト処理を行い、信号の一致度を表す相関量を算出する(相関演算)。本実施形態では、フィルタ処理後のk番目のLSF_AをA(k)、LSF_BをB(k)、焦点検出領域に対応する番号kの範囲をWとする。シフト処理によるシフト量をs1、シフト量s1のシフト範囲をΓ1として、相関量CORは、式(8)により算出される。

Figure 0006890937
Next, in step S111, the camera MPU 125 performs a shift process of relatively shifting the filtered LSF_A and LSF_B in the pupil division direction, and calculates a correlation amount representing the degree of signal matching (correlation calculation). In the present embodiment, the k-th LSF_A after the filter processing is A (k), the LSF_B is B (k), and the range of the number k corresponding to the focus detection region is W. The correlation amount COR is calculated by the equation (8), where the shift amount by the shift process is s1 and the shift range of the shift amount s1 is Γ1.
Figure 0006890937

シフト量s1のシフト処理により、k番目のA(k)とk−s1番目のB(k−s1)を対応させ減算し、シフト減算信号を生成する。生成されたシフト減算信号の絶対値を計算し、焦点検出領域に対応する範囲W内で番号kの和を取り、相関量COR(s1)を算出する。必要に応じて、各行毎に算出された相関量(評価値)を、シフト量毎に、複数行に渡って加算しても良い。算出された相関量から、サブピクセル演算により、相関量が最小値となる実数値のシフト量を算出して像ずれ量p1を算出する。本実施形態では、像ずれ量p1を、LSF_AとLSF_Bの信号の一致度を示す相関量(相関演算)に基づいて導出したが、LSF_AとLSF_Bの信号の重心ずれ量に基づいて算出してもよい。 By the shift processing of the shift amount s1, the k-th A (k) and the k-s1st B (k-s1) are associated and subtracted to generate a shift subtraction signal. The absolute value of the generated shift / subtraction signal is calculated, the sum of the numbers k is taken within the range W corresponding to the focus detection region, and the correlation amount COR (s1) is calculated. If necessary, the correlation amount (evaluation value) calculated for each row may be added over a plurality of rows for each shift amount. From the calculated correlation amount, the shift amount of the real value at which the correlation amount is the minimum value is calculated by the sub-pixel calculation, and the image shift amount p1 is calculated. In the present embodiment, the image shift amount p1 is derived based on the correlation amount (correlation calculation) indicating the degree of coincidence between the LSF_A and LSF_B signals, but it may be calculated based on the center of gravity shift amount of the LSF_A and LSF_B signals. Good.

次に、ステップS112(第2算出工程)で、カメラMPU125は、ステップS111で算出した像ずれ量p1に、焦点検出領域の位置座標(x1、y1)と、光学系の絞り値、射出瞳距離に応じた変換係数Kをかけて、第2補正値(BP2)を算出する。次に、ステップS113で、第2補正値の製造誤差補正を行う。 Next, in step S112 (second calculation step), the camera MPU 125 adds the position coordinates (x1, y1) of the focus detection region, the aperture value of the optical system, and the exit pupil distance to the image shift amount p1 calculated in step S111. The second correction value (BP2) is calculated by multiplying the conversion coefficient K according to the above. Next, in step S113, the manufacturing error correction of the second correction value is performed.

本実施形態では、第2補正値の製造誤差補正情報を、撮影光学系の像面倒れ量に応じて保持した場合について説明する。なお、カメラMPU125は、本実施形態の第2製造誤差補正手段として機能する。ここで、図13〜15に撮影光学系の像面倒れに応じて第2補正値の製造誤差が変化することを説明するための図を示す。図13(A)及び図14(A)は、撮影光学系の像面倒れがない場合を示しており、図13(A)は、右側像高、図14(A)は、左側像高の様子を表している。線像強度分布1501_A、1503_Aは、分割された光電変換部211aに対応した線像強度分布であり、線像強度分布1501_B、1503_Bは、分割された光電変換部211bに対応した線像強度分布である。 In the present embodiment, a case where the manufacturing error correction information of the second correction value is held according to the amount of image plane tilt of the photographing optical system will be described. The camera MPU 125 functions as a second manufacturing error correction means of the present embodiment. Here, FIGS. 13 to 15 show diagrams for explaining that the manufacturing error of the second correction value changes according to the image plane tilt of the photographing optical system. 13 (A) and 14 (A) show the case where the image plane of the photographing optical system is not tilted. FIG. 13 (A) shows the right image height, and FIG. 14 (A) shows the left image height. It shows the situation. The line image intensity distributions 1501_A and 1503_A are line image intensity distributions corresponding to the divided photoelectric conversion units 211a, and the line image intensity distributions 1501_B and 1503_B are line image intensity distributions corresponding to the divided photoelectric conversion units 211b. is there.

図13(B)及び図14(B)は、撮影光学系の像面倒れがある場合を示しており、図13(B)は右側像高、図14(B)は左側像高の様子を表している。線像強度分布1502_A、1504_Aは、分割された光電変換部211aに対応した線像強度分布であり、線像強度分布1502_B、1504_Bは、分割された光電変換部211bに対応した線像強度分布である。横収差量1510は、像面倒れのない場合の横収差量を、横収差量1511は、像面倒れがある場合の横収差量を表している。また、重心位置1501_G_A〜1504_G_Aは、線像強度分布1501_A〜1504_Aの重心位置を、重心位置1501_G_B〜1504_G_Bは、線像強度分布1501_B〜1504_Bの重心位置を表している。 13 (B) and 14 (B) show the case where the image plane of the photographing optical system is tilted. FIG. 13 (B) shows the right image height, and FIG. 14 (B) shows the left image height. Represents. The line image intensity distributions 1502_A and 1504_A are line image intensity distributions corresponding to the divided photoelectric conversion units 211a, and the line image intensity distributions 1502_B and 1504_B are line image intensity distributions corresponding to the divided photoelectric conversion units 211b. is there. The lateral aberration amount 1510 represents the lateral aberration amount when there is no image surface tilt, and the lateral aberration amount 1511 represents the lateral aberration amount when there is image surface tilt. Further, the center of gravity positions 1501_G_A to 1504_G_A represent the center of gravity positions of the line image intensity distributions 1501_A to 1504_A, and the center of gravity positions 1501_G_B to 1504_G_B represent the center of gravity positions of the line image intensity distributions 1501_B to 1504_B.

図13(A)と図14(A)を比較すると、線像強度分布1501_Aと線像強度分布1502_B、線像強度分布1501_Bと線像強度分布1502Aが同形状であることがわかる。このように、像面倒れがない場合には、左右像高で光電変換部211a、211bそれぞれに対応する線像強度分布が入れ替わり反転するだけで、形状に違いがないことがわかる。 Comparing FIGS. 13 (A) and 14 (A), it can be seen that the line image intensity distribution 1501_A and the line image intensity distribution 1502_B, and the line image intensity distribution 1501_B and the line image intensity distribution 1502A have the same shape. As described above, when there is no image plane tilt, it can be seen that there is no difference in shape only by switching and inverting the line image intensity distributions corresponding to the photoelectric conversion units 211a and 211b at the left and right image heights.

次に、図13(B)と図13(A)を比較すると、像面の倒れにより横収差量が拡大した側を主に通過した光線により形成される線像強度分布1502_Aはより外側に尾を引く方向に形状が変化している。それに対して、横収差が減少した側を主に通過した光線により形成される線像強度分布1502_Bは尾が小さくなる方向に形状が変化する。このことから、線像強度分布1502_G_Aは、線像強度分布1501_G_Aよりも外側に、線像強度分布1502_G_Bは、線像強度分布1501_G_Bよりも内側に移動する。 Next, when FIG. 13 (B) and FIG. 13 (A) are compared, the line image intensity distribution 1502_A formed by the light rays mainly passing through the side where the amount of lateral aberration is expanded due to the tilt of the image plane is tailed to the outer side. The shape is changing in the direction of pulling. On the other hand, the shape of the line image intensity distribution 1502_B formed by the light rays mainly passing through the side where the lateral aberration is reduced changes in the direction in which the tail becomes smaller. From this, the line image intensity distribution 1502_G_A moves outward from the line image intensity distribution 1501_G_A, and the line image intensity distribution 1502_G_B moves inward from the line image intensity distribution 1501_G_B.

次に、図14(B)と図14(A)を比較すると、像面の倒れにより横収差量が拡大した側を主に通過した光線により形成される線像強度分布1504_Aはより外側に尾を引く方向に形状が変化している。それに対して、横収差が減少した側を主に通過した光線により形成される線像強度分布1504_Bは、尾が小さくなる方向に形状が変化する。このことから、線像強度分布1504_G_Aは、線像強度分布1503_G_Aよりも外側に、線像強度分布1504_G_Aは、線像強度分布1503_G_Aよりも内側に移動する。 Next, when FIG. 14 (B) and FIG. 14 (A) are compared, the line image intensity distribution 1504_A formed by the light rays mainly passing through the side where the amount of lateral aberration is expanded due to the tilt of the image plane is tailed to the outer side. The shape is changing in the direction of pulling. On the other hand, the shape of the line image intensity distribution 1504_B formed by the light rays mainly passing through the side where the lateral aberration is reduced changes in the direction in which the tail becomes smaller. From this, the line image intensity distribution 1504_G_A moves outward from the line image intensity distribution 1503_G_A, and the line image intensity distribution 1504_G_A moves inward from the line image intensity distribution 1503_G_A.

図15(A)に、右側像高における像面倒れがない場合と、像面倒れがある場合の重心位置差の違いを説明するための図を示す。重心位置差δG1は、像面倒れがない場合の線像強度分布1501_Aと1501_Bの重心位置差を、重心位置差δG2は、像面倒れがある場合の線像強度分布1502_Aと1502_Bの重心位置差を示している。 FIG. 15A shows a diagram for explaining the difference in the position difference of the center of gravity between the case where there is no image plane tilt at the right image height and the case where there is an image plane tilt. The center of gravity position difference δG1 is the center of gravity position difference between the line image intensity distributions 1501_A and 1501_B when there is no image plane tilt, and the center of gravity position difference δG2 is the center of gravity position difference between the line image intensity distributions 1502_A and 1502_B when there is no image plane tilt. Is shown.

図15(B)は、左側像高における像面倒れがない場合と、像面倒れがある場合の重心ずれ量の違いを説明するための図である。重心ずれ量δG3は、1503_Aと1503_Bの重心ずれ量を、重心ずれ量δG4は、1504_Aと1504_Bの重心ずれ量を示している。図15(A)の通り、像面倒れにより、線像強度分布1501_G_Aが外側へ移動し線像強度分布1502_G_Aに、線像強度分布1501_G_Bが内側へ移動し線像強度分布1502_G_Bとなり重心ずれ量がδG1からδG2へと小さくなる。また、図15(B)に示す通り、像面倒れにより、線像強度分布1503_G_Aが外側へ移動し線像強度分布1504_G_Aに、線像強度分布1503_G_Bが内側へ移動し線像強度分布1504_G_Bとなり重心ずれ量がδG3からδG4へと大きくなる。 FIG. 15B is a diagram for explaining the difference in the amount of center of gravity shift between the case where there is no image plane tilt at the left image height and the case where there is an image plane tilt. The center of gravity shift amount δG3 indicates the center of gravity shift amount of 1503_A and 1503_B, and the center of gravity shift amount δG4 indicates the center of gravity shift amount of 1504_A and 1504_B. As shown in FIG. 15 (A), the line image intensity distribution 1501_G_A moves outward to the line image intensity distribution 1502_G_A, and the line image intensity distribution 1501_G_B moves inward to become the line image intensity distribution 1502_G_B. It becomes smaller from δG1 to δG2. Further, as shown in FIG. 15B, the line image intensity distribution 1503_G_A moves outward to the line image intensity distribution 1504_G_A, and the line image intensity distribution 1503_G_B moves inward to become the line image intensity distribution 1504_G_B due to the image plane tilt. The amount of deviation increases from δG3 to δG4.

以上のことから、重心ずれ量は、像面倒れに応じて変化し、片方の像高は減少し、もう片方の像高は増加することがわかる。重心ずれ量は、位相差AF起因のピントずれ量となるため、像面倒れに応じて位相差AF起因のピントずれ量は変化するといえる。従って、第2補正値の製造誤差に関する情報を、撮影光学系の像面倒れ量(T)として、レンズメモリ118にあらかじめ記憶しておき、第2製造誤差補正値(BP2d)を、焦点検出条件に応じた像面倒れ量(T)を取得し、式(9)に従って算出する。
BP2d=BP2×T×α (9)
ここで、αは、像面倒れ量(T)とBP2からDELTA_BP2を算出するための換算係数である。以上のように、ステップS113では、算出したBP2dを用いて、カメラMPU125が、BP2にBP2dを加算し、第2製造誤差補正を行う。なお、カメラMPU125は、第2製造誤差補正手段として機能する。
From the above, it can be seen that the amount of center of gravity shift changes according to the image plane tilt, the image height of one decreases, and the image height of the other increases. Since the amount of center of gravity shift is the amount of focus shift due to phase difference AF, it can be said that the amount of focus shift due to phase difference AF changes according to the image plane tilt. Therefore, the information regarding the manufacturing error of the second manufacturing error is stored in advance in the lens memory 118 as the image plane tilt amount (T) of the photographing optical system, and the second manufacturing error correction value (BP2d) is set as the focus detection condition. The amount of image plane tilt (T) corresponding to the above is obtained and calculated according to the equation (9).
BP2d = BP2 × T × α (9)
Here, α is a conversion coefficient for calculating DELTA_BP2 from the image plane tilt amount (T) and BP2. As described above, in step S113, the camera MPU 125 adds BP2d to BP2 using the calculated BP2d to perform the second manufacturing error correction. The camera MPU 125 functions as a second manufacturing error correction means.

なお、本実施形態では、第2補正値の製造誤差に関する情報をステート毎に保持し、焦点検出条件に応じた製造誤差補正情報を取得し製造誤差補正値を算出した。しかしながら、製造誤差補正情報を、特定のステートでのみ保持し、保持していないステートに関しては、第2補正値のステート間での変化率から算出してもよい。 In the present embodiment, the information regarding the manufacturing error of the second correction value is held for each state, the manufacturing error correction information according to the focus detection condition is acquired, and the manufacturing error correction value is calculated. However, the manufacturing error correction information may be held only in a specific state, and the state not held may be calculated from the rate of change of the second correction value between the states.

このように、被写体の色、方向、空間周波数に依存する製造誤差補正と、位相差AFに依存する製造誤差補正を分けて行うことで、要因毎に製造誤差補正を実施することができ、高精度な製造誤差補正を可能としている。第1補正値(BP1)、第2補正値(BP2)を分けて算出し、要因の異なる第1補正値(BP1)、第2補正値(BP2)毎に製造誤差補正を実施できない場合、位相差AFとコントラストAFで同製造誤差補正を行うことしかできない。これにより、片方の製造誤差補正の精度が低下してしまう。 In this way, by separately performing the manufacturing error correction that depends on the color, direction, and spatial frequency of the subject and the manufacturing error correction that depends on the phase difference AF, it is possible to carry out the manufacturing error correction for each factor. Accurate manufacturing error correction is possible. If the manufacturing error correction cannot be performed for each of the first correction value (BP1) and the second correction value (BP2) having different factors, the first correction value (BP1) and the second correction value (BP2) are calculated separately. The same manufacturing error correction can only be performed with phase difference AF and contrast AF. As a result, the accuracy of one of the manufacturing error corrections is lowered.

(焦点検出補正値算出)
次に、図6に戻って、ステップS114(第3算出工程)で、カメラMPU125は、焦点検出補正値(BP)を、以下の式(10)により算出する。
BP=BP1+BP2 (10)
本実施形態では、焦点検出補正値(BP)を、被写体の色、方向、空間周波数に依存する第1補正値(BP1)と、位相差AFに依存する第2補正値(BP2)とに分けて算出する。これにより、位相差AFにおける自動焦点検出のピントずれ量を高精度に補正することが可能となる。
(Focus detection correction value calculation)
Next, returning to FIG. 6, in step S114 (third calculation step), the camera MPU 125 calculates the focus detection correction value (BP) by the following formula (10).
BP = BP1 + BP2 (10)
In the present embodiment, the focus detection correction value (BP) is divided into a first correction value (BP1) that depends on the color, direction, and spatial frequency of the subject and a second correction value (BP2) that depends on the phase difference AF. To calculate. This makes it possible to correct the amount of focus shift of automatic focus detection in phase difference AF with high accuracy.

ここで、図16に、第1補正値(BP1)と、第2補正値(BP2)とに分けて算出することにより高精度に補正できることを説明する図を示す。図16の位置P_IMGは、ステップS102で算出した撮影画像の画像特性もしくは評価特性から算出される撮像合焦位置を、位置P_AFは、ステップS103で算出した焦点検出手段の焦点検出特性から算出される焦点検出合焦位置を示す。また、補正値BP1は、ステップS104にて算出される第1補正値を、補正値BP2は、ステップS112にて算出される第2補正値を、補正値BPは、ステップS114にて算出される焦点検出補正値を表している。また差分、BP’は、第1補正値と第2補正値とを分けずに、位置P_IMGでの線像強度分布に基づいて、図6のフローに基づいて算出した補正値を、差分δBPは、本来算出したい補正値との差分(BP’−BP)を表している。横軸は設定def(実際のデフォーカス量)、縦軸は検出def(自動焦点検出手段にて算出されるdef量)を示す。 Here, FIG. 16 shows a diagram for explaining that the correction can be performed with high accuracy by separately calculating the first correction value (BP1) and the second correction value (BP2). The position P_IMG in FIG. 16 is calculated from the image in-focus position calculated from the image characteristics or evaluation characteristics of the captured image calculated in step S102, and the position P_AF is calculated from the focus detection characteristics of the focus detection means calculated in step S103. Indicates the focus detection focus position. The correction value BP1 is the first correction value calculated in step S104, the correction value BP2 is the second correction value calculated in step S112, and the correction value BP is calculated in step S114. Indicates the focus detection correction value. Further, the difference BP'is a correction value calculated based on the flow of FIG. 6 based on the line image intensity distribution at the position P_IMG without separating the first correction value and the second correction value, and the difference δBP is , Represents the difference (BP'-BP) from the correction value originally desired to be calculated. The horizontal axis shows the set def (actual defocus amount), and the vertical axis shows the detection def (def amount calculated by the automatic focus detection means).

図16に示すように、設定defと検出defの関係が線形でない場合、撮影画像の画像特性または評価特性から算出される撮像合焦位置(P_IMG)の位置でのLSFに基づいて補正値を算出する。この場合、検出した像ずれ量をデフォーカス量に換算する際に、設定defと検出defの非線形性に起因して誤差δBPが生じる。それに対し、焦点検出手段の焦点検出特性から算出される焦点検出合焦位置(P_AF)の位置でのLSFに基づいて補正値を算出する場合には、算出する補正値が小さくなるため、設定defと検出defの非線形性に起因して誤差の影響が小さくなる。 As shown in FIG. 16, when the relationship between the setting def and the detection def is not linear, the correction value is calculated based on the LSF at the imaging focusing position (P_IMG) calculated from the image characteristics or the evaluation characteristics of the captured image. To do. In this case, when the detected image shift amount is converted into the defocus amount, an error δBP occurs due to the non-linearity between the set def and the detected def. On the other hand, when the correction value is calculated based on the LSF at the focus detection focusing position (P_AF) calculated from the focus detection characteristic of the focus detection means, the calculated correction value becomes small, so the setting def And the influence of the error becomes small due to the non-linearity of the detection def.

以上、本実施形態によれば、焦点検出補正値(BP)を、被写体の色、方向、空間周波数に依存する第1補正値(BP1)と、位相差AFに依存する第2補正値(BP2)とに分けて算出する。これにより、位相差AFにおける自動焦点検出のピントずれ量を高精度に補正することが可能となる。 As described above, according to the present embodiment, the focus detection correction value (BP) is the first correction value (BP1) that depends on the color, direction, and spatial frequency of the subject, and the second correction value (BP2) that depends on the phase difference AF. ) And the calculation. This makes it possible to correct the amount of focus shift of automatic focus detection in phase difference AF with high accuracy.

(第2実施形態)
次に、第2の実施形態について説明する。第1の実施形態との主な違いは、ステップS107で取得した位相差補正情報が線像強度分布ではなく、位相差AFが検出する位相差焦点検出合焦位置と焦点検出手段の焦点検出特性から算出される焦点検出合焦位置との差分である点である。また、第1実施形態では、焦点検出補正値を第1補正値と第2補正値とに分けて算出した。しかしながら、本実施形態では、P_AFを算出する際に、位相差AFが検出する位相差焦点検出合焦位置と焦点検出手段の焦点検出特性から算出される焦点検出合焦位置との差分である第2補正値(BP2)を加味して算出する。
(Second Embodiment)
Next, the second embodiment will be described. The main difference from the first embodiment is that the phase difference correction information acquired in step S107 is not the line image intensity distribution, but the phase difference focus detection focusing position detected by the phase difference AF and the focus detection characteristic of the focus detection means. This is the difference from the focus detection focusing position calculated from. Further, in the first embodiment, the focus detection correction value is calculated separately for the first correction value and the second correction value. However, in the present embodiment, when calculating P_AF, it is the difference between the phase difference focus detection focus position detected by the phase difference AF and the focus detection focus position calculated from the focus detection characteristic of the focus detection means. 2 Calculated by adding the correction value (BP2).

図5、図17を参照して、本実施形態のデジタルカメラにおける自動焦点検出(AF)動作について説明する。図5の処理は、第1の実施形態と同様の処理のため割愛する。以下、第1の実施形態にて、図5を用いて説明したAF処理全体のフローのステップS5における自動焦点検出の結果を補正するための焦点検出補正値の算出について図17を用いて説明する。 The automatic focus detection (AF) operation in the digital camera of the present embodiment will be described with reference to FIGS. 5 and 17. The process of FIG. 5 is omitted because it is the same process as that of the first embodiment. Hereinafter, in the first embodiment, the calculation of the focus detection correction value for correcting the result of the automatic focus detection in step S5 of the flow of the entire AF process described with reference to FIG. 5 will be described with reference to FIG. ..

まず、ステップS1601で、カメラMPU125は、収差情報を取得する。ここでの収差情報は、光学系の収差状態を表す情報であり、例えば、被写体の色、方向、空間周波数ごとの撮影光学系の結像位置に関する情報である。次に、ステップS1602で、カメラMPU125は、位相差補正情報を取得する。位相差補正情報は、位相差AFが検出する位相差焦点検出合焦位置に関連する情報である。本実施形態では、位相差AFが検出する位相差焦点検出合焦位置と焦点検出手段の焦点検出特性から算出される焦点検出合焦位置との差分を取得する。また、位相差AFが検出する位相差焦点検出合焦位置と焦点検出手段の焦点検出特性から算出される焦点検出合焦位置との差分は、撮影光学系の変化や焦点検出光学系の変化に伴い変化する。すなわち、デフォーカス状態を示すフォーカスレンズ104の位置、ズーム状態を示す第1レンズ群101の位置、焦点検出領域の位置座標(x1、y1)など、撮影光学系の変化や焦点検出光学系の変化に伴い変化する。そのため、取得する位相差AFが検出する位相差焦点検出合焦位置と焦点検出手段の焦点検出特性から算出される焦点検出合焦位置との差分は、図5のステップS4で取得した、補正値算出条件に基づいて決定する。 First, in step S1601, the camera MPU 125 acquires aberration information. The aberration information here is information representing the aberration state of the optical system, and is, for example, information regarding the imaging position of the photographing optical system for each of the color, direction, and spatial frequency of the subject. Next, in step S1602, the camera MPU 125 acquires the phase difference correction information. The phase difference correction information is information related to the phase difference focus detection focusing position detected by the phase difference AF. In the present embodiment, the difference between the phase difference focus detection focus position detected by the phase difference AF and the focus detection focus position calculated from the focus detection characteristic of the focus detection means is acquired. In addition, the difference between the phase difference focus detection focus position detected by the phase difference AF and the focus detection focus position calculated from the focus detection characteristics of the focus detection means depends on the change in the photographing optical system and the change in the focus detection optical system. It changes with it. That is, changes in the photographing optical system and changes in the focus detection optical system, such as the position of the focus lens 104 indicating the defocus state, the position of the first lens group 101 indicating the zoom state, and the position coordinates (x1, y1) of the focus detection region. It changes with. Therefore, the difference between the phase difference focus detection focus position detected by the acquired phase difference AF and the focus detection focus position calculated from the focus detection characteristic of the focus detection means is a correction value acquired in step S4 of FIG. Determined based on the calculation conditions.

次に、ステップS1603、ステップS1604で、カメラMPU125は、ステップS1601で取得した収差情報と、ステップS1602で取得した位相差補正情報から、撮像合焦位置(P_IMG)、焦点検出合焦位置(P_AF)を算出する。つまり、撮影画像の画像特性または評価特性から算出される撮像合焦位置(P_IMG)、焦点検出手段の焦点検出特性から算出される焦点検出合焦位置(P_AF)を算出する。 Next, in step S1603 and step S1604, the camera MPU 125 obtains the imaging focusing position (P_IMG) and the focus detection focusing position (P_AF) from the aberration information acquired in step S1601 and the phase difference correction information acquired in step S1602. Is calculated. That is, the imaging in-focus position (P_IMG) calculated from the image characteristics or the evaluation characteristics of the captured image, and the focus detection in-focus position (P_AF) calculated from the focus detection characteristics of the focus detection means are calculated.

本実施形態では、第1の実施形態における図8(D)に示す合焦位置の算出に用いる重み付け係数を構成する係数のうち、以下の係数を設定した場合を例にして説明する。
K_AF_H=1
K_AF_V=0
K_IMG_H=0.5
K_IMG_V=0.5
K_IMG_FQ(1)=1
K_IMG_FQ(2)=0
K_IMG_FQ(3)=0
K_IMG_FQ(4)=0
K_AF_R=0
K_AF_G=1
K_AF_B=0
K_IMG_R=0.3
K_IMG_G=0.5
K_IMG_B=0.2
In this embodiment, the case where the following coefficients are set among the coefficients constituting the weighting coefficient used for calculating the in-focus position shown in FIG. 8D in the first embodiment will be described as an example.
K_AF_H = 1
K_AF_V = 0
K_IMG_H = 0.5
K_IMG_V = 0.5
K_IMG_FQ (1) = 1
K_IMG_FQ (2) = 0
K_IMG_FQ (3) = 0
K_IMG_FQ (4) = 0
K_AF_R = 0
K_AF_G = 1
K_AF_B = 0
K_IMG_R = 0.3
K_IMG_G = 0.5
K_IMG_B = 0.2

また、第1の実施形態における式(1)の緑(G)色の信号について水平(H)方向に対応した空間周波数ごとのデフォーカスMTFの極大値を示すフォーカスレンズ104位置の情報MTF_P_GHは式(11)で表される。
MTF_P_GH(f,x,y)=(gh(0)×x+gh(1)×y+gh(2))×f2+(gh(3)×x+gh(4)×y+gh(5))×f+(gh(6)×x+gh(7)×y+gh(8)) (11)
Further, the information MTF_P_GH of the focus lens 104 position indicating the maximum value of the defocus MTF for each spatial frequency corresponding to the horizontal (H) direction for the green (G) color signal of the formula (1) in the first embodiment is expressed by the formula MTF_P_GH. It is represented by (11).
MTF_P_GH (f, x, y) = (gh (0) x x + gh (1) x y + gh (2)) x f2 + (gh (3) x x + gh (4) x y + gh (5)) x f + (gh (6)) × x + gh (7) × y + gh (8)) (11)

まず、本実施形態では、緑(G)色の信号について水平(H)方向に対応した、式(10)のgh(8)項に、第2補正値(BP2)の2倍を加算する。つまり、位相差AFが検出する位相差焦点検出合焦位置と焦点検出手段の焦点検出特性から算出される焦点検出合焦位置との差分である第2補正値(BP2)の2倍を加算する。加算後のMTF_P_GH(f,x,y)を加算前と区別するために、MTF_P_GH_BP2(f,x,y)と表記する。加算後の式(11)を式(12)に示す。
MTF_P_GH_BP2(f,x,y)=(gh(0)×x+gh(1)×y+gh(2))×f2+(gh(3)×x+gh(4)×y+gh(5))×f+(gh(6)×x+gh(7)×y+(gh(8)+BP2×2)) (12)
First, in the present embodiment, twice the second correction value (BP2) is added to the gh (8) term of the equation (10) corresponding to the horizontal (H) direction for the green (G) color signal. That is, twice the second correction value (BP2), which is the difference between the phase difference focus detection focus position detected by the phase difference AF and the focus detection focus position calculated from the focus detection characteristic of the focus detection means, is added. .. In order to distinguish MTF_P_GH (f, x, y) after addition from that before addition, it is expressed as MTF_P_GH_BP2 (f, x, y). The equation (11) after addition is shown in equation (12).
MTF_P_GH_BP2 (f, x, y) = (gh (0) x x + gh (1) x y + gh (2)) x f2 + (gh (3) x x + gh (4) x y + gh (5)) x f + (gh (6)) × x + gh (7) × y + (gh (8) + BP2 × 2)) (12)

なお、式(12)は、緑(G)色の信号について水平(H)方向に対応した空間周波数ごとのデフォーカスMTFの極大値を示すフォーカスレンズ104位置の情報MTF_P_GH_BP2の式を示している。なお、赤(R)色、青(B)色の信号の水平(H)方向も同様である。赤(R)色、緑(G)色、青(B)色の信号の垂直(V)方向に関しては、第1の実施形態の式(1)同様である。 The equation (12) shows the equation of the information MTF_P_GH_BP2 of the focus lens 104 position indicating the maximum value of the defocus MTF for each spatial frequency corresponding to the horizontal (H) direction for the green (G) color signal. The same applies to the horizontal (H) direction of the red (R) color and blue (B) color signals. The vertical (V) direction of the red (R) color, green (G) color, and blue (B) color signals is the same as in the formula (1) of the first embodiment.

また、本実施形態では、カメラMPU125がgh(8)、BP2を取得し、式(12)により、第2補正値(BP2)の2倍を算出した。しかしながら、レンズMPU117であらかじめ第2補正値(BP2)の2倍を加算したgh(8)+BP2×2をカメラMPU125が取得してもよい。そうすることで、レンズMPU117とカメラMPU125間の通信を削減可能となる。 Further, in the present embodiment, the camera MPU 125 acquires gh (8) and BP2, and the second correction value (BP2) is calculated twice by the equation (12). However, the camera MPU 125 may acquire gh (8) + BP2 × 2 obtained by adding twice the second correction value (BP2) in advance with the lens MPU117. By doing so, it is possible to reduce the communication between the lens MPU 117 and the camera MPU 125.

また、レンズユニット100のレンズメモリ118に、gh(8)の代わりにgh(8)+BP2×2をgh(8)_BP2としてあらかじめ記憶しておき、カメラMPU125が、レンズMPU117に要求してgh(8)_BP2を取得してもよい。なお、gh(8)_BP2は、カメラRAM125bの不揮発性領域に記憶されていてもよい。この場合、レンズメモリ118またはカメラRAM125bの記憶容量を削減可能となる。 Further, in the lens memory 118 of the lens unit 100, gh (8) + BP2 × 2 is stored in advance as gh (8) _BP2 instead of gh (8), and the camera MPU 125 requests the lens MPU 117 to perform gh (8). 8) _BP2 may be acquired. Note that gh (8) _BP2 may be stored in the non-volatile region of the camera RAM 125b. In this case, the storage capacity of the lens memory 118 or the camera RAM 125b can be reduced.

次に、式(12)のx,yに焦点検出領域の位置情報(x1、y1)を代入する。この計算により式(12)は、以下の式(13)のような形式で表される。
MTF_P_GH_BP2(f)=Agh×f2+Bgh×f+Cgh+BP×2
=MTF_P_GH(f)+BP×2 (13)
Agh、Bgh、Cghは第1の実施形態と同係数を表している。ここで、カメラMPU125は、MTF_P_RH_BP2(f)、MTF_P_BH_BP2(f)についても同様に計算する。
Next, the position information (x1, y1) of the focus detection region is substituted into x and y of the equation (12). By this calculation, the equation (12) is expressed in the form of the following equation (13).
MTF_P_GH_BP2 (f) = Agh x f2 + Bgh x f + Cgh + BP x 2
= MTF_P_GH (f) + BP x 2 (13)
Agh, Bgh, and Cgh represent the same coefficients as in the first embodiment. Here, the camera MPU 125 also calculates MTF_P_RH_BP2 (f) and MTF_P_BH_BP2 (f) in the same manner.

次に、カメラMPU125は、第1の実施形態の図5のステップS4で取得している補正値算出条件の合焦位置の算出に用いる重み付け係数を構成する係数(図8(D))で、収差情報を重み付けする。ただし、K_AF_H、K_AF_V、K_IMG_H、K_IMG_V、K_IMG_FQ(1)、K_IMG_FQ(2)、K_IMG_FQ(3)、K_IMG_FQ(4)は上述した値を用いる。 Next, the camera MPU 125 is a coefficient (FIG. 8 (D)) that constitutes a weighting coefficient used for calculating the focusing position of the correction value calculation condition acquired in step S4 of FIG. 5 of the first embodiment. Weight the aberration information. However, the above-mentioned values are used for K_AF_H, K_AF_V, K_IMG_H, K_IMG_V, K_IMG_FQ (1), K_IMG_FQ (2), K_IMG_FQ (3), and K_IMG_FQ (4).

具体的には、第1の実施形態の式(3)、式(4)に式(13)および上述した、係数を代入する。代入して整理すると式(14)、式(15)となる。
MTF_P_AF_BP2(f)= MTF_P_GH(f)+BP2×2 (14)
MTF_P_IMG_BP2(f)=
0.15×MTF_P_RH(f)
+0.15×MTF_P_RV(f)
+0.25×MTF_P_GH(f)
+0.25MTF_P_GV(f)
+0.25×MTF_P_BH(f)
+0.25×MTF_P_BV(f)
+BP2 (15)
Specifically, the equation (13) and the above-mentioned coefficients are substituted into the equations (3) and (4) of the first embodiment. When substituting and rearranging, equations (14) and (15) are obtained.
MTF_P_AF_BP2 (f) = MTF_P_GH (f) + BP2 × 2 (14)
MTF_P_IMG_BP2 (f) =
0.15 × MTF_P_RH (f)
+0.15 × MTF_P_RV (f)
+0.25 × MTF_P_GH (f)
+0.25 MTF_P_GV (f)
+0.25 × MTF_P_BH (f)
+0.25 × MTF_P_BV (f)
+ BP2 (15)

また、第1の実施形態の式(3)、式(4)に、上述の係数を代入して整理すると式(16)、式(17)となる。
MTF_P_AF(f)= MTF_P_GH(f) (16)
MTF_P_IMG=
0.15×MTF_P_RH(f)
+015×MTF_P_RV(f)
+0.25×MTF_P_GH(f)
+0.25MTF_P_GV(f)
+0.25×MTF_P_BH(f)
+0.25×MTF_P_BV(f) (17)
Further, when the above-mentioned coefficients are substituted into the equations (3) and (4) of the first embodiment and arranged, the equations (16) and (17) are obtained.
MTF_P_AF (f) = MTF_P_GH (f) (16)
MTF_P_IMG =
0.15 × MTF_P_RH (f)
+015 × MTF_P_RV (f)
+0.25 × MTF_P_GH (f)
+0.25 MTF_P_GV (f)
+0.25 × MTF_P_BH (f)
+0.25 × MTF_P_BV (f) (17)

式(14)、式(15)を、式(16)、式(17)をもちいて整理すると式(18)、式(19)となる。
MTF_P_AF_BP2(f)=MTF_P_AF(f)+BP2×2 (18)
MTF_P_IMG_BP2(f)=MTF_P_IMG(f)+BP2 (19)
When the equations (14) and (15) are rearranged using the equations (16) and (17), the equations (18) and (19) are obtained.
MTF_P_AF_BP2 (f) = MTF_P_AF (f) + BP2 × 2 (18)
MTF_P_IMG_BP2 (f) = MTF_P_IMG (f) + BP2 (19)

次に、カメラMPU125は、位相差AFに依存する第2補正値(BP2)を考慮した撮像合焦位置(P_IMG)と焦点検出合焦位置(P_AF)を、以下の式(20)および(21)に従って算出する。つまり、第2補正値(BP2)を考慮した撮影画像の画像特性もしくは評価特性から算出される撮像合焦位置(P_IMG)と焦点検出手段の焦点検出特性から算出される焦点検出合焦位置(P_AF)を、以下の式(20)および(21)に従って算出する。 Next, the camera MPU 125 sets the imaging focusing position (P_IMG) and the focus detection focusing position (P_AF) in consideration of the second correction value (BP2) depending on the phase difference AF by the following equations (20) and (21). ). That is, the focus detection focus position (P_IMG) calculated from the image characteristics or evaluation characteristics of the captured image in consideration of the second correction value (BP2) and the focus detection focus position (P_AF) calculated from the focus detection characteristics of the focus detection means. ) Is calculated according to the following equations (20) and (21).

焦点検出合焦位置の算出は、式(14)および式(15)で得た空間周波数ごとのデフォーカスMTFの極大値情報と、ステップS4で得た撮影画像やAFの評価帯域で重みづけ加算する。つまり、空間周波数ごとのデフォーカスMTFの極大値情報MTF_P_AF_BP2(f)、MTF_P_IMG_BP2(f)と、ステップS4で得た撮影画像やAFの評価帯域K_IMG_FQ(n),K_AF_FQ(n)で重みづけ加算する。ただし、本実施例では上述した、K_IMG_FQ(1)、K_IMG_FQ(2)、K_IMG_FQ(3)、K_IMG_FQ(4)を用いて算出する。
P_IMG_BP2=MTF_P_IMG_BP2(1)
=MTF_P_IMG(1)+BP2 (20)
P_AF_BP2=MTF_P_AF_BP2(1)
=MTF_P_AF(1)+BP2×2 (21)
The focus detection focus position is calculated by weighting and adding the maximum value information of the defocus MTF for each spatial frequency obtained by the equations (14) and (15) and the photographed image and the AF evaluation band obtained in step S4. To do. That is, the maximum value information MTF_P_AF_BP2 (f) and MTF_P_IMG_BP2 (f) of the defocus MTF for each spatial frequency are weighted and added by the captured image obtained in step S4 and the AF evaluation bands K_IMG_FQ (n) and K_AF_FQ (n). .. However, in this embodiment, the calculation is performed using the above-mentioned K_IMG_FQ (1), K_IMG_FQ (2), K_IMG_FQ (3), and K_IMG_FQ (4).
P_IMG_BP2 = MTF_P_IMG_BP2 (1)
= MTF_P_IMG (1) + BP2 (20)
P_AF_BP2 = MTF_P_AF_BP2 (1)
= MTF_P_AF (1) + BP2 × 2 (21)

次に、ステップS1605で、カメラMPU125は、焦点検出補正値(BP)を、以下の式(22)により算出する。
BP=P_AF_BP2−P_IMG_BP2
=MTF_P_AF(1)−MTF_P_IMG(1)+BP2
=BP1+BP2 (22)
Next, in step S1605, the camera MPU 125 calculates the focus detection correction value (BP) by the following equation (22).
BP = P_AF_BP2-P_IMG_BP2
= MTF_P_AF (1) -MTF_P_IMG (1) + BP2
= BP1 + BP2 (22)

以上のように、式(11)のgh(8)項に、第2補正値(BP2)の2倍を加算し、計算することで、第1補正値(BP1)と、第2補正値(BP2)を合わせた焦点検出補正値(BP)を算出可能となる。以上、本実施形態によれば、被写体の色、方向、空間周波数に依存する補正と、位相差AFに依存する補正を分けて補正することにより、光学系の収差による位相差AFの焦点検出誤差を精度良く補正可能な焦点検出方法を提供できる。 As described above, the first correction value (BP1) and the second correction value (BP1) are calculated by adding twice the second correction value (BP2) to the gh (8) term of the equation (11). The focus detection correction value (BP) including BP2) can be calculated. As described above, according to the present embodiment, the focus detection error of the phase difference AF due to the aberration of the optical system is corrected by separately correcting the correction depending on the color, direction, and spatial frequency of the subject and the correction depending on the phase difference AF. Can be provided with a focus detection method capable of accurately correcting.

また、本発明の好ましい実施形態について説明したが、本発明は、これらの実施形態に限定されず、その要旨の範囲内で種々の変形および変更が可能である。 Moreover, although the preferred embodiment of the present invention has been described, the present invention is not limited to these embodiments, and various modifications and modifications can be made within the scope of the gist thereof.

Claims (8)

撮像光学系の異なる瞳領域を通過した光束を光電変換して、一対の光電変換信号を出力することが可能な複数の画素を有する撮像手段と、
撮影光学系の収差情報を取得する取得手段と、
前記取得した収差情報から、画像の画像特性または評価特性から算出される撮像合焦位置と、焦点検出手段の焦点検出特性から算出される焦点検出合焦位置から第1補正値を算出し、
一対の線像強度分布の形状が互いに異なることで生じる重心ずれ量差に応じた補正値であって、前記焦点検出合焦位置における前記撮像手段一対の光電変換部に対応した前記撮影光学系の線像強度分布に基づいて位相差焦点検出方式で検出される位相差焦点検出合焦位置から第2補正値を算出し、
前記第1補正値と前記第2補正値から焦点検出補正値を算出する算出手段と、
を有する
ことを特徴とする焦点検出装置。
An imaging means having a plurality of pixels capable of photoelectrically converting a light flux passing through different pupil regions of an imaging optical system and outputting a pair of photoelectric conversion signals.
An acquisition means for acquiring aberration information of the photographing optical system, and
From the acquired aberration information, the first correction value is calculated from the imaging in-focus position calculated from the image characteristic or the evaluation characteristic of the image and the focus detection in-focus position calculated from the focus detection characteristic of the focus detection means.
A correction value corresponding to the gravity center displacement amount difference caused by the shape of the pair of line image intensity distributions are different from each other, the imaging optical system corresponding to the pair of photoelectric conversion units of the image pickup means in the focus detecting focus position and based on the line image intensity distribution by calculating a second correction value from the phase difference focus detection in-focus position detected by the phase difference focus detection method,
A calculation means for calculating the focus detection correction value from the first correction value and the second correction value, and
A focus detector characterized by having.
前記第1補正値は、前記撮像合焦位置と前記焦点検出合焦位置との差分であり、前記第2補正値は、前記焦点検出合焦位置と前記位相差焦点検出合焦位置との差分である
ことを特徴とする請求項1に記載の焦点検出装置。
The first correction value is the difference between the imaging focus position and the focus detection focus position, and the second correction value is the difference between the focus detection focus position and the phase difference focus detection focus position. The focus detection device according to claim 1, wherein the focus detection device is characterized by the above.
前記位相差焦点検出合焦位置は、前記位相差焦点検出方式で検出される前記撮影光学系の線像強度分布の位置ずれ量に基づいて算出される
ことを特徴とする請求項1または2に記載の焦点検出装置。
According to claim 1 or 2, the phase difference focus detection focusing position is calculated based on the amount of misalignment of the line image intensity distribution of the photographing optical system detected by the phase difference focus detection method. The focus detector of the description.
前記算出手段は、前記位相差焦点検出方式を用いない場合には、前記第1補正値のみを用いて前記焦点検出補正値を算出する
ことを特徴とする請求項1〜3のいずれか1項に記載の焦点検出装置。
Any one of claims 1 to 3, wherein the calculation means calculates the focus detection correction value using only the first correction value when the phase difference focus detection method is not used. The focus detector according to.
前記算出手段は、前記焦点検出合焦位置と前記位相差焦点検出合焦位置との差分が小さい場合、前記第1補正値のみを用いて前記焦点検出補正値を算出し、前記差分が小さくない場合、前記第1補正値と前記第2補正値から前記焦点検出補正値を算出する
ことを特徴とする請求項1〜4のいずれか1項に記載の焦点検出装置。
The calculating means, when the difference between the phase difference focus detection focus position and the focus detection focus position is small, by using only the first correction value to calculate the focus detection correction value, the difference is not smaller The focus detection device according to any one of claims 1 to 4, wherein the focus detection correction value is calculated from the first correction value and the second correction value.
前記撮影光学系の収差情報は、異なる複数の空間周波数ごとの撮影光学系の結像位置に関する情報である
ことを特徴とする請求項1〜5のいずれか1項に記載の焦点検出装置。
The focus detection device according to any one of claims 1 to 5, wherein the aberration information of the photographing optical system is information regarding the imaging position of the photographing optical system for each of a plurality of different spatial frequencies.
請求項1〜6のいずれか1項に記載の焦点検出装置と、
前記焦点検出補正値によって補正された焦点検出の結果に基づいて前記撮影光学系が有するフォーカスレンズの位置を制御する制御手段と、
を備える
ことを特徴とする撮像装置。
The focus detection device according to any one of claims 1 to 6.
A control means for controlling the position of the focus lens of the photographing optical system based on the result of the focus detection corrected by the focus detection correction value, and
An imaging device characterized by comprising.
撮像光学系の異なる瞳領域を通過した光束を光電変換して、一対の光電変換信号を出力することが可能な複数の画素を有する撮像手段を有する焦点検出装置の焦点検出方法であって、
撮影光学系の収差情報から、画像の画像特性または評価特性から算出される撮像合焦位置と、焦点検出手段の焦点検出特性から算出される焦点検出合焦位置から第1補正値を算出する第1算出工程と、
一対の線像強度分布の形状が互いに異なることで生じる重心ずれ量差に応じた補正値であって、前記焦点検出合焦位置における前記撮像手段の一対の光電変換部に対応した前記撮影光学系の線像強度分布に基づいて位相差焦点検出方式で検出される位相差焦点検出合焦位置から第2補正値を算出する第2算出工程と、
前記第1補正値と前記第2補正値から焦点検出補正値を算出する第3算出工程と、
を有する
ことを特徴とする焦点検出方法。
A focus detection method of a focus detection device having an imaging means having a plurality of pixels capable of photoelectrically converting a light flux passing through different pupil regions of an imaging optical system and outputting a pair of photoelectric conversion signals.
The first correction value is calculated from the imaging in-focus position calculated from the image characteristics or evaluation characteristics of the image from the aberration information of the photographing optical system and the focus detection in-focus position calculated from the focus detection characteristics of the focus detection means. 1 calculation process and
The imaging optical system corresponding to the pair of photoelectric conversion units of the imaging means at the focus detection focusing position, which is a correction value corresponding to the difference in the amount of center of gravity shift caused by the shapes of the pair of line image intensity distributions being different from each other. The second calculation step of calculating the second correction value from the phase difference focus detection focusing position detected by the phase difference focus detection method based on the line image intensity distribution of
A third calculation step of calculating the focus detection correction value from the first correction value and the second correction value, and
A focus detection method characterized by having.
JP2016151419A 2016-08-01 2016-08-01 Focus detector, image pickup device, and focus detection method Active JP6890937B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2016151419A JP6890937B2 (en) 2016-08-01 2016-08-01 Focus detector, image pickup device, and focus detection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016151419A JP6890937B2 (en) 2016-08-01 2016-08-01 Focus detector, image pickup device, and focus detection method

Publications (3)

Publication Number Publication Date
JP2018021971A JP2018021971A (en) 2018-02-08
JP2018021971A5 JP2018021971A5 (en) 2019-09-12
JP6890937B2 true JP6890937B2 (en) 2021-06-18

Family

ID=61164472

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016151419A Active JP6890937B2 (en) 2016-08-01 2016-08-01 Focus detector, image pickup device, and focus detection method

Country Status (1)

Country Link
JP (1) JP6890937B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020003686A (en) * 2018-06-29 2020-01-09 キヤノン株式会社 Focus detection device, imaging apparatus, and interchangeable lens device
TWI781490B (en) * 2020-02-27 2022-10-21 日商斯庫林集團股份有限公司 Focusing position detection method, focusing position detector, recording medium, and focusing position detection program
CN114324423B (en) * 2021-12-24 2023-07-25 武汉联影生命科学仪器有限公司 Focus correction method, apparatus, system, computer device, and readable storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5300414B2 (en) * 2008-10-30 2013-09-25 キヤノン株式会社 Camera and camera system
JP2015049330A (en) * 2013-08-30 2015-03-16 キヤノン株式会社 Interchangeable lens, imaging device, control method of interchangeable lens and imaging device, and control program thereof
JP6313685B2 (en) * 2014-05-01 2018-04-18 キヤノン株式会社 Imaging apparatus and control method thereof

Also Published As

Publication number Publication date
JP2018021971A (en) 2018-02-08

Similar Documents

Publication Publication Date Title
US11099459B2 (en) Focus adjustment device and method capable of executing automatic focus detection, and imaging optical system storing information on aberrations thereof
US10313578B2 (en) Image capturing apparatus and method for controlling image capturing apparatus
JP6478457B2 (en) Focus adjustment device and focus adjustment method
JP6429546B2 (en) Imaging apparatus, control method, program, and storage medium
US9641769B2 (en) Image capture apparatus and method for controlling the same
JP6682310B2 (en) Focus detection apparatus and method, and imaging apparatus
JP6486288B2 (en) Imaging apparatus, control method, program, storage medium
JP6298362B2 (en) Imaging apparatus, control method therefor, and imaging system
JP6843604B2 (en) Information processing device and information processing method
US10326924B2 (en) Focus detection apparatus and method, image capturing apparatus, and lens unit
JP6890937B2 (en) Focus detector, image pickup device, and focus detection method
JP7091053B2 (en) Imaging device and focus detection method
JP6854619B2 (en) Focus detection device and method, imaging device, lens unit and imaging system
JP7037271B2 (en) Focus detectors and focus detectors, imaging devices, programs and storage media
JP6744933B2 (en) Lens part and its control method
JP6685769B2 (en) Information processing device, imaging device, and information processing method
JP6686191B2 (en) Focus detection device, imaging device, and focus detection method
JP6686239B1 (en) Lens unit, transmitter, and receiver
JP6548626B2 (en) Image pickup apparatus, control method for image pickup apparatus, and focus control program
JP2020003686A (en) Focus detection device, imaging apparatus, and interchangeable lens device
JP6415054B2 (en) Imaging apparatus and imaging method

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20190730

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20190730

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20200630

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20200707

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20200904

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20201222

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20210219

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20210427

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20210526

R151 Written notification of patent or utility model registration

Ref document number: 6890937

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151