JP2932537B2 - Automatic focus adjustment device - Google Patents

Automatic focus adjustment device

Info

Publication number
JP2932537B2
JP2932537B2 JP1301081A JP30108189A JP2932537B2 JP 2932537 B2 JP2932537 B2 JP 2932537B2 JP 1301081 A JP1301081 A JP 1301081A JP 30108189 A JP30108189 A JP 30108189A JP 2932537 B2 JP2932537 B2 JP 2932537B2
Authority
JP
Japan
Prior art keywords
focus adjustment
histogram
image
image quality
adjustment amount
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP1301081A
Other languages
Japanese (ja)
Other versions
JPH03160572A (en
Inventor
紫朗 藤枝
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.)
Omron Corp
Original Assignee
Omron 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 Omron Corp filed Critical Omron Corp
Priority to JP1301081A priority Critical patent/JP2932537B2/en
Publication of JPH03160572A publication Critical patent/JPH03160572A/en
Application granted granted Critical
Publication of JP2932537B2 publication Critical patent/JP2932537B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Automatic Focus Adjustment (AREA)
  • Image Input (AREA)
  • Image Processing (AREA)
  • Focusing (AREA)

Description

【発明の詳細な説明】 <産業上の利用分野> この発明は、撮像装置に設けられた光学系を駆動して
対象物の光学的結像距離を自動調整するための自動ピン
ト調整装置に関する。
Description: BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an automatic focus adjustment device for automatically adjusting an optical imaging distance of an object by driving an optical system provided in an imaging device.

<従来の技術> 例えば物体認識用の撮像装置では、良好な画質の画像
を得るために、作業者が手操作で光学系を駆動して試行
錯誤的にピント調整を行ったり、光学系から対象物まで
の距離を計測してその計測値に応じた最適な焦点位置を
算出してピント調整を行ったりしている。
<Prior Art> For example, in an image pickup apparatus for object recognition, in order to obtain an image of good image quality, an operator manually drives an optical system to perform focus adjustment by trial and error, or performs a target adjustment from the optical system. The focus adjustment is performed by measuring the distance to an object, calculating the optimum focus position according to the measured value, and the like.

<発明が解決しようとする問題点> しかしながら前者の方法では、対象物を変更すると、
その都度、同様のピント調整作業が必要であるため、作
業の迅速化や作業能率の向上は到底期待できない。
<Problems to be solved by the invention> However, in the former method, when the object is changed,
Since the same focus adjustment work is required each time, it is impossible to expect speeding up of work and improvement of work efficiency at all.

また後者の方法では、距離計測系が必要であるため、
装置全体が高価となり、しかも装置が大型化して設置ス
ペースが限定されるという不利がある。また光学系に用
いられるレンズの種類により焦点位置を算出するための
計算式が異なるため、装置の汎用性に欠け、しかも対象
物の背後に他の物体が存在すると、その物体に対してピ
ント調整が行われるなどの虞がある。
Also, the latter method requires a distance measurement system,
There is a disadvantage that the entire apparatus becomes expensive, and the apparatus becomes large-sized and installation space is limited. Also, since the formula for calculating the focal position differs depending on the type of lens used in the optical system, the versatility of the device is lacking, and if there is another object behind the object, the focus adjustment is performed on that object. May be performed.

この発明は、上記問題に着目してなされたもので、画
質を定量的に表す画質ヒストグラムを光学系のピント調
整に利用することにより、距離計測系を必要とせずに最
適かつ迅速なピント調整を可能とした自動ピント調整装
置を提供することを目的とする。
The present invention has been made in view of the above problem, and utilizes an image quality histogram that quantitatively expresses image quality for focus adjustment of an optical system, thereby achieving optimal and quick focus adjustment without the need for a distance measurement system. It is an object of the present invention to provide an automatic focus adjustment device that is enabled.

<問題点を解決するための手段> 請求項1に記載された発明は、撮像装置に設けられた
光学系を駆動して光学的結像距離を自動調整するため
に、ピント調整量を可変設定するための調整量設定手段
と、設定されたピント調整量に応じて光学系を駆動して
光学的結像距離を変化させるための駆動手段と、前記駆
動手段により光学的結像距離を変化させつつ得られた各
入力画像につき画像評価用の画質ヒストグラムを生成す
るヒストグラム生成手段と、生成された各画質ヒストグ
ラムのピーク値を用いて最適なピント調整量を判別する
判別手段とで、ピント調整装置を構成し、前記画像評価
用のヒストグラムとして、明るさレベルと、その明るさ
レベルにより前記入力画像を2値化処理して得られる2
値画像の滑らかさの度合いを示す度数データとの関係を
示すヒストグラムを、生成するようにしている。
<Means for Solving the Problems> The invention described in claim 1 variably sets a focus adjustment amount in order to automatically adjust an optical imaging distance by driving an optical system provided in an imaging apparatus. Adjustment amount setting means for driving, driving means for driving the optical system according to the set focus adjustment amount to change the optical imaging distance, and changing the optical imaging distance by the driving means. A histogram adjusting unit for generating an image quality histogram for image evaluation for each input image obtained while determining, and a determining unit for determining an optimal focus adjustment amount using a peak value of each of the generated image quality histograms. And a brightness level and a binary level obtained by binarizing the input image based on the brightness level as the histogram for image evaluation.
A histogram indicating the relationship with the frequency data indicating the degree of smoothness of the value image is generated.

また請求項2の発明では、前記判別手段に、各画質ヒ
ストグラムのピーク値を比較する比較手段を含ませ、そ
の比較結果に基づき最適なピント調整量を判別するよう
構成している。
According to a second aspect of the present invention, the discriminating means includes a comparing means for comparing the peak values of the respective image quality histograms, and the optimum focus adjustment amount is discriminated based on the comparison result.

さらに請求項3の発明では、請求項1と同様の調整量
設定手段,駆動手段,ヒストグラム生成手段のほか、ピ
ント調整の対象物を明るさを基準として指定する指定手
段と、各画質ヒストグラムの指定された対象物の明るさ
に対応するピーク値を用いて最適なピント調整量を判別
する判別手段とにより、自動ピント調整装置を構成して
いる。
According to the third aspect of the present invention, in addition to the adjustment amount setting means, the driving means, and the histogram generating means as in the first aspect, a designation means for designating an object of focus adjustment based on brightness, and a designation of each image quality histogram An automatic focus adjustment device is configured by a determination unit that determines an optimal focus adjustment amount using a peak value corresponding to the brightness of the target object.

<作用> ピント調整量を可変設定して光学系の光学的結像距離
を変化させつつ各入力画像の画質ヒストグラムを生成
し、各画質ヒストグラムのピーク値を用いて最適なピン
ト調整量を判別するので、最適かつ迅速なピントの自動
調整を行うことが可能であり、しかも最適な画質の画像
を得ることができる。
<Operation> An image quality histogram of each input image is generated while variably setting a focus adjustment amount to change an optical image forming distance of the optical system, and an optimum focus adjustment amount is determined using a peak value of each image quality histogram. Therefore, it is possible to perform the optimal and quick focus automatic adjustment, and to obtain an image with the optimal image quality.

なおこの最適な画質の画像を2値化処理する場合、そ
の画像につき得られた画像ヒストグラムのピーク値に対
応する明るさレベルで2値化したときに、最も滑らかな
2値画像が得られることになるから、最適な画質の画像
を得ると同時に、その画像を2値化処理するのに最適な
2値化しきい値を得ることができる。
When the image having the optimum image quality is subjected to the binarization processing, the smoothest binary image is obtained when the image is binarized at a brightness level corresponding to the peak value of the image histogram obtained for the image. Therefore, it is possible to obtain an image having an optimum image quality and, at the same time, obtain an optimum binarization threshold value for binarizing the image.

またピント調整の対象物を明るさを基準として指定し
てやれば、撮像装置の視野内に複数の物体が存在してい
ても、所望の物体にピントが合わせられる。
In addition, if an object to be adjusted is designated with reference to brightness, even if a plurality of objects exist in the field of view of the imaging device, a desired object can be focused.

<実施例> 第1図は、この発明の一実施例にかかる自動ピント調
整装置の概略構成を示すもので、撮像装置1,レンズ駆動
機構2,駆動制御装置3より構成されている。
<Embodiment> FIG. 1 shows a schematic configuration of an automatic focus adjustment apparatus according to an embodiment of the present invention, which comprises an imaging device 1, a lens drive mechanism 2, and a drive control device 3.

撮像装置1は、対象物5を撮像して濃淡画像を生成す
るテレビカメラであって、この撮像装置1にはピント調
整が可能な光学系4が設けてある。レンズ駆動機構2は
光学系4をモータ(図示せず)により所定角度範囲内で
正逆回動させることにより、光学系4の光学的結像距離
を変更するためのものである。
The imaging device 1 is a television camera that captures a target object 5 and generates a grayscale image. The imaging device 1 includes an optical system 4 that can perform focus adjustment. The lens drive mechanism 2 is for changing the optical imaging distance of the optical system 4 by rotating the optical system 4 forward and backward within a predetermined angle range by a motor (not shown).

駆動制御装置3は可変設定されたピント調整量(例え
ば電圧値)をレンズ駆動機構2に与えることにより、光
学系4の光学的結像距離を変化させつつその都度入力画
像の画質ヒストグラムを生成し、その画質ヒストグラム
のピーク値が最小となるピント調整量を最適値として求
めてそのピント調整量により光学系の光学結像距離を決
定する。
The drive control device 3 changes the optical imaging distance of the optical system 4 by generating a variable focus adjustment amount (for example, a voltage value) to the lens drive mechanism 2 to generate an image quality histogram of the input image each time. The amount of focus adjustment that minimizes the peak value of the image quality histogram is determined as the optimum value, and the optical imaging distance of the optical system is determined based on the amount of focus adjustment.

第2図は、画質ヒストグラムの具体例を示すもので、
横軸に2値化レベル、縦軸に画質の悪さがとってある。
同図中、実線はピントの合った入力画像より求めた画質
ヒストグラム6を、また破線はピントのぼけた入力画像
より求めた画質ヒストグラム7を、それぞれ示してお
り、前者の画質ヒストグラム6のピーク値p1が後者の画
質ヒストグラム7のピーク値p2より小さな値となってい
る。
FIG. 2 shows a specific example of the image quality histogram.
The horizontal axis represents the binarization level, and the vertical axis represents poor image quality.
In the figure, the solid line indicates the image quality histogram 6 obtained from the in-focus input image, and the broken line indicates the image quality histogram 7 obtained from the out-of-focus input image. The peak value of the former image quality histogram 6 is shown. p 1 is a value smaller than the peak value p 2 of the latter quality histograms 7.

従ってピーク値が最小となる画質ヒストグラムが得ら
れたとき、その入力画像についてのピント調整量を最適
値として決定することになる。
Therefore, when the image quality histogram with the minimum peak value is obtained, the focus adjustment amount for the input image is determined as the optimum value.

上記の画質ヒストグラムは、出願人が以前に提案した
公知例(特開昭64−51586号)を利用して生成するもの
で、第3図にその公知例による駆動制御装置3の構成が
具体的に示してある。
The above-mentioned image quality histogram is generated by using a known example (Japanese Patent Laid-Open No. 64-51586) proposed by the applicant before, and FIG. 3 shows a specific configuration of the drive control device 3 according to the known example. It is shown in

図示例の駆動制御装置3は、マイクロコンピュータ10
を制御主体とし、ウィンドウ走査部11,非合法パターン
検出部12,非合法パターンヒストグラム生成部13,明るさ
ヒストグラム生成部14,画質ヒストグラム生成部15,ヒス
トグラム平滑処理部16,ピーク値探索部17を具備してい
る。
The drive control device 3 in the illustrated example includes a microcomputer 10
The window scanning unit 11, the illegal pattern detection unit 12, the illegal pattern histogram generation unit 13, the brightness histogram generation unit 14, the image quality histogram generation unit 15, the histogram smoothing unit 16, and the peak value search unit 17 I have it.

ウィンドウ走査部11は、マイクロコンピュータ10にCP
Uバス18を介して接続されたアドレスジェネレータ19
と、このアドレスジェネレータ19に画像バス20を介して
接続された画像メモリ24と、前記画像バス20のデータバ
ス23に接続されたFIFO(first−in first−out)方式の
第1のシフトレジスタ25および第1群のラッチ回路26〜
29と、この最終段のラッチ回路29に接続された同じFIFO
方式の第2のシフトレジスタ30および第2群のラッチ回
路31〜34とから構成されている。
The window scanning unit 11 controls the microcomputer 10
Address generator 19 connected via U bus 18
And an image memory 24 connected to the address generator 19 via an image bus 20, and a first shift register 25 of a FIFO (first-in first-out) system connected to a data bus 23 of the image bus 20. And the first group of latch circuits 26 to
29 and the same FIFO connected to this last-stage latch circuit 29
A second shift register 30 and a second group of latch circuits 31 to 34 are provided.

図示例のウィンドウ走査部11は、画像メモリ24に記憶
された濃淡画像上に、第4図に示すような矩形状のウィ
ンドウ35を設定してラスタ走査するためのものであっ
て、このウィンドウ35内の画像につき所定の画素A0〜A7
の明るさデータd0〜d7が同時に取り出されるようになっ
ている。なお図中、×印は処理対象外の画素である。
The window scanning unit 11 in the illustrated example is for setting a rectangular window 35 as shown in FIG. 4 on the grayscale image stored in the image memory 24 and performing raster scanning. Predetermined pixels A 0 to A 7 for the image in
Brightness data d 0 to d 7 is adapted to be taken out simultaneously. In the figure, the crosses indicate pixels that are not to be processed.

すなわちアドレスジェネレータ19は画像メモリ24の各
画素のアドレスを順次生成して、そのアドレスに対応す
る画素の明るさデータを画像バス20を介して第1のシフ
トレジスタ25へ出力させる。なお画像バス20のうち、ア
ドレスバス21はアドレスを、データバス23は明るさデー
タを、コントロールバス22はアドレスストローブ信号や
リード・ライト信号を、それぞれ伝送する。第1のシフ
トレジスタ25は画像メモリ24の横方向の画素数をn(第
4図参照)とすると、このnより第1群のラッチ回路26
〜29の段数を差し引いた段数(n−4)をもつものであ
って、この段数分だけ明るさデータの出力を遅延させる
動作を実行する。第1群の4段のラッチ回路26〜29は全
体としてシフトレジスタの動作を行い、最終段のラッチ
回路29の出力が第2のシフトレジスタ30へ出力される。
この第2のシフトレジスタ30も(n−4)の段数を有
し、この段数分だけ明るさデータの出力を遅延させて第
2群の4段のラッチ回路31〜34へ伝える。
That is, the address generator 19 sequentially generates the address of each pixel in the image memory 24, and outputs the brightness data of the pixel corresponding to the address to the first shift register 25 via the image bus 20. In the image bus 20, an address bus 21 transmits an address, a data bus 23 transmits brightness data, and a control bus 22 transmits an address strobe signal and a read / write signal. Assuming that the number of pixels in the horizontal direction of the image memory 24 is n (see FIG. 4), the first shift register 25 has a first group of latch circuits 26 based on this n.
An operation of delaying the output of the brightness data by the number of stages (n-4) obtained by subtracting the number of stages of ~ 29 is executed. The first group of four-stage latch circuits 26 to 29 perform the operation of the shift register as a whole, and the output of the last-stage latch circuit 29 is output to the second shift register 30.
The second shift register 30 also has (n-4) stages, and outputs the brightness data to the second group of four-stage latch circuits 31 to 34 by delaying the output by the number of stages.

かくて第1段および第2段の各ラッチ回路26〜29,31
〜34と第2のシフトレジスタ30とから同時に明るさデー
タが取り出されるもので、第1群のラッチ回路26〜28の
各出力は前記ウィンドウ35内の画素A0〜A2の明るさデー
タd0〜d2を与え、また第2のシフトレジスタ30および第
2群のラッチ回路31〜34の各出力はウィンドウ35内の画
素A3〜A7の明るさデータd3〜d7を与えることになる。
Thus, the first-stage and second-stage latch circuits 26 to 29, 31
34 and the second shift register 30 simultaneously extract brightness data, and the outputs of the first group of latch circuits 26 to 28 output the brightness data d of the pixels A 0 to A 2 in the window 35. 0 to d 2 gives also the output of the second shift register 30 and the second group of latch circuits 31 to 34 to give the brightness data d 3 to d 7 of the pixel a 3 to a 7 in the window 35 become.

各画素A0〜A7の明るさデータd0〜d7は非合法パターン
検出部12へ出力されると共に、特定画素A1の明るさデー
タd1については非合法パターンヒストグラム生成部13お
よび明るさヒストグラム生成部14にも出力される。
Brightness data d 0 to d 7 of the respective pixels A 0 to A 7 together with the output to the illegal pattern detecting section 12, illegal pattern histogram generation unit 13 and the brightness for the brightness data d 1 of the specific pixel A 1 It is also output to the histogram generation unit 14.

非合法パターン検出部12はこれら明るさd0〜d7を取り
込み、特定の画素A1の明るさデータd1をしきい値として
ウィンドウ35内の各画素を2値化した後、その2値パタ
ーンが合法パターンに該当するのか、非合法パターンに
該当するのかを判断する。もし非合法パターンであれば
検出フラグ「1」が出力され、非合法パターンヒストグ
ラム生成部13において明るさ(しきい値)毎の非合法パ
ターンの発生度数が計数されて、非合法パターンヒスト
グラムが生成される。同様に明るさヒストグラム生成部
14では各明るさの度数が計数されて明るさヒストグラム
が生成される。
Illegal pattern detector 12 fetches these brightness d 0 to d 7, after binarizing the pixels in the window 35 brightness data d 1 specific pixel A 1 as a threshold value, the binary It is determined whether the pattern corresponds to a legal pattern or an illegal pattern. If the pattern is an illegal pattern, a detection flag “1” is output, and the frequency of occurrence of the illegal pattern for each brightness (threshold) is counted in the illegal pattern histogram generation unit 13 to generate an illegal pattern histogram. Is done. Similarly, brightness histogram generator
At 14, the frequency of each brightness is counted and a brightness histogram is generated.

なおここで合法パターンとは滑らかな画像上に頻繁に
現れる第5図に例示するような2値パターンを意味し、
また非合法パターンとは滑らかでない画像上に頻繁に現
れる第6図に例示するような2値パターンを意味してい
る。第5,6図中、斜線部は「1」の2値データをもつ画
素であり、第6図の2値パターンでは「1」の画素領域
の内側に「0」の孔部36が生じている。
Here, the legal pattern means a binary pattern that frequently appears on a smooth image as exemplified in FIG.
An illegal pattern means a binary pattern that frequently appears on a non-smooth image as exemplified in FIG. In FIGS. 5 and 6, hatched portions are pixels having binary data of “1”, and in the binary pattern of FIG. 6, a hole 36 of “0” is formed inside the pixel region of “1”. I have.

このように非合法パターンヒストグラム生成部13は図
示しないメモリ上に非合法パターンヒストグラムfhist
(k)を生成する。ここでfhist(k)はしきい値kに
おける非合法パターンの発生度数を意味する。この実施
例の場合、非合法パターン検出部12で特定画素の明るさ
データd1をしきい値として他の画素の明るさデータd0
よびd2〜d7によるパターンを評価して、その結果がフラ
グflagで表されるから、非合法パターンヒストグラムf
hisk(k)はつぎの式に従って形成される。
As described above, the illegal pattern histogram generation unit 13 stores the illegal pattern histogram f hist on a memory (not shown).
(K) is generated. Here, f hist (k) means the frequency of occurrence of illegal patterns at the threshold value k. In this embodiment, by evaluating the pattern by the illegal pattern detecting unit luminance data d 0 other pixel brightness data d 1 of the specific pixel as the threshold at 12 and d 2 to d 7, as a result Is represented by the flag flag, the illegal pattern histogram f
hisk (k) is formed according to the following equation:

fhist(k)=fhist(k)+flag ‥‥ ただし非合法パターンヒストグラムの各要素はゼロで
初期化されているものとする。
f hist (k) = f hist (k) + flag ‥‥ However, it is assumed that each element of the illegal pattern histogram is initialized to zero.

また明るさヒストグラム生成部14は図示しないメモリ
上に明るさヒストグラムhist(k)を生成する。ここで
hist(k)は明るさkの画素の発生度数を意味してお
り、この明るさヒストグラムhist(k)は、同様につぎ
の式に従って生成される。
The brightness histogram generation unit 14 generates a brightness histogram hist (k) on a memory (not shown). here
hist (k) means the frequency of occurrence of a pixel of brightness k, and this brightness histogram hist (k) is similarly generated according to the following equation.

hist(k)=hist(k)+1 ‥‥ 第3図に戻って、画質ヒストグラム15は非合法パター
ンヒストグラムおよび明るさヒストグラムの生成が完了
した後、画質ヒストグラムqhist(k)を生成する。こ
の画質ヒストグラムqhist(k)は画質の評価基準、こ
の実施例では画質の悪さを示す基準を与えるもので、つ
ぎの式に従って生成される。
hist (k) = hist (k) + 1 ‥‥ Returning to FIG. 3, the image quality histogram 15 generates an image quality histogram q hist (k) after the generation of the illegal pattern histogram and the brightness histogram is completed. The image quality histogram q hist (k) provides an evaluation standard for image quality, in this embodiment, a standard indicating poor image quality, and is generated according to the following equation.

(1) hist(k)=0のとき qhist(k)=Q0 ‥‥ (2) hist(k)≠0のとき なお上式中、Q0は定数(最大値)である。(1) When hist (k) = 0 q hist (k) = Q 0 ‥‥ (2) When hist (k) ≠ 0 In the above equation, Q 0 is a constant (maximum value).

つぎに第3図のヒストグラム平滑処理部16は、必要に
応じて画質ヒストグラムqhist(k)を平滑化するため
のもので、その結果、第2図に示すような、平滑化され
た画質ヒストグラムが生成される。
Next, the histogram smoothing processing section 16 in FIG. 3 is for smoothing the image quality histogram q hist (k) as necessary. As a result, as shown in FIG. Is generated.

第2図において、横軸は2値化レベル(しきい値
k)、縦軸は画質の悪さであって、画質の悪さは2値化
レベルがLのときピークとなっている。
In FIG. 2, the horizontal axis represents the binarization level (threshold k), and the vertical axis represents the image quality. The image quality is peaked when the binarization level is L.

ピーク値探索部17は、このピーク値p1,p2を探索し、
その探索結果をCPUバス18を通じてマイクロコンピュー
タ10に知らせるのである。
The peak value search unit 17 searches for the peak values p 1 and p 2 ,
The search result is notified to the microcomputer 10 through the CPU bus 18.

第7図は、上記の装置例によるピント調整の制御手順
を示している。
FIG. 7 shows a control procedure of the focus adjustment by the above-described apparatus example.

同図のステップ1(図中「ST1」で示す)において、
駆動制御装置3のマイクロコンピュータ10はピント調整
量F0として初期値F1を設定し、その値をレベル駆動機構
2へ出力する(ステップ2)。レベル駆動機構2はこの
入力値に基づき光学系4を回転駆動して光学的結像距離
を設定する。
In step 1 of the figure (indicated by “ST1” in the figure),
The microcomputer 10 of the drive control unit 3 sets an initial value F 1 as the focus adjustment amount F 0, and outputs the value to a level drive mechanism 2 (Step 2). The level drive mechanism 2 drives the optical system 4 based on the input value to set the optical imaging distance.

つぎのステップ3で撮像装置1はこの光学的結像距離
により対象物5を撮像し、その濃淡画像は画像メモリ24
に格納される。つぎにステップ4では、駆動制御装置3
はこの入力画像につき画質ヒストグラムを生成し、その
画質ヒストカラムのピーク値(画質評価値)を求める。
この画質評価値はとりあえず最小の画質評価値H0として
マイクロコンピュータ10に取り込まれてメモリ(図示せ
ず)に記憶される。
In the next step 3, the image pickup apparatus 1 picks up an image of the object 5 based on the optical image forming distance, and stores the grayscale image in the image memory 24.
Is stored in Next, in step 4, the drive control device 3
Generates an image quality histogram for this input image, and obtains a peak value (image quality evaluation value) of the image quality history column.
The image quality evaluation value is stored in that time being taken into the microcomputer 10 as the minimum image quality evaluation value H 0 to a memory (not shown).

つぎにステップ5において、マイクロコンピュータ10
はピント調整量F0に所定の微小値ΔFを加算して新たな
ピント調整量F0を算出し、その値をレンズ駆動機構2へ
出力して光学系4を回転駆動し、これにより新たな光学
的結像距離を設定する(ステップ6)。
Next, in step 5, the microcomputer 10
It adds the predetermined minute value ΔF to the focus adjustment amount F 0 to calculate a new focus adjustment amount F 0, the optical system 4 and rotated and outputs the value to the lens driving mechanism 2, thereby a new An optical imaging distance is set (step 6).

つぎにステップ7で撮像装置1はこの光学的結像距離
により対象物5を撮像し、その濃淡画像は画像メモリ24
に格納される。つぎのステップ8では駆動制御装置3は
この入力画像につき画質ヒストグラムを生成し、その画
質ヒストグラムのピーク値を画質評価値H1として求め、
マイクロコンピュータ10のメモリに記憶させる。
Next, in step 7, the image pickup apparatus 1 picks up an image of the object 5 based on the optical imaging distance, and the grayscale image is stored in the image memory 24.
Is stored in Step 8 In the drive control unit 3 of the following produces a quality histogram per the input image, obtains the peak value of the image quality histogram as an image quality evaluation value H 1,
It is stored in the memory of the microcomputer 10.

つぎのステップ9ではマイクロコンピュータ10はこの
画質評価値H1が最小の画質評価値H0より小さいか否かを
判断しており、もしステップ8で求めた画質評価値H1
方が小さければ、ステップ9の「H0>H1」の判定が“YE
S"となり、ステップ10でこの画質評価値H1をもって最小
の画質評価値H0に置き代えてメモリに記憶させる。
Next Step 9 microcomputer 10 in the has determined whether the quality evaluation value H 1 is less than the minimum image quality evaluation value H 0, the smaller the better the image quality evaluation value H 1 that if obtained in step 8 The determination of “H 0 > H 1 ” in step 9 is “YE
S ", and this with an image quality evaluation value H 1 is stored in the memory instead placed a minimum of image quality evaluation value H 0 in step 10.

つぎのステップ11では、マイクロコンピュータ10はピ
ント調整量F0に所定の微小値ΔFを加算してつぎの新た
なピント調整量F0を算出し、その値をレンズ駆動機構2
へ出力して光学系4を回転駆動し、これにより新たな光
学的結像距離を設定する(ステップ12)。
In the next step 11, the microcomputer 10 focus adjustment amount F 0 to by adding a predetermined small value ΔF to calculate a new focus adjustment amount F 0 of the next, the lens driving mechanism 2 that value
To drive the optical system 4 to rotate, thereby setting a new optical imaging distance (step 12).

つぎに撮像装置1はこの光学的結像距離により対象物
5を撮像し、その濃淡画像は画像メモリ24に格納される
(ステップ13)。つぎのステップ14では駆動制御装置3
はこの入力画像につき画質ヒストグラムを生成し、その
画質ヒストグラムのピーク値を画質評価値H1として求
め、マイクロコンピュータ10のメモリに記憶させる。
Next, the image pickup apparatus 1 picks up an image of the object 5 based on the optical image formation distance, and the grayscale image is stored in the image memory 24 (step 13). In the next step 14, the drive control device 3
Generates a quality histogram per the input image, obtains the peak value of the image quality histogram as an image quality evaluation value H 1, is stored in the memory of the microcomputer 10.

つぎにステップ15でマイクロコンピュータ10はこの画
質評価値H1が最小の画質評価値H0より小さいか否かを判
断しており、もしステップ14で求めた画質評価値H1の方
が小さければ、ステップ15の「H0<H1」の判定が“NO"
となり、ステップ10へ戻って以下同様の手順が実行され
る。
Then the microcomputer 10 in step 15 is determined whether the quality evaluation value H 1 is the minimum image quality evaluation value H 0 is less than, the smaller the better the image quality evaluation value H 1 that if obtained in step 14 The determination of “H 0 <H 1 ” in step 15 is “NO”
Then, the process returns to step 10 and the same procedure is performed.

もしステップ14で求めた画質評価値H1が最小の画質評
価値H0より大きければ、この最小の画質評価値H0は最小
値を構成することになり、ステップ15の判定が“YES"と
なる。つぎのステップ16では、マイクロコンピュータ10
は現在のピント調整量F0より所定の微小値ΔFを減算し
て前回のピント調整量F0を算出し、その値を確定値とし
てレンズ駆動機構2へ出力して光学系4を回転駆動し、
これにより光学的結像距離を固定する(ステップ17)。
If If greater than the image quality evaluation value H 0 image quality evaluation value H 1 is the minimum determined at step 14, the image quality evaluation value H 0 of the minimum could be formed into a minimum value, the determination in step 15 the "YES" Become. In the next step 16, the microcomputer 10
Subtracts a predetermined small value ΔF than the current focus adjustment amount F 0 calculates the focus adjustment amount F 0 of the previous, the optical system 4 and rotated by the output to the lens driving mechanism 2 that value as the determined value ,
This fixes the optical imaging distance (step 17).

もし前記のステップ9において、ステップ8で求めた
画質評価値H1の方が最小の画質評価値H0より大きけれ
ば、ステップ9の「H0>H1」の判定が“NO"となってス
テップ18へ進み、マイクロコンピュータ10は現在のピン
ト調整量F0より所定の微小値ΔFを減算して前回のピン
ト調整量F0を算出する。さらにマイクロコンピュータ10
はつぎのステップ19でピント調整量F0より所定の微小値
ΔFをさらに減算してつぎの新たなピント調整量F0を算
出し、その値をレンズ駆動機構2へ出力して光学系4を
回転駆動し、これにより新たな光学的結像距離を設定す
る(ステップ20)。
If in step 9 above, is greater than the minimum image quality evaluation value H 0 is better image quality evaluation value H 1 obtained in step 8, a determination is "H 0> H 1" in step 9 becomes "NO" proceeds to step 18, the microcomputer 10 calculates the focus adjustment amount F 0 of the last by subtracting a predetermined minute value ΔF than the current focus adjustment amount F 0. Further microcomputer 10
Calculates the next new focus adjustment amount F 0 by further subtracting a predetermined small value ΔF from the focus adjustment amount F 0 in the next step 19, outputs the value to the lens drive mechanism 2, and rotates the optical system 4. Drive, thereby setting a new optical imaging distance (step 20).

つぎのステップ21で撮像装置1はこの光学的結像距離
により対象物5を撮像し、その濃淡画像は画像メモリ24
に格納される。つぎにステップ22では駆動制御装置3は
この入力画像につき画質ヒストグラムを生成し、その画
質ヒストグラムのピーク値を画質評価値H1として求めて
マイクロコンピュータ10のメモリに記憶させる。
In the next step 21, the imaging apparatus 1 images the object 5 based on the optical imaging distance, and the grayscale image is stored in the image memory 24.
Is stored in Then the drive control unit 3 in step 22 generates an image quality histogram per the input image, and stores the peak value of the image quality histogram memory of the microcomputer 10 obtained as the image quality evaluation value H 1.

つぎのステップ23ではマイクロコンピュータ10はこの
画質評価値H1が最小の画質評価値H0より小さいか否かを
判断しており、もしステップ22で求めた画質評価値H1
方が小さければ、ステップ23の「H0<H1」の判定が“N
O"となって、ステップ24へ進み、マイクロコンピュータ
10はこの画質評価値H1をもって最小の画質評価値H0に置
き代えてメモリに記憶させた後、ステップ19へ戻り以下
同様の手順が実行される。
The next step 23 the microcomputer 10 in the has determined whether the quality evaluation value H 1 is less than the minimum image quality evaluation value H 0, the smaller the better the image quality evaluation value H 1 that if obtained in step 22 The determination of “H 0 <H 1 ” in step 23 is “N
O ", go to step 24, microcomputer
10 This after storing in the memory instead placed a minimum of image quality evaluation value H 0 with the image quality evaluation value H 1, a similar procedure is performed following the process returns to step 19.

もしステップ22で求めた画質評価値H1が最小の画質評
価値H0より大きければ、この最小の画質評価値H0は最小
値を構成することになり、ステップ23の判定が“YES"と
なる。つぎのステップ25ではマイクロコンピュータ10は
現在のピント調整量F0より所定の微小値ΔFを加算して
前回のピント調整量F0を算出し、その値を確定値として
レンズ駆動機構2へ出力して光学系4を回転駆動し、こ
れにより光学的結像距離を固定する(ステップ17)。
If If greater than the image quality evaluation value H 0 image quality evaluation value H 1 is the minimum determined at step 22, the image quality evaluation value H 0 of the minimum could be formed into a minimum value, the determination in step 23 is a "YES" Become. The microcomputer 10 in the next step 25 by adding a predetermined small value ΔF than the current focus adjustment amount F 0 calculates the focus adjustment amount F 0 of the last, is output to the lens driving mechanism 2 that value as the determined value To rotate the optical system 4 to fix the optical imaging distance (step 17).

第8図は、撮像装置1の視野37を示すもので、この視
野37内には明るさの異なる複数の物体5A,5Bが存在して
いる。
FIG. 8 shows a field of view 37 of the imaging apparatus 1, in which a plurality of objects 5A and 5B having different brightness exist.

いま一方の物体5Aが他方の物体5Bより暗いと仮定した
場合において、この両物体5A,5Bを含んで撮像して得た
入力画像より画質ヒストグラムを求めると、第9図に示
すような曲線となる。
When it is assumed that one object 5A is darker than the other object 5B, when an image quality histogram is obtained from an input image obtained by imaging including both objects 5A and 5B, a curve as shown in FIG. 9 is obtained. Become.

同図中、実線は暗い方の物体5Aにピントが合った入力
画像より求めた画質ヒストグラム38を、また破線は暗い
方の物体5Aにピントが合っていない入力画像より求めた
画質ヒストグラム39を、それぞれ示している。同図によ
れば、いずれの画質ヒストグラム38,39にも物体数に対
応してピークが2箇所現れているが、明るさが小さい方
のピークについては、前者の画質ヒストグラム38のピー
ク値p1が後者の画質ヒストグラム39のピーク値p2よりも
小さな値となっている。
In the figure, the solid line shows the image quality histogram 38 obtained from the input image in which the darker object 5A is in focus, and the broken line shows the image quality histogram 39 obtained from the input image out of focus on the darker object 5A, Each is shown. According to the figure, two peaks appear in each of the image quality histograms 38 and 39 corresponding to the number of objects, but the peak having the smaller brightness has the peak value p 1 of the former image quality histogram 38. There has been a value smaller than the peak value p 2 of the latter quality histogram 39.

従っていずれの物体にピントを合わせるかを指定した
上で、例えば暗い方の物体5Aにピントを合わせる場合は
明るさの小さい方のピークについてピーク値が最小とな
る画質ヒストグラムが得られらとき、その入力画像につ
いてのピント調整量を最適値として決定することにな
る。
Therefore, after specifying which object to focus on, for example, when focusing on the darker object 5A, when an image quality histogram in which the peak value is the smallest for the smaller peak of brightness is obtained, the The focus adjustment amount for the input image is determined as the optimum value.

この場合にピント調整の対象を物体の明るさを判断基
準として作業者の目視判断に基づき外部入力装置により
指定することもできるが、この実施例の場合、適当なピ
ント調整状態で得た入力画像につきマイクロコンピュー
タ10により両物体5A,5Bの明るさを計測して、その計測
結果に基づきピント調整の対象を指定している。
In this case, the object of the focus adjustment can be designated by an external input device based on the visual judgment of the worker using the brightness of the object as a criterion, but in the case of this embodiment, the input image obtained in an appropriate focus adjustment state The brightness of both objects 5A and 5B is measured by the microcomputer 10 and the focus adjustment target is specified based on the measurement result.

第10図は、マイクロコンピュータ10による計測手順を
示すもので、ステップ1で入力画像の各物体5A,5Bの位
置に所定のウィンドウを設定した後、つぎのステップ2
で各ウィンドウ内に含まれる画素の明るさの平均値a,b
を計測している。つぎのステップ3ではこの明るさの平
均値a,bが大小比較され、もしa<bであれば、ステッ
プ4が“YES"となり、ピント調整の対象として物体Aが
指定され、物体Aの明るさの近傍にピント調整量の初期
値F1が選定される(ステップ5)。またもしa>bであ
れば、ステップ4が“NO"であり、ピント調整の対象と
して物体Bが指定され、物体Bの明るさの近傍にピント
調整量の初期値F1が選定される(ステップ6)。
FIG. 10 shows a measurement procedure by the microcomputer 10. After setting a predetermined window at the position of each of the objects 5A and 5B of the input image in step 1, the next step 2 is executed.
The average brightness a, b of the pixels contained in each window
Is being measured. In the next step 3, the average values a and b of the brightness are compared in magnitude. If a <b, step 4 is "YES", the object A is designated as a target of focus adjustment, and the brightness of the object A is adjusted. the initial value F 1 of focus adjustment amount is selected in the vicinity of the (step 5). If a> b, step 4 is “NO”, the object B is designated as the object of focus adjustment, and the initial value F 1 of the focus adjustment amount is selected near the brightness of the object B ( Step 6).

<発明の効果> この発明は上記の如く、ピント調整量を可変設定して
光学系の光学的結像距離を変化させつつ各入力画像の画
質ヒストグラムを生成した後、各画質ヒストグラムのピ
ーク値を用いて最適なピント調整量を判別するから、距
離計測系を必要とせずに最適かつ迅速なピントの自動調
整が可能であり、しかも最適な画質の画像を得ることが
でき、あわせてその画像につき得られた画質ヒストグラ
ムから最適な2値化しきい値を得ることができる。
<Effect of the Invention> As described above, the present invention generates the image quality histogram of each input image while variably setting the focus adjustment amount and changing the optical imaging distance of the optical system, and then sets the peak value of each image quality histogram. Since the optimum focus adjustment amount is determined by using this function, it is possible to automatically and optimally adjust the focus automatically without the need for a distance measurement system, and to obtain an image of the optimum image quality. An optimum binarization threshold can be obtained from the obtained image quality histogram.

またピント調整の対象物を明るさを基準として指定す
る請求項3の発明では、撮像装置の視野内に複数の物体
が存在していても、所望の物体に着目したピント合わせ
が可能であるなど、発明目的で達成した顕著な効果を奏
する。
Further, in the invention according to the third aspect, an object to be focused is specified based on brightness, even when a plurality of objects are present in the field of view of the imaging device, it is possible to focus on a desired object. It has a remarkable effect achieved for the purpose of the invention.

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

第1図はこの発明の一実施例にかかる自動ピント調整装
置の概略構成を示す説明図、第2図は画質ヒストグラム
の具体例を示す説明図、第3図は駆動制御装置の回路構
成例を示すブロック図、第4図は濃淡画像上に設定され
るウィンドウを示す説明図、第5図は合法パターンの一
例を示す説明図、第6図は非合法パターンの一例の示す
説明図、第7図はピント調整の制御手順を示すフローチ
ャート、第8図は撮像装置の視野内の物体を示す説明
図、第9図は画質ヒストグラムの具体例を示す説明図、
第10図はマイクロコンピュータによる明るさの計測手順
を示すフローチャートである。 1……撮像装置、2……レンズ駆動機構 3……駆動制御装置、4……光学系 10……マイクロコンピュータ
FIG. 1 is an explanatory diagram showing a schematic configuration of an automatic focus adjustment device according to an embodiment of the present invention, FIG. 2 is an explanatory diagram showing a specific example of an image quality histogram, and FIG. 3 is an example of a circuit configuration of a drive control device. FIG. 4 is an explanatory diagram showing a window set on a grayscale image, FIG. 5 is an explanatory diagram showing an example of a legal pattern, FIG. 6 is an explanatory diagram showing an example of an illegal pattern, FIG. FIG. 8 is a flowchart showing a control procedure of focus adjustment, FIG. 8 is an explanatory diagram showing an object in the field of view of the imaging apparatus, FIG. 9 is an explanatory diagram showing a specific example of an image quality histogram,
FIG. 10 is a flowchart showing a procedure of measuring brightness by the microcomputer. DESCRIPTION OF SYMBOLS 1 ... Image pick-up device, 2 ... Lens drive mechanism 3 ... Drive control device, 4 ... Optical system 10 ... Microcomputer

───────────────────────────────────────────────────── フロントページの続き (58)調査した分野(Int.Cl.6,DB名) G06T 1/00 ──────────────────────────────────────────────────続 き Continued on front page (58) Field surveyed (Int.Cl. 6 , DB name) G06T 1/00

Claims (3)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】撮像装置に設けられた光学系を駆動して光
学的結像距離を自動調整するピント調整装置であって、 ピント調整量を可変設定するための調整量設定手段と、 設定されたピント調整量に応じて光学系を駆動して光学
的結像距離を変化させるための駆動手段と、 前記駆動手段により光学的結像距離を変化させつつ得ら
れた各入力画像につき画像評価用の画質ヒストグラムを
生成するヒストグラム生成手段と、 生成された各画質ヒストグラムのピーク値を用いて最適
なピント調整量を判別する判別手段とを具備し、 前記ヒストグラム生成手段は、明るさレベルと、その明
るさレベルにより前記入力画像を2値化処理して得られ
る2値画像の滑らかさの度合いを示す度数データとの関
係を示すヒストグラムを、前記画像評価用の画質ヒスト
グラムとして生成して成る自動ピント調整装置。
1. A focus adjustment device for automatically adjusting an optical imaging distance by driving an optical system provided in an imaging device, comprising: an adjustment amount setting means for variably setting a focus adjustment amount. A driving unit for driving the optical system according to the focus adjustment amount to change the optical imaging distance, and an image evaluation for each input image obtained while changing the optical imaging distance by the driving unit. Histogram generating means for generating an image quality histogram, and determining means for determining an optimal focus adjustment amount using a peak value of each generated image quality histogram, wherein the histogram generating means includes a brightness level, A histogram indicating the relationship between the binary image obtained by binarizing the input image based on the brightness level and frequency data indicating the degree of smoothness of the binary image is stored in the image quality evaluation image for image evaluation. Automatic focus adjustment device formed by generating a chromatogram.
【請求項2】前記判別手段は、各画質ヒストグラムのピ
ーク値を比較する比較手段を含み、その比較結果に基づ
き最適なピント調整量を判別する請求項1に記載された
自動ピント調整装置。
2. The automatic focus adjustment apparatus according to claim 1, wherein said determination means includes a comparison means for comparing peak values of the respective image quality histograms, and determines an optimum focus adjustment amount based on the comparison result.
【請求項3】撮像装置に設けられた光学系を駆動して光
学的結像距離を自動調整するピント調整装置であって、 ピント調整量を可変設定するための調整量設定手段と、 設定されたピント調整量に応じて光学系を駆動して光学
的結像距離を変化させるための駆動手段と、 前記駆動手段により光学的結像距離を変化させつつ得ら
れた各入力画像につき画像評価用の画質ヒストグラムを
生成するヒストグラム生成手段と、 ピント調整の対象物を明るさを基準として指定する指定
手段と、 生成された各画質ヒストグラムおよび前記指定手段によ
り指定された対象物の明るさを用いて、最適なピント調
整量を判別する判別手段とを具備し、 前記ヒストグラム生成手段は、明るさレベルと、その明
るさレベルにより前記入力画像を2値化処理して得られ
る2値画像の滑らかさの度合いを示す度数データとの関
係を示すヒストグラムを、前記画像評価用の画質ヒスト
グラムとして生成し、 前記判別手段は、各画質ヒストグラムの指定された対象
物の明るさに対応するピーク値を用いて最適なピント調
整量を判別して成る自動ピント調整装置。
3. A focus adjustment device for automatically adjusting an optical imaging distance by driving an optical system provided in an imaging device, comprising: an adjustment amount setting means for variably setting a focus adjustment amount. A driving unit for driving the optical system according to the focus adjustment amount to change the optical imaging distance, and an image evaluation for each input image obtained while changing the optical imaging distance by the driving unit. Histogram generation means for generating an image quality histogram, designation means for designating an object of focus adjustment with reference to brightness, and using the generated image quality histograms and the brightness of the object designated by the designation means. Determination means for determining an optimal focus adjustment amount, wherein the histogram generation means obtains a brightness level and binarizes the input image based on the brightness level. A histogram indicating a relationship with frequency data indicating a degree of smoothness of the binary image as an image quality histogram for the image evaluation, wherein the determination unit determines whether the brightness of the designated object in each image quality histogram is high. An automatic focus adjustment device that determines the optimal focus adjustment amount using the corresponding peak value.
JP1301081A 1989-11-20 1989-11-20 Automatic focus adjustment device Expired - Lifetime JP2932537B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1301081A JP2932537B2 (en) 1989-11-20 1989-11-20 Automatic focus adjustment device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1301081A JP2932537B2 (en) 1989-11-20 1989-11-20 Automatic focus adjustment device

Publications (2)

Publication Number Publication Date
JPH03160572A JPH03160572A (en) 1991-07-10
JP2932537B2 true JP2932537B2 (en) 1999-08-09

Family

ID=17892638

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1301081A Expired - Lifetime JP2932537B2 (en) 1989-11-20 1989-11-20 Automatic focus adjustment device

Country Status (1)

Country Link
JP (1) JP2932537B2 (en)

Also Published As

Publication number Publication date
JPH03160572A (en) 1991-07-10

Similar Documents

Publication Publication Date Title
JP2696044B2 (en) Focus detection method, non-contact displacement measuring method and apparatus using the same
US5877809A (en) Method of automatic object detection in image
JP3733392B2 (en) Image composition change detection method
USRE41222E1 (en) Focus control apparatus, image sensor, program and storage medium
JP4145308B2 (en) Image stabilizer
JP3226861B2 (en) Automatic focusing method
JP3058781B2 (en) Focusing point detection method
JP2932537B2 (en) Automatic focus adjustment device
JP5050282B2 (en) Focus detection device, focus detection method, and focus detection program
JP2003065969A (en) Apparatus and method for inspecting pattern
JPH10170817A (en) Method and device for calculating focal position, and electron microscope using the same
JP2628863B2 (en) Visual recognition device
JP2001012913A (en) Coil position detector
JP3369114B2 (en) Automatic focusing method and apparatus by image measurement
JP2001307017A (en) Character plate recognizing device
JPH05164703A (en) Inspecting method for surface of workpiece
JPH0757080A (en) Adaptive binarization control system
JP2924514B2 (en) Cross-sectional shape measuring device
JP3263570B2 (en) Automatic focusing device
JPH0727107B2 (en) Correlation image comparison device and focus detection device and distance measuring device using the same
JP3342143B2 (en) Prism foreign matter detection method
JP2005345590A (en) Inspection method and inspection apparatus for imaging device
JPH113415A (en) Image fetching device
JP2001305421A (en) Automatic focusing device
JPH05164700A (en) Method for inspecting work surface