JP2021148841A - Automatic focus detector, automatic focus detection method, and automatic focus detection program - Google Patents

Automatic focus detector, automatic focus detection method, and automatic focus detection program Download PDF

Info

Publication number
JP2021148841A
JP2021148841A JP2020045800A JP2020045800A JP2021148841A JP 2021148841 A JP2021148841 A JP 2021148841A JP 2020045800 A JP2020045800 A JP 2020045800A JP 2020045800 A JP2020045800 A JP 2020045800A JP 2021148841 A JP2021148841 A JP 2021148841A
Authority
JP
Japan
Prior art keywords
image signal
range
correlation calculation
value
reliability
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
JP2020045800A
Other languages
Japanese (ja)
Other versions
JP7435085B2 (en
Inventor
幸介 福成
Kosuke Fukunari
幸介 福成
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.)
Ricoh Co Ltd
Original Assignee
Ricoh Co Ltd
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 Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP2020045800A priority Critical patent/JP7435085B2/en
Publication of JP2021148841A publication Critical patent/JP2021148841A/en
Application granted granted Critical
Publication of JP7435085B2 publication Critical patent/JP7435085B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Abstract

To calculate a highly accurate defocus amount even when a plurality of subjects differing in photographing distance coexist within a focus detection area.SOLUTION: An automatic focus detector comprises: a correlation computing unit for performing correlation computing about an image signal sequence outputted from a sensor train; a reliability discrimination unit for discriminating the reliability of the result of correlation computing; a defocus amount calculation unit for calculating, when determined as reliable, a defocus amount on the basis of the result of correlation computing that is determined as reliable; and a narrowing unit for comparing, when determined as not reliable, reliability about an image signal on the beginning end side of the image signal sequence on which correlation computing was performed with reliability about an image signal on the trailing end side, and excluding the image signal on the beginning end and/or the trailing end side from the image signal sequence on the basis of the result of comparison, thereby narrowing the image signal sequence. The narrowing of the image signal sequence by the narrowing unit and the correlation computing on a range of image signal sequence after narrowing by the correlation computing unit is performed until being determined as reliable.SELECTED DRAWING: Figure 6

Description

本発明は、自動焦点検出装置、自動焦点検出方法及び自動焦点検出プログラムに関する。 The present invention relates to an autofocus detector, an autofocus detection method and an autofocus detection program.

被写体に対する合焦状態を検出する自動焦点検出装置が知られている。例えば特許文献1に、この種の自動焦点検出装置の具体的構成が記載されている。特許文献1に記載の自動焦点検出装置では、瞳分割された一対の被写体像をラインセンサ上に投影し、ラインセンサ上の一対の被写体像の位相差(言い換えると、位相ずれ量)からデフォーカス量を算出する瞳分割位相差方式が採用される。 An automatic focus detection device that detects the in-focus state with respect to a subject is known. For example, Patent Document 1 describes a specific configuration of this type of automatic focus detection device. In the automatic focus detection device described in Patent Document 1, a pair of pupil-divided subject images is projected onto a line sensor and defocused from the phase difference (in other words, the amount of phase shift) of the pair of subject images on the line sensor. The pupil division phase difference method for calculating the amount is adopted.

瞳分割位相差方式の自動焦点検出装置では、撮影距離の異なる複数の被写体が存在する(すなわち、焦点検出領域内に撮影距離の異なる複数の被写体が混在する遠近混在部がある)と、複数の被写体の位相ずれ量が混在した値がラインセンサから出力されることがあり、この場合、デフォーカス量を精度良く算出することができない。 In the pupil division phase difference type automatic focus detection device, when there are a plurality of subjects having different shooting distances (that is, there is a perspective mixed portion in which a plurality of subjects having different shooting distances are mixed in the focus detection area), a plurality of subjects are present. A value in which the amount of phase shift of the subject is mixed may be output from the line sensor, and in this case, the amount of defocus cannot be calculated accurately.

そこで、例えば特許文献1に記載の自動焦点検出装置は、相関演算を行って焦点検出領域の最大輝度差を検出し、最大輝度差が得られるラインセンサの画素を基準点とした所定画素分の画素範囲を遠近混在部の検出範囲として設定し、設定した検出範囲にて高い相関値が算出されると、この範囲を遠近混在部として検出する。次いで、この自動焦点検出装置は、検出した遠近混在部を除いた範囲で相関演算を再度実行して、デフォーカス量を算出する。 Therefore, for example, the automatic focus detection device described in Patent Document 1 performs a correlation calculation to detect the maximum luminance difference in the focal detection region, and uses the pixel of the line sensor at which the maximum luminance difference can be obtained as a reference point for a predetermined pixel. When the pixel range is set as the detection range of the perspective mixed portion and a high correlation value is calculated in the set detection range, this range is detected as the perspective mixed portion. Next, this automatic focus detection device re-executes the correlation calculation in the range excluding the detected perspective mixed portion to calculate the defocus amount.

特開2011−242677号公報Japanese Unexamined Patent Publication No. 2011-242677

特許文献1に記載の自動焦点検出装置では、遠近混在部を除く範囲として、最大輝度差が得られる画素を含む範囲が設定される。しかし、このような画素を含む範囲は、撮影距離の異なる被写体の境界を含む可能性が高い。そのため、このような画素を含む範囲で相関演算を実行すると、位相ずれ量が誤差を含むものとなる。そのため、デフォーカス量を精度良く算出することができない。 In the automatic focus detection device described in Patent Document 1, a range including pixels in which the maximum luminance difference can be obtained is set as a range excluding the perspective mixed portion. However, the range including such pixels is likely to include the boundaries of subjects having different shooting distances. Therefore, when the correlation calculation is executed in the range including such pixels, the amount of phase shift includes an error. Therefore, the defocus amount cannot be calculated accurately.

本発明は上記の事情に鑑みてなされたものであり、その目的とするところは、焦点検出領域内に撮影距離の異なる複数の被写体が混在する場合にも、精度の高いデフォーカス量を算出することができる自動焦点検出装置、自動焦点検出方法及び自動焦点検出プログラムを提供することである。 The present invention has been made in view of the above circumstances, and an object of the present invention is to calculate a highly accurate defocus amount even when a plurality of subjects having different shooting distances coexist in the focus detection area. It is to provide an automatic focus detection device, an automatic focus detection method, and an automatic focus detection program capable of providing an automatic focus detection device.

本発明の一実施形態に係る自動焦点検出装置は、一対のセンサ列上に投影された一対の被写体光に基づいて焦点検出を行う瞳分割位相差方式の自動焦点検出装置であり、センサ列より出力される画像信号列について相関演算を行う相関演算部と、相関演算部による相関演算結果の信頼性を判定する信頼性判定部と、信頼性判定部により信頼性ありと判定されると、信頼性ありと判定された相関演算結果に基づいてデフォーカス量を算出するデフォーカス量算出部と、信頼性判定部により信頼性なしと判定されると、相関演算を行った画像信号列の始端側の画像信号に対する信頼性と、終端側の画像信号に対する信頼性と、を比較し、比較結果に基づいて画像信号列から始端側と終端側の少なくとも一方の画像信号を除外することにより、画像信号列を絞り込む絞込部と、を備え、信頼性判定部により信頼性ありと判定されるまで、絞込部による画像信号列の絞り込み及び相関演算部による絞り込み後の画像信号列の範囲に対する相関演算を行う。 The automatic focus detection device according to an embodiment of the present invention is a pupil division phase difference type automatic focus detection device that performs focus detection based on a pair of subject lights projected on a pair of sensor rows, and is based on the sensor rows. When the correlation calculation unit that performs the correlation calculation on the output image signal sequence, the reliability judgment unit that determines the reliability of the correlation calculation result by the correlation calculation unit, and the reliability judgment unit determines that the reliability is reliable, the reliability is determined. The defocus amount calculation unit that calculates the defocus amount based on the correlation calculation result determined to be possible, and the reliability determination unit determines that there is no reliability, the start end side of the image signal string subjected to the correlation calculation. By comparing the reliability of the image signal and the reliability of the image signal on the terminal side, and excluding at least one of the image signals on the start side and the end side from the image signal sequence based on the comparison result, the image signal A narrowing section for narrowing down columns is provided, and until the reliability determination section determines that the image signal sequence is reliable, the narrowing section narrows down the image signal sequence and the correlation calculation section narrows down the range of the image signal sequence. I do.

本発明の一実施形態に係る自動焦点検出方法は、一対のセンサ列上に投影された一対の被写体光に基づいて焦点検出を行う瞳分割位相差方式の自動焦点検出装置が実行する方法であり、センサ列より出力される画像信号列について相関演算を行う相関演算ステップと、相関演算ステップでの相関演算結果の信頼性を判定する信頼性判定ステップと、信頼性判定ステップにて信頼性ありと判定されると、信頼性ありと判定された相関演算結果に基づいてデフォーカス量を算出するデフォーカス量算出ステップと、信頼性判定ステップにて信頼性なしと判定されると、相関演算を行った画像信号列の始端側の画像信号に対する信頼性と、終端側の画像信号に対する信頼性と、を比較し、比較結果に基づいて画像信号列から始端側と終端側の少なくとも一方の画像信号を除外することにより、画像信号列を絞り込む絞込ステップと、を含み、信頼性判定ステップにて信頼性ありと判定されるまで、絞込ステップでの画像信号列の絞り込み及び相関演算ステップでの絞り込み後の画像信号列の範囲に対する相関演算を行う。 The automatic focus detection method according to an embodiment of the present invention is a method executed by a pupil division phase difference type automatic focus detection device that performs focus detection based on a pair of subject lights projected on a pair of sensor rows. , The correlation calculation step that performs the correlation calculation on the image signal string output from the sensor string, the reliability judgment step that judges the reliability of the correlation calculation result in the correlation calculation step, and the reliability judgment step. When it is determined, the defocus amount calculation step of calculating the defocus amount based on the correlation calculation result determined to be reliable, and the correlation calculation when it is determined to be unreliable in the reliability determination step are performed. The reliability of the image signal on the start side and the reliability of the image signal on the end side of the image signal sequence are compared, and at least one of the image signals on the start side and the end side is selected from the image signal sequence based on the comparison result. By excluding, the narrowing down step of narrowing down the image signal sequence is included, and the narrowing down of the image signal sequence in the narrowing down step and the narrowing down in the correlation calculation step until it is determined to be reliable in the reliability determination step. Correlation calculation is performed on the range of the later image signal sequence.

本発明の一実施形態に係る自動焦点検出プログラムは、一対のセンサ列上に投影された一対の被写体光に基づいて焦点検出を行う瞳分割位相差方式の自動焦点検出装置が実行するプログラムであり、センサ列より出力される画像信号列について相関演算を行う相関演算ステップと、相関演算ステップでの相関演算結果の信頼性を判定する信頼性判定ステップと、信頼性判定ステップにて信頼性ありと判定されると、信頼性ありと判定された相関演算結果に基づいてデフォーカス量を算出するデフォーカス量算出ステップと、信頼性判定ステップにて信頼性なしと判定されると、相関演算を行った画像信号列の始端側の画像信号に対する信頼性と、終端側の画像信号に対する信頼性と、を比較し、比較結果に基づいて画像信号列から始端側と終端側の少なくとも一方の画像信号を除外することにより、画像信号列を絞り込む絞込ステップと、を含み、信頼性判定ステップにて信頼性ありと判定されるまで、絞込ステップでの画像信号列の絞り込み及び相関演算ステップでの絞り込み後の画像信号列の範囲に対する相関演算を行う。 The automatic focus detection program according to an embodiment of the present invention is a program executed by a pupil division phase difference type automatic focus detection device that performs focus detection based on a pair of subject lights projected on a pair of sensor rows. , The correlation calculation step that performs the correlation calculation on the image signal sequence output from the sensor string, the reliability judgment step that judges the reliability of the correlation calculation result in the correlation calculation step, and the reliability judgment step. When it is determined, the defocus amount calculation step of calculating the defocus amount based on the correlation calculation result determined to be reliable, and the correlation calculation when it is determined to be unreliable in the reliability determination step are performed. The reliability of the image signal on the start side and the reliability of the image signal on the end side of the image signal sequence are compared, and at least one of the image signals on the start side and the end side is selected from the image signal sequence based on the comparison result. By excluding, the narrowing down step of narrowing down the image signal sequence is included, and the narrowing down of the image signal sequence in the narrowing down step and the narrowing down in the correlation calculation step until it is determined to be reliable in the reliability determination step. Correlation calculation is performed on the range of the later image signal sequence.

本発明の一実施形態によれば、自動焦点検出装置、自動焦点検出方法及び自動焦点検出プログラムにおいて、焦点検出領域内に撮影距離の異なる複数の被写体が混在する場合にも、精度の高いデフォーカス量を算出することができる。 According to one embodiment of the present invention, in the automatic focus detection device, the automatic focus detection method, and the automatic focus detection program, even when a plurality of subjects having different shooting distances coexist in the focus detection area, defocusing with high accuracy is performed. The amount can be calculated.

本発明の一実施形態に係る撮影装置の概略構成を示すブロック図である。It is a block diagram which shows the schematic structure of the photographing apparatus which concerns on one Embodiment of this invention. 本発明の一実施形態に係る測距素子の概略構成を示す図である。It is a figure which shows the schematic structure of the distance measuring element which concerns on one Embodiment of this invention. 本発明の一実施形態に係るファインダ上での焦点検出エリアを示す図である。It is a figure which shows the focus detection area on the finder which concerns on one Embodiment of this invention. 本発明の第1実施形態において、カメラ制御部により実行される、焦点調節処理の一例を示すフローチャートである。It is a flowchart which shows an example of the focus adjustment process executed by the camera control part in 1st Embodiment of this invention. 本発明の第1実施形態において、カメラ制御部が取得する焦点検出信号の一例を示す図である。It is a figure which shows an example of the focus detection signal acquired by the camera control part in 1st Embodiment of this invention. 図4の測距演算処理(ステップS104)を示すフローチャートである。It is a flowchart which shows the distance measurement calculation process (step S104) of FIG. 図6の相関演算処理(ステップS204)により求められる相関値及びコントラスト値の一例を示す図である。It is a figure which shows an example of the correlation value and contrast value obtained by the correlation calculation process (step S204) of FIG. 図6の絞り込み範囲探索処理(ステップS207)を示すフローチャートである。It is a flowchart which shows the narrowing-down range search process (step S207) of FIG. 図8の初期化処理(ステップS301)を示すフローチャートである。It is a flowchart which shows the initialization process (step S301) of FIG. 図8の、絞り込み後の範囲に対して行われる相関演算処理(ステップS317)を示すフローチャートである。FIG. 8 is a flowchart showing a correlation calculation process (step S317) performed on the narrowed-down range in FIG. 図6の絞り込み範囲探索処理(ステップS207)の実行により絞り込まれる相関演算範囲の具体的一例を示す図である。It is a figure which shows a specific example of the correlation calculation range narrowed down by the execution of the narrowing-down range search process (step S207) of FIG. 画素範囲12〜21に対して相関演算処理を行ったときに求められる相関値及びコントラスト値の一例を示す図である。It is a figure which shows an example of the correlation value and contrast value obtained when the correlation calculation processing is performed on the pixel range 12-21. 図6の余剰範囲確認処理(ステップS208)を示すフローチャートである。It is a flowchart which shows the surplus range confirmation process (step S208) of FIG. 余剰範囲4〜11に対して相関演算処理を行ったときに求められる相関値SCO(s)及びコントラスト値OLC(s)の一例を示す図である。It is a figure which shows an example of the correlation value SCO (s) and contrast value OLC (s) obtained when the correlation calculation processing is performed on the surplus range 4-11. 余剰範囲4〜10に対して相関演算処理を行ったときに求められる相関値SCO(s)及びコントラスト値OLC(s)の一例を示す図である。It is a figure which shows an example of the correlation value SCO (s) and contrast value OLC (s) obtained when the correlation calculation processing is performed on the surplus range 4-10. 余剰範囲22〜29に対して相関演算処理を行ったときに求められる相関値SCO(s)及びコントラスト値OLC(s)の一例を示す図である。It is a figure which shows an example of the correlation value SCO (s) and contrast value OLC (s) obtained when the correlation calculation processing is performed on the surplus range 22 to 29. 余剰範囲26〜29に対して相関演算処理を行ったときに求められる相関値SCO(s)及びコントラスト値OLC(s)の一例を示す図である。It is a figure which shows an example of the correlation value SCO (s) and contrast value OLC (s) obtained when the correlation calculation processing is performed on the surplus range 26-29. 余剰範囲22〜25に対して相関演算処理を行ったときに求められる相関値SCO(s)及びコントラスト値OLC(s)の一例を示す図である。It is a figure which shows an example of the correlation value SCO (s) and contrast value OLC (s) obtained when the correlation calculation processing is performed on the surplus range 22 to 25. 図6のデフォーカス量選択処理(ステップS210)を示すフローチャートである。It is a flowchart which shows the defocus amount selection process (step S210) of FIG. 本発明の第1実施形態において、ファインダに表示される画面の一例を示す図である。It is a figure which shows an example of the screen displayed in the finder in 1st Embodiment of this invention. 本発明の第1実施形態において、ファインダに表示される画面の一例を示す図である。It is a figure which shows an example of the screen displayed in the finder in 1st Embodiment of this invention. 本発明の第2実施形態において、カメラ制御部が取得する焦点検出信号の一例を示す図である。It is a figure which shows an example of the focus detection signal acquired by the camera control part in the 2nd Embodiment of this invention. 本発明の第2実施形態において実行される測距演算処理を示すフローチャートである。It is a flowchart which shows the distance measurement calculation processing which is executed in 2nd Embodiment of this invention. 本発明の第2実施形態において求められる相関値及びコントラスト値の一例を示す図である。It is a figure which shows an example of the correlation value and contrast value required in the 2nd Embodiment of this invention. 図20の絞り込み範囲探索処理(ステップS207’)を示すフローチャートである。It is a flowchart which shows the narrowing-down range search process (step S207') of FIG. 図22のステップS317の処理までを実行したときの、相関演算範囲の絞り込み例を示す図である。It is a figure which shows the example of narrowing down of the correlation calculation range when the process up to step S317 of FIG. 22 is executed. 余剰範囲14〜21に対して相関演算処理を行ったときに求められる相関値SCO(s)及びコントラスト値OLC(s)の一例を示す図である。It is a figure which shows an example of the correlation value SCO (s) and contrast value OLC (s) obtained when the correlation calculation processing is performed on the surplus range 14-21. 図22のセンサ出力差補正処理(ステップS319)を示すフローチャートである。It is a flowchart which shows the sensor output difference correction process (step S319) of FIG. 図22のセンサ出力差補正処理(ステップS319)後の焦点検出信号の一例を示す図である。It is a figure which shows an example of the focus detection signal after the sensor output difference correction process (step S319) of FIG. 図22のセンサ出力差補正処理(ステップS319)後の画素範囲12〜21に対して相関演算処理を行ったときに求められる相関値及びコントラスト値の一例を示す図である。It is a figure which shows an example of the correlation value and the contrast value obtained when the correlation calculation process is performed on the pixel range 12 to 21 after the sensor output difference correction process (step S319) of FIG. 22.

以下、本発明の一実施形態に係る、自動焦点検出機能を有する自動焦点検出装置について図面を参照しながら説明する。この自動焦点検出装置は、一対のセンサ列上に投影された一対の被写体光に基づいて焦点検出を行う瞳分割位相差方式の自動焦点検出装置である。なお、以下においては、自動焦点検出装置の一例として撮影装置を挙げて説明を行う。 Hereinafter, an automatic focus detection device having an automatic focus detection function according to an embodiment of the present invention will be described with reference to the drawings. This automatic focus detection device is a pupil division phase difference type automatic focus detection device that performs focus detection based on a pair of subject lights projected on a pair of sensor rows. In the following, an imaging device will be described as an example of the automatic focus detection device.

図1は、本発明の一実施形態に係る撮影装置1の概略構成を示すブロック図である。本実施形態では、撮影装置1は、デジタル一眼レフカメラである。なお、撮影装置1は、デジタル一眼レフカメラに限らず、ミラーレス一眼カメラ、コンパクトデジタルカメラ、ビデオカメラ、ノートPC、タブレット端末、PHS(Personal Handy phone System)、スマートフォン、フィーチャフォン、ゲーム機等の、自動焦点検出機能を有する他の装置であってもよい。 FIG. 1 is a block diagram showing a schematic configuration of a photographing apparatus 1 according to an embodiment of the present invention. In the present embodiment, the photographing device 1 is a digital single-lens reflex camera. The photographing device 1 is not limited to a digital single-lens reflex camera, but may be a mirrorless single-lens camera, a compact digital camera, a video camera, a notebook PC, a tablet terminal, a PHS (Personal Handy phone System), a smartphone, a feature phone, a game machine, or the like. , It may be another device having an automatic focus detection function.

図1に示されるように、撮影装置1は、カメラボディ100及びカメラボディ100のマウント部101に着脱可能な撮影レンズ200を備える。カメラボディ100と撮影レンズ200は、マウント部101に設けられている電気接点102を介して通信可能となっている。 As shown in FIG. 1, the photographing device 1 includes a camera body 100 and a photographing lens 200 that can be attached to and detached from the mount portion 101 of the camera body 100. The camera body 100 and the photographing lens 200 can communicate with each other via the electric contact 102 provided on the mount portion 101.

カメラボディ100は、撮影装置1の統括的な制御を司るカメラ制御部103を備える。カメラ制御部103は、例えば、DSP(Digital Signal Processor)及びCPU(Central Processing Unit)を搭載したシステムLSI(Large-scale Integrated Circuit)であり、RAM(Random Access Memory)、ROM(Read Only Memory)等のメモリやA/Dコンバータを備える。また、カメラ制御部103は、機能構成として、露出制御部103a、焦点調節制御部103b、駆動機構制御部103c、画像処理部103d、表示制御部103e、スイッチ検出部104fを備える。カメラ制御部103は、ROMに格納されているプログラム(例えば後述する図4の焦点調節処理)を呼び出し、呼び出したプログラムをDSPやCPUで実行することにより、符号103a〜103fに示す機能構成の制御を行う。ROMには、これらの機能構成の制御を行うための制御パラメータも格納される。 The camera body 100 includes a camera control unit 103 that controls the overall control of the photographing device 1. The camera control unit 103 is, for example, a system LSI (Large-scale Integrated Circuit) equipped with a DSP (Digital Signal Processor) and a CPU (Central Processing Unit), such as a RAM (Random Access Memory) and a ROM (Read Only Memory). It is equipped with a memory and an A / D converter. Further, the camera control unit 103 includes an exposure control unit 103a, a focus adjustment control unit 103b, a drive mechanism control unit 103c, an image processing unit 103d, a display control unit 103e, and a switch detection unit 104f as functional configurations. The camera control unit 103 calls a program stored in the ROM (for example, the focus adjustment process of FIG. 4 described later), and executes the called program on the DSP or the CPU to control the functional configuration shown by the reference numerals 103a to 103f. I do. The ROM also stores control parameters for controlling these functional configurations.

カメラボディ100は、レリーズスイッチ110、メインミラー111、サブミラー112を備える。レリーズスイッチ110は、2段階スイッチである。スイッチ検出部104fは、レリーズスイッチ110に関し、半押し状態(S1状態)と全押し状態(S2状態)の2つの状態を検出することができる。スイッチ検出部104fによりS1状態が検出されると、露出制御部103aによる露出制御や焦点調節制御部103bによる焦点調節制御等の撮影準備動作が行われる。 The camera body 100 includes a release switch 110, a main mirror 111, and a sub mirror 112. The release switch 110 is a two-stage switch. The switch detection unit 104f can detect two states, a half-pressed state (S1 state) and a fully-pressed state (S2 state), with respect to the release switch 110. When the S1 state is detected by the switch detection unit 104f, a shooting preparation operation such as exposure control by the exposure control unit 103a and focus adjustment control by the focus adjustment control unit 103b is performed.

カメラボディ100は、フォーカシングスクリーン113、ペンタプリズム114、接眼レンズ115、ファインダ116を備える。撮影レンズ200を通過した被写体光は、メインミラー111で反射され、フォーカシングスクリーン113に結像される。フォーカシングスクリーン113で結像された被写体像は、ペンタプリズム114で正立像にされ、接眼レンズ115及びファインダ116を介して撮影者に視認される。 The camera body 100 includes a focusing screen 113, a pentaprism 114, an eyepiece 115, and a finder 116. The subject light that has passed through the photographing lens 200 is reflected by the main mirror 111 and imaged on the focusing screen 113. The subject image formed by the focusing screen 113 is made into an upright image by the pentaprism 114, and is visually recognized by the photographer through the eyepiece lens 115 and the finder 116.

ペンタプリズム114近傍には測光素子117が備えられる。この測光素子117に、ペンタプリズム114に入射した被写体光の一部が入射される。測光素子117は、被写体光の明るさに応じた電気信号を露出制御部103aに出力する。露出制御部103aは、入力された電気信号をA/Dコンバータにより画像信号(「露出信号」と記す。)に変換し、露出信号に基づいて測光演算を行い、撮影時の露出(例えば絞り値と露光時間)を決定する。 A photometric element 117 is provided in the vicinity of the pentaprism 114. A part of the subject light incident on the pentaprism 114 is incident on the photometric element 117. The photometric element 117 outputs an electric signal corresponding to the brightness of the subject light to the exposure control unit 103a. The exposure control unit 103a converts the input electric signal into an image signal (referred to as “exposure signal”) by an A / D converter, performs a photometric calculation based on the exposure signal, and performs an exposure (for example, aperture value) at the time of shooting. And the exposure time).

カメラボディ100は、瞳分割位相差方式による自動焦点検出を行うための焦点検出モジュール118として、コンデンサレンズ118a、反射ミラー118b、セパレータマスク118c、再結像レンズ118d、測距素子118eを備える。 The camera body 100 includes a condenser lens 118a, a reflection mirror 118b, a separator mask 118c, a reimaging lens 118d, and a ranging element 118e as a focus detection module 118 for performing automatic focus detection by the pupil division phase difference method.

撮影レンズ200を通過した被写体光の一部は、ハーフミラーであるメインミラー111を透過し、サブミラー112で反射され、焦点検出モジュール118に入射される。焦点検出モジュール118に入射された被写体光は、コンデンサレンズ118aを透過して反射ミラー118bで反射される。反射ミラー118bで反射された被写体光は、セパレータマスク118cにより一対の被写体光に分割された後、再結像レンズ118dにより測距素子118e上に再結像される。 A part of the subject light that has passed through the photographing lens 200 passes through the main mirror 111, which is a half mirror, is reflected by the sub mirror 112, and is incident on the focus detection module 118. The subject light incident on the focus detection module 118 passes through the condenser lens 118a and is reflected by the reflection mirror 118b. The subject light reflected by the reflection mirror 118b is divided into a pair of subject lights by the separator mask 118c, and then reimaged on the ranging element 118e by the reimaging lens 118d.

図2は、本発明の一実施形態に係る測距素子118eの概略構成を示す図である。図2に示されるように、測距素子118eは、同一構成及び同一寸法を持つ一対のラインセンサ118eA、118eBを有する。ラインセンサ118eA、118eBは、CCD(Charge Coupled Device)やCMOS(Complementary Metal Oxide Semiconductor)等の電荷蓄積型のラインセンサであり、N個の画素を有する。便宜上、ラインセンサ118eA、118eBの各画素に符号を付す。具体的には、ラインセンサ118eAに関し、図2の最も左側の画素に符号A[1]を付し、図2の最も右側の画素に符号A[N]を付す。これらの間の画素には、左側の画素から右側の画素に向かって順に、符号A[2]〜A[N−1]を付す。ラインセンサ118eBの各画素にも同様のルールで符号B[1]〜B[N]を付す。なお、本実施形態では、ラインセンサ118eA、118eBは、32個の画素を有する。便宜上、画素A[1]〜画素A[N]の画素列より出力される画像信号列を「Aセンサ列An」と記し、画素B[1]〜画素B[N]の画素列より出力される画像信号列を「Bセンサ列Bn」と記す。 FIG. 2 is a diagram showing a schematic configuration of a distance measuring element 118e according to an embodiment of the present invention. As shown in FIG. 2, the distance measuring element 118e has a pair of line sensors 118eA and 118eB having the same configuration and the same dimensions. The line sensors 118eA and 118eB are charge storage type line sensors such as CCD (Charge Coupled Device) and CMOS (Complementary Metal Oxide Semiconductor), and have N pixels. For convenience, each pixel of the line sensors 118eA and 118eB is coded. Specifically, regarding the line sensor 118eA, the leftmost pixel in FIG. 2 is designated by the reference numeral A [1], and the rightmost pixel in FIG. 2 is designated by the reference numeral A [N]. The pixels between them are designated by reference numerals A [2] to A [N-1] in order from the pixel on the left side to the pixel on the right side. The symbols B [1] to B [N] are assigned to each pixel of the line sensor 118eB according to the same rule. In this embodiment, the line sensors 118eA and 118eB have 32 pixels. For convenience, the image signal string output from the pixel strings of pixel A [1] to pixel A [N] is referred to as "A sensor string An", and is output from the pixel strings of pixel B [1] to pixel B [N]. The image signal sequence is referred to as "B sensor sequence Bn".

図3に、ファインダ116上での測距素子118eによる焦点検出エリア120を示す。焦点検出エリア120は、ファインダ視野内において測距素子118eの各画素が並ぶ領域と等価である。言い換えると、焦点検出エリア120内の被写体の光像は、測距素子118eの各画素で受光される。 FIG. 3 shows a focus detection area 120 by the distance measuring element 118e on the finder 116. The focus detection area 120 is equivalent to an area in which the pixels of the distance measuring element 118e are lined up in the viewfinder field of view. In other words, the light image of the subject in the focus detection area 120 is received by each pixel of the distance measuring element 118e.

図3の例では、測距素子118eは、焦点検出エリア120内に位置する被写体光(被写体300〜302の光像)を受光する。測距素子118eは、受光した被写体光に応じた電荷を蓄積し、蓄積した電荷を電気信号として焦点調節制御部103bに出力する。焦点調節制御部103bに入力された電気信号は、A/Dコンバータで画像信号(以下「焦点検出信号」と記す。)に変換される。焦点調節制御部103bは、焦点検出信号に対して相関演算を行い、測距素子118e上での位相ずれ量を算出し、位相ずれ量から像面ずれ量(すなわちデフォーカス量)を算出する。デフォーカス量が正の値の場合、被写体より遠距離側にピントが合っている状態(後ピン状態)であり、デフォーカス量が負の値の場合、被写体より近距離側にピントが合っている状態(前ピン状態)である。焦点調節制御部103bは、デフォーカス量が被写体にピントが合っているとみなせる合焦状態になると、合焦マーク121をファインダ116上に表示させる。合焦マーク121は、焦点検出エリア120を取り囲うマークとなっている。 In the example of FIG. 3, the distance measuring element 118e receives the subject light (light image of the subjects 300 to 302) located in the focus detection area 120. The ranging element 118e accumulates an electric charge corresponding to the received subject light, and outputs the accumulated electric charge as an electric signal to the focus adjustment control unit 103b. The electric signal input to the focus adjustment control unit 103b is converted into an image signal (hereinafter referred to as "focus detection signal") by the A / D converter. The focus adjustment control unit 103b performs a correlation calculation on the focus detection signal, calculates the amount of phase shift on the ranging element 118e, and calculates the amount of image plane shift (that is, the amount of defocus) from the amount of phase shift. When the defocus amount is a positive value, it is in focus on the far side from the subject (rear focus state), and when the defocus amount is negative, it is in focus on the short distance side from the subject. It is in the state of being (front pin state). The focus adjustment control unit 103b displays the in-focus mark 121 on the finder 116 when the defocus amount is in the in-focus state where it can be considered that the subject is in focus. The focus mark 121 is a mark that surrounds the focus detection area 120.

カメラボディ100は、スクリーン122、照明装置123を備える。スクリーン122は、フォーカシングスクリーン113とペンタプリズム114との間に設置される。スクリーン122には、測距点の位置に合わせてマイクロプリズムが形成される。照明装置123は、LED(Light Emitting Diode)等の光源を備える。照明装置123による照明光がペンタプリズム114内を反射してスクリーン122を照明すると、この照明光が、マイクロプリズムにより反射され、ペンタプリズム114内を反射して、接眼レンズ115及びファインダ116へ導かれる。これにより、ファインダ116上に合焦マーク121が表示され、撮影者に視認される。 The camera body 100 includes a screen 122 and a lighting device 123. The screen 122 is installed between the focusing screen 113 and the pentaprism 114. A microprism is formed on the screen 122 according to the position of the AF point. The lighting device 123 includes a light source such as an LED (Light Emitting Diode). When the illumination light from the illumination device 123 is reflected inside the pentaprism 114 to illuminate the screen 122, the illumination light is reflected by the microprism, reflected inside the pentaprism 114, and guided to the eyepiece lens 115 and the finder 116. .. As a result, the focusing mark 121 is displayed on the viewfinder 116 and is visible to the photographer.

カメラボディ100は、ミラー駆動機構124、シャッタ駆動機構125、シャッタ126、撮像素子127、画像記憶部128、記録装置収納部129、背面モニタ130を備える。スイッチ検出部104fによりS2状態が検出されると、撮影動作が開始される。まず、駆動機構制御部103cはミラー駆動機構124を制御し、メインミラー111及びサブミラー112を撮影光路の上方に退避させる。次いで、露出制御部103aは、露出演算にて決定した絞り値を撮影レンズ200に送信する。 The camera body 100 includes a mirror drive mechanism 124, a shutter drive mechanism 125, a shutter 126, an image sensor 127, an image storage unit 128, a recording device storage unit 129, and a rear monitor 130. When the S2 state is detected by the switch detection unit 104f, the photographing operation is started. First, the drive mechanism control unit 103c controls the mirror drive mechanism 124, and retracts the main mirror 111 and the sub mirror 112 above the photographing optical path. Next, the exposure control unit 103a transmits the aperture value determined by the exposure calculation to the photographing lens 200.

撮影レンズ200は、鏡筒201、第1レンズ群(固定レンズ群)202、第2レンズ群(フォーカスレンズ群)203、第3レンズ群(ズームレンズ群)204、絞り205、レンズ駆動機構206、絞り駆動機構207、フォーカスエンコーダ208、ズームエンコーダ209、レンズ制御部210、AF/MFモードスイッチ211を備える。 The photographing lens 200 includes a lens barrel 201, a first lens group (fixed lens group) 202, a second lens group (focus lens group) 203, a third lens group (zoom lens group) 204, an aperture 205, and a lens drive mechanism 206. It includes an aperture drive mechanism 207, a focus encoder 208, a zoom encoder 209, a lens control unit 210, and an AF / MF mode switch 211.

レンズ制御部210は、CPU、ROM等を備える。レンズ制御部210は、このROMに格納されているプログラムを呼び出し、呼び出したプログラムをCPUで実行することにより、各種制御を行う。 The lens control unit 210 includes a CPU, a ROM, and the like. The lens control unit 210 calls the program stored in the ROM and executes the called program on the CPU to perform various controls.

AF/MFモードスイッチ211は、撮影レンズ200の自動焦点検出及び調節を行うAFモードと、撮影レンズ200の手動焦点調節を行うMFモードとを切り替えるスイッチである。レンズ制御部210は、AF/MFモードスイッチ211のステータスをカメラ制御部103に通知する。カメラ制御部103は、レンズ制御部210に通知されたステータスに応じてAFモード又はMFモードに設定する焦点調節モード設定部として動作する。カメラ制御部103は、レンズ制御部210に対し、設定したモードに応じた制御を行う。 The AF / MF mode switch 211 is a switch that switches between an AF mode that automatically detects and adjusts the focus of the photographing lens 200 and an MF mode that manually adjusts the focus of the photographing lens 200. The lens control unit 210 notifies the camera control unit 103 of the status of the AF / MF mode switch 211. The camera control unit 103 operates as a focus adjustment mode setting unit that sets the AF mode or the MF mode according to the status notified to the lens control unit 210. The camera control unit 103 controls the lens control unit 210 according to the set mode.

レンズ制御部210は、AFモード時、カメラボディ100より受信したデフォーカス量を所定のレンズ駆動量変換係数を用いてレンズ駆動量に変換し、レンズ駆動量だけフォーカスレンズ群203が光軸上を移動するようにレンズ駆動機構206を制御する。なお、フォーカスレンズ群203の位置は、フォーカスエンコーダ208にて検出され、レンズ制御部210に出力される。レンズ制御部210は、フォーカスエンコーダ208より出力される位置をモニタしながらフォーカスレンズ群203の移動制御を行う。 In the AF mode, the lens control unit 210 converts the defocus amount received from the camera body 100 into a lens drive amount using a predetermined lens drive amount conversion coefficient, and the focus lens group 203 moves on the optical axis by the lens drive amount. The lens drive mechanism 206 is controlled so as to move. The position of the focus lens group 203 is detected by the focus encoder 208 and output to the lens control unit 210. The lens control unit 210 controls the movement of the focus lens group 203 while monitoring the position output from the focus encoder 208.

フォーカスレンズ群203は、MFモード時、不図示のフォーカスリングを撮影者が操作することによっても光軸上を移動する。フォーカスレンズ群203の移動に伴い、撮影レンズ200の焦点が変わる。 The focus lens group 203 moves on the optical axis when the photographer operates a focus ring (not shown) in the MF mode. As the focus lens group 203 moves, the focus of the photographing lens 200 changes.

ズームレンズ群204は、鏡筒201に設けられている不図示のズームリングを撮影者が操作することで光軸上を移動する。ズームレンズ群204の移動に伴い、撮影レンズ200のズーム倍率が変わる。なお、ズームレンズ群204の位置は、ズームエンコーダ209により検出され、レンズ制御部210に出力される。レンズ制御部210は、この位置をカメラ制御部103に通知する。例えば表示制御部103eによる表示制御により、現在のズーム倍率が背面モニタ130に表示される。 The zoom lens group 204 moves on the optical axis by the photographer operating a zoom ring (not shown) provided on the lens barrel 201. As the zoom lens group 204 moves, the zoom magnification of the photographing lens 200 changes. The position of the zoom lens group 204 is detected by the zoom encoder 209 and output to the lens control unit 210. The lens control unit 210 notifies the camera control unit 103 of this position. For example, the current zoom magnification is displayed on the rear monitor 130 by the display control by the display control unit 103e.

レンズ制御部210は、カメラボディ100より受信した絞り値を絞り駆動量に変換し、絞り駆動量だけ絞り205が開閉するように絞り駆動機構207を制御する。絞り駆動機構207の駆動力により絞り205の開度が変わると、固定レンズ群202、フォーカスレンズ群203、ズームレンズ群204を透過する被写体光の光量が変わる。 The lens control unit 210 converts the aperture value received from the camera body 100 into an aperture drive amount, and controls the aperture drive mechanism 207 so that the aperture 205 opens and closes by the aperture drive amount. When the opening degree of the aperture 205 changes due to the driving force of the aperture drive mechanism 207, the amount of subject light transmitted through the fixed lens group 202, the focus lens group 203, and the zoom lens group 204 changes.

駆動機構制御部103cは、シャッタ駆動機構125を制御し、測光演算にて決定した露光時間だけ撮像素子127に被写体光が当たるように、シャッタ126を開閉させる。 The drive mechanism control unit 103c controls the shutter drive mechanism 125 and opens and closes the shutter 126 so that the subject light hits the image sensor 127 for the exposure time determined by the photometric calculation.

撮像素子127は、被写体光を光電変換作用により電気信号に変換する受光素子であり、例えばCCDイメージセンサやCMOSイメージセンサである。撮像素子127により生成される電気信号は、画像処理部103dに出力される。画像処理部103dに入力された電気信号は、A/Dコンバータにより画像信号に変換され、γ補正等のデジタル画像処理が施される。デジタル画像処理が施された撮影画像データは、画像記憶部128に一時記憶され、圧縮処理等の画像処理が施された後、記録装置収納部129に収納されたメモリカード等の記録装置に記録される。画像記憶部128に一時記憶される撮影画像は、表示制御部103eによる表示制御により背面モニタ130に表示される。これにより、撮影者は、撮影画像の確認を撮影直後に行うことができる。 The image pickup device 127 is a light receiving element that converts subject light into an electric signal by a photoelectric conversion action, and is, for example, a CCD image sensor or a CMOS image sensor. The electric signal generated by the image sensor 127 is output to the image processing unit 103d. The electric signal input to the image processing unit 103d is converted into an image signal by the A / D converter, and digital image processing such as γ correction is performed. The captured image data subjected to digital image processing is temporarily stored in the image storage unit 128, and after image processing such as compression processing is performed, it is recorded in a recording device such as a memory card stored in the recording device storage unit 129. Will be done. The captured image temporarily stored in the image storage unit 128 is displayed on the rear monitor 130 by display control by the display control unit 103e. As a result, the photographer can confirm the captured image immediately after shooting.

[第1実施形態]
図4は、本発明の第1実施形態において、カメラ制御部103(焦点調節制御部103b)により実行される、焦点調節処理の一例を示すフローチャートである。
[First Embodiment]
FIG. 4 is a flowchart showing an example of the focus adjustment process executed by the camera control unit 103 (focus adjustment control unit 103b) in the first embodiment of the present invention.

図4に示されるように、カメラ制御部103は、レリーズスイッチ110の半押し状態(S1状態)を検知する(ステップS101)。カメラ制御部103は、S1状態を検知すると(ステップS101:YES)、測距素子118eの露光(ステップS102)と焦点検出信号の読み出し(ステップS103)を行う。 As shown in FIG. 4, the camera control unit 103 detects the half-pressed state (S1 state) of the release switch 110 (step S101). When the camera control unit 103 detects the S1 state (step S101: YES), the camera control unit 103 exposes the ranging element 118e (step S102) and reads out the focus detection signal (step S103).

図5に、本実施形態においてカメラ制御部103(焦点調節制御部103b)が取得する焦点検出信号の一例を示す。図5中、実線は、ラインセンサ118eAより出力される焦点検出信号(言い換えると、Aセンサ列An)を示し、破線は、ラインセンサ118eBより出力される焦点検出信号(言い換えると、Bセンサ列Bn)を示す。図5中、縦軸は、ラインセンサの出力値(輝度値)を示し、横軸は、画素番号を示す。この画素番号は、図2において各画素に付した符号の括弧書き内の数値に対応する。便宜上、画素番号1〜32が付された画素を単に画素1〜32と記す。 FIG. 5 shows an example of the focus detection signal acquired by the camera control unit 103 (focus adjustment control unit 103b) in the present embodiment. In FIG. 5, the solid line indicates the focus detection signal output from the line sensor 118eA (in other words, the A sensor array An), and the broken line indicates the focus detection signal output from the line sensor 118eB (in other words, the B sensor array Bn). ) Is shown. In FIG. 5, the vertical axis represents the output value (luminance value) of the line sensor, and the horizontal axis represents the pixel number. This pixel number corresponds to the numerical value in parentheses of the code attached to each pixel in FIG. For convenience, the pixels with pixel numbers 1-32 are simply referred to as pixels 1-32.

図5は、図3に示される如く焦点検出エリア120内に被写体300〜302が混在するときに取得される焦点検出信号を示す。被写体300が撮影装置1に最も近く、次いで、被写体301が撮影装置1に近く、被写体302が撮影装置1から最も遠い。補足すると、被写体300単体で見たときの位相ずれ量は+2画素(言い換えると、シフト数sが+2)とし、被写体301単体で見たときの位相ずれ量は+1画素(言い換えるとシフト数sが+1)とし、被写体302単体で見たときの位相ずれ量は0画素(言い換えるとシフト数sがゼロ)とする。なお、シフト数sについては後述する。 FIG. 5 shows a focus detection signal acquired when subjects 300 to 302 coexist in the focus detection area 120 as shown in FIG. The subject 300 is closest to the photographing device 1, then the subject 301 is closest to the photographing device 1, and the subject 302 is the farthest from the photographing device 1. Supplementally, the amount of phase shift when viewed with the subject 300 alone is +2 pixels (in other words, the number of shifts s is +2), and the amount of phase shift when viewed with the subject 301 alone is +1 pixel (in other words, the number of shifts s is +2). +1), and the amount of phase shift when the subject 302 is viewed alone is 0 pixels (in other words, the number of shifts s is zero). The number of shifts s will be described later.

カメラ制御部103は、焦点検出信号を用いて測距演算を行い、デフォーカス量を算出する(ステップS104)。 The camera control unit 103 performs a distance measurement calculation using the focus detection signal and calculates the defocus amount (step S104).

カメラ制御部103は、ステップS104にてデフォーカス量が算出できたか否かを判定する(ステップS105)。具体的には、デフォーカス量が算出できたことを示す測距フラグ(後述の図17参照)が「T(true)」に設定されているか否かが判定される。 The camera control unit 103 determines whether or not the defocus amount can be calculated in step S104 (step S105). Specifically, it is determined whether or not the ranging flag (see FIG. 17 described later) indicating that the defocus amount has been calculated is set to "T (true)".

カメラ制御部103は、デフォーカス量が算出できた場合(ステップS105:YES)、現在のデフォーカス量が所定量以内か否かを判定する(ステップS106)。この所定量以内とは、焦点深度により合焦と見なせる範囲内であることを意味する。この所定量の値は、例えば一定値又は焦点距離及び開放絞り情報から演算して設定することができる。 When the defocus amount can be calculated (step S105: YES), the camera control unit 103 determines whether or not the current defocus amount is within a predetermined amount (step S106). Within this predetermined amount means that it is within a range that can be regarded as focusing depending on the depth of focus. The value of this predetermined amount can be set by calculating from, for example, a constant value or focal length and open aperture information.

カメラ制御部103は、現在のデフォーカス量が所定量以内の場合(ステップS106:YES)、合焦マーク121を表示させて(ステップS107)、図4の焦点調節処理を終了する。 When the current defocus amount is within a predetermined amount (step S106: YES), the camera control unit 103 displays the focusing mark 121 (step S107) and ends the focus adjustment process of FIG.

カメラ制御部103は、現在のデフォーカス量が所定量を超える場合(ステップS106:NO)、レンズ制御部210にデフォーカス量を送信して、フォーカスレンズ群203をデフォーカス量に応じたレンズ駆動量だけ光軸方向に移動させる(ステップS108)。 When the current defocus amount exceeds a predetermined amount (step S106: NO), the camera control unit 103 transmits the defocus amount to the lens control unit 210 and drives the focus lens group 203 with the lens according to the defocus amount. The lens is moved in the optical axis direction by the amount (step S108).

カメラ制御部103は、ステップS104にてデフォーカス量が算出できなかった場合には(ステップS105:NO)、フォーカスレンズ群203を光軸方向に移動させながら(ステップS108)、デフォーカス量が算出可能な位置を探すサーチ動作を行う。 If the defocus amount cannot be calculated in step S104 (step S105: NO), the camera control unit 103 calculates the defocus amount while moving the focus lens group 203 in the optical axis direction (step S108). Performs a search operation to search for a possible position.

なお、フォーカスモードがMFモードに設定されている場合、ステップS107の合焦マーク表示処理を行った後であってもS1状態が継続する限りは、図4の焦点調節処理を繰り返し実行する。また、MFモード時には、現在のデフォーカス量が合焦と見なせる所定量を超える場合であっても(ステップS106:NO)、レンズ制御部210にデフォーカス量を送信せず、フォーカスレンズ群203を光軸方向に移動させない。また、MFモード時には、ステップS104にてデフォーカス量が算出できなかった場合にも(ステップS105:NO)、レンズ制御部210にデフォーカス量を送信せず、フォーカスレンズ群203を光軸方向に移動させない。 When the focus mode is set to the MF mode, the focus adjustment process of FIG. 4 is repeatedly executed as long as the S1 state continues even after the focus mark display process of step S107 is performed. Further, in the MF mode, even if the current defocus amount exceeds a predetermined amount that can be regarded as focusing (step S106: NO), the defocus amount is not transmitted to the lens control unit 210, and the focus lens group 203 is set. Do not move in the optical axis direction. Further, in the MF mode, even if the defocus amount cannot be calculated in step S104 (step S105: NO), the defocus amount is not transmitted to the lens control unit 210, and the focus lens group 203 is moved in the optical axis direction. Do not move.

図6は、図4の測距演算処理(ステップS104)を示すフローチャートである。 FIG. 6 is a flowchart showing the distance measurement calculation process (step S104) of FIG.

図6に示されるように、カメラ制御部103は、初期設定を行う(ステップS201)。この初期設定では、演算範囲の配列に初期範囲が設定される。ここで、本実施形態では、Aセンサ列AnとBセンサ列Bnを重ね合わせて画素毎の差の絶対値(画素単位相関値SCO[n])の総和(以下「相関値SCO(s)」と記す。)を求める演算が、Bセンサ列Bnを基準としてAセンサ列Anを1画素分ずつシフトさせながら実行される。シフト数sがゼロの状態から、Bセンサ列Bnに対してAセンサ列Anを±1画素分シフトさせていき、シフト数sが±sMAX(本実施形態では±3)になるまでシフト及び演算が繰り返される。Aセンサ列Anとして画素1〜32の全てを設定すると、例えばシフト数s=+1のとき、Bセンサ列Bnには、これに対応する画素33(=32+1)が存在しないため、適正な相関値SCO(s)を求めることができない。そこで、Aセンサ列Anの初期範囲は、画素4〜29(画素数26)に設定され、Bセンサ列Bnの初期範囲は、画素1〜32(画素数32)に設定される。 As shown in FIG. 6, the camera control unit 103 performs initial settings (step S201). In this initial setting, the initial range is set in the array of calculation ranges. Here, in the present embodiment, the A sensor row An and the B sensor row Bn are superposed and the sum of the absolute values of the differences for each pixel (pixel unit correlation value SCO [n]) (hereinafter, “correlation value SCO (s)””. The calculation for obtaining) is executed while shifting the A sensor row An by one pixel with respect to the B sensor row Bn. From the state where the shift number s is zero, the A sensor row An is shifted by ± 1 pixel with respect to the B sensor row Bn, and the shift is performed until the shift number s becomes ± s MAX (± 3 in this embodiment). The operation is repeated. When all of the pixels 1 to 32 are set as the A sensor row An, for example, when the number of shifts s = + 1, the corresponding pixel 33 (= 32 + 1) does not exist in the B sensor row Bn, so an appropriate correlation value is obtained. SCO (s) cannot be calculated. Therefore, the initial range of the A sensor array An is set to pixels 4 to 29 (pixel number 26), and the initial range of the B sensor array Bn is set to pixels 1-32 (pixel number 32).

補足すると、画素単位相関値SCO[n]は、「画素A[n]の輝度値」と「画素B[n+s]の輝度値」との差の絶対値である。 Supplementally, the pixel-based correlation value SCO [n] is an absolute value of the difference between the "luminance value of pixel A [n]" and the "luminance value of pixel B [n + s]".

カメラ制御部103は、演算範囲要素iをゼロに設定し、演算範囲要素数Iを1に設定する(ステップS202)。 The camera control unit 103 sets the calculation range element i to zero and sets the number of calculation range elements I to 1 (step S202).

カメラ制御部103は、演算範囲要素iが演算範囲要素数Iよりも小さい(すなわち、i<Iである)限り(ステップS203)、ステップS204〜S209の測距演算処理を繰り返す。 The camera control unit 103 repeats the distance measurement calculation processing of steps S204 to S209 as long as the calculation range element i is smaller than the number of calculation range elements I (that is, i <I) (step S203).

カメラ制御部103は、相関演算処理を行う(ステップS204)。この相関演算処理については、周知の処理であるため、ここでの詳細な説明は省略する。なお、この相関演算処理の具体的一例は、特許文献1にて参照される。 The camera control unit 103 performs the correlation calculation process (step S204). Since this correlation calculation process is a well-known process, detailed description thereof will be omitted here. A specific example of this correlation calculation process is referred to in Patent Document 1.

この相関演算処理により、相関値SCO(s)、輝度差(コントラスト値)OLC(s)及び信頼性判定値TRS(s)が求まる。コントラスト値OLC(s)は、Aセンサ列An及びBセンサ列Bnの相関演算範囲において隣接する画素の輝度差の絶対値の1/2(言い換えると、当該絶対値の平均値)の総和として求められる。補足すると、Aセンサ列An内の隣接画素間の輝度差の絶対値(隣接画素間コントラスト値CA[n])は、「画素A[n]の輝度値」と「画素A[n+1]の輝度値」との差の絶対値で示される。Bセンサ列Bn内の隣接画素間の輝度差の絶対値(隣接画素間コントラスト値CB[n])は、「画素B[n]の輝度値」と「画素B[n+1]の輝度値」との差の絶対値で示される。従って、コントラスト値OLC(s)は、相関演算範囲に含まれる各画素の隣接画素間コントラスト値CA[n]と隣接画素間コントラスト値CB[n]との平均値の総和である。 By this correlation calculation processing, the correlation value SCO (s), the luminance difference (contrast value) OLC (s), and the reliability determination value TRS (s) can be obtained. The contrast value OLC (s) is obtained as the sum of 1/2 (in other words, the average value of the absolute values) of the absolute value of the brightness difference between adjacent pixels in the correlation calculation range of the A sensor row An and the B sensor row Bn. Be done. Supplementally, the absolute value of the brightness difference between adjacent pixels in the A sensor array An (contrast value between adjacent pixels CA [n]) is "the brightness value of pixel A [n]" and "the brightness of pixel A [n + 1]". It is indicated by the absolute value of the difference from "value". The absolute value of the brightness difference between adjacent pixels in the B sensor array Bn (contrast value between adjacent pixels CB [n]) is "the brightness value of pixel B [n]" and "the brightness value of pixel B [n + 1]". It is indicated by the absolute value of the difference between. Therefore, the contrast value OLC (s) is the sum of the average values of the contrast value CA [n] between adjacent pixels and the contrast value CB [n] between adjacent pixels of each pixel included in the correlation calculation range.

信頼性判定値TRS(s)は、相関値SCO(s)をコントラスト値OLC(s)で除した値(=相関値SCO(s)/コントラスト値OLC(s))である。 The reliability determination value TRS (s) is a value obtained by dividing the correlation value SCO (s) by the contrast value OLC (s) (= correlation value SCO (s) / contrast value OLC (s)).

図7は、ラインセンサ118eA、118eBの全画素を相関演算範囲としたときに、図6の相関演算処理(ステップS204)により求められる相関値SCO(s)及びコントラスト値OLC(s)の一例を示す図である。図7中、実線は、各シフト数sにおける相関値SCO(s)(言い換えると、相関関数)を示し、破線は、各シフト数sにおけるコントラスト値OLC(s)を示す。図7中、縦軸は、相関値SCO(s)及びコントラスト値OLC(s)を示し、横軸は、シフト数sを示す。上述したように、本実施形態では、シフト数s=±3(すなわち7通りの)相関値SCO(s)及びコントラスト値OLC(s)が求められる。 FIG. 7 shows an example of the correlation value SCO (s) and the contrast value OLC (s) obtained by the correlation calculation process (step S204) of FIG. 6 when all the pixels of the line sensors 118eA and 118eB are set as the correlation calculation range. It is a figure which shows. In FIG. 7, the solid line shows the correlation value SCO (s) (in other words, the correlation function) at each shift number s, and the broken line shows the contrast value OLC (s) at each shift number s. In FIG. 7, the vertical axis represents the correlation value SCO (s) and the contrast value OLC (s), and the horizontal axis represents the number of shifts s. As described above, in the present embodiment, the number of shifts s = ± 3 (that is, 7 ways) correlation value SCO (s) and contrast value OLC (s) are obtained.

一対の被写体像の相対的な位置ずれ量は、Aセンサ列AnとBセンサ列Bnとが一致したときのシフト数である。そこで、カメラ制御部103は、ステップS204において、相関関数の極小値を検出し、この極小値をとるときのBセンサ列Bnに対するAセンサ列Anのシフト数s、すなわち像間隔を、相関演算結果(測距値)として検出する。図7の例では、相関関数は、シフト数sが+2のときに極小値をとる。 The relative displacement amount of the pair of subject images is the number of shifts when the A sensor row An and the B sensor row Bn coincide with each other. Therefore, in step S204, the camera control unit 103 detects the minimum value of the correlation function, and determines the number of shifts s of the A sensor sequence An with respect to the B sensor sequence Bn when taking this minimum value, that is, the image interval, as a result of the correlation calculation. Detect as (distance measurement value). In the example of FIG. 7, the correlation function takes a minimum value when the number of shifts s is +2.

このように、カメラ制御部103(焦点調節制御部103b)は、センサ列より出力される画像信号列について相関演算を行う相関演算部として動作する。 In this way, the camera control unit 103 (focus adjustment control unit 103b) operates as a correlation calculation unit that performs a correlation calculation on the image signal sequence output from the sensor sequence.

なお、本実施形態では、ラインセンサ118eA、118eBの画素単位よりも細かい単位での極小値を求めるため、相関関数について補間演算を行う。例示的には、シフト数s(=+2)及びその±1のシフト数(=+1、+3)の相関値SCOの3点で線形補間を行い、サブピクセル単位での極小値を求める。これにより、図7の例では、相関値が極小となるときのシフト数として+1.7が求まる。また、このときの相関値SCO(s)は304となる。図7では、この補間処理によって得られた相関値SCO(s)を黒い四角の点で示す。なお、補間処理の結果、相関値SCO(s)が負数になる場合は、相関値SCO(s)をゼロに置換する。 In the present embodiment, in order to obtain the minimum value in a unit finer than the pixel unit of the line sensors 118eA and 118eB, an interpolation calculation is performed on the correlation function. Illustratively, linear interpolation is performed at three points of the correlation value SCO of the number of shifts s (= + 2) and the number of shifts of ± 1 (= +1, +3) to obtain the minimum value in sub-pixel units. As a result, in the example of FIG. 7, +1.7 is obtained as the number of shifts when the correlation value becomes the minimum. Further, the correlation value SCO (s) at this time is 304. In FIG. 7, the correlation value SCO (s) obtained by this interpolation process is indicated by a black square dot. If the correlation value SCO (s) becomes a negative number as a result of the interpolation processing, the correlation value SCO (s) is replaced with zero.

このように、カメラ制御部103(焦点調節制御部103b)は、相関関数に対する補間処理によりサブピクセル単位での位相ずれ量を計算する補間計算部として動作する。 In this way, the camera control unit 103 (focus adjustment control unit 103b) operates as an interpolation calculation unit that calculates the amount of phase shift in sub-pixel units by interpolation processing for the correlation function.

本実施形態では、信頼性判定値TRS(s)は、補間処理後の相関値SCO(s)をコントラスト値OLC(s)で除した値とする。これにより、相関値が極小となるときのシフト数が例えば+1.7のように整数でない場合に、補間処理前の相関値SCO(s)をコントラスト値OLC(s)で除した値と比べて、信頼性判定値TRS(s)が判定値として精度の高いものとなる。なお、分子である相関値SCO(s)が小さいほどAセンサ列AnとBセンサ列Bnとの一致度が高い。そのため、この信頼性判定値TRS(s)は、ゼロに近いほど、相関演算結果の信頼性が高いことを示すものとなっている。 In the present embodiment, the reliability determination value TRS (s) is a value obtained by dividing the correlation value SCO (s) after the interpolation processing by the contrast value OLC (s). As a result, when the number of shifts when the correlation value becomes the minimum is not an integer such as +1.7, it is compared with the value obtained by dividing the correlation value SCO (s) before the interpolation processing by the contrast value OLC (s). , The reliability determination value TRS (s) becomes a highly accurate determination value. The smaller the correlation value SCO (s), which is a molecule, the higher the degree of coincidence between the A sensor row An and the B sensor row Bn. Therefore, the closer the reliability determination value TRS (s) is to zero, the higher the reliability of the correlation calculation result.

すなわち、相関演算によって求まった相関関数が極小値を取るときの位相ずれ量(第1の位相ずれ量)の信頼性判定値は、補間処理後の相関関数での極小値を、第1の位相ずれ量でのコントラスト値で除した値である。 That is, the reliability determination value of the phase shift amount (first phase shift amount) when the correlation function obtained by the correlation calculation takes the minimum value is the minimum value in the correlation function after the interpolation processing as the first phase. It is a value divided by the contrast value in the amount of deviation.

カメラ制御部103は、この信頼性判定値TRS(s)が第1の閾値以下(言い換えると、第1の位相ずれ量の信頼性判定値が所定閾値以下)の場合には信頼性フラグを「T(true)」に設定し、この信頼性判定値TRS(s)が第1の閾値より大きい場合には信頼性フラグを「F(false)」に設定する。カメラ制御部103は、前者の場合には、デフォーカス量を算出してステップS205に進む。カメラ制御部103は、後者の場合には、デフォーカス量を算出せずにステップS205に進む。 When the reliability determination value TRS (s) is equal to or less than the first threshold value (in other words, the reliability determination value of the first phase shift amount is equal to or less than the predetermined threshold value), the camera control unit 103 sets the reliability flag to ". It is set to "T (true)", and when the reliability determination value TRS (s) is larger than the first threshold value, the reliability flag is set to "F (false)". In the former case, the camera control unit 103 calculates the defocus amount and proceeds to step S205. In the latter case, the camera control unit 103 proceeds to step S205 without calculating the defocus amount.

このように、カメラ制御部103(焦点調節制御部103b)は、相関演算部による相関演算結果の信頼性を判定する信頼性判定部として動作する。また、カメラ制御部103(焦点調節制御部103b)は、信頼性判定部により信頼性ありと判定されると、信頼性ありと判定された相関演算結果に基づいてデフォーカス量を算出するデフォーカス量算出部として動作する。 In this way, the camera control unit 103 (focus adjustment control unit 103b) operates as a reliability determination unit that determines the reliability of the correlation calculation result by the correlation calculation unit. Further, when the camera control unit 103 (focus adjustment control unit 103b) is determined to be reliable by the reliability determination unit, the defocus amount is calculated based on the correlation calculation result determined to be reliable. Operates as a quantity calculation unit.

本実施形態では、第1の閾値を、セパレータマスク118cや再結像レンズ118dの製造誤差による非対称性、測距素子118eのノイズ成分による焦点検出信号のばらつきを考慮して、例えば0.05に設定する。 In the present embodiment, the first threshold value is set to, for example, 0.05 in consideration of the asymmetry due to the manufacturing error of the separator mask 118c and the reimaging lens 118d and the variation of the focus detection signal due to the noise component of the distance measuring element 118e. Set.

カメラ制御部103は、相関演算範囲を遠近混在部が含まれない範囲に絞り込む絞り込み範囲探索処理(ステップS207)及びデフォーカス量(言い換えると、合焦対象の被写体)を選択するデフォーカス量選択処理(ステップS210)で必要な各相関演算データを演算範囲要素iの配列に格納(言い換えると、各相関演算データを設定)する(ステップS205)。 The camera control unit 103 has a narrowing range search process (step S207) that narrows the correlation calculation range to a range that does not include the perspective mixed portion, and a defocus amount selection process that selects the defocus amount (in other words, the subject to be focused). Each correlation calculation data required in (step S210) is stored in the array of the calculation range element i (in other words, each correlation calculation data is set) (step S205).

具体的には、カメラ制御部103は、ステップS204にて求められた相関値SCO(s)を相関値SCO[i]として、コントラスト値OLC(s)をコントラスト値OLC[i]として、信頼性判定値TRS(s)を信頼性判定値TRS[i]として、信頼性フラグを信頼性フラグ[i]として、シフト数(s)をシフト数[i]として、補間処理後のシフト数(s)を補間シフト数[i]として、デフォーカス量をデフォーカス量[i]として、それぞれ、RAM等に格納する。 Specifically, the camera control unit 103 sets the correlation value SCO (s) obtained in step S204 as the correlation value SCO [i] and the contrast value OLC (s) as the contrast value OLC [i] for reliability. The determination value TRS (s) is the reliability determination value TRS [i], the reliability flag is the reliability flag [i], the number of shifts (s) is the number of shifts [i], and the number of shifts (s) after interpolation processing. ) Is stored in the RAM or the like as the number of interpolation shifts [i] and the defocus amount is stored in the RAM or the like as the defocus amount [i].

カメラ制御部103は、演算範囲要素iの配列に格納された信頼性フラグ[i]が「T(true)」の場合(ステップS206:YES)、演算範囲要素iにおける相関演算範囲が遠近混在部を含まない可能性の高い範囲であるとみなし、iを1インクリメントして(ステップS209)、当該範囲についての相関演算処理を完了する。カメラ制御部103は、1インクリメント後のiが演算範囲要素数Iよりも小さい(すなわち、i(=i+1)<Iである)場合、次の演算範囲要素i(=i+1)に対してステップS204〜S209の処理を実行する。 In the camera control unit 103, when the reliability flag [i] stored in the array of the calculation range element i is “T (true)” (step S206: YES), the correlation calculation range in the calculation range element i is a perspective mixed unit. Is considered to be a range that is highly likely not to include, i is incremented by 1 (step S209), and the correlation calculation process for the range is completed. When i after one increment is smaller than the number of calculation range elements I (that is, i (= i + 1) <I), the camera control unit 103 sets step S204 for the next calculation range element i (= i + 1). ~ S209 is executed.

カメラ制御部103は、演算範囲要素iの配列に格納された信頼性フラグ[i]が「F(false)」の場合(ステップS206:NO)、演算範囲要素iにおける相関演算範囲が遠近混在部を含む可能性の高い範囲であるとみなし、ステップS207の絞り込み範囲探索処理を行う。この絞り込み範囲探索処理では、相関演算範囲から遠近混在部を排除する範囲が探索され、探索された範囲(絞り込み範囲)で相関演算処理が行われる。遠近混在部を排除した範囲で相関演算及びデフォーカス量計算が行われるため、精度の高い焦点調節処理が可能となる。 In the camera control unit 103, when the reliability flag [i] stored in the array of the calculation range element i is “F (false)” (step S206: NO), the correlation calculation range in the calculation range element i is a perspective mixed unit. It is considered that the range includes the above, and the narrowing range search process in step S207 is performed. In this narrowing down range search processing, a range excluding the perspective mixed portion from the correlation calculation range is searched, and the correlation calculation processing is performed in the searched range (narrowing range). Since the correlation calculation and the defocus amount calculation are performed in the range excluding the perspective mixed portion, highly accurate focus adjustment processing becomes possible.

図8は、図6の絞り込み範囲探索処理(ステップS207)を示すフローチャートである。 FIG. 8 is a flowchart showing the narrowing range search process (step S207) of FIG.

図8に示されるように、カメラ制御部103は、絞り込み範囲探索処理に用いるデータの初期化処理を行う(ステップS301)。図9に、この初期化処理(ステップS301)のフローチャートを示す。 As shown in FIG. 8, the camera control unit 103 performs the data initialization process used for the narrowing down range search process (step S301). FIG. 9 shows a flowchart of this initialization process (step S301).

図9に示されるように、カメラ制御部103は、絞り込み範囲の始端画素と終端画素の初期値を設定する(ステップS401)。この初期値は、ステップS204において相関演算処理を行ったAセンサ列Anの演算範囲である。絞り込み範囲探索処理の初回実行時(i=0)には、ステップS204においてAセンサ列Anの画素4〜29に対して相関演算処理が行われているため、始端画素が4に設定され、終端画素が29に設定される。 As shown in FIG. 9, the camera control unit 103 sets the initial values of the start pixel and the end pixel of the narrowing range (step S401). This initial value is the calculation range of the A sensor string An that has undergone the correlation calculation process in step S204. At the time of the first execution (i = 0) of the narrowing down range search process, since the correlation calculation process is performed on the pixels 4 to 29 of the A sensor sequence An in step S204, the start pixel is set to 4 and the end pixel is set to 4. The pixel is set to 29.

カメラ制御部103は、絞り込み範囲画素数の初期値を計算する(ステップS402)。絞り込み範囲探索処理の初回実行時(i=0)には、ステップS204においてAセンサ列AnとBセンサ列Bnの26画素に対して相関演算処理が行われているため、絞り込み範囲画素数として26が計算される。 The camera control unit 103 calculates the initial value of the number of pixels in the narrowing range (step S402). At the time of the first execution (i = 0) of the narrowing down range search process, the correlation calculation process is performed on the 26 pixels of the A sensor row An and the B sensor row Bn in step S204, so that the number of narrowed down range pixels is 26. Is calculated.

カメラ制御部103は、絞り込み範囲の始端画素の相関値(「始端側相関値[1])の初期値と、絞り込み範囲の終端画素の相関値(終端側相関値[1]」)の初期値を計算する(ステップS403)。絞り込み範囲探索処理の初回実行時(i=0)には、相関関数が極小値を取るときのシフト数s(=+2)における、画素4の画素単位相関値[4]、画素29の画素単位相関値[29]が、それぞれ、始端側相関値[1]の初期値、終端側相関値[1]の初期値として計算される。始端側相関値[1]の初期値は、例えば32であり、終端側相関値[1]の初期値は、例えば64である。 The camera control unit 103 has an initial value of a correlation value of the start pixel of the narrowing range (“start end side correlation value [1]) and an initial value of the correlation value of the end pixel of the narrowing range (end side correlation value [1]”). Is calculated (step S403). At the time of the first execution (i = 0) of the narrowing range search process, the pixel unit correlation value [4] of the pixel 4 and the pixel unit of the pixel 29 in the shift number s (= + 2) when the correlation function takes the minimum value. The correlation value [29] is calculated as the initial value of the start side correlation value [1] and the initial value of the end side correlation value [1], respectively. The initial value of the start-end correlation value [1] is, for example, 32, and the initial value of the end-end correlation value [1] is, for example, 64.

なお、ステップS204において相関値SCO(s)及びコントラスト値OLC(s)を求める過程で、各シフト数s=±3の画素単位相関値[n]、隣接画素間コントラスト値CA[n]、隣接画素間コントラスト値CB[n]が求まっている。 In the process of obtaining the correlation value SCO (s) and the contrast value OLC (s) in step S204, the pixel-by-pixel correlation value [n] of each shift number s = ± 3, the contrast value CA [n] between adjacent pixels, and the adjacent pixels. The inter-pixel contrast value CB [n] has been obtained.

カメラ制御部103は、絞り込み範囲最小コントラスト差の初期値として、ステップS204の相関演算処理で求められたコントラスト差を設定する(ステップS404)。ここで、ステップS204では、相関関数が極小値を取るときのシフト数s(=+2)におけるコントラスト値OLC(+2)と、これに隣接するシフト数s(=+1)におけるコントラスト値OLC(+1)との差分、及びコントラスト値OLC(+2)と、これに隣接するシフト数s(=+3)におけるコントラスト値OLC(+3)との差分が計算され、計算された差の絶対値が大きい方がコントラスト差として求められる。言い換えると、コントラスト差は、第1の位相ずれ量と、第1の位相ずれ量よりも所定画素分(ここでは一例として1画素分、別の実施形態では2画素分以上であってもよい。)大きい又は小さい第2の位相ずれ量と、のコントラスト値の差である。 The camera control unit 103 sets the contrast difference obtained in the correlation calculation process in step S204 as the initial value of the minimum contrast difference in the narrowing range (step S404). Here, in step S204, the contrast value OLC (+2) at the shift number s (= + 2) when the correlation function takes the minimum value, and the contrast value OLC (+1) at the shift number s (= + 1) adjacent thereto. And the difference between the contrast value OLC (+2) and the contrast value OLC (+3) at the number of shifts s (= + 3) adjacent to this are calculated, and the larger the absolute value of the calculated difference, the more the contrast. Obtained as a difference. In other words, the contrast difference may be a predetermined pixel amount (here, one pixel as an example, or two pixels or more in another embodiment) than the first phase shift amount and the first phase shift amount. ) The difference between the large or small second phase shift amount and the contrast value.

図7に示されるコントラスト値OLC(+1)、OLC(+2)、OLC(+3)は、それぞれ、「1528」、「1520」、「1504」である。そのため、カメラ制御部103は、絞り込み範囲探索処理の初回実行時(i=0)には、ステップS204においてコントラスト差として16を求め、ステップS404において絞り込み範囲最小コントラスト差の初期値として16を設定する。 The contrast values OLC (+1), OLC (+2), and OLC (+3) shown in FIG. 7 are "1528", "1520", and "1504", respectively. Therefore, the camera control unit 103 obtains 16 as the contrast difference in step S204 at the first execution (i = 0) of the narrowing down range search process, and sets 16 as the initial value of the narrowing down range minimum contrast difference in step S404. ..

カメラ制御部103は、絞り込み範囲最小信頼性判定値の初期値としてステップS204の相関演算処理で求められた信頼性判定値を設定する(ステップS405)。ここで、絞り込み範囲探索処理の初回実行時(i=0)には、ステップS204では、信頼性判定値TRS(s)として、補間処理後の相関値SCO(s)をコントラスト値OLC(s)で除した値(=304/1520)が計算される。そのため、カメラ制御部103は、絞り込み範囲最小信頼性判定値の初期値として0.2を設定する。 The camera control unit 103 sets the reliability determination value obtained in the correlation calculation process in step S204 as the initial value of the narrowing down range minimum reliability determination value (step S405). Here, at the time of the first execution (i = 0) of the narrowing down range search process, in step S204, the correlation value SCO (s) after the interpolation process is set as the reliability determination value TRS (s) and the contrast value OLC (s). The value divided by (= 304/1520) is calculated. Therefore, the camera control unit 103 sets 0.2 as the initial value of the narrowing-down range minimum reliability determination value.

カメラ制御部103は、絞り込み範囲画素数が第2の閾値より大きい限り(ステップS302)、ステップS303〜S317の絞り込み処理を繰り返し実行する。第2の閾値は、例えば4である。絞り込み範囲探索処理の初回実行時(i=0)には、絞り込み範囲画素数が26に設定されているため、ステップS303以降の処理が実行される。 As long as the number of pixels in the narrowing range is larger than the second threshold value (step S302), the camera control unit 103 repeatedly executes the narrowing process of steps S303 to S317. The second threshold is, for example, 4. Since the number of pixels in the narrowing range is set to 26 at the time of the first execution (i = 0) of the narrowing range search process, the processes after step S303 are executed.

カメラ制御部103は、始端側相関値[2]、終端側相関値[2]、始端側コントラスト値[1]、終端側コントラスト値[1]を計算する(ステップS303)。 The camera control unit 103 calculates the start end side correlation value [2], the end side correlation value [2], the start end side contrast value [1], and the end side contrast value [1] (step S303).

始端側相関値[2]は、絞り込み範囲の始端画素の+方向に隣接する画素の画素単位相関値である。終端側相関値[2]は、終端画素の−方向に隣接する画素の画素単位相関値である。 The start-end-side correlation value [2] is a pixel-by-pixel correlation value of pixels adjacent to the start-end pixel in the narrowing range in the + direction. The end-side correlation value [2] is a pixel-by-pixel correlation value of pixels adjacent to the end pixel in the − direction.

始端側コントラスト値[1]は、絞り込み範囲の始端画素での隣接画素間コントラスト値CA[n]と、当該始端画素での隣接画素間コントラスト値CB[n+s]との合計を2で割った値である。終端側コントラスト値[1]は、絞り込み範囲の終端画素での隣接画素間コントラスト値CA[n]と、絞り込み範囲の終端画素での隣接画素間コントラスト値CB[n+s]との合計を2で割った値である。 The start end side contrast value [1] is a value obtained by dividing the sum of the contrast value CA [n] between adjacent pixels in the start pixel of the narrowing range and the contrast value CB [n + s] between adjacent pixels in the start pixel by 2. Is. For the end-side contrast value [1], the sum of the contrast value CA [n] between adjacent pixels at the end pixel of the narrowing range and the contrast value CB [n + s] between adjacent pixels at the end pixel of the narrowing range is divided by 2. Value.

カメラ制御部103は、絞り込み範囲の始端側相関値[X]、終端側相関値[X]、始端側コントラスト値[X]、終端側コントラスト値[X]、始端側信頼性判定値[X]、終端側信頼性判定値[X]を計算する(ステップS304)。 The camera control unit 103 has a start end side correlation value [X], an end side correlation value [X], a start end side contrast value [X], an end side contrast value [X], and a start end side reliability determination value [X] in the narrowing range. , The terminal reliability determination value [X] is calculated (step S304).

始端側相関値[X]は、始端側相関値[0]と始端側相関値[1]と始端側相関値[2]との合計である。始端側相関値[0]は、絞り込み範囲の始端画素の−方向に隣接する画素の画素単位相関値である。終端側相関値[X]は、終端側相関値[0]と終端側相関値[1]と終端側相関値[2]との合計である。終端側相関値[0]は、絞り込み範囲の始端画素の+方向に隣接する画素の画素単位相関値である。 The start-end side correlation value [X] is the sum of the start-end side correlation value [0], the start-end side correlation value [1], and the start-end side correlation value [2]. The start-end-side correlation value [0] is a pixel-by-pixel correlation value of pixels adjacent to the start-end pixel in the narrowing range in the − direction. The end-side correlation value [X] is the sum of the end-side correlation value [0], the end-side correlation value [1], and the end-side correlation value [2]. The end-side correlation value [0] is a pixel-by-pixel correlation value of pixels adjacent to the start end pixel in the narrowing range in the + direction.

始端側コントラスト値[X]は、始端側コントラスト値[0]と始端側コントラスト値[1]との合計である。始端側コントラスト値[0]は、絞り込み範囲の始端画素の−方向に隣接する画素での隣接画素間コントラスト値CA[n]と、当該画素での隣接画素間コントラスト値CB[n+s]との合計を2で割った値である。終端側コントラスト値[X]は、終端側コントラスト値[0]と終端側コントラスト値[1]との合計である。終端側コントラスト値[0]は、絞り込み範囲の終端画素の+方向に隣接する画素での隣接画素間コントラスト値CA[n]と、当該画素での隣接画素間コントラスト値CB[n+s]との合計を2で割った値である。 The start-end side contrast value [X] is the sum of the start-end side contrast value [0] and the start-end side contrast value [1]. The contrast value [0] on the start end side is the sum of the contrast value CA [n] between adjacent pixels in the pixels adjacent in the − direction of the start pixel in the narrowing range and the contrast value CB [n + s] between adjacent pixels in the pixel. Is divided by two. The end-side contrast value [X] is the sum of the end-side contrast value [0] and the end-side contrast value [1]. The contrast value [0] on the terminal side is the sum of the contrast value CA [n] between adjacent pixels in the pixels adjacent to the terminal pixel in the narrowing range in the + direction and the contrast value CB [n + s] between the adjacent pixels in the pixel. Is divided by two.

始端側信頼性判定値[X]は、始端側相関値[X]を始端側コントラスト値[X]で除した値である。終端側信頼性判定値[X]は、終端側相関値[X]を終端側コントラスト値[X]で除した値である。 The start-end side reliability determination value [X] is a value obtained by dividing the start-end side correlation value [X] by the start-end side contrast value [X]. The end-side reliability determination value [X] is a value obtained by dividing the end-side correlation value [X] by the end-side contrast value [X].

カメラ制御部103は、始端側信頼性判定値[X]が終端側信頼性判定値[X]よりも大きいか否かを判定する(ステップS305)。カメラ制御部103は、始端側信頼性判定値[X]が終端側信頼性判定値[X]以下の場合(ステップS305:NO)、始端側信頼性判定値[X]が終端側信頼性判定値[X]よりも小さいか否かを判定する(ステップS306)。カメラ制御部103は、始端側信頼性判定値[X]と終端側信頼性判定値[X]が同じ値の場合(ステップS306:NO)、始端側コントラスト値[X]が終端側コントラスト値[X]よりも小さいか否かを判定する(ステップS307)。カメラ制御部103は、始端側コントラスト値[X]が終端側コントラスト値[X]以上の場合(ステップS307:NO)、始端側コントラスト値[X]が終端側コントラスト値[X]よりも大きいか否かを判定する(ステップS308)。 The camera control unit 103 determines whether or not the start end side reliability determination value [X] is larger than the end end side reliability determination value [X] (step S305). When the start end side reliability determination value [X] is equal to or less than the end end side reliability determination value [X] (step S305: NO), the camera control unit 103 determines that the start end side reliability determination value [X] is the end side reliability determination. It is determined whether or not it is smaller than the value [X] (step S306). In the camera control unit 103, when the start end side reliability determination value [X] and the end end side reliability determination value [X] are the same value (step S306: NO), the start end side contrast value [X] is the end side contrast value [X]. It is determined whether or not it is smaller than X] (step S307). When the start end side contrast value [X] is equal to or higher than the end side contrast value [X] (step S307: NO), the camera control unit 103 determines whether the start end side contrast value [X] is larger than the end side contrast value [X]. Whether or not it is determined (step S308).

ステップS309〜S311において、カメラ制御部103は、始端画素絞り込みフラグと終端画素絞り込みフラグを「T(true)」又は「F(false)」に設定する。始端画素絞り込みフラグは、相関演算範囲から遠近混在部を排除するうえで始端画素が絞り込むべき画素であることを示すフラグである。終端画素絞り込みフラグは、相関演算範囲から遠近混在部を排除するうえで終端画素が絞り込むべき画素であることを示すフラグである。 In steps S309 to S311 the camera control unit 103 sets the start pixel narrowing flag and the ending pixel narrowing flag to "T (true)" or "F (false)". The start pixel narrowing-down flag is a flag indicating that the start-end pixel is a pixel to be narrowed down in order to exclude the perspective mixed portion from the correlation calculation range. The terminal pixel narrowing-down flag is a flag indicating that the terminal pixel is a pixel to be narrowed down in order to exclude the perspective mixed portion from the correlation calculation range.

カメラ制御部103は、始端側信頼性判定値[X]が終端側信頼性判定値[X]よりも大きい場合(ステップS305:YES)、始端画素が絞り込むべき画素であるとみなし、始端画素絞り込みフラグを「T(true)」に設定し、終端画素絞り込みフラグを「F(false)」に設定する(ステップS309)。これとは逆に、終端側信頼性判定値[X]が始端側信頼性判定値[X]よりも大きい場合(ステップS306:YES)、カメラ制御部103は、終端画素が絞り込むべき画素であるとみなし、始端画素絞り込みフラグとして「F(false)」を立て、終端画素絞り込みフラグを「T(true)」に設定する(ステップS310)。 When the start-end side reliability determination value [X] is larger than the end-side reliability determination value [X] (step S305: YES), the camera control unit 103 considers that the start-end pixel is a pixel to be narrowed down, and narrows down the start-end pixel. The flag is set to "T (true)" and the terminal pixel narrowing flag is set to "F (false)" (step S309). On the contrary, when the end side reliability determination value [X] is larger than the start end side reliability determination value [X] (step S306: YES), the camera control unit 103 is a pixel to be narrowed down by the end pixel. Assuming that, "F (false)" is set as the start pixel narrowing flag, and the end pixel narrowing flag is set to "T (true)" (step S310).

始端側信頼性判定値[X]と終端側信頼性判定値[X]が同じ値の場合は、コントラスト値によって絞り込むべき画素が判断される。具体的には、コントラスト値が小さい方に相関演算範囲を絞り込むと、偽ボトム(相関関数において真なる極小値にはならない変曲点)を極小値として検出する可能性が高くなる。そのため、コントラスト値が小さい画素が絞り込むべき画素として判断される。 When the start end side reliability determination value [X] and the end end side reliability determination value [X] are the same value, the pixels to be narrowed down are determined by the contrast value. Specifically, if the correlation calculation range is narrowed down to the one with the smaller contrast value, there is a high possibility that the false bottom (the inflection point that does not become the true minimum value in the correlation function) is detected as the minimum value. Therefore, a pixel having a small contrast value is determined as a pixel to be narrowed down.

カメラ制御部103は、始端側コントラスト値[X]が終端側コントラスト値[X]よりも小さい場合(ステップS307:YES)、始端画素が絞り込むべき画素であるとみなし、始端画素絞り込みフラグを「T(true)」設定し、終端画素絞り込みフラグを「F(false)」に設定する(ステップS309)。これとは逆に、終端側コントラスト値[X]が始端側コントラスト値[X]よりも小さい場合(ステップS308:YES)、カメラ制御部103は、終端画素が絞り込むべき画素であるとみなし、始端画素絞り込みフラグを「F(false)」に設定し、終端画素絞り込みフラグを「T(true)」に設定する(ステップS310)。 When the start end side contrast value [X] is smaller than the end side contrast value [X] (step S307: YES), the camera control unit 103 considers that the start end pixel is a pixel to be narrowed down, and sets the start end pixel narrowing flag to "T". (True) ”is set, and the terminal pixel narrowing-down flag is set to“ F (false) ”(step S309). On the contrary, when the end side contrast value [X] is smaller than the start end side contrast value [X] (step S308: YES), the camera control unit 103 considers that the end pixel is a pixel to be narrowed down and starts the end. The pixel narrowing flag is set to "F (false)", and the terminal pixel narrowing flag is set to "T (true)" (step S310).

始端側信頼性判定値[X]と終端側信頼性判定値[X]が同じで、始端側コントラスト値[X]と終端側コントラスト値[X]も同じ場合(ステップS308:NO)は、始端画素と終端画素の何れを絞り込むべきか判断するのが難しい。そこで、この場合、カメラ制御部103は、両方の画素が絞り込むべき画素であるとみなし、始端画素絞り込みフラグを「T(true)」に設定し、終端画素絞り込みフラグを「T(true)」に設定する(ステップS311)。 When the start end side reliability judgment value [X] and the end side reliability judgment value [X] are the same, and the start end side contrast value [X] and the end side contrast value [X] are also the same (step S308: NO), the start end side It is difficult to determine whether to narrow down the pixels or the terminal pixels. Therefore, in this case, the camera control unit 103 considers that both pixels are pixels to be narrowed down, sets the start pixel narrowing flag to "T (true)", and sets the ending pixel narrowing flag to "T (true)". Set (step S311).

カメラ制御部103は、ステップS309〜S311にて立てられたフラグに従って絞り込まれたときの相関演算範囲の見込み画素数が、第2の閾値(ステップS302参照)より大きいか否かを判定する(ステップS312)。 The camera control unit 103 determines whether or not the expected number of pixels in the correlation calculation range when narrowed down according to the flags set in steps S309 to S311 is larger than the second threshold value (see step S302) (step). S312).

カメラ制御部103は、見込み画素数が第2の閾値より大きい場合(ステップS312:YES)、フラグに従って相関演算範囲の絞り込みを行う(ステップS313〜S316)。具体的には、カメラ制御部103は、始端画素絞り込みフラグが「T(true)」の場合(ステップS313:YES)、相関演算範囲から始端画素を除外し(ステップS314)、終端画素絞り込みフラグが「T(true)」の場合(ステップS315:YES)、相関演算範囲から終端画素を除外する(ステップS316)。 When the number of expected pixels is larger than the second threshold value (step S312: YES), the camera control unit 103 narrows down the correlation calculation range according to the flag (steps S313 to S316). Specifically, when the start pixel narrowing flag is "T (true)" (step S313: YES), the camera control unit 103 excludes the start pixel from the correlation calculation range (step S314), and the end pixel narrowing flag is set. In the case of "T (true)" (step S315: YES), the terminal pixel is excluded from the correlation calculation range (step S316).

カメラ制御部103は、見込み画素数が第2の閾値以下の場合(ステップS312:NO)、ステップS313〜S316の絞り込み処理を実行することなく、図8の絞り込み範囲探索処理を終了する。 When the number of expected pixels is equal to or less than the second threshold value (step S312: NO), the camera control unit 103 ends the narrowing range search process of FIG. 8 without executing the narrowing process of steps S313 to S316.

このように、カメラ制御部103(焦点調節制御部103b)は、信頼性判定部により信頼性なしと判定されると、絞り込み範囲探索処理(ステップS207)を実行することにより、相関演算を行った画像信号列の始端側の画像信号に対する信頼性と、終端側の画像信号に対する信頼性と、を比較し、比較結果に基づいて画像信号列から始端側と終端側の少なくとも一方の画像信号を除外することにより、画像信号列を絞り込む絞込部として動作する。 As described above, when the reliability determination unit determines that the camera control unit 103 (focus adjustment control unit 103b) is unreliable, the camera control unit 103 (focus adjustment control unit 103b) performs the correlation calculation by executing the narrowing down range search process (step S207). The reliability of the image signal on the start side of the image signal sequence and the reliability of the image signal on the end side are compared, and at least one of the image signals on the start side and the end side is excluded from the image signal sequence based on the comparison result. By doing so, it operates as a narrowing-down unit that narrows down the image signal sequence.

この絞込部は、絞り込むべき画素を精度よく判定するため、ステップS305〜S308において、始端側に位置する複数の画像信号に対する信頼性(具体的には、複数の画像信号に対する信頼性を示す始端側信頼性判定値[X])と、終端側に位置する複数の画像信号に対する信頼性(具体的には、複数の画像信号に対する信頼性を示す終端側信頼性判定値[X])と、を比較する。 In order to accurately determine the pixels to be narrowed down, this narrowing unit accurately determines the reliability of a plurality of image signals located on the start end side in steps S305 to S308 (specifically, the start end indicating the reliability of the plurality of image signals). Side reliability determination value [X]), reliability for a plurality of image signals located on the terminal side (specifically, terminal reliability determination value [X] indicating reliability for a plurality of image signals), and To compare.

また、この絞込部は、始端側の画像信号に対する信頼性と、終端側の画像信号に対する信頼性とが同じ場合、ステップS307〜S310において、始端側の画像信号のコントラスト値である始端側コントラスト値(始端側コントラスト値[X])と、終端側の画像信号のコントラスト値である終端側コントラスト値(終端側コントラスト値[X])と、を比較し、コントラスト値が低い方の端部の画像信号を画像信号列から除外する。この絞込部は、更に、始端側コントラスト値と終端側コントラスト値とが同じであった場合には、ステップS311において、両方の端部の画像信号を画像信号列から除外する。 Further, in steps S307 to S310, when the reliability of the image signal on the start end side and the reliability of the image signal on the end side are the same, the narrowing section has the contrast value on the start end side, which is the contrast value of the image signal on the start end side. The value (starting side contrast value [X]) and the ending side contrast value (terminating side contrast value [X]), which is the contrast value of the image signal on the terminating side, are compared, and the end portion having the lower contrast value is compared. Exclude the image signal from the image signal sequence. Further, when the start end side contrast value and the end side contrast value are the same, the narrowing section excludes the image signals of both ends from the image signal sequence in step S311.

カメラ制御部103は、ステップS313〜S316の処理による絞り込み後の範囲に対して相関演算処理を行う(ステップS317)。図10は、絞り込み後の範囲に対して行われる相関演算処理(ステップS317)を示すフローチャートである。 The camera control unit 103 performs correlation calculation processing on the range after narrowing down by the processing of steps S313 to S316 (step S317). FIG. 10 is a flowchart showing a correlation calculation process (step S317) performed on the narrowed-down range.

図10に示されるように、カメラ制御部103は、ステップS313〜S316の処理による絞り込み後の範囲を相関演算範囲[i]としてRAM等に格納する(ステップS501)。 As shown in FIG. 10, the camera control unit 103 stores the range after narrowing down by the processing of steps S313 to S316 as the correlation calculation range [i] in the RAM or the like (step S501).

カメラ制御部103は、この絞り込み後の相関演算範囲[i]を今回の演算範囲に設定し(ステップS502)、この絞り込み後の範囲に対して、ステップS204と同様の相関演算処理を行う(ステップS503)。 The camera control unit 103 sets the correlation calculation range [i] after the narrowing down to the current calculation range (step S502), and performs the same correlation calculation processing as in step S204 for the range after the narrowing down (step S502). S503).

カメラ制御部103は、ステップS503において絞り込み後の範囲での相関関数にて極小値が検出され(ステップS504:YES)、ステップS503にて求められた、絞り込み後の範囲でのコントラスト差が、絞り込み範囲最小コントラスト差以下であり(ステップS505:YES)、ステップS503にて求められた、絞り込み後の範囲での信頼性判定値TRS(s)が、絞り込み範囲最小信頼性判定値未満の場合(ステップS506:YES)、絞り込み範囲最小信頼性判定値をステップS503にて求められた信頼性判定値TRS(s)に更新するとともに(ステップS507)、絞り込み範囲最小コントラスト差をステップS503にて求められた上記コントラスト差に更新する(ステップS508)。次いで、カメラ制御部103は、ステップS205にて演算範囲要素iの配列に格納された各相関演算データを、絞り込み後の範囲について計算された各相関演算データで更新して(ステップS509)、図10の相関演算処理を終了する。 In step S503, the camera control unit 103 detects the minimum value by the correlation function in the range after narrowing down in step S503 (step S504: YES), and the contrast difference in the range after narrowing down obtained in step S503 is narrowed down. When the contrast is equal to or less than the minimum range contrast difference (step S505: YES) and the reliability determination value TRS (s) in the range after narrowing down obtained in step S503 is less than the narrowing down range minimum reliability determination value (step). S506: YES), the narrowing down range minimum reliability determination value is updated to the reliability determination value TRS (s) obtained in step S503 (step S507), and the narrowing down range minimum contrast difference is obtained in step S503. The contrast difference is updated (step S508). Next, the camera control unit 103 updates each correlation calculation data stored in the array of calculation range elements i in step S205 with each correlation calculation data calculated for the range after narrowing down (step S509). The correlation calculation process of 10 is completed.

極小値が求まったシフト数sにおける相関演算範囲のコントラスト値に対してシフト数s±1でのコントラスト値の差が小さいほど、この相関演算範囲に遠近混在部が含まれない可能性が高くなり、補間シフト数(言い換えるとデフォーカス量)の精度が高い相関演算データを得られやすくなる。そのため、上記の例では、絞り込み後の範囲でのコントラスト差が絞り込み範囲最小コントラスト差以下の場合(ステップS505:YES)に、絞り込み範囲最小コントラスト差がこのコントラスト差に更新される(ステップS508)。 The smaller the difference in the contrast value in the shift number s ± 1 with respect to the contrast value in the correlation calculation range in the shift number s for which the minimum value has been obtained, the higher the possibility that the perspective mixed portion is not included in this correlation calculation range. , It becomes easy to obtain correlation calculation data with high accuracy of the number of interpolation shifts (in other words, the amount of defocus). Therefore, in the above example, when the contrast difference in the narrowed-down range is equal to or less than the narrowed-down range minimum contrast difference (step S505: YES), the narrowed-down range minimum contrast difference is updated to this contrast difference (step S508).

カメラ制御部103は、ステップS504〜S506の何れかでNO判定となった場合には、ステップS205にて演算範囲要素iの配列に格納された各相関演算データを更新することなく、ステップS501にて格納した、図8のステップS313〜S316の処理による絞り込み後の相関演算範囲[i]を、前回の相関演算範囲に戻して(ステップS510)、図10の相関演算処理を終了する。 When the camera control unit 103 determines NO in any of steps S504 to S506, the camera control unit 103 goes to step S501 without updating each correlation calculation data stored in the array of calculation range elements i in step S205. The correlation calculation range [i] after narrowing down by the processing of steps S313 to S316 of FIG. 8 is returned to the previous correlation calculation range (step S510), and the correlation calculation processing of FIG. 10 is completed.

カメラ制御部103は、絞り込み範囲画素数が第2の閾値より大きい限り(ステップS302)、ステップS303〜S317の絞り込み処理を繰り返し実行し、最終的な絞り込み範囲を決定する。図10の相関演算処理では、この最終的な絞り込み範囲での各相関演算データが得られる。 As long as the number of pixels in the narrowing range is larger than the second threshold value (step S302), the camera control unit 103 repeatedly executes the narrowing process of steps S303 to S317 to determine the final narrowing range. In the correlation calculation process of FIG. 10, each correlation calculation data in the final narrowing range is obtained.

図11は、図6の絞り込み範囲探索処理(ステップS207)の実行により絞り込まれる相関演算範囲の具体的一例を示す図である。図11の「画素範囲」は、相関演算範囲を示す。また、図11では、相関関数が極小値を取るときのシフト数s(=+2)及びその±1のシフト数(=s+1、+3)の相関値SCO(s)及びコントラスト値OLC(s)を示す。また、図11には、コントラスト差も示される。図11中、信頼性判定値TRS(s)は、補間処理後の相関値SCO(s)をコントラスト値OLC(s)で除した値である。例えば画素範囲が画素4〜29のときには、相関関数が極小値を取るときのシフト数sの相関値SCO(+2)を補間したときの相関値が304である。そのため、信頼性判定値TRS(s)は、この相関値(すなわち、304)をシフト数sが+2のコントラスト値OLC(+2)(すなわち、1520)で除した値0.2となる。 FIG. 11 is a diagram showing a specific example of the correlation calculation range narrowed down by executing the narrowing down range search process (step S207) of FIG. “Pixel range” in FIG. 11 indicates a correlation calculation range. Further, in FIG. 11, the correlation value SCO (s) and the contrast value OLC (s) of the shift number s (= + 2) when the correlation function takes the minimum value and the shift number (= s + 1, +3) of ± 1 thereof are shown. show. FIG. 11 also shows the contrast difference. In FIG. 11, the reliability determination value TRS (s) is a value obtained by dividing the correlation value SCO (s) after the interpolation processing by the contrast value OLC (s). For example, when the pixel range is pixels 4 to 29, the correlation value when the correlation value SCO (+2) of the number of shifts s when the correlation function takes the minimum value is interpolated is 304. Therefore, the reliability determination value TRS (s) is 0.2, which is obtained by dividing this correlation value (that is, 304) by the contrast value OLC (+2) (that is, 1520) in which the shift number s is +2.

初回の絞り込み範囲探索処理では、ステップS303において、始端側相関値[2]として32(=画素単位相関値[5(=4+1)])が計算され、終端側相関値[2]として96(=画素単位相関値[28(=29−1)])が計算される。 In the first narrowing range search process, in step S303, 32 (= pixel unit correlation value [5 (= 4 + 1)]) is calculated as the start end side correlation value [2], and 96 (=) is set as the end side correlation value [2]. The pixel-by-pixel correlation value [28 (= 29-1)]) is calculated.

また、ステップS303において、始端側コントラスト値[1]として32が計算され、終端側コントラスト値[1]として32が計算される。始端側コントラスト値[1]は、隣接画素間コントラスト値CA[4](例えば32)と隣接画素間コントラスト値CB[6(=4+2)](例えば32)との合計を2で除した値である。終端側コントラスト値[1]は、隣接画素間コントラスト値CA[28(=29−1)](例えば48)と隣接画素間コントラスト値CB[30(=(29−1)+2)](例えば16)との合計を2で除した値である。 Further, in step S303, 32 is calculated as the start end side contrast value [1], and 32 is calculated as the end side contrast value [1]. The contrast value [1] on the starting end side is a value obtained by dividing the sum of the contrast value CA [4] (for example, 32) between adjacent pixels and the contrast value CB [6 (= 4 + 2)] (for example, 32) between adjacent pixels by 2. be. The contrast value [1] on the terminal side is the contrast value CA [28 (= 29-1)] (for example, 48) between adjacent pixels and the contrast value CB [30 (= (29-1) + 2)] (for example, 16) between adjacent pixels. ) Divided by 2.

また、ステップS304において、始端側相関値[X]として64が計算され、終端側相関値[X]として160が計算され、始端側コントラスト値[X]として32が計算され、終端側コントラスト値[X]として32が計算され、始端側信頼性判定値[X]として2が計算され、終端側信頼性判定値[X]として5が計算される。 Further, in step S304, 64 is calculated as the start side correlation value [X], 160 is calculated as the end side correlation value [X], 32 is calculated as the start end side contrast value [X], and the end side contrast value [X] is calculated. 32 is calculated as the start side reliability determination value [X], 2 is calculated as the start end side reliability determination value [X], and 5 is calculated as the end side reliability determination value [X].

初回の絞り込み範囲探索処理では、終端側信頼性判定値[X]が始端側信頼性判定値[X]よりも大きいため(ステップS306:YES)、相関演算範囲から終端画素29が除外される(ステップS316)。これにより、相関演算範囲が画素範囲4〜29から画素範囲4〜28に絞り込まれる(図11の画素範囲4〜29及び画素範囲4〜28参照)。 In the first narrowing down range search process, since the end side reliability determination value [X] is larger than the start end side reliability determination value [X] (step S306: YES), the end pixel 29 is excluded from the correlation calculation range (step S306: YES). Step S316). As a result, the correlation calculation range is narrowed down from the pixel range 4 to 29 to the pixel range 4 to 28 (see pixel range 4 to 29 and pixel range 4 to 28 in FIG. 11).

2回目の絞り込み範囲探索処理では、ステップS303において、始端側相関値[2]として32(=画素単位相関値[5])が計算され、終端側相関値[2]として96(=画素単位相関値[27(=28−1)])が計算される。 In the second narrowing down range search process, in step S303, 32 (= pixel unit correlation value [5]) is calculated as the start end side correlation value [2], and 96 (= pixel unit correlation) is calculated as the end side correlation value [2]. The value [27 (= 28-1)]) is calculated.

また、ステップS303において、始端側コントラスト値[1]として32が計算され、終端側コントラスト値[1]として48が計算される。2回目の絞り込み範囲探索処理において、始端側コントラスト値[1]は、隣接画素間コントラスト値CA[4](例えば32)と隣接画素間コントラスト値CB[6(=4+2)](例えば32)との合計を2で除した値である。また、終端側コントラスト値[1]は、隣接画素間コントラスト値CA[27(=28−1)](例えば48)と隣接画素間コントラスト値CB[29(=(28−1)+2)](例えば48)との合計を2で除した値である。 Further, in step S303, 32 is calculated as the start end side contrast value [1], and 48 is calculated as the end side contrast value [1]. In the second narrowing down range search process, the contrast value [1] on the starting end side is the contrast value CA [4] (for example, 32) between adjacent pixels and the contrast value CB [6 (= 4 + 2)] (for example, 32) between adjacent pixels. Is the value obtained by dividing the total of. Further, the contrast value [1] on the terminal side is a contrast value CA [27 (= 28-1)] (for example, 48) between adjacent pixels and a contrast value CB [29 (= (28-1) + 2)] ( For example, it is a value obtained by dividing the total with 48) by 2.

また、ステップS304において、始端側相関値[X]として64が計算され、終端側相関値[X]として256が計算され、始端側コントラスト値[X]として32が計算され、終端側コントラスト値[X]として80が計算され、始端側信頼性判定値[X]として2が計算され、終端側信頼性判定値[X]として3.2が計算される。 Further, in step S304, 64 is calculated as the start side correlation value [X], 256 is calculated as the end side correlation value [X], 32 is calculated as the start end side contrast value [X], and the end side contrast value [X] is calculated. 80 is calculated as X], 2 is calculated as the start end side reliability determination value [X], and 3.2 is calculated as the end side reliability determination value [X].

2回目の絞り込み範囲探索処理においても、終端側信頼性判定値[X]が始端側信頼性判定値[X]よりも大きいため(ステップS306:YES)、相関演算範囲から終端画素28が除外される(ステップS316)。これにより、相関演算範囲が画素範囲4〜28から画素範囲4〜27に絞り込まれる(図11の画素範囲4〜28及び画素範囲4〜27参照)。 Even in the second narrowing down range search process, since the end side reliability determination value [X] is larger than the start end side reliability determination value [X] (step S306: YES), the end pixel 28 is excluded from the correlation calculation range. (Step S316). As a result, the correlation calculation range is narrowed down from the pixel range 4 to 28 to the pixel range 4 to 27 (see pixel range 4 to 28 and pixel range 4 to 27 in FIG. 11).

図11の例では、相関演算範囲を画素12〜21に絞り込んだときにコントラスト差がゼロとなる。コントラスト差は絶対値であるため、ゼロは最小値である。また、このときの信頼性判定値TRS(s)はゼロであり、第1の閾値(例えば0.05)を下回る。信頼性判定値TRS(s)は負数を取らないため、ゼロは最小値である。絞り込み範囲画素数が第2の閾値(ここでは4)より大きい限り(ステップS302)、ステップS303〜S317の絞り込み処理は繰り返し実行される。しかし、図11の例では、画素範囲12〜21に絞り込んだ時点でコントラスト差、信頼性判定値TRS(s)が最小値となる。そのため、ステップS506にてNO判定となる。従って、画素範囲12〜21に絞り込んだときの更新を最後に、各相関演算データの更新は行われない。すなわち、絞り込み範囲探索処理の初回実行時(i=0)には、相関演算範囲が画素範囲4〜29から画素範囲12〜21に絞り込まれる。ステップS503において、この画素範囲12〜21に対し、信頼性ありを示す信頼性フラグが「T(true)」に設定され、デフォーカス量が算出される。 In the example of FIG. 11, the contrast difference becomes zero when the correlation calculation range is narrowed down to the pixels 12 to 21. Since the contrast difference is an absolute value, zero is the minimum value. Further, the reliability determination value TRS (s) at this time is zero, which is lower than the first threshold value (for example, 0.05). Since the reliability determination value TRS (s) does not take a negative number, zero is the minimum value. As long as the number of pixels in the narrowing range is larger than the second threshold value (4 in this case) (step S302), the narrowing process of steps S303 to S317 is repeatedly executed. However, in the example of FIG. 11, the contrast difference and the reliability determination value TRS (s) become the minimum values when the pixel range is narrowed down to 12 to 21. Therefore, a NO determination is made in step S506. Therefore, each correlation calculation data is not updated at the end of the update when the pixel range is narrowed down to 12 to 21. That is, at the time of the first execution (i = 0) of the narrowing down range search process, the correlation calculation range is narrowed down from the pixel range 4 to 29 to the pixel range 12 to 21. In step S503, the reliability flag indicating reliability is set to "T (true)" for the pixel ranges 12 to 21, and the defocus amount is calculated.

すなわち、カメラ制御部103(焦点調節制御部103b)は、絞り込み範囲探索処理(ステップS207)を実行することにより、信頼性判定部により信頼性ありと判定されるまで、絞込部による画像信号列の絞り込み及び相関演算部による絞り込み後の画像信号列の範囲に対する相関演算を行う。より詳細には、カメラ制御部103(焦点調節制御部103b)は、絞込部による画像信号列の絞り込み及び相関演算部による絞り込み後の画像信号列の範囲に対する相関演算を行い、第1の位相ずれ量の信頼性判定値が所定条件を満たし且つコントラスト差が最小になる相関演算結果が得られると、この相関演算結果について信頼性ありと判定する。 That is, the camera control unit 103 (focus adjustment control unit 103b) executes the narrowing down range search process (step S207) until the reliability determination unit determines that the image signal sequence is reliable. Correlation calculation is performed on the range of the image signal sequence after the narrowing down and the correlation calculation unit. More specifically, the camera control unit 103 (focus adjustment control unit 103b) performs a correlation calculation on the range of the image signal sequence after the narrowing down of the image signal sequence by the narrowing down unit and the narrowing down by the correlation calculation unit, and performs the first phase. When a correlation calculation result is obtained in which the reliability determination value of the deviation amount satisfies a predetermined condition and the contrast difference is minimized, it is determined that the correlation calculation result is reliable.

図12は、図7と同様の図であって、画素範囲12〜21に対して相関演算処理(ステップS317)を行ったときに求められる相関値SCO(s)及びコントラスト値OLC(s)の一例を示す図である。 FIG. 12 is a diagram similar to that of FIG. 7, and shows the correlation value SCO (s) and the contrast value OLC (s) obtained when the correlation calculation process (step S317) is performed on the pixel ranges 12 to 21. It is a figure which shows an example.

本実施形態では、相関演算範囲が画素範囲12〜21に絞り込まれることにより、図12に示されるように、補間処理後の相関値が極小となるときのシフト数として+2、言い換えると、被写体300に対する精確なデフォーカス量に相当する位相ずれ量が求まる。これは、遠近混在部が排除された(すなわち、相関演算範囲が被写体300のみが位置する範囲に絞り込まれた)ことを示す。このように、本実施形態によれば、焦点検出エリア120内に撮影距離の異なる複数の被写体300〜302が混在する場合にも、精度の高いデフォーカス量を算出することが可能となる。 In the present embodiment, by narrowing the correlation calculation range to the pixel range 12 to 21, as shown in FIG. 12, the number of shifts when the correlation value after the interpolation processing becomes the minimum is +2, in other words, the subject 300. The amount of phase shift corresponding to the exact amount of defocus for is obtained. This indicates that the perspective mixed portion is eliminated (that is, the correlation calculation range is narrowed down to the range in which only the subject 300 is located). As described above, according to the present embodiment, it is possible to calculate the defocus amount with high accuracy even when a plurality of subjects 300 to 302 having different shooting distances coexist in the focus detection area 120.

図13は、図6の余剰範囲確認処理(ステップS208)を示すフローチャートである。 FIG. 13 is a flowchart showing the surplus range confirmation process (step S208) of FIG.

カメラ制御部103は、ステップS208において、全画像信号列のうち、絞り込み範囲探索処理(ステップS207)による絞り込み後の範囲(上記の例では画素範囲12〜21)以外の範囲(以下「余剰範囲」と記す。)を検出し、更に、この余剰範囲の中から、相関演算処理を行うべき範囲について確認する。概略的には、余剰範囲がある程度まとまった数の画素範囲(ここでは4画素以上よりなる画素範囲)であり、且つ余剰範囲のコントラスト値がある程度の値(ここでは例えば100)以上であるかが確認される。 In step S208, the camera control unit 103 includes a range (hereinafter, “surplus range”) other than the range (pixel range 12 to 21 in the above example) of the entire image signal sequence after narrowing down by the narrowing down range search process (step S207). ) Is detected, and further, the range in which the correlation calculation processing should be performed is confirmed from this surplus range. Roughly speaking, whether the surplus range is a certain number of pixel ranges (here, a pixel range consisting of 4 pixels or more) and the contrast value of the surplus range is a certain value (for example, 100 in this case) or more. It is confirmed.

図13に示されるように、カメラ制御部103は、余剰範囲から始端側の余剰範囲の画素数を計算する(ステップS601)。余剰範囲確認処理の初回実行時(i=0)には、画素範囲4〜11の画素数(すなわち8つ)が始端側の余剰範囲の画素数として計算される。 As shown in FIG. 13, the camera control unit 103 calculates the number of pixels in the surplus range on the starting end side from the surplus range (step S601). At the time of the first execution (i = 0) of the surplus range confirmation process, the number of pixels in the pixel range 4 to 11 (that is, eight) is calculated as the number of pixels in the surplus range on the starting end side.

カメラ制御部103は、ステップS601において計算された始端側の余剰範囲の画素数が第3の閾値(例えば第2の閾値と同じ「4」)以上の場合(ステップS602:YES)、この余剰範囲について隣接画素間コントラスト値CA[n]の積算値を計算する(ステップS603)。具体的には、隣接画素間コントラスト値CA[4]〜CA[10]の積算値として304が計算される。 When the number of pixels in the surplus range on the starting end side calculated in step S601 is equal to or greater than the third threshold value (for example, “4” which is the same as the second threshold value), the camera control unit 103 has this surplus range (step S602: YES). The integrated value of the contrast value CA [n] between adjacent pixels is calculated for (step S603). Specifically, 304 is calculated as an integrated value of the contrast values CA [4] to CA [10] between adjacent pixels.

カメラ制御部103は、ステップS603において計算された積算値が第4の閾値(例えば100)以上の場合(ステップS604:YES)、演算範囲要素数I(I=1)の演算範囲の配列に、ステップS601において計算された始端側の余剰範囲を設定し(ステップS605)、演算範囲要素数Iを1インクリメントする(ステップS606)。 When the integrated value calculated in step S603 is equal to or greater than the fourth threshold value (for example, 100) (step S604: YES), the camera control unit 103 arranges the calculation range with the number of calculation range elements I (I = 1). The surplus range on the starting end side calculated in step S601 is set (step S605), and the number of calculation range elements I is incremented by 1 (step S606).

また、カメラ制御部103は、余剰範囲から終端側の余剰範囲の画素数を計算する(ステップS607)。余剰範囲確認処理の初回実行時(i=0)には、画素範囲22〜29の画素数(すなわち8つ)が終端側の余剰範囲の画素数として計算される。 Further, the camera control unit 103 calculates the number of pixels in the surplus range on the terminal side from the surplus range (step S607). At the time of the first execution (i = 0) of the surplus range confirmation process, the number of pixels in the pixel range 22 to 29 (that is, eight) is calculated as the number of pixels in the surplus range on the terminal side.

カメラ制御部103は、ステップS607において計算された終端側の余剰範囲の画素数が第5の閾値(例えば第2の閾値と同じ「4」)以上の場合(ステップS608:YES)、この余剰範囲について隣接画素間コントラスト値CA[n]の積算値を計算する(ステップS609)。具体的には、隣接画素間コントラスト値CA[22]〜CA[28]の積算値として400が計算される。 When the number of pixels in the surplus range on the terminal side calculated in step S607 is equal to or greater than the fifth threshold value (for example, “4” which is the same as the second threshold value), the camera control unit 103 has this surplus range (step S608: YES). The integrated value of the contrast value CA [n] between adjacent pixels is calculated for (step S609). Specifically, 400 is calculated as an integrated value of the contrast values CA [22] to CA [28] between adjacent pixels.

カメラ制御部103は、ステップS609において計算された積算値が第4の閾値以上の場合(ステップS610:YES)、演算範囲要素数I(I=2)の演算範囲の配列に、ステップS607において計算された終端側の余剰範囲を設定し(ステップS611)、演算範囲要素数Iを1インクリメントする(ステップS612)。 When the integrated value calculated in step S609 is equal to or greater than the fourth threshold value (step S610: YES), the camera control unit 103 calculates in step S607 to the array of the calculation range of the number of calculation range elements I (I = 2). The surplus range on the terminal side is set (step S611), and the number of calculation range elements I is incremented by 1 (step S612).

カメラ制御部103は、演算範囲要素iを1インクリメントする(ステップS209)。これにより、2回目以降の(i=1,2・・・)ステップS203〜S209が実行される。 The camera control unit 103 increments the calculation range element i by 1 (step S209). As a result, the second and subsequent (i = 1, 2, ...) Steps S203 to S209 are executed.

なお、ステップS602又は604においてNO判定になると、ステップS606において演算範囲要素数Iが1インクリメントされない。また、ステップS608又は610においてNO判定になると、ステップS612において演算範囲要素数Iが1インクリメントされない。相関演算処理を行うべき全ての範囲に対してステップS204〜S207の処理が完了すると、演算範囲要素iが演算範囲要素数Iと同じ値となる。これにより、カメラ制御部103は、ステップS203〜S209のループを抜けて、ステップS210のデフォーカス量選択処理を行う。 If the determination is NO in step S602 or 604, the number of calculation range elements I is not incremented by 1 in step S606. Further, if a NO determination is made in step S608 or 610, the number of calculation range elements I is not incremented by 1 in step S612. When the processing of steps S204 to S207 is completed for all the ranges to be subjected to the correlation calculation processing, the calculation range element i becomes the same value as the number of calculation range elements I. As a result, the camera control unit 103 exits the loop of steps S203 to S209 and performs the defocus amount selection process of step S210.

図14Aは、図7と同様の図であって、余剰範囲4〜11に対して相関演算処理(ステップS204)を行ったときに求められる相関値SCO(s)及びコントラスト値OLC(s)の一例を示す図である。図14Bは、図7と同様の図であって、余剰範囲4〜10に対して相関演算処理(ステップS317)を行ったときに求められる相関値SCO(s)及びコントラスト値OLC(s)の一例を示す図である。 FIG. 14A is a diagram similar to that of FIG. 7, and shows the correlation value SCO (s) and the contrast value OLC (s) obtained when the correlation calculation process (step S204) is performed on the surplus ranges 4 to 11. It is a figure which shows an example. FIG. 14B is a diagram similar to that of FIG. 7, and shows the correlation value SCO (s) and the contrast value OLC (s) obtained when the correlation calculation process (step S317) is performed on the surplus range 4 to 10. It is a figure which shows an example.

余剰範囲4〜11では、コントラスト差が40であり、信頼性判定値TRS(s)が0.16129であるが、余剰範囲4〜10では、コントラスト差、信頼性判定値TRS(s)が何れもゼロとなる。そのため、画素範囲4〜10に絞り込んだときの更新を最後に、各相関演算データの更新は行われない。すなわち、絞り込み範囲探索処理の2回目の実行時(i=1)には、相関演算範囲が画素範囲4〜11から画素範囲4〜10に絞り込まれる。 In the surplus range 4 to 11, the contrast difference is 40 and the reliability determination value TRS (s) is 0.16129, but in the surplus range 4 to 10, the contrast difference and the reliability determination value TRS (s) are either. Is also zero. Therefore, each correlation calculation data is not updated at the end of the update when the pixel range is narrowed down to 4 to 10. That is, at the time of the second execution (i = 1) of the narrowing down range search process, the correlation calculation range is narrowed down from the pixel range 4 to 11 to the pixel range 4 to 10.

ここでは、相関演算範囲が画素範囲4〜10に絞り込まれることにより、図14Bに示されるように、補間処理後の相関値が極小となるときのシフト数として+1、言い換えると、被写体301に対する精確なデフォーカス量に相当する位相ずれ量が求まる。これは、遠近混在部が排除された(すなわち、相関演算範囲が被写体301のみが位置する範囲に絞り込まれた)ことを示す。このように、本実施形態によれば、焦点検出エリア120内に撮影距離の異なる複数の被写体300〜302が混在する場合にも、精度の高いデフォーカス量を算出することが可能となる。 Here, by narrowing the correlation calculation range to the pixel range 4 to 10, as shown in FIG. 14B, the number of shifts when the correlation value after interpolation processing becomes the minimum is +1. In other words, the accuracy with respect to the subject 301. The amount of phase shift corresponding to the amount of defocus can be obtained. This indicates that the perspective mixed portion is eliminated (that is, the correlation calculation range is narrowed down to the range in which only the subject 301 is located). As described above, according to the present embodiment, it is possible to calculate the defocus amount with high accuracy even when a plurality of subjects 300 to 302 having different shooting distances coexist in the focus detection area 120.

図15Aは、図7と同様の図であって、余剰範囲22〜29に対して相関演算処理(ステップS204)を行ったときに求められる相関値SCO(s)及びコントラスト値OLC(s)の一例を示す図である。図15Bは、図7と同様の図であって、余剰範囲26〜29に対して相関演算処理(ステップS317)を行ったときに求められる相関値SCO(s)及びコントラスト値OLC(s)の一例を示す図である。 FIG. 15A is a diagram similar to that of FIG. 7, and shows the correlation value SCO (s) and the contrast value OLC (s) obtained when the correlation calculation process (step S204) is performed on the surplus range 22 to 29. It is a figure which shows an example. FIG. 15B is a diagram similar to that of FIG. 7, and shows the correlation value SCO (s) and the contrast value OLC (s) obtained when the correlation calculation process (step S317) is performed on the surplus range 26 to 29. It is a figure which shows an example.

余剰範囲22〜29では、コントラスト差が16であり、信頼性判定値TRS(s)が0.63333であるが、余剰範囲26〜29では、コントラスト差、信頼性判定値TRS(s)が何れもゼロとなる。そのため、画素範囲26〜29に絞り込んだときの更新を最後に、各相関演算データの更新は行われない。すなわち、絞り込み範囲探索処理の3回目の実行時(i=2)には、相関演算範囲が画素範囲22〜29から画素範囲26〜29に絞り込まれる。 In the surplus range 22 to 29, the contrast difference is 16 and the reliability determination value TRS (s) is 0.63333, but in the surplus range 26 to 29, the contrast difference and the reliability determination value TRS (s) are either. Is also zero. Therefore, each correlation calculation data is not updated at the end of the update when the pixel range is narrowed down to 26 to 29. That is, at the time of the third execution (i = 2) of the narrowing down range search process, the correlation calculation range is narrowed down from the pixel range 22 to 29 to the pixel range 26 to 29.

ここでは、相関演算範囲が画素範囲26〜29に絞り込まれることにより、図15Bに示されるように、補間処理後の相関値が極小となるときのシフト数としてゼロ、言い換えると、被写体302に対する精確なデフォーカス量に相当する位相ずれ量が求まる。これは、遠近混在部が排除された(すなわち、相関演算範囲が被写体302のみが位置する範囲に絞り込まれた)ことを示す。このように、本実施形態によれば、焦点検出エリア120内に撮影距離の異なる複数の被写体300〜302が混在する場合にも、精度の高いデフォーカス量を算出することが可能となる。 Here, by narrowing the correlation calculation range to the pixel range 26 to 29, as shown in FIG. 15B, the number of shifts when the correlation value after interpolation processing becomes the minimum is zero, in other words, the accuracy with respect to the subject 302. The amount of phase shift corresponding to the amount of defocus can be obtained. This indicates that the perspective mixed portion is eliminated (that is, the correlation calculation range is narrowed down to the range in which only the subject 302 is located). As described above, according to the present embodiment, it is possible to calculate the defocus amount with high accuracy even when a plurality of subjects 300 to 302 having different shooting distances coexist in the focus detection area 120.

画素範囲22〜29を画素範囲26〜29に絞り込んだ後の余剰範囲22〜25は、画素数が第3の閾値(ここでは4)以上であり、隣接画素間コントラスト値CA[n]の積算値が208となる。そのため、余剰範囲22〜25は、相関演算処理を行うべき全ての範囲として、演算範囲要素数I(I=3)の演算範囲の配列に設定される(ステップS601〜S606)。 In the surplus range 22 to 25 after narrowing down the pixel range 22 to 29 to the pixel range 26 to 29, the number of pixels is equal to or greater than the third threshold value (here, 4), and the integration of the contrast values CA [n] between adjacent pixels is achieved. The value is 208. Therefore, the surplus ranges 22 to 25 are set in an array of calculation ranges having the number of calculation range elements I (I = 3) as all ranges to be subjected to the correlation calculation process (steps S601 to S606).

図16は、図7と同様の図であって、余剰範囲22〜25に対して相関演算処理(ステップS204)を行ったときに求められる相関値SCO(s)及びコントラスト値OLC(s)の一例を示す図である。 FIG. 16 is a diagram similar to that of FIG. 7, and shows the correlation value SCO (s) and the contrast value OLC (s) obtained when the correlation calculation process (step S204) is performed on the surplus range 22 to 25. It is a figure which shows an example.

余剰範囲22〜25では、シフト数sが+2、補間処理後のシフト数sが+1.6875、補間処理後の相関値SCO(s)の最小値が112、コントラスト値OLC(s)が256、信頼性判定値TRS(s)が0.4375となる。信頼性判定値TRS(s)が第1の閾値(ここでは0.05)よりも高いものの、余剰範囲の画素数が第3の閾値(ここでは4)に達している。そのため、カメラ制御部103は、相関演算範囲のこれ以上の絞り込みを行わず、ステップS203〜S209のループを抜けて、ステップS210のデフォーカス量選択処理を行う。 In the surplus range 22 to 25, the number of shifts s is +2, the number of shifts s after interpolation processing is +1.6875, the minimum value of the correlation value SCO (s) after interpolation processing is 112, and the contrast value OLC (s) is 256. The reliability determination value TRS (s) is 0.4375. Although the reliability determination value TRS (s) is higher than the first threshold value (0.05 in this case), the number of pixels in the surplus range has reached the third threshold value (4 in this case). Therefore, the camera control unit 103 does not further narrow down the correlation calculation range, exits the loop of steps S203 to S209, and performs the defocus amount selection process of step S210.

このように、カメラ制御部103(焦点調節制御部103b)は、画像信号列の全範囲のうち、相関演算結果が信頼性ありと判定された第1の範囲以外の範囲(すなわち余剰範囲)を検出する検出部として動作する。また、カメラ制御部103(焦点調節制御部103b)は、信頼性判定部により、検出範囲での相関演算結果が信頼性なしと判定されると、相関演算結果が信頼性ありと判定されるまで、絞込部による画像信号列の絞り込み及び相関演算部による絞り込み後の画像信号列の範囲に対する相関演算を行う。 In this way, the camera control unit 103 (focus adjustment control unit 103b) covers the entire range of the image signal sequence other than the first range in which the correlation calculation result is determined to be reliable (that is, the surplus range). Operates as a detector to detect. Further, in the camera control unit 103 (focus adjustment control unit 103b), when the reliability determination unit determines that the correlation calculation result in the detection range is unreliable, the correlation calculation result is determined to be reliable. , The narrowing down unit narrows down the image signal sequence and the correlation calculation unit performs the correlation calculation for the range of the narrowed down image signal sequence.

図17は、図6のデフォーカス量選択処理(ステップS210)を示すフローチャートである。 FIG. 17 is a flowchart showing the defocus amount selection process (step S210) of FIG.

図17に示されるように、カメラ制御部103は、デフォーカス量を規定値(例えば−65536)に設定し(ステップS701)、測距フラグを「F(false)」に設定し(ステップS702)、変数iをゼロに設定する(ステップS703)。 As shown in FIG. 17, the camera control unit 103 sets the defocus amount to a specified value (for example, -65536) (step S701), and sets the ranging flag to "F (false)" (step S702). , Set the variable i to zero (step S703).

カメラ制御部103は、AFモード時(ステップS704:YES)、撮影装置1に最も近い被写体が主被写体である可能性が高いという理由から、シフト数sが+2の場合のデフォーカス量(言い換えると、被写体300に対する精確なデフォーカス量)を選択する(ステップS705〜S710)。なお、撮影装置1に最も近い被写体に対するデフォーカス量を選択することにより、撮影距離の異なる複数の被写体が混在する場合にも背景抜け(すなわち、撮影装置1に対して主被写体300よりも遠い被写体301や被写体302にピントを合わせてしまう動作)の発生が防がれる。 In the AF mode (step S704: YES), the camera control unit 103 has a defocus amount (in other words, in other words) when the shift number s is +2 because the subject closest to the photographing device 1 is likely to be the main subject. , An accurate defocus amount for the subject 300) (steps S705-S710). By selecting the defocus amount for the subject closest to the photographing device 1, the background is missing (that is, the subject farther than the main subject 300 with respect to the photographing device 1) even when a plurality of subjects having different shooting distances coexist. Occurrence of (operation of focusing on 301 or subject 302) can be prevented.

具体的には、カメラ制御部103は、変数iが演算範囲要素数I(ここではI=3)以下である限り(ステップS705)、ステップS706〜710の処理を繰り返し実行する。カメラ制御部103は、信頼性フラグ[i]が「T(true)」であり(ステップS706:YES)、デフォーカス量[i]が現在のデフォーカス量よりも大きい場合(ステップS707:YES)、デフォーカス量[i]を現在のデフォーカス量に更新する(ステップS708)。次いで、カメラ制御部103は、測距フラグを「T(true)」に設定して(ステップS709)、変数iを1インクリメントする(ステップS710)。 Specifically, the camera control unit 103 repeatedly executes the processes of steps S706 to 710 as long as the variable i is equal to or less than the number of calculation range elements I (here, I = 3) (step S705). In the camera control unit 103, when the reliability flag [i] is "T (true)" (step S706: YES) and the defocus amount [i] is larger than the current defocus amount (step S707: YES). , The defocus amount [i] is updated to the current defocus amount (step S708). Next, the camera control unit 103 sets the ranging flag to “T (true)” (step S709) and increments the variable i by 1 (step S710).

このように、カメラ制御部103(焦点調節制御部103b)は、検出範囲の中で相関演算結果が信頼性ありと判定される範囲が少なくとも1つある場合、デフォーカス量算出部により、第1の範囲及び少なくとも1つの範囲の各範囲について算出されたデフォーカス量のうち、撮影装置1(自動焦点検出装置)に最も近い被写体に対応する範囲について算出されたデフォーカス量を、フォーカスレンズ群203を駆動するためのデフォーカス量として選択するデフォーカス量選択部として動作する。 As described above, when the camera control unit 103 (focus adjustment control unit 103b) has at least one range in which the correlation calculation result is determined to be reliable in the detection range, the defocus amount calculation unit first determines the camera control unit 103 (focus adjustment control unit 103b). Of the defocus amount calculated for each range of the range and at least one range, the defocus amount calculated for the range corresponding to the subject closest to the photographing device 1 (automatic focus detection device) is set to the focus lens group 203. Operates as a defocus amount selection unit that selects as the defocus amount for driving.

なお、カメラ制御部103は、AFモード時(ステップS704:YES)、撮影装置1から最も遠い被写体302又は中間に位置する被写体301に対する合焦を行うべく、シフト数sがゼロ又は+1の場合のデフォーカス量を選択してもよい。 In the AF mode (step S704: YES), the camera control unit 103 has a shift number s of zero or +1 in order to focus on the subject 302 farthest from the photographing device 1 or the subject 301 located in the middle. You may select the amount of defocus.

カメラ制御部103は、MFモード時(ステップS704:NO)、フォーカスレンズ群203の現在位置に最も近い被写体の焦点調節状態を撮影者に報知するため、絶対値が最も小さいデフォーカス量(言い換えると、現在の焦点調節状態から最も合焦状態に近い範囲について算出されたデフォーカス量)を選択する(ステップS711〜S716)。具体的には、本実施形態では、シフト数sがゼロの場合のデフォーカス量(言い換えると、被写体302のデフォーカス量)が選択される。なお、ステップS711〜S716の処理は、ステップS713においてデフォーカス量[i]の絶対値が現在のデフォーカス量の絶対値よりも小さいか否かを判定する点を除き、ステップS705〜S710と同様の処理となる。 In the MF mode (step S704: NO), the camera control unit 103 notifies the photographer of the focus adjustment state of the subject closest to the current position of the focus lens group 203, so that the defocus amount having the smallest absolute value (in other words,). , The defocus amount calculated for the range closest to the in-focus state from the current focus adjustment state) is selected (steps S711 to S716). Specifically, in the present embodiment, the defocus amount when the shift number s is zero (in other words, the defocus amount of the subject 302) is selected. The processing of steps S711 to S716 is the same as that of steps S705 to S710, except that in step S713, it is determined whether or not the absolute value of the defocus amount [i] is smaller than the absolute value of the current defocus amount. It becomes the processing of.

図18Aは、ステップS705〜S710によりシフト数sが+2のときのデフォーカス量が選択された場合にファインダ116に表示される画面の一例を示す図である。図18Bは、ステップS711〜S716によりシフト数sがゼロのときのデフォーカス量が選択された場合にファインダ116に表示される画面の一例を示す図である。 FIG. 18A is a diagram showing an example of a screen displayed on the finder 116 when the defocus amount when the shift number s is +2 is selected in steps S705 to S710. FIG. 18B is a diagram showing an example of a screen displayed on the finder 116 when the defocus amount when the shift number s is zero is selected in steps S711 to S716.

ステップS705〜S710によりシフト数sが+2のときのデフォーカス量が選択されると、フォーカスレンズ群203がデフォーカス量に応じたレンズ駆動量だけ光軸方向に移動する。これにより、被写体300に焦点が合い、図18Aに示されるように、合焦マーク121Aが表示される。この合焦マーク121Aは、ファインダ視野内において、ラインセンサ118eA、118eBの画素12〜21が並ぶ領域(すなわち、遠近混在部を排除した絞り込み後の画素範囲12〜21)と等価な領域を取り囲うマークとなっている。そのため、合焦マーク121Aの幅は、絞り込み後の画素範囲に応じて変わる。画素範囲12〜21に対応するファインダ116内の領域には、ほぼ被写体300のみが位置する。そのため、図18Aに示されるように、合焦マーク121Aは、被写体300に合う位置に表示される。 When the defocus amount when the shift number s is +2 is selected in steps S705 to S710, the focus lens group 203 moves in the optical axis direction by the lens drive amount corresponding to the defocus amount. As a result, the subject 300 is focused and the focusing mark 121A is displayed as shown in FIG. 18A. The focusing mark 121A surrounds an area equivalent to the area where the pixels 12 to 21 of the line sensors 118eA and 118eB are lined up (that is, the pixel range 12 to 21 after narrowing down excluding the perspective mixture) in the viewfinder field of view. It is a mark. Therefore, the width of the focusing mark 121A changes according to the pixel range after narrowing down. Almost only the subject 300 is located in the area in the finder 116 corresponding to the pixel ranges 12 to 21. Therefore, as shown in FIG. 18A, the focusing mark 121A is displayed at a position that matches the subject 300.

ステップS711〜S716によりシフト数sがゼロのときのデフォーカス量が選択されると、被写体302に焦点が合っているため、図18Bに示されるように、合焦マーク121Aと同様の合焦マーク121Bが表示される。この合焦マーク121Bは、ファインダ視野内において、ラインセンサ118eA、118eBの画素26〜29が並ぶ領域(すなわち、遠近混在部を排除した絞り込み後の画素範囲26〜29)と等価な領域を取り囲うマークとなっている。画素範囲26〜29に対応するファインダ116内の領域には、ほぼ被写体302のみが位置する。そのため、図18Bに示されるように、合焦マーク121Bは、被写体302に合う位置に表示される。 When the defocus amount when the shift number s is zero is selected in steps S711 to S716, the subject 302 is in focus. Therefore, as shown in FIG. 18B, the same focusing mark as the focusing mark 121A 121B is displayed. The focusing mark 121B surrounds an area equivalent to the area where the pixels 26 to 29 of the line sensors 118eA and 118eB are lined up (that is, the pixel range 26 to 29 after narrowing down excluding the perspective mixture) in the viewfinder field of view. It is a mark. Almost only the subject 302 is located in the area in the finder 116 corresponding to the pixel ranges 26 to 29. Therefore, as shown in FIG. 18B, the focusing mark 121B is displayed at a position that matches the subject 302.

このように、カメラ制御部103(焦点調節制御部103b)は、被写体の合焦状態を報知する報知部として動作する。また、カメラ制御部103(焦点調節制御部103b)は、デフォーカス量選択部により選択されたデフォーカス量に対応する範囲の被写体が合焦状態にあることを撮影者に知らせる。 In this way, the camera control unit 103 (focus adjustment control unit 103b) operates as a notification unit that notifies the focusing state of the subject. Further, the camera control unit 103 (focus adjustment control unit 103b) informs the photographer that the subject in the range corresponding to the defocus amount selected by the defocus amount selection unit is in the in-focus state.

MFモード時、撮影者がフォーカスリングを操作してフォーカスレンズ群203を現在位置から前ピン方向に移動させると、合焦マーク121Bが消去され、フォーカスレンズ群203がシフト数s=+1相当の量を移動したとき、図18Bに示されるように、合焦マーク121Cが表示される。合焦マーク121Cは、ファインダ視野内において、ラインセンサ118eA、118eBの画素4〜10が並ぶ領域(すなわち、遠近混在部を排除した絞り込み後の画素範囲4〜10)と等価な領域を取り囲うマークである。更に、撮影者がフォーカスリングを操作してフォーカスレンズ群203を前ピン方向に移動させると、この合焦マークが消去され、フォーカスレンズ群203が更にシフト数s=+1相当の量を移動したとき、図18Aに示されるように、合焦マーク121Aが表示される。なお、図18Bでは、便宜上、合焦マーク121Cを一点鎖線で示すが、合焦マーク121Cは、例えば合焦マーク121Aや合焦マーク121Bと同様に、矩形の太枠状のマークであってもよい。 In the MF mode, when the photographer operates the focus ring to move the focus lens group 203 from the current position toward the front pin, the focusing mark 121B is erased and the focus lens group 203 is shifted by the number of shifts s = + 1. When the lens is moved, the focusing mark 121C is displayed as shown in FIG. 18B. The focusing mark 121C is a mark that surrounds an area equivalent to the area where the pixels 4 to 10 of the line sensors 118eA and 118eB are lined up (that is, the pixel range 4 to 10 after narrowing down excluding the perspective mixed portion) in the viewfinder field of view. Is. Further, when the photographer operates the focus ring to move the focus lens group 203 in the front pin direction, this focusing mark is erased, and when the focus lens group 203 further moves by an amount equivalent to the number of shifts s = + 1. , The focusing mark 121A is displayed as shown in FIG. 18A. In FIG. 18B, the focusing mark 121C is indicated by a chain line for convenience, but the focusing mark 121C may be a rectangular thick frame-shaped mark like the focusing mark 121A and the focusing mark 121B, for example. good.

この場合、撮影者は、ファインダ116内に表示される合焦マークを視認することにより、各被写体の合焦位置(言い換えると、各被写体に焦点を合わせる際のフォーカスリングの操作量)を把握することができる。 In this case, the photographer grasps the focusing position of each subject (in other words, the amount of operation of the focus ring when focusing on each subject) by visually recognizing the focusing mark displayed in the viewfinder 116. be able to.

すなわち、カメラ制御部103(焦点調節制御部103b)は、MFモード時、第1の範囲及び少なくとも1つの範囲の各範囲について算出されたデフォーカス量のうち、現在の焦点調節状態から最も合焦状態に近い範囲について算出されたデフォーカス量を選択し、選択されたデフォーカス量に対応する範囲の被写体が合焦状態にあることを報知する。 That is, the camera control unit 103 (focus adjustment control unit 103b) is the most focused from the current focus adjustment state among the defocus amounts calculated for each range of the first range and at least one range in the MF mode. The calculated defocus amount is selected for a range close to the state, and it is notified that the subject in the range corresponding to the selected defocus amount is in the in-focus state.

カメラ制御部103(焦点調節制御部103b)は、カメラボディ100に設けられたスイッチ、ボタン、ダイヤル等に対する所定の操作が行われると、絞込モードのオンとオフとを切り替える絞込モード切替部として動作する。絞込モードがオンされているとき、本実施形態の如く図4の焦点調節処理が実行され、相関演算範囲の絞り込み及び絞り込み後の相関演算範囲に対する相関演算が行われる。絞込モードがオフされているときには、相関演算範囲の絞り込み及び絞り込み後の相関演算範囲に対する相関演算を行わない従来の焦点調節処理が実行される。 The camera control unit 103 (focus adjustment control unit 103b) is a narrowing mode switching unit that switches the narrowing mode on and off when a predetermined operation is performed on the switches, buttons, dials, etc. provided on the camera body 100. Works as. When the narrowing mode is turned on, the focus adjustment process of FIG. 4 is executed as in the present embodiment, and the correlation calculation range is narrowed down and the correlation calculation is performed on the correlation calculation range after the narrowing down. When the narrowing mode is turned off, the conventional focus adjustment process in which the correlation calculation range is narrowed down and the correlation calculation is not performed on the narrowed-down correlation calculation range is executed.

図18A及び図18Bに示されるように、ファインダ116内には、絞込モードがオンされているか否か示すモードマーク121Dが表示される。撮影者は、このモードマーク121Dを視認することにより、絞込モードがオンされているか否かを把握することができる。なお、モードマーク121Dは、絞込モードがオンされているときに表示され、絞込モードがオフされているときに表示されない。 As shown in FIGS. 18A and 18B, a mode mark 121D indicating whether or not the narrowing mode is turned on is displayed in the finder 116. By visually recognizing the mode mark 121D, the photographer can grasp whether or not the narrowing-down mode is turned on. The mode mark 121D is displayed when the narrowing mode is on, and is not displayed when the narrowing mode is off.

すなわち、カメラ制御部103は、絞込モードがオンされているか否かを表示する表示部として動作する。 That is, the camera control unit 103 operates as a display unit that displays whether or not the narrowing-down mode is turned on.

[第2実施形態]
図19は、図5と同様の図であって、本発明の第2実施形態において、カメラ制御部103(焦点調節制御部103b)が取得する焦点検出信号の一例を示す図である。本実施形態においても、被写体は、第1実施形態と同じ被写体300〜302である。なお、本実施形態では、被写体300がサングラスを装用している。本実施形態では、このサングラスの偏光作用により、各ラインセンサ118eA、118eBに入射される被写体300の光量に差が生じる。言い換えると、各ラインセンサ118eA、118eBより出力される焦点検出信号にレベル差が生じる。このレベル差により、精確なデフォーカス量を算出できない場合がある。
[Second Embodiment]
FIG. 19 is a diagram similar to FIG. 5, and is a diagram showing an example of a focus detection signal acquired by the camera control unit 103 (focus adjustment control unit 103b) in the second embodiment of the present invention. Also in this embodiment, the subjects are the same subjects 300 to 302 as in the first embodiment. In this embodiment, the subject 300 wears sunglasses. In the present embodiment, the polarization action of the sunglasses causes a difference in the amount of light of the subject 300 incident on the line sensors 118eA and 118eB. In other words, there is a level difference in the focus detection signals output from the line sensors 118eA and 118eB. Due to this level difference, it may not be possible to calculate an accurate defocus amount.

本実施形態においても、第1実施形態と同様に、カメラ制御部103(焦点調節制御部103b)により、図4の焦点調節処理が実行される。図20は、本実施形態において実行される測距演算処理(ステップS104)を示すフローチャートである。 Also in the present embodiment, the focus adjustment process of FIG. 4 is executed by the camera control unit 103 (focus adjustment control unit 103b) as in the first embodiment. FIG. 20 is a flowchart showing a distance measurement calculation process (step S104) executed in the present embodiment.

図20の測距演算処理は、ステップS207に代えて、ステップS207’を実行する点、及びステップS208とステップS209との間にステップS211〜S212の処理を実行する点を除き、図6の測距演算処理と同じである。 The distance measurement calculation process of FIG. 20 is the measurement of FIG. 6 except that the process of step S207'is executed instead of step S207 and the process of steps S211 to S212 is executed between steps S208 and S209. It is the same as the distance calculation processing.

図21は、図7と同様の図であって、本実施形態において、ラインセンサ118eA、118eBの全画素を相関演算範囲としたときに、相関演算処理(ステップS204)により求められる相関値SCO(s)及びコントラスト値OLC(s)の一例を示す図である。 FIG. 21 is a diagram similar to FIG. 7, and in the present embodiment, when all the pixels of the line sensors 118eA and 118eB are set as the correlation calculation range, the correlation value SCO (step S204) obtained by the correlation calculation process (step S204). It is a figure which shows an example of s) and a contrast value OLC (s).

図22は、図20の絞り込み範囲探索処理(ステップS207’)を示すフローチャートである。図22の絞り込み範囲探索処理は、ステップS317以降にステップS318〜S321の処理を実行する点を除き、図8の絞り込み範囲探索処理と同じである。なお、図22では、便宜上、ステップS302〜S308の図示を省略する。 FIG. 22 is a flowchart showing the narrowing range search process (step S207') of FIG. 20. The narrowing range search process of FIG. 22 is the same as the narrowing range search process of FIG. 8 except that the processes of steps S318 to S321 are executed after step S317. In FIG. 22, the illustration of steps S302 to S308 is omitted for convenience.

図23は、図11と同様の図であって、図22のステップS317の処理までを実行したときの、相関演算範囲の絞り込み例を示す図である。図23に示されるように、本実施形態では、信頼性判定値TRS(s)は、相関演算範囲が画素範囲14〜21のときに最小となる。なお、本実施形態において、この画素範囲14〜21には、ほぼ被写体300のみが位置するものとする。 FIG. 23 is a diagram similar to that of FIG. 11, and is a diagram showing an example of narrowing down the correlation calculation range when the process up to step S317 of FIG. 22 is executed. As shown in FIG. 23, in the present embodiment, the reliability determination value TRS (s) is minimized when the correlation calculation range is the pixel range 14 to 21. In the present embodiment, it is assumed that almost only the subject 300 is located in the pixel ranges 14 to 21.

しかし、図23に示されるように、画素範囲14〜21の信頼性判定値TRS(s)は0.24であり、第1の閾値(ここでは、0.05)よりも大きい。この結果、本実施形態では、信頼性判定値TRS(s)が第1の閾値以下となる相関演算範囲が求まらず、信頼性フラグが「T(true)」に設定されない。そのため、被写体300が位置するであろう画素範囲14〜21についてデフォーカス量が算出されない。 However, as shown in FIG. 23, the reliability determination value TRS (s) in the pixel range 14 to 21 is 0.24, which is larger than the first threshold value (here, 0.05). As a result, in the present embodiment, the correlation calculation range in which the reliability determination value TRS (s) is equal to or less than the first threshold value cannot be obtained, and the reliability flag is not set to "T (true)". Therefore, the defocus amount is not calculated for the pixel ranges 14 to 21 where the subject 300 will be located.

図24は、図7と同様の図であって、画素範囲14〜21に対して相関演算処理(ステップS317)を行ったときに求められる相関値SCO(s)及びコントラスト値OLC(s)の一例を示す図である。 FIG. 24 is a diagram similar to that of FIG. 7, and shows the correlation value SCO (s) and the contrast value OLC (s) obtained when the correlation calculation process (step S317) is performed on the pixel ranges 14 to 21. It is a figure which shows an example.

本実施形態では、相関演算範囲が画素範囲14〜21に絞り込まれた場合にも、図24に示されるように、補間処理後の相関値が極小となるときのシフト数として+1.9、言い換えると、被写体300に対する精確なデフォーカス量に相当する位相ずれ量が求まっていない。 In the present embodiment, even when the correlation calculation range is narrowed down to the pixel range 14 to 21, as shown in FIG. 24, the number of shifts when the correlation value after the interpolation processing becomes the minimum is +1.9, in other words. And, the phase shift amount corresponding to the accurate defocus amount with respect to the subject 300 has not been obtained.

そこで、図22に示されるように、カメラ制御部103は、演算範囲要素iの配列に格納された信頼性フラグ[i]が「F(false)」の場合(ステップS318:NO)、絞り込み後の相関演算範囲が焦点検出信号の出力レベル差により信頼性判定値TRS(s)に誤差が生じている可能性の高い範囲であるとみなし、センサ出力差補正処理(ステップS319)を行う。カメラ制御部103は、このセンサ出力差補正処理(ステップS319)により焦点検出信号の出力レベル差を補正すると(ステップS319、S320:YES)、出力レベル差を補正した絞り込み後の相関演算範囲に対して再度相関演算を行う(ステップS321)。 Therefore, as shown in FIG. 22, when the reliability flag [i] stored in the array of the calculation range elements i is “F (false)” (step S318: NO), the camera control unit 103 after narrowing down. It is considered that the correlation calculation range of is a range in which there is a high possibility that an error has occurred in the reliability determination value TRS (s) due to the output level difference of the focus detection signal, and the sensor output difference correction process (step S319) is performed. When the camera control unit 103 corrects the output level difference of the focus detection signal by this sensor output difference correction process (step S319) (steps S319, S320: YES), the camera control unit 103 with respect to the correlation calculation range after narrowing down after correcting the output level difference. The correlation calculation is performed again (step S321).

概説すると、カメラ制御部103(焦点調節制御部103b)は、信頼性判定部により信頼性なしと判定されると、信頼性なしと判定された相関演算結果における相関演算範囲について、一対の画像信号列の出力レベル差を計算する出力レベル差計算部として動作する。また、カメラ制御部103(焦点調節制御部103b)は、出力レベル差が所定値より大きい場合、相関演算範囲にて出力レベル差が軽減されるように、一対の画像信号列の出力レベルを補正する出力レベル補正部として動作する。カメラ制御部103(焦点調節制御部103b)は、出力レベル補正部による出力レベル補正後の画像信号列に対し、相関演算部による絞り込み後の画像信号列の範囲に対する相関演算を行う。 Generally speaking, when the camera control unit 103 (focus adjustment control unit 103b) determines that the reliability is unreliable, the camera control unit 103 (focus adjustment control unit 103b) has a pair of image signals regarding the correlation calculation range in the correlation calculation result determined to be unreliable. It operates as an output level difference calculation unit that calculates the output level difference of columns. Further, when the output level difference is larger than a predetermined value, the camera control unit 103 (focus adjustment control unit 103b) corrects the output levels of the pair of image signal strings so that the output level difference is reduced in the correlation calculation range. Operates as an output level correction unit. The camera control unit 103 (focus adjustment control unit 103b) performs a correlation calculation on the range of the image signal sequence after narrowing down by the correlation calculation unit with respect to the image signal sequence after the output level correction by the output level correction unit.

図25は、図22のセンサ出力差補正処理(ステップS319)を示すフローチャートである。 FIG. 25 is a flowchart showing the sensor output difference correction process (step S319) of FIG.

図25に示されるように、カメラ制御部103は、絞り込み後の相関演算範囲(ここでは、画素範囲14〜21)について、ラインセンサ118eAでの平均輝度値Aave(すなわち、画素14〜21の平均輝度値)を計算する(ステップS801)。ここでは、平均輝度値Aaveとして、169.75が計算される。 As shown in FIG. 25, the camera control unit 103 has an average luminance value Aave (that is, an average of pixels 14 to 21) of the line sensor 118eA with respect to the correlation calculation range (here, pixel range 14 to 21) after narrowing down. The brightness value) is calculated (step S801). Here, 169.75 is calculated as the average luminance value Aave.

カメラ制御部103は、絞り込み後の相関演算範囲について、ラインセンサ118eBでの平均輝度値Baveを計算する(ステップS802)。図24に示されるように、相関演算範囲が画素範囲14〜21の場合、相関関数はシフト数sが+2のときに極小値を取る。平均輝度値Baveは、焦点検出信号の出力レベル差を精度良く算出するため、このシフト数sを考慮した値、すなわち、画素範囲14〜21を+2シフトした画素範囲16〜23の平均輝度値となっている。ここでは、平均輝度値Baveとして、194が計算される。 The camera control unit 103 calculates the average luminance value Bave of the line sensor 118eB for the correlation calculation range after narrowing down (step S802). As shown in FIG. 24, when the correlation calculation range is the pixel range 14 to 21, the correlation function takes a minimum value when the shift number s is +2. The average luminance value Bave is a value considering the number of shifts s in order to accurately calculate the output level difference of the focus detection signal, that is, the average luminance value of the pixel ranges 16 to 23 obtained by shifting the pixel ranges 14 to 21 by +2. It has become. Here, 194 is calculated as the average luminance value Bave.

カメラ制御部103は、焦点検出信号の出力レベル差Vgapを計算する(ステップS803)。出力レベル差Vgapは、平均輝度値Aaveと平均輝度値Baveとの差の絶対値である。ここでは、出力レベル差Vgapとして、24.25が計算される。 The camera control unit 103 calculates the output level difference Vgap of the focus detection signal (step S803). The output level difference Vgap is an absolute value of the difference between the average luminance value Aave and the average luminance value Bave. Here, 24.25 is calculated as the output level difference Vgap.

カメラ制御部103は、出力レベル差Vgapが第6の閾値(本実施形態ではゼロ)より大きい場合に(ステップS804:YES)、焦点検出信号の出力レベル差を補正する。具体的には、カメラ制御部103は、補正対象の画素nを画素1に設定し(ステップS805)、平均輝度値Baveよりも平均輝度値Aaveが大きい場合(ステップS806:YES)、ラインセンサ118eAの各画素1〜32の出力レベルを補正し(ステップS807〜810及びS815)、平均輝度値Aaveよりも平均輝度値Baveが大きい場合(ステップS806:NO)、ラインセンサ118eBの各画素1〜32の出力レベルを補正する(ステップS811〜S815)。 When the output level difference Vgap is larger than the sixth threshold value (zero in the present embodiment) (step S804: YES), the camera control unit 103 corrects the output level difference of the focus detection signal. Specifically, the camera control unit 103 sets the pixel n to be corrected to pixel 1 (step S805), and when the average luminance value Ave is larger than the average luminance value Bave (step S806: YES), the line sensor 118eA When the output level of each pixel 1-32 is corrected (steps S807 to 810 and S815) and the average luminance value Babe is larger than the average luminance value Aave (step S806: NO), each pixel 1-32 of the line sensor 118eB is corrected. (Steps S811 to S815).

より詳細には、カメラ制御部103は、平均輝度値Baveよりも平均輝度値Aaveが大きい場合(ステップS806:YES)、Aセンサ列Anをなす全画素の輝度値(画素A[1]〜A[32]の輝度値)をRAM等に格納する(ステップS807)。カメラ制御部103は、補正対象の画素nが画素N(=32)になるまで(ステップS808)、ステップS809〜S810を繰り返し実行する。 More specifically, when the average luminance value Ave is larger than the average luminance value Bave (step S806: YES), the camera control unit 103 has the luminance values of all the pixels forming the A sensor array An (pixels A [1] to A). The brightness value of [32]) is stored in a RAM or the like (step S807). The camera control unit 103 repeatedly executes steps S809 to S810 until the pixel n to be corrected becomes pixel N (= 32) (step S808).

具体的には、カメラ制御部103は、RAM等に格納された画素nの輝度値を読み出し、画素nの輝度値を平均輝度値Aaveで除算した値(比率)を出力レベル差Vgapで乗算し、画素nの輝度値から、この乗算値を減算した値(=画素nの輝度値−(出力レベル差Vgap×画素nの輝度値/平均輝度値Aave))を計算する(ステップS809)。これにより、画素nの輝度の補正値が得られる。カメラ制御部103は、値nを1インクリメントする(ステップS810)。 Specifically, the camera control unit 103 reads out the brightness value of the pixel n stored in the RAM or the like, divides the brightness value of the pixel n by the average brightness value Aave, and multiplies the value (ratio) by the output level difference Vgap. , The value obtained by subtracting this multiplication value from the luminance value of the pixel n (= the luminance value of the pixel n- (output level difference Vgap × the luminance value of the pixel n / the average luminance value Ave)) is calculated (step S809). As a result, a correction value for the brightness of the pixel n can be obtained. The camera control unit 103 increments the value n by 1 (step S810).

ステップS809〜S810が繰り返し実行されることにより、Aセンサ列Anをなす全画素の輝度値が補正される。カメラ制御部103は、Aセンサ列Anをなす全画素の輝度値を補正すると、この補正処理が行われたことを示すセンサ出力差補正フラグを「T(true)」に設定する(ステップS815)。なお、センサ出力差補正フラグは、初期的には「F(false)」となっている。 By repeatedly executing steps S809 to S810, the brightness values of all the pixels forming the A sensor sequence An are corrected. When the camera control unit 103 corrects the brightness values of all the pixels forming the A sensor sequence An, the sensor output difference correction flag indicating that this correction processing has been performed is set to "T (true)" (step S815). .. The sensor output difference correction flag is initially set to "F (false)".

カメラ制御部103は、平均輝度値Aaveよりも平均輝度値Baveが大きい場合には(ステップS806:NO)、Bセンサ列BnについてステップS807〜810と同様の処理を行う(ステップS811〜S814)。カメラ制御部103は、Bセンサ列Bnをなす全画素の輝度値を補正すると、この補正処理が行われたことを示すセンサ出力差補正フラグを「T(true)」に設定する(ステップS815)。 When the average luminance value Babe is larger than the average luminance value Aave (step S806: NO), the camera control unit 103 performs the same processing as in steps S807 to 810 for the B sensor sequence Bn (steps S811 to S814). When the camera control unit 103 corrects the brightness values of all the pixels forming the B sensor sequence Bn, the sensor output difference correction flag indicating that this correction processing has been performed is set to "T (true)" (step S815). ..

なお、本実施形態では、平均輝度値Aaveよりも平均輝度値Baveが大きいため、Bセンサ列Bnをなす全画素の輝度値が補正される。 In the present embodiment, since the average luminance value Babe is larger than the average luminance value Aave, the luminance values of all the pixels forming the B sensor sequence Bn are corrected.

図26は、図5と同様の図であって、図22のセンサ出力差補正処理(ステップS319)後の焦点検出信号の一例を示す図である。図19と図26とを比較すると、主に、被写体300が位置するであろう画素範囲14〜21において、焦点検出信号の出力レベル差が軽減補正されていることが判る。 FIG. 26 is a diagram similar to FIG. 5, showing an example of the focus detection signal after the sensor output difference correction process (step S319) of FIG. 22. Comparing FIG. 19 and FIG. 26, it can be seen that the output level difference of the focus detection signal is reduced and corrected mainly in the pixel range 14 to 21 where the subject 300 will be located.

本実施形態では、焦点検出信号の出力レベル差を軽減補正するため、平均輝度値が大きい方の画像信号列に対してのみ補正処理を行っているが、別の実施形態では、両方の画像信号列に対して補正処理を行ってもよい。 In the present embodiment, in order to reduce and correct the output level difference of the focus detection signal, the correction processing is performed only on the image signal string having the larger average luminance value, but in another embodiment, both image signals are corrected. The column may be corrected.

図27は、図7と同様の図であって、図22のセンサ出力差補正処理(ステップS319)後の画素範囲14〜21に対して相関演算処理(ステップS321)を行ったときに求められる相関値SCO(s)及びコントラスト値OLC(s)の一例を示す図である。 FIG. 27 is a diagram similar to that of FIG. 7, and is obtained when the correlation calculation process (step S321) is performed on the pixel ranges 14 to 21 after the sensor output difference correction process (step S319) of FIG. 22. It is a figure which shows an example of the correlation value SCO (s) and contrast value OLC (s).

本実施形態では、焦点検出信号の出力レベル差を軽減補正することにより、図27に示されるように、補間処理後の相関値が極小となるときのシフト数として+2、言い換えると、被写体300に対する精確なデフォーカス量に相当する位相ずれ量が求まる。このように、本実施形態によれば、焦点検出信号にレベル差が生じる場合にも、精度の高いデフォーカス量を算出することが可能となる。 In the present embodiment, by reducing and correcting the output level difference of the focus detection signal, as shown in FIG. 27, the number of shifts when the correlation value after the interpolation processing becomes the minimum is +2, in other words, with respect to the subject 300. The amount of phase shift corresponding to the exact amount of defocus can be obtained. As described above, according to the present embodiment, it is possible to calculate the defocus amount with high accuracy even when the focus detection signal has a level difference.

焦点検出信号の出力レベル差は必ずしも全ての画素範囲で生じているわけではない。出力レベル差がもともと生じていない画素範囲に対し、図22のセンサ出力差補正処理(ステップS319)を行って相関演算処理を行うと、却って、被写体301及び302に対する精確なデフォーカス量に相当する位相ずれ量を求めることができなくなってしまう。 The output level difference of the focus detection signal does not necessarily occur in the entire pixel range. When the sensor output difference correction process (step S319) of FIG. 22 is performed on the pixel range in which the output level difference does not originally occur and the correlation calculation process is performed, it corresponds to an accurate defocus amount for the subjects 301 and 302. It becomes impossible to obtain the amount of phase shift.

そこで、カメラ制御部103は、余剰範囲確認処理(ステップS208)にて確認された範囲に対して相関演算処理を行う前に、焦点検出信号を出力レベル差を補正する前の状態に(言い換えると、図26に示される焦点検出信号から図19に示される焦点検出信号に)戻し(ステップS211)、センサ出力差補正フラグを「F(false)」に設定する(ステップS212)。これにより、余剰範囲確認処理(ステップS208)にて確認された他の範囲について、まずは、補正前の焦点検出信号を用いて相関演算処理が行われる。 Therefore, the camera control unit 103 puts the focus detection signal in the state before correcting the output level difference (in other words, before performing the correlation calculation process on the range confirmed in the surplus range confirmation process (step S208)). , The focus detection signal shown in FIG. 26 is returned to the focus detection signal shown in FIG. 19 (step S211), and the sensor output difference correction flag is set to “F (false)” (step S212). As a result, for the other ranges confirmed in the surplus range confirmation process (step S208), first, the correlation calculation process is performed using the focus detection signal before correction.

余剰範囲確認処理(ステップS208)にて確認された他の範囲(ここでは、被写体301及び302が位置する範囲)では、焦点検出信号の出力レベル差が生じていない。そのため、焦点検出信号を出力レベル差を補正する前の状態に戻したうえで相関演算処理を行うことにより、第1実施形態と同様に、被写体301及び302に対する精確なデフォーカス量に相当する位相ずれ量(図14B及び図15B参照)が求まる。 In the other range confirmed in the surplus range confirmation process (step S208) (here, the range in which the subjects 301 and 302 are located), there is no difference in the output level of the focus detection signal. Therefore, by returning the focus detection signal to the state before correcting the output level difference and then performing the correlation calculation processing, the phase corresponding to the accurate defocus amount for the subjects 301 and 302 is performed as in the first embodiment. The amount of deviation (see FIGS. 14B and 15B) can be obtained.

本実施形態では、焦点検出信号を出力レベル差を補正する前の状態に戻したうえで相関演算処理を行うことにより、焦点検出信号の出力レベル差が生じている範囲と生じていない範囲が混在する場合にも、各被写体に対する精確なデフォーカス量に相当する位相ずれ量を求めることができる。 In the present embodiment, the focus detection signal is returned to the state before the output level difference is corrected, and then the correlation calculation processing is performed, so that the range in which the output level difference of the focus detection signal is generated and the range in which the output level difference is not generated are mixed. Even in this case, it is possible to obtain a phase shift amount corresponding to an accurate defocus amount for each subject.

以上が本発明の例示的な実施形態の説明である。本発明の実施形態は、上記に説明したものに限定されず、本発明の技術的思想の範囲において様々な変形が可能である。例えば明細書中に例示的に明示される実施形態等又は自明な実施形態等を適宜組み合わせた内容も本願の実施形態に含まれる。 The above is the description of the exemplary embodiment of the present invention. The embodiments of the present invention are not limited to those described above, and various modifications can be made within the scope of the technical idea of the present invention. For example, the embodiment of the present application also includes a content obtained by appropriately combining an embodiment or the like or a self-explanatory embodiment or the like which is exemplified in the specification.

1 撮影装置
100 カメラボディ
103 カメラ制御部
118 焦点検出モジュール
118e 測距素子
118eA、118eB ラインセンサ
121A〜121C 合焦マーク
121D モードマーク
200 撮影レンズ
203 フォーカスレンズ群
1 Imaging device 100 Camera body 103 Camera control unit 118 Focus detection module 118e Distance measuring elements 118eA, 118eB Line sensors 121A to 121C Focusing mark 121D Mode mark 200 Imaging lens 203 Focus lens group

Claims (18)

一対のセンサ列上に投影された一対の被写体光に基づいて焦点検出を行う瞳分割位相差方式の自動焦点検出装置において、
前記センサ列より出力される画像信号列について相関演算を行う相関演算部と、
前記相関演算部による相関演算結果の信頼性を判定する信頼性判定部と、
前記信頼性判定部により信頼性ありと判定されると、信頼性ありと判定された相関演算結果に基づいてデフォーカス量を算出するデフォーカス量算出部と、
前記信頼性判定部により信頼性なしと判定されると、前記相関演算を行った画像信号列の始端側の画像信号に対する信頼性と、終端側の画像信号に対する信頼性と、を比較し、比較結果に基づいて前記画像信号列から前記始端側と前記終端側の少なくとも一方の画像信号を除外することにより、前記画像信号列を絞り込む絞込部と、
を備え、
前記信頼性判定部により信頼性ありと判定されるまで、前記絞込部による画像信号列の絞り込み及び前記相関演算部による前記絞り込み後の画像信号列の範囲に対する相関演算を行う、
自動焦点検出装置。
In an autofocus detection device of the pupil division phase difference method that performs focus detection based on a pair of subject lights projected on a pair of sensor rows.
A correlation calculation unit that performs correlation calculation on the image signal sequence output from the sensor sequence, and
A reliability determination unit that determines the reliability of the correlation calculation result by the correlation calculation unit,
When the reliability determination unit determines that there is reliability, the defocus amount calculation unit that calculates the defocus amount based on the correlation calculation result determined to be reliable, and the defocus amount calculation unit.
When the reliability determination unit determines that there is no reliability, the reliability of the image signal on the start side and the reliability of the image signal on the end side of the image signal string subjected to the correlation calculation are compared and compared. A narrowing section that narrows down the image signal sequence by excluding at least one of the image signals on the start end side and the end side from the image signal sequence based on the result.
With
Until the reliability determination unit determines that the image signal sequence is reliable, the narrowing down unit narrows down the image signal sequence and the correlation calculation unit performs a correlation calculation on the range of the image signal string after the narrowing down.
Autofocus detector.
前記信頼性判定部は、
前記相関演算によって求まった第1の位相ずれ量での相関値及びコントラスト値に基づいて、前記第1の位相ずれ量の信頼性を判定する信頼性判定値を計算し、
前記第1の位相ずれ量と、前記第1の位相ずれ量よりも所定画素分大きい又は小さい第2の位相ずれ量と、のコントラスト値の差であるコントラスト差を計算し、
前記絞込部による画像信号列の絞り込み及び前記相関演算部による前記絞り込み後の画像信号列の範囲に対する相関演算が行われ、前記第1の位相ずれ量の信頼性判定値が所定条件を満たし且つ前記コントラスト差が最小になる相関演算結果が得られると、この相関演算結果について信頼性ありと判定する、
請求項1に記載の自動焦点検出装置。
The reliability determination unit
Based on the correlation value and the contrast value in the first phase shift amount obtained by the correlation calculation, a reliability determination value for determining the reliability of the first phase shift amount is calculated.
The contrast difference, which is the difference between the contrast values of the first phase shift amount and the second phase shift amount which is larger or smaller by a predetermined pixel than the first phase shift amount, is calculated.
The narrowing down of the image signal sequence by the narrowing down unit and the correlation calculation for the range of the image signal string after the narrowing down by the correlation calculation unit are performed, and the reliability determination value of the first phase shift amount satisfies a predetermined condition. When the correlation calculation result that minimizes the contrast difference is obtained, it is determined that the correlation calculation result is reliable.
The automatic focus detection device according to claim 1.
前記所定条件は、
前記第1の位相ずれ量の信頼性判定値が所定閾値以下である、
請求項2に記載の自動焦点検出装置。
The predetermined condition is
The reliability determination value of the first phase shift amount is equal to or less than a predetermined threshold value.
The automatic focus detection device according to claim 2.
前記第1の位相ずれ量は、
前記相関演算によって求まった相関関数が極小値を取るときの位相ずれ量である、
請求項2又は請求項3に記載の自動焦点検出装置。
The first phase shift amount is
This is the amount of phase shift when the correlation function obtained by the correlation calculation takes a minimum value.
The automatic focus detection device according to claim 2 or 3.
前記相関関数に対する補間処理によりサブピクセル単位での位相ずれ量を計算する補間計算部
を更に備え、
前記第1の位相ずれ量の信頼性判定値は、
前記補間処理後の相関関数での極小値を、前記第1の位相ずれ量での前記コントラスト値で除した値である、
請求項4に記載の自動焦点検出装置。
Further, an interpolation calculation unit for calculating the amount of phase shift in sub-pixel units by interpolation processing for the correlation function is provided.
The reliability determination value of the first phase shift amount is
It is a value obtained by dividing the minimum value in the correlation function after the interpolation process by the contrast value in the first phase shift amount.
The automatic focus detection device according to claim 4.
前記絞込部は、
前記始端側に位置する複数の画像信号に対する信頼性と、前記終端側に位置する複数の画像信号に対する信頼性と、を比較する、
請求項1から請求項5の何れか一項に記載の自動焦点検出装置。
The narrowing part
The reliability of the plurality of image signals located on the start end side is compared with the reliability of the plurality of image signals located on the end side.
The automatic focus detection device according to any one of claims 1 to 5.
前記絞込部は、
前記始端側の画像信号に対する信頼性と、前記終端側の画像信号に対する信頼性とが同じ場合、前記始端側の画像信号のコントラスト値である始端側コントラスト値と、前記終端側の画像信号のコントラスト値である終端側コントラスト値と、を比較し、前記コントラスト値が低い方の端部の画像信号を前記画像信号列から除外する、
請求項1から請求項6の何れか一項に記載の自動焦点検出装置。
The narrowing part
When the reliability of the image signal on the start end side and the reliability of the image signal on the end side are the same, the contrast value of the start end side, which is the contrast value of the image signal on the start end side, and the contrast of the image signal on the end side. The end side contrast value, which is a value, is compared with, and the image signal at the end having the lower contrast value is excluded from the image signal sequence.
The automatic focus detection device according to any one of claims 1 to 6.
前記絞込部は、
更に、前記始端側コントラスト値と前記終端側コントラスト値とが同じ場合、両方の端部の画像信号を前記画像信号列から除外する、
請求項7に記載の自動焦点検出装置。
The narrowing part
Further, when the start end side contrast value and the end end side contrast value are the same, the image signals at both ends are excluded from the image signal sequence.
The automatic focus detection device according to claim 7.
前記画像信号列の全範囲のうち、前記相関演算結果が信頼性ありと判定された第1の範囲以外の範囲を検出する検出部
を更に備え、
前記相関演算部により、前記検出部により検出された検出範囲の画像信号列に対して相関演算が行われ、
前記信頼性判定部により、前記検出範囲での相関演算結果が信頼性なしと判定されると、相関演算結果が信頼性ありと判定されるまで、前記絞込部による画像信号列の絞り込み及び前記相関演算部による前記絞り込み後の画像信号列の範囲に対する相関演算を行う、
請求項1から請求項8の何れか一項に記載の自動焦点検出装置。
A detection unit for detecting a range other than the first range in which the correlation calculation result is determined to be reliable is further provided among the entire range of the image signal sequence.
The correlation calculation unit performs a correlation calculation on the image signal sequence of the detection range detected by the detection unit.
When the reliability determination unit determines that the correlation calculation result in the detection range is unreliable, the narrowing down unit narrows down the image signal sequence and the narrowing down until the correlation calculation result is determined to be reliable. Correlation calculation is performed on the range of the image signal sequence after the narrowing down by the correlation calculation unit.
The automatic focus detection device according to any one of claims 1 to 8.
前記検出範囲の中で前記相関演算結果が信頼性ありと判定される範囲が少なくとも1つある場合、前記デフォーカス量算出部により、前記第1の範囲及び前記少なくとも1つの範囲の各範囲について算出されたデフォーカス量のうち、前記自動焦点検出装置に最も近い被写体に対応する範囲について算出されたデフォーカス量を、フォーカスレンズを駆動するためのデフォーカス量として選択するデフォーカス量選択部
を更に備える、
請求項9に記載の自動焦点検出装置。
When there is at least one range in which the correlation calculation result is determined to be reliable in the detection range, the defocus amount calculation unit calculates each range of the first range and the at least one range. Further, a defocus amount selection unit that selects the defocus amount calculated for the range corresponding to the subject closest to the automatic focus detection device as the defocus amount for driving the focus lens among the defocus amounts. Prepare, prepare
The automatic focus detection device according to claim 9.
AFモード又はMFモードに設定する焦点調節モード設定部と、
被写体の合焦状態を報知する報知部と、
を更に備え、
前記AFモード時、
前記デフォーカス量選択部が、前記自動焦点検出装置に最も近い被写体に対応する範囲について算出されたデフォーカス量を、前記フォーカスレンズを駆動するためのデフォーカス量として選択し、
前記MFモード時、
前記デフォーカス量選択部が、前記第1の範囲及び前記少なくとも1つの範囲の各範囲について算出されたデフォーカス量のうち、現在の焦点調節状態から最も合焦状態に近い範囲について算出されたデフォーカス量を選択し、前記報知部が、前記デフォーカス量選択部により選択されたデフォーカス量に対応する範囲の被写体が合焦状態にあることを報知する、
請求項10に記載の自動焦点検出装置。
Focus adjustment mode setting unit for setting AF mode or MF mode,
A notification unit that notifies the focus status of the subject and
Further prepare
In the AF mode
The defocus amount selection unit selects the defocus amount calculated for the range corresponding to the subject closest to the automatic focus detection device as the defocus amount for driving the focus lens.
In the MF mode
Of the defocus amounts calculated for each of the first range and at least one range, the defocus amount selection unit calculates the defocus amount calculated for the range closest to the in-focus state from the current focus adjustment state. A focus amount is selected, and the notification unit notifies that a subject in a range corresponding to the defocus amount selected by the defocus amount selection unit is in focus.
The automatic focus detection device according to claim 10.
前記報知部は、
前記デフォーカス量選択部により選択されたデフォーカス量に対応する範囲の被写体が合焦状態にあることを知らせる表示を行う、
請求項11に記載の自動焦点検出装置。
The notification unit
A display is performed to notify that the subject in the range corresponding to the defocus amount selected by the defocus amount selection unit is in the in-focus state.
The automatic focus detection device according to claim 11.
絞込モードのオンとオフとを切り替える絞込モード切替部
を更に備え、
前記絞込モードがオンされているときに前記信頼性判定部により信頼性なしと判定されると、前記信頼性判定部により信頼性ありと判定されるまで、前記絞込部による画像信号列の絞り込み及び前記相関演算部による前記絞り込み後の画像信号列の範囲に対する相関演算を行う、
請求項1から請求項12の何れか一項に記載の自動焦点検出装置。
It also has a narrowing mode switching unit that switches the narrowing mode on and off.
If the reliability determination unit determines that the image signal is unreliable while the narrowing mode is turned on, the image signal sequence of the image signal sequence by the narrowing unit is determined by the reliability determination unit until it is determined to be reliable. Correlation calculation is performed on the range of the image signal sequence after the narrowing down and the narrowing down by the correlation calculation unit.
The automatic focus detection device according to any one of claims 1 to 12.
前記絞込モードがオンされているか否かを表示する表示部
を更に備える、
請求項13に記載の自動焦点検出装置。
A display unit for displaying whether or not the narrowing mode is turned on is further provided.
The automatic focus detection device according to claim 13.
前記信頼性判定部により信頼性なしと判定されると、信頼性なしと判定された相関演算結果における相関演算範囲について、一対の前記画像信号列の出力レベル差を計算する出力レベル差計算部と、
前記出力レベル差が所定値より大きい場合、前記相関演算範囲にて前記出力レベル差が軽減されるように、前記一対の画像信号列の出力レベルを補正する出力レベル補正部と、を更に備え、
前記出力レベル補正部による出力レベル補正後の画像信号列に対し、前記相関演算部による前記絞り込み後の画像信号列の範囲に対する相関演算を行う、
請求項1から請求項14の何れか一項に記載の自動焦点検出装置。
When the reliability determination unit determines that there is no reliability, the output level difference calculation unit calculates the output level difference of the pair of image signal strings for the correlation calculation range in the correlation calculation result determined to be unreliable. ,
When the output level difference is larger than a predetermined value, an output level correction unit for correcting the output level of the pair of image signal strings is further provided so that the output level difference is reduced in the correlation calculation range.
For the image signal string after the output level correction by the output level correction unit, the correlation calculation unit performs the correlation calculation on the range of the image signal sequence after the narrowing down.
The automatic focus detection device according to any one of claims 1 to 14.
前記検出範囲の画像信号列に対して相関演算を行う前に、前記出力レベル補正部による出力レベル補正後の画像信号列を、前記出力レベル補正部による出力レベル補正前の画像信号列に戻す、
請求項9を引用する、請求項10から請求項15の何れか一項に記載の自動焦点検出装置。
Before performing the correlation calculation on the image signal string in the detection range, the image signal string after the output level correction by the output level correction unit is returned to the image signal sequence before the output level correction by the output level correction unit.
The automatic focus detection device according to any one of claims 10 to 15, which cites claim 9.
一対のセンサ列上に投影された一対の被写体光に基づいて焦点検出を行う瞳分割位相差方式の自動焦点検出装置が実行する自動焦点検出方法において、
前記センサ列より出力される画像信号列について相関演算を行う相関演算ステップと、
前記相関演算ステップでの相関演算結果の信頼性を判定する信頼性判定ステップと、
前記信頼性判定ステップにて信頼性ありと判定されると、信頼性ありと判定された相関演算結果に基づいてデフォーカス量を算出するデフォーカス量算出ステップと、
前記信頼性判定ステップにて信頼性なしと判定されると、前記相関演算を行った画像信号列の始端側の画像信号に対する信頼性と、終端側の画像信号に対する信頼性と、を比較し、比較結果に基づいて前記画像信号列から前記始端側と前記終端側の少なくとも一方の画像信号を除外することにより、前記画像信号列を絞り込む絞込ステップと、
を含み、
前記信頼性判定ステップにて信頼性ありと判定されるまで、前記絞込ステップでの画像信号列の絞り込み及び前記相関演算ステップでの前記絞り込み後の画像信号列の範囲に対する相関演算を行う、
自動焦点検出方法。
In the automatic focus detection method executed by the pupil division phase difference type automatic focus detection device that performs focus detection based on a pair of subject lights projected on a pair of sensor rows.
A correlation calculation step for performing a correlation calculation on the image signal sequence output from the sensor sequence, and
A reliability determination step for determining the reliability of the correlation calculation result in the correlation calculation step, and
When it is determined to be reliable in the reliability determination step, the defocus amount calculation step for calculating the defocus amount based on the correlation calculation result determined to be reliable, and the defocus amount calculation step.
When it is determined that there is no reliability in the reliability determination step, the reliability of the image signal on the start side of the image signal sequence subjected to the correlation calculation is compared with the reliability of the image signal on the end side. A narrowing-down step of narrowing down the image signal sequence by excluding at least one of the image signals on the start end side and the end side from the image signal sequence based on the comparison result.
Including
Until it is determined to be reliable in the reliability determination step, the image signal trains are narrowed down in the narrowing down step and the correlation calculation is performed on the range of the image signal trains after the narrowing down in the correlation calculation step.
Autofocus detection method.
一対のセンサ列上に投影された一対の被写体光に基づいて焦点検出を行う瞳分割位相差方式の自動焦点検出装置が実行する自動焦点検出プログラムにおいて、
前記センサ列より出力される画像信号列について相関演算を行う相関演算ステップと、
前記相関演算ステップでの相関演算結果の信頼性を判定する信頼性判定ステップと、
前記信頼性判定ステップにて信頼性ありと判定されると、信頼性ありと判定された相関演算結果に基づいてデフォーカス量を算出するデフォーカス量算出ステップと、
前記信頼性判定ステップにて信頼性なしと判定されると、前記相関演算を行った画像信号列の始端側の画像信号に対する信頼性と、終端側の画像信号に対する信頼性と、を比較し、比較結果に基づいて前記画像信号列から前記始端側と前記終端側の少なくとも一方の画像信号を除外することにより、前記画像信号列を絞り込む絞込ステップと、
を含み、
前記信頼性判定ステップにて信頼性ありと判定されるまで、前記絞込ステップでの画像信号列の絞り込み及び前記相関演算ステップでの前記絞り込み後の画像信号列の範囲に対する相関演算を行う、
自動焦点検出プログラム。
In an automatic focus detection program executed by an autofocus detection device of the pupil division phase difference method that performs focus detection based on a pair of subject lights projected on a pair of sensor rows.
A correlation calculation step for performing a correlation calculation on the image signal sequence output from the sensor sequence, and
A reliability determination step for determining the reliability of the correlation calculation result in the correlation calculation step, and
When it is determined to be reliable in the reliability determination step, the defocus amount calculation step for calculating the defocus amount based on the correlation calculation result determined to be reliable, and the defocus amount calculation step.
When it is determined that there is no reliability in the reliability determination step, the reliability of the image signal on the start side of the image signal sequence subjected to the correlation calculation is compared with the reliability of the image signal on the end side. A narrowing-down step of narrowing down the image signal sequence by excluding at least one of the image signals on the start end side and the end side from the image signal sequence based on the comparison result.
Including
Until it is determined to be reliable in the reliability determination step, the image signal trains are narrowed down in the narrowing down step and the correlation calculation is performed on the range of the image signal trains after the narrowing down in the correlation calculation step.
Autofocus detection program.
JP2020045800A 2020-03-16 2020-03-16 Automatic focus detection device, automatic focus detection method, and automatic focus detection program Active JP7435085B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2020045800A JP7435085B2 (en) 2020-03-16 2020-03-16 Automatic focus detection device, automatic focus detection method, and automatic focus detection program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2020045800A JP7435085B2 (en) 2020-03-16 2020-03-16 Automatic focus detection device, automatic focus detection method, and automatic focus detection program

Publications (2)

Publication Number Publication Date
JP2021148841A true JP2021148841A (en) 2021-09-27
JP7435085B2 JP7435085B2 (en) 2024-02-21

Family

ID=77851282

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2020045800A Active JP7435085B2 (en) 2020-03-16 2020-03-16 Automatic focus detection device, automatic focus detection method, and automatic focus detection program

Country Status (1)

Country Link
JP (1) JP7435085B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023037934A1 (en) 2021-09-13 2023-03-16 富士フイルム株式会社 Production method for encapsulation of bicycloalkane compound

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005084330A (en) 2003-09-08 2005-03-31 Olympus Corp Range finder and camera mounted with same range finder
JP5531774B2 (en) 2010-05-20 2014-06-25 リコーイメージング株式会社 Automatic focusing apparatus and camera equipped with the same
JP7237450B2 (en) 2018-01-23 2023-03-13 キヤノン株式会社 Image processing device, image processing method, program, storage medium, and imaging device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023037934A1 (en) 2021-09-13 2023-03-16 富士フイルム株式会社 Production method for encapsulation of bicycloalkane compound

Also Published As

Publication number Publication date
JP7435085B2 (en) 2024-02-21

Similar Documents

Publication Publication Date Title
JP4872834B2 (en) Image recognition device, focus adjustment device, and imaging device
JP5167750B2 (en) TRACKING DEVICE, IMAGING DEVICE, AND TRACKING METHOD
JP5157256B2 (en) Image tracking device and imaging device
JP2010015024A (en) Image pickup apparatus, control method thereof, program and storage medium
US20040223073A1 (en) Focal length detecting method and focusing device
US9781330B2 (en) Focus detection apparatus and control method for focus detection apparatus
JP2009109839A (en) Image tracking device and imaging device
JP2014013368A (en) Imaging apparatus and control method thereof
JP2005215373A (en) Imaging apparatus
JP2012226206A (en) Image tracking device and imaging apparatus
JP7435085B2 (en) Automatic focus detection device, automatic focus detection method, and automatic focus detection program
JP4888249B2 (en) Focus detection apparatus and imaging apparatus
JP2009086688A (en) Camera
JP4985155B2 (en) Focus adjustment device and imaging device
JP4786734B2 (en) camera
JP2008026787A (en) Imaging apparatus
JP5420034B2 (en) Imaging apparatus, control method therefor, program, and storage medium
JP2010200138A (en) Photographic subject tracking device
JP2004361431A (en) Imaging unit
JP5541396B2 (en) Image tracking device
JP5447579B2 (en) Tracking device, focus adjustment device, and photographing device
JP2001108886A (en) Camera
JP2010117488A (en) Imaging apparatus and focal position-detecting device
JP5762037B2 (en) Imaging apparatus and control method
JP5176845B2 (en) Image tracking device and imaging device

Legal Events

Date Code Title Description
RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20201007

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20230116

RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20231025

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20231115

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: 20240109

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20240122

R151 Written notification of patent or utility model registration

Ref document number: 7435085

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151