JP2671489B2 - Focus detection device - Google Patents

Focus detection device

Info

Publication number
JP2671489B2
JP2671489B2 JP10089889A JP10089889A JP2671489B2 JP 2671489 B2 JP2671489 B2 JP 2671489B2 JP 10089889 A JP10089889 A JP 10089889A JP 10089889 A JP10089889 A JP 10089889A JP 2671489 B2 JP2671489 B2 JP 2671489B2
Authority
JP
Japan
Prior art keywords
focus detection
block
defocus amount
data
focus
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.)
Expired - Lifetime
Application number
JP10089889A
Other languages
Japanese (ja)
Other versions
JPH026916A (en
Inventor
徳治 石田
正隆 浜田
賢司 石橋
寿夫 糊田
浩 上田
宣之 沖須
Original Assignee
ミノルタ株式会社
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 ミノルタ株式会社 filed Critical ミノルタ株式会社
Priority to JP10089889A priority Critical patent/JP2671489B2/en
Publication of JPH026916A publication Critical patent/JPH026916A/en
Application granted granted Critical
Publication of JP2671489B2 publication Critical patent/JP2671489B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、被写体の光像を形成する結像光学系の焦点
調整状態を検出するカメラ等の光学装置の焦点検出装置
に関するものである。
Description: BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a focus detection device for an optical device such as a camera that detects a focus adjustment state of an imaging optical system that forms an optical image of a subject.

〔従来の技術〕[Conventional technology]

従来、被写体のほぼ同一部分に関する2つの光像を、
複数の光電変換素子の配列から成る一対の光電変換素子
アレイ上に導き、この光電変換素子アレイの出力を演算
して前記光電変換素子アレイ上の光像の相対的変位を検
出し、この検出結果から焦点を検出して撮影レンズの焦
点調整を行う自動焦点検出装置がある。
Conventionally, two light images of almost the same part of the subject are
Leading on a pair of photoelectric conversion element arrays consisting of an array of a plurality of photoelectric conversion elements, calculating the output of this photoelectric conversion element array to detect the relative displacement of the optical image on the photoelectric conversion element array, the detection result 2. Description of the Related Art There is an automatic focus detection device that detects the focus from the camera and adjusts the focus of a photographing lens.

また、この種の自動焦点検出装置として合焦範囲の幅
にヒステリシスを持たせ、撮影レンズの微振動を防止
し、安定した撮影を行うようにしたもの(特開昭59-340
6号公報)があるが、例えば被写体のコントラストが低
いと、被写体の焦点検出が不安定になり、動作が不安定
になることがある。
Further, as this type of automatic focus detection device, a width of the focusing range is provided with hysteresis to prevent slight vibration of the taking lens and to perform stable photographing (JP-A-59-340).
However, if the contrast of the subject is low, the focus detection of the subject becomes unstable and the operation may become unstable.

このような場合を考慮して、前回の検出結果が焦点検
出可能であったかどうかにより、検出の判定レベルを変
更して安定した焦点検出を行うようにしたものがある
(特開昭60-247210号公報)。
In consideration of such a case, there is a method in which a stable focus detection is performed by changing the determination level of the detection depending on whether or not the focus detection is possible in the previous detection result (JP-A-60-247210). Gazette).

〔発明が解決しようとする課題〕[Problems to be solved by the invention]

ところが、従来の自動焦点検出装置にあっては、判定
レベルの設定は1焦点検出ブロックのみで行っており、
該焦点検出ブロックで前回焦点検出ができなかった場合
には、被写体の焦点検出の判定が不安定になったりする
場合がある。
However, in the conventional automatic focus detection device, the determination level is set only in one focus detection block,
If the previous focus detection cannot be performed by the focus detection block, the focus detection determination of the subject may become unstable.

このため、安定した焦点検出ができなくなるといった
問題ある。
Therefore, there is a problem that stable focus detection cannot be performed.

本発明は、安定した焦点検出を行うことができる焦点
検出装置を提供することを目的とする。
An object of the present invention is to provide a focus detection device that can perform stable focus detection.

〔課題を解決するための手段〕[Means for solving the problem]

前記目的を達成するために、本発明は、焦点検出領域
に入射した被写体の光像に基づいて焦点状態を検出する
焦点検出装置において、前記焦点検出領域を分割した複
数の領域において、各領域毎に判定レベルを設定する判
定レベル設定手段と、前記各領域毎に、設定された判定
レベルと各領域のデータに基づいた演算結果とを比較す
ることにより焦点検出が可能か否かを判定する判定手段
と、前記判定結果を記憶する記憶手段と、記憶された前
回の判定結果に応じて前記判定レベルを変更する変更手
段とを備えたものである。
In order to achieve the above-mentioned object, the present invention is a focus detection device that detects a focus state based on an optical image of a subject incident on a focus detection region, in a plurality of regions obtained by dividing the focus detection region, for each region. A determination level setting means for setting a determination level, and a determination for each area to determine whether focus detection is possible by comparing the set determination level with a calculation result based on the data in each area. Means, storage means for storing the determination result, and changing means for changing the determination level according to the stored previous determination result.

また、請求項2では、前記焦点検出装置は、複数の光
電変換素子からなる受光素子列を備え、前記判定レベル
は隣接する光電変換素子のデータの差分を総和したコン
トラスト値に応じて変更されるようにした。
Further, in claim 2, the focus detection device includes a light receiving element array including a plurality of photoelectric conversion elements, and the determination level is changed according to a contrast value obtained by summing up differences of data of adjacent photoelectric conversion elements. I did it.

さらに、請求項3では、前記焦点検出装置は、入射し
た被写体の光像から得られた一対の光像を受光する複数
の光電変換素子からなる受光素子列を備え、前記判定レ
ベルは隣接する光電変換素子のデータの差分を総和した
コントラスト値と、前記一対の光像の相互比較により求
められる相関値の最良相関値との比に応じて変更される
ようにした。
Further, in claim 3, the focus detection device includes a light receiving element array including a plurality of photoelectric conversion elements that receive a pair of optical images obtained from an optical image of an incident subject, and the determination levels are adjacent to each other. The contrast value, which is the sum of the differences of the data of the conversion elements, and the best correlation value of the correlation values obtained by the mutual comparison of the pair of optical images are changed.

また、請求項4では、焦点検出動作の1回目のとき
は、焦点検出動作の2回目以降に前回焦点検出不能と判
定されるときよりも判定レベルを低レベルにした。
In the fourth aspect, the determination level at the first focus detection operation is set to a lower level than when the focus detection operation is determined to be impossible last time after the second focus detection operation.

(作用) 前記構成の焦点検出装置によれば、焦点検出領域は複
数の領域に分割され、それぞれの領域において焦点検出
のための演算等が行えるようになされていることを前提
として、各領域毎の判定レベルは前回判定結果に基づい
て変更され、各領域毎の判定レベルと同領域のデータに
基づいた演算結果とが比較され、焦点が検出可能か否か
の判定が行われる。
(Operation) According to the focus detection device having the above configuration, the focus detection area is divided into a plurality of areas, and it is premised that the calculation for focus detection and the like can be performed in each area. The determination level of is changed based on the previous determination result, and the determination level for each area is compared with the calculation result based on the data of the area to determine whether the focus can be detected.

また、判定レベルは、隣接する光電変換素子のデータ
の差分を総和したコントラスト値に応じて変更される。
Further, the determination level is changed according to the contrast value obtained by summing the differences between the data of the adjacent photoelectric conversion elements.

さらに、判定レベルは、隣接する光電変換素子のデー
タの差分を総和したコントラスト値と、前記一対の光像
の相互比較により求められる相関値の最良相関値との比
に応じても変更される。
Further, the determination level is also changed according to the ratio between the contrast value obtained by summing the differences between the data of the adjacent photoelectric conversion elements and the best correlation value of the correlation values obtained by the mutual comparison of the pair of optical images.

また、焦点検出動作の1回目のときは、2回目以降に
前回焦点検出不能と判定されるときよりも判定レベルが
緩和される。
Further, in the first focus detection operation, the determination level is relaxed after the second and subsequent times when it is determined that focus detection cannot be performed the previous time.

〔実施例〕〔Example〕

第1図は本発明に係る自動焦点検出装置を備えたカメ
ラの概略構成の一実施例を示す。自動焦点検出装置1は
撮影レンズ2と焦点検出手段3とデフォーカス量決定手
段4とレンズ位置検出手段5とレンズ駆動手段6と制御
手段7とから構成されている。この撮影レンズ2は被写
体8から発せられた光束9を焦点検出手段3に導くもの
である。焦点検出手段3は光電変換素子アレイ(図示せ
ず)を有し、この光電変換素子アレイの出力を演算処理
して光電変換素子アレイ上の被写体8による光像の相対
的変位を検出するものである。
FIG. 1 shows an embodiment of a schematic configuration of a camera provided with an automatic focus detection device according to the present invention. The automatic focus detecting device 1 includes a photographing lens 2, focus detecting means 3, defocus amount determining means 4, lens position detecting means 5, lens driving means 6, and control means 7. The photographing lens 2 guides a light beam 9 emitted from the subject 8 to the focus detecting means 3. The focus detection means 3 has a photoelectric conversion element array (not shown), and processes the output of this photoelectric conversion element array to detect the relative displacement of the optical image by the subject 8 on the photoelectric conversion element array. is there.

また、デフォーカス量決定手段4は前記焦点検出手段
3から出力される変位検出信号に基づいて撮影レンズ2
のデフォーカス量を決定するものである。レンズ位置検
出手段5は撮影レンズ2の現在の位置を検出するもので
ある。レンズ駆動手段6は前記デフォーカス量決定手段
4のデフォーカス量信号に基づいて撮影レンズ2を駆動
するものである。制御手段7は、前記デフォーカス量に
対応する位置に撮影レンズ2が駆動されるようにレンズ
駆動手段6を制御するとともに、前記焦点検出手段3か
ら合焦信号が出力されたとき、撮影レンズ2の駆動を停
止させるものである。
Further, the defocus amount determining means 4 determines whether the photographing lens 2 is based on the displacement detection signal output from the focus detecting means 3.
Is determined. The lens position detecting means 5 detects the current position of the taking lens 2. The lens driving unit 6 drives the photographing lens 2 based on the defocus amount signal of the defocus amount determining unit 4. The control means 7 controls the lens driving means 6 so that the photographing lens 2 is driven to a position corresponding to the defocus amount, and when the focus detection means 3 outputs a focusing signal, the photographing lens 2 Is stopped.

第2図は前記焦点検出手段3の機構構成の一実施例を
示す。焦点検出手段3は主ミラー10とサブミラー11と焦
点検出光学系12とから構成されている。この主ミラー10
は撮影レンズ2を通過した光束9を図示しないファイン
ダ光学系とサブミラー11とに分岐させるものである。サ
ブミラー11は主ミラー10で分岐された光束9を、さらに
焦点検出光学系12とフィルム面13とに分岐させるもので
ある。
FIG. 2 shows an embodiment of the mechanism configuration of the focus detecting means 3. The focus detecting means 3 includes a main mirror 10, a sub mirror 11, and a focus detecting optical system 12. This primary mirror 10
Is for branching the light beam 9 that has passed through the taking lens 2 into a finder optical system (not shown) and a sub-mirror 11. The sub-mirror 11 further splits the light beam 9 split by the main mirror 10 into a focus detection optical system 12 and a film surface 13.

前記焦点検出光学系12は光電変換素子アレイ141,142,
143とセパレータレンズ15と絞りマスク16とモジュール
ミラー17とコンデンサレンズ181,182,183と視野絞り19
とから構成されている。光電変換素子アレイ141,142,14
3は複数のCCD撮像素子等を配列したもので、セパレータ
レンズ15の焦点面14上のワンチップ上に形成されてい
る。セパレータレンズ15はセパレータレンズ対151,152,
153を有し、分岐された光束9を光電変換素子アレイ14
1,142,143に投影するものである。絞りマスク16は円形
あるいは長円形の開口部161,162,163を有し、セパレー
タレンズ15へ入力する光束9を限定するものである。モ
ジュールミラー17はコンデンサレンズ181,182,183を通
過した光束9をセパレータレンズ15へ導くものである。
視野絞り19は矩形開口部191,192,193を有するととも
に、焦点面近傍に配設され、焦点検出光学系12に入力さ
れる光束9の視野を限定するものである。
The focus detection optical system 12 is a photoelectric conversion element array 141, 142,
143, separator lens 15, aperture mask 16, module mirror 17, condenser lenses 181, 182, 183 and field stop 19
It is composed of Photoelectric conversion element arrays 141, 142, 14
Reference numeral 3 denotes an arrangement of a plurality of CCD image pickup devices and the like, which are formed on one chip on the focal plane 14 of the separator lens 15. The separator lens 15 is a separator lens pair 151, 152,
The photoelectric conversion element array 14 that has the branched light flux 9
1, 142, 143. The aperture mask 16 has circular or oblong openings 161, 162, and 163, and limits the light flux 9 input to the separator lens 15. The module mirror 17 guides the light beam 9 passing through the condenser lenses 181, 182, 183 to the separator lens 15.
The field stop 19 has rectangular openings 191, 192, and 193 and is disposed near the focal plane, and limits the field of view of the light beam 9 input to the focus detection optical system 12.

第3図は前記光電変換素子アレイ141,142,143の受光
部(以下、光電変換素子の受光部と蓄積部と転送部とを
含めてCCDという)を示している。この光電変換素子ア
レイ141は基準部141aと参照部141bと光電センサ141cと
からなり、同様に光電変換素子アレイ142は基準部142a
と参照部142bと光電センサ142cとからなり、光電変換素
子アレイ143は基準部143aと参照部143bと光電センサ143
cとからなる。前記光電センサ141c,142c,143cはそれぞ
れ基準部141a,142a,143aの一方の側部に長手方向に配設
され、受光量に応じた信号を出力するようになってい
る。そして、この受光量に応じた信号によりCCDの蓄積
部への蓄積時間を制御するようになっている。また、光
電変換素子アレイ141,142,143は、第4図に示すよう
に、ファインダ内の撮影画面20の中央部に位置する焦点
検出領域21,22,23(以下、それぞれ第1アイランド21,
第2アイランド22,第3アイランド23という)に投影さ
れる被写体8の光像に基づいて変位検出信号を出力する
ようになっている。
FIG. 3 shows a light receiving section of the photoelectric conversion element arrays 141, 142, 143 (hereinafter, referred to as a CCD including a light receiving section, a storage section, and a transfer section of the photoelectric conversion element). The photoelectric conversion element array 141 includes a reference part 141a, a reference part 141b, and a photoelectric sensor 141c. Similarly, the photoelectric conversion element array 142 includes a reference part 142a.
The photoelectric conversion element array 143 includes a reference portion 143a, a reference portion 143b, and a photoelectric sensor 143.
c. The photoelectric sensors 141c, 142c, and 143c are disposed on one side of the reference portions 141a, 142a, and 143a, respectively, in the longitudinal direction, and output signals according to the amount of received light. The accumulation time of the CCD in the accumulation unit is controlled by a signal corresponding to the amount of received light. As shown in FIG. 4, the photoelectric conversion element arrays 141, 142, and 143 are focus detection areas 21, 22, and 23 (hereinafter, referred to as first islands 21 and 22, respectively) located at the center of the photographing screen 20 in the viewfinder.
The displacement detection signal is output based on the light image of the subject 8 projected on the second island 22 and the third island 23).

撮影画面20の中央部に点線で示された領域24は撮影者
に焦点検出を行っている領域を表示するものである。ま
た、表示部25は合焦時に点灯するものである。
A region 24 indicated by a dotted line in the center of the photographing screen 20 displays a region where focus detection is performed for the photographer. The display unit 25 is turned on when focusing is performed.

前記基準部141a,142a,143aの各画素数X、および参照
部141b,142b,143bの各画素数Yは、例えば、第3図に示
すように、光電変換素子アレイ141および光電変換素子
アレイ143ではそれぞれ基準部の画素数Xは34個で、参
照部の画素数Yは44個で構成され、光電変換素子アレイ
142では基準部の画素数Xは44個で、参照部の画素数Y
は52個で構成されるようになっている。
The number of pixels X of the reference portions 141a, 142a, 143a and the number of pixels Y of the reference portions 141b, 142b, 143b are, for example, as shown in FIG. In this example, the number of pixels X in the reference portion is 34, and the number of pixels Y in the reference portion is 44.
In 142, the number of pixels X in the reference portion is 44 and the number of pixels Y in the reference portion is Y
Consists of 52 pieces.

また、自動焦点検出装置1では基準部141a,142a,143a
の各画素のデータを複数のブロックに分割し、この分割
した各ブロックをそれぞれの参照部141b,142b,143bの全
てのデータと比較して焦点検出を行う。そして、各ブロ
ックでの焦点検出結果のうち、最も後ピンのデータを前
記の各アイランド21,22,23の焦点検出データとし、さら
に各アイランド21,22,23の焦点検出データと撮影レンズ
2の撮影倍率のデータとに基づいて撮影レンズ2を駆動
し、合焦させている。
In the automatic focus detection device 1, the reference portions 141a, 142a, 143a
Is divided into a plurality of blocks, and each of the divided blocks is compared with all the data of the reference units 141b, 142b, and 143b to perform focus detection. Then, among the focus detection results in each block, the data of the rearmost pin is used as the focus detection data of each of the islands 21, 22, and 23, and the focus detection data of each of the islands 21, 22, and The photographing lens 2 is driven based on the data of the photographing magnification to bring the lens into focus.

次いで、前記光電変換素子アレイ141,142,143からデ
フォーカス量(すなわち、デフォーカス量とは結像光学
系の予定焦点面と被写体像面との光軸方向のずれ量)を
検出する範囲(デフォーカス範囲)を求める手段につい
て第5図〜第7図を用いて説明する。
Next, a range (a defocus range) for detecting the amount of defocus (that is, the amount of defocus in the optical axis direction between the planned focal plane of the imaging optical system and the object image plane) from the photoelectric conversion element arrays 141, 142, and 143. Will be described with reference to FIGS. 5 to 7.

第5図は第3図に示した各アイランド21,22,23に対応
する基準部141a,142a,143aの差分データ領域を拡大して
示したものである。同図において、各基準部141a,142a,
143aに示している数値は、第3図に示した基準部141a,1
42a,143aの各画素のデータをそれぞれ3つ置きに検出
し、それらの差をとった差分(すなわち、空間周波数成
分)のデータ数を示している。また、この差分データ
は、前記画素データから抽出(フィルムリング)された
特定の空間周波数の成分を示している(第1の空間周波
数成分抽出手段)。なお、差分データは2つ、または1
つ置きでもよい。ただし、前記空間周波数成分は3つ置
きにとったときと異なり、かつ、前記数値も異なる。
FIG. 5 is an enlarged view of the difference data area of the reference portions 141a, 142a, 143a corresponding to the islands 21, 22, 23 shown in FIG. In the figure, each of the reference portions 141a, 142a,
The numerical value shown in 143a is the reference part 141a, 1 shown in FIG.
Data for each pixel 42a and 143a is detected every third pixel, and the number of differences (that is, spatial frequency components) obtained by taking the difference between them is shown. Further, this difference data indicates a specific spatial frequency component extracted (film ring) from the pixel data (first spatial frequency component extraction means). The difference data is two or one.
It may be every other. However, the spatial frequency components are different from every third spatial frequency component, and the numerical values are also different.

各アイランド21,22,23の基準部141a,142a,143aにおけ
る前記数値は、第1アイランド21では30個、第2アイラ
ンド22では40個、第3アイランド23では30個になる。ま
た、参照部141b,142b,143bに対しても基準部141a,142a,
143aの差分データの数値と同様に求められる。つまり、
参照部141b,142b,143bの数値は、第1アイランド21では
40個、第2アイランド22では48個、第3アイランド23で
は40個になる。
The numerical values in the reference portions 141a, 142a, 143a of the islands 21, 22, 23 are 30 in the first island 21, 40 in the second island 22, and 30 in the third island 23. In addition, the reference parts 141a, 142a,
It is obtained in the same manner as the numerical value of the difference data of 143a. That is,
The numerical values of the reference portions 141b, 142b, 143b are
Forty, the second island 22 has 48, and the third island 23 has forty.

次に、各アイランド21,22,23でのブロック分割につい
て説明する。すなわち、第1アイランド21では、上端の
差分データからK1(1〜20)、K1(11〜30)の2つのブ
ロックに分け、それぞれ第1ブロックBL1、第2ブロッ
クBL2とする。第2アイランド22では、左端の差分デー
タからK2(1〜20)、K2(11〜30)、K2(21〜40)の3
つのブロックに分け、それぞれ第3ブロックBL3、第4
ブロックBL4、第5ブロックBL5とする。第3アイランド
23では、上端の差分データからK3(1〜20)、K3(11〜
30)の2つのブロックに分け、それぞれ第9ブロックBL
9、第10ブロックBL10とする。
Next, block division in each of the islands 21, 22, and 23 will be described. That is, the first island 21 is divided into two blocks, K1 (1 to 20) and K1 (11 to 30), from the difference data at the upper end, and sets them as a first block BL1 and a second block BL2, respectively. In the second island 22, three of K2 (1 to 20), K2 (11 to 30), and K2 (21 to 40) are obtained from the left end difference data.
Divided into three blocks, the third block BL3 and the fourth block, respectively.
Block BL4 and fifth block BL5. Third island
In 23, K3 (1-20), K3 (11-
30) divided into two blocks, and the ninth block BL
9, and the tenth block BL10.

さらに、第2アイランド22では、低周波成分でなる被
写体に合焦させるために抽出周波数を変えた差分データ
を検出し(第2の空間周波数成分抽出手段)、この差分
データを第6ブロックBL6、第7ブロックBL7および第8
ブロックBL8に分割して焦点検出データに用いる。すな
わち、基準部142aおよび参照部142bの各画素のデータ
を、例えば、それぞれ7つ置きに差分をとり、この差分
データの隣接間の和を求め、この和のデータを第6ブロ
ックBL6にする。すなわち、7つ置きの差分データの数
は、基準部142aでは36個、参照部142bでは44個になり、
第6ブロックBL6のデータ数は、基準部142aでは35個、
参照部142bでは43個になる。そして、この基準部142aの
35個の左側の25個を第7ブロックBL7とし、右側の25個
を第8ブロックBL8になる。
Further, the second island 22 detects difference data whose extraction frequency has been changed in order to focus on a subject composed of low-frequency components (second spatial frequency component extraction means), and converts the difference data into sixth block BL6, 7th block BL7 and 8th block
It is divided into blocks BL8 and used for focus detection data. That is, the data of each pixel of the reference unit 142a and the reference unit 142b is, for example, a difference is obtained every seven, and the sum of the difference data is obtained between adjacent data. The sum data is used as the sixth block BL6. That is, the number of difference data every seventh is 36 in the reference unit 142a and 44 in the reference unit 142b.
The number of data in the sixth block BL6 is 35 in the reference unit 142a,
In the reference part 142b, the number is 43. And this reference part 142a
The 25 blocks on the left side are the seventh block BL7, and the 25 blocks on the right side are the eighth block BL8.

なお、前述では差分の間隔を7つ置きにしたが、この
間隔は大きいほど低周波成分を抽出することができる。
つまり、差分の間隔を7つ置き以外の間隔にしてもよ
い。
In the above description, the intervals of the difference are set at seven intervals, but the larger the interval, the more low frequency components can be extracted.
That is, the intervals of the differences may be intervals other than every seven intervals.

この焦点検出手段では、基準部と参照部との光像が一
致したときの像間隔が所定の間隔よりも大きいときには
後ピン、小さいときには前ピン、所定の間隔では合焦と
なる。したがって、分割したブロックでのデフォーカス
範囲は各アイランド内で光学中心から離れたブロックほ
ど後ピン側を受け持つことになる。
In this focus detecting means, the rear focus is set when the image interval when the optical images of the reference portion and the reference portion match is larger than a predetermined interval, the front focus is set when the image interval is smaller than the predetermined interval, and the focus is set at the predetermined interval. Therefore, the defocus range in the divided blocks is such that the blocks farther from the optical center in each island cover the rear focus side.

第6図は第2アイランド22の基準部142aおよび参照部
142bの実際に使用するエリアを拡大して示しており、同
図を用いてブロック分けした第ブロックBL4のデフォー
カス範囲を説明する。つまり、基準部142aの第4ブロッ
クBL4の像と合焦するには、参照部142bの中央に位置す
るブロックBL41、すなわち参照部142bの左端より15番目
から34番目に位置する像のデータと第4ブロックBL4の
データK2(11〜30)とが一致するときである。そして、
これより像の一致が参照部142bの左側になると前ピンと
なり、前ピンの最大のずれデータ数(以下、ずれピッチ
という)は14個となる。一方、像の一致が参照部142bの
右側になると後ピンとなり、後ピンの最大のずれピッチ
は14個となる。
FIG. 6 shows the reference portion 142a and the reference portion of the second island 22.
The actually used area of 142b is enlarged and shown, and the defocus range of the block BL4 divided into blocks will be described with reference to FIG. That is, in order to focus on the image of the fourth block BL4 of the reference unit 142a, the data of the block BL41 located at the center of the reference unit 142b, that is, the data of the image located at the 15th to 34th positions from the left end of the reference unit 142b and This is when the data K2 (11 to 30) of the four blocks BL4 match. And
From this, when the image coincidence is on the left side of the reference portion 142b, it becomes the front pin, and the maximum displacement data number of the front pin (hereinafter referred to as displacement pitch) becomes 14. On the other hand, if the image coincides with the right side of the reference portion 142b, the rear focus is set, and the maximum shift pitch of the rear focus is 14 pieces.

また、第1アイランド21および第3アイランド23につ
いても同様である。すなわち、第7図に示すように、第
3ブロックBL3では、前ピン側ずれピッチが4個、後ピ
ン側ずれピッチが24個であり、第5ブロックBL5では、
前ピン側ずれピッチが24個、後ピン側ずれピッチが4個
である。また、第1ブロックBL1および第9ブロックBL9
では、前ピン側ずれピッチが5個、後ピン側ずれピッチ
が15個であり、第2ブロックBL2および第10ブロックBL1
0では、前ピン側ずれピッチが15個、後ピン側ずれピッ
チが5個である。さらに、第6ブロックBL6では、前ピ
ン側、後ピン側共にずれピッチが4個である。
The same applies to the first island 21 and the third island 23. That is, as shown in FIG. 7, in the third block BL3, the front pin side shift pitch is 4, and the rear pin side shift pitch is 24. In the fifth block BL5,
The front pin side shift pitch is 24, and the rear pin side shift pitch is 4. Further, the first block BL1 and the ninth block BL9
In the example, the front pin side shift pitch is 5 and the rear pin side shift pitch is 15, and the second block BL2 and the tenth block BL1
In the case of 0, the front pin side shift pitch is 15, and the rear pin side shift pitch is 5. Further, in the sixth block BL6, there are four shift pitches on both the front pin side and the rear pin side.

第7ブロックBL7では、前ピン側ずれピッチが4個、
後ピン側ずれピッチが14個であり、第8ブロックBL8で
は、前ピン側ずれピッチが14個、後ピン側ずれピッチが
4個となるが、第6ブロックBL6とずれピッチが重複す
るので、第7ブロックBL7では、後ピン側の4個〜14個
のずれピッチを、第8ブロックBL8では、前ピン側の4
個〜14個のずれピッチをデフォーカス範囲にする。
In the seventh block BL7, the front-pin-side shift pitch is four,
The rear pin side shift pitch is 14, and in the eighth block BL8, the front pin side shift pitch is 14, and the rear pin side shift pitch is 4, but since the shift pitch overlaps with the sixth block BL6, In the seventh block BL7, 4 to 14 shift pitches on the rear pin side are used.
The defocus range is set to the shift pitches of 14 to 14 pieces.

第8図は、本発明に係る自動焦点検出装置をマイコン
を用いて構成したカメラの回路ブロックの一実施例を示
す。
FIG. 8 shows an embodiment of a camera circuit block in which the automatic focus detection device according to the present invention is configured using a microcomputer.

中央制御回路(以下、マイコンという)26はカメラ全
体の制御し、露出等を演算するとともに、第1の空間周
波数成分を抽出し(一次フィルタ手段)、この抽出され
た空間周波数成分に基づいて焦点検出を行い(第1の焦
点検出手段)、さらに前記抽出された空間周波数成分に
基づいて第2の空間周波数成分を抽出し(二次フィルタ
手段)、この二次フィルタ手段で抽出された空間周波数
成分に基づいて焦点検出を行い(第2の焦点検出手
段)、前記第1の焦点検出手段で焦点検出不能と判定さ
れたときに前記二次フィルタ手段と第2の焦点検出手段
とを作動させる(判定手段)ものである。レンズ回路27
はカメラ本体(図示せず)に装着される撮影レンズ2
(交換レンズ)固有のデータをマイコン26に伝達するも
のである。焦点検出回路28は第1図の焦点検出手段3に
対応するもので、光電変換素子アレイのアナログ出力を
デジタル出力に変換してマイコン26に伝達するものであ
る。輝度検出回路29は撮影レンズ2を通過した光束9を
測定することにより被写体8の明るさを検出し、この明
るさに対応したアペックス値BV0をマイコン26に伝達す
るものである。フィルム感度読取回路30はフィルム(図
示せず)からフィルム感度を読取り、このフィルム感度
に対応したアペックス値SVをマイコン26に伝達するも
のである。
A central control circuit (hereinafter, referred to as a microcomputer) 26 controls the entire camera, calculates exposure and the like, extracts a first spatial frequency component (primary filter means), and focuses on the basis of the extracted spatial frequency component. Detection (first focus detection means), and further, a second spatial frequency component is extracted based on the extracted spatial frequency component (secondary filter means), and the spatial frequency extracted by the secondary filter means is extracted. Focus detection is performed based on the component (second focus detection means), and when the first focus detection means determines that the focus cannot be detected, the secondary filter means and the second focus detection means are operated. (Determination means). Lens circuit 27
Denotes a photographing lens 2 mounted on a camera body (not shown)
(Interchangeable lens) This is for transmitting data unique to the microcomputer 26. The focus detection circuit 28 corresponds to the focus detection means 3 in FIG. 1 and converts the analog output of the photoelectric conversion element array into a digital output and transmits it to the microcomputer 26. The brightness detection circuit 29 detects the brightness of the subject 8 by measuring the light flux 9 that has passed through the taking lens 2, and transmits the apex value BV0 corresponding to this brightness to the microcomputer 26. The film sensitivity reading circuit 30 reads the film sensitivity from a film (not shown) and transmits the apex value SV corresponding to the film sensitivity to the microcomputer 26.

表示回路31は露出情報および撮影レンズ2の焦点状態
を表示するものである。エンコーダ32はレンズ駆動モー
タ33の回転量を検出し、後述のレンズ駆動制御回路34に
レンズ駆動モータ33の所定の回転量に応じたパルス数を
出力するものである。レンズ駆動制御回路34はマイコン
26からモータ駆動方向の信号およびモータ停止信号を入
力し、これらの信号に基づいてレンズ駆動モータ33の駆
動を制御するものである。
The display circuit 31 displays the exposure information and the focus state of the taking lens 2. The encoder 32 detects the rotation amount of the lens drive motor 33 and outputs a pulse number corresponding to a predetermined rotation amount of the lens drive motor 33 to a lens drive control circuit 34 described later. The lens drive control circuit 34 is a microcomputer
The motor drive direction signal and the motor stop signal are input from 26, and the drive of the lens drive motor 33 is controlled based on these signals.

また、マイコン26の内部にはカウンタが備えられてい
る。このカウンタは、撮影レンズ2の無限遠位置からの
繰り出し位置を検出するもので、前記パルス数に対して
カウントアップあるいはカウントダウンするようになっ
ている。また、後述の電源スイッチ(メインスイッチ)
SW1がオンされ、さらに、撮影レンズ2が駆動されて撮
影レンズ2が無限遠位置に繰り込まれたときには、前記
カウンタはリセットされるようになっている。
Further, a counter is provided inside the microcomputer 26. This counter detects the extension position of the photographing lens 2 from the infinity position, and counts up or down with respect to the pulse number. In addition, a power switch (main switch) described later
SW 1 is turned on, further, when being driven taking lens 2 is the taking lens 2 has been retracted to the infinity position, the counter is adapted to be reset.

電源電池35はマイコン26および後述のスイッチ類に直
接電力を供給し、それら以外の回路には後述の給電回路
36を介して電力を供給するものである。給電回路36はマ
イコン26からの制御信号に基づいてレンズ回路27、焦点
検出データ出力回路28等の回路に電力を供給するもので
ある。
The power supply battery 35 directly supplies power to the microcomputer 26 and switches described later, and the other circuits include a power supply circuit described later.
The power is supplied via 36. The power supply circuit 36 supplies power to circuits such as the lens circuit 27 and the focus detection data output circuit 28 based on a control signal from the microcomputer 26.

電源スイッチSW1は開閉操作されることによりカメラ
の動作を開始あるいは停止させるものである。ワンショ
ット回路37は、前記電源スイッチSW1の開閉操作に連動
して所定のパルスを発生させ、このパルスをマイコン26
に入力するものである。撮影準備スイッチSW2はレリー
ズスイッチ(図示せず)の操作により開閉されるもの
で、この撮影準備スイッチSW2がオンすると、焦点検出
動作が開始されるようになっている。リミットスイッチ
SW3は、撮影レンズ2が無限遠位置に練り込まれたと
き、あるいは最先端まで繰り出されたときにオンするも
のである。選択スイッチSW4は、自動焦点調整モード
(以下、AFモードという)か、あるいは焦点検出表示モ
ード(以下、FAモードという)かを選択するもので、こ
の選択スイッチSW4をオンするとFAモードになり、オフ
するとAFモードになるものである。
Power switch SW 1 is intended to start or stop the operation of the camera by being opened and closed. One-shot circuit 37, in conjunction with the opening and closing of the power switch SW 1 generates a predetermined pulse, the pulse microcomputer 26
Is to be entered. Shooting preparation switch SW 2 is intended to be opened and closed by operation of the release switch (not shown), when the shooting preparation switch SW 2 is turned on, so that the focus detection operation is started. Limit switch
SW 3 is turned on when the taking lens 2 is kneaded to the infinity position or when it is extended to the leading edge. The selection switch SW 4 selects an automatic focus adjustment mode (hereinafter, referred to as AF mode) or a focus detection display mode (hereinafter, referred to as FA mode). When the selection switch SW 4 is turned on, the FA mode is set. When turned off, the camera enters AF mode.

次に、前記構成のカメラの動作について説明する。 Next, the operation of the camera having the above configuration will be described.

まず、電源スイッチSW1がオンされると、ワンショッ
ト回路37からマイコン26の割込入力端子INTOにパルスが
出力され、マイコン26は第9図に示した割り込み動作の
フローチャートを実行する。
First, the power switch SW 1 is once turned on, the one-shot circuit 37 outputs pulses to the interrupt input terminal INTO of the microcomputer 26, the microcomputer 26 executes the flowchart of the interrupt operation shown in FIG. 9.

すなわち、マイコン26は撮影準備スイッチSW2のオン
による焦点検出動作を禁止し(ステップ#1)、この割
り込み動作が電源スイッチSW1のオンによるものか、オ
フによるものかをマイコン26の割込入力端子IP1に入力
された電圧により判定する(ステップ#2)。そして、
この入力電圧がハイ電圧であれば、ステップ#3〜#11
の処置を行わずに、レンズ回路27等への電力を停止し、
マイコン26は動作待機状態になる(ステップ#12,#1
3)。この入力電圧がロー電圧であれば、電源スイッチS
W1はオン状態と判定し、マイコン26内のカウンタの動作
を禁止し(ステップ#3)、フローチャートの実行に使
用するフラグ、およびマイコン26の出力端子類を初期セ
ットする(ステップ#4)。
That is, the microcomputer 26 prohibits the focus detection operation by the on the shooting preparation switch SW 2 (step # 1), or not this interruption operation due to the on power switch SW 1, or by off interrupt input of the microcomputer 26 The determination is made based on the voltage input to the terminal IP1 (step # 2). And
If this input voltage is a high voltage, steps # 3 to # 11
Stopping the power to the lens circuit 27 etc. without performing the procedure of
The microcomputer 26 enters an operation standby state (steps # 12 and # 1).
3). If this input voltage is a low voltage, the power switch S
W 1 determines the ON state, and prohibits the operation of the counter in the microcomputer 26 (Step # 3), the flag to be used for execution of the flowchart, and initially sets the output terminal such microcomputer 26 (Step # 4).

次いで、マイコン26の出力端子OP1をハイ電圧にして
レンズ回路27等の回路に電力を供給する(ステップ#
5)。次に、レンズ駆動制御回路34に撮影レンズ2の繰
り込み信号が入力され、撮影レンズ2は無限遠位置の方
向に繰り込まれる(ステップ#6)。そして、撮影レン
ズ2が無限遠位置に繰り込まれ、リミットスイッチSW3
がオンするのを待つ(ステップ#7)。ステップ#7で
リミットスイッチSW3がオンすると、撮影レンズ2の駆
動を停止させる(ステップ#8)。また、これに伴っ
て、マイコン26内のカウンタをリセットし、レンズ駆動
モータ33の回転量に応じたパルス数をカウントする(ス
テップ#9,ステップ#10)。そして、撮影準備スイッチ
SW2のオンによる焦点検出動作の割り込みを許可する
(ステップ#11)。
Next, the output terminal OP1 of the microcomputer 26 is set to a high voltage to supply power to circuits such as the lens circuit 27 (step #
5). Next, the retraction signal of the photographing lens 2 is input to the lens drive control circuit 34, and the photographing lens 2 is retracted in the direction of the infinite position (step # 6). Then, the photographing lens 2 is retracted to the infinity position, and the limit switch SW 3
Is turned on (step # 7). When the limit switch SW 3 is turned on at step # 7, it stops the driving of the photographic lens 2 (step # 8). Along with this, the counter in the microcomputer 26 is reset and the number of pulses corresponding to the rotation amount of the lens drive motor 33 is counted (steps # 9, # 10). And shooting preparation switch
The interruption of the focus detection operation by turning on SW 2 is enabled (step # 11).

そして、出力端子OP1を口一電圧にしてレンズ回路27
等への電力を停止し、撮影準備スイッチSW2等が押され
るまで動作を待機させる(ステップ#12,#13)。
Then, the lens circuit 27
It stops power to such, to wait the operation to the photographing preparation switch SW 2 and the like is depressed (step # 12, # 13).

また、前記ステップ#13の動作待機状態のときに撮影
準備スイッチSW2がオンされると、マイコン26は第10図
に示した割り込み動作のフローチャートを実行する。
The photographing preparation switch SW 2 when the operation waiting state of the step # 13 when it is turned on, the microcomputer 26 executes the flowchart of the interrupt operation shown in FIG. 10.

すなわち、マイコン26はフローチャートの実行に使用
するフラグ、およびマイコン26の出力端子類を初期セッ
トする(ステップ#21)。さらに、マイコン26内の設け
られたタイマをリセットし、次いで、このタイマをスタ
ートさせる(ステップ#22)。そして、焦点調整動作の
1回目であることを示すフラグAFSFをセットし(ステッ
プ#23)、出力端子OP1をハイ電圧にしてレンズ回路27
等に電力を供給する(ステップ#24)。次に、撮影レン
ズ2の焦点距離データ、開放絞り値およびデフォーカス
量等からレンズ駆動のためのパルス数に変換する係数等
よりなるデータをレンズ回路27から入力する(ステップ
#25)。そして、焦点検出回路28のセンサを駆動させ
て、被写体光を積分させ、この画素データを取り込んで
記憶する(ステップ#26,#27)。次に、前述の各アイ
ランド21,22,23のデフォーカス量が演算され、さらに露
出演算が行われ、これらの演算結果が表示回路31に表示
される(ステップ#28〜#30)。
That is, the microcomputer 26 initially sets flags used for execution of the flowchart and output terminals of the microcomputer 26 (step # 21). Further, the timer provided in the microcomputer 26 is reset, and then this timer is started (step # 22). Then, a flag AFSF indicating that this is the first focus adjustment operation is set (step # 23), and the output terminal OP1 is set to a high voltage to set the lens circuit 27.
And the like (Step # 24). Next, data including a coefficient for converting the focal length data of the photographing lens 2, the open aperture value, the defocus amount, and the like into a pulse number for driving the lens is input from the lens circuit 27 (step # 25). Then, the sensor of the focus detection circuit 28 is driven to integrate the subject light, and this pixel data is captured and stored (steps # 26, # 27). Next, the defocus amount of each of the islands 21, 22, 23 described above is calculated, the exposure calculation is further performed, and the calculation results are displayed on the display circuit 31 (steps # 28 to # 30).

次に、FAモードか、AFモードかの判定を行い(ステッ
プ#31)、AFモードであれば、前記デフォーカス量から
撮影レンズ2の駆動量を算出し、これに基づいて撮影レ
ンズ2を駆動させる(ステップ#32)。一方、ステップ
#31でFAモードであれば、ステップ#32の処理を行わず
にステップ#34に移行する。ステップ#34では、撮影準
備スイッチSW2の開閉を判定する。そして、撮影準備ス
イッチSW2がオンであれば、フラグAFSFをリセットし
(ステップ#35)、ステップ#25に戻って、ステップ#
25からの処理を繰り返す。一方、ステップ#34で撮影準
備スイッチSW2がオフであれば、給電回路36をオフにし
てレンズ回路27等への電力を停止し(ステップ#36)、
撮影準備スイッチSW2等が押されるまで動作を待機させ
る(ステップ#37)。そして、撮影準備スイッチSW2
が押されると、第9図のフローチャートに移行する。
Next, it is determined whether the mode is the FA mode or the AF mode (step # 31). If the mode is the AF mode, the driving amount of the photographing lens 2 is calculated from the defocus amount, and the photographing lens 2 is driven based on the calculated amount. (Step # 32). On the other hand, if the mode is the FA mode in step # 31, the process proceeds to step # 34 without performing the process of step # 32. At step # 34, it determines the opening and closing of the shooting preparation switch SW 2. Then, if photographing preparation switch SW 2 is turned on, and resets the flag AFSF (step # 35), the process returns to step # 25, step #
Repeat the process from 25. On the other hand, if the shooting preparation switch SW 2 is turned off at step # 34, turns off the power supply circuit 36 stops power to the lens circuit 27 and the like (step # 36),
Shooting preparation switch SW 2 and the like to wait operation until pressed (step # 37). When the shooting preparation switch SW 2 and the like is depressed, the process proceeds to the flow chart of Figure 9.

次に、第10図のステップ#28に示した各アイランド2
1,22,23のデフォーカス量演算のサブルーチンについて
第11図〜第14図を用いて説明する。
Next, each island 2 shown in step # 28 of FIG.
A defocus amount calculation subroutine of 1, 22, 23 will be described with reference to FIGS. 11 to 14.

第11図は各アイランド21,22,23のデフォーカス量を第
1アイランド21(ステップ#41)、第2アイランド22
(ステップ#41)、第3アイランド23(ステップ#41)
の順に演算することを示し、第12図〜第14図は各アイラ
ンド21,22,23のデフォーカス量演算の具体的なフローチ
ャートを示している。
FIG. 11 shows the defocus amount of each of the islands 21, 22, and 23 as the first island 21 (step # 41) and the second island 22.
(Step # 41), Third Island 23 (Step # 41)
12 to 14 show a specific flowchart of the defocus amount calculation of each of the islands 21, 22, and 23.

第12図は第1アイランド21のデフォーカス量演算(ス
テップ#41)のサブルーチンを示している。この第1ア
イランド21は、前述のように、第1ブロックBL1、第2
ブロックBL2に分けられ、これら各ブロックBL1、BL2の
各デフォーカス量をそれぞれ記憶する変数DF1,DF2に所
定値“−K"を記憶させる(ステップ#51、#52)。この
所定値“−K"は各ブロックBL1、BL2では、取り得ないよ
うな前ピン状態の値であり、第1アイランド21で焦点検
出不能の場合(以下、ローコンという)のデフォーカス
量として出力される。
FIG. 12 shows a subroutine for calculating the defocus amount of the first island 21 (step # 41). As described above, the first island 21 includes the first block BL1 and the second block BL1.
A predetermined value "-K" is stored in variables DF1 and DF2 which are divided into blocks BL2 and store the respective defocus amounts of these blocks BL1 and BL2 (steps # 51 and # 52). This predetermined value “−K” is a value of a front focus state that cannot be obtained in each of the blocks BL1 and BL2, and is output as a defocus amount when focus detection cannot be performed on the first island 21 (hereinafter referred to as low contrast). You.

次に、第1アイランド21でローコンの状態を示すフラ
グLCF1をセットする(ステップ#53)。そして、第1ブ
ロックBL1の焦点状態(前ピン状態、後ピン状態、合焦
状態)の検出およびデフォーカス量DFを演算し(ステッ
プ#54)、この演算結果から焦点検出が可能であれば、
フラグLCF1をリセットし、求めたデフォーカス量DFを第
1ブロックBL1のデフォーカス量を記憶する変数DF1に記
憶させ(ステップ#55〜#57)、ステップ#58に移行す
る。
Next, the flag LCF1 indicating the state of the low contrast on the first island 21 is set (step # 53). Then, the focus state (front focus state, rear focus state, focus state) of the first block BL1 is detected and the defocus amount DF is calculated (step # 54). If focus detection is possible from this calculation result,
The flag LCF1 is reset, the obtained defocus amount DF is stored in the variable DF1 that stores the defocus amount of the first block BL1 (steps # 55 to # 57), and the process proceeds to step # 58.

一方、ステップ#55で焦点検出が不能と判定される
と、ステップ#56、#57の処理を行わずにステップ#58
に移行する。
On the other hand, if it is determined in step # 55 that focus detection cannot be performed, step # 58 is skipped without performing steps # 56 and # 57.
Move to

次に、第2ブロックBL2の焦点状態の検出およびデフ
ォーカス量DFを演算し(ステップ#58)、この演算結果
から焦点検出が不能であれば、フラグLCF1がセットされ
ているかどうかを判定する。そして、フラグLCF1がリセ
ットされているとき、すなわち、ステップ#55の判定に
おいて焦点検出が可能とされたときには、ステップ#62
に移行する。また、ステップ#60でフラグLCF1がセット
されているときは、第11図に示すステップ#42の第2ア
イランド22のデフォーカス量演算サブルーチン(第13
図)に移行する。
Next, the focus state of the second block BL2 is detected and the defocus amount DF is calculated (step # 58). If focus detection is impossible from the calculation result, it is determined whether the flag LCF1 is set. When the flag LCF1 is reset, that is, when the focus detection is enabled in the determination in step # 55, the process proceeds to step # 62.
Move to When the flag LCF1 is set in step # 60, the defocus amount calculation subroutine for the second island 22 in step # 42 shown in FIG.
(Figure).

一方、ステップ#59で焦点検出が可能と判定される
と、ステップ#60の処理を行わずに、ステップ#69でフ
ラグLCF1をリセットし、ステップ#70で、求めたデフォ
ーカス量をDF2に記憶させ、ステップ#62に移行する。
On the other hand, if it is determined in step # 59 that focus detection is possible, the process in step # 60 is not performed, the flag LCF1 is reset in step # 69, and the calculated defocus amount is stored in DF2 in step # 70. Then, the process proceeds to step # 62.

ステップ#62では、後述の平均処理ルーチンで使用す
るブロック間デフォーカス量(平均処理幅)ΔDFを決定
する。次いで、デフォーカス量DF1とデフォーカス量DF2
との大小を判定し、デフォーカス量の大きい方、すなわ
ち、撮影レンズ2(カメラ)に近い方の被写体のデフォ
ーカス量を第1アイランド21のデフォーカス量DFIS1と
する。つまり、デフォーカス量DF1がデフォーカス量DF2
よりも大きいときは、デフォーカス量DF1を第1アイラ
ンド21のデフォーカス量DFIS1とし、逆に、デフォーカ
ス量DF2がデフォーカス量DF1よりも大きいときは、デフ
ォーカス量DF2を第1アイランド21のデフォーカス量DFI
S1とする(ステップ#63〜#67)。
In step # 62, an inter-block defocus amount (average processing width) ΔDF used in an averaging processing routine described later is determined. Next, the defocus amount DF1 and the defocus amount DF2
The defocus amount of the subject closer to the photographing lens 2 (camera) is determined as the defocus amount DFIS1 of the first island 21. That is, the defocus amount DF1 is equal to the defocus amount DF2.
If the defocus amount DF1 is larger than the defocus amount DF2, the defocus amount DF2 is set to the defocus amount DFIS1 of the first island 21. Defocus amount DFI
S1 is set (steps # 63 to # 67).

また、ステップ#64,#65でデフォーカス量DF1とデフ
ォーカス量DF2との差が平均処理幅ΔDFよりも小さいと
きは、デフォーカス量DF1とデフォーカス量DF2との平均
を行い、この平均値と第1アイランド21のデフォーカス
量DFIS1とする(ステップ#68)。そして、ステップ#6
6,#67,#68の処理を終えると、第11図のステップ#42
に移行する。
When the difference between the defocus amount DF1 and the defocus amount DF2 is smaller than the average processing width ΔDF in steps # 64 and # 65, the defocus amount DF1 and the defocus amount DF2 are averaged, and the average value is calculated. And the defocus amount DFIS1 of the first island 21 (step # 68). And step # 6
After completing the processing of 6, # 67 and # 68, step # 42 in FIG.
Move to

第13図は第2アイランド22のデフォーカス量演算のサ
ブルーチンを示す。
FIG. 13 shows a subroutine for calculating the defocus amount of the second island 22.

まず、第3ブロックBL3、第4ブロックBL4、第5ブロ
ックBL5の各デフォーカス量をそれぞれ記憶する変数DF
3,DF4,DF5に所定値“−K"をそれぞれ設定させ(ステッ
プ#71〜#73)、第2アイランド22でのローコンの状態
を示すフラグLCF2をセットする(ステップ#74)。そし
て、各ブロックBL3,BL4,BL5の焦点状態の検出およびデ
フォーカス量DFを演算する(ステップ#75,#79,#8
3)。すなわち、ステップ#75による第3ブロックBL3の
デフォーカス量DFの演算結果から焦点検出が可能であれ
ば、フラグLCF2をリセットし、求めたデフォーカス量DF
を変数DF3に記憶させ(ステップ#76〜#78)、ステッ
プ#79に移行する。逆に、焦点検出が不能と判定される
と、ステップ#77,#78の処理を行わずにステップ#79
に移行する。
First, a variable DF for storing the defocus amount of each of the third block BL3, the fourth block BL4, and the fifth block BL5.
A predetermined value "-K" is set to 3, DF4 and DF5 (steps # 71 to # 73), and a flag LCF2 indicating the state of the low contrast on the second island 22 is set (step # 74). Then, the focus state detection and the defocus amount DF of each block BL3, BL4, BL5 are calculated (steps # 75, # 79, # 8).
3). That is, if the focus can be detected from the calculation result of the defocus amount DF of the third block BL3 in step # 75, the flag LCF2 is reset and the obtained defocus amount DF
Is stored in the variable DF3 (Steps # 76 to # 78), and the routine goes to Step # 79. Conversely, if it is determined that focus detection cannot be performed, the processing in steps # 77 and # 78 is not performed and step # 79 is performed.
Move to

第4ブロックBL4のデフォーカス量DFも同様に、ステ
ップ#79の演算結果から焦点検出が可能であれば、フラ
グLCF2をリセットし、デフォーカス量DFを変数DF4に記
憶させ(ステップ#80〜#82)、ステップ#83に移行す
る。逆に、焦点検出が不能と判定されると、ステップ#
81,#82の処理を行わずにステップ#83に移行する。
Similarly, for the defocus amount DF of the fourth block BL4, if the focus can be detected from the calculation result of step # 79, the flag LCF2 is reset, and the defocus amount DF is stored in the variable DF4 (steps # 80 to ##). 82), proceed to step # 83. Conversely, if it is determined that focus detection is impossible, step #
The process proceeds to step # 83 without performing the processes of 81 and # 82.

第5ブロックBL5のデフォーカス量DFも同様に、ステ
ップ#83の演算結果から焦点検出が可能であれば、フラ
グLCF2をリセットし、デフォーカス量DFを変数DF5に記
憶させ(ステップ#84〜#86)、ステップ#87に移行す
る。逆に、焦点検出が不能と判定されると、ステップ#
85,#86の処理を行わずにステップ#87に移行する。
Similarly, if the defocus amount DF of the fifth block BL5 can be detected from the calculation result of step # 83, the flag LCF2 is reset, and the defocus amount DF is stored in the variable DF5 (steps # 84 to # 84). 86), proceed to step # 87. Conversely, if it is determined that focus detection is impossible, step #
The process proceeds to step # 87 without performing the processes of 85 and # 86.

ステップ#87では、ローコンフラグLCF2がセットされ
ているかどうかを判定する。そして、フラグLCF2がセッ
トされていないとき、すなわち、ステップ#76,#80,#
84の判定においてそれぞれ焦点検出が可能とされたとき
には、後述の平均処理ルーチンで使用する平均処理幅Δ
DFを決定する(ステップ#88)。次いで、各ブロックBL
3,BL4,BL5の各デフォーカス量DF3,DF4,DF5の大小を判定
し、最も大きなデフォーカス量MAXDFを抽出する(ステ
ップ#89)。そして、デフォーカス量MAXDFとの差が平
均処理幅ΔDFよりも小さい他のブロックが存在しない場
合には、前記デフォーカス量MAXDFを第2アイランド22
のデフォーカス量DFIS2とし(ステップ#90,#91)、前
記差が平均処理幅ΔDFよりも小さい他のブロックが1つ
以上存在する場合には、前記デフォーカス量MAXDFと前
記差が平均処理幅ΔDFよりも小さい他のブロックのデフ
ォーカス量とだけで平均を行い(平均処理)、この平均
値を第2アイランド22のデフォーカス量DFIS2とする
(ステップ#92)。そして、ステップ#91,#92の処理
を終えると、第11図に示すステップ#43の第3アイラン
ド23のデフォーカス量演算サブルーチン(第14図)に移
行する。
In step # 87, it is determined whether or not the low contrast flag LCF2 is set. When the flag LCF2 is not set, that is, in steps # 76, # 80, #
When it is determined that the focus can be detected in each of the determinations in step 84, the average processing width Δ used in the averaging processing routine described below is used.
Determine the DF (step # 88). Next, each block BL
The magnitude of each of the defocus amounts DF3, DF4, DF5 of 3, BL4, BL5 is determined, and the largest defocus amount MAXDF is extracted (step # 89). If there is no other block whose difference from the defocus amount MAXDF is smaller than the average processing width ΔDF, the defocus amount MAXDF is set to the second island 22.
(Steps # 90 and # 91), and if there is at least one other block in which the difference is smaller than the average processing width ΔDF, the defocus amount MAXDF and the difference are the average processing width. Averaging is performed only with the defocus amounts of other blocks smaller than ΔDF (average processing), and the average value is used as the defocus amount DFIS2 of the second island 22 (step # 92). When the processes of steps # 91 and # 92 are completed, the process proceeds to the defocus amount calculation subroutine (FIG. 14) for the third island 23 in step # 43 shown in FIG.

また、ステップ#87でフラグLCF2がセットされている
と判定されたときには、低周波成分でなる被写体に合焦
させるために3つ置きの差分データを7つ置きの差分デ
ータに再編成する(ステップ#93)。すなわち、例え
ば、画素のデータをl1,l2,ln,…とすると、3つ置き
の差分データは、dDn=l1−l5,…,l5−l9,…,ln
n+4,…となる。また、7つ置きの差分データはdDm
1−l9,…,lm−lm+8,…となる。この7つ置きの差
分データはdDmは3つ置きの差分データdDnの和を3つ置
きに取ることにより求められる。つまり、7つ置きの差
分データは、 dDm=dD1+dD5,…,dDm+dDm+4,… =l1−l5+l5−l9,…,ln-4−ln+ln−l
n+4,… =l1−l9,…,ln-4−ln+4,… =l1−l9,…,lm−lm+8,… となる。ただし、n=m+4である。
When it is determined in step # 87 that the flag LCF2 is set, every third difference data is re-organized into every seventh difference data in order to focus on a subject having low frequency components (step # 87). # 93). That is, for example, if the pixel data is l 1 , l 2 , l n , ..., The difference data for every three pixels is dD n = l 1 -l 5 , ..., l 5 -l 9 , ..., l n
l n + 4 , ... Also, every 7th difference data is dD m =
l 1 −l 9 , ..., L m −l m + 8 ,. This every 7th difference data is obtained by taking the sum of every 3rd difference data dD n for every 3rd dD m . In other words, the difference data of 7 every is, dD m = dD 1 + dD 5, ..., dD m + dD m + 4, ... = l 1 -l 5 + l 5 -l 9, ..., l n-4 -l n + l n- 1
n + 4, ... = l 1 -l 9, ..., l n-4 -l n + 4, ... = l 1 -l 9, ..., l m -l m + 8, ... become. Here, n = m + 4.

さらに、この差分データdDmの隣接間の和を取り、新
たなデータ列dDW(m)=dDm+dDm+1を演算し、これを
用いて第6ブロックBL6での焦点検出を行い、焦点状態
の検出およびデフォーカス量DFを演算し(ステップ#9
4)、焦点検出が可能であれば、フラグLCF2をリセット
し、第6ブロックBL6のデフォーカス量DF6を第2アイラ
ンド22のデフォーカス量DFIS2として前記ステップ#43
に移行する(ステップ#95〜#97)。一方、ステップ#
95で焦点検出が不能であれば、第7ブロックBL7での焦
点検出を行い、焦点状態の検出およびデフォーカス量DF
を演算し(ステップ#98)、焦点検出が可能であれば
(ステップ#99)、ステップ#96に戻って、フラグLCF2
をリセットし、第7ブロックBL7のデフォーカス量を第
2アイランド22のデフォーカス量DFIS2として前記ステ
ップ#43に移行する。一方、ステップ#99で焦点検出が
不能であれば、第8ブロックBL8での焦点検出を行い、
焦点状態の検出およびデフォーカス量DFを演算し(ステ
ップ#100)、焦点検出が可能であれば(ステップ#10
1)、ステップ#96に戻って、フラグLCF2をリセット
し、第8ブロックBL8のデフォーカス量を第2アイラン
ド22のデフォーカス量DFIS2として前記ステップ#43に
移行する。一方、ステップ#101で焦点検出が不能であ
れば、ステップ#96,#97の処理を行わずに前記ステッ
プ#43に移行する。
Further, the difference between the adjacent difference data dD m is calculated, and a new data sequence dDW (m) = dD m + dD m + 1 is calculated. Using this, focus detection is performed in the sixth block BL6, and the focus is calculated. The state is detected and the defocus amount DF is calculated (step # 9
4) If focus detection is possible, the flag LCF2 is reset and the defocus amount DF6 of the sixth block BL6 is set as the defocus amount DFIS2 of the second island 22 in step # 43.
(Steps # 95 to # 97). Meanwhile, step #
If the focus cannot be detected at 95, the focus is detected at the seventh block BL7 to detect the focus state and the defocus amount DF.
Is calculated (step # 98), and if focus detection is possible (step # 99), the flow returns to step # 96 to set the flag LCF2
Is reset, and the defocus amount of the seventh block BL7 is set as the defocus amount DFIS2 of the second island 22, and the process proceeds to step # 43. On the other hand, if focus detection is not possible in step # 99, focus detection is performed in the eighth block BL8,
The focus state detection and the defocus amount DF are calculated (step # 100), and if focus detection is possible (step # 10)
1) Returning to step # 96, the flag LCF2 is reset, and the defocus amount of the eighth block BL8 is set as the defocus amount DFIS2 of the second island 22, and the process proceeds to step # 43. On the other hand, if the focus cannot be detected in step # 101, the process proceeds to step # 43 without performing the processes of steps # 96 and # 97.

第14図は第3アイランド23のデフォーカス量演算(ス
テップ#43)のサブルーチンを示す。まず、第9ブロッ
クBL9、第10ブロックBL10の各デフォーカス量をそれぞ
れ記憶する変数DF9,DF10に所定値“−K"を記憶させる
(ステップ#111,#112)。次に、第3アイランド23で
のローコンの状態を示すフラグLCF3をセットする(ステ
ップ#113)。そして、第9ブロックBL9の焦点状態の検
出およびデフォーカス量DFを演算し(ステップ#11
4)、焦点検出が可能であれば、フラグLCF3をリセット
し、求めたデフォーカス量DFを第9ブロックBL9のデフ
ォーカス量DF9に記憶させる(ステップ#115〜#11
7)。一方、ステップ#115で焦点検出が不能と判定され
ると、ステップ#116,#117の処理を行わずにステップ
#118に移行する。
FIG. 14 shows a subroutine for calculating the defocus amount of the third island 23 (step # 43). First, a predetermined value “−K” is stored in variables DF9 and DF10 for storing the respective defocus amounts of the ninth block BL9 and the tenth block BL10 (steps # 111 and # 112). Next, a flag LCF3 indicating the state of the low contrast in the third island 23 is set (step # 113). Then, the focus state detection of the ninth block BL9 and the defocus amount DF are calculated (step # 11).
4) If the focus can be detected, the flag LCF3 is reset and the obtained defocus amount DF is stored in the defocus amount DF9 of the ninth block BL9 (steps # 115 to # 11).
7). On the other hand, if it is determined in step # 115 that the focus detection cannot be performed, the process proceeds to step # 118 without performing the processes of steps # 116 and # 117.

次に、第10ブロックBL10の焦点状態の検出およびデフ
ォーカス量DFを演算し(ステップ#118)、この演算結
果から焦点検出が不能であれば、フラグLCF3がセットさ
れているかどうかを判定する。そして、フラグLCF3がリ
セットされているとき、すなわち、ステップ#115の判
定において焦点検出が可能とされたときには、ステップ
#122に移行する。また、フラグLCF3がセットされてい
るときには、第10図に示すステップ#29の露出演算サブ
ルーチンに移行する(ステップ#119,#120)。一方、
ステップ#119で焦点検出が可能と判定されると、ステ
ップ#120の処理を行わずにフラグLCF3をリセットし、D
F10にステップ#118で求めたデフォーカス量を記憶させ
(#129,#130)、ステップ#122に移行する。
Next, the detection of the focus state of the tenth block BL10 and the defocus amount DF are calculated (step # 118). If the focus detection is not possible from this calculation result, it is determined whether or not the flag LCF3 is set. Then, when the flag LCF3 is reset, that is, when the focus detection is enabled in the determination of step # 115, the process proceeds to step # 122. When the flag LCF3 is set, the process proceeds to the exposure calculation subroutine of step # 29 shown in FIG. 10 (steps # 119, # 120). on the other hand,
If focus detection is determined to be possible in step # 119, the flag LCF3 is reset without performing the processing in step # 120, and D
The defocus amount obtained in step # 118 is stored in F10 (# 129, # 130), and the process proceeds to step # 122.

ステップ#122では、後述の平均処理ルーチンの平均
処理幅ΔDFを決定する。次いで、デフォーカス量DF9と
デフォーカス量FG10との大小を判定し、デフォーカス量
の大きい方を第3アイランド23のデフォーカス量DFIS3
とする(ステップ#123〜#127)。
In step # 122, an average processing width ΔDF of an averaging processing routine described later is determined. Next, the magnitude of the defocus amount DF9 and the defocus amount FG10 is determined, and the one with the larger defocus amount is defocus amount DFIS3 of the third island 23.
(Steps # 123 to # 127).

また、ステップ#124,#125でデフォーカス量DF9とデ
フォーカス量DF10との差が平均処理幅ΔDFよりも小さい
ときは、デフォーカス量DF9とデフォーカス量DF10との
平均を行い、この平均値を第3アイランド23のデフォー
カス量DFIS3とする(ステップ#128)。そして、ステッ
プ#126,#127,#128の処理を終えると、第10図のステ
ップ#29に移行する。
If the difference between the defocus amounts DF9 and DF10 is smaller than the average processing width ΔDF in steps # 124 and # 125, the defocus amounts DF9 and DF10 are averaged. Is the defocus amount DFIS3 of the third island 23 (step # 128). Then, when the processes of steps # 126, # 127 and # 128 are completed, the process proceeds to step # 29 in FIG.

次に、第10図のステップ#29に示した露出演算サブル
ーチンについて第15図を用いて説明する。
Next, the exposure calculation subroutine shown in step # 29 of FIG. 10 will be described with reference to FIG.

まず、輝度検出回路29から被写体8の明るさに対応し
た開放輝度値(アペックス値)BV0がマイコン26に入力
される(ステップ#131)。続いて、フィルム感度読取
回路30からフィルム感度に対応したフィルム感度値(ア
ペックス値)SVがマイコン26に入力される(ステップ
#132)。次いで、これら開放輝度値BV0と、フィルム
感度値SVと、第10図のステップ#27で予めマイコン26
に入力されている開放絞り値AV0との和より、露出値E
V(EV=BV0+SV+AV0)を演算する(ステップ#13
3)。
First, an open luminance value (apex value) BV0 corresponding to the brightness of the subject 8 is input from the luminance detection circuit 29 to the microcomputer 26 (step # 131). Subsequently, a film sensitivity value (apex value) SV corresponding to the film sensitivity is input from the film sensitivity reading circuit 30 to the microcomputer 26 (step # 132). Next, these open brightness value BV0, film sensitivity value SV, and microcomputer 26 are determined in advance in step # 27 of FIG.
The exposure value E is calculated from the sum of the open aperture value AV0 input to
V (EV = BV0 + SV + AV0) is calculated (step # 13)
3).

次に、前記露出値EVに基づいて制御絞り値AVおよび
シャッター速度TVを決定し(ステップ#134)、そのの
ち、第10図に示すステップ#30に移行する。
Next, the control aperture value AV and the shutter speed TV are determined based on the exposure value EV (step # 134), and thereafter, the process proceeds to step # 30 shown in FIG.

次に、第10図のステップ#32に示した撮影レンズ2の
駆動量を算出する処理について説明する。このステップ
#32の処理では、各アイランド21,22,23の各デフォーカ
ス量から被写体がどのように分布しているかをパターン
分けし、このパターンごとに最適なデフォーカス量の演
算手順を選択して最適な撮影レンズ2の駆動量を得るよ
うにしている。ここで、前記演算手順を選択する手段に
ついて簡単に説明する。
Next, the process of calculating the drive amount of the photographing lens 2 shown in step # 32 of FIG. 10 will be described. In the process of step # 32, how the object is distributed is divided into patterns based on the defocus amounts of the islands 21, 22, and 23, and an optimal defocus amount calculation procedure is selected for each pattern. Thus, an optimal driving amount of the photographing lens 2 is obtained. Here, the means for selecting the calculation procedure will be briefly described.

まず、FAモードかAFモードかの判定が行われる。そし
て、FAモードの場合では、第2アイランド22の測距を優
先し、第2アイランド22が測距可能であれば、第2アイ
ランド22のデフォーカス量DFIS2に基づいて撮影レンズ
2の駆動量を決定し、第2アイランド22が測距不可能で
あれば、最近接のアイランドのデフォーカス量に基づい
て撮影レンズ2の駆動量を決定する。つまり、FAモード
では、静止した被写体を中央にして撮影する場合が多
く、広い範囲での測距に基づいてデフォーカス量を求め
ると、どのアイランドを選択して表示しているのかが明
確でなくなるため、撮影画面の中央部の測距を行う第2
アイランド22のデフォーカス量DFIS2を優先することと
した。
First, it is determined whether the mode is the FA mode or the AF mode. In the case of the FA mode, the distance measurement of the second island 22 is prioritized. If the distance measurement of the second island 22 is possible, the driving amount of the photographing lens 2 is determined based on the defocus amount DFIS2 of the second island 22. If it is determined that the distance cannot be measured for the second island 22, the driving amount of the photographing lens 2 is determined based on the defocus amount of the nearest island. In other words, in the FA mode, shooting is often performed with a still subject in the center, and if the defocus amount is obtained based on ranging over a wide range, it is not clear which island is selected and displayed. To measure the distance in the center of the shooting screen,
The defocus amount DFIS2 of the island 22 is given priority.

一方、AFモードの場合では、各アイランド21,22,23の
被写体の内、いずれかの被写体8が焦点検出可能なとき
には、最近接になるアイランド、すなわちデフォーカス
量が最大になるアイランドのデフォーカス量、撮影レン
ズ2の焦点距離データ、および被写体までの距離に基づ
いて撮影倍率を演算し、この演算結果によってデフォー
カス量の演算手順を変えている。すなわち、基本的に
は、撮影倍率が大きければ、主被写体は撮影画面の中央
部に必ず存在するとして、第2アイランド22のデフォー
カス量DFIS2を優先する。また、撮影倍率が小さけれ
ば、背景を含んだ撮影になり、被写体までの距離分布の
ばらつきが大きいとし、さらに主被写体はカメラに近い
位置に存在することが多いので、距離分布の近い側を優
先する。この撮影倍率の判定の目安となる値と、この値
に基づいて演算手段を選択する手順の一例を第16図に示
す。
On the other hand, in the case of the AF mode, when any one of the subjects 8 among the subjects on each of the islands 21, 22, and 23 can detect the focus, the defocus of the closest island, that is, the island having the largest defocus amount is performed. The photographing magnification is calculated based on the amount, the focal length data of the photographing lens 2 and the distance to the subject, and the calculation procedure of the defocus amount is changed according to the calculation result. In other words, basically, if the shooting magnification is large, the main subject always exists at the center of the shooting screen, and the defocus amount DFIS2 of the second island 22 is prioritized. Also, if the shooting magnification is small, the shooting will include the background, and the distribution of the distance to the subject will be large, and the main subject is often located close to the camera. I do. FIG. 16 shows an example of a value used as a guide for determining the photographing magnification and a procedure for selecting a calculation means based on the value.

すなわち、例えば、AFモードの場合には、撮影レンズ
2の焦点距離fは35mmを境に演算手段を選択する。そし
て、焦点距離fが35mm以上、かつ、最近接アイランドの
撮影倍率βdfが所定の倍率βH(例えば、倍率1/25)よ
りも小さければ、最近接アイランドのデフォーカス量に
基づいて撮影レンズ2の駆動量を決定する。一方、撮影
倍率βdfが所定の倍率βHを越えると、第2アイランド2
2のデフォーカス量DFIS2を優先し、第2アイランド22が
測距不可能であれば、最近接アイランドのデフォーカス
量に基づいて撮影レンズ2の駆動量を決定する。
That is, for example, in the case of the AF mode, the calculation means is selected when the focal length f of the photographing lens 2 is 35 mm. If the focal length f is equal to or greater than 35 mm and the imaging magnification βdf of the nearest island is smaller than a predetermined magnification βH (for example, 1/25), the photographic lens 2 is adjusted based on the defocus amount of the nearest island. Determine the drive amount. On the other hand, when the photographing magnification βdf exceeds the predetermined magnification βH, the second island 2
The second defocus amount DFIS2 is prioritized, and if the distance measurement of the second island 22 is impossible, the driving amount of the taking lens 2 is determined based on the defocus amount of the closest island.

さらに、焦点距離fが35mm未満であれば、最近接アイ
ランドのデフォーカス量に基づいて撮影レンズ2の駆動
量を決定する。これは焦点距離fが短くなると、被写界
深度が深くなるので、距離分布において最近接アイラン
ドの被写体に焦点を合せても他のアイランドで検出され
た被写体をかなりの範囲まで被写界深度内に含むことが
できるからである。
Further, if the focal length f is less than 35 mm, the driving amount of the photographing lens 2 is determined based on the defocus amount of the nearest island. This is because, as the focal length f becomes shorter, the depth of field becomes deeper. Therefore, even if the object on the closest island is focused on in the distance distribution, the object detected on the other island is within a considerable range within the depth of field. Because it can be included in

また、FAモードの場合には、焦点距離fに関係なく、
第2アイランド22のデフォーカス量DFIS2を優先し、第
2アイランド22が測距不可能であれば、最近接アイラン
ドのデフォーカス量に基づいて撮影レンズ2の駆動量を
決定する。
In the case of the FA mode, regardless of the focal length f,
The defocus amount DFIS2 of the second island 22 is prioritized. If the second island 22 cannot be measured, the driving amount of the photographing lens 2 is determined based on the defocus amount of the closest island.

ここで、前述の撮影倍率βdfの算出手段について説明
する。
Here, the calculation means of the above-described photographing magnification βdf will be described.

この撮影倍率βdfは焦点距離fとカメラからの被写体
距離xとから下式のようになる。
The photographing magnification βdf is given by the following equation based on the focal length f and the subject distance x from the camera.

βdf=f/x 前記焦点距離fのデータは撮影レンズ2から入力され
るので、前記被写体距離xを求めると、撮影倍率βdfは
算出される。また、この被写体距離xは撮影レンズ2の
無限遠位置から被写体位置までのデフォーカス量DFx
用いて、下式のように求められる。
βdf = f / x Since the data of the focal length f is input from the photographing lens 2, when the subject distance x is obtained, the photographing magnification βdf is calculated. Further, the subject distance x is obtained by using the defocus amount DF x from the infinity position of the taking lens 2 to the subject position as in the following formula.

x=f2/DFx ただし、撮影レンズ2は1枚の薄い理想レンズではな
く、主点が前後にあるとともに、焦点距離の変化によっ
てその主点が異なるので、上式から被写体距離xは近似
値として求められる。
x = f 2 / DF x However, since the taking lens 2 is not a single thin ideal lens, the principal point is at the front and back, and the principal point differs depending on the change in the focal length, so the subject distance x is approximated from the above formula. Calculated as a value.

一方、撮影レンズ2の無限遠位置から現在位置までの
デフォーカス量DFoは、マイコン26内部のカウンタに記
憶されているレンズ駆動モータ33の回転量(数)Nに応
じたパルス数から求められ、その関係は下式のようにな
る。
On the other hand, the defocus amount DF o from infinity position of the taking lens 2 to the current position is determined from the rotation amount (number) number of pulses corresponding to the N of the lens driving motor 33 stored in the counter of the microcomputer 26 , The relationship is as shown below.

N=k・DFo DFo=N/K ただし、係数kの値は前記パルス数等に基づいて定め
られる。
N = k · DF o DF o = N / K However, the value of the coefficient k is determined based on the number of pulses and the like.

そして、デフォーカス量DFxはデフォーカス量DFoと撮
影レンズ2の現在位置から被写体の合焦位置までのデフ
ォーカス量DFとから、 DFx=DFo+DF となる。これらの式から被写体距離xは、 x=f2/DFx=f2/(N/k+DF) したがって、撮影倍率βdfは、 βdf=f/x=(N/k+DF)/f となる。
Then, the defocus amount DF x is DF x = DF o + DF from the defocus amount DF o and the defocus amount DF from the current position of the taking lens 2 to the in-focus position of the subject. From these expressions, the subject distance x is x = f 2 / DF x = f 2 / (N / k + DF) Therefore, the imaging magnification βdf is βdf = f / x = (N / k + DF) / f.

また、上式とは別に撮影倍率βdfは撮影レンズ2の現
在位置から被写体位置までの駆動量ΔN(ΔN=DF・
k)を用いて、 βdf=(N+ΔN)/f・k としても求められる。
Further, separately from the above equation, the photographing magnification βdf is the drive amount ΔN from the current position of the photographing lens 2 to the subject position (ΔN = DF ·
Using k), βdf = (N + ΔN) / f · k.

次に、平均処理を行うサブルーチンについて第2アイ
ランド22のフローチャート(第13図のステップ#88,#9
2)を例にして説明する。
Next, the subroutine for performing the averaging process will be described with reference to the flowchart of the second island 22 (steps # 88 and # 9 in FIG. 13).
This will be described using 2) as an example.

第13図のステップ#88の平均処理幅ΔDFは、第17図に
示すサブルーチンに従って求められる。まず、前回平均
処理が行われたかどうかをフラグWZF2により判定する
(ステップ#141)。すなわち、前回平均処理が行われ
ると、フラグWZF2はセットされる。そして、前回平均処
理が行われていれば、係数k1を“1.5"に設定し、前回
平均処理が行われなければ、係数k1を“1"に設定する
(ステップ#142,#143)。係数k1を設定する理由は、
測距値のばらつきによって平均処理が行われたり、行わ
れなかったりすることを防ぐため、一度平均処理が行わ
れた場合は平均処理幅を広げて2回目以降も平均処理が
行われる可能性(確率)を高めるためである。
The average processing width ΔDF of step # 88 in FIG. 13 is obtained according to a subroutine shown in FIG. First, it is determined whether or not the previous averaging process has been performed by using the flag WZF2 (step # 141). That is, when the previous averaging process is performed, the flag WZF2 is set. If the previous averaging process has been performed, the coefficient k 1 is set to "1.5", and if the previous averaging process has not been performed, the coefficient k 1 is set to "1" (steps # 142, # 143). . The reason for setting the coefficient k 1 is
In order to prevent the averaging process from being performed or not being performed due to the variation in the distance measurement values, the averaging process may be expanded once and the averaging process may be performed again after the averaging process once ( This is to increase the probability).

次に、前回測距時に検出された撮影倍率βdfの判定が
行われ、撮影倍率βdfが“1/20"以上の場合には係数k2
を“1"に設定し、撮影倍率βdfが“1/20"から“1/50"の
場合には係数k2を“0.5"に設定し、撮影倍率βdfが“1
/50"以下の場合には係数k2を“0"に設定し(ステップ
#145〜#149)、ステップ#150に移行する。前記係数
2を設定する理由は、撮影倍率βdfが高いと同一アイ
ランド内の複数ブロックに同一被写体で占められる可能
性が高くなるためである。
Next, the shooting magnification βdf detected at the previous distance measurement is determined, and when the shooting magnification βdf is “1/20” or more, the coefficient k 2
Is set to “1”, and the shooting magnification βdf is from “1/20” to “1/50”, the coefficient k 2 is set to “0.5”, and the shooting magnification βdf is set to “1”.
/ 50 "coefficient k 2 in the following cases" 0 "(step # 145 to # 149), the reason for setting to. The coefficient k 2 proceeds to step # 150, the high imaging magnification βdf This is because there is a high possibility that the same subject will be occupied by a plurality of blocks in the same island.

次いで、ステップ#150で、撮影時の絞り値FNo.に基
づいて基準平均処理幅ΔDF1の設定を行う。つまり、撮
影時の絞り値FNo.と許容錯乱円直径εの積により求め
られる焦点深度δを撮影された像の解像度を保存するた
めの基準平均処理幅ΔDF1として設定される。
Then, in step # 150, the reference average processing width ΔDF1 is set based on the aperture value FNo. That is, the depth of focus δ obtained by the product of the aperture value FNo. At the time of shooting and the permissible circle of confusion diameter ε is set as the reference average processing width ΔDF1 for storing the resolution of the shot image.

そして、前記係数k1および係数k2をこの基準平均処
理幅ΔDF1に掛けることにより、平均処理幅ΔDFが決定
され、さらにフラグWZF2がリセットされる(ステップ#
151)。そののち、第13図に示すステップ#89に移行す
る。
Then, the average processing width ΔDF1 is determined by multiplying the reference average processing width ΔDF1 by the coefficients k 1 and k 2 , and the flag WZF2 is reset (step #
151). Thereafter, the flow shifts to step # 89 shown in FIG.

また、前回平均処理が行われたかどうかを判定するた
めのフラグは、第1アイランド21および第3アイランド
23にもフラグWZF2と同様に有しており、前回平均処理が
行われると、フラグWZF2はセットされ、前回平均処理が
行われなければ、リセットされる。
The flag for determining whether or not the previous averaging process has been performed is determined by the first island 21 and the third island 21.
23 has the same flag WZF2. When the previous averaging process is performed, the flag WZF2 is set. When the previous averaging process is not performed, the flag WZF2 is reset.

ここで、各ブロックのデフォーカス量の演算、および
本発明に係る焦点検出不能判断について第3ブロックBL
3を例(第13図のステップ#75〜#78)にして第18図
(a)を用いて説明する。
Here, regarding the calculation of the defocus amount of each block and the focus detection impossibility judgment according to the present invention, the third block BL
This will be described with reference to FIG. 18 (a), taking 3 as an example (steps # 75 to # 78 in FIG. 13).

まず、前ピン側ずれピッチが4個の位置(ずれピッチ
“−4")から後ピン側ずれピッチが24個の位置(ずれピ
ッチ“24")までのデフォーカス範囲において参照部142
bのデータをずらせながら(シフトさせながら)、各シ
フト位置における第3ブロックBL3のデータと参照部142
bのデータとの相関関数H3(I)を求める(ステップ#16
1)。
First, in the defocus range from the position where the front pin side shift pitch is four (shift pitch “−4”) to the position where the rear pin side shift pitch is 24 (shift pitch “24”), the reference unit 142
While shifting (shifting) the data of b, the data of the third block BL3 at each shift position and the reference unit 142
Obtain the correlation function H3 (I) with the data of b (step # 16
1).

この相関関数H3(I)は下式のようになる。 This correlation function H3 (I) is expressed by the following equation.

ただし、K2は基準部142aの差分データ列を示し、S2は
参照部142bの差分データ列を示す。
Here, K2 indicates a difference data string of the reference unit 142a, and S2 indicates a difference data string of the reference unit 142b.

次いで、前述の各シフト位置における相関関数H3(I)
の内で最も相関の良い、すなわち、相関関数H3(I)の値
が小になるシフト位置IMを抽出する(ステップ#16
2)。次に、相関関数H3(I)の各点の値を用いて各ピッ
チ間の補間演算を行う(ステップ#163)。
Then, the correlation function H3 (I) at each shift position described above
Among them, the shift position IM having the best correlation, that is, the value of the correlation function H3 (I) is small, is extracted (step # 16).
2). Next, the interpolating operation between the pitches is performed using the value of each point of the correlation function H3 (I) (step # 163).

この補間演算により求めらる補間ピッチXMは下式のよ
うになる(特開昭60-247211号公報参照)。
The interpolation pitch XM obtained by this interpolation calculation is as shown in the following equation (see Japanese Patent Application Laid-Open No. 60-247211).

XM=IM+{H3(IM-3)−H3(IM+1)}/[MIN{H3(IM-
1),H3(IM+1)}−H3(IM)]/2 この補間演算を行う理由は、1個のピッチのずれをデ
フォーカス量に換算すると約1000μmと大きく、このピ
ッチ間を補うことにより精度の良い測距を行うためであ
る。
XM = IM + {H3 (IM-3) -H3 (IM + 1)} / [MIN {H3 (IM-
1), H3 (IM + 1)}-H3 (IM)] / 2 The reason for performing this interpolation calculation is that the displacement of one pitch is converted to the defocus amount, which is as large as about 1000 μm. This is for accurate distance measurement.

こうして求められた補間ピッチXMに光学系および光
電変換素子アレイのピッチ長で決定する係数αを掛けて
デフォーカス量DF(DF=XM・α)に換算する(ステッ
プ#164)。次いで、第3ブロックBL3のデータの持つコ
ントラスト(明暗)値C(3)を基準部142aの隣接デー
タの差の総和として求める(ステップ#165)。
The interpolation pitch XM obtained in this way is multiplied by a coefficient α determined by the pitch length of the optical system and the photoelectric conversion element array, and converted into a defocus amount DF (DF = XM · α) (step # 164). Next, the contrast (brightness / darkness) value C (3) of the data of the third block BL3 is obtained as the sum of the differences between the adjacent data of the reference unit 142a (step # 165).

このコントラスト値C(3)は下式のようになる。 This contrast value C (3) is expressed by the following equation.

続いて相関関数H3(I)の最小値の補間値YMを求める
とともに、この補間値YMとコントラスト値C(3)と
の比の値R(3)を求める(ステップ#167)。
Then, the minimum interpolation value YM of the correlation function H3 (I) is obtained, and the ratio value R (3) between the interpolation value YM and the contrast value C (3) is obtained (step # 167).

これらの補間値YMと比の値R(3)とは下式のよう
になる。
The interpolated value YM and the ratio value R (3) are given by the following equation.

YM=H3(IM)−|H3(IM-1)−H3(IM+1)|/2 R(3)=C(3)/YM こうして求められたコントラスト値C(3)および比
の値R(3)が共に設定値を満足した場合のみ焦点検出
可能とし、コントラスト値C(3)あるいは比の値R
(3)のいずれか一方でも満足しない場合には、焦点検
出不能とする(ローコン判定)。すなわち、まず、第3
ブロックBL3が前回のルーチン処理で焦点検出可能であ
ったかどうかの判定を、検出フラグNLB3を用いて行う
(ステップ#168)。これは前回焦点検出可能であった
場合に判定レベルの総和を行い、焦点検出判定レベルぎ
りぎりの被写体に対し、焦点検出可能かどうかの判定が
不安定になることを防ぐためである。すなわち、焦点検
出判定レベルぎりぎりの被写体に対しては、判定レベル
Cth,Rthにそれぞれ所定値C1,R1を設定する(ステップ
#169)。
YM = H3 (IM)-| H3 (IM-1) -H3 (IM + 1) | / 2 R (3) = C (3) / YM The contrast value C (3) thus obtained and the ratio value R Focus detection is possible only when both (3) satisfy the set value, and the contrast value C (3) or the ratio value R
If either one of (3) is not satisfied, focus detection is disabled (low contrast determination). That is, first, the third
A determination is made as to whether the block BL3 has been able to perform focus detection in the previous routine processing, using the detection flag NLB3 (step # 168). This is to prevent the instability of the determination as to whether or not the focus can be detected for the subject at the end of the focus detection determination level, by summing the determination levels when the focus detection was possible last time. That is, with respect to the subject at the edge of the focus detection determination level, predetermined values C1 and R1 are set to the determination levels Cth and Rth, respectively (step # 169).

そして、ステップ#168で前回焦点検出不能あるいは
一度目のルーチン処理、すなわち、検出フラグNLB3がリ
セットされている場合には、現在の撮影レンズ2の位置
での撮影を行った際の撮影倍率βLSの演算を行う(ステ
ップ#170)。
Then, in step # 168, if the focus cannot be detected last time or the first routine processing, that is, if the detection flag NLB3 has been reset, the photographing magnification βLS when photographing at the current position of the photographing lens 2 is performed. An operation is performed (step # 170).

この撮影倍率βLSは、前述の撮影倍率βdfの演算、す
なわち、βdf=(N/k+DF)/fのデフォーカス量DFに
“0"を代入して求める。
The photographing magnification βLS is obtained by calculating the above-described photographing magnification βdf, that is, by substituting “0” into the defocus amount DF of βdf = (N / k + DF) / f.

そして、この撮影倍率βLSと焦点距離fとの積を求
め、この積が所定値f・βth(例えば、300mmレンズの
場合βthは1/15以上)以上の場合には、判定レベルCt
h,Rthにそれぞれ所定値C1,R1よりも大きい所定値C4,R4
を設定する(ステップ#171,#172)。つまり、ステッ
プ#169の場合に比べて判定レベルCth,Rthは厳しくな
る。
Then, a product of the photographing magnification βLS and the focal length f is obtained, and when the product is a predetermined value f · βth (for example, βth is 1/15 or more in the case of a 300 mm lens), the determination level Ct
Predetermined values C4 and R4 greater than the prescribed values C1 and R1 for h and Rth, respectively
Is set (steps # 171, # 172). That is, the determination levels Cth and Rth are more severe than in step # 169.

前記ステップ#171で所定値のf・βth未満の場合、
第3ブロックBL3の最大の局所コントラスト値CLthの演
算を行う(ステップ#173)。そして、局所コントラス
ト値CLthが予め設定された所定値よりも大きければ、す
なわち後述のフラグCLがセットされていると、判定レベ
ルCthに所定値C2を設定し、所定値よりも小さければ、
すなわちフラグCLがリセットされていると、判定レベル
Cthに所定値C3を設定する(ステップ#174〜#174)。
ただし、所定値C2,C3の関係は、C1<C2<C3<C4となる
ように予め設定されている。
When it is less than the predetermined value f · βth in step # 171,
The maximum local contrast value CLth of the third block BL3 is calculated (step # 173). Then, if the local contrast value CLth is larger than a preset predetermined value, that is, if a flag CL described later is set, the determination level Cth is set to a predetermined value C2, and if it is smaller than the predetermined value,
That is, if the flag CL has been reset, the determination level Cth is set to a predetermined value C3 (steps # 174 to # 174).
However, the relationship between the predetermined values C2 and C3 is set in advance so that C1 <C2 <C3 <C4.

次いで、フラグAFSFがセットされているかどうかの判
定を行い、セットされていれば、判定レベルRthに所定
値R2を設定し、リセットされていれば、判定レベルRth
に所定値R3を設定する(ステップ#177〜#179)。ただ
し、所定値R2,R3の関係は、R1<R2<R3<R4となるよう
に予め設定されている。
Next, it is determined whether or not the flag AFSF is set. If it is set, the determination level Rth is set to a predetermined value R2, and if it is reset, the determination level Rth is set.
Is set to a predetermined value R3 (steps # 177 to # 179). However, the relationship between the predetermined values R2 and R3 is set in advance so that R1 <R2 <R3 <R4.

そして、前記判定レベルCth,Rthにそれぞれ所定値が
設定されたのち(ステップ#169,#172,#178,#17
9)、コントラスト値C(3)が判定レベルCthよりも大
きく、かつ、比の値R(3)が判定レベルRthよりも大
きいときには、検出フラグNLB3をセットし、コントラス
ト値C(3)あるいは比の値R(3)のいずれか一方で
も判定レベルCthあるいは判定レベルRthよりも小さい
ときには、検出フラグNLB3をリセットする(ステップ#
180〜#182)。そののち、第13図のステップ#79以降に
示された第4ブロックBL4のデフォーカス量の演算およ
び焦点検出不能判断等の処理を行う。
Then, after a predetermined value is set for each of the determination levels Cth, Rth (steps # 169, # 172, # 178, # 17).
9) If the contrast value C (3) is greater than the determination level Cth and the ratio value R (3) is greater than the determination level Rth, the detection flag NLB3 is set to set the contrast value C (3) or the ratio When either one of the values R (3) of the above is smaller than the determination level Cth or the determination level Rth, the detection flag NLB3 is reset (step #
180 to # 182). After that, processing such as calculation of the defocus amount of the fourth block BL4 and determination of the inability to detect the focus, which are shown in step # 79 and thereafter in FIG. 13, are performed.

なお、検出フラグNLB3は、各アイランドごとに、この
検出フラグNLBを設定し、この検出フラグNLBに基づいて
判定レベルの緩和を行うようにしてもよい。つまり、一
度合焦検出して大きなデフォーカス量を検出した場合、
レンズ駆動により、その像間隔が基本像間隔に近ずく。
そのため、基準部の像自体も、例えば、第4ブロック、
第5ブロックにあった像が、レンズ駆動により像間隔が
広がり第3ブロック、第4ブロックにシフトすることが
ある。この様なときは第3ブロックで焦点検出不能にな
る。そこで、各アイランドごとにローコンを示すフラグ
LCFを別のフラグLCFNに格納して、このフラグLCFNを検
出フラグNLBの代りにそれぞれのアイランドの測距時に
判定するようにしてもよい。
As the detection flag NLB3, the detection flag NLB may be set for each island, and the determination level may be relaxed based on the detection flag NLB. In other words, if the focus is detected once and a large defocus amount is detected,
By driving the lens, the image interval approaches the basic image interval.
Therefore, the image itself of the reference portion is also, for example, the fourth block,
The image in the fifth block may be shifted to the third block and the fourth block by expanding the image interval by driving the lens. In such a case, focus detection becomes impossible in the third block. Therefore, a flag indicating low contrast for each island
The LCF may be stored in another flag LCFN, and this flag LCFN may be determined at the time of distance measurement of each island instead of the detection flag NLB.

ここで、ステップ#172の所定値f・βth以上の場合
に判定レベルCth,Rthを厳しくした理由について説明す
る。
Here, the reason why the determination levels Cth and Rth are tightened when the value is equal to or larger than the predetermined value f · βth in step # 172 will be described.

つまり、極めて大きなレンズ駆動範囲(レンズ繰り出
し量40mm以上)を有する長焦点レンズの場合、レンズ位
置が前記条件を満足するように高倍率、すなわち、レン
ズ繰り出し量が大きい場合でかなりの遠景、低倍率の被
写体に対して焦点検出しようとすると、この様な場合、
被写体の空間周波数成分はかなりの高周波成分を有し、
基準部142aあるいは参照部142bにおける像間隔が極めて
小さく、基準部142aと参照部142bとではまったく異なっ
た像が投影されることになる。さらに、低倍率であるた
め、まったく異なった被写体が投影されることになる。
この様なぼけ状態の場合には、光学系は極めて低周波成
分のみを通過させるので、通常は焦点検出不能となる。
ところが、第18図(b)に示すように、人物A,Bが並ん
でいるような場合、人物A,Bを区別する細部のデータ
(高周波成分)は光学系を通過しないので、基準部142a
と参照部142bとに投影される人物A,Bのそれぞれの像は
ほぼ同じ波形になり、人物Aの像と人物bの像とを誤っ
て判定し、焦点検出可能と判定する場合がある。
That is, in the case of a long focal length lens having an extremely large lens driving range (lens extension amount of 40 mm or more), a high magnification is set so that the lens position satisfies the above condition. If you try to detect the focus for the subject,
The spatial frequency component of the subject has a considerable high frequency component,
The image interval in the reference portion 142a or the reference portion 142b is extremely small, and a completely different image is projected between the reference portion 142a and the reference portion 142b. Further, since the magnification is low, a completely different subject is projected.
In such a blurred state, the optical system passes only an extremely low frequency component, so that focus detection cannot be normally performed.
However, as shown in FIG. 18 (b), when the persons A and B are arranged side by side, the data (high-frequency component) for distinguishing the persons A and B does not pass through the optical system.
Each of the images of the persons A and B projected on the reference portion 142b and the reference section 142b has substantially the same waveform, and the image of the person A and the image of the person b may be erroneously determined to determine that the focus can be detected.

一方、レンズ位置が無限遠状態で低倍率の場合に近
景、高倍率の被写体に対して焦点検出しようとすると、
この様な場合にも、光学系は極めて低周波成分のみを通
過させるので、細部のデータは通過しない。ところが、
高倍率であるため基準部142aあるいは参照部142bにおけ
る像間隔が極めて大きく、基準部142aと参照部142bとは
同じ被写体の異なった部分が投影されることになる。し
たがって、基準部142aと参照部142bとが異なった被写体
を投影されることはないので、判定レベルCth,Rthを厳
しくすることとした。
On the other hand, if the lens position is at infinity and the magnification is low, the focus is to be detected on a near-view, high-magnification subject.
Even in such a case, the optical system passes only very low frequency components, so that detailed data does not pass. However,
Since the magnification is high, the image interval in the reference portion 142a or the reference portion 142b is extremely large, and different portions of the same subject are projected on the reference portion 142a and the reference portion 142b. Therefore, since the standard portion 142a and the reference portion 142b do not project different subjects, the determination levels Cth and Rth are set to be strict.

また、前記ステップ#161およびステップ#165では、
第3ブロックBL3の相関関数H3(I)およびコントラスト
値C(3)を演算したが、第19図に示すように、他のブ
ロックBL1,BL2,BL4,BL5,BL9,BL10についても同様に求め
ることができる。
Also, in step # 161 and step # 165,
The correlation function H3 (I) and the contrast value C (3) of the third block BL3 were calculated, but as shown in FIG. 19, the other blocks BL1, BL2, BL4, BL5, BL9, BL10 are similarly obtained. be able to.

次に、前記ステップ#173での局所コントラスト値CLt
hの演算について説明する。このステップ#173でのコン
トラスト値の判定レベルCthには、光電変換素子アレイ
等により発生するノイズ(雑音)量Cnoiseが重畳され
ている。このノイズ量Cnoiseのノイズ自体の大きさは
変らないがノイズの波形がばらつくため、合焦検出に最
低限必要な真の被写体コントラスト値をCMINとする
と、判定レベルCthは下式のようになる。
Next, the local contrast value CLt in the step # 173
The operation of h will be described. A noise amount Cnoise generated by the photoelectric conversion element array or the like is superimposed on the contrast level determination level Cth in step # 173. The magnitude of the noise itself of the noise amount Cnoise does not change, but the waveform of the noise varies. Therefore, when the minimum true subject contrast value required for focus detection is CMIN, the determination level Cth is expressed by the following equation.

Cth=CMIN+MAX{Cnoise} ただし、CMIN≪MAX{Cnoise} このため、ノイズ量Cnoiseが小さく、本来、焦点検
出可能にもかかわらず、コントラスト値が判定レベルC
thを越えないために焦点検出不能と判定される場合があ
る。そこで、最大のノイズ量Cnoiseが発生する時は、
第3ブロックBL3の各部でもノイズが存在すると予測さ
れるので、第3ブロックBL3の差分データごとに下式に
したがってコントラスト限界の判定を行う。
Cth = CMIN + MAX {Cnoise} However, CMIN << MAX {Cnoise} Therefore, the noise amount Cnoise is small, and the contrast value is the judgment level C although the focus detection is possible originally.
In some cases, it is determined that the focus cannot be detected because it does not exceed th. Therefore, when the maximum noise amount Cnoise occurs,
Since it is predicted that noise exists in each part of the third block BL3, the contrast limit is determined for each difference data of the third block BL3 according to the following equation.

ただし、値Pは予め設定する所定値で、“20"以下の
値から選択する。
However, the value P is a predetermined value set in advance, and is selected from values equal to or less than “20”.

また、前記コントラスト限界の判定において、局所的
なコントラスト値が所定値を満足しているときには、コ
ントラスト値の判定レベルをノイズが小さな場合と同様
に判定することができる。つまり、コントラスト限界の
判定の手段は、第20図〜第22図に示されたように、複数
の判定ルーチンがある。すなわち、第20図の判定ルーチ
ンでは、例えば、第3ブロックBL3から7個の差分デー
タごとに細分したデータブロックを抽出し、このデータ
ブロックの内、1個のデータでも所定値CLth1以上であ
れば、トータルのコントラスト値の判定レベルを緩和す
るようになっている。
In the determination of the contrast limit, when the local contrast value satisfies a predetermined value, the determination level of the contrast value can be determined in the same manner as when the noise is small. That is, as shown in FIGS. 20 to 22, there are a plurality of determination routines for determining the contrast limit. That is, in the determination routine of FIG. 20, for example, a data block subdivided for every seven difference data from the third block BL3 is extracted, and if even one of the data blocks is equal to or more than the predetermined value CLth1, In addition, the judgment level of the total contrast value is relaxed.

つまり、この判定ルーチンは、まず、フラグCLをリセ
ットするとともに、変数qをリセットする(ステップ#
191)。次いで、第3ブロックBL3のデータをデータK2
(1)からK2(8)までの差分データ(7個)よりなる
データブロックCLOC を抽出し、このデータブロックCLOCと所定値CLth1と比
較する(ステップ#192,#193)。そして、このデータ
ブロックCLOCが所定値CLth1以上であれば、フラグCLを
セットし(ステップ#194)、コントラスト値の判定レ
ベルを緩和する。
That is, this determination routine first resets the flag CL and also resets the variable q (step #
191). Next, the data of the third block BL3 is replaced with the data K2
Data block CLOC consisting of difference data (7) from (1) to K2 (8) Is extracted, and this data block CLOC is compared with a predetermined value CLth1 (steps # 192, # 193). If the data block CLOC is greater than or equal to the predetermined value CLth1, the flag CL is set (step # 194), and the determination level of the contrast value is relaxed.

一方、データブロックCLOCの各差分データが所定値C
Lth1未満であれば、変数qをインクリメントして第3ブ
ロックBL3のデータK2(2)からK2(9)までの差分デ
ータよりなるデータブロックCLOCを抽出し、このデー
タブロックCLOCと所定値CLth1と比較する(ステップ#
195,#193)。以下同様に、データK2(13)からK2(2
0)までの差分データよりなるデータブロックCLOCを抽
出されるまで続けられる(ステップ#192〜#196)。そ
して、データブロックCLOCの内、1個のデータでも所
定値CLth1以上であれば、フラグCLをセットし、全ての
データブロックCLOCで所定値CLth1未満であれば、フラ
グCLはリセットのままで第18図(a)のフローチャート
に移行する。
On the other hand, each difference data of the data block CLOC is a predetermined value C
If it is less than Lth1, the variable q is incremented to extract the data block CLOC consisting of the difference data from the data K2 (2) to K2 (9) of the third block BL3, and this data block CLOC is compared with the predetermined value CLth1. Do (step #
195, # 193). Similarly, data K2 (13) to K2 (2
This is continued until the data block CLOC consisting of the difference data up to 0) is extracted (steps # 192 to # 196). If even one piece of data in the data block CLOC is greater than or equal to the predetermined value CLth1, the flag CL is set, and if all data blocks CLOC are less than the predetermined value CLth1, the flag CL remains reset and the 18th. The process moves to the flowchart of FIG.

また、第21図では、ブロックのデータの最大値および
最小値を抽出し、これら最大値と最小値との差から局所
コントラストの有無を判定する。
In FIG. 21, the maximum value and the minimum value of the data of the block are extracted, and the presence or absence of local contrast is determined from the difference between the maximum value and the minimum value.

つまり、この判定ルーチンは、第3ブロックBL3のデ
ータK2(1〜20)から最大値[MAX{K2(j)}]およ
び最小値[MIN{K2(j)}]を抽出し、これら最大値
[MAX{K2(j)}]と最小値[MIN{K2(j)}]と
の差CLOC(CLOC=MAX{K2(j)}−MIN{K2
(j)})を求める(ステップ#201〜#203)。次い
で、フラグCLをリセットし(ステップ#204)、差CLOC
と所定値CLth2と比較する(ステップ#205)。そして、
所定値CLth2以上であれば、フラグCLをセットし(ステ
ップ#206)、コントラスト値の判定レベルを緩和す
る。一方、差CLOCが所定値CLth2未満であれば、フラグC
Lはリセットのままで第18図(a)のフローチャートに
移行する。
That is, this determination routine extracts the maximum value [MAX {K2 (j)}] and the minimum value [MIN {K2 (j)}] from the data K2 (1 to 20) of the third block BL3, and determines these maximum values. Difference between [MAX {K2 (j)}] and minimum value [MIN {K2 (j)}] CLOC (CLOC = MAX {K2 (j)}-MIN {K2
(J)}) is obtained (steps # 201 to # 203). Next, the flag CL is reset (step # 204), and the difference CLOC
Is compared with a predetermined value CLth2 (step # 205). And
If the value is equal to or larger than the predetermined value CLth2, the flag CL is set (step # 206), and the judgment level of the contrast value is relaxed. On the other hand, if the difference CLOC is less than the predetermined value CLth2, the flag C
While L remains reset, the process moves to the flowchart of FIG. 18 (a).

さらに、第22図では、ブロックのデータの内、所定レ
ベルより大きなデータが所定個数以上あるかどうかの判
定で局所コントラストの有無を判定する。
Further, in FIG. 22, the presence or absence of local contrast is determined by determining whether or not there is a predetermined number or more of data greater than a predetermined level among the data of the block.

つまり、この判定ルーチンは、まず、変数jを“1"に
セットし、変数CL1,CL2をリセットし、さらにフラグCL
をリセットする(ステップ#211)。次いで、第3ブロ
ックBL3のデータK2(1)と所定値CLth3を比較し、所定
値CLth3以上のとき、変数CL1に“1"を加え、次に、デー
タK2(1)が所定値−CLth3以下のとき、変数CL2に“1"
を加える(ステップ#212〜#215)。そして、前記変数
CL1と変数CL2との積を求め、この積CL1・CL2が所定値CL
th4以上であれば、フラグCLをセットし(ステップ#21
7)、コントラスト値の判定レベルを緩和する。一方、
積CL1・CL2が所定値CLth4未満であれば、変数jをイン
クリメントし、第3ブロックBL3の全てのデータK2(2
0)について、ステップ#212から#215までの処理を行
う(ステップ#212〜#219)。この結果、全てのデータ
の処理を終えても積CL1・CL2が所定値CLth4未満であれ
ば、フラグCLはリセットのままで第18図(a)のフロー
チャートに移行する。
That is, in this determination routine, first, the variable j is set to "1", the variables CL1 and CL2 are reset, and the flag CL
Is reset (step # 211). Next, the data K2 (1) of the third block BL3 is compared with the predetermined value CLth3, and when the data K2 (1) is equal to or more than the predetermined value CLth3, "1" is added to the variable CL1. In the case of, "1" is set to the variable CL2
Is added (steps # 212 to # 215). And the variable
The product of CL1 and the variable CL2 is calculated, and the products CL1 and CL2 are set to the predetermined value CL.
If th4 or more, the flag CL is set (step # 21)
7) Relax the contrast level judgment level. on the other hand,
If the product CL1 · CL2 is less than the predetermined value CLth4, the variable j is incremented and all the data K2 (2
With respect to (0), the processes from steps # 212 to # 215 are performed (steps # 212 to # 219). As a result, if the products CL1 and CL2 are less than the predetermined value CLth4 even after all the data have been processed, the flow shifts to the flowchart of FIG. 18A with the flag CL kept reset.

次に、第13図のステップ#92の平均処理ルーチンにつ
いて説明する。この平均処理ルーチンにはいくつかの処
理手順があり、それぞれの処理手段について第23図〜第
25図を用いて説明する。
Next, the averaging process routine in step # 92 of FIG. 13 will be described. There are several processing procedures in this averaging processing routine, and the respective processing means are shown in FIGS.
This will be described with reference to FIG.

第23図の平均処理ルーチンでは、第18図(a)のステ
ップ#165,#167で求められたコントラスト値C(3)
および比の値R(3)に基づいて重み関数W(I)を設
定し、この重み関数W(I)を用いて各ブロックのデフ
ォーカス量の加重平均を行うようになっている。なお、
この重み関数W(I)は、例えばコントラスト値C
(3)そのもの、あるいは比の値R(3)そのものとし
てもよい。
In the averaging process routine of FIG. 23, the contrast value C (3) obtained in steps # 165 and # 167 of FIG.
And a weighting function W (I) based on the ratio value R (3), and a weighted average of the defocus amount of each block is calculated using the weighting function W (I). In addition,
The weight function W (I) is, for example, a contrast value C
(3) itself or the ratio value R (3) itself may be used.

すなわち、まず、変数Iを“3"にセットする(ステッ
プ#217)。そして、各ブロックBL3,BL4,BL5の各デフォ
ーカス量DF3,DF4,DF5の内の最も大きなデフォーカス量M
AXDFとデフォーカス量DF3との差を求め、この差と平均
処理幅ΔDFとを比較し、この差が平均処理幅ΔDFを越え
たときには、重み関数W(3)を“0"にする。そして、
変数Iをインクリメントし、デフォーカス量MAXDFとデ
フォーカス量DF4およびデフォーカス量DF5との差を求
め、この差と平均処理幅ΔDFとを比較し、この差が平均
処理幅ΔDFを越えたときは、重み関数W(4)および重
み関数W(5)を“0"にする(ステップ#222〜#22
5)。つまり、各ブロックBL3,BL4,BL5の各デフォーカス
量DF3,DF4,DF5の内、平均処理幅ΔDF以内のデフォーカ
ス量を用いて平均処理を行う。次いで、前述のように処
理された重み関数W(I)を用いて加重平均を行い、こ
の平均値を第2アイランド22のデフォーカス量DFIS2に
設定する(ステップ#226)。
That is, first, the variable I is set to "3" (step # 217). Then, the largest defocus amount M among the respective defocus amounts DF3, DF4, DF5 of the blocks BL3, BL4, BL5.
The difference between AXDF and the defocus amount DF3 is obtained, and the difference is compared with the average processing width ΔDF. When the difference exceeds the average processing width ΔDF, the weight function W (3) is set to “0”. And
The variable I is incremented, the difference between the defocus amount MAXDF, the defocus amount DF4 and the defocus amount DF5 is determined, and this difference is compared with the average processing width ΔDF. When the difference exceeds the average processing width ΔDF, , The weight function W (4) and the weight function W (5) are set to “0” (steps # 222 to # 22).
Five). That is, the averaging process is performed using the defocus amount within the average processing width ΔDF among the defocus amounts DF3, DF4, and DF5 of the blocks BL3, BL4, and BL5. Next, weighted averaging is performed using the weight function W (I) processed as described above, and this average value is set as the defocus amount DFIS2 of the second island 22 (step # 226).

つまり、デフォーカス量DFIS2は下式のようになる。 That is, the defocus amount DFIS2 is given by the following equation.

DFIS2={DF3・W(3)+DF4・W(4)+DF5・W(5)}/
{W(3)+W(4)+W(5)} そして、ワイドゾーンフラグWZF2をセットする(ステ
ップ#227)。そののち、第11図のステップ#43のデフ
ォーカス量演算サブルーチンに移行する。
DFIS2 = {DF3 ・ W (3) + DF4 ・ W (4) + DF5 ・ W (5)} /
{W (3) + W (4) + W (5)} Then, the wide zone flag WZF2 is set (step # 227). After that, the flow shifts to the defocus amount calculation subroutine of step # 43 in FIG.

第24図の平均処理ルーチンでは、相関関数の内、最大
相関位置IMと、その前後の相関位置IM+1および相関位
置IM-1において複数のブロックを組み合せて相関関数
を再計算し、さらに再補間演算するようになっている。
すなわち、第13図のステップ#90で得られた平均処理対
象のブロック(以下、対象ブロックという)が全てのブ
ロックBL3,BL4,BL5であれば、第2アイランド22のデー
タK2(1〜40)で相関関数H3,4,5(IM),H3,4,5(IM
-1),H3,4,5(IM+1)を再計算し、さらに再補間演算し
てこの値を第2アイランド22のデフォーカス量DFIS2に
設定する(ステップ#231,#232)。また、第3ブロッ
クBL3および第4ブロックBL4が対象ブロックであれば、
データK2(1〜30)で相関関数H3,4(IM),H3,4(IM
-1),H3,4(IM+1)を再計算し、再補間演算してこの値
をデフォーカス量DFIS2に設定する(ステップ#233,#2
34)。さらに、第4ブロックBL4および第5ブロックBL5
が対象ブロックであれば、データK2(11〜40)で相関関
数H4,5(IM),H4,5(IM-1),H4,5(IM+1)を再計算
し、再補間演算してこの値をデフォーカス量DFIS2に設
定する(ステップ#235,#236)。また、ステップ#235
で、第3ブロックBL3および第5ブロックBL5が対象ブロ
ックであれば、ステップ#232に移行し、そして、ワイ
ドゾーンフラグWZF2をセットし(ステップ#237)、そ
ののち、第11図のステップ#43のデフォーカス量演算サ
ブルーチンに移行する。
In the averaging processing routine shown in FIG. 24, among the correlation functions, a plurality of blocks are combined at the maximum correlation position IM and the correlation positions IM + 1 and IM-1 before and after the maximum correlation position IM, and the correlation function is recalculated, and the correlation function is calculated again. It is designed to interpolate.
That is, if the blocks to be averaged (hereinafter referred to as target blocks) obtained in step # 90 in FIG. 13 are all blocks BL3, BL4, BL5, the data K2 (1-40) of the second island 22. And the correlation functions H3,4,5 (IM), H3,4,5 (IM
-1), H3,4,5 (IM + 1) are recalculated, and re-interpolation calculation is performed to set this value as the defocus amount DFIS2 of the second island 22 (steps # 231, # 232). If the third block BL3 and the fourth block BL4 are target blocks,
Correlation functions H3,4 (IM), H3,4 (IM
-1), H3,4 (IM + 1) are recalculated, re-interpolation is performed, and this value is set as the defocus amount DFIS2 (steps # 233, # 2).
34). Furthermore, the fourth block BL4 and the fifth block BL5
If is the target block, the correlation functions H4,5 (IM), H4,5 (IM-1), H4,5 (IM + 1) are recalculated with the data K2 (11 to 40) and reinterpolation calculation is performed. The lever value is set to the defocus amount DFIS2 (steps # 235, # 236). Also, step # 235
Then, if the third block BL3 and the fifth block BL5 are target blocks, the process proceeds to step # 232, and the wide zone flag WZF2 is set (step # 237), and then step # 43 of FIG. Then, the process proceeds to the defocus amount calculation subroutine.

ここで、前述のステップ#232,#234,#236の相関関
数H3,4,5(IM),H3,4(IM),H4,5(IM)の演算式を
示す。
Here, the calculation formulas of the correlation functions H3,4,5 (IM), H3,4 (IM), H4,5 (IM) in the above steps # 232, # 234, # 236 will be shown.

また、第25図の平均処理ルーチンでは、平均処理の対
象となる各ブロックの相関関数H(IM),H(IM-1),H
(IM+1)をそれぞれ加算し、この加算結果を用いて補
間演算以後の処理を行うようになっている。すなわち、
全てのブロックBL3,BL4,BL5が対象ブロックであれば、
相関関数H3,4,5(IM),H3,4,5(IM-1),H3,4,5(IM
+1)は下式のように計算する(ステップ#241,#24
2)。
In addition, in the averaging processing routine of FIG. 25, the correlation functions H (IM), H (IM-1), H of each block to be subjected to the averaging processing are
Each of (IM + 1) is added, and the processing after the interpolation calculation is performed using the addition result. That is,
If all blocks BL3, BL4, BL5 are target blocks,
Correlation functions H3,4,5 (IM), H3,4,5 (IM-1), H3,4,5 (IM
+1) is calculated by the following formula (steps # 241, # 24)
2).

H3,4,5(IM-1)=H3(IM-1)+H4(IM-1)+H5
(IM-1) H3,4,5(IM)=H3(IM)+H4(IM)+H5(IM) H3,4,5(IM+1)=H3(IM+1)+H4(IM+1)+H5
(IM+1) また、第3ブロックBL3および第4ブロックBL4が対象
ブロックであれば、相関関数H3,4(IM),H3,4(IM-
1),H3,4(IM+1)は下式のように計算する(ステップ
#243,#244)。
H3,4,5 (IM-1) = H3 (IM-1) + H4 (IM-1) + H5
(IM-1) H3,4,5 (IM) = H3 (IM) + H4 (IM) + H5 (IM) H3,4,5 (IM + 1) = H3 (IM + 1) + H4 (IM + 1) + H5
(IM + 1) If the third block BL3 and the fourth block BL4 are target blocks, the correlation functions H3,4 (IM), H3,4 (IM-
1), H3,4 (IM + 1) are calculated by the following equation (steps # 243, # 244).

H3,4(IM-1)=H3(IM-1)+H4(IM-1) H3,4(IM)=H3(IM)+H4(IM) H3,4(IM+1)=H3(IM+1)+H4(IM+1) さらに、第4ブロックBL4および第5ブロックBL5が対
象ブロックであれば、相関関数H4,5(IM),H4,5(IM
-1),H4,5(IM+1)は下式のように計算する(ステップ
#245,#246)。
H3,4 (IM-1) = H3 (IM-1) + H4 (IM-1) H3,4 (IM) = H3 (IM) + H4 (IM) H3,4 (IM + 1) = H3 (IM + 1) ) + H4 (IM + 1) Further, if the fourth block BL4 and the fifth block BL5 are target blocks, the correlation functions H4,5 (IM), H4,5 (IM
-1), H4,5 (IM + 1) are calculated by the following equation (steps # 245, # 246).

H4,5(IM-1)=H4(IM-1)+H5(IM-1) H4,5(IM)=H4(IM)+H5(IM) H4,5(IM+1)=H4(IM+1)+H5(IM+1) また、ステップ#245で、第3ブロックBL3および第5
ブロックBL5が対象ブロックであれば、相関関数H3,5
(IM),H3,5(IM-1),H3,5(IM+1)は下式のように
計算する(ステップ#247)。
H4,5 (IM-1) = H4 (IM-1) + H5 (IM-1) H4,5 (IM) = H4 (IM) + H5 (IM) H4,5 (IM + 1) = H4 (IM + 1) ) + H5 (IM + 1) In step # 245, the third block BL3 and the fifth block
If the block BL5 is the target block, the correlation function H3,5
(IM), H3,5 (IM-1), H3,5 (IM + 1) are calculated by the following equation (step # 247).

H3,5(IM-1)=H3(IM-1)+H5(IM-1) H3,5(IM)=H3(IM)+H5(IM) H3,5(IM+1)=H3(IM+1)+H5(IM+1) そして、ステップ#242,#244,#246,#247の相関関
数の計算を終えると、再補間演算を行い、この値をデフ
ォーカス量DFIS2に設定する(ステップ#248)。つま
り、デフォーカス量DFIS2は下式のようになる。
H3,5 (IM-1) = H3 (IM-1) + H5 (IM-1) H3,5 (IM) = H3 (IM) + H5 (IM) H3,5 (IM + 1) = H3 (IM + 1) ) + H5 (IM + 1) Then, when the calculation of the correlation function in steps # 242, # 244, # 246, # 247 is completed, re-interpolation calculation is performed and this value is set to the defocus amount DFIS2 (step # 248). ). That is, the defocus amount DFIS2 is given by the following equation.

DFIS2=α・IM+α・1/2・{H(IM-1)− H(IM十1)}/[MIN{H(IM-1),H( IM+1)}−H(IM)] そして、ワイドゾーンフラグWZF2をセットし(ステッ
プ#249)、そののち、第11図のステップ#43のデフォ
ーカス量演算サブルーチンに移行する。
DFIS2 = α · IM + α · 1/2 · {H (IM-1) −H (IM + 1)} / [MIN {H (IM-1), H (IM + 1)} − H (IM)] and , The wide zone flag WZF2 is set (step # 249), and then the defocus amount calculation subroutine of step # 43 in FIG. 11 is entered.

次に、第13図のステップ#93〜#95の第6ブロックBL
6のデフォーカス量演算サブルーチンについて第26図を
用いて説明する。
Next, the sixth block BL of steps # 93 to # 95 in FIG.
The defocus amount calculation subroutine 6 will be described with reference to FIG.

まず、ブロックBL3,BL4,BL5で用いた差分データ列K2
(j)およびS2(j)よりそれぞれ7つ置きに差分をと
り、この差分データの隣接間の和分データ列KW(j)お
よびSW(j)を求める(ステップ#251)。この和分デ
ータ列KW(j),SW(j)は第10図のステップ#26で入
力された差分データ列を用いて下式のようになる。
First, the difference data string K2 used in the blocks BL3, BL4, BL5
Differences are taken at every seventh from (j) and S2 (j), and the sum data strings KW (j) and SW (j) between adjacent differences are obtained (step # 251). The sum data strings KW (j) and SW (j) are expressed by the following equation using the difference data string input in step # 26 of FIG.

KW(m)=K2(m)+K2(m+1)+K2(m+4)+K2
(m+5) SW(l)=S2(l)+S2(l+1)+S2(l+4)+S2
(l+5) 次に、相関関数H6(I)を求め、相関関数H6(I)の値が
最小になるシフト量IM(IM=MIN{H6(I)})を抽出
する(ステップ#252,#253)。この相関関数H6(I)は
下式のようになる。
KW (m) = K2 (m) + K2 (m + 1) + K2 (m + 4) + K2
(M + 5) SW (l) = S2 (l) + S2 (l + 1) + S2 (l + 4) + S2
(L + 5) Next, the correlation function H6 (I) is obtained, and the shift amount IM (IM = MIN {H6 (I)}) that minimizes the value of the correlation function H6 (I) is extracted (steps # 252, #). 253). This correlation function H6 (I) is expressed by the following equation.

ここで、上式のように基準部142aのデータ列から両端
のデータを除いて相関関数H6(I)を求めるのは、後述の
補間演算の際に最小シフト量IM近傍の相関関数H6(I
M-1),H6(IM),H6(IM+1)を用いるのではなく、相
関関数H6(IM-2),H6(IM-1),H6(IM+1),H6(IM
+2)を用いるために相関関数H6(IM-2),H6(IM+2)
での参照部142bのデータに対応する位置が大きくずれる
のを補正するためである(特開昭60-247211号参照)。
Here, the correlation function H6 (I) is obtained by removing the data at both ends from the data string of the reference unit 142a as in the above equation, in order to obtain the correlation function H6 (I
Instead of using M-1), H6 (IM), H6 (IM + 1), correlation functions H6 (IM-2), H6 (IM-1), H6 (IM + 1), H6 (IM
+2) to use the correlation functions H6 (IM-2), H6 (IM + 2)
This is to correct a large shift in the position corresponding to the data of the reference portion 142b in (1) (see Japanese Patent Laid-Open No. 60-247211).

ステップ#254では、これら相関関数H6(IM-2),H6
(IM-1),H6(IM+1),H6(IM+2)を求める。すなわ
ち、これらの式は、 となる。
In step # 254, these correlation functions H6 (IM-2), H6
(IM-1), H6 (IM + 1), H6 (IM + 2) are obtained. That is, these equations are: Becomes

これら相関関数H6(IM-2),H6(IM-1),H6(IM+
1),H6(IM+2)を用いて補間演算を下式のように行う
(ステップ#255)。
These correlation functions H6 (IM-2), H6 (IM-1), H6 (IM +
1) and H6 (IM + 2) are used to perform the interpolation calculation as shown in the following equation (step # 255).

XM=IM+{H6(IM-2)−(H6(IM+2)}/[MIN {H6(IM-2),H6(IM+2)}−MAX{H6(I M-1),H6(IM+1)}]/2 前記補間ピッチXMに係数αを掛けてデフォーカス量D
F(DF=XM・α)に換算する(ステップ#256)。次い
で、第6ブロックBL6のデータの持つコントラスト値C
(6)を下式のように求める(ステップ#257)。
XM = IM + {H6 (IM-2)-(H6 (IM + 2)} / [MIN {H6 (IM-2), H6 (IM + 2)}-MAX {H6 (IM-1), H6 ( IM + 1)}] / 2 The defocus amount D is obtained by multiplying the interpolation pitch XM by a coefficient α.
Convert to F (DF = XM · α) (step # 256). Next, the contrast value C of the data of the sixth block BL6
(6) is calculated by the following equation (step # 257).

続いて相関関数H6(IM)の最小値の補間値YM1を求
め、この補間値YM1とコントラスト値C(6)とを用い
て比の値R(6)を下式のように求める(ステップ#25
8)。
Then, the minimum interpolated value YM1 of the correlation function H6 (IM) is obtained, and the value R (6) of the ratio is obtained by the following equation using the interpolated value YM1 and the contrast value C (6) (step # twenty five
8).

YM1=MAX{H6(IM-1),H6(IM+1)}/{| H6(IM-2)−H6(IM+2)|}/2 R(6)=C(6)/{YM1−OF} 次いで、判定レベルCth6,Rth6にそれぞれ所定値を設
定し、コントラスト値C(6)および比の値R(6)が
共に所定値を満足した場合のみ焦点検出可能とし、コン
トラスト値C(6)あるいは比の値R(6)のいずれか
一方でも満足しない場合には、焦点検出不能とする(ス
テップ#259,#260)。
YM1 = MAX {H6 (IM-1), H6 (IM + 1)} / {| H6 (IM-2) -H6 (IM + 2) |} / 2 R (6) = C (6) / {YM1 -OF} Next, predetermined values are set to the determination levels Cth6 and Rth6, respectively, and focus detection is enabled only when both the contrast value C (6) and the ratio value R (6) satisfy the predetermined values. If either 6) or the ratio value R (6) is not satisfied, focus detection is disabled (steps # 259, # 260).

そののち、第13図のフローチャートに移行し、ステッ
プ#96あるいはステップ#98の処理を行う。
After that, the flow shifts to the flowchart of FIG. 13 to perform the process of step # 96 or step # 98.

次に、ステップ#256の補間演算の手段について第27
図の例を用いて説明する。
Next, regarding the means of the interpolation calculation in step # 256,
This will be described with reference to the example of FIG.

まず、基準部142aのデータ列を“3,2,1,−1,−2,−3"
とし、参照部142bのデータ列を“4,3,2,1,−1,−2,−3,
−4"とすると、相関関数はH(0)=0,H(−1)=6,H
(1)=6になる。ここで、参照部142bのデータ列にノ
イズが加わり、参照部142bのデータ列が“4,3,2,0,−1,
−1,−3,−4"に変化すると、相関関数はH(0)=2,H
(−1)=5,5,H(1)=6になり、合焦点、すなわ
ち、相関関数H(IM)に対するノイズの影響が最も大
きく、相関関数H(IM-1),H(IM+1)への影響は比較
的小さくなる。このため、相関関数H(IM)が周期的
な関数でない限り、相関関数H(IM)を用いずに、相
関関数H(IM)の前後の相関関数H(IM-2),H(IM-
1),H(IM+1),H(IM+2)を用いてノイズの影響を小
さくするようにしている。
First, the data string of the reference unit 142a is set to “3, 2, 1, −1, −2, −3”.
And the data string of the reference unit 142b is “4, 3, 2, 1, −1, −2, −3,
-4 ", the correlation function is H (0) = 0, H (-1) = 6, H
(1) = 6. Here, noise is added to the data sequence of the reference unit 142b, and the data sequence of the reference unit 142b is “4, 3, 2, 0, −1,
-1, -3, -4 ", the correlation function becomes H (0) = 2, H
(-1) = 5,5, H (1) = 6, and the influence of noise on the focal point, that is, the correlation function H (IM) is the largest, and the correlation functions H (IM-1), H (IM + The effect on 1) is relatively small. Therefore, unless the correlation function H (IM) is a periodic function, the correlation functions H (IM-2) and H (IM-) before and after the correlation function H (IM) are used without using the correlation function H (IM).
1), H (IM + 1), H (IM + 2) are used to reduce the influence of noise.

また、ステップ#258では、第18図(a)のような通
常の補間演算を行うと、オフセット量が生じるため、補
間値YM1からMAX{H6(IM-1),H6(IM+1)}と相関
関数H6(IM)との差OF1、あるいはMAX{H6(IM-2),H
6(IM+2)}とMAX{H6(IM-1),H6(IM+1)}との
差OF2、あるいはコントラスト値C(6)を引いた値に
基づいて設定した値OFを用いて比の値R(6)の演算を
行う。
Further, in step # 258, when the normal interpolation calculation as shown in FIG. 18 (a) is performed, an offset amount is generated, and therefore the interpolation value YM1 to MAX {H6 (IM-1), H6 (IM + 1)} Difference between the correlation function H6 (IM) and OF1 or MAX {H6 (IM-2), H
Using the difference OF2 between 6 (IM + 2)} and MAX (H6 (IM-1), H6 (IM + 1)}, or the value OF set based on the value obtained by subtracting the contrast value C (6) The ratio value R (6) is calculated.

(発明の効果) 本発明は、判定レベルを、焦点検出領域を分割した複
数の領域毎に設定するので、各領域毎に判定レベルを異
ならせて設定することができる。また、判定レベルを前
回の判定結果に応じて変更するので、前回の判定で焦点
が検出された後にレンズ駆動や手振れ等により被写体検
出の条件が若干変動しても焦点検出が可能と判定される
ようにすることができ、安定した焦点検出を行うことが
できる。
(Effect of the Invention) According to the present invention, the determination level is set for each of a plurality of areas into which the focus detection area is divided, so that the determination level can be set differently for each area. In addition, since the determination level is changed according to the previous determination result, it is determined that the focus detection is possible even if the subject detection condition slightly changes due to lens drive or camera shake after the focus is detected in the previous determination. Therefore, stable focus detection can be performed.

すなわち、本焦点検出装置を備えたカメラにより動い
ている被写体を撮影するような場合、一度被写体の焦点
が検出されると、その後も続けて該被写体の焦点検出が
行われるようにすることができ、したがって、該被写体
を連写することができる。
That is, when a moving subject is photographed by a camera equipped with the present focus detection device, once the focus of the subject is detected, the focus detection of the subject can be continuously performed thereafter. Therefore, the subject can be continuously shot.

また、判定レベルを、隣接する光電変換素子のデータ
の差分を総和したコントラスト値に応じて変更するの
で、光電変換素子アレイ等で発生するノイズを被写体と
誤判断することを防止することができ、確実な焦点検出
を行うことができる。
Further, since the determination level is changed according to the contrast value obtained by summing the differences between the data of the adjacent photoelectric conversion elements, it is possible to prevent the noise generated in the photoelectric conversion element array or the like from being erroneously determined as the subject, A reliable focus detection can be performed.

さらに、判定レベルを、隣接する光電変換素子のデー
タの差分を総和したコントラスト値と、一対の光像の相
互比較により求められる相関値の最良相関値との比に応
じて変更するので、被写体が複数であった場合等でも、
焦点検出の対象となる被写体を誤ることなく、正確な焦
点検出を行うことができる。
Further, the determination level is changed according to the ratio of the contrast value obtained by summing the differences between the data of the adjacent photoelectric conversion elements and the best correlation value of the correlation values obtained by the mutual comparison of the pair of optical images, so that the subject is Even if there are multiple,
Accurate focus detection can be performed without erroneously selecting the subject that is the focus detection target.

また、焦点検出動作の1回目の判定レベルは、焦点検
出動作の2回目以降の前回焦点検出判定で前回焦点検出
可能とされた場合よりも緩和されるので、焦点検出の対
象の被写体を誤ることを防止することができる。
Further, since the first determination level of the focus detection operation is relaxed compared to the case where the previous focus detection determination of the second and subsequent focus detection operations was made possible last time, the target object of focus detection may be mistaken. Can be prevented.

【図面の簡単な説明】[Brief description of the drawings]

第1図は本発明に係る自動焦点検出装置を備えたカメラ
の概略構成図、第2図は焦点検出手段の機構構成図、第
3図は光電変換素子アレイを示す図、第4図はファイン
ダ内の撮影画面の焦点検出領域を示す図、第5図は第1
アイランド〜第3アイランドに対応する基準部を拡大し
た図、第6図,第7図は各ブロックのデフォーカス範囲
を説明する図、第8図は本発明に係る自動焦点検出装置
をマイコンを用いて構成したカメラの回路ブロック図、
第9図,第10図はマイコンの割り込み動作のフローチャ
ート、第11図〜第14図は第1アイランド〜第3アイラン
ドのデフォーカス量演算のサブルーチンを示すフローチ
ャート、第15図は露出演算のサブルーチンを示すフロー
チャート、第16図はデフォーカス量の演算手段を選択す
る手順を説明する図、第17図は平均処理幅を求めるサブ
ルーチンを示すフローチャート、第18図(a)は第3ブ
ロックのデフォーカス量の演算および焦点検出不能判断
を説明する図、第18図(b)は人物が並んでいるような
場合に誤判定することを説明する図、第19図は各ブロッ
クの相関関数およびコントラスト値の演算を示す図、第
20図〜第22図はコントラスト限界の判定のサブルーチン
を示すフローチャート、第23図〜第25図は平均処理ルー
チンを示すフローチャート、第26図はデフォーカス量演
算サブルーチンを示すフローチャート、第27図は補間演
算の手段を説明する図である。 1……自動焦点検出装置、2……撮影レンズ、3……焦
点検出手段、4……デフォーカス量決定手段、5……レ
ンズ位置検出手段、6……レンズ駆動手段、7……制御
手段、8……被写体、21……第1アイランド、22……第
2アイランド、23……第3アイランド、26……マイコ
ン、27……レンズ回路、28……焦点検出データ出力回
路、34……レンズ制御回路、35……電源電池、36……給
電回路、141a,142a,143a……基準部、141b,142b,143b…
…参照部、BL1……第1ブロック、BL2……第2ブロッ
ク、BL3……第3ブロック、BL4……第4ブロック、BL5
……第5ブロック、BL9……第9ブロック、BL10……第1
0ブロック、SW1……電源スイッチ、SW2……撮影準備ス
イッチ、SW4……選択スイッチ。
FIG. 1 is a schematic configuration diagram of a camera provided with an automatic focus detection device according to the present invention, FIG. 2 is a configuration diagram of a focus detection unit, FIG. 3 is a diagram showing a photoelectric conversion element array, and FIG. FIG. 5 shows a focus detection area of a photographing screen in FIG.
FIGS. 6 and 7 are diagrams illustrating the defocus range of each block, and FIG. 8 is a diagram illustrating an automatic focus detection device according to the present invention using a microcomputer. Circuit block diagram of the camera configured
9 and 10 are flowcharts of the interrupt operation of the microcomputer, FIGS. 11 to 14 are flowcharts showing a subroutine of the defocus amount calculation of the first to third islands, and FIG. 15 is a subroutine of the exposure calculation. FIG. 16 is a diagram for explaining a procedure for selecting a calculating means of the defocus amount, FIG. 17 is a flowchart showing a subroutine for obtaining an average processing width, and FIG. 18 (a) is a defocus amount of the third block. FIG. 18 (b) is a diagram for explaining the calculation and the focus detection impossible determination, FIG. 18 (b) is a diagram for explaining erroneous determination when a person is lined up, and FIG. FIG.
20 to 22 are flowcharts showing a subroutine for determining the contrast limit, FIGS. 23 to 25 are flowcharts showing an averaging process routine, FIG. 26 is a flowchart showing a defocus amount calculation subroutine, and FIG. 27 is an interpolation FIG. 4 is a diagram for explaining means of calculation. DESCRIPTION OF SYMBOLS 1 ... Automatic focus detection device, 2 ... Photographing lens, 3 ... Focus detection means, 4 ... Defocus amount determination means, 5 ... Lens position detection means, 6 ... Lens drive means, 7 ... Control means , 8 subject, 21 ... first island, 22 ... second island, 23 ... third island, 26 ... microcomputer, 27 ... lens circuit, 28 ... focus detection data output circuit, 34 ... Lens control circuit, 35 ... Power battery, 36 ... Power supply circuit, 141a, 142a, 143a ... Reference part, 141b, 142b, 143b ...
Reference section, BL1 First block, BL2 Second block, BL3 Third block, BL4 Fourth block, BL5
... 5th block, BL9 ... 9th block, BL10 ... 1st
0 block, SW 1 ... Power switch, SW 2 ... Shooting preparation switch, SW 4 ... Selection switch.

フロントページの続き (72)発明者 石橋 賢司 大阪府大阪市中央区安土町2丁目3番13 号 大阪国際ビル ミノルタカメラ株式 会社内 (72)発明者 糊田 寿夫 大阪府大阪市中央区安土町2丁目3番13 号 大阪国際ビル ミノルタカメラ株式 会社内 (72)発明者 上田 浩 大阪府大阪市中央区安土町2丁目3番13 号 大阪国際ビル ミノルタカメラ株式 会社内 (72)発明者 沖須 宣之 大阪府大阪市中央区安土町2丁目3番13 号 大阪国際ビル ミノルタカメラ株式 会社内 (56)参考文献 特開 昭63−17415(JP,A) 特開 昭60−247210(JP,A) 特開 昭62−150310(JP,A)Front Page Continuation (72) Kenji Ishibashi, Inventor Kenji Ishibashi 2-3-13 Azuchi-cho, Chuo-ku, Osaka Prefecture Osaka International Building Minolta Camera Co., Ltd. (72) Inventor, Hisao Morita 2 Azuchi-cho, Chuo-ku, Osaka-shi, Osaka Chome 3-13 Osaka International Building Minolta Camera Co., Ltd. (72) Inventor Hiroshi Ueda 2-33 Azuchicho, Chuo-ku, Osaka-shi, Osaka Osaka International Building Minolta Camera Co., Ltd. (72) Inventor Noriyuki Okisu 2-13-3 Azuchicho, Chuo-ku, Osaka City, Osaka Prefecture Osaka International Building Minolta Camera Co., Ltd. (56) References JP 63-17415 (JP, A) JP 60-247210 (JP, A) Special Kai 62-150310 (JP, A)

Claims (4)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】焦点検出領域に入射した被写体の光像に基
づいて焦点状態を検出する焦点検出装置において、前記
焦点検出領域を分割した複数の領域において、各領域毎
に判定レベルを設定する判定レベル設定手段と、前記各
領域毎に、設定された判定レベルと各領域のデータに基
づいた演算結果とを比較することにより焦点検出が可能
か否かを判定する判定手段と、前記判定結果を記憶する
記憶手段と、記憶された前回の判定結果に応じて前記判
定レベルを変更する変更手段とを備えたことを特徴とす
る焦点検出装置。
1. A focus detection device for detecting a focus state based on a light image of a subject incident on a focus detection region, wherein a determination level is set for each of a plurality of regions into which the focus detection region is divided. Level setting means, a judgment means for judging whether or not focus detection is possible by comparing the judgment level set for each area and a calculation result based on the data of each area, and the judgment result A focus detection device comprising: a storage unit that stores the change and a change unit that changes the determination level according to the stored previous determination result.
【請求項2】前記焦点検出装置は、複数の光電変換素子
からなる受光素子列を備え、前記判定レベルは隣接する
光電変換素子のデータの差分を総和したコントラスト値
に応じて変更されるようにしたことを特徴とする請求項
1記載の焦点検出装置。
2. The focus detection device includes a light receiving element array including a plurality of photoelectric conversion elements, and the determination level is changed according to a contrast value obtained by summing up differences between data of adjacent photoelectric conversion elements. The focus detection device according to claim 1, wherein
【請求項3】前記焦点検出装置は、入射した被写体の光
像から得られた一対の光像を受光する複数の光電変換素
子からなる受光素子列を備え、前記判定レベルは隣接す
る光電変換素子のデータの差分を総和したコントラスト
値と、前記一対の光像の相互比較により求められる相関
値の最良相関値との比に応じて変更されることを特徴と
する請求項1記載の焦点検出装置。
3. The focus detection device includes a light receiving element array including a plurality of photoelectric conversion elements that receive a pair of optical images obtained from an optical image of an incident object, and the determination levels are adjacent photoelectric conversion elements. The focus detection device according to claim 1, wherein the focus detection device is changed in accordance with a ratio between a contrast value obtained by summing up the differences of the data of (1) and a best correlation value of correlation values obtained by mutual comparison of the pair of optical images. .
【請求項4】焦点検出動作の1回目のときは、焦点検出
動作の2回目以降に前回焦点検出不能と判定されるとき
よりも判定レベルを低レベルにしたことを特徴とする請
求項1記載の焦点検出装置。
4. The determination level at the first focus detection operation is set to a lower level than when the focus detection operation is determined to be impossible last time after the second focus detection operation. Focus detection device.
JP10089889A 1989-04-20 1989-04-20 Focus detection device Expired - Lifetime JP2671489B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10089889A JP2671489B2 (en) 1989-04-20 1989-04-20 Focus detection device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10089889A JP2671489B2 (en) 1989-04-20 1989-04-20 Focus detection device

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP63118792A Division JP2770318B2 (en) 1988-05-16 1988-05-16 Automatic focus detection device

Publications (2)

Publication Number Publication Date
JPH026916A JPH026916A (en) 1990-01-11
JP2671489B2 true JP2671489B2 (en) 1997-10-29

Family

ID=14286162

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10089889A Expired - Lifetime JP2671489B2 (en) 1989-04-20 1989-04-20 Focus detection device

Country Status (1)

Country Link
JP (1) JP2671489B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3414500B2 (en) * 1994-06-30 2003-06-09 オリンパス光学工業株式会社 Focus detection device

Also Published As

Publication number Publication date
JPH026916A (en) 1990-01-11

Similar Documents

Publication Publication Date Title
JP2605282B2 (en) Automatic focusing device
JP5424708B2 (en) Focus detection device
US5091742A (en) Camera having an auto focusing device
JPH05297266A (en) Camera with focus sensing means and line-of-sight sensing means
JPS62229213A (en) Photographic lens barrel
JPH10311999A (en) Camera
US6463214B1 (en) Multi-point autofocus system
US4905032A (en) Automatic focus detecting device
US6636699B2 (en) Focus detection device and distance measurement device
US5144357A (en) Automatic focus detecting means
JP2770408B2 (en) Focus detection device
JP2671489B2 (en) Focus detection device
JP2671491B2 (en) Focus detection device
JP2682132B2 (en) Focus detection device
JP4950634B2 (en) Imaging apparatus and imaging system
EP0438140B1 (en) Focus detecting device in a camera
JP2671490B2 (en) Focus detection device
JP2671493B2 (en) Focus detection device
JP2770318B2 (en) Automatic focus detection device
JP2770407B2 (en) Focus detection device
JP5171124B2 (en) Focus adjustment device, imaging device, and focus adjustment method
JPH0215217A (en) Focus detector
JP2979417B2 (en) Multi-photometer
JPS63262611A (en) Automatic focusing device
JP3912853B2 (en) camera

Legal Events

Date Code Title Description
FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080711

Year of fee payment: 11

EXPY Cancellation because of completion of term