JP2006308884A - Automatic focusing device - Google Patents

Automatic focusing device Download PDF

Info

Publication number
JP2006308884A
JP2006308884A JP2005131660A JP2005131660A JP2006308884A JP 2006308884 A JP2006308884 A JP 2006308884A JP 2005131660 A JP2005131660 A JP 2005131660A JP 2005131660 A JP2005131660 A JP 2005131660A JP 2006308884 A JP2006308884 A JP 2006308884A
Authority
JP
Japan
Prior art keywords
evaluation value
contrast evaluation
contrast
image information
distance
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2005131660A
Other languages
Japanese (ja)
Inventor
Kazuhito Horiuchi
一仁 堀内
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 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 Olympus Corp filed Critical Olympus Corp
Priority to JP2005131660A priority Critical patent/JP2006308884A/en
Publication of JP2006308884A publication Critical patent/JP2006308884A/en
Pending legal-status Critical Current

Links

Images

Landscapes

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

Abstract

<P>PROBLEM TO BE SOLVED: To provide an automatic focusing device capable of performing high speed and highly precise automatic focusing processing. <P>SOLUTION: A scanning system selection part 34 selects a scanning system of an image. A contrast evaluation value calculation part 26 separates image information into an odd-numbered field and an even-numbered field, calculates contrast evaluation values for every field and combines the two calculated contrast evaluation values when the scanning system is interlace. A contrast evaluation value maximum value judgment part 32 judges maximum in time series change of the contrast evaluation values. A contrast evaluation value maximum Z position calculation part 33 calculates a Z position (focal position) at which contrast of the image information becomes maximum based on a Z position corresponding to the contrast evaluation value judged as maximum. <P>COPYRIGHT: (C)2007,JPO&INPIT

Description

本発明は、観察対象物を撮像して画像情報(画像データ)を生成し、その画像情報に基づいて、観察光学系の合焦位置を自動で検出するオートフォーカス装置に関する。   The present invention relates to an autofocus device that captures an image of an observation target, generates image information (image data), and automatically detects a focus position of an observation optical system based on the image information.

被検査対象等となる観察対象物をステージに配置して観察する顕微鏡は、フォーカスを自動で合わせるオートフォーカス(AF)機能が実装されているものが多い。AF機能を実現するAF処理はアクティブ方式とパッシブ方式に大きく分かれる。アクティブ方式は顕微鏡から半導体レーザを観察対象物に照射し、反射してきた光を利用して合焦位置を見つけるものである。一方、パッシブ方式は、観察対象物の状態をCCDカメラ等で検知したものを利用して合焦位置を見つけるものである。   Many microscopes that place an observation object to be inspected or the like on a stage for observation are equipped with an autofocus (AF) function that automatically adjusts the focus. AF processing for realizing the AF function is largely divided into an active method and a passive method. In the active method, a semiconductor laser is irradiated from a microscope onto an observation object, and a focused position is found using reflected light. On the other hand, the passive method finds the in-focus position by using the object detected by the CCD camera or the like.

アクティブ方式では高速な処理を行うことができるが、半導体レーザ等の照射光源や、反射光を検知するセンサを組み込む必要があるため、顕微鏡が高価になってしまう。一方、パッシブ方式は、Z方向の移動制御を行ったり、観察対象物の観察画像を取得したりすることができれば実現可能なので、顕微鏡は安価になるが、Z方向にステージまたは観察系をステップ駆動させ、停止を確認してから画像情報(画像データ)を取得するといった動作が行われることから、処理速度が遅いという欠点がある。そこで、処理速度を改善するための方法が提案されている。   Although the active method can perform high-speed processing, it is necessary to incorporate an irradiation light source such as a semiconductor laser and a sensor that detects reflected light, which makes the microscope expensive. On the other hand, the passive method can be realized if the movement control in the Z direction can be performed or the observation image of the observation object can be acquired, so that the microscope is inexpensive, but the stage or the observation system is step-driven in the Z direction. Since the operation of acquiring the image information (image data) after confirming the stop is performed, there is a disadvantage that the processing speed is slow. Therefore, a method for improving the processing speed has been proposed.

特許文献1に記載の技術では、被検査対象を載せたステージまたは観察系をZ方向に移動させ、移動中の状態からZ位置を読み込むと同時に画像情報を取得して、画像のコントラストの度合を示すコントラスト評価値を算出するという処理を、ステージまたは観察系が、予め定められた範囲を移動している間繰り返す。その後、算出された複数のコントラスト評価値を補間してコントラスト最大Z位置を求めることによって、AF処理の高速化を図っている。   In the technique described in Patent Document 1, a stage or an observation system on which an object to be inspected is moved is moved in the Z direction, the Z position is read from the moving state, and at the same time, image information is acquired, and the degree of contrast of the image is determined. The process of calculating the contrast evaluation value shown is repeated while the stage or the observation system moves within a predetermined range. Thereafter, the AF processing is speeded up by interpolating the plurality of calculated contrast evaluation values to obtain the maximum contrast Z position.

また、特許文献2に記載の技術では、被検査対象を載せたステージまたは観察系をZ方向に駆動させながら画像情報を取得してコントラスト評価値を算出し、コントラストのピーク(極大)をとるZ位置を見つけて合焦させるようにしている。この方法では、実際のAF処理の開始前に、予め定められた計測開始点を検出した後、計測開始点にステージまたは観察系が到達したことを認識してからAF処理が開始される。   Further, in the technique described in Patent Document 2, image information is acquired while driving a stage or an observation system on which an object to be inspected is mounted in the Z direction, a contrast evaluation value is calculated, and a contrast peak (maximum) is obtained. I try to find the position and focus. In this method, after a predetermined measurement start point is detected before the actual AF process is started, the AF process is started after recognizing that the stage or the observation system has reached the measurement start point.

上記の2例の特許文献で示した方法とは異なり、かつ走査方式を考慮した方法でAF処理の高速化を図っている例もある。特許文献3では、コントラスト評価値を算出する画像として、NTSCフォーマット(インターレース)の条件下でフィールド画像情報を用いてAF処理を行う方法が示されており、観察系がZ方向に移動しながらZ位置を読みつつ、画像情報のコントラスト評価値を算出している。フレームレートの撮像装置は30フレーム/秒で画像情報を出力するため、AFの処理も最速30回/秒である。また、フィールドレートの撮像装置は60フィールド/秒で画像情報を出力できるため、AF処理が最速60回/秒で実現できる。   There is also an example in which the AF processing is speeded up by a method that considers the scanning method, which is different from the methods shown in the above two patent documents. Patent Document 3 discloses a method of performing AF processing using field image information under an NTSC format (interlace) condition as an image for calculating a contrast evaluation value, and the observation system moves in the Z direction while moving in the Z direction. While reading the position, the contrast evaluation value of the image information is calculated. Since an image pickup apparatus with a frame rate outputs image information at 30 frames / second, AF processing is also performed at a maximum speed of 30 times / second. In addition, since the field-rate imaging apparatus can output image information at 60 fields / second, AF processing can be realized at a maximum speed of 60 times / second.

これに対して、特許文献4に記載されるように、本発明の発明者は、被検査対象を載せたステージまたは観察系をZ方向に相対的に移動させながら画像情報を取得してコントラスト評価値を算出し、コントラスト評価値の極大値が見つかったところで、該当する画像情報(コントラスト極大画像情報)を出力する高速なAF処理方法を提案している。
特開2003-315684号公報 特開2003-161875号公報 特開平5-288981号公報 特開2004-62167号公報
In contrast, as described in Patent Document 4, the inventor of the present invention acquires image information while relatively moving a stage or an observation system on which an object to be inspected is placed in the Z direction, and evaluates contrast. A high-speed AF processing method is proposed in which values are calculated and the corresponding image information (contrast maximum image information) is output when the maximum value of the contrast evaluation value is found.
JP 2003-315684 A JP 2003-161875 A Japanese Patent Laid-Open No. 5-288981 JP 2004-62167 A

特許文献1および特許文献2に記載の技術において、取得される画像情報の状態については開示されていないが、例えば高倍率の観察では、ステージまたは観察系を移動する際に発生する振動が画像情報に影響することが考えられる。さらには、顕微鏡で使用されるインターレース走査方式のカメラで画像情報を取得する場合、振動の影響が、取得した画像情報に現れ、結果としてAF処理が失敗することが考えられる。   In the techniques described in Patent Document 1 and Patent Document 2, the state of acquired image information is not disclosed. For example, in high-magnification observation, vibration generated when moving a stage or an observation system is image information. It is possible to affect Furthermore, when image information is acquired with an interlace scanning camera used in a microscope, the influence of vibration appears in the acquired image information, and as a result, the AF process may fail.

例えば、Z方向に駆動するステージまたは観察系に対して、画像情報の走査線と平行方向に振動が発生する場合、プログレッシブ走査方式のカメラで画像を取得すると、振動の振幅が大きい場合に、相応のボケが発生するが、インターレース走査方式のカメラで画像を取得すると、奇数フィールドと偶数フィールドとの間に振動起因の「ずれ」が発生する。この「ずれ」は、振幅が小さくても注視すればわかるものである。この「ずれ」があると、コントラスト評価値の算出において、コントラストが大きいと誤って解釈され、結果的に本来の合焦位置とは異なる位置を合焦と判断する「偽合焦」を起こすことになる。   For example, if vibration occurs in the direction parallel to the scanning line of the image information for a stage or observation system driven in the Z direction, and if an image is acquired with a progressive scan camera, the vibration amplitude is large. However, when an image is acquired with an interlaced scanning camera, a “shift” due to vibration occurs between the odd field and the even field. This “displacement” can be understood even if the amplitude is small, if attention is paid. If there is this “deviation”, the contrast evaluation value is misinterpreted as a high contrast in the calculation of the contrast evaluation value, resulting in a “false focus” that determines that the position is different from the original focus position. become.

また、特許文献3に記載の技術では、AF処理が最速60回/秒で実現できるとしているが、フレームからフィールドにすることは、画像が本来もつ情報量を1/2にすることであり、コントラスト評価値の算出に利用する情報量を少なくして処理の高速化を行っている一方で、合焦位置の精度に課題が残る。   Further, in the technique described in Patent Document 3, AF processing can be realized at a maximum speed of 60 times / second, but changing from a frame to a field is to halve the amount of information inherent in the image. While the processing speed is increased by reducing the amount of information used to calculate the contrast evaluation value, there remains a problem in the accuracy of the in-focus position.

また、特許文献4に記載の技術では、Z位置の変化が合焦位置で停止するわけではないため、オペレータが観察する場合は、従来のステップ駆動によるAF処理を行う必要がある。さらに、画像情報の取得を行うカメラの走査方式の種類には言及されていないので、前述したように、インターレース走査方式では振動の影響が画像に反映され、偽合焦を起こす可能性がある。   Further, in the technique described in Patent Document 4, since the change in the Z position does not stop at the in-focus position, when the operator observes, it is necessary to perform the AF processing by the conventional step drive. Further, since there is no mention of the type of scanning method of the camera that acquires image information, as described above, the influence of vibration is reflected in the image in the interlace scanning method, which may cause false focusing.

さらに、従来、画像情報がカラーである場合、通常の観察とは異なる観察として、撮像系に特定の色のフィルタ(カラーフィルタ)を挿入した状態での特殊な観察がある。例えば、工業用基板(フラットパネルディスプレイ(FPD)、半導体ウェハ等)の欠陥修復検査において、波長が短い紫外域の光源を利用して欠陥を除去するレーザリペア機能を利用する場合、光学設計が紫外域に合わせて行われるため、可視域の波長では、撮像系のレンズ(対物レンズ等)の収差により、たとえ合焦していてもコントラストがはっきりした状態になるわけではなく、コントラストを強調する目的で緑色のフィルタをつけて、可視域の画像情報のコントラストを向上させることがある。   Further, conventionally, when the image information is in color, as an observation different from the normal observation, there is a special observation in a state where a filter of a specific color (color filter) is inserted in the imaging system. For example, in the defect repair inspection of industrial substrates (flat panel displays (FPD), semiconductor wafers, etc.), when using a laser repair function that removes defects using an ultraviolet light source with a short wavelength, the optical design is ultraviolet. In order to enhance the contrast at the visible wavelength, the contrast of the imaging system lens (objective lens, etc.) is not clear even if it is in focus. In some cases, a green filter may be attached to improve the contrast of visible image information.

この場合、画像全体が緑色になることから、画像情報のうち、緑色成分に関する輝度が大きくなることが予想される。そのとき、画像の中で明るい箇所では輝度が飽和する可能性があり、緑色成分の画像情報を使ってAF処理を行うと、輝度の飽和がコントラスト評価値の算出に影響を及ぼす。これによって、AF処理が誤った結果を導き出すことが考えられる。   In this case, since the entire image is green, it is expected that the luminance related to the green component in the image information is increased. At that time, there is a possibility that the luminance is saturated at a bright portion in the image. When the AF processing is performed using the image information of the green component, the luminance saturation affects the calculation of the contrast evaluation value. As a result, it is conceivable that the AF process leads to an erroneous result.

本発明は、上述した問題点に鑑みてなされたものであって、高速かつ高精度なオートフォーカス処理を行うことができるオートフォーカス装置を提供することを目的とする。   The present invention has been made in view of the above-described problems, and an object thereof is to provide an autofocus device that can perform high-speed and high-precision autofocus processing.

本発明は、上記の課題を解決するためになされたもので、観察対象物を撮像し、画像情報を生成する撮像手段と、前記観察対象物と観察光学系との間の距離を変化させる移動制御手段と、前記距離を検出する検出手段と、画像の走査方式を指定する走査方式指定手段と、指定された前記画像の走査方式に合わせ、前記画像情報のコントラストの度合を示すコントラスト評価値を算出し、算出した前記コントラスト評価値を合成して前記画像情報の前記コントラスト評価値とする評価値算出手段と、前記距離と、前記評価値算出手段によって算出された前記コントラスト評価値とを対応させて記憶する記憶手段と、前記記憶手段に記憶されている前記コントラスト評価値の時系列変化における極大を判定する判定手段と、前記判定手段によって極大と判定された前記コントラスト評価値に対応する前記距離に基づいて、画像のコントラストが極大となる距離を算出する距離算出手段とを備えたことを特徴とするオートフォーカス装置である。   The present invention has been made in order to solve the above-described problem, and is an image capturing unit that captures an image of an observation object and generates image information, and a movement that changes a distance between the observation object and the observation optical system. A contrast evaluation value indicating the degree of contrast of the image information in accordance with the control means, the detection means for detecting the distance, the scanning method specifying means for specifying the scanning method of the image, and the specified scanning method of the image; An evaluation value calculating unit that calculates and combines the calculated contrast evaluation values to obtain the contrast evaluation value of the image information, and associates the distance with the contrast evaluation value calculated by the evaluation value calculating unit. A storage unit that stores the determination result, a determination unit that determines a local maximum in the time series change of the contrast evaluation value stored in the storage unit, and the determination unit Based on the distance corresponding to the contrast evaluation value is determined to a large autofocusing apparatus characterized by comprising a distance calculating means for calculating the distance the contrast of the image is maximized.

また、本発明のオートフォーカス装置において、前記評価値算出手段は、前記走査方式指定手段によって指定された前記走査方式がインターレースの場合には、前記画像情報を奇数フィールドと偶数フィールドに分離して、前記コントラスト評価値をフィールド毎に算出し、算出した前記コントラスト評価値を合成して前記画像情報の前記コントラスト評価値とすることを特徴とする。   Further, in the autofocus device of the present invention, the evaluation value calculation means separates the image information into odd fields and even fields when the scanning method designated by the scanning method designation means is interlaced, The contrast evaluation value is calculated for each field, and the calculated contrast evaluation value is combined to obtain the contrast evaluation value of the image information.

また、本発明は、観察対象物を撮像し、画像情報を生成する撮像手段と、前記観察対象物と観察光学系との間の距離を変化させる移動制御手段と、前記距離を検出する検出手段と、前記コントラスト評価値の算出に用いる前記画像情報の色情報を指定する色情報指定手段と、前記色情報指定手段によって指定された色情報で構成される画像データを用いて、前記画像情報のコントラストの度合を示すコントラスト評価値を算出する評価値算出手段と、前記距離と、前記評価値算出手段によって算出された前記コントラスト評価値とを対応させて記憶する記憶手段と、前記記憶手段に記憶されている前記コントラスト評価値の時系列変化における極大を判定する判定手段と、前記判定手段によって極大と判定された前記コントラスト評価値に対応する前記距離に基づいて、画像のコントラストが極大となる距離を算出する距離算出手段とを備えたことを特徴とするオートフォーカス装置である。   Further, the present invention provides an imaging unit that images an observation object and generates image information, a movement control unit that changes a distance between the observation object and the observation optical system, and a detection unit that detects the distance. Color information specifying means for specifying color information of the image information used for calculating the contrast evaluation value, and image data composed of the color information specified by the color information specifying means. Evaluation value calculating means for calculating a contrast evaluation value indicating the degree of contrast, storage means for storing the distance and the contrast evaluation value calculated by the evaluation value calculating means in association with each other, and storing in the storage means Determination means for determining a local maximum in the time series change of the contrast evaluation value, and the contrast evaluation value determined to be maximum by the determination means. Based on the distance to an automatic focusing apparatus characterized by comprising a distance calculating means for calculating a distance that the contrast of the image is maximized.

また、本発明のオートフォーカス装置において、前記移動制御手段は、前記記憶手段によって記憶されている前記コントラスト評価値の時系列変化に基づいて、前記観察対象物と前記観察光学系との間の前記距離の変化の速度を制御することを特徴とする。   In the autofocus device according to the aspect of the invention, the movement control unit may be configured such that the movement between the observation object and the observation optical system is based on a time series change of the contrast evaluation value stored in the storage unit. It is characterized by controlling the speed of change of distance.

また、本発明のオートフォーカス装置において、前記移動制御手段は、前記評価値算出手段が前記コントラスト評価値の算出に要する時間の変化に基づいて、前記観察対象物と前記観察光学系との間の前記距離の変化の速度を制御することを特徴とする。   In the autofocus device according to the aspect of the invention, the movement control unit may determine whether the evaluation value calculation unit between the observation object and the observation optical system is based on a change in time required for the calculation of the contrast evaluation value. The speed of the change of the distance is controlled.

また、本発明のオートフォーカス装置において、前記移動制御手段は、前記観察光学系から推定される焦点深度と、前記評価値算出手段が前記コントラスト評価値の算出に要する時間とに基づいて、前記観察対象物と前記観察光学系との間の前記距離の変化の初速度を設定することを特徴とする。   In the autofocus device according to the aspect of the invention, the movement control unit may perform the observation based on the depth of focus estimated from the observation optical system and the time required for the evaluation value calculation unit to calculate the contrast evaluation value. An initial speed of the change in the distance between the object and the observation optical system is set.

また、本発明のオートフォーカス装置において、前記判定手段は、最新の前記コントラスト評価値が、前記記憶手段によって記憶されている前記コントラスト評価値の中の最大値に対して所定の割合以下となったとき、または/および前記最大値が算出されてから、所定の回数連続して前記コントラスト評価値が減少したときに、前記最大値をとる前記コントラスト評価値が極大であると判断することを特徴とする。   In the autofocus device according to the aspect of the invention, the determination unit may determine that the latest contrast evaluation value is equal to or less than a predetermined ratio with respect to the maximum value among the contrast evaluation values stored in the storage unit. Or / and when the contrast evaluation value decreases continuously for a predetermined number of times after the maximum value is calculated, the contrast evaluation value taking the maximum value is determined to be maximal. To do.

また、本発明のオートフォーカス装置において、前記距離算出手段は、極大と判定された前記コントラスト評価値の前後に取得された前記コントラスト評価値と、各々の前記コントラスト評価値に対応する前記距離を前記記憶手段から読み出し、読み出した前記コントラスト評価値を補間することによって推定される近似関数に基づいて、画像のコントラストが極大となる前記距離を算出することを特徴とする。   Further, in the autofocus device of the present invention, the distance calculating means calculates the contrast evaluation values acquired before and after the contrast evaluation value determined to be maximal, and the distance corresponding to each of the contrast evaluation values. The distance at which the contrast of the image is maximized is calculated on the basis of an approximation function estimated by interpolating the contrast evaluation value read out from the storage means.

また、本発明のオートフォーカス装置において、前記検出手段が前記距離を検出した第1のタイミングと、前記評価値算出手段が前記コントラスト評価値を算出した第2のタイミングとを取得するタイミング取得手段をさらに備え、前記記憶手段は、前記タイミング取得手段によって取得された前記第1のタイミングを前記距離に対応付けて記憶すると共に、前記第2のタイミングを前記コントラスト評価値に対応付けて記憶することを特徴とする。   In the autofocus device of the present invention, timing acquisition means for acquiring a first timing at which the detection means detects the distance and a second timing at which the evaluation value calculation means calculates the contrast evaluation value. In addition, the storage means stores the first timing acquired by the timing acquisition means in association with the distance, and stores the second timing in association with the contrast evaluation value. Features.

また、本発明のオートフォーカス装置において、前記色情報指定手段は、前記画像情報の色相から、最も頻度の多い色の補色に対応する色情報を指定することを特徴とする。   In the autofocus device of the present invention, the color information designating unit designates color information corresponding to a complementary color of the most frequent color from the hue of the image information.

本発明によれば、観察対象物と観察光学系との間の距離を変化させながら取得した画像のコントラストを評価してオートフォーカス処理を行うので、高速なオートフォーカス処理を行うことができるという効果が得られる。また、画像の走査方式がインターレース方式である場合に、フィールド別にコントラスト評価値を算出して合成することによって、振動起因の画像の「ずれ」の影響を抑えて、高精度なオートフォーカス処理を行うことができるという効果が得られる。さらに、画像中の特定の色情報を用いてコントラスト評価値を算出することによって、色の影響を最小限にした高精度なオートフォーカス処理を行うことができるという効果が得られる。   According to the present invention, since the autofocus process is performed by evaluating the contrast of the acquired image while changing the distance between the observation object and the observation optical system, it is possible to perform a high-speed autofocus process. Is obtained. In addition, when the image scanning method is an interlace method, high-precision autofocus processing is performed by suppressing the influence of image “deviation” due to vibration by calculating and synthesizing contrast evaluation values for each field. The effect that it can be obtained. Furthermore, by calculating the contrast evaluation value using specific color information in the image, there is an effect that it is possible to perform highly accurate autofocus processing with minimal influence of color.

以下、図面を参照し、本発明を実施するための最良の形態について説明する。本実施形態におけるAF処理は、画像情報(画像データ)を用いたAF処理であり、例えば被検査対象等の観察対象物または観察系をZ方向に駆動させて画像情報を取得し、エッジ等のようなコントラストを表す評価値(コントラスト評価値)を画像情報から算出し、コントラスト評価値が極大となるZ位置に検査対象物または観察系を移動させることによって、合焦位置を得るようにしている。   The best mode for carrying out the present invention will be described below with reference to the drawings. The AF process in the present embodiment is an AF process using image information (image data). For example, an observation target such as an inspection target or an observation system is driven in the Z direction to acquire image information, and an edge or the like is acquired. An evaluation value representing the contrast (contrast evaluation value) is calculated from the image information, and the in-focus position is obtained by moving the inspection object or the observation system to the Z position where the contrast evaluation value is maximized. .

図1は、本発明の第1の実施形態による検査装置の構成を示す概略構成図である。本実施形態による検査装置には顕微鏡が搭載され、顕微鏡に付随して、本発明のオートフォーカス(AF)処理を行うオートフォーカス(AF)装置が搭載されている。図1において、AF装置12は、XYZステージ1のZ方向の移動を制御する移動制御部3と、コントラスト評価値や合焦位置の演算等を行う演算部13とから構成される。本実施形態においては、本発明のオートフォーカス装置を液晶等のフラットパネルディスプレイ(FPD)の基板や半導体ウェハ等の基板検査装置もしくはレーザリペア装置へ適用した例を用いて説明を行うが、オートフォーカス装置の適用はこれに限定されるわけではない。   FIG. 1 is a schematic configuration diagram showing the configuration of the inspection apparatus according to the first embodiment of the present invention. The inspection apparatus according to the present embodiment is equipped with a microscope, and an autofocus (AF) apparatus that performs the autofocus (AF) process of the present invention is mounted along with the microscope. In FIG. 1, the AF device 12 includes a movement control unit 3 that controls movement of the XYZ stage 1 in the Z direction, and a calculation unit 13 that calculates a contrast evaluation value and a focus position. In the present embodiment, the autofocus device according to the present invention will be described using an example in which the autofocus device is applied to a flat panel display (FPD) substrate such as a liquid crystal, a substrate inspection device such as a semiconductor wafer, or a laser repair device. The application of the apparatus is not limited to this.

XYZステージ1上には、被検査対象として例えばFPDガラス基板2(観察対象物)が載置されている。XYZステージ1は、X方向、Y方向、Z方向にそれぞれステージを移動させる直流または交流のX方向モータ、Y方向モータ、Z方向モータを有する。X方向、Y方向、Z方向の各モータは等速度駆動とマイクロステップ駆動を可能とする。XYZステージ1は、AF装置12内の移動制御部3から出力される移動指示を受けて、駆動制御される。移動制御部3は、XYZステージ1に対して、Z方向への上昇または下降の移動指示を出力する。   On the XYZ stage 1, for example, an FPD glass substrate 2 (observation object) is placed as an object to be inspected. The XYZ stage 1 includes a direct current or alternating current X direction motor, a Y direction motor, and a Z direction motor that move the stage in the X direction, the Y direction, and the Z direction, respectively. Each motor in the X direction, the Y direction, and the Z direction enables constant speed driving and microstep driving. The XYZ stage 1 is driven and controlled in response to a movement instruction output from the movement control unit 3 in the AF device 12. The movement control unit 3 outputs an instruction to move up or down in the Z direction to the XYZ stage 1.

XYZステージ1は、Z方向の移動指示を受けたときに、Z方向モータの駆動によって、等速で連続的に、または所定のピッチでZ方向に上昇または下降する。これと共に移動制御部3は、連続して上昇または下降するXYZステージ1の高さ情報(Z位置)を検出する。XYZステージ1の上方には観察光学系4を介してカラーの画像情報を得るためのCCDカメラ5が設けられている。なお、本実施形態においては、XYZステージ1が駆動され、Z方向に移動するとしているが、観察光学系4がZ方向に移動してもよい。いずれにせよ、観察対象物と観察光学系4との間の距離(間隔)を変更可能なように検査装置が構成されていればよい。   When receiving an instruction to move in the Z direction, the XYZ stage 1 is raised or lowered in the Z direction continuously at a constant speed or at a predetermined pitch by driving the Z direction motor. At the same time, the movement control unit 3 detects the height information (Z position) of the XYZ stage 1 that is continuously raised or lowered. Above the XYZ stage 1 is provided a CCD camera 5 for obtaining color image information via an observation optical system 4. In the present embodiment, the XYZ stage 1 is driven and moved in the Z direction, but the observation optical system 4 may move in the Z direction. In any case, it is only necessary that the inspection apparatus is configured so that the distance (interval) between the observation object and the observation optical system 4 can be changed.

観察光学系4は、光軸p上に配置される対物レンズ6およびリレーレンズ7,8を有する。照明装置9から出力される照明光は照明用リレーレンズ10を介してハーフミラー11に入射する。ハーフミラー11は、観察光学系4の光軸p上に設けられている。これにより、照明装置9から出力された照明光は、ハーフミラー11で下方に反射され、リレーレンズ7および対物レンズ6を通ってFPDガラス基板2上に照射される。CCDカメラ5は、XYZステージ1上に載置されているFPDガラス基板2を撮像して画像情報を生成し、AF装置12へ出力する。   The observation optical system 4 has an objective lens 6 and relay lenses 7 and 8 arranged on the optical axis p. The illumination light output from the illumination device 9 enters the half mirror 11 via the illumination relay lens 10. The half mirror 11 is provided on the optical axis p of the observation optical system 4. As a result, the illumination light output from the illumination device 9 is reflected downward by the half mirror 11, and is irradiated onto the FPD glass substrate 2 through the relay lens 7 and the objective lens 6. The CCD camera 5 images the FPD glass substrate 2 placed on the XYZ stage 1 to generate image information and outputs it to the AF device 12.

CCDカメラ5から出力される画像情報は、複数の色に関する輝度情報(以降、色別画像情報と称す)から構成され、例えば、R(赤)、G(緑)、B(青)の3つの色別画像情報からなるものとする。出力された画像情報はAF装置12内の演算部13に入力される。演算部13において、後述するAF処理を始めとする各種の演算が行われる。ディスプレイ14にはCCDカメラ5からの画像情報が、演算部13を介して入力され、ディスプレイ14は、画像情報に基づいて画像を表示する。   Image information output from the CCD camera 5 is composed of luminance information relating to a plurality of colors (hereinafter referred to as color-specific image information). For example, three pieces of information R (red), G (green), and B (blue) are included. It is assumed that it consists of color-specific image information. The output image information is input to the calculation unit 13 in the AF device 12. The calculation unit 13 performs various calculations including an AF process described later. Image information from the CCD camera 5 is input to the display 14 via the calculation unit 13, and the display 14 displays an image based on the image information.

図2は、本実施形態によるAF装置12の内部構成を示すブロック図である。図2においては、移動制御部3および演算部13のそれぞれの構成が図示されている。移動制御部3において、駆動モータ用パルス出力部21は、XYZステージ1が有するZ方向モータを駆動するためのパルスをXYZステージ1へ出力する。本実施形態では、単位時間あたりのパルス数をZ方向モータ駆動のパルスとして定義する。パルスを変更することによって、Z方向モータの速度、すなわちXYZステージ1のZ方向への移動速度を変更することができる。   FIG. 2 is a block diagram showing an internal configuration of the AF apparatus 12 according to the present embodiment. In FIG. 2, the respective configurations of the movement control unit 3 and the calculation unit 13 are illustrated. In the movement control unit 3, the drive motor pulse output unit 21 outputs a pulse for driving the Z-direction motor of the XYZ stage 1 to the XYZ stage 1. In the present embodiment, the number of pulses per unit time is defined as pulses for driving the Z direction motor. By changing the pulse, the speed of the Z direction motor, that is, the moving speed of the XYZ stage 1 in the Z direction can be changed.

駆動モータ用パルス出力部21にはパルスを制御する信号がCPU24から入力され、この信号に基づいて駆動モータ用パルス出力部21は、XYZステージ1が有するZ方向モータへ出力するパルスを制御する。駆動モータ用パルス読み取り部22は、XYZステージ1が有するZ方向モータの現在のパルス数を読み取る。Z位置算出部23は、駆動モータ用パルス出力部21に出力されるCPU24からのパルス数の指示情報、または駆動モータ用パルス読み取り部22が読み取ったパルス数を用いて、FPDガラス基板2と観察光学系4との間の距離に対応した現在のZ位置を算出する。   A signal for controlling the pulse is input to the drive motor pulse output unit 21 from the CPU 24, and the drive motor pulse output unit 21 controls a pulse output to the Z direction motor of the XYZ stage 1 based on this signal. The drive motor pulse reading unit 22 reads the current number of pulses of the Z direction motor of the XYZ stage 1. The Z position calculation unit 23 uses the pulse number instruction information from the CPU 24 output to the drive motor pulse output unit 21 or the pulse number read by the drive motor pulse reading unit 22 to observe the FPD glass substrate 2. A current Z position corresponding to the distance to the optical system 4 is calculated.

演算部13において、CPU24は演算部13全体の処理の制御を行う。カメラ画像取り込み部25は、CCDカメラ5から出力された画像情報を取り込む。コントラスト評価値算出部26は、カメラ画像取り込み部25によって取り込まれた画像から、後述する方法によりコントラスト評価値を算出する。経過時間計測用カウンタ部27は、経過時間に関するカウンタであり、任意のタイミングでの初期化が可能である。   In the calculation unit 13, the CPU 24 controls processing of the entire calculation unit 13. The camera image capturing unit 25 captures image information output from the CCD camera 5. The contrast evaluation value calculation unit 26 calculates a contrast evaluation value from the image captured by the camera image capturing unit 25 by a method described later. The elapsed time measurement counter unit 27 is a counter related to elapsed time, and can be initialized at an arbitrary timing.

カウンタ読み取り部28は、経過時間計測用カウンタ部27のカウンタの値を読み取る。このカウンタの値は、Z位置算出部23によるZ位置の算出のタイミングや、コントラスト評価値算出部26によるコントラスト評価値の算出のタイミング(より具体的にはコントラスト評価値の算出に用いられる画像情報の取得のタイミング)を示す情報として利用されるものである。Z位置記憶部29は、Z位置算出部23によって算出されたZ位置を記憶するためのメモリである。カウンタ記憶部30は、カウンタ読み取り部28によって読み取られたカウンタの値を記憶するためのメモリである。コントラスト評価値記憶部31は、コントラスト評価値算出部26によって算出されたコントラスト評価値を記憶するためのメモリである。   The counter reading unit 28 reads the value of the counter of the elapsed time measuring counter unit 27. The value of the counter is calculated based on the Z position calculation timing by the Z position calculation section 23 and the contrast evaluation value calculation timing by the contrast evaluation value calculation section 26 (more specifically, image information used for calculating the contrast evaluation value). This is used as information indicating the timing of acquisition. The Z position storage unit 29 is a memory for storing the Z position calculated by the Z position calculation unit 23. The counter storage unit 30 is a memory for storing the counter value read by the counter reading unit 28. The contrast evaluation value storage unit 31 is a memory for storing the contrast evaluation value calculated by the contrast evaluation value calculation unit 26.

コントラスト評価値極大値判定部32は、複数のコントラスト評価値を用いて、現時点での最大値が極大値として妥当であるか否かを判定する。コントラスト評価値極大Z位置算出部33は、コントラスト評価値極大値判定部32によって、極大値が妥当であると判定された場合に、極大値に対応するZ位置(合焦位置)を算出する。走査方式選択部34は、CCDカメラ5から出力される画像情報の走査方式を選択する。本実施形態ではインターレース走査方式とプログレッシブ走査方式のいずれかを選択できるものとする。走査方式の検出は、例えば画像情報から走査方式を検出したり、トリガー信号の間隔を検出したりすることによって行われる。色情報選択部35は、カメラ画像取り込み部25によって取り込まれた画像情報に基づいて、コントラスト評価値算出部26で使用される画像情報の色を選択する。本実施形態ではR(赤)、G(緑)、B(青)、C(シアン)、M(マゼンダ)、Y(黄)、K(グレースケール)、A(全ての色)のいずれかを選択できるものとする。   The contrast evaluation value maximum value determination unit 32 determines whether or not the current maximum value is appropriate as the maximum value using a plurality of contrast evaluation values. The contrast evaluation value maximum Z position calculation unit 33 calculates the Z position (focus position) corresponding to the maximum value when the contrast evaluation value maximum value determination unit 32 determines that the maximum value is appropriate. The scanning method selection unit 34 selects a scanning method for image information output from the CCD camera 5. In the present embodiment, it is assumed that either an interlace scanning method or a progressive scanning method can be selected. The scanning method is detected by, for example, detecting a scanning method from image information or detecting an interval between trigger signals. The color information selection unit 35 selects the color of the image information used by the contrast evaluation value calculation unit 26 based on the image information captured by the camera image capture unit 25. In the present embodiment, one of R (red), G (green), B (blue), C (cyan), M (magenta), Y (yellow), K (grayscale), and A (all colors) is set. It shall be selectable.

次に、上述した構成による処理の流れを示す。まず、CPU24からカウンタ読み取り部28を経由して、経過時間計測用カウンタ部27が初期化される。これと同時に、CPU24は、駆動モータ用パルス出力部21にXYZステージ1のZ方向モータの駆動開始を指示する。すなわち、経過時間計測用カウンタ部27ではZ方向モータの駆動開始の時点からの経過時間がカウントされる。   Next, the flow of processing by the above-described configuration is shown. First, the elapsed time measuring counter unit 27 is initialized from the CPU 24 via the counter reading unit 28. At the same time, the CPU 24 instructs the drive motor pulse output unit 21 to start driving the Z direction motor of the XYZ stage 1. That is, the elapsed time measuring counter unit 27 counts the elapsed time from the start of driving the Z-direction motor.

続いて、CPU24は、Z位置算出部23を経由して駆動モータ用パルス読み取り部22に現在のZ方向モータのパルス数の読み取りを指示する。これと同時に、カウンタ読み取り部28は経過時間計測用カウンタ部27から、現在の経過時間を表すカウンタの値を読み取る。駆動モータ用パルス読み取り部22で読み取られたパルス数はZ位置算出部23へ出力される。Z位置算出部23は、読み取られたパルス数に対応するZ位置を算出する。Z位置算出部23によって算出されたZ位置、およびカウンタ読み取り部28によって読み取られたカウンタの値はそれぞれZ位置記憶部29およびカウンタ記憶部30に格納される。その際、Z位置とカウンタの値との時間関係に関して整合がとれるように、例えばカウンタ記憶部30に格納されるカウンタの値としてZ位置用およびコントラスト評価値用の2種類を用意して、Z位置およびコントラスト評価値の各々の算出が行われたときのカウンタの値が識別可能に記憶されるようにする。   Subsequently, the CPU 24 instructs the drive motor pulse reading unit 22 to read the current pulse number of the Z direction motor via the Z position calculation unit 23. At the same time, the counter reading unit 28 reads a counter value representing the current elapsed time from the elapsed time measuring counter unit 27. The number of pulses read by the drive motor pulse reading unit 22 is output to the Z position calculation unit 23. The Z position calculation unit 23 calculates a Z position corresponding to the read number of pulses. The Z position calculated by the Z position calculation unit 23 and the counter value read by the counter reading unit 28 are stored in the Z position storage unit 29 and the counter storage unit 30, respectively. At this time, for example, two types of values for the Z position and the contrast evaluation value are prepared as counter values stored in the counter storage unit 30 so that the time relationship between the Z position and the counter value can be matched. The counter value when each calculation of the position and contrast evaluation value is performed is stored so as to be identifiable.

続いて、CPU24は、コントラスト評価値算出部26を経由してカメラ画像取り込み部25に画像情報の取得を指示する。これと同時に、カウンタ読み取り部28は、経過時間計測用カウンタ部27から現在の経過時間を表すカウンタの値を読み取る。CCDカメラ5からカメラ画像取り込み部25に取り込まれた画像はコントラスト評価値算出部26へ出力される。コントラスト評価値算出部26は、画像情報に基づいて、画像のコントラストの度合を示すコントラスト評価値を算出する。   Subsequently, the CPU 24 instructs the camera image capturing unit 25 to acquire image information via the contrast evaluation value calculating unit 26. At the same time, the counter reading unit 28 reads a counter value indicating the current elapsed time from the elapsed time measuring counter unit 27. The image captured from the CCD camera 5 to the camera image capturing unit 25 is output to the contrast evaluation value calculating unit 26. The contrast evaluation value calculation unit 26 calculates a contrast evaluation value indicating the degree of contrast of the image based on the image information.

コントラスト評価値の算出は、走査方式選択部34からコントラスト評価値算出部26へ出力された走査方式の情報を考慮し、かつ画像情報の中から、色情報選択部35によって選択された色に該当する色別画像情報(色情報)を用いて行われる。コントラスト評価値算出部26によって算出されたコントラスト評価値、およびカウンタ読み取り部28で読み取られたカウンタの値はそれぞれコントラスト評価値記憶部31およびカウンタ記憶部30に記憶される。その際、前記したZ位置を記憶するときと同様に、コントラスト評価値とカウンタの値との時間関係に関して整合がとれるようにする。   The calculation of the contrast evaluation value corresponds to the color selected by the color information selection unit 35 from the image information in consideration of the scanning method information output from the scanning method selection unit 34 to the contrast evaluation value calculation unit 26. This is performed using color-specific image information (color information). The contrast evaluation value calculated by the contrast evaluation value calculation unit 26 and the counter value read by the counter reading unit 28 are stored in the contrast evaluation value storage unit 31 and the counter storage unit 30, respectively. At this time, as in the case of storing the Z position described above, the time relationship between the contrast evaluation value and the counter value is matched.

コントラスト評価値算出部26によって算出されたコントラスト評価値がコントラスト評価値記憶部31に記憶されると、コントラスト評価値極大値判定部32はコントラスト評価値記憶部31に記憶されたコントラスト評価値の中で、時系列変化における極大値として妥当な値が存在するか否かを判定する。妥当な極大値の判定基準としては、例えばコントラスト評価値記憶部31に記憶されたコントラスト評価値の中に最大値が存在し、時系列でコントラスト評価値を見たときに、最新のコントラスト評価値が最大値に対して所定の割合以下(例えば70%未満)となったとき、または最大値が算出された時点以降に算出されたコントラスト評価値が3回連続して単調減少したとき等に、最大値をとるコントラスト評価値が妥当な極大値であると判断することとする。あるいは、上記の2つの条件が共に満たされた場合に、最大値をとるコントラスト評価値が妥当な極大値であると判断してもよい。コントラスト評価値の極大値が妥当でないと判断された場合は、再度Z位置の取得およびコントラスト評価値の算出が行われた後に、判定が行われる。   When the contrast evaluation value calculated by the contrast evaluation value calculation unit 26 is stored in the contrast evaluation value storage unit 31, the contrast evaluation value maximum value determination unit 32 includes the contrast evaluation values stored in the contrast evaluation value storage unit 31. Thus, it is determined whether or not there is a reasonable value as the maximum value in the time series change. As a criterion for determining an appropriate maximum value, for example, there is a maximum value among the contrast evaluation values stored in the contrast evaluation value storage unit 31, and when the contrast evaluation value is viewed in time series, the latest contrast evaluation value is obtained. Is less than a predetermined ratio with respect to the maximum value (for example, less than 70%), or when the contrast evaluation value calculated after the time when the maximum value is calculated decreases monotonously three times continuously, etc. It is determined that the contrast evaluation value that takes the maximum value is a reasonable maximum value. Alternatively, when both of the above two conditions are satisfied, it may be determined that the contrast evaluation value that takes the maximum value is a reasonable maximum value. If it is determined that the maximum value of the contrast evaluation value is not appropriate, the determination is performed after obtaining the Z position and calculating the contrast evaluation value again.

コントラスト評価値極大値判定部32は、コントラスト評価値の極大値を決定した(妥当と判断した)場合、CPU24に極大値の決定を通知する。CPU24はコントラスト評価値極大値判定部32からの通知を受けて、現在駆動中のXYZステージ1のZ方向モータを停止する指示を駆動モータ用パルス出力部21へ出力する。Z方向モータの停止指示は、CPU24から駆動モータ用パルス出力部21を経由してXYZステージ1に出力される。これと同時にCPU24は、カウンタ読み取り部28を経由して経過時間計測用カウンタ部27に動作停止を指示する。指示を受けた経過時間計測用カウンタ部27はカウントを停止する。   When the contrast evaluation value maximum value determination unit 32 determines the maximum value of the contrast evaluation value (determines that it is appropriate), the contrast evaluation value maximum value determination unit 32 notifies the CPU 24 of the determination of the maximum value. In response to the notification from the contrast evaluation value maximum value determination unit 32, the CPU 24 outputs an instruction to the drive motor pulse output unit 21 to stop the Z-direction motor of the currently driven XYZ stage 1. The instruction to stop the Z direction motor is output from the CPU 24 to the XYZ stage 1 via the drive motor pulse output unit 21. At the same time, the CPU 24 instructs the elapsed time measuring counter unit 27 to stop the operation via the counter reading unit 28. Receiving the instruction, the elapsed time measuring counter unit 27 stops counting.

続いて、コントラスト評価値極大値判定部32は、コントラスト評価値極大Z位置算出部33に対して、画像のコントラストが極大となったZ位置(合焦位置)の算出を指示する。コントラスト評価値極大Z位置算出部33は指示を受けて、極大値をとるコントラスト評価値、および時間的に極大値の前後に取得された複数のコントラスト評価値を、コントラスト評価値極大値判定部32を経由してコントラスト評価値記憶部31から読み出す。また、コントラスト評価値極大Z位置算出部33は、取得したコントラスト評価値を算出したタイミングに対応するカウンタの値をカウンタ記憶部30から読み出し、取得したカウンタの値に近いタイミングで取得された複数のZ位置もZ位置記憶部29から読み出す。   Subsequently, the contrast evaluation value maximum value determination unit 32 instructs the contrast evaluation value maximum Z position calculation unit 33 to calculate the Z position (focus position) at which the contrast of the image is maximum. The contrast evaluation value maximum Z position calculation unit 33 receives the instruction, and compares the contrast evaluation value having the maximum value and the plurality of contrast evaluation values acquired before and after the local maximum value with respect to the contrast evaluation value maximum value determination unit 32. Is read out from the contrast evaluation value storage unit 31. In addition, the contrast evaluation value maximum Z position calculation unit 33 reads a counter value corresponding to the timing at which the acquired contrast evaluation value is calculated from the counter storage unit 30, and acquires a plurality of values acquired at timings close to the acquired counter value. The Z position is also read from the Z position storage unit 29.

コントラスト評価値極大Z位置算出部33は、読み出した値を利用して、後述する方法により、コントラストが実質的に極大を示すZ位置、すなわち合焦位置を算出する。コントラスト評価値極大Z位置算出部33によって算出された、合焦位置を示すZ位置はCPU24に出力される。CPU24は、指定されたZ位置にXYZステージ1を動かすように、駆動モータ用パルス出力部21に指示を出し、XYZステージ1のZ方向モータを駆動させる。   The contrast evaluation value maximum Z position calculation unit 33 uses the read value to calculate a Z position where the contrast substantially has a maximum, that is, a focus position, by a method described later. The Z position indicating the in-focus position calculated by the contrast evaluation value maximum Z position calculation unit 33 is output to the CPU 24. The CPU 24 instructs the drive motor pulse output unit 21 to move the XYZ stage 1 to the designated Z position, and drives the Z direction motor of the XYZ stage 1.

次に、コントラスト評価値算出部26の構成を説明する。図3は、コントラスト評価値算出部26の内部構成を示すブロック図である。図3は、カメラ画像取り込み部25から出力された画像情報を用いてコントラスト評価値を算出し、算出結果をコントラスト評価値記憶部31に出力するまでの処理の流れを主に示しており、例えば図2を用いて説明した、CPU24によって指示されるカメラ画像取り込み部25の画像情報の取得に関する処理の流れは特に示していない。   Next, the configuration of the contrast evaluation value calculation unit 26 will be described. FIG. 3 is a block diagram showing an internal configuration of the contrast evaluation value calculation unit 26. FIG. 3 mainly shows the flow of processing until the contrast evaluation value is calculated using the image information output from the camera image capturing unit 25 and the calculation result is output to the contrast evaluation value storage unit 31, for example. The flow of processing related to the acquisition of image information of the camera image capturing unit 25 instructed by the CPU 24 described with reference to FIG. 2 is not particularly shown.

カメラ画像取り込み部25から出力された画像情報は、色情報指定部41に入力される。色情報指定部41は、色情報選択部35によって選択された色に従って、コントラスト評価値の算出に用いる特定の色別画像情報を決定する。例えば画像情報が「R」、「G」、「B」の色別画像情報からなる場合、色情報選択部35によって「G(緑)」が指定された場合には、「G」に関する色別画像情報が、「M(マゼンダ)」が指定された場合には、「R」と「G」に関する色別画像情報が、コントラスト評価値の演算に用いる画像情報として決定され、該当する色別画像情報が出力される。   The image information output from the camera image capturing unit 25 is input to the color information specifying unit 41. The color information specifying unit 41 determines specific color-specific image information used for calculating the contrast evaluation value according to the color selected by the color information selecting unit 35. For example, when the image information is made up of “R”, “G”, and “B” color-specific image information, and “G (green)” is designated by the color information selection unit 35, the color information related to “G” When “M (magenta)” is designated as the image information, the color-specific image information regarding “R” and “G” is determined as the image information used for the calculation of the contrast evaluation value, and the corresponding color-specific image. Information is output.

また、「K(グレースケール)」が指定された場合には、色情報指定部41は、グレースケール変換した画像情報を、「A(全ての色)」が指定された場合には、全ての色別画像情報を、それぞれコントラスト評価値の算出に用いることを決定し、入力されたままの画像情報を走査切替部42へ出力する。これと同時に、色情報指定部41は、実際のコントラスト評価値の算出で、画像情報に対して事前に変換等の演算が必要であるか否かを示す情報をコントラスト評価値演算部44へ出力する。コントラスト評価値演算部44に出力される情報は、例えば全ての色の画像情報を利用する場合に、色情報選択部35で「K(グレースケール)」と指定されたときは、事前の変換が必要であるという内容であり、同様に色情報選択部35で「A(全ての色)」と指定されたときは、事前の変換は必要ないという内容である。   In addition, when “K (grayscale)” is designated, the color information designating unit 41 converts the grayscale converted image information into all image information when “A (all colors)” is designated. The image information for each color is determined to be used for calculation of the contrast evaluation value, and the image information as it is input is output to the scan switching unit 42. At the same time, the color information specifying unit 41 outputs, to the contrast evaluation value calculating unit 44, information indicating whether or not calculation such as conversion is necessary for the image information in advance in calculating the actual contrast evaluation value. To do. The information output to the contrast evaluation value calculation unit 44 is, for example, when image information of all colors is used, and when the color information selection unit 35 designates “K (grayscale)”, prior conversion is performed. Similarly, when the color information selection unit 35 designates “A (all colors)”, it is the content that prior conversion is not necessary.

色情報指定部41から出力された画像情報は走査切替部42に入力される。走査切替部42は、走査方式選択部34から指示される走査方式に従って、画像情報の出力先を変更する。走査切替部42は、指示された走査方式がインターレースの場合にはフィールド分離部43に、プログレッシブの場合にはコントラスト評価値演算部44に画像情報を出力する。   The image information output from the color information specifying unit 41 is input to the scan switching unit 42. The scan switching unit 42 changes the output destination of the image information according to the scan method instructed from the scan method selecting unit 34. The scan switching unit 42 outputs image information to the field separation unit 43 when the instructed scanning method is interlace, and to the contrast evaluation value calculation unit 44 when the scanning method is progressive.

フィールド分離部43は、走査方式選択部34によって、画像情報がインターレース走査方式であると指定された場合に動作し、走査切替部42から出力された画像情報を奇数(Odd)フィールドと偶数(Even)フィールドの2フィールドに分離する。フィールド分離部43に入力される画像情報は、上述した走査切替部42の内容から、インターレースの走査方式の画像情報だけである。フィールド分離部43は、以降のコントラスト評価値の算出をフィールド別に行うために設けられている。   The field separation unit 43 operates when the scanning method selection unit 34 specifies that the image information is an interlaced scanning method, and converts the image information output from the scanning switching unit 42 into an odd (Odd) field and an even number (Even). ) Separated into two fields. The image information input to the field separation unit 43 is only the image information of the interlaced scanning method from the contents of the scanning switching unit 42 described above. The field separation unit 43 is provided to perform subsequent calculation of the contrast evaluation value for each field.

フィールド分離部43によって分離されたフィールド単位の画像情報、および走査切替部42から出力された、分離されていないプログレッシブ走査方式の画像情報はコントラスト評価値演算部44に入力される。コントラスト評価値演算部44は、入力された画像情報に基づいて、所定の方法に従って、コントラスト評価値を求める演算を行う。演算の際にコントラスト評価値演算部44は、走査方式選択部34から指示された走査方式に従って、演算の対象としてフィールド単位の画像情報とプログレッシブ走査方式の画像情報のいずれかを選択して決定する。   The field-by-field image information separated by the field separation unit 43 and the non-separated progressive scanning image information output from the scan switching unit 42 are input to the contrast evaluation value calculation unit 44. The contrast evaluation value calculation unit 44 performs a calculation for obtaining the contrast evaluation value according to a predetermined method based on the input image information. In the calculation, the contrast evaluation value calculation unit 44 selects and determines either field unit image information or progressive scan method image information as a calculation target in accordance with the scanning method instructed by the scanning method selection unit 34. .

さらに、コントラスト評価値演算部44は、色情報指定部41から出力された事前の画像情報変換の必要有無に関する情報に基づいて、必要に応じて事前に画像情報の変換を行う等の処理を行う。このうち、画像情報の変換については、全ての色を含む画像情報がコントラスト評価値の演算対象として入力された場合に、色別画像情報毎にコントラスト評価値を求めるのか、それともグレースケールに変換した画像情報を用いてコントラスト評価値を求めるのかを明確にするために、コントラスト評価値演算部44は色情報指定部41から、事前の画像情報の変換に関する情報を受け取るようにしている。   Further, the contrast evaluation value calculation unit 44 performs processing such as converting image information in advance as necessary based on the information regarding the necessity of image information conversion in advance output from the color information specifying unit 41. . Among these, regarding the conversion of image information, when image information including all colors is input as a target for calculating the contrast evaluation value, a contrast evaluation value is obtained for each color-specific image information, or converted to gray scale. In order to clarify whether the contrast evaluation value is obtained using the image information, the contrast evaluation value calculation unit 44 receives information related to the conversion of the previous image information from the color information specifying unit 41.

なお、入力される画像情報の走査方式が異なっても、コントラスト評価値を演算するアルゴリズムは、画像情報で参照する位置が異なる以外は同じものを用いている。コントラスト評価値演算部44によって演算されたコントラスト評価値は、それがフィールド単位の画像情報から求められた場合にはフィールド別評価値合成部45へ出力され、さらに下記の処理が施される。また、コントラスト評価値がプログレッシブ走査方式の画像情報から求められた場合には、コントラスト評価値はそのままCPU24およびコントラスト評価値記憶部31に出力される。   Even if the scanning method of the input image information is different, the same algorithm is used for calculating the contrast evaluation value except that the position referred to by the image information is different. The contrast evaluation value calculated by the contrast evaluation value calculation unit 44 is output to the field-specific evaluation value synthesis unit 45 when it is obtained from the image information in field units, and further subjected to the following processing. When the contrast evaluation value is obtained from the progressive scanning image information, the contrast evaluation value is output to the CPU 24 and the contrast evaluation value storage unit 31 as it is.

フィールド別評価値合成部45は、走査方式選択部34によって、画像情報の走査方式としてインターレースが選択された場合に動作し、コントラスト評価値演算部44から出力されたフィールド別のコントラスト評価値を合成し、コントラスト評価値算出部26に入力された画像情報のコントラスト評価値を算出する。各フィールドのコントラスト評価値の合成方法は、奇数(Odd)フィールドのコントラスト評価値をCV_I_odd、偶数(Even)フィールドのコントラスト評価値をCV_I_evenとして、(1)式により画像情報のコントラスト評価値CV_Iを求めるという方法である。
CV_I = α×CV_odd + (1−α)×CV_I_even ・・・(1)
The field-by-field evaluation value combining unit 45 operates when interlace is selected as the image information scanning method by the scanning method selection unit 34, and combines the field-by-field contrast evaluation values output from the contrast evaluation value calculation unit 44. The contrast evaluation value of the image information input to the contrast evaluation value calculation unit 26 is calculated. The method for synthesizing the contrast evaluation value of each field is to obtain the contrast evaluation value CV_I of the image information by the expression (1), where CV_I_odd is the contrast evaluation value of the odd (Odd) field and CV_I_even is the contrast evaluation value of the even (Even) field. It is a method.
CV_I = α × CV_odd + (1−α) × CV_I_even (1)

(1)式のαは重み係数であり、0≦α≦1である。このαを変えることによって、画像情報のコントラスト評価値CV_Iを、どちらか一方のフィールドの画像情報から算出した結果だけとしたり、両者のフィールドの画像情報から算出した結果を平均化した結果としたり等の制御が可能である。(1)式により算出されたコントラスト評価値は、CPU24およびコントラスト評価値記憶部31に出力される。   In the equation (1), α is a weighting coefficient, and 0 ≦ α ≦ 1. By changing this α, the contrast evaluation value CV_I of the image information is only the result calculated from the image information of one of the fields, or the result calculated from the image information of both fields is averaged, etc. Can be controlled. The contrast evaluation value calculated by the equation (1) is output to the CPU 24 and the contrast evaluation value storage unit 31.

なお、CV_I_oddおよびCV_I_evenの算出結果の利用方法は、上述した方法に限定されない。例えば、奇数フィールドと偶数フィールドとの間に振動起因の「ずれ」が発生した場合には、CV_I_oddとCV_I_evenとが著しく異なる可能性があるので、CV_I_oddとCV_I_evenの差が所定値以上の場合には、算出したコントラスト評価値を極大の判定に使用しないようにしてもよい。あるいは、CV_I_oddとCV_I_evenのそれぞれについて、CV_I_oddまたはCV_I_evenの時系列変化における前後の値と比較した結果、異常値であると判定された場合には、その値を使用しないようにしてもよい。   Note that the method of using the calculation results of CV_I_odd and CV_I_even is not limited to the method described above. For example, if a `` deviation '' due to vibration occurs between an odd field and an even field, CV_I_odd and CV_I_even may be significantly different. The calculated contrast evaluation value may not be used for maximal determination. Alternatively, if each of CV_I_odd and CV_I_even is determined to be an abnormal value as a result of comparison with values before and after the time series change of CV_I_odd or CV_I_even, the values may not be used.

次に、コントラスト評価値算出部26によるコントラスト評価値の算出方法を説明する。図4は、本実施形態におけるコントラスト評価値の算出に利用するサンプリングラインパターンの一例を示している。図4において、サンプリングラインパターンは、画像情報Imに対して設定されるものである。コントラスト評価値算出部26によって算出されるコントラスト評価値は、図4に示されるラインSおよびS上に位置する画素の輝度情報を利用して算出される。図4(a)では画像情報Imの画面中央部に「×」形状のサンプリングパターンSが設定されており、図4(b)では画像情報Imの複数箇所、例えば4箇所に「×」形状のサンプリングパターンSが設定されている。 Next, a method for calculating the contrast evaluation value by the contrast evaluation value calculation unit 26 will be described. FIG. 4 shows an example of the sampling line pattern used for calculation of the contrast evaluation value in the present embodiment. In FIG. 4, the sampling line pattern is set for the image information Im. Contrast evaluation value calculated by the contrast evaluation value calculating unit 26 is calculated by using the luminance information of the pixels located on the line S 1 and S 2 shown in FIG. 4 sampling pattern S 1 of "×" shape in the center of the screen of (a) the image information Im is set, "×" shape at a plurality of locations, for example four positions shown in FIG. 4 (b) the image information Im sampling pattern S 2 of is set.

各サンプリングパターンS、Sを用いるのは次の理由による。例えば被検査対象であるFPDガラス基板2が欠陥検査を対象としており、欠陥部が画面中央部に存在する場合、欠陥自体がどのようなものであるかを検査する際には、欠陥そのものに焦点を合わせる必要があるため、図4(a)のように画面中央にサンプリングパターンSを設定することによって、欠陥自体のコントラスト評価値を見てAF処理が行われる。一方、欠陥が、FPDガラス基板2の正常パターンに対してどのような影響を及ぼすかを検査する際には、欠陥ではなく正常パターンに焦点を合わせる必要があるため、図4(b)のように画面中心から離れた複数箇所にサンプリングパターンSを設定することによって、正常パターンのコントラスト評価値を見てAF処理が行われる。なおサンプリングパターンはSやSの形状に限らず、任意の画面位置、任意の形状、任意の個数で設定してよい。 Each sampling pattern S 1 , S 2 is used for the following reason. For example, when the FPD glass substrate 2 to be inspected is targeted for defect inspection and the defective portion exists in the center of the screen, when inspecting what the defect itself is, focus on the defect itself. it is necessary to adjust the, by setting the sampling pattern S 1 in the center of the screen as shown in FIG. 4 (a), AF processing is performed to look at the contrast evaluation value of the defect itself. On the other hand, when inspecting how the defect affects the normal pattern of the FPD glass substrate 2, it is necessary to focus on the normal pattern instead of the defect, as shown in FIG. by setting the sampling pattern S 2 at a plurality of positions away from the center to, AF processing is performed to look at the contrast evaluation value of the normal pattern. Note sampling pattern is not limited to the shape of the S 1 and S 2, any screen position, any shape may be set at any number.

以下、図4のサンプリングパターンを用いたコントラスト評価値の算出について述べる。サンプリングパターンがN個の画素配列0〜N−1からなり、n番目の画素に関して、コントラスト評価値の算出に用いられる画像情報の輝度値がIv(n)であるとする。輝度値Iv(n)が、ノイズ除去目的のフィルタリングを既に済ませたものとして、サンプリングパターン上で隣接する画素の輝度値Iv(n-1)との差ΔIv(n)を、(2)式により求める。
ΔIv(n) = |Iv(n) −Iv(n-1)| ・・・(2)
Hereinafter, calculation of the contrast evaluation value using the sampling pattern of FIG. 4 will be described. It is assumed that the sampling pattern is composed of N pixel arrays 0 to N−1, and the luminance value of the image information used for calculating the contrast evaluation value is Iv (n) for the nth pixel. Assuming that the luminance value Iv (n) has already been filtered for noise removal, the difference ΔIv (n) with the luminance value Iv (n−1) of the adjacent pixel on the sampling pattern is expressed by equation (2). Ask.
ΔIv (n) = | Iv (n) −Iv (n−1) | 2 (2)

(2)式に示される演算をサンプリングパターン上の各画素に対して行い、(3)式で表される値CV_Iをコントラスト評価値とする。   The calculation shown in Expression (2) is performed on each pixel on the sampling pattern, and the value CV_I expressed in Expression (3) is used as the contrast evaluation value.

Figure 2006308884
Figure 2006308884

(3)式の右辺はn=1からN−1までのΔIv(n)の和を示す。(3)式は1本のサンプリングパターンに関するものであり、図4のように「×」型で構成される2本1組のサンプリングパターンがある場合は、それぞれのサンプリングパターンに関して(3)式で求めた“CV_I”の和を画像情報全体のコントラスト評価値とすればよい。また、それぞれのサンプリングパターンに関して重みをつける、例えば図4(b)のように「×」型のサンプリングパターンが複数存在する場合は、「×」型のサンプリングパターンの画面位置に応じて重みを変えて加算することによって、画像情報全体のコントラスト評価値を得るようにしてもよい。   The right side of the equation (3) indicates the sum of ΔIv (n) from n = 1 to N−1. Equation (3) relates to one sampling pattern, and when there is a set of two sampling patterns configured in an “x” shape as shown in FIG. The sum of the obtained “CV_I” may be used as the contrast evaluation value of the entire image information. Also, when there is a plurality of “×” type sampling patterns as shown in FIG. 4B, for example, when there are a plurality of “×” type sampling patterns, the weight is changed according to the screen position of the “×” type sampling pattern. Thus, the contrast evaluation value of the entire image information may be obtained.

次に、本実施形態におけるAF処理を、図5を参照して説明する。図5は、本実施形態におけるAF処理の手順を示すフローチャートである。なお、図5において、既に説明を行った処理に対しては概略的な説明のみを行う。CPU24による指示に基づいて、経過時間計測用カウンタ部27はカウンタの値を初期化する(ステップS101)。駆動モータ用パルス出力部21は、XYZステージ1に備わっているZ方向モータの駆動を開始させ、XYZステージ1をZ方向に移動させる(ステップS102)。駆動モータ用パルス読み取り部22によって読み取られたパルス数に基づいて、Z位置算出部23は現在のXYZステージ1のZ位置を算出し、同時にカウンタ読み取り部28は現在のカウンタの値を取得する。取得されたZ位置とカウンタの値は1つの組として対応付けられて、それぞれZ位置記憶部29およびカウンタ記憶部30に格納される(ステップS103)。   Next, AF processing in the present embodiment will be described with reference to FIG. FIG. 5 is a flowchart showing a procedure of AF processing in the present embodiment. In FIG. 5, only a schematic description is given to the processing that has already been described. Based on the instruction from the CPU 24, the elapsed time measuring counter unit 27 initializes the value of the counter (step S101). The drive motor pulse output unit 21 starts driving the Z direction motor provided in the XYZ stage 1 and moves the XYZ stage 1 in the Z direction (step S102). Based on the number of pulses read by the drive motor pulse reading unit 22, the Z position calculation unit 23 calculates the current Z position of the XYZ stage 1, and at the same time, the counter reading unit 28 obtains the current counter value. The acquired Z position and counter value are associated with each other as a set, and are stored in the Z position storage unit 29 and the counter storage unit 30, respectively (step S103).

コントラスト評価値算出部26は、コントラスト評価値を算出する画像情報をカメラ画像取り込み部25から取得する。同時に、CPU24はカウンタ読み取り部28から現在のカウンタの値を取得する(ステップS104)。コントラスト評価値算出部26は、ステップS104で取得した画像情報に関するコントラスト評価値を算出する。算出されたコントラスト評価値は、ステップS104で取得されたカウンタの値と1つの組として対応付けられて、それぞれコントラスト評価値記憶部31およびカウンタ記憶部30に格納される(ステップS105)。   The contrast evaluation value calculation unit 26 acquires image information for calculating a contrast evaluation value from the camera image capturing unit 25. At the same time, the CPU 24 obtains the current counter value from the counter reading unit 28 (step S104). The contrast evaluation value calculation unit 26 calculates a contrast evaluation value related to the image information acquired in step S104. The calculated contrast evaluation values are associated with the counter values acquired in step S104 as one set, and are stored in the contrast evaluation value storage unit 31 and the counter storage unit 30, respectively (step S105).

コントラスト評価値極大値判定部32は、現在までに算出されたコントラスト評価値をコントラスト評価値記憶部31から読み出し、現在のコントラスト評価値の極大値が妥当であるか否かの判定を行う(ステップS106)。この判定の基準は前述したとおりである。判定の結果はコントラスト評価値極大値判定部32からCPU24に通知される。CPU24は、ステップS106の結果(コントラスト評価値の極大値が妥当であるか否かの判定結果)に基づいて、以下のいずれの処理を行うべきかを判定する(ステップS107)。極大値が妥当であった場合には、処理はステップS108に進み、極大値が妥当でなかった場合には、処理はステップS111に進む。   The contrast evaluation value maximum value determination unit 32 reads the contrast evaluation value calculated so far from the contrast evaluation value storage unit 31, and determines whether or not the maximum value of the current contrast evaluation value is appropriate (step). S106). The criteria for this determination are as described above. The determination result is notified from the contrast evaluation value maximum value determination unit 32 to the CPU 24. The CPU 24 determines which of the following processes should be performed based on the result of step S106 (determination result of whether or not the maximum value of the contrast evaluation value is appropriate) (step S107). If the maximum value is valid, the process proceeds to step S108. If the maximum value is not valid, the process proceeds to step S111.

コントラスト評価値の極大値が妥当であった場合には、CPU24は駆動モータ用パルス出力部21に現在駆動中のZ方向モータの停止を指示し、指示を受けた駆動モータ用パルス出力部21はZ方向モータを停止させる(ステップS108)。コントラスト評価値極大Z位置算出部33は、コントラスト評価値の極大値に対応した、画像のコントラストが極大となった際のZ位置、すなわち合焦位置を算出し、算出結果をCPU24へ出力する(ステップS109)。合焦位置の算出の際にコントラスト評価値極大Z位置算出部33は、コントラスト評価値およびZ位置と対応付けられているカウンタの値を参照すると共に、コントラスト評価値の極大値だけでなく、その前後の時間に算出されたコントラスト評価値も利用する。CPU24は駆動モータ用パルス出力部21にZ方向モータの駆動を指示し、指示を受けた駆動モータ用パルス出力部21はZ方向モータを駆動して、XYZステージ1を、ステップS109において算出された合焦位置に移動させる(ステップS110)。   When the maximum value of the contrast evaluation value is appropriate, the CPU 24 instructs the drive motor pulse output unit 21 to stop the Z-direction motor currently being driven, and the received drive motor pulse output unit 21 receives the instruction. The Z direction motor is stopped (step S108). The contrast evaluation value maximum Z position calculation unit 33 calculates the Z position, that is, the in-focus position when the contrast of the image is maximum corresponding to the maximum value of the contrast evaluation value, and outputs the calculation result to the CPU 24 ( Step S109). When calculating the in-focus position, the contrast evaluation value maximum Z position calculation unit 33 refers to the contrast evaluation value and the counter value associated with the Z position, and not only the maximum value of the contrast evaluation value but also the Contrast evaluation values calculated before and after are also used. The CPU 24 instructs the drive motor pulse output unit 21 to drive the Z-direction motor. Upon receiving the instruction, the drive motor pulse output unit 21 drives the Z-direction motor, and the XYZ stage 1 is calculated in step S109. Move to the in-focus position (step S110).

また、コントラスト評価値の極大値が妥当でなかった場合には、CPU24は、最新のコントラスト評価値と最新から1つ前の時間(カウンタの値)に対応するコントラスト評価値とをコントラスト評価値記憶部31から読み出し、それらの間の変化が所定のしきい値Th1以上であるか否かを判断する(ステップS111)。2つのコントラスト評価値の間の変化がしきい値Th1以上であった場合には、処理はステップS112に進み、しきい値Th1未満であった場合には、処理はステップS103に戻る。   If the maximum value of the contrast evaluation value is not appropriate, the CPU 24 stores the latest contrast evaluation value and the contrast evaluation value corresponding to the time (counter value) one time before the latest. It is read from the unit 31, and it is determined whether or not the change between them is equal to or greater than a predetermined threshold value Th1 (step S111). If the change between the two contrast evaluation values is greater than or equal to the threshold value Th1, the process proceeds to step S112. If the change is less than the threshold value Th1, the process returns to step S103.

上記のステップS111の処理は、コントラスト評価値の時間変化に応じて、Z方向モータの駆動速度を変更できるようにするための処理である。しきい値Th1はコントラスト評価値の定義や被検査対象のパターンによって変わるが、例えばコントラスト評価値のとりうる範囲が最小値0、最大値10000であった場合には、しきい値Th1を+3000にする(コントラスト評価値が増加する)というように、時間的に隣接する状態で十分大きな変化であることを踏まえた値に設定する。   The process in step S111 is a process for enabling the drive speed of the Z-direction motor to be changed in accordance with the temporal change in the contrast evaluation value. The threshold value Th1 varies depending on the definition of the contrast evaluation value and the pattern of the object to be inspected. For example, when the possible range of the contrast evaluation value is the minimum value 0 and the maximum value 10000, the threshold value Th1 is set to +3000. (Contrast evaluation value is increased), and the value is set in consideration of the sufficiently large change in the temporally adjacent state.

コントラスト評価値の時間変化がしきい値Th1以上であった場合、CPU24は、Z方向モータの駆動速度を現在のβ倍(0<β<1)にする(減速する)ことを駆動モータ用パルス出力部21に指示する。指示を受けた駆動モータ用パルス出力部21はZ方向モータの駆動速度を上記のように制御する(ステップS112)。この処理は、コントラスト評価値の増加という変化に伴い、合焦位置が近くなっているという認識に基づいて、コントラスト評価値を算出する画像情報に対応するZ位置をより細かい間隔で取得できるようにするための処理である。なお、ステップS112の処理を何回も実行すると、Z方向モータの駆動速度が遅くなり、AF処理の時間に影響するため、駆動速度が遅くなりすぎない程度の所定の回数Qだけ実行されるものとする。例えば、処理開始時のZ方向モータ駆動速度=Vz0、β=0.8とした場合、ステップS112の処理をq回行った時の速度Vzqは(4)式で表される。
Vzq = Vz0×βq ・・・(4)
When the time change of the contrast evaluation value is equal to or greater than the threshold value Th1, the CPU 24 sets the drive speed of the Z direction motor to the current β times (0 <β <1) (decelerates) the drive motor pulse. The output unit 21 is instructed. Upon receiving the instruction, the drive motor pulse output unit 21 controls the drive speed of the Z-direction motor as described above (step S112). With this process, the Z position corresponding to the image information for calculating the contrast evaluation value can be acquired at a finer interval based on the recognition that the in-focus position is close as the contrast evaluation value increases. It is a process to do. If the process of step S112 is executed many times, the driving speed of the Z-direction motor is slowed down and affects the AF processing time. Therefore, the process is executed a predetermined number of times Q so that the driving speed is not too slow. And For example, when the Z-direction motor drive speed at the start of processing = Vz0 and β = 0.8, the speed Vzq when the process of step S112 is performed q times is expressed by equation (4).
Vzq = Vz0 × β q (4)

(4)式の左辺がVz0のB倍未満にならないようにするため、処理を行う回数Qを式(5)のように決定する。
Q=Int(LogB/Logβ) ・・・(5)
(5)式で“Int(X)”はXを超えない最大の整数を表すものとする。例えばβ=0.8のときにΒ=0.35とすると、Q=4となり、ステップS112の処理は最大で4回まで実行されることとなる。
In order to prevent the left side of the equation (4) from being less than B times Vz0, the number Q of processing is determined as in the equation (5).
Q = Int (LogB / Logβ) (5)
In equation (5), “Int (X)” represents the maximum integer not exceeding X. For example, if == 0.35 when β = 0.8, Q = 4, and the process of step S112 is executed up to four times.

次に、本実施形態のコントラスト極大値判定部32による、コントラスト評価値の変化を利用したコントラスト評価値の極大値の妥当性の判断方法、およびXYZステージ1のZ方向モータの駆動速度の変更方法を説明する。図6(a)は、コントラスト評価値の変化を利用した極大値の妥当性の判断方法を説明するための図であり、図6(b)は、XYZステージ1のZ方向モータの駆動速度の変更方法を説明するための図である。どちらの図においても、横軸をZ位置、縦軸をコントラスト評価値としている。   Next, the method of determining the validity of the maximum value of the contrast evaluation value using the change of the contrast evaluation value, and the method of changing the driving speed of the Z-direction motor of the XYZ stage 1 by the contrast maximum value determination unit 32 of the present embodiment. Will be explained. FIG. 6A is a diagram for explaining a method of determining the validity of the maximum value using the change in the contrast evaluation value, and FIG. 6B is a diagram illustrating the driving speed of the Z-direction motor of the XYZ stage 1. It is a figure for demonstrating the change method. In both figures, the horizontal axis represents the Z position, and the vertical axis represents the contrast evaluation value.

コントラスト評価値の極大値に関する妥当性の判定は、前述した方法で行われる。図6(a)において、Z位置が「Zmax」のときのコントラスト評価値「CV_Imax」が、現時点までに算出されたコントラスト評価値の極大値であるとすると、妥当性を判定するためのコントラスト評価値に関するしきい値(例えば本実施形態ではコントラスト評価値の極大値の70%の値)が設定される。 The validity of the maximum value of the contrast evaluation value is determined by the method described above. In FIG. 6A, when the contrast evaluation value “CV_I max ” when the Z position is “Z max ” is the maximum value of the contrast evaluation values calculated up to the present time, A threshold value regarding the contrast evaluation value (for example, a value of 70% of the maximum value of the contrast evaluation value in this embodiment) is set.

そして、以降の処理において、Z位置が「Zm」のときのコントラスト評価値「CV_Im」が極大値の妥当性判断のためのしきい値、すなわち「CV_Imax×0.7」未満であったとすると、この時点でコントラスト評価値「CV_Imax」が極大値として妥当であると判断され、Z方向モータを停止して合焦位置を算出するための処理が行われる。これ以外に妥当性を判定する方法として、例えばコントラスト評価値の極大値が算出されてから連続して3回単調減少したときに、極大値が妥当であると判定される。図6(a)の場合には、Z位置が「Zm」のときのコントラスト評価値「CV_Im」が算出されたところで、コントラスト評価値「CV_Imax」が極大値として妥当であると判定される。 In the subsequent processing, it is assumed that the contrast evaluation value “CV_I m ” when the Z position is “Z m ” is less than the threshold for determining the validity of the maximum value, that is, “CV_I max × 0.7”. At this time, it is determined that the contrast evaluation value “CV_I max ” is appropriate as the maximum value, and processing for calculating the in-focus position by stopping the Z-direction motor is performed. As another method for determining the validity, for example, when the maximum value of the contrast evaluation value is calculated and continuously decreased monotonically three times, it is determined that the maximum value is appropriate. In the case of FIG. 6A, when the contrast evaluation value “CV_I m ” when the Z position is “Z m ” is calculated, it is determined that the contrast evaluation value “CV_I max ” is valid as the maximum value. The

Z方向モータの駆動速度の変更は、図5を用いて説明した。図6(b)において、Z方向モータの駆動速度Vzが「X[pps]」であるとする。Z位置が「Zm」のときのコントラスト評価値が「CV_Im」であり、次に算出された、Z位置が「Zm+1」のときのコントラスト評価値が「CV_Im+1」であったとする。CPU 24は、時間的に隣接するコントラスト評価値をコントラスト評価値記憶部31から読み出してそれらの差ΔCV_Iを算出し、ΔCV_Iが、図5のステップS111におけるしきい値Th1以上であるか否かを調べる。 The change of the driving speed of the Z direction motor has been described with reference to FIG. In FIG. 6B, it is assumed that the driving speed V z of the Z direction motor is “X [pps]”. The contrast evaluation value when the Z position is “Z m ” is “CV_I m ”, and the calculated contrast evaluation value when the Z position is “Z m + 1 ” is “CV_I m + 1 ”. Suppose there was. The CPU 24 reads out the contrast evaluation values that are temporally adjacent from the contrast evaluation value storage unit 31, calculates the difference ΔCV_I, and determines whether ΔCV_I is equal to or greater than the threshold value Th1 in step S111 in FIG. Investigate.

コントラスト評価値「CV_Im」とコントラスト評価値「CV_Im+1」の差をΔCV_Imとすると、ΔCV_ImがTh1以上であった場合、CPU24は、合焦位置に近づいてきたと認識し、Z方向モータの駆動速度Vzを現在の速度の1/2、すなわち「X/2[pps]」にすることを決定する。ここで “1/2”は(4)式の“β”に相当する。これによって、以降に算出されるZ位置の間隔が小さくなり、今までよりも良い精度でコントラスト評価値の算出、すなわち合焦位置の算出が行われる。 Assuming that the difference between the contrast evaluation value “CV_I m ” and the contrast evaluation value “CV_I m + 1 ” is ΔCV_I m , if ΔCV_I m is equal to or greater than Th1, the CPU 24 recognizes that it has approached the in-focus position and is in the Z direction. It is determined that the motor driving speed V z is set to ½ of the current speed, that is, “X / 2 [pps]”. Here, “1/2” corresponds to “β” in equation (4). As a result, the interval between the Z positions calculated thereafter is reduced, and the contrast evaluation value, that is, the in-focus position is calculated with higher accuracy than before.

なお、図6を用いて示した処理は、コントラスト評価値の特性が、ピーク値から見て比較的「急峻」な特性を示す「山」型になっている前提で述べているが、例えばコントラスト評価値の特性が緩やかな「山」型になる場合は、連続して算出されたコントラスト評価値の差ΔCV_Imが所定のしきい値以上になる状態が連続して所定の回数になったときに、Z方向モータの速度を変更するようにすればよい。また、Z方向モータの駆動速度を変更した後のコントラスト評価値の差ΔCV_Imを調べ、所定の回数分コントラスト評価値の算出を行っても、未だにコントラスト評価値の極大値が妥当であると判定されない場合は、コントラスト評価値の差ΔCV_Imと所定のしきい値を比較して、ΔCV_Imがしきい値未満であればZ方向モータの駆動速度を変更前の状態に戻す(すなわち速くする)ようにすればよい。 The process shown in FIG. 6 is described on the assumption that the characteristic of the contrast evaluation value is a “mountain” type that exhibits a relatively “steep” characteristic as viewed from the peak value. When the evaluation value characteristic is a gradual “mountain” type, when the difference ΔCV_I m between the consecutively calculated contrast evaluation values is equal to or greater than the predetermined threshold value, the predetermined number of times continues. In addition, the speed of the Z direction motor may be changed. In addition, even if the contrast evaluation value difference ΔCV_I m after changing the Z-direction motor drive speed is examined and the contrast evaluation value is calculated a predetermined number of times, it is still determined that the maximum contrast evaluation value is still valid. If not, the contrast evaluation value difference ΔCV_I m is compared with a predetermined threshold value, and if ΔCV_I m is less than the threshold value, the driving speed of the Z-direction motor is returned to the state before the change (ie, increased). What should I do?

次に、本実施形態のコントラスト評価値極大Z位置算出部33による合焦位置の算出方法を、図7を用いて説明する。図7において、Z位置が「Zm」であるときに算出されたコントラスト評価値「CV_Im」が極大値であると判定された場合、コントラスト評価値極大Z位置算出部33は、極大値の前後に取得されたZ位置およびコントラスト評価値をそれぞれZ位置記憶部29およびコントラスト評価値記憶部31から読み出す。コントラスト評価値極大Z位置算出部33は、それらを用いてコントラスト評価値を補間し、コントラスト評価値の推定曲線を、例えば最小2乗法により2次関数に近似させることによって、コントラスト(コントラスト評価値)が最も大きくなるZ位置、すなわち合焦位置を推定する。図7では5個のZ位置(Zm-2〜Zm+2)およびコントラスト評価値(CV_Im-2〜CV_Im+2)が用いられている。 Next, a method for calculating the in-focus position by the contrast evaluation value maximum Z position calculating unit 33 according to the present embodiment will be described with reference to FIG. In FIG. 7, when it is determined that the contrast evaluation value “CV_I m ” calculated when the Z position is “Z m ” is the maximum value, the contrast evaluation value maximum Z position calculation unit 33 displays the maximum value. The Z position and the contrast evaluation value acquired before and after are read from the Z position storage unit 29 and the contrast evaluation value storage unit 31, respectively. The contrast evaluation value maximum Z position calculation unit 33 interpolates the contrast evaluation value using them, and approximates the estimated curve of the contrast evaluation value to a quadratic function by, for example, the least square method, thereby increasing the contrast (contrast evaluation value). The Z position at which is the largest, that is, the focus position is estimated. In FIG. 7, five Z positions (Z m−2 to Z m + 2 ) and contrast evaluation values (CV_I m−2 to CV_I m + 2 ) are used.

Z位置とコントラスト評価値の関係が一般の2次関数Y=A×X+B×X+C(Z位置をX、コントラスト評価値をYで表記)であれば、最小2乗法によって係数A,B,Cが推定される。そして、2次関数の微分関数Y’=2×A×X+Bが0となるXを求めると、そのXが合焦のZ位置に相当する。図7では実際のコントラスト評価値「CV_Im」に対応するZ位置「Zm」から僅かに離れたZ位置「Zmax」が合焦位置として推定される。これによって、粗い間隔でZ位置の取得やコントラスト評価値の算出を行っても、精度よく合焦位置を求めることができる。なお、Z位置とコントラスト評価値の関係を表す近似関数は2次関数に限定しなくてもよい。また、近似関数の係数を推定する方法も最小2乗法に限定しなくてもよい。 If the relationship between the Z position and the contrast evaluation value is a general quadratic function Y = A × X 2 + B × X + C (Z position is expressed as X and contrast evaluation value is expressed as Y), the coefficients A, B, C is estimated. Then, when X is obtained such that the differential function Y ′ = 2 × A × X + B of the quadratic function is 0, the X corresponds to the Z position for focusing. In FIG. 7, the Z position “Z max ” slightly separated from the Z position “Z m ” corresponding to the actual contrast evaluation value “CV_I m ” is estimated as the in-focus position. Thereby, even if the Z position is acquired and the contrast evaluation value is calculated at a rough interval, the in-focus position can be obtained with high accuracy. The approximate function representing the relationship between the Z position and the contrast evaluation value need not be limited to a quadratic function. Further, the method for estimating the coefficient of the approximation function may not be limited to the least square method.

次に、本実施形態におけるZ位置およびコントラスト評価値とカウンタ値との関連付けを説明する。図8は、カウンタ記憶部30内のカウンタ値、コントラスト評価値記憶部31内のコントラスト評価値、およびZ位置記憶部29内のZ位置のそれぞれの記憶部内の関係を示している。Z位置とコントラスト評価値は、それぞれカウンタの値に対応付けられて各記憶部に格納されるため、カウンタ記憶部30によって記憶されるカウンタの値がZ位置とコントラスト評価値のどちらに対応しているのかを識別する必要がある。そこで、図8(a)に示されるように、カウンタ記憶部30には、カウンタの値に対して、各カウンタの値に対応した対応インデックス値が付加されて格納されている。対応インデックス値は、対応するカウンタの値がZ位置、またはコントラスト評価値の何番目のデータに関連付けられているのかを識別するための値である。   Next, the association between the Z position and contrast evaluation value and the counter value in this embodiment will be described. FIG. 8 shows the relationship in the storage unit between the counter value in the counter storage unit 30, the contrast evaluation value in the contrast evaluation value storage unit 31, and the Z position in the Z position storage unit 29. Since the Z position and the contrast evaluation value are associated with the counter value and stored in each storage unit, the counter value stored by the counter storage unit 30 corresponds to either the Z position or the contrast evaluation value. It is necessary to identify whether there is. Therefore, as shown in FIG. 8A, the counter storage unit 30 stores the index value corresponding to the value of each counter added to the counter value. The corresponding index value is a value for identifying the counter value associated with the Z position or the contrast evaluation value.

そして、Z位置記憶部29によって記憶されるZ位置、およびコントラスト評価値記憶部31によって記憶されるコントラスト評価値は、それぞれカウンタ記憶部30に記憶されている対応インデックス値に関連付けられて記憶される。これによって、対応するZ位置とコントラスト評価値のそれぞれのカウンタ値を別々に管理することができる。   The Z position stored by the Z position storage unit 29 and the contrast evaluation value stored by the contrast evaluation value storage unit 31 are stored in association with the corresponding index values stored in the counter storage unit 30, respectively. . Thus, the counter values of the corresponding Z position and contrast evaluation value can be managed separately.

次に、より高精度に合焦位置を算出する方法を、図9を用いて説明する。図9は、本実施形態におけるカウンタ値の推移と、Z位置およびコントラスト評価値の変化を示す図である。横軸がカウンタ値、縦軸がZ位置およびコントラスト評価値である。理想的にはZ位置の取得と、それに対応する画像のコントラスト評価値の算出(厳密には算出するための画像情報の取得)は全く同じタイミング(時刻)に行われるが、実際には装置全体の処理の負荷等の要因により、Z位置取得と画像情報取得は必ずしも同じタイミングで行われず、両者のタイミングに僅かなタイムラグが生じることがある。   Next, a method for calculating the in-focus position with higher accuracy will be described with reference to FIG. FIG. 9 is a diagram illustrating the transition of the counter value and the change of the Z position and the contrast evaluation value in the present embodiment. The horizontal axis is the counter value, and the vertical axis is the Z position and contrast evaluation value. Ideally, the acquisition of the Z position and the calculation of the contrast evaluation value of the corresponding image (accurately, acquisition of image information for calculation) are performed at exactly the same timing (time), but actually the entire apparatus Due to factors such as the processing load, the Z position acquisition and the image information acquisition are not necessarily performed at the same timing, and a slight time lag may occur between both timings.

焦点深度が非常に狭い観察系で行われるAF処理等といった高精度なAF処理を考えた場合、Z位置と画像情報の取得のタイムラグが処理の精度に影響することが考えられる。そこで、本実施形態では、以下で説明するように、タイミングを表すカウンタ値を、Z位置の取得と画像情報の取得(コントラスト評価値の算出)との各々のタイミングで取得して、タイムラグの影響を極力減らすようにしている。   When high-precision AF processing such as AF processing performed in an observation system with a very narrow depth of focus is considered, it is conceivable that the Z position and the time lag in obtaining image information affect the processing accuracy. Therefore, in the present embodiment, as described below, a counter value representing timing is acquired at each timing of acquisition of the Z position and acquisition of image information (calculation of contrast evaluation value), and the influence of the time lag. To reduce as much as possible.

図9において、Z方向モータの駆動が開始されると共に、Z位置が取得され、続いて画像情報が取得され、コントラスト評価値が算出される。両者のデータを取得する際には、カウンタ読み取り部28によって、経過時間計測用カウンタ部27のカウンタ値が読み取られる。取得または算出された各データは、図8に示されるデータ構造で、該当する記憶部に格納される。この一連の処理は、コントラスト評価値の極大値が妥当であると判定されるまで続けられる。   In FIG. 9, the driving of the Z direction motor is started, the Z position is acquired, the image information is acquired, and the contrast evaluation value is calculated. When acquiring both data, the counter reading unit 28 reads the counter value of the elapsed time measuring counter unit 27. Each acquired or calculated data is stored in a corresponding storage unit with the data structure shown in FIG. This series of processing is continued until it is determined that the maximum value of the contrast evaluation value is appropriate.

そして、コントラスト評価値の極大値が妥当であると判定された場合、コントラスト評価値極大Z位置算出部33は、合焦位置を算出する際に、コントラスト評価値に対応するZ位置をそのまま使用せず、カウンタ値を利用して「画像情報取得時のZ位置」を推定し、使用する。画像情報取得時のZ位置の推定には、コントラスト評価値の算出直後のZ位置に対応するカウンタ値を利用する。m番目のZ位置が「Zm」、それに対応したカウンタ値が「TC2m」、m番目の画像情報の取得に対応したカウンタ値が「TC2m+1」、次の(m+1)番目のZ位置が「Zm+1」、それに対応したカウンタ値が「TC2m+2」であるとすると、画像情報取得時のZ位置「Ev_Zm」は(6)式で推定される。
Ev_Zm={Zm+1×(TC2m+1− TC2m)+Zm×(TC2m+2−TC2m+1)}/(TC2m+2− TC2m) ・・・(6)
合焦位置の算出に用いる複数のコントラスト評価値に対して、(6)式でZ位置を推定して用いることによって、Z位置と画像情報の取得のタイムラグの影響を減らし、精度の高いAF処理を行うことができる。
If it is determined that the maximum value of the contrast evaluation value is appropriate, the contrast evaluation value maximum Z position calculation unit 33 uses the Z position corresponding to the contrast evaluation value as it is when calculating the in-focus position. First, the “Z position at the time of image information acquisition” is estimated and used using the counter value. For estimation of the Z position at the time of image information acquisition, a counter value corresponding to the Z position immediately after the calculation of the contrast evaluation value is used. The m-th Z position is “Z m ”, the corresponding counter value is “TC 2m ”, the counter value corresponding to the acquisition of the m-th image information is “TC 2m + 1 ”, the next (m + 1) th Assuming that the Z position is “Z m + 1 ” and the corresponding counter value is “TC 2m + 2 ”, the Z position “Ev_Z m ” at the time of image information acquisition is estimated by equation (6).
Ev_Z m = {Z m + 1 × (TC 2m + 1 - TC 2m) + Z m × (TC 2m + 2 -TC 2m + 1)} / (TC 2m + 2 - TC 2m) ··· (6)
For a plurality of contrast evaluation values used for calculation of the in-focus position, the Z position is estimated and used by the expression (6), thereby reducing the influence of the time lag in obtaining the Z position and image information, and highly accurate AF processing. It can be performed.

本実施形態では顕微鏡に備わっているカラーのCCDカメラ(エリアセンサ)からの画像情報を扱っていたが、画像情報を得る手段は特に限定せず、ラインセンサにも適用可能である。この場合、コントラスト評価値の算出に全画素の輝度情報を利用することによって、図4に示されるサンプリングパターンによる算出方法と同等の処理を実現することができる。また、XYZステージ1のZ方向モータのパルスに基づいてZ位置を取得するようにしていたが、Z位置ではなく、パルスの値、例えばモータのエンコーダから読み取られる値そのものをZ位置の代用として用いて処理を行ってもよい。   In this embodiment, image information from a color CCD camera (area sensor) provided in the microscope is handled, but the means for obtaining the image information is not particularly limited and can be applied to a line sensor. In this case, processing equivalent to the calculation method using the sampling pattern shown in FIG. 4 can be realized by using luminance information of all pixels for calculation of the contrast evaluation value. Also, the Z position is obtained based on the Z direction motor pulse of the XYZ stage 1, but instead of the Z position, a pulse value, for example, a value read from the encoder of the motor itself is used as a substitute for the Z position. May be processed.

上述したように、本実施形態のオートフォーカス装置は、対象物が配置されたステージまたは観察系をZ方向に移動させながらZ位置および画像情報を取得し、画像情報に基づいて算出したコントラスト評価値とZ位置(観察対象物と観察光学系との間の距離に対応した位置)とを対応付けて記憶しながら、コントラスト評価値が時系列変化の中で極大となったか否かを調べ、極大となったと判定したときに、極大をとるコントラスト評価値に対応するZ位置、すなわち合焦位置を算出する。Z方向の移動中にZ位置を読みながら取得した画像のコントラストを評価してAF処理を行うので、逐次駆動と停止を繰り返す従来の駆動方法によるAF処理と比べて高速化を図ることができる。   As described above, the autofocus device according to the present embodiment acquires the Z position and the image information while moving the stage or the observation system on which the object is arranged in the Z direction, and calculates the contrast evaluation value calculated based on the image information. And the Z position (position corresponding to the distance between the object to be observed and the observation optical system) are stored in association with each other, and whether or not the contrast evaluation value is maximized in the time series change is determined. When it is determined that the Z value is satisfied, the Z position corresponding to the contrast evaluation value that takes the maximum, that is, the in-focus position is calculated. Since the AF processing is performed by evaluating the contrast of the acquired image while reading the Z position during movement in the Z direction, the speed can be increased compared with the AF processing by the conventional driving method in which the driving and stopping are sequentially performed.

また、本実施形態のオートフォーカス装置は、コントラスト評価値の算出方法を画像の走査方式(プログレッシブ/インターレース)に適合させ、AF処理に利用する情報(フィールド/フレーム単位)を分けている。そして、本実施形態のオートフォーカス装置は、特にインターレース方式の場合に、奇数フィールドと偶数フィールドとのフィールド別にコントラスト評価値を算出して両者を合成する。これによって、インターレース方式において、振動を伴う環境下で取得された画像の隣接するフィールド間で、振動に起因して発生する画像の「ずれ」あるいは「ぶれ」の影響を最小限にし、外乱に対して安定であり、かつ精度の高いAF処理を実現することができる。   Also, the autofocus device of this embodiment adapts the method of calculating the contrast evaluation value to the image scanning method (progressive / interlace), and divides information (field / frame unit) used for the AF processing. The autofocus apparatus according to the present embodiment calculates the contrast evaluation value for each of the odd field and the even field and synthesizes both, particularly in the case of the interlace method. As a result, in the interlace method, the influence of image “deviation” or “blurring” caused by vibration between the adjacent fields of the image acquired in the environment with vibration is minimized, and the disturbance is prevented. And stable and highly accurate AF processing can be realized.

また、本実施形態のオートフォーカス装置は、画像の色の状態を考慮し、必要に応じて画像中の特定の色情報を用いてコントラスト評価値を算出する。これによって、観察系にカラーフィルタが挿入されている場合やホワイトバランスが特定の色に偏っている場合であっても、色の影響を最小限にした、精度の高いAF処理を実現することができる。   In addition, the autofocus apparatus according to the present embodiment calculates the contrast evaluation value using specific color information in the image as necessary in consideration of the color state of the image. As a result, even when a color filter is inserted in the observation system or when the white balance is biased toward a specific color, it is possible to realize a highly accurate AF process with minimal influence of color. it can.

また、コントラスト評価値が小さく、その時系列変化が少ないときのZ位置は合焦位置から離れているため、本実施形態のオートフォーカス装置はZ位置の変化の速度を高速にし、コントラスト評価値の時系列変化が大きくなると、合焦位置が近いと判断して、Z位置の変化の速度を低速にする。このように、コントラスト評価値の状況に応じて速度を制御することによって、高速かつ精度の高いAF処理を実現することができる。   Further, since the Z position when the contrast evaluation value is small and the time series change is small is away from the in-focus position, the autofocus device of the present embodiment increases the speed of the Z position change, and the contrast evaluation value is When the series change becomes large, it is determined that the in-focus position is close, and the speed of change in the Z position is reduced. Thus, by controlling the speed according to the state of the contrast evaluation value, it is possible to realize high-speed and high-precision AF processing.

また、本実施形態のオートフォーカス装置は、最新のコントラスト評価値が、既に算出して記憶したコントラスト評価値の中の最大値に対して所定の割合以下となったとき、または/および最大値を算出してから、所定の回数連続してコントラスト評価値が減少したときに、最大値をとるコントラスト評価値が極大であると判断する。このように、極大をとるコントラスト評価値が算出された以降のコントラスト評価値の低下の状況に基づいて、極大の妥当性が判断されるので、精度の高いAF処理を実現することができる。   In addition, the autofocus device according to the present embodiment is configured such that the latest contrast evaluation value is equal to or less than a predetermined ratio with respect to the maximum value among the already calculated and stored contrast evaluation values, or / and the maximum value is set. After the calculation, when the contrast evaluation value decreases continuously a predetermined number of times, it is determined that the maximum contrast evaluation value is the maximum. As described above, since the validity of the maximum is determined based on the situation of the decrease in the contrast evaluation value after the contrast evaluation value taking the maximum is calculated, it is possible to realize an AF process with high accuracy.

また、本実施形態のオートフォーカス装置は、極大と判定したコントラスト評価値の前後に取得したコントラスト評価値と、各々のコントラスト評価値に対応するZ位置を用いてコントラスト評価値を補間することによって推定した近似関数に基づいて、コントラストが極大となるZ位置、すなわち合焦位置を算出する。これによって、高速駆動でコントラスト評価値を算出する状況下でも、低速駆動時と同等の精度を維持できるAF処理を実現することができる。   In addition, the autofocus device according to the present embodiment is estimated by interpolating the contrast evaluation values using the contrast evaluation values acquired before and after the contrast evaluation value determined to be maximal and the Z position corresponding to each contrast evaluation value. Based on the approximate function, the Z position where the contrast becomes maximum, that is, the in-focus position is calculated. As a result, it is possible to realize AF processing capable of maintaining the same accuracy as that at the time of low-speed driving even in a situation where the contrast evaluation value is calculated at high-speed driving.

また、本実施形態のオートフォーカス装置は、Z位置を検出したタイミング(あるいは時刻)とZ位置とを対応付け、コントラスト評価値を算出したタイミング(あるいは時刻)とコントラスト評価値とを対応付けて記憶する。Z位置およびコントラスト評価値に対してそれぞれの取得タイミングを対応付けることによって、たとえZ位置の取得タイミングと、そのZ位置に対応するコントラスト評価値の算出タイミングとがずれていても、両者のタイミングのずれを考慮したコントラスト評価値の極大判定が可能となるので、精度の高いAF処理を実現することができる。   Further, the autofocus device according to the present embodiment associates the timing (or time) at which the Z position is detected with the Z position, and stores the timing (or time) at which the contrast evaluation value is calculated and the contrast evaluation value in association with each other. To do. By associating the respective acquisition timings with the Z position and the contrast evaluation value, even if the acquisition timing of the Z position and the calculation timing of the contrast evaluation value corresponding to the Z position are shifted, the timing difference between the two Since it is possible to determine the maximum of the contrast evaluation value in consideration of the above, it is possible to realize highly accurate AF processing.

次に、本発明の第2の実施形態を説明する。本実施形態によるオートフォーカス装置の構成は、第1の実施形態と基本的には同じであるので、第1の実施形態と異なる箇所のみ説明する。第1の実施形態と異なる箇所は、XYZステージ1のZ方向モータの駆動速度の変更方法と、色情報指定部41での処理である。   Next, a second embodiment of the present invention will be described. Since the configuration of the autofocus device according to the present embodiment is basically the same as that of the first embodiment, only the points different from the first embodiment will be described. The difference from the first embodiment is the method of changing the driving speed of the Z direction motor of the XYZ stage 1 and the processing in the color information specifying unit 41.

まず、Z方向モータの駆動速度の変更方法を、図10を用いて説明する。図10は、本実施形態におけるAF処理の手順を示すフローチャートである。AF処理の手順は、基本的には図5に示される手順と同じであるが、異なる点はステップS121およびS122の処理である。第1の実施形態では最新のコントラスト評価値の変化に基づいて、Z方向モータの速度が変更されるが、本実施形態では画像情報の取得タイミングを示すカウンタの値に基づいて、1つのコントラスト評価値の算出に関する時間がチェックされ、その時間に応じてZ方向モータの駆動速度が変更される。   First, a method for changing the driving speed of the Z-direction motor will be described with reference to FIG. FIG. 10 is a flowchart showing the procedure of AF processing in the present embodiment. The procedure of the AF process is basically the same as the procedure shown in FIG. 5 except for the processes in steps S121 and S122. In the first embodiment, the speed of the Z-direction motor is changed based on the latest change in the contrast evaluation value, but in this embodiment, one contrast evaluation is performed based on the value of the counter indicating the acquisition timing of the image information. The time for calculating the value is checked, and the driving speed of the Z-direction motor is changed according to the time.

ここで、Z方向モータの駆動を開始する際の「初速度」について説明する。Z方向モータが駆動中の状態でコントラスト評価値を算出する場合、時間的に隣接するコントラスト評価値の取得間隔、すなわち画像情報の取得間隔でXYZステージ1がZ方向にどれだけ移動するのか(Z方向モータがどの程度の速度でXYZステージ1を移動させるのか)ということがAF処理の精度に影響する。そこで、駆動開始時の速度を設定する要素として、観察系の焦点深度をとりあげる。   Here, the “initial speed” when starting to drive the Z-direction motor will be described. When the contrast evaluation value is calculated while the Z-direction motor is being driven, how much the XYZ stage 1 moves in the Z direction at the time interval for acquiring contrast evaluation values that are temporally adjacent, that is, the image information acquisition interval (Z How fast the direction motor moves the XYZ stage 1) affects the accuracy of the AF process. Therefore, the depth of focus of the observation system is taken up as an element for setting the speed at the start of driving.

この観察系の焦点深度とは、対物レンズ6やCCDカメラ5のレンズ等、観察に関わるレンズ全体から決まる焦点深度を指す。すなわち、焦点深度の距離だけXYZステージ1が動く間に、1つの画像情報に関するコントラスト評価値が算出されるようにする。観察系の焦点深度をDOFとし、1つの画像情報に関するコントラスト評価値の算出時間(カウンタ値)をΔTCCとして、Z方向モータ駆動開始時の初速度Vz0を(7)式で与えるようにする。
Vz0=DOF/ΔTCC ・・・(7)
The depth of focus of the observation system refers to the depth of focus determined from the entire lens related to observation, such as the objective lens 6 and the lens of the CCD camera 5. That is, the contrast evaluation value for one piece of image information is calculated while the XYZ stage 1 moves by the distance of the focal depth. The focal depth of the observation system is DOF, the contrast evaluation value calculation time (counter value) for one piece of image information is ΔTC C , and the initial speed Vz0 at the start of driving the Z-direction motor is given by equation (7).
Vz0 = DOF / ΔTC C (7)

(7)式で与えられるコントラスト評価値の算出時間(カウンタ値)ΔTCCは、例えばコントラスト評価値の算出自体が10ミリ秒以下というオーダーで行われる場合には、1つの画像情報を取得する時間を目安に与え、CCDカメラ5の走査方式がインターレース走査方式である場合には、1フレームの画像の走査時間(33ミリ秒)を目安に与えればよい。 The calculation time (counter value) ΔTC C of the contrast evaluation value given by the equation (7) is the time for acquiring one piece of image information when the calculation of the contrast evaluation value is performed in the order of 10 milliseconds or less. If the scanning method of the CCD camera 5 is an interlaced scanning method, the scanning time of one frame image (33 milliseconds) may be given as a guide.

初速度Vz0が設定され、実際に駆動が開始されて、AF処理が行われていくと、装置内部の処理負荷の増加によって、画像情報を取得する時間の間隔が広がることが考えられる。その場合に、(7)式で設定された速度を維持したままで処理が行われると、コントラスト評価値を算出する時間的間隔が広がり、近似関数で合焦位置を推定するところで精度が低下してしまう懸念がある。そこで、本実施形態ではステップS121において、CPU24は、最新の画像情報を取得したときのカウンタ値と、最新から時間的に1つ前の画像情報を取得したときのカウンタ値との差を求め、これがしきい値Th2以上であった場合には、コントラスト評価値の算出の間隔が広がっており、このままではAF処理の精度が悪くなると判断する。   When the initial speed Vz0 is set, the drive is actually started, and AF processing is performed, it is conceivable that the time interval for acquiring image information increases due to an increase in processing load inside the apparatus. In this case, if the processing is performed while maintaining the speed set by the equation (7), the time interval for calculating the contrast evaluation value is widened, and the accuracy is lowered when the in-focus position is estimated by the approximation function. There is a concern. Therefore, in the present embodiment, in step S121, the CPU 24 obtains a difference between the counter value when the latest image information is acquired and the counter value when the image information one time earlier from the latest is acquired, If this is equal to or greater than the threshold value Th2, the interval for calculating the contrast evaluation value is widened, and it is determined that the accuracy of the AF processing will deteriorate if this is left as it is.

カウンタ値の差がしきい値Th2以上であった場合に、CPU24は、ステップS122において、カウンタ値の差に応じて、Z方向モータの駆動速度を遅くするように制御する。例えば、(7)式で与えられているコントラスト評価値の算出時間(カウンタ値)ΔTCCに対して、カウンタ値の差がどの程度の割合で増加しているか等を目安にして、カウンタ値の差が2フレームの画像の走査時間(66ミリ秒)前後であれば、CPU24は駆動速度を現在の1/2にする等の制御を行う。 When the difference between the counter values is equal to or greater than the threshold value Th2, the CPU 24 controls to reduce the driving speed of the Z-direction motor in accordance with the difference between the counter values in step S122. For example, with reference to how much the difference between the counter values increases with respect to the contrast evaluation value calculation time (counter value) ΔTC C given by equation (7), the counter value If the difference is around the scanning time (66 milliseconds) of the image of two frames, the CPU 24 performs control such as reducing the driving speed to the current half.

次に、本実施形態の色情報指定部41での処理を、図11を用いて説明する。図11は、本実施形態において、画像情報に基づいて、コントラスト評価値の算出に用いる色情報を推定する方法を示している。第1の実施形態では色情報選択部35がコントラスト評価値の算出に使用する色を選択し、色情報指定部41が、実際に必要とする色別画像情報を取り出すようにしていたが、本実施形態の色情報指定部41は、コントラスト評価値の算出に用いる色別画像情報を、画像情報に基づいて自動的に指定する。なお、画像情報はRGBカラーで構成されているものとする。   Next, processing in the color information specifying unit 41 of the present embodiment will be described with reference to FIG. FIG. 11 shows a method for estimating color information used for calculating a contrast evaluation value based on image information in the present embodiment. In the first embodiment, the color information selection unit 35 selects a color to be used for calculation of the contrast evaluation value, and the color information designation unit 41 extracts image information for each color that is actually required. The color information specifying unit 41 according to the embodiment automatically specifies the image information for each color used for calculating the contrast evaluation value based on the image information. The image information is assumed to be composed of RGB colors.

色情報指定部41は、カメラ画像取り込み部25から入力された画像情報に関してHSL変換を行い、色相情報(H)を取り出す。色相は、標準カラーホイールの位置で決まる角度として表され、範囲は0°〜360°である。本実施形態ではB(青)を基準(0°および360°)として色相情報が算出される。続いて、色情報指定部41は、算出した色相情報に関して、図11のようなヒストグラムを作成する。このヒストグラムは、横軸を色相、縦軸を頻度としたものである。このうち横軸は、色相が6色(R,G,B,C,M,Y)に分割され、さらに1つの色について、角度に応じて6個の区間に分割されている。   The color information specifying unit 41 performs HSL conversion on the image information input from the camera image capturing unit 25 and extracts the hue information (H). Hue is expressed as an angle determined by the position of the standard color wheel, and the range is from 0 ° to 360 °. In the present embodiment, hue information is calculated using B (blue) as a reference (0 ° and 360 °). Subsequently, the color information specifying unit 41 creates a histogram as shown in FIG. 11 for the calculated hue information. In this histogram, the horizontal axis represents hue and the vertical axis represents frequency. Of these, the horizontal axis is divided into six colors (R, G, B, C, M, Y), and further, one color is divided into six sections according to the angle.

図11は、グリーン系のカラーフィルタが挿入された観察系の画像情報から得られた色相情報のヒストグラムの一例を示している。色情報指定部41は、1画素の情報につき1つの頻度を計上するが、画面全体の色相の傾向を調べる意味では、例えば隣接する4画素や9画素の平均から1つの色相情報を求めて1つの頻度を計上してもよい。また、グレースケールの画像情報が入力されることを考慮して、HSL変換時に求められる彩度情報(S)を調べた上で、色相情報をヒストグラムに追加するか否かを決めるようにしてもよい。彩度情報を使用する場合、例えば彩度が256階調で表される(最小0が彩度なしのグレー、最大255が純色)として、彩度が25階調以下であれば、同じところで算出された色相情報はヒストグラムには追加しない等といった処理が行われる。   FIG. 11 shows an example of a histogram of hue information obtained from image information of an observation system in which a green color filter is inserted. The color information designating unit 41 counts one frequency for information of one pixel. In the sense of examining the hue tendency of the entire screen, for example, one color information is obtained by obtaining one hue information from the average of four adjacent pixels or nine pixels. One frequency may be counted. In consideration of the input of grayscale image information, it is also possible to determine whether or not to add hue information to the histogram after examining the saturation information (S) required during HSL conversion. Good. When using saturation information, for example, if saturation is represented by 256 gradations (minimum 0 is gray without saturation, maximum 255 is pure color), and saturation is 25 gradations or less, it is calculated in the same place The processed hue information is not added to the histogram.

続いて、色情報指定部41は、色相情報のヒストグラムに基づいて、頻度が最も多い色相を選ぶ。頻度が最も多い色相は、画像情報において支配的な「色」となる。図11では「Yellow」(黄)の区間が、最も頻度の多い区間である。これにはグリーン系のカラーフィルタの他に照明光やレンズ等の要因が含まれる。また、グレースケールの画像情報が入力されることを考慮して、頻度がある一定値より少ない区間のヒストグラムが色相の選択には使用されないようにしてもよい。例えば、図11で横軸(色相)に平行な「有効最小頻度」を設定し、頻度が有効最小頻度未満のものは色相選択の対象から外すようにする。すると、実際には「Yellow」と「Green」(緑)のいずれかから、頻度が最も多い色相が選ばれるようになる。   Subsequently, the color information specifying unit 41 selects a hue with the highest frequency based on the histogram of the hue information. The hue with the highest frequency is the dominant “color” in the image information. In FIG. 11, the section “Yellow” (yellow) is the section with the highest frequency. This includes factors such as illumination light and lenses in addition to green color filters. In consideration of the input of grayscale image information, a histogram of a section having a frequency less than a certain fixed value may not be used for selection of hue. For example, “effective minimum frequency” parallel to the horizontal axis (hue) in FIG. 11 is set, and those whose frequency is less than the effective minimum frequency are excluded from hue selection targets. Then, the hue with the highest frequency is actually selected from either “Yellow” or “Green”.

続いて、色情報指定部41は、画像情報において支配的な「色相」に対する「補色」を決定し、これをコントラスト評価値の算出に使用する色別画像情報として決定する。画像情報で支配的な「色」に該当する輝度情報は比較的大きい(明るい)傾向となるため、最大輝度付近に飽和する可能性がある。飽和に近い輝度情報は、階調が十分に再現できていないため、コントラスト評価値の算出にその輝度情報を使用すると、コントラスト評価値を適切に算出することができない。このことを踏まえ、画像情報で支配的な「色」に対して、反対の「色」=「補色」は、飽和に近い輝度情報が少ないため、「補色」を用いれば適切なコントラスト評価値を算出することができる。例えば、図11で頻度が最も多い色相が「Yellow」であれば、その補色は「Blue」(青)であるから、RGBからなる画像情報のうちB(青)の色別画像情報を用いてコントラスト評価値が算出される。以降のコントラスト評価値の算出については第1の実施形態と同様の方法がとられる。   Subsequently, the color information specifying unit 41 determines “complementary color” for “hue” dominant in the image information, and determines this as image information for each color used for calculation of the contrast evaluation value. Luminance information corresponding to “color” dominant in image information tends to be relatively large (bright), and may be saturated near the maximum luminance. Since the luminance information close to saturation cannot reproduce the gradation sufficiently, if the luminance information is used for calculating the contrast evaluation value, the contrast evaluation value cannot be calculated appropriately. Based on this, the opposite “color” = “complementary color” has little luminance information close to saturation with respect to the “color” dominant in the image information. Therefore, if “complementary color” is used, an appropriate contrast evaluation value is obtained. Can be calculated. For example, if the hue having the highest frequency in FIG. 11 is “Yellow”, the complementary color is “Blue”, and therefore image information for each color of B (blue) among the image information of RGB is used. A contrast evaluation value is calculated. For the subsequent calculation of the contrast evaluation value, the same method as in the first embodiment is used.

このように画像情報の色相を調べ、画像情報で支配的な「色」の「補色」からなる色別画像情報をコントラスト評価値の算出に利用することによって、画面の色の影響を最小限にした精度の高いAF処理が可能となる。なお、「補色」を決定する処理を、画像情報が入力される度に行う必要はない。例えば、検査装置や顕微鏡のセッティングの段階で基準の被検査対象を用いて1度だけ処理を行う、または最初の検査において被検査対象を撮像した画像情報を用いて1度だけ処理を行う等によって決定した色情報を以降の検査に反映させるようにしてもよい。また、被検査対象の種類や観察方法によって画像情報の「色相」が異なる場合は、検査条件に関する情報を活用すればよい。例えば、別途に色情報に関する記憶部を設け、検査条件に対応した「補色」の情報をその記憶部に記憶させ、実際の検査では検査条件から「補色」の情報を引き当てるようにする等としてもよい。   In this way, the hue of the image information is examined, and the color-dependent image information consisting of “complementary colors” that are dominant in the image information is used for calculating the contrast evaluation value, thereby minimizing the influence of the screen color. Thus, highly accurate AF processing can be performed. Note that the process of determining “complementary colors” need not be performed every time image information is input. For example, processing is performed only once using the reference inspection target at the stage of setting the inspection apparatus or microscope, or processing is performed only once using image information obtained by imaging the inspection target in the first inspection. The determined color information may be reflected in subsequent inspections. In addition, when the “hue” of the image information differs depending on the type of the object to be inspected and the observation method, information on the inspection conditions may be used. For example, a separate storage unit for color information may be provided so that “complementary color” information corresponding to the inspection condition is stored in the storage unit, and “complementary color” information is assigned from the inspection condition in actual inspection. Good.

上述したように、本実施形態のオートフォーカス装置は、観察系から推定される焦点深度と、コントラスト評価値の算出に要する時間とに基づいて、Z位置の変化の初速度を設定する。これによって、低速駆動と同等の精度を維持しつつ、Z位置を高速に変化させることのできるAF処理を実現することができる。   As described above, the autofocus device according to the present embodiment sets the initial speed of the change in the Z position based on the depth of focus estimated from the observation system and the time required to calculate the contrast evaluation value. As a result, it is possible to realize an AF process that can change the Z position at high speed while maintaining the same accuracy as that of low-speed driving.

また、本実施形態のオートフォーカス装置は、コントラスト評価値の時系列変化に基づいて、Z位置の変化の速度を制御する。装置全体の制御で負荷が増加してしまうことによって、コントラスト評価値の算出時間(コントラスト評価値算出部26の処理時間)が増加する場合であっても、算出時間の変化の度合に応じてZ位置の変化の速度を変更することによって、安定した精度を維持できるAF処理を実現することができる。   In addition, the autofocus device according to the present embodiment controls the speed of change of the Z position based on the time series change of the contrast evaluation value. Even if the calculation time of the contrast evaluation value (the processing time of the contrast evaluation value calculation unit 26) increases due to an increase in the load due to the control of the entire apparatus, Z depends on the degree of change in the calculation time. By changing the speed of the position change, it is possible to realize AF processing capable of maintaining stable accuracy.

また、本実施形態のオートフォーカス装置は、画像情報の色相から、最も頻度の多い支配的な色の補色に対応する色情報を指定し、コントラスト評価値の算出に用いる。画像全体において、占める割合が最も多く支配的な色を画像支配色と定義すると、画像支配色の補色に対応する色情報は、輝度の頻度が明るい方向に偏っていない。これはすなわち、画像のコントラスト評価値に影響する「飽和(白とび)」が最も少ないことを示している。従って、コントラスト評価値の算出に有効となる情報が最も多い色情報を利用することにより、適切な画像のコントラスト評価値を算出することができ、精度の高いAF処理を実現することができる。   In addition, the autofocus device according to the present embodiment designates color information corresponding to the complementary color of the most frequent dominant color from the hue of the image information, and uses it to calculate the contrast evaluation value. If the dominant color that occupies the most in the entire image is defined as the image dominant color, the color information corresponding to the complementary color of the image dominant color is not biased toward the brighter frequency. This indicates that “saturation (overexposure)” that affects the contrast evaluation value of the image is the smallest. Therefore, by using the color information that has the most information that is effective for calculating the contrast evaluation value, it is possible to calculate the contrast evaluation value of an appropriate image and to realize highly accurate AF processing.

以上、図面を参照して本発明の実施形態について詳述してきたが、具体的な構成はこれらの実施形態に限られるものではなく、この発明の要旨を逸脱しない範囲の設計変更等も含まれる。   As described above, the embodiments of the present invention have been described in detail with reference to the drawings. However, the specific configuration is not limited to these embodiments, and includes design changes and the like without departing from the gist of the present invention. .

本発明の第1の実施形態による検査装置の構成を示す概略構成図である。It is a schematic block diagram which shows the structure of the test | inspection apparatus by the 1st Embodiment of this invention. 本発明の第1の実施形態によるAF装置の構成を示すブロック図である。1 is a block diagram illustrating a configuration of an AF apparatus according to a first embodiment of the present invention. 本発明の第1の実施形態によるコントラスト評価値算出部の構成を示すブロック図である。It is a block diagram which shows the structure of the contrast evaluation value calculation part by the 1st Embodiment of this invention. 本発明の第1の実施形態におけるコントラスト評価値の算出に利用するサンプリングラインパターンの一例を示す参考図である。It is a reference figure showing an example of a sampling line pattern used for calculation of contrast evaluation values in a 1st embodiment of the present invention. 本発明の第1の実施形態によるAF装置の動作の手順を示すフローチャートである。It is a flowchart which shows the procedure of operation | movement of AF apparatus by the 1st Embodiment of this invention. 本発明の第1の実施形態におけるコントラスト評価値の極大値の妥当性の判断方法とZ方向モータの駆動速度の変更方法を説明するための参考図である。FIG. 5 is a reference diagram for explaining a method for determining the validity of the maximum value of the contrast evaluation value and a method for changing the driving speed of the Z-direction motor in the first embodiment of the present invention. 本発明の第1の実施形態における合焦位置の算出方法を説明するための参考図である。It is a reference figure for demonstrating the calculation method of the focus position in the 1st Embodiment of this invention. 本発明の第1の実施形態におけるZ位置およびコントラスト評価値とカウンタ値との関連付けを説明するための参考図である。FIG. 6 is a reference diagram for explaining association between a Z position, a contrast evaluation value, and a counter value in the first embodiment of the present invention. 本発明の第1の実施形態におけるカウンタの値の推移とZ位置およびコントラスト評価値の変化とを示す参考図である。It is a reference figure showing change of a value of a counter in a 1st embodiment of the present invention, and change of a Z position and contrast evaluation value. 本発明の第2の実施形態によるAF装置の動作の手順を示すフローチャートである。It is a flowchart which shows the procedure of operation | movement of AF apparatus by the 2nd Embodiment of this invention. 本発明の第2の実施形態における色情報指定部41での処理を説明するための参考図である。It is a reference diagram for demonstrating the process in the color information designation | designated part 41 in the 2nd Embodiment of this invention.

符号の説明Explanation of symbols

1・・・XYZステージ、2・・・FPDガラス基板、3・・・移動制御部、4・・・観察光学系、5・・・CCDカメラ、6・・・対物レンズ、7,8・・・リレーレンズ、9・・・照明装置、10・・・照明用リレーレンズ、11・・・ハーフミラー、12・・・AF装置、13・・・演算部、14・・・ディスプレイ、21・・・駆動モータ用パルス出力部、22・・・駆動モータ用パルス読み取り部、23・・・Z位置算出部、24・・・CPU、25・・・カメラ画像取り込み部、26・・・コントラスト評価値算出部、27・・・経過時間計測用カウンタ部、28・・・カウンタ読み取り部、29・・・Z位置記憶部、30・・・カウンタ記憶部、31・・・コントラスト評価値記憶部、32・・・コントラスト評価値極大値判定部、33・・・コントラスト評価値極大Z位置算出部、34・・・走査方式選択部、35・・・色情報選択部、41・・・色情報指定部、42・・・走査切替部、43・・・フィールド分離部、44・・・コントラスト評価値演算部、45・・・フィールド別評価値合成部

DESCRIPTION OF SYMBOLS 1 ... XYZ stage, 2 ... FPD glass substrate, 3 ... Movement control part, 4 ... Observation optical system, 5 ... CCD camera, 6 ... Objective lens, 7, 8, ... Relay lens, 9 ... lighting device, 10 ... lighting relay lens, 11 ... half mirror, 12 ... AF device, 13 ... calculation unit, 14 ... display, 21 ... Drive motor pulse output unit, 22 ... Drive motor pulse reading unit, 23 ... Z position calculation unit, 24 ... CPU, 25 ... Camera image capturing unit, 26 ... Contrast evaluation value Calculation unit, 27... Elapsed time measurement counter unit, 28... Counter reading unit, 29... Z position storage unit, 30. ... Maximum contrast evaluation value , 33 ... Contrast evaluation value maximum Z position calculation part, 34 ... Scanning method selection part, 35 ... Color information selection part, 41 ... Color information designation part, 42 ... Scan switching part, 43... Field separation unit, 44... Contrast evaluation value calculation unit, 45.

Claims (10)

観察対象物を撮像し、画像情報を生成する撮像手段と、
前記観察対象物と観察光学系との間の距離を変化させる移動制御手段と、
前記距離を検出する検出手段と、
画像の走査方式を指定する走査方式指定手段と、
指定された前記画像の走査方式に合わせ、前記画像情報のコントラストの度合を示すコントラスト評価値を算出し、算出した前記コントラスト評価値を合成して前記画像情報の前記コントラスト評価値とする評価値算出手段と、
前記距離と、前記評価値算出手段によって算出された前記コントラスト評価値とを対応させて記憶する記憶手段と、
前記記憶手段に記憶されている前記コントラスト評価値の時系列変化における極大を判定する判定手段と、
前記判定手段によって極大と判定された前記コントラスト評価値に対応する前記距離に基づいて、画像のコントラストが極大となる距離を算出する距離算出手段と、
を備えたことを特徴とするオートフォーカス装置。
An imaging means for imaging an observation object and generating image information;
Movement control means for changing the distance between the observation object and the observation optical system;
Detecting means for detecting the distance;
Scanning method designating means for designating an image scanning method;
In accordance with the designated image scanning method, a contrast evaluation value indicating the degree of contrast of the image information is calculated, and the calculated contrast evaluation value is combined to be used as the contrast evaluation value of the image information. Means,
Storage means for storing the distance and the contrast evaluation value calculated by the evaluation value calculation means in association with each other;
Determination means for determining a local maximum in the time series change of the contrast evaluation value stored in the storage means;
Distance calculation means for calculating a distance at which the contrast of the image is maximum based on the distance corresponding to the contrast evaluation value determined to be maximum by the determination means;
An autofocus device characterized by comprising:
前記評価値算出手段は、前記走査方式指定手段によって指定された前記走査方式がインターレースの場合には、前記画像情報を奇数フィールドと偶数フィールドに分離して、前記コントラスト評価値をフィールド毎に算出し、算出した前記コントラスト評価値を合成して前記画像情報の前記コントラスト評価値とすることを特徴とする請求項1に記載のオートフォーカス装置。   The evaluation value calculation means calculates the contrast evaluation value for each field by separating the image information into odd fields and even fields when the scanning method designated by the scanning method designation means is interlaced. The autofocus device according to claim 1, wherein the calculated contrast evaluation values are combined to obtain the contrast evaluation value of the image information. 観察対象物を撮像し、画像情報を生成する撮像手段と、
前記観察対象物と観察光学系との間の距離を変化させる移動制御手段と、
前記距離を検出する検出手段と、
前記コントラスト評価値の算出に用いる前記画像情報の色情報を指定する色情報指定手段と、
前記色情報指定手段によって指定された色情報で構成される画像データを用いて、前記画像情報のコントラストの度合を示すコントラスト評価値を算出する評価値算出手段と、
前記距離と、前記評価値算出手段によって算出された前記コントラスト評価値とを対応させて記憶する記憶手段と、
前記記憶手段に記憶されている前記コントラスト評価値の時系列変化における極大を判定する判定手段と、
前記判定手段によって極大と判定された前記コントラスト評価値に対応する前記距離に基づいて、画像のコントラストが極大となる距離を算出する距離算出手段と、
を備えたことを特徴とするオートフォーカス装置。
An imaging means for imaging an observation object and generating image information;
Movement control means for changing the distance between the observation object and the observation optical system;
Detecting means for detecting the distance;
Color information specifying means for specifying color information of the image information used for calculation of the contrast evaluation value;
Evaluation value calculating means for calculating a contrast evaluation value indicating the degree of contrast of the image information, using image data composed of the color information specified by the color information specifying means;
Storage means for storing the distance and the contrast evaluation value calculated by the evaluation value calculation means in association with each other;
Determination means for determining a local maximum in the time series change of the contrast evaluation value stored in the storage means;
Distance calculation means for calculating a distance at which the contrast of the image is maximum based on the distance corresponding to the contrast evaluation value determined to be maximum by the determination means;
An autofocus device characterized by comprising:
前記移動制御手段は、前記記憶手段によって記憶されている前記コントラスト評価値の時系列変化に基づいて、前記観察対象物と前記観察光学系との間の前記距離の変化の速度を制御することを特徴とする請求項1〜請求項3のいずれかの項に記載のオートフォーカス装置。   The movement control means controls the speed of change in the distance between the observation object and the observation optical system based on a time series change in the contrast evaluation value stored in the storage means. The autofocus device according to any one of claims 1 to 3, wherein the autofocus device is characterized. 前記移動制御手段は、前記評価値算出手段が前記コントラスト評価値の算出に要する時間の変化に基づいて、前記観察対象物と前記観察光学系との間の前記距離の変化の速度を制御することを特徴とする請求項1〜請求項3のいずれかの項に記載のオートフォーカス装置。   The movement control means controls the speed of change in the distance between the observation object and the observation optical system based on a change in time required for the evaluation value calculation means to calculate the contrast evaluation value. The autofocus device according to any one of claims 1 to 3, wherein: 前記移動制御手段は、前記観察光学系から推定される焦点深度と、前記評価値算出手段が前記コントラスト評価値の算出に要する時間とに基づいて、前記観察対象物と前記観察光学系との間の前記距離の変化の初速度を設定することを特徴とする請求項1〜請求項5のいずれかの項に記載のオートフォーカス装置。   The movement control means is based on the depth of focus estimated from the observation optical system and the time required for the evaluation value calculation means to calculate the contrast evaluation value, between the observation object and the observation optical system. 6. The autofocus device according to claim 1, wherein an initial speed of a change in the distance is set. 前記判定手段は、最新の前記コントラスト評価値が、前記記憶手段によって記憶されている前記コントラスト評価値の中の最大値に対して所定の割合以下となったとき、または/および前記最大値が算出されてから、所定の回数連続して前記コントラスト評価値が減少したときに、前記最大値をとる前記コントラスト評価値が極大であると判断することを特徴とする請求項1〜請求項6のいずれかの項に記載のオートフォーカス装置。   The determination means calculates when the latest contrast evaluation value is equal to or less than a predetermined ratio with respect to the maximum value of the contrast evaluation values stored in the storage means, or / and the maximum value is calculated. 7. The method according to claim 1, wherein when the contrast evaluation value decreases continuously a predetermined number of times, the contrast evaluation value that takes the maximum value is determined to be maximal. The autofocus device according to any of the above items. 前記距離算出手段は、極大と判定された前記コントラスト評価値の前後に取得された前記コントラスト評価値と、各々の前記コントラスト評価値に対応する前記距離を前記記憶手段から読み出し、読み出した前記コントラスト評価値を補間することによって推定される近似関数に基づいて、画像のコントラストが極大となる前記距離を算出することを特徴とする請求項1〜請求項7のいずれかの項に記載のオートフォーカス装置。   The distance calculating unit reads the contrast evaluation values acquired before and after the contrast evaluation value determined to be maximal and the distance corresponding to each of the contrast evaluation values from the storage unit, and reads the read contrast evaluation values 8. The autofocus device according to claim 1, wherein the distance at which the contrast of the image is maximized is calculated based on an approximate function estimated by interpolating values. . 前記検出手段が前記距離を検出した第1のタイミングと、前記評価値算出手段が前記コントラスト評価値を算出した第2のタイミングとを取得するタイミング取得手段をさらに備え、前記記憶手段は、前記タイミング取得手段によって取得された前記第1のタイミングを前記距離に対応付けて記憶すると共に、前記第2のタイミングを前記コントラスト評価値に対応付けて記憶することを特徴とする請求項1〜請求項8のいずれかの項に記載のオートフォーカス装置。   The storage means further comprises timing acquisition means for acquiring a first timing at which the detection means has detected the distance and a second timing at which the evaluation value calculation means has calculated the contrast evaluation value. The first timing acquired by the acquisition unit is stored in association with the distance, and the second timing is stored in association with the contrast evaluation value. The autofocus device according to any one of the items. 前記色情報指定手段は、前記画像情報の色相から、最も頻度の多い色の補色に対応する色情報を指定することを特徴とする請求項3〜請求項9のいずれかの項に記載のオートフォーカス装置。

10. The auto according to claim 3, wherein the color information designating unit designates color information corresponding to a complementary color of the most frequent color from the hue of the image information. Focus device.

JP2005131660A 2005-04-28 2005-04-28 Automatic focusing device Pending JP2006308884A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005131660A JP2006308884A (en) 2005-04-28 2005-04-28 Automatic focusing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005131660A JP2006308884A (en) 2005-04-28 2005-04-28 Automatic focusing device

Publications (1)

Publication Number Publication Date
JP2006308884A true JP2006308884A (en) 2006-11-09

Family

ID=37475845

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005131660A Pending JP2006308884A (en) 2005-04-28 2005-04-28 Automatic focusing device

Country Status (1)

Country Link
JP (1) JP2006308884A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008197612A (en) * 2007-01-17 2008-08-28 Fuji Electric Holdings Co Ltd Image display apparatus and image display program
JP2009003152A (en) * 2007-06-21 2009-01-08 Sharp Corp Focus adjustment device and focus adjustment method for camera module
JP2010175696A (en) * 2009-01-28 2010-08-12 Nikon Corp Autofocus device
WO2011087115A1 (en) * 2010-01-12 2011-07-21 Ricoh Company, Ltd. Auto-focus controlling apparatus, electronic imaging apparatus and digital still camera
WO2013077073A1 (en) * 2011-11-25 2013-05-30 オリンパス株式会社 Imaging device and imaging method
JP2015203774A (en) * 2014-04-14 2015-11-16 キヤノン株式会社 Image-capturing device and control method thereof
JP2019095804A (en) * 2019-02-07 2019-06-20 株式会社ニコン Focus detection device and camera
JP2020043337A (en) * 2016-02-25 2020-03-19 株式会社東京精密 Control device and control method

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05288981A (en) * 1992-04-14 1993-11-05 Sony Corp Automatic focusing device
JPH0638089A (en) * 1992-07-20 1994-02-10 Konica Corp Automatic focusing device
JPH06133203A (en) * 1992-10-20 1994-05-13 Sankyo Seiki Mfg Co Ltd Automatic focal position detector and automatic focusing device provided with it
JP2002318341A (en) * 2001-04-20 2002-10-31 Fuji Photo Film Co Ltd Device and method for automatic focusing
JP2004085673A (en) * 2002-08-23 2004-03-18 Fuji Photo Optical Co Ltd Autofocus system
JP2004361484A (en) * 2003-06-02 2004-12-24 Nikon Corp Autofocus camera
JP2005010313A (en) * 2003-06-17 2005-01-13 Minolta Co Ltd Imaging device
JP2005055744A (en) * 2003-08-06 2005-03-03 Minolta Co Ltd Imaging apparatus and program

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05288981A (en) * 1992-04-14 1993-11-05 Sony Corp Automatic focusing device
JPH0638089A (en) * 1992-07-20 1994-02-10 Konica Corp Automatic focusing device
JPH06133203A (en) * 1992-10-20 1994-05-13 Sankyo Seiki Mfg Co Ltd Automatic focal position detector and automatic focusing device provided with it
JP2002318341A (en) * 2001-04-20 2002-10-31 Fuji Photo Film Co Ltd Device and method for automatic focusing
JP2004085673A (en) * 2002-08-23 2004-03-18 Fuji Photo Optical Co Ltd Autofocus system
JP2004361484A (en) * 2003-06-02 2004-12-24 Nikon Corp Autofocus camera
JP2005010313A (en) * 2003-06-17 2005-01-13 Minolta Co Ltd Imaging device
JP2005055744A (en) * 2003-08-06 2005-03-03 Minolta Co Ltd Imaging apparatus and program

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008197612A (en) * 2007-01-17 2008-08-28 Fuji Electric Holdings Co Ltd Image display apparatus and image display program
JP2009003152A (en) * 2007-06-21 2009-01-08 Sharp Corp Focus adjustment device and focus adjustment method for camera module
JP2010175696A (en) * 2009-01-28 2010-08-12 Nikon Corp Autofocus device
US8964105B2 (en) 2010-01-12 2015-02-24 Ricoh Company, Ltd. Auto-focus controlling apparatus, electronic imaging apparatus and digital still camera
CN102812391A (en) * 2010-01-12 2012-12-05 株式会社理光 Auto-focus controlling apparatus, electronic imaging apparatus and digital still camera
WO2011087115A1 (en) * 2010-01-12 2011-07-21 Ricoh Company, Ltd. Auto-focus controlling apparatus, electronic imaging apparatus and digital still camera
WO2013077073A1 (en) * 2011-11-25 2013-05-30 オリンパス株式会社 Imaging device and imaging method
JP2013113903A (en) * 2011-11-25 2013-06-10 Olympus Corp Imaging apparatus and imaging method
CN103562769A (en) * 2011-11-25 2014-02-05 奥林巴斯株式会社 Imaging device and imaging method
US8872963B2 (en) 2011-11-25 2014-10-28 Olympus Corporation Imaging apparatus and imaging method
JP2015203774A (en) * 2014-04-14 2015-11-16 キヤノン株式会社 Image-capturing device and control method thereof
JP2020043337A (en) * 2016-02-25 2020-03-19 株式会社東京精密 Control device and control method
JP2019095804A (en) * 2019-02-07 2019-06-20 株式会社ニコン Focus detection device and camera

Similar Documents

Publication Publication Date Title
JP3733392B2 (en) Image composition change detection method
JP6179827B2 (en) How to generate a focus signal
JP2006308884A (en) Automatic focusing device
US20180115698A1 (en) Focus adjusting device and focus adjusting program with control unit to guide a light image based upon detected distributions
JP5459717B2 (en) Method for generating a focus signal in an autofocus image system
JP5446076B2 (en) Digital camera
US8373789B2 (en) Auto focus system and auto focus method
RU2011140241A (en) SYSTEM AND METHOD OF IMPROVED AUTO FOCUSING WITH PREDICTION
US8860874B2 (en) Imaging sensing device, image sensing processing device, and image processing method
KR100897768B1 (en) An automatic focusing method and apparatus for using the same
EP3035104B1 (en) Microscope system and setting value calculation method
JP2012073285A (en) Imaging method and microscope device
US8872963B2 (en) Imaging apparatus and imaging method
KR101510107B1 (en) Photographing apparatus and method
CN105430277B (en) Autofocus control method and device
US20150138335A1 (en) Observation apparatus
US8212865B2 (en) Microscope image pickup apparatus, microscope image pickup program product, microscope image pickup program transmission medium and microscope image pickup method
US6979808B2 (en) Autofocus control apparatus and method
US8488048B2 (en) Image pickup apparatus for finding in-focus direction based on focus signal and control method for the image pickup apparatus
JP2015152749A (en) Imaging device and control method of the same
JP5223912B2 (en) Imaging apparatus and focus determination program
JP2018010023A (en) Focusing control device, focusing control method, focusing control program, lens device, and imaging apparatus
JP5920608B2 (en) Imaging system and method for evaluating image sharpness
JP6312410B2 (en) Alignment apparatus, microscope system, alignment method, and alignment program
US7161127B2 (en) Automatic focusing apparatus and automatic focusing method using an index value based on background color information

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20080423

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100727

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20101220