JP2020003686A - Focus detection device, imaging apparatus, and interchangeable lens device - Google Patents

Focus detection device, imaging apparatus, and interchangeable lens device Download PDF

Info

Publication number
JP2020003686A
JP2020003686A JP2018123799A JP2018123799A JP2020003686A JP 2020003686 A JP2020003686 A JP 2020003686A JP 2018123799 A JP2018123799 A JP 2018123799A JP 2018123799 A JP2018123799 A JP 2018123799A JP 2020003686 A JP2020003686 A JP 2020003686A
Authority
JP
Japan
Prior art keywords
correction value
focus detection
focus
image
focus position
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2018123799A
Other languages
Japanese (ja)
Inventor
優 稲垣
Masaru Inagaki
優 稲垣
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 JP2018123799A priority Critical patent/JP2020003686A/en
Publication of JP2020003686A publication Critical patent/JP2020003686A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

To excellently correct a focus detection error caused by a phase difference detection system.SOLUTION: Focus detection devices 125 and 129 acquire a focus detection correction value used for the correction of the result of focus detection, acquire a first correction value which is a difference between a first focusing position calculated according to the characteristics of an image generated from the output of an imaging element 122 and a second focusing position calculated according to the characteristics of the focus detection, acquire a second correction value which is a correction value corresponding to a condition relating to the light reception sensitivity distribution of the imaging element and is the difference between the second focusing position and a third focusing position calculated from the result of the focus detection, and further acquire the focus detection correction value by using the first correction value and the second correction value.SELECTED DRAWING: Figure 1

Description

本発明は、撮像面位相差検出方式による焦点検出を行う焦点検出技術に関する。   The present invention relates to a focus detection technique for performing focus detection by an imaging plane phase difference detection method.

デジタルカメラやビデオカメラ等の撮像装置の自動焦点検出(AF)方式として、撮像素子を焦点検出用センサとして用いて位相差検出方式の焦点検出を行う撮像面位相差検出方式がある。また、位相差検出方式では、被写体からの光により形成される対の光学像を利用して焦点検出を行うため、該光学像を形成する光学系の収差が焦点検出結果に誤差を生じさせる場合がある。このため、特許文献1には、合焦状態において対の光学像の形状が光学系の収差に起因して一致しないことによる焦点検出誤差を補正する方法が開示されている。   As an automatic focus detection (AF) method for an image pickup apparatus such as a digital camera and a video camera, there is an image pickup surface phase difference detection method for performing focus detection using a phase difference detection method using an image sensor as a focus detection sensor. Further, in the phase difference detection method, since focus detection is performed using a pair of optical images formed by light from a subject, an aberration of an optical system forming the optical image may cause an error in the focus detection result. There is. For this reason, Patent Literature 1 discloses a method of correcting a focus detection error caused by a mismatch between the shapes of a pair of optical images due to aberration of an optical system in a focused state.

特開2013−171251号公報JP 2013-171251 A

しかしながら、焦点検出誤差には、光学系の収差に起因して生じるものだけではなく、被写体の色、方向および空間周波数に依存して生じるものがある。また、撮像素子の種類や製造誤差によって撮像素子の入射角度ごとの受光感度、すなわち受光感度分布が異なると、光学系の収差に起因する焦点検出誤差量が異なる。このため、光学系の収差と撮像素子の受光感度分布との組合せごとに異なる焦点検出誤差に対する補正が必要となる。   However, the focus detection errors include not only errors due to aberrations of the optical system but also errors depending on the color, direction, and spatial frequency of the subject. Further, if the light receiving sensitivity at each incident angle of the image sensor, that is, the light receiving sensitivity distribution differs depending on the type of the image sensor and manufacturing errors, the focus detection error amount due to the aberration of the optical system differs. Therefore, it is necessary to correct different focus detection errors for each combination of the aberration of the optical system and the light receiving sensitivity distribution of the image sensor.

本発明は、光学系の収差だけでなく、被写体の色、方向および空間周波数等の特性や撮像素子の受光感度分布に応じて異なる焦点検出誤差を良好に補正することが可能な焦点検出装置を提供する。   The present invention provides a focus detection device that can satisfactorily correct not only aberrations of an optical system but also focus detection errors that differ depending on characteristics of a subject, such as color, direction, and spatial frequency, and distribution of light receiving sensitivity of an image sensor. provide.

本発明の一側面としての焦点検出装置は、撮像素子を用いた位相差検出方式での焦点検出を行う。該焦点検出装置は、焦点検出の結果の補正に用いられる焦点検出補正値を取得する補正値取得手段を有する。該補正値取得手段は、撮像素子の出力から生成される画像の特性に応じて算出される第1合焦位置と焦点検出の特性に応じて算出される第2合焦位置との差分である第1補正値を取得し、撮像素子の受光感度分布に関する条件に応じた補正値であって、第2合焦位置と焦点検出の結果から算出される第3合焦位置との差分である第2補正値を取得し、第1補正値と第2補正値を用いて焦点検出補正値を取得することを特徴とする。   A focus detection device according to one aspect of the present invention performs focus detection by a phase difference detection method using an image sensor. The focus detection device has a correction value acquisition unit that acquires a focus detection correction value used for correcting a result of focus detection. The correction value obtaining means is a difference between a first focus position calculated according to a characteristic of an image generated from an output of the imaging element and a second focus position calculated according to a characteristic of focus detection. The first correction value is obtained, and is a correction value corresponding to a condition regarding the light-receiving sensitivity distribution of the image sensor, and is a difference between the second focus position and a third focus position calculated from a result of focus detection. (2) acquiring a second correction value, and acquiring a focus detection correction value using the first correction value and the second correction value.

また、本発明の他の一側面としての交換レンズ装置は、撮像素子の出力から生成される画像の特性に応じて算出される第1合焦位置と位相差検出方式での焦点検出の特性に応じて算出される第2合焦位置との差分である第1補正値と、撮像素子の受光感度分布に関する条件に応じた補正値であって、第2合焦位置と焦点検出の結果から算出される第3合焦位置との差分である第2補正値とを用いて、焦点検出の結果の補正に用いられる焦点検出補正値を取得する撮像装置に装着される。該交換レンズ装置は、撮像装置が第1補正値および第2補正値のうち少なくとも一方を取得するために用いられる情報を記憶した記憶手段と、撮像素子の受光感度分布に関する条件に応じた上記情報を撮像装置に送信する送信手段とを有することを特徴とする。   In addition, the interchangeable lens device according to another aspect of the present invention provides a first focus position calculated based on characteristics of an image generated from an output of an imaging element and characteristics of focus detection in a phase difference detection method. A first correction value, which is a difference between the second focus position calculated in accordance with the second focus position, and a correction value corresponding to a condition relating to the light receiving sensitivity distribution of the image sensor, which is calculated from the second focus position and the result of focus detection. The imaging apparatus is mounted on an imaging device that acquires a focus detection correction value used for correcting a result of focus detection using a second correction value that is a difference from the third in-focus position. The interchangeable lens device includes a storage unit that stores information used by the imaging device to obtain at least one of the first correction value and the second correction value, and the information according to a condition regarding a light-receiving sensitivity distribution of the imaging device. And transmitting means for transmitting to the imaging device.

また、本発明の他の一側面としての焦点検出方法は、撮像素子を用いた位相差検出方式での焦点検出を行う方法であり、撮像素子の出力から生成される画像の特性に応じて算出される第1合焦位置と焦点検出の特性に応じて算出される第2合焦位置との差分である第1補正値を取得するステップと、撮像素子の受光感度分布に関する条件に応じた補正値であって、第2合焦位置と焦点検出の結果から算出される第3合焦位置との差分である第2補正値を取得するステップと、第1補正値と第2補正値を用いて、焦点検出の結果を補正するための焦点検出補正値を取得するステップとを有することを特徴とする。   A focus detection method according to another aspect of the present invention is a method of performing focus detection by a phase difference detection method using an image sensor, which is calculated according to characteristics of an image generated from an output of the image sensor. Obtaining a first correction value that is a difference between the first focus position to be calculated and a second focus position calculated in accordance with the characteristics of focus detection; and correction according to a condition relating to a light-receiving sensitivity distribution of the image sensor. Obtaining a second correction value, which is a difference between the second focus position and a third focus position calculated from the result of focus detection, using a first correction value and a second correction value. Obtaining a focus detection correction value for correcting the result of focus detection.

なお、焦点検出装置または撮像装置のコンピュータに、上記焦点検出方法に従う処理を実行させるコンピュータプログラムも、本発明の他の一側面を構成する。   Note that a computer program that causes a computer of the focus detection device or the imaging device to execute a process according to the focus detection method also constitutes another aspect of the present invention.

本発明によれば、位相差検出方式での焦点検出誤差を高精度に補正することができる。   According to the present invention, a focus detection error in the phase difference detection method can be corrected with high accuracy.

本発明の実施例1としてのデジタルカメラの構成を示すブロック図。FIG. 1 is a block diagram illustrating a configuration of a digital camera as a first embodiment of the present invention. 実施例1のカメラに用いられる撮像素子の構成を示す図。FIG. 2 is a diagram illustrating a configuration of an image sensor used in the camera according to the first embodiment. 上記撮像素子の光電変換領域と射出瞳との関係を示す図。FIG. 4 is a diagram illustrating a relationship between a photoelectric conversion region of the image sensor and an exit pupil. 実施例1のカメラにおけるTVAF部の構成を示すブロック図。FIG. 2 is a block diagram illustrating a configuration of a TVAF unit in the camera according to the first embodiment. 実施例1のカメラにおけるAF処理を示すフローチャート。6 is a flowchart illustrating AF processing in the camera according to the first embodiment. 実施例1における焦点検出補正値の算出処理を示すフローチャート。9 is a flowchart illustrating a calculation process of a focus detection correction value according to the first embodiment. 実施例1のカメラにおける焦点検出領域を示す図。FIG. 3 is a diagram illustrating a focus detection area in the camera according to the first embodiment. 撮像画像の合焦位置と焦点検出合焦位置との差分を算出する処理を示す図。The figure which shows the process which calculates the difference of the focus position of a picked-up image and the focus detection focus position. デフォーカスによる線像強度分布の重心ずれ量を説明する図。FIG. 4 is a diagram for explaining a shift amount of the center of gravity of a line image intensity distribution due to defocus. ケラレが大きい場合の対の線像強度分布を示す図。The figure which shows the line image intensity distribution of a pair when vignetting is large. 撮像素子の画素サイズ、瞳距離および瞳ずれ量によって受光感度分布が異なることを示す図。FIG. 4 is a diagram showing that a light receiving sensitivity distribution differs depending on a pixel size, a pupil distance, and a pupil shift amount of an image sensor. 実施例1における受光感度条件と第2補正値との関係を示す図。FIG. 4 is a diagram illustrating a relationship between a light receiving sensitivity condition and a second correction value according to the first embodiment. 実施例1において位相差AFの焦点検出誤差の補正を説明する図。FIG. 4 is a diagram for explaining correction of a focus detection error of the phase difference AF in the first embodiment. 本発明の実施例2における焦点検出補正値の算出処理を示すフローチャート。9 is a flowchart illustrating a calculation process of a focus detection correction value according to the second embodiment of the present invention.

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

図1は、本発明の実施例1である焦点検出装置を有する電子機器(撮像装置)としてのレンズ交換型デジタルカメラ(以下、カメラ本体という)120および該カメラ本体120に着脱可能に装着された交換レンズ装置としてのレンズユニット100の構成を示す。カメラ本体120とレンズユニット100によりカメラシステムが構成される。   FIG. 1 shows a lens-interchangeable digital camera (hereinafter, referred to as a camera body) 120 as an electronic apparatus (imaging apparatus) having a focus detection apparatus according to a first embodiment of the present invention, and is detachably attached to the camera body 120. 1 shows a configuration of a lens unit 100 as an interchangeable lens device. A camera system is configured by the camera body 120 and the lens unit 100.

レンズユニット100は、図の中央の点線で示されるマウントMを介してカメラ本体120に装着される。レンズユニット100は、被写体側(図の左側)から順に第1レンズ101、絞り102、第2レンズ103およびフォーカスレンズ104を含む撮像光学系(以下、レンズ光学系という)を有する。第1レンズ101、第2レンズ103およびフォーカスレンズ104はそれぞれ、1つ又は複数のレンズにより構成されている。また、レンズユニット100は、レンズ光学系を駆動および制御するレンズ駆動/制御系を有する。   The lens unit 100 is mounted on the camera body 120 via a mount M indicated by a dotted line in the center of the figure. The lens unit 100 has an imaging optical system (hereinafter, referred to as a lens optical system) including a first lens 101, an aperture 102, a second lens 103, and a focus lens 104 in order from the subject side (left side in the figure). Each of the first lens 101, the second lens 103, and the focus lens 104 includes one or a plurality of lenses. The lens unit 100 has a lens drive / control system that drives and controls the lens optical system.

第1レンズ101および第2レンズ103は、撮像光学系の光軸が延びる方向である光軸方向OAに移動して変倍を行う。絞り102は、光量を調節する機能と、静止画撮像時に露出時間を制御するメカニカルシャッタとしての機能とを有する。絞り102と第2レンズ103は、変倍に際して一体となって光軸方向OAに移動する。フォーカスレンズ104は、光軸方向OAに移動して撮像光学系が合焦する被写体距離(合焦距離)を変化させる、すなわち焦点調節を行う。   The first lens 101 and the second lens 103 move in the optical axis direction OA, which is the direction in which the optical axis of the imaging optical system extends, to perform zooming. The aperture 102 has a function of adjusting the amount of light and a function as a mechanical shutter that controls the exposure time when capturing a still image. The diaphragm 102 and the second lens 103 move together in the optical axis direction OA during zooming. The focus lens 104 moves in the optical axis direction OA to change a subject distance (focus distance) at which the imaging optical system focuses, that is, performs focus adjustment.

レンズ駆動/制御系は、ズームアクチュエータ111、絞りアクチュエータ112、フォーカスアクチュエータ113、ズーム駆動部114、絞り駆動部115、フォーカス駆動部116、レンズMPU117およびレンズメモリ118を有する。ズーム駆動部114は、ズームアクチュエータ111を駆動して第1レンズ101および第2レンズ103をそれぞれ光軸方向OAに移動させる。絞りシャッタ駆動部115は、絞りアクチュエータ112を駆動して絞り102を動作させ、絞り102の開口径やシャッタ開閉動作を制御する。フォーカス駆動部116は、フォーカスアクチュエータ113を駆動してフォーカスレンズ104を光軸方向OAに移動させる。フォーカス駆動部116には、フォーカスアクチュエータ113に設けられた不図示のセンサを用いてフォーカスレンズ104の位置を検出する。   The lens drive / control system includes a zoom actuator 111, an aperture actuator 112, a focus actuator 113, a zoom drive unit 114, an aperture drive unit 115, a focus drive unit 116, a lens MPU 117, and a lens memory 118. The zoom drive unit 114 drives the zoom actuator 111 to move the first lens 101 and the second lens 103 in the optical axis direction OA, respectively. The aperture shutter driving unit 115 drives the aperture actuator 112 to operate the aperture 102, and controls the aperture diameter of the aperture 102 and the shutter opening / closing operation. The focus drive unit 116 drives the focus actuator 113 to move the focus lens 104 in the optical axis direction OA. The focus drive unit 116 detects the position of the focus lens 104 using a sensor (not shown) provided on the focus actuator 113.

レンズMPU117は、カメラ本体120に設けられたカメラMPU125とマウントMに設けられた不図示の通信接点を介してデータやコマンドの通信を行うことができる。レンズMPU117は、カメラMPU125からの要求コマンドに応じて、レンズ位置情報をカメラMPU125に送信する。レンズ位置情報は、フォーカスレンズ104の光軸方向OAでの位置、駆動されていない状態の撮像光学系の射出瞳の光軸方向OAでの位置および直径、射出瞳を通過する光束を制限するレンズ枠の光軸方向OAでの位置および直径等の情報を含む。また、レンズMPU117は、カメラMPU125からの制御コマンドに応じて、ズーム駆動部114、絞り駆動部115、フォーカス駆動部116を制御する。これにより、ズーム制御、絞り/シャッタ制御および焦点調節(AF)制御が行われる。
レンズメモリ(記憶手段)118は、AF制御に必要な光学情報を予め記憶している。カメラMPU125は、内蔵する不揮発性メモリやレンズメモリ118に記憶されたプログラムを実行することで、レンズユニット100の動作を制御する。
The lens MPU 117 can communicate data and commands with a camera MPU 125 provided on the camera body 120 via a communication contact (not shown) provided on the mount M. The lens MPU 117 transmits lens position information to the camera MPU 125 in response to a request command from the camera MPU 125. The 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 of the imaging optical system in an undriven state in the optical axis direction OA, and a lens that restricts the light flux passing through the exit pupil. Information such as the position and diameter of the frame in the optical axis direction OA is included. Further, the lens MPU 117 controls the zoom drive unit 114, the aperture drive unit 115, and the focus drive unit 116 according to a control command from the camera MPU 125. Thus, zoom control, aperture / shutter control, and focus adjustment (AF) control are performed.
The lens memory (storage means) 118 stores optical information necessary for AF control in advance. The camera MPU 125 controls the operation of the lens unit 100 by executing a program stored in a built-in nonvolatile memory or the lens memory 118.

カメラ本体120は、光学ローパスフィルタ121および撮像素子122により構成されるカメラ光学系と、カメラ駆動/制御系とを有する。レンズ光学系およびカメラ光学系によりカメラシステムの撮像光学系が構成される。   The camera body 120 has a camera optical system including an optical low-pass filter 121 and an image sensor 122, and a camera driving / control system. An imaging optical system of the camera system is configured by the lens optical system and the camera optical system.

光学ローパスフィルタ121は、撮像画像の偽色やモアレを軽減する。撮像素子122は、CMOSイメージセンサとその周辺部により構成され、撮像光学系により形成された被写体像を光電変換(撮像)する。撮像素子122は、横方向に複数のm画素、縦方向に複数のn画素を有する。また、撮像素子122は、後述する瞳分割機能を有しており、撮像素子122の出力から生成された後述する位相差像信号を用いて位相差検出方式でのAF(撮像面位相差AF:以下、単に位相差AFという)を行うことが可能である。   The optical low-pass filter 121 reduces false colors and moire of a captured image. The imaging element 122 is configured by a CMOS image sensor and its peripheral portion, and photoelectrically converts (images) a subject image formed by the imaging optical system. The image sensor 122 has a plurality of m pixels in the horizontal direction and a plurality of n pixels in the vertical direction. Further, the image sensor 122 has a pupil division function described below, and uses a phase difference image signal (described later) generated from an output of the image sensor 122 to perform AF (imaging plane phase difference AF: Hereinafter, it is simply referred to as phase difference AF).

カメラ駆動/制御系は、撮像素子駆動部123、画像処理部124、カメラMPU125、表示器126、操作スイッチ群127、位相差焦点検出部129およびTVAF焦点検出部130を有する。撮像素子駆動部123は、撮像素子122の駆動を制御する。画像処理部124は、撮像素子122の出力であるアナログ撮像信号をデジタル撮像信号に変換し、該デジタル撮像信号に対してγ変換、ホワイトバランス処理および色補間処理を行って映像信号(画像データ)を生成してカメラMPU125に出力する。カメラMPU125は、画像データを表示器126に表示させたりメモリ128に撮像画像データとして記録させたりする。また、画像処理部124は、必要に応じて、画像データに対して圧縮符号化処理を行う。さらに画像処理部124は、デジタル撮像信号から対の位相差像信号やTVAF焦点検出部130で用いられるTVAF用画像データ(RAW画像データ)を生成する。   The camera driving / control system includes an image sensor driving unit 123, an image processing unit 124, a camera MPU 125, a display 126, an operation switch group 127, a phase difference focus detection unit 129, and a TVAF focus detection unit 130. The image sensor driving unit 123 controls driving of the image sensor 122. The image processing unit 124 converts an analog image signal output from the image sensor 122 into a digital image signal, performs γ conversion, white balance processing, and color interpolation processing on the digital image signal, and outputs a video signal (image data). Is generated and output to the camera MPU 125. The camera MPU 125 displays the image data on the display 126 or records the image data in the memory 128 as captured image data. Further, the image processing unit 124 performs a compression encoding process on the image data as needed. Further, the image processing unit 124 generates a pair of phase difference image signals and TVAF image data (RAW image data) used in the TVAF focus detection unit 130 from the digital image pickup signal.

制御手段としてのカメラMPU125は、カメラシステム全体に必要な演算や制御を行う。カメラMPU125は、レンズMPU117に対して、前述したレンズ位置情報やレンズユニット100の固有の光学情報の要求コマンドや、ズーム、絞りおよび焦点調節の制御コマンドを送信する。カメラMPU125は、上記演算や制御を行うためのプログラムを格納したROM125a、変数を記憶するRAM125b、各種パラメータを記憶するEEPROM125cが内蔵されている。   The camera MPU 125 as control means performs necessary calculations and controls for the entire camera system. The camera MPU 125 transmits, to the lens MPU 117, a command for requesting the above-described lens position information and optical information unique to the lens unit 100, and a control command for zoom, aperture, and focus adjustment. The camera MPU 125 has a built-in ROM 125a that stores programs for performing the above calculations and controls, a RAM 125b that stores variables, and an EEPROM 125c that stores various parameters.

表示器126は、LCD等により構成され、上述した画像データや撮像モードその他の撮像に関する情報を表示する。画像データは、撮像前のプレビュー画像データ、AF時の合焦確認用画像データおよび撮像記録後の撮像確認用画像等を含む。操作スイッチ群127は、電源スイッチ、レリーズ(撮像トリガ)スイッチ、ズーム操作スイッチ、撮像モード選択スイッチ等を含む。メモリ128は、カメラ本体120に対して着脱可能なフラッシュメモリであり、撮像画像データを記録する。   The display 126 is configured by an LCD or the like, and displays the above-described image data, the imaging mode, and other information related to imaging. The image data includes preview image data before imaging, image data for focusing confirmation at the time of AF, an image for confirming imaging after imaging and recording, and the like. The operation switch group 127 includes a power switch, a release (imaging trigger) switch, a zoom operation switch, an imaging mode selection switch, and the like. The memory 128 is a flash memory that can be attached to and detached from the camera body 120, and records captured image data.

位相差焦点検出部129は、画像処理部124から得られる位相差像信号を用いて位相差AFでの焦点検出処理を行う。被写体からの光束は、撮像光学系の射出瞳のうち撮像素子122は瞳分割機能により分割された対の瞳領域を通過して撮像素子122上に対の位相差像(光学像)を形成する。撮像素子122からは、これら対の位相差像を光電変換して得られた信号を画像処理部124に出力する。画像処理部124は、この信号から対の位相差像信号を生成して、カメラMPU125を介して位相差焦点検出部129に出力する。位相差焦点検出部129は、対の位相差像信号に対して相関演算を行ってこれら対の位相差像信号間のずれ量(位相差:以下、像ずれ量という)を求め、該像ずれ量をカメラMPU125に出力する。カメラMPU125は、像ずれ量から撮像光学系のデフォーカス量を算出する。   The phase difference focus detection unit 129 performs focus detection processing in phase difference AF using the phase difference image signal obtained from the image processing unit 124. The light beam from the subject passes through the pair of pupil regions divided by the pupil division function of the exit pupil of the imaging optical system, and forms a pair of phase difference images (optical images) on the image sensor 122. . The image sensor 122 outputs a signal obtained by photoelectrically converting the pair of phase difference images to the image processing unit 124. The image processing unit 124 generates a pair of phase difference image signals from this signal, and outputs the signal to the phase difference focus detection unit 129 via the camera MPU 125. The phase difference focus detection unit 129 performs a correlation operation on the pair of phase difference image signals to obtain a shift amount (phase difference: hereinafter, referred to as an image shift amount) between the pair of phase difference image signals, and obtains the image shift. The amount is output to the camera MPU 125. The camera MPU 125 calculates the defocus amount of the imaging optical system from the image shift amount.

位相差焦点検出部129およびカメラMPU125が行う位相差AFについては後に詳細に説明する。また、位相差焦点検出部129およびカメラMPU125により焦点検出装置が構成される。   The phase difference AF performed by the phase difference focus detection unit 129 and the camera MPU 125 will be described later in detail. Further, a focus detection device is configured by the phase difference focus detection unit 129 and the camera MPU 125.

TVAF焦点検出部130は、画像処理部124から入力されたTVAF用画像データから該画像データのコントラスト状態を示す焦点評価値(コントラスト評価値)を生成する。カメラMPU125は、フォーカスレンズ104を移動させて焦点評価値がピークとなる位置を探索し、その位置をTVAF合焦位置として検出する。TVAFは、コントラスト検出方式のAF(コントラストAF)とも称される。   The TVAF focus detection unit 130 generates a focus evaluation value (contrast evaluation value) indicating a contrast state of the image data from the TVAF image data input from the image processing unit 124. The camera MPU 125 moves the focus lens 104 to search for a position where the focus evaluation value reaches a peak, and detects that position as the TVAF in-focus position. The TVAF is also called a contrast detection type AF (contrast AF).

このように、本実施例のカメラ本体120は、位相差AFとTVAF(コントラストAF)の両方を行うことが可能であり、これらを選択的に使用したり組み合わせて使用したりすることができる。   As described above, the camera body 120 of the present embodiment can perform both the phase difference AF and the TVAF (contrast AF), and can use these selectively or in combination.

次に、位相差焦点検出部129の動作について説明する。図2(A)は、撮像素子122の画素配列を示し、レンズユニット100側から見たCMOSイメージセンサの縦(Y方向)6画素行と横(X方向)8画素列の範囲を示している。撮像素子122には、ベイヤー配列のカラーフィルタが設けられ、奇数行の画素には、左から順に緑(G)と赤(R)のカラーフィルタが交互に配置され、偶数行の画素には、左から順に青(B)と緑(G)のカラーフィルタが交互に配置されている。画素211において、符号211iを付した円はオンチップマイクロレンズ(以下、単にマイクロレンズという)を示し、マイクロレンズ211iの内側に配置された符号211a,211bを付した2つの矩形はそれぞれ光電変換部を示す。   Next, the operation of the phase difference focus detection unit 129 will be described. FIG. 2A shows a pixel array of the image sensor 122, and shows a range of 6 pixel rows (Y direction) and 8 pixel columns (X direction) of the CMOS image sensor viewed from the lens unit 100 side. . The image sensor 122 is provided with a Bayer array of color filters. Green (G) and red (R) color filters are alternately arranged in the odd-numbered pixels in order from the left. Blue (B) and green (G) color filters are arranged alternately from the left. In the pixel 211, a circle with reference numeral 211i indicates an on-chip microlens (hereinafter, simply referred to as a microlens), and two rectangles with reference numerals 211a and 211b disposed inside the microlens 211i indicate photoelectric conversion units, respectively. Is shown.

撮像素子122は、すべての画素において光電変換部がX方向に2つに分割され、個々の光電変換部からの光電変換信号と、同じ画素の2つの光電変換部からの2つの光電変換信号を合成した信号(以下、合成光電変換信号ていう)とを読み出すことが可能である。合成光電変換信号から一方の光電変換部からの光電変換信号を減じることで、他方の光電変換部からの光電変換信号に相当する信号を得ることができる。個々の光電変換部からの光電変換信号は、位相差像信号を生成するために用いられたり、3D画像を構成する視差画像の生成に用いられたりする。合成光電変換信号は、通常の表示用画像データや撮像画像データ、さらにはTVAF用画像データの生成に用いられる。   In the image sensor 122, the photoelectric conversion unit is divided into two in the X direction in all the pixels, and the photoelectric conversion signals from the individual photoelectric conversion units and the two photoelectric conversion signals from the two photoelectric conversion units of the same pixel are used. The combined signal (hereinafter, referred to as a combined photoelectric conversion signal) can be read. By subtracting the photoelectric conversion signal from one photoelectric conversion unit from the combined photoelectric conversion signal, a signal corresponding to the photoelectric conversion signal from the other photoelectric conversion unit can be obtained. The photoelectric conversion signals from the individual photoelectric conversion units are used to generate a phase difference image signal or used to generate a parallax image forming a 3D image. The combined photoelectric conversion signal is used for generating normal display image data and captured image data, and further, TVAF image data.

位相差AFに用いられる対の位相差像信号について説明する。撮像素子122は、図2(A)に示したマイクロレンズ211iと、分割された光電変換部211a,211bとによって撮像光学系の射出瞳を分割する。同一の画素行に配置された所定領域内の複数の画素211の光電変換部211aからの光電変換信号をつなぎ合わせた信号が、対の位相差像信号のうち一方であるA像信号である。また、上記複数の画素211の光電変換部211bからの光電変換信号をつなぎ合わせた信号が、対の位相差像信号のうち他方であるB像信号である。各画素から光電変換部211aからの光電変換信号と合成光電変換信号とが読み出される場合、光電変換部211bからの光電変換信号に相当する信号は、合成光電変換信号から光電変換部211aからの光電変換信号を減じることで取得される。A像およびB像信号は、赤、青および緑のカラーフィルタが設けられた画素からの光電変換信号を加算して生成した疑似的な輝度(Y)信号である。ただし、赤、青、緑の色ごとにA像およびB像信号を生成してもよい。   A pair of phase difference image signals used for the phase difference AF will be described. The imaging element 122 divides the exit pupil of the imaging optical system by the microlens 211i illustrated in FIG. 2A and the divided photoelectric conversion units 211a and 211b. A signal obtained by joining the photoelectric conversion signals from the photoelectric conversion units 211a of the plurality of pixels 211 in a predetermined area arranged in the same pixel row is the A image signal, which is one of the pair of phase difference image signals. A signal obtained by joining the photoelectric conversion signals from the photoelectric conversion units 211b of the plurality of pixels 211 is a B image signal which is the other of the pair of phase difference image signals. When the photoelectric conversion signal from the photoelectric conversion unit 211a and the combined photoelectric conversion signal are read from each pixel, a signal corresponding to the photoelectric conversion signal from the photoelectric conversion unit 211b is obtained by converting the combined photoelectric conversion signal into the photoelectric conversion signal from the photoelectric conversion unit 211a. Obtained by subtracting the transformed signal. The A image signal and the B image signal are pseudo luminance (Y) signals generated by adding photoelectric conversion signals from pixels provided with red, blue, and green color filters. However, an A image signal and a B image signal may be generated for each of red, blue, and green colors.

このように生成されたA像およびB像信号の相対的な像ずれ量を相関演算により算出することで、所定領域でのデフォーカス量を取得することができる。   By calculating the relative image shift amounts of the A image signal and the B image signal thus generated by the correlation operation, the defocus amount in a predetermined area can be obtained.

図2(B)は、撮像素子122の読み出し部の回路構成を示す。水平走査部151と垂直走査部153につながる各画素(光電変換部211a,211b)の境界部には、水平走査ライン152a,152bと垂直走査ライン154a,154bとが設けられている。各光電変換部からの信号は、これら走査ラインを介して読み出される。   FIG. 2B illustrates a circuit configuration of a reading unit of the image sensor 122. A horizontal scanning line 152a, 152b and a vertical scanning line 154a, 154b are provided at a boundary between pixels (photoelectric conversion units 211a, 211b) connected to the horizontal scanning unit 151 and the vertical scanning unit 153. The signal from each photoelectric conversion unit is read out via these scanning lines.

本実施例のカメラ本体120は、撮像素子122からの信号の読み出しモードとして、第1読み出しモードと第2読み出しモードを有する。第1読み出しモードは、全画素読み出しモードであり、高精細静止画を撮像するためのモードである。第1読み出しモードでは撮像素子122の全画素から信号が読み出される。また、第2読み出しモードは、間引き読み出しモードであり、動画記録またはプレビュー画像の表示のみを行うためのモードである。第2読み出しモードに必要な画素数は全画素数よりも少ないため、X方向とY方向に所定比率で間引かれた画素からの光電変換信号のみが読み出される。   The camera body 120 of the present embodiment has a first read mode and a second read mode as a read mode of a signal from the image sensor 122. The first reading mode is an all-pixel reading mode, and is a mode for capturing a high-definition still image. In the first read mode, signals are read from all pixels of the image sensor 122. The second reading mode is a thinning-out reading mode in which only a moving image is recorded or a preview image is displayed. Since the number of pixels required for the second read mode is smaller than the total number of pixels, only the photoelectric conversion signals from the pixels thinned out at a predetermined ratio in the X and Y directions are read.

また、撮像素子122から高速で読み出す必要がある場合にも、第2読み出しモードが用いられる。信号を読み出す画素をX方向に間引く際には、信号を加算してS/N比を改善させ、Y方向に間引く際には間引かれる画素行からの信号を無視する。位相差AFおよびTVAFは、第2読み出しモードで読み出された光電変換信号を用いて行われる。   The second read mode is also used when it is necessary to read data from the image sensor 122 at high speed. When thinning out pixels from which signals are read out in the X direction, signals are added to improve the S / N ratio, and when thinning out pixels in the Y direction, signals from the pixel rows to be thinned out are ignored. The phase difference AF and the TVAF are performed using the photoelectric conversion signal read in the second read mode.

図3(A)は、本実施例における撮像光学系の射出瞳の位置(射出瞳面)と、像高0、すなわち像面の中央近傍に配置された撮像素子122の光電変換部211a,211bとの共役関係を示している。撮像素子122内の光電変換部211a,211bと撮像光学系の射出瞳面は、マイクロレンズ211iによって共役関係とされる。撮像光学系の射出瞳面は、一般に光量調節用の虹彩絞りが配置される面とほぼ一致する。一方、本実施例の撮像光学系は、変倍機能を有するズームレンズであるが、光学タイプによっては変倍を行うと、射出瞳の像面からの距離(射出瞳距離)や大きさが変化する。図3(A)では、撮像光学系の焦点距離が広角端と望遠端の中央にある状態を示している。この状態における射出瞳距離Zepを標準値として、マイクロレンズ211iの形状や像高(X,Y座標)に応じた偏心パラメータが設定される。   FIG. 3A illustrates the position of the exit pupil (exit pupil plane) of the imaging optical system according to the present embodiment, and the image height 0, that is, the photoelectric conversion units 211a and 211b of the imaging element 122 arranged near the center of the image plane. Shows a conjugate relationship with. The photoelectric conversion units 211a and 211b in the imaging element 122 and the exit pupil plane of the imaging optical system are conjugated by the microlens 211i. In general, the exit pupil plane of the imaging optical system substantially coincides with the plane on which the iris diaphragm for adjusting the light amount is arranged. On the other hand, the imaging optical system according to the present embodiment is a zoom lens having a zooming function. However, depending on the optical type, when zooming is performed, the distance (exit pupil distance) and size of the exit pupil from the image plane change. I do. FIG. 3A shows a state where the focal length of the imaging optical system is at the center between the wide-angle end and the telephoto end. With the exit pupil distance Zep in this state as a standard value, an eccentricity parameter corresponding to the shape and image height (X, Y coordinates) of the microlens 211i is set.

図3(A)において、レンズユニット100は、第1レンズ101を保持する鏡筒部材101bと、第3レンズ105と、フォーカスレンズ104を保持する鏡筒部材104bとを含む。また、レンズユニット100は、絞り102の開放時の開口径を規定する開口板102aと、絞り102の絞り込み時の開口径を調節する絞り羽根102bとを含む。なお、撮像光学系を通過する光束に対する制限部材として作用する鏡筒部材101b,104b、開口板102aおよび絞り羽根102bは、像面から観察した場合の光学的な虚像として示している。また、絞り102の近傍における合成開口を撮像光学系の射出瞳と定義し、その像面からの距離を射出瞳距離Zepと定義している。   3A, the lens unit 100 includes a lens barrel member 101b that holds the first lens 101, a third lens 105, and a lens barrel member 104b that holds the focus lens 104. In addition, the lens unit 100 includes an aperture plate 102a that defines an aperture diameter of the aperture 102 when the aperture 102 is open, and an aperture blade 102b that adjusts the aperture diameter of the aperture 102 when the aperture 102 is stopped down. Note that the lens barrel members 101b and 104b, the aperture plate 102a, and the aperture blade 102b that function as a restricting member for a light beam passing through the imaging optical system are shown as optical virtual images when observed from the image plane. The synthetic aperture near the stop 102 is defined as the exit pupil of the imaging optical system, and the distance from the image plane is defined as the exit pupil distance Zep.

画素211は、像面の中央近傍に配置されており、以下、中央画素という。中央画素211は、その最下層から順に、光電変換部211a,211b、配線層211e〜211g、カラーフィルタ211hおよびマイクロレンズ211iを有する。2つの光電変換部211a,211bは、マイクロレンズ211iによって撮像光学系の射出瞳面に投影される。言い換えれば、撮像光学系の射出瞳が、マイクロレンズ211iを介して光電変換部211a,211bの表面に投影される。   The pixel 211 is arranged near the center of the image plane, and is hereinafter referred to as a center pixel. The central pixel 211 includes, in order from the lowest layer, photoelectric conversion units 211a and 211b, wiring layers 211e to 211g, a color filter 211h, and a microlens 211i. The two photoelectric conversion units 211a and 211b are projected on the exit pupil plane of the imaging optical system by the microlenses 211i. In other words, the exit pupil of the imaging optical system is projected on the surfaces of the photoelectric conversion units 211a and 211b via the microlenses 211i.

図3(B)は、撮像光学系の射出瞳面上における光電変換部211a,211bの投影像を示している。射出瞳面上における光電変換部211a,211bの投影像をそれぞれ、EP1a,EP1bとして示している。中央画素211は、2つの光電変換部211a,211bのいずれか一方からの光電変換信号と、両方からの光電変換信号の和(合成光電変換信号)とを出力することができる。合成光電変換出力は、撮像光学系の射出瞳のほぼ全体にわたる投影像EP1a,EP1bの両方の領域を通過した光束を光電変換した信号に相当する。   FIG. 3B shows a projected image of the photoelectric conversion units 211a and 211b on the exit pupil plane of the imaging optical system. Projection images of the photoelectric conversion units 211a and 211b on the exit pupil plane are shown as EP1a and EP1b, respectively. The center pixel 211 can output the photoelectric conversion signal from one of the two photoelectric conversion units 211a and 211b and the sum of the photoelectric conversion signals from both (a combined photoelectric conversion signal). The combined photoelectric conversion output corresponds to a signal obtained by photoelectrically converting a light beam that has passed through both regions of the projected images EP1a and EP1b over substantially the entire exit pupil of the imaging optical system.

図3(A)において、撮像光学系を通過する光束の最外光線をLで示す。光束Lは、絞り102の開口板102aで制限されており、投影像EP1a,EP1bは、撮像光学系でケラレがほぼ発生していない。図3(B)では、図3(A)の光束LをTLで示している。TLで示す円の内部に、光電変換部211a,211bの投影像EP1a,EP1bの大部分が含まれているため、ケラレはほぼ発生していない。光束Lは、絞り102の開口板102aでのみ制限されているため、円TLは開口板102aと言い換えることができる。この際、像面の中央では、投影像EP1a,EP1bのケラレ状態は、図3(A)中に一点鎖線で示す光軸について対称となり、2つの光電変換部211a,211bが受光する光量は互いに等しい。   In FIG. 3A, the outermost ray of the light beam passing through the imaging optical system is indicated by L. The light flux L is restricted by the aperture plate 102a of the stop 102, and the projected images EP1a and EP1b have almost no vignetting in the imaging optical system. In FIG. 3B, the light beam L in FIG. 3A is indicated by TL. Since most of the projected images EP1a and EP1b of the photoelectric conversion units 211a and 211b are included in a circle indicated by TL, vignetting hardly occurs. Since the light beam L is limited only by the aperture plate 102a of the stop 102, the circle TL can be rephrased as the aperture plate 102a. At this time, at the center of the image plane, the vignetting state of the projected images EP1a and EP1b is symmetric with respect to the optical axis indicated by the dashed line in FIG. 3A, and the light amounts received by the two photoelectric conversion units 211a and 211b are mutually different. equal.

位相差AFを行う場合、カメラMPU125は、撮像素子122から上述した2種類の出力(一方の光電変換信号および合成光電変換信号)を読み出すようにセンサ駆動部123を制御する。カメラMPU125は、画像処理部124に対して、撮像領域内に設定された焦点検出領域の情報を与え、該焦点検出領域内に含まれる画素の出力からA像およびB像信号を生成して位相差焦点検出部129に供給するよう命令する。画像処理部124は、この命令に従って、A像およびB像信号を生成して位相差焦点検出部129に出力する。また、画像処理部124は、TVAF焦点検出部130に対してRAW画像データを供給する。   When performing the phase difference AF, the camera MPU 125 controls the sensor driving unit 123 so as to read out the above-described two types of outputs (one photoelectric conversion signal and the combined photoelectric conversion signal) from the image sensor 122. The camera MPU 125 gives the information of the focus detection area set in the imaging area to the image processing unit 124, and generates an A image signal and a B image signal from the output of the pixels included in the focus detection area to generate a position. A command is supplied to the phase difference focus detection unit 129 to supply the phase difference focus detection unit 129. The image processing unit 124 generates an A image signal and a B image signal according to the instruction, and outputs the signals to the phase difference focus detection unit 129. The image processing unit 124 supplies the RAW image data to the TVAF focus detection unit 130.

以上説明したように、撮像素子122は、位相差AFおよびTVAFの両方における焦点検出装置の一部を構成する。なお、本実施例は、射出瞳を水平方向に2分割する(すなわち瞳分割方向が水平方向である)場合について説明したが、一部の画素について射出瞳を垂直方向に2分割してもよい。射出瞳を垂直方向に分割する(すなわち瞳分割方向が垂直方向である)ことにより、水平方向だけでなく垂直方向にコントラストを有する被写体に対する位相差AFが可能となる。また、射出瞳を水平および垂直方向の両方に分割して4分割としてもよい。   As described above, the image sensor 122 constitutes a part of the focus detection device in both the phase difference AF and the TVAF. In the present embodiment, the case where the exit pupil is divided into two in the horizontal direction (that is, the pupil division direction is the horizontal direction) has been described. However, the exit pupil may be divided into two in some of the pixels in the vertical direction. . By dividing the exit pupil in the vertical direction (that is, the pupil division direction is the vertical direction), phase difference AF can be performed on a subject having a contrast not only in the horizontal direction but also in the vertical direction. Further, the exit pupil may be divided into both the horizontal and vertical directions to be divided into four.

次に、図4を用いて、TVAF(コントラストAF)について説明する。TVAFは、カメラMPU125とTVAF焦点検出部130が連携してフォーカスレンズ104の駆動と焦点評価値の算出とを繰り返すことで実現される。前述したように、画像処理部124からRAW画像データがTVAF焦点検出部130に入力される。TVAF焦点検出部130において、AF評価用信号処理部401は、RAW画像データのベイヤー配列信号から緑(G)信号を抽出し、該G信号の低輝度成分を強調して高輝度成分を抑圧するガンマ補正処理を行うことで輝度信号Yを生成する。本実施例では、輝度信号YをG信号を用いて生成する場合について説明するが、赤(R)信号や青(B)信号を用いて輝度信号を生成してもよい。また、R、GおよびB信号を全て用いて輝度信号を生成してもよい。   Next, TVAF (contrast AF) will be described with reference to FIG. TVAF is realized by the camera MPU 125 and the TVAF focus detection unit 130 repeating the driving of the focus lens 104 and the calculation of the focus evaluation value in cooperation with each other. As described above, the RAW image data is input from the image processing unit 124 to the TVAF focus detection unit 130. In the TVAF focus detection unit 130, the AF evaluation signal processing unit 401 extracts a green (G) signal from the Bayer array signal of the RAW image data, and emphasizes a low luminance component of the G signal to suppress a high luminance component. A luminance signal Y is generated by performing a gamma correction process. In this embodiment, the case where the luminance signal Y is generated using the G signal will be described. However, the luminance signal may be generated using the red (R) signal and the blue (B) signal. Alternatively, a luminance signal may be generated using all of the R, G, and B signals.

カメラMPU125は、TVAF焦点検出部130内の領域設定部413に1又は複数の焦点検出領域を設定する。領域設定部413は、設定された焦点検出領域内の信号を選択するゲート信号を生成する。そして、このゲート信号を、ラインピーク検出部402、水平積分部403、ライン最小値検出部404、ラインピーク検出部409、垂直積分部406,410および垂直ピーク検出部405,407,411に入力する。また、領域設定部413は、焦点評価値が焦点検出領域内の輝度信号Yを用いて生成されるように、輝度信号Yが上記各部に入力されるタイミングを制御する。上記ラインピーク検出部402〜垂直ピーク検出部405,407,411は、Yピーク評価値、Y積分評価値、Max−Min評価値、領域ピーク評価値および全ライン積分評価値を算出する。   The camera MPU 125 sets one or a plurality of focus detection areas in the area setting unit 413 in the TVAF focus detection unit 130. The area setting unit 413 generates a gate signal for selecting a signal in the set focus detection area. Then, the gate signal is input to the line peak detection unit 402, the horizontal integration unit 403, the line minimum value detection unit 404, the line peak detection unit 409, the vertical integration units 406 and 410, and the vertical peak detection units 405, 407 and 411. . The area setting unit 413 controls the timing at which the luminance signal Y is input to each of the units so that the focus evaluation value is generated using the luminance signal Y in the focus detection area. The line peak detection unit 402 to the vertical peak detection units 405, 407, and 411 calculate a Y peak evaluation value, a Y integration evaluation value, a Max-Min evaluation value, an area peak evaluation value, and a total line integration evaluation value.

Yピーク評価値の算出方法について説明する。ガンマ補正処理を受けた輝度信号Yは、ラインピーク検出部402に入力される。ラインピーク検出部402は、領域設定部413に設定された焦点検出領域内において水平ラインごとの輝度信号Yのピーク値であるYラインピーク値を求める。垂直ピーク検出部405は、ラインピーク検出部402から出力された水平ラインごとのYラインピーク値を焦点検出領域内で垂直方向にてピークホールドしてYピーク評価値を生成する。Yピーク評価値は、高輝度被写体や低照度被写体の判定に有効な指標である。   A method for calculating the Y peak evaluation value will be described. The luminance signal Y that has been subjected to the gamma correction processing is input to the line peak detection unit 402. The line peak detection unit 402 obtains a Y line peak value which is a peak value of the luminance signal Y for each horizontal line in the focus detection area set by the area setting unit 413. The vertical peak detector 405 generates a Y peak evaluation value by vertically holding the Y line peak value of each horizontal line output from the line peak detector 402 in the focus detection area. The Y peak evaluation value is an effective index for determining a high-luminance subject or a low-illuminance subject.

次に、Y積分評価値の算出方法について説明する。ガンマ補正処理を受けた輝度信号Yは、水平積分部403に入力される。水平積分部403は、焦点検出領域内で水平ラインごとに輝度信号Yの積分値(Y積分値)を求める。垂直積分部406は、水平積分部403から出力される焦点検出領域内のY積分値を垂直方向に積分してY積分評価値を生成する。Y積分評価値は、焦点検出領域全体の明るさを判断する指標として用いられる。   Next, a method of calculating the Y integral evaluation value will be described. The luminance signal Y that has been subjected to the gamma correction processing is input to the horizontal integration section 403. The horizontal integration unit 403 obtains an integrated value (Y integrated value) of the luminance signal Y for each horizontal line in the focus detection area. The vertical integration unit 406 integrates the Y integration value in the focus detection area output from the horizontal integration unit 403 in the vertical direction to generate a Y integration evaluation value. The Y integral evaluation value is used as an index for determining the brightness of the entire focus detection area.

次に、Max−Min評価値の算出方法について説明する。ガンマ補正処理を受けた輝度信号Yは、ラインピーク検出部402に入力される。ラインピーク検出部402は、焦点検出領域内で水平ラインごとのYラインピーク値を求める。また、ガンマ補正処理を受けた輝度信号Yは、ライン最小値検出部404に入力される。ライン最小値検出部404は、焦点検出領域内で水平ラインごとに輝度信号Yの最小値(Y最小値)を検出する。水平ラインごとのYラインピーク値およびY最小値は、減算器(−)に入力される。これにより、水平ラインごとの(ラインピーク値−最小値)が垂直ピーク検出部407に入力される。垂直ピーク検出部407は、焦点検出領域内で水平ラインごとの(ラインピーク値−最小値)を垂直方向でピークホールドしてMax−Min評価値を生成する。Max−Min評価値は、コントラストの高低の判定に有効な指標である。   Next, a method of calculating the Max-Min evaluation value will be described. The luminance signal Y that has been subjected to the gamma correction processing is input to the line peak detection unit 402. The line peak detector 402 calculates a Y line peak value for each horizontal line in the focus detection area. The luminance signal Y that has been subjected to the gamma correction processing is input to the line minimum value detection unit 404. The line minimum value detection unit 404 detects the minimum value (Y minimum value) of the luminance signal Y for each horizontal line in the focus detection area. The Y line peak value and the Y minimum value for each horizontal line are input to a subtractor (-). As a result, (line peak value−minimum value) for each horizontal line is input to the vertical peak detection unit 407. The vertical peak detection unit 407 generates a Max-Min evaluation value by peak-holding (line peak value−minimum value) for each horizontal line in the focus detection area in the vertical direction. The Max-Min evaluation value is an index effective for determining the level of the contrast.

次に、領域ピーク評価値の算出方法について説明する。ガンマ補正処理を受けた輝度信号YがBPF408を通過することによって、特定の周波数成分が抽出され、これにより焦点信号が生成される。この焦点信号は、ラインピーク検出部409に入力される。ラインピーク検出部409は、焦点検出領域内で水平ラインごとの焦点信号のピーク値であるラインピーク値を求める。垂直ピーク検出部411は、焦点検出領域内で水平ラインごとのラインピーク値をピークホールドして領域ピーク評価値を生成する。領域ピーク評価値は、焦点検出領域内で被写体が移動しても変化が少ないので、合焦状態から再度合焦位置を探索する処理に移行するかどうかを判定する再起動判定に有効な指標である。   Next, a method of calculating the area peak evaluation value will be described. When the luminance signal Y that has been subjected to the gamma correction process passes through the BPF 408, a specific frequency component is extracted, thereby generating a focus signal. This focus signal is input to the line peak detection unit 409. The line peak detection unit 409 obtains a line peak value which is a peak value of a focus signal for each horizontal line in the focus detection area. The vertical peak detection unit 411 generates a region peak evaluation value by peak-holding a line peak value for each horizontal line in the focus detection region. The area peak evaluation value is an effective index for restart determination to determine whether or not to shift from the in-focus state to the process of searching for the in-focus position again because the change is small even if the subject moves within the focus detection area. is there.

次に、全ライン積分評価値の算出方法について説明する。領域ピーク評価値と同様に、ラインピーク検出部409は、焦点検出領域内で水平ラインごとのラインピーク値を求める。垂直積分部410は、焦点検出領域内で水平ラインごとのラインピーク値を垂直方向に全水平ラインについて積分して全ライン積分評価値を生成する。全ライン積分評価値は、積分の効果によってダイナミックレンジが広く、感度が高いので、主要な焦点評価値である。以下の説明において、特に断りがない限り、焦点評価値は全ライン積分評価値を意味する。   Next, a method of calculating the integral evaluation value of all lines will be described. Similarly to the area peak evaluation value, the line peak detection unit 409 obtains a line peak value for each horizontal line in the focus detection area. The vertical integrator 410 integrates the line peak value of each horizontal line in the focus detection area for all horizontal lines in the vertical direction to generate an integrated evaluation value of all lines. The integral evaluation value of all lines is a main focus evaluation value because the dynamic range is wide and the sensitivity is high due to the effect of integration. In the following description, unless otherwise specified, the focus evaluation value means an integrated evaluation value of all lines.

カメラMPU125内のAF制御部151は、TVAF焦点検出部130から焦点評価値を取得するとともに、レンズMPU117を通じてフォーカスレンズ104を光軸方向のうち所定方向に所定量だけ移動させる。そして、新たにTVAF焦点検出部130から焦点評価値を取得し、焦点評価値が最大値となるフォーカスレンズ104の位置(TVAF合焦位置)を検出する。   The AF control unit 151 in the camera MPU 125 acquires the focus evaluation value from the TVAF focus detection unit 130, and moves the focus lens 104 by a predetermined amount in the optical axis direction through the lens MPU 117. Then, a focus evaluation value is newly acquired from the TVAF focus detection unit 130, and the position of the focus lens 104 at which the focus evaluation value becomes the maximum value (TVAF in-focus position) is detected.

本実施例では、焦点評価値を水平方向および垂直方向のそれぞれで算出する。これにより、被写体の水平方向および垂直方向でのコントラストを利用してTVAFを行うことができる。   In this embodiment, the focus evaluation value is calculated in each of the horizontal direction and the vertical direction. This makes it possible to perform TVAF using the contrast of the subject in the horizontal and vertical directions.

次に、本実施例におけるAF処理について説明する。本実施例では、まずカメラMPU125が、焦点検出領域において位相差AFもしくはTVAFによる焦点検出を行って現在のフォーカスレンズ104の位置と合焦位置との距離であるデフォーカス量を求める。焦点検出が終わると、カメラMPU125は、該焦点検出の結果としてのデフォーカス量を補正するための焦点検出補正値を算出し、該焦点検出補正値を用いてデフォーカス量を補正する。そして、カメラMPU125は、補正後のデフォーカス量に応じてレンズMPU117を通じてフォーカスレンズ104をより精度が高い合焦位置に移動させるフォーカス制御を行う。   Next, the AF processing in the present embodiment will be described. In the present embodiment, first, the camera MPU 125 performs focus detection by phase difference AF or TVAF in the focus detection area to obtain a defocus amount that is a distance between the current position of the focus lens 104 and the focus position. When the focus detection is completed, the camera MPU 125 calculates a focus detection correction value for correcting the defocus amount as a result of the focus detection, and corrects the defocus amount using the focus detection correction value. Then, the camera MPU 125 performs focus control for moving the focus lens 104 to a more accurate focusing position through the lens MPU 117 in accordance with the corrected defocus amount.

以上のAF処理の詳細を、図5および図6のフローチャートを用いて説明する。図5は、AF処理全体の流れを、図6は図5中のステップS5における焦点検出補正値を算出する処理を示している。主としてカメラMPU125がコンピュータプログラムに従ってAF処理を実行する。   Details of the above AF processing will be described with reference to the flowcharts of FIGS. FIG. 5 shows the flow of the entire AF process, and FIG. 6 shows the process of calculating the focus detection correction value in step S5 in FIG. Mainly, the camera MPU 125 executes the AF processing according to the computer program.

まずステップS1では、カメラMPU125は、図7に示すように撮像画面(撮像素子122)上の主被写体220に対して焦点検出領域219を設定する。なお、ここで設定される焦点検出領域は、撮像画面の中央部等、予め設定された焦点検出領域でもよい。カメラMPU125は、焦点検出領域219を代表する座標(x1,y1)を設定する。代表座標(x1,y1)は、例えば焦点検出領域219の重心位置に設定される。   First, in step S1, the camera MPU 125 sets the focus detection area 219 for the main subject 220 on the imaging screen (imaging element 122) as shown in FIG. Note that the focus detection area set here may be a preset focus detection area such as the center of the imaging screen. The camera MPU 125 sets coordinates (x1, y1) representing the focus detection area 219. The representative coordinates (x1, y1) are set, for example, at the position of the center of gravity of the focus detection area 219.

次にステップS2では、カメラMPU125は、焦点検出に用いる焦点検出信号を取得する。位相差AFを行う場合は、カメラMPU125は、焦点検出領域219内の同一画素行における所定範囲に含まれる複数の画素の出力からA像信号およびB像信号を焦点検出信号として取得する。TVAFを行う場合には、カメラMPU125は、TVAF焦点検出部130から焦点評価値を焦点検出信号として取得する。   Next, in step S2, the camera MPU 125 acquires a focus detection signal used for focus detection. When performing the phase difference AF, the camera MPU 125 acquires the A image signal and the B image signal from the outputs of a plurality of pixels included in a predetermined range in the same pixel row in the focus detection area 219 as focus detection signals. When performing TVAF, the camera MPU 125 acquires a focus evaluation value from the TVAF focus detection unit 130 as a focus detection signal.

次にステップS3では、カメラMPU125は、位相差AFを行う場合はA像およびB像信号の像ずれ量を算出し、該像ずれ量から焦点検出結果としてのデフォーカス量を算出する。また、TVAFを行う場合には、カメラMPU125は、フォーカスレンズ104を移動させて焦点評価値がピークとなる位置(TVAF合焦位置)を検出する。   Next, in step S3, when performing the phase difference AF, the camera MPU 125 calculates an image shift amount of the A image signal and the B image signal, and calculates a defocus amount as a focus detection result from the image shift amount. When performing TVAF, the camera MPU 125 moves the focus lens 104 to detect a position at which the focus evaluation value reaches a peak (TVAF in-focus position).

次にステップS4では、補正値取得手段としてのカメラMPU125は、焦点検出補正値の算出に必要な補正値算出条件を取得する。ここにいう補正値算出条件は、フォーカスレンズ104の位置、ズーム状態を示す第1レンズ101の位置および絞り値等の撮像光学系(レンズ光学系)の状態や、焦点検出領域の位置座標(x1,y1)である。また、補正値算出条件は、コントラスト方向(水平、垂直:以下、単に方向という)、色(R,G,B)および空間周波数を含み、さらに後述する図8(D)に示す方向、色および空間周波数に対する重み付けの大きさ(重み付け係数)も含む。   Next, in step S4, the camera MPU 125 as a correction value acquisition unit acquires a correction value calculation condition necessary for calculating a focus detection correction value. The correction value calculation condition referred to here includes the position of the focus lens 104, the position of the first lens 101 indicating the zoom state, the state of the imaging optical system (lens optical system) such as the aperture value, and the position coordinates (x1) of the focus detection area. , Y1). The correction value calculation condition includes a contrast direction (horizontal, vertical: hereinafter, simply referred to as a direction), a color (R, G, B) and a spatial frequency, and further includes a direction, a color, and a color shown in FIG. It also includes the magnitude (weighting factor) of the weighting for the spatial frequency.

次にステップS5では、カメラMPU125は、焦点検出補正値を以下のように算出する。まずカメラMPU125は、後述する撮像画像の特性(以下、画像特性という)に応じて算出される撮像合焦位置(第1合焦位置)と、焦点検出信号の特性(以下、焦点検出特性という)から算出される焦点検出合焦位置(第2合焦位置)との差分である第1補正値を算出する。また、カメラMPU125は、焦点検出合焦位置と、後述する位相差補正情報に応じて算出される位相差合焦位置(第3合焦位置)との差分である第2補正値を算出する。そして、カメラMPU125は、第1補正値と第2補正値とから焦点検出補正値を算出する。また、ステップS5における焦点検出補正値の算出方法の詳細については後に図6を用いて説明する。   Next, in step S5, the camera MPU 125 calculates a focus detection correction value as follows. First, the camera MPU 125 determines an imaging in-focus position (first in-focus position) calculated in accordance with characteristics of a captured image described below (hereinafter, referred to as image characteristics) and characteristics of a focus detection signal (hereinafter, referred to as focus detection characteristics). A first correction value, which is a difference from the focus detection in-focus position (second in-focus position) calculated from the above, is calculated. Further, the camera MPU 125 calculates a second correction value that is a difference between the focus detection focus position and a phase difference focus position (third focus position) calculated according to phase difference correction information described later. Then, the camera MPU 125 calculates a focus detection correction value from the first correction value and the second correction value. Details of the method of calculating the focus detection correction value in step S5 will be described later with reference to FIG.

次にステップS6では、カメラMPU125は、ステップS5で算出した焦点検出補正値BPを用いて以下の式(1)により焦点検出結果であるデフォーカス量DEF_0を補正し、補正後のデフォーカス量DEFを算出する。   Next, in step S6, the camera MPU 125 corrects the defocus amount DEF_0, which is the focus detection result, by the following equation (1) using the focus detection correction value BP calculated in step S5, and the corrected defocus amount DEF. Is calculated.

DEF=DEF_0+BP (1)
そしてステップS7では、カメラMPU125は、補正後のデフォーカス量DEFに応じた合焦位置にフォーカスレンズ104を駆動する。
DEF = DEF_0 + BP (1)
In step S7, the camera MPU 125 drives the focus lens 104 to a focus position corresponding to the corrected defocus amount DEF.

次にステップS8では、カメラMPU125は合焦状態が得られたか否かを判定し、合焦状態が得られていないと判定した場合はステップS1に戻り、合焦状態が得られたと判定した場合は本AF処理を終了する。   Next, in step S8, the camera MPU 125 determines whether the in-focus state has been obtained. If it is determined that the in-focus state has not been obtained, the process returns to step S1, and it is determined that the in-focus state has been obtained. Ends the AF process.

図6を用いてステップS5における焦点検出補正値の算出方法について説明する。ステップS101〜S104は撮像合焦位置と焦点検出合焦位置との差分としての第1補正値の算出に関する処理(第1工程)であり、ステップS107〜S110は焦点検出合焦位置と位相差合焦位置との差分としての第2補正値の算出に関する処理(第2工程)である。また、ステップ111は、焦点検出補正値を算出する処理(第3工程)である。   The method of calculating the focus detection correction value in step S5 will be described with reference to FIG. Steps S101 to S104 are processing (first step) relating to the calculation of the first correction value as the difference between the imaging focus position and the focus detection focus position, and steps S107 to S110 are the phase correction and the focus detection focus position. This is a process (second step) for calculating a second correction value as a difference from the focal position. Step 111 is a process of calculating a focus detection correction value (third process).

まずステップS101で、カメラMPU125は、第1補正値を取得するための情報としての撮像光学系(主としてレンズ光学系)の収差の状態を示す情報(以下、収差情報という)を、レンズメモリ118から送信手段としてのレンズMPU117を通じて取得する。本実施例での収差情報は、例えば、色、方向および空間周波数ごとの撮像光学系の結像位置に関する情報である。収差情報は、前述した撮像光学系の状態に応じて変化する。   First, in step S101, the camera MPU 125 transmits, from the lens memory 118, information indicating the state of aberration of the imaging optical system (mainly the lens optical system) as information for obtaining the first correction value (hereinafter, referred to as aberration information). It is obtained through the lens MPU 117 as a transmission unit. The aberration information in the present embodiment is, for example, information on the imaging position of the imaging optical system for each color, direction, and spatial frequency. The aberration information changes according to the state of the imaging optical system described above.

図8(A)および(B)を用いてレンズメモリ118に格納された空間周波数ごとの収差情報について説明する。図8(A)は、撮像光学系のデフォーカスMTFを示している。横軸はフォーカスレンズ104の位置を示し、縦軸はMTFの強度を示している。図8(A)中の4つの曲線は空間周波数ごとのデフォーカスMTF曲線であり、MTF1,MTF2,MTF3およびMTF4の順に空間周波数が低い方から高い方に変化した場合のデフォーカスMTFを示している。図8(B)に示す空間周波数F1(lp/mm)のデフォーカスMTF曲線がMTF1であり、同様に空間周波数F2,F3,F4(lp/mm)のデフォーカスMTF曲線がMTF2,MTF3,MTF4である。また、図8(A)中のLP4,LP5,LP6およびLP7は、各デフォーカスMTFが極大値となるフォーカスレンズ104の位置(以下、デフォーカスMTFピーク位置という)を示している。   The aberration information for each spatial frequency stored in the lens memory 118 will be described with reference to FIGS. FIG. 8A shows a defocus MTF of the imaging optical system. The horizontal axis indicates the position of the focus lens 104, and the vertical axis indicates the MTF intensity. The four curves in FIG. 8A are defocus MTF curves for each spatial frequency, and show the defocus MTF when the spatial frequency changes from low to high in the order of MTF1, MTF2, MTF3 and MTF4. I have. The defocus MTF curve of the spatial frequency F1 (lp / mm) shown in FIG. 8B is MTF1, and the defocus MTF curve of the spatial frequencies F2, F3, F4 (lp / mm) is MTF2, MTF3, MTF4. It is. Further, LP4, LP5, LP6, and LP7 in FIG. 8A indicate positions of the focus lens 104 at which each defocus MTF has a maximum value (hereinafter, referred to as a defocus MTF peak position).

図8(B)は本実施例における収差情報を示しており、図8(A)のデフォーカスMTFが極大値となるフォーカスレンズ104の位置MTF_P_RHを示している。収差情報は、3色(R,G,B)と2方向(水平および垂直方向)の6通りの組み合わせのそれぞれについて、空間周波数fと撮像素子122上での焦点検出領域の位置座標(x,y)を変数とした以下の式(2)で表現される。   FIG. 8B shows aberration information in the present embodiment, and shows the position MTF_P_RH of the focus lens 104 at which the defocus MTF in FIG. The aberration information includes the spatial frequency f and the position coordinates (x, x) of the focus detection area on the image sensor 122 for each of the six combinations of three colors (R, G, B) and two directions (horizontal and vertical directions). It is expressed by the following equation (2) using y) as a variable.

MTF_P_RH(f,x,y)
=(rh(0)×x+rh(1)×y+rh(2))×f
+(rh(3)×x+rh(4)×y+rh(5))×f
+(rh(6)×x+rh(7)×y+rh(8)) (2)
rh(n)(0≦n≦8)は、収差情報を示す上記関数式(2)における各項の係数であり、nは係数のインデックスであり、0≦n≦8である。本実施例では、rh(n)はレンズメモリ118に予め記憶されており、カメラMPU125はレンズMPU117に要求してこのrh(n)を取得する。ただし、rh(n)はカメラRAM125bの不揮発性領域に記憶されていてもよい。
MTF_P_RH (f, x, y)
= (Rh (0) × x + rh (1) × y + rh (2)) × f 2
+ (Rh (3) × x + rh (4) × y + rh (5)) × f
+ (Rh (6) × x + rh (7) × y + rh (8)) (2)
rh (n) (0 ≦ n ≦ 8) is a coefficient of each term in the above functional expression (2) indicating aberration information, n is an index of the coefficient, and 0 ≦ n ≦ 8. In the present embodiment, rh (n) is stored in the lens memory 118 in advance, and the camera MPU 125 requests the lens MPU 117 to acquire this rh (n). However, rh (n) may be stored in the non-volatile area of the camera RAM 125b.

なお、式(2)は、R信号について水平(H)方向での空間周波数ごとのデフォーカスMTFピーク位置MTF_P_RHを示しているが、他の色の信号とH方向および垂直(V)方向との組み合わせについても同様の式で表される。   Equation (2) shows the defocus MTF peak position MTF_P_RH for each spatial frequency in the horizontal (H) direction for the R signal, but the signal of another color and the H direction and the vertical (V) direction The combination is also represented by the same equation.

また、第1補正値に含まれる製造誤差を補正するために、rh(n)に対する第1補正値の製造誤差補正情報rhd(n)をレンズメモリ118またはカメラRAM125bの不揮発性領域に記憶しておくことが望ましい。第1補正値の製造誤差補正を行う場合には、カメラMPU125は、レンズメモリ118またはカメラRAM125bの不揮発性領域からrhd(n)を取得し、rh(n)にrhd(n)を加算することにより製造誤差補正を行う。   In addition, in order to correct a manufacturing error included in the first correction value, manufacturing error correction information rhd (n) of the first correction value for rh (n) is stored in the lens memory 118 or the nonvolatile area of the camera RAM 125b. It is desirable to keep. When performing the manufacturing error correction of the first correction value, the camera MPU 125 acquires rhd (n) from the non-volatile area of the lens memory 118 or the camera RAM 125b, and adds rhd (n) to rh (n). To correct the manufacturing error.

RとV(MTF_P_RV)、GとH(MTF_P_GH)、GとV(MTF_P_GV)、BとH(MTF_P_BH)およびBとV(MTF_P_BV)のそれぞれ組み合わせに対する係数(rv,gh,gv,bh,bv)も同様に取得することができる。このように、収差情報を関数化して各項の係数を収差情報として記憶することで、レンズメモリ118やカメラRAM125bに記憶されるデータ量を削減しつつ、撮像光学系の状態に対応した収差情報の記憶が可能になる。   Coefficients (rv, gh, gv, bh, bv) for each combination of R and V (MTF_P_RV), G and H (MTF_P_GH), G and V (MTF_P_GV), B and H (MTF_P_BH), and B and V (MTF_P_BV) Can be obtained similarly. As described above, by converting the aberration information into a function and storing the coefficient of each term as the aberration information, the amount of data stored in the lens memory 118 or the camera RAM 125b is reduced, and the aberration information corresponding to the state of the imaging optical system is reduced. Can be stored.

図8(D)は、図5中のステップS4で取得した補正値算出条件としての方向(H,V)、色(R,G,B)および空間周波数に対する重み付け係数の例を示す。図8(D)に示す重み付け係数は、撮像合焦位置および焦点検出合焦位置の算出に用いられる。   FIG. 8D shows an example of a weighting coefficient for the direction (H, V), color (R, G, B) and spatial frequency as the correction value calculation condition acquired in step S4 in FIG. The weighting coefficients shown in FIG. 8D are used for calculating the imaging focus position and the focus detection focus position.

図6のステップS102およびステップS103では、カメラMPU125は、ステップS4で取得した図8(D)に示す重み付け係数とステップS101で取得した収差情報とから、撮像合焦位置P_IMGおよび焦点検出合焦位置P_AFを算出する。具体的には、まず、式(2)のx,yに焦点検出領域の位置座標(x1,y1)を代入する。この計算により式(2)は、以下の式(3)のような形式で表される。
MTF_P_RH(f)=Arh×f2+Brh×f+Crh (3)
カメラ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ピーク位置を示す。図に示される通り、色収差が大きい場合には色ごとのデフォーカスMTF曲線が乖離し、縦横差が大きい場合にはH方向とV方向のデフォーカスMTF曲線が乖離する。このように、本実施例では、色(R,G,B)と方向(H,V)との組み合わせごとに、空間周波数に対応したデフォーカスMTF曲線の情報(デフォーカスMTF情報)を有する。
In steps S102 and S103 in FIG. 6, the camera MPU 125 determines the imaging focus position P_IMG and the focus detection focus position from the weighting coefficients shown in FIG. 8D obtained in step S4 and the aberration information obtained in step S101. Calculate P_AF. Specifically, first, the position coordinates (x1, y1) of the focus detection area are substituted for x and y in Expression (2). By this calculation, equation (2) is represented in the form of equation (3) below.
MTF_P_RH (f) = Arh × f2 + Brh × f + Chr (3)
The camera MPU 125 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 the aberration information after substituting the position coordinates of the focus detection area in step S1, where the horizontal axis indicates the spatial frequency and the vertical axis indicates the defocus MTF peak position. As shown in the figure, when the chromatic aberration is large, the defocus MTF curve for each color deviates, and when the vertical and horizontal differences are large, the defocus MTF curves in the H direction and the V direction deviate. As described above, in this embodiment, for each combination of the color (R, G, B) and the direction (H, V), there is information (defocus MTF information) of the defocus MTF curve corresponding to the spatial frequency.

次に、カメラMPU125は、ステップS4で取得した重み付け係数(図8(D))を用いて収差情報を重み付けする。これにより、収差情報が、焦点検出および撮像画像において評価される色と方向について重み付けされる。具体的には、カメラMPU125は、焦点検出用の空間周波数特性MTF_P_AF(f)と撮像画像用の空間周波数特性MTF_P_IMG(f)をそれぞれ、式(4)と式(5)を用いて算出する。K_AFは焦点検出用の重み付け係数であり、K_IMGは撮像画像用の重み付け係数である。
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) (4)

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) (5)
図8(C)は、横軸に示す離散的な空間周波数F1〜F4に対して、式(4)に代入して得られるデフォーカスMTFピーク位置LP4_AF,LP5_AF,LP6_AF,LP7_AFを縦軸に示している。
Next, the camera MPU 125 weights the aberration information using the weighting coefficient (FIG. 8D) acquired in step S4. Thereby, the aberration information is weighted with respect to the color and the direction evaluated in the focus detection and the captured image. Specifically, the camera MPU 125 calculates a spatial frequency characteristic MTF_P_AF (f) for focus detection and a spatial frequency characteristic MTF_P_IMG (f) for a captured image using Expressions (4) and (5), respectively. K_AF is a weighting coefficient for focus detection, and K_IMG is a weighting coefficient for a captured image.
MTF_P_AF (f)
= K_AF_R x K_AF_H x 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) (4)

MTF_P_IMG (f)
= K_IMG_R x K_IMG_H x 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) (5)
FIG. 8C shows the defocus MTF peak positions LP4_AF, LP5_AF, LP6_AF, LP7_AF obtained by substituting into the equation (4) for the discrete spatial frequencies F1 to F4 shown on the horizontal axis. ing.

カメラMPU125は、撮像画像の画像特性から算出される撮像合焦位置P_IMGと位相差AFの焦点検出特性から算出される焦点検出合焦位置P_AFを、以下の式(6)と式(7)を用いて算出する。すなわち、式(4)と式(5)で得られた図8(C)に示す空間周波数F1〜F4のそれぞれに対する空間周波数特性(デフォーカスMTFの極大値)MTF_P_AF(f),MTF_P_IMG(f)を、ステップS4で得られた空間周波数ごとの重み付け係数K_IMG_FQ(n),K_AF_FQ(n)を用いて重み付け加算する。   The camera MPU 125 calculates the imaging focus position P_IMG calculated from the image characteristics of the captured image and the focus detection focus position P_AF calculated from the focus detection characteristics of the phase difference AF by using the following Expressions (6) and (7). Calculate using That is, the spatial frequency characteristics (maximum value of the defocus MTF) MTF_P_AF (f) and MTF_P_IMG (f) for each of the spatial frequencies F1 to F4 shown in FIG. 8C obtained by Expressions (4) and (5). Are weighted and added using the weighting coefficients K_IMG_FQ (n) and K_AF_FQ (n) for each spatial frequency obtained in step S4.

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) (6)

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) (7)
ここで、画像特性および焦点検出特性について説明する。画像特性とは、人が撮像画像を観察してその撮像画像を評価するときの該評価に関わる特性を意味する。また、焦点検出特性は、焦点検出、つまりはAF処理の評価に関わる特性を意味する。具体例を以下に示す。
図8(D)に示す方向に対する重み付け係数K_AF_H,K_AF_V,K_IMG_HおよびK_IMG_Vは、瞳分割方向が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で平均化して行うことが一般的であるためである。
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) (6)

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) (7)
Here, the image characteristics and the focus detection characteristics will be described. The image characteristics mean characteristics relating to the evaluation when a person observes a captured image and evaluates the captured image. Further, the focus detection characteristic means a characteristic relating to focus detection, that is, evaluation of AF processing. Specific examples are shown below.
The weighting coefficients K_AF_H, K_AF_V, K_IMG_H, and K_IMG_V for the directions shown in FIG. 8D are, for example, when the pupil division direction is only the H direction,
K_AF_H = 1
K_AF_V = 0
K_IMG_H = 0.5
K_IMG_V = 0.5
Is set. This is because the evaluation of the focus position obtained by the AF process is greatly affected by aberrations in the H direction, while the evaluation of the focus position when a person observes a captured image is based on aberrations in the H direction and the V direction. Is generally averaged at a ratio of 1: 1.

色に対する重み付け係数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
と設定される。これは焦点検出時にはカラーフィルタがベイヤー配列で配置された撮像素子122から取得した信号に基づいて合焦位置が評価されるが、撮像画像では所望のホワイトバランス係数に応じて重み付けされた各色の色収差の影響で合焦位置が変化するためである。
The weighting coefficients K_AF_R, K_AF_G, K_AF_B, K_IMG_R, K_IMG_G, and K_IMG_B for the color are, 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
Is set. This is because the focus position is evaluated based on the signal obtained from the image sensor 122 in which the color filters are arranged in the Bayer array at the time of focus detection, but the chromatic aberration of each color weighted according to a desired white balance coefficient is obtained in the captured image. This is because the in-focus position changes under the influence of.

空間周波数に対する重み付け係数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
と設定される。これは、一般に焦点検出時には合焦位置を空間周波数の低い帯域で評価し撮像画像については合焦位置を空間周波数が高い帯域で評価しているためである。
The weighting coefficients K_AF_fq (1) to K_AF_fq (4) and K_IMG_fq (1) to K_IMG_fq (4) for the spatial frequency are, 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
Is set. This is because, in general, at the time of focus detection, the focus position is evaluated in a low spatial frequency band, and the focus position is evaluated in a captured image in a high spatial frequency band.

図6のステップS104では、カメラMPU125は、焦点検出補正値BPにおいて被写体の色、方向および空間周波数に依存する成分である第1補正値BP1を、以下の式(8)により算出する。   In step S104 of FIG. 6, the camera MPU 125 calculates a first correction value BP1, which is a component that depends on the color, direction, and spatial frequency of the subject in the focus detection correction value BP, using the following equation (8).

BP1=P_AF−P_IMG (8)
本実施例では、焦点検出領域の位置や色および方向に関する処理を、空間周波数に関する処理よりも先行して実行する。これは、ユーザが焦点検出領域の位置を任意に設定する場合は、その焦点検出領域の位置や色および方向を変更する頻度が低いためである。一方、空間周波数については、撮像素子の読み出しモードや焦点評価値を得るためのデジタルフィルタの選択等により変更される頻度が高い。例えば、信号のS/Nが低下する低照度環境では、デジタルフィルタの通過周波数域をより低周波数域に変更することが考えられる。本実施例では、変更の頻度が低い係数(位置や色および方向)を算出および記憶した後に、変更の頻度の高い係数(空間周波数域)を必要に応じて計算して、第1補正値を算出する。これにより、ユーザが焦点検出領域の位置を任意に設定する場合等に演算量を低減することができる。
BP1 = P_AF-P_IMG (8)
In the present embodiment, processing relating to the position, color, and direction of the focus detection area is performed prior to processing relating to the spatial frequency. This is because when the user arbitrarily sets the position of the focus detection area, the frequency of changing the position, color, and direction of the focus detection area is low. On the other hand, the spatial frequency is frequently changed by the reading mode of the image sensor, selection of a digital filter for obtaining a focus evaluation value, and the like. For example, in a low illuminance environment where the signal S / N is reduced, it is conceivable to change the pass frequency range of the digital filter to a lower frequency range. In this embodiment, after calculating and storing a coefficient (position, color, and direction) having a low change frequency, a coefficient (spatial frequency range) having a high change frequency is calculated as necessary, and the first correction value is calculated. calculate. Thus, the amount of calculation can be reduced when the user arbitrarily sets the position of the focus detection area.

次にステップS105では、第1補正値の製造誤差補正情報を撮像光学系の状態(ステート)ごとに保持し、焦点検出条件としての補正値算出条件に応じた製造誤差補正情報を取得する。そして、第1補正値に対する製造誤差補正を行う。なお、第1補正値の製造誤差補正情報を特定のステートでのみ保持し、保持していないステートに関しては、第1補正値のステート間での変化率から算出してもよい。   Next, in step S105, manufacturing error correction information of the first correction value is held for each state of the imaging optical system, and manufacturing error correction information corresponding to a correction value calculation condition as a focus detection condition is acquired. Then, the manufacturing error is corrected for the first correction value. Note that 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か否かを判定し、位相差AFである場合はステップS107に進む。一方、位相差AFでない場合、すなわち焦点検出合焦位置P_AFと位相差AFにより得られる位相差合焦位置P_AF2との差分である第2補正値BP2が得られない場合は、カメラMPU125はステップS112にて第2補正値を0(BP2=0)としてステップS111に進む。このように焦点検出方式を判定して焦点検出補正値を算出することで、焦点検出方式に応じてデフォーカス量を高精度に補正することができる。   Next, in step S106, the camera MPU 125 determines whether or not the focus detection method that has performed focus detection in step S3 is phase difference AF. If the focus detection method is phase difference AF, the process proceeds to step S107. On the other hand, if it is not the phase difference AF, that is, if the second correction value BP2 that is the difference between the focus detection focus position P_AF and the phase difference focus position P_AF2 obtained by the phase difference AF cannot be obtained, the camera MPU 125 proceeds to step S112. Then, the second correction value is set to 0 (BP2 = 0), and the process proceeds to step S111. By determining the focus detection method and calculating the focus detection correction value in this manner, the defocus amount can be corrected with high accuracy according to the focus detection method.

ステップS107では、カメラMPU125は、補正値算出条件を判定する。すなわち、カメラMPU125は、焦点検出合焦位置P_AFと位相差合焦位置P_AF2との差が所定値より小さいか否かを判定し、小さい場合はステップS112にて第2補正値を0(BP2=0)としてステップS111に進む。一方、カメラMPU125は、焦点検出合焦位置P_AFと位相差合焦位置P_AF2との差が所定値より小さくない場合はステップS108に進む。   In step S107, the camera MPU 125 determines a correction value calculation condition. That is, the camera MPU 125 determines whether or not the difference between the focus detection focus position P_AF and the phase difference focus position P_AF2 is smaller than a predetermined value. If the difference is smaller, the camera MPU 125 sets the second correction value to 0 (BP2 = 0) and proceeds to step S111. On the other hand, if the difference between the focus detection focus position P_AF and the phase difference focus position P_AF2 is not smaller than the predetermined value, the camera MPU 125 proceeds to step S108.

ここで、焦点検出合焦位置P_AFと位相差合焦位置P_AF2との差が小さくなる条件について説明する。位相差AFでは、デフォーカスによる対の線像強度分布の重心ずれ量を像ずれ量として検出し、該像ずれ量からデフォーカス量、さらには位相差合焦位置を算出する。   Here, the conditions under which the difference between the focus detection focus position P_AF and the phase difference focus position P_AF2 becomes small will be described. In the phase difference AF, an amount of shift of the center of gravity of a pair of line image intensity distributions due to defocus is detected as an amount of image shift, and a defocus amount and a phase difference in-focus position are calculated from the amount of image shift.

図9を用いて、デフォーカスによる線像強度分布の重心ずれ量について説明する。図9は、上記重心ずれ量と相関演算の結果である線像強度分布の位置ずれ量のうち少なくとも一方に誤差を与える収差(例えばコマ収差)および絞り102等による光束のケラレがない状態を示している。図9に示す状態では、焦点検出合焦位置P_AFと位相差合焦位置P_AF2との間に差分は生じない。   The center-of-gravity shift amount of the line image intensity distribution due to defocus will be described with reference to FIG. FIG. 9 shows a state in which there is no aberration (for example, coma aberration) that gives an error to at least one of the above-described center-of-gravity deviation amount and the positional deviation amount of the line image intensity distribution that is the result of the correlation operation, and there is no vignetting of the light beam due to the diaphragm 102 or the like. ing. In the state shown in FIG. 9, no difference occurs between the focus detection focus position P_AF and the phase difference focus position P_AF2.

デフォーカス位置1201_P,1202_Pは互いに異なる位置を示す。対の線像強度分布1201_A,1201_Bは、デフォーカス位置1201_Pにおいて分割された光電変換部(211a,211b)に対応する対の線像強度分布を示す。対の線像強度分布1202_A,1202_Bは、デフォーカス位置1202_Pにおいて分割された光電変換部(211a,211b)に対応する対の線像強度分布を示す。   The defocus positions 1201_P and 1202_P indicate different positions. A pair of line image intensity distributions 1201_A and 1201_B indicate a pair of line image intensity distributions corresponding to the photoelectric conversion units (211a and 211b) divided at the defocus position 1201_P. A pair of line image intensity distributions 1202_A and 1202_B indicate a pair of line image intensity distributions corresponding to the photoelectric conversion units (211a and 211b) divided at the defocus position 1202_P.

また、重心位置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 center of gravity positions 1201_GA and 1201_GB indicate the center of gravity of the pair of line image intensity distributions 1201_A and 1201_B. The centroid positions 1202_GA and 1202_GB indicate the centroid positions of the paired line image intensity distributions 1202_A and 1202_B. Further, the center-of-gravity shift amount 1201_difG indicates a difference between the center-of-gravity positions 1201_GA and 1201_GB, and the center-of-gravity shift amount 1202_difG indicates a difference between the center of gravity positions 1202_GA and 1202_GB. Further, as shown in FIG. 9, when there is no aberration or vignetting due to the stop 102 or the like, the center-of-gravity shift amounts 1201_difG and 1202_difG increase in proportion to the defocus amount. The phase difference AF calculates the defocus amount by acquiring the center-of-gravity deviation amount.

次に、撮像光学系の収差や絞り102等によるケラレが大きい場合について説明する。図10(A)は、撮像光学系の収差や絞り102等によるケラレが大きい場合の対の線像強度分布を示す。光電変換部211aに対応する線像強度分布1301_Aを破線で示し、光電変換部211bに対応する線像強度分布1301_Bを実線で示す。また、一点鎖線G_Aは線像強度分布1301_Aの重心位置を、一点鎖線G_Bが線像強度分布1301_Bの重心位置を示す。   Next, a case where the aberration of the imaging optical system and the vignetting due to the stop 102 and the like are large will be described. FIG. 10A shows a pair of line image intensity distributions in a case where aberrations of the imaging optical system and vignetting due to the stop 102 and the like are large. A line image intensity distribution 1301_A corresponding to the photoelectric conversion unit 211a is indicated by a broken line, and a line image intensity distribution 1301_B corresponding to the photoelectric conversion unit 211b is indicated by a solid line. The dashed line G_A indicates the position of the center of gravity of the line image intensity distribution 1301_A, and the dashed line G_B indicates the position of the center of gravity of the line image intensity distribution 1301_B.

図10(A)に示すように、線像強度分布1301_A,1301_Bは、収差の影響を受けて各線像強度分布が片側に延びるような非対称形状となっている。このような非対称形状の線像強度分布では、その重心位置が線像強度分布が延びる側に重心ずれが生じる。   As shown in FIG. 10A, the line image intensity distributions 1301_A and 1301_B have an asymmetric shape such that each line image intensity distribution extends to one side under the influence of aberration. In such an asymmetric line image intensity distribution, the barycentric position is shifted on the side where the line image intensity distribution extends.

また、線像強度分布1301_A,1301_Bは、絞り102等によるケラレの影響を受けて光量差が生じる。よりケラレの影響が大きい線像強度分布1301_Aの方が収差の影響も大きく受けて、その非対称度合いが大きくなる。このように非対称度合いが線像強度分布1301_Aと線像強度分布1301_B間で異なることで、それぞれの重心位置G_A,G_Bのずれ量が異なり、重心ずれ量の差が生じる。   In addition, the line image intensity distributions 1301_A and 1301_B are affected by vignetting due to the aperture 102 and the like, and a light amount difference occurs. The line image intensity distribution 1301_A, which is more affected by vignetting, is also more affected by aberration, and the degree of asymmetry is greater. As described above, the degree of asymmetry is different between the line image intensity distribution 1301_A and the line image intensity distribution 1301_B, so that the shift amounts of the respective gravity centers G_A and G_B are different, and a difference in the center of gravity shift occurs.

図10(B)に示す線像強度分布1301_IMGは、線像強度分布1301_A,1301_Bを足し合わせた線像強度分布であり、光電変換部211a,211bからの光電変換信号の和(合成光電変換信号)に対応した線像強度分布である。   A line image intensity distribution 1301_IMG illustrated in FIG. 10B is a line image intensity distribution obtained by adding the line image intensity distributions 1301_A and 1301_B, and is the sum of the photoelectric conversion signals from the photoelectric conversion units 211a and 211b (the combined photoelectric conversion signal). 7) is a line image intensity distribution corresponding to ()).

図10(C)に示す1302_A、1302_Bおよび図10(D)に示す1302_IMGは、1301_A、1301_Bおよび1301_IMGの状態とはデフォーカス位置が異なり、破線で示す1302_Aの線像強度分と、実線で示す1301_Bの線像強度分の重心位置が一致した状態を表している。1302_IMGは、1301_IMGと同様に、1302_Aおよび1302_Bを足し合わせた線像強度分布を表している。   1302_A and 1302_B illustrated in FIG. 10C and 1302_IMG illustrated in FIG. 10D have different defocus positions from the states of 1301_A, 1301_B and 1301_IMG, and are indicated by a solid line and a line image intensity of 1302_A indicated by a broken line. This shows a state in which the barycenter positions for the line image intensity of 1301_B match. 1302_IMG, like 1301_IMG, represents a line image intensity distribution obtained by adding 1302_A and 1302_B.

線像強度分布1301_IMGと1302_IMGを比較すると、互いに重心位置が異なる線像強度分布1301_Aと1301_Bの和である線像強度分布1301_IMGの方が、互いに重心位置が一致した線像強度分布1302_A,1302_Bの和である線像強度分布1302_IMGより分布形状がシャープである。   Comparing the line image intensity distributions 1301_IMG and 1302_IMG, the line image intensity distribution 1301_IMG, which is the sum of the line image intensity distributions 1301_A and 1301_B having different barycentric positions, is better than the line image intensity distributions 1302_A and 1302_B whose barycentric positions match each other. The distribution shape is sharper than the line image intensity distribution 1302_IMG which is the sum.

撮像画像の信号に対応する線像強度分布1301_IMG,1302_IMGの形状が最もシャープである位置が、合焦位置を意味する。このため、線像強度分布1301_A,1301_Bのように重心位置が互いに異なる状態が合焦状態であり、線像強度分布1302_A,1302_Bのように重心位置が一致した状態は非合焦(デフォーカス)状態である。つまり、対の線像強度分布間で非対称度合いが異なり、重心ずれ量差が生じている場合には、重心位置が一致する位置が合焦位置とはならず、重心位置が異なる位置が合焦位置となる。   The position where the shape of the line image intensity distributions 1301_IMG and 1302_IMG corresponding to the signal of the captured image is the sharpest means the in-focus position. For this reason, a state where the barycentric positions are different from each other as in the line image intensity distributions 1301_A and 1301_B is a focus state, and a state where the barycenter positions match as in the line image intensity distributions 1302_A and 1302_B is out of focus (defocus). State. In other words, when the degree of asymmetry is different between the paired line image intensity distributions and a difference in the center of gravity is generated, the position where the center of gravity coincides is not the in-focus position, and the position where the center of gravity is different is the in-focus position. Position.

以上説明したように、線像強度分布1301_A,1301_Bのような撮像光学系の収差や絞り102等によるケラレが大きい場合は、デフォーカスによる重心ずれ量に加えて、線像強度分布の非対称度合いに起因した重心ずれ量差が生じる。これにより、位相差AFは、本来は合焦状態を検出するべきデフォーカス位置で非合焦状態を検出してしまう。   As described above, when the aberration of the imaging optical system such as the line image intensity distributions 1301_A and 1301_B and the vignetting due to the diaphragm 102 are large, the degree of asymmetry of the line image intensity distribution is determined in addition to the amount of the center of gravity shift due to defocus. This causes a difference in the amount of displacement of the center of gravity. As a result, the phase difference AF detects an out-of-focus state at a defocus position where the in-focus state should be detected.

また、位相差AFによりデフォーカス量を検出する際に用いられる相関演算においては、線像強度分布1301_A,1301_Bのように形状差がある場合には検出誤差が生じる。形状差がない場合には、対の線像強度分布が完全に重なり合うところで信号の一致度を表す相関量が0となる。しかしながら、形状差がある線像強度分布1301_A,1301_Bには完全に重なるところがないために、相関量が0とはならず、互いに少しずれたところで相関量が極小値となる。このように、対の線像強度分布間に形状差がある場合には検出誤差が生じる。   Further, in the correlation calculation used when detecting the defocus amount by the phase difference AF, a detection error occurs when there is a shape difference like the line image intensity distributions 1301_A and 1301_B. If there is no shape difference, the correlation amount indicating the degree of coincidence of the signal becomes 0 when the paired line image intensity distributions completely overlap. However, since the line image intensity distributions 1301_A and 1301_B having a shape difference do not completely overlap each other, the correlation amount does not become 0, and the correlation amount becomes a minimum value when it is slightly shifted from each other. Thus, when there is a shape difference between the paired line image intensity distributions, a detection error occurs.

以上のことから、焦点検出合焦位置P_AFと位相差合焦位置P_AF2との差が小さくなる条件は、撮像光学系の収差や絞り102等によるケラレが小さい場合となる。また、焦点検出領域の位置座標(x1,y1)が中央像高付近の場合には、撮像光学系の収差が小さく、絞り102等によるケラレが小さいことが一般的である。このため、焦点検出領域の位置座標(x1,y1)が中央像高付近であることも、焦点検出合焦位置P_AFと位相差合焦位置P_AF2の差が小さくなる条件である。   From the above, the condition that the difference between the focus detection focus position P_AF and the phase difference focus position P_AF2 is small is when aberration of the imaging optical system and vignetting due to the diaphragm 102 and the like are small. Further, when the position coordinates (x1, y1) of the focus detection area are near the center image height, it is common that the aberration of the imaging optical system is small and the vignetting due to the aperture 102 and the like is small. Therefore, the fact that the position coordinates (x1, y1) of the focus detection area is near the center image height is also a condition for reducing the difference between the focus detection focus position P_AF and the phase difference focus position P_AF2.

図6のステップS108では、カメラMPU125は、撮像素子122の入射角度ごとの受光感度である受光感度分布を変化させる撮像素子122の条件、言い換えれば撮像素子の受光感度分布に関する条件(以下、受光感度条件という)を示す受光感度条件情報zをEEPROM125cから取得する。受光感度条件情報zは、撮像素子122の画素サイズ、撮像素子122から撮像素子122の入射瞳までの距離である瞳距離および瞳ずれ量を含む。瞳ずれ量は、図11(E)中のdxに示すように、カメラの組立てばらつきや撮像素子の製造ばらつきの影響による瞳の重心位置のずれ量である。瞳ずれ量は、カメラ個体ごとに異なる。そして、これら画素サイズ、瞳距離および瞳ずれ量が異なると、レンズ枠や絞り等によってケラレることなく光が通過する領域である光線通過領域の受光感度分布が異なる。線像強度分布の形状は光線通過領域の受光感度分布に依存するため、受光感度分布が異なると、焦点検出合焦位置P_AFと位相差焦点検出合焦位置P_AF2との差も異なる。   In step S108 in FIG. 6, the camera MPU 125 changes the condition of the image sensor 122 that changes the light sensitivity distribution, which is the light sensitivity at each incident angle of the image sensor 122, in other words, the condition regarding the light sensitivity distribution of the image sensor (hereinafter, the light sensitivity). ) Is acquired from the EEPROM 125c. The light receiving sensitivity condition information z includes a pixel size of the image sensor 122, a pupil distance that is a distance from the image sensor 122 to an entrance pupil of the image sensor 122, and a pupil shift amount. As shown by dx in FIG. 11E, the pupil shift amount is a shift amount of the center of gravity of the pupil due to a variation in assembling the camera and a variation in manufacturing the imaging device. The pupil shift amount differs for each camera individual. If the pixel size, the pupil distance, and the pupil shift amount are different, the light receiving sensitivity distribution in the light beam passing area, which is an area through which light passes without vignetting due to a lens frame or a diaphragm, is different. Since the shape of the line image intensity distribution depends on the light receiving sensitivity distribution in the light beam passage area, if the light receiving sensitivity distribution differs, the difference between the focus detection focus position P_AF and the phase difference focus detection focus position P_AF2 also differs.

図11(A)〜(E)を用いて、撮像素子122の画素サイズ、瞳距離および瞳ずれ量に応じて光線通過領域の受光感度分布が異なることを説明する。図11(A)に示す受光感度分布における画素サイズ、瞳距離および瞳ずれ量を基準とする。この基準に対して、図11(B)は画素サイズが異なる受光感度分布を、図11(C)が製造誤差により瞳距離が異なる受光感度分布を、図11(D)は設計瞳距離が異なる受光感度分布を、図11(E)は瞳ずれ量が異なる受光感度分布をそれぞれ示す。   With reference to FIGS. 11A to 11E, a description will be given of how the light receiving sensitivity distribution in the light beam passage area differs depending on the pixel size, pupil distance, and pupil shift amount of the image sensor 122. FIG. The pixel size, pupil distance, and pupil shift amount in the light reception sensitivity distribution shown in FIG. With respect to this criterion, FIG. 11B shows a light receiving sensitivity distribution with different pixel sizes, FIG. 11C shows a light receiving sensitivity distribution with different pupil distances due to manufacturing errors, and FIG. 11D shows a different design pupil distance. FIG. 11E shows light receiving sensitivity distributions having different pupil shift amounts.

図中のDlは撮像光学系の射出瞳距離を示し、Ds,Ds’は撮像素子122の瞳距離を示す。dxは撮像素子122の瞳ずれ量を示しており、図11(A)〜(E)の瞳ずれ量は0である。また、光線通過領域を符号1101〜1105で示す。   Dl in the figure indicates the exit pupil distance of the imaging optical system, and Ds and Ds' indicate the pupil distance of the image sensor 122. dx indicates the pupil shift amount of the image sensor 122, and the pupil shift amount in FIGS. 11A to 11E is zero. Further, the light passage areas are indicated by reference numerals 1101 to 1105.

図11(B)に示す画素サイズが図11(A)と異なる場合には、光線通過領域1102は図11(A)における光線通過領域1101と同じであるが、受光感度分布の形状が図11(A)と異なるため、光線通過領域1102の受光感度分布が異なる。   When the pixel size shown in FIG. 11B is different from that in FIG. 11A, the light ray passing area 1102 is the same as the light ray passing area 1101 in FIG. Since it is different from (A), the light receiving sensitivity distribution of the light beam passage area 1102 is different.

図11(C)に示すように製造誤差により瞳距離が図11(A)と異なる場合には、受光感度分布の形状は同じであるが、瞳距離Ds’が図11(A)における瞳距離Dsと異なることにより、光線通過領域1103は図11(A)における光線通過領域1101と異なる。これにより、光線通過領域1103の受光感度分布が図11(A)と異なる。   When the pupil distance is different from that in FIG. 11A due to a manufacturing error as shown in FIG. 11C, the shape of the light receiving sensitivity distribution is the same, but the pupil distance Ds ′ is the pupil distance in FIG. Due to the difference from Ds, the light passage area 1103 is different from the light passage area 1101 in FIG. Thus, the light-receiving sensitivity distribution in the light-passing region 1103 differs from that in FIG.

図11(D)に示すように設計瞳距離が図11(A)と異なる場合には、受光感度分布は、瞳距離の比Ds’/Dsだけスケール変換された形状となる。さらに、瞳距離Ds’がDsと異なることにより、光線通過領域1104は図11(A)における光線通過領域1101と異なる。このように受光感度分布の形状と光線通過領域の双方が異なることで、光線通過領域1104の受光感度分布が図11(A)と異なる。   When the design pupil distance is different from that in FIG. 11A as shown in FIG. 11D, the light receiving sensitivity distribution has a shape obtained by scale conversion by the pupil distance ratio Ds' / Ds. Further, since the pupil distance Ds' is different from Ds, the light ray passing area 1104 is different from the light ray passing area 1101 in FIG. Since the shape of the light reception sensitivity distribution and the light passage area are different from each other, the light reception sensitivity distribution of the light passage area 1104 is different from that in FIG.

図11(E)に示すように瞳ずれ量が図11(A)と異なる場合には、瞳距離Dsは同じであるため、光線通過領域1105は図11(A)の光線通過領域1101と同じである。しかし、瞳ずれ量dxが図11(A)における0と異なることにより、受光感度分布の形状は同じでも、受光感度分布の重心位置が図11(A)に対してdxだけずれる。このように受光感度分布の重心位置が異なることで、光線通過領域1105の受光感度分布が図11(A)と異なる。   When the pupil shift amount is different from that in FIG. 11A as shown in FIG. 11E, the pupil distance Ds is the same, so that the ray passage area 1105 is the same as the ray passage area 1101 in FIG. It is. However, since the pupil shift amount dx is different from 0 in FIG. 11A, the barycentric position of the light-receiving sensitivity distribution is shifted by dx from FIG. 11A even though the shape of the light-receiving sensitivity distribution is the same. Since the barycentric position of the light-receiving sensitivity distribution is different as described above, the light-receiving sensitivity distribution in the light beam passage area 1105 is different from FIG.

次に、受光感度条件が異なると、焦点検出合焦位置P_AFと位相差合焦位置P_AF2との差分である第2補正値も異なることを、図12を用いて説明する。図12は、受光感度条件と第2補正値との関係を示しており、横軸は受光感度条件(情報z)を、縦軸は第2補正値を示している。この図から、受光感度条件の変化に伴って第2補正値も変化することが分かる。   Next, it will be described with reference to FIG. 12 that when the light receiving sensitivity conditions are different, the second correction value, which is the difference between the focus detection focus position P_AF and the phase difference focus position P_AF2, is different. FIG. 12 shows the relationship between the light receiving sensitivity condition and the second correction value. The horizontal axis shows the light receiving sensitivity condition (information z), and the vertical axis shows the second correction value. From this figure, it can be seen that the second correction value also changes with the change in the light receiving sensitivity condition.

図12では撮像素子122の画素サイズ、瞳距離および瞳ずれ量を総称して受光感度条件としているが、画素サイズ、瞳距離および瞳ずれ量のそれぞれの変化に伴って第2補正値は変化する。   In FIG. 12, the pixel size, the pupil distance, and the pupil shift amount of the image sensor 122 are collectively used as the light receiving sensitivity condition. However, the second correction value changes with each change in the pixel size, the pupil distance, and the pupil shift amount. .

このように、受光感度条件が異なると、光線通過領域の受光感度分布が変化し、焦点検出合焦位置P_AFと位相差合焦位置P_AF2との差分である第2補正値も異なる。このため、受光感度条件に対応する第2補正値を算出するために、ステップS108ではカメラMPU125は受光感度条件情報zを取得する。   As described above, when the light receiving sensitivity conditions are different, the light receiving sensitivity distribution in the light beam passage area changes, and the second correction value that is the difference between the focus detection focus position P_AF and the phase difference focus position P_AF2 also differs. Therefore, in order to calculate the second correction value corresponding to the light receiving sensitivity condition, in step S108, the camera MPU 125 acquires the light receiving sensitivity condition information z.

またレンズメモリ118は、焦点検出合焦位置P_AFと位相差合焦位置P_AF2との差分である第2補正値を焦点検出領域の位置座標(x,y)を変数とする関数で表す際の該関数の係数(以下、第2補正値係数という)を、フォーカスレンズ104の位置、第1レンズ101の位置(ズーム状態)および絞り値と受光感度条件ごとに記憶している。ここにいう関数と第2補正値係数については後述する。ステップS108では、レンズMPU117は、受光感度条情報zをEEPROM125cからカメラMPU125を通じて取得する。   Further, the lens memory 118 stores the second correction value, which is the difference between the focus detection in-focus position P_AF and the phase difference in-focus position P_AF2, using a function using the position coordinates (x, y) of the focus detection area as a variable. Function coefficients (hereinafter, referred to as second correction value coefficients) are stored for each of the position of the focus lens 104, the position of the first lens 101 (zoom state), the aperture value, and the light receiving sensitivity condition. The function and the second correction value coefficient will be described later. In step S108, the lens MPU 117 acquires the light receiving sensitivity line information z from the EEPROM 125c through the camera MPU 125.

次にステップS109では、カメラMPU125は、第2補正値を取得するために用いられる情報としての位相差補正情報を取得する。位相差補正情報は、位相差AFにより得られる位相差合焦位置に関する情報である。具体的には、位相差補正情報は、図5のステップS4で取得したフォーカスレンズ104の位置、第1レンズ101の位置(ズーム状態)および絞り値と図6のステップS108で取得した受光感度条情報zとに応じた第2補正値係数である。このようにレンズメモリ118に受光感度条件ごとの第2補正値係数を記憶しておくことで、レンズユニット100が互いに受光感度条件が異なる様々なカメラ本体に装着された場合でも、高精度に第2補正値を算出することが可能となる。   Next, in step S109, the camera MPU 125 obtains phase difference correction information as information used for obtaining a second correction value. The phase difference correction information is information on the phase difference in-focus position obtained by the phase difference AF. Specifically, the phase difference correction information includes the position of the focus lens 104, the position (zoom state) and the aperture value of the first lens 101 obtained in step S4 of FIG. 5, and the light receiving sensitivity obtained in step S108 of FIG. This is a second correction value coefficient corresponding to the information z. By storing the second correction value coefficient for each light receiving sensitivity condition in the lens memory 118 in this way, even when the lens unit 100 is mounted on various camera bodies having different light receiving sensitivity conditions from each other, the second correction value coefficient can be accurately corrected. Two correction values can be calculated.

なお、レンズメモリ118に、それぞれ離散的なフォーカスレンズ104の位置、第1レンズ101の位置、絞り値、受光感度条件(画素サイズ、瞳距離および瞳ずれ量)および焦点検出領域の位置座標(x,y)ごとの第2補正値係数を記憶させておいてもよい。この場合、カメラMPU125は、レンズメモリ118に記憶された複数の第2補正値係数からの補間によって取得すべき第2補正値係数を算出すればよい。例えば、図12に示すように受光感度条件(情報z)に対して第2補正値が線形に変化する場合には、離散的に記憶された第2補正値係数の線形補間を行うことで、そのときの受光感度条件に対応する第2補正値係数を算出することができる。   In the lens memory 118, the discrete position of the focus lens 104, the position of the first lens 101, the aperture value, the light receiving sensitivity condition (pixel size, pupil distance and pupil shift amount), and the position coordinates (x , Y) may be stored in advance. In this case, the camera MPU 125 may calculate a second correction value coefficient to be obtained by interpolation from a plurality of second correction value coefficients stored in the lens memory 118. For example, as shown in FIG. 12, when the second correction value changes linearly with respect to the light receiving sensitivity condition (information z), linear interpolation of the second correction value coefficient discretely stored is performed. A second correction value coefficient corresponding to the light receiving sensitivity condition at that time can be calculated.

また本実施例では、それぞれ複数の受光感度条件である画素サイズ、瞳距離および瞳ずれ量に対応する第2補正値係数をレンズメモリ118に記憶させる場合について説明している。しかし、画素サイズ、瞳距離および瞳ずれ量の代表値に対応する第2補正値係数のみをレンズメモリ118に記憶させ、実際の受光感度条件によらず、記憶された第2補正値係数を受光感度条件に対応する第2補正値係数として用いてもよい。   In this embodiment, a case is described in which the lens memory 118 stores second correction value coefficients corresponding to a plurality of light receiving sensitivity conditions, such as a pixel size, a pupil distance, and a pupil shift amount. However, only the second correction value coefficient corresponding to the representative value of the pixel size, the pupil distance, and the pupil shift amount is stored in the lens memory 118, and the stored second correction value coefficient is received regardless of the actual light receiving sensitivity condition. It may be used as a second correction value coefficient corresponding to the sensitivity condition.

次にステップS110では、カメラMPU125は、焦点検出補正値BPの位相差AFに依存する成分である第2補正値BP2を、以下の式(9)で示す上述した関数により算出する。式(9)において、a00,a02,a20,a22は、ステップS109にて取得した第2補正値係数である。 Next, in step S110, the camera MPU 125 calculates a second correction value BP2, which is a component that depends on the phase difference AF of the focus detection correction value BP, using the above-described function represented by the following equation (9). In equation (9), a 00 , a 02 , a 20 , and a 22 are the second correction value coefficients acquired in step S109.

BP2=a00+a02+a20+a22 (9)
このように、カメラMPU125は、受光感度条件に対応する第2補正値係数をレンズユニット100から取得して第2補正値BP2を算出する。これにより、受光感度分布が異なる場合においても焦点検出合焦位置P_AFと位相差合焦位置P_AF2との差を良好に補正する(減少させる)ための第2補正値BP2を取得することができる。
BP2 = a 00 + a 02 y 2 + a 20 x 2 + a 22 x 2 y 2 (9)
As described above, the camera MPU 125 acquires the second correction value coefficient corresponding to the light receiving sensitivity condition from the lens unit 100 and calculates the second correction value BP2. This makes it possible to acquire the second correction value BP2 for favorably correcting (decreasing) the difference between the focus detection focus position P_AF and the phase difference focus position P_AF2 even when the light receiving sensitivity distribution is different.

本実施例では、カメラMPU125は、焦点検出領域の位置座標(x,y)を変数とする関数の係数である第2補正値係数を取得して該関数により第2補正値を算出する。しかし、予め像高ごとに算出されてレンズメモリ118に記憶された第2補正値を取得してもよい。   In this embodiment, the camera MPU 125 obtains a second correction value coefficient, which is a coefficient of a function having the position coordinate (x, y) of the focus detection area as a variable, and calculates a second correction value using the function. However, a second correction value calculated in advance for each image height and stored in the lens memory 118 may be obtained.

次にステップS111では、カメラMPU125は、焦点検出補正値BPを、第1補正値BP1と第2補正値BP2を用いて、以下の式(10)により算出する。
BP=BP1+BP2 (10)
この際、ステップS112で第2補正値BP2が0に設定された場合は、第2補正値BP2が用いられずに第1補正値BP1のみから焦点検出補正値BPが算出されることになる。
Next, in step S111, the camera MPU 125 calculates the focus detection correction value BP by using the first correction value BP1 and the second correction value BP2 according to the following equation (10).
BP = BP1 + BP2 (10)
At this time, if the second correction value BP2 is set to 0 in step S112, the focus detection correction value BP is calculated from only the first correction value BP1 without using the second correction value BP2.

以上説明したように、本実施例では、焦点検出補正値BPを、被写体の色、方向および空間周波数に依存する第1補正値BP1と、位相差AFに依存する第2補正値BP2とに分けて算出する。これにより、位相差AFにおけるデフォーカス量を高精度に補正することができる。   As described above, in the present embodiment, the focus detection correction value BP is divided into the first correction value BP1 depending on the color, direction, and spatial frequency of the subject, and the second correction value BP2 depending on the phase difference AF. And calculate. Thereby, the defocus amount in the phase difference AF can be corrected with high accuracy.

図13を用いて、第1補正値BP1と第2補正値BP2とを分けて算出することによりデフォーカス量を高精度に補正できることを説明する。図13中のP_IMGは、カメラMPU125がステップS102で算出した撮像合焦位置を示す。また、P_AFは、カメラMPU125がステップS103で算出した焦点検出合焦位置を示す。BP1はカメラMPU125がステップS104にて算出した第1補正値を、BP2はカメラMPU125がステップS112にて算出した第2補正値を、BPはステップS114にて算出される焦点検出補正値をそれぞれ示す。また、BP’は、第1補正値と第2補正値とを分けずに撮像合焦位置P_IMGでの線像強度分布に基づいて、図6に示した処理により算出した補正値を示している。δBPは、補正値BP’と本来算出すべき補正値との差分(BP’−BP)を示している。横軸は実def(実際のデフォーカス量)を、縦軸は検出def(位相差AFにて検出されるデフォーカス量)を示す。   The fact that the defocus amount can be corrected with high accuracy by separately calculating the first correction value BP1 and the second correction value BP2 will be described with reference to FIG. P_IMG in FIG. 13 indicates the imaging focus position calculated by the camera MPU 125 in step S102. P_AF indicates the focus detection in-focus position calculated by the camera MPU 125 in step S103. BP1 indicates the first correction value calculated by the camera MPU 125 in step S104, BP2 indicates the second correction value calculated by the camera MPU 125 in step S112, and BP indicates the focus detection correction value calculated in step S114. . BP ′ indicates a correction value calculated by the processing illustrated in FIG. 6 based on the line image intensity distribution at the imaging focus position P_IMG without separating the first correction value and the second correction value. . δBP indicates a difference (BP′−BP) between the correction value BP ′ and the correction value to be calculated originally. The horizontal axis represents actual def (actual defocus amount), and the vertical axis represents detection def (defocus amount detected by phase difference AF).

図13に示すように実defと検出defとの関係が線形でない場合は、検出したA像およびB像信号間の像ずれ量をデフォーカス量に換算して補正値BPを算出する際に、実defと検出defの非線形な関係に起因して算出される補正値は、補正値BP’となり誤差δBPが生じる。これに対して、焦点検出特性から算出される焦点検出合焦位置P_AFでのLSFを用いて第2補正値BP2を算出する場合には、算出する第2補正値BP2が補正値BPよりも小さくなるため、実defと検出defの非線形な関係に起因した誤差の影響が小さくなる。   When the relationship between the actual def and the detected def is not linear as shown in FIG. 13, when the correction value BP is calculated by converting the detected image shift amount between the A image signal and the B image signal into a defocus amount, The correction value calculated due to the non-linear relationship between the actual def and the detected def becomes a correction value BP ′, and an error δBP occurs. On the other hand, when the second correction value BP2 is calculated using the LSF at the focus detection focus position P_AF calculated from the focus detection characteristics, the calculated second correction value BP2 is smaller than the correction value BP. Therefore, the influence of an error due to the nonlinear relationship between the actual def and the detected def is reduced.

以上説明したように、本実施例では、焦点検出補正値BPを、被写体の色、方向および空間周波数に依存する第1補正値BP1と、位相差AFに依存する第2補正値BP2とに分けて取得する。そして本実施例では、第2補正値BP2を、撮像素子122の受光感度条件に応じて算出する。これにより、位相差AFにおけるデフォーカス量を高精度に補正することができる。   As described above, in the present embodiment, the focus detection correction value BP is divided into the first correction value BP1 depending on the color, direction, and spatial frequency of the subject, and the second correction value BP2 depending on the phase difference AF. To get. In the present embodiment, the second correction value BP2 is calculated according to the light receiving sensitivity condition of the image sensor 122. Thereby, the defocus amount in the phase difference AF can be corrected with high accuracy.

次に、本発明の実施例2について説明する。実施例2は、第1補正値の取得方法と第2補正値の算出方法が実施例1と異なる。なお、本実施例におけるカメラ本体120およびレンズユニット100の構成は実施例1と同じであり、実施例1と共通する構成要素には実施例1と同符号を付す。   Next, a second embodiment of the present invention will be described. The second embodiment differs from the first embodiment in the method of obtaining the first correction value and the method of calculating the second correction value. Note that the configurations of the camera body 120 and the lens unit 100 in the present embodiment are the same as those in the first embodiment, and the same components as those in the first embodiment are denoted by the same reference numerals.

実施例1では、カメラMPU125は、ステップS101で取得した収差情報から算出した撮像合焦位置P_IMGおよび焦点検出合焦位置P_AFから第1補正値を算出した。これに対して、実施例2では、それぞれ予め算出した撮像合焦位置P_IMGと焦点検出合焦位置P_AFとの差分である第1補正値をEEPROM125cに記憶させておく。そして、カメラMPU125は、EEPROM125cから図4のステップS4で取得したフォーカスレンズ104の位置、第1レンズ101の位置および絞り値に応じた第1補正値を読み出して取得する。   In the first embodiment, the camera MPU 125 calculates the first correction value from the imaging focus position P_IMG and the focus detection focus position P_AF calculated from the aberration information acquired in step S101. On the other hand, in the second embodiment, a first correction value, which is a difference between the previously calculated imaging focus position P_IMG and the focus detection focus position P_AF, is stored in the EEPROM 125c. Then, the camera MPU 125 reads and acquires the first correction value corresponding to the position of the focus lens 104, the position of the first lens 101, and the aperture value acquired in step S4 of FIG. 4 from the EEPROM 125c.

また、実施例1では、カメラMPU125は、焦点検出領域の位置座標(x,y)を変数とする関数における受光感度条件ごとの係数(第2補正値係数)を取得し、これを用いて第2補正値を算出した。これに対して、実施例2では、予め焦点検出領域の位置座標(x,y)と受光感度条件ごとの第2補正値を算出するための関数の係数(以下、これについても第2補正値係数という)とをEEPROM125cに記憶させておく。そしてカメラMPU125は、これらを用いて上述した関数により第2補正値を算出する。   In the first embodiment, the camera MPU 125 obtains a coefficient (second correction value coefficient) for each light receiving sensitivity condition in a function using the position coordinate (x, y) of the focus detection area as a variable, and uses this to obtain a second correction value coefficient. Two correction values were calculated. On the other hand, in the second embodiment, the position coordinates (x, y) of the focus detection area and the coefficient of a function for calculating the second correction value for each light receiving sensitivity condition (hereinafter also referred to as the second correction value) Is stored in the EEPROM 125c. Then, the camera MPU 125 calculates the second correction value by using the above and the function described above.

本実施例におけるAF処理の基本的な流れは実施例1で図5を用いて説明したAF処理と同じであるが、そのステップS5でカメラMPU125が行う焦点検出補正値の算出処理が異なる。図14は、本実施例における焦点検出補正値の算出処理を示している。図14のステップS201は撮像合焦位置と焦点検出合焦位置との差分である第1補正値の算出に関する処理(第1工程)であり、ステップS203〜S206は焦点検出合焦位置と位相差焦点検出合焦位の差分である第2補正値の算出に関する処理(第2工程)である。また、ステップ207は、焦点検出補正値を算出する処理(第3工程)である。   The basic flow of the AF processing in the present embodiment is the same as the AF processing described in the first embodiment with reference to FIG. 5, but the calculation processing of the focus detection correction value performed by the camera MPU 125 in step S5 is different. FIG. 14 shows the calculation processing of the focus detection correction value in the present embodiment. Step S201 in FIG. 14 is processing (first step) related to calculation of a first correction value that is a difference between the imaging focus position and the focus detection focus position. Steps S203 to S206 are steps S203 to S206. This is a process (second step) related to calculation of a second correction value that is a difference between focus detection focus positions. Step 207 is processing for calculating a focus detection correction value (third step).

ステップS201において、カメラMPU125は、ステップS1で設定した焦点検出領域の位置座標(x,y)、ステップS4で取得したフォーカスレンズ104の位置、第1レンズ101の位置(ズーム状態)および絞り値に応じて第1補正値を取得する。本実施例では、前述したように予め記憶された第1補正値を取得するが、焦点検出領域の位置座標(x,y)と第1補正値を算出するための関数の係数を記憶しておき、それらを用いて第1補正値を算出してもよい。   In step S201, the camera MPU 125 sets the position coordinates (x, y) of the focus detection area set in step S1, the position of the focus lens 104, the position of the first lens 101 (zoom state), and the aperture value obtained in step S4. A first correction value is obtained accordingly. In the present embodiment, the first correction value stored in advance is acquired as described above. However, the position coordinates (x, y) of the focus detection area and the coefficient of the function for calculating the first correction value are stored. And the first correction value may be calculated using them.

次にステップS202では、カメラMPU125は、ステップS3で焦点検出を行った焦点検出方式が位相差AFか否かを判定し、位相差AFである場合はステップS203に進む。一方、位相差AFでない場合、すなわち第2補正値BP2が得られない場合は、カメラMPU125はステップS208にて第2補正値を0(BP2=0)としてステップS207に進む。このように焦点検出方式を判定して焦点検出補正値を算出することで、焦点検出方式に応じてデフォーカス量を高精度に補正することができる。   Next, in step S202, the camera MPU 125 determines whether or not the focus detection method that has performed focus detection in step S3 is phase difference AF. If the focus detection method is phase difference AF, the process proceeds to step S203. On the other hand, if it is not the phase difference AF, that is, if the second correction value BP2 cannot be obtained, the camera MPU 125 sets the second correction value to 0 (BP2 = 0) in step S208, and proceeds to step S207. By determining the focus detection method and calculating the focus detection correction value in this manner, the defocus amount can be corrected with high accuracy according to the focus detection method.

ステップS203では、カメラMPU125は、補正値算出条件を判定する。すなわち、カメラMPU125は、焦点検出合焦位置P_AFと位相差合焦位置P_AF2との差が所定値より小さいか否かを判定し、小さい場合はステップS208にて第2補正値を0(BP2=0)としてステップS111に進む。一方、カメラMPU125は、焦点検出合焦位置P_AFと位相差合焦位置P_AF2との差が所定値より小さくない場合はステップS204に進む。焦点検出合焦位置P_AFと位相差合焦位置P_AF2との差が小さくなる条件については実施例1で説明した通りである。   In step S203, the camera MPU 125 determines a correction value calculation condition. That is, the camera MPU 125 determines whether or not the difference between the focus detection focus position P_AF and the phase difference focus position P_AF2 is smaller than a predetermined value. If the difference is smaller, the camera MPU 125 sets the second correction value to 0 (BP2 = 0) and proceeds to step S111. On the other hand, if the difference between the focus detection focus position P_AF and the phase difference focus position P_AF2 is not smaller than the predetermined value, the camera MPU 125 proceeds to step S204. The condition under which the difference between the focus detection focus position P_AF and the phase difference focus position P_AF2 is small is as described in the first embodiment.

ステップS204では、カメラMPU125は、実施例1のステップS108と同様に、撮像素子の受光感度条件情報zを取得する。   In step S204, the camera MPU 125 acquires the light receiving sensitivity condition information z of the image sensor, as in step S108 of the first embodiment.

次にステップS205では、カメラMPU125は、位相差補正情報を取得する。実施例1のステップS109でも説明したように、位相差補正情報は、位相差AFにより得られる位相差合焦位置に関する情報である。ただし本実施例における位相差補正情報は、焦点検出領域の位置座標(x,y)とステップS204で取得した受光感度条件情報zを変数とする関数の第2補正値係数であり、フォーカスレンズ104の位置、第1レンズ101の位置(ズーム状態)および絞り値に応じた係数である。カメラMPU125は、図5のステップS4で取得したフォーカスレンズ104の位置、第1レンズ101の位置(ズーム状態)および絞り値に応じた第2補正値係数をEEPROM125cから取得する。   Next, in step S205, the camera MPU 125 acquires phase difference correction information. As described in step S109 of the first embodiment, the phase difference correction information is information on the phase difference in-focus position obtained by the phase difference AF. However, the phase difference correction information in the present embodiment is a second correction value coefficient of a function using the position coordinates (x, y) of the focus detection area and the light-receiving sensitivity condition information z acquired in step S204 as variables. , The position of the first lens 101 (zoom state), and a coefficient according to the aperture value. The camera MPU 125 acquires the second correction value coefficient corresponding to the position of the focus lens 104, the position (zoom state) of the first lens 101 and the aperture value acquired in step S4 of FIG. 5 from the EEPROM 125c.

次にステップS206では、カメラMPU125は、焦点検出補正値BPの位相差AFに依存する成分である第2補正値BP2を、以下の式(11)により示す関数を用いて算出する。式(11)において、a00(z),a02(z),a20(z)およびa22(z)は、ステップS205にて取得した第2補正値係数である。各第2補正値係数は、受光感度条件情報zを変数とする関数である。 Next, in step S206, the camera MPU 125 calculates a second correction value BP2, which is a component depending on the phase difference AF of the focus detection correction value BP, using a function represented by the following equation (11). In Expression (11), a 00 (z), a 02 (z), a 20 (z), and a 22 (z) are the second correction value coefficients acquired in Step S205. Each second correction value coefficient is a function using the light receiving sensitivity condition information z as a variable.

BP2=a00(z)+a02(z)y+a20(z)x+a22(z)x (10)
このように、カメラMPU125は、受光感度条件情報zに応じた第2補正値係数を取得し、第2補正値係数から第2補正値を算出する。これにより、受光感度条件が異なる場合においても、高精度に焦点検出合焦位置P_AFと位相差合焦位置P_AF2の差を良好に補正するための第2補正値を取得することができる。
BP2 = a 00 (z) + a 02 (z) y 2 + a 20 (z) x 2 + a 22 (z) x 2 y 2 (10)
As described above, the camera MPU 125 obtains the second correction value coefficient corresponding to the light-receiving sensitivity condition information z, and calculates the second correction value from the second correction value coefficient. Thereby, even when the light receiving sensitivity conditions are different, it is possible to acquire the second correction value for satisfactorily correcting the difference between the focus detection focus position P_AF and the phase difference focus position P_AF2 with high accuracy.

次にステップS207では、カメラMPU125は、実施例1と同様に、焦点検出補正値BPを式(10)を用いて算出する。この際、ステップS208で第2補正値BP2が0に設定された場合は、第2補正値BP2が用いられずに第1補正値BP1のみから焦点検出補正値BPが算出されることになる。   Next, in step S207, the camera MPU 125 calculates the focus detection correction value BP using Expression (10), as in the first embodiment. At this time, if the second correction value BP2 is set to 0 in step S208, the focus detection correction value BP is calculated from only the first correction value BP1 without using the second correction value BP2.

以上説明したように、本実施例でも、焦点検出補正値BPを、被写体の色、方向および空間周波数に依存する第1補正値BP1と、位相差AFに依存する第2補正値BP2とに分けて取得する。さらに本実施例でも、第2補正値BP2を、撮像素子122の受光感度条件情報に応じて算出する。これにより、位相差AFにおけるデフォーカス量を高精度に補正することができる。   As described above, also in this embodiment, the focus detection correction value BP is divided into the first correction value BP1 depending on the color, direction, and spatial frequency of the subject, and the second correction value BP2 depending on the phase difference AF. To get. Further, also in the present embodiment, the second correction value BP2 is calculated according to the light receiving sensitivity condition information of the image sensor 122. Thereby, the defocus amount in the phase difference AF can be corrected with high accuracy.

なお、上記各実施例では、第1および第2補正値の両方をカメラMPU125が算出する場合について説明したが、第1および第2補正値のうち少なくとも一方をレンズMPU117が算出してカメラMPU125に送信してもよい。すなわち、カメラMPU125は、第1および第2補正値のうち少なくとも一方を、レンズMPU117から取得してもよい。   In each of the above embodiments, the case where the camera MPU 125 calculates both the first and second correction values has been described. However, at least one of the first and second correction values is calculated by the lens MPU 117 and the camera MPU 125 calculates the first and second correction values. May be sent. That is, the camera MPU 125 may acquire at least one of the first and second correction values from the lens MPU 117.

上記各実施例ではレンズ交換型デジタルカメラについて説明したが、本発明の他の実施例としての撮像装置はレンズ一体型カメラやビデオカメラも含む。また、本発明の他の実施例は、携帯電話機、パーソナルコンピュータ、ゲーム機等の電子機器に搭載される撮像装置も含む。
(その他の実施例)
本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサーがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する部(例えば、ASIC)によっても実現可能である。
In each of the embodiments described above, the interchangeable lens type digital camera has been described. However, the imaging apparatus as another embodiment of the present invention also includes a lens integrated camera and a video camera. Another embodiment of the present invention also includes an imaging device mounted on an electronic device such as a mobile phone, a personal computer, and a game machine.
(Other Examples)
The present invention supplies a program for realizing one or more functions of the above-described embodiments to a system or an apparatus via a network or a storage medium, and one or more processors in a computer of the system or the apparatus read and execute the program. It can also be realized by the following processing. Further, it can also be realized by a unit (for example, an ASIC) that realizes one or more functions.

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

120 カメラ本体
122 撮像素子
125 カメラMPU
129 位相差焦点検出部
120 Camera main body 122 Image sensor 125 Camera MPU
129 Phase difference focus detection unit

Claims (11)

撮像素子を用いた位相差検出方式での焦点検出を行う焦点検出装置であって、
前記焦点検出の結果の補正に用いられる焦点検出補正値を取得する補正値取得手段を有し、
前記補正値取得手段は、
前記撮像素子の出力から生成される画像の特性に応じて算出される第1合焦位置と前記焦点検出の特性に応じて算出される第2合焦位置との差分である第1補正値を取得し、
前記撮像素子の受光感度分布に関する条件に応じた補正値であって、前記第2合焦位置と前記焦点検出の結果から算出される第3合焦位置との差分である第2補正値を取得し、
前記第1補正値と前記第2補正値を用いて前記焦点検出補正値を取得することを特徴とする焦点検出装置。
A focus detection device that performs focus detection by a phase difference detection method using an imaging element,
A correction value acquisition unit that acquires a focus detection correction value used for correcting the result of the focus detection,
The correction value acquiring means,
A first correction value, which is a difference between a first focus position calculated according to the characteristics of an image generated from the output of the image sensor and a second focus position calculated according to the characteristics of the focus detection, Acquired,
Obtaining a second correction value, which is a correction value according to a condition relating to a light-receiving sensitivity distribution of the image sensor and is a difference between the second focus position and a third focus position calculated from a result of the focus detection. And
A focus detection device, wherein the focus detection correction value is obtained using the first correction value and the second correction value.
前記撮像素子の受光感度分布に関する条件は、前記撮像素子の画素サイズ、瞳距離および瞳ずれ量のうち少なくとも1つを含むことを特徴とする請求項1に記載の焦点検出装置。   The focus detection apparatus according to claim 1, wherein the condition regarding the light-receiving sensitivity distribution of the image sensor includes at least one of a pixel size, a pupil distance, and a pupil shift amount of the image sensor. 前記第1合焦位置および前記第2合焦位置は、前記撮像素子上に被写体像を形成する光学系の収差の情報を用いて算出されることを特徴とする請求項1または2に記載の焦点検出装置。   3. The apparatus according to claim 1, wherein the first focus position and the second focus position are calculated using information on aberration of an optical system that forms a subject image on the image sensor. 4. Focus detection device. 前記補正値取得手段は、前記位相差検出方式による焦点検出が行われない場合は、前記第2補正値を用いずに前記第1補正値を用いて前記第3の補正値を取得することを特徴とする請求項1から3のいずれか一項に記載の焦点検出装置。   When the focus detection by the phase difference detection method is not performed, the correction value acquiring unit may acquire the third correction value using the first correction value without using the second correction value. The focus detection device according to claim 1, wherein the focus detection device is a display device. 前記補正値取得手段は、前記第2合焦位置と前記第3合焦位置との差が前記所定値より小さい場合は前記第2補正値を用いずに前記第1補正値を用いて前記第3の補正値を取得することを特徴とする請求項1から3のいずれか一項に記載の焦点検出装置。   When the difference between the second in-focus position and the third in-focus position is smaller than the predetermined value, the correction value obtaining means uses the first correction value without using the second correction value, and The focus detection apparatus according to claim 1, wherein the focus detection apparatus obtains three correction values. 前記第1補正値および前記第2補正値のうち少なくとも一方を、前記撮像素子上に被写体像を形成する光学系を有する交換レンズ装置から取得することを特徴とする請求項1から5のいずれか一項に記載の焦点検出装置。   6. The apparatus according to claim 1, wherein at least one of the first correction value and the second correction value is obtained from an interchangeable lens device having an optical system that forms a subject image on the image sensor. The focus detection device according to claim 1. 撮像素子と、
請求項1から6のいずれか一項に記載の焦点検出装置と、
前記第3の補正値により補正された前記焦点検出結果を用いてフォーカス制御を行う制御手段とを有することを特徴とする撮像装置。
An image sensor;
A focus detection device according to any one of claims 1 to 6,
Control means for performing focus control using the focus detection result corrected by the third correction value.
撮像素子を有する撮像装置に着脱可能な交換レンズ装置であって、
前記撮像装置は、前記撮像素子の出力から生成される画像の特性に応じて算出される第1合焦位置と位相差検出方式での焦点検出の特性に応じて算出される第2合焦位置との差分である第1補正値と、前記撮像素子の受光感度分布に関する条件に応じた補正値であって、前記第2合焦位置と前記焦点検出の結果から算出される第3合焦位置との差分である第2補正値とを用いて、前記焦点検出の結果の補正に用いられる焦点検出補正値を取得し、
前記交換レンズ装置は、
前記撮像装置が前記第1補正値および前記第2補正値のうち少なくとも一方を取得するために用いられる情報を記憶した記憶手段と、
前記撮像素子の受光感度分布に関する条件に応じた前記情報を前記撮像装置に送信する送信手段とを有することを特徴とする交換レンズ装置。
An interchangeable lens device detachable from an imaging device having an imaging element,
The image pickup apparatus includes a first focus position calculated according to characteristics of an image generated from an output of the image sensor, and a second focus position calculated according to characteristics of focus detection in a phase difference detection method. And a third focus position calculated from the second focus position and the result of the focus detection, wherein the first focus value is a difference between the first focus value and the second focus position. And a second correction value, which is a difference from the above, to obtain a focus detection correction value used for correcting the result of the focus detection,
The interchangeable lens device,
Storage means for storing information used by the imaging device to acquire at least one of the first correction value and the second correction value;
An interchangeable lens device comprising: a transmission unit configured to transmit the information according to a condition regarding a light-receiving sensitivity distribution of the imaging element to the imaging device.
前記第1補正値および前記第2補正値のうち少なくとも一方を算出し、前記撮像装置に送信する算出手段を有することを特徴とする請求項8に記載の交換レンズ装置。   9. The interchangeable lens device according to claim 8, further comprising a calculating unit configured to calculate at least one of the first correction value and the second correction value and transmit the calculated value to the imaging device. 撮像素子を用いた位相差検出方式での焦点検出を行う焦点検出方法であって、
前記撮像素子の出力から生成される画像の特性に応じて算出される第1合焦位置と前記焦点検出の特性に応じて算出される第2合焦位置との差分である第1補正値を取得するステップと、
前記撮像素子の受光感度分布に関する条件に応じた補正値であって、前記第2合焦位置と前記焦点検出の結果から算出される第3合焦位置との差分である第2補正値を取得するステップと、
前記第1補正値と前記第2補正値を用いて、前記焦点検出の結果を補正するための焦点検出補正値を取得するステップとを有することを特徴とする焦点検出方法。
A focus detection method for performing focus detection by a phase difference detection method using an imaging element,
A first correction value, which is a difference between a first focus position calculated according to the characteristics of an image generated from the output of the image sensor and a second focus position calculated according to the characteristics of the focus detection, Obtaining,
Obtaining a second correction value, which is a correction value according to a condition relating to a light-receiving sensitivity distribution of the image sensor and is a difference between the second focus position and a third focus position calculated from a result of the focus detection. Steps to
Obtaining a focus detection correction value for correcting a result of the focus detection using the first correction value and the second correction value.
焦点検出装置または撮像装置のコンピュータに、請求項10に記載の焦点検出方法に従う処理を実行させることを特徴とするコンピュータプログラム。
A computer program for causing a computer of a focus detection device or an imaging device to execute a process according to the focus detection method according to claim 10.
JP2018123799A 2018-06-29 2018-06-29 Focus detection device, imaging apparatus, and interchangeable lens device Pending JP2020003686A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2018123799A JP2020003686A (en) 2018-06-29 2018-06-29 Focus detection device, imaging apparatus, and interchangeable lens device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018123799A JP2020003686A (en) 2018-06-29 2018-06-29 Focus detection device, imaging apparatus, and interchangeable lens device

Publications (1)

Publication Number Publication Date
JP2020003686A true JP2020003686A (en) 2020-01-09

Family

ID=69100054

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018123799A Pending JP2020003686A (en) 2018-06-29 2018-06-29 Focus detection device, imaging apparatus, and interchangeable lens device

Country Status (1)

Country Link
JP (1) JP2020003686A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018021971A (en) * 2016-08-01 2018-02-08 キヤノン株式会社 Focus detection method, and imaging apparatus
JP2018066864A (en) * 2016-10-19 2018-04-26 キヤノン株式会社 Focus detection device and method, imaging device, lens unit, and imaging system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018021971A (en) * 2016-08-01 2018-02-08 キヤノン株式会社 Focus detection method, and imaging apparatus
JP2018066864A (en) * 2016-10-19 2018-04-26 キヤノン株式会社 Focus detection device and method, imaging device, lens unit, and imaging system

Similar Documents

Publication Publication Date Title
KR101968109B1 (en) Focus adjustment device, method for controlling the same, and image capture apparatus
JP6478457B2 (en) Focus adjustment device and focus adjustment method
CN109981945B (en) Image pickup optical system
JP6429546B2 (en) Imaging apparatus, control method, program, and storage medium
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
JP5966426B2 (en) Focus detection device
JP2017107204A (en) Information processing apparatus and information processing method
JP6890937B2 (en) Focus detector, image pickup device, and focus detection method
JP6854619B2 (en) Focus detection device and method, imaging device, lens unit and imaging system
JP7091053B2 (en) Imaging device and focus detection method
US20200092489A1 (en) Optical apparatus, control method, and non-transitory computer-readable storage medium
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
JP2020003686A (en) Focus detection device, imaging apparatus, and interchangeable lens device
JP6686239B1 (en) Lens unit, transmitter, and receiver
JP6686191B2 (en) Focus detection device, imaging device, and focus detection method
JP7019442B2 (en) Image pickup device and its control method
JP6548626B2 (en) Image pickup apparatus, control method for image pickup apparatus, and focus control program
JP6415054B2 (en) Imaging apparatus and imaging method
JP2019219594A (en) Processing apparatus, imaging apparatus, interchangeable lens, processing method and program
JP2014032414A (en) Imaging device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20210628

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20220413

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20220510

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20220629

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20221101