JPH04348306A - Focus detector - Google Patents

Focus detector

Info

Publication number
JPH04348306A
JPH04348306A JP3159379A JP15937991A JPH04348306A JP H04348306 A JPH04348306 A JP H04348306A JP 3159379 A JP3159379 A JP 3159379A JP 15937991 A JP15937991 A JP 15937991A JP H04348306 A JPH04348306 A JP H04348306A
Authority
JP
Japan
Prior art keywords
condition
processing means
amount
shift
detection device
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
JP3159379A
Other languages
Japanese (ja)
Other versions
JPH07119887B2 (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 JP3159379A priority Critical patent/JPH07119887B2/en
Publication of JPH04348306A publication Critical patent/JPH04348306A/en
Publication of JPH07119887B2 publication Critical patent/JPH07119887B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Abstract

PURPOSE:To perform a deviation arithmetic operation in different conditions and to obtain superior responsiveness without prolonging the arithmetic time. CONSTITUTION:This focus detector is equipped with a microcomputer 8 which has a prefilter means 5, a memory 9, a postfilter 10, deviation arithmetic operation 11, etc., and the deviation amount between a couple of object images is calculated by shifting the image outputs of the object images within a 1st specific shift quantity range in a 1st condition to detect the quantity of relative deviation between the couple of object images, and the deviation between the couple of object images is calculated by shifting the image outputs of the object images within a 2nd specific shift quantity range in a 2nd condition so as to detect the quantity of relative deviation between the couple of object images. The detection range of the relative images which is determined by the 1st specific shift quantity in the 1st condition is set wider than the detection range of the relative deviation between the object images which is determined by the 2nd specific shift quantity in the 2nd condition, and a defocusing quantity is calculated from the processing result of at least one of 1st and 2nd processing means.

Description

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

【0001】0001

【産業上の利用分野】本発明は、結像光学系の焦点調節
状態を検出する焦点検出装置に係り、特にカメラの焦点
検出装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a focus detection device for detecting the focus adjustment state of an imaging optical system, and more 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】このようなイメージセンサー上の一対の物
体像の相対的なずれ量を光電的に検出して結像光学系の
焦点調節状態を検出する焦点検出装置に関して、出願人
は特開昭60−37513号公報において物体像の画像
出力を所定の画素数の範囲で相対的にシフトして2 像
の相関量を算出し、こうして求められた複数の相関量に
基づいて2像の相対的なずれ量を1シフト量以下の精度
で算出するずれ演算の方法を提案している。
Regarding such a focus detection device that photoelectrically detects the relative shift amount of a pair of object images on an image sensor to detect the focus adjustment state of an imaging optical system, the applicant has proposed a method disclosed in Japanese Patent Application Laid-Open No. In Publication No. 37513, the image output of the object image is relatively shifted within a predetermined pixel number range to calculate the amount of correlation between the two images, and the relative amount of the two images is calculated based on the multiple correlation amounts thus calculated. We have proposed a shift calculation method that calculates the shift amount with an accuracy of one shift amount or less.

【0004】0004

【発明が解決しようとする課題】ところが、結像光学系
の焦点調節状態によっては異なった性能が要求される。 例えば、撮影レンズが合焦位置から大きくずれている場
合にはイメージセンサー上の一対の物体像には比較的、
低次の空間周波数成分が多く含まれており、このような
一対の物体像から大きなずれ量を検出することが必要と
なる。一方、撮影レンズが合焦位置近傍にある時には高
次の空間周波数成分が比較的多く含む一対の物体像から
高精度なずれ量の検出を行うことが好ましいことが分か
った。
However, different performance is required depending on the focusing state of the imaging optical system. For example, if the photographic lens is far away from the in-focus position, the image of the pair of objects on the image sensor will be relatively distorted.
Many low-order spatial frequency components are included, and it is necessary to detect a large amount of deviation from such a pair of object images. On the other hand, it has been found that when the photographic lens is near the in-focus position, it is preferable to detect the amount of deviation with high precision from a pair of object images containing relatively many high-order spatial frequency components.

【0005】また、単一のずれ演算では焦点調節状態に
よって要求される異なった性能に対応することは難しい
ことが分かった。本発明は、このような単一のずれ演算
では焦点調節状態によって要求される異なった性能に対
応することが難しいことに鑑みてなされたもので、異な
る条件のもとにずれ演算を行うことが可能とすると共に
、これにともなって演算時間が増大することのない応答
性に優れた焦点検出装置を提供することを目的とする。
[0005] Furthermore, it has been found that it is difficult to cope with different performance requirements depending on the focus adjustment state using a single shift calculation. The present invention was made in view of the fact that it is difficult to respond to the different performances required depending on the focus adjustment state with such a single shift calculation, and it is possible to perform shift calculations under different conditions. It is an object of the present invention to provide a focus detection device with excellent responsiveness that does not require an increase in calculation time.

【0006】[0006]

【実施例】以下に本発明について図面を参照して説明す
る。図1において、光電変換装置1はCCD型又はMO
S型イメージセンサから成る一対の光電素子アレイ2、
3を有し、これらのアレイ2、3上には夫々カメラの撮
影レンズの瞳の異った領域を通った一対の光束によって
被写体の光像が形成される。アレイ2上の光像とアレイ
3上の光像との相対的ずれ量がレンズの焦点調節状態を
表わしている。上記アレイ2、3は夫々空間ピッチp0
 で直線上に配列された光電素子a1 ’ …an ’
 とb1 ’ …bn ’ とから構成され、各光電素
子a1 ’ …an ’ 、b1 ’ …bn ’ は
夫々空間ピッチp0 の一次データa1 …an 、b
1 …bn を時系列的に出力する。アレイ2に関する
データ、アレイ3に関するデータを以下夫々a系列、b
系列データと言う。
DESCRIPTION OF THE PREFERRED EMBODIMENTS The present invention will be explained below with reference to the drawings. In FIG. 1, the photoelectric conversion device 1 is a CCD type or MO
a pair of photoelectric element arrays 2 consisting of an S-type image sensor;
3, and on these arrays 2 and 3, an optical image of the object is formed by a pair of light beams that have passed through different areas of the pupil of the photographing lens of the camera. 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 above arrays 2 and 3 each have a spatial pitch p0
Photoelectric elements a1 '...an' arranged on a straight line with
and b1'...bn', and each photoelectric element a1'...an', b1'...bn' has primary data a1...an, b with a spatial pitch p0, respectively.
1 ...bn is output in time series. The data related to array 2 and the data related to array 3 are shown below as series a and series b, respectively.
This is called series data.

【0007】各光電素子アレイ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.

【0008】光電変換装置1からの一次データai、b
iは、非線形処理部4において例えば対数増幅された後
、前置フィルタ手段5に送られる。この前置フィルタ手
段5は、ハードウェア具体的には図3(a)又は(b)
に示すトランスパーサルフィルタにより構成されている
。図3(a)(b)のフィルタは、直列接続された−デ
ータ分の遅延回路D1 、D2 、D3 …と、夫々所
定の加重係数w1 、w2 、w3 、w4 、w5 
を入力データに乗ずる乗算器w1 、w2 、…w5 
と、これらの乗算器の出力を加算する加算器T1 とか
ら構成され、図3(a)は一次データがa1 、b1 
、a2 、b2 …an、bn の順に入力される場合
の構成を、図3(b)は、a1 、a2 …an 、b
1 、b2 …bn の順で入力される場合の構成を示
している。このようにトランスパーサルフィルタは、順
次入力されるa系列の一次データa1 、a2 …an
 の連続する5個のデータに図2(b−2)に示すよう
な所定の加重係数w1 =0.28、w2 =0.76
、w3 =1、w4 =0.76、w5 =0.28を
夫々乗じ、それらを加算した後和を出力し、b系列の一
次データb1 、b2 …bn についても全く同様に
処理する。複数のデータに所定の加重係数を乗じそれら
と加算するフィルタリング処理及びフィルタを夫々加重
加算及び加重加算フィルタを称することにする。上述の
加重係数列(0.28、0.76、1、0.76、0.
28)を有する加重加算フィルタのMTF特性は、図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. This prefilter means 5 is implemented by hardware, specifically as shown in FIG. 3(a) or (b).
It consists of a transpersal filter shown in the figure below. The filters in FIGS. 3(a) and 3(b) include series-connected -data delay circuits D1, D2, D3... and predetermined weighting coefficients w1, w2, w3, w4, w5, respectively.
Multipliers w1, w2,...w5 that multiply input data by
and an adder T1 that adds the outputs of these multipliers, and in FIG. 3(a), the primary data is a1, b1.
, a2, b2...an, bn are input in the order shown in FIG. 3(b).
1, b2...bn are input in this order. In this way, the transpersal filter uses the primary data a1, a2...an of the a series input sequentially.
Predetermined weighting coefficients w1 = 0.28, w2 = 0.76 as shown in Fig. 2 (b-2) are applied to the five consecutive pieces of data.
, w3 = 1, w4 = 0.76, and w5 = 0.28, respectively, and after adding these, the sum is output, and the primary data b1, b2 . . . bn of the b series is processed 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, 0.76, 0.
The MTF characteristics of the weighted addition filter with 28) are shown in Figure 2.
As shown in (b-1), D. Extract C component sufficiently and 1/
This characteristic removes frequency components around 4p0 or above, in other words, spatial frequency components above Nyquist frequency fN=1/2p determined by sampling pitch p=2p0. 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.

【0009】前置フィルタ手段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.

【0010】0010

【数1】[Math 1]

【0011】これらの二次データ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 and 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.

【0012】この三次データは結局、前置フィルタ手段
5と後置フィルタ部10との両方の加重加算フィルタリ
ング処理を受けたことになる。図2(b−2)と図2(
c−3)の重み係数列を夫々持つフィルタの合成MTF
を図2(c−1)に示し、同様に図2(b−2)と(d
−3)のフィルタの合成MTFを図2(d−1)に示す
[0012] 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).

【0013】ずれ演算部11はa系列とb系列の二次デ
ータから、又はa系列とb系列の三次データからアレイ
2、3上の光像の相対的ずれ量を算出する。次に、空間
周波数成分と演算結果の精度との関係を述べる。一般に
、サンプリングピッチpのデータを演算してずれ量を検
出する場合、サンプリングピッチpから決まるナイキス
ト周波数fN =1/2p以上の空間周波数成分は、有
害で誤検出の要因となり、上記ナイキスト周波数の半分
fN /2付近の空間周波数成分は、極めて有効で高精
度の演算結果が期待でき、また周波数がこの周波数fN
 /2より小さくなるにつれて精度が低下する。一方撮
影レンズが合焦位置から大きくずれていると、光電素子
アレイ上の光像は大きくボケてしまいこの光像には高次
の空間周波数成分が大幅に減少しD.C成分付近の成分
が増加する。
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. Next, the relationship between spatial frequency components and the accuracy of calculation results will be described. In general, when calculating the amount of deviation by calculating the data of the sampling pitch p, spatial frequency components higher than the Nyquist frequency fN = 1/2p determined by the sampling pitch p are harmful and cause false detection; Very effective and highly accurate calculation results can be expected for spatial frequency components around fN /2, and the frequency is around this frequency fN.
The accuracy decreases as the value becomes smaller than /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.

【0014】図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.

【0015】マイコン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.

【0016】ステップ〔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.

【0017】このステップ〔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.

【0018】このように、撮影レンズが合焦位置から大
きくずれている場合には比較的低次の空間周波数成分を
相対的に多く含んだ二次データによりずれ検出が行われ
また合焦位置近傍にある場合には、高次の空間周波数成
分を相対的に多く含んだ三次データにより高精度のずれ
検出が行われる。こうして求められたデフォーカス量に
応じて、表示手段12と焦点調節手段13が夫々焦点調
節状態の表示及び焦点調節を行う。
In this way, when the photographing lens is largely deviated 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.

【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 of the single filter 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を越えない最大の整数を表わす。図5(a)はシ
フト量Lを順次変えた時々の相関量C(L)をプロット
したものでFはプロットされた点を結ぶ関数でありこの
関数Fが最小となる点Fmを与えるLのシスト量Lmが
、構造のずれ量に対応している。
S is a constant integer representing the number of addition terms [X
] represents the largest integer not exceeding X. Figure 5(a) is a plot of the correlation amount C(L) when the shift amount L is sequentially changed. The cyst amount Lm corresponds to the amount of structural deviation.

【0029】最小点Fm付近の曲線Fの形状が図5(a
)に示すように最大値Fmを中心とするほぼ対称なV字
形となっていることを実験の結果見出した。これに基づ
き最小値Fmを与えるシフト量Lmを内挿する手法を以
下に述べる。一データ分ずつ増加したシフト量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 とを直線l
1 で結び、この直線l1 の傾きと絶対値が等しいが
符号が逆の傾きを持つ直線l−1を中間の値C−1を通
る様に引く。両直線l1とl−1の交点が関数Fの極小
値Cextとなる。座標軸C(L)方向におけるC0 
とCextとの間の距離DL は次の様になる。
The shape of the curve F near the minimum point Fm is shown in FIG.
) As a result of experiments, it was found that the shape is approximately symmetrical V-shaped around the maximum value Fm. A method of interpolating the shift amount Lm that gives the minimum value Fm based on this will be described below. 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. As shown in FIG. 5(b), C-1≧C0 and C1 >C0
When is satisfied, a local minimum 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 drawn by a straight line l
1, and draw a straight line l-1 having a slope equal in absolute value but opposite in sign to the slope of this straight line l1 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. C0 in the coordinate axis C(L) direction
The distance DL between and Cext is as follows.

【0030】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.

【0031】そこで規格化極小値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.

【0032】図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.

【0033】ステップ〔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.

【0034】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.

【0035】次いでステップ〔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〕へ戻る。このようにして
、例えばlf =5としたとき、最大相関が得られるま
でシフト量Lを0から順次1、−1、2、−2、3、−
3、4、−4と漸増して、最大相関を与えるシフト量を
求める。最大相関が得られる事なくシフト量Lが所定シ
フト量lf になった時、ステップ〔25〕で最大シフ
ト量までデータをシフトしても最大相関が得られないと
いうことを示すためにパラメータCorrelを0にセ
ットしてアルゴリズムのルーチンを終了する。またステ
ップ〔13〕はCorrel=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 shift amount lf. This predetermined shift amount lf is an integer value that determines the maximum shift amount. Step [22
] or when the conditions in step [24] are not satisfied, the process returns to step [12]. After returning from this step [12], when you come to step [21] again, since L=1, the sign is reversed and L=-1, and step [22]
The process returns to step [12] again via . In this way, for example, when lf = 5, the shift amount L is sequentially changed from 0 to 1, -1, 2, -2, 3, - until the maximum correlation is obtained.
The shift amount is gradually increased to 3, 4, and -4 to find the shift amount that gives the maximum correlation. When the shift amount L reaches the predetermined shift amount lf without obtaining the maximum correlation, the parameter Correl is set to indicate that the maximum correlation cannot be obtained even if the data is shifted to the maximum shift amount in step [25]. Set to 0 to end the algorithm routine. Further, step [13] is to determine whether or not the determination in the case of ending with Correl=0 has been made based on a sufficient amount of information.

【0036】上述の相関演算において、例えば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 predetermined shift amount lf is selected to be about 3, the number of calculations of equation (1) will be only 7 times, and when the number of data N = 50 and the number of addition terms to calculate equation (1) is S = 30. In this case, only 210 calculations of Ai-Bi+L are required.

【0037】以上の背景説明のもとに本発明の実施例に
ついて説明する。デフォーカスの大きいところで性能を
発揮する条件(第1条件)で大きいシフト範囲で2像の
ずれを演算する処理(第1処理)と、合焦近傍で性能を
発揮する条件(第2条件)で少ないシフト範囲で2像の
ずれ演算をする処理(第2処理)とはどちらを先に行う
こともできるが、第2処理を先に行い検出不能の時にの
み第1処理を行うと撮影レンズは合焦近傍にあることが
大いので、殆どの場合第2処理だけで済演算時間が少な
くてすむ利点がある。
Embodiments of the present invention will be explained based on the above background explanation. A process that calculates the deviation of two images in a large shift range (first process) under conditions that exhibit performance in areas with large defocus (first condition), and a condition that exhibits performance near in-focus (second condition). The process of calculating the deviation of the two images within a small shift range (second process) can be performed first, but if the second process is performed first and the first process is performed only when detection is not possible, the photographing lens will Since it is important that the object is near the in-focus state, in most cases only the second processing is required, which has the advantage of requiring less calculation time.

【0038】このような場合について図7を用いて第1
実施例を説明する。a系列、b系列の空間ピッチp0 
の一次データai、biから夫々の空間ピッチ2p0 
の二次データ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)
にセットする。
In such a case, the first
An example will be explained. Spatial pitch p0 of a series and b series
From the primary data ai, bi, the respective spatial pitches 2p0
The steps up to creating the secondary data Ai, Bi are the same as in the first embodiment. A/D converted secondary data Ai, Bi
is 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], specify the memory area (2) and set the predetermined cyst amount lf2 (lf2 is 2 or 3).
Set to .

【0039】なお図面のフローチャート中では所定シフ
ト量のことを指定相関演算域と表現している。ステップ
〔34〕でこの所定シフト量内で、fN /2付近の高
次の空間周波数成分について図6のずれ演算アルゴリズ
ム処理を行う。ずれ演算結果の有効性を判定する判定手
段としてステップ〔35〕において最大相関が所定シフ
ト量lf2内に存在し(Correl=1)、かつ演算
の信頼性が充分(Infom=1)であるかを判別しY
esであれば、ステップ〔36〕で、シフト量Lmをデ
フォーカス量に換算する。
In the flowchart of the drawing, the predetermined shift amount is expressed as a designated correlation calculation area. In step [34], within this predetermined shift amount, the shift calculation algorithm process of FIG. 6 is performed for high-order spatial frequency components around fN/2. As a determination means for determining the validity of the deviation calculation result, it is determined in step [35] whether the maximum correlation exists within a predetermined shift amount lf2 (Correl=1) and the reliability of the calculation is sufficient (Inform=1). Determine Y
If es, the shift amount Lm is converted into a defocus amount in step [36].

【0040】もしステップ〔35〕でNoの場合には、
ステップ〔37〕においてメモリ領域(1)を指定しか
つ所定シフト量lf をlf2(lf1>lf2でlf
1≒N/2)にセットする。ステップ〔38〕において
、所定シフト量lf1内で、D.C成分を充分含む空間
周波数成分に基づいて図6のずれ演算アルゴリズム処理
を行う。この結果に基づいてステップ〔36〕が実行さ
れる。
[0040] If No in step [35],
In step [37], specify the memory area (1) and set the predetermined shift amount lf to lf2 (if lf1>lf2, lf
1≒N/2). In step [38], within the predetermined 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.

【0041】以上の如く、本実施例では、まずD.C成
分抑制したデータに基づいてずれ演算を行い。判定手段
がこの第2処理の結果を有効でないと判定した時にはさ
らにDC成分を充分に含む画像データに基づいて広いシ
フト範囲でずれ演算を行う(第処理)。撮影レンズの自
動焦点調節を連続的に行なっている場合は、一般的に撮
影レンズは合焦位置近傍にあることが多く、従って多く
の場合ステップ〔35〕でYesとなることが期待され
演算処理時間が大幅に短縮できる。
As described above, in this embodiment, first, D. A shift calculation is performed based on the data with the C component suppressed. When the determining means determines that the result of the second process is not valid, a shift calculation is further performed in a wide shift range based on image data that sufficiently includes a DC component (first process). When automatic focus adjustment of the photographic lens is performed continuously, the photographic lens is generally located near the in-focus position, and therefore, in most cases, it is expected that the result in step [35] will be Yes, and the calculation process will be performed. Time can be significantly reduced.

【0042】次に広いシフト範囲でずれ演算を行う処理
(第1処理)を先に行う場合について図8により第2実
施例として説明する。ステップ〔41〕、〔42〕、〔
43〕は図7のステップ〔31〕、〔37〕、〔38〕
と同一である。D.C成分を充分含んだデータから算出
した内挿シフト量Lmが、撮影レンズが合焦位置近傍に
あることを示しているか否かをステップ〔44〕で判別
し、Noである場合、ステップ〔50〕でそのシフト量
をデフォーカス量に換算する。上記判別がYesであっ
た場合、ステップ〔45〕において、ステップ〔43〕
の演算結果Lm(1) とE(3) とを記憶する。ス
テップ〔46〕、〔47〕及び〔48〕は図8のステッ
プ〔32〕、〔33〕及び〔34〕と同一でD.C成分
を充分又はかなり除去したデータに基づきずれ演算結果
Lm(2) 、E(2) が算出される。ステップ〔4
9〕でパラメータ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からデフォーカス量を換
算する。
Next, a second embodiment will be described with reference to FIG. 8, in which the process (first process) of performing shift calculation in a wide shift range is performed first. Steps [41], [42], [
43] are steps [31], [37], and [38] in FIG.
is the same as D. It is determined in step [44] 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 No, step [50] ) to convert the shift amount into a defocus amount. If the above determination is Yes, in step [45], step [43]
The calculation results Lm(1) and E(3) 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. Step [4
9], one of the interpolation shift amounts Lm(1) and Lm(2) is selected from the parameters E(1) and E(2). The subject himself is D. When there is only a spatial frequency component near the C component, the calculation result Lm(2
) becomes very low in reliability, and at this time the parameter E also becomes very small. Therefore, when E(2) is less than a predetermined threshold Eth and E(1) is sufficiently large, Lm(1) is selected; otherwise, Lm(2) is selected, and in step [50] Convert the focus amount.

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

【0044】次に、第2実施例の改良に当たる第3実施
例を説明する。図9において、ステップ〔51〕〜〔5
5〕は夫々図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=Eth
2 を指定する。この条件で下のステップ〔59〕で図
6のアルゴリズム処理を行い、その結果、ステップ〔6
0〕でInform=1、Correl=1であればス
テップ〔65〕でこの時の内挿シフト量Lmからデフォ
ーカス量を検出する。
Next, a third embodiment, which is an improvement on the second embodiment, will be described. In FIG. 9, steps [51] to [5
5] 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]. Memory area (1) in step [57]
Figure 2 (d-
3) Weighted addition filter processing of the weighted coefficient sequence, generally speaking, as shown in Figure 2 (d-1), the peak frequency f2 is determined by the pitch p, Nyquist frequency fN = 1/2p.
/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], the memory area (2) is specified as the memory to be used, and the predetermined shift amount lf is
For example, specify 2 as =lf2 and set the threshold value Eth=Eth
Specify 2. Under these conditions, the algorithm processing shown in FIG. 6 is performed in step [59] below, and as a result, step [6
0], and 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 predetermined 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 predetermined shift amount lf to a wider 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でサンプルしてもよい。次いで使用メモリ領域(1
’ )を指定し、所定シフト量lf =lf1≒N’ 
/2を指定する。ここでサンプル数N’ はメモリ領域
(1)でのサンプル数Nのほぼ1/nである。(ステッ
プ〔73〕)次いで像ずれ量算出のアルゴリズム処理を
行ない(ステップ〔74〕)、求められた像ずれのシフ
ト量Lmにサンプルピッチがn倍となっている事による
n倍の補正を行ないLm×n→Lmとする(ステップ〔
75〕)。次いで、これからデフォーカス量を算出する
(ステップ〔76〕)。
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. Next, the used memory area (1
) and specify the predetermined shift amount lf = lf1≒N'
/2 is specified. 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 fact that the sample pitch is multiplied by n. Let Lm×n → Lm (step [
75]). Next, the defocus amount is calculated from this (step [76]).

【0049】ここではデフォーカス量の大きい所でのサ
ンプルピッチを大きくして処理時間の短縮をする例を示
したが、合焦近傍においても第3実施例におけるフィル
タ処理でそのMTFのピークをより低空間周波数側に移
す場合にはそれに合わせてサンプルピッチを大きくして
処理時間を短縮する事が可能である。図11の実施例は
その様な場合を示している。ここで再びシフト範囲の狭
い合焦近傍の処理(第2処理)を先に行う第1実施例の
改良である第4実施例を図11により説明する。
Here, we have shown an example in which the processing time is shortened by increasing the sample pitch in areas where the amount of defocus is large, but even near the in-focus area, the filtering process in the third embodiment can further reduce the MTF peak. When moving to the lower spatial frequency side, the processing time can be shortened by increasing the sample pitch accordingly. The embodiment of FIG. 11 shows such a case. Here, a fourth embodiment, which is an improvement of the first embodiment, will be described with reference to FIG. 11, in which processing near focus (second processing) with a narrow shift range is performed first.

【0050】ハードウエアフィルタにより図2(b−1
)の特性でフィルタされた二次データがメモリ領域(1
)にストアされ(ステップ〔81〕)、さらにステップ
〔82〕で図2(d−3)のフィルターで処理された即
わち同図(d−1)のようにf2 =1/(8p0 )
を中心とする空間周波数帯に関する情報を含むデータが
メモリ領域(2)にストアされる。続いて使用メモリ(
2)を指定し、所定シフト量lf として例えばlf 
=lf2=3を指定し、情報量に関するしきい値Eth
をEth2に指定する(ステップ〔83〕)。これにも
とずいて図6のシフト量算出のアルゴリズム処理(ステ
ップ〔84〕を行ない、その結果、情報量が十分(In
fom=1)でかつ検出所定シフト量内(Correl
=1)ならば(ステップ〔85〕)、結果のシフト量L
mからデフォーカス量を算出し(ステップ〔86〕)終
了とする。ステップ〔85〕の条件が充足されなかった
時は、系は合焦近傍にないか、あるいは合焦近傍にあっ
ても光像が前記空間周波数f2 より低い空間周波数し
か含まない場合なので、以後の演算は処理時間の短縮を
はかるためサンプルピッチを2倍の2pとして行なう。 そこで今後のサンプルピッチをp’ とするとp’ =
2p=4p0 である。
FIG. 2(b-1)
) is stored in the memory area (1
) (step [81]), and further processed with the filter of FIG. 2 (d-3) in step [82], that is, f2 = 1/(8p0) as shown in FIG. 2 (d-1).
Data containing information regarding a spatial frequency band centered at is stored in a memory area (2). Next, use memory (
2), and set the predetermined shift amount lf to, for example, lf
=lf2=3, and the threshold value Eth regarding the amount of information
is designated as Eth2 (step [83]). Based on this, the algorithm processing (step [84]) for calculating the shift amount in FIG. 6 is performed, and as a result, the amount of information is sufficient (In
fom=1) and within the predetermined detection shift amount (Correl
= 1) (step [85]), the resulting shift amount L
The defocus amount is calculated from m (step [86]) and the process ends. If the condition in step [85] is not satisfied, this means that the system is not in the vicinity of focus, or even if it is in the vicinity of focus, the optical image only contains a spatial frequency lower than the spatial frequency f2. The calculation is performed with the sample pitch doubled to 2p in order to shorten the processing time. Therefore, if the future sample pitch is p', then p' =
2p=4p0.

【0051】具体的には図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.

【0052】次に使用メモリ領域〔4〕を指定し、所定
シフト量lf =lf4=3を指定し情報量のしきい値
Eth=Eth4 を指定する(ステップ〔91〕)。 これにもとずいて図6のアルゴリズム処理を行なう(ス
テップ〔92〕)。この場合ステップ〔84〕及び〔9
2〕のアルゴリズム処理において所定シフト量lf は
3で同じでるが、サンプルピッチが2倍違いのでステッ
プ〔92〕の方が物体像の相対的ずれ量を検出する範囲
は広く、また検出領域も広い。
Next, the memory area to be used [4] is designated, the predetermined shift amount lf = lf4 = 3, and the information amount threshold value Eth = Eth4 (step [91]). Based on this, the algorithm processing shown in FIG. 6 is performed (step [92]). In this case, steps [84] and [9]
In the algorithm processing of step [2], the predetermined shift amount lf is the same as 3, but the sample pitch is twice as different, so step [92] has a wider range for detecting the relative shift amount of the object image, and the detection area is also wider. .

【0053】もし情報量が十分で(Infom=1)(
ステップ〔93〕)かつ所定シフト量(Correl=
1)(ステップ〔96〕)ならばこの時のLmからこの
時のサンプルピッチ2pを考慮して、像ずれ量XをX=
Lm×2pにより算出する(ステップ〔100〕)。 ステップ〔93〕の条件が充足されない場合にはパラメ
ータjを1増してj=5とする。この場合ステップ〔9
5〕を介して再びステップ
[0053] If the amount of information is sufficient (Inform=1) (
step [93]) and a predetermined shift amount (Correl=
1) (Step [96]) Then, considering the sample pitch 2p at this time from Lm at this time, the image shift amount X is set to X=
Calculate by Lm×2p (step [100]). If the condition in step [93] is not satisfied, the parameter j is incremented by 1 to make j=5. In this case step [9
5] Step again through

〔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 is again applied to the data in memory area (3).
.. C component is removed and the spatial frequency f5 (f5 < f4
) is performed and stored in the data memory area (5). For example, f5 = 1/
Filter processing is performed such that 2f4 = 1/8p' = 1/32p0. 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.

【0054】この様にして前回と同様にステップ〔91
〕、〔92〕を行ない、情報量が十分で(ステップ〔9
3〕)かつ相関検出域内(ステップ〔96〕)ならばス
テップ〔100〕で像ずれ量を算出する。ステップ〔9
3〕で条件が充足されないとステップ〔94〕でj=6
となりステップ〔95〕の条件が満たされてステップ〔
97〕へ移る。又ステップ〔88〕やステップ〔96〕
の条件が満たされた場合もステップ〔97〕へ移る。
[0054] 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].

【0055】この時点では系は合焦近傍にないか、ある
いは被写体が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.

【0056】この実施例では、空間ピッチ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.

【0057】上述の実施例はいずれもマイコンでの加重
加算処理とずれ演算処理とを全く別個に行う例であった
。しかし、この両処理を一部又は完全に結合した形で行
うことも可能である。例えば、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.

【0058】[0058]

【数4】[Math 4]

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

【0060】[0060]

【発明の効果】以上の説明から明らかなように、従来で
は単一のずれ演算では焦点調節状態によって要求される
異なった性能に対応することが難しかったが、本発明に
よると、異なる条件のもとにずれ演算を行うことが可能
であると共に、これにともなって演算時間が増大するこ
とのない応答性に優れた効果がある。
[Effects of the Invention] As is clear from the above explanation, in the past, it was difficult to cope with the different performance required depending on the focus adjustment state with a single shift calculation, but according to the present invention, it is difficult to cope with the different performance required depending on the focus adjustment state. It is possible to perform the shift calculation at the same time, and the calculation time does not increase accordingly, resulting in excellent responsiveness.

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

【図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 regarding focus detection.

【図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】第1実施例に関するフローチャート図。FIG. 7 is a flowchart diagram regarding the first embodiment.

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

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

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

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

【主要部分の符号の説明】[Explanation of symbols of main parts]

2、3…光電素子アレイ 5…前置フィルタ 8…マイコン 10、10j…後置フィルタ部 11…ずれ演算部 2, 3...Photoelectric element array 5...Pre-filter 8...Microcomputer 10, 10j...Post filter section 11...Difference calculation section

Claims (9)

【特許請求の範囲】[Claims] (1)  光電変換手段上の一対の物体像の相対的なず
れ量を光電的に検出して結像レンズの焦点調節状態を検
出する焦点検出装置において、前記一対の物体像の相対
的なずれ量を検出するために前記物体像の画像出力を第
1条件のもとに第1所定シフト量の範囲でシフトして前
記一対の物体像のずれ演算を行う第1処理手段と、前記
一対の物体像の相対的なずれ量を検出するために前記物
体像の画像出力を第1条件と異なる第2条件のもとに第
2所定シフト量の範囲でシフトして前記一対の物体像の
ずれ演算を行う第2処理手段とを備え、前記第2条件に
おける前記第2所定シフト量で決められる前記物体像の
相対的ずれの検出範囲より、前記第1条件における前記
第1所定シスト量で決められる前記物体像の相対的ずれ
の検出範囲の方が広くなるように設定されており、前記
第1処理手段もしくは前記第2処理手段の少なくとも一
方の処理結果に基づいてデフォーカス量を算出すること
を特徴とする焦点検出装置。
(1) In a focus detection device that photoelectrically detects the relative shift amount of a pair of object images on a photoelectric conversion means to detect the focus adjustment state of an imaging lens, the relative shift amount of the pair of object images is detected. a first processing means for calculating a shift between the pair of object images by shifting the image output of the object image within a first predetermined shift amount range under a first condition; In order to detect the relative displacement amount of the object images, the image output of the object images is shifted within a second predetermined shift amount range under a second condition different from the first condition to detect the displacement between the pair of object images. a second processing means for performing calculation, which is determined by the first predetermined cyst amount in the first condition from the detection range of the relative shift of the object image determined by the second predetermined shift amount in the second condition. The defocus amount is calculated based on a processing result of at least one of the first processing means and the second processing means. A focus detection device featuring:
(2)  前記第1条件及び前記第2条件は、前記第1
処理手段及び前記第2処理手段の前記画像出力をサンプ
リングするためのサンプリングピッチであり、夫々のサ
ンプリングピッチは異なることを特徴とする特許請求の
範囲第(1)項記載の焦点検出装置。
(2) The first condition and the second condition are
The focus detection device according to claim 1, wherein the sampling pitch is a sampling pitch for sampling the image output of the processing means and the second processing means, and each sampling pitch is different.
(3)  前記第1処理手段もしくは前記第2処理手段
の少なくとも一方の処理結果に基づいてデフォーカス量
を算出する際に、前記所定シフト量の範囲内の一部のシ
フトで前記ずれ演算を終了した場合には残りのシフトは
行わないことを特徴とする特許請求の範囲第(1)項記
載の焦点検出装置。
(3) When calculating the defocus amount based on the processing result of at least one of the first processing means or the second processing means, the shift calculation is terminated with a partial shift within the range of the predetermined shift amount. The focus detection device according to claim 1, wherein the remaining shift is not performed in the case where the focus detection device is shifted.
(4)  前記第2処理手段により前記ずれ演算を行い
、この結果が有効と判定された場合には前記デフォーカ
ス量を算出し、それ以外の場合には前記第1処理手段に
より前記ずれ演算を行うことを特徴とする特許請求の範
囲第(1)項記載の焦点検出装置。
(4) The second processing means performs the shift calculation, and if the result is determined to be valid, the defocus amount is calculated; otherwise, the first processing means performs the shift calculation. A focus detection device according to claim (1), characterized in that:
(5)  前記第2処理手段の第2条件は、前記画像出
力に対するDC成分の除去であることを特徴とする特許
請求の範囲第(1)項又は(2)項記載の焦点検出装置
(5) The focus detection device according to claim 1 or 2, wherein the second condition of the second processing means is to remove a DC component from the image output.
(6)  前記第1処理手段の第1条件は、前記画像出
力に対するDC成分の除去しないことを特徴とする特許
請求の範囲第(1)項又は(2)項記載の焦点検出装置
(6) The focus detection device according to claim 1 or 2, wherein the first condition of the first processing means is not to remove a DC component from the image output.
(7)  前記第1条件は、前記第2条件より低次空間
周波数成分をおもに抽出するような条件であることを特
徴とする特許請求の範囲第(1)項又は(2)項記載の
焦点検出装置。
(7) The focus according to claim 1 or 2, wherein the first condition is a condition that mainly extracts lower-order spatial frequency components than the second condition. Detection device.
(8)  前記第1条件は、前記第2条件より前記サン
プリングピッチが粗いことを特徴とする特許請求の範囲
第(2)項記載の焦点検出装置。
(8) The focus detection device according to claim (2), wherein the first condition is such that the sampling pitch is coarser than the second condition.
(9)  前記第1処理手段により前記ずれ演算を行い
、この結果合焦近傍と判定された時には前記第2処理手
段により前記ずれ演算を行い、それ以外の時には前記第
1処理手段により前記ずれ演算を行うことを特徴とする
特許請求の範囲第(1)項記載の焦点検出装置。
(9) The first processing means performs the deviation calculation, and when it is determined as a result that the focus is near, the second processing means performs the deviation calculation, and in other cases, the first processing means performs the deviation calculation. A focus detection device according to claim (1), characterized in that the focus detection device performs the following.
JP3159379A 1991-07-01 1991-07-01 Focus detection device Expired - Lifetime JPH07119887B2 (en)

Priority Applications (1)

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

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3159379A JPH07119887B2 (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
JPH04348306A true JPH04348306A (en) 1992-12-03
JPH07119887B2 JPH07119887B2 (en) 1995-12-20

Family

ID=15692532

Family Applications (1)

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

Country Status (1)

Country Link
JP (1) JPH07119887B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006017933A (en) * 2004-06-30 2006-01-19 Olympus Corp Focus arithmetic unit of camera
JP2016224159A (en) * 2015-05-28 2016-12-28 株式会社ニコン Focus detection device and imaging device
JP2016224160A (en) * 2015-05-28 2016-12-28 株式会社ニコン Focus detection device and imaging device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS599611A (en) * 1982-07-09 1984-01-19 Hitachi Denshi Ltd Correlator
JPS59123810A (en) * 1982-12-29 1984-07-17 Nippon Seimitsu Kogyo Kk Automatic focus control device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS599611A (en) * 1982-07-09 1984-01-19 Hitachi Denshi Ltd Correlator
JPS59123810A (en) * 1982-12-29 1984-07-17 Nippon Seimitsu Kogyo Kk Automatic focus control device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006017933A (en) * 2004-06-30 2006-01-19 Olympus Corp Focus arithmetic unit of camera
JP4615912B2 (en) * 2004-06-30 2011-01-19 オリンパス株式会社 Camera focus calculation device
JP2016224159A (en) * 2015-05-28 2016-12-28 株式会社ニコン Focus detection device and imaging device
JP2016224160A (en) * 2015-05-28 2016-12-28 株式会社ニコン Focus detection device and imaging device

Also Published As

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

Similar Documents

Publication Publication Date Title
US4561749A (en) Focus detection apparatus
JP5824364B2 (en) Distance estimation device, distance estimation method, integrated circuit, computer program
US10326927B2 (en) Distance information producing apparatus, image capturing apparatus, distance information producing method and storage medium storing distance information producing program
US7583442B2 (en) Extended depth of field optical systems
CN102209245B (en) Image processing apparatus, image pickup apparatus and image processing method
CN101388952B (en) Apparatus and method for restoring image
RU2222113C2 (en) Method and device for automatic focusing in image clamping system using symmetrical finite impulse response filters
US8269861B2 (en) Image acquisition apparatus which has a focus detection function and program recording device
US6441855B1 (en) Focusing device
US5572011A (en) Focus detecting method and distance measuring method with a plurality of light fluxes and a contrast operation
JP3444551B2 (en) Camera focus detection device
US20160344952A1 (en) Image processing apparatus, image pickup apparatus, image processing method, and storage medium
JPH0328691B2 (en)
JPH04348306A (en) Focus detector
JPH0477289B2 (en)
JP4255186B2 (en) Focusing device
JPH04338905A (en) Focus detection device
JPH05181057A (en) Automatic focusing device
JP5846895B2 (en) Image processing system and microscope system including the same
JPH04338906A (en) Focus detection device
JPH0762733B2 (en) Focus detection device
JP2850336B2 (en) Focus detection device
JP2762463B2 (en) Focus detection device
Xian et al. Performance evaluation of different depth from defocus (DFD) techniques
JPH0750241B2 (en) Focus detection device

Legal Events

Date Code Title Description
EXPY Cancellation because of completion of term