JP2016061803A - Focus adjustment device, control method and control program for the same, and imaging apparatus - Google Patents

Focus adjustment device, control method and control program for the same, and imaging apparatus Download PDF

Info

Publication number
JP2016061803A
JP2016061803A JP2014186896A JP2014186896A JP2016061803A JP 2016061803 A JP2016061803 A JP 2016061803A JP 2014186896 A JP2014186896 A JP 2014186896A JP 2014186896 A JP2014186896 A JP 2014186896A JP 2016061803 A JP2016061803 A JP 2016061803A
Authority
JP
Japan
Prior art keywords
focus
cpu
image
focus adjustment
optical system
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2014186896A
Other languages
Japanese (ja)
Other versions
JP6448267B2 (en
Inventor
小西 一樹
Kazuki Konishi
一樹 小西
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 JP2014186896A priority Critical patent/JP6448267B2/en
Publication of JP2016061803A publication Critical patent/JP2016061803A/en
Application granted granted Critical
Publication of JP6448267B2 publication Critical patent/JP6448267B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Abstract

PROBLEM TO BE SOLVED: To highly accurately perform a focus adjustment by reducing data (characteristic data) acquired from a photographic optical system such as an interchangeable lens unit.SOLUTION: A CPU 15 determines whether or not the adjustment of a focus position on a subject is possible by a phase difference AF processing with a phase difference AF processing circuit 13 and determines whether or not the adjustment of the focus position on the subject is possible by a scan AF processing circuit 12. The CPU obtains the focus position on the subject, according to at least one of the results of the phase difference AF processing and the scan AF processing. The CPU obtains a focus position correction value corresponding to the characteristic of the photographic optical system at the timing of determining that the adjustment of the focus position is possible by one of the phase difference AF processing and the scan AF processing, corrects the focus position, according to the focus position correction value, and performs the focus adjustment of the photographic optical system on the basis of the corrected focus position.SELECTED DRAWING: Figure 2

Description

本発明は、焦点調整装置、その制御方法、および制御プログラム、並びに撮像装置に関し、特に、画像信号に応じて焦点調整を行う際、光学収差に起因する焦点調整の誤差を低減する焦点調整装置に関する。   The present invention relates to a focus adjustment apparatus, a control method thereof, a control program, and an imaging apparatus, and more particularly, to a focus adjustment apparatus that reduces a focus adjustment error caused by optical aberration when performing focus adjustment according to an image signal. .

一般に、撮像素子の出力である画像信号を用いて焦点調整を行う際に、撮像光学系の光学収差による影響を低減することが行われている。   In general, when focus adjustment is performed using an image signal that is an output of an image sensor, the influence of the optical aberration of the imaging optical system is reduced.

例えば、合焦精度を向上させるため、撮影画面に設定された測距領域に対応する受光面の画像信号から被写体の高周波成分を示す高周波信号を抽出するとともに、測距領域の色情報を検出することが行われている。そして、ここでは、高周波信号に応じて合焦位置を検出して、当該検出結果に応じて測距領域に対応する合焦位置に関して色情報およびフォーカスレンズの特性によって定まる所定の量ずらした位置に、フォーカスレンズを駆動する(特許文献1参照)。   For example, in order to improve the focusing accuracy, a high-frequency signal indicating a high-frequency component of the subject is extracted from the image signal of the light receiving surface corresponding to the distance measurement area set on the shooting screen, and color information of the distance measurement area is detected. Things have been done. Here, the focus position is detected according to the high-frequency signal, and the focus position corresponding to the distance measurement area is shifted according to the detection result to a position shifted by a predetermined amount determined by the color information and the characteristics of the focus lens. The focus lens is driven (see Patent Document 1).

さらに、撮影レンズの収差量に拘わらずピント位置を検出するため、フォーカスレンズの初期停止位置に係るフォーカスゾーンの初期最良ピント補正固有値を得るようにしたものがある。ここでは、最良ピント補正固有値と目的合焦位置に係るフォーカスゾーンの目的最良ピント補正固有値との差分に応じたレンズ駆動量エラーを補正するようにしている(特許文献2参照)。   Further, in order to detect the focus position regardless of the aberration amount of the photographing lens, there is an apparatus that obtains the initial best focus correction eigenvalue of the focus zone related to the initial stop position of the focus lens. Here, the lens drive amount error is corrected according to the difference between the best focus correction eigenvalue and the target best focus correction eigenvalue of the focus zone related to the target focus position (see Patent Document 2).

特開2004−347665号公報JP 2004-347665 A 特開平7−301747号公報JP-A-7-301747

上述の特許文献1においては、色情報およびフォーカスレンズの特性に応じて定まる所定の量ずらした位置にフォーカスレンズを駆動して焦点調整を行っている。このため、フォーカスレンズの位置によって所定の量が異なると、不可避的に焦点調整に誤差が生じてしまう。   In Patent Document 1 described above, focus adjustment is performed by driving the focus lens to a position shifted by a predetermined amount determined according to the color information and the characteristics of the focus lens. For this reason, if the predetermined amount varies depending on the position of the focus lens, an error will inevitably occur in the focus adjustment.

また、上述の特許文献2においては、初期最良ピント補正固有値と目的最良ピント補正固有値との差分に応じたレンズ駆動量エラーを補正している。ところが、このような差分を求めるためには、全てのフォーカス位置において補正のための固有値を備える必要がある。特に、交換レンズユニットの場合には、交換レンズユニット毎に極めて多数の固有値を準備する必要があり、メモリ容量が膨大となるばかりでなく、固有値取得のための処理が面倒となる。   In Patent Document 2 described above, the lens driving amount error is corrected according to the difference between the initial best focus correction eigenvalue and the target best focus correction eigenvalue. However, in order to obtain such a difference, it is necessary to provide eigenvalues for correction at all focus positions. In particular, in the case of an interchangeable lens unit, it is necessary to prepare an extremely large number of eigenvalues for each interchangeable lens unit, and not only the memory capacity becomes enormous, but also the processing for obtaining eigenvalues becomes troublesome.

従って、本発明の目的は、交換レンズユニットなどの撮影光学系から取得するデータ(特性データ)を少なくして、精度よく焦点調整を行うことのできる焦点調整装置、その制御方法、および制御プログラム、並びに撮像装置を提供することにある。   Therefore, an object of the present invention is to reduce the data (characteristic data) acquired from the photographing optical system such as the interchangeable lens unit and perform the focus adjustment with high accuracy, the control method thereof, and the control program, An object is to provide an imaging apparatus.

上記の目的を達成するため、本発明による焦点調整装置は、撮影光学系を介して結像された光学像に応じた画像信号を出力する撮像手段から前記画像信号を受けて、当該画像信号が示す画像において被写体に関してその焦点位置を調整する焦点調整装置であって、前記撮像手段は前記撮影光学系における射出瞳の互いに異なる領域から光束を受光して焦点調整用画像信号を出力しており、前記焦点調整用画像信号に基づいて前記被写体に関して焦点位置の調整が可能であるか否かを判定する第1の判定手段と、前記画像信号に応じて得られる焦点調整用評価値に基づいて前記被写体に関して焦点位置の調整が可能であるか否かを判定する第2の判定手段と、前記焦点調整用画像信号および前記焦点調整用評価値の少なくとも1つに応じて前記被写体に関する焦点位置を求める焦点位置算出手段と、前記第1の判定手段および前記第2の判定手段のいずれかによって前記焦点位置の調整が可能である判定されたタイミングで、前記撮影光学系の特性に応じた焦点位置補正値を得て、当該焦点位置補正値に応じて前記焦点位置算出手段で算出された焦点位置を補正して、補正された焦点位置に基づいて前記撮影光学系の焦点調整を行う制御手段と、を有することを特徴とする。   In order to achieve the above object, a focus adjustment apparatus according to the present invention receives the image signal from an image pickup unit that outputs an image signal corresponding to an optical image formed through a photographing optical system, and the image signal is A focus adjustment device that adjusts a focal position of a subject in an image shown, wherein the imaging means receives a light beam from different areas of an exit pupil in the photographing optical system and outputs a focus adjustment image signal; First determination means for determining whether or not the focus position of the subject can be adjusted based on the focus adjustment image signal, and the focus adjustment evaluation value obtained according to the image signal. Second determination means for determining whether or not the focus position of the subject can be adjusted, and the at least one of the focus adjustment image signal and the focus adjustment evaluation value. A focal position calculation unit that obtains a focal position related to the subject, and at a timing at which the focal position can be adjusted by any one of the first determination unit and the second determination unit. A focus position correction value corresponding to the characteristic is obtained, the focus position calculated by the focus position calculation unit is corrected according to the focus position correction value, and the focus of the photographing optical system is corrected based on the corrected focus position. Control means for performing adjustment.

本発明による撮像装置は、上記の焦点調整装置と、前記焦点調整装置を有する撮像装置本体と、前記撮影光学系を備え、前記撮像装置本体に着脱可能な交換レンズユニットと、を有することを特徴とする。   An imaging apparatus according to the present invention includes the above-described focus adjustment apparatus, an imaging apparatus main body including the focus adjustment apparatus, and an interchangeable lens unit that includes the imaging optical system and is detachable from the imaging apparatus main body. And

本発明による制御方法は、撮影光学系を介して結像された光学像に応じた画像信号を出力する撮像手段から前記画像信号を受けて、当該画像信号が示す画像において被写体に関してその焦点位置を調整する焦点調整装置の制御方法であって、前記撮像手段は前記撮影光学系における射出瞳の互いに異なる領域から光束を受光して焦点調整用画像信号を出力しており、前記焦点調整用画像信号に基づいて前記被写体に関して焦点位置の調整が可能であるか否かを判定する第1の判定ステップと、前記画像信号に応じて得られる焦点調整用評価値に基づいて前記被写体に関して焦点位置の調整が可能であるか否かを判定する第2の判定ステップと、前記焦点調整用画像信号および前記焦点調整用評価値の少なくとも1つに応じて前記被写体に関する焦点位置を求める焦点位置算出ステップと、前記第1の判定ステップおよび前記第2の判定ステップのいずれかによって前記焦点位置の調整が可能である判定されたタイミングで、前記撮影光学系の特性に応じた焦点位置補正値を得て、当該焦点位置補正値に応じて前記焦点位置算出ステップで算出された焦点位置を補正して、補正された焦点位置に基づいて前記撮影光学系の焦点調整を行う制御ステップと、を有することを特徴とする。   According to the control method of the present invention, the image signal is received from an imaging unit that outputs an image signal corresponding to an optical image formed through a photographing optical system, and the focal position of the subject in the image indicated by the image signal is determined. A method of controlling a focus adjusting apparatus for adjusting, wherein the imaging means receives a light beam from different areas of an exit pupil in the photographing optical system and outputs a focus adjusting image signal, and the focus adjusting image signal And a focus position adjustment for the subject based on a focus adjustment evaluation value obtained according to the image signal. A second determination step for determining whether or not the object is possible, and the subject according to at least one of the focus adjustment image signal and the focus adjustment evaluation value. According to the characteristics of the photographing optical system at a timing at which the focus position can be adjusted by any one of the focus position calculation step for obtaining the focus position and the first determination step and the second determination step. The focus position correction value is obtained, the focus position calculated in the focus position calculation step is corrected according to the focus position correction value, and the focus adjustment of the photographing optical system is performed based on the corrected focus position. And a control step.

本発明による制御プログラムは、撮影光学系を介して結像された光学像に応じた画像信号を出力する撮像手段から前記画像信号を受けて、当該画像信号が示す画像において被写体に関してその焦点位置を調整する焦点調整装置で用いられる制御プログラムであって、前記撮像手段は前記撮影光学系における射出瞳の互いに異なる領域から光束を受光して焦点調整用画像信号を出力しており、前記焦点調整装置が備えるコンピュータに、前記焦点調整用画像信号に基づいて前記被写体に関して焦点位置の調整が可能であるか否かを判定する第1の判定ステップと、前記画像信号に応じて得られる焦点調整用評価値に基づいて前記被写体に関して焦点位置の調整が可能であるか否かを判定する第2の判定ステップと、前記焦点調整用画像信号および前記焦点調整用評価値の少なくとも1つに応じて前記被写体に関する焦点位置を求める焦点位置算出ステップと、前記第1の判定ステップおよび前記第2の判定ステップのいずれかによって前記焦点位置の調整が可能である判定されたタイミングで、前記撮影光学系の特性に応じた焦点位置補正値を得て、当該焦点位置補正値に応じて前記焦点位置算出ステップで算出された焦点位置を補正して、補正された焦点位置に基づいて前記撮影光学系の焦点調整を行う制御ステップと、を実行させることを特徴とする。   The control program according to the present invention receives the image signal from an imaging unit that outputs an image signal corresponding to the optical image formed through the photographing optical system, and sets the focal position of the subject in the image indicated by the image signal. A control program used in a focus adjustment device for adjusting, wherein the imaging means receives a light beam from different areas of an exit pupil in the photographing optical system and outputs a focus adjustment image signal, and the focus adjustment device A first determination step of determining whether or not the focus position of the subject can be adjusted based on the focus adjustment image signal, and a focus adjustment evaluation obtained according to the image signal A second determination step for determining whether or not the focus position of the subject can be adjusted based on the value, and the focus adjustment image signal and The focus position can be adjusted by any one of a focus position calculation step for obtaining a focus position for the subject according to at least one of the focus adjustment evaluation values, and the first determination step and the second determination step. At the determined timing, a focus position correction value corresponding to the characteristics of the photographing optical system is obtained, and the focus position calculated in the focus position calculation step is corrected according to the focus position correction value, thereby correcting. And a control step of performing focus adjustment of the photographing optical system based on the focused position.

本発明によれば、合焦可能と判定されたタイミングで撮影光学系の特性に応じた焦点調整補正値を得るようにしたので、撮影光学系を備える交換レンズユニットからデータを取得する頻度を少なくして、高速に焦点位置補正値の算出を行うことができる。   According to the present invention, since the focus adjustment correction value corresponding to the characteristics of the photographing optical system is obtained at the timing when it is determined that focusing is possible, the frequency of acquiring data from the interchangeable lens unit including the photographing optical system is reduced. Thus, the focal position correction value can be calculated at high speed.

本発明の第1の実施形態による焦点調整装置を備える撮像装置の一例についてその構成を示すブロック図である。It is a block diagram which shows the structure about an example of an imaging device provided with the focus adjustment apparatus by the 1st Embodiment of this invention. 図1に示すカメラで行われる撮影動作を説明するためのフローチャートである。2 is a flowchart for explaining a photographing operation performed by the camera shown in FIG. 1. 図1に示すカメラで行われるAF処理の一例を説明するための図である。It is a figure for demonstrating an example of the AF process performed with the camera shown in FIG. 図1に示すカメラで用いられるBP補正値の一例についてズームがワイドである場合を説明するための図である。It is a figure for demonstrating the case where a zoom is wide about an example of the BP correction value used with the camera shown in FIG. 図1に示すカメラで用いられるBP補正値の一例についてズームが第1のミドルである場合を説明するための図である。It is a figure for demonstrating the case where a zoom is a 1st middle about an example of the BP correction value used with the camera shown in FIG. 図1に示すカメラで用いられるBP補正値の一例についてズームが第2のミドルである場合を説明するための図である。It is a figure for demonstrating the case where a zoom is a 2nd middle about an example of the BP correction value used with the camera shown in FIG. 図1に示すカメラで用いられるBP補正値の一例についてズームがテレである場合を説明するための図である。It is a figure for demonstrating the case where a zoom is tele about an example of BP correction value used with the camera shown in FIG. 図1に示す交換レンズに記録されたBP補正値算出用パラメータについて緑(Green)に係る一例を説明するための図である。It is a figure for demonstrating an example which concerns on green (Green) about the parameter for BP correction value calculation recorded on the interchangeable lens shown in FIG. 図1に示す交換レンズに記録されたBP補正値算出用パラメータについて赤(Red)に係る一例を説明するための図である。It is a figure for demonstrating an example which concerns on red (Red) about the parameter for BP correction value calculation recorded on the interchangeable lens shown in FIG. 図1に示す交換レンズに記録されたBP補正値算出用パラメータについて青(Blue)に係る一例を説明するための図である。It is a figure for demonstrating an example which concerns on blue (Blue) about the parameter for BP correction value calculation recorded on the interchangeable lens shown in FIG. 図1に示す交換レンズにおける個体差の測定結果について緑(Green)に係る一例を説明するための図である。It is a figure for demonstrating an example which concerns on the green (Green) about the measurement result of the individual difference in the interchangeable lens shown in FIG. 図1に示す交換レンズにおける個体差の測定結果について赤(Red)に係る一例を説明するための図である。It is a figure for demonstrating an example which concerns on red (Red) about the measurement result of the individual difference in the interchangeable lens shown in FIG. 図1に示す交換レンズにおける個体差の測定結果について青(Blue)に係る一例を説明するための図である。It is a figure for demonstrating an example which concerns on blue (Blue) about the measurement result of the individual difference in the interchangeable lens shown in FIG. 図2に示す位相差AF処理の一例を説明するためのフローチャートである。3 is a flowchart for explaining an example of a phase difference AF process shown in FIG. 2. 図1に示す撮像素子に備えられた位相差AF用画素(焦点調整画素)の配列についてその一例を示す図である。FIG. 2 is a diagram illustrating an example of an array of phase difference AF pixels (focus adjustment pixels) provided in the image sensor illustrated in FIG. 1. 本発明の第2の実施形態に係るカメラで設定されるAF枠の一例を示す図である。It is a figure which shows an example of the AF frame set with the camera which concerns on the 2nd Embodiment of this invention. 本発明の第2の実施形態に係るカメラで行われる撮影動作を説明するためのフローチャートである(その1)。It is a flowchart for demonstrating imaging | photography operation | movement performed with the camera which concerns on the 2nd Embodiment of this invention (the 1). 本発明の第2の実施形態に係るカメラで行われる撮影動作を説明するためのフローチャートである(その2)。It is a flowchart for demonstrating imaging | photography operation | movement performed with the camera which concerns on the 2nd Embodiment of this invention (the 2). 本発明の第2の実施形態によるカメラで行われる一連のAF処理の一例を説明するための図である。It is a figure for demonstrating an example of a series of AF processes performed with the camera by the 2nd Embodiment of this invention. 本発明の第2の実施形態によるカメラで行われる一連のAF処理の他の例を説明するための図である。It is a figure for demonstrating the other example of a series of AF processes performed with the camera by the 2nd Embodiment of this invention.

以下に、本発明の実施の形態による焦点調整装置の一例について図面を参照して説明する。   Hereinafter, an example of a focus adjusting apparatus according to an embodiment of the present invention will be described with reference to the drawings.

[第1の実施形態]
図1は、本発明の第1の実施形態による焦点調整装置を備える撮像装置の一例についてその構成を示すブロック図である。
[First Embodiment]
FIG. 1 is a block diagram illustrating a configuration of an example of an imaging apparatus including a focus adjustment apparatus according to the first embodiment of the present invention.

図示の撮像装置は、例えば、デジタルカメラ(以下単にカメラと呼ぶ)1であり、カメラ本体(撮像装置本体)1aおよび交換レンズユニット(以下単に交換レンズと呼ぶ)31を備えている。そして、交換レンズ31はカメラ本体1aに備えられたレンズマウント2に装着される。つまり、交換レンズ31はカメラ本体1aに着脱可能である。   The illustrated imaging apparatus is, for example, a digital camera (hereinafter simply referred to as a camera) 1 and includes a camera body (imaging apparatus body) 1 a and an interchangeable lens unit (hereinafter simply referred to as an interchangeable lens) 31. The interchangeable lens 31 is attached to the lens mount 2 provided in the camera body 1a. That is, the interchangeable lens 31 is detachable from the camera body 1a.

交換レンズ31はズームレンズ群(変倍光学系)32と、光軸に沿って移動可能なフォーカスレンズ群とを有する撮影光学系を有している。そして、撮影光学系の後段には撮影光学系を通過する光量を調整する絞り34が配置されている。   The interchangeable lens 31 has a photographing optical system having a zoom lens group (magnification changing optical system) 32 and a focus lens group movable along the optical axis. A diaphragm 34 for adjusting the amount of light passing through the photographing optical system is disposed at the subsequent stage of the photographing optical system.

撮影光学系を通過した被写体像(光学像)は個体撮像素子(以下単に撮像素子と呼ぶ)3に結像する。撮像素子3は光電変換によって光学像に応じた電気信号を出力する。撮像回路4は、撮像素子3の出力である電気信号を受けて、当該電気信号に対して所定の画像処理を施してアナログ画像信号を生成する。   A subject image (optical image) that has passed through the photographing optical system is imaged on an individual image sensor (hereinafter simply referred to as an image sensor) 3. The image sensor 3 outputs an electrical signal corresponding to the optical image by photoelectric conversion. The imaging circuit 4 receives an electrical signal that is an output of the imaging device 3 and performs predetermined image processing on the electrical signal to generate an analog image signal.

A/D変換回路5はアナログ画像信号をデジタル画像信号に変換する。そして、このデジタル画像信号は一時的にバッファメモリなどのメモリ(VRAM)6に記録される。VRAM6に記録されたデジタル画像信号はD/A変換回路7によってアナログ画像信号に変換される。さらに、D/A変換回路7は当該アナログ画像信号を再生出力に適する形態に変換する。そして、液晶表示装置(LCD)などの画像表示装置にはD/A変換回路7の出力応じた画像が表示される。   The A / D conversion circuit 5 converts an analog image signal into a digital image signal. The digital image signal is temporarily recorded in a memory (VRAM) 6 such as a buffer memory. The digital image signal recorded in the VRAM 6 is converted into an analog image signal by the D / A conversion circuit 7. Further, the D / A conversion circuit 7 converts the analog image signal into a form suitable for reproduction output. An image corresponding to the output of the D / A conversion circuit 7 is displayed on an image display device such as a liquid crystal display device (LCD).

圧縮伸長回路9はVRAM6に記録されたデジタル画像信号を読み出して、当該デジタル画像信号に対して圧縮処理および符号化処理を行って画像データを生成する。そして、この画像データは半導体メモリなどの記憶用メモリ10に記憶される。   The compression / decompression circuit 9 reads the digital image signal recorded in the VRAM 6 and performs compression processing and encoding processing on the digital image signal to generate image data. The image data is stored in a storage memory 10 such as a semiconductor memory.

さらに、圧縮伸長回路9は記憶用メモリ10に記憶された画像データを再生表示する際、画像データに対して復号化処理および伸長処理を行って、デジタル画像信号としてVRAM6に記録する。   Further, when the image data stored in the storage memory 10 is reproduced and displayed, the compression / decompression circuit 9 performs a decoding process and an expansion process on the image data and records them in the VRAM 6 as a digital image signal.

AE(自動露出)処理回路11は、A/D変換回路5からデジタル画像信号を受けてAE処理を行う。スキャンAF(自動焦点調節)処理回路12はA/D変換回路5からデジタル画像信号を受けてAF評価値を生成する。位相差AF処理回路13はA/D変換回路5から後述する位相差AF用信号を受けて位相差AF処理を行う。例えば、位相差AF処理回路13は位相差AF用信号の像修正を行うとともに、基準像信号(A像)と参照像信号(B像)との相関演算を行って、撮像素子3におけるA像とB像との像ずれ量およびデフォーカス量を求める。   The AE (automatic exposure) processing circuit 11 receives the digital image signal from the A / D conversion circuit 5 and performs AE processing. A scan AF (automatic focus adjustment) processing circuit 12 receives a digital image signal from the A / D conversion circuit 5 and generates an AF evaluation value. The phase difference AF processing circuit 13 receives a phase difference AF signal described later from the A / D conversion circuit 5 and performs phase difference AF processing. For example, the phase difference AF processing circuit 13 corrects the image of the phase difference AF signal and performs a correlation operation between the reference image signal (A image) and the reference image signal (B image), thereby obtaining an A image on the image sensor 3. And an image shift amount and a defocus amount between the B image and the B image.

通信ドライバー14は交換レンズ31と通信を行う際に用いられる。CPU15は演算用のメモリを内蔵し、カメラ1全体の制御を行う。タイミングジェネレータ(TG)16は、CPU15の制御下でタイミング信号を撮像回路4およびセンサードライバ17に出力する。センサードライバ17はタイミング信号に応じて撮像素子3を駆動する。   The communication driver 14 is used when communicating with the interchangeable lens 31. The CPU 15 incorporates a calculation memory and controls the entire camera 1. The timing generator (TG) 16 outputs a timing signal to the imaging circuit 4 and the sensor driver 17 under the control of the CPU 15. The sensor driver 17 drives the image sensor 3 according to the timing signal.

操作スイッチ(操作SW)18は各種のスイッチ群を備え、ユーザは操作SW18の操作によって各種の指示をCPU15に与える。電気的に書き換え可能な読み出し専用メモリ(例えば、EEPROM)19には各種の制御など行うプログラムが格納されるとともに、カメラ1に各種動作を行わせる際に用いるデータなどが予め記憶されている。   The operation switch (operation SW) 18 includes various switch groups, and the user gives various instructions to the CPU 15 by operating the operation SW 18. An electrically rewritable read-only memory (for example, EEPROM) 19 stores programs for performing various controls and the like, and stores data used when the camera 1 performs various operations.

図示のように、CPU15は電池20、スイッチング回路22、AF補助光駆動回路23、および表示素子(LED)25が接続されている。スイッチング回路22はCPU15の制御下でストロボ発光部22の閃光発光を制御する。AF補助光駆動回路23はCPU15の制御下でAF補助光部24を駆動する。なお、AF補助光部24はLEDなどの光源で構成されている。また、CPU15はLED25を点灯制御して警告を行う。   As illustrated, the battery 15, the switching circuit 22, the AF auxiliary light driving circuit 23, and the display element (LED) 25 are connected to the CPU 15. The switching circuit 22 controls the flash emission of the strobe light emitting unit 22 under the control of the CPU 15. The AF auxiliary light driving circuit 23 drives the AF auxiliary light unit 24 under the control of the CPU 15. The AF auxiliary light unit 24 is composed of a light source such as an LED. Further, the CPU 15 issues a warning by controlling the lighting of the LED 25.

顔検出回路26はA/D変換回路7からデジタル画像信号を受けて画像における被写体の顔位置および顔の大きさなどを検出する。なお、CPU15はスピーカー27によって音声によるガイダンスおよび警告などを行う。   The face detection circuit 26 receives the digital image signal from the A / D conversion circuit 7 and detects the face position and face size of the subject in the image. Note that the CPU 15 gives voice guidance and warning through the speaker 27.

交換レンズ31は前述のズームレンズ群32、フォーカスレンズ群33、および絞り34に加えて、通信ドライバー35、制御回路36、およびEEPROM37を有している。制御回路36は通信ドライバー35によってカメラ本体1aと通信を行う。   The interchangeable lens 31 includes a communication driver 35, a control circuit 36, and an EEPROM 37 in addition to the zoom lens group 32, the focus lens group 33, and the diaphragm 34 described above. The control circuit 36 communicates with the camera body 1a by the communication driver 35.

また、制御回路16は絞り駆動モータ、フォーカス駆動モータ、およびズーム駆動モータ(ともに図示せず)を制御して、それぞれ絞り34、フォーカスレンズ群33、およびズームレンズ群32を駆動する。EEPROM37には、制御回路36で用いられるデータなど予め記憶されている。   The control circuit 16 controls the aperture drive motor, the focus drive motor, and the zoom drive motor (both not shown) to drive the aperture 34, the focus lens group 33, and the zoom lens group 32, respectively. The EEPROM 37 stores data used in the control circuit 36 in advance.

なお、記憶用メモリ10としてフラッシュメモリなどの半導体メモリが用いられるが、半導体メモリとしてカード形状又はスティック形状の着脱自在なフラッシュメモリを用いるようにしてもよい。さらには、記憶用メモリ10として半導体メモリの他、ハードディスク又はフレキシブルディスクなどの記録媒体を用いるようにしてもよい。   Note that a semiconductor memory such as a flash memory is used as the storage memory 10, but a detachable flash memory having a card shape or a stick shape may be used as the semiconductor memory. Furthermore, a recording medium such as a hard disk or a flexible disk may be used as the storage memory 10 in addition to a semiconductor memory.

また、操作スイッチ24には、カメラ1を起動させて電源供給を行うための主電源スイッチ、撮影動作(および記憶動作)などを開始するためのレリーズスイッチ、および再生動作を開始させる再生スイッチなどが備えられている。   The operation switch 24 includes a main power switch for starting up the camera 1 and supplying power, a release switch for starting a photographing operation (and storage operation), a reproduction switch for starting a reproduction operation, and the like. Is provided.

例えば、レリーズスイッチは撮影動作に先立ち行われるAE処理およびAF処理を開始するための指示信号を発生する第1のストロークスイッチ(以下SW1という)を備えるとともに、露光動作を開始するための指示信号を発生する第2のストロークスイッチ(以下SW2ていう)を備えている。   For example, the release switch includes a first stroke switch (hereinafter referred to as SW1) that generates an instruction signal for starting an AE process and an AF process performed prior to a photographing operation, and an instruction signal for starting an exposure operation. A second stroke switch (hereinafter referred to as SW2) is provided.

いま、操作スイッチ18に備えられた再生スイッチが操作されると、CPU15は再生動作を開始する。これによって、前述のように、圧縮伸長回路9は記憶用メモリ10に記録された画像データに対して復号化処理および伸長処理を施して、デジタル画像信号をVRAM6に一時的に記憶する。そして、VRAM6に格納されたデジタル画像信号はD/A変換回路7によってアナログ画像信号に変換されて、LCD8に画像として表示される。   Now, when the reproduction switch provided in the operation switch 18 is operated, the CPU 15 starts the reproduction operation. Thereby, as described above, the compression / decompression circuit 9 performs a decoding process and an expansion process on the image data recorded in the storage memory 10 and temporarily stores the digital image signal in the VRAM 6. The digital image signal stored in the VRAM 6 is converted into an analog image signal by the D / A conversion circuit 7 and displayed on the LCD 8 as an image.

前述のAE処理回路11は、デジタル画像信号について一画面分の画像の輝度値を累積加算する演算処理を行って、被写体の明るさに応じたAE評価値を算出する。そして、AE処理回路11はAE評価値をCPU15に出力する。   The AE processing circuit 11 described above performs arithmetic processing for accumulatively adding the luminance values of one screen image to the digital image signal, and calculates an AE evaluation value corresponding to the brightness of the subject. Then, the AE processing circuit 11 outputs the AE evaluation value to the CPU 15.

スキャンAF処理回路12はデジタル画像信号についてハイパスフィルタ(HPF)処理を行って、その高周波成分を抽出して、累積加算する演算処理を行って、高域側の輪郭成分量に対応するAF評価値を算出する。そして、このAF評価値はCPU15に送られる。   The scan AF processing circuit 12 performs high-pass filter (HPF) processing on the digital image signal, extracts high-frequency components, performs cumulative processing, and performs an AF evaluation value corresponding to the contour component amount on the high frequency side. Is calculated. The AF evaluation value is sent to the CPU 15.

例えば、スキャンAF処理は、AF領域として指定された画面の一部領域についてHPF処理によって高周波成分を抽出する。そして、スキャンAF処理回路12は高周波成分について累積加算などの演算処理を行う。これによって、スキャンAF処理回路12は高域側の輪郭成分量に対応するAF評価値を算出する。   For example, in the scan AF process, a high frequency component is extracted by HPF process for a partial area of the screen designated as the AF area. Then, the scan AF processing circuit 12 performs arithmetic processing such as cumulative addition on the high frequency component. Accordingly, the scan AF processing circuit 12 calculates an AF evaluation value corresponding to the contour component amount on the high frequency side.

上記のAF領域は、例えば、画面の中央部分に設定される。なお、AF領域を画面の中央部分とこの中央部分に隣接する領域に設定するようにしてもよく、AF領域を離散的に分布する複数の領域に設定するようにしてもよい。   The AF area is set at the center of the screen, for example. Note that the AF area may be set in the central portion of the screen and an area adjacent to the central portion, or the AF area may be set in a plurality of discretely distributed areas.

なお、スキャンAF処理回路12は、ノイズ成分をキャンセルするためにHPF処理の前にローパスフィルタ(LPF)処理を行う。つまり、スキャンAF処理回路12はバンドパスフィルタ(BPF)処理を行うことになる。   The scan AF processing circuit 12 performs a low-pass filter (LPF) process before the HPF process in order to cancel the noise component. That is, the scan AF processing circuit 12 performs band pass filter (BPF) processing.

このように、スキャンAF処理回路12は、AF処理を行う際に、デジタル画像信号から所定の高周波成分を検出することになる。   Thus, the scan AF processing circuit 12 detects a predetermined high-frequency component from the digital image signal when performing the AF processing.

ところで、撮像素子3は焦点調整のための画素(以下焦点調整画素と呼ぶ)を備えており、焦点調整画素の出力に対応するデジタル画像信号(位相差AF用信号)がA/D変換回路5から位相差AF処理回路13に与えられる。そして、位相差AF処理回路13は位相差AF用信号の像修正を行って、前述のように像信号の相関演算によって像ずれ量およびデフォーカス量を求める。   By the way, the image sensor 3 includes a pixel for focus adjustment (hereinafter referred to as a focus adjustment pixel), and a digital image signal (phase difference AF signal) corresponding to the output of the focus adjustment pixel is converted into an A / D conversion circuit 5. To the phase difference AF processing circuit 13. Then, the phase difference AF processing circuit 13 corrects the image of the phase difference AF signal, and obtains the image shift amount and the defocus amount by the correlation calculation of the image signal as described above.

撮像素子3は、撮影光学系の射出瞳の第1の領域から光束を受光する焦点調整画素と、撮像光学系の射出瞳の第2の領域からの光束を受光する焦点調整画素を一対とする焦点調整画素ペアを有している。ここで、第1の領域から光束を受光する焦点調整画素からの出力に応じたデジタル画像信号(焦点調整用画像信号)を第1の信号(基準画像:A像)とし、第2の領域から光束を受光する焦点調整画素からの出力に応じたデジタル画像信号を第2の信号(参照画像:B像)とする。   The image pickup device 3 has a pair of a focus adjustment pixel that receives a light beam from the first region of the exit pupil of the imaging optical system and a focus adjustment pixel that receives a light beam from the second region of the exit pupil of the image pickup optical system. It has a focus adjustment pixel pair. Here, the digital image signal (focus adjustment image signal) corresponding to the output from the focus adjustment pixel that receives the light beam from the first region is set as the first signal (reference image: A image), and the second region is used. A digital image signal corresponding to the output from the focus adjustment pixel that receives the light beam is defined as a second signal (reference image: B image).

位相差AF処理回路13は、A像およびB像の像修正を行った後、A像とB像との相関を求める相関演算を行う。そして、位相差AF処理回路13は相関演算結果に応じてA像とB像との像ずれ量を検出して、所定の変換係数(K値)を像ずれ量に乗算してデフォーカス量を求める。   The phase difference AF processing circuit 13 corrects the A image and the B image, and then performs a correlation operation for obtaining a correlation between the A image and the B image. Then, the phase difference AF processing circuit 13 detects the image shift amount between the A image and the B image according to the correlation calculation result, and multiplies the image shift amount by a predetermined conversion coefficient (K value) to obtain the defocus amount. Ask.

前述のTG16から所定のタイミング信号がCPU15、撮像回路4、およびセンサードライバ17に出力される。CPU15はタイミング信号に同期して各種の制御を行う。また、撮像回路4はタイミング信号に同期して、例えば、色信号の分離などの各種画像処理を行う。センサードライバ17はタイミング信号に同期して撮像素子3を駆動する。   A predetermined timing signal is output from the TG 16 to the CPU 15, the imaging circuit 4, and the sensor driver 17. The CPU 15 performs various controls in synchronization with the timing signal. The imaging circuit 4 performs various image processing such as separation of color signals in synchronization with the timing signal. The sensor driver 17 drives the image sensor 3 in synchronization with the timing signal.

CPU15は、通信ドライバー14を介して交換レンズ31と通信を行って、絞り34およびフォーカスレンズ群33を制御する。例えば、CPU15はAE評価値に基づいて絞り34を制御するためのAE情報を交換レンズ31に送る。これによって、制御回路36は絞り34の絞り量を調整する。   The CPU 15 communicates with the interchangeable lens 31 via the communication driver 14 to control the diaphragm 34 and the focus lens group 33. For example, the CPU 15 sends AE information for controlling the diaphragm 34 to the interchangeable lens 31 based on the AE evaluation value. Thereby, the control circuit 36 adjusts the aperture amount of the aperture 34.

さらに、CPU15はAF評価値(焦点調整用評価値)又はデフォーカス量に基づいてフォーカスレンズ群33を制御するためのフォーカス情報を交換レンズ31に送る。これによって、制御回路36はフォーカスレンズ群33を合焦位置に移動させるAF制御を行う。   Further, the CPU 15 sends focus information for controlling the focus lens group 33 to the interchangeable lens 31 based on the AF evaluation value (focus adjustment evaluation value) or the defocus amount. As a result, the control circuit 36 performs AF control for moving the focus lens group 33 to the in-focus position.

ここで、交換レンズ31において、EEPROM37にはレンズ(例えば、フォーカスレンズ)に係る設計パラメータおよび製造誤差パラメータが記録されている。なお、製造誤差パラメータは交換レンズ31を製造した際に測定される設計パラメータとの誤差を示す。   Here, in the interchangeable lens 31, design parameters and manufacturing error parameters relating to the lens (for example, a focus lens) are recorded in the EEPROM 37. The manufacturing error parameter indicates an error from the design parameter measured when the interchangeable lens 31 is manufactured.

フォーカスレンズの特性によって定まるピント補正値(ベストピント補正値:BP補正値と呼ぶ)は個々のフォーカスレンズによって異なるので、その相違を吸収するために、設計パラメータおよび製造誤差パラメータに応じてBP補正値(焦点位置補正値)が求められる。ここでは、CPU15は交換レンズ31から設計パラメータおよび製造誤差パラメータを得てBP補正値を演算する。これによって、CPU15は精度の高いピント位置補正を行うことができる。   The focus correction value (best focus correction value: referred to as BP correction value) determined by the characteristics of the focus lens differs depending on each focus lens. Therefore, in order to absorb the difference, the BP correction value according to the design parameter and the manufacturing error parameter. (Focus position correction value) is obtained. Here, the CPU 15 obtains design parameters and manufacturing error parameters from the interchangeable lens 31 and calculates a BP correction value. As a result, the CPU 15 can perform highly accurate focus position correction.

一般に、撮影光学系において球面収差などの光学収差が生じると、被写体の周波数に応じたピント位置が異なる。よって、スキャンAF処理を行う際に用いられるフィルターの帯域が静止画又は動画像で表現可能な空間周波数の帯域よりも低域の場合には、そのピント位置が異なる。従って、スキャンAF処理で得られたAF評価値が極大となる位置にピントを合わせると、ユーザはピントが合っていないと感じることがある。   In general, when an optical aberration such as spherical aberration occurs in the photographing optical system, the focus position differs depending on the frequency of the subject. Therefore, when the band of the filter used when performing the scan AF process is lower than the band of the spatial frequency that can be expressed by a still image or a moving image, the focus position is different. Therefore, when focusing is performed at a position where the AF evaluation value obtained by the scan AF process is maximized, the user may feel that the focus is not achieved.

さらに、色収差による被写体の色(波長)によってピント位置が異なる。このため、スキャンAF処理で用いる信号の生成手法と画像信号の生成手法とが異なる場合に、AF評価値が極大となる位置にピントを合わせると、ユーザはピントが合っていないと感じることがある。なお、スキャンAF処理で用いる信号の生成手法とは、例えば、色フィルター毎に出力される信号に重み付けをして疑義的に輝度信号を生成する際には、各色成分の重み付けをいう。   Furthermore, the focus position varies depending on the color (wavelength) of the subject due to chromatic aberration. For this reason, when the signal generation method used in the scan AF process and the image signal generation method are different, the user may feel out of focus when focusing on the position where the AF evaluation value is maximized. . Note that the signal generation method used in the scan AF process refers to weighting of each color component when, for example, a signal output for each color filter is weighted and a luminance signal is suspiciously generated.

また、画像の水平方向と垂直方向とにおいてもピント位置が異なることがある。このため、スキャンAF処理において水平方向の信号処理のみを行う場合には、撮影の結果得られた画像に対して水平垂直のピント位置差に起因するピント位置差が生じることになる。   Also, the focus position may differ between the horizontal direction and the vertical direction of the image. For this reason, when only the horizontal signal processing is performed in the scan AF process, a focus position difference due to a horizontal / vertical focus position difference occurs with respect to an image obtained as a result of shooting.

但し、誤差量およびその方向は交換レンズ31の特性による。よって、誤差が極めて小さくほとんど影響のない場合もある。また、交換レンズ31の変倍に伴う焦点距離、撮影距離、および絞り値などによっても誤差量およびその方向が異なることがある。そして、上述のスキャンAF処理に関する点は位相差AF処理に関して言えることである。   However, the error amount and its direction depend on the characteristics of the interchangeable lens 31. Therefore, there are cases where the error is extremely small and has almost no effect. Further, the amount of error and its direction may vary depending on the focal length, the shooting distance, the aperture value, and the like associated with zooming of the interchangeable lens 31. The point related to the above-described scan AF process is the same as the phase difference AF process.

よって、ここでは、交換レンズ31の光学特性に応じて位相差AF処理およびスキャンAF処理で求めたピント位置をBP補正値によって補正した位置を合焦位置とする。前述のように、BP補正値は、交換レンズ31毎に異なり、同一の交換レンズであっても撮影距離、AF枠の位置(像高)、および撮像素子3に備えられた色フィルターによっても異なる。   Therefore, here, a position obtained by correcting the focus position obtained by the phase difference AF process and the scan AF process according to the optical characteristics of the interchangeable lens 31 with the BP correction value is set as the in-focus position. As described above, the BP correction value differs for each interchangeable lens 31, and varies depending on the shooting distance, the position of the AF frame (image height), and the color filter provided in the image sensor 3 even for the same interchangeable lens. .

また、ズームレンズの場合にはその焦点距離によってもBP補正値は異なる。さらに、同一機種で用いられる交換レンズ31であっても個々の交換レンズ31によってBP補正値が異なることもある。   In the case of a zoom lens, the BP correction value varies depending on the focal length. Furthermore, even if the interchangeable lens 31 is used in the same model, the BP correction value may differ depending on the individual interchangeable lens 31.

図2は、図1に示すカメラ1で行われる撮影動作を説明するためのフローチャートである。なお、図示のフローチャートに係る処理はCPU15の制御下で行われる。   FIG. 2 is a flowchart for explaining a photographing operation performed by the camera 1 shown in FIG. The processing according to the flowchart shown in the figure is performed under the control of the CPU 15.

以下の説明では、フォーカスレンズ群33を所定の位置に駆動しつつAF評価値を取得する動作をスキャンと呼ぶ。また、AF評価値を取得する際のフォーカスレンズ群33の位置の間隔をスキャン間隔と呼ぶ。さらに、AF評価値を取得する数をスキャンポイント数、AF評価値を取得する範囲をスキャン範囲、そして、合焦位置を検出するための画像を取得する領域をAF枠と呼ぶ。   In the following description, the operation of acquiring the AF evaluation value while driving the focus lens group 33 to a predetermined position is referred to as scanning. The interval between the positions of the focus lens group 33 when acquiring the AF evaluation value is called a scan interval. Further, the number of AF evaluation values acquired is called the number of scan points, the range of acquiring AF evaluation values is called the scan range, and the area for acquiring the image for detecting the in-focus position is called the AF frame.

いま、カメラ1の主電源スイッチがオンとされて、その動作モードが撮影(録画)モードにあると、CPU15は撮影処理シーケンスを起動する。まず、CPU15はカメラ本体1aに交換レンズ31が装着されているか否かを判定する(ステップS101)。   Now, when the main power switch of the camera 1 is turned on and its operation mode is the shooting (recording) mode, the CPU 15 starts the shooting processing sequence. First, the CPU 15 determines whether or not the interchangeable lens 31 is attached to the camera body 1a (step S101).

カメラ本体1aに交換レンズ31が装着されていると、CPU15は交換レンズ31からそのレンズIDを取得するとともに、BP補正値処理を行う(ステップS102)。   When the interchangeable lens 31 is attached to the camera body 1a, the CPU 15 acquires the lens ID from the interchangeable lens 31 and performs BP correction value processing (step S102).

ステップS102の処理では、CPU15はレンズIDに基づいて既にBP補正値がEEPROM19に存在するか否かを調べて、BP補正値が存在する場合には、特に処理を行うことなく後述するステップS121の処理に進む。   In the process of step S102, the CPU 15 checks whether or not the BP correction value already exists in the EEPROM 19 based on the lens ID. If the BP correction value exists, the CPU 15 performs the process of step S121 described later without performing any particular process. Proceed to processing.

一方、EEPROM19にBP補正値が存在しない場合には、CPU15は、前出のようにしてBP補正値を求めて、レンズIDに対応づけてEEPROM19にBP補正値を記憶する。   On the other hand, when the BP correction value does not exist in the EEPROM 19, the CPU 15 obtains the BP correction value as described above, and stores the BP correction value in the EEPROM 19 in association with the lens ID.

なお、交換レンズ31には前述の製造誤差パラメータが記録されていない交換レンズがある。製造誤差パラメータを備えない交換レンズ31の場合には、CPU15は設計パラメータに応じて、像高、焦点距離、撮影距離(フォーカスレンズ群3の位置)、および絞り値毎にBP補正値を求めて、当該BP補正値をレンズIDに対応づけてEEPROM19に記憶する。   The interchangeable lens 31 includes an interchangeable lens in which the manufacturing error parameter is not recorded. In the case of the interchangeable lens 31 that does not have a manufacturing error parameter, the CPU 15 obtains a BP correction value for each image height, focal length, photographing distance (position of the focus lens group 3), and aperture value according to the design parameters. The BP correction value is stored in the EEPROM 19 in association with the lens ID.

既に多数の交換レンズ31についてそのBP補正値が記録されている場合には、EEPROM19の記録容量によっては新たなBP補正値を記録できないことがある。この場合には、CPU15はカメラ本体1aに装着された交換レンズの履歴を調べて、最も古いレンズIDに対応するBP補正値を削除し、最も新しいレンズIDに対応するBP補正値をEEPROM19に記録する。よって、CPU15はレンズIDを取得すると、レンズIDを取得した日時を履歴としてEEPROM19に記録する。   If the BP correction values have already been recorded for a large number of interchangeable lenses 31, a new BP correction value may not be recorded depending on the recording capacity of the EEPROM 19. In this case, the CPU 15 checks the history of the interchangeable lens attached to the camera body 1a, deletes the BP correction value corresponding to the oldest lens ID, and records the BP correction value corresponding to the newest lens ID in the EEPROM 19. To do. Therefore, when acquiring the lens ID, the CPU 15 records the date and time when the lens ID is acquired in the EEPROM 19 as a history.

なお、前述のように、BP補正値は焦点距離により異なるので、ズーム倍率に応じて記録に必要とする容量が異なることになる。従って、新たな交換レンズ31がカメラ本体1a装着された場合には、一つの交換レンズに係るBP補正値が削除されるとは限らず、複数の交換レンズのBP補正値が削除されることもある。   As described above, since the BP correction value varies depending on the focal length, the capacity required for recording varies depending on the zoom magnification. Accordingly, when a new interchangeable lens 31 is attached to the camera body 1a, the BP correction value related to one interchangeable lens is not necessarily deleted, and the BP correction values of a plurality of interchangeable lenses may be deleted. is there.

続いて、CPU15は、撮像素子3の出力に応じて得られた画像をLCD8に表示する(ステップS121)。この際には、LCD8に表示される画像の明るさが適正になるようにAE処理が行われ、CPU15は絞り34および撮像素子3の蓄積時間、そして、撮像回路4の増幅率を制御する。   Subsequently, the CPU 15 displays an image obtained according to the output of the image sensor 3 on the LCD 8 (step S121). At this time, AE processing is performed so that the brightness of the image displayed on the LCD 8 is appropriate, and the CPU 15 controls the storage time of the diaphragm 34 and the image sensor 3 and the gain of the image pickup circuit 4.

なお、カメラ本体1aに交換レンズ31が装着されないと(ステップS101において、NO)、CPU15は交換レンズ31がカメラ本体1aに装着されるまで待機する。   If the interchangeable lens 31 is not attached to the camera body 1a (NO in step S101), the CPU 15 waits until the interchangeable lens 31 is attached to the camera body 1a.

次に、CPU15はレリーズスイッチの状態を確認して、ユーザによってレリーズスイッチが操作されて、SW1がオンであるか否かを判定する(ステップS122)。SW1がオンでないと(ステップS122において、NO)、CPU15は待機する。一方、SW1がオンであると(ステップS122において、YES)、CPU15はAE処理回路11を制御してAE処理を行う(ステップS123)。   Next, the CPU 15 confirms the state of the release switch, and determines whether or not the release switch is operated by the user and the SW1 is on (step S122). If SW1 is not on (NO in step S122), CPU 15 waits. On the other hand, when SW1 is on (YES in step S122), the CPU 15 controls the AE processing circuit 11 to perform AE processing (step S123).

続いて、CPU15は、位相差AF処理回路13を制御して位相差AF処理を行う(ステップS124)。この位相差AF処理はSW1オンの前に取得したA像およびB像に応じて行われる。   Subsequently, the CPU 15 controls the phase difference AF processing circuit 13 to perform phase difference AF processing (step S124). This phase difference AF process is performed according to the A and B images acquired before SW1 is turned on.

次に、CPU15は位相差AF処理の結果に応じて合焦可能であるか否かを判定する(ステップS125)。ステップS125の処理では、CPU15はデフォーカス量とその信頼性とに応じて合焦可能であるか否かを判定する。   Next, the CPU 15 determines whether or not focusing is possible according to the result of the phase difference AF process (step S125). In the process of step S125, the CPU 15 determines whether or not focusing is possible according to the defocus amount and its reliability.

例えば、A像およびB像の信号レベルが所定の信号レベル以上であり、A像およびB像との間に類似度が所定の類似度以上であって、かつデフォーカス量が所定の値以下であると、CPU15は合焦可能であると判定する。   For example, the signal levels of the A image and the B image are equal to or higher than a predetermined signal level, the similarity between the A image and the B image is equal to or higher than a predetermined similarity, and the defocus amount is equal to or lower than a predetermined value. If there is, the CPU 15 determines that focusing is possible.

合焦可能でないと判定すると(ステップS125において、NO)、CPU15はスキャンAF処理回路12を制御してスキャンAF処理を行う(ステップS126)。その後、CPU15はスキャンAF処理で得られたAF評価値を用いて合焦可能であるか否かを判定する(ステップS1227)。そして、AF評価値を用いて合焦可能でないと判定すると(ステップS127)において、NO)、CPU15はステップS124の処理に戻る。   If it is determined that focusing is not possible (NO in step S125), the CPU 15 controls the scan AF processing circuit 12 to perform scan AF processing (step S126). Thereafter, the CPU 15 determines whether or not focusing is possible using the AF evaluation value obtained in the scan AF process (step S1227). If it is determined that focusing is not possible using the AF evaluation value (NO in step S127), the CPU 15 returns to the process of step S124.

上記の一連のAF処理は、位相差AF処理とスキャンAF処理とを独立して完結させるのではなく、どちらか一方のAF処理の結果によって合焦可能になるまで交互に行われる。   The series of AF processes described above are not performed separately from the phase difference AF process and the scan AF process, but are alternately performed until focusing is possible according to the result of one of the AF processes.

上記のステップS126の処理においては、CPU15はまずセンサー(撮像素子)駆動モードを変更する。スキャンAF処理を行わない場合には、電力消費量などを考慮してフレームレートが比較的遅いセンサー駆動モードが用いられる。一方、スキャンAF処理においては、高速化のため撮像素子で実現可能な最も速いフレームレートのセンサー駆動モードが用いられる。よって、CPU15当該最も速いフレームレートのセンサー駆動モードに変更する。   In the process of step S126, the CPU 15 first changes the sensor (imaging device) drive mode. When scan AF processing is not performed, a sensor drive mode with a relatively slow frame rate is used in consideration of power consumption and the like. On the other hand, in the scan AF process, the fastest frame rate sensor drive mode that can be realized by the image sensor is used for speeding up. Therefore, the CPU 15 changes to the sensor drive mode with the fastest frame rate.

センサー駆動モードの変更は一度だけ行われるので、2度目以降のスキャンAF処理においてはセンサー駆動モードの変更は行われない。また、スキャンAF処理が終了すると、例えば、後述するステップS129のAF表示を行うタイミングなどのセンサー駆動モードに戻される。   Since the sensor drive mode is changed only once, the sensor drive mode is not changed in the second and subsequent scan AF processes. When the scan AF process is completed, for example, the sensor drive mode is returned to the timing for performing AF display in step S129 described later.

ここで、上記の一連のAF処理についてさらに説明する。   Here, the series of AF processes will be further described.

図3は、図1に示すカメラで行われるAF処理の一例を説明するための図である。   FIG. 3 is a diagram for explaining an example of the AF processing performed by the camera shown in FIG.

まず、CPU15は位相差AF処理の結果に応じたスキャン開始位置にフォーカスレンズ群33を移動する。位相差AF処理の結果、合焦可能ではないが信頼性は比較的高くフォーカスレンズ群3の位置の周辺に合焦位置があると判断できたとする(ケース1)。この場合には、CPU15は現在位置(初期位置「A」)から所定量だけフォーカスレンズ群3を移動する(位置「B」)。   First, the CPU 15 moves the focus lens group 33 to a scan start position corresponding to the result of the phase difference AF process. As a result of the phase difference AF process, it is assumed that it is not possible to focus, but the reliability is relatively high and it can be determined that the focus position is around the position of the focus lens group 3 (case 1). In this case, the CPU 15 moves the focus lens group 3 by a predetermined amount from the current position (initial position “A”) (position “B”).

その後、前述のステップS127において、CPU15はスキャンAF処理の結果に応じて合焦可能であるか否かを判定する。合焦可能であると、後述するスッテプS128の処理に進むが、この段階ではまだスキャンAF処理は実質的に開始されていないので、CPU15は合焦不可能と判定してステップS124の処理に戻る。   Thereafter, in step S127 described above, the CPU 15 determines whether or not focusing is possible according to the result of the scan AF process. If the in-focus state is possible, the process proceeds to step S128, which will be described later. At this stage, since the scan AF process has not substantially started yet, the CPU 15 determines that the in-focus state is impossible and returns to the process in step S124. .

ステップS124の処理では、図3に示す位置「B」で得られるA像及びB像を用いて位相差AF処理が行われることになる。位置「B」は初期位置「A」よりも合焦位置に近付いているので、A像とB像との類似度およびデフォーカス量などが合焦可能と判定される条件を満たす可能性がある。   In the process of step S124, the phase difference AF process is performed using the A and B images obtained at the position “B” shown in FIG. Since the position “B” is closer to the in-focus position than the initial position “A”, there is a possibility that the similarity between the A image and the B image, the defocus amount, and the like satisfy the condition for determining that in-focus is possible. .

このため、位置「B」で再度位相差AF処理が行われる。なお、この位相差AF処理は、ステップS126で設定された最速のフレームレートのセンサー駆動モードでの得られたA像およびB像を用いて行われる。位相差AF処理の結果から合焦可能と判定すると、CPU15はステップS128の処理に進む。一方、合焦可能でないと判定すると、CPU15はステップS126の処理に進み、再びスキャンAF処理を行う。   Therefore, the phase difference AF process is performed again at the position “B”. This phase difference AF process is performed using the A and B images obtained in the sensor drive mode with the fastest frame rate set in step S126. If it is determined from the result of the phase difference AF process that focusing is possible, the CPU 15 proceeds to the process of step S128. On the other hand, if it is determined that focusing is not possible, the CPU 15 proceeds to the process of step S126 and performs the scan AF process again.

ここでは、既に前処理が行われているので、実際にスキャンAF処理が行われる。CPU15は、スキャンAF処理回路12を制御して位置「B」で得られるデジタル画像信号からAF評価値を求める。そして、CPU15は当該AF評価値を内蔵メモリに記録する。そして、CPU15は次にAF評価値を取得する位置にフォーカスレンズ群33を移動する。   Here, since pre-processing has already been performed, scan AF processing is actually performed. The CPU 15 controls the scan AF processing circuit 12 to obtain an AF evaluation value from the digital image signal obtained at the position “B”. Then, the CPU 15 records the AF evaluation value in the built-in memory. Then, the CPU 15 moves the focus lens group 33 to a position where the AF evaluation value is next acquired.

その後、再度ステップS124の処理に戻って、CPU15は位相差AF処理回路13によって位相差AF処理を行い、ステップS125において位相差AF処理の結果によって合焦可能であるか否かを判定する。   Thereafter, returning to the process of step S124 again, the CPU 15 performs the phase difference AF process by the phase difference AF processing circuit 13, and determines in step S125 whether or not focusing is possible based on the result of the phase difference AF process.

合焦可能でない場合には、CPU15は再度ステップS126においてスキャンAF処理回路12によってスキャンAF処理を行う。スキャンAF処理を行う都度、AF評価値の取得とフォーカスレンズ群3の移動が繰り返される。この結果、CPU15はAF評価値が極大となるフォーカスレンズ群33の位置「D」とAF評価値が極大となった後AF評価値が小さくなった位置「C」を知ることができる。   If the in-focus state is not possible, the CPU 15 performs the scan AF process by the scan AF processing circuit 12 again in step S126. Each time the scan AF process is performed, the acquisition of the AF evaluation value and the movement of the focus lens group 3 are repeated. As a result, the CPU 15 can know the position “D” of the focus lens group 33 where the AF evaluation value becomes maximum and the position “C” where the AF evaluation value becomes small after the AF evaluation value becomes maximum.

CPU15はAF評価値の極大値を検出できると判定した時点(位置「C」の時点)でフォーカスレンズ群33の駆動を終了する。そして、CPU15は今までに取得したAF評価値に応じてAF評価値が極大となる位置(位置「D」)を求める。なお、AF評価値の取得の際にはスキャンAF処理を高速化するため、全てのフォーカスレンズ群33の停止位置で行わず、所定のスキャン間隔毎にAF評価値の取得が行われる。   The CPU 15 finishes driving the focus lens group 33 when it is determined that the maximum value of the AF evaluation value can be detected (at the time of the position “C”). Then, the CPU 15 obtains a position (position “D”) at which the AF evaluation value is maximized according to the AF evaluation values acquired so far. In order to increase the speed of the scan AF process when acquiring the AF evaluation value, the AF evaluation value is acquired at every predetermined scan interval without being performed at the stop positions of all the focus lens groups 33.

この場合、図3に示す位置a1、位置a2、および位置a3においてAF評価値が取得されることがある。このような場合には、AF評価値が最大値となった位置とその前後の位置とに応じて、次の式(1)によってAF評価値が極大となる位置Dが求められる。   In this case, AF evaluation values may be acquired at the positions a1, a2, and a3 shown in FIG. In such a case, the position D at which the AF evaluation value is maximized is obtained by the following equation (1) according to the position where the AF evaluation value becomes the maximum value and the positions before and after the position.

X0={(Y3−Y2)×X1+(Y3−Y1)×X2+(Y2−Y1)×X3}/{2×(Y3−Y1)} (1)
但し、フォーカスレンズ群33の位置がX1の際にAF評価値が最大値となり、その値がY1であるとする(位置「a2」)。そして、その前後の位置X2およびX3におけるAF評価値がそれぞれY2およびY3(位置「a1」および「a3」)、極大位置「D」のフォーカスレンズ群33の位置をX0とする。なお、Y1>Y3、Y1≧Y2とする。
X0 = {(Y3-Y2) * X1 + (Y3-Y1) * X2 + (Y2-Y1) * X3} / {2 * (Y3-Y1)} (1)
However, when the position of the focus lens group 33 is X1, the AF evaluation value is the maximum value, and the value is Y1 (position “a2”). The AF evaluation values at the front and rear positions X2 and X3 are Y2 and Y3 (positions “a1” and “a3”), respectively, and the position of the focus lens group 33 at the maximum position “D” is X0. Note that Y1> Y3 and Y1 ≧ Y2.

信頼性が十分でないと判定すると、CPU15はスキャンAF処理を継続する。信頼性を考慮するのはノイズなどで生じる偽の最大値を除外して本来の極大値を検出するためである。なお、本来の極大値が検出されることなくフォーカスレンズ群33が移動範囲の端に達した場合には、CPU15はそこでフォーカスレンズ群33を停止して、スキャンAFでは合焦不可能と判定する。   If it is determined that the reliability is not sufficient, the CPU 15 continues the scan AF process. The reason why the reliability is taken into account is to detect the original maximum value by excluding the false maximum value caused by noise or the like. When the focus lens group 33 reaches the end of the moving range without detecting the original maximum value, the CPU 15 stops the focus lens group 33 there and determines that the in-focus state is not possible in the scan AF. .

スキャンAF処理におけるAF評価値の信頼性判定手法については、例えば、特開2004−101766号公報および特開2004−102130号公報に記載されているので、ここでは説明を省略する。   Since the reliability evaluation method of the AF evaluation value in the scan AF process is described in, for example, Japanese Patent Application Laid-Open Nos. 2004-101766 and 2004-102130, description thereof is omitted here.

一度目のスッテプS124の処理において位相差AF処理の結果、信頼性が低く、例えば、デフォーカス量の方向は信頼できるもののその量が信頼できないとする(ケース2)。この場合には、CPU15は現在位置(初期位置「A」)からデフォーカス方向にフォーカスレンズ群33を駆動する。この際、CPU15は、スキャンAF処理によって極大位置が検出可能な間隔にフォーカスレンズ群33の駆動量を設定し、次のAF評価値を位置「b1」で取得するようにする。   As a result of the phase difference AF process in the first step S124, the reliability is low. For example, although the direction of the defocus amount is reliable, the amount is not reliable (case 2). In this case, the CPU 15 drives the focus lens group 33 in the defocus direction from the current position (initial position “A”). At this time, the CPU 15 sets the drive amount of the focus lens group 33 at an interval at which the maximum position can be detected by the scan AF process, and acquires the next AF evaluation value at the position “b1”.

例えば、CPU15は最速のセンサー駆動モードにおいて、次にAF評価値を取得する位置が深度の5倍程度になるようにフォーカスレンズ群33の駆動速度を設定する。   For example, in the fastest sensor drive mode, the CPU 15 sets the drive speed of the focus lens group 33 so that the position where the AF evaluation value is next acquired is about five times the depth.

そして、CPU15はステップS127の処理でスキャンAF処理によって合焦可能か否かを判定する。合焦不可能と判定すると、CPU15はステップS124の処理に戻る。   Then, the CPU 15 determines whether or not focusing is possible by the scan AF process in the process of step S127. If it is determined that focusing is impossible, the CPU 15 returns to the process of step S124.

スッテプS124の処理においては、合焦位置に近付いた位置、つまり、合焦位置に近傍の位置「b1」で得られるA像およびB像を用いて位相差AF処理が行われる。当該位相差AF処理の結果によって合焦可能と判定すると、CPU15はステップS128の処理に進む。   In the process of step S124, the phase difference AF process is performed using the A image and the B image obtained at the position close to the in-focus position, that is, the position “b1” near the in-focus position. If it is determined that focusing is possible based on the result of the phase difference AF process, the CPU 15 proceeds to the process of step S128.

一方、合焦可能ではないが、信頼性が比較的高くフォーカスレンズ群3の位置の周辺に合焦位置があると判定できると、CPU15はデフォーカス位置から所定量だけフォーカスレンズ群3を移動して、位置「B」に位置付ける。以下の動作ついては前述のケース1と同様である。   On the other hand, if the in-focus state is not possible but the reliability is relatively high and it can be determined that the in-focus position is around the position of the focus lens group 3, the CPU 15 moves the focus lens group 3 by a predetermined amount from the defocus position. To position “B”. The following operations are the same as in the case 1 described above.

上記のいずれでもない場合には、CPU15はステップS126の処理に進み再びスキャンAF処理を行う。そして、CPU15はスキャンAF処理回路12によって位置「b1」で得られるデジタル画像信号からAF評価値を求めて、内蔵メモリに記録する。続いて、CPU15は次にAF評価値を取得する位置「b2」にフォーカスレンズ群33を移動する。   If none of the above, the CPU 15 proceeds to the process of step S126 and performs the scan AF process again. Then, the CPU 15 obtains an AF evaluation value from the digital image signal obtained at the position “b1” by the scan AF processing circuit 12 and records it in the built-in memory. Subsequently, the CPU 15 moves the focus lens group 33 to the position “b2” where the AF evaluation value is acquired next.

その後、CPU15はステップS124の処理に戻って、位相差AF処理回路13によって位相差AF処理を行って、ステップS125において位相差AF処理の結果によって合焦可能であるか否かを判定する。   Thereafter, the CPU 15 returns to the process of step S124, performs the phase difference AF process by the phase difference AF processing circuit 13, and determines in step S125 whether or not focusing is possible based on the result of the phase difference AF process.

合焦可能でない場合には、CPU15はステップS126においてスキャンAF処理回路12によってスキャンAF処理を行う。ここでもフォーカスレンズ群3の位置の周辺に合焦位置があると判定できる場合には、CPU15はデフォーカス位置から所定量だけフォーカスレンズ群3を移動して、位置「B」に位置付ける。   If the in-focus state is not possible, the CPU 15 performs scan AF processing by the scan AF processing circuit 12 in step S126. Here again, if it can be determined that the in-focus position exists around the position of the focus lens group 3, the CPU 15 moves the focus lens group 3 by a predetermined amount from the defocus position and positions it at the position “B”.

上述の処理を行う都度、AF評価値の取得とフォーカスレンズ群3の移動とが繰り返されるので、CPU15はAF評価値が極大になるフォーカスレンズ群33の位置「D」、AF評価値が極大となった後AF評価値が小さくなる位置「C」を知ることができる。   Every time the above-described processing is performed, the acquisition of the AF evaluation value and the movement of the focus lens group 3 are repeated. After that, the position “C” where the AF evaluation value becomes smaller can be known.

よって、CPU15はケース1の場合と同様の処理を行い、全てのAF評価値からAF評価値が極大になる位置「D」を求める。   Therefore, the CPU 15 performs the same processing as in the case 1, and obtains the position “D” at which the AF evaluation value is maximized from all the AF evaluation values.

信頼性が十分でないと判定した場合には、CPU15はスキャンAF処理を継続する。そして、本来の極大値を検出することなくフォーカスレンズ群33が移動範囲の端に達した場合には、CPU15はそこでフォーカスレンズ群33を停止して、スキャンAF処理では合焦不可能と判定する。一度目のステップS124の処理でよる位相差AF処理の結果、信頼性が極めて低くデフォーカス量の方向および量とも信頼できないとする(ケース3)。この場合には、CPU15は現在位置(初期位置「A」)から当該位置に近いフォーカスレンズ群33の移動範囲端にフォーカスレンズ群33を移動する。   If it is determined that the reliability is not sufficient, the CPU 15 continues the scan AF process. When the focus lens group 33 reaches the end of the moving range without detecting the original maximum value, the CPU 15 stops the focus lens group 33 there and determines that the in-focus state is impossible in the scan AF process. . As a result of the phase difference AF process in the first step S124, it is assumed that the reliability is extremely low and the direction and amount of the defocus amount are not reliable (case 3). In this case, the CPU 15 moves the focus lens group 33 from the current position (initial position “A”) to the end of the movement range of the focus lens group 33 close to the position.

図3に示す例では、CPU15は無限遠側の移動範囲端である位置「I」にフォーカスレンズ群33を移動する。一方、初期位置が位置「C」のように至近側の移動範囲端である位置「N」に近い場合には、CPU15はフォーカスレンズ群33を位置「N」に移動する。   In the example illustrated in FIG. 3, the CPU 15 moves the focus lens group 33 to a position “I” that is the end of the movement range on the infinity side. On the other hand, when the initial position is close to the position “N” that is the end of the moving range on the closest side, such as the position “C”, the CPU 15 moves the focus lens group 33 to the position “N”.

その後、ステップS127の処理において、CPU15はスキャンAF処理によって合焦可能であるか否かを判定する。合焦不可能と判定すると、CPU15はステップS124の処理に戻る。   Thereafter, in the process of step S127, the CPU 15 determines whether or not focusing is possible by the scan AF process. If it is determined that focusing is impossible, the CPU 15 returns to the process of step S124.

ステップS124の処理においては、CPU15は位置「I」で得られるA像およびB像を用いて、位相差AF処理回路13によって位相差AF処理を行う。そして、位相差AF処理の結果から合焦可能と判定すると、CPU15はステップS128の処理に進む。   In the processing of step S124, the CPU 15 performs the phase difference AF processing by the phase difference AF processing circuit 13 using the A image and the B image obtained at the position “I”. If it is determined from the result of the phase difference AF process that focusing is possible, the CPU 15 proceeds to the process of step S128.

一方、合焦可能ではないが、信頼性が比較的高くフォーカスレンズ群3の位置の周辺に合焦位置があると判定できる場合には、CPU15はデフォーカス位置から所定量だけフォーカスレンズ群3を移動して、位置「B」に位置付ける。以下の動作ついてはケース1と同様である。   On the other hand, if the in-focus state is not possible but the reliability is relatively high and it can be determined that the in-focus position is around the position of the focus lens group 3, the CPU 15 moves the focus lens group 3 by a predetermined amount from the defocus position. Move to position “B”. The following operations are the same as in Case 1.

上記の二つのいずれでもない場合には、CPU15はステップS126の処理に進んで、再度スキャンAF処理を行う。以下の動作ついてケース2と同様である。   If neither of the above two is present, the CPU 15 proceeds to the process of step S126 and performs the scan AF process again. The following operations are the same as those in Case 2.

まず、CPU15は反対側の端の方向にフォーカスレンズ群33を駆動する。この際、CPU15はスキャンAF処理によって極大位置が検出可能な間隔に駆動量を設定して、次のAF評価値を位置「c1」で取得するようにする。例えば、CPU15は最速のセンサー駆動モードにおいて、次にAF評価値を取得する位置が深度の5倍程度になるようにフォーカスレンズ群33の駆動速度を設定する。   First, the CPU 15 drives the focus lens group 33 in the direction of the opposite end. At this time, the CPU 15 sets the driving amount at an interval at which the maximum position can be detected by the scan AF process, and acquires the next AF evaluation value at the position “c1”. For example, in the fastest sensor drive mode, the CPU 15 sets the drive speed of the focus lens group 33 so that the position where the AF evaluation value is next acquired is about five times the depth.

その後、CPU15はステップS127においてスキャンAF処理で合焦可能か否かを判定する。合焦不可能であると判定すると、CPU15はステップS124の処理に戻る。   Thereafter, in step S127, the CPU 15 determines whether or not focusing is possible in the scan AF process. If it is determined that focusing is impossible, the CPU 15 returns to the process of step S124.

ステップS124の処理では、CPU15は位置「c1」で得られるA像およびB像を用いて、位相差AF処理回路13によって位相差AF処理を行う。そして、位相差AF処理の結果から合焦可能である判定すると、CPU15はステップS128の処理に進む。   In step S124, the CPU 15 performs phase difference AF processing by the phase difference AF processing circuit 13 using the A and B images obtained at the position “c1”. If it is determined that focusing is possible from the result of the phase difference AF process, the CPU 15 proceeds to the process of step S128.

一方、合焦可能ではないが、信頼性が比較的高くフォーカスレンズ群3の位置の周辺に合焦位置があると判定できる場合には、CPU15はデフォーカス位置から所定量だけフォーカスレンズ群3を移動して、位置「B」に位置付ける。以下の動作についてはケース1と同様である。   On the other hand, if the in-focus state is not possible but the reliability is relatively high and it can be determined that the in-focus position is around the position of the focus lens group 3, the CPU 15 moves the focus lens group 3 by a predetermined amount from the defocus position. Move to position “B”. The following operations are the same as in Case 1.

上記のいずれでもない場合には、CPU15はステップS126の処理に進んで、再びスキャンAF処理回路12によってスキャンAF処理を行う。そして、CPU15は、スキャンAF処理回路12によって位置「c1」において得られるデジタル画像信号からAF評価値を求めて、内蔵メモリに記録する。その後、CPU15は次にAF評価値を取得する位置「c2」にフォーカスレンズ群33を移動する。   If none of the above is true, the CPU 15 proceeds to the process of step S126, and the scan AF processing circuit 12 performs the scan AF process again. Then, the CPU 15 obtains an AF evaluation value from the digital image signal obtained at the position “c1” by the scan AF processing circuit 12 and records it in the built-in memory. Thereafter, the CPU 15 moves the focus lens group 33 to a position “c2” where the AF evaluation value is next acquired.

続いて、CPU15はステップS124の処理に戻って、位相差AF処理回路13によって位相差AF処理を行って、ステップS125において位相差AF処理の結果から合焦可能かであるか否かを判定する。   Subsequently, the CPU 15 returns to the process of step S124, performs the phase difference AF process by the phase difference AF processing circuit 13, and determines whether or not focusing is possible from the result of the phase difference AF process in step S125. .

合焦可能でない場合には、CPU15はステップS126においてスキャンAF処理回路12によってスキャンAF処理を行う。ここでもフォーカスレンズ群3の位置の周辺に合焦位置があると判定できる場合には、CPU15はデフォーカス位置から所定量だけフォーカスレンズ群3を移動して、位置「B」に位置付ける。   If the in-focus state is not possible, the CPU 15 performs scan AF processing by the scan AF processing circuit 12 in step S126. Here again, if it can be determined that the in-focus position exists around the position of the focus lens group 3, the CPU 15 moves the focus lens group 3 by a predetermined amount from the defocus position and positions it at the position “B”.

このようにして、AF処理を行う都度、AF評価値の取得およびフォーカスレンズ群3の移動が繰り返される。これによって、CPU15はAF評価値が極大になるフォーカスレンズ群33の位置「D」とAF評価値が極大となった後AF評価値が小さくなる位置「C」を知ることができる。   In this way, every time AF processing is performed, acquisition of AF evaluation values and movement of the focus lens group 3 are repeated. Thus, the CPU 15 can know the position “D” of the focus lens group 33 where the AF evaluation value is maximized and the position “C” where the AF evaluation value becomes small after the AF evaluation value becomes maximum.

そして、CPU15はケース1と同様の処理を行って、全てのAF評価値に基づいて、AF評価値が極大になる位置Dを求める。   Then, the CPU 15 performs the same process as in the case 1, and obtains the position D at which the AF evaluation value is maximized based on all the AF evaluation values.

信頼性が十分でないと判定した場合には、CPU15はスキャンAF処理を継続する。そして、本来の極大値を検出することなくフォーカスレンズ群33が移動範囲の端に達すると、CPU15はそこでフォーカスレンズ群33を停止して、スキャンAF処理によっては合焦不可能と判定する。   If it is determined that the reliability is not sufficient, the CPU 15 continues the scan AF process. Then, when the focus lens group 33 reaches the end of the movement range without detecting the original maximum value, the CPU 15 stops the focus lens group 33 there, and determines that focusing is impossible by the scan AF process.

このようにして、CPU15はステップS124〜S127の処理を繰り返す。そして、位相差AF処理又はスキャンAF処理で合焦可能と判定すると、CPU15はステップS128の処理に進む。   In this way, the CPU 15 repeats the processes of steps S124 to S127. If the CPU 15 determines that focusing is possible in the phase difference AF process or the scan AF process, the CPU 15 proceeds to the process of step S128.

再び図2を参照して、ステップS128の処理では、CPU15はBP補正値を取得するとともに、合焦位置を算出する。まず、CPU15はBP補正値の取得を行う。   Referring to FIG. 2 again, in the process of step S128, CPU 15 obtains the BP correction value and calculates the in-focus position. First, the CPU 15 acquires a BP correction value.

位相差AF処理の場合には、CPU15はデフォーカス量を求める際に用いたA像およびB像の信号レベルが所定レベル以上であり、A像とB像とが類似度すると判定して、かつデフォーカス量が所定の値以下において合焦可能と判定した時点におけるBP補正値の取得を行う。   In the case of the phase difference AF process, the CPU 15 determines that the signal levels of the A image and the B image used for obtaining the defocus amount are equal to or higher than a predetermined level, and that the A image and the B image are similar. The BP correction value at the time when it is determined that focusing is possible when the defocus amount is a predetermined value or less is acquired.

一方、スキャンAF処理の場合には、CPU15はAF評価値が極大になるフォーカスレンズ群33の位置「D」とAF評価値が極大となった後AF評価値が小さくなった位置「C」におけるAF評価値を取得する。そして、CPU15は極大値を検出できると判定してフォーカスレンズ群33の駆動を終了した時点におけるBP補正値の取得を行う。   On the other hand, in the case of the scan AF process, the CPU 15 at the position “D” of the focus lens group 33 where the AF evaluation value is maximized and at the position “C” where the AF evaluation value becomes small after the AF evaluation value becomes maximum. An AF evaluation value is acquired. Then, the CPU 15 determines that the maximum value can be detected, and acquires the BP correction value at the time when the driving of the focus lens group 33 is finished.

このように、位相差AFで合焦可能と判定した場合には、CPU15は位相差AF処理のBP補正値を取得する。また、スキャンAFで合焦可能と判判定した場合には、CPU15はスキャンAF処理のBP補正値を取得する。   As described above, when it is determined that focusing is possible with the phase difference AF, the CPU 15 acquires a BP correction value for the phase difference AF process. If it is determined that the in-focus state can be obtained by the scan AF, the CPU 15 acquires a BP correction value for the scan AF process.

CPU15はスキャンAF処理の結果得られたAF評価値が極大値となるフォーカスレンズ群33の位置にBP補正値を加算して合焦位置とする。または、CPU15はデフォーカス量が零となるフォーカスレンズ群33の位置にBP補正値を加算して合焦位置といる。そして、CPU15は当該合焦位置にフォーカスレンズ群33を移動する。   The CPU 15 adds the BP correction value to the position of the focus lens group 33 at which the AF evaluation value obtained as a result of the scan AF process becomes the maximum value, and sets the focus position. Alternatively, the CPU 15 adds the BP correction value to the position of the focus lens group 33 where the defocus amount becomes zero to obtain the in-focus position. Then, the CPU 15 moves the focus lens group 33 to the in-focus position.

続いて、CPU15はAFOK表示を行う(ステップS129)。ここでは、CPU15はLED25を点灯するとともに、LCD8に緑色枠を表示する。   Subsequently, the CPU 15 performs AFOK display (step S129). Here, the CPU 15 turns on the LED 25 and displays a green frame on the LCD 8.

なお、ステップS127までの処理において、位相差AF処理およびスキャンAF処理ともに合焦可能と判定しないと、CPU15はBP補正値を取得する処理を行うことなくAFNG表示を行う。ここでは、CPU15はLED25を点滅させるとともにLCD8に黄色枠を表示する。   If it is not determined that focusing is possible in both the phase difference AF process and the scan AF process in the processes up to step S127, the CPU 15 performs the AFNG display without performing the process of acquiring the BP correction value. Here, the CPU 15 blinks the LED 25 and displays a yellow frame on the LCD 8.

その後、CPU15はレリーズスイッチを確認してSW2がオンであるか否かを判定する(ステップS130)。SW2がオンでないと(ステップS130において、NO)、CPU15は待機する。一方、SW2がオンとなると(ステップS130において、YES)、CPU15は露光処理を行って(ステップS131)、前述のようにして画像データを記録用メモリ10に記録する。そして、CPU15は撮影動作を終了する。   Thereafter, the CPU 15 confirms the release switch and determines whether or not SW2 is on (step S130). If SW2 is not on (NO in step S130), CPU 15 waits. On the other hand, when SW2 is turned on (YES in step S130), CPU 15 performs an exposure process (step S131), and records the image data in recording memory 10 as described above. Then, the CPU 15 ends the shooting operation.

ここで、ステップS128の処理で行われるBP補正値の取得についてさらに説明する。ここでは、まず製造誤差パラメータ(製造誤差情報)を備えない交換レンズがカメラ本体に装着され場合について説明する。   Here, the acquisition of the BP correction value performed in the process of step S128 will be further described. Here, a case where an interchangeable lens that does not have a manufacturing error parameter (manufacturing error information) is attached to the camera body will be described.

製造誤差情報を備えない交換レンズが装着された場合には、前述のように、交換レンズ装着の際に求められたBP補正値がEEPROM19に記録される。   When an interchangeable lens that does not have manufacturing error information is attached, the BP correction value obtained when the interchangeable lens is attached is recorded in the EEPROM 19 as described above.

図4〜図7は図1に示すカメラで用いられるBP補正値の一例を説明するための図である。   4 to 7 are diagrams for explaining an example of the BP correction value used in the camera shown in FIG.

前述のステップS128の処理においては、合焦位置を求めるための像高、ズームポジション、およびフォーカス位置は確定しているので、CPU15は当該状態におけるBP補正値をEEPROM19から読み出せばよい。   In the process of step S128 described above, the image height, the zoom position, and the focus position for obtaining the in-focus position are fixed. Therefore, the CPU 15 may read the BP correction value in this state from the EEPROM 19.

位相差AF処理で合焦可能と判定した場合には、合焦可能と判定した時点におけるフォーカスレンズ群33の位置にデフォーカス量を加算した位置がフォーカスレンズ群の位置となる。   When it is determined that focusing is possible in the phase difference AF process, the position of the focus lens group 33 is the position obtained by adding the defocus amount to the position of the focus lens group 33 at the time when it is determined that focusing is possible.

一方、スキャンAF処理で合焦可能と判定した場合には、合焦可能と判定した時点におけるAF評価値が極大となるフォーカスレンズ群33の位置(図3に示す位置「D」)が得られているので、AF評価値が極大となる位置がフォーカスレンズ群33の位置となる。   On the other hand, when it is determined that focus is possible in the scan AF process, the position of the focus lens group 33 (position “D” shown in FIG. 3) at which the AF evaluation value at the time when it is determined that focus is possible is maximized. Therefore, the position where the AF evaluation value is maximized is the position of the focus lens group 33.

従って、合焦可能と判定した時点におけるズームポジション、ユーザによって設定又は顔検出結果などによって設定されたAF枠の像高におけるBP補正値が読み出される。但し、像高に関しては、記録された像高以外において位相差AF処理から得られるデフォーカス量又はスキャンAF処理から得られるAF評価値の極大値を用いることがある。このような場合には、隣接する座標のBP補正値を用いて補間演算によって、合焦位置を算出する際のBP補正値を得る。   Therefore, the BP correction value at the image height of the AF frame set by the zoom position, the user setting or the face detection result when it is determined that focusing is possible is read out. However, regarding the image height, there may be used a defocus amount obtained from the phase difference AF process or a maximum value of the AF evaluation value obtained from the scan AF process at a position other than the recorded image height. In such a case, a BP correction value for calculating the in-focus position is obtained by interpolation using the BP correction values of adjacent coordinates.

EEPROM19には、中心のxy座標を(0,0)とした際、座標(0,0)、(x1,0)、(x2,0)、(0,y1)、および(0,y2)におけるBP補正値が記録されている。   The EEPROM 19 has coordinates (0,0), (x1,0), (x2,0), (0, y1), and (0, y2) when the center xy coordinate is (0,0). A BP correction value is recorded.

ここで、位相差AF処理においてA像およびB像を取得した領域の中心座標を(x,y)、同様に、スキャンAF処理におけるAF枠の中心座標を(x,y)とする。   Here, it is assumed that the center coordinates of the area where the A image and the B image are acquired in the phase difference AF process are (x, y), and the center coordinates of the AF frame in the scan AF process are (x, y).

ズームポジションzoom、フォーカス位置focusにおける像高(x,y)のBP補正値BP(x,y,zoom.focus)は、次の式(2)で示される。   The BP correction value BP (x, y, zoom. Focus) of the image height (x, y) at the zoom position zoom and the focus position focus is expressed by the following equation (2).

Figure 2016061803
Figure 2016061803

但し、BP(x,0,zoom.focus)はBP補正値の水平方向の像高成分であり、BP(0,y,zoom.focus)はBP補正値の垂直方向の像高の成分である。   However, BP (x, 0, zoom. Focus) is a horizontal image height component of the BP correction value, and BP (0, y, zoom. Focus) is a vertical image height component of the BP correction value. .

そして、0≦x≦x1の場合には、BP補正値BP(x,0,zoom.focus)は、次の式(3)で示される。   When 0 ≦ x ≦ x1, the BP correction value BP (x, 0, zoom.focus) is expressed by the following equation (3).

BP(x,0,zoom.focus)=BP(0,0,zoom.focus)+[BP(x1,0,zoom.focus)−BP(0,0,zoom.focus)]×x÷x1 (3)
x1<x≦x2の場合には、BP補正値BP(x,0,zoom.focus)は、次の式(4)で示される。
BP (x, 0, zoom.focus) = BP (0,0, zoom.focus) + [BP (x1,0, zoom.focus) −BP (0,0, zoom.focus)] × x ÷ x1 ( 3)
In the case of x1 <x ≦ x2, the BP correction value BP (x, 0, zoom.focus) is expressed by the following equation (4).

BP(x,0,zoom.focus)=BP(x1,0,zoom.focus)+[BP(x2,0,zoom.focus)−BP(x1,0,zoom.focus)]×(x−x1)÷(x2−x1) (4)
x2<xの場合には、BP補正値BP(x,0,zoom.focus)は、次の式(5)で示される。
BP (x, 0, zoom.focus) = BP (x1,0, zoom.focus) + [BP (x2,0, zoom.focus) −BP (x1,0, zoom.focus)] × (x−x1 ) / (X2-x1) (4)
When x2 <x, the BP correction value BP (x, 0, zoom.focus) is expressed by the following equation (5).

BP(x,0,zoom.focus)=BP(x2,0,zoom.focus)
(5)
0≦y≦y1の場合には、BP補正値BP(0,y,zoom.focus)は、次の式(6)で示される。
BP (x, 0, zoom.focus) = BP (x2,0, zoom.focus)
(5)
In the case of 0 ≦ y ≦ y1, the BP correction value BP (0, y, zoom. Focus) is expressed by the following equation (6).

BP(0,y,zoom.focus)=BP(0,0,zoom.focus)+[BP(0,y1,zoom.focus)−BP(0,0,zoom.focus)]×y÷y1 (6)
y1<y≦y2の場合には、BP補正値BP(0,y,zoom.focus)は、次の式(7)で示される。
BP (0, y, zoom.focus) = BP (0,0, zoom.focus) + [BP (0, y1, zoom.focus) −BP (0,0, zoom.focus)] × y ÷ y1 ( 6)
In the case of y1 <y ≦ y2, the BP correction value BP (0, y, zoom. focus) is expressed by the following equation (7).

BP(0,y,zoom.focus)=BP(0,y1,zoom.focus)+[BP(0,y2,zoom.focus)−BP(0,y1,zoom.focus)]×(y−y1)÷(y2−y1) (7)
y2<yの場合には、BP補正値BP(0,y,zoom.focus)は、次の式(8)で示される。
BP (0, y, zoom. Focus) = BP (0, y1, zoom. Focus) + [BP (0, y2, zoom. Focus) −BP (0, y1, zoom. Focus)] × (y−y1 ) ÷ (y2-y1) (7)
In the case of y2 <y, the BP correction value BP (0, y, zoom. focus) is expressed by the following equation (8).

BP(0,y,zoom.focus)=BP(0,y2,zoom.focus)
(8)
上述のようにして、製造誤差情報を備えない場合のBP補正値BP(x,y,zoom.focus)が得られると、CPU15は当該BP補正値を、AF評価値が極大値となるフォーカスレンズ群33の位置又はデフォーカス量が零となるフォーカスレンズ群33の位置に加算して、加算後の位置にフォーカスレンズ群33を制御する。
BP (0, y, zoom.focus) = BP (0, y2, zoom.focus)
(8)
As described above, when the BP correction value BP (x, y, zoom. Focus) when the manufacturing error information is not provided is obtained, the CPU 15 uses the BP correction value as the focus lens where the AF evaluation value becomes the maximum value. Addition is made to the position of the group 33 or the position of the focus lens group 33 where the defocus amount is zero, and the focus lens group 33 is controlled to the position after the addition.

製造誤差情報を備えない交換レンズにおいてレンズ設計値に基づくBP補正算出用パラメータからBP補正値を求める際には、交換レンズが装着された際に以下のようにしてBP補正値の算出が行われる。   When obtaining a BP correction value from a BP correction calculation parameter based on a lens design value in an interchangeable lens having no manufacturing error information, the BP correction value is calculated as follows when the interchangeable lens is mounted. .

前述のように、異なる交換レンズであっても同一の機種で用いられる交換レンズ(レンズIDが同一の交換レンズ)であれば、同一のBP補正値を用いることができる。そこで、初めて交換レンズを装着した際、CPU15は交換レンズからレンズ設計値に基づいてBP補正値を求めるための設計パラメータ(例えば、BP補正値算出用パラメータ)を得て、当該設計パラメータをBP補正値に変換してEEPROM19に記録する。これによって、レンズ通信等が不要となってカメラの起動時間が短縮される。   As described above, the same BP correction value can be used for different interchangeable lenses as long as they are interchangeable lenses (interchangeable lenses having the same lens ID) used in the same model. Therefore, when the interchangeable lens is mounted for the first time, the CPU 15 obtains a design parameter (for example, a BP correction value calculation parameter) for obtaining a BP correction value from the interchangeable lens based on the lens design value, and the BP correction is performed on the design parameter. The value is converted and recorded in the EEPROM 19. This eliminates the need for lens communication and shortens the camera startup time.

また、キットレンズなど使用頻度の高い交換レンズに関しては、予めカメラ本体1aのEEPROM19にBP補正値を記憶しておけば、レンズ通信等が不要となってカメラの起動時間が短縮される。   For interchangeable lenses that are frequently used, such as kit lenses, if the BP correction value is stored in the EEPROM 19 of the camera body 1a in advance, lens communication or the like is not necessary, and the startup time of the camera is shortened.

図8〜図10は、図1に示す交換レンズに記録されたBP補正値算出用パラメータの一例を説明するための図である。   8 to 10 are diagrams for explaining an example of the BP correction value calculation parameter recorded in the interchangeable lens shown in FIG.

交換レンズには、被写体の空間周波数毎の結像位置の基準に対する差が記録されている。図8〜図10には、ズームポジションがZoom(0)=Wide、フォーカス位置:遠、水平(H)の例が示されているが、同様の形式のデータが、複数のズームポジション(Wide、Middle1、Middle2、Tele)、フォーカス位置(遠、中、近)、方向(水平、垂直)毎に記録されている。そして、最高の帯域の像高零における値を基準として、当該値との差分が記録されている。   In the interchangeable lens, the difference with respect to the reference of the imaging position for each spatial frequency of the subject is recorded. FIGS. 8 to 10 show examples in which the zoom position is Zoom (0) = Wide and the focus position is far and horizontal (H). However, data in a similar format can be represented by a plurality of zoom positions (Wide, (Middle1, Middle2, Tele), focus position (far, middle, near), and direction (horizontal, vertical) are recorded. Then, a difference from the value is recorded on the basis of the value at the image height zero of the highest band.

像高に関しては、設計上、正および負の方向における光学的な特性は変わらないので、BP補正値も変わらない。よって、像高は正の値として扱い設計値に起因するBP補正量を求める。そして、その条件毎にBP補正が求められる。   Regarding the image height, the optical characteristics in the positive and negative directions are not changed by design, and therefore the BP correction value is not changed. Therefore, the image height is treated as a positive value, and the BP correction amount resulting from the design value is obtained. And BP correction | amendment is calculated | required for every condition.

まず、CPU15は上記の差分データを交換レンズ31との通信によって得て、BP補正値に変換して、EEPROM19に記録する。CPU15はスキャンAF処理又は位相差AF処理で用いる周波数帯域に近い2つの周波数帯域を選択する。そして、CPU15は2つの周波数帯域の値を、使用する帯域で内分して使用する帯域における基準に対するピント位置差とする。   First, the CPU 15 obtains the above difference data through communication with the interchangeable lens 31, converts it into a BP correction value, and records it in the EEPROM 19. The CPU 15 selects two frequency bands close to the frequency band used in the scan AF process or the phase difference AF process. Then, the CPU 15 internally divides the values of the two frequency bands into the used band and sets it as the focus position difference with respect to the reference in the used band.

まず、スキャンAF処理又は位相差AF処理で用いる周波数帯域の値を求める。ここでは、スキャンAF処理および位相差AF処理とも水平方向の成分のみ使用するとして数値を求める。但し、AF系の構成によっては垂直方向の成分を使用することがある。   First, a frequency band value used in the scan AF process or the phase difference AF process is obtained. Here, numerical values are obtained on the assumption that only the components in the horizontal direction are used in both the scan AF process and the phase difference AF process. However, depending on the configuration of the AF system, a vertical component may be used.

いま、AF処理で用いる周波数帯域をfreqAFとし、当該周波数帯域freqAFがfreqβとfreqαとの間に存在すると、色成分Green(緑)による像高0(0,0)における値gPxy(0,0,freqAF)は、次の式(9)で得られる。   If the frequency band used in the AF processing is freqAF and the frequency band freqAF exists between freqβ and freqα, the value gPxy (0, 0, 0) at the image height 0 (0, 0) by the color component Green (green). freqAF) is obtained by the following equation (9).

gPxy(0,0,freqAF)=gPxyH(0,0,freqα)+(freqAF―freqα)×[gPxyH(0,0,freqβ)―gPxyH(0,0,freqα)]÷(freqβ―freqα) (9)
同様にして、色成分Red(赤)による像高0(0,0)における値rPxy(0,0,freqAF)は、次の式(10)で得られる。
gPxy (0,0, freqAF) = gPxyH (0,0, freqα) + (freqAF−freqα) × [gPxyH (0,0, freqβ) −gPxyH (0,0, freqα)] ÷ (freqβ−freqα) ( 9)
Similarly, the value rPxy (0, 0, freqAF) at the image height 0 (0, 0) by the color component Red (red) is obtained by the following equation (10).

rPxy(0,0,freqAF)=rPxyH(0,0,freqα)+(freqAF―freqα)×[rPxyH(0,0,freqβ)―rPxyH(0,0,freqα)]÷(freqβ―freqα) (10)
また、色成分Blue(青)による像高0(0,0)における値bPxy(0,0,freqAF)は、次の式(11)で得られる。
rPxy (0,0, freqAF) = rPxyH (0,0, freqα) + (freqAF−freqα) × [rPxyH (0,0, freqβ) −rPxyH (0,0, freqα)] ÷ (freqβ−freqα) ( 10)
Further, the value bPxy (0, 0, freqAF) at the image height 0 (0, 0) by the color component Blue (blue) is obtained by the following equation (11).

bPxy(0,0,freqAF)=bPxyH(0,0,freqα)+(freqAF―freqα)×[bPxyH(0,0,freqβ)―bPxyH(0,0,freqα)]÷(freqβ―freqα) (11)
次いで、使用する色成分の比率に応じて、CPU15は重みづけ平均を行って、AFにおいて像高(0、0)のピント位置Pxy(0,0,freqAF)を求める。
bPxy (0,0, freqAF) = bPxyH (0,0, freqα) + (freqAF−freqα) × [bPxyH (0,0, freqβ) −bPxyH (0,0, freqα)] ÷ (freqβ−freqα) ( 11)
Next, the CPU 15 performs weighted averaging according to the ratio of the color components to be used, and obtains the focus position Pxy (0, 0, freqAF) of the image height (0, 0) in AF.

AF評価値を求める際の各色成分の比率をGreea成分:Red成分:Blue成分=WgAF:WrAF:WbAF(但し、WgAF+WrAF+WbAF=1)
とすると、ピント位置Pxy(0,0,freqAF)は、次の式(12)で得られる。
The ratio of each color component when obtaining the AF evaluation value is represented by Greea component: Red component: Blue component = WgAF: WrAF: WbAF (WgAF + WrAF + WbAF = 1)
Then, the focus position Pxy (0, 0, freqAF) is obtained by the following equation (12).

Pxy(0,0,freqAF)=WgAF×gPxy(0,0,freqAF)+WrAF×rPxy(0,0,freqAF)+WbAF×bPxy(0,0,freqAF) (12)
スキャンAF処理および位相差AF処理で用いる周波数帯域および色成分の比率は異なることもあるが、演算の際に参照する周波数帯域および係数が変わるのみで算出手法は同様である。
Pxy (0,0, freqAF) = WgAF × gPxy (0,0, freqAF) + WrAF × rPxy (0,0, freqAF) + WbAF × bPxy (0,0, freqAF) (12)
Although the frequency band and the ratio of color components used in the scan AF process and the phase difference AF process may be different, the calculation method is the same except that the frequency band and the coefficient referred to in the calculation are changed.

次に、CPU15は撮影画像が最もピントが合っていると認識される周波数帯域の値を求める。この周波数帯域は交換レンズ31の特性によって定まるので、概略、交換レンズ31が備えるデータ(差分)の最高周波数帯域となる。   Next, the CPU 15 obtains a value of a frequency band in which the captured image is recognized as being in focus. Since this frequency band is determined by the characteristics of the interchangeable lens 31, it is roughly the highest frequency band of data (difference) provided in the interchangeable lens 31.

一方、交換レンズ31が製造誤差情報を備える場合には異なることもあるので、AFで使用する帯域と同様に、予め規定された周波数帯域に近い2つの周波数帯域を選択して、2つの周波数帯域の値を、使用する帯域で内分して使用する帯域における基準に対するピント位置差とする。撮像は水平・垂直方向の成分を使用するものとして数値を求める。   On the other hand, when the interchangeable lens 31 includes manufacturing error information, it may be different. Therefore, two frequency bands close to a predetermined frequency band are selected and two frequency bands are selected in the same manner as the band used in AF. Is a focus position difference with respect to the reference in the band to be used by dividing into the band to be used. The numerical value is obtained assuming that imaging uses components in the horizontal and vertical directions.

いま、予め規定された撮影画像の周波数帯域をfreqImgとし、周波数帯域freqImgがfreqβとfreqαの間に存在するとする。色成分Greenによる像高0(0,0)における水平方向の値gPxyH(0,0,freqImg)は、次の式(13)で得られる。   It is assumed that the frequency band of the captured image defined in advance is freqImg, and the frequency band freqImg exists between freqβ and freqα. The horizontal value gPxyH (0, 0, freqImg) at the image height 0 (0, 0) by the color component Green is obtained by the following equation (13).

gPxyH(0,0,freqImg)=gPxyH(0,0,freqα)+(freqImg−freqα)×[gPxyH(0,0,freqβ)―gPxyH(0,0,freqα)]÷(freqβ―freqα) (13)
同様にして、色成分Redによる像高0(0,0)に水平方向のおける値rPxyH(0,0,freqImg)は、次の式(14)で得られる。
gPxyH (0,0, freqImg) = gPxyH (0,0, freqα) + (freqImg−freqα) × [gPxyH (0,0, freqβ) −gPxyH (0,0, freqα)] ÷ (freqβ−freqα) ( 13)
Similarly, the value rPxyH (0, 0, freqImg) in the horizontal direction at the image height 0 (0, 0) by the color component Red is obtained by the following equation (14).

rPxyH(0,0,freqImg)=rPxyH(0,0,freqα)+(freqImg−freqα)×[rPxyH(0,0,freqβ)―rPxyH(0,0,freqα)]÷(freqβ―freqα) (14)
色成分Blueによる像高0(0,0)に水平方向のおける値bPxyH(0,0,freqImg)は、次の式(15)で得られる。
rPxyH (0,0, freqImg) = rPxyH (0,0, freqα) + (freqImg−freqα) × [rPxyH (0,0, freqβ) −rPxyH (0,0, freqα)] ÷ (freqβ−freqα) ( 14)
The value bPxyH (0, 0, freqImg) in the horizontal direction at the image height 0 (0, 0) by the color component Blue is obtained by the following equation (15).

bPxyH(0,0,freqImg)=bPxyH(0,0,freqα)+(freqImg−freqα)×[bPxyH(0,0,freqβ)―bPxyH(0,0,freqα)]÷(freqβ―freqα) (15)
同様に、各色成分における垂直方向の値gPxyV(0,0,freqImg)、値rPxyV(0,0,freqImg)、およびbPxyV(0,0,freqImg)は、それぞれ次の式(16)〜式(18)で得られる。
bPxyH (0,0, freqImg) = bPxyH (0,0, freqα) + (freqImg−freqα) × [bPxyH (0,0, freqβ) −bPxyH (0,0, freqα)] ÷ (freqβ−freqα) ( 15)
Similarly, the vertical value gPxyV (0,0, freqImg), value rPxyV (0,0, freqImg), and bPxyV (0,0, freqImg) in each color component are respectively expressed by the following equations (16) to ( 18).

gPxyV(0,0,freqImg)=gPxyV(0,0,freqα)+(freqImg−freqα)×[gPxyV(0,0,freqβ)―gPxyV(0,0,freqα)]÷(freqβ―freqα) (16)
rPxyV(0,0,freqImg)=rPxyV(0,0,freqα)+(freqImg−freqα)×[rPxyV(0,0,freqβ)―rPxyV(0,0,freqα)]÷(freqβ―freqα) (17)
bPxyV(0,0,freqImg)=bPxyV(0,0,freqα)+(freqImg−freqα)×[bPxyV(0,0,freqβ)―bPxyV(0,0,freqα)]÷(freqβ―freqα) (18)
次いで、撮影画像を生成する際の水平および垂直方向成分の寄与比率、撮影画像を生成する際の色成分の比率に応じて、CPU15は重みづけ平均を行い、撮影画像において像高(0、0)のピント位置Pxy(0,0,freqImg)を求める。
gPxyV (0,0, freqImg) = gPxyV (0,0, freqα) + (freqImg−freqα) × [gPxyV (0,0, freqβ) −gPxyV (0,0, freqα)] ÷ (freqβ−freqα) ( 16)
rPxyV (0,0, freqImg) = rPxyV (0,0, freqα) + (freqImg−freqα) × [rPxyV (0,0, freqβ) −rPxyV (0,0, freqα)] ÷ (freqβ−freqα) ( 17)
bPxyV (0,0, freqImg) = bPxyV (0,0, freqα) + (freqImg−freqα) × [bPxyV (0,0, freqβ) −bPxyV (0,0, freqα)] ÷ (freqβ−freqα) ( 18)
Next, the CPU 15 performs weighted averaging according to the contribution ratio of the horizontal and vertical components when generating the captured image and the ratio of the color components when generating the captured image, and the image height (0, 0) in the captured image. ) To obtain the focus position Pxy (0, 0, freqImg).

撮影画像を生成する際のMG評価値を求める際の各色成分の比率を水平成分:垂直成分=WhImg:WvImg(但し、WhImg+WvImg=1)とする。また、撮影画像を生成する際の各色成分の比率をGreea成分:Red成分:Blue成分=WgImg:WrImg:WbImg(但し、WgImg+WrImg+WbImg=1)とする。Pxy(0,0,freqImg)は、次の式(19)で求められる。   The ratio of each color component when obtaining the MG evaluation value when generating a captured image is horizontal component: vertical component = WhImg: WvImg (WhImg + WvImg = 1). Further, the ratio of each color component when generating a captured image is Greea component: Red component: Blue component = WgImg: WrImg: WbImg (where WgImg + WrImg + WbImg = 1). Pxy (0, 0, freqImg) is obtained by the following equation (19).

Pxy(0,0,freqImg)=WhImg×{WgImg×gPxyH(0,0,freqImg)+WrImg×rPxyH(0,0,freqImg)+WbImg×bPxyH(0,0,freqImg)}+WvImg×{WgImg×gPxyV(0,0,freqImg)+WrImg×rPxyV(0,0,freqImg)+WbImg×bPxyV(0,0,freqImg)} (19)
これより、ズームポジション0、フォーカス位置0、像高(0、0)におけるBP補正値BP(0,0,0,0)は、次の式(20)で求められる。
Pxy (0,0, freqImg) = WhImg × {WgImg × gPxyH (0,0, freqImg) + WrImg × rPxyH (0,0, freqImg) + WbImg × bPxyH (0,0, freqImg)} + WvImg × {WxImg × g 0,0, freqImg) + WrImg × rPxyV (0,0, freqImg) + WbImg × bPxyV (0,0, freqImg)} (19)
Thus, the BP correction value BP (0, 0, 0, 0) at the zoom position 0, the focus position 0, and the image height (0, 0) is obtained by the following equation (20).

BP(0,0,0.0)=Pxy(0,0,freqImg)―Pxy(0,0,freqAF) (20)
なお、他の像高に関しても同様にして求めることができる。つまり、像高(x、y)におけるAF処理で使用する周波数帯域のピント値、撮影画像が最もピントが合っていると認識される周波数帯域のピント値、およびBP補正値は、それぞれ次の式(21)〜式(23)で求められる。
BP (0,0,0.0) = Pxy (0,0, freqImg) −Pxy (0,0, freqAF) (20)
Other image heights can be obtained in the same manner. That is, the focus value of the frequency band used in the AF processing at the image height (x, y), the focus value of the frequency band recognized as the best focus on the captured image, and the BP correction value are respectively expressed by the following equations. It is calculated | required by (21)-Formula (23).

Pxy(x,y,freqAF)=WgAF×gPxy(x,y,freqAF)+WrAF×rPxy(x,y,freqAF)+WbAF×bPxy(x,y,freqAF) (21)
Pxy(x,y,freqImg)=WhImg×{WgImg×gPxyH(x,y,freqImg)+WrImg×rPxyH(x,y,freqImg)+WbImg×bPxyH(x,y,freqImg)}+WvImg×{WgImg×gPxyV(x,y,freqImg)+WrImg×rPxyV(x,y,freqImg)+WbImg×bPxyV(x,y,freqImg)} (22)
BP(x,y,0.0)=Pxy(x,y,freqImg)―Pxy(x,y,freqAF) (23)
像高に関する設計値に基づくBP補正値は画面中心に対して水平方向および垂直方向とも正の範囲における値を有するものとする。つまり、設計上は正の方向および負の方向の光学的な特性は変わらないので、BP補正値も変わらない。従って、BP補正値を求めるためのパラメータも図8〜図10に示すように正の範囲における値のみとなる。そして、CPU15は、他のズームポジション、他のフォーカス位置に関しても同様にしてBP補正値を求める。
Pxy (x, y, freqAF) = WgAF × gPxy (x, y, freqAF) + WrAF × rPxy (x, y, freqAF) + WbAF × bPxy (x, y, freqAF) (21)
Pxy (x, y, freqImg) = WhImg × {WgImg × gPxyH (x, y, freqImg) + WrImg × rPxyH (x, y, freqImg) + WbImg × bPxyH (x, y, freqImg)} + WvImg × {WxImg × g x, y, freqImg) + WrImg × rPxyV (x, y, freqImg) + WbImg × bPxyV (x, y, freqImg)} (22)
BP (x, y, 0.0) = Pxy (x, y, freqImg) −Pxy (x, y, freqAF) (23)
The BP correction value based on the design value related to the image height is assumed to have a value in a positive range in both the horizontal direction and the vertical direction with respect to the screen center. That is, since the optical characteristics in the positive direction and the negative direction are not changed in design, the BP correction value does not change. Therefore, the parameter for obtaining the BP correction value is only a value in the positive range as shown in FIGS. The CPU 15 similarly obtains the BP correction value for other zoom positions and other focus positions.

このようにして、ズームポジション、フォーカス位置、および像高を関数とするBP補正値を生成すると、CPU15は当該BP補正値をEEPROM19に記憶する。   When the BP correction value is generated as a function of the zoom position, the focus position, and the image height in this way, the CPU 15 stores the BP correction value in the EEPROM 19.

次いで、製造誤差情報を有する交換レンズの場合について説明する。   Next, the case of an interchangeable lens having manufacturing error information will be described.

製造誤差情報を有する交換レンズの場合には、交換レンズを装着する際にEEPROMに該当するデータが存在しないと、CPU15は交換レンズ31から図8〜図10に示す形式の設計値に基づくBP補正値を求めるためのパラメータを取得して、EEPROM19に記録する。   In the case of an interchangeable lens having manufacturing error information, if there is no data corresponding to the EEPROM when the interchangeable lens is mounted, the CPU 15 performs BP correction from the interchangeable lens 31 based on the design values of the formats shown in FIGS. A parameter for obtaining the value is acquired and recorded in the EEPROM 19.

製造誤差情報に基づくBP補正値を求めためのパラメータを取得は、位相差AF処理又はスキャンAF処理で合焦可能と判定されてステップS128に進んだ時点で行われる。この時点では、ズームポジション、フォーカス位置、および像高は確定しているので、CPU15は、確定したズームポジション、フォーカス位置、および像高の製造誤差に基づくパラメータのみを交換レンズ31から取得する。   The parameter for obtaining the BP correction value based on the manufacturing error information is acquired when it is determined that focusing is possible in the phase difference AF process or the scan AF process and the process proceeds to step S128. At this time, since the zoom position, the focus position, and the image height are determined, the CPU 15 acquires only the parameters based on the determined zoom position, focus position, and image height manufacturing error from the interchangeable lens 31.

但し、像高に関して隣接する座標のBP補正値からの補間計算を行うため、CPU15は該当する像高の両隣の像高のパラメータを取得する。   However, in order to perform the interpolation calculation from the BP correction value of the adjacent coordinates with respect to the image height, the CPU 15 acquires the image height parameters on both sides of the corresponding image height.

位相差AF処理で合焦可能と判定した場合には、判定時点におけるフォーカスレンズ群33の位置に、検出されたデフォーカス量を加算した位置がフォーカスレンズ群33の位置となる。   When it is determined that focusing is possible by the phase difference AF process, a position obtained by adding the detected defocus amount to the position of the focus lens group 33 at the determination time becomes the position of the focus lens group 33.

一方、スキャンAF処理で合焦可能と判定した場合には、判定時点におけるAF評価値が極大になるフォーカスレンズ群33の位置(図3に示す位置「D」)が求められているので、このAF評価値が極大となる位置がフォーカスレンズ群33の位置となる。 よって、その時点におけるズームポジション、ユーザにより設定されるか又は顔検出などによって設定されたAF枠の像高におけるBP補正値を、EEPROM19に記録された設計値に基づくパラメータと、交換レンズ33から取得した製造誤差情報に基づくパラメータから求めればよい。   On the other hand, when it is determined that in-focus is possible in the scan AF process, the position of the focus lens group 33 (position “D” shown in FIG. 3) at which the AF evaluation value at the time of determination is maximized is obtained. The position where the AF evaluation value is maximized is the position of the focus lens group 33. Therefore, the BP correction value at the image position of the AF frame set by the zoom position at that time or set by the user or by face detection or the like is acquired from the parameter based on the design value recorded in the EEPROM 19 and the interchangeable lens 33. What is necessary is just to obtain | require from the parameter based on manufactured manufacturing error information.

以上のようにして、製造誤差情報を有する場合のBP補正値が求めた後、CPU15はそのBP補正値を、AF評価値が極大値となるフォーカスレンズ群33の位置、又はデフォーカス量が零となるフォーカスレンズ群33の位置に加算して、当該位置にフォーカスレンズ群33を制御する。   As described above, after obtaining the BP correction value in the case of having the manufacturing error information, the CPU 15 uses the BP correction value as the position of the focus lens group 33 where the AF evaluation value becomes the maximum value or the defocus amount is zero. And the focus lens group 33 is controlled to that position.

さらに、製造誤差情報を有する交換レンズ31の場合についてBP補正値の算出を説明する。   Further, calculation of the BP correction value for the interchangeable lens 31 having manufacturing error information will be described.

ここでは、撮影画像が最もピントが合っていると認識される周波数帯域のピント位置とAF処理の結果得られるピント位置との差に対して、製造誤差による光学系の特性が大きく影響するとする。このような交換レンズ31については、交換レンズ31を製造する際にその個体差について測定を行って、その測定値を交換レンズの記録領域(EEPROM)に記憶する。   Here, it is assumed that the characteristics of the optical system due to manufacturing errors greatly affect the difference between the focus position in the frequency band where the captured image is recognized as being in focus and the focus position obtained as a result of AF processing. For such an interchangeable lens 31, the individual difference is measured when the interchangeable lens 31 is manufactured, and the measured value is stored in the recording area (EEPROM) of the interchangeable lens.

図11〜図13は図1に示す交換レンズにおける個体差の測定結果の一例を説明するための図である。   11 to 13 are diagrams for explaining an example of measurement results of individual differences in the interchangeable lens shown in FIG.

BP補正値を求めるためのパラメータは、画面中心に対して水平方向および垂直方向ともに正負の範囲における値を有するものとする。設計値と異なって製造誤差は交換レンズ31の光学系を構成する各レンズの中心位置のずれおよび傾きによって、正の方向および負の方向の光学的な特性が変わる。このため、BP補正値も変わることになる。   The parameter for obtaining the BP correction value is assumed to have a value in a positive / negative range in both the horizontal direction and the vertical direction with respect to the center of the screen. Unlike the design value, the optical error in the positive direction and the negative direction varies depending on the deviation and inclination of the center position of each lens constituting the optical system of the interchangeable lens 31. For this reason, the BP correction value also changes.

図11〜図13には、ズームポジションがZoom(0)=Wide、フォーカス位置:遠、水平(H)の例が示されているが、同様の形式のデータが、複数のズームポジション(Wide、Middle1、Middle2、Tele)、フォーカス位置(遠、中、近)、および方向(水平、垂直)毎に備えられている。その値は各項目における設計値との差分が記録されている。   FIGS. 11 to 13 show an example in which the zoom position is Zoom (0) = Wide, and the focus position is far and horizontal (H). However, data in a similar format includes a plurality of zoom positions (Wide, (Middle1, Middle2, Tele), focus position (far, middle, near) and direction (horizontal, vertical). The difference between the value and the design value in each item is recorded.

BP補正値を求めるためのパラメータは該当する部分のみが、ステップS128において合焦位置算出の前に交換レンズ31から取得される。なお、製造誤差情報を有する交換レンズ21が装着された場合には、毎回製造誤差情報を取得してBP補正値を算出する。つまり、同一のレンズIDであっても個々の交換レンズによって製造誤差情報が異なるためである。また、同一の交換レンズであっても修理などのメンテナンスによって製造誤差情報が変わる。   Only the relevant parameter for obtaining the BP correction value is acquired from the interchangeable lens 31 before the in-focus position is calculated in step S128. When the interchangeable lens 21 having manufacturing error information is attached, the manufacturing error information is acquired every time and the BP correction value is calculated. That is, even if the lens ID is the same, manufacturing error information varies depending on each interchangeable lens. In addition, even for the same interchangeable lens, manufacturing error information changes depending on maintenance such as repair.

まず、交換レンズ31を装着した際、EEPROM19に該当するデータが存在しない場合には、CPU15は交換レンズ31から設計値に基づくBP補正値を求めるためのパラメータを取得して、EEPROM19に記録する。設計値に起因するBP補正値に関する情報は、前述の図8〜図10で説明したように、被写体の空間周波数毎の結像位置の基準に対する差として記録されている。   First, when the interchangeable lens 31 is attached, if there is no corresponding data in the EEPROM 19, the CPU 15 acquires a parameter for obtaining a BP correction value based on the design value from the interchangeable lens 31 and records it in the EEPROM 19. Information regarding the BP correction value resulting from the design value is recorded as a difference with respect to the reference of the imaging position for each spatial frequency of the subject, as described above with reference to FIGS.

BP補正値の演算は前述のステップS128で行われる。この時点では、ズームポジション、フォーカス位置、およびAF枠の像高は確定しているので、CPU15はその状態における設計値に基づくBP補正値をEEPROM19から読み出すパラメータから求める。   The calculation of the BP correction value is performed in step S128 described above. At this time, since the zoom position, the focus position, and the image height of the AF frame are fixed, the CPU 15 obtains a BP correction value based on the design value in that state from parameters read from the EEPROM 19.

さらに、CPU15は、上記の状態における製造誤差に起因するBP補正値を求めるためのパラメータを交換レンズ31から取得する。但し、像高に関しては、記録された像高以外の値を必要とする場合があるので、隣接する座標のパラメータも用いるために隣接する座標のパラメータも取得する。その後、CPU15は製造誤差に起因するパラメータからBP補正値を求める。そして、CPU15は、設計値に起因するBP補正値と製造誤差に起因するBP補正値の合計値を新たなBP補正値とする。   Further, the CPU 15 acquires a parameter for obtaining a BP correction value resulting from the manufacturing error in the above state from the interchangeable lens 31. However, since the image height may require a value other than the recorded image height, the adjacent coordinate parameter is also acquired in order to use the adjacent coordinate parameter. Thereafter, the CPU 15 obtains a BP correction value from the parameter resulting from the manufacturing error. Then, the CPU 15 sets a total value of the BP correction value caused by the design value and the BP correction value caused by the manufacturing error as a new BP correction value.

ここで、設計値に起因するBP補正値と製造誤差に起因するBP補正値を求める手順について説明する。   Here, a procedure for obtaining the BP correction value caused by the design value and the BP correction value caused by the manufacturing error will be described.

まず、CPU15は確定したズームポジション、フォーカス位置、および像高の設計値に基づくパラメータからBP補正値を求める。設計値に基づくBP補正値BP(x,y,zoom.focus)_designは、像高に関して隣接する座標のBP補正値から補間計算を行うなど製造誤差情報を備えない交換レンズ31の場合と同様にして求められる。   First, the CPU 15 obtains a BP correction value from parameters based on the determined zoom position, focus position, and image height design value. The BP correction value BP (x, y, zoom. Focus) _design based on the design value is the same as that of the interchangeable lens 31 having no manufacturing error information, such as performing interpolation calculation from the BP correction value of the adjacent coordinates with respect to the image height. Is required.

位相差AF処理においてA像およびB像を取得した領域の中心座標、スキャンAF処理におけるAF枠の中心座標を(x,y)とする。この際、像高(x,y)(但し、設計値に起因するBP補正量は像高に関しては正の値として扱う)、ズームポジション=Zoom、およびフォーカス位置=focusにおける設計値に基づくBP補正値BP(x,y,zoom.focus)_designは、次の式(24)で得られる。   Let (x, y) be the center coordinates of the area from which the A and B images have been acquired in the phase difference AF process, and the center coordinates of the AF frame in the scan AF process. At this time, BP correction based on the design value at the image height (x, y) (however, the BP correction amount due to the design value is treated as a positive value with respect to the image height), zoom position = Zoom, and focus position = focus. The value BP (x, y, zoom. Focus) _design is obtained by the following equation (24).

Figure 2016061803
Figure 2016061803

但し、BP(x,0,zoom.focus)は設計値に起因するBP補正値の水平方向像高の成分、BP(0,y,zoom.focus)は設計値に起因するBP補正値の垂直方向像高の成分である。   However, BP (x, 0, zoom. Focus) is a component of the horizontal image height of the BP correction value resulting from the design value, and BP (0, y, zoom. Focus) is the vertical of the BP correction value resulting from the design value. It is a component of the direction image height.

0≦x≦x1の時には、BP(x,0,zoom.focus)は次の式(25)で示される。   When 0 ≦ x ≦ x1, BP (x, 0, zoom. Focus) is expressed by the following equation (25).

BP(x,0,zoom.focus)=BP(0,0,zoom.focus)+[BP(x1,0,zoom.focus)−BP(0,0,zoom.focus)]×x÷x1 (25)
x1<x≦x2の時には、BP(x,0,zoom.focus)は次の式(26)で示される。
BP (x, 0, zoom.focus) = BP (0,0, zoom.focus) + [BP (x1,0, zoom.focus) −BP (0,0, zoom.focus)] × x ÷ x1 ( 25)
When x1 <x ≦ x2, BP (x, 0, zoom.focus) is expressed by the following equation (26).

BP(x,0,zoom.focus)=BP(x1,0,zoom.focus)+[BP(x2,0,zoom.focus)−BP(x1,0,zoom.focus)]×(x−x1)÷(x2−x1) (26)
x2<xの時には、BP(x,0,zoom.focus)は次の式(27)で示される。
BP (x, 0, zoom.focus) = BP (x1,0, zoom.focus) + [BP (x2,0, zoom.focus) −BP (x1,0, zoom.focus)] × (x−x1 ) ÷ (x2−x1) (26)
When x2 <x, BP (x, 0, zoom. focus) is expressed by the following equation (27).

BP(x,0,zoom.focus)=BP(x2,0,zoom.focus) (27)
0≦y≦y1の時には、BP(0,y,zoom.focus)は次の式(28)で示される。
BP (x, 0, zoom.focus) = BP (x2,0, zoom.focus) (27)
When 0 ≦ y ≦ y1, BP (0, y, zoom. Focus) is expressed by the following equation (28).

BP(0,y,zoom.focus)=BP(0,0,zoom.focus)+[BP(0,y1,zoom.focus)−BP(0,0,zoom.focus)]×y÷y1 (28)
y1<y≦y2の時には、BP(0,y,zoom.focus)は次の式(29)で示される。
BP (0, y, zoom.focus) = BP (0,0, zoom.focus) + [BP (0, y1, zoom.focus) −BP (0,0, zoom.focus)] × y ÷ y1 ( 28)
When y1 <y ≦ y2, BP (0, y, zoom. focus) is expressed by the following equation (29).

BP(0,y,zoom.focus)=BP(0,y1,zoom.focus)+[BP(0,y2,zoom.focus)−BP(0,y1,zoom.focus)]×(y−y1)÷(y2−y1) (29)
y2<yの時には、BP(0,y,zoom.focus)は次の式(30)で示される。
BP (0, y, zoom. Focus) = BP (0, y1, zoom. Focus) + [BP (0, y2, zoom. Focus) −BP (0, y1, zoom. Focus)] × (y−y1 ) ÷ (y2-y1) (29)
When y2 <y, BP (0, y, zoom. focus) is expressed by the following equation (30).

BP(0,y,zoom.focus)=BP(0,y2,zoom.focus)
(30)
また、設計値に起因するBP補正値の水平方向の像高の成分および垂直方向の像高の成分は、次の式(31)および式(32)、各条件の被写体周波数freqAFにおけるピント位置、および被写体周波数freqImgにおけるピント位置の差として求められる。
BP (0, y, zoom.focus) = BP (0, y2, zoom.focus)
(30)
Further, the horizontal image height component and the vertical image height component of the BP correction value resulting from the design value are expressed by the following expressions (31) and (32), the focus position at the subject frequency freqAF in each condition, And the difference in focus position at the subject frequency freqImg.

BP(x,0,zoom.focus)=Pxy(x,0,freqImg)―Pxy(x,0,freqAF) (31)
BP(0,y,zoom.focus)=Pxy(0,y,freqImg)―Pxy(0,y,freqAF) (32)
なお、各条件とは、ズームポジション、フォーカス位置、および補間前の像高をいう。
BP (x, 0, zoom.focus) = Pxy (x, 0, freqImg) −Pxy (x, 0, freqAF) (31)
BP (0, y, zoom. Focus) = Pxy (0, y, freqImg) −Pxy (0, y, freqAF) (32)
Each condition means a zoom position, a focus position, and an image height before interpolation.

被写体周波数freqAFにおけるピント位置および被写体周波数freqImgにおけるピント位置はそれぞれ式(33)および式(34)で表される。   The focus position at the subject frequency freqAF and the focus position at the subject frequency freqImg are expressed by equations (33) and (34), respectively.

Pxy(x,y,freqAF)=WgAF×gPxy(x,y,freqAF)+WrAF×rPxy(x,y,freqAF)+WbAF×bPxy(x,y,freqAF) (33)
Pxy(x,y,freqImg)=WhImg×{WgImg×gPxyH(x,y,freqImg)+WrImg×rPxyH(x,y,freqImg)+WbImg×bPxyH(x,y,freqImg)}+WvImg×{WgImg×gPxyV(x,y,freqImg)+WrImg×rPxyV(x,y,freqImg)+WbImg×bPxyV(x,y,freqImg)} (34)
但し、freqAFはAF処理で使用する周波数帯域であり、freqβとfreqαとの間に存在するとする。また、gPxy(x,y,freqAF)、rPxy(x,y,freqAF)、およびbPxy(x,y,freqAF)はそれぞれ色成分Green、Red、およびBlueによる像高(x、y)におけるピント値で、それぞれ式(35)〜式(37)で表される。
Pxy (x, y, freqAF) = WgAF × gPxy (x, y, freqAF) + WrAF × rPxy (x, y, freqAF) + WbAF × bPxy (x, y, freqAF) (33)
Pxy (x, y, freqImg) = WhImg × {WgImg × gPxyH (x, y, freqImg) + WrImg × rPxyH (x, y, freqImg) + WbImg × bPxyH (x, y, freqImg)} + WvImg × {WxImg × g x, y, freqImg) + WrImg × rPxyV (x, y, freqImg) + WbImg × bPxyV (x, y, freqImg)} (34)
However, it is assumed that freqAF is a frequency band used for AF processing and exists between freqβ and freqα. Also, gPxy (x, y, freqAF), rPxy (x, y, freqAF), and bPxy (x, y, freqAF) are focus values at image heights (x, y) by the color components Green, Red, and Blue, respectively. And are represented by Formula (35) to Formula (37), respectively.

gPxy(x,y,freqAF)=gPxyH(x,y,freqα)+(freqAF―freqα)×[gPxyH(x,y,freqβ)―gPxyH(x,y,freqα)]÷(freqβ―freqα) (35)
rPxy(x,y,freqAF)=rPxyH(x,y,freqα)+(freqAF―freqα)×[rPxyH(x,y,freqβ)―rPxyH(x,y,freqα)]÷(freqβ―freqα) (36)
bPxy(x,y,freqAF)=bPxyH(x,y,freqα)+(freqAF―freqα)×[bPxyH(x,y,freqβ)―bPxyH(x,y,freqα)]÷(freqβ―freqα) (37)
また、WgAF、WrAF、およびWbAFは、それぞれGreea成分、Red成分、およびBlue成分のAF評価値を求める際の各色成分の比率であって、WgAF+WrAF+WbAF=1である。なお、freqImgは撮影画像の周波数帯域でfreqβとfreqαとの間に存在するとする。
gPxy (x, y, freqAF) = gPxyH (x, y, freqα) + (freqAF−freqα) × [gPxyH (x, y, freqβ) −gPxyH (x, y, freqα)] ÷ (freqβ−freqα) ( 35)
rPxy (x, y, freqAF) = rPxyH (x, y, freqα) + (freqAF−freqα) × [rPxyH (x, y, freqβ) −rPxyH (x, y, freqα)] ÷ (freqβ−freqα) ( 36)
bPxy (x, y, freqAF) = bPxyH (x, y, freqα) + (freqAF−freqα) × [bPxyH (x, y, freqβ) −bPxyH (x, y, freqα)] ÷ (freqβ−freqα) ( 37)
WgAF, WrAF, and WbAF are ratios of the respective color components when obtaining the AF evaluation values of the Greea component, the Red component, and the Blue component, and WgAF + WrAF + WbAF = 1. It is assumed that freqImg exists between freqβ and freqα in the frequency band of the captured image.

gPxyH(x,y,freqImg)、rPxyH(x,y,freqImg)、およびbPxyH(x,y,freqImg)はそれぞれ色成分Green、Red、およびBlueによる像高(x、y)における水平方向のピント値で、次の式(38)〜式(40)で表される。   gPxyH (x, y, freqImg), rPxyH (x, y, freqImg), and bPxyH (x, y, freqImg) are respectively focused in the image height (x, y) by the color components Green, Red, and Blue. The value is expressed by the following formula (38) to formula (40).

gPxyH(x,y,freqImg)=gPxyH(x,y,freqα)+(freqImg―freqα)×[gPxyH(x,y,freqβ)―gPxyH(x,y,freqα)]÷(freqβ―freqα) (38)
rPxyH(x,y,freqImg)=rPxyH(x,y,freqα)+(freqImg―freqα)×[rPxyH(x,y,freqβ)―rPxyH(x,y,freqα)]÷(freqβ―freqα) (39)
bPxyH(x,y,freqImg)=bPxyH(x,y,freqα)+(freqImg―freqα)×[bPxyH(x,y,freqβ)―bPxyH(x,y,freqα)] ÷(freqβ―freqα) (40)
gPxyV(x,y,freqImg)、rPxyV(x,y,freqImg)、およびbPxyV(x,y,freqImg)はそれぞれの色成分における像高(x、y)の垂直方向のピント値であって、次の式(41)〜式(43)で表される。
gPxyH (x, y, freqImg) = gPxyH (x, y, freqα) + (freqImg−freqα) × [gPxyH (x, y, freqβ) −gPxyH (x, y, freqα)] ÷ (freqβ−freqα) ( 38)
rPxyH (x, y, freqImg) = rPxyH (x, y, freqα) + (freqImg−freqα) × [rPxyH (x, y, freqβ) −rPxyH (x, y, freqα)] ÷ (freqβ−freqα) ( 39)
bPxyH (x, y, freqImg) = bPxyH (x, y, freqα) + (freqImg−freqα) × [bPxyH (x, y, freqβ) −bPxyH (x, y, freqα)] ÷ (freqβ−freqα) ( 40)
gPxyV (x, y, freqImg), rPxyV (x, y, freqImg), and bPxyV (x, y, freqImg) are vertical focus values of the image height (x, y) in the respective color components, It is represented by the following formulas (41) to (43).

gPxyV(x,y,freqImg)=gPxyV(x,y,freqα)+(freqImg―freqα)×[gPxyV(x,y,freqβ)―gPxyV(x,y,freqα)]÷(freqβ―freqα) (41)
rPxyV(x,y,freqImg)=rPxyV(x,y,freqα)+(freqImg―freqα)×[rPxyV(x,y,freqβ)―rPxyV(x,y,freqα)]÷(freqβ―freqα) (42)
bPxyV(x,y,freqImg)=bPxyV(x,y,freqα)+(freqImg―freqα)×[bPxyV(x,y,freqβ)―bPxyV(x,y,freqα)]÷(freqβ―freqα) (43)
WhImgおよびWvImgは撮影画像を生成する際の水平および垂直成分の比率であり、WhImg+WvImg=1である。また、WgImg:WrImg:WbImgは撮影画像を生成する際の各色成分の比率であり、WgImg+WrImg+WbImg=1である。
gPxyV (x, y, freqImg) = gPxyV (x, y, freqα) + (freqImg−freqα) × [gPxyV (x, y, freqβ) −gPxyV (x, y, freqα)] ÷ (freqβ−freqα) ( 41)
rPxyV (x, y, freqImg) = rPxyV (x, y, freqα) + (freqImg−freqα) × [rPxyV (x, y, freqβ) −rPxyV (x, y, freqα)] ÷ (freqβ−freqα) ( 42)
bPxyV (x, y, freqImg) = bPxyV (x, y, freqα) + (freqImg−freqα) × [bPxyV (x, y, freqβ) −bPxyV (x, y, freqα)] ÷ (freqβ−freqα) ( 43)
WhImg and WvImg are the ratios of the horizontal and vertical components when generating a captured image, and WhImg + WvImg = 1. WgImg: WrImg: WbImg is the ratio of each color component when generating a captured image, and WgImg + WrImg + WbImg = 1.

CPU15は、上記の状態における製造誤差情報に基づいてBP補正値を求める。像高に関しては、軸ずれおよび面倒れによって製造誤差に起因する設計値のBP補正量は原点対象にならないので、像高は符号付きで扱って製造誤差に起因するBP補正量が求められる。   The CPU 15 obtains a BP correction value based on the manufacturing error information in the above state. With respect to the image height, the BP correction amount of the design value resulting from the manufacturing error due to the axis deviation and the surface tilt is not the origin, so the image height is handled with a sign and the BP correction amount resulting from the manufacturing error is obtained.

よって、製造誤差に基づくBP補正値を求めるためのパラメータとして記録するのは中心のxy座標を(0,0)とした時の座標(0,0)、(x1,0)、(x2,0)、(0,y1)、(0,y2)、(−x1,0)、(−x2,0)、(0,−y1)、(0,−y2)の値である。   Therefore, the coordinates (0,0), (x1,0), (x2,0) when the center xy coordinates are (0,0) are recorded as parameters for obtaining the BP correction value based on the manufacturing error. ), (0, y1), (0, y2), (−x1, 0), (−x2, 0), (0, −y1), and (0, −y2).

算出の際には、確定したズームポジション、フォーカス位置、および像高の製造誤差に基づくパラメータを用いて行う。また、像高に関して隣接する座標のBP補正値から補間計算が行われる。   The calculation is performed using parameters based on the determined zoom position, focus position, and image height manufacturing error. Further, interpolation calculation is performed from the BP correction value of the adjacent coordinates with respect to the image height.

位相差AF処理においてA像およびB像を取得した領域の中心座標、スキャンAF処理においてAF枠の中心座標を(x,y)とする。像高(x,y)(但し、製造誤差に起因するBP補正量は像高に関しては符号付きの値として扱う)、ズームポジション=Zoom、フォーカス位置=focusにおける製造誤差に基づくBP補正値BP(x,y,zoom.focus)_manufactは、次の式(44)で求められる。   Let (x, y) be the center coordinates of the area where the A and B images are acquired in the phase difference AF process, and the center coordinates of the AF frame in the scan AF process. Image height (x, y) (however, the BP correction amount caused by the manufacturing error is treated as a signed value with respect to the image height), the BP correction value BP (based on the manufacturing error at the zoom position = Zoom, the focus position = focus) x, y, zoom.focus) _manufact is obtained by the following equation (44).

Figure 2016061803
Figure 2016061803

但し、BP(x,0,zoom.focus)_manufactは製造誤差に起因するBP補正値の水平方向像高の成分、BP(0,y,zoom.focus)_manufactは製造誤差に起因するBP補正値の垂直方向像高の成分である。   However, BP (x, 0, zoom. Focus) _manufact is a component of the horizontal image height of the BP correction value caused by the manufacturing error, and BP (0, y, zoom. Focus) _manufact is a BP correction value caused by the manufacturing error. Of the vertical image height.

0≦x≦x1の時には、BP(x,0,zoom.focus)_manufactは次の式(45)で表される。   When 0 ≦ x ≦ x1, BP (x, 0, zoom. Focus) _manufact is expressed by the following equation (45).

BP(x,0,zoom.focus)_manufact=BP(0,0,zoom.focus)_manufact+[BP(x1,0,zoom.focus)_manufact−BP(0,0,zoom.focus)_manufact]×x÷x1 (45)
−x1≦x≦0の時には、BP(x,0,zoom.focus)_manufactは次の式(46)で表される。
BP (x, 0, zoom.focus) _manufact = BP (0,0, zoom.focus) _manufact + [BP (x1,0, zoom.focus) _manufact-BP (0,0, zoom.focus) _manfact) × manfact ÷ x1 (45)
When −x1 ≦ x ≦ 0, BP (x, 0, zoom. Focus) _manufact is expressed by the following equation (46).

BP(x,0,zoom.focus)_manufact=BP(0,0,zoom.focus)_manufact−[BP(−x1,0,zoom.focus)_manufact−BP(0,0,zoom.focus)_manufact]×x÷x1 (46)
x1<x≦x2の時には、BP(x,0,zoom.focus)_manufactは次の式(47)で表される。
BP (x, 0, zoom.focus) _manufact = BP (0,0, zoom.focus) _manufact- [BP (-x1,0, zoom.focus) _manufact-BP (0,0, zoom.fucact) _muc_act] _m × x ÷ x1 (46)
When x1 <x ≦ x2, BP (x, 0, zoom. focus) _manufact is expressed by the following equation (47).

BP(x,0,zoom.focus)_manufact=BP(x1,0,zoom.focus)_manufact+[BP(x2,0,zoom.focus)_manufact−BP(x1,0,zoom.focus)_manufact]×(x−x1)÷(x2−x1) (47)
−x2≦x<−x1の時には、BP(x,0,zoom.focus)_manufactは次の式(48)で表される。
BP (x, 0, zoom.focus) _manufact = BP (x1,0, zoom.focus) _manufact + [BP (x2,0, zoom.focus) _manufact-BP (x1,0, zoom.focus) _man () x−x1) ÷ (x2−x1) (47)
When −x2 ≦ x <−x1, BP (x, 0, zoom. Focus) _manufact is expressed by the following equation (48).

BP(x,0,zoom.focus)_manufact=BP(−x1,0,zoom.focus)_manufact−[BP(−x2,0,zoom.focus)_manufact−BP(−x1,0,zoom.focus)_manufact]×(x−x1)÷(x2−x1) (48)
x2<xの時には、BP(x,0,zoom.focus)_manufactは次の式(49)で表される。
BP (x, 0, zoom.focus) _manufact = BP (-x1,0, zoom.focus) _manufact- [BP (-x2,0, zoom.focus) _manufact-BP (-x1,0, zoom.focus) _Manufact] × (x−x1) ÷ (x2−x1) (48)
When x2 <x, BP (x, 0, zoom.focus) _manufact is expressed by the following equation (49).

BP(x,0,zoom.focus)_manufact=BP(x2,0,zoom.focus)_manufact (49)
x<−x2の時には、BP(x,0,zoom.focus)_manufactは次の式(50)で表される。
BP (x, 0, zoom.focus) _manufact = BP (x2,0, zoom.focus) _manufact (49)
When x <−x2, BP (x, 0, zoom. focus) _manufact is expressed by the following equation (50).

BP(x,0,zoom.focus)_manufact=BP(−x2,0,zoom.focus)_manufact (50)
0≦y≦y1の時には、BP(0,y,zoom.focus)_manufactは次の式(51)で表される。
BP (x, 0, zoom.focus) _manufact = BP (−x2,0, zoom.focus) _manufact (50)
When 0 ≦ y ≦ y1, BP (0, y, zoom. Focus) _manufact is expressed by the following equation (51).

BP(y,0,zoom.focus)_manufact=BP(0,0,zoom.focus)_manufact_ manufact+[BP(y1,0,zoom.focus)_manufact−BP(0,0,zoom.focus)_manufact]×y÷y1 (51)
−y1≦y≦0の時には、BP(0,y,zoom.focus)_manufactは次の式(52)で表される。
BP (y, 0, zoom.focus) _manufact = BP (0,0, zoom.focus) _manufact_manufact + [BP (y1,0, zoom.focus) _manufact-BP (0,0, zooc_foc_foc_foc_foc_foc_foc_foc. y ÷ y1 (51)
When −y1 ≦ y ≦ 0, BP (0, y, zoom. Focus) _manufact is expressed by the following equation (52).

BP(y,0,zoom.focus)_manufact=BP(0,0,zoom.focus)_manufact−[BP(−y1,0,zoom.focus)_manufact−BP(0,0,zoom.focus)_manufact]×y÷y1 (52)
y1<y≦y2の時には、BP(0,y,zoom.focus)_manufactは次の式(53)で表される。
BP (y, 0, zoom.focus) _manufact = BP (0,0, zoom.focus) _manufact- [BP (-y1,0, zoom.focus) _manufact-BP (0,0, zoom.fuocus) _fucact_muc × y ÷ y1 (52)
When y1 <y ≦ y2, BP (0, y, zoom. focus) _manufact is expressed by the following equation (53).

BP(y,0,zoom.focus)_manufact=BP(y1,0,zoom.focus)_manufact+[BP(y2,0,zoom.focus)_manufact−BP(y1,0,zoom.focus)_manufact]×(y−y1)÷(y2−y1) (53)
−y2≦y<−y1の時には、BP(0,y,zoom.focus)_manufactは次の式(54)で表される。
BP (y, 0, zoom.focus) _manufact = BP (y1,0, zoom.focus) _manufact + [BP (y2,0, zoom.focus) _manufact-BP (y1,0, zoom.fucus) _man () y−y1) ÷ (y2−y1) (53)
When −y2 ≦ y <−y1, BP (0, y, zoom. Focus) _manufact is expressed by the following equation (54).

BP(y,0,zoom.focus)_manufact=BP(−y1,0,zoom.focus)_manufact−[BP(−y2,0,zoom.focus)_manufact−BP(−y1,0,zoom.focus)_manufact]×(y−y1)÷(y2−y1) (54)
y2<yの時には、BP(0,y,zoom.focus)_manufactは次の式(55)で表される。
BP (y, 0, zoom.focus) _manufact = BP (-y1,0, zoom.focus) _manufact- [BP (-y2,0, zoom.focus) _manufact-BP (-y1,0, zoom.focus) _Manufact] × (y−y1) ÷ (y2−y1) (54)
When y2 <y, BP (0, y, zoom. focus) _manufact is expressed by the following equation (55).

BP(y,0,zoom.focus)_manufact=BP(y2,0,zoom.focus)_manufact (55)
y<−y2の時には、BP(0,y,zoom.focus)_manufactは次の式(56)で表される。
BP (y, 0, zoom.focus) _manufact = BP (y2,0, zoom.focus) _manufact (55)
When y <−y2, BP (0, y, zoom. focus) _manufact is expressed by the following equation (56).

BP(y,0,zoom.focus)_manufact=BP(−y2,0,zoom.focus)_manufact(56)
また、製造誤差に起因するBP補正値の水平方向の像高成分および垂直方向の像高成分は、それぞれ式(57)および式(58)と、各条件、被写体周波数freqAFにおけるピント位置と、被写体周波数freqImgにおけるピント位置との差として求められる。
BP (y, 0, zoom.focus) _manufact = BP (−y2,0, zoom.focus) _manufact (56)
In addition, the horizontal image height component and the vertical image height component of the BP correction value caused by the manufacturing error are expressed by Expressions (57) and (58), the focus position at each object frequency freqAF, and the object, respectively. It is obtained as a difference from the focus position at the frequency freqImg.

BP(x,0,zoom.focus)_manufact=Pxy(x,0,freqImg)_manufact―Pxy(x,0,freqAF)_manufact
(57)
BP(0,y,zoom.focus)_manufact=Pxy(0,y,freqImg)_manufact―Pxy(0,y,freqAF)_manufact
(58)
なお、各条件とは、ズームポジション、フォーカス位置、および補間前の像高をいう。
BP (x, 0, zoom.focus) _manufact = Pxy (x, 0, freqImg) _manufact-Pxy (x, 0, freqAF) _manufact
(57)
BP (0, y, zoom.focus) _manufact = Pxy (0, y, freqImg) _manufact-Pxy (0, y, freqAF) _manufact
(58)
Each condition means a zoom position, a focus position, and an image height before interpolation.

被写体周波数freqAFにおけるピント位置および被写体周波数freqImgにおけるピント位置は、それぞれ式(59)および式(60)によって求められる。   The focus position at the subject frequency freqAF and the focus position at the subject frequency freqImg are obtained by Expressions (59) and (60), respectively.

Pxy(x,y,freqAF)_manufact=WgAF×gPxy(x,y,freqAF)+WrAF×rPxy(x,y,freqAF)+WbAF×bPxy(x,y,freqAF) (59)
Pxy(x,y,freqImg)_manufact=WhImg×{WgImg×gPxyH(x,y,freqImg+WrImg×rPxyH(x,y,freqImg)+WbImg×bPxyH(x,y,freqImg)}+WvImg×{WgImg×gPxyV(x,y,freqImg)+WrImg×rPxyV(x,y,freqImg)+WbImg×bPxyV(x,y,freqImg)}
(60)
但し、freqAFはAF処理で使用する周波数帯域でfreqβとfreqαとの間に存在するとする。gPxy(x,y,freqAF)、rPxy(x,y,freqAF)、およびbPxy(x,y,freqAF)は色成分Green、Red、およびBlueによる像高(x、y)におけるピント値であり、式(61)〜式(63)で表される。
Pxy (x, y, freqAF) _manufact = WgAF × gPxy (x, y, freqAF) + WrAF × rPxy (x, y, freqAF) + WbAF × bPxy (x, y, freqAF) (59)
Pxy (x, y, freqImg) _manufact = WhImg × {WgImg × gPxyH (x, y, freqImg + WrImg × rPxyH (x, y, freqImg) + WbImg × bPxyH (x, y, freqImg)} + WvImg × gxx , Y, freqImg) + WrImg × rPxyV (x, y, freqImg) + WbImg × bPxyV (x, y, freqImg)}
(60)
However, it is assumed that freqAF exists between freqβ and freqα in the frequency band used in the AF processing. gPxy (x, y, freqAF), rPxy (x, y, freqAF), and bPxy (x, y, freqAF) are focus values at the image height (x, y) by the color components Green, Red, and Blue, It represents with Formula (61)-Formula (63).

gPxy(x,y,freqAF)=gPxyH(x,y,freqα)+(freqAF―freqα)×[gPxyH(x,y,freqβ)―gPxyH(x,y,freqα)]÷(freqβ―freqα) (61)
rPxy(x,y,freqAF)=rPxyH(x,y,freqα)+(freqAF―freqα)×[rPxyH(x,y,freqβ)―rPxyH(x,y,freqα)]÷(freqβ―freqα) (62)
bPxy(x,y,freqAF)=bPxyH(x,y,freqα)+(freqAF―freqα)×[bPxyH(x,y,freqβ)―bPxyH(x,y,freqα)]÷(freqβ―freqα) (63)
WgAF、WrAF、WbAFはそれぞれGreea成分、Red成分、およびBlue成分のAF評価値を求める際の各色成分の比率で、WgAF+WrAF+WbAF=1である。freqImgは撮影画像の周波数帯域でfreqβとfreqαの間に存在するとする。
gPxy (x, y, freqAF) = gPxyH (x, y, freqα) + (freqAF−freqα) × [gPxyH (x, y, freqβ) −gPxyH (x, y, freqα)] ÷ (freqβ−freqα) ( 61)
rPxy (x, y, freqAF) = rPxyH (x, y, freqα) + (freqAF−freqα) × [rPxyH (x, y, freqβ) −rPxyH (x, y, freqα)] ÷ (freqβ−freqα) ( 62)
bPxy (x, y, freqAF) = bPxyH (x, y, freqα) + (freqAF−freqα) × [bPxyH (x, y, freqβ) −bPxyH (x, y, freqα)] ÷ (freqβ−freqα) ( 63)
WgAF, WrAF, and WbAF are ratios of the respective color components when obtaining the AF evaluation values of the Greea component, the Red component, and the Blue component, and WgAF + WrAF + WbAF = 1. It is assumed that freqImg exists between freqβ and freqα in the frequency band of the captured image.

gPxyH(x,y,freqImg)、rPxyH(x,y,freqImg)、およびbPxyH(x,y,freqImg)はそれぞれ色成分Green、Red、およびBlueによる像高(x、y)における水平方向のピント値であり、それぞれ式(64)〜式(66)で表される。   gPxyH (x, y, freqImg), rPxyH (x, y, freqImg), and bPxyH (x, y, freqImg) are respectively focused in the image height (x, y) by the color components Green, Red, and Blue. It is a value and is represented by Formula (64)-Formula (66), respectively.

gPxyH(x,y,freqImg)=gPxyH(x,y,freqα)+(freqImg―freqα)×[gPxyH(x,y,freqβ)―gPxyH(x,y,freqα)]÷(freqβ―freqα) (64)
rPxyH(x,y,freqImg)=rPxyH(x,y,freqα)+(freqImg―freqα)×[rPxyH(x,y,freqβ)―rPxyH(x,y,freqα)]÷(freqβ―freqα) (65)
bPxyH(x,y,freqImg)=bPxyH(x,y,freqα)+(freqImg―freqα)×[bPxyH(x,y,freqβ)―bPxyH(x,y,freqα)]÷(freqβ―freqα) (66)
gPxyV(x,y,freqImg)、rPxyV(x,y,freqImg)、およびbPxyV(x,y,freqImg)はそれぞれの色成分における像高(x、y)の垂直方向のピント値であり、式(67)〜式(69)で表される。
gPxyH (x, y, freqImg) = gPxyH (x, y, freqα) + (freqImg−freqα) × [gPxyH (x, y, freqβ) −gPxyH (x, y, freqα)] ÷ (freqβ−freqα) ( 64)
rPxyH (x, y, freqImg) = rPxyH (x, y, freqα) + (freqImg−freqα) × [rPxyH (x, y, freqβ) −rPxyH (x, y, freqα)] ÷ (freqβ−freqα) ( 65)
bPxyH (x, y, freqImg) = bPxyH (x, y, freqα) + (freqImg−freqα) × [bPxyH (x, y, freqβ) −bPxyH (x, y, freqα)] ÷ (freqβ−freqα) ( 66)
gPxyV (x, y, freqImg), rPxyV (x, y, freqImg), and bPxyV (x, y, freqImg) are vertical focus values of the image height (x, y) in the respective color components. It is represented by (67)-Formula (69).

gPxyV(x,y,freqImg)=gPxyV(x,y,freqα)+(freqImg―freqα)×[gPxyV(x,y,freqβ)―gPxyV(x,y,freqα)]÷(freqβ―freqα) (67)
rPxyV(x,y,freqImg)=rPxyV(x,y,freqα)+(freqImg―freqα)×[rPxyV(x,y,freqβ)―rPxyV(x,y,freqα)]÷(freqβ―freqα) (68)
bPxyV(x,y,freqImg)=bPxyV(x,y,freqα)+(freqImg―freqα)×[bPxyV(x,y,freqβ)―bPxyV(x,y,freqα)]÷(freqβ―freqα) (69)
WhImgおよびWvImgは撮影画像を生成する際の水平・垂直成分の比率であり、WhImg+WvImg=1である。WgImg:WrImg:WbImgは撮影画像を生成する際の各色成分の比率であり、WgImg+WrImg+WbImg=1である。
gPxyV (x, y, freqImg) = gPxyV (x, y, freqα) + (freqImg−freqα) × [gPxyV (x, y, freqβ) −gPxyV (x, y, freqα)] ÷ (freqβ−freqα) ( 67)
rPxyV (x, y, freqImg) = rPxyV (x, y, freqα) + (freqImg−freqα) × [rPxyV (x, y, freqβ) −rPxyV (x, y, freqα)] ÷ (freqβ−freqα) ( 68)
bPxyV (x, y, freqImg) = bPxyV (x, y, freqα) + (freqImg−freqα) × [bPxyV (x, y, freqβ) −bPxyV (x, y, freqα)] ÷ (freqβ−freqα) ( 69)
WhImg and WvImg are ratios of horizontal and vertical components when generating a captured image, and WhImg + WvImg = 1. WgImg: WrImg: WbImg is the ratio of each color component when generating a captured image, and WgImg + WrImg + WbImg = 1.

以上のようにして、設計値に起因するBP補正値BP(x,y,zoom.focus)_designと製造誤差に起因するBP補正値BP(x,y,zoom.focus)_manufactを求めた後、CPU15はその合計値を新たなBP補正値とする。   After obtaining the BP correction value BP (x, y, zoom. Focus) _design resulting from the design value and the BP correction value BP (x, y, zoom. Focus) _manufact resulting from the manufacturing error as described above, The CPU 15 sets the total value as a new BP correction value.

ここで、図2に示すステップS124で行われる位相差AF処理に関して説明する。   Here, the phase difference AF process performed in step S124 shown in FIG. 2 will be described.

図14は、図2に示す位相差AF処理の一例を説明するためのフローチャートである。   FIG. 14 is a flowchart for explaining an example of the phase difference AF process shown in FIG.

位相差AF処理を開始すると、位相差AF処理回路13はA/D変換回路5より出力される位相差AF用画像信号(出力信号)を位相差AF処理回路13の所定の記録領域に記録する(ステップS601)。そして、位相差AF処理回路13は、位相差AF用画像信号を修正する(ステップS602)。   When the phase difference AF processing is started, the phase difference AF processing circuit 13 records the phase difference AF image signal (output signal) output from the A / D conversion circuit 5 in a predetermined recording area of the phase difference AF processing circuit 13. (Step S601). Then, the phase difference AF processing circuit 13 corrects the phase difference AF image signal (step S602).

撮像素子3においては、位相差AFを行うための画素(焦点調整画素)が備えられているので、二次結像光学系で再結像させる場合のように像高による光束の相違によって生じる像の歪みを修正するフィールドレンズを結像面と撮像素子3との間に配置できない。また、焦点調整画素に入射する光束の瞳位置を制限するための絞りおよび不要な光束を遮断するためのマスクを結像面と撮像素子3との間に配置できない。このため、位相差AF用画像信号は画素毎にシェーディングおよびオフセットが異なり、像の補正が必要となる。   Since the imaging element 3 includes pixels (focus adjustment pixels) for performing phase difference AF, an image generated due to a difference in light flux depending on image height as in the case of re-imaging with a secondary imaging optical system. A field lens that corrects the distortion of the image cannot be disposed between the imaging plane and the image sensor 3. In addition, a diaphragm for limiting the pupil position of the light beam incident on the focus adjustment pixel and a mask for blocking the unnecessary light beam cannot be disposed between the imaging plane and the image sensor 3. For this reason, the image signal for phase difference AF has different shading and offset for each pixel, and image correction is required.

シェーディングは光軸中心からの画素の位置(像高)、撮影レンズの射出瞳位置、絞り、画素の開口部の位置によって異なる。このため、各要因に関して像修正量を備えて、要因に応じて焦点調整画素毎に像修正が行われる。   Shading varies depending on the position of the pixel (image height) from the center of the optical axis, the exit pupil position of the taking lens, the stop, and the position of the aperture of the pixel. For this reason, an image correction amount is provided for each factor, and image correction is performed for each focus adjustment pixel according to the factor.

また、オフセットは位相差AF用画像信号の増幅率、画素の開口部の位置、焦点調整画素の列アンプの特性によって異なる。このため、各要因に関して像修正量を備えて、要因に応じて焦点調整画素毎に像修正が行われる。   The offset varies depending on the amplification factor of the phase difference AF image signal, the position of the opening of the pixel, and the characteristics of the column amplifier of the focus adjustment pixel. For this reason, an image correction amount is provided for each factor, and image correction is performed for each focus adjustment pixel according to the factor.

像修正の手法については、例えば、特開2012−252280号公報に記載されているので、ここでは説明を省略する。   The image correction method is described in, for example, Japanese Patent Application Laid-Open No. 2012-252280, and thus the description thereof is omitted here.

続いて、位相差AF処理回路13は像修正された位相差AF用画素(焦点調整画素)について並び替えを行って、基準画像(A像)と参照画像(B像)とを生成する(ステップS603)。   Subsequently, the phase difference AF processing circuit 13 rearranges the image-corrected phase difference AF pixels (focus adjustment pixels) to generate a standard image (A image) and a reference image (B image) (step). S603).

図15は、図1に示す撮像素子3に備えられた位相差AF用画素(焦点調整画素)の配列についてその一例を示す図である。   FIG. 15 is a diagram illustrating an example of the arrangement of the phase difference AF pixels (focus adjustment pixels) provided in the image sensor 3 illustrated in FIG. 1.

図15において、「A」で示す画素は位相差AF画素(焦点調整画素)のうちA像を生成するための画素であり、「B」で示す画素は位相差AF画素のうちB像を生成するための画素である。そして、その他の画素は撮像画素である。   In FIG. 15, a pixel indicated by “A” is a pixel for generating an A image among phase difference AF pixels (focus adjustment pixels), and a pixel indicated by “B” generates a B image among phase difference AF pixels. It is a pixel for doing. The other pixels are imaging pixels.

位相差AF処理回路13には、「A」および「B」で示す位相差AF画素の出力に応じた画像信号が記録されることになる。撮像素子3においてその読み出しの順序は「A」、「B」、「A」、「B」、〜、「A」、「B」の順となっており、ステップS602で行われる像修正後においても同一の順序で位相差AF処理回路13の所定の記録領域に記録される。   The phase difference AF processing circuit 13 records an image signal corresponding to the output of the phase difference AF pixels indicated by “A” and “B”. In the imaging device 3, the reading order is “A”, “B”, “A”, “B”, to “A”, “B”, and after the image correction performed in step S602. Are also recorded in a predetermined recording area of the phase difference AF processing circuit 13 in the same order.

そこで、「A」で示す画素に対応する出力のみを抽出して、抽出した順序に並べてA像とする。同様に、「B」で示す画素に対応する出力のみを抽出して、抽出した順序に並べてB像とする。   Therefore, only the output corresponding to the pixel indicated by “A” is extracted and arranged in the extracted order to obtain an A image. Similarly, only the output corresponding to the pixel indicated by “B” is extracted and arranged in the extracted order to obtain a B image.

続いて、位相差AF処理回路13は相関演算を行う際に用いる初期値を設定する(ステップS604)。位相差AF処理回路37は、次の式(70)を用いて相関演算を行って、A像(aj+1)とB像(bj+k)との相関値を求める(ステップS605)。   Subsequently, the phase difference AF processing circuit 13 sets an initial value used when performing the correlation calculation (step S604). The phase difference AF processing circuit 37 performs correlation calculation using the following equation (70) to obtain a correlation value between the A image (aj + 1) and the B image (bj + k) (step S605).

Uk=Σmax(aj+1,bj+k)−Σmax(aj,bj+k+1)
(70)
ここで、max(a,b)はaおよびbのうち大きい方を採用する演算である。また、kは相関演算を行う像ずらし量、jは相関演算を行う画素数であり、ステップS604で初期化される。
Uk = Σmax (aj + 1, bj + k) −Σmax (aj, bj + k + 1)
(70)
Here, max (a, b) is an operation that employs the larger of a and b. Further, k is an image shift amount for performing the correlation calculation, and j is the number of pixels for which the correlation calculation is performed, and is initialized in step S604.

次に、CPU15はA像とB像との相関値を位相差AF処理回路13から得て記録する。そして、CPU15は既に記録されている相関値があれば、直前に記録した相関値と今回の相関値との符号が等しいか調べる(ステップS606)。そして、CPU15は符号が反転しているか又は今回取得した相関値が零であるか否かを判定する(ステップS607)。   Next, the CPU 15 obtains and records the correlation value between the A image and the B image from the phase difference AF processing circuit 13. If there is a correlation value already recorded, the CPU 15 checks whether or not the signs of the correlation value recorded immediately before and the current correlation value are the same (step S606). Then, the CPU 15 determines whether the sign is inverted or whether the correlation value acquired this time is zero (step S607).

符号が反転しているか又は今回取得した相関値が零であると(ステップS607において、YES)、CPU15は位相差AF処理結果(つまり、相関値)の信頼性を判定する(ステップS608)。   If the sign is inverted or the correlation value acquired this time is zero (YES in step S607), the CPU 15 determines the reliability of the phase difference AF processing result (that is, the correlation value) (step S608).

ステップS608の処理では、位相差AF処理で合焦可能、位相差AF処理では合焦が可能ではないが信頼性は比較的高くデフォーカス量の周辺に合焦位置がある、信頼性は低くデフォーカス量の方向は信頼できるがその量は信頼できない、そして、信頼性は極めて低くデフォーカス量の方向および量とも信頼ができない4つのいずれに該当するかが判定される。   In the process of step S608, focusing is possible with the phase difference AF process, and focusing is not possible with the phase difference AF process, but the reliability is relatively high, and there is an in-focus position around the defocus amount, and the reliability is low. The direction of the focus amount is reliable but the amount is not reliable, and the reliability is extremely low, and it is determined which of the four defocus amount directions and amounts cannot be trusted.

この判定は、デフォーカス量、デフォーカス量を求める際に用いたA像およびB像の信号レベル、およびA像とB像の類似度を用いて行われる。まず、CPU15はA像およびB像の信号レベルを調べて、その信号レベルを所定値と比較する。ここでは、CPU15は、A像の信号レベルの最大値と最小値の差、B像の信号レベルの最大値と最小値の差のうち小さい方を求めて、これを信号レベルのピークボトム値(PB値)とする。   This determination is performed using the defocus amount, the signal levels of the A and B images used when obtaining the defocus amount, and the similarity between the A and B images. First, the CPU 15 checks the signal levels of the A and B images and compares the signal levels with a predetermined value. Here, the CPU 15 obtains the smaller one of the difference between the maximum value and the minimum value of the signal level of the A image and the difference between the maximum value and the minimum value of the signal level of the B image, and calculates this as the peak bottom value ( PB value).

続いて、CPU15は、A像およびB像の類似度を表わす指数FLVLを算出する。ここでは、2つの相関量(相関値)Ma(k)およびMi(k)を次の式(71)および式(72)を用いて求める。   Subsequently, the CPU 15 calculates an index FLVL representing the similarity between the A image and the B image. Here, two correlation amounts (correlation values) Ma (k) and Mi (k) are obtained using the following equations (71) and (72).

Ma(k)=Σmax(aj,bj+k) (71)
Mi(k)=Σmain(aj,bj+k) (72)
ここで、max(a,b)はaおよびbのうち大きい方を採用する演算であり、min(a,b)はaおよびbのうち小さい方を採用する演算である。
Ma (k) = Σmax (aj, bj + k) (71)
Mi (k) = Σmain (aj, bj + k) (72)
Here, max (a, b) is an operation that employs the larger one of a and b, and min (a, b) is an operation that employs the smaller of a and b.

類似度が高く、A像とB像とが一致していれば、Ma(k)とMi(k)が等しくなる像ずらし量が存在する。しかしながら、実際には両者が等しくなる像ずらし量が整数でないことが多い。また、撮像素子3の出力信号に生じるノイズおよびA像を構成する画素とB像を構成する画素とが異なることなどによってA像とB像が完全に一致することは稀である。よって、Ma(k)とMi(k)とが等しくなることはほとんどない。   If the similarity is high and the A and B images match, there is an image shift amount in which Ma (k) and Mi (k) are equal. In practice, however, the image shift amount at which both are equal is often not an integer. In addition, it is rare that the A image and the B image completely coincide with each other due to noise generated in the output signal of the image sensor 3 and the difference between the pixels constituting the A image and the pixels constituting the B image. Therefore, Ma (k) and Mi (k) are hardly equal.

そこで、式(70)で相関値を計算した結果、K=l(スモールエル)とK=l+1(スモールエル+1)との間で相関量Ukの符号が反転したとした際、CPU15は、Ma(l)―Mi(l)とMa(l+1)―Mi(l+1)とを求め、その小さい方をA像およびB像の類似度を表わす指数FLVLとする。   Therefore, as a result of calculating the correlation value using the equation (70), when the sign of the correlation amount Uk is inverted between K = 1 (small L) and K = 1 + 1 (small L + 1), the CPU 15 (L) -Mi (l) and Ma (l + 1) -Mi (l + 1) are obtained, and the smaller one is used as an index FLVL representing the similarity between the A and B images.

PB値およびFLVLを求めた後、CPU15は、次の表に従って位相差AF処理の信頼性判定を行う。   After obtaining the PB value and FLVL, the CPU 15 determines the reliability of the phase difference AF process according to the following table.

Figure 2016061803
Figure 2016061803

合焦可能とは、位相差AF処理の結果、PB値が第1PB閾値以上でかつFLVLが第ぬFLVL閾値以下の場合において、デフォーカス量dが第1所定範囲以内で、位相差AF処理の結果のみで合焦可能の場合である。   “Focus is possible” means that when the PB value is greater than or equal to the first PB threshold and the FLVL is less than or equal to the first FLVL threshold, the defocus amount d is within the first predetermined range and the phase difference AF process is performed. This is a case where focusing is possible only with the result.

略合焦可能とは、位相差AF処理の結果、PB値が第2PB閾値以上で第1PB閾値未満、かつFLVLが第1FLVL閾値以下の場合において、合焦が可能ではないが信頼性は比較的高くデフォーカス量dの周辺に合焦位置があると判定できる場合である。   The term “substantially in focus” means that when the PB value is greater than or equal to the second PB threshold and less than the first PB threshold and the FLVL is less than or equal to the first FLVL threshold, focusing is not possible but the reliability is relatively This is a case where it can be determined that the in-focus position is high around the defocus amount d.

方向検出可能とは、位相差AF処理の結果、PB値が第3PB閾値以上で第2PB閾値未満、かつFLVLが第2FLVL閾値以下の場合において、又はPB値が第3PB閾値以上でかつFLVLが第1FLVL閾値を超え第2FLVL閾値以下の場合において、信頼性は低くデフォーカス量の方向は信頼できるがその量は信頼できない場合である。   Direction detection is possible when the PB value is greater than or equal to the third PB threshold and less than the second PB threshold and FLVL is less than or equal to the second FLVL threshold, or when the PB value is greater than or equal to the third PB threshold and FLVL is greater than the second PB threshold. In the case of exceeding the 1FLVL threshold and not more than the second FLVL threshold, the reliability is low and the direction of the defocus amount is reliable, but the amount is not reliable.

NGとは、位相差AF処理の結果、PB値が第3PB閾値未満又はFLVLが第2FLVL閾値を超えている場合において、信頼性は極めて低く検出されたデフォーカス量の方向および量とも信頼できない場合である。   NG is the result of phase difference AF processing, when the PB value is less than the third PB threshold value or the FLVL exceeds the second FLVL threshold value, and the reliability and the direction and amount of the detected defocus amount are not reliable It is.

ここでは、合焦可能、略合焦可能、および方向検出可能が信頼性ありとされる。   Here, it is considered reliable that focusing is possible, substantially focusing is possible, and direction detection is possible.

CPU15は、上述のようにして、位相差AF処理結果(つまり、相関値)に信頼性があるか否かを判定する(ステップS609)。位相差AF処理結果に信頼性があると(ステップS609において、YES)、CPU15は相関値が零になる像ずらし量を求める(ステップS610)。   As described above, the CPU 15 determines whether or not the phase difference AF processing result (that is, the correlation value) is reliable (step S609). If the phase difference AF processing result is reliable (YES in step S609), CPU 15 obtains an image shift amount at which the correlation value becomes zero (step S610).

ところで、相関値を求める際には、1画素ずつずらして相関演算が行われるので、位相差AF処理回路13において求められた相関値が零になることは稀である。そこで、CPU15は符号が異なる2つの相関値とそのずらし量とから相関値が零となる像ずらす量を求める。   By the way, when calculating the correlation value, the correlation calculation is performed by shifting one pixel at a time. Therefore, it is rare that the correlation value calculated by the phase difference AF processing circuit 13 becomes zero. Therefore, the CPU 15 obtains an image shift amount at which the correlation value becomes zero from two correlation values having different signs and the shift amount.

式(70)で相関値を求めた結果、K=l(スモールエル)とK=l+1(スモールエル+1)との間で相関量Ukの符号が反転したとする。CPU15は直線補間によって相関値が零となる像ずらす量δを、次の式(73)によって求める(ステップS610)。   As a result of obtaining the correlation value by the equation (70), it is assumed that the sign of the correlation amount Uk is inverted between K = 1 (small L) and K = 1 + 1 (small L + 1). The CPU 15 obtains an image shift amount δ at which the correlation value becomes zero by linear interpolation using the following equation (73) (step S610).

δ=l+|Ul|÷[|Ul|+|Ul+1|] (73)
但し、|z|はzの絶対値である。
δ = l + | Ul | ÷ [| Ul | + | Ul + 1 |] (73)
However, | z | is the absolute value of z.

続いて、CPU15は、式(74)によって像ずれ量δからプレディクション量Pを求める。   Subsequently, the CPU 15 obtains the prediction amount P from the image shift amount δ by the equation (74).

P=δ―Δ (74)
但し、Δは合焦時の像ずれ量である。
P = δ−Δ (74)
However, Δ is an image shift amount at the time of focusing.

次に、CPU15は交換レンズ31の特性から定まる基線長を用いて、プレディクション量Pからデフォーカス量d(フォーカスレンズ群の移動量と方向)を、式(75)によって求める(ステップS611)。そして、CPU15は位相差AF処理を終了する。   Next, the CPU 15 obtains the defocus amount d (the amount and direction of movement of the focus lens group) from the prediction amount P by using the base line length determined from the characteristics of the interchangeable lens 31 (step S611). Then, the CPU 15 ends the phase difference AF process.

d=K×P (75)
但し、Kはデフォーカス量に変換する係数(K値)であり、交換レンズ31の焦点距離、絞り34の値、像高に依存する値である。EEPROM19にK値をパラメータとするテーブルが記録されており、CPU15は当該テーブルを参照してデフォーカス量を求める。
d = K × P (75)
However, K is a coefficient (K value) to be converted into a defocus amount, and is a value depending on the focal length of the interchangeable lens 31, the value of the diaphragm 34, and the image height. A table using the K value as a parameter is recorded in the EEPROM 19, and the CPU 15 refers to the table to obtain the defocus amount.

相関値の符号が反転しておらず、かつ今回取得した相関値が零でないと(ステップS607において、NO)、CPU15は相関値を求める際の終端値になったか否かを判定する(像ずらし位置終端:ステップS612)。   If the sign of the correlation value is not inverted and the correlation value acquired this time is not zero (NO in step S607), the CPU 15 determines whether or not the terminal value for obtaining the correlation value has been reached (image shift). Position end: Step S612).

終端値になると(ステップS612において、YES)、CPU15は位相差AF処理がNGであるする(ステップS613)。そして、CPU15は位相差AF処理を終了する。   When the terminal value is reached (YES in step S612), the CPU 15 determines that the phase difference AF process is NG (step S613). Then, the CPU 15 ends the phase difference AF process.

一方、終端値になっていないと(ステップS613において、NO)、CPU15はずらし量kをk=k+1に更新する(ステップS614)。そして、処理はステップS605に戻る。   On the other hand, if the terminal value is not reached (NO in step S613), the CPU 15 updates the shift amount k to k = k + 1 (step S614). Then, the process returns to step S605.

なお、位相差AF処理結果に信頼性がないと(ステップS609において、NO)、CPU15はステップS612の処理に進む。   If the phase difference AF process result is not reliable (NO in step S609), the CPU 15 proceeds to the process of step S612.

このように、本発明の第1の実施形態では、合焦可能であるか否かを判定して、この判定タイミングでBP補正値を得るようにしたので、交換レンズからのデータ取得に頻度を少なくして、かつ高速にBP補正値を算出することができる。   As described above, in the first embodiment of the present invention, whether or not focusing is possible is determined, and the BP correction value is obtained at this determination timing. Therefore, the frequency of data acquisition from the interchangeable lens is increased. The BP correction value can be calculated at a high speed with less.

[第2の実施形態]
続いて、本発明の第2の実施形態による焦点検出装置を備えるカメラの一例について説明する。なお、第2の実施形態に係るカメラの構成は図1に示すカメラと同様である。
[Second Embodiment]
Next, an example of a camera provided with the focus detection apparatus according to the second embodiment of the present invention will be described. The configuration of the camera according to the second embodiment is the same as that of the camera shown in FIG.

第2の実施形態においては、位相差AF処理およびスキャンAF処理で用いられるAF枠が複数存在する。   In the second embodiment, there are a plurality of AF frames used in the phase difference AF process and the scan AF process.

図16は、本発明の第2の実施形態に係るカメラで設定されるAF枠の一例を示す図である。   FIG. 16 is a diagram illustrating an example of an AF frame set by the camera according to the second embodiment of the present invention.

図示の例では、画面上に3つのAF枠00、01、および02が設定されている。ここでは、AF枠00には遠距離の背景が対応しており、AF枠01には中間距離の樹木が対応している。そして、AF枠02には主被写体である近距離の人物被写体が対応している。   In the illustrated example, three AF frames 00, 01, and 02 are set on the screen. Here, a long-distance background corresponds to the AF frame 00, and an intermediate-distance tree corresponds to the AF frame 01. The AF frame 02 corresponds to a short-distance human subject that is the main subject.

図16に示すAF枠の設定は一例であり、例えば、水平方向にAF枠を9つ、垂直方向にAF枠を7つ格子状に配置して、合計63のAF枠を二次元的に設定するようにしてもよい。さらには、任意の位置に離散的に複数のAF枠を設定するようにしてもよい。   The setting of the AF frame shown in FIG. 16 is an example. For example, nine AF frames are arranged in a horizontal pattern in the horizontal direction and seven AF frames are arranged in a vertical pattern, and a total of 63 AF frames are set two-dimensionally. You may make it do. Furthermore, a plurality of AF frames may be set discretely at an arbitrary position.

図17Aおよび図17Bは、本発明の第2の実施形態に係るカメラで行われる撮影動作を説明するためのフローチャートである。   FIG. 17A and FIG. 17B are flowcharts for explaining the photographing operation performed by the camera according to the second embodiment of the present invention.

なお、図17Aおよび図17Bにおいて、図2に示すフローチャートのステップと同一のステップについて同一の参照符号を付して、説明を省略する。   In FIGS. 17A and 17B, the same steps as those in the flowchart shown in FIG.

ステップS123において、AE処理が行われた後、CPU15は、位相差AF処理回路13を用いて位相差AF処理を行う(ステップS901)。ステップS901の処理においては、SW1がオンする前に得た各AF枠に対応する領域から抽出したA像およびB像が用いられる。そして、全てのAF枠に関して位相差AF処理が行われる。   After the AE process is performed in step S123, the CPU 15 performs the phase difference AF process using the phase difference AF processing circuit 13 (step S901). In the process of step S901, the A and B images extracted from the area corresponding to each AF frame obtained before SW1 is turned on are used. Then, phase difference AF processing is performed for all AF frames.

次に、CPU15はAF枠毎に位相差AF処理の結果によって合焦可能か否かを判定する(ステップS902)。ここでは、第1の実施形態で説明したように、デフォーカス量およびその信頼性に基づいて合焦可能であるか否かが判定される。   Next, the CPU 15 determines whether or not focusing is possible based on the result of the phase difference AF processing for each AF frame (step S902). Here, as described in the first embodiment, whether or not focusing is possible is determined based on the defocus amount and its reliability.

デフォーカス量を求める際に用いたA像およびB像の信号レベルが所定値以上あってA像およびB像に類似度があるとされ、かつデフォーカス量が第1デフォーカス量所定値以下の場合には、CPU15は焦点調整画素の出力を用いた位相差AF処理結果によって合焦可能であると判定する。   The signal levels of the A image and the B image used for obtaining the defocus amount are equal to or greater than a predetermined value, and the A image and the B image are similar, and the defocus amount is equal to or less than the first defocus amount predetermined value. In this case, the CPU 15 determines that focusing is possible based on the phase difference AF processing result using the output of the focus adjustment pixel.

いずれか1つのAF枠について合焦可能であると(ステップS902において、YES)、CPU15は、第1の実施形態で説明したようにして全てのAF枠について位相差AF用のBP補正値を得る(ステップS903)。   If focusing is possible for any one of the AF frames (YES in step S902), the CPU 15 obtains BP correction values for phase difference AF for all the AF frames as described in the first embodiment. (Step S903).

この時点でBP補正値を取得するのは次の理由による。デフォーカス量が零の位置にフォーカスレンズ群33を駆動した後、他のAF枠にさらに近側にデフォーカス量が零となるフォーカスレンズ群33の位置が検出されたとする。この場合、当該位置は位相差AF処理の誤測距による可能性がある。   The reason why the BP correction value is acquired at this time is as follows. Assume that after the focus lens group 33 is driven to a position where the defocus amount is zero, the position of the focus lens group 33 where the defocus amount is zero is detected closer to the other AF frame. In this case, there is a possibility that the position is due to erroneous distance measurement of the phase difference AF process.

このような場合に、誤測距の位置にフォーカスレンズ群33を移動した時点では、フォーカスレンズ群33の位置が更新されているので正しいBP補正値を取得することができない。また、BP補正値を取得するためにフォーカスレンズ群33を再度駆動すると、その分、位相差AF処理に要する時間が長くなってしまう。   In such a case, when the focus lens group 33 is moved to the erroneous distance measurement position, the correct BP correction value cannot be obtained because the position of the focus lens group 33 is updated. Further, when the focus lens group 33 is driven again in order to acquire the BP correction value, the time required for the phase difference AF process becomes longer accordingly.

続いて、CPU15は合焦可能と判定できないAF枠について、合焦可能と判定されたAF枠の被写体よりも近側の被写体が存在するAF枠があるか否かを調べる(ステップS904)。そして、CPU15は該当するAF枠が存在するか否かを判定する(ステップS905)。   Subsequently, the CPU 15 checks whether or not there is an AF frame in which there is an object closer to the subject of the AF frame determined to be in focus for the AF frame that cannot be determined to be in focus (step S904). Then, the CPU 15 determines whether or not the corresponding AF frame exists (step S905).

ステップS905においては、CPU15は合焦可能と判定できないAF枠に関する位相差AF処理結果に基づいて判定する。ここでは、合焦可能と判定できないAF枠において、合焦可能ではないが信頼性が比較的高く、検出されたデフォーカス量におけるフォーカスレンズ群3の位置の周辺に合焦位置があると判定できるとする。この場合には、当該位置が合焦可能と判定されたAF枠のデフォーカス量より近側である場合には、CPU15は近側の被写体が存在する可能性があると判定する。また、デフォーカス量の方向が信頼でき、その方向が近側である場合にも、CPU15は近側の被写体が存在する可能性があると判定する。   In step S905, the CPU 15 makes a determination based on the phase difference AF processing result regarding the AF frame that cannot be determined to be in focus. Here, in an AF frame that cannot be determined to be in focus, it is not possible to focus, but the reliability is relatively high, and it can be determined that there is a focus position around the position of the focus lens group 3 in the detected defocus amount. And In this case, if the position is closer to the defocus amount of the AF frame determined to be in focus, the CPU 15 determines that there is a possibility that a near subject exists. Also, when the direction of the defocus amount is reliable and the direction is the near side, the CPU 15 determines that there is a possibility that the near subject exists.

さらに、近側からAF処理を開始した場合には、デフォーカス量が零となるフォーカスレンズ群33の位置が装着された交換レズの撮影可能範囲の至近端に近いと、CPU15は該当するAF枠が存在すると判定する。   Further, when the AF process is started from the near side, if the position of the focus lens group 33 in which the defocus amount is zero is close to the closest end of the shootable range of the attached lens, the CPU 15 determines that the corresponding AF It is determined that a frame exists.

該当するAF枠が存在しないと(ステップS905において、NO)、CPU15は図2に示すステップS128で行った合焦位置算出を行う。   If there is no corresponding AF frame (NO in step S905), the CPU 15 performs the in-focus position calculation performed in step S128 shown in FIG.

該当するAF枠が存在すると(ステップS905において、YES)、CPU15は撮像素子3のセンサー駆動モードを変更して、スキャンAF処理回路12によって全てのAF枠についてスキャンAF処理を行う(ステップS906)。   If there is a corresponding AF frame (YES in step S905), the CPU 15 changes the sensor drive mode of the image sensor 3, and the scan AF processing circuit 12 performs scan AF processing on all AF frames (step S906).

ここでは、スキャンAF処理の高速化のため、撮像素子3で実現可能な最速のフレームレートにセンサー駆動モードに変更する。前述のように、センサー駆動モードの変更は一度のみ行われ、2度目以降のスキャンAF処理ではセンサー駆動モードの変更は行わない。AF処理が終了すると、例えば、ステップS129のAF表示を行うタイミングで元のセンサー駆動モードに戻す。 その後、CPU15はスキャンAF処理結果によって合焦可能であるか否かを判定する(ステップS907)。そして、全てのAF枠で合焦可能でないと(ステップS907において、NO)、CPU15はステップS901の処理に戻って再び位相差AF処理を行う。   Here, in order to speed up the scan AF process, the sensor drive mode is changed to the fastest frame rate that can be realized by the image sensor 3. As described above, the sensor drive mode is changed only once, and the sensor drive mode is not changed in the second and subsequent scan AF processes. When the AF process ends, for example, the original sensor drive mode is restored at the timing of performing the AF display in step S129. Thereafter, the CPU 15 determines whether or not focusing is possible based on the scan AF processing result (step S907). If focus cannot be achieved with all AF frames (NO in step S907), the CPU 15 returns to the process in step S901 and performs the phase difference AF process again.

一方、いずれか1つのAF枠で合焦可能であると(ステップS907において、YES)、CPU15は、第1の実施形態と同様にして、全てのAF枠に関してスキャンAF処理に係るBP補正値を得る(ステップS908)。   On the other hand, if focusing is possible with any one of the AF frames (YES in step S907), the CPU 15 sets the BP correction value related to the scan AF process for all the AF frames in the same manner as in the first embodiment. Obtain (step S908).

この時点でBP補正値を取得するのは次の理由による。スキャンAFの信頼性が低く端までスキャンした結果、それ以前に検出したAF評価値が極大値となるフォーカスレンズ群33の位置にBP補正量を加算した位置を合焦位置とする場合があるからである。   The reason why the BP correction value is acquired at this time is as follows. As a result of scanning to the end with low reliability of scan AF, there is a case where a position obtained by adding the BP correction amount to the position of the focus lens group 33 where the AF evaluation value detected before that is the maximum value is set as the focus position. It is.

このような場合、スキャン端までスキャンした時点ではフォーカスレンズ群33の位置が更新されているので、正しいBP補正値を取得することができない。また、BP補正値を取得するためにフォーカスレンズ群33を再度駆動すると、その分スキャンAF処理に要する時間が長くなる。   In such a case, the correct BP correction value cannot be acquired because the position of the focus lens group 33 has been updated at the time of scanning up to the scanning end. Further, when the focus lens group 33 is driven again in order to acquire the BP correction value, the time required for the scan AF process is increased accordingly.

続いて、CPU15は、合焦可能と判定できないAF枠について、合焦可能と判定されたAF枠の被写体より近側の被写体が存在するAF枠があるか否かを調べる(ステップS909)。そして、CPU15は該当するAF枠が存在するか否かを判定する(ステップS910)。   Subsequently, the CPU 15 checks whether or not there is an AF frame in which there is a subject closer to the subject of the AF frame determined to be in focus for the AF frame that cannot be determined to be in focus (step S909). Then, the CPU 15 determines whether or not the corresponding AF frame exists (step S910).

該当するAF枠が存在するか否かを判定する際には、例えば、合焦可能と判定できないAF枠に係るAF評価値の形状に基づいて判定が行われる。AF枠に係るAF評価値が近側のスキャンポイントにおいて増加している場合又は減少している場合でもその減少量が小さい場合には、CPU15は近側にAF評価値の極大値が存在する可能性があると判定する。   When determining whether or not the corresponding AF frame exists, for example, the determination is performed based on the shape of the AF evaluation value related to the AF frame that cannot be determined to be in focus. If the AF evaluation value related to the AF frame is increasing or decreasing at the near-side scan point, but the amount of decrease is small, the CPU 15 may have a local maximum AF evaluation value. Judge that there is sex.

また、AF評価値の極大値が求められておらず、かつAF評価値のレベルが高い場合には、CPU15は近側にスキャンを継続した場合にAF評価値の極大値が存在する可能性があると判定する。   Further, when the maximum value of the AF evaluation value is not obtained and the level of the AF evaluation value is high, there is a possibility that the maximum value of the AF evaluation value exists when the CPU 15 continues the scan to the near side. Judge that there is.

近側からスキャンAF処理を開始した場合には、基本的には当該判定を行う必要はないが、AF評価値が極大値となるフォーカスレンズ群33の位置が装着された交換レズの撮影可能範囲の至近端に近い場合には、CPU15は該当するAF枠が存在すると判定する。   When the scan AF process is started from the near side, it is not necessary to perform the determination basically, but the photographic range of the exchangeable lens in which the position of the focus lens group 33 at which the AF evaluation value becomes the maximum value is mounted. If it is close to the closest end of the, the CPU 15 determines that the corresponding AF frame exists.

該当するAF枠が存在すると(ステップS910において、YES)、CPU15はステップS901の処理に戻って、再度位相差AF処理を行う。一方、該当するAF枠が存在しないと(ステップS910において、NO)、CPU15はステップS128の処理に進んで、合焦位置の算出を行う。   If the corresponding AF frame exists (YES in step S910), the CPU 15 returns to the process of step S901 and performs the phase difference AF process again. On the other hand, if the corresponding AF frame does not exist (NO in step S910), the CPU 15 proceeds to the process of step S128 and calculates the in-focus position.

なお、ステップSS902の処理において、全てのAF枠について合焦可能でないと(ステップS902において、NO)、CPU15は、ステップS906の処理に進み、スキャンAF処理を行う。   If it is not possible to focus on all AF frames in the process of step SS902 (NO in step S902), the CPU 15 proceeds to the process of step S906 and performs a scan AF process.

上記の一連のAF処理は、位相差AF処理とスキャンAF処理を独立的に完結させるのではなく、いずれか一方のAF処理において少なくとも1つのAF枠について合焦可能となって、かつ当該AF枠より近側に被写体の存在するAF枠が存在しないと判定されるまで行われる。   In the series of AF processes described above, the phase difference AF process and the scan AF process are not completed independently, but at least one AF frame can be focused in any one of the AF processes, and the AF frame This is performed until it is determined that there is no AF frame in which the subject is present on the nearer side.

図18は、本発明の第2の実施形態によるカメラで行われる一連のAF処理を説明するための図である。   FIG. 18 is a diagram for explaining a series of AF processes performed by the camera according to the second embodiment of the present invention.

図18に示す例では、図16に示すようにして被写体が存在し、AF枠00では、無限遠(∞)位置(図18に示す位置「F」)において、位相差AF処理で得られるデフォーカス量が零となるか又はスキャンAF処理で得られるAF評価値が極大値となる。   In the example shown in FIG. 18, the subject exists as shown in FIG. 16, and in the AF frame 00, the data obtained by the phase difference AF process at the infinity (∞) position (position “F” shown in FIG. 18). The focus amount becomes zero or the AF evaluation value obtained by the scan AF process becomes a maximum value.

また、AF枠01では、中間距離(図18に示す位置「E」)において位相差AF処理で得られるデフォーカス量が零となるか又はスキャンAF処理で得られるAF評価値が極大値となる。そして、AF枠02では、近距離(図18に示す位置「D」)において位相差AF処理で得られるデフォーカス量が零となるか又はスキャンAF処理で得られるAF評価値が極大値となる。   In the AF frame 01, the defocus amount obtained by the phase difference AF process becomes zero or the AF evaluation value obtained by the scan AF process becomes a maximum value at an intermediate distance (position “E” shown in FIG. 18). . In the AF frame 02, the defocus amount obtained by the phase difference AF process becomes zero or the AF evaluation value obtained by the scan AF process becomes a maximum value at a short distance (position “D” shown in FIG. 18). .

図18に示す位置「D」のように、位相差AF処理結果によって合焦可能で、かつ当該AF枠より近側の被写体が位置するAF枠が存在しない場合には(ケース0)、図17Bに示すステップS901、S902、S903、S904、S905、およびS128の順に処理が進む。CPU15は位相差AF処理の結果得られたデフォーカス量が零となるフォーカスレンズ群33の位置に、ステップS903で得た位相差AF用のBP補正値を加算して合焦位置とする。そして、CPU15は当該合焦位置にフォーカスレンズ群33を制御する。   In the case where there is no AF frame that can be focused according to the phase difference AF processing result and the subject closer to the AF frame is present (case 0) as in the position “D” shown in FIG. The process proceeds in the order of steps S901, S902, S903, S904, S905, and S128 shown in FIG. The CPU 15 adds the BP correction value for phase difference AF obtained in step S903 to the position of the focus lens group 33 where the defocus amount obtained as a result of the phase difference AF process becomes zero to obtain a focus position. Then, the CPU 15 controls the focus lens group 33 to the in-focus position.

例えば、図16に示す例では、初期位置(図18に示す位置「A」)において、少なくともAF枠02において合焦可能と判定されると、AF枠00およびAF枠01で合焦可能と判定されても、AF枠02について位相差AFの結果得られるデフォーカス量が零のフォーカスレンズ群33の位置が最も近側の被写体の位置と判定できる。このため、AF枠02について得られたデフォーカス量が零となるフォーカスレンズ群33の位置を用いて合焦動作を行えばよい。   For example, in the example shown in FIG. 16, when it is determined that focusing is possible at least in the AF frame 02 at the initial position (position “A” shown in FIG. 18), it is determined that focusing is possible in the AF frame 00 and the AF frame 01. Even so, the position of the focus lens group 33 with zero defocus obtained as a result of the phase difference AF for the AF frame 02 can be determined as the position of the closest subject. For this reason, the focusing operation may be performed using the position of the focus lens group 33 where the defocus amount obtained for the AF frame 02 is zero.

また、位相差AF処理の結果、合焦可能なAF枠は存在せず、いずれか1つのAF枠で合焦が可能ではないが、信頼性は比較的高く検出されたデフォーカス量のフォーカスレンズ群3の位置の周辺に合焦位置があると判断できる場合がある(ケース1)。この場合には、次の動作が行われる。   Further, as a result of the phase difference AF process, there is no focusable AF frame, and focusing is not possible with any one of the AF frames, but the focus lens has a defocus amount detected with relatively high reliability. In some cases, it can be determined that there is an in-focus position around the position of group 3 (case 1). In this case, the following operation is performed.

まず、CPU15は位相差AF処理の結果に応じたスキャン開始位置にフォーカスレンズ群33を移動する。位相差AF処理の結果、AF枠02において合焦可能ではないが、信頼性は比較的高く、検出されたデフォーカス量のフォーカスレンズ群3の位置の周辺に合焦位置があると判定できるとする。この場合、CPU15は現在位置(図18に示す初期位置「A」)から、検出されたデフォーカス位置から所定量だけ現在位置に近い位置(図18に示す位置「B」)にフォーカスレンズ群3を移動する。   First, the CPU 15 moves the focus lens group 33 to a scan start position corresponding to the result of the phase difference AF process. As a result of the phase difference AF processing, focusing is not possible in the AF frame 02, but the reliability is relatively high, and it can be determined that there is a focusing position around the position of the focus lens group 3 of the detected defocus amount. To do. In this case, the CPU 15 moves the focus lens group 3 from the current position (initial position “A” shown in FIG. 18) to a position (position “B” shown in FIG. 18) that is close to the current position by a predetermined amount from the detected defocus position. To move.

AF枠02における位相差AF処理の結果ではフォーカスレンズ群33の移動位置を決定できない場合において、AF枠01において合焦可能ではないが信頼性は比較的高く、検出されたデフォーカス量のフォーカスレンズ群3の位置の周辺に合焦位置があると判定できるとする。この場合には、CPU15は現在位置(図18に示す初期位置「A」)から、検出されたデフォーカス位置から所定量だけ現在位置に近い位置(図18に示す位置「E‘」)にフォーカスレンズ群3を移動する。   When the movement position of the focus lens group 33 cannot be determined from the result of the phase difference AF process in the AF frame 02, the focus is not possible in the AF frame 01, but the reliability is relatively high, and the focus lens of the detected defocus amount Assume that it can be determined that there is an in-focus position around the position of group 3. In this case, the CPU 15 focuses from the current position (initial position “A” shown in FIG. 18) to a position (position “E ′” shown in FIG. 18) close to the current position by a predetermined amount from the detected defocus position. The lens group 3 is moved.

AF枠01およびAF枠02における位相差AF処理の結果ではフォーカスレンズ群33の移動位置を決定できない場合において、AF枠00において合焦可能ではないが信頼性は比較的高く、検出されたデフォーカス量のフォーカスレンズ群3の位置の周辺に合焦位置があると判断できるとする。この場合には、CPU15は現在位置(図18の初期位置「A」)から、検出されたデフォーカス位置から所定量だけ現在位置に近い位置(図18に示す位置「F‘」)にフォーカスレンズ群3を移動する。   When the movement position of the focus lens group 33 cannot be determined from the result of the phase difference AF process in the AF frame 01 and the AF frame 02, the AF frame 00 cannot be focused but is relatively reliable, and the detected defocus is detected. It is assumed that it is possible to determine that the in-focus position is around the position of the amount of the focus lens group 3. In this case, the CPU 15 moves the focus lens from the current position (initial position “A” in FIG. 18) to a position (position “F ′” shown in FIG. 18) that is close to the current position by a predetermined amount from the detected defocus position. Move group 3.

但し、AF枠01およびAF枠02における位相差AF処理の結果、初期位置より近側に被写体が存在すると判定された場合には、後述するケース2に該当するので、CPU15は図18に示す位置「F‘」にフォーカスレンズ群3の移動を行わない。   However, if it is determined as a result of the phase difference AF processing in the AF frame 01 and the AF frame 02 that the subject is present on the near side from the initial position, this corresponds to case 2 described later, and therefore the CPU 15 determines the position shown in FIG. The focus lens group 3 is not moved to “F ′”.

ここで、前述のステップS907の処理に進み、CPU15はスキャンAF処理で合焦可能か否かを判定する。前述のように、合焦可能であるとスッテプS908の処理に進むが、この段階では、未だスキャンAF処理は実質的に開始されていないので、合焦不可能と判定して、CPU15はステップS901の処理に戻る。   Here, the process proceeds to step S907 described above, and the CPU 15 determines whether or not focusing is possible in the scan AF process. As described above, if the in-focus state is possible, the process proceeds to step S908. However, at this stage, since the scan AF process has not substantially started yet, it is determined that the in-focus state is impossible, and the CPU 15 determines in step S901. Return to the process.

そして、ステップS901においては、図18に示す位置の「B」(又は図18に示す位置「E‘」)で得られる画像から抽出したA像及びB像を用いて位相差AF処理が行われる。初期位置(図18に示す位置「A」)よりAF枠01およびAF枠02における合焦位置へ近付いているので、A像およびB像の類似度とデフォーカス量などが合焦可能と判定される条件を満たす可能性がある。   In step S901, phase difference AF processing is performed using the A and B images extracted from the image obtained at the position “B” shown in FIG. 18 (or the position “E ′” shown in FIG. 18). . Since the focus position in the AF frame 01 and the AF frame 02 is approaching from the initial position (position “A” shown in FIG. 18), it is determined that the similarity between the A image and the B image, the defocus amount, and the like can be focused. There is a possibility that

このため、CPU15は、当該位置(図18に示す位置「B」又は位置「E‘」)で再度位相差AF処理を行う。なお、ここで行われる位相差AF処理は、ステップS906の前処理で設定された最速のフレームレートであるセンサー駆動モードで読み出した結果得られるA像およびB像を用いて行われる。   Therefore, the CPU 15 performs the phase difference AF process again at the position (position “B” or position “E ′” shown in FIG. 18). Note that the phase difference AF processing performed here is performed using the A and B images obtained as a result of reading in the sensor drive mode, which is the fastest frame rate set in the preprocessing in step S906.

そして、この位相差AF処理の結果で合焦可能と判定すると、CPU15はステップS903の処理に進んで、ステップS903〜S905の処理を行う。一方、合焦可能と判定できないと場合には、CPU15はステップS906の処理に進んで、再びスキャンAF処理を行う。   If the CPU 15 determines that focusing is possible based on the result of the phase difference AF process, the CPU 15 proceeds to the process of step S903 and performs the processes of steps S903 to S905. On the other hand, if it cannot be determined that focusing is possible, the CPU 15 proceeds to the process of step S906 and performs the scan AF process again.

既に前処理が行われているので、ここから、実際にスキャンAF処理が行われることになる。そして、スキャンAF処理回路12は図18に示す位置「B」又は位置「E‘」において得られるデジタル画像信号からAF評価値を求める。そして、CPU15は当該AF評価値を内蔵メモリに記録する。その後、CPU15は次にAF評価値を取得する位置にフォーカスレンズ群33を移動する。   Since pre-processing has already been performed, the scan AF processing is actually performed from here. Then, the scan AF processing circuit 12 obtains an AF evaluation value from the digital image signal obtained at the position “B” or the position “E ′” shown in FIG. Then, the CPU 15 records the AF evaluation value in the built-in memory. Thereafter, the CPU 15 moves the focus lens group 33 to a position where an AF evaluation value is acquired next.

続いて、CPU15は再びステップS901の処理に戻って、位相差AF処理回路13によって位相差AF処理を行う。その結果、位相差AF処理の結果で合焦可能と判定すると、CPU15はステップS903において位相差AF用のBP補正値を取得した後、S904の処理を行う。そして、CPU15は、ステップS905において合焦可能と判定されたAF枠より近側に被写体のあるAF枠があるか調べる。   Subsequently, the CPU 15 returns to the process of step S901 again, and performs the phase difference AF process by the phase difference AF processing circuit 13. As a result, when it is determined that focusing is possible based on the result of the phase difference AF process, the CPU 15 acquires the BP correction value for phase difference AF in step S903, and then performs the process of S904. Then, the CPU 15 checks whether there is an AF frame with a subject nearer to the AF frame determined to be in focus in step S905.

一方、合焦可能でない場合には、CPU15はステップS906においてスキャンAF処理回路12によってスキャンAF処理を行う。このようにしてスキャンAF処理を行う都度、AF評価値の取得、そして、フォーカスレンズ群3の移動が繰り返される。これによって、AF枠02におけるAF評価値が極大になるフォーカスレンズ群33の位置(図18に示す位置「D」)、AF枠02におけるAF評価値が極大となった後のAF評価値が小さくなり極大位置を過ぎたことを確認できる位置(図18に示す位置「C」)において、CPU15はAF評価値を取得することができる。   On the other hand, if the in-focus state is not possible, the CPU 15 performs scan AF processing by the scan AF processing circuit 12 in step S906. In this way, every time the scan AF process is performed, the acquisition of the AF evaluation value and the movement of the focus lens group 3 are repeated. Accordingly, the position of the focus lens group 33 at which the AF evaluation value in the AF frame 02 is maximized (position “D” shown in FIG. 18), and the AF evaluation value after the AF evaluation value in the AF frame 02 is maximized are small. At a position (position “C” shown in FIG. 18) where it can be confirmed that the maximum position has passed, the CPU 15 can acquire the AF evaluation value.

CPU15は、AF枠02において極大値を検出できると判定した時点(図11に示す位置「C」)においてフォーカスレンズ群33の駆動を終了する。そして、CPU15は、これまでに取得したAF評価値から、AF評価値が極大になる位置(図18に示す位置「D」)を求める。   The CPU 15 ends the driving of the focus lens group 33 at the time when it is determined that the maximum value can be detected in the AF frame 02 (position “C” shown in FIG. 11). Then, the CPU 15 obtains a position where the AF evaluation value is maximized (position “D” shown in FIG. 18) from the AF evaluation values acquired so far.

このAF評価値の取得は、スキャンAF処理を高速化するため、全てのフォーカスレンズ群33の停止位置については行われず、所定のスキャン間隔毎に行われる。この場合、図18に示す位置a1、a2、およびa3においてAF評価値が取得されることがある。このような場合には、AF評価値が最大値となった位置とその前後の位置のから、次の式(76)によってAF評価値が極大となる極大位置Dが求められる。   The acquisition of the AF evaluation value is not performed for the stop positions of all the focus lens groups 33 in order to speed up the scan AF process, but is performed at predetermined scan intervals. In this case, AF evaluation values may be acquired at positions a1, a2, and a3 shown in FIG. In such a case, the local maximum position D at which the AF evaluation value is maximum is obtained from the position where the AF evaluation value becomes the maximum value and the positions before and after the position, according to the following equation (76).

X0={(Y3−Y2)×X1+(Y3−Y1)×X2+(Y2−Y1)×X3}/{2×(Y3−Y1)} (76)
但し、フォーカスレンズ群33の位置がX1の時にAF評価値が極大になり、その値がY1である(図18に示す位置「a2」)。そして、その前後の位置X2、X3で取得したAF評価値がY2、Y3の時(図18に示す位置「a1」および「a3」)、極大位置「D」のフォーカスレンズ群33の位置をX0とし、Y1>Y3、Y1≧Y2とする。そして、ステップS908の処理において、CPU15は第1の実施形態と同様の手法で全てのAF枠に関してスキャンAF用のBP補正値を取得する。
X0 = {(Y3-Y2) * X1 + (Y3-Y1) * X2 + (Y2-Y1) * X3} / {2 * (Y3-Y1)} (76)
However, when the position of the focus lens group 33 is X1, the AF evaluation value becomes maximum, and the value is Y1 (position “a2” shown in FIG. 18). When the AF evaluation values acquired at the front and rear positions X2 and X3 are Y2 and Y3 (positions “a1” and “a3” shown in FIG. 18), the position of the focus lens group 33 at the maximum position “D” is set to X0. Y1> Y3 and Y1 ≧ Y2. In step S908, the CPU 15 acquires BP correction values for scan AF for all AF frames by the same method as in the first embodiment.

信頼性が十分でないと判定した場合には、CPU15はスキャンAF処理を継続する。つまり、ノイズなどで生じる偽の極大値を除外して、本来の極大値を検出するために行われる。なお、本来の極大値を検出することなく、フォーカスレンズ群33の移動範囲の端に達した場合には、CPU15はそこでフォーカスレンズ群33を停止して、スキャンAF処理では合焦不可能と判定する。   If it is determined that the reliability is not sufficient, the CPU 15 continues the scan AF process. That is, it is performed to detect the original maximum value by excluding the false maximum value caused by noise or the like. If the end of the movement range of the focus lens group 33 is reached without detecting the original maximum value, the CPU 15 stops the focus lens group 33 there and determines that the in-focus state cannot be obtained in the scan AF process. To do.

また、図18に示す例では、AF枠02についてAF評価値が極大になるフォーカスレンズ群33の位置(図18に示す位置「D」)を検出する前に、AF枠01についてAF評価値が極大になるフォーカスレンズ群33の位置(図18に示す位置E」)を検出する。この時点でさらに近側に被写体が存在するAF枠(AF枠02)が存在することが分かるので、CPU15はスキャンAF処理を継続する。   In the example shown in FIG. 18, the AF evaluation value for the AF frame 01 is detected before the position of the focus lens group 33 where the AF evaluation value becomes the maximum for the AF frame 02 (position “D” shown in FIG. 18) is detected. The position of the focus lens group 33 that is maximized (position E "shown in FIG. 18) is detected. At this point in time, it can be seen that there is an AF frame (AF frame 02) where the subject is present on the nearer side, so the CPU 15 continues the scan AF process.

一度目のステップS901における位相差AF処理の結果、合焦可能なAF枠又は周辺に合焦位置があると判定されるAF枠が存在しないとする。そして、いずれか1つのAF枠においては信頼性が低いデフォーカス量においてその方向は信頼できるがその量は信頼できないとする(ケース2)。この場合、CPU15は現在位置(図18に示す初期位置「A」)から検出されたデフォーカス量の方向にフォーカスレンズ群33を駆動する。この際の駆動量は、スキャンAFで極大位置が検出可能か間隔で、かつ所定時間間隔でAF評価値の取得が可能に設定される。これによって、次のAF評価値は図18に示す位置「b1」で取得される。   As a result of the first phase difference AF process in step S901, it is assumed that there is no AF frame that can be focused or an AF frame that is determined to have a focus position in the vicinity. In any one of the AF frames, it is assumed that the direction is reliable at a defocus amount with low reliability, but the amount is not reliable (Case 2). In this case, the CPU 15 drives the focus lens group 33 in the direction of the defocus amount detected from the current position (initial position “A” shown in FIG. 18). The driving amount at this time is set such that the AF evaluation value can be acquired at intervals of whether the maximum position can be detected by scan AF and at predetermined time intervals. As a result, the next AF evaluation value is acquired at the position “b1” shown in FIG.

例えば、最速のセンサー駆動モードにおいて次にAF評価値を取得する位置が深度の5倍程度になるようにフォーカスレンズ群33の駆動速度が設定される。   For example, the drive speed of the focus lens group 33 is set so that the position where the AF evaluation value is next acquired is about 5 times the depth in the fastest sensor drive mode.

そして、CPU15は、ステップS907の処理でスキャンAF処理において合焦可能であるか否かを判定する。いずれか1つのAF枠で合焦可能であると、CPU15はステップS908の処理に進む。一方、全てのAF枠で合焦可能でないと、CPU15はステップS901の処理に戻って再び位相差AF処理を行う。   Then, the CPU 15 determines whether or not focusing is possible in the scan AF process in the process of step S907. If focusing is possible with any one of the AF frames, the CPU 15 proceeds to the process of step S908. On the other hand, if focusing is not possible in all AF frames, the CPU 15 returns to the processing in step S901 and performs the phase difference AF processing again.

スッテプS901の処理では、CPU15は、位相差AF処理回路13によって所定量で合焦位置に近付いた図18に示す位置「b1」で得られる画像から抽出したA像及びB像を用いて位相差AF処理を行う。位相差AF処理の結果で合焦可能と判定すると、CPU15はステップS904に進み、ステップS904〜S905の処理を行う。   In the process of step S901, the CPU 15 uses the A and B images extracted from the image obtained at the position “b1” shown in FIG. 18 that is close to the in-focus position by a predetermined amount by the phase difference AF processing circuit 13. AF processing is performed. If it is determined that focusing is possible as a result of the phase difference AF process, the CPU 15 proceeds to step S904 and performs the processes of steps S904 to S905.

合焦可能ではないが信頼性は比較的高く、検出されたデフォーカス量のフォーカスレンズ群3の位置の周辺に合焦位置があると判定できる場合には、CPU15は検出されたデフォーカス位置から所定量だけ現在位置に近い位置(図18に示す位置「B」又は位置「E‘」)にフォーカスレンズ群33を移動する。   If the focus is not possible but the reliability is relatively high and it can be determined that the focus position is in the vicinity of the position of the focus lens group 3 with the detected defocus amount, the CPU 15 determines from the detected defocus position. The focus lens group 33 is moved to a position close to the current position by a predetermined amount (position “B” or position “E ′” shown in FIG. 18).

以下の動作は前述のケース1の場合と同様である。   The following operations are the same as in the case 1 described above.

上記2つ状態のいずれでもない場合には、CPU15はステップS906の処理に進んで、再びスキャンAF処理を行う。   If neither of the two states is present, the CPU 15 proceeds to the process of step S906 and performs the scan AF process again.

この場合、スキャンAF処理回路12は、図18に示す位置b1」において得られるデジタル画像信号からAF評価値を求める。そして、CPU15は当該AF評価値を内蔵メモリに記録する。その後、CPU15は次にAF評価値を取得する位置(図18に示す位置「b2」にフォーカスレンズ群33を移動する。   In this case, the scan AF processing circuit 12 obtains an AF evaluation value from the digital image signal obtained at the position b1 "shown in FIG. Then, the CPU 15 records the AF evaluation value in the built-in memory. Thereafter, the CPU 15 moves the focus lens group 33 to a position where an AF evaluation value is next acquired (position “b2” shown in FIG. 18).

そして、CPU15はステップS901の処理に再び戻って位相差AF処理を行って、ステップS902の処理で位相差AF処理の結果で合焦可能であるか否かを判定する。その後、CPU15は、ステップS904の処理で合焦可能と判定したAF枠より近側に被写体のあるAF枠が存在するか否かを調べる。   Then, the CPU 15 returns to the process of step S901 to perform the phase difference AF process, and determines whether or not focusing is possible based on the result of the phase difference AF process in the process of step S902. Thereafter, the CPU 15 checks whether or not there is an AF frame with a subject nearer to the AF frame determined to be in focus in the process of step S904.

合焦可能でない場合には、CPU15はステップS906でスキャンAF処理を行う。ここでも、検出されたデフォーカス量のフォーカスレンズ群3の位置の周辺に合焦位置があると判定できる場合には、CPU15は、検出されたデフォーカス位置から所定量だけ現在位置に近い位置(図18に示す「B」又は「E‘」)にフォーカスレンズ群3を移動する。   If the in-focus state is not possible, the CPU 15 performs a scan AF process in step S906. Here again, if it can be determined that the focus position is in the vicinity of the position of the focus lens group 3 of the detected defocus amount, the CPU 15 is positioned close to the current position by a predetermined amount from the detected defocus position ( The focus lens group 3 is moved to “B” or “E ′” shown in FIG.

このようにして、スキャンAF処理を行う都度、AF評価値の取得およびフォーカスレンズ群3の移動が繰り返される。よって、CPU15はAF評価値が極大になるフォーカスレンズ群33の位置(図18に示す位置「D」)、AF評価値が極大となった後にAF評価値が小さくなり極大位置を過ぎたことを確認できる位置(図18に示す位置「C」)におけるAF評価値を取得することができる。   In this way, each time the scan AF process is performed, the acquisition of the AF evaluation value and the movement of the focus lens group 3 are repeated. Therefore, the CPU 15 confirms that the position of the focus lens group 33 at which the AF evaluation value is maximized (position “D” shown in FIG. 18), the AF evaluation value becomes small after the AF evaluation value has become maximum, and has passed the maximum position. An AF evaluation value at a position that can be confirmed (position “C” shown in FIG. 18) can be acquired.

よって、前述のケース1と同様の処理を行い。CPU15はこれまでに取得したAF評価値から、AF評価値が極大になる位置(図18に示す位置「D」)を求める。   Therefore, the same processing as in case 1 described above is performed. The CPU 15 obtains a position where the AF evaluation value is maximized (position “D” shown in FIG. 18) from the AF evaluation values acquired so far.

信頼性が十分でないと判定した場合には、CPU15はスキャンAF処理を継続する。そして、本来の極大値を検出することなく、フォーカスレンズ群33が移動範囲の端に達した場合には、CPU15はそこでフォーカスレンズ群33を停止する。そして、CPU15はスキャンAF処理では合焦不可能と判定する。   If it is determined that the reliability is not sufficient, the CPU 15 continues the scan AF process. When the focus lens group 33 reaches the end of the movement range without detecting the original maximum value, the CPU 15 stops the focus lens group 33 there. Then, the CPU 15 determines that focusing is impossible in the scan AF process.

また、図18に示す例では、AF枠02でAF評価値が極大になるフォーカスレンズ群33の位置(図18に示す位置「D」)を検出する前に、CPU15はAF枠01でAF評価値が極大になるフォーカスレンズ群33の位置(図18に示す位置「E」)を検出する。この時点で、さらに近側に被写体が存在するAF枠(AF枠02)が存在することが分かるので、CPU15はスキャンAF処理を継続する。   In the example shown in FIG. 18, the CPU 15 performs AF evaluation with the AF frame 01 before detecting the position of the focus lens group 33 (position “D” shown in FIG. 18) where the AF evaluation value becomes maximum in the AF frame 02. The position (position “E” shown in FIG. 18) of the focus lens group 33 where the value is maximized is detected. At this point in time, it can be seen that there is an AF frame (AF frame 02) where the subject is present closer, so the CPU 15 continues the scan AF process.

一度目のスッテプS901において、位相差AF処理の結果、信頼性が極めて低く検出されたデフォーカス量の方向および量とも信頼できないとする(ケース3)。この場合には、CPU15は、現在位置(図18に示す初期位置「A」)から、当該位置に近いフォーカスレンズ群33の移動範囲の端にフォーカスレンズ群33を移動する。   In the first step S901, it is assumed that the direction and amount of the defocus amount detected as extremely low reliability as a result of the phase difference AF process are not reliable (case 3). In this case, the CPU 15 moves the focus lens group 33 from the current position (initial position “A” shown in FIG. 18) to the end of the movement range of the focus lens group 33 close to the position.

図18に示す例では、CPU15は無限遠側の移動範囲の端である図18に示す位置「I」にフォーカスレンズ群33を移動する。初期位置が図18に示す位置「C」などのように至近側の移動範囲の端である位置「N」に近い位置であれば、CPU15はフォーカスレンズ群33を位置「N」に移動する。   In the example shown in FIG. 18, the CPU 15 moves the focus lens group 33 to the position “I” shown in FIG. 18 which is the end of the moving range on the infinity side. If the initial position is close to the position “N” that is the end of the closest movement range, such as the position “C” shown in FIG. 18, the CPU 15 moves the focus lens group 33 to the position “N”.

そして、ここで、CPU15はステップS907の処理に進んで、スキャンAF処理で合焦可能であるか否かを判定する。合焦不可能と判定すると、CPU15はステップS901の処理に戻る。   Here, the CPU 15 proceeds to the process of step S907, and determines whether or not focusing is possible in the scan AF process. If it is determined that focusing is impossible, the CPU 15 returns to the process of step S901.

ステップS901の処理では、CPU15は、位相差AF処理回路13によって、図18に示す位置「I」で得られる画像デジタル信号から抽出したA像およびB像を用いて位相差AF処理を行う。位相差AF処理の結果で合焦可能と判定した場合には、CPU15はステップS903の処理に進み、ステップS903〜S905の処理を行う。   In the process of step S901, the CPU 15 performs the phase difference AF process using the A image and the B image extracted from the image digital signal obtained at the position “I” shown in FIG. If it is determined that focusing is possible as a result of the phase difference AF process, the CPU 15 proceeds to the process of step S903 and performs the processes of steps S903 to S905.

また、合焦が可能ではないが信頼性が比較的高く、検出されたデフォーカス量のフォーカスレンズ群3の位置の周辺に合焦位置があると判定できると、CPU15は検出されたデフォーカス位置から所定量だけ現在位置に近い位置(図18に示す位置「B」又は位置「E‘」)にフォーカスレンズ群3を移動する。   If the focus is not possible but the reliability is relatively high and it can be determined that the focus position is in the vicinity of the position of the focus lens group 3 with the detected defocus amount, the CPU 15 detects the detected defocus position. The focus lens group 3 is moved to a position (position “B” or position “E ′” shown in FIG. 18) close to the current position by a predetermined amount.

以下の動作は前述のケース1と同様となる。上記の2つの状態のいずれでもない場合には、CPU15はステップS906の処理に進んで、再びスキャンAF処理を行う。以下の動作はケース2の場合と同様である。   The following operation is the same as in the case 1 described above. If neither of the two states is present, the CPU 15 proceeds to the process of step S906 and performs the scan AF process again. The following operations are the same as those in case 2.

まず、CPU15は反対側のフォーカスレンズ群33の端の方向にフォーカスレンズ群33を駆動する。この際の駆動量は、スキャンAF処理で極大位置が検出可能な間隔で、かつ所定時間間隔でAF評価値の取得が可能な設定される。そして、CPU15は次のAF評価値を図18に示す「c1」で取得する。   First, the CPU 15 drives the focus lens group 33 in the direction of the end of the opposite focus lens group 33. The driving amount at this time is set such that an AF evaluation value can be acquired at an interval at which the maximum position can be detected by the scan AF process and at a predetermined time interval. Then, the CPU 15 acquires the next AF evaluation value by “c1” shown in FIG.

例えば、最速のセンサー駆動モードにおいて次にAF評価値を取得する位置が深度の5倍程度になるようにフォーカスレンズ群33の駆動速度を設定する。そして、ここで、CPU15はステップS907の処理に進み、スキャンAF処理で合焦可能であるか否かを判定する。合焦不可能と判定すると、CPU15はステップS901の処理に戻る。   For example, the drive speed of the focus lens group 33 is set so that the position where the AF evaluation value is next acquired is about 5 times the depth in the fastest sensor drive mode. Here, the CPU 15 proceeds to the process of step S907, and determines whether or not focusing is possible in the scan AF process. If it is determined that focusing is impossible, the CPU 15 returns to the process of step S901.

ステップS901においては、CPU15は、位相差AF処理回路13によって所定量で合焦位置に近付いた位置「c1」で得られるデジタル画像信号から抽出したA像およびB像を用いて位相差AF処理を行う。位相差AF処理の結果で合焦可能と判定すると、CPU15はステップS903に進み、ステップS903〜S905の処理を行う。   In step S901, the CPU 15 performs phase difference AF processing using the A image and the B image extracted from the digital image signal obtained at the position “c1” approaching the in-focus position by a predetermined amount by the phase difference AF processing circuit 13. Do. If it is determined that focusing is possible as a result of the phase difference AF process, the CPU 15 proceeds to step S903 and performs the processes of steps S903 to S905.

また、合焦が可能ではないが信頼性は比較的高く、検出されたデフォーカス量のフォーカスレンズ群3の位置の周辺に合焦位置があると判定できる場合には、CPU15は、検出されたデフォーカス位置から所定量だけ現在位置に近い位置(図18に示す位置「B」)にフォーカスレンズ群3を移動する。   If the focus is not possible but the reliability is relatively high and it can be determined that the focus position is around the position of the focus lens group 3 of the detected defocus amount, the CPU 15 detects the focus position. The focus lens group 3 is moved from the defocus position to a position close to the current position by a predetermined amount (position “B” shown in FIG. 18).

以下の動作は前述のケース1の場合と同様である。   The following operations are the same as in the case 1 described above.

上記の2つ状態のいずれでもない場合には、CPU15はステップS906の処理に進んで、再びスキャンAF処理を行う。   If neither of the two states is present, the CPU 15 proceeds to the process of step S906 and performs the scan AF process again.

スキャンAF処理回路12は位置「c1」において得られるデジタル画像信号からAF評価値を求める。そして、CPU15は当該AF評価値を内蔵メモリに記録する。CPU15は、次にAF評価値を取得する位置「C2」にフォーカスレンズ群33を移動する。そして、CPU15はステップS901の処理に再び戻って位相差AF処理を行う。そして、位相差AF処理の結果で合焦可能と判定すると、CPU15はステップS903で位相差AFのBP補正値を取得した後、ステップS904の処理を行う。続いて、CPU15はその結果に応じて合焦可能と判定されたAF枠より近側に被写体のあるAF枠があるか否かを調べる。   The scan AF processing circuit 12 obtains an AF evaluation value from the digital image signal obtained at the position “c1”. Then, the CPU 15 records the AF evaluation value in the built-in memory. The CPU 15 moves the focus lens group 33 to the position “C2” where the AF evaluation value is next acquired. Then, the CPU 15 returns to the process of step S901 again to perform the phase difference AF process. If the CPU 15 determines that focusing is possible based on the result of the phase difference AF process, the CPU 15 obtains the BP correction value of the phase difference AF in step S903, and then performs the process of step S904. Subsequently, the CPU 15 checks whether or not there is an AF frame with a subject nearer to the AF frame determined to be in focus according to the result.

合焦可能でない場合には、CPU15はステップS906においてスキャンAF処理を行う。ここでも、検出されたデフォーカス量のフォーカスレンズ群3の位置の周辺に合焦位置があると判定できると、CPU15は検出されたデフォーカス位置から所定量だけ現在位置に近い位置(図18に示す位置「B」)にフォーカスレンズ群3を移動する。   If the in-focus state is not possible, the CPU 15 performs a scan AF process in step S906. Also here, if it can be determined that the focus position is in the vicinity of the position of the focus lens group 3 with the detected defocus amount, the CPU 15 is a position close to the current position by a predetermined amount from the detected defocus position (see FIG. 18). The focus lens group 3 is moved to the indicated position “B”).

スキャンAF処理を行う都度、AF評価値の取得およびフォーカスレンズ群3の移動が繰り返される。これによって。CPU15は、AF評価値が極大になるフォーカスレンズ群33の位置(図18に示す位置「D」)、AF評価値が極大となった後AF評価値が小さくなって極大位置を過ぎたことを確認できる位置(図18に示す位置「C」)におけるAF評価値を取得することができる。よって、ケース1と同様の処理を行い、CPU15はこれまでに取得したAF評価値から、AF評価値が極大になる位置(図18に示す位置「D」)を求める。   Each time the scan AF process is performed, the acquisition of the AF evaluation value and the movement of the focus lens group 3 are repeated. by this. The CPU 15 confirms that the position of the focus lens group 33 at which the AF evaluation value is maximized (position “D” shown in FIG. 18), and that the AF evaluation value becomes small after the AF evaluation value has been maximized and has passed the maximum position. An AF evaluation value at a position that can be confirmed (position “C” shown in FIG. 18) can be acquired. Therefore, the same processing as in case 1 is performed, and the CPU 15 obtains a position where the AF evaluation value is maximized (position “D” shown in FIG. 18) from the AF evaluation values acquired so far.

信頼性が十分でないと判定した場合には、CPU15はスキャンAF処理を継続する。本来の極大値を検出することなく、フォーカスレンズ群33が移動範囲の端に達した場合には、CPU15はそこでフォーカスレンズ群33を停止する。そして、CPU15はスキャンAF処理では合焦不可能と判定する。上述のようにして、CPU15はステップS901〜S910の処理を繰り返す。そして、位相差AF処理又はスキャンAF処理で合焦可能と判定すると、CPU15はステップS128の処理に進む。   If it is determined that the reliability is not sufficient, the CPU 15 continues the scan AF process. If the focus lens group 33 reaches the end of the movement range without detecting the original maximum value, the CPU 15 stops the focus lens group 33 there. Then, the CPU 15 determines that focusing is impossible in the scan AF process. As described above, the CPU 15 repeats the processes of steps S901 to S910. If the CPU 15 determines that focusing is possible in the phase difference AF process or the scan AF process, the CPU 15 proceeds to the process of step S128.

ステップS128においては、CPU15はステップS903又はステップS908において取得された位相差AF又はスキャンAF用のBP補正値が適切であるか否かを確認する。適切なBP補正値であると、CPU15はスキャンAF処理の結果得られたAF評価値が極大値となるフォーカスレンズ群33の位置又は位相差AF処理の結果得られたデフォーカス量が零となるフォーカスレンズ群33の位置にBP補正値を加算して合焦位置とする。そして、CPU15は当該合焦位置にフォーカスレンズ群33を制御する。   In step S128, the CPU 15 checks whether or not the BP correction value for phase difference AF or scan AF acquired in step S903 or step S908 is appropriate. When the BP correction value is appropriate, the CPU 15 sets the position of the focus lens group 33 at which the AF evaluation value obtained as a result of the scan AF process becomes a maximum value or the defocus amount obtained as a result of the phase difference AF process to zero. A BP correction value is added to the position of the focus lens group 33 to obtain a focus position. Then, the CPU 15 controls the focus lens group 33 to the in-focus position.

図16には示されていないが、複数のAF枠に同一の被写体が存在する場合には、AF評価値が極大値となるフォーカスレンズ群33の位置又はデフォーカス量が零となるフォーカスレンズ群33の位置が等しい複数のAF枠が存在することになる。このような場合は、複数のAF枠のBP補正値が異なる場合があるので、複数のBP補正値の平均値を加算して新たなBP補正値とする。   Although not shown in FIG. 16, when the same subject exists in a plurality of AF frames, the focus lens group 33 where the AF evaluation value becomes the maximum value or the defocus amount becomes zero. There are a plurality of AF frames having the same position 33. In such a case, since the BP correction values of the plurality of AF frames may be different, the average value of the plurality of BP correction values is added to obtain a new BP correction value.

適切なBP補正値でない場合には、CPU15はスキャンAF処理の結果得られたAF評価値が極大値となるフォーカスレンズ群33の位置又は位相差AF処理の結果得られたデフォーカス量が零となるフォーカスレンズ群33の位置にフォーカスレンズ群33を移動する。その後、第1の実施形態と同様の手法で、CPU15は全てのAF枠についてBP補正値を取得する。そして、CPU15は当該BP補正値を加算した合焦位置にフォーカスレンズ群33を制御する。   If the BP correction value is not appropriate, the CPU 15 determines that the position of the focus lens group 33 at which the AF evaluation value obtained as a result of the scan AF process is a maximum value or the defocus amount obtained as a result of the phase difference AF process is zero. The focus lens group 33 is moved to the position of the focus lens group 33. Thereafter, the CPU 15 acquires BP correction values for all AF frames by the same method as in the first embodiment. Then, the CPU 15 controls the focus lens group 33 to the in-focus position where the BP correction value is added.

このような制御を行うのは次の理由による。被写体のコントラストが低いなどAF処理(位相差AF処理又はスキャンAF処理)が苦手とする被写体の場合には、合焦可能と判定してBP補正値を取得した時点でフォーカスレンズ群33の位置がAF評価値が極大値となるフォーカスレンズ群33の位置又はデフォーカス量が零となるフォーカスレンズ群33の位置とならない。このため、その後のスキャンAF処理でAF評価値が極大値となるフォーカスレンズ群33の位置を検出することがある。   Such control is performed for the following reason. In the case of a subject that is not good at AF processing (phase difference AF processing or scan AF processing) such as low contrast of the subject, the position of the focus lens group 33 is determined when it is determined that focusing is possible and a BP correction value is acquired. The position of the focus lens group 33 where the AF evaluation value becomes the maximum value or the position of the focus lens group 33 where the defocus amount becomes zero is not reached. For this reason, the position of the focus lens group 33 at which the AF evaluation value becomes the maximum value may be detected in the subsequent scan AF processing.

さらに、スキャンAF処理の結果の信頼性が低く、移動範囲の端までスキャンAFした結果、それ以前に検出したAF評価値が極大値となるフォーカスレンズ群33の位置にBP補正量を加算した位置を合焦位置とすることがある。   Further, the position of the focus lens group 33 where the AF evaluation value detected before that is the maximum value as a result of the scan AF to the end of the moving range is low because the reliability of the result of the scan AF process is low, and the position where the BP correction amount is added May be the in-focus position.

また、上述の説明では、ステップS902又はステップS907で合焦可能と判定される都度、BP補正値を取得するようにしたが、最初に合焦可能と判定した際および最後に合焦可能と判定した際のBP補正値のみ取得するようにしてもよい。このようにするのは、最初に合焦可能と判定した際にはその信頼性が高く、また最後に合焦可能と判定した際には最至近の被写体であって主被写体の可能性が高いからである。   In the above description, the BP correction value is acquired every time it is determined that focus is possible in step S902 or step S907. However, when it is determined that focus is possible for the first time, it is determined that focus is possible at the end. Only the BP correction value obtained at the time may be acquired. This is because the reliability is high when it is determined that focusing is possible for the first time, and the main subject is highly likely to be the closest subject when it is determined that focusing is possible at the end. Because.

例えば、BP補正値を記録する記憶領域を2つ設けて、一方の記憶領域には最初に合焦可能と判定した際のBP補正値を記録して、一方の記憶領域では合焦可能と判定する毎にBP補正値を更新するようにすればよい。   For example, two storage areas for recording BP correction values are provided, and one storage area is recorded with the BP correction value when it is first determined that focusing is possible, and it is determined that focusing is possible in one storage area. It is only necessary to update the BP correction value each time.

これによってBP補正値を記憶するため記録容量を削減することが可能になって、特に、AF枠数が多い場合などは記憶料量の削減に有効となる。   As a result, since the BP correction value is stored, the recording capacity can be reduced. In particular, when the number of AF frames is large, it is effective in reducing the storage charge amount.

図19は、本発明の第2の実施形態によるカメラで行われる一連のAF処理の他の例を説明するための図である。   FIG. 19 is a diagram for explaining another example of a series of AF processes performed by the camera according to the second embodiment of the present invention.

図19に示す例では、フォーカスレンズ群33の初期位置が至近側の移動範囲の端に近く、AF処理を至近側から行う場合の処理が示されている。処理手順はAF処理を遠側から行う場合と同様であって、図17Aおよび図17Bに示すフローチャートに基づいて行われる。   In the example shown in FIG. 19, the process in the case where the initial position of the focus lens group 33 is close to the end of the moving range on the close side and the AF process is performed from the close side is shown. The processing procedure is the same as when the AF processing is performed from the far side, and is performed based on the flowcharts shown in FIGS. 17A and 17B.

さらに、遠側からAF処理を行う場合と同様に、図16に示すように3つのAF枠が設定され、AF枠00には遠距離の背景、AF枠01には中間距離の樹木、AF枠02には主被写体である近距離の人物被写体が存在しているものとする。   Further, as in the case where AF processing is performed from the far side, three AF frames are set as shown in FIG. 16, the AF frame 00 is a long distance background, the AF frame 01 is an intermediate distance tree, and the AF frame. It is assumed that there is a short-distance human subject as the main subject at 02.

図16に示す例では被写体が存在しており、AF枠00については、図19に示す位置「F」において位相差AF処理で得られるデフォーカス量が零となる。または、位置「F」においてスキャンAF処理で得られるAF評価値が極大値となる。   In the example shown in FIG. 16, there is a subject, and for the AF frame 00, the defocus amount obtained by the phase difference AF process is zero at the position “F” shown in FIG. Alternatively, the AF evaluation value obtained by the scan AF process at the position “F” becomes a maximum value.

また、AF枠01ついては、中間距離(図19に示す位置「E」)において位相差AF処理で得られるデフォーカス量が零となる。または、位置「E」においてスキャンAF処理で得られるAF評価値が極大値となる。   For the AF frame 01, the defocus amount obtained by the phase difference AF process is zero at the intermediate distance (position “E” shown in FIG. 19). Alternatively, the AF evaluation value obtained by the scan AF process at the position “E” becomes a maximum value.

そして、AF枠02については、近距離(図19に示す位置「D」)において位相差AF処理で得られるデフォーカス量が零となる。または、位置「D」においてスキャンAF処理で得られるAF評価値が極大値となる。   For the AF frame 02, the defocus amount obtained by the phase difference AF process becomes zero at a short distance (position “D” shown in FIG. 19). Alternatively, the AF evaluation value obtained by the scan AF process at the position “D” becomes a maximum value.

図19に示す位置「D」のように、位相差AF処理の結果、合焦可能かつそのAF枠より近側の被写体の存在するAF枠が存在しない場合をケース0とする。この場合には、CPU15はステップS901、S902、S903、S904、S905、およびS128の順に処理を行う。CPU15は、位相差AF処理の結果得られたデフォーカス量が零となるフォーカスレンズ群33の位置に、ステップS903で取得した位相差AF用のBP補正値を加算して合焦位置とする。そして、CPU15は当該合焦位置にフォーカスレンズ群33を制御する。   As in the case of position “D” shown in FIG. 19, Case 0 is a case in which there is no AF frame in which a subject that is in focus and nearer to the AF frame exists as a result of the phase difference AF process. In this case, the CPU 15 performs processing in the order of steps S901, S902, S903, S904, S905, and S128. The CPU 15 adds the BP correction value for phase difference AF acquired in step S903 to the position of the focus lens group 33 where the defocus amount obtained as a result of the phase difference AF process becomes zero to obtain a focus position. Then, the CPU 15 controls the focus lens group 33 to the in-focus position.

例えば、図16に示す例では、初期位置(図19に示す位置「A」)において、少なくともAF枠02において合焦可能と判定すれば、AF枠00およびAF枠01で合焦可能と判定されても、AF枠02における位相差AFの結果得られるデフォーカス量が零のフォーカスレンズ群33の位置が最も近側の被写体の位置と判定することができる。よって、CPU15はAF枠02について求めたデフォーカス量が零となるフォーカスレンズ群33の位置を用いて合焦動作を行えばよい。   For example, in the example shown in FIG. 16, if it is determined that focusing is possible at least in the AF frame 02 at the initial position (position “A” shown in FIG. 19), it is determined that focusing is possible in the AF frame 00 and the AF frame 01. However, it is possible to determine that the position of the focus lens group 33 with zero defocus obtained as a result of the phase difference AF in the AF frame 02 is the position of the closest subject. Therefore, the CPU 15 may perform the focusing operation using the position of the focus lens group 33 where the defocus amount obtained for the AF frame 02 is zero.

また、位相差AF処理の結果、合焦可能なAF枠が存在せず、いずれか1つのAF枠で合焦可能ではないが信頼性が比較的高く、検出されたデフォーカス量のフォーカスレンズ群3の位置の周辺に合焦位置があると判断できる場合をケース1)とする。このケース1の場合には、次のようにしてAF処理が行われる。   Further, as a result of the phase difference AF process, there is no AF frame that can be focused, and it is not possible to focus with any one AF frame, but the reliability is relatively high, and the focus lens group has a detected defocus amount. Case 1) is a case where it can be determined that there is an in-focus position around the position 3. In the case 1, the AF process is performed as follows.

まず、CPU15は位相差AF処理の結果に応じたスキャン開始位置にフォーカスレンズ群33を移動する。位相差AF処理の結果、AF枠02において合焦可能ではないが信頼性は比較的高く、検出されたデフォーカス量のフォーカスレンズ群3の位置の周辺に合焦位置があると判定できたものとする。この場合には、CPU15は現在位置(図19に示す初期位置「A」)から、検出されたデフォーカス位置から所定量だけ現在位置に近い位置(図19に示す位置「B」)にフォーカスレンズ群3を移動する。   First, the CPU 15 moves the focus lens group 33 to a scan start position corresponding to the result of the phase difference AF process. As a result of the phase difference AF process, focusing is not possible in the AF frame 02, but the reliability is relatively high, and it can be determined that there is a focusing position around the position of the focus lens group 3 of the detected defocus amount. And In this case, the CPU 15 moves the focus lens from the current position (initial position “A” shown in FIG. 19) to a position (position “B” shown in FIG. 19) close to the current position by a predetermined amount from the detected defocus position. Move group 3.

AF枠02における位相差AF処理の結果ではフォーカスレンズ群33の移動位置を決定できない場合でも、AF枠01において合焦可能ではないが信頼性は比較的高く、検出されたデフォーカス量のフォーカスレンズ群3の位置の周辺に合焦位置があると判定できたとする。この場合には、CPU15は現在位置(図19に示す初期位置「A」)から、検出されたデフォーカス位置から所定量だけ現在位置に近い位置(図19に示す位置「E‘」)にフォーカスレンズ群3を移動する。   Even when the movement position of the focus lens group 33 cannot be determined from the result of the phase difference AF process in the AF frame 02, the focus is not possible in the AF frame 01, but the reliability is relatively high, and the focus lens of the detected defocus amount Assume that it is possible to determine that there is an in-focus position around the position of group 3. In this case, the CPU 15 focuses from the current position (initial position “A” shown in FIG. 19) to a position (position “E ′” shown in FIG. 19) close to the current position by a predetermined amount from the detected defocus position. The lens group 3 is moved.

AF枠01およびAF枠02における位相差AF処理の結果ではフォーカスレンズ群33の移動位置を決定できない場合において、AF枠00において合焦可能ではないが信頼性が比較的高く、検出されたデフォーカス量のフォーカスレンズ群3の位置の周辺に合焦位置があると判定できたものとする。この場合には、CPU15は、現在位置(図19に示す初期位置「A」)から、検出されたデフォーカス位置から所定量だけ現在位置に近い位置(図19に示す位置「F‘」)にフォーカスレンズ群3を移動する。   When the movement position of the focus lens group 33 cannot be determined from the result of the phase difference AF process in the AF frame 01 and the AF frame 02, the AF frame 00 is not in focus but is relatively reliable, and the detected defocus is detected. It is assumed that it is possible to determine that there is an in-focus position around the position of the amount of the focus lens group 3. In this case, the CPU 15 moves from the current position (initial position “A” shown in FIG. 19) to a position (position “F ′” shown in FIG. 19) that is close to the current position by a predetermined amount from the detected defocus position. The focus lens group 3 is moved.

ところが、現実的には、AF枠00より初期位置に近い位置に被写体があるAF枠01およびAF枠02によってAF処理が決定されると予測される。   However, in reality, it is predicted that AF processing is determined by the AF frame 01 and the AF frame 02 in which the subject is located closer to the initial position than the AF frame 00.

ここで、CPU15はステップS907の処理に進み、スキャンAF処理で合焦可能であるか否かを判定する。合焦可能であると、CPU15はステップS908の処理に進むが、この段階では未だスキャンAF処理は実質的に開始されていないので、CPU15は合焦不可能と判定してステップS901の処理に戻ることになる。   Here, the CPU 15 proceeds to the process of step S907 and determines whether or not focusing is possible in the scan AF process. If the in-focus state is possible, the CPU 15 proceeds to the process of step S908. However, since the scan AF process has not substantially started at this stage, the CPU 15 determines that the in-focus state is impossible and returns to the process of step S901. It will be.

スッテプS901においては、CPU15は、位相差AF処理回路13によって図19に示す位置「B」(又は図19に示す位置「E‘」)で得られるデジタル画像信号から抽出したA像およびB像を用いて位相差AF処理を行う。初期位置(図19に示す位置「A」)よりAF枠01およびAF枠02の合焦位置へ近付いているので、A像およびB像の類似度、デフォーカス量などが合焦可能と判定される条件を満たす可能性がある。   In step S901, the CPU 15 obtains the A image and the B image extracted from the digital image signal obtained at the position “B” shown in FIG. 19 (or the position “E ′” shown in FIG. 19) by the phase difference AF processing circuit 13. To perform phase difference AF processing. Since the focus position of the AF frame 01 and the AF frame 02 is approaching from the initial position (position “A” shown in FIG. 19), it is determined that the similarity between the A image and the B image, the defocus amount, and the like can be focused. There is a possibility that

このため、CPU15は当該位置(図19に示す位置「B」又は位置「E‘」)で再度位相差AF処理を行う。なお、ここで行われる位相差AF処理は、ステップS906の前処理で設定された最速のフレームレートのセンサー駆動モードにおける読み出しで得られるA像およびB像が用いられる。   Therefore, the CPU 15 performs the phase difference AF process again at the position (position “B” or position “E ′” shown in FIG. 19). Note that the phase difference AF processing performed here uses an A image and a B image obtained by reading in the sensor drive mode at the fastest frame rate set in the preprocessing in step S906.

位相差AF処理の結果で合焦可能と判定すると、CPU15はステップS903の処理に進み、ステップS903〜S905の処理を行う。合焦可能と判定できないと、CPU15はステップS906の処理に進み、再びスキャンAF処理を行う。   If it is determined that focusing is possible as a result of the phase difference AF process, the CPU 15 proceeds to the process of step S903 and performs the processes of steps S903 to S905. If it is not possible to determine that focusing is possible, the CPU 15 proceeds to the process of step S906 and performs the scan AF process again.

ここでは、既に前処理は行われているので、実際のスキャンAF処理が行われる。そして、スキャンAF処理回路12は位置(図19に示す位置「B」又は位置「E‘」)において得られるデジタル画像信号からAF評価値を求める。CPU15は当該AF評価値を内蔵メモリに記録する。そして、CPU15は次にAF評価値を取得する位置にフォーカスレンズ群33を移動する。その後、CPU15はステップS901の処理に戻って、位相差AF処理回路13によって再び位相差AF処理を行う。位相差AF処理で合焦可能と判定すると、CPU15はステップS903で位相差AF用のBP補正値を取得してステップS904の処理を行う。そして、CPU15は、ステップS905において合焦可能と判定したAF枠より近側に被写体のあるAF枠があるか調べる。   Here, since pre-processing has already been performed, actual scan AF processing is performed. Then, the scan AF processing circuit 12 obtains an AF evaluation value from the digital image signal obtained at the position (position “B” or position “E ′” shown in FIG. 19). The CPU 15 records the AF evaluation value in the built-in memory. Then, the CPU 15 moves the focus lens group 33 to a position where the AF evaluation value is next acquired. Thereafter, the CPU 15 returns to the process of step S901, and performs the phase difference AF process again by the phase difference AF processing circuit 13. If it is determined that focusing is possible in the phase difference AF process, the CPU 15 acquires a BP correction value for phase difference AF in step S903 and performs the process in step S904. Then, the CPU 15 checks whether there is an AF frame with a subject nearer to the AF frame determined to be in focus in step S905.

合焦可能でない場合には、CPU15はステップS906においてスキャンAF処理を行う。スキャンAF処理を行う都度、AF評価値の取得およびフォーカスレンズ群3の移動が繰り返される。これによって、CPU15は、AF枠02においてAF評価値が極大になるフォーカスレンズ群33の位置(図19に示す位置「D」)、AF枠02でAF評価値が極大となった後AF評価値が小さくなって極大位置を過ぎたこと確認できる位置(図19に示す位置「C」)におけるAF評価値を取得することができる。   If the in-focus state is not possible, the CPU 15 performs a scan AF process in step S906. Each time the scan AF process is performed, the acquisition of the AF evaluation value and the movement of the focus lens group 3 are repeated. Thus, the CPU 15 determines the position of the focus lens group 33 at which the AF evaluation value is maximized in the AF frame 02 (position “D” shown in FIG. 19), and the AF evaluation value after the AF evaluation value is maximized in the AF frame 02. The AF evaluation value can be acquired at a position (position “C” shown in FIG. 19) at which it can be confirmed that has passed and the maximum position has passed.

この繰り返しの処理において、最初にAF評価値が極大になることを確認できるのはAF枠02についてであり、その位置は最も至近側のAF評価値が極大になる位置であるので、その後のスキャンは行われない。   In this iterative process, it can be confirmed that the AF evaluation value is maximized first for the AF frame 02, and the position is the position where the closest AF evaluation value is maximized. Is not done.

また、図19に示す位置「E‘」又は位置「F‘」にフォーカスレンズ群3を移動した場合には、フォーカスレンズ群33の移動に伴ってAF枠02におけるAF評価値が減少する。図19に示す位置「F‘」にフォーカスレンズ群3を移動した場合には、フォーカスレンズ群33の移動に伴いAF枠01AF評価値も少する。この場合は、CPU15はフォーカスレンズ群33の移動の方向を反転して至近方向に向けてフォーカスレンズ群33を移動してスキャンAF処理を行う。   When the focus lens group 3 is moved to the position “E ′” or the position “F ′” illustrated in FIG. 19, the AF evaluation value in the AF frame 02 decreases as the focus lens group 33 moves. When the focus lens group 3 is moved to the position “F ′” shown in FIG. 19, the AF frame 01AF evaluation value decreases as the focus lens group 33 moves. In this case, the CPU 15 reverses the direction of movement of the focus lens group 33 and moves the focus lens group 33 toward the closest direction to perform scan AF processing.

CPU15は、AF枠02で極大値を検出できると判定した時点(図19に示す位置「C」)でフォーカスレンズ群33の駆動を終了する。そして、CPU15はこれまでに取得したAF評価値から、AF評価値が極大になる位置(図19に示す位置「D」)を求める。   The CPU 15 ends the driving of the focus lens group 33 when it is determined that the maximum value can be detected by the AF frame 02 (position “C” shown in FIG. 19). Then, the CPU 15 obtains a position where the AF evaluation value is maximized (position “D” shown in FIG. 19) from the AF evaluation values acquired so far.

信頼性が十分でないと判定した場合には、CPU15はスキャンAF処理を継続する。これの理由は、ノイズなどで生じる偽の極大値を除外して本来の極大値を検出するためである。なお、本来の極大値を検出することなくフォーカスレンズ群33が移動範囲の端に達した場合には、CPU15はそこでフォーカスレンズ群33を停止する。そして、CPU15はスキャンAF処理では合焦不可能と判定する。   If it is determined that the reliability is not sufficient, the CPU 15 continues the scan AF process. The reason for this is to exclude the false maximum value caused by noise or the like and detect the original maximum value. When the focus lens group 33 reaches the end of the movement range without detecting the original maximum value, the CPU 15 stops the focus lens group 33 there. Then, the CPU 15 determines that focusing is impossible in the scan AF process.

一度目のステップS901の位相差AF処理の結果、合焦可能なAF枠又は周辺に合焦位置があると判定されるAF枠が存在せず、いずれか1つのAF枠で信頼性が低く検出されたデフォーカス量の方向は信頼できるがその量は信頼できない場合をケース2とする。この場合には、CPU15は現在位置(図19に示す初期位置「A」)から検出されたデフォーカスの方向にフォーカスレンズ群33を駆動する。この際の駆動量は、スキャンAF処理において極大位置が検出可能か間隔で、かつ所定時間間隔でAF評価値の取得が可能に設定される。これによって、CPU15は次のAF評価値を図19に示す位置「b1」で取得する。   As a result of the first phase difference AF process in step S901, there is no AF frame that can be focused or an AF frame that is determined to have a focus position in the vicinity, and detection is low with any one of the AF frames. Case 2 is a case where the direction of the defocus amount is reliable but the amount is not reliable. In this case, the CPU 15 drives the focus lens group 33 in the defocus direction detected from the current position (initial position “A” shown in FIG. 19). The driving amount at this time is set such that the maximum position can be detected in the scan AF process, and the AF evaluation value can be acquired at predetermined time intervals. As a result, the CPU 15 acquires the next AF evaluation value at the position “b1” shown in FIG.

例えば、最速のセンサー駆動モードにおいて次にAF評価値を取得する位置が深度の5倍程度になるようにフォーカスレンズ群33の駆動速度が設定される。そして、CPU15はステップS907においてスキャンAF処理で合焦可能であるか否かを判定する。いずれか1つのAF枠で合焦可能であると、CPU15はステップS908の処理に進む。一方、全てのAF枠で合焦可能でないと、CPU15はステップS901へ戻って再び位相差AF処理を行う。   For example, the drive speed of the focus lens group 33 is set so that the position where the AF evaluation value is next acquired is about 5 times the depth in the fastest sensor drive mode. In step S907, the CPU 15 determines whether or not focusing is possible with the scan AF process. If focusing is possible with any one of the AF frames, the CPU 15 proceeds to the process of step S908. On the other hand, if focusing is not possible in all AF frames, the CPU 15 returns to step S901 and performs the phase difference AF process again.

ステッププS901の処理において、CPU15は、位相差AF処理回路13によって所定量で合焦位置に近付いた位置「b1」で得られるデジタル画像信号から抽出したA像およびB像を用いて位相差AF処理を行う。位相差AF処理の結果で合焦可能と判定した場合には、CPU15はステップS904の処理に進み、ステップS903〜S905の処理を行う。   In step S901, the CPU 15 uses the phase difference AF processing circuit 13 to perform phase difference AF processing using the A and B images extracted from the digital image signal obtained at the position “b1” approaching the in-focus position by a predetermined amount. I do. If it is determined that focusing is possible as a result of the phase difference AF process, the CPU 15 proceeds to the process of step S904 and performs the processes of steps S903 to S905.

また、合焦可能ではないが信頼性は比較的高く、検出されたデフォーカス量のフォーカスレンズ群3の位置の周辺に合焦位置があると判定すると、CPU15は、検出されたデフォーカス位置から所定量だけ現在位置に近い位置(図19に示す位置「B」又は位置「E‘」)にフォーカスレンズ群33を移動する。以下の動作は、前述のケース1の場合と同様である。   If the focus is not possible but the reliability is relatively high and it is determined that the focus position is around the position of the focus lens group 3 of the detected defocus amount, the CPU 15 determines from the detected defocus position. The focus lens group 33 is moved to a position close to the current position by a predetermined amount (position “B” or position “E ′” shown in FIG. 19). The following operation is the same as in the case 1 described above.

上記の2つ状態のいずれにも該当しない場合には、CPU15はステップS906の処理に進んで、再度スキャンAF処理を行う。   If none of the above two states apply, the CPU 15 proceeds to the process of step S906 and performs the scan AF process again.

CPU15は、スキャンAF処理回路12によって位置「b1」において得られるデジタル画像信号からAF評価値を求める。CPU15は当該AF評価値を内蔵メモリに記録する。そして、CPU15は次にAF評価値を取得する位置「B2」にフォーカスレンズ群33を移動する。   The CPU 15 obtains an AF evaluation value from the digital image signal obtained at the position “b1” by the scan AF processing circuit 12. The CPU 15 records the AF evaluation value in the built-in memory. Then, the CPU 15 moves the focus lens group 33 to the position “B2” where the AF evaluation value is acquired next.

CPU15はステップS901の処理に再び戻って位相差AF処理を行い、ステップS902において位相差AFで合焦可能であるか否かを判定する。そして、CPU15は、ステップS904において合焦可能と判定したAF枠より近側に被写体のあるAF枠があるか調べる。   The CPU 15 returns to the process of step S901 again to perform the phase difference AF process, and determines in step S902 whether or not focusing is possible with the phase difference AF. Then, the CPU 15 checks whether there is an AF frame with a subject nearer to the AF frame determined to be in focus in step S904.

合焦可能でない場合には、CPU15はステップS906においてスキャンAF処理を行う。ここでも、検出されたデフォーカス量のフォーカスレンズ群3の位置の周辺に合焦位置があると判定すると、CPU15は、検出されたデフォーカス位置から所定量だけ現在位置に近い位置(図19に示す位置「B」又は位置「E‘」)にフォーカスレンズ群3を移動する。   If the in-focus state is not possible, the CPU 15 performs a scan AF process in step S906. Here again, if it is determined that the focus position is in the vicinity of the position of the focus lens group 3 with the detected defocus amount, the CPU 15 closes the current position by a predetermined amount from the detected defocus position (see FIG. 19). The focus lens group 3 is moved to the indicated position “B” or “E ′”).

これらのAF処理を行う都度、AF評価値の取得およびフォーカスレンズ群3の移動が繰り返さされる。これによって、CPU15はAF評価値が極大になるフォーカスレンズ群33の位置(図19に示す位置「D」)、AF評価値が極大となった後AF評価値が小さくなって極大位置を過ぎたことを確認できる位置(図19に示す位置「C」)においてAF評価値をCPU15は取得することができる。   Each time these AF processes are performed, the acquisition of the AF evaluation value and the movement of the focus lens group 3 are repeated. As a result, the CPU 15 moves the position of the focus lens group 33 at which the AF evaluation value is maximized (position “D” shown in FIG. 19), and after the AF evaluation value becomes maximal, the AF evaluation value decreases and passes the maximal position. The CPU 15 can acquire the AF evaluation value at a position where it can be confirmed (position “C” shown in FIG. 19).

よって、CPU15はケース1の場合と同様の処理を行って、これまでに取得したAF評価値信号から、AF評価値が極大になる位置(図19に示す位置「D」)を求める。信頼性が十分でないと判定した場合には、CPU15はAFスキャンを継続する。本来の極大値を検出することなくフォーカスレンズ群33が移動範囲の端に達した場合には、CPU15はそこでフォーカスレンズ群33を停止する。そして、CPU15はスキャンAF処理では合焦不可能と判定する。   Therefore, the CPU 15 performs the same process as in the case 1, and obtains the position where the AF evaluation value is maximized (position “D” shown in FIG. 19) from the AF evaluation value signal acquired so far. If it is determined that the reliability is not sufficient, the CPU 15 continues the AF scan. When the focus lens group 33 reaches the end of the movement range without detecting the original maximum value, the CPU 15 stops the focus lens group 33 there. Then, the CPU 15 determines that focusing is impossible in the scan AF process.

一度目のスッテプS901における位相差AF処理の結果、信頼性が極めて低く検出されたデフォーカス量の方向および量とも信頼できないとする(ケース3)。この場合には、CPU15は現在位置(図19に示す初期位置「A」)から、その位置に近いフォーカスレンズ群33の移動範囲の端にフォーカスレンズ群33を移動する。図19に示す例では、CPU15は無限遠側の移動範囲の端である位置「N」にフォーカスレンズ群33を移動する。   As a result of the phase difference AF process in the first step S901, it is assumed that the direction and amount of the defocus amount detected with extremely low reliability are not reliable (case 3). In this case, the CPU 15 moves the focus lens group 33 from the current position (initial position “A” shown in FIG. 19) to the end of the movement range of the focus lens group 33 close to that position. In the example shown in FIG. 19, the CPU 15 moves the focus lens group 33 to a position “N” that is the end of the moving range on the infinity side.

その後、CPU15はステップS907の処理に進み、スキャンAF処理で合焦可能であるか否かを判定する。合焦不可能と判定すると、CPU15はステップS901の処理に戻る。   Thereafter, the CPU 15 proceeds to the process of step S907, and determines whether or not focusing is possible by the scan AF process. If it is determined that focusing is impossible, the CPU 15 returns to the process of step S901.

ステップS901では、CPU15は、位相差AF処理回路13によって位置「N」で得られるデジタル画像信号から抽出したA像およびB像を用いて位相差AF処理を行う。位相差AF処理の結果で合焦可能と判定すると、CPU15はステップS903の処理に進んで、ステップS903〜S905の処理を行う。   In step S <b> 901, the CPU 15 performs phase difference AF processing using the A and B images extracted from the digital image signal obtained at the position “N” by the phase difference AF processing circuit 13. If it is determined that focusing is possible as a result of the phase difference AF process, the CPU 15 proceeds to the process of step S903 and performs the processes of steps S903 to S905.

合焦可能ではないが信頼性は比較的高く、検出されたデフォーカス量のフォーカスレンズ群33の位置の周辺に合焦位置があると判定すると、CPU15は検出されたデフォーカス位置から所定量だけ現在位置に近い位置(図19に示す位置「B」又は位置「E‘」)にフォーカスレンズ群3を移動する。以下の動作は前述の(ケース1)の場合と同様となる。   If the focus is not possible but the reliability is relatively high, and it is determined that the focus position is in the vicinity of the position of the focus lens group 33 with the detected defocus amount, the CPU 15 determines a predetermined amount from the detected defocus position. The focus lens group 3 is moved to a position close to the current position (position “B” or position “E ′” shown in FIG. 19). The following operation is the same as in the case (Case 1) described above.

上記の2つ状態のいずれでもないと、CPU15はステップS906の処理に進み、再度スキャンAF処理を行う。以下の動作はケース2の場合と同様である。まず、CPU15は反対側のフォーカスレンズ群33の端の方向にフォーカスレンズ群33を駆動する。この際の駆動量は、スキャンAFで極大位置が検出可能な間隔で、かつ所定時間間隔でAF評価値の取得が可能に設定される。これによって、CPU15は次のAF評価値を位置「c1」で取得する。   If neither of the above two states is present, the CPU 15 proceeds to the process of step S906 and performs the scan AF process again. The following operations are the same as those in case 2. First, the CPU 15 drives the focus lens group 33 in the direction of the end of the opposite focus lens group 33. The driving amount at this time is set such that the AF evaluation value can be obtained at intervals at which the maximum position can be detected by scan AF and at predetermined time intervals. As a result, the CPU 15 acquires the next AF evaluation value at the position “c1”.

例えば、最速のセンサー駆動モードにおいて次にAF評価値を取得する位置が深度の5倍程度になるようにフォーカスレンズ群33の駆動速度が設定される。   For example, the drive speed of the focus lens group 33 is set so that the position where the AF evaluation value is next acquired is about 5 times the depth in the fastest sensor drive mode.

そして、CPU15はステップS907の処理に進み、スキャンAF処理で合焦可能であるか否かを判定する。合焦不可能と判定すると、CPU15はステップS901の処理戻る。   Then, the CPU 15 proceeds to the process of step S907, and determines whether or not focusing is possible in the scan AF process. If it is determined that focusing is impossible, the CPU 15 returns to the process of step S901.

ステップS901では、CPU15は、位相差AF処理回路13によって所定量で合焦位置に近付いた位置「c1」で得られるデジタル画像信号から抽出したA像およびB像を用いて位相差AF処理を行う。位相差AF処理の結果で合焦可能と判定すると、CPU15はステップS904に進み、ステップS903〜S905の処理を行う。   In step S901, the CPU 15 performs the phase difference AF process using the A and B images extracted from the digital image signal obtained at the position “c1” approaching the in-focus position by a predetermined amount by the phase difference AF processing circuit 13. . If it is determined that focusing is possible as a result of the phase difference AF process, the CPU 15 proceeds to step S904 and performs the processes of steps S903 to S905.

合焦可能ではないが信頼性は比較的高く、検出されたデフォーカス量のフォーカスレンズ群3の位置の周辺に合焦位置があると判定すると、CPU15は検出されたデフォーカス位置から所定量だけ現在位置に近い位置(図19に示す位置「B」)にフォーカスレンズ群3を移動する。   If the focus is not possible but the reliability is relatively high and the focus position is determined to be in the vicinity of the position of the focus lens group 3 with the detected defocus amount, the CPU 15 determines a predetermined amount from the detected defocus position. The focus lens group 3 is moved to a position close to the current position (position “B” shown in FIG. 19).

以下の動作は前述のケース1の場合と同様となる。上記の2つの状態のいずれでもないと、CPU15はステップS906の処理に進んで、再度スキャンAF処理を行う。   The following operation is the same as in the case 1 described above. If it is neither of the above two states, the CPU 15 proceeds to the process of step S906 and performs the scan AF process again.

CPU15は、スキャンAF処理回路12によって位置「c1」において得られるデジタル画像信号からAF評価値を求める。CPU15は当該AF評価値を内蔵メモリに記録する。そして、CPU15は次にAF評価値を取得する位置「c2」にフォーカスレンズ群33を移動する。その後、CPU15はステップS901の処理に再び戻って位相差AF処理を行う。そして、位相差AFで合焦可能と判定すると、CPU15はステップS903において位相差AF用のBP補正値を取得した後、ステップS904の処理を行う。その後、CPU15は、ステップS905において合焦可能と判定したAF枠より近側に被写体のあるAF枠があるか調べる。   The CPU 15 obtains an AF evaluation value from the digital image signal obtained at the position “c1” by the scan AF processing circuit 12. The CPU 15 records the AF evaluation value in the built-in memory. Then, the CPU 15 moves the focus lens group 33 to the position “c2” where the AF evaluation value is next acquired. Thereafter, the CPU 15 returns to the process of step S901 again to perform the phase difference AF process. If it is determined that focusing is possible with the phase difference AF, the CPU 15 obtains the BP correction value for phase difference AF in step S903, and then performs the process of step S904. Thereafter, the CPU 15 checks whether there is an AF frame with a subject nearer to the AF frame determined to be in focus in step S905.

合焦可能でない場合には、CPU15はステップS906においてスキャンAF処理を行う。ここでも、検出されたデフォーカス量のフォーカスレンズ群3の位置の周辺に合焦位置があると判定すると、CPU15は、検出されたデフォーカス位置から所定量だけ現在位置に近い位置(図19に示す位置「B」)にフォーカスレンズ群3を移動する。   If the in-focus state is not possible, the CPU 15 performs a scan AF process in step S906. Here again, if it is determined that the focus position is in the vicinity of the position of the focus lens group 3 with the detected defocus amount, the CPU 15 closes the current position by a predetermined amount from the detected defocus position (see FIG. 19). The focus lens group 3 is moved to the indicated position “B”).

このようにAF処理を行う都度、AF評価値の取得およびフォーカスレンズ群3の移動を繰り返される。これによって、CPU15はAF評価値が極大になるフォーカスレンズ群33の位置(図19に示す位置「D」)、AF評価値が極大となった後AF評価値が小さくなって極大位置を過ぎたことを確認できる位置(図19に示す位置「C」)におけるAF評価値を取得することができる。よって、CPU15はケース1と同様の処理を行い、これまでに取得したAF評価値信号から、AF評価値が極大になる位置(図19に示す位置「D」)を求める。   Thus, every time AF processing is performed, acquisition of AF evaluation values and movement of the focus lens group 3 are repeated. As a result, the CPU 15 moves the position of the focus lens group 33 at which the AF evaluation value is maximized (position “D” shown in FIG. 19), and after the AF evaluation value becomes maximal, the AF evaluation value decreases and passes the maximal position. An AF evaluation value at a position where this can be confirmed (position “C” shown in FIG. 19) can be acquired. Therefore, the CPU 15 performs the same processing as in Case 1, and obtains the position where the AF evaluation value is maximized (position “D” shown in FIG. 19) from the AF evaluation value signal acquired so far.

信頼性が十分でないと判定した場合には、CPU15はスキャンAFを継続する。本来の極大値を検出することなくフォーカスレンズ群33が移動範囲の端に達した場合には、CPU15はそこでフォーカスレンズ群33を停止する。そして、CPU15はスキャンAF処理では合焦不可能と判定する。上述のようにして、ステップS901〜S910の処理が繰り返される。そして、位相差AF処理又はスキャンAF処理で合焦可能と判定した場合には、CPU15はステップS128の処理に進む。   If it is determined that the reliability is not sufficient, the CPU 15 continues the scan AF. When the focus lens group 33 reaches the end of the movement range without detecting the original maximum value, the CPU 15 stops the focus lens group 33 there. Then, the CPU 15 determines that focusing is impossible in the scan AF process. As described above, the processes of steps S901 to S910 are repeated. When it is determined that focusing is possible in the phase difference AF process or the scan AF process, the CPU 15 proceeds to the process of step S128.

ステップS128においては、CPU15はステップS903又はステップS908において取得した位相差AF又はスキャンAF用のBP補正値が適切であるか否かを確認する。そして、適切なBP補正値であると、CPU15はBP補正値を加算して合焦位置として、当該合焦位置にフォーカスレンズ群33を制御する。   In step S128, the CPU 15 checks whether or not the BP correction value for phase difference AF or scan AF acquired in step S903 or step S908 is appropriate. If the BP correction value is appropriate, the CPU 15 adds the BP correction value to obtain the in-focus position, and controls the focus lens group 33 to the in-focus position.

適切なBP補正値でない場合には、CPU15はAF評価値が極大値となるフォーカスレンズ群33の位置、又はデフォーカス量が零となるフォーカスレンズ群33の位置にフォーカスレンズ群33を移動する。その後、CPU15は、第1の実施形態と同様の手法で全てのAF枠についてBP補正値を取得する。そして、CPU15は、取得したBP補正値を加算した合焦位置にフォーカスレンズ群33を制御する。   If the BP correction value is not appropriate, the CPU 15 moves the focus lens group 33 to the position of the focus lens group 33 where the AF evaluation value becomes the maximum value or the position of the focus lens group 33 where the defocus amount becomes zero. Thereafter, the CPU 15 acquires BP correction values for all AF frames by the same method as in the first embodiment. Then, the CPU 15 controls the focus lens group 33 to the in-focus position where the acquired BP correction value is added.

このような制御を行うのは次の理由による。被写体のコントラストが低いなどAF処理(位相差AF処理又はスキャンAF処理)が苦手とする被写体の場合には、合焦可能と判定してBP補正値を取得した時点でフォーカスレンズ群33の位置がAF評価値が極大値となるフォーカスレンズ群33の位置又はデフォーカス量が零となるフォーカスレンズ群33の位置とならない。このため、その後のスキャンAF処理でAF評価値が極大値となるフォーカスレンズ群33の位置を検出することがある。   Such control is performed for the following reason. In the case of a subject that is not good at AF processing (phase difference AF processing or scan AF processing) such as low contrast of the subject, the position of the focus lens group 33 is determined when it is determined that focusing is possible and a BP correction value is acquired. The position of the focus lens group 33 where the AF evaluation value becomes the maximum value or the position of the focus lens group 33 where the defocus amount becomes zero is not reached. For this reason, the position of the focus lens group 33 at which the AF evaluation value becomes the maximum value may be detected in the subsequent scan AF processing.

さらに、スキャンAF処理の結果の信頼性が低く、移動範囲の端までスキャンAFした結果、それ以前に検出したAF評価値が極大値となるフォーカスレンズ群33の位置にBP補正量を加算した位置を合焦位置とすることがある。   Further, the position of the focus lens group 33 where the AF evaluation value detected before that is the maximum value as a result of the scan AF to the end of the moving range is low because the reliability of the result of the scan AF process is low, and the position where the BP correction amount is added May be the in-focus position.

また、上述の説明では、ステップS902又はステップS907で合焦可能と判定される都度、BP補正値を取得するようにしたが、至近側からAF処理を行う場合には、最初に合焦可能と判定した際およびその位置から所定量離れた位置でBP補正値取得するようにしてもよい。   In the above description, the BP correction value is acquired every time it is determined in step S902 or step S907 that focusing is possible. However, when performing AF processing from the closest side, it is possible to focus first. The BP correction value may be acquired when the determination is made and at a position away from the position by a predetermined amount.

このようにするのは、最初に合焦可能と判定した際はその信頼性が高くかつ至近からAF処理を行っているため最至近の被写体であり主被写体の可能性が高いからである。また、位相差AF処理の結果デフォーカス量が零となるフォーカスレンズ群33の位置とスキャンAF処理でAF評価値が極大値となるフォーカスレンズ群33の位置とが異なる場合には、その差分に相当する位置におけるBP補正値を記録しておけばよい。   The reason for this is that when it is determined that focusing is possible for the first time, the reliability is high and the AF processing is performed from the closest point, so the possibility of being the closest subject and the main subject is high. Further, when the position of the focus lens group 33 where the defocus amount is zero as a result of the phase difference AF process and the position of the focus lens group 33 where the AF evaluation value is a maximum value in the scan AF process are different, the difference is included. The BP correction value at the corresponding position may be recorded.

このように、本発明の第2の実施形態では、複数のAF枠について合焦可能であるか否かを判定して、この判定タイミングでBP補正値を得るようにしたので、交換レンズからのデータ取得に頻度を少なくして、かつ高速にBP補正値を算出することができる。   As described above, in the second embodiment of the present invention, it is determined whether or not focusing is possible for a plurality of AF frames, and the BP correction value is obtained at this determination timing. It is possible to calculate the BP correction value at a high speed while reducing the frequency of data acquisition.

なお、第1および第2の実施形態では、所謂ミラーレスカメラを例に挙げて説明したが、レンズ交換式のカメラであれば、デジタルビデオカメラ又はデジタルSLRなど他のタイプのカメラにも適用することができる。   In the first and second embodiments, a so-called mirrorless camera has been described as an example. However, as long as an interchangeable lens camera is used, the present invention is also applicable to other types of cameras such as a digital video camera or a digital SLR. be able to.

上述の説明から明らかなように、図1に示す例では、少なくともスキャンAF処理回路12、位相差AF処理回路13、およびCPU15が焦点調整装置を構成する。また、位相差AF処理回路13およびCPU15は第1の判定手段として機能し、スキャンAF処理回路12およびCPU15は第2の判定手段として機能する。そして、CPU15は焦点位置算出手段および制御手段として機能する。さらに、撮像素子3、撮像回路4、およびA/D変換回路5は撮像手段として機能する。   As is clear from the above description, in the example shown in FIG. 1, at least the scan AF processing circuit 12, the phase difference AF processing circuit 13, and the CPU 15 constitute a focus adjustment device. The phase difference AF processing circuit 13 and the CPU 15 function as a first determination unit, and the scan AF processing circuit 12 and the CPU 15 function as a second determination unit. The CPU 15 functions as a focal position calculation unit and a control unit. Furthermore, the image pickup device 3, the image pickup circuit 4, and the A / D conversion circuit 5 function as image pickup means.

以上、本発明について実施の形態に基づいて説明したが、本発明は、これらの実施の形態に限定されるものではなく、この発明の要旨を逸脱しない範囲の様々な形態も本発明に含まれる。   As mentioned above, although this invention was demonstrated based on embodiment, this invention is not limited to these embodiment, Various forms of the range which does not deviate from the summary of this invention are also contained in this invention. .

例えば、上記の実施の形態の機能を制御方法として、この制御方法を焦点調整装置に実行させるようにすればよい。また、上述の実施の形態の機能を有するプログラムを制御プログラムとして、当該制御プログラムを焦点調整装置が備えるコンピュータに実行させるようにしてもよい。なお、制御プログラムは、例えば、コンピュータに読み取り可能な記録媒体に記録される。   For example, the function of the above-described embodiment may be used as a control method, and this control method may be executed by the focus adjustment apparatus. Further, a program having the functions of the above-described embodiments may be used as a control program, and the control program may be executed by a computer included in the focus adjustment apparatus. The control program is recorded on a computer-readable recording medium, for example.

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

3 撮像素子
4 撮像回路
5 A/D変換回路
11 AE処理回路
12 スキャンAF処理回路
13 位相差AF処理回路
19 EEPROM
26 顔検出回路
31 交換レンズ
33 フォーカスレンズ群
DESCRIPTION OF SYMBOLS 3 Image pick-up element 4 Image pick-up circuit 5 A / D conversion circuit 11 AE processing circuit 12 Scan AF processing circuit 13 Phase difference AF processing circuit 19 EEPROM
26 Face Detection Circuit 31 Interchangeable Lens 33 Focus Lens Group

Claims (13)

撮影光学系を介して結像された光学像に応じた画像信号を出力する撮像手段から前記画像信号を受けて、当該画像信号が示す画像において被写体に関してその焦点位置を調整する焦点調整装置であって、
前記撮像手段は前記撮影光学系における射出瞳の互いに異なる領域から光束を受光して焦点調整用画像信号を出力しており、
前記焦点調整用画像信号に基づいて前記被写体に関して焦点位置の調整が可能であるか否かを判定する第1の判定手段と、
前記画像信号に応じて得られる焦点調整用評価値に基づいて前記被写体に関して焦点位置の調整が可能であるか否かを判定する第2の判定手段と、
前記焦点調整用画像信号および前記焦点調整用評価値の少なくとも1つに応じて前記被写体に関する焦点位置を求める焦点位置算出手段と、
前記第1の判定手段および前記第2の判定手段のいずれかによって前記焦点位置の調整が可能である判定されたタイミングで、前記撮影光学系の特性に応じた焦点位置補正値を得て、当該焦点位置補正値に応じて前記焦点位置算出手段で算出された焦点位置を補正して、補正された焦点位置に基づいて前記撮影光学系の焦点調整を行う制御手段と、
を有することを特徴とする焦点調整装置。
A focus adjusting device that receives the image signal from an imaging unit that outputs an image signal corresponding to an optical image formed through a photographing optical system, and adjusts a focal position of a subject in an image indicated by the image signal. And
The imaging means receives a light beam from different areas of the exit pupil in the photographing optical system and outputs a focus adjustment image signal,
First determination means for determining whether or not the focus position of the subject can be adjusted based on the focus adjustment image signal;
Second determination means for determining whether or not the focus position of the subject can be adjusted based on a focus adjustment evaluation value obtained according to the image signal;
A focus position calculating means for determining a focus position related to the subject in accordance with at least one of the focus adjustment image signal and the focus adjustment evaluation value;
At a timing at which the focus position can be adjusted by any of the first determination unit and the second determination unit, a focus position correction value corresponding to the characteristics of the photographing optical system is obtained, and Control means for correcting the focus position calculated by the focus position calculation means according to a focus position correction value, and performing focus adjustment of the photographing optical system based on the corrected focus position;
A focus adjusting apparatus comprising:
前記撮像手段には前記光学像を光電変換して画像信号を出力する撮像素子が備えられ、前記撮像素子には前記撮影光学系の射出瞳の互いに異なる領域から光束を受光する一対の焦点調整画素が備えられ、前記撮像手段は前記焦点調整画素からの出力に応じて前記焦点調整用画像信号として所定の基準画像と参照画像と出力しており、
前記第1の判定手段は、前記基準画像および前記参照画像の信号レベルが所定の信号レベル以上であり、前記基準画像および前記参照画像の類似度が所定の類似度より高く、かつ、前記基準画像と前記参照画像との相関を示すデフォーカス量が第1デフォーカス量所定値以下であると、前記焦点調整用画像信号に基づいて前記被写体に関して焦点位置の調整が可能であると判定することを特徴とする請求項1に記載の焦点調整装置。
The imaging means includes an imaging device that photoelectrically converts the optical image and outputs an image signal. The imaging device receives a pair of focus adjustment pixels that receive light beams from different regions of the exit pupil of the imaging optical system. The imaging means outputs a predetermined standard image and a reference image as the focus adjustment image signal according to the output from the focus adjustment pixel,
The first determination unit is configured such that a signal level of the reference image and the reference image is equal to or higher than a predetermined signal level, a similarity between the reference image and the reference image is higher than a predetermined similarity, and the reference image And determining that the focus position of the subject can be adjusted based on the image signal for focus adjustment when the defocus amount indicating the correlation between the image and the reference image is equal to or less than a first defocus amount predetermined value. The focus adjusting apparatus according to claim 1, wherein
前記第2の判定手段は、前記画像信号における所定の周波数を超える高域側の輪郭成分量に対応する前記焦点調整用評価値に基づいて前記被写体に関して焦点位置の調整が可能であるか否かを判定することを特徴とする請求項1又は2に記載の焦点調整装置。   Whether the second determination means is capable of adjusting a focus position with respect to the subject based on the focus adjustment evaluation value corresponding to a high-frequency contour component amount exceeding a predetermined frequency in the image signal. The focus adjusting apparatus according to claim 1 or 2, wherein 前記第2の判定手段は、前記高域側の輪郭成分量に対応する前記焦点調整用評価値が極大となった場合に、前記焦点調整用評価値に基づいて前記被写体に関して焦点位置の調整が可能であると判定することを特徴とする請求項3に記載の焦点調整装置。   The second determination means adjusts the focal position of the subject based on the focus adjustment evaluation value when the focus adjustment evaluation value corresponding to the contour component amount on the high frequency side becomes maximum. The focus adjustment apparatus according to claim 3, wherein it is determined that the focus adjustment is possible. 前記撮影光学系に備えられた記憶領域には前記撮影光学系の特性を示すパラメータが記憶されており、
前記制御手段は、前記撮影光学系から前記パラメータを読み込んで前記焦点位置補正値を生成することを特徴とする請求項1〜4のいずれか1項に記載の焦点調整装置。
The storage area provided in the photographing optical system stores parameters indicating the characteristics of the photographing optical system,
5. The focus adjustment apparatus according to claim 1, wherein the control unit reads the parameter from the photographing optical system and generates the focus position correction value. 6.
前記撮像光学系には光軸に沿って移動可能なフォーカスレンズが備えられており、
前記制御手段は、前記第1の判定手段および前記第2の判定手段のいずれかによって前記被写体に関して焦点位置の調整が可能であると判定されると、前記フォーカスレンズの現在位置による前記撮影光学系の特性に応じた前記焦点位置補正値を得ることを特徴とする請求項1〜4のいずれか1項に記載の焦点調整装置。
The imaging optical system is provided with a focus lens movable along the optical axis,
When it is determined by any one of the first determination unit and the second determination unit that the focus position can be adjusted with respect to the subject, the control unit is configured to perform the photographing optical system based on the current position of the focus lens. 5. The focus adjustment apparatus according to claim 1, wherein the focus position correction value corresponding to the characteristic is obtained.
前記撮影光学系には変倍を行うための変倍光学系が備えられており、
前記制御手段は、前記第1の判定手段および前記第2の判定手段のいずれかによって前記被写体に関して焦点位置の調整が可能であると判定されると、前記変倍光学系の倍率による前記撮影光学系の特性に応じた前記焦点位置補正値を得ることを特徴とする請求項1〜6のいずれか1項に記載の焦点調整装置。
The photographing optical system is provided with a zoom optical system for zooming,
When it is determined by any one of the first determination unit and the second determination unit that the focus position can be adjusted with respect to the subject, the control unit is configured to perform the photographing optical with the magnification of the variable power optical system. The focus adjustment apparatus according to claim 1, wherein the focus position correction value corresponding to a characteristic of the system is obtained.
前記撮影光学系には、前記撮像手段に入射する光量を調整するための絞りが備えられており、
前記制御手段は、前記第1の判定手段および前記第2の判定手段のいずれかによって前記被写体に関して焦点位置の調整が可能であると判定されると、前記絞りの絞り値による前記撮影光学系の特性に応じた前記焦点位置補正値を得ることを特徴とする請求項1〜7のいずれか1項に記載の焦点調整装置。
The photographing optical system is provided with a diaphragm for adjusting the amount of light incident on the imaging means,
When it is determined by any one of the first determination unit and the second determination unit that the focus position can be adjusted with respect to the subject, the control unit of the photographing optical system uses the diaphragm aperture value. The focus adjustment apparatus according to claim 1, wherein the focus position correction value according to characteristics is obtained.
前記画像信号が示す画像において、前記焦点調整を行うための複数の領域が設定された際、前記第1の判定手段および前記第2の判定手段のいずれかにおいて前記領域の少なくとも1つで焦点調整が可能と判定されると、前記制御手段はそのタイミングで前記撮影光学系の特性に応じた焦点位置補正値を得ることを特徴とする請求項1〜8のいずれか1項に記載の焦点調整装置。   When a plurality of areas for performing the focus adjustment are set in the image indicated by the image signal, the focus adjustment is performed on at least one of the areas by either the first determination unit or the second determination unit. 9. The focus adjustment according to claim 1, wherein when it is determined that the focus is possible, the control unit obtains a focus position correction value corresponding to the characteristic of the photographing optical system at that timing. apparatus. 前記撮影光学系には光軸に沿って移動可能なフォーカスレンズが備えられており、
前記画像信号が示す画像において、前記焦点調整を行うための複数の領域が設定された際、前記第1の判定手段および前記第2の判定手段のいずれかにおいて前記領域の少なくとも1つで焦点調整が可能と判定されると、前記制御手段は前記フォーカスレンズの位置と当該位置の近傍における所定の位置とに応じて前記撮影光学系の特性に応じた焦点位置補正値を得ることを特徴とする請求項1に記載の焦点調整装置。
The photographing optical system is provided with a focus lens movable along the optical axis,
When a plurality of areas for performing the focus adjustment are set in the image indicated by the image signal, the focus adjustment is performed on at least one of the areas by either the first determination unit or the second determination unit. When it is determined that the image is possible, the control unit obtains a focus position correction value according to the characteristics of the photographing optical system according to the position of the focus lens and a predetermined position in the vicinity of the position. The focus adjustment apparatus according to claim 1.
請求項1〜10のいずれか1項に記載の焦点調整装置と、
前記焦点調整装置を有する撮像装置本体と、
前記撮影光学系を備え、前記撮像装置本体に着脱可能な交換レンズユニットと、
を有することを特徴とする撮像装置。
The focus adjustment apparatus according to any one of claims 1 to 10,
An imaging apparatus body having the focus adjustment apparatus;
An interchangeable lens unit that includes the imaging optical system and is detachable from the imaging apparatus body;
An imaging device comprising:
撮影光学系を介して結像された光学像に応じた画像信号を出力する撮像手段から前記画像信号を受けて、当該画像信号が示す画像において被写体に関してその焦点位置を調整する焦点調整装置の制御方法であって、
前記撮像手段は前記撮影光学系における射出瞳の互いに異なる領域から光束を受光して焦点調整用画像信号を出力しており、
前記焦点調整用画像信号に基づいて前記被写体に関して焦点位置の調整が可能であるか否かを判定する第1の判定ステップと、
前記画像信号に応じて得られる焦点調整用評価値に基づいて前記被写体に関して焦点位置の調整が可能であるか否かを判定する第2の判定ステップと、
前記焦点調整用画像信号および前記焦点調整用評価値の少なくとも1つに応じて前記被写体に関する焦点位置を求める焦点位置算出ステップと、
前記第1の判定ステップおよび前記第2の判定ステップのいずれかによって前記焦点位置の調整が可能である判定されたタイミングで、前記撮影光学系の特性に応じた焦点位置補正値を得て、当該焦点位置補正値に応じて前記焦点位置算出ステップで算出された焦点位置を補正して、補正された焦点位置に基づいて前記撮影光学系の焦点調整を行う制御ステップと、
を有することを特徴とする制御方法。
Control of a focus adjustment device that receives the image signal from an imaging unit that outputs an image signal corresponding to an optical image formed through a photographing optical system, and adjusts the focal position of the subject in the image indicated by the image signal A method,
The imaging means receives a light beam from different areas of the exit pupil in the photographing optical system and outputs a focus adjustment image signal,
A first determination step of determining whether or not the focus position of the subject can be adjusted based on the focus adjustment image signal;
A second determination step of determining whether or not the focus position of the subject can be adjusted based on a focus adjustment evaluation value obtained according to the image signal;
A focal position calculating step for obtaining a focal position related to the subject in accordance with at least one of the focus adjustment image signal and the focus adjustment evaluation value;
At a timing at which the focus position can be adjusted by any one of the first determination step and the second determination step, a focus position correction value corresponding to the characteristics of the photographing optical system is obtained, and A control step of correcting the focus position calculated in the focus position calculation step according to a focus position correction value, and performing focus adjustment of the photographing optical system based on the corrected focus position;
A control method characterized by comprising:
撮影光学系を介して結像された光学像に応じた画像信号を出力する撮像手段から前記画像信号を受けて、当該画像信号が示す画像において被写体に関してその焦点位置を調整する焦点調整装置で用いられる制御プログラムであって、
前記撮像手段は前記撮影光学系における射出瞳の互いに異なる領域から光束を受光して焦点調整用画像信号を出力しており、
前記焦点調整装置が備えるコンピュータに、
前記焦点調整用画像信号に基づいて前記被写体に関して焦点位置の調整が可能であるか否かを判定する第1の判定ステップと、
前記画像信号に応じて得られる焦点調整用評価値に基づいて前記被写体に関して焦点位置の調整が可能であるか否かを判定する第2の判定ステップと、
前記焦点調整用画像信号および前記焦点調整用評価値の少なくとも1つに応じて前記被写体に関する焦点位置を求める焦点位置算出ステップと、
前記第1の判定ステップおよび前記第2の判定ステップのいずれかによって前記焦点位置の調整が可能である判定されたタイミングで、前記撮影光学系の特性に応じた焦点位置補正値を得て、当該焦点位置補正値に応じて前記焦点位置算出ステップで算出された焦点位置を補正して、補正された焦点位置に基づいて前記撮影光学系の焦点調整を行う制御ステップと、
を実行させることを特徴とする制御プログラム。
Used in a focus adjustment device that receives the image signal from an imaging unit that outputs an image signal corresponding to an optical image formed through a photographing optical system, and adjusts the focal position of the subject in the image indicated by the image signal A control program,
The imaging means receives a light beam from different areas of the exit pupil in the photographing optical system and outputs a focus adjustment image signal,
A computer provided in the focus adjustment device,
A first determination step of determining whether or not the focus position of the subject can be adjusted based on the focus adjustment image signal;
A second determination step of determining whether or not the focus position of the subject can be adjusted based on a focus adjustment evaluation value obtained according to the image signal;
A focal position calculating step for obtaining a focal position related to the subject in accordance with at least one of the focus adjustment image signal and the focus adjustment evaluation value;
At a timing at which the focus position can be adjusted by any one of the first determination step and the second determination step, a focus position correction value corresponding to the characteristics of the photographing optical system is obtained, and A control step of correcting the focus position calculated in the focus position calculation step according to a focus position correction value, and performing focus adjustment of the photographing optical system based on the corrected focus position;
A control program characterized by causing
JP2014186896A 2014-09-12 2014-09-12 Imaging apparatus, control method thereof, control program, system, and interchangeable lens unit Active JP6448267B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014186896A JP6448267B2 (en) 2014-09-12 2014-09-12 Imaging apparatus, control method thereof, control program, system, and interchangeable lens unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014186896A JP6448267B2 (en) 2014-09-12 2014-09-12 Imaging apparatus, control method thereof, control program, system, and interchangeable lens unit

Publications (2)

Publication Number Publication Date
JP2016061803A true JP2016061803A (en) 2016-04-25
JP6448267B2 JP6448267B2 (en) 2019-01-09

Family

ID=55797657

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014186896A Active JP6448267B2 (en) 2014-09-12 2014-09-12 Imaging apparatus, control method thereof, control program, system, and interchangeable lens unit

Country Status (1)

Country Link
JP (1) JP6448267B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020013088A (en) * 2018-07-20 2020-01-23 株式会社ニコン Camera body and interchangeable lens

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008275712A (en) * 2007-04-26 2008-11-13 Canon Inc Imaging apparatus
JP2008309882A (en) * 2007-06-12 2008-12-25 Nikon Corp Digital camera
WO2009028181A1 (en) * 2007-08-29 2009-03-05 Panasonic Corporation Interchangeable lens camera system having autofocusing function
US20110164865A1 (en) * 2010-01-05 2011-07-07 Samsung Electronics Co., Ltd. Auto focus adjusting apparatus and camera system
JP2011199493A (en) * 2010-03-18 2011-10-06 Nikon Corp Camera
JP2014029353A (en) * 2012-07-31 2014-02-13 Sony Corp Focus adjustment device, and focus adjustment method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008275712A (en) * 2007-04-26 2008-11-13 Canon Inc Imaging apparatus
JP2008309882A (en) * 2007-06-12 2008-12-25 Nikon Corp Digital camera
WO2009028181A1 (en) * 2007-08-29 2009-03-05 Panasonic Corporation Interchangeable lens camera system having autofocusing function
US20110164865A1 (en) * 2010-01-05 2011-07-07 Samsung Electronics Co., Ltd. Auto focus adjusting apparatus and camera system
JP2011199493A (en) * 2010-03-18 2011-10-06 Nikon Corp Camera
JP2014029353A (en) * 2012-07-31 2014-02-13 Sony Corp Focus adjustment device, and focus adjustment method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020013088A (en) * 2018-07-20 2020-01-23 株式会社ニコン Camera body and interchangeable lens
JP7206668B2 (en) 2018-07-20 2023-01-18 株式会社ニコン camera body and interchangeable lens

Also Published As

Publication number Publication date
JP6448267B2 (en) 2019-01-09

Similar Documents

Publication Publication Date Title
US20210333690A1 (en) Focus adjustment device, method for controlling the same, and image capture apparatus
US10313578B2 (en) Image capturing apparatus and method for controlling image capturing apparatus
US8259216B2 (en) Interchangeable lens camera system having autofocusing function
US20160080634A1 (en) Control apparatus, control method, and non-transitory computer-readable storage medium for performing focus control
JP2009115893A (en) Image-pickup apparatus
JP7051373B2 (en) Image processing device, image pickup device, image processing method, program, and storage medium
JP2010016743A (en) Distance measuring apparatus, distance measuring method, distance measuring program, or imaging device
JP6478534B2 (en) Focus control device, imaging device, interchangeable lens, focus control method, and focus control program
JP6300670B2 (en) Focus adjustment apparatus, focus adjustment method and program, and imaging apparatus
JP6838894B2 (en) Focus control device, its control method and program
JP2015031743A (en) Exposure control device, control method for the same, and control program, and imaging device
CN109983382B (en) Focus control device, focus control method, program, and imaging device
JP6448267B2 (en) Imaging apparatus, control method thereof, control program, system, and interchangeable lens unit
JP2018021971A (en) Focus detection method, and imaging apparatus
JP6429724B2 (en) Imaging apparatus and control method thereof
JP2015152830A (en) Imaging device and control method thereof, program, and storage medium
JP2016099432A (en) Focus detection device, and method, program and storage medium
JP7146592B2 (en) Imaging device, imaging method and program
JP2011120309A (en) Imaging device
JP6838608B2 (en) Image processing device and image processing method
JP2005134820A (en) Automatic focusing device and program
WO2013153666A1 (en) Focus adjustment device and image capture device employing same
JP2023069386A (en) Image measurement device, method and program
JP2016218205A (en) Imaging apparatus and method for controlling the same
JP2016006463A (en) Imaging device and control method therefor

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20170825

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20180322

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20180327

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20180524

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20181106

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20181204

R151 Written notification of patent or utility model registration

Ref document number: 6448267

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151