JPH0553241B2 - - Google Patents

Info

Publication number
JPH0553241B2
JPH0553241B2 JP58028594A JP2859483A JPH0553241B2 JP H0553241 B2 JPH0553241 B2 JP H0553241B2 JP 58028594 A JP58028594 A JP 58028594A JP 2859483 A JP2859483 A JP 2859483A JP H0553241 B2 JPH0553241 B2 JP H0553241B2
Authority
JP
Japan
Prior art keywords
image
images
image data
contrast
amount
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP58028594A
Other languages
Japanese (ja)
Other versions
JPS59155807A (en
Inventor
Yoshiaki Horikawa
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.)
Olympus Corp
Original Assignee
Olympus Optical Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Olympus Optical Co Ltd filed Critical Olympus Optical Co Ltd
Priority to JP2859483A priority Critical patent/JPS59155807A/en
Priority to DE3406578A priority patent/DE3406578C2/en
Publication of JPS59155807A publication Critical patent/JPS59155807A/en
Priority to US06/928,730 priority patent/US4740678A/en
Priority to US07/140,537 priority patent/US4833315A/en
Publication of JPH0553241B2 publication Critical patent/JPH0553241B2/ja
Granted legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G02OPTICS
    • G02BOPTICAL ELEMENTS, SYSTEMS OR APPARATUS
    • G02B7/00Mountings, adjusting means, or light-tight connections, for optical elements
    • G02B7/28Systems for automatic generation of focusing signals
    • G02B7/34Systems for automatic generation of focusing signals using different areas in a pupil plane

Description

【発明の詳細な説明】 本発明は、顕微鏡やカメラ等の光学系に用いら
れる自動焦点検出装置であつて、異なる光路を通
つて形成された二つの像を多数の素子を配列して
成る光電変換装置により個別に光電出力信号に変
換し、該光電出力信号に基いて二つの像の相対位
置関係を検出することにより合焦検出を行うよう
にした自動焦点検出装置に関するものである。
DETAILED DESCRIPTION OF THE INVENTION The present invention is an automatic focus detection device used in optical systems such as microscopes and cameras. The present invention relates to an automatic focus detection device that performs focus detection by individually converting into photoelectric output signals using a conversion device and detecting the relative positional relationship between two images based on the photoelectric output signals.

この種従来の自動焦点検出装置には、三角測量
を応用した距離形式のものや瞳を通る光束を分割
して二つの像を得るTTL方式のものがあり、い
ずれも二つの像の合致を検出するのに二つの像に
ついてデジタル的に相関を求め、その相関値の極
道をもつて合致となし且つその合致まで二つの像
の相対移動量をもつて像の位相差量とするもので
あつた。
Conventional automatic focus detection devices of this type include a distance type that applies triangulation and a TTL type that divides the light flux passing through the pupil to obtain two images, and both detect the coincidence of the two images. In order to do this, the correlation between the two images was calculated digitally, the peak of the correlation value was taken as a match, and the amount of relative movement of the two images until the match was taken as the amount of phase difference between the images. .

第1図はその一例を示しており、図示しないイ
メージセンサーにより撮られた二つの像のデータ
A,Bはサンプルホールド回路、A−D変換器
(いずれも図示せず)等を通つてリング状のシフ
トレジスタ1a,1bに夫々記憶される。この例
では画像データを128ビツトで構成している。両
画像データA,Bが夫々シフトレジスタ1a,1
bに格納されると、続いて差の絶対値を求める回
路2により各ビツト毎の差の絶対値が求められ、
更に加算器3によつてそれらの和が求められて二
つの像の相関値となる。次に、クロツクCLから
のパルスによりシフトレジスタ1bの画像データ
Bが1ビツト分移動されて再び回路2、加算器3
により相関値が求められる。このようにして、ク
ロツクCLにより次々と一方の画像データを移動
させるたびに相関値が求められ、更にピークデイ
テクタ4によつて相関値の極値が求められ、極値
を検出した位置が合焦位置となる。又、極値の場
合のクロツク数がカウンタ5によつて求められ、
このクロツク数即ちシフトレジスタ1bの画像デ
ータBの移動量が二つの画像の位相差量となり、
これからでフオーカスの方向と量を知ることが出
来る。
Figure 1 shows an example of this, in which data A and B of two images taken by an image sensor (not shown) are passed through a sample hold circuit, an A-D converter (none of which is shown), etc., into a ring shape. are stored in shift registers 1a and 1b, respectively. In this example, the image data consists of 128 bits. Both image data A and B are stored in shift registers 1a and 1, respectively.
Once stored in bit b, the circuit 2 for calculating the absolute value of the difference calculates the absolute value of the difference for each bit.
Further, an adder 3 calculates the sum of the two images to obtain a correlation value between the two images. Next, the image data B in the shift register 1b is shifted by one bit by a pulse from the clock CL, and the circuit 2 and the adder 3 are moved again.
The correlation value is obtained by In this way, each time one of the image data is moved one after another by the clock CL, a correlation value is determined, and the peak detector 4 further determines the extreme value of the correlation value, and the position where the extreme value is detected is the same. It becomes the focal position. Further, the number of clocks in the case of an extreme value is determined by the counter 5,
This number of clocks, that is, the amount of movement of the image data B in the shift register 1b becomes the amount of phase difference between the two images.
From this, you can know the direction and amount of focus.

ところが、この従来装置では、イメージセンサ
ーが一定の大きさを有せざるを得ないためイメー
ジセンサーに写る二つの像は単に位置がずれてい
るだけでなく周辺部分が異なつたものとなり、そ
の結果二つのシフトレジスタ1a,1bに記憶さ
れる画像データA,Bも単に位置がずれているだ
けでなく端部において異なつたものとなり、而も
この一方の画像データをリング状に回転させなが
ら相関を計算するので、正確な像の位相差が求め
られ得なかつた。この点を第2図に基づき詳細に
説明すれば、a及びbはシフトレジスタ1aに格
納された画像データA及びシフトレジスタ1bに
格納された画像データBを夫々示していて、焦点
が合つていない場合両方の画像データA,Bがず
れ従つてピークP,P′もずれていると共に、両方
の画像データA,Bは端部において異なつたもの
となつている。又、cはシフトレジスタ1bの画
像データBをαビツト移動せしめたものを示して
いる。従つて、ピークP,P″が一致しているこ
とから両画像データA,Bの位相差がαビツトで
あることがわかるが、cの画像データのうち0〜
αビツトの部分はbの状態におけるβ〜127ビツ
トの部分であり、aとcの画像データは完全には
一致しない。即ち、相関の計算を0〜127ビツト
の全ての画像データについて行うと、像の位相差
が零の場合即ちピークP,P″が一致した場合に
相関の値が極値になるとは限らない。従つて、こ
の装置では正確な像の位相差を求めることは困難
である。又、この装置では画像データの移動を1
ビツドずつでしか行つていないので、大きなデフ
オーカス量を検出する場合に時間がかかつてしま
うという欠点もあつた。
However, in this conventional device, since the image sensor has to have a certain size, the two images captured on the image sensor are not only shifted in position, but also have different peripheral parts, and as a result, the two images are different. The image data A and B stored in the two shift registers 1a and 1b are not only shifted in position, but also different at the ends, and the correlation is calculated while rotating one of the image data in a ring shape. Therefore, it was not possible to obtain an accurate image phase difference. To explain this point in detail based on FIG. 2, a and b indicate image data A stored in the shift register 1a and image data B stored in the shift register 1b, respectively. If not, both image data A and B are shifted, and therefore the peaks P and P' are also shifted, and both image data A and B are different at the ends. Further, c indicates the image data B in the shift register 1b shifted by α bits. Therefore, since the peaks P and P'' match, it can be seen that the phase difference between both image data A and B is α bit, but among the image data of c, 0 to
The .alpha.-bit portion is the .beta. to 127-bit portion in state b, and the image data of a and c do not completely match. That is, when the correlation is calculated for all image data of 0 to 127 bits, the correlation value does not always reach an extreme value when the image phase difference is zero, that is, when the peaks P and P'' match. Therefore, it is difficult to obtain an accurate image phase difference with this device.Also, with this device, the movement of image data is
Since this is done only bit by bit, it also has the disadvantage that it takes time to detect a large amount of defocus.

本発明は、上記問題点に鑑み、光電変換装置の
一部の素子の光電出力信号を用いて相対位置関係
を検出すると共に、デフオーカス量が大きい場合
は該光電変換装置の複数個ずつずれた素子の光電
出力信号を用いて相対位置関係を検出するように
して、検出精度及び検出速度の大巾な向上を実現
した自動焦点検出装置を提供せんとするものであ
るが、以下第3図及至第15図に示した一実施例
に基づきこれを説明すれば、第3図は本実施例に
用いられる瞳分割法の原理を示しており、aにお
いて、6は結像レンズ、7は結像レンズ6の前側
で瞳の近傍に配設された開口7aを有する遮光
板、8は像面であり、合焦時には像面8上に像Q
が結像されるが、非合焦時には前ピン、後ピンに
対して像Qに関して各々光軸0に垂直な方向で反
対方向にずれた位置にボケた像Q1,Q2が像面8
上に形成される。bは遮光板7の開口7aを光軸
0に関して反対側に移動させた場合を示してお
り、合焦時には像面8上に像Q′が結像されるが、
非合焦時には各々前ピン、後ピンにに対応してボ
ケた像Q1′,Q2′が像面8上に形成される。従つ
て、遮光板7の開口7aを例えばaの位置からb
の位置へ移動させると、合焦時には像Q及び
Q′が同じ位置にあつて移動しないが、前ピンの
場合には像はQ1からQ1′の位置へ移動し、また後
ピンの場合にはQ2からQ2′の位置へ移動する。そ
して、8の像面上にいわゆるイメージセンサーを
設けることにより像の状態を測定できる。
In view of the above-mentioned problems, the present invention detects the relative positional relationship using photoelectric output signals of some elements of a photoelectric conversion device, and when the amount of defocus is large, a plurality of elements of the photoelectric conversion device are shifted by a plurality of elements. The purpose of this invention is to provide an automatic focus detection device that detects the relative positional relationship using the photoelectric output signal of This will be explained based on an embodiment shown in Fig. 15. Fig. 3 shows the principle of the pupil division method used in this embodiment, and in a, 6 is an imaging lens, and 7 is an imaging lens. 6 is a light shielding plate having an aperture 7a disposed near the pupil, 8 is an image plane, and when in focus, an image Q is formed on the image plane 8.
However, when out of focus, blurred images Q 1 and Q 2 are shifted in opposite directions perpendicular to the optical axis 0 with respect to the front focus and rear focus, respectively, at the image plane 8.
formed on top. b shows the case where the aperture 7a of the light shielding plate 7 is moved to the opposite side with respect to the optical axis 0, and when in focus, an image Q' is formed on the image plane 8;
When out of focus, blurred images Q 1 ' and Q 2 ' are formed on the image plane 8 corresponding to the front focus and the rear focus, respectively. Therefore, the opening 7a of the light shielding plate 7 can be moved, for example, from the position a to the position b.
If you move it to the position, the image Q and
Q′ stays at the same position and does not move, but if the front focus is on the image, the image moves from Q 1 to the Q 1 ′ position, and if the back focus is on the image, it moves from Q 2 to the Q 2 ′ position. . By providing a so-called image sensor on the image plane 8, the state of the image can be measured.

以上のことから、前ピン、後ピンの判別と、そ
の時の非合焦の量を像の移動方向とその量(すな
わち位相差)から知ることができる。
From the above, it is possible to distinguish between front focus and rear focus, and to know the amount of out-of-focus at that time from the moving direction of the image and its amount (ie, phase difference).

第4図は上記原理を顕微鏡に用いた場合の実施
例の全体図であり、51は光源、52はコンデン
サーレンズである。53はステージで、この上に
標本をのせて観察を行なう。54は対物レンズ、
55は焦点検出系へ光を導くビームスプリツタ
ー、56は接眼レンズに光の一部を導くプリズ
ム、57は接眼レンズである。58は写真用接眼
レンズ、59はフイルムである。ここまでは、普
通の顕微鏡と何ら異なるところは無い光学系であ
る。60はビームスプリツター55からの光を検
出光学系に導くリレーレンズ、61はリレーレン
ズ60と共に対物レンズ54の瞳の像を所定の位
置に形成するためのレンズ、62は該瞳の像の位
置に置かれる瞳分割器である。63は結像レンズ
で、これを通る光をフイルター64を介してイメ
ージセンサー65上に結像させる。66は瞳分割
器駆動回路、67はステージ駆動回路であり、そ
れぞれマイクロコンピユータ70によつて制御さ
れる。68はイメージセンサー駆動回路、69は
イメージセンサー65からの画像データをマイク
ロコンピユータ70に入力するインターフエイス
回路である。71は自動焦点動作を行なつたり、
合焦表示や不可能表示を行なうコンソールであ
る。相関の演算や合焦の判定等は全てマイクロコ
ンピユータ70が行なつている。相関の演算は最
近開発され市場に出ている計算専用LSIを用いる
良い。
FIG. 4 is an overall view of an embodiment in which the above principle is applied to a microscope, where 51 is a light source and 52 is a condenser lens. 53 is a stage on which the specimen is placed for observation. 54 is an objective lens;
55 is a beam splitter that guides light to the focus detection system, 56 is a prism that guides a portion of the light to an eyepiece, and 57 is an eyepiece. 58 is a photographic eyepiece lens, and 59 is a film. Up to this point, the optical system is no different from an ordinary microscope. 60 is a relay lens that guides the light from the beam splitter 55 to the detection optical system, 61 is a lens for forming an image of the pupil of the objective lens 54 at a predetermined position together with the relay lens 60, and 62 is the position of the pupil image. It is a pupil divider placed in the pupil divider. Reference numeral 63 denotes an imaging lens, and the light passing through this lens forms an image on an image sensor 65 via a filter 64. 66 is a pupil divider drive circuit, and 67 is a stage drive circuit, each of which is controlled by a microcomputer 70. 68 is an image sensor drive circuit, and 69 is an interface circuit that inputs image data from the image sensor 65 to the microcomputer 70. 71 performs automatic focus operation,
This is a console that displays in-focus and impossible indicators. The microcomputer 70 performs all correlation calculations, focus determination, etc. Correlation calculations can be performed using calculation-dedicated LSIs that have recently been developed and are on the market.

次に各部分の動作について詳述する。第5図は
二つの像を形成する為に瞳を通る光束を分割する
瞳分割器の具体的な二つの例を示しており、aは
ガラス基板に遮光部分(斜線部)を設け且つ軸0
を中心に回転させることにより瞳9を半分ずつ交
互に開閉するようにしたものであり、bは開口部
10を有した扇形のもので軸0を中心に左右に回
転させることにより瞳9を半分ずつ交互に開閉す
るようになつている。aの場合は、DCモータ等
によつて回転させつつ回転する瞳分割器による同
期信号に応じてイメージセンサーで撮像する方法
に適している。bはマイクロコンピユータ等の制
御装置に従つて瞳分割器を動かしながらそれと同
期してイメージセンサーで撮像する方法に適して
いる。かくして、以上の様な瞳分割器によつて第
3図におけるa,bの状態を作り出し、そのa,
bの状態それぞれの場合の画像データをイメージ
センサーによつて得ることが可能となる。
Next, the operation of each part will be explained in detail. Figure 5 shows two specific examples of a pupil splitter that splits the light flux passing through the pupil to form two images, and a shows a pupil splitter in which a light-shielding part (shaded part) is provided on the glass substrate and the axis is 0.
The pupil 9 is opened and closed alternately in half by rotating the pupil 9 around the axis 0, and b is a sector-shaped one with an opening 10, and by rotating left and right around the axis 0, the pupil 9 can be opened and closed in half. They are designed to open and close alternately. Case a is suitable for a method in which an image sensor is used to capture an image in response to a synchronization signal from a pupil splitter that is rotated by a DC motor or the like. b is suitable for a method in which the pupil divider is moved according to a control device such as a microcomputer and an image is captured by an image sensor in synchronization with the movement of the pupil divider. In this way, the states a and b in FIG. 3 are created using the pupil divider as described above, and the states a,
It becomes possible to obtain image data for each of the states b using the image sensor.

又、一般に合焦の対象となる被写体が標本は視
野の中心にあるとは限らないので、イメージセン
サーは視野の中心だけでなくなるべく広範囲にわ
たつていることが望ましい。しかし、視野全体を
カバーしようとするとイメージセンサーの素子数
を増やす必要がある。これは合焦精度を一定に保
つためには素子のピツチをある程度の大きさにし
なければならないところからくる。
Furthermore, since the specimen to be focused on is generally not necessarily located at the center of the field of view, it is desirable that the image sensor cover as wide a range as possible and not just at the center of the field of view. However, in order to cover the entire field of view, it is necessary to increase the number of elements in the image sensor. This comes from the fact that the pitch of the elements must be set to a certain size in order to maintain constant focusing accuracy.

この点について以下説明する。第6図は二つの
像の位相差量とデフオーカス量との関係を示す図
である。こゝでは、説明を簡単にする為に点像を
考える。13は光学系の光軸であり、後側開口数
がNA′の光学系によつて点像11が形成されてい
るとする。今デフオーカス量δdの位置にイメー
ジセンサー12があるとすると、二つの像11
A,11BはSpだけ位相差をもつて形成される
から、δdとSpの関係は δd=Sp/NA′ (1) となる。今10×の対物レンズを用いた場合の合焦
精度を考える。10×対物レンズのNAを0.40とす
るNA′は0.04となり、(1)式から δd=25Sp (2) で導かれる。一方、10×対物レンズの焦点深度t
は t=ε/NA′ (3) で表わされる(εは許容錯乱円である)から、ε
=0.05mm(20本/mmの分解能に相当)とすれば、 t=1.25mm (4) となる。この焦点深度以内の合焦検出精度が必要
であるから、 δd=1/2 (5) として δd=0.625mm (6) よつて Sp=25μm (7) となる。この程度の像の位相差量を精度良く求め
るには、イメージセンサー12のダイオードアレ
イのピツチがやはり25μm程度である必要があ
る。
This point will be explained below. FIG. 6 is a diagram showing the relationship between the amount of phase difference between two images and the amount of defocus. Here, to simplify the explanation, we will consider a point image. 13 is the optical axis of the optical system, and it is assumed that the point image 11 is formed by the optical system whose rear numerical aperture is NA'. Assuming that the image sensor 12 is now located at the position of the defocus amount δd, two images 11
Since A and 11B are formed with a phase difference of Sp, the relationship between δd and Sp is δd=Sp/NA' (1). Now let's consider the focusing accuracy when using a 10x objective lens. If the NA of the 10× objective lens is 0.40, the NA′ is 0.04, which is derived from equation (1) as δd=25Sp (2). On the other hand, the depth of focus t of the 10× objective lens
is expressed as t=ε/NA′ (3) (ε is the permissible circle of confusion), so ε
= 0.05mm (equivalent to a resolution of 20 lines/mm), then t = 1.25mm (4). Since focus detection accuracy within this depth of focus is required, δd = 1/2 (5), δd = 0.625 mm (6), and therefore Sp = 25 μm (7). In order to accurately obtain this amount of image phase difference, the pitch of the diode array of the image sensor 12 must be approximately 25 μm.

以上の様に合焦精度の要求からイメージセンサ
ー12のピツチが決定される。この場合仮に128
個のダイオードアレイを有するイメージセンサー
を用いたとすると、イメージセンサーがカバーす
る範囲は128×0.025=3.2mmとなり、これは視野
数21(視野が直径21mm)に比べて非常に小さく、
合焦の対象となる被写体をイメージセンサーの位
置(一般的には中心)に移動させて合焦を行う必
要が生じる。
As described above, the pitch of the image sensor 12 is determined based on the requirement for focusing accuracy. In this case, temporarily 128
If we use an image sensor with a diode array of
It becomes necessary to move the subject to be focused on to the position (generally the center) of the image sensor to perform focusing.

第7図は本実施例に使用したイメージセンサー
とそこにおける処理方法を示したものである。本
実施例は512個のフオトダイオードアレイを有す
るイメージセンサーを使用しているが、このイメ
ージセンサーによると512×0.025=12.8mmとな
り、視野のかなりの部分をカバーすることができ
る。しかし、全てのビツト(ダイオードアレイ)
を用いて相関演算すると非常に演算時間が長くな
るし、意味も無い。そこで512ビツトを128ビツト
の五つのブロツクa〜dに分け、その内最もコン
トラストの高いブロツクで相関の演算を行なう。
FIG. 7 shows the image sensor used in this example and the processing method used therein. This embodiment uses an image sensor having 512 photodiode arrays, which has a size of 512×0.025=12.8 mm, which can cover a considerable portion of the field of view. However, all bits (diode array)
If the correlation calculation is performed using , the calculation time will be extremely long and it will be meaningless. Therefore, the 512 bits are divided into five blocks a to d of 128 bits, and the correlation calculation is performed on the block with the highest contrast.

ここで、コントラスト計算方法の一例について
説明す。一般にコントラスト評価の評価関数とし
ては、f(x)センサーのxビツト目の出力とした場
合 C= 〓x |f(x)−f(x+1)| 又は、 C= 〓x |(f(x)−f(x+1))2 が知られている、本実施例の場合、コントラスト
の変化を精度良く知る必要のあるコントラスト法
による焦点合わせとは異なり、各ブロツク間の相
対的コントラスト強度を知れば良いから、必ずし
も隣りのビツトの差を計算する必要はない。例え
ば C= 〓x ′|f(x)−f(x+5)| とする( 〓′x はxを4つおきに計算するという意
味である)と、例えばAブロツクの計算は C=184 〓′x=64 |f(x)−f(x+5)| =|f(64)−f(69)|+…… +|f(184)−f(188)| となり、差の絶対値を31回計算しながら加算すれ
ば良いことになる。従来の計算法なら121回必要
となる。
Here, an example of a contrast calculation method will be described. Generally, as an evaluation function for contrast evaluation, when the x-th bit output of the f(x) sensor is used, C= 〓 x | f(x) - f(x+1) | or C= 〓 x | (f(x) -f(x+1)) 2 is known, and in this example, unlike focusing using the contrast method, which requires accurate knowledge of changes in contrast, it is only necessary to know the relative contrast strength between each block. Therefore, it is not necessary to calculate the difference between adjacent bits. For example, if C= 〓 x ′|f( x )−f(x+ 5 )| x=64 |f(x)-f(x+5)| =|f(64)-f(69)|+... +|f(184)-f(188)|, and the absolute value of the difference is calculated 31 times. All you have to do is add it up while calculating. With the conventional calculation method, 121 times would be required.

尚、ここで5ビツト隣りの値との差の絶対値を
4ビツトおきに計算しているのは、ただ単に隣り
の値の差の絶対値を4ビツトおきに計算するより
もコントラストの感度を良くするためである。こ
の点に関し、例えば第8図に示したイメージセン
サー上の光の強度分布lに基づき比較計算を行つ
てみると、本実施例の場合は C=|f(64)−f(69)|+|f(68)−f(73)
| =|13−30|+|25−60| =52 となるのに対し、従来の場合は C′=|f(64)−f(65)|+|f(68)−f(69
)| =|13−14|+|25−30| =6 となることから、本実施例の方が従来の場合より
コントラスト感度が良くなつている。
Note that the reason why the absolute value of the difference between 5-bit adjacent values is calculated every 4 bits is to improve the contrast sensitivity, rather than simply calculating the absolute value of the difference between adjacent values every 4 bits. It's to make things better. Regarding this point, if we perform a comparative calculation based on the light intensity distribution l on the image sensor shown in FIG. 8, for example, in the case of this example, C=|f(64)-f(69)|+ |f(68)−f(73)
| = | 13 − 30 | + | 25 − 60 | = 52, whereas in the conventional case C′ = | f (64) − f (65) | + | f (68) − f (69
) | = | 13 - 14 | + | 25 - 30 | = 6 Therefore, the contrast sensitivity of this embodiment is better than that of the conventional case.

更に、計算量を少なくする為にXビツト隣りの
値との差を求め、これをYビツトおきに計算する
場合は、X>Yが好ましい。本実施例はX=5>
4=Yである。
Further, in order to reduce the amount of calculation, when calculating the difference between X bits and the adjacent value and calculating this every Y bits, it is preferable that X>Y. In this example, X=5>
4=Y.

以上を一般式で表わすと、 C= 〓o |f(xn+z)−f(xn+z+y)| となる。即ち、n=0、1、2、…とすれば、素
子の位置はxおきに変わつていき、このxおきの
各素子に対してyだけ離れた素子との出力差を見
ることによつて、コントラストを評価することに
なるのである。但し、x、yは正の整数、zは零
または正の整数で、x>y、x≠zである。
If the above is expressed as a general formula, C= 〓o |f(xn+z)−f(xn+z+y)|. That is, if n = 0, 1, 2,..., the position of the element changes every x, and by looking at the output difference between each element at every x and the element that is separated by y. , the contrast will be evaluated. However, x and y are positive integers, z is zero or a positive integer, and x>y, x≠z.

なお、上記関数fに用いるデータは画像データ
A,Bのどちらか一方で良い。
Note that the data used for the function f may be either image data A or B.

かくして、以上の様な方法でブロツクa,b,
…,eのコントラストを計算してその内の一番コ
ントラストの良いものを選ぶが、ここで第7図か
ら明らかなようにブロツクaとbが128〜192ビツ
トで重なつているので、無駄な計算をしないよう
に64〜128ビツト、128〜192ビツト、192〜256ビ
ツトのコントラストを各々計算し、ブロツクaの
コントラストは64〜128ビツトと128〜192ビツト
のコントラストの和、ブロツクbのコントラスト
は128〜192ビツトと192〜256ビツトのコントラス
トの和としても良い。尚、ブロツクa,b,c,
d,eが各々半分ずつ重なり合つているのは、ブ
ロツクの境界に画像強度変化の著しい部分がある
場合でもその変化を含んだブロツクを設定できる
ようにする為である。例えばブロツクa,bの境
界すなわち192ビツト近辺に画像強度変化の著し
い部分があつた場合、ブロツクaあるいはブロツ
クcでは情報を全て使うことは出来ないが、ブロ
ツクbが設定されていれば情報の全てがブロツク
bに含まれることになり都合が良い。コントラス
トを求める演算は相関の演算に比べて非常に短時
間に済むので、本実施例の演算時間は128ビツト
だけの相関演算時間+α程度の時間で済む。又、
両側のそれぞれ64ビツトにブロツクを設定してい
ないのは、像をずらして相関を計算する場合に第
2図で述べたことが起こらないようにする為であ
る。
Thus, blocks a, b,
..., e and select the one with the best contrast, but as it is clear from Figure 7, blocks a and b overlap with 128 to 192 bits, so it is wasted. Calculate the contrast of 64 to 128 bits, 128 to 192 bits, and 192 to 256 bits to avoid calculations.The contrast of block a is the sum of the contrast of 64 to 128 bits and 128 to 192 bits, and the contrast of block b is the sum of the contrast of 64 to 128 bits and 128 to 192 bits. It may also be the sum of the contrasts of 128 to 192 bits and 192 to 256 bits. Furthermore, blocks a, b, c,
The reason why half of d and e overlap each other is to enable setting of a block that includes a significant change in image intensity even if there is a significant change in image intensity at the boundary of the block. For example, if there is a significant change in image intensity near the boundary between blocks a and b, i.e. around 192 bits, all of the information cannot be used in block a or block c, but if block b is set, all of the information will be used. is included in block b, which is convenient. Since the computation for determining the contrast takes a much shorter time than the computation for the correlation, the computation time in this embodiment is about 128-bit correlation computation time + α. or,
The reason why blocks are not set for each of the 64 bits on both sides is to prevent the situation described in FIG. 2 from occurring when the correlation is calculated by shifting the images.

以上のように処理を行なえば、必ずしも合焦さ
せるべき被写体や標本が視野の中心になくとも被
写体のある部分(ブロツク)が自動的に選ばれて
焦点検出が行なわれる。以上のことは特に固定的
なブロツクを定めておく必要はなく、視野の大部
分をカバーするように配設されたイメージセンサ
ーの数多くのフオトダイオードアレイの中から、
相関演算に必要なフオトダイオードアレイを含ん
だ部分をコントラスト等で選べば良い。また観察
用の視野中にマーク等を設け手動で設定するよう
にしても良い。この様にすると視野中に立体的な
標本があつても、あるいはゴミがあつても、使用
者の合わせたい被写体に焦点を合わせることがで
きる。
By performing the processing as described above, even if the subject or specimen to be focused is not necessarily in the center of the field of view, a certain part (block) of the subject is automatically selected and focus detection is performed. For the above, there is no need to define a fixed block, and from among the many photodiode arrays of the image sensor arranged to cover most of the field of view,
The portion containing the photodiode array required for the correlation calculation may be selected based on contrast or the like. Alternatively, a mark or the like may be provided in the field of view for observation and the setting may be made manually. In this way, even if there is a three-dimensional specimen or dust in the field of view, the user can focus on the subject he or she wants to focus on.

次に、全体の動作について説明する。まず、第
4図のイメージセンサー65からの二つの画像デ
ータA及びBはインターフエイス69を通してマ
イクロコンピユータ70のメモリに格納される。
そして、五つのブロツクの内最もコントラストの
高いブロツクが選択され、そのブロツクの画像デ
ータによつて相関が演算される。仮に第7図のブ
ロツクaを選択したとして話を進める。
Next, the overall operation will be explained. First, two image data A and B from the image sensor 65 in FIG. 4 are stored in the memory of the microcomputer 70 through the interface 69.
Then, the block with the highest contrast among the five blocks is selected, and the correlation is calculated using the image data of that block. Let us proceed by assuming that block a in FIG. 7 is selected.

相関演算はメモリに格納された二つの画像に対
応する画像データAと画像データBとを相対的に
1ビツトずつずらしながら計算し、何ビツト分ず
らしたら画像が重なつたかを判定して像の位相差
量を求める。相関の式は、例えば R(δ)=191x=64 ABS{fA(x)−fB(X+δ)} (8) となり、ABSは絶対値を表わし、関数fA(x)、fB(x)
は夫々画像データA,Bのxビツト目の値を表わ
している。そして、一組の関数fA、fBについてδ
を変えていつてR(δ)が最小となる時のδ即ち
δ′を位相差としている。又、この例では−64≦δ
≦64としている。このδの範囲は合焦点近くでは
狭くすることができるので、演算時間の短縮とな
る。
In the correlation calculation, image data A and image data B corresponding to two images stored in memory are calculated by relatively shifting them by 1 bit, and it is determined how many bits have to be shifted before the images overlap. Find the amount of phase difference. The correlation formula is, for example, R(δ)= 191x=64 ABS{f A (x)−f B (X+δ)} (8) where ABS represents the absolute value and the functions f A (x), f B (x)
represent the x-th bit values of image data A and B, respectively. And for a set of functions f A , f B δ
The phase difference is defined as δ, that is, δ', when R(δ) is minimized by changing . Also, in this example, −64≦δ
≦64. Since the range of δ can be narrowed near the focal point, calculation time can be shortened.

実際のδの値はイメージセンサーの1ビツトご
との値しかとらないので、さらに精度良く検出す
る為には相関の離数的な値をカーブフイテイング
等で近似して1ビツト以下の精度で像の位相差を
求める(第9図)。あるいはR(δ)が最小の時の
δ即ちδ′とその前後の三点o,p,qを用いて二
次曲線近似を行うことによつて求めることもでき
る。(第10図)。
Since the actual value of δ is only taken for each bit of the image sensor, in order to detect even more accurately, the discrete value of the correlation is approximated by curve fitting, etc. to obtain an image with an accuracy of 1 bit or less. Find the phase difference (Figure 9). Alternatively, it can also be determined by performing quadratic curve approximation using δ when R(δ) is minimum, that is, δ', and three points o, p, and q before and after it. (Figure 10).

以上の結果、視野の多くの部分をカバーし且つ
合焦の精度を維持しながら、演算時間をほとんど
増加させないで済む。
As a result of the above, it is possible to cover a large part of the field of view and maintain focusing accuracy while hardly increasing the calculation time.

上記の例ではδが−64〜64の範囲にあり、この
範囲のデフオーカス量は(6)式から0.625×64=40
mmとなり、対物側では40/102=0.4=400μmであ
るからデフオーカス量が±400μmとなる。これ
以上の広い範囲のデフオーカス量を検出範囲に入
れようとする場合、δの範囲を増やすことが考え
られるが、これは計算量が増大し好ましい。また
その様にデフオーカス量が大きい場合に上記の様
な精度の高い計算をしても意味が無い。
In the above example, δ is in the range of -64 to 64, and the defocus amount in this range is 0.625 × 64 = 40 from equation (6).
mm, and since 40/10 2 =0.4=400 μm on the objective side, the amount of defocus is ±400 μm. If it is desired to include a wider range of defocus amounts within the detection range, it may be possible to increase the range of δ, but this increases the amount of calculation and is preferable. Furthermore, when the amount of defocus is large, there is no point in performing highly accurate calculations as described above.

そこで、本実施例では画像データとして取込ん
だデータの内の数ビツトごとのデータを用いてコ
ントラストや相関の計算を実行している。具体的
には5ビツトおきにデータを用い8とすると、画
像メモリ中のデータf(0)、f(1)、f(2)、…、f
(510)、f(511)の中のf(0)、f(5)、f(10)、
…、
f(505)、f(510)が使用するデータになる考え
れば良い。実際には計算の際に5ビツトおきのデ
ータを用いるに過ぎない。例えば(8)式は R(δ)=64n=0 |fA(96+4n)−fB(96+4n+δ)| (9) の様になる。この場合は、デフオーカス量が大き
く像もぼやけて低周波成分しかないから、ブロツ
ク分けは行なつていないが、必要に応じてブロツ
ク分けをしてもよい。この場合、δの変化量即ち
1回相関演算を行なつてから次の相関演算を行な
う際の二つの画像データのずらし量も5ビツトず
つにして計算すれば、δの範囲を例えば−200≦
δ≦200とした場合でも相関計算の回数は81回と
なり少なくて済む。検出範囲は±1.25mmとなる。
Therefore, in this embodiment, contrast and correlation calculations are performed using data for every few bits of the data captured as image data. Specifically, if data is used every 5 bits to make 8, then the data in the image memory is f(0), f(1), f(2),..., f
(510), f(0), f(5), f(10) in f(511),
...,
Just think of f(505) and f(510) as the data to be used. In reality, only every fifth bit of data is used during calculation. For example, equation (8) becomes R(δ)= 64n=0 |f A (96+4n)−f B (96+4n+δ)| (9). In this case, since the amount of defocus is large and the image is blurred and has only low frequency components, it is not divided into blocks, but it may be divided into blocks if necessary. In this case, if the amount of change in δ, that is, the amount of shift between two image data when performing one correlation calculation and then the next correlation calculation, is also calculated using 5 bits each, the range of δ can be set to, for example, −200≦
Even when δ≦200, the number of correlation calculations is 81, which is small. The detection range is ±1.25mm.

以上の様に、画像データを数ビツトおきに用
い、更に相関演算を数ビツトずつずらしながら行
なうことにより計算量を増やすことなく検出範囲
を広げられる。この様にデフオーカス量の大きい
時は数ビツトごとの計算により焦点位置の近くに
合わせ、その後に前述の精度を考えた計算即ち1
ビツトごとの相関の計算さらにはカーブフイツテ
イング近似或は2次曲線近似を行なうと、合焦可
能範囲が広く且つ合焦精度の良い自動焦点検出を
行うことが出来る。
As described above, by using image data every few bits and performing the correlation calculation while shifting the bits by several bits, the detection range can be expanded without increasing the amount of calculation. In this way, when the amount of defocus is large, it is calculated every few bits to bring it close to the focal point, and then the calculation taking into consideration the accuracy mentioned above, i.e. 1
By calculating the correlation for each bit and performing curve fitting approximation or quadratic curve approximation, automatic focus detection with a wide focusable range and high focusing accuracy can be performed.

さらにデフオーカス量が大きい場合には、画像
データからコントラスト(計算量が少なくて済
む)だけを計算しつつステージを移動し、コント
ラストが一定の値になつてから相関による焦点合
わせを行なうようにすると良い。特に顕微鏡にお
いては、カメラ等に比較して物体位置の僅かなズ
レが像面で拡大されるため著しいデフオーカス状
態が発生するケースが多い。このため、相関演算
が可能な程度まで粗い焦点合わせを演算時間が短
くて済むコントラスト検出法で行ない、その後は
一度の演算で合焦位置までの移動量を算出できる
位相差法を用いることが迅速な焦点合わせのため
に有効である。又、像のコントラストを検出した
時に、コントラストが一定以上ないと相関計算が
誤つた像位相を計算する恐れもあるので、それよ
り低いコントラストの場合は計算しないなどの判
断に用いてもよい。
Furthermore, if the amount of defocus is large, it is better to move the stage while calculating only the contrast (which requires less calculation) from the image data, and then perform focusing by correlation after the contrast reaches a constant value. . Particularly in microscopes, compared to cameras and the like, a slight deviation in the position of an object is magnified on the image plane, so that a severe defocus state often occurs. For this reason, it is recommended to perform coarse focusing to the extent that correlation calculation is possible using the contrast detection method, which requires a short calculation time, and then quickly use the phase difference method, which can calculate the amount of movement to the in-focus position with a single calculation. This is effective for accurate focusing. Furthermore, when the contrast of an image is detected, if the contrast is not above a certain level, there is a risk that the correlation calculation will calculate an incorrect image phase, so it may be used to determine not to calculate if the contrast is lower than that.

尚、カメラ等対物光学系を移動して焦点合わせ
を行なう装置の場合は、光学系を駆動するのは言
うまでもない。
In the case of a device such as a camera that moves an objective optical system to perform focusing, it goes without saying that the optical system is driven.

上記の実施例の場合、瞳を通る光束を分割して
二つの像を得るので、光学系の偏芯や瞳の偏芯等
で画像データAとBの光量が異なる場合もある。
特に合焦系をアタツチメント形式にすると影響が
出やすい。また瞳位置に瞳分割器が無い場合に
は、第11図のように画像データAとBで光量に
むらが出来る。第12図は光量むらを模式的に説
明する図である。aの場合、瞳と瞳分割器が一致
しているから各像高h、i、jに対して瞳を通過
する光量は全てaに等しい。bの場合、瞳と瞳分
割器が一致していないから、各像高h、i、jに
対して瞳を通過する光量はそれぞれb、a、cと
なつて不均一となり、光量むらが生じる。
In the case of the above embodiment, since the light flux passing through the pupil is divided to obtain two images, the light amounts of image data A and B may differ due to eccentricity of the optical system, eccentricity of the pupil, etc.
This is especially likely to be the case if the focusing system is attached. Furthermore, if there is no pupil divider at the pupil position, the amount of light will be uneven between image data A and B as shown in FIG. FIG. 12 is a diagram schematically illustrating unevenness in light amount. In the case of a, since the pupil and the pupil divider coincide, the amount of light passing through the pupil for each image height h, i, and j is all equal to a. In case b, since the pupil and the pupil divider do not match, the amount of light passing through the pupil for each image height h, i, and j becomes b, a, and c, respectively, and becomes nonuniform, resulting in uneven light amount. .

以上のような光量差や光量むらがあると、画像
データAとBの二つの像の相似性が悪化し、相関
処理結果の精度が著しく低下することになる。そ
こで補正が必要となる。補正の一つの例は、イメ
ージセンサーの固定パターンノイズの除去によく
用いられている方法で、あらかじめ均一な光でイ
メージセンサーを露光しその画像データを得る。
入射光が均一であることにより画像データは固定
パターンノイズそのものであるから、その逆数に
よつて補正係数をつくれば、その後画像データに
補正係数をかけることにより固定パターンノイズ
の影響を除くことができる。本実施例の場合、合
焦光学系を通した均一な光で画像データA及びB
を得ると画像データAとBは偏芯等により第11
図の様に光量むらのあるデータとなつている。従
つて、その逆数等によつて補正係数をつくり同様
な処理を行なえば、光量むらの影響を除くことが
出来る。光量差がある場合もその光学系を通して
同様な処理を行なえば同様な効果を得ることがで
きる。付随的にはイメージセンサーの固定パター
ンノイズの除去にもなる。均一光で露光する具体
的方法としては、ステージ53上に試料をおかな
い状態での画像データを入力する方法が簡単であ
る。
If there is a difference in light amount or unevenness in light amount as described above, the similarity between the two images of image data A and B deteriorates, and the accuracy of the correlation processing result is significantly reduced. Therefore, correction is necessary. One example of correction is a method commonly used to remove fixed pattern noise from image sensors, in which image data is obtained by exposing an image sensor to uniform light in advance.
Since the image data is the fixed pattern noise itself due to the uniformity of the incident light, if a correction coefficient is created by the reciprocal of the image data, then the influence of the fixed pattern noise can be removed by multiplying the correction coefficient by the image data. . In the case of this embodiment, image data A and B are created using uniform light passing through the focusing optical system.
When obtained, image data A and B become 11th due to eccentricity etc.
As shown in the figure, the data has uneven light intensity. Therefore, by creating a correction coefficient using its reciprocal or the like and performing similar processing, the influence of uneven light amount can be removed. Even if there is a difference in light intensity, the same effect can be obtained by performing the same processing through the optical system. Incidentally, it also serves to remove fixed pattern noise from the image sensor. As a specific method for exposing with uniform light, a simple method is to input image data with no sample placed on the stage 53.

以上のように、上記の補正には一度均一光によ
るデータ入力を行なう必要がある。これはめんど
うな操作ではないが、それでも補正用のデータ入
力を行ないたくない場合は計算によつて補正する
ことも出来る。第13図はそれを説明する図で、
x軸をセンサーアレイの並び方向にy軸を画像デ
ータの強度の方向に夫々とつてある。画像データ
A,Bの値は、第12図の説明でもわかる通りあ
る一定の傾きをもつ直線と考えることが出来る。
それぞれをlA、lBとする。画像データlAの傾きを
αAとすると、画像データlAの式は、IAをlAの光量
の平均として、 y=βAx+IA となる。ここで傾きβAは光量によつて変化する
が、βA=IA/Kとなる定数kを導入することにより、 kから求めることが出来る。kはその光学系の特
性により決まるもので、あらかじめ測定しておけ
ば良い。画像データA,Bの光量の平均をIallと、
補正係数αは α=Iall/IA/Kx+IA=Iall/IA・1/x/k+1 となり、これによつて光量差の補正及び光量むら
の補正ができる。
As described above, the above correction requires data input using uniform light once. This is not a troublesome operation, but if you still do not want to input data for correction, you can also correct it by calculation. Figure 13 is a diagram explaining this.
The x-axis is aligned in the direction of arrangement of the sensor array, and the y-axis is aligned in the direction of the intensity of image data. As can be seen from the explanation of FIG. 12, the values of image data A and B can be thought of as straight lines with a certain slope.
Let them be l A and l B , respectively. When the slope of the image data l A is α A , the formula for the image data l A is y=β A x+I A , where I A is the average of the light amount of l A. Although the slope β A changes depending on the amount of light, it can be determined from k by introducing a constant k such that β A =I A /K. k is determined by the characteristics of the optical system, and can be measured in advance. The average light amount of image data A and B is I a ll,
The correction coefficient α is α=I a ll/I A /Kx+I A =I a ll/I A ·1/x/k+1, thereby making it possible to correct the light amount difference and the light amount unevenness.

以上の様に、均一光を用いたりあるいは計算す
ることで、光学系の偏芯あるいは瞳の偏芯の影響
や瞳と瞳分割器が一致していない影響を補正し除
去することが出来る。その結果、合焦の精度が向
上し、検出範囲が拡がる。更には合焦検出部をア
タツチメント形式にしても使用出来る。最も大き
な効果としては、瞳位置の異なる各種各倍率の対
物レンズが使用出来ることである。
As described above, by using uniform light or performing calculations, it is possible to correct and eliminate the effects of eccentricity of the optical system or eccentricity of the pupil, or the effects of misalignment between the pupil and the pupil divider. As a result, focusing accuracy is improved and the detection range is expanded. Furthermore, the focus detection section can also be used in the form of an attachment. The most significant effect is that objective lenses of various magnifications with different pupil positions can be used.

また、顕微鏡のように多くの種類の対物レンズ
を用いるとそれぞれの対物レンズにより瞳位置が
違うので、瞳分割器を瞳位置で全ての対物レンズ
について正しく設定することが難しい。この不具
合の解決法の一つとして瞳分割器を複数個設ける
ことが考えられる。複数の瞳分割器をそれぞれの
対物レンズの瞳位置に設けることにより瞳と瞳分
割器とを一致させる。一つの瞳分割器を使用して
いる場合、他の瞳分割器が瞳をけらないように構
成されているのは言うまでもない。。例えば第1
4図のように第5図と同じ瞳分割器を二枚連結し
たものを用いてもよい。
Furthermore, when many types of objective lenses are used, such as in a microscope, the pupil positions differ depending on each objective lens, so it is difficult to set the pupil divider correctly for all the objective lenses at the pupil positions. One possible solution to this problem is to provide a plurality of pupil dividers. By providing a plurality of pupil dividers at the pupil position of each objective lens, the pupils and the pupil dividers are made to coincide. It goes without saying that when one pupil divider is used, the other pupil dividers are configured so as not to disturb the pupil. . For example, the first
As shown in FIG. 4, the same two pupil dividers as shown in FIG. 5 connected together may be used.

第4図において、フイルター64は赤外カツト
フイルター或いはバンドパスフイルターであつ
て、イメージセンサー及び光源51等の分光感
度、分光分布が比想感度と異なるので、そのこと
による焦点ずれの現象を防ぐ役目をする。
In FIG. 4, a filter 64 is an infrared cut filter or a band pass filter, and serves to prevent the phenomenon of defocus caused by the spectral sensitivity and spectral distribution of the image sensor, light source 51, etc., which differ from the relative sensitivity. do.

以上のような自動焦点装置の制御、演算処理を
行う場合、マイクロコンピユータ及び演算処理ユ
ニツトによる方法が最も設計容易で安価である。
これについて、第15図のフローチヤートで説明
を補足する。これは最も基本的な場合を示してい
る。合焦が開始されると、まず顕微鏡の状態が合
焦動作に敵した状態になつているかをチエツク
し、対物の種類、倍率を判別する。これは、光量
むら補正の場合対物の種類及び倍率によつてパラ
メータが異なり、像位相差量をステージ移動量に
変換する変換の係数も倍率によつて違うからであ
る((1)式参照)。次に、イメージセンサーからfA
及びfBのデータを得てメモリに格納する。その
後、光量むらを補正し再びメモリに格納する。合
焦開始時は焦点が大きくずれていることがあるの
で、5ビツトおきの相関演算でおおよその焦点位
置を決定する((9)式参照)。そして、相関により
求めた像位相差量をステージ移動量に変換しステ
ージを移動する。そこで再びfA、fBのデータを
得、補正を行なう。次にコントラスト評価により
ブロツクを決定する。コントラストが一定値以上
なければ相関による結果の信頼性が少ないので、
もう一度5ビツト相関を行ないステージを焦点位
置に近づける。数回行なつてもコントラストが上
がらない場合は試料のコントラストが低ぎるので
不可能表示を行なう。コントラストが一定以上あ
れば、決定されたブロツクで相関を計算し、ステ
ージを移動して合焦する。合焦の確認としてもう
一度fA、fBを得、相関を計算する。ここで像位相
差量が焦点深度内の値であれば合焦であり、ステ
ージを移動しない。もし焦点深度外であればもう
一度同じ動作を繰り返す。
When controlling and arithmetic processing of the automatic focusing device as described above, a method using a microcomputer and arithmetic processing unit is easiest and cheapest in design.
A supplementary explanation of this will be given with the flowchart shown in FIG. This shows the most basic case. When focusing is started, it is first checked to see if the microscope is in a state suitable for focusing, and the type and magnification of the objective are determined. This is because in the case of light intensity unevenness correction, the parameters differ depending on the type of objective and the magnification, and the conversion coefficient for converting the amount of image phase difference into the amount of stage movement also differs depending on the magnification (see equation (1)). . Next, from the image sensor f A
and f B data is obtained and stored in memory. Thereafter, the unevenness in the amount of light is corrected and the image is stored in the memory again. Since the focus may be largely out of focus at the start of focusing, the approximate focus position is determined by correlation calculation every 5 bits (see equation (9)). Then, the image phase difference amount determined by the correlation is converted into a stage movement amount, and the stage is moved. Therefore, data on f A and f B is obtained again and correction is performed. Next, blocks are determined by contrast evaluation. If the contrast is not above a certain value, the reliability of the correlation results will be low.
Perform 5-bit correlation again and move the stage closer to the focal position. If the contrast does not increase even after several attempts, the contrast of the sample is too low, and an "impossible" indication is displayed. If the contrast is above a certain level, the correlation is calculated using the determined block, and the stage is moved to focus. To confirm focus, obtain f A and f B again and calculate the correlation. Here, if the image phase difference amount is within the depth of focus, the image is in focus and the stage is not moved. If it is outside the depth of focus, repeat the same operation again.

以上は最も基本的な動作を説明したもので、実
際のプログラムには試料が無かつた場合とか機械
が故障した場合のフエニル・セイフ等も考慮され
ている。
The above is an explanation of the most basic operation, and the actual program also takes into consideration phenyl safety in the case of no sample or machine failure.

また5ビツト相関から1ビツト相関に移る場合
の判定に像位相差量を用いてもよい。前例の場合
−200≦δ≦200の範囲を5つおきに計算している
が、相関R(δ)が最小値をとるδが−200≦δ′≦
200ならばその分ステージを移動した後に1ビツ
ト相関に移る。この場合判定条件をy180≦δ′≦80
のように計算したδの範囲より小さめに設定する
ほうがよい。これはデフオーカス量が大きい場合
には雑音等で誤つて最小値をとるδ′を決定するこ
とがあるからである。
Further, the amount of image phase difference may be used for determination when changing from 5-bit correlation to 1-bit correlation. In the previous example, the range of -200≦δ≦200 is calculated every 5 times, but δ where the correlation R(δ) takes the minimum value is -200≦δ′≦
If it is 200, move the stage by that amount and then move to 1-bit correlation. In this case, the judgment condition is y180≦δ′≦80
It is better to set it to a value smaller than the range of δ calculated as follows. This is because when the amount of defocus is large, δ' may be incorrectly determined to take the minimum value due to noise or the like.

第16図は第二実施例として中央処理装置以外
をハードウエアで構成した例の制御・演算回路を
示している。これについて説明すれば、まずコン
ソール71からの合焦開始信号により瞳分割器駆
動回路66が働き画像データAをイメージセンサ
ー65により得る。イメージセンサー65は瞳分
割器62と同期してセンサー駆動回路68により
撮像を開始する。この時、蓄積型イメージセンサ
ーの場合は(一般に個体撮像素子はこの型)、一
度以前に蓄積された信号を消去する為にカラ読み
出しを行なう。イメージセンサー65から連続し
て読み出される画像データAはサンプルホールド
回路31、A/Dコンバータ32、スイツチ回路
33を通つて第一メモリ34に記憶される。そし
て、図示していないメモリにあらかじめ記憶され
ている補正係数数データによつて画像データAは
補正されて再び第一メモリ34に記憶される。補
正係数データはあらかじめ均一光を入射して画像
センサーで撮像した前述の画像データの逆数にそ
の時の画像データA,Bの平均値を掛けたもので
ある。512ビツトのイメージセンターの場合を考
える。画像データA,Bは両方合わせると0〜
1023ビツトまで合計1024個となる。画像データA
は0〜511ビツト、画像データBは512〜1023ビツ
トとする。試料が無い状態での均一光で得た画像
データのnビツト目の値をxoとすると、nビツト
目の補正係数koとなる。
FIG. 16 shows a second embodiment of a control/arithmetic circuit in which components other than the central processing unit are constructed of hardware. To explain this, first, the pupil divider drive circuit 66 operates in response to a focus start signal from the console 71 and image data A is obtained by the image sensor 65. The image sensor 65 starts imaging by the sensor drive circuit 68 in synchronization with the pupil splitter 62. At this time, in the case of a storage type image sensor (solid-state image sensors are generally of this type), color readout is performed to erase previously stored signals. Image data A continuously read out from the image sensor 65 is stored in the first memory 34 through the sample hold circuit 31, A/D converter 32, and switch circuit 33. Then, the image data A is corrected using correction coefficient number data stored in advance in a memory (not shown) and stored in the first memory 34 again. The correction coefficient data is obtained by multiplying the reciprocal of the above-mentioned image data captured by the image sensor with uniform light incident thereon by the average value of the image data A and B at that time. Consider the case of a 512-bit image center. Image data A and B together are 0~
Total of 1024 pieces up to 1023 bits. Image data A
is 0 to 511 bits, and image data B is 512 to 1023 bits. If the value of the n-th bit of image data obtained with uniform light without a sample is x o , then the correction coefficient k o of the n-th bit is becomes.

次に、画像データAが第一メモリ34に格納さ
れると、瞳分割器62は画像データBを取る状態
になり画像データBは画像データAと同様にして
第二メモリ35に補正されて格納される。第一メ
モリ34に格納されたデータは第7図に示したブ
ロツクごとにコントラスト判別器36に送られ、
コントラストの高さにより用いるべきブロツクが
決定される。ブロツクbのコントラストが最も高
い場合にはアドレス指定回路37に128が与え
られる。アドレスシフト回路38には初期値−3
2が入つており、アドレス指定回路37が第一メ
モリ34の128を指定すると、アドレスシフト
回路38は第二メモリ35の96を指定する。そ
して画像データfA(128)とfB(96)が減算器39
に入力され、絶対値回路40を経て|fA(128)−
fB(96)|の演算が行なわれる。そして、加算器4
1を経てメモリ42に格納される。以上が終る
と、アドレス指定回路37はメモリ34の129
を指定し、アドレスシフト回路38はメモリ35
の97を指定し、以後同様に演算され|fA
(129)−fB(97)|は加算器41によつて前のデー
タ|fA(128)−fB(96)|に加えられてメモリ42
に格納される。以後第一メモリ34のアドレス2
55まで繰り返され、相関演算 R(−32)=255x=128 ABS{fA(x)−fB(X−32)} が完了する。この計算が完了すると、アドレスシ
フト回路38の値は−31になり、 R(−31)=255x=128 ABS{fA(x)−fB(X−31)} が計算される。そして、これはアドレスシフト回
路38の値が31になるまで続き、全体の相関演
算 R(δ)=255x=128 ABS{fA(x)−fB(X−δ)}−32≦δ≦31 が行なわれる。続いて中央処理装置43によりメ
モリ42内のR(δ)を比較し、R(δ)が最小に
なるδを見つけて像の位相差量とする。それに従
つてステージ駆動回路67を駆動しピントを合わ
せる。
Next, when the image data A is stored in the first memory 34, the pupil divider 62 becomes in a state to take the image data B, and the image data B is corrected and stored in the second memory 35 in the same manner as the image data A. be done. The data stored in the first memory 34 is sent to the contrast discriminator 36 for each block shown in FIG.
The block to be used is determined by the height of contrast. When the contrast of block b is the highest, 128 is given to the addressing circuit 37. The address shift circuit 38 has an initial value of -3.
2, and when the address designation circuit 37 designates 128 of the first memory 34, the address shift circuit 38 designates 96 of the second memory 35. Then, the image data f A (128) and f B (96) are transferred to the subtracter 39
|f A (128)−
The calculation f B (96) | is performed. And adder 4
1 and then stored in the memory 42. When the above steps are completed, the addressing circuit 37
The address shift circuit 38 specifies the memory 35
97 is specified, and thereafter it is calculated in the same way |f A
(129)−f B (97)| is added to the previous data |f A (128)−f B (96)| by the adder 41 and stored in the memory 42.
is stored in From now on, address 2 of the first memory 34
55, and the correlation calculation R(-32)= 255x=128 ABS{f A (x)-f B (X-32)} is completed. When this calculation is completed, the value of the address shift circuit 38 becomes -31, and the following is calculated: R(-31)= 255x=128 ABS{f A (x)-f B (X-31)}. This continues until the value of the address shift circuit 38 becomes 31, and the entire correlation calculation R(δ)= 255x=128 ABS{f A (x)−f B (X−δ)}−32≦ δ≦31. Next, the central processing unit 43 compares R(δ) in the memory 42, finds δ that minimizes R(δ), and uses it as the amount of phase difference of the image. Accordingly, the stage drive circuit 67 is driven to adjust the focus.

尚、デフオーカス量が大きく−32≦δ≦31の位
相差量では不足な場合は、アドレス指定回路37
は第一メモリ34の128を指定し且つアドレス
シフト回路38の初期値は−64となる。そして、
それぞれの相関計算が終るごとに2ずつ増え、 R(−64)=|fA(128)−fB(128−64)| +|fA(130)−fB(130−64)| +……+|fA(382)−fB(382−64)| +R(−62)=… 〓 R(60)=… という計算が行なわれる。これは画像データを1
ビツトおきに用いたことに相当し、同じ計算量で
像位相差の検出範囲が二倍になつている。但し合
焦精度は1/2になる。
In addition, if the amount of defocus is large and the phase difference amount of -32≦δ≦31 is insufficient, the addressing circuit 37
specifies 128 in the first memory 34, and the initial value of the address shift circuit 38 is -64. and,
It increases by 2 after each correlation calculation, R (-64) = | f A (128) - f B (128-64) | + | f A (130) - f B (130-64) | + ...+|f A (382)-f B (382-64)| +R(-62)=... 〓 R(60)=... The following calculation is performed. This converts the image data into 1
This corresponds to using every other bit, and the detection range of the image phase difference is doubled with the same amount of calculation. However, the focusing accuracy will be 1/2.

以上のように像位相差を計算しステージ駆動回
路67を駆動してピントを合わせるが、ピントを
正確に合せる為上記動作を数回繰り返しても良
い。尚、コンソール71では合焦開始や合焦表示
を行なう。
As described above, the image phase difference is calculated and the stage drive circuit 67 is driven to adjust the focus, but the above operation may be repeated several times in order to accurately adjust the focus. Note that the console 71 starts focusing and displays the focus.

上述の如く、本発明による自動焦点検出装置
は、イメージセンサーで得た画像データの一部だ
けを用いて相関演算を行うと共に、デフオーカス
量が大きい場合は画像データの複数個ずつずれた
データを用いて相関演算を行つているので、検出
精度及び検出速度が大幅に向上する。
As described above, the automatic focus detection device according to the present invention performs a correlation calculation using only a part of the image data obtained by the image sensor, and when the amount of defocus is large, it uses data shifted by multiple pieces of image data. Since the correlation calculation is performed based on the data, the detection accuracy and detection speed are greatly improved.

尚、本発明は、二つのイメージセンサーを用い
た自動焦点検出装置にも適応し得るのは言うまで
もない。
It goes without saying that the present invention can also be applied to an automatic focus detection device using two image sensors.

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

第1図は従来の自動焦点検出装置の要部回路を
示す図、第2図は上記従来例のシフトレジスタに
記憶される画像データの一例を示す図、第3図は
本発明による自動焦点検出装置の一実施例に用い
られる瞳分割法の原理を示す図、第4は上記実施
例の全体図、第5図は上記実施例に用いられる瞳
分割器の具体例を示す正面図、第6図は二つの像
の位相差量とデフオーカス量との関係を示す図、
第7図は上記実施例のイメージセンサーとそこに
おける処理方法を示す図、第8図はイメージセン
サー上の光の強度分布の一例を示す図、第9図及
び第10図は合焦点付近における精度の良い位相
差計算法を示す図、第11図は上記実施例におけ
る画像データの光量むらを示す図、第12図は光
量むらを模式的に説明する図、第13図は光量む
らの補正方法を示す図、第14図は他の瞳分割器
の斜視図、第15図は上記実施例のコンピユータ
による制御及び演算処理方法を示すフローチヤー
ト、第16図は他の実施例の制御・演算回路を示
す図である。 51……光源、52……コンデンサーレンズ、
53……ステージ、54……対物レンズ、55…
…ビームスプリツター、56……プリズム、57
……接眼レンズ、58……写真用接眼レンズ、5
9……フイルム、60……リレーレンズ、61…
…レンズ、62……瞳分割器、63……結像レン
ズ、64……フイルター、65……イメージセン
サー、66……瞳分割器駆動回路、67……ステ
ージ駆動回路、68……イメージセンサー駆動回
路、69……インターフエイス回路、70……マ
イクロコンピユーター、71……コンソール。
FIG. 1 is a diagram showing the main circuit of a conventional automatic focus detection device, FIG. 2 is a diagram showing an example of image data stored in the shift register of the conventional example, and FIG. 3 is an automatic focus detection according to the present invention. 6 is a diagram showing the principle of the pupil division method used in one embodiment of the device; FIG. 4 is an overall view of the above embodiment; FIG. 5 is a front view showing a specific example of the pupil splitter used in the above embodiment; The figure shows the relationship between the amount of phase difference between two images and the amount of defocus.
Fig. 7 is a diagram showing the image sensor of the above embodiment and the processing method therein, Fig. 8 is a diagram showing an example of the light intensity distribution on the image sensor, and Figs. 9 and 10 are accuracy near the focal point. Fig. 11 is a diagram showing the unevenness of light amount of image data in the above embodiment, Fig. 12 is a diagram schematically explaining the unevenness of light amount, and Fig. 13 is a method of correcting the unevenness of light amount. FIG. 14 is a perspective view of another pupil divider, FIG. 15 is a flowchart showing the computer control and arithmetic processing method of the above embodiment, and FIG. 16 is a control/arithmetic circuit of another embodiment. FIG. 51...Light source, 52...Condenser lens,
53...stage, 54...objective lens, 55...
...beam splitter, 56...prism, 57
...Eyepiece, 58...Photography eyepiece, 5
9...Film, 60...Relay lens, 61...
... Lens, 62 ... Pupil divider, 63 ... Imaging lens, 64 ... Filter, 65 ... Image sensor, 66 ... Pupil divider drive circuit, 67 ... Stage drive circuit, 68 ... Image sensor drive Circuit, 69...Interface circuit, 70...Microcomputer, 71...Console.

Claims (1)

【特許請求の範囲】 1 異なる光路を通つて形成された第1、第2の
二つの像を多数の素子を配列して成る光電変換装
置により光電出力信号に変換し、該光電出力信号
に基づいて二つの像の相対位置関係を検出するこ
とにより合焦検出を行なうようにした自動焦点検
出装置において、 前記多数の素子を各々が少なくとも二つ以上の
素子を含む複数のブロツクに分け、少なくとも一
方の像については前記光電変換装置の両端の素子
又は素子群以外の素子の光電出力信号を用いるよ
うにして前記二つの像の相対位置関係の検出を行
なうと共に、前記第1の像を表わす光電出力信号
と第2の像を表わす光電出力信号とを複数素子分
づつずらして比較することにより二つの像の相対
位置関係を検出しておよその焦点検出を行なう第
1のステツプと、 前記第1のステツプの後、前記第1の像を表わ
す光電出力信号に基づいて前記第1の像のコント
ラストを計算し、あらかじめ定められた所定のコ
ントラストに応じて、前記複数のブロツクのうち
一つのブロツクから得られた光電出力信号を選択
する第2のステツプと、 前記第2のステツプの後、前記第1の像を表わ
す光電出力信号のうち第2のステツプで選択され
た一つのブロツクの光電出力信号と第2の像を表
わす光電出力信号とを1素子づつずらして比較す
ることにより二つの像の相対位置関係を検出する
第3のステツプとを備えていることを特徴とする
自動焦点検出装置。 2 前記光電出力信号のうち少なくとも複数素子
おきに選んだ素子からの光電出力信号を用いて第
1のステツプを行なうことを特徴とする特許請求
の範囲1に記載の自動焦点検出装置。 3 前記第1の像のコントラストを検出するた
め、以下に示す評価関数を用いることを特徴とす
る特許請求の範囲1に記載の自動焦点検出装置。 C= 〓n |f(xn+z)−f(xn+z+y)| x>y、x≠z x、y:正の整数、z:零又は正の整数 n:0、1、2、…。
[Scope of Claims] 1. Two images, first and second, formed through different optical paths are converted into a photoelectric output signal by a photoelectric conversion device formed by arranging a large number of elements, and based on the photoelectric output signal, In an automatic focus detection device that performs focus detection by detecting the relative positional relationship between two images, the large number of elements is divided into a plurality of blocks each including at least two or more elements, and at least one Regarding the image, the relative positional relationship between the two images is detected by using the photoelectric output signals of the elements at both ends of the photoelectric conversion device or the elements other than the element group, and the photoelectric output representing the first image is detected. a first step of detecting the relative positional relationship between the two images and performing approximate focus detection by comparing the signal and the photoelectric output signal representing the second image by shifting them by a plurality of elements; After the step, the contrast of the first image is calculated based on the photoelectric output signal representing the first image, and the contrast of the first image is calculated from one of the plurality of blocks according to a predetermined contrast. a second step of selecting a photoelectric output signal of one block selected in the second step of the photoelectric output signals representative of the first image after the second step; An automatic focus detection device comprising: a third step for detecting the relative positional relationship between the two images by shifting the photoelectric output signal representing the second image one element at a time and comparing the two images. 2. The automatic focus detection apparatus according to claim 1, wherein the first step is carried out using a photoelectric output signal from at least every plurality of elements selected from among the photoelectric output signals. 3. The automatic focus detection device according to claim 1, wherein an evaluation function shown below is used to detect the contrast of the first image. C= 〓 n | f (xn + z) - f (xn + z + y) | x>y, x≠z x, y: positive integer, z: zero or positive integer n: 0, 1, 2,...
JP2859483A 1983-02-24 1983-02-24 Automatic focus detecting device Granted JPS59155807A (en)

Priority Applications (4)

Application Number Priority Date Filing Date Title
JP2859483A JPS59155807A (en) 1983-02-24 1983-02-24 Automatic focus detecting device
DE3406578A DE3406578C2 (en) 1983-02-24 1984-02-21 Automatic focus detection device
US06/928,730 US4740678A (en) 1983-02-24 1986-11-10 Automatic focus detecting device in which two objects images formed through different light paths are converted to photoelectric signals
US07/140,537 US4833315A (en) 1983-02-24 1988-01-04 Automatic focus detecting device in which two object images formed through different light paths are converted to photoelectric signals

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2859483A JPS59155807A (en) 1983-02-24 1983-02-24 Automatic focus detecting device

Publications (2)

Publication Number Publication Date
JPS59155807A JPS59155807A (en) 1984-09-05
JPH0553241B2 true JPH0553241B2 (en) 1993-08-09

Family

ID=12252913

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2859483A Granted JPS59155807A (en) 1983-02-24 1983-02-24 Automatic focus detecting device

Country Status (1)

Country Link
JP (1) JPS59155807A (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2712412B2 (en) * 1988-11-07 1998-02-10 株式会社ニコン Focus detection device
JPH07199052A (en) * 1993-12-28 1995-08-04 Olympus Optical Co Ltd Focus detecting method and distance measuring method

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5675607A (en) * 1979-11-26 1981-06-22 Ricoh Co Ltd Automatic focus detecting device
JPS56101111A (en) * 1980-01-14 1981-08-13 Mamiya Koki Kk Automatic focus adjustment method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5675607A (en) * 1979-11-26 1981-06-22 Ricoh Co Ltd Automatic focus detecting device
JPS56101111A (en) * 1980-01-14 1981-08-13 Mamiya Koki Kk Automatic focus adjustment method

Also Published As

Publication number Publication date
JPS59155807A (en) 1984-09-05

Similar Documents

Publication Publication Date Title
JPH0541965B2 (en)
US5825016A (en) Focus detection device and accompanying optical equipment
JPS62189415A (en) Focus detecting device
US4740678A (en) Automatic focus detecting device in which two objects images formed through different light paths are converted to photoelectric signals
JPH0666007B2 (en) Camera focus detector
JPH08262552A (en) Camera capable of displaying distance information
US6636699B2 (en) Focus detection device and distance measurement device
JP4468396B2 (en) Lens unit and optical apparatus having the same
JPH0553241B2 (en)
JP2007156304A (en) Camera, camera system, and interchangeable lens device
JPH09189850A (en) Automatic focusing microscope
JP3144155B2 (en) Focus detection device
JP4291052B2 (en) Interchangeable lens adjuster
JPH03196106A (en) Camera focus detector
JP3230759B2 (en) Distance measuring device
JPS59155808A (en) Automatic focus detecting device
JPH0693059B2 (en) Focus detection device
JPS63194240A (en) Automatic focus detector
JP4137717B2 (en) Interchangeable lens measuring machine
JPH08211284A (en) Focus detector
JP2558377B2 (en) Focus detection device
JP3703153B2 (en) Focus detection device
JPH0643356A (en) Focus detector
JP3427215B2 (en) Camera TTL metering device
JPH0511178A (en) Autofocusing device