JPH04338905A - Focus detection device - Google Patents

Focus detection device

Info

Publication number
JPH04338905A
JPH04338905A JP3159377A JP15937791A JPH04338905A JP H04338905 A JPH04338905 A JP H04338905A JP 3159377 A JP3159377 A JP 3159377A JP 15937791 A JP15937791 A JP 15937791A JP H04338905 A JPH04338905 A JP H04338905A
Authority
JP
Japan
Prior art keywords
data
shift
amount
correlation
filter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP3159377A
Other languages
Japanese (ja)
Other versions
JPH07119885B2 (en
Inventor
Takeshi Utagawa
健 歌川
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.)
Nikon Corp
Original Assignee
Nikon Corp
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 Nikon Corp filed Critical Nikon Corp
Priority to JP3159377A priority Critical patent/JPH07119885B2/en
Publication of JPH04338905A publication Critical patent/JPH04338905A/en
Publication of JPH07119885B2 publication Critical patent/JPH07119885B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

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

Abstract

PURPOSE:To improve the detection accuracy by shifting images alternately to find their correlation quantity, and calculating the relative deviation quantity by interpolating extremal values by assuming that the correlation curve has a V shape. CONSTITUTION:A couple of pieces of luminous flux having parallax optically are guided onto a couple of photoelectric converting means and the relative shift of the object images on the photoelectric converting means is calculated to perform focus detection. In this case, the photoelectric outputs of the couple of photoelectric converting means or filter outputs obtained by filtering the photoelectric outputs are denoted as data A1, A2 ... or B1, B2..., the couples of data A and B are compared while a specific number of data shift quantities L (L: integer) to calculate plural next correlation quantities by an arithmetic means according to an equation I. In the equation I, (q) is a function of the L. This focus detection device is so constituted that addition by the arithmetic means is performed by shifting both the data in comparison start position alternately by one each time the mutual shift quantity L increases.

Description

【発明の詳細な説明】[Detailed description of the invention]

【0001】0001

【産業上の利用分野】本発明は、結像光学系による対象
物体の光像を光電素子アレイにより光電変換しその光電
出力に応じて結像光学系の焦点調節状態又は対象物体ま
での距離を検出する焦点検出装置に係り、特にカメラの
焦点検出装置に関する。
[Industrial Application Field] The present invention converts an optical image of a target object formed by an imaging optical system into electricity using a photoelectric element array, and adjusts the focus adjustment state of the imaging optical system or the distance to the target object according to the photoelectric output. The present invention relates to a focus detection device for detection, and particularly to a focus detection device for a camera.

【0002】0002

【従来の技術】対象物体の光像を夫々一体の光電素子ア
レイ上に形成しそれらのアレイの光電出力を演算するこ
とにより、結像光学系の焦点調節状態又は対象物体まで
の距離を検出する焦点検出装置は種々提案されている。 例えば、結像レンズの瞳の異なる領域を通過した光束を
一体のイメージセンサ上に導き両イメージセンサ上の対
象物体像の相対的ずれ量を光電的に検出して結像レンズ
の焦点調節状態を検出する焦点検出装置は広く実用化さ
れている。
2. Description of the Related Art The focusing state of an imaging optical system or the distance to the target object is detected by forming optical images of the target object on respective integrated photoelectric element arrays and calculating the photoelectric outputs of those arrays. Various focus detection devices have been proposed. For example, light fluxes that have passed through different areas of the pupil of the imaging lens are guided onto a single image sensor, and the relative shift between the images of the target object on both image sensors is photoelectrically detected to determine the focusing state of the imaging lens. Focus detection devices for detecting focus have been widely put into practical use.

【0003】0003

【発明が解決しようとする課題】しかし、イメージセン
サーから得られた画像データから複数の相関量を求めて
、これに基づいて精度良く対象物体の相対的像ずれ量を
算出するための極値の内挿方法は知られていない。本発
明の目的は、精度良い極値の内挿方法を与えると共に、
その際に精度向上に効果的な相関量の求め方(シフトの
させ方)を与えることにある。
[Problem to be Solved by the Invention] However, there is a problem in finding a plurality of correlation amounts from image data obtained from an image sensor, and calculating the relative image shift amount of the target object with high accuracy based on the correlation amounts. No interpolation method is known. The purpose of the present invention is to provide a highly accurate extreme value interpolation method, and to
The purpose of this invention is to provide a method for determining the amount of correlation (a method for shifting) that is effective in improving accuracy.

【0004】0004

【実施例】以下に本発明の実施例であるカメラの焦点検
出装置を図面を参照して説明する。図1において、光電
変換装置1はCCD型又はMOS型イメージセンサから
成る一対の光電素子アレイ2、3を有し、これらのアレ
イ2、3上には夫々カメラの撮影レンズの瞳の異った領
域を通った一対の光束によって被写体の光像が形成され
る。アレイ2上の光像とアレイ3上の光像との相対的ず
れ量がレンズの焦点調節状態を表わしている。上記アレ
イ2、3は夫々空間ピッチp0で直線上に配列された光
電素子a1 ’ …an ’ とb1 ’ …bn ’
 とから構成され、各光電素子a1 ’ …an ’ 
、b1 ’ …bn ’ は夫々空間ピッチp0 の一
次データa1 …an 、b1 …bn を時系列的に
出力する。アレイ2に関するデータ、アレイ3に関する
データを以下夫々a系列、b系列データと言う。
DESCRIPTION OF THE PREFERRED EMBODIMENTS A camera focus detection device according to an embodiment of the present invention will be described below with reference to the drawings. In FIG. 1, a photoelectric conversion device 1 has a pair of photoelectric element arrays 2 and 3 consisting of CCD type or MOS type image sensors. An optical image of the object is formed by a pair of light beams passing through the area. The amount of relative deviation between the light image on array 2 and the light image on array 3 represents the focus adjustment state of the lens. The arrays 2 and 3 have photoelectric elements a1'...an' and b1'...bn' arranged in a straight line with a spatial pitch p0, respectively.
and each photoelectric element a1'...an'
, b1'...bn' output primary data a1...an, b1...bn of the spatial pitch p0, respectively, in time series. The data regarding array 2 and the data regarding array 3 will hereinafter be referred to as a-series data and b-series data, respectively.

【0005】各光電素子アレイ2、3のMTF特性は、
図2(a)に示されるようにD.C(直流)成分付近で
充分大きくそこから周波数が大きくなるにつれて低下し
、1/p0 の周波数付近で零になる。従って一次デー
タa1 …an 、b1 …bn は光像の空間周波数
成分のうちD.C成分付近を充分含み、1/p0 付近
の周波数成分をほとんど含まない。
The MTF characteristics of each photoelectric element array 2 and 3 are as follows:
As shown in FIG. 2(a), D. It is sufficiently large near the C (DC) component, then decreases as the frequency increases, and becomes zero near the frequency of 1/p0. Therefore, the primary data a1...an, b1...bn are D. of the spatial frequency components of the optical image. It contains enough frequency components near the C component and almost no frequency components near 1/p0.

【0006】光電変換装置1からの一次データai、b
iは、非線形処理部4において例えば対数増幅された後
、前置フィルタ手段5に送られる。この前置フィルタ手
段5は本実施例では、ハードウェア具体的には図3(a
)又は(b)に示すトランスパーサルフィルタにより構
成されている。図3(a)(b)のフィルタは、直列接
続された−データ分の遅延回路D1 、D2 、D3 
…と、夫々所定の加重係数w1 、w2 、w3 、w
4 、w5 を入力データに乗ずる乗算器w1 、w2
 、…w5 と、これらの乗算器の出力を加算する加算
器T1 とから構成され、図3(a)は一次データがa
1 、b1 、a2 、b2 …an 、bn の順に
入力される場合の構成を、図3(b)は、a1 、a2
 …an 、b1 、b2 …bn の順で入力される
場合の構成を示している。このようにトランスパーサル
フィルタは、順次入力されるa系列の一次データa1 
、a2 …an の連続する5個のデータに図2(b−
2)に示すような所定の加重係数w1 =0.28、w
2 =0.76、w3 =1、w4 =0.76、w5
 =0.28を夫々乗じ、それらを加算した後和を出力
し、b系列の一次データb1 、b2 …bn につい
ても全く同様に処理する。複数のデータに所定の加重係
数を乗じそれらと加算するフィルタリング処理及びフィ
ルタを夫々加重加算及び加重加算フィルタを称すること
にする。上述の加重係数列(0.28、0.76、1、
0.76、0.28)を有する加重加算フィルタのMT
F特性は、図2(b−1)に示すように、D.C成分を
充分抽出し1/4p0 付近以上の周波数成分を除去す
るもので、換言するとサンプリングピッチp=2p0 
により決まるナイキスト周波数fN =1/2p以上の
空間周波数成分を除去する特性である。もちろんこの様
なMTF特性を有する加重加算フィルタは上述の重み係
数列に限らず他の加重係数列によっても達成できる。
Primary data ai, b from the photoelectric conversion device 1
i is, for example, logarithmically amplified in the nonlinear processing section 4 and then sent to the prefilter means 5. In this embodiment, this pre-filter means 5 is implemented by hardware specifically shown in FIG. 3(a).
) or (b). The filters in FIGS. 3(a) and 3(b) are series-connected delay circuits D1, D2, and D3 for data.
...and predetermined weighting coefficients w1, w2, w3, w, respectively.
Multipliers w1 and w2 that multiply input data by 4 and w5
,...w5, and an adder T1 that adds the outputs of these multipliers, and FIG. 3(a) shows that the primary data is a.
1, b1, a2, b2...an, bn are input in the order shown in FIG. 3(b).
...an, b1, b2...bn are input in this order. In this way, the transpersal filter uses the primary data a1 of the a series that is input sequentially.
, a2...an in Figure 2 (b-
2) Predetermined weighting coefficient w1 = 0.28, w
2 =0.76, w3 =1, w4 =0.76, w5
=0.28, add them, output the sum, and process the b-series primary data b1, b2 . . . bn in exactly the same way. A filtering process and a filter that multiply a plurality of data by a predetermined weighting coefficient and add them are respectively referred to as a weighted addition and a weighted addition filter. The above weighting coefficient sequence (0.28, 0.76, 1,
MT of the weighted addition filter with 0.76, 0.28)
The F characteristics are as shown in FIG. 2(b-1). It fully extracts the C component and removes frequency components around 1/4p0 or higher, in other words, sampling pitch p=2p0
This is a characteristic that removes spatial frequency components higher than the Nyquist frequency fN = 1/2p determined by . Of course, a weighted addition filter having such an MTF characteristic can be achieved not only by the above-mentioned weighting coefficient sequence but also by other weighting coefficient sequences.

【0007】前置フィルタ手段5によりフィルタリング
されたデータはサンプルホールド手段6によりサンプリ
ングピッチp=2p0 でサンプルホールドされる。こ
うして空間ピッチp0 のa系列及びb系列の一次デー
タai、biは前置フィルタ手段とサンプルホールド手
段を経て空間ピッチ2p0 を有するa系列二次データ
Aiとb系列二次データBiに変換される。この二次デ
ータAi、Biはピッチ2p0 であるため、その個数
が、一次データai・biの約半分である。二次データ
Ai、Biは以下の数式で表わすことができる。
The data filtered by the prefilter means 5 is sampled and held by the sample hold means 6 at a sampling pitch p=2p0. In this way, the a-series and b-series primary data ai, bi with a spatial pitch p0 are converted into a-series secondary data Ai and b-series secondary data Bi with a spatial pitch 2p0 through the prefilter means and sample hold means. Since the secondary data Ai and Bi have a pitch of 2p0, their number is about half of the primary data ai and bi. The secondary data Ai, Bi can be expressed by the following formula.

【0008】[0008]

【数1】[Math 1]

【0009】これらの二次データAi、BiはA/D変
換器7でA/D変換された後、マイクロコンピュータ(
以下マイコンと称する。)8に入力されそのメモリ部9
に収容される。マイコン8のCPUはフィルタリング処
理やずれ演算等の機能をなすものである。これらの機能
を視覚化する為にここではブロック8の内部に便宜上、
加重加算フィルタリング機能を行う後置フィルタ部10
と、演算機能を行うずれ演算部11とを夫々ブロック化
した。後置フィルタ部10は、メモリ部9内の二次デー
タAi、Biに、図2(c−3)に示す空間ピッチ4p
0 の重み係数列(−0.25、1、−0.25)又は
図2(d−3)に示す空間ピッチ4p0 の重み係数列
(−0.5、1、−0.5)を用いた加重加算処理を施
こし、三次データを作成する。具体的には二次データA
i、Biは空間ピッチp=2p0 であるので、後置フ
ィルタ部は、連続する5個の二次データに、図2(c−
3)又は(d−3)として(−0.25、0、1、0、
−0.25)、又は(−0.5、0、1、0、−0.5
)の加重係数列を乗じて加算する。
After these secondary data Ai, Bi are A/D converted by an A/D converter 7, they are sent to a microcomputer (
Hereinafter, it will be referred to as a microcomputer. ) 8 and its memory section 9
be accommodated in. The CPU of the microcomputer 8 performs functions such as filtering processing and shift calculation. In order to visualize these functions, here, for convenience, inside block 8,
Post-filter unit 10 that performs a weighted addition filtering function
and a shift calculation section 11 that performs calculation functions are each made into blocks. The post-filter unit 10 inputs the secondary data Ai, Bi in the memory unit 9 with a spatial pitch 4p shown in FIG. 2(c-3).
0 weighting coefficient sequence (-0.25, 1, -0.25) or the spatial pitch 4p0 weighting coefficient sequence (-0.5, 1, -0.5) shown in Fig. 2 (d-3). Perform weighted addition processing to create tertiary data. Specifically, secondary data A
Since i and Bi have a spatial pitch of p=2p0, the post-filter section filters the continuous five secondary data as shown in Fig. 2(c-
3) or (d-3) as (-0.25, 0, 1, 0,
-0.25), or (-0.5, 0, 1, 0, -0.5
) are multiplied by the weighting coefficient sequence and added.

【0010】この三次データは結局、前置フィルタ手段
5と後置フィルタ部10との両方の加重加算フィルタリ
ング処理を受けたことになる。図2(b−2)と図2(
c−3)の重み係数列を夫々持つフィルタの合成MTF
を図2(c−1)に示し、同様に図2(b−2)と(d
−3)のフィルタの合成MTFを図2(d−1)に示す
[0010] This tertiary data has been subjected to weighted addition filtering processing by both the pre-filter means 5 and the post-filter section 10. Figure 2 (b-2) and Figure 2 (
c-3) Synthesis MTF of filters each having a weighting coefficient sequence
is shown in Fig. 2 (c-1), and similarly Fig. 2 (b-2) and (d
The composite MTF of the filter of -3) is shown in FIG. 2(d-1).

【0011】ずれ演算部11はa系列とb系列の二次デ
ータから、又はa系列とb系列の三次データからアレイ
2、3上の光像の相対的ずれ量を算出する。このa系列
とb系列とのデータから光像のずれを求める演算は種々
のタイプが知られており、ここでは任意のタイプを用い
ることができる。このずれ量は、焦点状態を表示する表
示手段12及び撮影レンズの焦点調節を行う焦点調節手
段13に夫々送られる。
The deviation calculation unit 11 calculates the relative deviation amount of the optical images on the arrays 2 and 3 from the secondary data of the a series and the b sequence, or from the tertiary data of the a series and the b series. Various types of calculations are known for calculating the shift of the optical image from the data of the a series and the b series, and any type can be used here. This amount of deviation is sent to a display means 12 that displays the focus state and a focus adjustment means 13 that adjusts the focus of the photographic lens.

【0012】この作用を説明する前に、空間周波数成分
と演算結果の精度との関係を述べる。一般に、サンプリ
ングピッチpのデータを演算してずれ量を検出する場合
、サンプリングピッチpから決まるナイキスト周波数f
N =1/2p以上の空間周波数成分は、有害で誤検出
の要因となり、上記ナイキスト周波数の半分fN /2
付近の空間周波数成分は、極めて有効で高精度の演算結
果が期待でき、また周波数がこの周波数fN /2より
小さくなるにつれて精度が低下する。一方撮影レンズが
合焦位置から大きくずれていると、光電素子アレイ上の
光像は大きくボケてしまいこの光像には高次の空間周波
数成分が大幅に減少しD.C成分付近の成分が増加する
Before explaining this effect, the relationship between the spatial frequency component and the accuracy of the calculation result will be described. In general, when detecting the amount of deviation by calculating data at a sampling pitch p, the Nyquist frequency f determined from the sampling pitch p
Spatial frequency components of N = 1/2p or more are harmful and cause false detection, and are half the Nyquist frequency fN /2
Very effective and highly accurate calculation results can be expected for nearby spatial frequency components, and the accuracy decreases as the frequency becomes smaller than this frequency fN/2. On the other hand, if the photographing lens is greatly deviated from the in-focus position, the optical image on the photoelectric element array will be greatly blurred, and this optical image will have significantly reduced high-order spatial frequency components. Components near the C component increase.

【0013】図1の装置の作用は以下の通りである。光
電変換手段1から時系列的に出力された空間ピッチp0
 の一次データai、biは、非線形化手段4、前置フ
ィルタ手段5を順次通過した後、サンプルホールド手段
6によりピッチp=2p0 でサンプリングされ、空間
ピッチ2p0 の二次データAi、Biとなる。この二
次データAi、BiはA/D変換された後、マイコン8
に入力される。
The operation of the device of FIG. 1 is as follows. Spatial pitch p0 chronologically output from photoelectric conversion means 1
The primary data ai, bi sequentially pass through the nonlinearization means 4 and the prefilter means 5, and then are sampled by the sample and hold means 6 at a pitch p=2p0 to become secondary data Ai, Bi with a spatial pitch of 2p0. After the secondary data Ai and Bi are A/D converted, the microcomputer 8
is input.

【0014】マイコン8は、図4に示すように、入力さ
れた二次データAi、Biをステップ〔1〕において、
メモリ領域(1)に格納し、ステップ〔2〕において格
納された二次データAi、Biを演算処理し光像のずれ
量に関連する値Lmを算出する。二次データAi、Bi
は、既に図2(b−1)のMTF特性の前置フィルタ手
段5のフィルタリング処理を受けてナイキスト周波数f
N =1/4p0 以上の有害な空間周波数成分をすべ
て除去されており、かつD.C成分を充分に含有してい
る可能性があるので、たとえずれ量が大きく光像がぼけ
ていたとしても、或る程度の精度でもってずれ検出が可
能である。
As shown in FIG. 4, the microcomputer 8 processes the input secondary data Ai, Bi in step [1].
The secondary data Ai and Bi stored in the memory area (1) and stored in step [2] are processed to calculate a value Lm related to the amount of deviation of the optical image. Secondary data Ai, Bi
has already undergone filtering processing by the prefilter means 5 of the MTF characteristic shown in FIG.
All harmful spatial frequency components of N = 1/4p0 or more have been removed, and D. Since there is a possibility that the C component is sufficiently contained, even if the amount of deviation is large and the optical image is blurred, the deviation can be detected with a certain degree of accuracy.

【0015】ステップ〔4〕では,演算結果Lmが、撮
影レンズが合焦位置近傍にあることを表わしているか否
か、即ちLmが所定値以下か否かを判定する。N0 の
場合には直ちにステップ〔8〕に移り、上記演算結果L
mからデフォーカス量即ち撮影レンズの結像位置と予定
焦点点面(フィルム面)とのずれ量を換算する。他方ス
テップ〔4〕においてYesであるならば光像中にfN
 /2付近の高次の空間周波数成分が充分に含まれてい
る可能性が大であり、その場合この高次の空間周波数成
分のみでずれ演算した方が精度が良いので、この高次空
間周波数成分によるずれ演算を行う為にステップ〔5〕
へ移る。
In step [4], it is determined whether the calculation result Lm indicates that the photographing lens is near the in-focus position, that is, whether Lm is less than or equal to a predetermined value. In the case of N0, immediately proceed to step [8] and calculate the above calculation result L.
The amount of defocus, that is, the amount of deviation between the imaging position of the photographic lens and the planned focal point plane (film plane) is converted from m. On the other hand, if Yes in step [4], fN is present in the optical image.
There is a high possibility that a high-order spatial frequency component around Step [5] to perform deviation calculation by component
Move to.

【0016】このステップ〔5〕では、メモリ領域(1
)の二次データAi、Biに図2(c−3)又は(d−
3)の加重係数列による加重加算処理を行い、三次デー
タを作りそれをメモリ領域(2)へ格納する。この三次
データは図2(c−1)又は(d−1)のMTF特性の
フィルタリング処理を受けているので、D.C成分をか
なり又は完全に除去され、fN /2(=1/8p0)
の高次空間周波数成分を充分含んでいることが期待され
る。ステップ〔6〕において使用メモリ領域としてメモ
リ領域(2)が指定されステップ〔7〕でメモリ領域(
2)からの三次データに基づきずれ演算処理を行う。ス
テップ〔8〕で演算結果Lmをデフォーカス量に換算す
る。
In this step [5], the memory area (1
) to the secondary data Ai, Bi in Figure 2 (c-3) or (d-
The weighted addition process using the weighted coefficient sequence of 3) is performed to create tertiary data and store it in the memory area (2). Since this tertiary data has been subjected to filtering processing using the MTF characteristics shown in FIG. 2(c-1) or (d-1), D. The C component is considerably or completely removed, fN /2 (=1/8p0)
is expected to contain sufficient high-order spatial frequency components. In step [6], memory area (2) is specified as the memory area to be used, and in step [7], memory area (2) is specified as the memory area to be used.
2) Performs deviation calculation processing based on the tertiary data from 2). In step [8], the calculation result Lm is converted into a defocus amount.

【0017】このように、撮影レンズが合焦位置から大
きくずれている場合には比較的低次の空間周波数成分を
相対的に多く含んだ二次データによりずれ検出が行われ
また合焦位置近傍にある場合には、高次の空間周波数成
分を相対的に多く含んだ三次データにより高精度のずれ
検出が行われる。こうして求められたデフォーカス量に
応じて、表示手段12と焦点調節手段13が夫々焦点調
節状態の表示及び焦点調節を行う。
[0017] In this way, when the photographing lens deviates significantly from the in-focus position, the deviation is detected using secondary data that contains a relatively large number of relatively low-order spatial frequency components, and In this case, highly accurate deviation detection is performed using tertiary data containing relatively many high-order spatial frequency components. According to the defocus amount thus determined, the display means 12 and the focus adjustment means 13 display the focus adjustment state and perform focus adjustment, respectively.

【0018】なお、上記実施例ではサンプルホールド手
段6のサンプルピッチpを2p0 と定めたが、一般的
にはそのピッチpはnp0 (nは自然数)でよく、こ
の場合前置フィルタ手段MTF特性は、このサンプルピ
ッチnp0 により決まるナイキスト周波数1/2np
0 以上の周波数成分を除去するように選定される。ま
た非線形化手段4による対数化は、D.C成分除去用の
加重加算フィルタに入力するデータを対数変換しておく
ことにより光像のケラレによるずれ検出誤差を低減する
効果がある。従ってこの手段4はD.C成分除去用加重
加算フィルタの前であればどこに配置してもよい。
In the above embodiment, the sample pitch p of the sample hold means 6 is set to 2p0, but generally the pitch p may be np0 (n is a natural number), and in this case, the prefilter means MTF characteristic is , Nyquist frequency 1/2np determined by this sample pitch np0
It is selected to remove frequency components above 0. Further, logarithmization by the nonlinearization means 4 is performed by D. Logarithmically transforming the data input to the weighted addition filter for C component removal has the effect of reducing deviation detection errors due to vignetting of the optical image. Therefore, this means 4 is D. It may be placed anywhere before the C component removal weighted addition filter.

【0019】また、メモリ領域(2)はメモリ領域(1
)を用いることもできる。またメモリ容量に余裕があり
メモリ領域(1)、(2)として別個の領域を使用でき
る場合でA/D変換に時間がかかりCPUの能力が余っ
ている場合には、ステップ〔5〕のフィルタ処理をステ
ップ〔1〕の格納と同時に行うこともできる。前置フィ
ルタ手段と後置フィルタ手段との性質について説明する
Furthermore, the memory area (2) is the memory area (1).
) can also be used. In addition, if there is sufficient memory capacity and separate areas can be used as memory areas (1) and (2), and if A/D conversion takes time and there is excess CPU capacity, the filter in step [5] The processing can also be performed simultaneously with the storage in step [1]. The properties of the pre-filter means and the post-filter means will be explained.

【0020】図2(b−2)の加重係数列を持つ前置フ
ィルタと図2(c−3)又は(d−3)の加重係数列を
持つ後置フィルタとの合成MTF特性は、図2(c−1
)又は(d−1)に示すものであり、この図2(c−1
)又は(d−1)のMTF特性の単一の加重加算フィル
タから得ようとするとこの単一加重加算フィルタの加重
係数列は図2(c−2)又は(d−2)となる。ここで
上記前置フィルタと後置フィルタの加重係数の個数の合
計は8個であり、上記単一フィルタの加重係数の個数は
13個となる。同様に、例えば図2(b−2)、(e−
3)及び(f−3)の加重係数列を夫々有する三個の加
重加算フィルタを直列に組合せた組合フィルタは図2(
f−1)に示す合成MTF特性を呈し、このMTF特性
は図2(f−2)の加重係数列を有する単一の加重加算
フィルタからも得ることができ、上記組合フィルタの加
重係数の個数の合計は11個であり、上記単一フィルタ
の加重係数の個数は25個である。更に、図2(e−3
)と(f−3)の加重係数列を夫々有する組合フィルタ
の合成MTF特性と、図2(f−4)の加重係数列を有
する単一フィルタのMTF特性とは同一であり、上記組
合フィルタの加重係数の個数の合計は6で、上記単一フ
ィルタのそれは9となる。
The combined MTF characteristics of the pre-filter having the weighting coefficient sequence shown in FIG. 2(b-2) and the post-filter having the weighting coefficient sequence shown in FIG. 2(c-3) or (d-3) are shown in FIG. 2(c-1
) or (d-1), and this Figure 2 (c-1
) or (d-1) from a single weighted addition filter, the weighting coefficient sequence of this single weighted addition filter will be as shown in FIG. 2 (c-2) or (d-2). Here, the total number of weighting coefficients of the pre-filter and post-filter is 8, and the number of weighting coefficients of the single filter is 13. Similarly, for example, FIGS. 2(b-2), (e-
A combination filter in which three weighted addition filters having weighted coefficient sequences of 3) and (f-3) are combined in series is shown in FIG.
It exhibits the composite MTF characteristic shown in f-1), and this MTF characteristic can also be obtained from a single weighted addition filter having the weighting coefficient sequence shown in FIG. The total number of weighting coefficients is 11, and the number of weighting coefficients of the single filter is 25. Furthermore, Figure 2 (e-3
) and (f-3), respectively, and the MTF characteristics of a single filter having the weighting coefficient sequence of FIG. 2(f-4) are the same, and the combined filter The total number of weighting coefficients is 6, and that of the single filter is 9.

【0021】この様に一般に単一の加重加算フィルタの
MTF特性と同一のMTF特性を複数の加重加算フィル
タを直列に組合せた組合フィルタからも得ることができ
、かつ、複数の加重加算フィルタの組合せの加重係数の
合計は、単一加重加算フィルタの加重係数個数より大幅
に減少できる。この個数の減少は、加重加算フィルタを
ハードウェアで構成した場合には構造の簡単化を期待で
き、加重加算をマイコンで行う場合には処理時間の短縮
が期待できる。
In this way, in general, the same MTF characteristic as that of a single weighted addition filter can be obtained from a combination filter in which a plurality of weighted addition filters are combined in series. The sum of the weighting coefficients can be significantly reduced than the number of weighting coefficients of a single weighted addition filter. This reduction in the number can be expected to simplify the structure if the weighted addition filter is configured by hardware, and can be expected to shorten the processing time if the weighted addition is performed by a microcomputer.

【0022】また後で述べる様に、後置フィルタとして
比較的簡単な加重係数列を複数個用意し、それらを適宜
選択して前置フィルタと組合せて使用することにより容
易に組合フィルタを複数個得ることができる。上述した
様に、前置フィルタに、ずれ演算に用いられるデータの
空間ピッチから決まるナイキスト周波数以上の空間周波
数成分を除去するMTF特性を付与することは次の利点
がある。即ち前置フィルタの出力はずれ演算に有害とな
る成分が除去されているので、後置フィルタの出力の外
に前置フィルタの出力をもずれ演算に使用することがで
きる利点である。
Furthermore, as will be described later, by preparing a plurality of relatively simple weighting coefficient sequences as post-filters, selecting them appropriately and using them in combination with a pre-filter, it is possible to easily create a plurality of combined filters. Obtainable. As described above, providing the prefilter with an MTF characteristic that removes spatial frequency components higher than the Nyquist frequency determined from the spatial pitch of data used for shift calculation has the following advantages. That is, since the output of the pre-filter has been removed from components that would be detrimental to the displacement calculation, it is advantageous that the output of the pre-filter can be used in addition to the output of the post-filter for the displacement calculation.

【0023】また、前置フィルタをハードウェアで構成
し、後置フィルタとして複数のフィルタを用意し、それ
らのフィルタリングをソフトウェアで処理する場合には
、前置フィルタの出力をメモリに収納しその収納データ
を順次複数の後置フィルタ処理に利用できる利点がある
。次に、ずれ演算部について説明する。
[0023] In addition, when the pre-filter is configured with hardware and a plurality of filters are prepared as post-filter and their filtering is processed by software, the output of the pre-filter is stored in memory and the There is an advantage that the data can be sequentially used for multiple post-filtering processes. Next, the deviation calculation section will be explained.

【0024】メモリには夫々N個のa系列データA1 
…AN 、b系列データB1 …BN が収容されてい
るとする。a系列データをb系列データに所定数のデー
タ分L(整数)ずつシフトしながら、以下の相関量C(
L)を算出する。
[0024] Each memory stores N pieces of a-series data A1.
...AN, b-series data B1...BN are stored. While shifting the a series data to the b series data by a predetermined number of data L (integer), the following correlation amount C (
Calculate L).

【0025】[0025]

【数2】[Math 2]

【0026】ここでqとrは例えば次式で与えられる。Here, q and r are given by the following equations, for example.

【0027】[0027]

【数3】[Math 3]

【0028】Sは加算の項数を表わす一定の整数で〔X
〕はXを越えない最大の整数を表わす。このように相関
量C(L)は一対のデータ列を相互にLだけシフトして
求められる。この場合(1)式の定義から明らかなよう
にA,Bデータの比較開始位置Aq 、Bq+L もシ
フト量Lの関数であり、シフト量が増加する毎に比較デ
ータの開始位置が交互に1つずつずれる様な構成を取る
。即ちより具体的に説明すれば、最初C(0)でAのあ
る範囲のデータとBのある範囲のデータとを比較したら
、C(1)ではBの方だけC(0)の場合に比べて1デ
ータずらしてAの方はC(0)の時のままで比較し、C
(2)ではBの方はC(1)の時のままでAの方はC(
1)の時のデータを−1だけずらして比較してと言うよ
うにAのデータとBのデータとを交互に逆方向にシフト
して比較を行って相関量を算出している。このようなシ
フト形式を取ることによりAデータとBデータの扱いが
対等になり、片方のデータを固定して他方のデータのみ
シフトして相関量を求める場合に比べて相関曲線(図5
のF)の対称性が良くなり、以下のシフト量算出の精度
が向上する。
S is a constant integer representing the number of addition terms [X
] represents the largest integer not exceeding X. In this way, the correlation amount C(L) is obtained by mutually shifting a pair of data strings by L. In this case, as is clear from the definition of equation (1), the comparison start positions Aq and Bq+L of the A and B data are also functions of the shift amount L, and each time the shift amount increases, the comparison data start position changes by one. Take a composition that shifts by one step at a time. In other words, to explain more specifically, if we first compare data in a certain range of A with data in a certain range of B at C(0), then in C(1) only B is compared to C(0). Shift 1 data and compare A as it was at C(0).
In (2), B remains as it was in C(1), and A remains C(
The correlation amount is calculated by comparing the data of A and B by alternately shifting them in opposite directions, such as by shifting the data in case 1) by -1 and comparing them. By adopting such a shift format, data A and data B are treated equally, and the correlation curve (Fig. 5
The symmetry of F) is improved, and the accuracy of the following shift amount calculation is improved.

【0029】図5(a)はシフト量Lを順次変えた時々
の相関量C(L)をプロットしたものでFはプロットさ
れた点を結ぶ関数でありこの関数Fが最小となる点Fm
を与えるLのシスト量Lmが、構造のずれ量に対応して
いる。最小点Fm付近の曲線Fの形状が図5(a)に示
すように最大値Fmを中心とするほぼ対称なV字形とな
っていることを実験の結果見出した。これに基づき最小
値Fmを与えるシフト量Lmを内挿する手法を以下に述
べる。
FIG. 5(a) is a plot of the correlation amount C(L) when the shift amount L is successively changed.F is a function connecting the plotted points, and the point Fm where this function F is minimum is
The cyst amount Lm of L that gives L corresponds to the amount of structural deviation. As a result of experiments, it was found that the shape of the curve F near the minimum point Fm is approximately symmetrical V-shaped with the maximum value Fm as the center, as shown in FIG. 5(a). A method of interpolating the shift amount Lm that gives the minimum value Fm based on this will be described below.

【0030】一データ分ずつ増加したシフト量L−1、
L、L+1に対する相関量C(L−1)、C(L)、C
(L+1)を夫々C−1、C0 、C1 とする。図5
(b)に示す如くC−1≧C0 及びC1 >C0 が
満足される時、C−1とC1 との間に極小値が存在す
る。この極小値を内挿により求めるために、上記三個の
相関量のうちの最大C1 と最小C0 とを直線l1 
で結び、この直線l1 の傾きと絶対値が等しいが符号
が逆の傾きを持つ直線l−1を中間の値C−1を通る様
に引く。両直線l1 とl−1の交点が関数Fの極小値
Cextとなる。座標軸C(L)方向におけるC0 と
Cextとの間の距離DL は次の様になる。
[0030] Shift amount L-1 increased by one data,
Correlation amounts C(L-1), C(L), C for L, L+1
Let (L+1) be C-1, C0, and C1, respectively. Figure 5
As shown in (b), when C-1≧C0 and C1 >C0 are satisfied, a minimum value exists between C-1 and C1. In order to find this minimum value by interpolation, the maximum C1 and minimum C0 of the above three correlation amounts are connected by a straight line l1
A straight line l-1 having a slope equal in absolute value but opposite in sign to the slope of this straight line l1 is drawn so as to pass through the intermediate value C-1. The intersection of both straight lines l1 and l-1 becomes the minimum value Cext of the function F. The distance DL between C0 and Cext in the coordinate axis C(L) direction is as follows.

【0031】DL =0.5×(C−1−C1 )従っ
て極小値CextはC0 −|DL |となる。この極
小値を与える内挿シフト量Lmを次の様になる。 Lm=L+DL /E ここでE=MA×{C1 −C0 、C−1−C0 }
MA×{Ca、Cb}は、CaとCbのうちの大なる方
を選択することを意味する。尚、相関量C(L)の大き
さは被写体像のパターンに大きく依存して変化するのが
、上記極小値が被写体像パターンに依存しない様に規格
化する。この為に、規格化因子として上記値Eを用いて
、C0 −|DL |をEで割った値を規格化極小値C
ext’とする。このように極小値を被写体像に依存し
ない様に規格化すると、図5(a)に示すように関数F
の最小値Fmは、被写体像にほとんど無関係なほぼ零に
近い値となり、その他の極小値Feはそれに比べてかな
り大きい値となる。
DL=0.5×(C-1-C1) Therefore, the minimum value Cext is C0-|DL|. The interpolation shift amount Lm that gives this minimum value is as follows. Lm=L+DL /E where E=MA×{C1 -C0, C-1-C0}
MA×{Ca, Cb} means selecting the greater of Ca and Cb. Note that the magnitude of the correlation amount C(L) varies depending largely on the pattern of the subject image, but it is standardized so that the minimum value does not depend on the pattern of the subject image. For this purpose, using the above value E as the normalization factor, the value obtained by dividing C0 - |DL | by E is calculated as the normalized minimum value C
ext'. When the minimum value is normalized so that it does not depend on the subject image, the function F
The minimum value Fm is a value close to zero that is almost unrelated to the subject image, and the other minimum values Fe are considerably large values in comparison.

【0032】そこで規格化極小値Cext’と参照値C
refとを比較し、Cext’<Crefである時に、
その極小値を与える内挿シフト量が、光像のずれ量を表
わしている。尚、参照値Crefは上記相関量Fmと他
の極小値Feとの中間の値に選定されている。以上説明
したずれ演算を達成するアルゴリズムを図6のフローチ
ャートを用いて説明する。
Therefore, the normalized minimum value Cext' and the reference value C
ref and when Cext'<Cref,
The interpolated shift amount that gives the minimum value represents the amount of deviation of the optical image. Note that the reference value Cref is selected to be an intermediate value between the above correlation amount Fm and another minimum value Fe. An algorithm for achieving the shift calculation described above will be explained using the flowchart of FIG. 6.

【0033】図6においてマイクロコンピュータはステ
ップ〔11〕でシフト量Lを零に設定し、後述する情報
量パラメータInfomを零に設定する。ステップ〔1
2〕でシフト量をL−1、L、L+1とした時の相関量
C(L−1)、C(L)、C(L+1)を(1)式にも
とづいて算出しメモリC−1、C0 、C1 にそれぞ
れ格納する。ステップ〔13〕でMA×{C1 、C0
 、C−1}>Cthの時、Infomを1に設定した
後、ステップ〔14〕で条件C1 >C0 及びC−1
≧C0 を満たすか否かを判定し、満たす時C−1の内
容とC1 の内容との間に極値があると判別する。上記
条件が充足された時ステップ〔15〕でメモりC−1、
C0 、C1 の内容から値DL 、E、Cext’を
算出する。ステップ〔16〕で規格化極小値Cext’
と参照値Crefとを比較し、条件Cext’<Cre
fを充足するか否かが判定される。この条件が充足され
る時、この時の極小値Cextが図5の相関関数Fの最
小値であると判別し、ステップ〔17〕において内挿シ
スト量Lm=(L+DL /E)を算出し記憶し、これ
と同時に予め定めた、シフトすべき最大量内に上記シフ
ト量Lmが存在する事を示すためにパラメータCorr
elを1にsetする。
In FIG. 6, the microcomputer sets the shift amount L to zero in step [11], and sets the information amount parameter Inform, which will be described later, to zero. Step [1
2], when the shift amounts are L-1, L, and L+1, the correlation amounts C(L-1), C(L), and C(L+1) are calculated based on formula (1), and the memory C-1, Store in C0 and C1 respectively. In step [13] MA×{C1, C0
, C-1} > Cth, after setting Info to 1, in step [14] the conditions C1 > C0 and C-1
It is determined whether ≧C0 is satisfied, and when it is satisfied, it is determined that there is an extreme value between the content of C-1 and the content of C1. When the above conditions are met, in step [15] memory C-1,
Values DL, E, and Cext' are calculated from the contents of C0 and C1. In step [16], the normalized minimum value Cext'
and the reference value Cref, and the condition Cext'<Cre
It is determined whether f is satisfied. When this condition is satisfied, it is determined that the minimum value Cext at this time is the minimum value of the correlation function F in FIG. 5, and the interpolated cyst amount Lm=(L+DL/E) is calculated and stored in step [17]. At the same time, a parameter Corr is set to indicate that the shift amount Lm is within a predetermined maximum amount to be shifted.
Set el to 1.

【0034】ステップ〔18〕で前記パラメータEを所
定の閾値Ethと比較する。この比較は以下の理由で行
うものである。一般にデータAi、Biが有効な空間周
波数成分を充分に含んでいない場合に、上記ステップ〔
15〕や〔17〕での演算結果の信頼性が低下してしま
う。この有効空間周波数成分の減少に伴いパラメータE
も小さくなる。そこでこのパラメータEの大きさから演
算結果の信頼性を判断できることになる。
In step [18], the parameter E is compared with a predetermined threshold value Eth. This comparison is made for the following reasons. Generally, when the data Ai and Bi do not contain enough effective spatial frequency components, the above step [
The reliability of the calculation results in [15] and [17] decreases. As the effective spatial frequency component decreases, the parameter E
will also become smaller. Therefore, the reliability of the calculation result can be determined from the magnitude of this parameter E.

【0035】E>Ethであるときステップ〔19〕で
、演算結果が信頼性あるとしてパラメータInfomを
1にセットする。逆にE>Ethでない時、ステップ〔
20〕でパラメータInfomを0にセットする。他方
、ステップ〔14〕又は〔16〕が充足されない場合に
は、ステップ〔21〕でLの符号を反転する。今シフト
量Lは零に設定されているのでやはりLは零である。
When E>Eth, in step [19], the parameter Inform is set to 1, assuming that the calculation result is reliable. Conversely, when E>Eth is not the case, step [
20], set the parameter Info to 0. On the other hand, if step [14] or [16] is not satisfied, the sign of L is inverted in step [21]. Since the shift amount L is now set to zero, L is also zero.

【0036】次いでステップ〔22〕でシスト量Lが条
件L≧0を満たすか否かを判別する。もし条件が満たさ
れればステップ〔23〕でLは1だけ増加する。今の場
合L=0でステップ〔22〕の条件は満たされているの
でステップ〔23〕をへてL=1が設定される。ステッ
プ〔24〕でこの新たに設定されたシフト量Lと所定数
lf とが比較される。この所定数lf は最大シフト
量を決定する整数値である。ステップ〔22〕あるいは
ステップ〔24〕の条件が満たされない時上述のステッ
プ〔12〕へ戻る。このステップ〔12〕の戻った後、
再びステップ〔21〕へ来た時、L=1であるので符号
が反転してL=−1となりステップ〔22〕を介して再
びステップ〔12〕へ戻る。このようにして、例えばl
f =5としたとき、最大相関が得られるまでシフト量
Lを0から順次1、−1、2、−2、3、−3、4、−
4と漸増して、最大相関を与えるシフト量を求める。最
大相関が得られる事なくシフト量Lが所定値lf にな
った時、ステップ〔25〕で最大シフト量までデータを
シフトしても最大相関が得られないということを示すた
めにパラメータCorrelを0にセットしてアルゴリ
ズムのルーチンを終了する。またステップ〔13〕はC
orrel=0で終了した場合の判定が十分な情報量の
もとに行なわれたか否かを判定するものである。
Next, in step [22], it is determined whether the cyst amount L satisfies the condition L≧0. If the conditions are met, L is increased by 1 in step [23]. In this case, since L=0 and the condition of step [22] is satisfied, L=1 is set after step [23]. In step [24], this newly set shift amount L is compared with a predetermined number lf. This predetermined number lf is an integer value that determines the maximum shift amount. When the conditions of step [22] or step [24] are not satisfied, the process returns to step [12] described above. After returning to this step [12],
When step [21] is reached again, since L=1, the sign is reversed and L=-1, and the process returns to step [12] via step [22]. In this way, for example l
When f = 5, the shift amount L is sequentially changed from 0 to 1, -1, 2, -2, 3, -3, 4, - until the maximum correlation is obtained.
4 and find the shift amount that gives the maximum correlation. When the shift amount L reaches the predetermined value lf without obtaining the maximum correlation, the parameter Correl is set to 0 in step [25] to indicate that the maximum correlation cannot be obtained even if the data is shifted to the maximum shift amount. to end the algorithm routine. Also, step [13] is C
This is to determine whether or not the determination in the case where orrel=0 has been made based on a sufficient amount of information.

【0037】上述の相関演算において、例えばL=0の
時の相関量C(L)、C(L+1)は夫々L=1の時の
相関量C(L−1)、C(L)に等しくL=0の時の相
関量C(L−1)、C(L)は夫々L=−1の時の相関
量C(L)、C(L+1)に等しい。同様に、L=1の
時のC(L)、C(L+1)は夫々L=2の時のC(L
−1)、C(L)に等しく、L=−1のときのC(L−
1)、C(L)はL=−2の時のC(L)、C(L+1
)に等しい。この様な関係にも拘らず、図6のフローチ
ャートでは、Lが変化した時三つの相関量C(L−1)
、C(L)、C(L+1)を全部新たに算出した。 C(L)の演算には相当時間がかかるので、これは演算
時間の増大を意味するものである。従って実際のプログ
ラムではL=0の時以外は前回の計算値を記憶しておき
、新たに必要となった相関量だけ計算するようにするの
が妥当である。その場合ステップ〔13〕は相関量C〔
L’ 〕が新しく計算されるたびにC(L’ )>Ct
hか否かを判定する事で置き換えられる。このずれ演算
のアルゴリズムはL=0から始めてL=1、−1、2、
−2…と増していき、所定の条件を満たす極小値が見つ
かれば−lf ≦L≦lf の全域の演算が終わってい
なくても、それが最大相関であると判定でき、実際自動
合焦駆動を行なっている間は真の合焦点はL=0の近傍
にある事が多いので数個のシスト量に対して(1)式を
計算するだけで済み、著しい演算時間の短縮が可能であ
る。又パラメータlf を3程度に選べば(1)式を計
算する回数はわずか7回ですみ、データ数N=50の場
合で(1)式を計算する加算項数S=30とした場合に
はAi−Bi+Lの計算はわずか210回で済む。
In the above correlation calculation, for example, the correlation amounts C(L) and C(L+1) when L=0 are equal to the correlation amounts C(L-1) and C(L) when L=1, respectively. The correlation amounts C(L-1) and C(L) when L=0 are equal to the correlation amounts C(L) and C(L+1) when L=-1, respectively. Similarly, C(L) and C(L+1) when L=1 are respectively C(L+1) when L=2.
-1), equal to C(L), and C(L-
1), C(L) are C(L), C(L+1) when L=-2
)be equivalent to. Despite this relationship, in the flowchart of FIG. 6, when L changes, the three correlation quantities C(L-1)
, C(L), and C(L+1) were all newly calculated. Since the computation of C(L) takes a considerable amount of time, this means an increase in computation time. Therefore, in an actual program, it is appropriate to store the previous calculated value except when L=0 and calculate only the newly required correlation amount. In that case, step [13] is the correlation amount C [
C(L')>Ct every time L'] is newly calculated.
It can be replaced by determining whether or not h. The algorithm for this shift calculation starts from L=0, L=1, -1, 2,
-2..., and if a minimum value is found that satisfies the predetermined condition, it can be determined that this is the maximum correlation even if the calculation of the entire range of -lf ≦L≦lf has not been completed, and the actual autofocus drive During this process, the true focal point is often near L = 0, so it is only necessary to calculate equation (1) for several cyst amounts, which can significantly shorten the calculation time. . Also, if the parameter lf is chosen to be about 3, the number of calculations of equation (1) will be only seven times, and when the number of data N = 50 and the number of addition terms to calculate equation (1) is S = 30, Only 210 calculations of Ai-Bi+L are required.

【0038】このずれ演算アルゴリズムを用いた焦点検
出を図7により説明する。a系列、b系列の空間ピッチ
p0 の一次データai、biから夫々の空間ピッチ2
p0 の二次データAi、Biを作成するまでは、第1
実施例と同一である。A/D変換された二次データAi
、Biは、ステップ〔31〕でメモリ領域(1)に格納
される。ステップ〔32〕でメモリ領域(1)のデータ
に対して図2(c−3)又は(d−3)の加重係数列を
用いた加重加算フィルタリング処理を行い、D.C成分
を抑制した三次データを作成しメモリ領域(2)へ格納
する。ステップ〔33〕でメモリ領域(2)を指定する
と共に、最大シスト量lf をlf2(lf2は、2又
は3)にセットする。ステップ〔34〕でこの最大シフ
ト量内で、fN /2付近の高次の空間周波数成分につ
いて図6のずれ演算アルゴリズム処理を行う。ステップ
〔35〕においてこの処理の結果、最大相関が最大シス
ト量lf2内に存在し(Correl=1)、かつ演算
の信頼性が充分(Infom=1)であるかを判別しY
esであれば、ステップ〔36〕で、シフト量Lmをデ
フォーカス量に換算する。
Focus detection using this shift calculation algorithm will be explained with reference to FIG. From the primary data ai, bi of the spatial pitch p0 of the a series and b series, the spatial pitch 2 of each
Until the secondary data Ai, Bi of p0 is created, the first
Same as the example. A/D converted secondary data Ai
, Bi are stored in the memory area (1) in step [31]. In step [32], the data in the memory area (1) is subjected to weighted addition filtering using the weighting coefficient sequence shown in FIG. 2 (c-3) or (d-3). Create tertiary data with the C component suppressed and store it in the memory area (2). In step [33], the memory area (2) is specified and the maximum cyst amount lf is set to lf2 (lf2 is 2 or 3). In step [34], within this maximum shift amount, the shift calculation algorithm process of FIG. 6 is performed for high-order spatial frequency components around fN/2. In step [35], as a result of this processing, it is determined whether the maximum correlation exists within the maximum cyst amount lf2 (Correl=1) and the reliability of the calculation is sufficient (Inform=1).
If es, the shift amount Lm is converted into a defocus amount in step [36].

【0039】もしステップ〔35〕でNoの場合には、
ステップ〔37〕においてメモリ領域(1)を指定しか
つ最大シフト量lf をlf2(lf1>lf2でlf
1≒N/2)にセットする。ステップ〔38〕において
、最大シフト量lf1内で、D.C成分を充分含む空間
周波数成分に基づいて図6のずれ演算アルゴリズム処理
を行う。この結果に基づいてステップ〔36〕が実行さ
れる。
[0039] If No in step [35],
In step [37], specify the memory area (1) and set the maximum shift amount lf to lf2 (if lf1>lf2, lf
1≒N/2). In step [38], within the maximum shift amount lf1, D. The shift calculation algorithm process shown in FIG. 6 is performed based on the spatial frequency component that sufficiently includes the C component. Step [36] is executed based on this result.

【0040】以上の如く、本実施例では、まずD.C成
分抑制したデータに基づいてずれ演算を行い、これが満
足できないときD.C成分を充分含むデータに基づいて
ずれ演算を行なっており、この順序は、第1実施例のそ
れと逆である。撮影レンズの自動焦点調節を連続的に行
なっている場合は、一般的に撮影レンズは合焦位置近傍
にあることが多く、従って多くの場合ステップ〔35〕
でYesとなることが期待され演算処理時間が大幅に短
縮できる。
As described above, in this embodiment, first, D. A deviation calculation is performed based on the data with the C component suppressed, and if this is not satisfied, D. The shift calculation is performed based on data sufficiently containing the C component, and this order is opposite to that of the first embodiment. When automatic focus adjustment of the photographic lens is performed continuously, the photographic lens is generally located near the in-focus position, so in many cases step [35]
It is expected that the result will be Yes, and the calculation processing time can be significantly reduced.

【0041】図8を説明する。ステップ〔41〕、〔4
2〕、〔43〕は図7のステップ〔31〕、〔37〕、
〔38〕と同一である。D.C成分を充分含んだデータ
から算出した内挿シフト量Lmが、撮影レンズが合焦位
置近傍にあることを示しているか否かをステップ〔44
〕で判別し、Noである場合、ステップ〔50〕でその
シフト量をデフォーカス量に換算する。上記判別がYe
sであった場合、ステップ〔45〕において、ステップ
〔43〕の演算結果Lm(1) とE(3) とを記憶
する。 ステップ〔46〕、〔47〕及び〔48〕は図8のステ
ップ〔32〕、〔33〕及び〔34〕と同一でD.C成
分を充分又はかなり除去したデータに基づきずれ演算結
果Lm(2) 、E(2) が算出される。
FIG. 8 will be explained. Step [41], [4
2], [43] are steps [31], [37], and
Same as [38]. D. Step 44 determines whether the interpolated shift amount Lm calculated from data sufficiently containing the C component indicates that the photographing lens is near the in-focus position.
], and if the answer is No, the shift amount is converted into a defocus amount in step [50]. The above judgment is Yes
If s, then in step [45], the calculation results Lm(1) and E(3) of step [43] are stored. Steps [46], [47] and [48] are the same as steps [32], [33] and [34] in FIG. The shift calculation results Lm(2) and E(2) are calculated based on data from which the C component has been sufficiently or considerably removed.

【0042】ステップ〔49〕でパラメータE(1) 
、E(2) とから内挿シフト量Lm(1) 、とLm
(2) との一方を選択する。被写体自身がD.C成分
近傍の空間周波数成分のみしか持たない場合ステップ〔
48〕の演算結果Lm(2) の信頼性は非常に低くな
りこの時パラメータEも非常に小さくなる。そこでE(
2)が所定閾値Eth以下でかつE(1) が充分大き
い時にはLm(1) の方を選択しそうでない時Lm(
2) を選択し、ステップ〔50〕でこの選択したLm
からデフォーカス量を換算する。
[0042] In step [49], parameter E(1)
, E(2) and interpolated shift amount Lm(1) , and Lm
(2) Select one of the following. The subject himself is D. If there is only a spatial frequency component near the C component, step [
48], the reliability of the calculation result Lm(2) becomes very low, and at this time the parameter E also becomes very small. So E(
2) is less than a predetermined threshold Eth and E(1) is sufficiently large, Lm(1) is selected; otherwise, Lm(
2) Select and in step [50] select this Lm
Convert the defocus amount from.

【0043】以上では、マイコンは単一の後置フィルタ
処理を行うのみであったが、以下にマイコンが複数の後
置フィルタ処理を行う例を説明する。図1において、マ
イコン8が複数の後置フィルタ処理を行うことを明示す
る為に、後置フィルタ部10の外に第j番目の後置フィ
ルタ部10jを点線のブロックにより示した。
In the above, the microcomputer only performs a single post-filter process, but an example in which the microcomputer performs a plurality of post-filter processes will be described below. In FIG. 1, in order to clearly show that the microcomputer 8 performs a plurality of post-filter processes, a j-th post-filter unit 10j is shown outside the post-filter unit 10 by a dotted line block.

【0044】図9において、ステップ〔51〕〜〔55
〕は夫々図8のステップ〔41〕〜〔45〕と同一であ
る。ステップ〔55〕においてD.C成分を含有するデ
ータによる演算結果Lm(1) 、E(1) がメモリ
された後、ステップ〔56〕においてパラメータjを2
にセットする。ステップ〔57〕でメモリ領域(1)の
空間ピッチp=2p0 のデータに対して図2(d−3
)の加重係数列の加重加算フィルタ処理、一般的に言う
と図2(d−1)の如くピーク周波数f2 がピッチp
により決まるナイキスト周波数fN =1/2pの1/
2付近となりかつD.C成分を充分除去したMTF特性
の加重加算フィルタ処理を行いその結果のデータをメモ
リ領域(2)へ格納する。ステップ〔58〕で使用メモ
リとしてメモリ領域(2)を指定し最大シフト量lf 
=lf2として例えば2を指定し閾値Eth=Eth2
 を指定する。この条件で下のステップ〔59〕で図6
のアルゴリズム処理を行い、その結果、ステップ〔60
〕でInform=1、Correl=1であればステ
ップ〔65〕でこの時の内挿シフト量Lmからデフォー
カス量を検出する。
In FIG. 9, steps [51] to [55]
] are the same as steps [41] to [45] in FIG. 8, respectively. In step [55], D. After the calculation results Lm(1) and E(1) based on the data containing the C component are stored in memory, the parameter j is set to 2 in step [56].
Set to . In step [57], data of spatial pitch p=2p0 in memory area (1) is
), generally speaking, as shown in Figure 2 (d-1), the peak frequency f2 is the pitch p.
Nyquist frequency fN = 1/2p determined by
2 and D. A weighted addition filter process is performed on the MTF characteristic that sufficiently removes the C component, and the resulting data is stored in the memory area (2). In step [58], specify the memory area (2) as the memory to be used and the maximum shift amount lf
For example, specify 2 as =lf2 and set the threshold value Eth=Eth2.
Specify. Under these conditions, in step [59] below, Figure 6
As a result, step [60
], if Inform=1 and Correl=1, the defocus amount is detected from the interpolated shift amount Lm at this time in step [65].

【0045】もしステップ〔60〕の条件が充足されな
い時にはステップ〔61〕でその時の演算結果Lm(2
) 、E(2) を記憶する。次いでステップ〔62〕
でパラメータjを1だけ増加してj=3とする。ステッ
プ〔63〕でj=5であるか否かの判定が行われる。今
j=3であるからステップ〔57〕に移る。ステップ〔
57〕ではj=3のとき図2(f−1)の如くピーク周
波数f3 が、前記ピーク周波数f2 の1/2付近に
存在しD.C成分を充分除去したフィルタ処理をしてデ
ータをメモリ領域(3)へ格納する。尚、このフィルタ
処理は、図2(b−2)のフィルタ処理を受けたメモリ
領域(1)のデータに対して、図2(e−3)の加重加
算処理と図2(f−3)の加重加算処理を順次直列的に
施すことにより達成される。この後のステップ〔58〕
〜〔62〕までの処理はj=2の時と同一である。ステ
ップ〔62〕のパラメータjは4となる。j=4の時の
ステップ〔57〕における加重加算フィルタは、ピーク
周波数f4 が前記ピーク周波数f2 の1/4付近に
存在しD.C成分が充分除去されたMTF特性となる。 この後のステップi=3の時と同一である。このように
jの増加に伴いステップ〔57〕のフィルタ特性を順次
変えたが最大シフト量lfjの値は、jに無関係に一定
であってもよい。パラメータjが5となると、ステップ
〔64〕に移りステップ〔55〕と〔61〕で記憶され
たデータE(1) 、E(2) 、E(3) 、E(4
) の値に基づき、内挿シフト量Lm(1) 、Lm(
2) 、Lm(3) 、Lm(4) から最も信頼性の
高いものを選択するか、それといずれも信頼性が高くな
いときは何も選択せずにステップ〔65〕に移る。
If the condition in step [60] is not satisfied, step [61] calculates the calculation result Lm(2
), E(2) is stored. Next step [62]
Then, parameter j is increased by 1 to make j=3. In step [63], it is determined whether j=5. Since j=3 now, the process moves to step [57]. step [
57], when j=3, the peak frequency f3 exists near 1/2 of the peak frequency f2 as shown in FIG. 2(f-1), and D. The data is stored in the memory area (3) after being filtered to sufficiently remove the C component. Note that this filtering process is performed by performing the weighted addition process in FIG. 2(e-3) and the weighted addition process in FIG. 2(f-3) on the data in memory area (1) that has undergone the filtering process in FIG. 2(b-2). This is achieved by sequentially performing weighted addition processing in series. Subsequent steps [58]
The processing from to [62] is the same as when j=2. The parameter j in step [62] is 4. The weighted addition filter in step [57] when j=4 has a peak frequency f4 near 1/4 of the peak frequency f2 and D. This results in MTF characteristics in which the C component is sufficiently removed. This is the same as the subsequent step i=3. In this way, the filter characteristics in step [57] are sequentially changed as j increases, but the value of the maximum shift amount lfj may be constant regardless of j. When the parameter j becomes 5, the process moves to step [64] and the data E(1), E(2), E(3), E(4) stored in steps [55] and [61] are
), the interpolation shift amounts Lm(1) and Lm(
2) Select the most reliable one from , Lm(3), and Lm(4), or if none of them is highly reliable, proceed to step [65] without selecting anything.

【0046】この例ではステップ〔57〕で最高3回の
フィルタ処理を行うようにしたが、この回数は適宜選定
できるものである。またjが増加するにつれてステップ
〔57〕でのフィルタとして、MTFピークが順次低周
波側に移行すると共にD.C成分が除去されたフィルタ
が選択されているので、たとえ被写体の空間周波数成分
が或る特定の成分のみを多く含む場合にも、上記いずれ
かのフィルタ処理により高精度の検出が期待できる。
In this example, the filtering process is performed a maximum of three times in step [57], but the number of times can be selected as appropriate. Also, as j increases, as the filter in step [57], the MTF peak sequentially shifts to the lower frequency side and D. Since a filter that removes the C component is selected, even if the spatial frequency component of the object contains a large amount of only a certain specific component, highly accurate detection can be expected by any of the above filter processes.

【0047】これまでに述べた実施例においては、合焦
近傍でない場合にデフォーカス量を算出するのに、メモ
リ領域(1)に格納されたサンプリングピッチp=2p
0 のデータをそのまま用いていた。合焦近傍でない場
合には最大シフト量lf を広く例えばlf ≒N/2
程度にとる事が望ましい。しかしa系列及びb系列のデ
ータの数Nが夫々50ともなると、この場合の演算時間
は膨大なものとなる。又合焦近傍でない時にデフォーカ
ス量を求める場合には、そのデフォーカス量の算出精度
はそれ程高い必要なくかつそもそも光像自体がデフォー
カスでぼけている為、比較的荒いサンプルピッチのデー
タで十分に目的を達成できることが可能であり、そうす
る事で演算時間が短縮される。
In the embodiments described so far, the sampling pitch p=2p stored in the memory area (1) is used to calculate the defocus amount when the defocus amount is not near the in-focus area.
0 data was used as is. If it is not near the focus, set the maximum shift amount lf to a wide range, for example, lf ≒ N/2
It is desirable to take it in moderation. However, if the number N of a-series and b-series data is 50 each, the calculation time in this case becomes enormous. In addition, when calculating the defocus amount when the focus is not near the focus, the calculation accuracy of the defocus amount does not need to be very high, and since the optical image itself is blurred due to defocus, data with a relatively rough sample pitch is sufficient. It is possible to achieve the objective in this way, and by doing so, the calculation time is shortened.

【0048】図10でそのような場合について説明する
。まずA/D変換時のサンプルピッチpの二次データを
メモリ領域(1)へ格納する(ステップ〔71〕。)メ
モリ領域(1)のデータに対してそのサンプリング間隔
をn倍にした時のナイキスト周波数以上の空間周波数成
分を除去するフィルタ処理を行ない、サンプリングピッ
チn×pでサンプルしたデータをメモリ領域(1’ )
に入れる。(ステップ〔72〕)一般にはサンプルピッ
チ変更に伴ない、このようにナイキスト周波数以上の成
分を除去するフィルタ処理を行なう事が望ましいが、デ
フォーカス量の大きい時には像が大きくぼけており、そ
の様な場合は光像はぼけにより問題としているサンプル
ピッチのナイキスト周波数以上の成分を含まない状態な
ので上記フィルタ処理を省いて新しいサンプルピッチn
×pでサンプルしてもよい。
Such a case will be explained with reference to FIG. First, secondary data with sample pitch p during A/D conversion is stored in memory area (1) (step [71].) When the sampling interval is multiplied by n for the data in memory area (1), Filter processing is performed to remove spatial frequency components higher than the Nyquist frequency, and data sampled at a sampling pitch of n×p is stored in the memory area (1').
Put it in. (Step [72]) In general, it is desirable to perform filter processing to remove components above the Nyquist frequency in conjunction with changing the sample pitch, but when the amount of defocus is large, the image is greatly blurred. In this case, the optical image is blurred and does not contain components higher than the Nyquist frequency of the sample pitch in question, so the above filtering process is omitted and a new sample pitch n is created.
You may sample by ×p.

【0049】次いで使用メモリ領域(1’ )を指定し
、最大シフト量lf =lf1≒N’ /2を指定する
。ここでサンプル数N’ はメモリ領域(1)でのサン
プル数Nのほぼ1/nである。(ステップ〔73〕)次
いで像ずれ量算出のアルゴリズム処理を行ない(ステッ
プ〔74〕)、求められた像ずれのシフト量Lmにサン
プルピッチがn倍となっている事によるn倍の補正を行
ないLm×n→Lmとする(ステップ〔75〕)。次い
で、これからデフォーカス量を算出する(ステップ〔7
6〕)。これ以外の過程は第1〜第4実施例と同様に進
められる。
Next, the memory area to be used (1') is designated, and the maximum shift amount lf = lf1≈N'/2 is designated. Here, the number of samples N' is approximately 1/n of the number of samples N in memory area (1). (Step [73]) Next, algorithm processing for calculating the amount of image shift is performed (Step [74]), and the obtained image shift amount Lm is corrected by a factor of n due to the sample pitch being multiplied by n. Let Lm×n→Lm (step [75]). Next, calculate the defocus amount from this (step [7]
6)). The other processes proceed in the same manner as in the first to fourth embodiments.

【0050】第5実施例ではデフォーカス量の大きい所
でのサンプルピッチを大きくして処理時間の短縮をする
例を示したが、合焦近傍においても第4実施例における
フィルタ処理でそのMTFのピークをより低空間周波数
側に移す場合にはそれに合わせてサンプルピッチを大き
くして処理時間を短縮する事が可能である。図11の例
はその様な場合を示している。ハードウエアフィルタに
より図2(b−1)の特性でフィルタされた二次データ
がメモリ領域(1)にストアされ(ステップ〔81〕)
、さらにステップ〔82〕で図2(d−3)のフィルタ
ーで処理された即わち同図(d−1)のようにf2 =
1/(8p0 )を中心とする空間周波数帯に関する情
報を含むデータがメモリ領域(2)にストアされる。 続いて使用メモリ(2)を指定し、最大シフト量lf 
として例えばlf =lf2=3を指定し、情報量に関
するしきい値EthをEth2 に指定する(ステップ
〔83〕)。
In the fifth embodiment, an example was shown in which the processing time is shortened by increasing the sample pitch in areas where the amount of defocus is large, but even in the vicinity of the focus, the filter processing in the fourth embodiment reduces the MTF. When the peak is shifted to a lower spatial frequency side, the processing time can be shortened by increasing the sample pitch accordingly. The example in FIG. 11 shows such a case. The secondary data filtered by the hardware filter according to the characteristics shown in FIG. 2 (b-1) is stored in the memory area (1) (step [81]).
, further processed by the filter of FIG. 2(d-3) in step [82], that is, as shown in FIG. 2(d-1), f2 =
Data containing information regarding a spatial frequency band centered at 1/(8p0) is stored in memory area (2). Next, specify the memory to be used (2) and set the maximum shift amount lf
For example, lf = lf2 = 3 is specified, and the threshold value Eth regarding the amount of information is specified as Eth2 (step [83]).

【0051】これにもとずいて図6のシフト量算出のア
ルゴリズム処理(ステップ〔84〕を行ない、その結果
、情報量が十分(Infom=1)でかつ検出最大シフ
ト量内(Correl=1)ならば(ステップ〔85〕
)、結果のシフト量Lmからデフォーカス量を算出し(
ステップ〔86〕)終了とする。ステップ〔85〕の条
件が充足されなかった時は、系は合焦近傍にないか、あ
るいは合焦近傍にあっても光像が前記空間周波数f2 
より低い空間周波数しか含まない場合なので、以後の演
算は処理時間の短縮をはかるためサンプルピッチを2倍
の2pとして行なう。そこで今後のサンプルピッチをp
’ とするとp’ =2p=4p0 である。
Based on this, the algorithm processing (step [84]) for calculating the shift amount shown in FIG. If so (step [85]
), calculate the defocus amount from the resulting shift amount Lm (
Step [86]) End. When the condition of step [85] is not satisfied, the system is not near the focus, or even if the system is near the focus, the optical image is at the spatial frequency f2.
Since this is a case where only lower spatial frequencies are included, subsequent calculations are performed with the sample pitch doubled to 2p in order to shorten processing time. Therefore, here are the sample pitches for the future.
', then p' = 2p = 4p0.

【0052】具体的には図2(e−3)のフィルタ処理
、即わちサンプルピッチpのメモリ領域(1)の連続す
る3項のデータに対して(0.5、1、0.5)の加重
をして加算し、結果はピッチp’ =2pごとのものに
ついてメモリ領域(3)にストアする。この時のフィル
タ特性は図2(e−1)のごとくなりサンプルピッチp
’ に関するナイキスト周波数fN =1/2p’ =
1/8p0 以上の空間周波数はほとんどなくなってい
る。なおステップ〔88〕はステップ〔84〕でのアル
ゴリズム処理の結果の情報量が十分(Infom=1)
でない場合に、合焦近傍でフィルターを切り換えるルー
プへ進む判定を下す。まずステップ〔89〕でループの
初期値としてパラメータj=4を設定する。ステップ〔
90〕においてメモリ領域(3)に格納されたサンプル
ピッチp’ =2p=4p0 のデータに対して図2(
f−3)の空間ピッチ8p0 の加重係数列のフィルタ
処理を行ない、やはりサンプルピッチp’ でのデータ
をメモリ領域(4)に格納する。領域(4)に格納され
るデータは図2(f−1)に示す如く、D.C成分を除
去し、空間周波数f4 =1/4p’ =1/16p0
 付近を主に抽出する特性のフィルタ処理を受けたもの
となる。
Specifically, the filtering process shown in FIG. ), and the results are stored in the memory area (3) for each pitch p' = 2p. The filter characteristics at this time are as shown in Figure 2 (e-1), and the sample pitch p
' Nyquist frequency fN = 1/2p' =
Spatial frequencies above 1/8p0 have almost disappeared. Note that in step [88], the amount of information as a result of the algorithm processing in step [84] is sufficient (Inform=1).
If not, a decision is made to proceed to a loop that switches filters near focus. First, in step [89], parameter j=4 is set as the initial value of the loop. step [
FIG. 2 (
Filtering is performed on the weighting coefficient sequence of f-3) with a spatial pitch of 8p0, and the data at the sample pitch p' is also stored in the memory area (4). The data stored in area (4) is as shown in FIG. 2(f-1). Remove C component, spatial frequency f4 = 1/4p' = 1/16p0
It has been subjected to filter processing with characteristics that mainly extract the surrounding area.

【0053】次に使用メモリ領域〔4〕を指定し、最大
シフト量lf =lf4=3を指定し情報量のしきい値
Eth=Eth4 を指定する(ステップ〔91〕)。 これにもとずいて図6のアルゴリズム処理を行なう(ス
テップ〔92〕)。もし情報量が十分で(Infom=
1)(ステップ〔93〕)かつ最大シフト量(Corr
el=1)(ステップ〔96〕)ならばこの時のLmか
らこの時のサンプルピッチ2pを考慮して、像ずれ量X
をX=Lm×2pにより算出する(ステップ〔100〕
)。
Next, the memory area to be used [4] is designated, the maximum shift amount lf = lf4 = 3, and the information amount threshold Eth = Eth4 (step [91]). Based on this, the algorithm processing shown in FIG. 6 is performed (step [92]). If the amount of information is sufficient (Inform=
1) (step [93]) and the maximum shift amount (Corr
el=1) (step [96]), then from Lm at this time, considering the sample pitch 2p at this time, the image shift amount X
is calculated by X=Lm×2p (step [100]
).

【0054】ステップ〔93〕の条件が充足されない場
合にはパラメータjを1増してj=5とする。この場合
ステップ〔95〕を介して再びステップ
If the condition in step [93] is not satisfied, the parameter j is incremented by 1 so that j=5. In this case step again via step [95]

〔90〕にもど
る。ステップ
Return to [90]. step

〔90〕では再びメモリ領域(3)のデー
タに対してD.C成分を除去しかつ空間周波数f5 (
f5 <f4 )を中心に抽出するフィルタ処理を行な
い、データメモリ領域(5)に格納する。ここで例えば
f5 =1/2f4 =1/8p’ =1/32p0 
とするようなフィルタ処理を行なう。この場合その時の
フィルタによってはサンプルピッチをさらに荒くする事
も可能であるが、データ数が少なくなり次第に精度が悪
くなるのでデータ数Nは20〜25程度以下にする事は
好ましくない。
In [90], D. C component is removed and the spatial frequency f5 (
A filter process is performed to mainly extract f5 < f4 ) and is stored in the data memory area (5). For example, f5 = 1/2f4 = 1/8p' = 1/32p0
Perform filter processing such as In this case, it is possible to make the sample pitch even rougher depending on the filter at that time, but as the number of data decreases, the accuracy gradually deteriorates, so it is not preferable to set the number N of data to less than about 20 to 25.

【0055】この様にして前回と同様にステップ〔91
〕、〔92〕を行ない、情報量が十分で(ステップ〔9
3〕)かつ相関検出域内(ステップ〔96〕)ならばス
テップ〔100〕で像ずれ量を算出する。ステップ〔9
3〕で条件が充足されないとステップ〔94〕でj=6
となりステップ〔95〕の条件が満たされてステップ〔
97〕へ移る。又ステップ〔88〕やステップ〔96〕
の条件が満たされた場合もステップ〔97〕へ移る。
[0055] In this way, step [91
] and [92], and if the amount of information is sufficient (step [9
3]) and within the correlation detection area (step [96]), the amount of image shift is calculated in step [100]. Step [9
If the condition is not satisfied in step [3], j = 6 in step [94].
Next, the conditions of step [95] are satisfied and step [
97]. Also, step [88] and step [96]
If the condition is also satisfied, the process moves to step [97].

【0056】この時点では系は合焦近傍にないか、ある
いは被写体がD.C成分に非常に近い空間周波数成分し
か含まない事が判明している。そこで使用メモリとして
メモリ領域(3)に格納されたピッチp’ =2pのD
.C成分の除去されていない画像データを指定し、最大
データ量lf としてlf3=N’ /2、(N’ =
N/2)を指定し、しきい値としてEth4 を指定す
る(ステップ〔97〕)。図6のアルゴリズム処理を行
ない(ステップ〔98〕)、Infom=1、Corr
el=1なら(ステップ
At this point, the system is not near focus, or the subject is D. It has been found that it contains only spatial frequency components very close to the C component. Therefore, D with pitch p' = 2p stored in memory area (3) as memory to be used.
.. Specify the image data from which the C component has not been removed, and set the maximum data amount lf as lf3=N'/2, (N'=
N/2) and Eth4 as the threshold value (step [97]). Perform the algorithm processing of FIG. 6 (step [98]), Inform=1, Corr
If el=1 (step

〔99〕)この結果のLmとこ
の時のピッチp’ =2pから像ずれ量X=Lm×2p
を算出する(ステップ〔100〕)。これらのステップ
〔100〕の結果にステップ〔101〕でデフォーカス
量に換算される。ステップ
[99]) From this result Lm and the pitch p' = 2p, the image shift amount X = Lm x 2p
is calculated (step [100]). The results of these steps [100] are converted into defocus amounts in step [101]. step

〔99〕の条件が充足されな
い時は検出不能として終了する。
When the condition [99] is not satisfied, the detection is terminated as undetectable.

【0057】この実施例では、空間ピッチp0 のa系
列b系列の一次データai、biが、図1の前置フィル
タ手段5を通った後、サンプルピッチp=2p0 でサ
ンプリングされマイコン8のメモリ領域(1)に格納さ
れ、更にこの格納されたデータがサンプルピッチp’ 
=2p=4p0でサンプリングされてメモリ領域(3)
へ格納される。a系列及びb系列の一次データの個数を
夫々100個とするとメモリ領域(1)と(3)に夫々
格納されたa系列及びb系列データは夫々約50個、約
25個となる。この様に状況に応じて処理すべきデータ
数を変えているので、情報を有効に使用しながら限られ
た演算規模で迅速な処理が可能となる。
In this embodiment, primary data ai, bi of a series and b series with a spatial pitch p0 are sampled at a sample pitch p=2p0 after passing through the prefilter means 5 of FIG. (1), and further this stored data is sample pitch p'
=2p=4p0 sampled memory area (3)
is stored in Assuming that the number of a-series and b-series primary data is 100 each, the a-series and b-series data stored in memory areas (1) and (3), respectively, are about 50 and about 25, respectively. In this way, since the number of data to be processed is changed depending on the situation, it is possible to perform speedy processing with a limited calculation scale while effectively using information.

【0058】図12に本発明の別の実施例を示す。同図
において、光電変換手段1、非線形化手段4、前置フィ
ルタ手段5、サンプルホールド手段6、A/D変換器7
、マイコン8、表示手段12、焦点調節手段13は、夫
々図1のものと同一である。前置フィルタ手段5とサン
プルホールド手段6との間に切換手段14が介在してい
る。この切換手段14は前置フィルタ手段5の出力と非
線形化手段4の出力とを択一的にサンプルホールド手段
6に入力される。モード設定手段15は、マイコン8に
接続され外部から第1モードと第2モードとに設定可能
であり、設定モードに応じてマイコン8を介して切換手
段14、サンプルホールド手段6及びA/D変換器7を
夫々次の如く制御する。即ち、第1モードに設定される
と、切換手段14は前置フィルタ手段5のa系列、b系
列夫々約100個のデータ出力をサンプルホールド手段
6に送り、このサンプルホールド手段6はサンプルピッ
チp=2p0 でサンプリングしa系列b系列夫々約5
0個のデータを出力し、A/D変換器7は、ピッチ2p
0 のタイミングで入力データをA/D変換する。第2
モードに設定されると、切換手段14は非線形化手段4
のa系列、b系列夫々100個のデータ出力をサンプル
ホールド手段6に送り、サンプルホールド手段6は各ア
レイ2、3の中央部に位置する50個の光電素子の出力
に対応した一次データai、biをサンプリングピッチ
p=p0 でサンプルホールドし、a系列b系列夫々5
0個のデータを出し、A/D変換器7は、ピッチp0 
のタイミングで入力データをA/D変換する。
FIG. 12 shows another embodiment of the present invention. In the figure, photoelectric conversion means 1, nonlinearization means 4, prefilter means 5, sample hold means 6, A/D converter 7
, the microcomputer 8, the display means 12, and the focus adjustment means 13 are the same as those shown in FIG. A switching means 14 is interposed between the prefilter means 5 and the sample and hold means 6. This switching means 14 selectively inputs the output of the prefilter means 5 and the output of the nonlinearization means 4 to the sample and hold means 6. The mode setting means 15 is connected to the microcomputer 8 and can be set to a first mode and a second mode from the outside, and the switching means 14, sample hold means 6, and A/D conversion are controlled via the microcomputer 8 according to the setting mode. The devices 7 are controlled as follows. That is, when set to the first mode, the switching means 14 sends approximately 100 data outputs each of the a series and b series of the prefilter means 5 to the sample and hold means 6, and this sample and hold means 6 has a sample pitch p. = 2p0, approximately 5 each for a series and b series
The A/D converter 7 outputs 0 data and the pitch is 2p.
A/D converts input data at timing 0. Second
When set to the mode, the switching means 14 switches the nonlinearization means 4
The sample and hold means 6 sends 100 data outputs for each of the a and b series to the sample and hold means 6, and the sample and hold means 6 collects primary data ai, which corresponds to the outputs of the 50 photoelectric elements located at the center of each array 2, 3. Bi is sampled and held at sampling pitch p=p0, and the a series and b series are each 5
0 data is output, and the A/D converter 7 outputs pitch p0.
The input data is A/D converted at the timing of .

【0059】マイコン8は第1モード時も第2モード時
も、A/D変換器7からのデータを第1実施例〜第6実
施例のいずれかにより処理する。第1モード時のサンプ
ルホールド手段6のサンプリングピッチは2p0 であ
り第2モード時のそれはp0 であるので、第2モード
時の方がより高次の空間周波数成分を含んでおり、従っ
て非常に微細なパターンの被写体に対する焦点検出に有
効である。また、第1モードではアレイ2、3の全長を
焦点検出領域としているのに対し、第2モードでは、ア
レイの中央部のみのデータを用いているため、焦点検出
領域が第1モード時の半分になっている。従って第2モ
ードは第1モードに比べて被写体のより小部分に対する
焦点検出が可能となる。
The microcomputer 8 processes data from the A/D converter 7 according to any one of the first to sixth embodiments in both the first mode and the second mode. The sampling pitch of the sample hold means 6 in the first mode is 2p0, and in the second mode it is p0, so the second mode contains higher-order spatial frequency components and is therefore very fine. This method is effective for detecting focus on objects with a pattern. In addition, in the first mode, the entire length of arrays 2 and 3 is used as the focus detection area, whereas in the second mode, data from only the center of the array is used, so the focus detection area is half of that in the first mode. It has become. Therefore, in the second mode, it is possible to detect focus on a smaller part of the subject than in the first mode.

【0060】尚、第2モードでは、一次データは前置フ
ィルタ手段5を通らずにマイコン8に入力される。従っ
て、第2モードのデータはピッチp0 で決まるナイキ
スト周波数以上の有害な周波数成分を多く含んでいる恐
れがある。しかし、ピッチp0 が非常に小さく例えば
50μ程度となると、以下の理由により上述の恐れは解
消する。ピッチp0 が50μ程度となると、アレイ2
、3上に光像を形成する焦点検出光学系の収差やその他
の理由により、p0 で決まるナイキスト周波数以上の
空間周波数成分は一次データai、biから充分に除去
されていることが期待できる。従って、第2モード時に
、一次データをナイキスト周波数以上を除去するフィル
タを通さなくても、特に検出精度が低下することはない
In the second mode, the primary data is input to the microcomputer 8 without passing through the prefilter means 5. Therefore, the second mode data may contain many harmful frequency components higher than the Nyquist frequency determined by the pitch p0. However, if the pitch p0 is very small, for example, about 50μ, the above-mentioned fear is eliminated for the following reasons. When the pitch p0 becomes about 50μ, array 2
, 3, and other reasons, it can be expected that spatial frequency components higher than the Nyquist frequency determined by p0 are sufficiently removed from the primary data ai, bi. Therefore, in the second mode, even if the primary data is not passed through a filter that removes frequencies above the Nyquist frequency, the detection accuracy does not particularly deteriorate.

【0061】上述の実施例はいずれもマイコンでの加重
加算処理とずれ演算処理とを全く別個に行う例であった
。しかし、この両処理を一部又は完全に結合した形で行
うことも可能である。例えば、Ai −bi +Lを多
数個のi及び複数個のLに関し計算メモリしておき、こ
のメモリ結果を加重加算フィルタ処理を行い、その後残
りのずれ演算を施すようにしてもよく、また加重加算処
理とずれ演算処理とを次式の如く完全に一致させてもよ
い。
In all of the embodiments described above, the weighted addition process and the shift calculation process in the microcomputer are performed completely separately. However, it is also possible to partially or completely combine these two processes. For example, Ai - bi +L may be calculated in memory for a large number of i's and a plurality of L's, and this memory result may be subjected to weighted addition filter processing, and then the remaining shift calculation may be performed. The process and the deviation calculation process may be completely matched as shown in the following equation.

【0062】[0062]

【数4】[Math 4]

【0063】ここで、加重加算フィルタの加重係数列は
(−0.5、1、−0.5)とした。
Here, the weighting coefficient sequence of the weighted addition filter is (-0.5, 1, -0.5).

【0064】[0064]

【発明の効果】以上の説明から明らかなように、本発明
によると、2像のずれ量を算出するに際して、交互に像
をシフトして相関量を求め、相関曲線がV字型であるこ
とを想定した極値の内挿方法により相対的ずれ量を算出
しているので、焦点検出精度向上に著しい効果がある。
[Effects of the Invention] As is clear from the above description, according to the present invention, when calculating the amount of deviation between two images, the amount of correlation is obtained by shifting the images alternately, and the correlation curve is V-shaped. Since the relative shift amount is calculated by an interpolation method of extreme values assuming that

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

【図1】本発明の実施例を示すブロック図。FIG. 1 is a block diagram showing an embodiment of the present invention.

【図2】MTF特性と加重係数列を示し、同図(a)は
、光電素子アレイのMTF特性を示し、同図(b−1)
、(c−1)、(d−1)、(e−1)、(f−1)は
夫々加重加算フィルタのMTF特性を示すグラフであり
、同図(b−2)、(c−2)、(c−3)、(d−2
)、(d−3)、(e−2)、(e−3)、(f−2)
、(f−3)、(f−4)は夫々加重係数列を示す図。
FIG. 2 shows MTF characteristics and weighting coefficient sequences; FIG. 2 (a) shows the MTF characteristics of a photoelectric element array; FIG. 2 (b-1)
, (c-1), (d-1), (e-1), and (f-1) are graphs showing the MTF characteristics of the weighted addition filter, respectively; ), (c-3), (d-2
), (d-3), (e-2), (e-3), (f-2)
, (f-3) and (f-4) are diagrams showing weighting coefficient sequences, respectively.

【図3】同図(a)及び(b)は、夫々トランスパーサ
ルフィルタを示すブロック図。
FIGS. 3(a) and 3(b) are block diagrams each showing a transversal filter.

【図4】本発明の実施例に関するフローチャート図。FIG. 4 is a flowchart diagram regarding an embodiment of the present invention.

【図5】同図(a)は、相関量とシフト量との関係を示
すグラフであり、同図(b)は内挿方法を説明するため
の図。
FIG. 5(a) is a graph showing the relationship between the correlation amount and the shift amount, and FIG. 5(b) is a diagram for explaining an interpolation method.

【図6】ずれ演算のアルゴリズムを示すフローチャート
図。
FIG. 6 is a flowchart showing an algorithm for calculating a deviation.

【図7】実施例に関するフローチャート図。FIG. 7 is a flowchart diagram regarding an example.

【図8】実施例に関するフローチャート図。FIG. 8 is a flowchart diagram regarding an example.

【図9】実施例に関するフローチャート図。FIG. 9 is a flowchart diagram regarding an example.

【図10】実施例に関するフローチャート図。FIG. 10 is a flowchart diagram related to the embodiment.

【図11】実施例に関するフローチャート図。FIG. 11 is a flowchart diagram regarding the embodiment.

【図12】別の実施例を示すブロック図。FIG. 12 is a block diagram showing another embodiment.

【主要部分の符号の説明】2、3…光電素子アレイ5…
前置フィルタ 8…マイコン 10、10j…後置フィルタ部 11…ずれ演算部
[Explanation of symbols of main parts] 2, 3...Photoelectric element array 5...
Pre-filter 8...Microcomputer 10, 10j...Post-filter section 11...Difference calculation section

Claims (2)

【特許請求の範囲】[Claims] (1)  光学的に視差を有する一対の光束を一対の光
電変換手段上に導き、該光電変換手段上の対象物体像の
相対的なずれを演算して焦点検出を行う焦点検出装置に
おいて、前記一対の光電変換手段の光電出力もしくは該
光電出力をフィルター処理したフィルター出力を、それ
ぞれデータA1,A2,A3,A4,……、B1,B2
,B3,B4,……とするとき、前記一対のデータA,
Bを所定数のデータシフト量L(Lは整数)を変えなが
ら比較して次の相関量を下記の式に基づき複数個算出し
、   ここで、qはLの関数であり、上記加算は相互シフ
ト量Lが増加する毎に両データに関して交互に比較の開
始位置がずれて交互に1つずつシフトするよう構成され
たずれ演算手段を有することを特徴とする焦点検出装置
(1) In a focus detection device that guides a pair of light beams having an optical parallax onto a pair of photoelectric conversion means and performs focus detection by calculating a relative shift of a target object image on the photoelectric conversion means, The photoelectric outputs of the pair of photoelectric conversion means or the filter outputs obtained by filtering the photoelectric outputs are data A1, A2, A3, A4, ..., B1, B2, respectively.
, B3, B4, ..., the pair of data A,
B is compared while changing a predetermined number of data shift amounts L (L is an integer), and the following correlation amounts are calculated based on the following formula. Here, q is a function of L, and the above addition is mutual. A focus detection device comprising a shift calculation means configured to alternately shift the comparison start position of both data items one by one each time the shift amount L increases.
(2)  前記ずれ演算手段は、連続する3つのシフト
量Lのうち中央の相関量C0 が最も小さい場合につい
て、そのシフト量を横軸に取りその相関量C−1、C0
 、C1 を縦軸に取った場合に、その各相関量の最大
のものの座標とC0 の座標とを通る直線を引き、さら
にC−1、C1 のうち最大でない方の相関量の座標を
通り前記直線と傾きの符号が逆の直線を引き、この両直
線の交点の位置の横軸(シフト量を表す)座標値からシ
フト量の端数の値を算出して前記一対の対象物体像の精
密な像ずれ量を算出することを特徴とする特許請求の範
囲第(1)項記載の焦点検出装置。
(2) When the central correlation amount C0 among the three consecutive shift amounts L is the smallest, the shift calculation means takes that shift amount on the horizontal axis and calculates the correlation amounts C-1 and C0.
, C1 as the vertical axis, draw a straight line passing through the coordinates of the maximum correlation amount and the coordinates of C0, and then draw a straight line passing through the coordinates of the correlation amount which is not the maximum among C-1 and C1. A straight line with the opposite sign of the slope is drawn, and the fractional value of the shift amount is calculated from the coordinate value of the horizontal axis (representing the shift amount) of the position of the intersection of these two straight lines, and the precise image of the pair of target objects is calculated. The focus detection device according to claim 1, wherein the focus detection device calculates an amount of image shift.
JP3159377A 1991-07-01 1991-07-01 Focus detection device Expired - Lifetime JPH07119885B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3159377A JPH07119885B2 (en) 1991-07-01 1991-07-01 Focus detection device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3159377A JPH07119885B2 (en) 1991-07-01 1991-07-01 Focus detection device

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP59007725A Division JPH0750241B2 (en) 1984-01-19 1984-01-19 Focus detection device

Publications (2)

Publication Number Publication Date
JPH04338905A true JPH04338905A (en) 1992-11-26
JPH07119885B2 JPH07119885B2 (en) 1995-12-20

Family

ID=15692489

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3159377A Expired - Lifetime JPH07119885B2 (en) 1991-07-01 1991-07-01 Focus detection device

Country Status (1)

Country Link
JP (1) JPH07119885B2 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009124574A (en) * 2007-11-16 2009-06-04 Nikon Corp Correlation computing method, correlation computing unit, focus detector and imaging apparatus
JP2009124575A (en) * 2007-11-16 2009-06-04 Nikon Corp Correlation computing method, correlation computing unit, focus detector and imaging apparatus
US7586072B2 (en) 2006-11-15 2009-09-08 Nikon Corporation Correlation operation method, correlation operation device, focus detection device and imaging device
US7586588B2 (en) 2006-05-17 2009-09-08 Nikon Corporation Correlation operation method, correlation operation device, focus detection device and imaging device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS55124112A (en) * 1979-03-16 1980-09-25 Nippon Kogaku Kk <Nikon> Focusing detector
JPS59126517A (en) * 1983-01-10 1984-07-21 Minolta Camera Co Ltd Focusing detector of camera

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS55124112A (en) * 1979-03-16 1980-09-25 Nippon Kogaku Kk <Nikon> Focusing detector
JPS59126517A (en) * 1983-01-10 1984-07-21 Minolta Camera Co Ltd Focusing detector of camera

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7586588B2 (en) 2006-05-17 2009-09-08 Nikon Corporation Correlation operation method, correlation operation device, focus detection device and imaging device
US7586072B2 (en) 2006-11-15 2009-09-08 Nikon Corporation Correlation operation method, correlation operation device, focus detection device and imaging device
JP2009124574A (en) * 2007-11-16 2009-06-04 Nikon Corp Correlation computing method, correlation computing unit, focus detector and imaging apparatus
JP2009124575A (en) * 2007-11-16 2009-06-04 Nikon Corp Correlation computing method, correlation computing unit, focus detector and imaging apparatus

Also Published As

Publication number Publication date
JPH07119885B2 (en) 1995-12-20

Similar Documents

Publication Publication Date Title
US4561749A (en) Focus detection apparatus
US8705801B2 (en) Distance estimation device, distance estimation method, integrated circuit, and computer program
US10326927B2 (en) Distance information producing apparatus, image capturing apparatus, distance information producing method and storage medium storing distance information producing program
US5083150A (en) Automatic focusing apparatus
US10455149B2 (en) Image processing apparatus, image processing apparatus control method, image pickup apparatus, and image pickup apparatus control method
JP2008211679A (en) Imaging apparatus and method thereof
JPS6037513A (en) Shift amount detector
US20160344952A1 (en) Image processing apparatus, image pickup apparatus, image processing method, and storage medium
JP3444551B2 (en) Camera focus detection device
JPH04338905A (en) Focus detection device
JPH0477289B2 (en)
JPH0875986A (en) Focus detector
JPH04348306A (en) Focus detector
JPH04338906A (en) Focus detection device
JP4632640B2 (en) Ranging device
JP2753544B2 (en) Focus detection device
JP2707569B2 (en) Focus detection device
JPH0750241B2 (en) Focus detection device
JP7009219B2 (en) Image processing method, image processing device, image pickup device, image processing program, and storage medium
US10200674B2 (en) Image processing apparatus, image capturing apparatus, and recording medium
JP3109865B2 (en) Focus detection device
JPH04230715A (en) Focus detector
JPH0527161A (en) Focus detecting device
JPH0411004B2 (en)
JPH02244019A (en) Focus detector

Legal Events

Date Code Title Description
EXPY Cancellation because of completion of term