JPH0215218A - Focus detecting device - Google Patents

Focus detecting device

Info

Publication number
JPH0215218A
JPH0215218A JP10325689A JP10325689A JPH0215218A JP H0215218 A JPH0215218 A JP H0215218A JP 10325689 A JP10325689 A JP 10325689A JP 10325689 A JP10325689 A JP 10325689A JP H0215218 A JPH0215218 A JP H0215218A
Authority
JP
Japan
Prior art keywords
data
focus detection
block
value
island
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP10325689A
Other languages
Japanese (ja)
Inventor
Tokuji Ishida
石田 徳治
Masataka Hamada
正隆 浜田
Kenji Ishibashi
賢司 石橋
Toshio Norita
寿夫 糊田
Hiroshi Ueda
浩 上田
Noriyuki Okisu
宣之 沖須
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Minolta Co Ltd
Original Assignee
Minolta Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Minolta Co Ltd filed Critical Minolta Co Ltd
Priority to JP10325689A priority Critical patent/JPH0215218A/en
Publication of JPH0215218A publication Critical patent/JPH0215218A/en
Pending legal-status Critical Current

Links

Landscapes

  • Automatic Focus Adjustment (AREA)

Abstract

PURPOSE:To stably detect focusing of an object with an overall low contrast by extracting part of data from plural pieces of data by a local contrast extracting means and deciding whether the object has a high contrast difference, or not. CONSTITUTION:The title device is to detect contrast based on optical images of the object in focus detecting areas 21 to 23 located in the central part of a photographic screen 20 in a finder. In an automatic focus detecting device, data on picture elements of the reference parts 141a to 143a in photoelectric conversion element arrays 141 to 143 divided into plural blocks, and each of them is compared with entire data in reference parts 141b to 143b to detect a focus. Part of data is extracted out of plural pieces of data, and according to it, a decision level is altered to compare each data. As a result, an object which has an overall low contrast but a locally high contrast difference can be detected stable focusing.

Description

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

〔従来の技術〕[Conventional technology]

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

この種の自動焦点検出装置では、例えば、被写体のコン
トラストが低い場合には、焦点検出可能かどうかの判定
が不安定になり、正確な焦点検出ができないとともに、
撮影レンズが微振動を生じることがある。
With this type of automatic focus detection device, for example, when the contrast of the subject is low, the determination as to whether focus detection is possible becomes unstable, and accurate focus detection becomes impossible.
The photographic lens may cause slight vibrations.

このような場合を考慮して、前回の検出結果が焦点検出
可能であったかどうかにより、焦点検出の判定レベルを
変更して安定した焦点検出を行うようにしたもの(特開
昭60−247210号公報)や、コントラスト値が所
定値以下の場合には複数回検出されたコントラスト信号
を平均し、この平均値を用いて焦点検出するようにした
ものがある(特開昭61−186917号公報)。
In consideration of such a case, the focus detection determination level is changed depending on whether or not the previous detection result indicates that focus detection was possible, and stable focus detection is performed (Japanese Patent Application Laid-Open No. 60-247210). ), and when the contrast value is less than a predetermined value, contrast signals detected a plurality of times are averaged, and this average value is used for focus detection (Japanese Patent Laid-Open No. 186917/1983).

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

ところが、特開昭60−247210号公報の自動焦点
検出装置にあっては、例えば、被写体の光像が局所的に
高いコントラスト差を持ち、この局所コントラストを用
いると焦点検出を行うことができるような場合であって
も、被写体全体としてコントラストが低いと、焦点検出
不可能と判定されることになる。
However, in the automatic focus detection device disclosed in Japanese Patent Application Laid-Open No. 60-247210, for example, the optical image of the object has a locally high contrast difference, and focus detection can be performed using this local contrast. Even in such a case, if the contrast of the object as a whole is low, it will be determined that focus cannot be detected.

また、特開昭61−186917号公報の自動焦点検出
装置でも、被写体全体としてコントラストが低いと、局
所的には高いコントラスト差があってもコントラスト信
号の平均化が行われ、焦点検出の応答性が悪くなるとい
った問題がある。
In addition, even with the automatic focus detection device disclosed in JP-A-61-186917, if the contrast of the subject as a whole is low, the contrast signal is averaged even if there is a locally high contrast difference, resulting in poor focus detection response. There is a problem that it becomes worse.

本発明は、局所的に高いコントラスト差を持つ被写体で
あれば、安定した焦点検出を行うことができる焦点検出
装置を提供することを目的とする。
SUMMARY OF THE INVENTION An object of the present invention is to provide a focus detection device that can perform stable focus detection for objects that have a locally high contrast difference.

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

前記目的を達成するために、本発明は、被写体の光像の
コントラストを検出する焦点検出領域を有する焦点検出
装置において、上記焦点検出領域からの複数個のデータ
の内から一部のデータを抽出する局所コントラスト抽出
手段と、該局所コントラスト抽出手段からのデータに応
じて判定レベルを設定する判定レベル設定手段と、上記
判定レベルと上記焦点検出領域からのデータとを比較し
て焦点検出が可能か否かを判定する判定手段とを備えた
ものである。
In order to achieve the above object, the present invention provides a focus detection device having a focus detection area for detecting the contrast of an optical image of a subject, in which a part of data is extracted from a plurality of pieces of data from the focus detection area. a local contrast extracting means for extracting a local contrast; a determination level setting means for setting a determination level according to data from the local contrast extracting means; and determining means for determining whether or not.

また、請求項2では、局所コントラスト抽出手段は焦点
検出領域からのデータの内から隣接する所定個数のデー
タを抽出するとともに、これらの差を総和してなるデー
タブロックCLCOを演算し、判定レベルは上記データ
ブロックCLCOに応じて変更されるようにした。
Further, in claim 2, the local contrast extraction means extracts a predetermined number of adjacent data from among the data from the focus detection area, and calculates a data block CLCO formed by summing these differences, and the determination level is It is changed according to the data block CLCO.

さらに、請求項3では、局所コントラスト抽出手段は焦
点検出領域からのデータの内から最大値と最小値とを抽
出するとともに、判定レベルは上記最大値と上記最小値
との差に応じて変更されるようにした。
Furthermore, in claim 3, the local contrast extraction means extracts a maximum value and a minimum value from the data from the focus detection area, and the determination level is changed according to the difference between the maximum value and the minimum value. It was to so.

また、請求項4では、局所コントラスト抽出手段は焦点
検出領域からのデータの内から第1の所定値以下と第2
の所定値以下のデータを抽出するとともに、判定レベル
は上記データの個数に応じて変更されるようにした。
Further, in claim 4, the local contrast extracting means selects a first predetermined value or less and a second predetermined value from among the data from the focus detection area.
Data below a predetermined value are extracted, and the determination level is changed according to the number of data.

〔作用〕[Effect]

前記構成の焦点検出装置によれば、判定レベルは焦点検
出領域からの複数のデータの内から抽出された一部のデ
ータに応じて変更され、この判定レベルに応じて焦点を
検出できるかどうかが判定される。
According to the focus detection device having the above configuration, the determination level is changed according to a part of data extracted from a plurality of data from the focus detection area, and whether or not the focus can be detected is determined according to this determination level. It will be judged.

また、焦点検出領域からのデータの内から隣接する所定
個数のデータが抽出され、これらの差を総和してなるデ
ータブロックCLCOが演算され、判定レベルは上記デ
ータブロックCLCOに応じて変更される。
Further, a predetermined number of adjacent pieces of data are extracted from among the data from the focus detection area, and a data block CLCO is calculated by summing the differences between them, and the determination level is changed according to the data block CLCO.

さらに、判定レベルは焦点検出領域からのデータの内か
ら抽出された最大値と最小値との差に応じて変更される
Further, the determination level is changed according to the difference between the maximum value and the minimum value extracted from the data from the focus detection area.

また、判定レベルは焦点検出領域からのデータの内から
抽出された第1の所定値以上と第2の所定値以下のデー
タの個数とに応じて変更される。
Further, the determination level is changed depending on the number of data extracted from the data from the focus detection area that is equal to or greater than the first predetermined value and equal to or less than the second predetermined value.

〔実施例〕〔Example〕

第1図は本発明に係る自動焦点検出装置を備えたカメラ
の概略構成の一実施例を示す。自動焦点検出装置1は撮
影レンズ2と焦点検出手段3とデフォーカス量決定手段
4とレンズ位置検出手段5どレンズ駆動手段6と制御手
段7とから構成されている。この撮影レンズ2は被写体
8から発ぜられた光束9を焦点検出手段3に導くもので
ある。
FIG. 1 shows an embodiment of the schematic configuration of a camera equipped with an automatic focus detection device according to the present invention. The automatic focus detection device 1 is composed of a photographing lens 2, a focus detection means 3, a defocus amount determination means 4, a lens position detection means 5, a lens drive means 6, and a control means 7. This photographing lens 2 guides a light beam 9 emitted from a subject 8 to a focus detection means 3.

焦点検出手段3は光電変換素子アレイ(図示せず〉を有
し、この光電変換素子アレイの出)〕を演鼻処理して光
電変換素子アレイ上の被写体8による光像の相対的変位
を検出するものである。
The focus detection means 3 has a photoelectric conversion element array (not shown), and detects the relative displacement of the optical image due to the subject 8 on the photoelectric conversion element array by performing nose processing on the photoelectric conversion element array (not shown). It is something to do.

また、デフォーカス量決定手段4は前記焦点検出手段3
から出力される変位検出信号に基づいて撮影レンズ2の
デフォーカス量を決定するものである。レンズ位置検出
手段5は撮影レンズ2の現在の位置を検出するものであ
る。レンズ駆動手段6は前記デフォーカス量決定手段4
のデフォーカス量信号に基づいて撮影レンズ2を駆動す
るものである。制御手段7は、前記デフォーカス量に苅
応する位置に撮影レンズ2が駆動されるようにレンズ駆
動手段6を制御するとともに、前記焦点検出手段3から
合焦信号が出力されたとき、撮影レンズ2の駆動を停止
させるものである。
Further, the defocus amount determining means 4 is configured to include the focus detecting means 3
The amount of defocus of the photographic lens 2 is determined based on the displacement detection signal output from the lens. The lens position detection means 5 detects the current position of the photographic lens 2. The lens driving means 6 is the defocus amount determining means 4.
The photographic lens 2 is driven based on the defocus amount signal. 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 also controls the photographing lens 2 when the focus signal is output from the focus detecting means 3. This is to stop the drive of No. 2.

第2図は前記焦点検出手段3の機構構成の一実施例を示
ず。焦点検出手段3は主ミラー1oとサブミラー11と
焦点検出光学系12とから構成されている。この主ミラ
ー1oは撮影レンズ2を通過した光束9を図示しないフ
ァインダ光学系とサブミラー11とに分岐させるもので
ある。ザブミラー11は主ミラー10で分岐された光束
9を、さらに焦点検出光学系12どフィルム面13とに
分岐させるものである。
FIG. 2 does not show an example of the mechanical configuration of the focus detection means 3. The focus detection means 3 is composed of a main mirror 1o, a submirror 11, and a focus detection optical system 12. This main mirror 1o branches the light beam 9 that has passed through the photographing lens 2 into a finder optical system and a submirror 11 (not shown). The submirror 11 further branches the light beam 9 branched by the main mirror 10 to a focus detection optical system 12 and a film surface 13.

前記焦点検出光学系12は光電変換素子アレイ141.
142.1/1.3とセパレータレンズ15と絞りマス
ク16とモジュールミラー17とコンデンサレンズ18
1,182,183と視野絞り19どから構成されてい
る。光電変換素子アレイ141.142,143は複数
のCOD撮像素子等を配列したもので、セパレータレン
ズ15の焦点面14上のワンデツプ上に形成されている
。セパレータレンズ15はセパレータレンズ対151゜
152.153を有し、分岐された光束9を光電変換素
子アレイ14.1,142,143に投影するものであ
る。絞りマスク16は円形あるいは長円形の開口部16
1,162,163を有し、セパレータレンズ15へ入
力する光束9を限定するものである。モジュールミラー
17はコンデンサレンズ181,182,183を通過
した光束9をセパレータレンズ15へ導くものである。
The focus detection optical system 12 includes a photoelectric conversion element array 141.
142.1/1.3, separator lens 15, aperture mask 16, module mirror 17, and condenser lens 18
1, 182, 183, a field stop 19, etc. The photoelectric conversion element arrays 141, 142, 143 are arrays of a plurality of COD imaging elements, etc., and are formed one depth above the focal plane 14 of the separator lens 15. The separator lens 15 has a pair of separator lenses 151.degree. The aperture mask 16 has a circular or oval opening 16.
1,162,163, and limits the light flux 9 input to the separator lens 15. The module mirror 17 guides the light beam 9 that has passed through the condenser lenses 181, 182, and 183 to the separator lens 15.

視野絞り19は矩形開口部191,192,193を有
するとともに、焦点面近傍に配設され、焦点検出光学系
12に入力される光束9の視野を限定するものである。
The field stop 19 has rectangular openings 191, 192, and 193, and is arranged near the focal plane to limit the field of view of the light beam 9 input to the focus detection optical system 12.

第3図は前記光電変換素子アレイ141,142.14
3の受光部(以下、光電変換素子の受光部と蓄積部と転
送部とを含めてCCDという)を示している。この光電
変換素子アレイ141は基準部141aと参照部141
bと光電センサー41Cとからなり、同様に光電変換素
子アレイ142は基準部142aと参照部142bと光
電センサ142Cとからなり、光電変換素子アレイ14
3は基準部143aと参照部143bと光電センす14
3Cとからなる。前記光電センサ141c。
FIG. 3 shows the photoelectric conversion element arrays 141, 142.14.
3 (hereinafter referred to as a CCD including the light receiving section, the storage section, and the transfer section of the photoelectric conversion element). This photoelectric conversion element array 141 includes a reference portion 141a and a reference portion 141.
Similarly, the photoelectric conversion element array 142 consists of a reference part 142a, a reference part 142b, and a photoelectric sensor 142C, and the photoelectric conversion element array 14
3 is a reference part 143a, a reference part 143b and a photoelectric sensor 14
It consists of 3C. The photoelectric sensor 141c.

142c、143cはそれぞれ基準部141a。142c and 143c are reference portions 141a, respectively.

142a、143aの一方の側部に長手方向に配設され
、受光量に応じた信号を出力するようになっている。そ
して、この受光量に応じた信号によりCODの蓄積部へ
の蓄積時間を制御するようになっている。また、光電変
換素子アレイ141゜142.143は、第4図に示す
ように、ファインダ内の撮影画面20の中央部に位置す
る焦点検出領域21,22.23 (以下、それぞれ第
1アイランド21.第2アイランド22.第3アイラン
ド23という)に投影される被写体8の光像に基づいて
変位検出信号を出力するようになっている。
It is arranged in the longitudinal direction on one side of 142a and 143a, and outputs a signal according to the amount of light received. Then, the storage time of COD in the storage section is controlled by a signal corresponding to the amount of received light. Further, as shown in FIG. 4, the photoelectric conversion element arrays 141, 142, 143 have focus detection areas 21, 22, 23 (hereinafter referred to as first islands 21, 22, 23, respectively) located at the center of the photographing screen 20 in the finder. A displacement detection signal is output based on the optical image of the subject 8 projected onto the second island 22 and third island 23).

撮影画面20の中央部に点線で示された領域24は撮影
者に焦点検出を行っている領域を表示するものである。
An area 24 indicated by a dotted line in the center of the photographing screen 20 is for displaying to the photographer the area where focus detection is being performed.

また、表示部25は合焦時に点灯するものである。Further, the display section 25 lights up when the image is in focus.

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

また、自動焦点検出装置1では基準部141a。Further, in the automatic focus detection device 1, the reference portion 141a.

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

次いで、前記光電変換素子アレイ141,142.14
3からデフォーカス量(すなわち、デフオーカス量とは
結像光学系の予定焦点面と被写体像面との光軸方向のず
れ量)を検出する範囲(デフォーカス範囲)を求める手
段について第5図〜第7図を用いて説明する。
Next, the photoelectric conversion element arrays 141, 142.14
3 shows the means for determining the range (defocus range) for detecting the defocus amount (that is, the defocus amount is the amount of deviation in the optical axis direction between the intended focal plane of the imaging optical system and the subject image plane). This will be explained using FIG.

第5図は第3図に示した各アイランド21.22.23
に対応する基準部141a、142a。
Figure 5 shows each island 21, 22, 23 shown in Figure 3.
Reference parts 141a and 142a corresponding to.

143aの差分データ領域を拡大して示したものである
。同図において、各基準部141a、142a、143
aに示している数値は、第3図に示した基準部141a
、142a、143aの各画素のデータをそれぞれ3つ
置きに検出し、それらの差をとった差分(すなわち、空
間周波数成分)のデータ数を示している。また、この差
分データは、前記画素データから抽出(フィルタリング
)された特定の空間周波数の成分を示している(第1の
空間周波数成分抽出手段)。なお、差分データは2つ、
または1つ置きでもよい。ただし、前記空間周波数成分
は3つ置きにとったときと異なり、かつ、前記数値も異
なる。
This is an enlarged view of the differential data area of 143a. In the figure, each reference portion 141a, 142a, 143
The numerical value shown in a is the reference part 141a shown in FIG.
, 142a, and 143a are detected every third pixel, and the difference (that is, spatial frequency component) obtained by calculating the difference between the data is shown. Further, this difference data indicates a specific spatial frequency component extracted (filtered) from the pixel data (first spatial frequency component extraction means). In addition, there are two difference data,
Or you can use every other one. However, the spatial frequency components are different from when every third spatial frequency component is taken, and the numerical values are also different.

各アイランド21,22.23の基準部141a、14
2a、143aにおける前記数値は、第1アイランド2
1では30個、第2アイランド22では40個、第3ア
イランド23では30個になる。また、参照部141b
、142b、143bに対しても基準部141a、14
2a、143aの差分データの数値と同様に求められる
。つまり、参照部141b、142b、143bの数値
は、第1アイランド21では40個、第2アイランド2
2では48個、第3アイランド23では40個になる。
Reference portions 141a, 14 of each island 21, 22.23
2a, 143a are the values for the first island 2
1, there are 30 pieces, 40 pieces on the second island 22, and 30 pieces on the third island 23. Also, the reference part 141b
, 142b, 143b as well as the reference parts 141a, 14
It is obtained in the same way as the numerical value of the difference data of 2a and 143a. In other words, the numerical values of the reference parts 141b, 142b, and 143b are 40 in the first island 21 and 40 in the second island 2.
In the second island, the number is 48, and in the third island 23, the number is 40.

次に、各アイランド21.22.23でのブロック分割
について説明する。すなわち、第1アイランド21では
、上端の差分データからに1(1〜20)、に1(11
〜30)の2つのブロックに分け、それぞれ第1ブロツ
クBL1、第2ブロツクB[2とする。第2アイランド
22では、左端の差分データからに2(1〜20)、に
2く11〜30)、に2(21〜40)の3つのブロッ
クに分け、それぞれ第3ブロツクBL3、第4ブロツク
B[4、第5ブロツクBL5とする。第3アイランド2
3では、上端の差分データからに3 (1〜20)、に
3(11〜30)の2つのブロックに分け、それぞれ第
9ブロツクBL9、第10ブロツクBL10とする。
Next, block division in each island 21, 22, and 23 will be explained. That is, in the first island 21, 1 (1 to 20) and 1 (11) are calculated from the upper end difference data.
-30) are divided into two blocks, the first block BL1 and the second block B[2. In the second island 22, the differential data at the left end is divided into three blocks: 2 (1 to 20), 2 (11 to 30), and 2 (21 to 40), and the third block BL3 and the fourth block are divided into three blocks, BL3 and BL3, respectively. B[4, fifth block BL5. 3rd island 2
3, the differential data at the upper end is divided into two blocks, 3 (1 to 20) and 3 (11 to 30), and are respectively designated as a ninth block BL9 and a 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とし、右側の2
5個を第8ブロツクBL8になる。
Furthermore, the second island 22 detects differential data whose extraction frequency is changed in order to focus on a subject consisting of low frequency components (second spatial frequency component extracting means), and transfers this differential data to the sixth block BL6, It is divided into a seventh block BL7 and an eighth block BL8 and used as focus detection data. That is, the data of each pixel in the reference part 142a and the reference part 142b is differenced, for example, every seventh pixel, the sum of the difference data between adjacent pixels is found, and the data of this sum is set as the sixth block BL6. That is, the number of difference data every seventh block is 36 in the reference section 142a and 44 in the reference section 142b, and the number of data in the sixth block BL6 is 35 in the reference section 142a and 44 in the reference section 142b.
So there will be 43 pieces. 35 of this reference portion 142a.
The 25 pieces on the left side of the block are set as the 7th block BL7, and the 25 pieces on the right side are the 7th block BL7.
The 5 pieces become the 8th block BL8.

なJ)、前述では差分の間隔を7つ置きにしたが、この
間隔は大ぎいほど低周波成分を抽出することができる。
J) In the above, the interval between the differences was set at every seventh interval, but the larger the interval, the more low frequency components can be extracted.

つまり、差分の間隔を7つ置き以外の間隔にしてもよい
In other words, the interval between the differences may be set to an interval other than every seven.

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

第6図は第2アイランド22の基準部142aおよび参
照部142bを拡大して示しており、同図を用いてブロ
ック分けした第4ブロツクBL4のデフォーカス範囲を
説明する。つまり、基準部142aの第4ブロツクBL
4の像と合焦するには、参照部142bの中央に位置す
るブロックB[41、すなわち参照部142bの左端よ
り15番目から34番目に位置する像のデータと第4ブ
ロツクBL4のデータに2(11〜30)とが一致する
ときである。そして、これより像の一致が参照部142
bの左側になると前ピンとなり、前ピンの最大のずれデ
ータ数(以下、ずれピッチという)は14個となる。一
方、像の一致が参照部142bの右側になると後ピンと
なり、後ピンの最大のずれピッチは14個となる。
FIG. 6 shows an enlarged view of the reference portion 142a and the reference portion 142b of the second island 22, and the defocus range of the fourth block BL4, which is divided into blocks, will be explained using this figure. In other words, the fourth block BL of the reference portion 142a
In order to focus on the image No. 4, the data of the block B [41 located at the center of the reference section 142b, that is, the image located 15th to 34th from the left end of the reference section 142b, and the data of the fourth block BL4 must be combined with the data of the fourth block BL4. (11 to 30) match. From this, the images match the reference part 142.
The left side of b is the front pin, and the maximum number of deviation data for the front pin (hereinafter referred to as deviation pitch) is 14. On the other hand, when the images match on the right side of the reference portion 142b, the rear focus becomes a rear focus, and the maximum displacement pitch of the rear focus becomes 14 pieces.

また、第1アイランド21および第3アイランド23に
ついても同様である。すなわち、第7図に小ずように、
第3ブロツクBL3では、前ピン側ずれピッチが4g、
後ピン側ずれピッチが24個であり、第5ブロツクBL
5では、前ピン側ずれピッチが24個、後ピン側ずれピ
ッチが4個である。
The same applies to the first island 21 and the third island 23. In other words, as shown in Figure 7,
In the third block BL3, the front pin side deviation pitch is 4g,
The rear pin side deviation pitch is 24, and the fifth block BL
In No. 5, the number of deviation pitches on the front pin side is 24 and the number of deviation pitches on the rear pin side is 4.

また、第1ブロツクBL1および第9ブロツクBL9で
は、前ピン側ずれピッチが5個、後ピン側ずれビッヂが
15個であり、第2ブロックB1−2および第10ブロ
ツクBLIOでは、前ピン側ずれピッチが15個、後ピ
ン側ずれピッチが5個である。さらに、第6ブロツクB
L6では、前ピン側、後ピン側共にずれピッチが4個で
ある。
Furthermore, in the first block BL1 and the ninth block BL9, the number of front pin side deviation pitches is 5 and the number of rear pin side deviation pitches is 15, and in the second block B1-2 and the tenth block BLIO, the number of front pin side deviation pitches is 15. There are 15 pitches and 5 rear pin side deviation pitches. Furthermore, the 6th block B
At L6, the deviation pitch is 4 on both the front pin side and the rear pin side.

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

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

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

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

また、マイコン26の内部にはカウンタが備えられてい
る。このカウンタは、撮影レンズ2の無限遠位置からの
繰り出し位置を検出するもので、前記パルス数に対して
カウントアツプあるVXtまカウントダウンするように
なっている。また、後’rliの電源スィッチ(メイン
スイッチ)SWlがオンされ、さらに、撮影レンズ2が
駆動されて撮影レンズ2が無限遠位置に繰り込まれたと
きに【よ、前記カウンタはリセットされるようになって
(Xる。
Additionally, a counter is provided inside the microcomputer 26. This counter detects the extended position of the photographing lens 2 from the infinite position, and is designed to count down to VXt, which is a count up to the number of pulses. Also, when the power switch (main switch) SWl of the rear 'rli is turned on and the photographing lens 2 is driven and the photographing lens 2 is retracted to the infinity position, the counter is reset. Become (Xru.

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

電源スイッチSW1は開閉操作されることによりカメラ
の動作を開始あるいは“停止させるものである。ワンシ
ョット回路37は、前記電源スィッチSW+の開閉操作
に連動して所定のパルスを発生させ、このパルスをマイ
コン26に入力するものである。撮影準備スイッチSW
2はレリーズスイッチ(図示せず)の操作により開閉さ
れるもので、この撮影準備スイッチSW2がオンすると
、焦点検出動作が開始されるようになっている。リミッ
トスイッチSW3は、撮影レンズ2が無限遠位置に繰り
込まれたとぎ、あるいは最先端まで繰り出されたときに
オンするものである。選択スイッチSW4は、自動焦点
調整モード(以下、AFモードという)か、あるいは焦
点検出表示モード(以下、FAモードという)かを選択
するもので、この選択スイッチSW4をオンするとFA
モードになり、オフするとAFモードになるものである
The power switch SW1 starts or "stops" the operation of the camera when the power switch SW1 is opened or closed.The one-shot circuit 37 generates a predetermined pulse in conjunction with the opening or closing operation of the power switch SW+. This is input to the microcomputer 26. Shooting preparation switch SW
2 is opened and closed by operating a release switch (not shown), and when this photography preparation switch SW2 is turned on, a focus detection operation is started. The limit switch SW3 is turned on when the photographing lens 2 is retracted to the infinite position or extended to the most extreme position. The selection switch SW4 is for selecting automatic focus adjustment mode (hereinafter referred to as AF mode) or focus detection display mode (hereinafter referred to as FA mode).When this selection switch SW4 is turned on, FA mode is selected.
mode, and when turned off, it becomes AF mode.

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

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

すなわち、マイコン26は撮影準備スイッチSW2のオ
ンによる焦点検出動作を禁止しくステップ#1)、この
割り込み動作が電源スィッチSW1のオンによるものか
、オフによるものかをマイコン26の割込入力端子IP
Iに入力された電圧により判定する(ステップ#2)。
That is, the microcomputer 26 prohibits the focus detection operation caused by turning on the photographing preparation switch SW2 (step #1), and determines whether this interrupt operation is caused by turning on or turning off the power switch SW1 via the interrupt input terminal IP of the microcomputer 26.
The determination is made based on the voltage input to I (step #2).

そして、この入力電圧がハイ電圧であれば、ステップ#
3〜#11の処理を行わずに、レンズ回路27等への電
力を停止し、マイコン26は動作待機状態になる(ステ
ップ#12.#13)。この入力電圧がロー電圧であれ
ば、電源スィッチSW1はオン状態と判定し、マイコン
26内のカウンタの動作を禁止しくステップ#3)、フ
ローチャートの実行に使用するフラグ、およびマイコン
26の出力端子類を初期セットする(ステップ#4)。
And if this input voltage is high voltage, step #
The power to the lens circuit 27 and the like is stopped without performing the processes 3 to #11, and the microcomputer 26 enters an operation standby state (steps #12 and #13). If this input voltage is a low voltage, the power switch SW1 is determined to be on, and the operation of the counter in the microcomputer 26 is prohibited (Step #3), the flag used for executing the flowchart, and the output terminals of the microcomputer 26. is initially set (step #4).

次いで、マイコン26の出力端子OP1をハイ電圧にし
てレンズ回路27等の回路に電力を供給する(ステップ
#5)。次に、レンズ駆動制御回路34に撮影レンズ2
の繰り込み信号が入力され、撮影レンズ2は無限遠位置
の方向に繰り込まれる(ステップ#6)。そして、撮影
レンズ2が無限遠位置に繰り込まれ、リミットスイッチ
SW3がオンするのを待つ(ステップ#7)。ステップ
#7でリミットスイッチSW3がオンすると、撮影レン
ズ2の駆動を停止させる(ステップ#8)。
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 lens drive control circuit 34
The renormalization signal is input, and the photographing lens 2 is retracted toward the infinite position (step #6). Then, the camera waits until the photographing lens 2 is retracted to the infinite position and the limit switch SW3 is turned on (step #7). When the limit switch SW3 is turned on in step #7, the driving of the photographing lens 2 is stopped (step #8).

また、これに伴って、マイコン26内のカウンタをリセ
ットし、レンズ駆動モータ33の回転量に応じたパルス
数をカウントする(ステップ#9゜#10)。そして、
撮影準備スイッチSW2のオンによる焦点検出動作の割
り込みを許可する(ステップ#11)。
Along with this, a counter in the microcomputer 26 is reset to count the number of pulses corresponding to the amount of rotation of the lens drive motor 33 (steps #9 and #10). and,
Interruption of the focus detection operation by turning on the photographing preparation switch SW2 is permitted (step #11).

そして、出力端子OP1をロー電圧にしてレンズ回路2
7等への電力を停止し、撮影準備スイッチSW2等が押
されるまで動作を待機させる(ステップ#12.#13
)。
Then, the output terminal OP1 is set to a low voltage and the lens circuit 2
7, etc., and standby operation until the shooting preparation switch SW2, etc. is pressed (steps #12 and #13).
).

また、前記ステップ#13の動作待機状態のときに搬影
準癩スイッチSW2がオンされると、マイコン26は第
10図に示した割り込み動作のフローチャートを実行す
る。
Further, when the projection quasi-leprosy switch SW2 is turned on during the operation standby state in step #13, the microcomputer 26 executes the interrupt operation flowchart shown in FIG.

すなわち、マイコン26はフローチャー1・の実行に使
用するフラグ、およびマイコン26の出力端子類を初期
セラ1〜するくステップ#21)。さらに、マイコン2
6内に設(プられたタイマをリセットし、次いで、この
タイマをスター1〜させる(ステップ#22)。そして
、焦点調整動作の1回目であることを示すフラグAFS
Fをセラ1〜しくステップ#23) 、出力端子OP1
をハイ電圧にしてレンズ回路27等に電力を供給する(
ステップ#24)。次に、撮影レンズ2の焦点距離ブタ
、開放絞り値およびデフォーカス量等からレンズ駆動の
ためのパルス数に変換する係数等よりなるデータをレン
ズ回路27から入力する(ステップ#25)。そして、
焦点検出データ出力回路28から差分データが入力され
、この差分データを記憶するくステップ#26.#27
)。次に、前述の各アイランド21,22.23のデフ
ォーカス量が演算され、さらに露出演算が行われ、これ
らの演算結果が表示回路31に表示される(ステップ#
28〜#30)。
That is, the microcomputer 26 sets the flags used to execute flowchart 1 and the output terminals of the microcomputer 26 from the initial cell 1 to step #21). Furthermore, microcontroller 2
The timer set in 6 is reset, and then this timer is started from 1 (step #22).Then, the flag AFS indicating that this is the first focus adjustment operation is reset.
Step #23), output terminal OP1
is set to high voltage and supplies power to the lens circuit 27 etc. (
Step #24). Next, data including coefficients for converting the focal length, open aperture value, defocus amount, etc. of the photographing lens 2 into the number of pulses for driving the lens is input from the lens circuit 27 (step #25). and,
Difference data is input from the focus detection data output circuit 28, and this difference data is stored in step #26. #27
). Next, the defocus amount of each of the islands 21, 22, and 23 described above is calculated, and furthermore, an exposure calculation is performed, and the results of these calculations are displayed on the display circuit 31 (step #
28~#30).

次に、FAモードか、AFモードかの判定を行い(ステ
ップ#31)、AFモードであれば、前記デフォーカス
量から撮影レンズ2の駆動量を算出し、これに基づいて
撮影レンズ2を駆動させる(ステップ#32)。一方、
ステップ#31でFAモードであれば、ステップ#32
の処理を行わずにステップ#34に移行する。ステップ
#34では、撮影準備スイッチSW2の開閉を判定する
Next, it is determined whether the mode is FA mode or AF mode (step #31), and if it is 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 this. (Step #32). on the other hand,
If it is FA mode in step #31, step #32
The process proceeds to step #34 without performing the above process. In step #34, it is determined whether the photographing preparation switch SW2 is opened or closed.

そして、撮影準備スイッチSW2がオンであれば、フラ
グAFSFをリセツl〜しくステップ#35)、ステッ
プ#25に戻って、ステップ#25からの処理を繰り返
す。一方、ステップ#34で撮影準備スイッチS W 
2がオフであれば、給電回路36をオフにしてレンズ回
路27等への電力を停止しくステップ#36)、fu影
準備スイッチSW2等が押されるまで動作を待機させる
(ステップ#37)。そして、撮影準備スイッチSW2
等が押されると、第9図のフローチャー1〜に移行する
If the photographing preparation switch SW2 is on, the flag AFSF is reset (step #35), the process returns to step #25, and the process from step #25 is repeated. On the other hand, in step #34, the shooting preparation switch SW
If 2 is off, the power supply circuit 36 is turned off to stop power to the lens circuit 27 etc. (step #36), and the operation is put on standby until the fu shadow preparation switch SW2 etc. is pressed (step #37). And the shooting preparation switch SW2
When ``etc.'' is pressed, the process moves to flowchart 1~ in FIG.

次に、第10図のステップ#28に示した各アイランド
21.22.23のデフォーカス量演粋のサブルーチン
について第11図〜第14図を用いて説明する。
Next, the subroutine for calculating the defocus amount for each island 21, 22, and 23 shown in step #28 of FIG. 10 will be explained using 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 island 21, 22, 23.
(Step #41), and the 12th
14 to 14 show specific flowcharts of defocus amount calculation for each island 21, 22, and 23.

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

次に、第1アイランド21でのローコンの状態を示すフ
ラグLCF1をセットする(ステップ#53)。そして
、第1ブロツクBL1の焦点状態(前ピン状態、後ピン
状態、合焦状tI!4)の検出およびデフォーカス量D
Fを演算しくステップ# 54. ) 、この演算結果
から焦点検出が可能であれば、フラグ1、CF 1をリ
セッ1〜し、求めたデフォーカス量DFをM1ブロック
81.1のデフォーカス量を記憶する変数DFIに記憶
させ(ステップ#55〜#57)、ステップ#58に移
行ザる。
Next, a flag LCF1 indicating the low contrast state at the first island 21 is set (step #53). Then, detection of the focus state (front focus state, back focus state, focused state tI!4) of the first block BL1 and defocus amount D
Calculate F Step #54. ), If focus detection is possible from this calculation result, reset flag 1 and CF 1 to 1 and store the obtained defocus amount DF in the variable DFI that stores the defocus amount of the M1 block 81.1 ( Steps #55 to #57), then proceed to step #58.

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

次に、第2ブロツクBL2の焦点状態の検出およびデフ
ォーカスIDFを演算しくステップ#58)G 、この演算結果から焦点検出が可能であれば、フラグL
CF1がセットされているかどうかを判定する。
Next, step #58)G detects the focus state of the second block BL2 and calculates the defocus IDF. If focus detection is possible from this calculation result, flag L
Determine whether CF1 is set.

そして、フラグLCF1がリセットされているとき、す
なわち、ステップ#55の判定において焦点検出が可能
とされたときには、ステップ#62に移行する。また、
ステップ#60でフラグLCF1がセットされていると
きは、第11図に示すステップ#42の第2アイランド
22のデフォーカス量演算サブルーチン(第13図)に
移行する。
Then, when the flag LCF1 is reset, that is, when focus detection is determined to be possible in the determination at step #55, the process moves to step #62. Also,
When the flag LCF1 is set in step #60, the process moves to the defocus amount calculation subroutine for the second island 22 (FIG. 13) in step #42 shown in FIG. 11.

一方、ステップ#59で焦点検出が可能と判定されると
、ステップ#60の処理を行わずにステップ#62に移
行する。
On the other hand, if it is determined in step #59 that focus detection is possible, the process proceeds to step #62 without performing the process in step #60.

ステップ#62では、後述の平均処理ルーチンで使用す
るブロック間デフォーカス量(平均処理幅)ΔDFを決
定する。次いで、デフォーカス量DF1とデフォーカス
l DF2との大小を判定し、デフォーカス量の大きい
方、すなわち、撮影レンズ2(カメラ)に近い方の被写
体のデフォーカス量を第1アイランド21のデフォーカ
スIDFIS1 とする。つまり、デフォーカスl D
FIがデフォ−カフ ス量DF2よりも大きいときは、デフォーカスfliD
F1を第1アイランド21のデフォーカス量DFISI
とし、逆に、デフォーカス酸DF2がデフォーカス量D
F1よりも大きいときは、デフォーカス量DF2を第1
アイランド21のデフォーカス@DFIS1とする(ス
テップ#63〜#67)。
In step #62, an inter-block defocus amount (average processing width) ΔDF to be used in an average processing routine to be described later is determined. Next, the magnitude of the defocus amount DF1 and the defocus lDF2 is determined, and the defocus amount of the subject with the larger defocus amount, that is, the one closer to the photographing lens 2 (camera), is determined as the defocus amount of the first island 21. IDFIS1. In other words, defocus l D
When FI is larger than the defocus amount DF2, the defocus fliD
F1 is the defocus amount DFISI of the first island 21
And conversely, the defocus acid DF2 is the defocus amount D
When it is larger than F1, the defocus amount DF2 is set to the first
The island 21 is defocused @DFIS1 (steps #63 to #67).

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

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

まず、第3ブロツクBL3、第4ブロツクBL4、第5
ブロツクBL5の各デフオーカス量をそれぞれ記憶する
変数DF3 、 DF4 、 DF5に所定値11  
K 11をそれぞれ設定させ(ステップ#71〜#73
)、第2アイランド22でのローコンの状態を示すフラ
グLCF2をセットする(ステップ#74)。そして、
各ブロックBL3 、 B10 、 B10の焦点状態
の検出およびデフォーカスfitDFを演算する(ステ
ップ#75.#79.#83)。すなわち、ステップ#
75による第3ブロツクBL3のデフォーカス量DFの
演算結果から焦点検出が可能であれば、フラグLCF2
をリセットし、求めたデフォーカス量DFを変数DF3
に記憶させ(ステップ#76〜#78)、ステップ#7
9に移行する。逆に、焦点検出が不能と判定されると、
ステップ#77、#78の処理を行わずにステップ#7
9に移行する。
First, the third block BL3, the fourth block BL4, and the fifth block BL3.
A predetermined value of 11 is set in variables DF3, DF4, and DF5 that store the respective defocus amounts of block BL5.
Set K11 (Steps #71 to #73)
), sets a flag LCF2 indicating the low contrast state at the second island 22 (step #74). and,
The focus state detection and defocus fitDF of each block BL3, B10, and B10 are calculated (steps #75, #79, and #83). i.e. step #
If focus detection is possible from the calculation result of the defocus amount DF of the third block BL3 by 75, the flag LCF2 is set.
and set the obtained defocus amount DF to variable DF3.
(Steps #76 to #78), Step #7
Move to 9. Conversely, if focus detection is determined to be impossible,
Step #7 without performing steps #77 and #78
Move to 9.

第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, the defocus amount DF is stored in the variable DF4 (steps #80 to #82), and the process moves to step #83. Conversely, if it is determined that focus detection is impossible, the process proceeds to step #83 without performing steps #81 and #82.

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

ステップ#87では、ローコンフラグLCF2がセット
されているかどうかを判定する。そして、フラグLCF
2がセットされていないとき、すなわち、ステップ#7
6、#80.#84の判定においてそれぞれ焦点検出が
可能とされたときには、後述の平均処理ルーチンで使用
する平均処理幅ΔDFを決定する(ステップ#88)。
In step #87, it is determined whether the low contrast flag LCF2 is set. And flag LCF
2 is not set, i.e. step #7
6, #80. When focus detection is determined to be possible in the determination at #84, an average processing width ΔDF to be used in an average processing routine to be described later is determined (step #88).

次いで、各ブロックBL3. B10. B10の各デ
フォーカス量DF3 。
Next, each block BL3. B10. Each defocus amount DF3 of B10.

DF4 、 DF5の大小を判定し、最も大きなデフォ
ーカス量HAX口「を抽出する(ステップ#89)。そ
して、デフォーカス量HAXDFとの差が平均処理幅Δ
DFよりも小さい他のブロックが存在しない場合には、
前記デフォーカス量HAXDFを第2アイランド22の
デフォーカスIi DFIS2としくステップ#90.
#91)、前記差が平均処理幅△DFよりも小さい他の
ブロックが1つ以上存在する場合には、前記デフォーカ
ス1HAXDFと前記差が平均処理幅ΔDFよりも小さ
い他のブロックのデフォーカス量とだけで平均を行い(
平均処理)、この平均値を第2アイランド22のデフォ
ーカスIDE132とする(ステップ#92)。そして
、ステップ#91.#92の処理を終えると、第11図
に示すステップ#43の第3アイランド23のデフォー
カス最演算サブルーチン(第14図)に移行する。
The magnitude of DF4 and DF5 is determined, and the largest defocus amount HAX is extracted (step #89). Then, the difference from the defocus amount HAXDF is the average processing width Δ.
If there are no other blocks smaller than DF, then
Step #90. Set the defocus amount HAXDF to the defocus Ii DFIS2 of the second island 22.
#91), if there is one or more other blocks whose difference is smaller than the average processing width ΔDF, the defocus amount of the other block whose difference is smaller than the average processing width ΔDF from the defocus 1HAXDF; Perform the average with just (
averaging process), and this average value is used as the defocus IDE 132 of the second island 22 (step #92). And step #91. When the process of #92 is completed, the process moves to the defocus maximum calculation subroutine for the third island 23 (FIG. 14) of step #43 shown in FIG. 11.

また、ステップ#87でフラグLCF2がセラ1〜され
ていると判定されたときには、低周波成分でなる被写体
に合焦させるために3つ置きの差分ブタを7つ置きの差
分データに再編成する〈ステップ#93)。すなわち、
例えば、画素のデータを+21.ρ2.・・・、Q口、
・・・とすると、3つ置きの差分データは、dDn =
Q+ −c5 、−、 Q5ρ9.・・・、ρn−ρj
l+4.・・・となる。ま1こ、7つ置きの差分データ
はdDm−ρ1−ρ9.・・・、ρm−Qm+8.・・
・どする。この7つ置きの差分ブタdDmは3つ置きの
差分データ d[)nの和を3つ置きに取ることにより
求められる。つまり、7つ置きの差分データは、 dDm =  dD+ +dD5 、 =・、d[)m
 +dl)m+4 、−・・−ρ1−ρ5+ρ5−ρ9
.・・・、+2n−4−Q、n+ρn−ρn+4.・・
・ −+2 ? −1! 9、−、ρn−4−l2Q44.
−・・=ρ1−ρ9.・・・、ρm−ffm→8.・・
・となる。ただし、n=m+4である。
Further, when it is determined in step #87 that the flag LCF2 is set to 1~, the difference data of every third difference is reorganized into the difference data of every seventh difference in order to focus on the subject consisting of low frequency components. (Step #93). That is,
For example, if the pixel data is +21. ρ2. ..., Q mouth,
..., then the difference data for every third data is dDn =
Q+ −c5 , −, Q5ρ9. ..., ρn−ρj
l+4. ...becomes... The difference data for every 7th place is dDm-ρ1-ρ9. ..., ρm-Qm+8.・・・
・What should I do? The difference data dDm for every seventh data is obtained by taking the sum of the difference data d[)n for every third data. In other words, the difference data for every 7th position is dDm = dD+ +dD5 , =・, d[)m
+dl) m+4 , -...-ρ1-ρ5+ρ5-ρ9
.. ..., +2n-4-Q, n+ρn-ρn+4.・・・
・-+2? -1! 9,-,ρn-4-l2Q44.
-...=ρ1-ρ9. ..., ρm-ffm→8.・・・
・It becomes. However, n=m+4.

さらに、この差分データclDmの隣接間の和を取り、
新ljなデータ列dDW(m)= dj)m 十dl)
m41を演算し、これを用いて第6ブロツクBL6での
焦点検出を行い、焦点状態の検出J5よびデフォーカス
ftDFを演算しくステップ#94)、焦点検出が可能
であれば、フラグLCF2をリセットし、第6ブロツク
BL5のデフォーカスIDF6を第2アイランド22の
デフォーカス量DFIS2として前記ステツブ#43に
移行する(ステップ#95〜#97)一方、ステップ#
95で焦点検出が不能であれば、第7ブロツクBL7で
の焦点検出を行い、焦点状態の検出、15よびデフォー
カス量DFを演算しくステップ#98)、焦点検出が可
能であれば(ステップ#99)、ステップ#96に戻っ
て、フラグLCF2をリセットし、第7ブロツクBL7
のデフォーカス量を第2アイランド22のデフォーカス
量DFIS2として前記ステップ#43に移行する。
Furthermore, take the sum of the adjacent difference data clDm,
New lj data string dDW(m) = dj)m +dl)
m41 is used to perform focus detection in the sixth block BL6, and to calculate focus state detection J5 and defocus ftDF (Step #94). If focus detection is possible, reset flag LCF2. , the defocus IDF6 of the sixth block BL5 is set as the defocus amount DFIS2 of the second island 22 and the process moves to step #43 (steps #95 to #97).
If focus detection is not possible in step 95, focus detection is performed in the seventh block BL7 to detect the focus state, and calculate 15 and defocus amount DF (step #98), and if focus detection is possible (step #98). 99), return to step #96, reset the flag LCF2, and set the seventh block BL7.
The defocus amount is set as the defocus amount DFIS2 of the second island 22, and the process moves to step #43.

一方、ステップ#99で焦点検出が不能であれは、第8
ブロツクBL8での焦点検出を行い、焦点状態の検出お
よびデフォーカス量DFを演算しくステップ#100)
、焦点検出が可能であれば(ステップ#101)、ステ
ップ#96に戻って、フラグLCF2をリセットし、第
8ブロツクBL8のデフォーカス量を第2アイランド2
2のデフォーカス量DFIS2として前記ステップ#4
3に移行する。
On the other hand, if focus detection is not possible in step #99,
Perform focus detection in block BL8, detect focus state and calculate defocus amount DF (Step #100)
, if focus detection is possible (step #101), return to step #96, reset the flag LCF2, and set the defocus amount of the eighth block BL8 to the second island 2.
2 as the defocus amount DFIS2 in step #4.
Move to 3.

方、ステップ#101で焦点検出が不能で必れば、ステ
ップ#96.#97の処理を行わずに前記ステップ#4
3に移行する。
On the other hand, if focus detection is impossible in step #101, step #96. Step #4 without performing the process in #97
Move to 3.

第74図は第3アイランド23のデフォーカス量演算(
ステップ#43)のサブルーチンを示す。
FIG. 74 shows the calculation of the defocus amount of the third island 23 (
The subroutine of step #43) is shown.

まず、第9ブロツク8[9、第10ブロツクBL10の
各デフォーカス量をそれぞれ記憶する変数D「9゜DF
IOに所定値“l  K I+を記憶させる(ステップ
#111、#112)。次に、第3アイランド23での
ローコンの状態を示すフラグLCF3をセットする(ス
テップ#113)。ぞして、第9ブロツクBL9の焦点
状態の検出およびデフォーカスIDFを演算しくステッ
プ#114)、焦点検出が可能であれば、フラグL C
F 3をリセットシ、求めたデフォーカスIDFを第9
ブロツクBL9のデフォーカス量DF9に記憶させる(
ステップ#115〜#117)。一方、ステップ#11
5で焦点検出が不能と判定されると、ステップ#116
.#1”+7の処理を行わずにステップ#118に移行
する。
First, a variable D "9° DF
A predetermined value "l K I+" is stored in the IO (steps #111 and #112).Next, a flag LCF3 indicating the low contrast state at the third island 23 is set (step #113). Detect the focus state of the 9th block BL9 and calculate the defocus IDF (Step #114). If focus detection is possible, flag L C
Reset F3 and set the obtained defocus IDF to the 9th
Store it in the defocus amount DF9 of block BL9 (
Steps #115 to #117). Meanwhile, step #11
If it is determined in step #5 that focus detection is impossible, step #116
.. The process moves to step #118 without performing the process #1''+7.

次に、第10ブロツクBL”IQの焦点状態の検出およ
びデフォーカスfiDFを演算しくステップ#118)
、この演算結果から焦点検出が不能であれば、フラグL
CF3がセラ1〜されているがどうかを判定する。そし
て、フラグLCF3がリセットされているとき、すなわ
ち、ステップ#115の判定において焦点検出が不能と
されたときには、ステップ#122に移行する。また、
フラグLCF3がセットされているときには、第10図
に示すステップ#29の露出演算サブルーチンに移行す
る(ステップ#119. #120>。一方、ステップ
#119で焦点検出が可能と判定されると、ステップ#
120の処理を行わずにステップ#122に移行する。
Next, detect the focus state of the 10th block BL''IQ and calculate the defocus fiDF (Step #118)
, If focus detection is impossible from this calculation result, flag L is set.
It is determined whether CF3 is set to Sera 1 or not. Then, when the flag LCF3 has been reset, that is, when focus detection is determined to be impossible in the determination at step #115, the process moves to step #122. Also,
When the flag LCF3 is set, the process moves to the exposure calculation subroutine of step #29 shown in FIG. #
The process moves to step #122 without performing the process of step #120.

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

また、ステップ#124.#125でデフォーカス量O
F9とデフォーカス量0F10との差が平均処理幅ΔD
Fよりも小さいときは、デフォーカス量0[9とデフォ
ーカスIDEIOとの平均を行い、この平均値を第3ア
イランド23のデフォーカス量DFIS3とする(ステ
ップ#128)。そして、ステップ#126.#127
.#128の処理を終えると、第10図のステップ#2
9に移行する。
Also, step #124. Defocus amount O at #125
The difference between F9 and defocus amount 0F10 is the average processing width ΔD
When it is smaller than F, the defocus amount 0[9 and the defocus IDEIO are averaged, and this average value is set as the defocus amount DFIS3 of the third island 23 (step #128). And step #126. #127
.. After completing the process #128, step #2 in Figure 10
Move to 9.

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

まず、輝度検出回路29から被写体8の明るさに対応し
た開放輝度値(アペックスfitりBVOがマイコン2
6に入力される(ステップ#131)。
First, from the brightness detection circuit 29, the open brightness value corresponding to the brightness of the subject 8 (apex fit BVO is
6 (step #131).

続いて、フィルム感度読取回路30からフィルム感度に
対応したフィルム感度値(アペックス値)Svがマイコ
ン26に入力される〈ステップ#132)。次いで、こ
れら開放輝度値BVOと、フィルム感度値Svと、第1
0図のステップ#27で予めマイコン26に入力されて
いる開放絞り1fiAvOとの和より、露出値EV(E
シーsvo+sv+Aν0〉を演算する(ステップ#1
33)。
Subsequently, the 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 BVO, film sensitivity value Sv, and first
The exposure value EV (E
Calculate svo+sv+Aν0> (step #1
33).

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

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

まず、FAモードかAFモードかの判定が行われる。そ
して、FAモードの場合では、第2アイランド22の測
距を優先し、第2アイランド22が測距可能であれば、
第2アイランド22のデフォーカス量DFIS2に基づ
いて撮影レンズ2の駆動量を決定し、第2アイランド2
2が測距不可能であれば、最近接のアイランドのデフォ
ーカス量に基づいて撮影レンズ2の駆動量を決定する。
First, it is determined whether the mode is FA mode or AF mode. In the case of FA mode, priority is given to the distance measurement of the second island 22, and if the second island 22 is capable of distance measurement,
The driving amount of the photographic lens 2 is determined based on the defocus amount DFIS2 of the second island 22, and the second island 2
2, the amount of drive of the photographing lens 2 is determined based on the amount of defocus of the nearest island.

つまり、FAモードでは、静止した被写体を中央にして
撮影する場合が多く、広い範囲での測距に基づいてデフ
ォーカス量を求めると、とのアイランドを選択して表示
しているのかが明確でなくなるため、撮影画面の中央部
の測距を行う第2アイランド22のデフォーカスIDF
TS2を優先することとした。
In other words, in FA mode, shots are often taken with a stationary subject in the center, and when the amount of defocus is determined based on distance measurement over a wide range, it is clear whether the island is selected and displayed. Therefore, the defocus IDF of the second island 22 performs distance measurement in the center of the shooting screen.
We decided to give priority to TS2.

一方、AFモードの場合では、各アイランド21.22
.23の被写体の内、いずれかの被写体8が焦点検出可
能なときには、最近接になるアイランド、すなわちデフ
ォーカス量が最大になるアイランドのデフォーカス量、
撮影レンズ2の焦点距離データ、および被写体までの距
離に基づいて撮影倍率を演算し、この演算結果によって
デフォーカス量の演算手順を変えている。すなわち、基
本的には、撮影倍率が大きければ、主被写体は撮影画面
の中央部に必ず存在するとして、第2アイランド22の
デフォーカス量DFIS2を優先する。
On the other hand, in the case of AF mode, each island 21.22
.. When the focus of any one of the 23 subjects 8 can be detected, the defocus amount of the nearest island, that is, the island with the maximum defocus amount,
The photographing magnification is calculated based on the focal length data of the photographic lens 2 and the distance to the subject, and the procedure for calculating the amount of defocus is changed depending on the result of this calculation. That is, basically, if the photographing magnification is large, the main subject is necessarily present in the center of the photographic screen, and priority is given to the defocus amount DFIS2 of the second island 22.

また、撮影倍率が小さければ、背景を含んだ撮影になり
、被写体までの距離分布のばらつきが大きいとし、さら
に主被写体はカメラに近い位置に存存することが多いの
で、距離分布の近い側を優先する。この撮影倍率の判定
の目安となる値と、この値に基づいて演算手段を選択す
る手順の一例を第16図に示す。
Also, if the shooting magnification is small, the background will be included in the shot, and the distance distribution to the subject will vary widely.Furthermore, since the main subject is often located close to the camera, priority will be given to the side with a closer distance distribution. do. FIG. 16 shows an example of a value that serves as a standard for determining the imaging magnification and a procedure for selecting a calculation means based on this value.

すなわち、例えば、AFモードの場合には、撮影レンズ
2の焦点距離fは35#Iを境に演算手段を選択する。
That is, for example, in the case of the AF mode, the calculation means is selected for the focal length f of the photographic lens 2 at 35#I.

そして、焦点距離fが35Mm以上、かつ、最近接アイ
ランドの撮影倍率βdfが所定の倍率βH(例えば、倍
率1/25>よりも小さ(プれば、最近接アイランドの
デフォーカス量に基づいて撮影レンズ2の駆動量を決定
する。一方、撮影倍率βdfが所定の倍率β11を越え
ると、第2アイランド22のデフオーカス量DFIS2
を優先し、第2アイランド22が測距不可能であれば、
最近接アイランドのデフォーカス量に基づいて撮影レン
ズ2の駆動量を決定する。
If the focal length f is 35 mm or more and the photographing magnification βdf of the nearest island is smaller than a predetermined magnification βH (for example, magnification 1/25>), then the photographing is performed based on the defocus amount of the nearest island. The driving amount of the lens 2 is determined. On the other hand, when the imaging magnification βdf exceeds the predetermined magnification β11, the defocus amount DFIS2 of the second island 22 is determined.
If priority is given to the second island 22 and distance measurement is not possible,
The driving amount of the photographing lens 2 is determined based on the defocus amount of the nearest island.

ざらに、焦点距離fが35fH未満であれば、最近接ア
イランドのデフォーカス量に基づいて撮影レンズ2の駆
動量を決定する。これは焦点距l1llIfが短くなる
と、被写界深度が深くなるので、距離分布において最近
接アイランドの被写体に焦点を合せても他のアイランド
で検出された被写体をかなりの範囲まで被写界深度内に
含むことができるからである。
Roughly speaking, if the focal length f is less than 35 fH, 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 l1llIf becomes shorter, the depth of field becomes deeper, so even if you focus on the object on the nearest island in the distance distribution, objects detected on other islands will be within the depth of field to a considerable extent. This is because it can be included in

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

ここで、前述の撮影倍率βdfの算出手段について説明
する。
Here, the above-mentioned means for calculating the imaging magnification βdf will be explained.

この撮影倍率βdfは焦点距@j fとカメラからの被
写体距MXとから下式のようになる。
This photographing magnification βdf is determined by the following formula from the focal length @j f and the subject distance MX from the camera.

βdf= f / x 前記焦点v0離fのデータは撮影レンズ2から入力され
るので、前記被写体距l11i×を求めると、撮影倍率
βdfは算出される。また、この被写体距離Xは撮影レ
ンズ2の無限遠位置から被写体位置までのデフオーカス
1DFxを用いて、下式のように求められる。
βdf=f/x Since the data on the focal point v0 and distance f is input from the photographing lens 2, the photographing magnification βdf is calculated by determining the subject distance l11i×. Further, this object distance X is determined using the differential focus 1DFx from the infinity position of the photographing lens 2 to the object position as shown in the following equation.

X=f2 /DFX ただし、撮影レンズ2は1枚の薄い理想レンズではなく
、主点が前後にあるとともに、焦点距離の変化によって
その主点が異なるので、上式から被写体距離Xは近似値
として求められる。
X=f2/DFX However, the photographing lens 2 is not a single thin ideal lens, but has principal points at the front and back, and the principal point changes depending on the change in focal length, so from the above equation, the subject distance X can be calculated as an approximate value. Desired.

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

N = k−DF。N = k-DF.

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

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

また、上式とは別に撮影倍率βdfは撮影レンズ2の現
在位置から被写体位置までの駆動量ΔN(ΔN=DF−
k)を用いて、 βdf=(N+ΔN)/f−に としても求められる。
In addition to the above formula, the photographing magnification βdf is the driving amount ΔN (ΔN=DF−) from the current position of the photographing lens 2 to the subject position.
k), it can also be obtained as βdf=(N+ΔN)/f−.

次に、平均処理を行うザブルーチンについて第2アイラ
ンド22のフローヂャート(第13図のステップ#88
.#92)を例にして説明する。
Next, the flowchart of the second island 22 regarding the subroutine that performs the averaging process (step #88 in FIG.
.. #92) will be explained as an example.

第13図のステップ#88の平均処理幅ΔDFは、第1
7図に示すサブルーチンに従って求められる。まず、前
回平均処理が行われたかどうかをフラグWZF2により
判定する(ステップ#141)。
The average processing width ΔDF in step #88 in FIG.
It is determined according to the subroutine shown in FIG. First, it is determined by the flag WZF2 whether or not the previous averaging process was performed (step #141).

すなわち、前回平均処理が行われると、フラグ−ZF2
はセットされる。そして、前回平均処理が行われていれ
ば、係数に1を”1.5”に設定し、前回平均処理が行
われなければ、係数に1をLL I I+に設定する(
ステップ#142.#143)。係数に1を設定する理
由は、測距値のばらつきによって平均処理が行われたり
、行われなかったりすることを防ぐため、−度平均処理
が行われた場合は平均処理幅を広げて2回目以降も平均
処理が行われる可能性(確率)を高めるためである。
That is, when the previous averaging process is performed, the flag -ZF2
is set. Then, if the averaging process was performed last time, the coefficient is set to 1 to "1.5", and if the previous averaging process was not performed, the coefficient is set to 1 to LL I I+ (
Step #142. #143). The reason for setting the coefficient to 1 is to prevent average processing from being performed or not performed due to variations in distance measurement values.If average processing is performed by -degrees, the average processing width is widened and the second processing is performed. This is to increase the possibility (probability) that the averaging process will be performed thereafter.

次に、前回測距時に検出された撮影倍率βdfの判定が
行われ、撮影倍率βdfが“’ 1 / 20 ”以上
の場合には係数に2を“1″に設定し、撮影倍率βdf
が” 1 / 20 ”から“1 / 50 ”の場合
には係数に2を“0.5”に設定し、撮影倍率βdfが
” 1 / 50 ”以下ノ場合ニハ係数に2を”O”
に設定しくステップ#145〜#149) 、ステップ
#150に移行する。前記係数に2を設定する理由は、
撮影倍率βdfが高いと同一アイランド内の複数ブロッ
クに同一被写体で占められる可能性が高くなるためであ
る。
Next, the photographing magnification βdf detected during the previous distance measurement is determined, and if the photographing magnification βdf is greater than or equal to "'1/20", the coefficient 2 is set to "1", and the photographing magnification βdf is
If the shooting magnification βdf is "1/20" to "1/50", set the coefficient 2 to "0.5", and if the imaging magnification βdf is "1/50" or less, set the niha coefficient 2 to "O".
If it is set to step #145 to #149), the process moves to step #150. The reason for setting the coefficient to 2 is
This is because when the photographing magnification βdf is high, there is a high possibility that the same subject will occupy multiple blocks within the same island.

次いで、ステップ#150で、撮影時の絞り値FNo、
に基づいて基準平均処理幅へ〇F1の設定を行う。つま
り、撮影時の絞り値F No、と許容錯乱円直径εの積
により求められる焦点検疫δを[された像の解像度を保
存するための基準平均処理幅ΔDFIとして設定される
Next, in step #150, the aperture value FNo.
〇F1 is set to the standard average processing width based on . In other words, the focus quarantine δ obtained from the product of the aperture value F No at the time of photographing and the allowable circle of confusion diameter ε is set as the standard average processing width ΔDFI for preserving the image resolution.

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

また、前回平均処理が行われたがどうかを判定するため
のフラグは、第1アイランド21および第3アイランド
23にもフラグば[2と同様に有しており、前回平均処
理が行われると、フラグWZF2はセットされ、前回平
均処理が行われなければ、リセットされる。
In addition, the first island 21 and the third island 23 also have flags for determining whether or not the averaging process was performed last time. Flag WZF2 is set, and if no averaging process was performed last time, it is reset.

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

まず、前ピン側ずれピッチが411!aの位置(ずれピ
ッチ゛’−4”)から後ビン側ずれピッチが24個の位
置くずれピッチ゛24”)までのデフ1−カス範囲にお
いて参照部142bのデータをずらせながら(シフトさ
せながら)、各シフト位置における第3ブロツク6[3
のデータと参照部142bのデータとの相関関数H3(
I)を求める(ステップ#161 )。
First, the front pin side deviation pitch is 411! While shifting the data of the reference part 142b in the differential 1-cass range from the position a (shift pitch ``-4'') to the rear bin side displacement pitch ``24''), each Third block 6[3 in shift position
The correlation function H3 (
I) is determined (step #161).

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

H3(1)=(1に2(1)−32(5+Il l +
lに2(20)−32(24ただし、に2は基準部14
2aの差分データ列を示し、S2は参照部142bの差
分データ列を示す。
H3(1)=(1 to 2(1)-32(5+Il l +
2 (20) - 32 (24, where 2 is the reference part 14)
2a shows the difference data string, and S2 shows the difference data string of the reference section 142b.

次いで、前述の各シフト位置における相関関数H3(1
)の内で最も相関の良い、すなわち、相関関数H3(I
)の値が最小になるシフト位置[を抽出する(ステップ
#162)。次に、相関関数H3(I)の各点の値を用
いて各ピッチ間の補間演算を行う(ステップ#163)
Next, the correlation function H3(1
), that is, the correlation function H3(I
) is extracted at the shift position [ where the value of ) is the minimum (step #162). Next, interpolation calculation between each pitch 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 Laid-Open No. 60-247211).

XH=  I  M  +  (H3(IN−1)−H
3(IN+1))/[MIN(H3(IN−1)、H3
(IN+1)L−83(IN)]/ 2この補間演算を
行う理由は、1個のピッチのずれをデフォーカス量に換
算すると約1000μmと大きく、このピッチ間を補う
ことにより精度の良い測距を行うためである。
XH=IM+(H3(IN-1)-H
3(IN+1))/[MIN(H3(IN-1), H3
(IN+1)L-83(IN)]/2 The reason for performing this interpolation calculation is that when converted to a defocus amount, one pitch deviation is large, approximately 1000 μm, and by compensating for this pitch difference, accurate distance measurement can be achieved. This is to do this.

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

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

C(3)−Σl K2(j)−に2(j+1)J”1 続いて相関関数H3(1)の最小値の補間値YHを求め
るとともに、この補間11fYHとコントラスト値C(
3)との比の値R(3)を求める(ステップ#167)
C(3)-Σl K2(j)-2(j+1)J"1 Next, find the interpolated value YH of the minimum value of the correlation function H3(1), and use this interpolated value 11fYH and the contrast value C(
Find the ratio R(3) to 3) (step #167)
.

これら補間値YHと比の1tllR(3)とは下式のよ
うになる。
These interpolated values YH and the ratio 1tllR(3) are expressed by the following equation.

Y M = 83(IM)−11−13(IN−11−
1−43(H1+1)  l /2R(3) =C(3
) /YH こうして求められたコン1〜ラスト値C(3)および比
の値R(3)が共に設定値を満足した場合のみ焦点検出
可能とし、コン1へラスト値C(3)あるいは比の値R
(3)のいずれか一方でも満足しない場合には、焦点検
出不能とする(ローコン判定)。すなわち、まず、第3
ブロツクBL3が前回のルーヂン処理で焦点検出可能で
あったかどうかの判定を、検出フラグN LB3を用い
て行う(ステップ#168)。これは前回焦点検出可能
であった場合に判定レベルの緩和を行い、焦点検出判定
レベルぎりぎりの被写体に対し、焦点検出可能かどうか
の判定が不安定になることを防ぐためである。すなわち
、焦点検出判定レベルぎりぎりの被写体に対しては、判
定レベルCth、 Rthにそれぞれ所定値C1,R1
を設定する(ステップ#16つ)。
YM = 83(IM)-11-13(IN-11-
1-43(H1+1) l /2R(3) =C(3
) /YH Focus detection is possible only when both the con1 to last value C(3) and the ratio value R(3) obtained in this way satisfy the set value, and the last value C(3) or the ratio value to con1 value R
If any one of (3) is not satisfied, focus detection is determined to be impossible (low contrast determination). That is, first, the third
It is determined whether or not the focus of block BL3 was able to be detected in the previous routine processing using detection flag NLB3 (step #168). This is to reduce the determination level when focus detection was possible last time, and to prevent the determination of whether focus detection is possible from becoming unstable for a subject whose focus detection determination level is at the very edge. That is, for a subject at the very edge of the focus detection judgment level, the judgment levels Cth and Rth are set to predetermined values C1 and R1, respectively.
(Step #16).

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

この撮影倍率βLSは、前述の撮影倍率βdfの演算、
すなわち、βdf= (N/に+DF>/f  のデフ
ォーカス量DFに′O″を代入して求める。
This imaging magnification βLS is determined by the calculation of the imaging magnification βdf described above.
That is, it is determined by substituting 'O'' for the defocus amount DF where βdf=(N/+DF>/f).

そして、この撮影倍率β[Sと焦点距l1lltfとの
積を求め、この積が所定値f・βth(例えば、300
Mレンズの場合βthは1/15以上)以上の場合には
、判定レベルCth、 Rthにそれぞれ所定値C1,
R1よりも大きい所定値C4,R4を設定する(ステッ
プ#171.R172)。つまり、ステップ#16つの
場合に比べて判定レベルc th。
Then, the product of the photographing magnification β[S and the focal length l1lltf is calculated, and this product is a predetermined value f·βth (for example, 300
In the case of an M lens, βth is 1/15 or more), the determination levels Cth and Rth are set to predetermined values C1 and Rth, respectively.
Predetermined values C4 and R4 larger than R1 are set (step #171.R172). In other words, the judgment level c th is higher than in the case of step #16.

Rthは厳しくなる。Rth will be tough.

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

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

そして、前記判定レベルCth、 Rlhにそれぞれ所
定値が設定されたのち(ステップ#169.#172、
R178,R179) 、コントラスト値C(3)が判
定レベルC1hよりも大きく、かつ、比の値R〈3)が
判定レベルRthよりも大きいとぎには、検出フラグN
LB3をセラ1−シ、コン1−ラスト値C(3)あるい
は比の値R(3)のいずれか一方でも判定レベルcth
あるいは判定レベルRthよりも小さいときには、検出
フラグNLB3をリセットする(ステップ#180〜#
182)。そののち、第13図のステップ#79以降に
示された第4ブロツクBL4のデフォーカス量の演算お
よび焦点検出不能判断等の処理を行う。
After each of the determination levels Cth and Rlh is set to a predetermined value (steps #169 and #172,
R178, R179), when the contrast value C(3) is larger than the judgment level C1h and the ratio value R<3) is larger than the judgment level Rth, the detection flag N is set.
If LB3 is set to 1-shi, contrast 1-last value C(3) or ratio value R(3), the judgment level cth
Alternatively, when it is smaller than the determination level Rth, the detection flag NLB3 is reset (steps #180 to #
182). Thereafter, processing such as calculating the defocus amount and determining whether focus detection is possible in the fourth block BL4 shown after step #79 in FIG. 13 is performed.

なお、検出フラグNLB3は、各アイランドごとに、こ
の検出フラグNLBを設定し、この検出フラグNしBに
基づいて判定レベルの緩和を行うようにしてもよい。つ
まり、−度合無検出して大きなデフォーカス量を検出し
た場合、レンズ駆動により、その像間隔が基本像間隔に
近ずく。そのため、基準部の像自体も、例えば、第4ブ
ロツク、第5ブロツクにあった像が、レンズ駆動により
像間隔が広がり第3ブロツク、第4ブロツクにシフトす
ることがある。この様なときは第3ブロツクで焦点検出
不能になる。そこで、各アイランドごとにローコンを示
ずフラグLCFを別のフラグLCFHに格納して、この
フラグLCFNを検出フラグNLBの代りにそれぞれの
アイランドの測距時に判定するようにしてもよい。
Note that the detection flag NLB3 may be set for each island, and the determination level may be relaxed based on the detection flag NLB3. In other words, when a large amount of defocus is detected with no -degree detected, the image interval approaches the basic image interval due to lens driving. Therefore, the image of the reference portion itself, for example, the image that was in the fourth and fifth blocks may be shifted to the third and fourth blocks as the distance between the images increases due to lens driving. In such a case, focus detection becomes impossible in the third block. Therefore, instead of indicating the low contrast for each island, the flag LCF may be stored in a separate flag LCFH, and this flag LCFN may be determined during 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 made stricter when the value is equal to or greater than the predetermined value f·βth in step #172 will be explained.

つまり、極めて大きなレンズ駆動範囲(レンズ繰り出し
量40m以上)を有する長焦点レンズの場合、レンズ位
置が前記条件を満足するように高倍率、すなわち、レン
ズ繰り出し量が大きい場合でかなりの遠景、低倍率の被
写体に対して焦点検出しようとすると、この様な場合、
被写体の空間周波数成分はかなりの高周波成分を有し、
基準部142aあるいは参照部142bにおける像間隔
が極めて小さく、基準部142aと参照部142bとで
はまったく異なった像が投影されることになる。さらに
、低倍率であるため、まったく異なった被写体が投影さ
れることになる。この様なぼけ状態の場合には、光学系
は極めて低周波成分のみを通過させるので、通常は焦点
検出不能となる。
In other words, in the case of a long focal length lens with an extremely large lens drive range (lens extension amount of 40 m or more), the lens position must satisfy the above conditions at high magnification, that is, when the lens extension amount is large, it will produce a very distant view and at low magnification. When trying to detect focus on a subject like this,
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 completely different images are projected on the reference portion 142a and the reference portion 142b. Furthermore, due to the low magnification, a completely different subject will be projected. In such a blurred state, the optical system passes only extremely low frequency components, so it is usually impossible to detect the focus.

ところが、第18図(b)に示すように、人物A。However, as shown in FIG. 18(b), person A.

Bが並んでいるような場合、人物A、Bを区別する細部
のデータ(高周波成分)は光学系を通過しないので、基
準部142aと参照部142bとに投影される人物A、
Bのそれぞれの像はほぼ同じ波形になり、人物Aの像と
人物すの像とを誤って判定し、焦点検出可能と判定する
場合がある。
In the case where persons A and B are lined up, the detailed data (high frequency components) that distinguish between persons A and B do not pass through the optical system.
Each image of B has almost the same waveform, and there are cases where the image of person A and the image of person A are erroneously determined, and it is determined that the focus can be detected.

一方、レンズ位置が無限遠状態で低倍率の場合に近景、
高倍率の被写体に対して焦点検出しようとすると、この
様な場合にも、光学系は極めて低周波成分のみを通過さ
せるので、細部のデータは通過しない。ところが、高倍
率であるため基準部142aあるいは参照部142bに
おりる像間隔が極めて大きく、基準部142aと参照部
142bとは同じ被写体の異なった部分が投影されるこ
とになる。したがって、基準部142aと参照部142
bとが異なった被写体を投影されることはないので、判
定レベルCth、Rthを厳しくすることとした。
On the other hand, when the lens position is at infinity and the magnification is low, foreground,
When attempting to detect focus on a subject with high magnification, the optical system passes only extremely low frequency components, so detailed data is not passed. However, since the magnification is high, the interval between images falling on the reference section 142a or the reference section 142b is extremely large, and different parts of the same subject are projected on the reference section 142a and the reference section 142b. Therefore, the reference portion 142a and the reference portion 142
Since a subject different from that in b is not projected, it was decided to make the determination levels Cth and Rth stricter.

また、前記ステップ#161およびステップ#165で
は、第3ブロツク8[3の相関関数H3(I)およびコ
ントラスト値C(3)を演算したが、第19図に示すよ
うに、他のブロックBL1 、 B10 。
Furthermore, in steps #161 and #165, the correlation function H3(I) and contrast value C(3) of the third block 8[3 were calculated, but as shown in FIG. B10.

B10 、 BL5 、 B10 、 BLl 0につ
いても同様に求めることができる。
B10, BL5, B10, and BLl0 can be similarly determined.

次に、前記ステップ#173での局所コントラスト値C
Lthの演算について説明する。このステップ#173
でのコントラスト値の判定レベルcthには、光電変換
素子アレイ等により発生するノイズ(雑音)量Cn0i
Seが重畳されている。このノイズ量Cnoiseのノ
イズ自体の大きさは変らないがノイズの波形がばらつく
ため、合焦検出に最低限必要な真の被写体コントラスト
値をCMINとすると、判定レベルcthは下式のよう
になる。
Next, the local contrast value C in step #173 is
The calculation of Lth will be explained. This step #173
The contrast value judgment level cth at
Se is superimposed. Although the size of the noise itself of the noise amount Cnoise does not change, the waveform of the noise varies, so if CMIN is the minimum true object contrast value required for focus detection, the determination level cth is as shown in the following equation.

Cth=CMIN +MAX(Cnoise )ただし
、CMIN <MAX (Cnoise )このため、
ノイズ量Cnoiseが小さく、本来、焦点検出可能に
もかかわらず、コントラスト値が判定レベルcthを越
えないために焦点検出不能と判定される場合がある。そ
こで、最大のノイズ量Cnoiseが発生する時は、第
3ブロツクBL3の各部でもノイズが存在すると予測さ
れるので、第3ブロツクBL3の差分データごとに下式
にしたがつてコントラスト限界の判定を行う。
Cth = CMIN + MAX (Cnoise) However, CMIN < MAX (Cnoise) Therefore,
Even though the noise amount Cnoise is small and focus detection is originally possible, it may be determined that focus detection is impossible because the contrast value does not exceed the determination level cth. Therefore, when the maximum amount of noise Cnoise occurs, it is predicted that noise will also exist in each part of the third block BL3, so the contrast limit is determined for each difference data of the third block BL3 according to the formula below. .

se  )  ・ P/20 ただし、値Pは予め設定する所定値で、’ 20 ”以
下の値から選択する。
se) P/20 However, the value P is a predetermined value set in advance, and is selected from values of '20' or less.

また、前記コントラスト限界の判定において、局所的な
コントラスト値が所定値を満足しているときには、コン
トラスト値の判定レベルをノイズが小さな場合と同様に
判定することができる。つまり、コントラスト限界の判
定の手段は、第20図〜第22図に示されたように、複
数の判定ルーチンがある。すなわち、第20図の判定ル
ーチンでは、例えば、第3ブロツクBL3から7個の差
分データごとに細分したデータブロックを抽出し、この
データブロックの内、1個のデータでも所定値ctth
i以上であれば、トータルのコントラスト値の判定レベ
ルを緩和するようになっている。
Furthermore, in determining 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 way as when noise is small. In other words, the means for determining the contrast limit includes a plurality of determination routines, as shown in FIGS. 20 to 22. That is, in the determination routine shown in FIG. 20, for example, a data block subdivided into 7 pieces of differential data is extracted from the third block BL3, and even one data block of this data block has a predetermined value ctth.
If it is equal to or greater than i, the determination level of the total contrast value is relaxed.

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

一方、データブロックCLOCの各差分データが所定値
CLth1未満であれば、変数qをインクリメン]へし
て第3ブロツクBL3のデータに2(2)からに2(9
)までの差分データよりなるデータブロックCLOCを
抽出し、このデータブロックCLOCと所定値CL t
 h 1と比較する(ステップ#195.#193)。
On the other hand, if each differential data of the data block CLOC is less than the predetermined value CLth1, the variable q is incremented] and the data of the third block BL3 is changed from 2 (2) to 2 (9
) is extracted, and this data block CLOC and a predetermined value CL t are extracted.
Compare with h 1 (step #195. #193).

以下同様に、データに2 (13)からに2(20)ま
での差分データよりなるデータブロツりCLOCを抽出
されるまで続番プられる(ステップ#192〜#196
)。そして、データブロックCLOCの内、1個のデー
タでも所定値CL t h 1以上であれば、フラグC
Lをセラ1〜し、全てのデータブロックCLOCで所定
値CLth1未満であれば、フラグCLはリセットのま
まで第18図(a)のフローチャートに移行する。
In the same way, successive numbers are added to the data until a data block CLOC consisting of differential data from 2 (13) to 2 (20) is extracted (steps #192 to #196).
). Then, if even one piece of data in the data block CLOC is greater than or equal to a predetermined value CL th 1, the flag C
If L is set to 1 to 1 and less than the predetermined value CLth1 in all data blocks CLOC, the process moves to the flowchart of FIG. 18(a) with the flag CL remaining reset.

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

つまり、この判定ルーチンは、第3ブロツクBL3のデ
ータに2 (1〜20)から最大値[M AX(K2(
j))]および最小値[M TN(K2(j)) ]を
抽出し、これら最大値[MAX(K2(j)) ] ト
最小値[M IN(K2(j)) ]との差CLOC(
C1,oc = M AX(K2(j))M IN(K
2(j)) )を求める(ステップ#201〜#203
)。次いで、フラグCLをリセットしくステップ#20
4) 、差CLOCと所定値CLth2と比較する(ス
テップ#205)。そして、所定値CLth2以」二で
あれば、フラグCLをセラ1へしくステツブ#206)
 、コントラスト値の判定レベルを緩和する。一方、差
CLOCが所定値CLth2未満であれば、フラグCL
はリセットのままで第18図(a)のフローチャートに
移行する。
In other words, this determination routine inputs the data of the third block BL3 from 2 (1 to 20) to the maximum value [MAX(K2(
j))] and the minimum value [M TN(K2(j)) ], and calculate the difference CLOC between these maximum value [MAX(K2(j)) ] and minimum value [MIN(K2(j)) ]. (
C1, oc = M AX (K2 (j)) M IN (K
2(j)) ) (steps #201 to #203
). Next, step #20 to reset the flag CL.
4) Compare the difference CLOC with a predetermined value CLth2 (step #205). Then, if it is less than the predetermined value CLth2, set the flag CL to cell 1 (step #206).
, the determination level of the contrast value is relaxed. On the other hand, if the difference CLOC is less than the predetermined value CLth2, the flag CL
remains reset and proceeds to the flowchart of FIG. 18(a).

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

つまり、この判定ルーチンは、まず、変数jを1111
+にセットし、変数CL1 、 Cl−2をリセッ1〜
し、さらにフラグCLをリセットする(ステップ#21
1)。次いで、第3ブロツクBL3のデータに2(1)
と所定値CLth3を比較し、所定値CLth3以上の
とき、変数01〜1に′1″を加え、次に、データに2
(1)が所定値−CLth3以下のとき、変数C[2に
((1I+を加える(ステップ#212〜#215)。
In other words, this determination routine first sets the variable j to 1111
+ and reset variables CL1 and Cl-2 to 1~
and further resets the flag CL (step #21
1). Next, 2(1) is added to the data of the third block BL3.
and a predetermined value CLth3, and when it is greater than or equal to the predetermined value CLth3, '1' is added to variables 01 to 1, and then 2 is added to the data.
When (1) is less than or equal to the predetermined value -CLth3, ((1I+) is added to the variable C[2 (steps #212 to #215).

そして、前記変数CL1と変数CL2との積を求め、こ
の積CL1  ・Cl2が所定値CL t h 4以上
であれば、フラグCLをセットしくステップ#217)
、コントラスト値の判定レベルを緩和する。一方、積C
1,1・Cl2が所定値CLth4未満であれば、変数
」をインクリメントし、第3ブロツクBL3の全てのデ
ータに2 (20>について、ステップ#212から#
215までの処理を行う(ステップ#212〜#2’1
9>。この結果、全てのデータの処理を終えても′ff
4CLI  ・Cl2が所定値CLth4未渦であれば
、フラグCLはリセッ1〜のままで第18図(a)のフ
ローヂャー1〜に移行する。
Then, calculate the product of the variable CL1 and the variable CL2, and if the product CL1 and Cl2 is greater than or equal to a predetermined value CL th 4, set the flag CL (step #217).
, the determination level of the contrast value is relaxed. On the other hand, product C
If 1,1・Cl2 is less than the predetermined value CLth4, the variable "is incremented, and all data in the third block BL3 is set to 2 (for 20>, steps #212 to #
Perform processing up to step 215 (steps #212 to #2'1
9>. As a result, even after processing all data, 'ff
4CLI If Cl2 is at the predetermined value CLth4, the flag CL remains at reset 1~ and the process moves to flowchart 1~ in FIG. 18(a).

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

第23図の平均処理ルーチンでは、第18図(a)のス
テップ#165.#167で求められたコン1−ラス1
〜値C(3)および比の値R〈3)に基づいて重み関数
W(I)を設定し、この重み関数W(I)を用いて各ブ
ロックのデフォーカス量の加重平均を行うようになって
いる。なお、この重み関数W(1)は、例えばコントラ
スl−値C(3)そのもの、あるいは比の値R(3)そ
のものとしてもよい。
In the averaging processing routine of FIG. 23, step #165 of FIG. 18(a). Con 1 - Las 1 found in #167
A weighting function W(I) is set based on the ~ value C(3) and the ratio value R<3), and this weighting function W(I) is used to perform a weighted average of the defocus amount of each block. It has become. Note that this weighting function W(1) may be, for example, the contrast l-value C(3) itself or the ratio value R(3) itself.

すなわち、まず、変数Iを“3″にセットする(ステッ
プ#217)。そして、各ブロックBシ3゜B10 、
 B10の各デフォーカス量DF3 、 DF4 、 
DF5の内の最も大きなデフォーカス1i=HAXDF
とデフォーカス量DF3との差を求め、この差と平均処
理幅ΔDFとを比較し、この差が平均処理幅ΔDFを越
えたときには、重み関数W(3)を0″にする。そして
、変数Iをインクリメントし、デフォーカス量HAXD
Fとデフォーカス1DF4およびデフォーカス量DF5
との差を求め、この差と平均処理幅ΔDFとを比較し、
この差が平均処理幅ΔDFを越えたときは、重み関数W
(4)および重み関数W(5)を11011にする(ス
テップ#222〜#225>。つまり、各ブロックBL
3 、 B10 、 B10の各デフォーカス量DF3
 、 DF4 、 DF5の内、平均処理幅ΔDF以内
のデフォーカス量を用いて平均処理を行う。次いで、前
述のように処理された重み関数W(1)を用いて加重平
均を行い、この平均値を第2アイランド22のデフォー
カス@DF132に設定する(ステップ#226)。
That is, first, variable I is set to "3" (step #217). And each block B 3゜B10,
Each defocus amount of B10 DF3, DF4,
Largest defocus 1i of DF5 = HAXDF
and the defocus amount DF3, and compare this difference with the average processing width ΔDF. If this difference exceeds the average processing width ΔDF, the weighting function W(3) is set to 0''. Increment I, defocus amount HAXD
F, defocus 1DF4 and defocus amount DF5
and compare this difference with the average processing width ΔDF,
When this difference exceeds the average processing width ΔDF, the weighting function W
(4) and weighting function W(5) to 11011 (steps #222 to #225>. In other words, each block BL
3, B10, and B10 each defocus amount DF3
, DF4, and DF5, the average processing is performed using a defocus amount within the average processing width ΔDF. Next, weighted averaging is performed using the weighting function W(1) processed as described above, and this average value is set as the defocus@DF 132 of the second island 22 (step #226).

つまり、デフォーカスMDFIS2は下式のようになる
In other words, the defocus MDFIS2 is expressed by the following formula.

DFIS2 =(DF3・W (3)+DF4 ・W 
(4)+DF5 ・W (5))/ (W (3)+W
 (4)+W (5))そして、ワイドゾーンフラグ−
ZF2をセラ1−する(ステップ#227)。そののち
、第11図のステップ#43のデフォーカス量演綽サブ
ルーチンに移行する。
DFIS2 = (DF3・W (3)+DF4・W
(4)+DF5 ・W (5))/ (W (3)+W
(4) +W (5)) And wide zone flag -
ZF2 is set to 1- (step #227). Thereafter, the process moves to the defocus amount calculating subroutine of step #43 in FIG.

第24図の平均処理ルーチンでは、相関関数の内、最大
相関位置INと、その前後の相関位置IH+1および相
関位置I M−1において複数のブロックを組み合せて
相関関数を百計拝し、ざらに再補間演算するようになっ
ている。すなわち、第13図のステップ#90で得られ
た平均処理対象のブロック(以下、対象ブロックという
)が全てのブロックBL3 、 B10 、 B10で
あれば、第2アイランド22のデータに2(1〜40)
で相関関数H3,45(IN)、 +3.4.5(IN
−1)、 1−13.4.5(IN+1)を百計算し、
ざらに再補間演算してこの値を第2アイランド22のデ
フォーカス1DFIs2に設定する(ステップ#231
.#232)。また、第3ブロツクBL3および第4ブ
ロツクBL4が対象ブロックであれば、データに2(1
〜30)で相関関数83.4(I M)、 H3,4(
I M−1)、 H3,4(I M+1)を再計算し、
再補間演算してこの値をデフォーカスIDFIS2に設
定する(ステップ#233.#234>。さらに、第4
ブロツク8[4および第5ブロツクBL5が対象ブロッ
クであれば、データに2(11〜40)で相関関数H4
,5(IN)、 H4,5(IN−1)、 H4,5(
IH+1)を再計算し、再補間演算してこの値をデフォ
ーカス量DFIS2に設定する(ステップ#235゜#
236)。また、ステップ#235で、第3ブロツク計
3および第5ブロツクBL5が対象ブロックであれば、
ステップ#232に移行し、そして、ワイドゾーンフラ
グ−ZF2をセットしくステップ#237)、そののち
、第11図のステップ#43のデフォーカス量演算サブ
ルーチンに移行する。
In the averaging processing routine shown in FIG. 24, a plurality of blocks are combined at the maximum correlation position IN, the correlation positions IH+1 and IM-1 before and after the correlation function, and the correlation function is calculated 100 times. It is designed to perform re-interpolation calculations. That is, if the blocks to be averaged (hereinafter referred to as target blocks) obtained in step #90 of FIG. )
and the correlation function H3, 45 (IN), +3.4.5 (IN
-1), 1-13.4.5 (IN+1) is calculated as 100,
Roughly re-interpolate and set this value to the defocus 1DFIs2 of the second island 22 (step #231
.. #232). Furthermore, if the third block BL3 and the fourth block BL4 are target blocks, the data has 2 (1
~30), the correlation function is 83.4 (I M), H3,4 (
I M-1), recalculate H3,4 (I M+1),
Re-interpolate and set this value to defocus IDFIS2 (steps #233 and #234>.Furthermore, the fourth
If block 8[4 and fifth block BL5 are the target blocks, the correlation function H4 is set to 2 (11 to 40) in the data.
,5(IN), H4,5(IN-1), H4,5(
IH+1) is recalculated, re-interpolated, and this value is set as the defocus amount DFIS2 (step #235゜#
236). Further, in step #235, if the third block total 3 and the fifth block BL5 are the target blocks,
The process moves to step #232, and the wide zone flag -ZF2 is set (step #237), and then the process moves to the defocus amount calculation subroutine of step #43 in FIG.

ここで、前述のステップ#232.#234゜#236
の相関関数H3,4,5(I N)、 H3H45(I
N)の演算式を示す。
Here, step #232 described above. #234゜#236
The correlation functions H3,4,5(I N), H3H45(I
The calculation formula for N) is shown below.

H3,4,5(I M)−H3,5(I M)=(に2
(1)−82(5+ I N)4(I N)。
H3,4,5(IM)-H3,5(IM)=(2
(1)-82(5+IN)4(IN).

+ に2(4 )−82(4+j+I H) +34(IN)=(l K2(1)−32(5+IN)
l + lに2(3)−32(4+j+I H) H4,5(IN)=(l K2(11)−82(15+
IH) l +1に2(j)−s2(4+j+ I N
) また、第25図の平均処理ルーチンでは、平均処理の対
象となる各ブロックの相関関数H(IN)。
+ 2(4)-82(4+j+I H) +34(IN)=(l K2(1)-32(5+IN)
l + l to 2(3)-32(4+j+I H) H4,5(IN)=(l K2(11)-82(15+
IH) l +1 to 2(j)-s2(4+j+ I N
) Also, in the averaging processing routine of FIG. 25, the correlation function H(IN) of each block to be subjected to averaging processing.

H(lN−1)、 H(I)l+1)をそれぞれ加算し
、この加惇結果を用いて補間演算以後の処理を行うよう
になっている。すなわち、全てのブロックBL3 。
H(lN-1) and H(I)l+1) are respectively added, and this addition result is used to perform processing subsequent to the interpolation calculation. That is, all blocks BL3.

B10. B10が対象ブロックであれば、相関関数H
3,4,5(I N)、 H3,4,5(I M−1)
、  H3,4,5(I H+1)は下式のように計算
する(ステップ#241.#242)。
B10. If B10 is the target block, the correlation function H
3,4,5(IN), H3,4,5(IM-1)
, H3, 4, 5 (I H+1) are calculated as shown below (steps #241 and #242).

1−13.4.5(IN−1)=H3(IN−1)+l
」4([t−1)+1−15(I H−1) 1−13.4.5(1)=83(IN)+l−14(I
N)+H5(IN)+3,4.5(IH+1)=H3(
rH+1)+1−14(IN+1)十H5(I )1+
1) また、第3ブロツクBL3および第4ブロツクBL4が
対象ブロックであれば、相関関数1−13.4(I )
11゜1−13.4(I M−1)、 H3,4(i 
N+1)は下式のように計算する(ステップ#243.
#244>。
1-13.4.5(IN-1)=H3(IN-1)+l
”4([t-1)+1-15(I H-1) 1-13.4.5(1)=83(IN)+l-14(I
N)+H5(IN)+3,4.5(IH+1)=H3(
rH+1)+1-14(IN+1) 10H5(I)1+
1) Furthermore, if the third block BL3 and the fourth block BL4 are target blocks, the correlation function 1-13.4(I)
11゜1-13.4 (I M-1), H3,4 (i
N+1) is calculated as shown below (step #243.
#244>.

+3.4(I Ll)= +3(I Ll)+ f−t
4(I Ll)H3,4(I M)= H3(I H)
+ H4(I H)H3,4(I N+1)= H3(
I ++11+ H4(I N+1)さらに、第4ブロ
ツクBL4および第5ブロツクBL5が対象ブロックで
あれば、相関関数H4,5(rMl、 l−(4,5(
T H−T)、 l−14,5(I N+1)は下式の
ように計算する(ステップ#245.#246)。
+3.4 (I Ll) = +3 (I Ll) + f-t
4(I Ll)H3, 4(I M)=H3(I H)
+ H4 (I H) H3,4 (I N+1) = H3 (
I ++11+ H4(IN+1) Furthermore, if the fourth block BL4 and the fifth block BL5 are target blocks, the correlation function H4,5(rMl, l-(4,5(
T H−T), l−14,5(IN+1) are calculated as shown in the following formula (steps #245 and #246).

H4,5(IN−1)=H4(IN−1)+l−15(
1−1)1−14.5(IN)=H4(I)l)+H5
(Nl)H4,5(1N+1)=H4(IN+1)+H
5(Ill+1)また、ステップ#245で、第3ブロ
ツクBL3および第5ブロツクBL5が対象ブロックで
あれば、相関関数H3,5(IN)、 1−13.5(
IN−1)、 1−13.5([+1)は下式のように
計算する(ステップ#247)。
H4,5(IN-1)=H4(IN-1)+l-15(
1-1) 1-14.5(IN)=H4(I)l)+H5
(Nl)H4,5(1N+1)=H4(IN+1)+H
5(Ill+1) Also, in step #245, if the third block BL3 and the fifth block BL5 are the target blocks, the correlation function H3,5(IN), 1-13.5(
IN-1) and 1-13.5 ([+1) are calculated as shown in the following formula (step #247).

1−13,5(I M−1)−+3(I M−1h−+
5(I H−1)+3,5(IN)−1−13JIH)
+85(IN)H3,5(I  N+4)=  H3(
I  N+1)  十 ト1 5(I  N+1)そし
て、ステップ#242.#244.#246、#247
の相関関数の計算を終えると、再補間演算を行い、この
値をデフォーカス1DFIs2に設定する(ステップ#
248)。つまり、デフォカス量DFI32は下式のよ
うになる。
1-13,5(IM-1)-+3(IM-1h-+
5(IH-1)+3,5(IN)-1-13JIH)
+85(IN)H3,5(IN+4)=H3(
I N+1) 15 (I N+1) And step #242. #244. #246, #247
After completing the calculation of the correlation function, re-interpolation is performed and this value is set to defocus 1DFIs2 (step #
248). In other words, the defocus amount DFI32 is expressed by the following formula.

DFIS2−α・IN→−α・1/2・(+−1(lN
−1)−1−1(IH+1))/[MIN (H(lN
−1)、H(1N+1)) −1−1(IN)] そして、ワイドゾーンフラグWZF2をセットしくステ
ップ#249)、そののち、第11図のステップ#43
のデフォーカス量演算4ナブル−チンに移行する。
DFIS2-α・IN→-α・1/2・(+-1(lN
-1)-1-1(IH+1))/[MIN (H(lN
-1), H(1N+1)) -1-1(IN)] Then, set the wide zone flag WZF2 in step #249), and then step #43 in FIG.
The defocus amount calculation moves to step 4.

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

まず、ブロックBL3 、 B10 、 B10で用い
た差分データ列に2(j)および82(j)よりそれぞ
れ7つ置きに差分をとり、この差分データの隣接間の和
分データ列KW(j)およびSW l)を求める(ステ
ップ#251)。この和分データ列に−(j) 、 3
顕j)は第10図のステップ#26で入力された差分デ
ータ列を用いて下式のようになる。
First, take the difference between the difference data strings used in blocks BL3, B10, and B10 by 2(j) and 82(j) at every seventh position, and then calculate the summation data string KW(j) and the adjacent data of this difference data. SW l) is determined (step #251). In this summation data string, -(j), 3
The expression j) is expressed as the following formula using the differential data string input in step #26 of FIG.

KW(m)  =に2(m)十に2(m+1)十に2(
m+4)+に2(m+5)311I(+)  −32(
11+32(1+1)+32(+44)+32(1+5
)次に、相関関数H6(1)を求め、相関関数1−16
CI)の値が最小になるシフl−量IN  (1=MI
N(+−16(I)) )を抽出する(ステップ#25
2.#253)。この相関関数H6(1)は下式のよう
になる。
KW (m) = 2 (m) 10 to 2 (m+1) 10 to 2 (
m+4)+ to 2(m+5)311I(+) -32(
11+32(1+1)+32(+44)+32(1+5
) Next, find the correlation function H6(1), and calculate the correlation function 1-16
Schiff l-quantity IN (1=MI
Extract N(+-16(I))) (Step #25
2. #253). This correlation function H6(1) is expressed by the following formula.

H6(I)= (l K14(2)−3W(6+I) 
 l + lにW(34)−8W(38B +I)    )/2  + Σ l  KW(j)−
3W(4+j+I)J二3 ここで、上式のように基準部142aのデータ列から両
端のデータを除いて相関関数86(1)を求めるのは、
後述の補間演算の際に最小シフト量IH近傍の相関関数
86(IH−1)、 H6(IN) 、 H6(IH+
1)を用いるのではなく、相関関数86(I L2)。
H6(I)=(l K14(2)-3W(6+I)
l + l to W(34)-8W(38B +I) )/2 + Σ l KW(j)-
3W(4+j+I)J23 Here, to obtain the correlation function 86(1) by removing data at both ends from the data string of the reference section 142a as in the above equation,
During the interpolation calculation described later, correlation functions 86 (IH-1), H6 (IN), H6 (IH+) near the minimum shift amount IH are
1) rather than using the correlation function 86 (IL2).

H6(I H−1)、 H6(J N+1)、 H6(
J N+2)を用いるために相関関数H6(I M−2
)、 H6(I )l+2)での参照部142bのデー
タに対応する位置が大きくずれるのを補正するためであ
る(特開昭60−247211号参照)。
H6 (I H-1), H6 (J N+1), H6 (
J N+2), the correlation function H6(I M-2
), H6(I )l+2) to correct a large shift in the position corresponding to the data of the reference portion 142b (see Japanese Patent Laid-Open No. 60-247211).

ステップ#254では、これら相関関数)−16(IH
−2)、 H6(IN−1)、 1−(6(IH+1)
、 H6(1→2)を求める。すなわち、これらの式は
、 となる。
In step #254, these correlation functions)-16(IH
-2), H6(IN-1), 1-(6(IH+1)
, find H6(1→2). That is, these formulas are as follows.

これら相関関数1−46(IN−2)、 H6(H4−
11,H6(IH+1)、 H6(IN+21を用いて
補間演算を下式のように行う(ステップ#255ン。
These correlation functions 1-46 (IN-2), H6 (H4-
11, H6 (IH+1) and H6 (IN+21) are used to perform interpolation calculations as shown below (step #255).

XH= IN +(H6(1N4−2)−1−16四旧
2))/[MIN(H6(1−2)、  l−16(I
)l+2))−MAX(H6(1H−1)、 H6(I
H+1)月/2 前記補間ピッチXHに係数αを掛けてデフォーカス、I
DF (DF=XH−ark:換算スル(ステップ#2
56>。次いで、第6ブロツクBL5のデータの持つコ
ントラスト値c(6)を下式のように求める(ステップ
#257>。
XH= IN +(H6(1N4-2)-1-164old2))/[MIN(H6(1-2), l-16(I
)l+2))-MAX(H6(1H-1), H6(I
H+1) month/2 Multiply the interpolation pitch XH by a coefficient α to defocus, I
DF (DF=XH-ark: Conversion Suru (Step #2
56>. Next, the contrast value c(6) of the data of the sixth block BL5 is determined as shown in the following formula (step #257>).

続いて相関関数86([1)の最小値の補間値Y)11
を求め、この補間値Y旧とコントラスト値c(6)とを
用いて比の値R(6)を下式のように求める(ステップ
#258)。
Next, the correlation function 86 (interpolated value Y of the minimum value of [1)) 11
is determined, and the ratio value R(6) is determined using the interpolated value Yold and the contrast value c(6) as shown in the following formula (step #258).

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

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

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

まず、基準部142aのデータ列を”3.2゜1、−1
.−2.−3”とし、参照部142bのデータ列を4.
3.2.1.−1.−2.−3゜=4″とすると、相関
関数はl−1(0) −〇、 H(−1> −6,H(
1) =6になる。ここで、参照部142bのデータ列
にノイズが加わり、参照部142bの−7−タ列tfi
”4.3.2.O,−1゜1、−3.−4”に変化する
と、相関関数はH(0) =2.8 (−1) =5.
5.8 (1) =6になり、合焦点、すなわち、相関
関数H(IN)に対するノイズの影響が最も大きく、相
関関数H(I H−1)、 HCI N+1)への影響
は比較的小さくなる。このため、相関関数1−1(11
4)が周期的な関数でない限り、相関関数)((IN)
を用いずに、相関関数1−1(114)の前後の相関関
数)−1(lN−2)、 H(I M−1)、 H(I
 N+1)、 H(I N+2)を用いてノイズの影響
を小さくするようにしている。
First, the data string of the reference part 142a is set to "3.2°1, -1".
.. -2. -3'', and the data string of the reference section 142b is set to 4.
3.2.1. -1. -2. -3゜=4'', the correlation function is l-1(0) -〇, H(-1>-6, H(
1) becomes =6. Here, noise is added to the data string of the reference section 142b, and the -7-ta string tfi of the reference section 142b
When changing to "4.3.2.O,-1°1,-3.-4", the correlation function becomes H(0) =2.8 (-1) =5.
5.8 (1) = 6, the effect of noise on the focused point, that is, the correlation function H(IN) is the largest, and the effect on the correlation functions H(I H-1), HCI N+1) is relatively small. Become. Therefore, the correlation function 1-1(11
4) is not a periodic function, the correlation function)((IN)
The correlation functions before and after the correlation function 1-1 (114))-1(lN-2), H(I M-1),
N+1) and H(IN+2) are used to reduce the influence of noise.

また、ステップ#258では、第18図(a)のような
通常の補間演算を行うと、オフセット量が生じるため、
補間値Y旧からM AX (H6(I )l−1)。
Furthermore, in step #258, if a normal interpolation calculation as shown in FIG. 18(a) is performed, an offset amount will occur.
Interpolated value Y old to M AX (H6(I)l-1).

H6(I N+1))と相関関数H6(IN)との差O
F1、あルイハMAX (H6(I H−2)、 H6
(I N+2))とMAX(H6(IN−1)、 H6
(IN+旬)との差OF2、あるいはコントラスト値C
(6)を引いた値に基づいて設定した値OFを用いて比
の値R(6)の演算を行う。
Difference O between H6(IN+1)) and correlation function H6(IN)
F1, Aiha MAX (H6 (I H-2), H6
(IN+2)) and MAX(H6(IN-1), H6
(IN+season) difference OF2 or contrast value C
The ratio value R(6) is calculated using the value OF set based on the value obtained by subtracting (6).

(発明の効果) 本発明は、複数個のデータの内から一部のデータを抽出
して高いコントラスト差を持つ被写体かどうかを判定す
るので、被写体全体としてはコントラストが低くても局
所的に高いコントラスト差を持つ被写体であれば、焦点
検出可能と判定することができる。
(Effects of the Invention) The present invention extracts some data from a plurality of pieces of data and determines whether the subject has a high contrast difference, so even if the contrast of the subject as a whole is low, it is locally high. If the subject has a contrast difference, it can be determined that focus detection is possible.

すなわち、例えば、スリット状の被写体の場合や、被写
体のエツジのように局所的に高いコン1−ラスト差があ
る場合には、被写体全体としてはコントラストが低くて
も安定した焦点検出を行うことができる。
That is, for example, in the case of a slit-shaped object or when there is a locally high contrast difference such as the edge of the object, stable focus detection cannot be performed even if the contrast of the object as a whole is low. can.

また、隣接した所定個数のデータの差を総和したブロッ
クデータを抽出して焦点検出可能かどうかを判定するの
で、ノイズの影響を軽減でき、応答性を犠牲にすること
なく、正確な焦点検出を行うことができる。
In addition, since it determines whether focus detection is possible by extracting block data that is the sum of differences between a predetermined number of adjacent pieces of data, it is possible to reduce the effects of noise and achieve accurate focus detection without sacrificing responsiveness. It can be carried out.

さらに、データの最大値と最小値の差に応じて焦点検出
可能かどうかを判定するので、スリット幅の狭い被写体
であっても安定した焦点検出を行うことができる。
Furthermore, since it is determined whether focus detection is possible according to the difference between the maximum value and the minimum value of data, stable focus detection can be performed even for a subject with a narrow slit width.

また、第1の所定値以上と第2の所定値以下のデータの
個数に応じて焦点検出可能かどうかを判定するので、ノ
イズの影響を軽減できるとともに、スリット状の被写体
であっても正確な焦点検出を行うことができる。
In addition, since it is determined whether focus detection is possible according to the number of pieces of data that are greater than or equal to the first predetermined value and less than or equal to the second predetermined value, it is possible to reduce the influence of noise and to accurately capture even slit-shaped objects. Focus detection can be performed.

【図面の簡単な説明】 第1図は本発明に係る自動焦点検出装置を備えたカメラ
の概略構成図、第2図は焦点検出手段の機構構成図、第
3図は光電変換素子アレイを示す図、第4図はファイン
ダ内の撮影画面の焦点検出領域を示す図、第5図は第1
アイランド〜第3アイランドに対応する基準部を拡大し
た図、第6図。 第7図は各ブロックのデフォーカス範囲を説明する図、
第8図は本発明に係る自動焦点検出装置をマイコンを用
いて構成したカメラの回路ブロック図、第9図、第10
図はマイコンの割り込み動作のフローチャート、第11
図〜第14図は第1アイランド〜第3アイランドのデフ
ォーカス量演算のサブルーチンを示すフローチャート、
第15図は露出演算のサブルーチンを示すフローチャー
ト、第16図はデフォーカス量の演算手段を選択する手
順を説明する図、第17図は平均処理幅を求めるサブル
ーチンを示すフローチャー1〜、第18図(a)は第3
ブロツクのデフォーカス量の演算および焦点検出不能判
断を説明する図、第18図(b)は人物が並んでいるよ
うな場合に誤判定することを説明する図、第19図は各
ブロックの相関関数およびコントラスト値の演算を示す
図、第20図〜第22図はコントラスト限界の判定のサ
ブルーチンを示すフローチャー1・、第23図〜第25
図は平均処理ルーチンを示すフローチャート、第26図
はデフォーカス量演算サブルーチンを示すフローチャー
ト、第27図は補間演算の手段を説明する図である。 1・・・自動焦点検出装置、2・・・撮影レンズ、3・
・・焦点検出手段、4・・・デフォーカス量決定手段、
5・・・レンズ位置検出手段、6・・・レンズ駆動手段
、7・・・制御手段、8・・・被写体、21・・・第1
アイランド、22・・・第2アイランド、23・・・第
3アイランド、26・・・マイコン、27・・・レンズ
回路、28・・・焦点検出データ出力回路、34・・・
レンズ制御回路、35・・・電源電池、36・・・給電
回路、14.1a、142a、143a・・・基準部、
141b、142b。 143b・・・参照部、BLl・・・第1ブ1]ツク、
BL2・・・第2ブロツク、B1−3・・・第3ブロツ
ク、B L 4・・・第4ブロツク、B l−5・・・
第5ブロツク、B10・・・第9ブロツク、BLlo・
・・第10ブロツク、SW+・・・電源スイッチ、 W2 ・・・撮影準備スイッチ、 Wa ・・・選 択スイッチ。
[BRIEF DESCRIPTION OF THE DRAWINGS] FIG. 1 is a schematic diagram of a camera equipped with an automatic focus detection device according to the present invention, FIG. 2 is a mechanical diagram of a focus detection means, and FIG. 3 is a photoelectric conversion element array. Figure 4 is a diagram showing the focus detection area of the photographing screen in the finder, and Figure 5 is a diagram showing the focus detection area of the photographing screen in the finder.
FIG. 6 is an enlarged view of the reference portion corresponding to the islands to the third island. FIG. 7 is a diagram explaining the defocus range of each block,
FIG. 8 is a circuit block diagram of a camera configured with an automatic focus detection device according to the present invention using a microcomputer, FIGS. 9 and 10.
The figure is a flowchart of microcontroller interrupt operation, No. 11.
14 are flowcharts showing subroutines for calculating the defocus amount of the first island to the third island,
FIG. 15 is a flowchart showing a subroutine for exposure calculation, FIG. 16 is a diagram explaining a procedure for selecting a defocus amount calculation means, and FIG. 17 is a flowchart 1 to 18 showing a subroutine for calculating an average processing width. Figure (a) is the third
Figure 18(b) is a diagram explaining the calculation of the defocus amount of a block and determination that the focus cannot be detected. Figure 18 (b) is a diagram explaining erroneous determination when people are lined up. Figure 19 is the correlation between each block. Figures 20 to 22 are flowcharts 1 and 23 to 25 showing subroutines for contrast limit determination.
FIG. 26 is a flowchart showing the average processing routine, FIG. 26 is a flowchart showing the defocus amount calculation subroutine, and FIG. 27 is a diagram illustrating means for interpolation calculation. 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 supply battery, 36... Power supply circuit, 14.1a, 142a, 143a... Reference section,
141b, 142b. 143b... Reference section, BLl... 1st block 1] Tsuku,
BL2...second block, B1-3...third block, BL4...fourth block, Bl-5...
5th block, B10...9th block, BLlo...
...10th block, SW+...power switch, W2...shooting preparation switch, Wa...selection switch.

Claims (1)

【特許請求の範囲】 1、被写体の光像のコントラストを検出する焦点検出領
域を有する焦点検出装置において、上記焦点検出領域か
らの複数個のデータの内から一部のデータを抽出する局
所コントラスト抽出手段と、該局所コントラスト抽出手
段からのデータに応じて判定レベルを設定する判定レベ
ル設定手段と、上記判定レベルと上記焦点検出領域から
のデータとを比較して焦点検出が可能か否かを判定する
判定手段とを備えたことを特徴とする焦点検出装置。 2、局所コントラスト抽出手段は焦点検出領域からのデ
ータの内から隣接する所定個数のデータを抽出するとと
もに、これらの差を総和してなるデータブロックCLC
Oを演算し、判定レベルは上記データブロックCLCO
に応じて変更されるようにしたことを特徴とする請求項
1記載の焦点検出装置。 3、局所コントラスト抽出手段は焦点検出領域からのデ
ータの内から最大値と最小値とを抽出するとともに、判
定レベルは上記最大値と上記最小値との差に応じて変更
されるようにしたことを特徴とする請求項1記載の焦点
検出装置。 4、局所コントラスト抽出手段は焦点検出領域からのデ
ータの内から第1の所定値以上と第2の所定値以下のデ
ータを抽出するとともに、判定レベルは上記データの個
数に応じて変更されるようにしたことを特徴とする請求
項1記載の焦点検出装置。
[Claims] 1. In a focus detection device having a focus detection area for detecting the contrast of an optical image of a subject, local contrast extraction for extracting some data from a plurality of data from the focus detection area. means, a determination level setting means for setting a determination level according to data from the local contrast extraction means, and determining whether focus detection is possible by comparing the determination level with data from the focus detection area. What is claimed is: 1. A focus detection device comprising: determination means for determining a focus. 2. The local contrast extraction means extracts a predetermined number of adjacent pieces of data from the data from the focus detection area, and sums up the differences between them to create a data block CLC.
O is calculated, and the judgment level is the above data block CLCO.
2. The focus detection device according to claim 1, wherein the focus detection device is configured to be changed in accordance with. 3. The local contrast extraction means extracts the maximum value and minimum value from the data from the focus detection area, and the determination level is changed according to the difference between the maximum value and the minimum value. The focus detection device according to claim 1, characterized in that: 4. The local contrast extraction means extracts data equal to or greater than a first predetermined value and equal to or less than a second predetermined value from among the data from the focus detection area, and the determination level is changed according to the number of pieces of data. The focus detection device according to claim 1, characterized in that:
JP10325689A 1989-04-21 1989-04-21 Focus detecting device Pending JPH0215218A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10325689A JPH0215218A (en) 1989-04-21 1989-04-21 Focus detecting device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10325689A JPH0215218A (en) 1989-04-21 1989-04-21 Focus detecting 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 (1)

Publication Number Publication Date
JPH0215218A true JPH0215218A (en) 1990-01-18

Family

ID=14349364

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10325689A Pending JPH0215218A (en) 1989-04-21 1989-04-21 Focus detecting device

Country Status (1)

Country Link
JP (1) JPH0215218A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0382564A2 (en) * 1989-02-10 1990-08-16 Nikon Corporation Focus state detecting device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0382564A2 (en) * 1989-02-10 1990-08-16 Nikon Corporation Focus state detecting device

Similar Documents

Publication Publication Date Title
US5138357A (en) Focus adjuster
JPS62229213A (en) Photographic lens barrel
JP2605282B2 (en) Automatic focusing device
US4994841A (en) Automatic focus detecting means
JPS59126517A (en) Focusing detector of camera
US6636699B2 (en) Focus detection device and distance measurement device
US5144357A (en) Automatic focus detecting means
US4021823A (en) Photometric device built into viewfinder system for a single lens reflex camera
JPH0215221A (en) Focus detecting device
JPH0215218A (en) Focus detecting device
JPH0215217A (en) Focus detector
JPH03164727A (en) Focus detecting photometric device
JP2671489B2 (en) Focus detection device
JP2770318B2 (en) Automatic focus detection device
JP2682132B2 (en) Focus detection device
JP2671490B2 (en) Focus detection device
JPH02176610A (en) Focus detector
US5402201A (en) Automatic flash control device of camera
JP2671493B2 (en) Focus detection device
JP2770407B2 (en) Focus detection device
JP2671491B2 (en) Focus detection device
JP2671490C (en)
JPH04119338A (en) Photometric computing device for camera
JP4532169B2 (en) Focus detection device
JPH01289905A (en) Camera and camera body