JPH08166535A - Focus detector and focus detecting method for camera - Google Patents
Focus detector and focus detecting method for cameraInfo
- Publication number
- JPH08166535A JPH08166535A JP31186094A JP31186094A JPH08166535A JP H08166535 A JPH08166535 A JP H08166535A JP 31186094 A JP31186094 A JP 31186094A JP 31186094 A JP31186094 A JP 31186094A JP H08166535 A JPH08166535 A JP H08166535A
- Authority
- JP
- Japan
- Prior art keywords
- block
- calculation
- pair
- focus
- value
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title abstract description 40
- 238000000605 extraction Methods 0.000 claims abstract description 8
- 238000001514 detection method Methods 0.000 claims description 55
- 230000004907 flux Effects 0.000 claims description 7
- 210000001747 pupil Anatomy 0.000 claims description 7
- 238000006243 chemical reaction Methods 0.000 claims description 6
- 230000000007 visual effect Effects 0.000 abstract description 15
- 238000012545 processing Methods 0.000 description 24
- 230000008569 process Effects 0.000 description 23
- 230000003287 optical effect Effects 0.000 description 20
- 238000010586 diagram Methods 0.000 description 10
- 238000009825 accumulation Methods 0.000 description 6
- 238000007781 pre-processing Methods 0.000 description 4
- 239000013256 coordination polymer Substances 0.000 description 3
- 230000035945 sensitivity Effects 0.000 description 3
- 230000003321 amplification Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 238000005259 measurement Methods 0.000 description 2
- 238000012544 monitoring process Methods 0.000 description 2
- 238000003199 nucleic acid amplification method Methods 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 238000012935 Averaging Methods 0.000 description 1
- RUPBZQFQVRMKDG-UHFFFAOYSA-M Didecyldimethylammonium chloride Chemical compound [Cl-].CCCCCCCCCC[N+](C)(C)CCCCCCCCCC RUPBZQFQVRMKDG-UHFFFAOYSA-M 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 238000006073 displacement reaction Methods 0.000 description 1
- 210000003128 head Anatomy 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 230000000717 retained effect Effects 0.000 description 1
- 238000005070 sampling Methods 0.000 description 1
- 230000001568 sexual effect Effects 0.000 description 1
- 238000004904 shortening Methods 0.000 description 1
Landscapes
- Focusing (AREA)
- Automatic Focus Adjustment (AREA)
Abstract
Description
【0001】[0001]
【産業上の利用分野】本発明は、位相差式焦点検出法を
用いたカメラの焦点検出装置及びその焦点検出方法に関
するものである。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a focus detecting device for a camera using a phase difference type focus detecting method and a focus detecting method thereof.
【0002】[0002]
【従来の技術】従来より、カメラの自動焦点検出方法と
して、異なる瞳を通った被写体からの光束が形成する2
つの像のずれ量から焦点状態を検出する、いわゆる位相
差式焦点検出法というものが知られている。2. Description of the Related Art Conventionally, as an automatic focus detection method for a camera, a light flux from an object passing through different pupils is formed by 2
A so-called phase-difference focus detection method is known in which the focus state is detected from the amount of displacement of two images.
【0003】例えば、特開昭59ー126517号公報
のカメラのピント検出装置には、以下のような旨の開示
がある。一対のラインセンサ、それぞれを複数の重なり
合ったブロックに分割して、その各ラインセンサ上に形
成される2像のうち、基準部となる一方のラインセンサ
の各ブロックのコントラストを求める。そして、コント
ラストが高いブロックについて、参照部としての他方の
ラインセンサの対応するブロック部分との2像の一致度
を相関演算によって求めるという手法である。For example, Japanese Patent Laid-Open No. 59-126517 discloses a focus detection device for a camera as disclosed below. A pair of line sensors, each of which is divided into a plurality of overlapping blocks, and the contrast of each block of one of the line sensors, which is the reference portion, of the two images formed on each line sensor is obtained. Then, for a block with high contrast, the degree of coincidence between the two images with the corresponding block portion of the other line sensor as the reference unit is obtained by a correlation calculation.
【0004】この手法では、まず初めに基準部のライン
センサの中からコントラストの高い部分(ブロック)を
探し、参照部のラインセンサの中でそれに対応する部分
(ブロック)とでしか相関演算を行わないため、相関演
算に要する時間を短くすることができる。In this method, first, a high-contrast portion (block) is searched for in the reference line sensor, and the correlation calculation is performed only with the corresponding portion (block) in the reference line sensor. Since it does not exist, the time required for the correlation calculation can be shortened.
【0005】[0005]
【発明が解決しようとする課題】しかしながら、上記特
開昭59−126517号公報による手法では、広視野
において十分デフォーカス検出ができるような仕様とし
たとき、即ち、一対のラインセンサにおいて各ラインセ
ンサが長く、センサの画素数が多い仕様としたとき、合
焦点検出の演算結果の精度が悪くなる場合が生じ易いと
いう問題点を有している。However, in the method disclosed in Japanese Patent Laid-Open No. 59-126517, when the specification is set so that defocus detection can be sufficiently performed in a wide field of view, that is, each line sensor in a pair of line sensors. However, when the specifications are long and the number of pixels of the sensor is large, there is a problem that the accuracy of the calculation result of the focus detection tends to deteriorate.
【0006】これは、広視野の場合、遠景と近景とが同
一視野内に存在する、いわゆる、被写体の遠近混在の状
態が起こり易く、この遠近混在の状態においてはどの被
写体情報に基づいて合焦検出を行えば良いかの判断が的
確にできないためである。This is because in the case of a wide field of view, a distant view and a near view are present in the same field of view, that is, a so-called mixed state of the objects is likely to occur, and in this mixed state of the perspective, focusing is performed based on which object information. This is because it is not possible to accurately determine whether to perform detection.
【0007】この対策として、他の従来例においては基
準部のラインセンサのブロックの大きさを小さく設定す
ることで視野を小さくして、遠近情報の分離を行ってい
る。ところが、参照部と基準部とのブロックの一致度を
調べる相関演算を行うときには、演算の基準となるブロ
ックが小さくてもデフォーカス量に対応した相関演算が
必要で、全デフォーカス範囲に対し演算を行わなければ
ならない。このため、ブロックを小さくすることによ
り、従来よりも演算時間が相当長くなる。As a countermeasure against this, in another conventional example, the field of view is made small by setting the size of the block of the line sensor of the reference portion small, and the distance information is separated. However, when performing the correlation calculation for checking the degree of coincidence between the reference portion and the reference portion, even if the reference block is small, the correlation calculation corresponding to the defocus amount is necessary, and the calculation is performed for the entire defocus range. Must be done. Therefore, by making the block smaller, the calculation time becomes considerably longer than in the conventional case.
【0008】これに対し、データを間引いて演算を行う
ことでデータ処理時間の短縮を図ることが考えられる
が、単にデータを間引くだけでは演算精度を低下させる
だけで、信頼性が低くなる。On the other hand, it is conceivable that the data processing time can be shortened by thinning out the data and performing the calculation. However, simply thinning out the data only lowers the calculation accuracy and lowers the reliability.
【0009】そこで本発明は、被写体の遠近混在の状態
が起こり易い広視野での焦点検出においても、焦点検出
時の演算時間を短縮でき正確な焦点検出が可能なカメラ
の焦点検出装置及びその焦点検出方法を提供することを
目的とする。Therefore, according to the present invention, a focus detection device for a camera and a focus detection device for the camera capable of shortening the calculation time at the time of focus detection and performing accurate focus detection even in the focus detection in a wide field of view in which the state of distant objects is likely to be mixed. It is intended to provide a detection method.
【0010】[0010]
【課題を解決するための手段】上記目的を達成するため
に、請求項1に記載のカメラの焦点検出装置は、撮影レ
ンズの異なる瞳部分を通過した被写体からの1対の光束
による1対の被写体像に基づいて、上記被写体に対する
撮影レンズの焦点調節状態を検出する焦点検出装置にお
いて、上記1対の被写体像を受光し、光電変換する蓄積
型の受光手段と、上記受光手段からの1対の電気信号を
それぞれ所定数のブロックに分割し、各ブロックごとの
複数の特徴点を抽出する特徴抽出手段と、上記特徴抽出
手段の出力に基づいて、上記1対の電気信号のそれぞれ
のコントラスト値と、相互の一致度とを上記ブロックご
とに演算する第1の演算手段と、上記一致度の演算の結
果と、最小値を与える複数のブロックに基づいて相関演
算を行い、最も相関性の高い部分につき補間演算と信頼
値演算とを行う第2の演算手段とを具備したことを特徴
とする。In order to achieve the above object, a focus detection device for a camera according to a first aspect of the present invention comprises a pair of light fluxes from a subject passing through different pupil portions of a photographing lens. In a focus detection device for detecting a focus adjustment state of a photographing lens with respect to the subject based on the subject image, a storage type light receiving means for receiving and photoelectrically converting the pair of subject images, and a pair of the light receiving means. Each of the electric signals is divided into a predetermined number of blocks, and a plurality of characteristic points for each block are extracted, and a contrast value of each of the pair of electric signals is calculated based on the output of the characteristic extracting means. And the mutual matching degree for each block, and the correlation calculation is performed based on the calculation result of the matching degree and a plurality of blocks giving the minimum value. Characterized by comprising a second operation means for performing sexual high part per interpolation operation and the reliability value calculation.
【0011】またさらに、請求項2に記載のカメラの焦
点検出装置は、上記ブロックごとの複数の特徴点が、そ
れぞれ該当ブロック内の信号の最大値及び最小値である
ことを特徴とする。Further, the camera focus detection device according to a second aspect of the present invention is characterized in that the plurality of feature points for each block are the maximum value and the minimum value of the signal in the corresponding block, respectively.
【0012】また、請求項3に記載のカメラの焦点検出
方法は、撮影レンズの異なる瞳部分を通過した被写体か
らの1対の光束による1対の被写体像に基づいて、撮影
レンズの焦点調節状態を検出する焦点検出方法におい
て、上記1対の被写体像を受光し、光電変換を行う受光
ステップと、上記光電変換された1対の電気信号を、そ
れぞれ所定数のブロックに分割し、各ブロックごとの複
数の特徴点を抽出する特徴抽出ステップと、上記特徴抽
出ステップによる上記特徴点の抽出結果に基づいて、上
記1対の電気信号のそれぞれのコントラスト値と、相互
の一致度とを上記ブロックごとに演算する第1の演算ス
テップと、上記第1の演算ステップによる上記一致度の
演算結果と、最小値を与える複数のブロックに基づい
て、相関演算を行う相関演算ステップと、上記相関演算
ステップによる相関演算結果に基づいて、最も相関性の
高い部分につき補間演算と信頼値演算とを行う第2の演
算ステップとを具備し、これらの結果に基づいて撮影レ
ンズの焦点調節状態を出力することを特徴とする。According to a third aspect of the focus detection method of the camera, the focus adjustment state of the photographing lens is based on a pair of subject images formed by a pair of light beams from the subject that have passed through different pupil portions of the photographing lens. In the focus detection method for detecting a light receiving step, the pair of subject images are received and photoelectric conversion is performed, and the pair of photoelectrically converted electric signals are divided into a predetermined number of blocks. Of a plurality of feature points, and the contrast values of the pair of electrical signals and the degree of mutual agreement for each block based on the feature point extraction result of the feature extracting step. The phase for performing the correlation calculation based on the first calculation step for calculating The imaging lens includes a calculation step and a second calculation step for performing an interpolation calculation and a confidence value calculation for a portion having the highest correlation based on the correlation calculation result obtained by the correlation calculation step. Is output.
【0013】[0013]
【作用】本発明のカメラの焦点検出装置においては、撮
影レンズの異なる瞳部分を通過した被写体からの1対の
光束による1対の被写体像に基づいて、上記被写体に対
する撮影レンズの焦点調節状態を検出する焦点検出装置
であって、蓄積型の受光手段により上記1対の被写体像
が受光され、光電変換される。さらに、特徴抽出手段に
より上記受光手段からの1対の電気信号がそれぞれ所定
数のブロックに分割され、各ブロックごとの複数の特徴
点が抽出される。In the focus detection apparatus for a camera of the present invention, the focus adjustment state of the photographing lens for the subject is determined based on the pair of subject images formed by the pair of light beams from the subject that have passed through different pupil portions of the photographing lens. In the focus detecting device for detecting, the pair of subject images are received by photoelectric conversion means and photoelectrically converted. Further, the pair of electric signals from the light receiving unit is divided into a predetermined number of blocks by the feature extraction unit, and a plurality of feature points in each block are extracted.
【0014】そして、上記特徴抽出手段の出力に基づい
て、上記1対の電気信号のそれぞれのコントラスト値
と、相互の一致度とが第1の演算手段により上記ブロッ
クごとに演算され、第2の演算手段により上記一致度の
演算の結果と、最小値を与える複数のブロックに基づい
て相関演算が行われ、最も相関性の高い部分につき補間
演算と信頼値演算とが行われる。Then, based on the output of the feature extracting means, the contrast value of each of the pair of electric signals and the degree of coincidence with each other are calculated by the first calculating means for each block, and the second value is calculated. Correlation calculation is performed by the calculation means based on the calculation result of the degree of coincidence and a plurality of blocks giving the minimum value, and interpolation calculation and reliability value calculation are performed for the portion having the highest correlation.
【0015】[0015]
【実施例】以下、図面を参照して本発明の実施例を説明
する。図1は、本発明に係る実施例の焦点検出装置の特
徴とする信号処理部の構成を示すのブロック図である。Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a block diagram showing a configuration of a signal processing unit which is a feature of a focus detection apparatus according to an embodiment of the present invention.
【0016】この焦点検出装置は、装置全体の動作を制
御するCPU(Central Processing Unit ;CP
U)1と、このCPU1から指令を受けて焦点検出部の
回路各部の動作を制御する制御部2と、被写体からの光
束を受光して焦点検出を行うための信号を出力する焦点
検出部3から構成される。ここで、制御部2と焦点検出
部3は一つのセンサチップ上に形成される。This focus detection device is a CPU (Central Processing Unit; CP) for controlling the operation of the entire device.
U) 1, a control unit 2 that receives an instruction from the CPU 1 to control the operation of each circuit of the focus detection unit, and a focus detection unit 3 that receives a light beam from a subject and outputs a signal for focus detection. Composed of. Here, the control unit 2 and the focus detection unit 3 are formed on one sensor chip.
【0017】上記CPU1は、この焦点検出装置の動作
を制御し、同時に、焦点検出部3からの出力信号をアナ
ログ/デジタル(以下A/Dと記す)変換して演算処理
を行う。The CPU 1 controls the operation of the focus detecting device, and at the same time, performs analog / digital (hereinafter referred to as A / D) conversion of the output signal from the focus detecting section 3 to perform arithmetic processing.
【0018】上記CPU1は、制御部2へ、モニタ出力
電圧をサンプルホールドする信号MON、蓄積された電
荷をリセットする信号RES、電荷の蓄積を終了する信
号END、チップイネーブル信号CEN、保持された電
荷の読み出しを制御する信号READ、焦点検出信号の
利得を制御する信号GAINを出力する。上記制御部2
はこれら信号を受けて、焦点検出部3の回路各部の動作
を制御する。The CPU 1 sends to the control unit 2 a signal MON for sampling and holding the monitor output voltage, a signal RES for resetting the accumulated charges, a signal END for ending the accumulation of charges, a chip enable signal CEN, and the retained charges. A signal READ for controlling the reading of the signal and a signal GAIN for controlling the gain of the focus detection signal are output. The control unit 2
Receives these signals and controls the operation of each part of the circuit of the focus detection unit 3.
【0019】一対のラインセンサ4は、それぞれ被写体
からの光束を受光し像信号を出力する画素から成る受光
部4aと、上記ラインセンサ4の暗電流に相当する電流
を出力する遮光された画素から成る遮光部4bとから構
成される。なお、図1は簡略化のため、一対のラインセ
ンサ4を一つのブロックで示している。The pair of line sensors 4 are composed of a light receiving portion 4a which is composed of pixels which receive a light beam from a subject and outputs an image signal, and a light-shielded pixel which outputs a current corresponding to the dark current of the line sensor 4. And a light shielding portion 4b. For simplification, FIG. 1 shows the pair of line sensors 4 as one block.
【0020】上記受光部4aには上記像信号の出力の蓄
積状態をモニタするためのピーク検出部5aが接続さ
れ、また、上記遮光部4bにはピーク検出部5bが接続
されている。これらピーク検出部5a,5bによりピー
ク検出された出力は、引き算器6で両者の差が求めら
れ、サンプルホールド回路7を介して出力部8へ導かれ
る。A peak detector 5a for monitoring the accumulation state of the output of the image signal is connected to the light receiving portion 4a, and a peak detector 5b is connected to the light shielding portion 4b. The subtracter 6 obtains the difference between the peak-detected outputs of the peak detectors 5a and 5b, and the output is guided to the output unit 8 through the sample-hold circuit 7.
【0021】また、受光部4aは被写体の明るさに応じ
て、自動的に高感度または低感度に切り換わるような構
成になっている。(なお、この切り換えは不図示の感度
切り換え制御部の制御により、被写体の明るさに応じて
自動的に行われる。)そして、制御部2はCPU1から
の信号ENDに応じて、スイッチ部9a、9bを切り換
える。この切り換えは、上記蓄積状態をモニタするとき
にはスイッチ部9aから出力されるように切り換えら
れ、CPU1のA/D変換入力部へ出力されるようにす
る。一方、上記制御により蓄積が信号ENDにより終了
すると、スイッチ部9bから出力されるように切り換え
られ、後述するAF信号出力が測距出力AFDATAと
してCPU1のA/D変換入力部へ出力されるようにす
る。Further, the light receiving section 4a is constructed so as to automatically switch between high sensitivity and low sensitivity according to the brightness of the subject. (Note that this switching is automatically performed according to the brightness of the subject under the control of the sensitivity switching control unit (not shown).) Then, the control unit 2 responds to the signal END from the CPU 1 to switch unit 9a, 9b is switched. This switching is switched so that it is output from the switch unit 9a when monitoring the accumulation state, and is output to the A / D conversion input unit of the CPU 1. On the other hand, when the accumulation is completed by the signal END under the above control, the switch section 9b is switched to output and the AF signal output described later is output as the distance measurement output AFDATA to the A / D conversion input section of the CPU 1. To do.
【0022】また、上記受光部4aは、制御部2がCP
U1からの信号RESを受信するのに応じて初期化さ
れ、蓄積を開始する。受光部4aが所定量の電荷を蓄積
すると、受光部4aの各画素に蓄積された電荷は蓄積終
了の信号ENDに応じて、読み出し部10に送られる。
なお、受光部4aからの蓄積電荷の読み出しは、一対の
ラインセンサ4のうち基準部としての一方のラインセン
サと、参照部としての他方のラインセンサとが交互に行
われる。さらに、制御部2はCPU1からの信号REA
Dに応じて、シフトレジスタ11により上記読み出し部
10に保持された電荷を順次読み出す。Further, in the light receiving section 4a, the control section 2 controls the CP.
It is initialized in response to receiving the signal RES from U1 and starts accumulation. When the light receiving section 4a accumulates a predetermined amount of electric charge, the electric charge accumulated in each pixel of the light receiving section 4a is sent to the reading section 10 in response to the accumulation end signal END.
The reading of the accumulated charge from the light receiving unit 4a is performed alternately by one of the pair of line sensors 4 as a standard unit and the other line sensor as a reference unit. Further, the control unit 2 receives the signal REA from the CPU 1.
In accordance with D, the shift register 11 sequentially reads the charges held in the reading section 10.
【0023】読み出された信号は、予め設定された増幅
率に基づいて増幅部12で所定の大きさの信号に増幅さ
れた後、引き算器13で受光部4aの信号から遮光部4
bの信号分が差し引かれ、AF信号出力となる。The read signal is amplified by the amplifier 12 into a signal of a predetermined magnitude based on a preset amplification factor, and then subtracted by the subtractor 13 from the signal of the light receiver 4a to the light shield unit 4.
The signal for b is subtracted and the AF signal is output.
【0024】図2は、上記ラインセンサ4で得られた信
号から、基準部のラインセンサである基準列21Lと参
照部のラインセンサである参照列21R上に形成された
2像の間隔を計算する方法を説明するための図である。In FIG. 2, the distance between the two images formed on the standard row 21L, which is the line sensor of the reference section, and the reference row 21R, which is the line sensor of the reference section, is calculated from the signal obtained by the line sensor 4. It is a figure for explaining the method of doing.
【0025】基準列21L及び参照列21Rに形成され
る2像は、合焦時にそれぞれラインセンサ4上のほぼ中
央の位置に結像するように配置され、ラインセンサ4の
前方で結像する状態になると内側へ、ラインセンサ4の
後方で結像する状態になると外側へそれぞれ反対方向へ
同じ大きさだけ移動(シフト)するようになっている。
すなわち、フィルム面の合焦の程度に対して、所定の関
係で移動(シフト)する。The two images formed in the standard row 21L and the reference row 21R are arranged so as to form images at substantially central positions on the line sensor 4 when focused, and are formed in front of the line sensor 4. In this case, the image is moved (shifted) to the inside by the same amount in the opposite direction when the image is formed behind the line sensor 4.
That is, it moves (shifts) in a predetermined relationship with respect to the degree of focusing on the film surface.
【0026】ここで、本実施例において2像のシフト量
を求める手法を以下に説明する。フィルム面上で視野に
相当する大きさを視野Vとする。基準列21L側のシフ
トは、基準列21Lの左端の位置Sastartから、
視野Vが右端に達する位置で視野V内左端の点が位置S
astopまで、ステップdでシフトする。ステップd
でシフトするのは、後述する視野V内の特徴点検出を毎
回行うよりも簡単に行えるという利点がある。本実施例
ではステップd=3とする。Now, a method for obtaining the shift amounts of the two images in this embodiment will be described below. A size corresponding to the visual field on the film surface is defined as a visual field V. The shift on the reference column 21L side starts from the position Sastart at the left end of the reference column 21L.
At the position where the visual field V reaches the right end, the leftmost point in the visual field V is the position S
Shift in step d until astop. Step d
Shifting with has an advantage that feature point detection within the visual field V described later can be performed more easily than each time. In this embodiment, step d = 3.
【0027】これに対し、参照列21R側のシフトは、
上記基準列21Lの各位置に対応する位置でシフトして
いく。ここで、基準列21Lのステップ数dに対応する
参照列21Rの位置は、ステップdだけ基準列21Lと
は逆方向にずれる。よって、基準列21Lの1ステップ
に対し、参照列21Rは、基準列21Lに対応する位置
から+3、−2まで−1ステップでシフトを行う。これ
を繰り返し行い、2像の一致度を検出する。この一致度
から2像の間隔を計算する図3は、本実施例の焦点検出
装置の光学系の構成を示す図である。On the other hand, the shift on the reference row 21R side is
Shifting is performed at positions corresponding to the respective positions of the reference row 21L. Here, the position of the reference row 21R corresponding to the step number d of the standard row 21L is shifted in the opposite direction from the standard row 21L by the step d. Therefore, with respect to one step of the standard column 21L, the reference column 21R shifts from the position corresponding to the standard column 21L to +3 and -2 in -1 step. This is repeated to detect the degree of coincidence between the two images. FIG. 3 that calculates the distance between the two images from the degree of coincidence is a diagram showing the configuration of the optical system of the focus detection apparatus of this embodiment.
【0028】撮影レンズ30の異なる瞳を通過した光束
は、1次結像面付近に設けられた視野絞り31、コンデ
ンサレンズ32を通り、絞りマスク33により、2像を
形成する2つの光束に分けられる。その後、この2つの
光束は、セパレータレンズ34を通って、センサ35に
設けられたラインセンサ4上に再結像する。1次結像面
での光軸方向の像のぼけは、ラインセンサ4上では光軸
と直交する方向の移動で表れ、この2像の間隔から合焦
状態を検出する。A light beam passing through different pupils of the taking lens 30 passes through a field stop 31 and a condenser lens 32 provided in the vicinity of the primary image forming plane, and is divided by a stop mask 33 into two light beams forming two images. To be After that, the two light fluxes pass through the separator lens 34 and are re-imaged on the line sensor 4 provided in the sensor 35. The blur of the image in the optical axis direction on the primary image forming surface appears on the line sensor 4 by the movement in the direction orthogonal to the optical axis, and the focused state is detected from the interval between the two images.
【0029】次に、本発明に係る実施例の焦点検出装置
の特徴とする信号処理部の動作について説明する。図
4,図5は、実施例の焦点検出装置の特徴とする信号処
理部のCPU1の処理を示すフローチャートである。Next, the operation of the signal processing unit, which is a feature of the focus detection apparatus according to the embodiment of the present invention, will be described. 4 and 5 are flowcharts showing the processing of the CPU 1 of the signal processing unit which is a feature of the focus detection apparatus of the embodiment.
【0030】データ読み込み後、以下の各変数を初期化
する(ステップS1)。まず、Cmin1=50、Cm
in2=7、Cmin=Cmin1、LX=0、LN=
255とする。また、C(CK,L)=0のうち、CK
=0〜23,L=0〜3とする。さらに、min(L)
=255のうち、L=0〜3とする。After reading the data, the following variables are initialized (step S1). First, Cmin1 = 50, Cm
in2 = 7, Cmin = Cmin1, LX = 0, LN =
It is set to 255. Also, of C (CK, L) = 0, CK
= 0 to 23 and L = 0 to 3. Furthermore, min (L)
= 255 out of 255.
【0031】次に、基準列21L側の画素全部から次
式、 LX=max{128−d(i+3)+d(i)} LN=min{128−d(i+3)+d(i)} で差分処理を行い、LX及びLNを算出する。ここで、
iは基準列21L側の信号数を表す(ステップS2)。Next, the difference processing is performed from all the pixels on the side of the reference column 21L by the following equation, LX = max {128-d (i + 3) + d (i)} LN = min {128-d (i + 3) + d (i)}. And calculate LX and LN. here,
i represents the number of signals on the reference column 21L side (step S2).
【0032】次に、CPU1は、LX−LN<Cmin
2+5の条件を満たすか否かを判定する(ステップS
3)。ここで、LX−LN<Cmin2+5の条件を満
たすとき、差分処理を行うと信号がローコントラスト化
し、検出演算上、演算結果が信頼できないものとなる。
よって、LX−LN<Cmin2+5の条件を満たさな
いときに限り、信号データに前処理を行う。Next, the CPU 1 sets LX-LN <Cmin.
It is determined whether the condition of 2 + 5 is satisfied (step S
3). Here, when the condition of LX-LN <Cmin2 + 5 is satisfied, the signal becomes low contrast when the difference processing is performed, and the calculation result becomes unreliable in the detection calculation.
Therefore, the signal data is preprocessed only when the condition of LX-LN <Cmin2 + 5 is not satisfied.
【0033】上記前処理は、まず、3画素加算による平
均処理である d(i)=int[{d(i−1)+d(i)+d(i
+1)}/3] によって、高周波の雑音を平滑化する(ステップS
4)。The above-mentioned preprocessing is an averaging processing by adding three pixels. D (i) = int [{d (i-1) + d (i) + d (i
+1)} / 3] to smooth high-frequency noise (step S
4).
【0034】次に、3画素間の差分処理である d(i)=128−d(i+3)+d(i) をステップS4にて平均処理したデータに対し行い、低
周波の雑音を除去する(ステップS5)。Next, d (i) = 128-d (i + 3) + d (i), which is a difference process between three pixels, is performed on the data averaged in step S4 to remove low frequency noise ( Step S5).
【0035】これら前処理の後、基準列21L側の視野
Vの移動を行うループカウンタSaをSa=Sasta
rtとする(ステップS6)。そして、基準列21L側
の視野V内を4つのブロックに分け、各ブロックの位置
の移動を行うループカウンタLをL=0(左端のブロッ
クを指す)とする(ステップS7)。After these pre-processes, the loop counter Sa for moving the visual field V on the reference row 21L side is set to Sa = Sasta.
rt (step S6). Then, the visual field V on the reference row 21L side is divided into four blocks, and the loop counter L for moving the position of each block is set to L = 0 (indicating the leftmost block) (step S7).
【0036】次に、CPU1はCmin=Cmin2
で、かつ、各ブロック内のCmin2でのコントラスト
判定フラグC(CK,L)が“1”か否かを判定する
(ステップS8)。この条件を満たさないときは、各ブ
ロック内の信号のうちから最大値の位置mx(L)と最
小値の位置mn(L)を検出するとともに、その最大値
と最小値を求める(ステップS9)。Next, the CPU 1 uses Cmin = Cmin2
Then, it is determined whether or not the contrast determination flag C (CK, L) at Cmin2 in each block is "1" (step S8). When this condition is not satisfied, the maximum value position mx (L) and the minimum value position mn (L) are detected from the signals in each block, and the maximum value and the minimum value are obtained (step S9). .
【0037】続いて、コントラスト判定を行う。このと
き、コントラストは2段階で判定を行い、ブロック内の
‘最大値−最小値’をSinnとして、以下の条件でコ
ントラスト判定を行う。ここで、本実施例ではステップ
S2にて設定したように判定値をCmin1=50,C
min2=7とする。Then, the contrast is determined. At this time, the contrast is determined in two stages, and the “maximum value-minimum value” in the block is set to Sinn, and the contrast determination is performed under the following conditions. Here, in this embodiment, the determination value is set to Cmin1 = 50, C as set in step S2.
Let min2 = 7.
【0038】まず、Sinn<Cmin2の条件を満た
すか否かを判定する(ステップS10)。Sinn<C
min2の条件を満たすときは、ステップS16へ飛
び、次のブロックの検出に移るために、L=L+1とす
る。一方、Sinn<Cmin2の条件を満たさないと
きは、ステップS11へ移行し、Sinn<Cmin1
の条件を満たすか否かを判定する。Sinn<Cmin
1の条件を満たすときは、すなわち、Cmin2≦Si
nn<Cmin1の条件を満たすときは、コントラスト
判定フラグC(CK,L)を“1”とし(ステップS1
3)、そのときの最大値と最小値の位置である、mx
(CK,L)=mxと、mn(CK,L)=mnを記憶
し(ステップS14)、ステップS16へ移行する。こ
こで、CKは基準列21Lのシフト位置、Lはブロック
の位置、mxは最大値の位置、mnは最小値の位置であ
ることを表す。First, it is determined whether or not the condition of Sinn <Cmin2 is satisfied (step S10). Sinn <C
When the condition of min2 is satisfied, the process jumps to step S16 and L = L + 1 is set in order to detect the next block. On the other hand, if the condition of Sinn <Cmin2 is not satisfied, the process proceeds to step S11, and Sinn <Cmin1.
It is determined whether or not the condition of is satisfied. Sinn <Cmin
When the condition of 1 is satisfied, that is, Cmin2 ≦ Si
When the condition of nn <Cmin1 is satisfied, the contrast determination flag C (CK, L) is set to “1” (step S1).
3), the position of the maximum value and the minimum value at that time, mx
(CK, L) = mx and mn (CK, L) = mn are stored (step S14), and the process proceeds to step S16. Here, CK represents a shift position of the reference column 21L, L represents a block position, mx represents a maximum value position, and mn represents a minimum value position.
【0039】一方、Sinn<Cmin1の条件を満た
さないとき、すなわち、Sinn≧Cmin1のときは
コントラストが十分であると判断し、ステップS15へ
移行する。On the other hand, when the condition of Sinn <Cmin1 is not satisfied, that is, when Sinn ≧ Cmin1, it is determined that the contrast is sufficient, and the process proceeds to step S15.
【0040】また、上記ステップS8にて、Cmin=
Cmin2で、かつ、各ブロック内のCmin2でのコ
ントラスト判定フラグC(CK,L)が“1”の条件を
満たすとき、ステップS12へ移行し、後述する処理で
記憶されているブロック内の最大値の位置mx(L)と
最小値の位置mn(L)の値を読み出し(ステップS1
2)、ステップS15へ移行する。In step S8, Cmin =
When the contrast determination flag C (CK, L) in Cmin2 in each block satisfies the condition of "1", the process proceeds to step S12, and the maximum value in the block stored in the process described later is performed. Value mx (L) and the minimum value position mn (L) are read (step S1).
2) and shifts to step S15.
【0041】上記ステップS15では、ステップS9に
てコントラスト検出に用いたブロック内の最大値と最小
値の2点から、比較データmin(L)を計算する。こ
の比較データmin(L)は、上記2点の特徴を比較す
るために絶対値の比較量を2点の和から求め、変化分の
比較量を2点の差から求める。このときのブロックLの
最大値、最小値の位置とその大きさをそれぞれ、 [mx(Sa+LL+mx),d{mx(Sa+LL+
mx)}] [mn(Sa+LL+mn),d{mn(Sa+LL+
mn)}] とおき、 mL1=d{mx(Sa+LL+mx)}+d{mn
(Sa+LL+mn)} mL2=d{mx(Sa+LL+mx)}−d{mn
(Sa+LL+mn)} を計算する。ここで、LLはブロックLの先頭位置を与
え、LL=11×Lとなる。この位置にそれぞれ対応す
る参照列21Rの信号値を、 [mx(Sb+LL+mx),d{mx(Sb+LL+
mx)}] [mn(Sb+LL+mn),d{mn(Sb+LL+
mn)}] とおくと、上記基準列21Lに対応する参照列21Rの
比較データは、 mR1=d{mx(Sb+LL+mx)}+d{mn
(Sb+LL+mn)} mR2=d{mx(Sb+LL+mx)}−d{mn
(Sb+LL+mn)} で算出される。ここで、Sbは、上記基準列21L側の
ブロック先頭位置を表すSaに対応する参照列21R側
のブロック先頭位置である。In step S15, the comparison data min (L) is calculated from the maximum and minimum values in the block used for contrast detection in step S9. This comparison data min (L) is obtained by comparing the absolute value comparison amount from the sum of the two points and comparing the change amount from the difference between the two points in order to compare the features of the two points. At this time, the positions of the maximum value and the minimum value of the block L and their sizes are respectively [mx (Sa + LL + mx), d {mx (Sa + LL +
mx)}] [mn (Sa + LL + mn), d {mn (Sa + LL +
mn)}] and mL1 = d {mx (Sa + LL + mx)} + d {mn
(Sa + LL + mn)} mL2 = d {mx (Sa + LL + mx)}-d {mn
(Sa + LL + mn)} is calculated. Here, LL gives the head position of the block L, and LL = 11 × L. The signal value of the reference row 21R corresponding to each of the positions is [mx (Sb + LL + mx), d {mx (Sb + LL +
mx)}] [mn (Sb + LL + mn), d {mn (Sb + LL +
mn)}], the comparison data of the reference column 21R corresponding to the standard column 21L is: mR1 = d {mx (Sb + LL + mx)} + d {mn
(Sb + LL + mn)} mR2 = d {mx (Sb + LL + mx)}-d {mn
(Sb + LL + mn)}. Here, Sb is the block start position on the reference column 21R side corresponding to Sa, which represents the block start position on the standard column 21L side.
【0042】被写体が所定のずれ量のときには、上記基
準列21L,参照列21Rの各位置の信号の大きさはほ
ぼ等しい値となる。よって、その大きさを調べるために
各列ごとに求めた比較データの差を、 min(L)=|mL1−mR1|+|mL2−mR2
| から求め、さらに、ループ中の4つのブロックのmin
(L)のうち、最小値をmin(L)として記憶する。When the object has a predetermined shift amount, the magnitudes of the signals at the respective positions of the standard row 21L and the reference row 21R have substantially the same value. Therefore, the difference of the comparison data obtained for each column in order to check the size is expressed by min (L) = | mL1-mR1 | + | mL2-mR2
|, And the min of four blocks in the loop
Of (L), the minimum value is stored as min (L).
【0043】その後、L=L+1とし(ステップS1
6)、ステップS17へ移行する。ステップS17で
は、L≦3の条件を満たすか否かを判定する。ここで、
L≦3の条件を満たすときは、ステップS8へ戻り、ス
テップS8〜ステップS17までの処理を繰り返す。L
≦3の条件を満たさなくなったとき、ステップS18へ
移行する。すなわち、4つのブロック、全てに対して、
ステップS8〜ステップS17までの処理を繰り返し、
同様にmin(L)の計算を行う。After that, L = L + 1 is set (step S1
6) and shifts to step S17. In step S17, it is determined whether or not the condition of L ≦ 3 is satisfied. here,
When the condition of L ≦ 3 is satisfied, the process returns to step S8 and the processes of steps S8 to S17 are repeated. L
When the condition of ≦ 3 is not satisfied, the process proceeds to step S18. That is, for all four blocks,
Repeat the processing from step S8 to step S17,
Similarly, min (L) is calculated.
【0044】その後、CPU1はSaを+3ステップシ
フトし(ステップS18)、Sa≦Sastopの条件
を満たすか否かを判定する(ステップS19)。ここ
で、Sa≦Sastopの条件を満たすときは、ステッ
プS7へ戻り、ステップS7〜ステップS19までの処
理を繰り返す。Sa≦Sastopの条件を満たさなく
なったとき、ステップS20へ移行する。After that, the CPU 1 shifts Sa by +3 steps (step S18), and determines whether or not the condition of Sa≤Sastop is satisfied (step S19). Here, when the condition of Sa ≦ Sastop is satisfied, the process returns to step S7, and the processes from step S7 to step S19 are repeated. When the condition of Sa ≦ Sastop is not satisfied, the process proceeds to step S20.
【0045】各ブロックについての比較計算が終了する
と、ステップS20では、コントラスト判定フラグC
(CK,L)が1つでも“1”になっているか否かを判
定する。もし、コントラスト判定フラグC(CK,L)
が1つでも“1”になっていないときは、低コントラス
トと判断しステップS34へ分岐し、非合焦判定を行
う。When the comparison calculation for each block is completed, the contrast determination flag C is set in step S20.
It is determined whether or not even one (CK, L) is "1". If the contrast determination flag C (CK, L)
If even one is not "1", it is determined that the contrast is low, and the process branches to step S34 to perform the out-of-focus determination.
【0046】一方、コントラスト判定フラグC(CK,
L)が1つでも“1”になっているときは、コントラス
ト検出値のmin(L)が初期値255であるか否かを
判定する(ステップS21)。ここで、初期値255の
ままであるときは、Cmin1のコントラスト条件に達
していないため、ステップS15の処理は行われない。
このときは、Cmin=Cmin2とし(ステップS2
2)、ステップS6へ戻る。一方、min(L)が初期
値255でないときは、ステップS23へ移行する。On the other hand, the contrast determination flag C (CK,
If even one of L) is "1", it is determined whether or not min (L) of the contrast detection value is the initial value 255 (step S21). Here, when the initial value is still 255, the contrast condition of Cmin1 has not been reached, so the process of step S15 is not performed.
At this time, Cmin = Cmin2 (step S2
2) and returns to step S6. On the other hand, when min (L) is not the initial value 255, the process proceeds to step S23.
【0047】ステップS23では、各ブロックのmin
(L)の最小値のうち、最小の値と2番目に小さい値と
をそれぞれFi1,Fi2として検出する。続いて、後
述する図6で説明する手法にて、測距計算に用いる視野
のブロックを選択する(ステップS24)。At step S23, min of each block
Among the minimum values of (L), the minimum value and the second smallest value are detected as Fi1 and Fi2, respectively. Then, the block of the visual field used for distance measurement calculation is selected by the method described later with reference to FIG. 6 (step S24).
【0048】選択された視野内の全データを用いて以
下、真の最小値を計算する。上記ステップS24で選ば
れた視野のずれ量位置に対し、±2画素シフトした範囲
で基準列21L側と参照列21R側の信号データから以
下の式で相関演算を行う。ここで、±2画素シフトする
のはシフト計算を基準列21L側と参照列21R側とを
非対象に行うためであり、場合によっては先に求めた位
置が最小値となる位置ではない場合が生じる。よって、
その対策として隣の位置のmin(L)の大きさも見
る。相関演算の式には次の式を用いる。The true minimum value is calculated below using all the data in the selected field of view. With respect to the shift amount position of the visual field selected in step S24, the correlation calculation is performed by the following formula from the signal data on the standard column 21L side and the reference column 21R side within a range shifted by ± 2 pixels. Here, the ± 2 pixel shift is performed because the shift calculation is not performed on the standard column 21L side and the reference column 21R side, and in some cases, the previously obtained position may not be the minimum position. Occurs. Therefore,
As a countermeasure, the size of min (L) at the adjacent position is also checked. The following equation is used for the correlation calculation equation.
【0049】[0049]
【数1】 [Equation 1]
【0050】このうちの最小値をFmin、−1シフト
のときの値をFm、+1シフトのときの値をFpとお
く。さらに、基準列21L側の検出位置に対して±1画
素ずらした位置の自己相関の値をそれぞれFm1,Fp
1とおく。これらは、次式で表すことができる。It is assumed that the minimum value is Fmin, the value in the -1 shift is Fm, and the value in the +1 shift is Fp. Furthermore, the values of the autocorrelation at positions shifted by ± 1 pixel from the detection position on the reference row 21L side are Fm1 and Fp, respectively.
Set to 1. These can be expressed by the following equations.
【0051】[0051]
【数2】 [Equation 2]
【0052】[0052]
【数3】 (Equation 3)
【0053】[0053]
【数4】 [Equation 4]
【0054】[0054]
【数5】 (Equation 5)
【0055】これらの値から後述の手法で補間計算を行
い、最小値zrと、その値の信頼度を評価する信頼性係
数SKとを求める(ステップS25,S26)。次に、
CPU1はSK<SK0の条件を満たすか否かを判定す
る(ステップS28)。ここで、SK<SK0の条件を
満たすときは、信頼性があると判断し、ラインセンサ4
上のずれ量zrからフィルム面の光軸方向へのずれ量d
へ、以下の式にて変換し(ステップS29)、ステップ
S30へ移行する。Interpolation calculation is performed from these values by the method described later to obtain the minimum value zr and the reliability coefficient SK for evaluating the reliability of the value (steps S25 and S26). next,
The CPU 1 determines whether or not the condition of SK <SK0 is satisfied (step S28). Here, when the condition of SK <SK0 is satisfied, it is determined that there is reliability, and the line sensor 4
Deviation amount d from the upper deviation amount zr in the optical axis direction of the film surface
Is converted by the following equation (step S29), and the process proceeds to step S30.
【0056】d=b−(a×b)/(a+zr)+c×
zr、(a,b,cは係数) ステップS30では、合焦判定を行い、本処理を終了す
る。一方、ステップS28にて、SK<SK0の条件を
満たさないとき、すなわち、信頼性が低いと判断したと
きは、ステップS31へ移行し、Fi=Fi1が成り立
つか否かにより、視野選択の条件を判定する(ステップ
S31)。ここで、Fi=Fi1が成り立つときは、視
野をFi=Fi2とし(ステップS32)、この条件に
もとづいてステップS24へ戻り、視野のブロックを変
更する。D = b- (axb) / (a + zr) + cx
zr, (a, b, and c are coefficients) In step S30, focus determination is performed, and this processing ends. On the other hand, in step S28, when the condition of SK <SK0 is not satisfied, that is, when it is determined that the reliability is low, the process proceeds to step S31, and the view selection condition is set depending on whether Fi = Fi1 is satisfied. The determination is made (step S31). Here, when Fi = Fi1 is satisfied, the field of view is set to Fi = Fi2 (step S32), and based on this condition, the process returns to step S24 to change the field of view block.
【0057】また、Fi=Fi1が成り立たないとき
は、すでに、Fi2になっているとして、コントラスト
条件のCmin=Cmin1が成り立つか否かを判定す
る(ステップS33)。ここで、Cmin=Cmin1
が成り立たないとき、すなわち、Cmin=Cmin2
のときは非合焦判定を行い(ステップS34)、本処理
を終了する。一方、Cmin=Cmin1が成り立たつ
ときは、ステップS22へ戻り、Cmin=Cmin2
とし、ステップS6へ戻り、再度、上記ステップS6以
降の処理を行う。以上が焦点検出の処理の流れである。When Fi = Fi1 is not established, it is already set to Fi2, and it is determined whether or not the contrast condition Cmin = Cmin1 is established (step S33). Here, Cmin = Cmin1
Does not hold, that is, Cmin = Cmin2
In the case of, the out-of-focus determination is performed (step S34), and this processing ends. On the other hand, when Cmin = Cmin1 is satisfied, the process returns to step S22 and Cmin = Cmin2
Then, the process returns to step S6, and the processes after step S6 are performed again. The above is the flow of focus detection processing.
【0058】図6は、視野内のブロックを4分割して基
準列21L側のそれぞれのブロックの最大値、最小値
と、対応する参照列21R側の各位置の値との関係を表
した図である。FIG. 6 is a diagram showing the relationship between the maximum value and the minimum value of each block on the standard column 21L side and the value of each position on the corresponding reference column 21R side by dividing the block in the visual field into four. Is.
【0059】VL,VRは、それぞれ基準列21L側、
参照列21R側のずれ量に対応する位置の視野に相当す
るブロックの大きさを表す。また、BL0〜BL3,B
R0〜BR3は、視野を4分割したそれぞれのブロック
の位置を表す。各視野内の最大、最小値は基準列21L
側の各ブロックごとに求める。いま、各ブロックの最大
値と最小値の位置をそれぞれ、mx(L)、mn(L)
とおくと、上述のように例えば、左端のブロックについ
てみると、 mx(0)=Sa+mx0、mn(0)=Sa+mn0 、として記憶する。ここで、mx0は左端から最大値ま
でのブロックシフト分であり、mn0は左端から最小値
までのブロックシフト分を示す。他のブロックは、Sa
の位置からブロックシフト分をさらに加算して表す。VL and VR are on the reference column 21L side,
The size of the block corresponding to the visual field at the position corresponding to the shift amount on the reference row 21R side is shown. Also, BL0 to BL3, B
R0 to BR3 represent the position of each block obtained by dividing the visual field into four. The maximum and minimum values in each field of view are the reference row 21L
Calculate for each block on the side. Now, the positions of the maximum value and the minimum value of each block are mx (L) and mn (L), respectively.
In other words, as described above, for example, regarding the leftmost block, it is stored as mx (0) = Sa + mx0, mn (0) = Sa + mn0. Here, mx0 is a block shift amount from the left end to the maximum value, and mn0 is a block shift amount from the left end to the minimum value. The other blocks are Sa
The block shift amount is further added from the position of.
【0060】このとき、基準列21L側の位置に対応す
る参照列21R側の位置は、予めわかっているので、上
記各ブロックの最大値、最小値の位置に対応する参照列
21R側の位置における信号出力を選択する。2点だけ
であるが、大きさ、コントラスト差の情報ともに、最も
特徴を有する点である。なお、計算時間に余裕がある場
合は、さらに、ブロック内の差分最大値を表す点を追加
しても良い。この差分最大値は2点を追加しても良い
し、例えば、2画素離れた位置の差分最大値を求めると
きはその間にある1点を追加しても良い。すなわち、 d(i)=128−d(i+2)+d(i) の処理を行うとき、差分最大値が得られる位置を、 d(i)=d(i+1) とする。At this time, since the position on the reference row 21R side corresponding to the position on the base row 21L side is known in advance, the position on the reference row 21R side corresponding to the maximum value and minimum value positions of each block described above. Select the signal output. Although there are only two points, they are the most characteristic points in both the information on the size and the contrast difference. If the calculation time has a margin, a point representing the maximum difference value in the block may be added. Two points may be added to the maximum difference value, or, for example, when a maximum difference value at two pixels apart is obtained, one point between them may be added. That is, when the processing of d (i) = 128−d (i + 2) + d (i) is performed, the position where the maximum difference value is obtained is set as d (i) = d (i + 1).
【0061】これらの点は全てそのブロックの特徴を最
も表す点であり、ブロック内全ての点を用いなくても十
分な情報を得ることができる。コントラストの検出は基
準列21L側を3ステップづつシフトするため、シフト
ごとに見直さなければならない。しかし、最大、あるい
は、最小の点がシフト後の範囲にあるときはコントラス
ト条件は満たしており、よって、最大、最小判断を省略
しても良い。また、省略しない場合でも3画素分の比較
を新たに行えば済む。シフト後に最大、あるいは最小の
点がシフト範囲から外れるときは、もう一度ブロック内
全体で検出を行う。All of these points are the most representative points of the feature of the block, and sufficient information can be obtained without using all the points in the block. Contrast detection is shifted on the reference line 21L side by three steps, so it must be reviewed every shift. However, when the maximum or minimum point is in the range after the shift, the contrast condition is satisfied, so the maximum and minimum determination may be omitted. Even if not omitted, it is sufficient to newly compare three pixels. When the maximum or minimum point is out of the shift range after the shift, detection is performed again in the entire block.
【0062】図7は、図5のフローチャート中のステッ
プS24における視野のブロックの選択方法を示す図で
ある。シフト演算の結果、各ブロックごとに求められた
比較データmin(BL),BL=0〜3のうち、最小
値を与えるブロックFi1がBL=1または2のとき、
視野はBL=1とBL=2のブロックを選択する。ま
た、最小値を与えるブロックFi1がBL=0のとき、
視野はBL=0とBL=1のブロックを選択する。さら
に、最小値を与えるブロックFi1がBL=3のとき、
視野はBL=2とBL=3のブロックをそれぞれ選択す
る。FIG. 7 is a diagram showing a method of selecting a field block in step S24 in the flowchart of FIG. Of the comparison data min (BL), BL = 0 to 3 obtained for each block as a result of the shift operation, when the block Fi1 giving the minimum value is BL = 1 or 2,
The field of view selects blocks of BL = 1 and BL = 2. When the block Fi1 giving the minimum value is BL = 0,
For the field of view, select blocks of BL = 0 and BL = 1. Furthermore, when the block Fi1 giving the minimum value is BL = 3,
The field of view selects the blocks of BL = 2 and BL = 3, respectively.
【0063】また、2番目に小さい値のブロックFi2
が選ばれた場合において、Fi2がBL=1のとき、視
野はBL=0とBL=1のブロックを選択する。また、
Fi2がBL=2のとき、視野はBL=2,BL=3の
ブロックを選択する。さらに、Fi2がBL=0または
BL=3のとき、視野はBL=0とBL=3のブロック
を選択する。The block Fi2 having the second smallest value
When Fi2 is BL = 1, the field of view selects blocks of BL = 0 and BL = 1. Also,
When Fi2 is BL = 2, the field of view selects blocks of BL = 2 and BL = 3. Further, when Fi2 is BL = 0 or BL = 3, the field of view selects blocks of BL = 0 and BL = 3.
【0064】以上のようにして選ばれた各々2つのブロ
ックのうち、基準列21Lの小さい方のブロック番号、
参照列21Rの左端の画素番号を記憶すれば、相関演算
を行うときの画素の位置がわかる。Of the two blocks selected as described above, the smaller block number of the reference column 21L,
By storing the leftmost pixel number of the reference column 21R, the position of the pixel when performing the correlation calculation can be known.
【0065】図8は、図5のフローチャート中のステッ
プS26における補間計算の方法を示す図である。同図
に示すように、相関演算で得られた3点のFm,Fmi
n,Fpに対し、基準列21Lの自己相関から求められ
る傾きの直線が上記3点の最も近くを通る位置を選んだ
ときの変極点の位置を真の最小値として検出する。これ
は、元々誤差を含む演算結果に対し、最小2乗法で直線
を求める方法を利用している。FIG. 8 is a diagram showing a method of interpolation calculation in step S26 in the flowchart of FIG. As shown in the figure, Fm and Fmi of three points obtained by the correlation calculation
For n and Fp, the position of the inflection point when the position where the straight line of the slope obtained from the autocorrelation of the reference column 21L passes closest to the above-mentioned three points is selected as the true minimum value. This utilizes a method of obtaining a straight line by the least square method with respect to an operation result that originally includes an error.
【0066】Fm≦Fpのとき、 zr=zr0−(Fp1−2×Fm+Fmin+Fp)
/{2×(Fp1+Fm1)} Fm>Fpのとき、 zr=zr0+(Fm1−2×Fp+Fmin+Fm)
/{2×(Fp1+Fm1)} とから求められる。ここで、Fp1,Fm1は自己相関
で求められた値であり、zrは2像間隔、zr0は基準
とする2像間隔を表す。When Fm ≦ Fp, zr = zr0− (Fp1-2 × Fm + Fmin + Fp)
/ {2 × (Fp1 + Fm1)} When Fm> Fp, zr = zr0 + (Fm1-2 × Fp + Fmin + Fm)
/ {2 × (Fp1 + Fm1)} Here, Fp1 and Fm1 are values obtained by autocorrelation, zr represents a two-image interval, and zr0 represents a reference two-image interval.
【0067】また、信頼性係数SKは補間に用いる3点
のFmin,Fm,及び、Fpとを用いて、 Fm≦Fpのとき、SK=(Fmin+Fm)/(Fp
−Fmin) Fm>Fpのとき、SK=(Fmin+Fp)/(Fm
−Fmin) で計算する。Further, the reliability coefficient SK uses Fmin, Fm, and Fp at three points used for interpolation. When Fm ≦ Fp, SK = (Fmin + Fm) / (Fp
-Fmin) When Fm> Fp, SK = (Fmin + Fp) / (Fm
-Fmin).
【0068】以上説明したように本実施例によれば、多
数の画素の中から両端とその間の少ないデータを用いて
比較演算を行い、その結果から補間計算のための視野を
決めて、合焦位置を求めている。これにより、データ量
が多く、さらにずれ量も多い焦点検出系の演算が短時間
で行え、かつ、広視野内で起こる遠近競合の影響を受け
ず、円滑な合焦動作を行うことができる。As described above, according to this embodiment, the comparison operation is performed using a large number of pixels from both ends and a small amount of data between them, and the field of view for the interpolation calculation is determined from the result, and focusing is performed. Seeking position. As a result, the focus detection system with a large amount of data and a large amount of deviation can be calculated in a short time, and a smooth focusing operation can be performed without being affected by the perspective competition occurring in the wide field of view.
【0069】なお、本発明の上記実施態様によれば、以
下のごとき構成が得られる。 (1) 撮影レンズを通過した被写体からの光束に基づ
く第1、第2の光学像を光電変換する受光手段と、上記
受光手段からの出力信号に基づき被写体に対する撮影レ
ンズの焦点調節状態を求める処理手段と、を備えた位相
差式の焦点検出装置であって、上記第1の光学像の信号
を複数のブロックに分割し、ブロック内の所定画素信号
の中から特徴を有する画素を複数個検出して演算する第
1の演算手段と、上記第2の光学像の信号を複数のブロ
ックに分割し、上記第1の光学像のブロック位置に対応
する上記第2の光学像のブロックの画素信号から上記特
徴を有する複数の画素に対応する位置の画素を複数個検
出し、演算する第2の演算手段と、上記第1の演算手段
による演算結果と、上記第2の演算手段による演算結果
とを比較する比較手段と、上記比較手段の比較結果に基
づき上記第1の光学像の信号と第2の光学像の信号とに
ついて相関演算を行う相関演算手段と、を具備したこと
を特徴とする測距装置。 (2) 撮影レンズを通過した被写体からの光束に基づ
く第1、第2の光学像を光電変換する受光手段と、上記
受光手段からの出力信号に基づき被写体に対する撮影レ
ンズの焦点調節状態を求める処理手段と、を備えた位相
差式の焦点検出装置であって、上記第1の光学像の信号
を複数のブロックに分割し、ブロック内の所定画素信号
の中から特徴を有する画素を複数個検出して演算する第
1の演算手段と、上記第2の光学像の信号を複数のブロ
ックに分割し、上記第1の光学像のブロック位置に対応
する上記第2の光学像のブロックの画素信号から上記特
徴を有する複数の画素に対応する位置の画素を複数個検
出し、演算する第2の演算手段と、上記第1の演算手段
による演算結果と、上記第2の演算手段による演算結果
とを比較する比較手段と、上記比較手段の比較結果に基
づき視野を選択する視野選択手段と、上記視野選択手段
により選択された視野と、その視野の上記比較結果とに
基づき、上記第1の光学像の信号と第2の光学像の信号
とについて相関演算を行う相関演算手段と、を具備した
ことを特徴とする測距装置。 (3) 上記第1の演算手段による演算は、上記特徴を
有する複数の画素が所定の条件を満たすときに行われる
ことを特徴とする上記(1)または(2)に記載の測距
装置。 (4) 上記第1の演算手段による特徴抽出は、少なく
とも所定ブロックの信号中の最大値もしくは最小値を含
むことを特徴とする上記(1)または(2)に記載の測
距装置。 (5) 上記第1の演算手段による特徴抽出は、所定ブ
ロックの信号中の信号を前処理した信号からなることを
特徴とする上記(1)または(2)に記載の測距装置。 (6) 上記第1の演算手段を前処理するとき、その処
理を実行するか否かを上記第1の光学像の信号により判
断することを特徴とする上記(5)に記載の測距装置。 (7) 上記前処理は複数のフィルタ演算を組み合わせ
て処理することを特徴とする上記(5)に記載の測距装
置。According to the above embodiment of the present invention, the following configuration can be obtained. (1) Light receiving means for photoelectrically converting the first and second optical images based on the light flux from the subject that has passed through the taking lens, and processing for obtaining the focus adjustment state of the taking lens for the subject based on the output signal from the light receiving means A phase-difference-type focus detection device comprising: a means for dividing the signal of the first optical image into a plurality of blocks, and detecting a plurality of pixels having characteristics from a predetermined pixel signal in the block. And a pixel signal of the block of the second optical image corresponding to the block position of the first optical image by dividing the signal of the second optical image into a plurality of blocks. From a plurality of pixels at positions corresponding to a plurality of pixels having the above characteristics, the second arithmetic means for performing arithmetic operation, the arithmetic result by the first arithmetic means, and the arithmetic result by the second arithmetic means. Comparison hand to compare A distance measuring device comprising: a stage; and a correlation calculation unit that performs a correlation calculation on the signal of the first optical image and the signal of the second optical image based on the comparison result of the comparison unit. (2) Light receiving means for photoelectrically converting the first and second optical images based on the light flux from the subject that has passed through the taking lens, and processing for obtaining the focus adjustment state of the taking lens for the subject based on the output signal from the light receiving means. A phase-difference-type focus detection device comprising: a means for dividing the signal of the first optical image into a plurality of blocks, and detecting a plurality of characteristic pixels from a predetermined pixel signal in the block And a pixel signal of the block of the second optical image corresponding to the block position of the first optical image by dividing the signal of the second optical image into a plurality of blocks. From a plurality of pixels at positions corresponding to a plurality of pixels having the above characteristics, the second arithmetic means for performing arithmetic operation, the arithmetic result by the first arithmetic means, and the arithmetic result by the second arithmetic means. Comparison hand to compare A step, a field-of-view selection means for selecting a field of view based on the comparison result of the comparison means, a field of view selected by the field-of-view selection means, and a signal of the first optical image based on the comparison result of the field of view. A distance measuring device comprising: a correlation calculating unit that performs a correlation calculation with respect to the signal of the second optical image. (3) The distance measuring device according to (1) or (2), wherein the calculation by the first calculation means is performed when a plurality of pixels having the above characteristics satisfy a predetermined condition. (4) The distance measuring apparatus according to (1) or (2), wherein the feature extraction by the first computing means includes at least a maximum value or a minimum value in the signal of the predetermined block. (5) The distance measuring apparatus according to (1) or (2) above, wherein the feature extraction by the first computing means comprises a signal obtained by preprocessing a signal in a signal of a predetermined block. (6) When preprocessing the first arithmetic means, whether or not to execute the processing is determined based on the signal of the first optical image. The distance measuring apparatus according to (5) above. . (7) The distance measuring apparatus according to (5), wherein the pre-processing is performed by combining a plurality of filter calculations.
【0070】[0070]
【発明の効果】以上述べたように本発明によれば、被写
体の遠近混在の状態が起こり易い広視野での焦点検出に
おいても、焦点検出時の演算時間を短縮でき正確な焦点
検出が可能なカメラの焦点検出装置及びその焦点検出方
法を提供するができる。As described above, according to the present invention, even in the focus detection in a wide field of view in which the state where objects are distant and near are likely to occur, the calculation time for focus detection can be shortened and accurate focus detection can be performed. A focus detection device for a camera and a focus detection method thereof can be provided.
【図1】実施例の焦点検出装置の特徴とする信号処理部
の構成を示すのブロック図である。FIG. 1 is a block diagram showing a configuration of a signal processing unit that is a feature of a focus detection apparatus according to an embodiment.
【図2】ラインセンサ4で得られた信号から、基準部の
ラインセンサである基準列21Lと参照部のラインセン
サである参照列21R上に形成された2像の間隔を計算
する方法を説明するための図である。FIG. 2 illustrates a method of calculating a distance between two images formed on a standard row 21L which is a line sensor of a standard section and a reference row 21R which is a line sensor of a reference section from a signal obtained by a line sensor 4. FIG.
【図3】実施例の焦点検出装置の光学系の構成を示す図
である。FIG. 3 is a diagram showing a configuration of an optical system of a focus detection device according to an embodiment.
【図4】実施例の焦点検出装置の特徴とする信号処理部
のCPU1の処理を示すフローチャートである。FIG. 4 is a flowchart showing the processing of the CPU 1 of the signal processing unit, which is a feature of the focus detection apparatus of the embodiment.
【図5】実施例の焦点検出装置の特徴とする信号処理部
のCPU1の処理を示すフローチャートである。FIG. 5 is a flowchart showing the processing of the CPU 1 of the signal processing unit, which is a feature of the focus detection apparatus of the embodiment.
【図6】視野内のブロックを4分割して基準列21L側
のそれぞれのブロックの最大値、最小値と、対応する参
照列21R側の各位置の値との関係を表した図である。FIG. 6 is a diagram showing the relationship between the maximum value and the minimum value of each block on the standard column 21L side and the value of each position on the corresponding reference column 21R side by dividing the block in the visual field into four.
【図7】図5のフローチャート中のステップS24にお
ける視野のブロックの選択方法を示す図である。7 is a diagram showing a method of selecting a block of a visual field in step S24 in the flowchart of FIG.
【図8】図5のフローチャート中のステップS26にお
ける補間計算の方法を示す図である。8 is a diagram showing a method of interpolation calculation in step S26 in the flowchart of FIG.
1…CPU(Central Processing Unit ;CP
U)、2…制御部、3…焦点検出部、4…ラインセン
サ、4a…受光部、4b…遮光部、5a,5b…ピーク
検出部、6…引き算器、7…サンプルホールド回路、8
…出力部、9a,9b…スイッチ部、10…読み出し
部、11…シフトレジスタ、12…増幅部、13…引き
算器、21L…ラインセンサの基準列、21R…ライン
センサの参照列、30…撮影レンズ、31…視野絞り、
32…コンデンサレンズ、33…絞りマスク、34…セ
パレータレンズ、35…センサ。1 ... CPU (Central Processing Unit; CP)
U), 2 ... Control unit, 3 ... Focus detection unit, 4 ... Line sensor, 4a ... Light receiving unit, 4b ... Light shielding unit, 5a, 5b ... Peak detection unit, 6 ... Subtractor, 7 ... Sample hold circuit, 8
... output section, 9a, 9b ... switch section, 10 ... readout section, 11 ... shift register, 12 ... amplification section, 13 ... subtractor, 21L ... standard row of line sensor, 21R ... reference row of line sensor, 30 ... photography Lens, 31 ... Field stop,
32 ... Condenser lens, 33 ... Aperture mask, 34 ... Separator lens, 35 ... Sensor.
───────────────────────────────────────────────────── フロントページの続き (51)Int.Cl.6 識別記号 庁内整理番号 FI 技術表示箇所 G03B 3/00 A ─────────────────────────────────────────────────── ─── Continuation of the front page (51) Int.Cl. 6 Identification code Internal reference number FI Technical display location G03B 3/00 A
Claims (3)
写体からの1対の光束による1対の被写体像に基づい
て、上記被写体に対する撮影レンズの焦点調節状態を検
出する焦点検出装置において、 上記1対の被写体像を受光し、光電変換する蓄積型の受
光手段と、 上記受光手段からの1対の電気信号をそれぞれ所定数の
ブロックに分割し、各ブロックごとの複数の特徴点を抽
出する特徴抽出手段と、 上記特徴抽出手段の出力に基づいて、上記1対の電気信
号のそれぞれのコントラスト値と、相互の一致度とを上
記ブロックごとに演算する第1の演算手段と、 上記一致度の演算の結果と、最小値を与える複数のブロ
ックに基づいて相関演算を行い、最も相関性の高い部分
につき補間演算と信頼値演算とを行う第2の演算手段
と、 を具備したことを特徴とするカメラの焦点検出装置。1. A focus detection device for detecting a focus adjustment state of a photographing lens for a subject based on a pair of subject images formed by a pair of light fluxes from the subject that have passed through different pupil portions of the photographing lens. Storage type light receiving means for receiving and photoelectrically converting a pair of object images, and a pair of electric signals from the light receiving means are each divided into a predetermined number of blocks, and a plurality of characteristic points for each block are extracted. Extraction means, first calculation means for calculating, for each block, the respective contrast values of the pair of electric signals and the mutual matching degree based on the output of the feature extracting means; Second calculation means for performing a correlation calculation based on the calculation result and a plurality of blocks giving the minimum value and performing an interpolation calculation and a confidence value calculation for the portion having the highest correlation. Focus detecting device of a camera according to claim.
れぞれ該当ブロック内の信号の最大値及び最小値である
ことを特徴とする請求項1に記載のカメラの焦点検出装
置。2. The focus detection device for a camera according to claim 1, wherein the plurality of feature points for each block are a maximum value and a minimum value of a signal in the corresponding block, respectively.
写体からの1対の光束による1対の被写体像に基づい
て、撮影レンズの焦点調節状態を検出する焦点検出方法
において、 上記1対の被写体像を受光し、光電変換を行う受光ステ
ップと、 上記光電変換された1対の電気信号を、それぞれ所定数
のブロックに分割し、各ブロックごとの複数の特徴点を
抽出する特徴抽出ステップと、 上記特徴抽出ステップによる上記特徴点の抽出結果に基
づいて、上記1対の電気信号のそれぞれのコントラスト
値と、相互の一致度とを上記ブロックごとに演算する第
1の演算ステップと、 上記第1の演算ステップによる上記一致度の演算結果
と、最小値を与える複数のブロックに基づいて、相関演
算を行う相関演算ステップと、 上記相関演算ステップによる相関演算結果に基づいて、
最も相関性の高い部分につき補間演算と信頼値演算とを
行う第2の演算ステップと、 を具備し、これらの結果に基づいて撮影レンズの焦点調
節状態を出力することを特徴とするカメラの焦点検出方
法。3. A focus detection method for detecting a focus adjustment state of a photographing lens based on a pair of subject images formed by a pair of light fluxes from the subject that have passed through different pupil portions of the photographing lens, wherein the pair of subjects A step of receiving an image and performing photoelectric conversion, a step of dividing the photoelectrically converted pair of electric signals into a predetermined number of blocks, and extracting a plurality of characteristic points in each block, A first calculation step of calculating, for each block, the contrast value of each of the pair of electric signals and the degree of mutual agreement based on the extraction result of the characteristic points by the characteristic extraction step; The correlation calculation step of performing a correlation calculation based on the calculation result of the degree of coincidence by the calculation step and the plurality of blocks giving the minimum value, and the correlation calculation step. Based on the correlation calculation result,
A second calculation step for performing an interpolation calculation and a confidence value calculation for the portion having the highest correlation, and outputting a focus adjustment state of the photographing lens based on these results. Detection method.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP31186094A JPH08166535A (en) | 1994-12-15 | 1994-12-15 | Focus detector and focus detecting method for camera |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP31186094A JPH08166535A (en) | 1994-12-15 | 1994-12-15 | Focus detector and focus detecting method for camera |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH08166535A true JPH08166535A (en) | 1996-06-25 |
Family
ID=18022296
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP31186094A Pending JPH08166535A (en) | 1994-12-15 | 1994-12-15 | Focus detector and focus detecting method for camera |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH08166535A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2008009279A (en) * | 2006-06-30 | 2008-01-17 | Canon Inc | Focus detection apparatus, driving method thereof, and camera system |
-
1994
- 1994-12-15 JP JP31186094A patent/JPH08166535A/en active Pending
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2008009279A (en) * | 2006-06-30 | 2008-01-17 | Canon Inc | Focus detection apparatus, driving method thereof, and camera system |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP5167750B2 (en) | TRACKING DEVICE, IMAGING DEVICE, AND TRACKING METHOD | |
| US10638033B2 (en) | Focus control apparatus, focus control method and storage medium | |
| US8103158B2 (en) | Image sensing apparatus and control method thereof | |
| JP2010139563A (en) | Focus detector, focusing device, and imaging apparatus | |
| JPH10160410A (en) | Range finder | |
| JP3444551B2 (en) | Camera focus detection device | |
| JPWO2019202984A1 (en) | Imaging device and distance measurement method, distance measurement program and recording medium | |
| US6636699B2 (en) | Focus detection device and distance measurement device | |
| US11425297B2 (en) | Image capturing apparatus and control method thereof | |
| JPH08166535A (en) | Focus detector and focus detecting method for camera | |
| JP2011197690A (en) | Imaging device and control method therefor | |
| JP4799226B2 (en) | Imaging apparatus and control method thereof | |
| JP3414500B2 (en) | Focus detection device | |
| JP4967826B2 (en) | Focus detection apparatus and imaging apparatus | |
| JP3678438B2 (en) | Ranging device | |
| JPH0442207A (en) | Autofocusing device | |
| JP5761984B2 (en) | Imaging apparatus and control method thereof | |
| US6144451A (en) | Multiple points distance measuring apparatus | |
| JP2012103285A (en) | Focus detecting device and method for controlling the same | |
| JPH09127403A (en) | Automatic focus detector | |
| JPH085902A (en) | Focus detecting device | |
| JP2013218062A (en) | Focus detector | |
| JPH1114900A (en) | Focus detector for camera | |
| JP2000147363A (en) | Focus detection device | |
| JPH0561610B2 (en) |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20040127 |