Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JPS627588B2 - - Google Patents
[go: Go Back, main page]

JPS627588B2 - - Google Patents

Info

Publication number
JPS627588B2
JPS627588B2 JP54027298A JP2729879A JPS627588B2 JP S627588 B2 JPS627588 B2 JP S627588B2 JP 54027298 A JP54027298 A JP 54027298A JP 2729879 A JP2729879 A JP 2729879A JP S627588 B2 JPS627588 B2 JP S627588B2
Authority
JP
Japan
Prior art keywords
pattern
inspected
inspection
image
area
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
Application number
JP54027298A
Other languages
Japanese (ja)
Other versions
JPS55119782A (en
Inventor
Hisao Goto
Juzaburo Mori
Toshihito Watanabe
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.)
Daihen Corp
Original Assignee
Daihen 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 Daihen Corp filed Critical Daihen Corp
Priority to JP2729879A priority Critical patent/JPS55119782A/en
Publication of JPS55119782A publication Critical patent/JPS55119782A/en
Publication of JPS627588B2 publication Critical patent/JPS627588B2/ja
Granted legal-status Critical Current

Links

Landscapes

  • Character Input (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Description

【発明の詳細な説明】 本発明は計算機を用いて二次元的なパターンの
自動検査を行なう方法に関するものである。
DETAILED DESCRIPTION OF THE INVENTION The present invention relates to a method for automatically inspecting two-dimensional patterns using a computer.

一般に生産ラインにおいては、製品または部品
の外観(形状、寸法、傷等)や製品に貼られたラ
ベル等の位置ずれ、或いはラベルや包装箱等に印
刷された文字や記号のミス、汚れまたは欠落、更
にはラインで混入した異物等の検査を行なう必要
がある。従来この種の検査を自動的に行なう目的
で、一次元イメージセンサで被検査パターンを走
査して得た被検査画像と基準パターンを走査して
得た基準画像とを比較して被検査パターンの良否
の判定を行なうようにした方法が種々提案されて
いる。この種の検査方法において、被検査対象物
の特定の部分のみを詳細に検査する必要がある場
合には、画像に含まれるパターン全体を比較する
と、検査の必要のない部分の情報がノイズとな
り、適確な検査を行なうことができなくなる。そ
こで画像を複数の領域に分割して必要な検査領域
のみを検査することが行なわれているが、従来は
例えば第1図aに示すように画像の端部を基準に
して画面を領域k1〜k3に分割し、パターンBを検
査する場合には領域k2を検査領域として設定する
方法がとられていた。しかしこの方法では、被検
査対象物の位置がずれた場合に同図bに示すよう
にパターンが検査領域内に正しく入らなくなり、
この場合パターンBを検査するために検査領域k2
を指定したとしても適確な検査を行なうことがで
きなかつた。また同図cに示すようにパターンが
複数段に並んでいるような場合や検査しようとす
るパターンの近傍に連続的な模様があるような場
合には、検査すべき特定のパターン(例えば文字
B)のみを含む検査領域を設定することができ
ず、他のパターンの情報がノイズとなつて適確な
検査を行なうことができなかつた。
In general, on the production line, the appearance of products or parts (shape, dimensions, scratches, etc.), misalignment of labels affixed to products, mistakes, dirt, or omissions in characters and symbols printed on labels and packaging boxes, etc. Furthermore, it is necessary to inspect for foreign substances that have entered the line. Conventionally, for the purpose of automatically performing this type of inspection, the image to be inspected obtained by scanning the pattern to be inspected with a one-dimensional image sensor and the reference image obtained by scanning the reference pattern are compared to determine the pattern to be inspected. Various methods have been proposed for determining pass/fail. In this type of inspection method, if only a specific part of the object to be inspected needs to be inspected in detail, when comparing the entire pattern included in the image, information on parts that do not need to be inspected becomes noise. It becomes impossible to conduct an accurate inspection. Therefore, it is common practice to divide the image into multiple areas and inspect only the necessary inspection area, but conventionally, for example, as shown in Figure 1a, the screen is divided into areas k 1 with the edge of the image as a reference. When pattern B is to be inspected, the area k2 is set as the inspection area. However, with this method, if the position of the object to be inspected shifts, the pattern will not fit within the inspection area correctly, as shown in Figure b.
In this case, to inspect pattern B, inspection area k 2
Even if specified, it was not possible to conduct an appropriate inspection. In addition, as shown in Figure c, when patterns are lined up in multiple rows or when there is a continuous pattern near the pattern to be inspected, the specific pattern to be inspected (for example, the character B ), and information on other patterns becomes noise, making it impossible to perform accurate inspection.

本発明の目的は、画像に含まれるパターン全体
の横方向及び縦方向の端縁を基準にとつて検査す
べき領域の中心位置の座標を定め、この中心位置
の周囲に検査枠を設定してこの検査枠の内側の領
域を検査領域とすることにより、特定の部分の検
査を常に適確に行ない得るようにしたパターン自
動検査方法を提案することにある。
An object of the present invention is to determine the coordinates of the center position of an area to be inspected based on the horizontal and vertical edges of the entire pattern included in the image, and to set an inspection frame around this center position. The object of the present invention is to propose an automatic pattern inspection method that allows a specific portion to be inspected accurately at all times by setting the area inside this inspection frame as the inspection area.

以下図面を参照して本発明の検査方法を詳細に
説明する。
The inspection method of the present invention will be explained in detail below with reference to the drawings.

第2図を参照すると、本発明の検査方法を実施
する装置の概略構成が示されており、同図におい
ては1はパターン自動検査装置本体、2は被検査
対象物3,3…を搬送するコンベア、4は検査装
置本体1内の電源にコードl1を介して接続されて
検査位置にある被検査対象物3を照明する照明装
置、5はコードl2を介して検査装置本体1に接続
された位置検出センサである。位置検出センサ5
はコンベア2を間にして対向配置された投光器5
a及び受光器5bからなり、被検査対象物3が検
査位置に来たときにその端縁を検出して受光器5
bが位置検出信号(スタート信号)を発生する。
Referring to FIG. 2, there is shown a schematic configuration of an apparatus for carrying out the inspection method of the present invention. In the figure, 1 is the main body of the automatic pattern inspection apparatus, and 2 is for conveying the objects to be inspected 3, 3... A conveyor, 4 is connected to the power supply in the inspection device main body 1 via a cord L1 , and is a lighting device that illuminates the object to be inspected 3 at the inspection position, 5 is connected to the inspection device main body 1 via a cord L2 This is a position detection sensor. Position detection sensor 5
are floodlights 5 arranged opposite to each other with the conveyor 2 in between.
a and a light receiver 5b, when the object 3 to be inspected comes to the inspection position, the edge of the object 3 is detected and the light receiver 5
b generates a position detection signal (start signal).

6は被検査対象物3の被検査パターンを撮影し
て電気的な画像を得るカメラで、このカメラは、
第3図に示したように一次元イメージセンサ7
と、被検査パターン8の像をイメージセンサ7の
受光面7a上に結ばせる集光レンズ9と、イメー
ジセンサ7を駆動する回路10とを備えており、
このようなカメラとしては例えば半導体カメラの
名称で市販されているものを用いることができ
る。一次元イメージセンサ7は、走査に電子ビー
ムを用いない固体撮像素子で、自己走査機能を備
えており、シリコンの単一基板上にフオトダイオ
ードDPのアレイとMOSシフトレジスタの走査回
路とを集積したものである。第4図はこのイメー
ジセンサの等価回路を示したもので、同図におい
てDPは受光面上に一列に並べられたフオトダイ
オード、Cは各フオトダイオードDPに並列接続
されたキヤパシタンス、Dは各フオトダイオード
Pに直列に接続されたダイオード、RLは負荷抵
抗、COは出力キヤパシタンス、VTは直流電源、
SRはシフトレジスタである。このイメージセン
サにおいて、シフトレジスタSRにクロツクパル
スを1個与えると、シフトレジスタSRがフオト
ダイオードDP,DP,…の各回路に順次走査パル
スを与え、フオトダイオードDPのアレイを端か
ら順に自動的に走査する。各フオトダイオードD
Pに直列に接続されているダイオードは、常時逆
バイアス状態にあり、走査パルスで走査を受けた
回路のダイオードDのみがONになつてキヤパシ
タンスCが電源VTの電圧まで充電される。光の
入射によつてフオトダイオードDPの導電率が上
がり、キヤパシタンスCから入射光束量に応じた
電荷が放電してキヤパシタンスCの端子電圧が低
下する。1レーム時間後に再びクロツクパルスが
与えられ、各フオトダイオードの回路に走査パル
スが与えられると、各キヤパシタンスCが再充電
されるが、このときキヤパシタンスCに流れる充
電電流はキヤパシタンスCの端子電圧の低下分、
即ち入射光束量に比例し、この入射光束量に比例
した信号が連続パルス列の形で映像信号出力EV
として取り出される。フオトダイオードは電荷蓄
積モードで動作するため、映像信号EVは光の強
さと繰り返し走査時間の積に比例した信号とな
る。現実に使用されているイメージセンサの一例
では、受光部の大きさが50μm×50μmのフオト
ダイオードが50μmの間隔で64個直線状に並べら
れ、2MHzまでの高速動作が可能になつている。
そして入射光束量に対する電気信号出力は直線的
である。
Reference numeral 6 denotes a camera that photographs the pattern to be inspected of the object to be inspected 3 and obtains an electrical image.
One-dimensional image sensor 7 as shown in FIG.
, a condensing lens 9 that focuses the image of the pattern to be inspected 8 on the light receiving surface 7 a of the image sensor 7 , and a circuit 10 that drives the image sensor 7 .
As such a camera, for example, one commercially available under the name of a semiconductor camera can be used. The one-dimensional image sensor 7 is a solid-state image sensor that does not use an electron beam for scanning, has a self-scanning function, and integrates an array of photodiodes DP and a scanning circuit of a MOS shift register on a single silicon substrate. This is what I did. Figure 4 shows the equivalent circuit of this image sensor. In the figure, D P is a photodiode arranged in a row on the light receiving surface, C is a capacitance connected in parallel to each photodiode D P , and D is a capacitance connected in parallel to each photodiode D P. A diode connected in series with each photodiode D P , R L is the load resistance, C O is the output capacitance, V T is the DC power supply,
SR is a shift register. In this image sensor, when one clock pulse is applied to the shift register SR, the shift register SR sequentially applies a scanning pulse to each circuit of the photodiodes D P , D P , etc., and automatically scans the photodiode D P array sequentially from the end. scan. Each photodiode D
The diode connected in series with P is always in a reverse bias state, and only the diode D of the circuit scanned by the scan pulse is turned on, and the capacitance C is charged to the voltage of the power supply V T . The conductivity of the photodiode D P increases due to the incidence of light, and a charge corresponding to the amount of incident light flux is discharged from the capacitance C, so that the terminal voltage of the capacitance C decreases. When a clock pulse is applied again after one frame time and a scanning pulse is applied to the circuit of each photodiode, each capacitance C is recharged. At this time, the charging current flowing through the capacitance C is equal to the drop in the terminal voltage of the capacitance C. ,
In other words, it is proportional to the amount of incident light flux, and a signal proportional to the amount of incident light flux is output as a video signal E V in the form of a continuous pulse train.
is extracted as. Since the photodiode operates in a charge accumulation mode, the video signal E V is a signal proportional to the product of light intensity and repetitive scanning time. An example of an image sensor that is actually used has 64 photodiodes with a light receiving area of 50 μm x 50 μm arranged in a straight line at 50 μm intervals, enabling high-speed operation up to 2 MHz.
The electrical signal output with respect to the amount of incident light flux is linear.

上記のようなイメージセンサ7を内蔵したカメ
ラ6をコンベア2上の被検査対象物に向けて配置
してコンベア2をイメージセンサ7の走査方向Y
と直角な矢印X方向に移動させ、一定周期のクロ
ツクパルスをシフトレジスタSRに与えると、被
検査対象物の全面の走査をして被検査対象物の画
像を得ることができる。この場合画像の分解能は
クロツクパルスの周波数とイメージセンサのフオ
トダイオードの数とにより定まる。本発明の方法
では、例えば、前述のようにフオトダイオードの
数(1フレーム)を64とし、256個のクロツクパ
ルスにより1フイールドを構成する。この場合1
フイールドの絵素の総数は256×64個となる。
The camera 6 incorporating the image sensor 7 as described above is placed facing the object to be inspected on the conveyor 2, and the conveyor 2 is moved in the scanning direction Y of the image sensor 7.
When the shift register SR is moved in the direction of the arrow X perpendicular to , and clock pulses of a constant period are applied to the shift register SR, the entire surface of the object to be inspected can be scanned and an image of the object to be inspected can be obtained. In this case, the resolution of the image is determined by the frequency of the clock pulse and the number of photodiodes in the image sensor. In the method of the present invention, for example, as described above, the number of photodiodes (one frame) is 64, and one field is composed of 256 clock pulses. In this case 1
The total number of picture elements in the field is 256 x 64.

第5図を参照すると、本発明の方法を実施する
装置の電気的な構成がブロツク図で示されてお
り、第6図には検査装置本体1の操作表示パネル
部1aの構成が示されている。イメージセンサ7
から得られる映像信号EVの各パルスの波高値
は、各絵素の明暗に比例している。このイメージ
センサ7から得られる信号は、第5図に示すよう
に、2値化回路11に入力される。2値化回路1
1は、映像信号EVの各パルスをその波高値が一
定のスレツシヨールドレベル未満であるか以上で
あるかによつて白または黒のいずれかの信号に変
換するもので、2値化回路11の出力側に得られ
る映像信号EV′が表わす画像は、白または黒から
なり灰色部分のない2値化画像となる。2値化回
路11の出力EV′は検査装置本体1内に収納され
たマイクロコンピユータ12の入力回路13を通
して中央演算処理装置(CPU)14に入力され
ている。マイクロコンピユータ12にはまた、基
準画像を記憶させておく基準画像メモリ
(RAM)15と、被検査画像を記憶させておく被
検査画像メモリ(RAM)16と、両画像の比較
をするための演算を行なう際に用いられる演算用
メモリ(RAM)17と、プログラムを記憶させ
ておくプログラム用メモリ(ROM)18とが設
けられており、基準画像メモリ15及び被検査画
像メモリ16に記憶された基準画像及び被検査
画像はビデオ信号発生回路19及びブランキン
グ回路(メモリの像が入つていないアドレスに相
応する部分を画面から消す回路)20を通して操
作表示パネル1aに設けられたモニタテレビ21
に上下に並べて表示されるようになつている。
Referring to FIG. 5, the electrical configuration of the apparatus for carrying out the method of the present invention is shown in a block diagram, and FIG. 6 shows the configuration of the operation display panel section 1a of the inspection apparatus main body 1. There is. Image sensor 7
The peak value of each pulse of the video signal E V obtained from is proportional to the brightness and darkness of each picture element. The signal obtained from this image sensor 7 is input to a binarization circuit 11, as shown in FIG. Binarization circuit 1
1 converts each pulse of the video signal E V into a white or black signal depending on whether its peak value is below or above a certain threshold level, and is a binary signal. The image represented by the video signal E V ' obtained at the output side of the circuit 11 is a binary image consisting of white or black and without gray areas. The output E V ' of the binarization circuit 11 is input to a central processing unit (CPU) 14 through an input circuit 13 of a microcomputer 12 housed in the inspection apparatus main body 1. The microcomputer 12 also includes a reference image memory (RAM) 15 that stores a reference image, an image memory (RAM) 16 that stores an image to be inspected, and an operation for comparing both images. An arithmetic memory (RAM) 17 used for performing the test and a program memory (ROM) 18 for storing programs are provided. The image and the image to be inspected are sent to a monitor television 21 provided on the operation display panel 1a through a video signal generation circuit 19 and a blanking circuit (a circuit that erases from the screen a portion corresponding to an address in which no image is stored in memory).
are now displayed vertically.

操作表示パネル部1aにはまた、検査領域を指
定することを指令するスイツチ22と、基準画像
と被検査画像との比較を行なう際の処理方法を初
換える比較処理方法切換スイツチ23と、基準画
像のヒストグラムと被検査画像のヒストグラムと
の間の偏差の許容値を設定する許容偏差設定用デ
ジタルスイツチ24と、検査領域の位置や偏差の
書込みを指示する書込み用押ボタンスイツチ25
と、画像の検査領域を指定する場合にその中心位
置や大きさを指定する検査領域指定用デジタルス
イツチ26と、偏差の読出を指示する偏差読出用
押ボタンスイツチ27と、押ボタンスイツチ27
が押されたときにデジタルスイツチ26により指
定された領域の偏差を表示する発光ダイオード
(LED)からなるデジタル表示部28とが設けら
れ、これらのうち、検査領域の指定を指示するス
イツチ22、比較処理方法設定用切換スイツチ2
3、許容偏差値設定用デジタルスイツチ24、偏
差書込み指示用押ボタンスイツチ25及び検査領
域位置指定用デジタルスイツチ26により与えら
れる指示の内容は入力回路29を介して中央演算
処理装置14に入力されている。また偏差値表示
用のデジタル表示器28は、中央処理装置14に
出力回路30を介して接続され、押ボタンスイツ
チ27が押されたときにデジタルスイツチ26で
指定された領域の偏差を%で表示するようになつ
ている。操作表示パネル1aには更に、検査した
全数量、良品の数量及び不良品の数量をそれぞれ
表示するLED表示部31乃至33を有するカウ
ンタ34が設けられ、このカウンタは中央演算処
理装置14に出力回路35を介して接続されてい
る。カウンタ34の表示部の下方にはカウンタリ
セツトボタン36が設けられ、このボタンの側方
には基準画像メモリ15及び被検査画像メモリ1
6の内容等のクリアをするシステムリセツトボタ
ン37が設けられている。またカウンタ34の表
示器の上方には、被検査対象物が良品であるとき
及び不良品であるときにそれぞれ点灯する良品表
示灯38及び不良品表示灯39が設けられ、モニ
タテレビ21の下方にはコンベア2の起動を行な
わせる押ボタンスイツチ40及びコンベア2を停
止させる押ボタンスイツチ41が設けられてい
る。またこれらの押ボタンスイツチの下方には電
源スイツチ42と、電源が投入されているときに
点灯する電源表示灯43とが設けられている。
The operation display panel 1a also includes a switch 22 for instructing designation of an inspection area, a comparison processing method changeover switch 23 for initially changing the processing method when comparing a reference image and an image to be inspected, and a reference image. A digital switch 24 for setting an allowable deviation for setting an allowable value of deviation between the histogram of the image and the histogram of the image to be inspected, and a writing push button switch 25 for instructing writing of the position of the inspection area and the deviation.
, an inspection area designating digital switch 26 that specifies the center position and size of an image inspection area, a deviation readout pushbutton switch 27 that instructs reading of deviations, and a pushbutton switch 27 that instructs to read deviations.
A digital display section 28 consisting of a light emitting diode (LED) is provided which displays the deviation of the area designated by the digital switch 26 when the switch 22 is pressed. Processing method setting switch 2
3. The contents of the instructions given by the digital switch 24 for setting the allowable deviation value, the push button switch 25 for writing the deviation instruction, and the digital switch 26 for specifying the inspection area position are input to the central processing unit 14 via the input circuit 29. There is. A digital display 28 for displaying deviation values is connected to the central processing unit 14 via an output circuit 30, and displays the deviation in the area specified by the digital switch 26 in percentage when the push button switch 27 is pressed. I'm starting to do that. The operation display panel 1a is further provided with a counter 34 having LED display sections 31 to 33 for displaying the total quantity inspected, the quantity of non-defective products, and the quantity of defective products, respectively. 35. A counter reset button 36 is provided below the display section of the counter 34, and the reference image memory 15 and the image memory 1 to be inspected are placed on the sides of this button.
A system reset button 37 for clearing the contents of 6 is provided. Further, above the display of the counter 34, a good product indicator light 38 and a defective product indicator light 39 are provided, which light up when the object to be inspected is a good product and a defective product, respectively, and below the monitor television 21. A push button switch 40 for starting the conveyor 2 and a push button switch 41 for stopping the conveyor 2 are provided. Further, below these pushbutton switches, a power switch 42 and a power indicator light 43 that lights up when the power is turned on are provided.

次に上記の装置を用いて行なうパターン自動検
査方法を第7図のフローチヤートによつて説明す
るが、以下の説明ではイメージセンサの走査方向
(画面の縦方向)をy軸方向とし、コンベア2の
移動方向(画面の横方向)をx軸方向とする。
Next, an automatic pattern inspection method using the above device will be explained with reference to the flowchart shown in FIG. Let the direction of movement (horizontal direction of the screen) be the x-axis direction.

検査を開始するに当つては先ず、電源スイツチ
42をオンにし、システムリセツトスイツチ37
を押してメモリ15,16等をクリアする。次に
検査する対象物に応じて設定する検査領域の数と
各検査領域の中心位置とを指定する(第7図のス
テツプa)。この検査領域の中心位置の指定は、
スイツチ22を検査領域指定側に切換えてデジタ
ルスイツチ26により検査領域の中心位置の座標
を指定することにより行なう。スイツチ22及び
押ボタンスイツチ26による指令は入力回路29
を通して中央演算処理装置CPU14に与えら
れ、CPU14は後記する方法でプログラムに従
い検査領域の指定を行なう。
To start the inspection, first turn on the power switch 42 and turn on the system reset switch 37.
Press to clear memory 15, 16, etc. Next, the number of inspection areas to be set and the center position of each inspection area are specified according to the object to be inspected (step a in FIG. 7). To specify the center position of this inspection area,
This is done by switching the switch 22 to the inspection area designation side and specifying the coordinates of the center position of the inspection area using the digital switch 26. Commands from the switch 22 and pushbutton switch 26 are sent to the input circuit 29.
The data is sent to the central processing unit CPU 14 through the program, and the CPU 14 specifies the inspection area according to the program using the method described later.

上記のようにして検査領域を指定した後、パタ
ーンの比較方法を決定する(第7図のステツプ
b)。パターンの比較方法は種々考えられるが、
本実施例では、後記するように、検査領域内のパ
ターンの白または黒の面積を比較する面積比較
法、パターンの白または黒の1つの軸方向のヒス
トグラムを比較する1軸ヒストグラム比較法及び
異なる2つの軸方向のヒストグラムを比較する2
軸ヒストグラム比較法の3種類の比較法により検
査を行なうことができるようになつている。この
パターンの比較法の設定は、比較処理方法設定用
切換スイツチ23を「面積比較法」、「1軸法」ま
たは「2軸法」に切換えることにより行なわれ、
このスイツチによる指令は入回路29を通して
CPU14に与えられる。CPU14は所定のプロ
グラムに従つてパターンの比較処理を行なわせ
る。パターンの比較処理方法を決定した後、コン
ベア2を起動させて検査の基準とすべき被検査対
象物を撮像し、基準画像のデータを取り込む(第
7図のステツプc)。このデータの取り込みは、
位置検出センサ5が信号を発生すると同時に開始
され、256個のクロツクパルスが与えられた時点
で終了する。カメラ6から得られた像は2値化回
路11により黒または白の絵素からなる2値化画
像に変換され、この2値化画像はモニタテレビ
21の画面の上方に表示される(第7図のステツ
プd)。次にオペレータはこのテレビ画面の像を
見て基準画像として適当か否かを判断し(第7図
のステツプe)、もし基準画像として不適当な場
合には、基準となるべき被検査物の変更や、照明
の具合の調節等の必要な処置を行なつた後システ
ムリセツトスイツチ37を押してメモリ15を再
度クリアしてから基準画像のデータを取り込む。
モニタテレビ21上に表示された基準画像が適当
な場合には、被検査物の中から正常と思われるも
のをコンベア2上に配置し、前記と同様にしてそ
の画像データを取り込む(第7図のステツプ
f)。この正常な被検査物の2値化画像はモニ
タテレビ21の画面の下方に表示される(第7図
のステツプg)。尚カメラ6から与えられる画像
信号を基準画像とすべきか否かはオペレータの判
断により行ない、画像データの起動は位置検出セ
ンサ5の出力信号により行なう。即ち、システム
リセツトスイツチ37が押された後最初に発生し
た位置検出センサの出力により走査を開始して得
た画像のみが基準画像として基準画像メモリ15
に記憶され、その後に発生する位置検出センサの
出力により走査を開始して得た画像は被検査画像
として被検査画像メモリ16に記憶される。基準
画像メモリ15の内容はシステムリセツトスイツ
チ37が再び押されるまで保持され、従つてモニ
タテレビ21上の基準画像もシステムリセツトス
イツチ37が押されるまで保持される。被検査画
像メモリ16の内容は、位置検出センサ5の出力
が発生して新たな被検査画像のデータが入力され
る毎に書き変えられ、モニタテレビ21上の被検
査画像もその都度新たな被検査画像と入れ換わ
る。
After specifying the inspection area as described above, a pattern comparison method is determined (step b in FIG. 7). There are various ways to compare patterns, but
In this example, as will be described later, an area comparison method that compares the area of white or black of a pattern in an inspection area, a uniaxial histogram comparison method that compares histograms of white or black in one axis direction of a pattern, and a different Comparing two axial histograms 2
The inspection can be performed using three types of comparison methods: the axial histogram comparison method. The comparison method for this pattern is set by switching the comparison processing method setting switch 23 to "area comparison method", "1-axis method" or "2-axis method",
The command from this switch is sent through the input circuit 29.
It is given to the CPU 14. The CPU 14 causes pattern comparison processing to be performed according to a predetermined program. After determining the pattern comparison processing method, the conveyor 2 is started to take an image of the object to be inspected to be used as a reference for inspection, and the data of the reference image is taken in (step c in FIG. 7). Ingesting this data is
It starts as soon as the position sensor 5 generates a signal and ends when 256 clock pulses have been applied. The image obtained from the camera 6 is converted by the binarization circuit 11 into a binarized image consisting of black or white picture elements, and this binarized image is displayed above the screen of the monitor television 21 (the seventh Step d) in the diagram. Next, the operator looks at this image on the TV screen and determines whether it is suitable as a reference image (step e in Figure 7), and if it is not suitable as a reference image, then After making necessary changes and adjusting the lighting conditions, the system reset switch 37 is pressed to clear the memory 15 again, and then the reference image data is imported.
If the reference image displayed on the monitor television 21 is appropriate, place an object to be inspected that appears to be normal on the conveyor 2, and import its image data in the same manner as described above (see Fig. 7). step f). This binary image of the normal object to be inspected is displayed at the bottom of the screen of the monitor television 21 (step g in FIG. 7). Note that whether or not the image signal given from the camera 6 should be used as a reference image is determined by the operator, and the image data is activated by the output signal of the position detection sensor 5. That is, only the image obtained by starting scanning based on the first output of the position detection sensor after the system reset switch 37 is pressed is stored in the reference image memory 15 as a reference image.
The image obtained by starting scanning based on the output of the position detection sensor generated thereafter is stored in the image to be inspected memory 16 as an image to be inspected. The contents of reference image memory 15 are held until system reset switch 37 is pressed again, and therefore the reference image on monitor television 21 is also held until system reset switch 37 is pressed. The contents of the image to be inspected memory 16 are rewritten each time an output from the position detection sensor 5 is generated and data of a new image to be inspected is input, and the image to be inspected on the monitor television 21 is also updated each time. Replaced with the inspection image.

次にCPU14は、2値化された基準画像及び
被検査画像のそれぞれについて指定された位置に
検査領域を設定し、各検査領域の枠をモニタテレ
ビ21上に表示する。この検査領域の設定のしか
たにつき第8図及び第9図を参照して説明する。
今、基準画像が第8図に示す通りであつたと
し、この画像に含まれるパターンのうち文字
「B」のみを検査するものとする。検査領域を設
定するに当つては先ず画像に含まれるパターン
「A〜H」の縦方向及び横方向の両端縁u,d及
びl,rを検出し、これらの端縁により囲まれた
領域Q内で座標系を考えて検査領域の中心位置の
座標を定める。この座標系の座標軸は端縁u,d
及びl,rにより囲まれた領域Q内の各点の位置
の座標を特定できるものであればよいが、最も簡
単なのは端縁uまたはdをx軸とし、端縁lまた
はrをy軸とする方法である。本実施例では第9
図に示したように端縁d及びlをそれぞれx軸及
びy軸とし、領域Qの左下隅を原点0とする。そ
して領域Qの右下隅を(100、0)、左上隅(0、
100)としてx軸及びy軸を100等分し、デジタル
スイツチ2bにより検査領域の中心位置αの座標
(X1、Y1)を設定する。図示の例ではX1=45、Y1
=85とし、この中心位置αの周囲に文字「B」を
囲む大きさの矩形状の検査枠βを設定している。
検査枠βの大きさ及び形状は検査領域内に含ませ
るパターンの大きさ及び形に応じて適宜に設定す
ることができ、この検査枠βの内側の領域を検査
領域kとする。検査枠βの大きさの設定はその幅
wと高さhとを予めデジタルスイツチにより書き
込むことにより行ない、中心位置αが定められた
ときに自動的にその周囲に検査枠βが定められる
ようにプログラムしておく。
Next, the CPU 14 sets inspection areas at designated positions for each of the binarized reference image and the image to be inspected, and displays the frame of each inspection area on the monitor television 21. The method of setting this inspection area will be explained with reference to FIGS. 8 and 9.
Assume now that the reference image is as shown in FIG. 8, and that only the letter "B" among the patterns included in this image is to be inspected. To set the inspection area, first detect the vertical and horizontal edges u, d, l, r of the patterns "A to H" included in the image, and then detect the area Q surrounded by these edges. Determine the coordinates of the center position of the inspection area by considering the coordinate system within. The coordinate axes of this coordinate system are edges u, d
Any method that can specify the coordinates of the position of each point in the area Q surrounded by This is the way to do it. In this example, the ninth
As shown in the figure, the edges d and l are the x-axis and the y-axis, respectively, and the lower left corner of the region Q is the origin 0. Then, set the lower right corner of area Q to (100, 0) and the upper left corner (0,
100), the x-axis and y-axis are divided into 100 equal parts, and the coordinates (X 1 , Y 1 ) of the center position α of the inspection area are set by the digital switch 2b. In the example shown, X 1 = 45, Y 1
=85, and a rectangular inspection frame β of a size surrounding the letter "B" is set around this center position α.
The size and shape of the inspection frame β can be appropriately set depending on the size and shape of the pattern included in the inspection area, and the area inside this inspection frame β is defined as the inspection area k. The size of the inspection frame β is set by writing its width w and height h in advance using a digital switch, so that when the center position α is determined, the inspection frame β is automatically determined around it. Program it.

画像に含まれるパターン全体の端縁の検出は、
パターンの面積のx軸方向及びy軸方向のヒスト
グラムを作成して記憶させ、これらのヒストグラ
ムの端縁のアドレスを検出することにより行なう
ことができる。この場合パターンの面積のとり方
としては、黒の部分の面積をとる方法と白の部分
の面積をとる方法とが考えられるが、黒の背景に
白抜きで現われるパターンを検査するような特別
の場合を除き、黒の部分の面積をとる。第8図に
おいてHxは画像に含まれるパターンのx軸方
向(横方向)ヒストグラムを示し、Hyはy軸方
向(縦方向)ヒストグラムを示している。尚この
場合y軸方向ヒストグラムHyは画面のy軸方向
全体について作成してもよいが、図示のように上
下の一定幅の部分についてのみ作成して領域Qの
左下隅部及び右上隅部を見出す方法をとつた方が
プログラムが容易になる。
Detecting the edges of the entire pattern included in the image is
This can be done by creating and storing histograms of the area of the pattern in the x-axis and y-axis directions, and detecting the addresses of the edges of these histograms. In this case, the area of the pattern can be determined by taking the area of the black part or by taking the area of the white part, but in special cases where a pattern that appears as a white outline on a black background is to be inspected. , and take the area of the black part. In FIG. 8, Hx indicates the histogram in the x-axis direction (horizontal direction) of the pattern included in the image, and Hy indicates the histogram in the y-axis direction (vertical direction). In this case, the y-axis direction histogram Hy may be created for the entire screen in the y-axis direction, but as shown in the figure, it is created only for a portion of a certain width above and below to find the lower left corner and upper right corner of the area Q. It will be easier to program if you use this method.

上記のようなヒストグラムHx、Hyは、例えば
2値化回路から出力される黒のパルス数を各クロ
ツクパルス毎に計数して記憶させていくか、また
は基準画像メモリ及び被検査画像メモリの中から
黒の絵素を記憶しているアドレスをピツクアツプ
して横方向及び縦方向の各走査線毎に計数し記憶
させていくことにより作成することができる。
The above histograms Hx and Hy can be created, for example, by counting and storing the number of black pulses output from the binarization circuit for each clock pulse, or by counting and storing the number of black pulses output from the binarization circuit, or by calculating the number of black pulses output from the reference image memory and the image memory to be inspected. It can be created by picking up addresses storing picture elements, counting and storing them for each scanning line in the horizontal and vertical directions.

このように本発明では、検査領域を指定するに
当り、画像に含まれるパターン全体の横方向及び
縦方向の端縁を基準にとるので、被検査対象物の
位置全体が同時に多少ずれてテレビ画面に表示さ
れても被検査パターンを所定の検査枠内に入れる
ことができ、常に正確に被検査パターンと基準パ
ターンとを対応させて検査精度を高めることがで
きる。
In this way, in the present invention, when specifying the inspection area, the horizontal and vertical edges of the entire pattern included in the image are taken as a reference, so the entire position of the object to be inspected may be slightly shifted at the same time on the TV screen. The pattern to be inspected can be placed within a predetermined inspection frame even when the pattern is displayed, and the pattern to be inspected and the reference pattern can always be accurately matched to improve inspection accuracy.

検査領域の指定を行なつた後、各検査領域毎に
基準パターンと被検査パターンとの比較を行なう
(第7図のステツプi)。この比較処理方法には前
述のように3種類あるので、以下これらの方法に
ついて説明する。
After specifying the inspection area, the reference pattern and the pattern to be inspected are compared for each inspection area (step i in FIG. 7). As mentioned above, there are three types of comparison processing methods, and these methods will be explained below.

(イ) 面積比較法 この方法は基準画像の各検査領域に含まる基
準パターンの白または黒の面積S0と、被検査画
像の対応する各検査領域に含まれる被検査パタ
ーンの白または黒の面積S1とを比較する方法
で、この場合も通常はパターンの黒の部分の面
積をとる。そして基準パターンの面積S1と被検
査パターンの面積S2との差の絶対値|S1―S2
を基準パターン面積S1で除することにより偏差
d=(|S1―S2|/S1)×100(%)を計算し、
この偏差dを予め設定した許容偏差d0と比較す
ることにより被検査対象物の良否を判定する。
(b) Area comparison method This method calculates the white or black area S 0 of the reference pattern included in each inspection area of the reference image and the white or black area S 0 of the inspection pattern included in each corresponding inspection area of the inspection image. This method compares the area with the area S1 , and in this case, the area of the black part of the pattern is usually taken. Then, the absolute value of the difference between the area S 1 of the reference pattern and the area S 2 of the pattern to be inspected |S 1 −S 2 |
Calculate the deviation d=(|S 1 - S 2 |/S 1 )×100(%) by dividing by the reference pattern area S 1 ,
The quality of the object to be inspected is determined by comparing this deviation d with a preset allowable deviation d 0 .

(ロ) 1軸方向ヒストグラム比較法 この方法は、各検査領域内に含まれるパター
ンの1つの軸方向、例えばx軸方向のヒストグ
ラムを重ね合せて一致するか否かを見る方法で
ある。例えば、或基準パターンのx軸方向のヒ
ストグラムが第10図のHxsであり、被検査パ
ターンのx軸方向ヒストグラムがHxである場
合には、両ヒストグラムを例えば中心位置x0
合せて重ね合せ、両ヒストグラムの一致しない
部分の間の面積sx(不一致部分間面積)を算
出する。そしてこのsxを基準パターンのヒス
トグラムの面積Sで除して偏差d=sx/S×
100(%)を算出する。この偏差を許容偏差と
比較し、被検査対象物の良否の判定を行なう。
(b) Uniaxial Histogram Comparison Method This method is a method in which the histograms of patterns included in each inspection area in one axis direction, for example, the x-axis direction, are superimposed to see if they match. For example, if the histogram in the x-axis direction of a certain reference pattern is Hxs in FIG. 10, and the histogram in the x-axis direction of the pattern to be inspected is Hx, then both histograms are superimposed with their center position x 0 aligned, The area sx (area between unmatched parts) between the unmatched parts of both histograms is calculated. Then, divide this sx by the area S of the histogram of the reference pattern, and the deviation d=sx/S×
Calculate 100 (%). This deviation is compared with the allowable deviation to determine whether the object to be inspected is good or bad.

(ハ) 2軸方向ヒストグラム比較法 この方法においては、各検査領域内に含まれ
る基準パターン及び被検査パターンの第1の軸
方向(例えばx軸方向)のヒストグラムを第1
0図に示したのと同様な方法で重ね合せて比較
して不一致部分間面積sxを算出するととも
に、両パターンの第1の軸に対して角度をもつ
た第2の軸方向(例えばy軸方向)のヒストグ
ラムをも同様の方法で重ね合せて比較し、第2
の軸方向ヒストグラムの不一致部分間面積sy
を算出する。そしてsx及びsyのうち大きい
方、max(sx、sy)を判定資料とし、偏差d=
max(sx、sy)/S×100(%)を算出する。
(c) Two-axis direction histogram comparison method In this method, the histogram of the reference pattern and the pattern to be inspected included in each inspection area in the first axis direction (for example, the x-axis direction) is
The area sx between the mismatched parts is calculated by overlapping and comparing them in the same manner as shown in Figure 0, and the area sx between the mismatched parts is calculated in the second axis direction (for example, the y axis) that is at an angle to the first axis of both patterns. The histograms of the direction) are also superimposed and compared in the same way, and the second
The area between the mismatched parts of the axial histogram sy
Calculate. Then, the larger of sx and sy, max (sx, sy), is used as the judgment material, and the deviation d=
Calculate max(sx, sy)/S×100(%).

このように向きが異なる2つの軸方向のヒスト
グラムを比較すると、パターンの面積や1軸方向
のみのヒストグラムでは差が現われないようなパ
ターンの欠陥をも検出できるため、検査精度を高
めることができる。
By comparing histograms in two axial directions that have different orientations, it is possible to detect defects in patterns for which differences do not appear in pattern areas or histograms in only one axis direction, thereby increasing inspection accuracy.

全ての検査領域の偏差が算出された後、許容偏
差が既に設定されているか否かの判定が行なわれ
る(第7図のステツプj)。最初はこの許容偏差
の設定が行なわれていないので、次に第7図kの
ステツプに進み、ステツプiで算出された各検査
領域毎の偏差を読み出す。オペレータはこの読み
出されたデータに基いて良品のバラツキによる偏
差のバラツキの範囲を示すデータをとる(第7図
のステツプl)。良品の偏差のバラツキ範囲を知
るために十分なデータが得られていないと判断さ
れた場合(第7図のステツプm)には再びステツ
プfに戻り、正常な被検査物の画像データを取り
込む。以下ステツプg〜mを繰り返し、良品の偏
差のバラツキ範囲を示すのに十分なデータが得ら
れたときに、得られたデータに基いて各検査領域
ごとに許容偏差を設定する(第7図のステツプ
n)。この許容偏差の設定は、操作パネル1aの
デジタルスイツチ24と書込み用押ボタンスイツ
チ25とにより行なわれる。許容偏差の設定を行
なつた後、実際に検査を行なう被検査物の画像デ
ータを取り込み(第7図のステツプo)、第7図
のステツプgに戻る。以下ステツプh〜jを順次
行ない、ステツプjでは、既に許容偏差が設定さ
れているので、ステツプpへと進む。ステツプp
では、すべての検査領域について基準パターンと
被検査パターンの偏差を許容偏差と比較し、すべ
ての検査領域で偏差が許容偏差以下の場合にその
被検査物が良品であることを示す良品信号を出力
する(第7図のステツプq)。この良品信号が出
力されると操作表示パネルの良品表示灯38が点
灯し、またカウンタ34の良品数量表示部32に
表示される計数値が1つ増加する(第7図のステ
ツプr)。またステツプpにおいていずれかの検
査領域で偏差が許容偏差より大きい場合には被検
査物が不良品であることを示す不良品信号を出力
する(第7図のステツプs)。この不良品信号が
出力されると、不良品表示灯39が点灯するとと
もに、カウンタ34の不良品数量表示部33の計
数値が1つ増加する(第7図のステツプt)。カ
ウンタの全数量表示部31の計数値は、良品信号
または不良品信号が出力されるごとに1つ増加
し、検査を行なつた被検査物の全数量を表示する
(第7図のステツプu)。また不良品信号が出力さ
れたときには必要に応じて不良品をコンベアから
除去するための信号が出力される(第7図のステ
ツプv)。
After the deviations of all inspection areas have been calculated, it is determined whether the allowable deviation has already been set (step j in FIG. 7). Since this permissible deviation has not been set at first, the process then proceeds to step k in FIG. 7 and reads out the deviation for each inspection area calculated in step i. Based on this read data, the operator obtains data indicating the range of variation in deviation due to variation in non-defective products (step 1 in FIG. 7). If it is determined that sufficient data has not been obtained to know the variation range of the deviation of non-defective products (step m in FIG. 7), the process returns to step f again and image data of a normal inspection object is captured. Steps g to m are repeated below, and when enough data is obtained to show the range of variation in deviation of non-defective products, the allowable deviation is set for each inspection area based on the obtained data (see Figure 7). step n). Setting of this allowable deviation is performed using the digital switch 24 and write push button switch 25 on the operation panel 1a. After setting the allowable deviation, image data of the object to be inspected is taken in (step o in FIG. 7), and the process returns to step g in FIG. Thereafter, steps h to j are performed in sequence, and in step j, since the allowable deviation has already been set, the process proceeds to step p. step p
The system compares the deviation between the reference pattern and the inspected pattern with the allowable deviation for all inspection areas, and outputs a non-defective signal indicating that the inspected item is non-defective if the deviation is less than the allowable deviation in all inspection areas. (Step q in Figure 7). When this non-defective product signal is output, the non-defective product indicator light 38 on the operation display panel lights up, and the count value displayed on the non-defective product quantity display section 32 of the counter 34 increases by one (step r in FIG. 7). If the deviation in any of the inspection areas is larger than the allowable deviation in step p, a defective product signal indicating that the object to be inspected is defective is output (step s in FIG. 7). When this defective product signal is output, the defective product indicator lamp 39 lights up and the count value of the defective product quantity display section 33 of the counter 34 increases by one (step t in FIG. 7). The count value of the total quantity display section 31 of the counter increases by one each time a non-defective product signal or a defective product signal is output, and displays the total quantity of the inspected objects (step u in FIG. 7). ). Further, when a defective product signal is output, a signal for removing the defective product from the conveyor is outputted as necessary (step v in FIG. 7).

良品信号または不良品を除去するための信号が
出力された後再びステツプOに戻り、次の被検査
物の画像データを取り込んで上記と同様の検査を
繰り返す。
After the non-defective product signal or the signal for removing defective products is output, the process returns to step O, and image data of the next object to be inspected is taken in, and the same inspection as above is repeated.

本発明の方法では、上記のように、検査領域を
指定する際にパターン全体の端縁を検出するが、
この検出の際に背景の僅かな汚れをも1つのパタ
ーンと認めると検査領域の設定を正確に行なうこ
とができなくなることがある。これを避けるため
には、パターンの端縁を検出する際に一定面積以
下の部分を無視するように検出感度を設定してお
けばよい。
In the method of the present invention, as described above, the edges of the entire pattern are detected when specifying the inspection area.
At the time of this detection, if even a slight stain in the background is recognized as one pattern, it may become impossible to accurately set the inspection area. In order to avoid this, the detection sensitivity may be set so as to ignore portions smaller than a certain area when detecting the edges of the pattern.

本発明の方法では、被検査対象物をイメージセ
ンサで走査して画像を得るが、イメージセンサで
走査して得た像は連続した線を不連続な点または
線分で近似したものであるので、いわゆる量子化
誤差を生じる。またイメージセンサで走査して得
た画像を2値化する際にも灰色物分を白または黒
で置き換えるために誤差を生じる。更に、コンベ
アで送られてくる対象物を撮像した場合、一般に
イメージセンサが走査を開始する位置を一定にす
ることは困難であるので、仮りにコンベアで順次
送られてくる被検査対象物が全く同一であつたと
しても微視的にみると毎回同一の画像が得られる
とは限らない。これらの誤差はイメージセンサの
受光素子の数とクロツクパルスの周波数とを増大
させて分解能を高くすれば減少するが、分解能を
高くすると処理に時間がかかり実用的でない。分
解能を特に高めることなくこれらの誤差を補なう
ためには、基準パターンの面積またはヒストグラ
ムに一定の幅をもたせるように補正量を設定し
て、この幅の範囲に入るものを良品と判定するよ
うにしておけばよい。この補正量の設定は許容偏
差値に適当な幅をもたせることにより行なうこと
ができる。
In the method of the present invention, an image is obtained by scanning the object to be inspected with an image sensor, but the image obtained by scanning with the image sensor is a continuous line approximated by discontinuous points or line segments. , resulting in so-called quantization errors. Furthermore, when an image obtained by scanning with an image sensor is binarized, errors occur because gray parts are replaced with white or black. Furthermore, when capturing images of objects being conveyed by a conveyor, it is generally difficult to maintain a constant position at which the image sensor starts scanning. Even if they are the same, microscopically, the same images are not necessarily obtained every time. These errors can be reduced by increasing the number of light-receiving elements and the frequency of the clock pulse of the image sensor to increase the resolution, but increasing the resolution requires a long processing time and is not practical. In order to compensate for these errors without particularly increasing the resolution, the correction amount is set so that the area of the reference pattern or histogram has a certain width, and items that fall within this width are judged as good products. Just do it like this. This correction amount can be set by giving an appropriate range to the allowable deviation value.

次に第11A図及び第11B図を参照すると、
上記実施例において、基準パターンと被検査パタ
ーンとの比較を面積比較法により行なう場合のコ
ンピユータのプログラムを作成するためのフロー
チヤートの要部が示されている。第11A図にお
いてaの部分は基準画像メモリにデータを入力し
たか否かを判断する過程であり、bの部分は、基
準画像のデータをメモリに取り込む過程である。
cの部分は検査領域の指定が既に行なわれている
か否かを判断して指定が行なわれていない場合に
は終了し、指定が行なわれている場合には次のス
テツプに進むことを指示する過程である。dの部
分は基準画像に含まれるパターンのx軸方向ヒス
トグラムを作成してこのヒストグラムより基準画
像に含まれるパターン全体の左端縁及び右端縁
(横方向の両端縁)を検出する過程である。eの
部分は基準画像に含まれるパターン全体の少なく
とも上下の一定幅部分についてy軸方向ヒストグ
ラムを作成して、このヒストグラムよりパターン
の上端縁及び下端縁(縦方向の両端)を求める過
程である。またfの部分は、検出した上下左右の
端縁により囲まれる領域の左下隅を原点とし、右
上隅を点(100、100)として座標系を構成する過
程である。gの部分は指定された座標(X1
Y1)を中心に指定された高さ及び幅の検査枠をモ
ニタTV上に基準画像とともに表示する過程であ
り、hの部分は各検査領域内の基準パターンの面
積を求める過程である。iの部分は全検査領域の
指定と検査領域内の基準パターンの面積の算出と
が終了しているか否かを判別して終了していない
場合にはgに戻り、終了している場合には次のj
に進むことを指示する過程である。jの部分は検
査領域の設定が適当であるか否かを判断して適当
でない場合にはkの部分に進み、適当な場合には
第11B図のlの部分に進むことを指示する過程
である。kの部分は検査領域の中心の座標と検査
枠の高さ、幅及び検査領域の数を修正する過程で
あり、この修正はオペレータに指示して行なわせ
る。この修正が行なわれる場合には前記bの部分
に戻つて再度基準画像メモリに2値化画像を取り
進む。第11B図においてl乃至qの部分は被検
査パターンについて前記と同様にして検査領域の
指定と検査領域内の被検査パターンの面積の計算
を行なう過程であり、lはbに対応し、m乃至q
はそれぞれd乃至hに対応している。rは検査領
域内の基準パターンの面積S1と被検査パターンの
面積S2との差|S1―S2|を基準パターンの面積S1
で除して偏差d=(|S1−S2|/S1)×100(%)
を算出する過程である。sは全検査領域について
終了したか否かを判断して終了していない場合に
はpの部分に戻り、終了している場合には次のt
の部分に進むことを指示する過程である。tの過
程は良否の判定を行なうことが指示されているか
否かを判断する過程で、良否の判定を行なうこと
が指示されていない場合には偏差の表示を行なわ
せて終了させ、良否の判定を行なうことが指示さ
れている場合には次のuの部分に進むことを指示
する。uの部分はrで算出された偏差と設定され
た許容偏差とを比較して偏差が許容偏差より大き
い場合には不良品信号を出力して終了させ、偏差
が許容偏差以下の場合には次のvの部分に進むこ
とを指示する過程である。そしてvの部分は全検
査領域について偏差と許容偏差との比較が終了し
たか否かを判別して終了していない場合にはuに
戻り、全検査領域において偏差が許容偏差以下の
場合には良品信号を出力させて検査を終了させる
過程である。
Next, referring to FIGS. 11A and 11B,
In the above embodiment, the main part of a flowchart for creating a computer program for comparing a reference pattern and a pattern to be inspected using an area comparison method is shown. In FIG. 11A, part a is the process of determining whether or not data has been input to the reference image memory, and part b is the process of loading the data of the reference image into the memory.
Part c determines whether or not the inspection area has already been specified, and if the specification has not been made, the process ends, and if the specification has been made, it instructs to proceed to the next step. It's a process. Part d is a process of creating an x-axis direction histogram of the pattern included in the reference image and detecting the left edge and right edge (both horizontal edges) of the entire pattern included in the reference image from this histogram. Part e is a process in which a y-axis direction histogram is created for at least the upper and lower fixed width portions of the entire pattern included in the reference image, and the upper and lower edges (both ends in the vertical direction) of the pattern are determined from this histogram. Part f is a process of constructing a coordinate system with the lower left corner of the area surrounded by the detected upper, lower, left, and right edges as the origin and the upper right corner as the point (100, 100). The part g has the specified coordinates (X 1 ,
This is the process of displaying an inspection frame with a designated height and width centered on Y 1 ) along with the reference image on the TV monitor, and the part h is the process of determining the area of the reference pattern within each inspection area. The part i determines whether the designation of all inspection areas and the calculation of the area of the reference pattern within the inspection area have been completed, and if they have not been completed, the process returns to g, and if they have been completed, the process returns to g. next j
This is the process of instructing the next step. Part j is a process of determining whether or not the setting of the inspection area is appropriate, and if not, proceeding to part k, and if appropriate, proceeding to part l in Figure 11B. be. Part k is a process of correcting the coordinates of the center of the inspection area, the height and width of the inspection frame, and the number of inspection areas, and the operator is instructed to perform this correction. If this correction is to be made, the process returns to the step b and reads the binarized image into the reference image memory again. In FIG. 11B, parts l to q are the process of specifying the inspection area and calculating the area of the pattern to be inspected within the inspection area in the same manner as described above for the pattern to be inspected, where l corresponds to b, and parts m to q q
correspond to d to h, respectively. r is the difference between the area S 1 of the reference pattern in the inspection area and the area S 2 of the pattern to be inspected |S 1 - S 2 | is the area S 1 of the reference pattern
Deviation d = (|S 1 − S 2 | / S 1 ) × 100 (%)
This is the process of calculating. s determines whether or not all inspection areas have been completed, and if not, returns to part p, and if completed, returns to the next t
This is the process of instructing the user to proceed to the section. The process of t is a process of determining whether or not a pass/fail judgment has been instructed. If a pass/fail judgment has not been instructed, the deviation is displayed and the process ends, and the pass/fail judgment is completed. If there is an instruction to perform , it is instructed to proceed to the next part u. The u part compares the deviation calculated in r with the set tolerance deviation, and if the deviation is larger than the tolerance deviation, outputs a defective product signal and ends the process, and if the deviation is less than the tolerance deviation, the next step is This is the process of instructing to proceed to part v of . Then, the v part determines whether or not the comparison between the deviation and the allowable deviation has been completed for all inspection areas, and if the comparison has not been completed, returns to u, and if the deviation is less than the allowable deviation in all the inspection areas, then This is the process of outputting a non-defective signal and ending the inspection.

上記の説明では、基準パターンの面積と被検査
パターンの面積との差を基準パターンの面積で除
して偏差を求めるとしたが、偏差を求めることな
く面積の差をそのまま判定の資料とし、表示させ
るようにすることもできる。
In the above explanation, the deviation was calculated by dividing the difference between the area of the standard pattern and the area of the pattern to be inspected by the area of the standard pattern. It is also possible to do so.

次に第12図を参照すると、本発明の方法の応
用例を種々示してある。同図aは被検査物の印刷
もれや汚れを検査する場合であり、同図bはライ
ンに異物(図示の例では印刷された文字が異なる
箱)が混入しているのを検査する場合である。ま
た同図cは錠剤等のパツクの検査(錠剤の不足、
錠剤の欠け等)を行なう場合であり、同図dはカ
メラを水平方向に配置して製品に印刷された文字
や汚れを検査する場合である。更に同図eは被検
査物をターンテーブルTに載せて検査する場合
で、びんや円筒体のような物の検査を行なう場合
である。また同図(f)はびんに貼られたラベルの位
置ずれを検査する場合である。
Referring now to FIG. 12, various examples of applications of the method of the present invention are illustrated. Figure a shows a case where the inspection target is inspected for printing leakage or stains, and figure b shows a case where a foreign object (in the example shown, a box with different printed characters) is mixed into the line. It is. Figure c also shows inspection of packs such as tablets (lack of tablets, etc.).
Figure d shows a case where the camera is placed horizontally to inspect characters and stains printed on the product. Further, Fig. 4(e) shows a case where an object to be inspected is placed on a turntable T and inspected, and an object such as a bottle or a cylindrical body is inspected. In addition, Fig. 4(f) shows a case where the positional shift of a label affixed to a bottle is inspected.

以上のように、本発明によれば、基準画像及び
被検査画像に含まれるパターン全体の横方向及び
縦方向の端縁を検出し、検出した端縁を基準にし
て検査領域の中心位置の座標を定めるようにした
ので、被検査対象物を撮像する位置が多少ずれて
も正確に被検査パターンを検査領域内に入れるこ
とができ、常に適確な検査を行なわせることがで
きる利点がある。また検査領域の設定は中心位置
を定めてその周囲に検査枠を設定することにより
行なうので、被検査対象物のパターンが如何なる
場合でも特定の被検査パターンのみを含む検査領
域を設定することができ、必要な部分のみを詳し
く検査して検査精度を高めることができる。
As described above, according to the present invention, the edges in the horizontal and vertical directions of the entire pattern included in the reference image and the image to be inspected are detected, and the coordinates of the center position of the inspection area are determined based on the detected edges. is determined, the pattern to be inspected can be accurately placed within the inspection area even if the position at which the image of the object to be inspected is shifted slightly, and there is an advantage that an appropriate inspection can be performed at all times. Furthermore, since the inspection area is set by determining the center position and setting an inspection frame around it, it is possible to set an inspection area that includes only a specific pattern to be inspected, no matter what the pattern of the object to be inspected. , inspection accuracy can be improved by inspecting only the necessary parts in detail.

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

第1図a乃至cは従来のパターン自動検査方法
において画像を複数の検査領域に分けた状態を示
す説明図、第2図は本発明の方法を実施する装置
の外観を示す斜視図、第3図は本発明の方法にお
いてカメラで被検査物を撮像している状態を示す
説明図、第4図は本発明の方法で用いるイメージ
センサの構成を示す回路図、第5図は本発明の方
法を実施する装置の概略構成を示すブロツク図、
第6図は本発明を実施する装置の操作表示パネル
の構成を示す正面図、第7図は本発明の一実施例
の流れを示すフローチヤート、第8図及び第9図
は本発明の方法における検査領域の指定方法を説
明する説明図、第10図は基準パターンと被検査
パターンとの比較法の一つを説明する線図、第1
1A図及び同B図は本発明で用いるコンピユータ
のプログラムを作成するためのフローチヤート、
第12図a乃至fは本発明の種々の応用例を示す
斜視図である。 1…パターン自動検査装置本体、2…コンベ
ア、3…被検査物、4…照明装置、5…位置検出
センサ、6…カメラ、7…イメージセンサ、u,
d…画像に含まれるパターン全体の縦方向の端
縁、l,r…画像に含まれるパターン全体の横方
向の端縁、α…検査領域の中心位置、β…検査
枠。
1A to 1C are explanatory diagrams showing a state in which an image is divided into a plurality of inspection areas in a conventional automatic pattern inspection method; FIG. 2 is a perspective view showing the appearance of an apparatus for carrying out the method of the present invention; The figure is an explanatory diagram showing a state in which an object to be inspected is imaged by a camera in the method of the present invention, Figure 4 is a circuit diagram showing the configuration of an image sensor used in the method of the present invention, and Figure 5 is a method of the present invention. A block diagram showing a schematic configuration of an apparatus for carrying out the
FIG. 6 is a front view showing the configuration of an operation display panel of an apparatus implementing the present invention, FIG. 7 is a flowchart showing the flow of an embodiment of the present invention, and FIGS. 8 and 9 are a method of the present invention. FIG. 10 is an explanatory diagram illustrating a method of specifying an inspection area in FIG.
1A and 1B are flowcharts for creating a computer program used in the present invention,
Figures 12a to 12f are perspective views showing various applications of the present invention. DESCRIPTION OF SYMBOLS 1... Pattern automatic inspection device main body, 2... Conveyor, 3... Inspected object, 4... Lighting device, 5... Position detection sensor, 6... Camera, 7... Image sensor, u,
d... Vertical edge of the entire pattern included in the image, l, r... Horizontal edge of the entire pattern included in the image, α... Center position of the inspection area, β... Inspection frame.

Claims (1)

【特許請求の範囲】 1 基準となる対象物及び被検査対象物をそれぞ
れ一次元イメージセンサで走査して得た像を2値
化して白または黒の絵素からなる基準画像及び被
検査画像を得、前記基準画像及び被検査画像にそ
れぞれ含まれる基準パターン及び被検査パターン
を比較して被検査対象物の良否の判定を行なうパ
ターン自動検査方法において、前記基準画像及び
被検査画像にそれぞれ含まれるパターン全体の横
方向及び縦方向の端縁を検出して検出した端縁を
基準として検査すべき領域の中心位置の座標を求
め、該中心位置の周囲に所定の大きさの検査枠を
設定して該検査枠の内側の領域を検査領域とし、
前記基準画像及び被検査画像の対応する検査領域
にそれぞれ含まれる基準パターンと被検査パター
ンとを比較することを特徴とするパターン自動検
査方法。 2 前記基準画像及び被検査画像に含まれるパタ
ーン全体の横方向及び縦方向の端縁の検出は、該
パターンの白または黒の部分の面積の横方向及び
縦方向のヒストグラムを作成し、両ヒストグラム
の端部を検出することにより行なうことを特徴と
する特許請求の範囲第1項に記載のパターン自動
検査方法。 3 前記基準パターンと被検査パターンとの比較
は、該基準パターン及び被検査パターンの白また
は黒の部分の面積を比較することにより行なうこ
とを特徴とする特許請求の範囲第1項または第2
項に記載のパターン自動検査方法。 4 前記基準パターンと被検査パターンとの比較
は、該基準パターン及び被検査パターンの白また
は黒の部分の面積の1つの軸方向のヒストグラム
を重ね合せて比較することにより行なうことを特
徴とする特許請求の範囲第1項または第2項に記
載のパターン自動検査方法。 5 前記基準パターンと被検査パターンとの比較
は、該基準パターン及び被検査パターンの白また
は黒の部分の面積の互いに角度をもつた異なる2
つの軸方向のヒストグラムを重ね合せて比較する
ことにより行なうことを特徴とする特許請求の範
囲第1項または第2項に記載のパターン自動検査
方法。 6 前記ヒストグラムを重ね合せて比較する際に
は、重ね合せたヒストグラムの一致していない部
分の間の面積を算出し、該面積を被検査対象物の
良否の判定資料とすることを特徴とする特許請求
の範囲第4項または第5項に記載のパターン自動
検査方法。
[Claims] 1. Images obtained by scanning a reference object and an inspection object with a one-dimensional image sensor are binarized to create a reference image and an inspection image consisting of white or black picture elements. In an automatic pattern inspection method for determining the quality of an object to be inspected by comparing a reference pattern and a to-be-inspected pattern included in the reference image and the to-be-inspected image, respectively, The horizontal and vertical edges of the entire pattern are detected, the coordinates of the center position of the area to be inspected are determined based on the detected edges, and an inspection frame of a predetermined size is set around the center position. and set the area inside the inspection frame as the inspection area,
An automatic pattern inspection method comprising comparing a reference pattern and a pattern to be inspected included in corresponding inspection areas of the reference image and the image to be inspected. 2. To detect the edges in the horizontal and vertical directions of the entire pattern included in the reference image and the image to be inspected, create a horizontal and vertical histogram of the area of the white or black part of the pattern, and 2. The automatic pattern inspection method according to claim 1, wherein the automatic pattern inspection method is carried out by detecting the end of the pattern. 3. The reference pattern and the pattern to be inspected are compared by comparing the areas of white or black portions of the reference pattern and the pattern to be inspected.
Automatic pattern inspection method described in Section. 4. A patent characterized in that the reference pattern and the pattern to be inspected are compared by superimposing and comparing histograms in one axis direction of the areas of the white or black portions of the reference pattern and the pattern to be inspected. An automatic pattern inspection method according to claim 1 or 2. 5 The comparison between the reference pattern and the pattern to be inspected is based on two different areas of the white or black portions of the reference pattern and the pattern to be inspected that are angular to each other.
3. The automatic pattern inspection method according to claim 1, wherein the automatic pattern inspection method is carried out by superimposing and comparing two axial histograms. 6. When the histograms are superimposed and compared, the area between the portions of the superimposed histograms that do not match is calculated, and the area is used as data for determining the quality of the inspected object. An automatic pattern inspection method according to claim 4 or 5.
JP2729879A 1979-03-09 1979-03-09 Pattern automatic inspection method Granted JPS55119782A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2729879A JPS55119782A (en) 1979-03-09 1979-03-09 Pattern automatic inspection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2729879A JPS55119782A (en) 1979-03-09 1979-03-09 Pattern automatic inspection method

Publications (2)

Publication Number Publication Date
JPS55119782A JPS55119782A (en) 1980-09-13
JPS627588B2 true JPS627588B2 (en) 1987-02-18

Family

ID=12217174

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2729879A Granted JPS55119782A (en) 1979-03-09 1979-03-09 Pattern automatic inspection method

Country Status (1)

Country Link
JP (1) JPS55119782A (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS57111781A (en) * 1980-12-29 1982-07-12 Fujitsu Ltd Pattern location detecting method
CA1193709A (en) * 1980-11-17 1985-09-17 Gary G. Wagner Operator programmable inspection apparatus
JPS5827275A (en) * 1981-08-10 1983-02-17 Toshiba Corp Address controlling system for pattern memory
JPS5827278A (en) * 1981-08-10 1983-02-17 Toshiba Corp Line searching system
JPS60147881A (en) * 1984-01-11 1985-08-03 Fuji Xerox Co Ltd Method and device for accumulating picture information
JPS63282576A (en) * 1987-05-14 1988-11-18 Toppan Printing Co Ltd Pattern inspection device
US5060276A (en) * 1989-05-31 1991-10-22 At&T Bell Laboratories Technique for object orientation detection using a feed-forward neural network
JP4631384B2 (en) * 2003-10-20 2011-02-16 オムロン株式会社 Printing state inspection method, character inspection method, and inspection apparatus using these methods
TWI428271B (en) * 2004-06-09 2014-03-01 Smithkline Beecham Corp Apparatus and method for pharmaceutical production

Also Published As

Publication number Publication date
JPS55119782A (en) 1980-09-13

Similar Documents

Publication Publication Date Title
US5305391A (en) Method of and apparatus for inspecting bottle or the like
JPH0599861A (en) Method and device for inspecting transparent vessel
JPS5937451A (en) Method and device for automatically inspecting vessel
US7372556B2 (en) Apparatus and methods for inspecting a composite structure for inconsistencies
JPS627588B2 (en)
JPH11211442A (en) Method and device for detecting defect of object surface
JPH07332951A (en) Apparatus and method for inspecting image
JPS627589B2 (en)
JP3001079B2 (en) Printed character inspection method and printed character inspection device
US5416335A (en) Automated visual inspection system for determining the set positions of a row of dip switches
JPS6210838Y2 (en)
JPH0711414B2 (en) Glass bottle uneven thickness inspection method
JPH06118026A (en) Method for inspecting vessel inner surface
JP3761313B2 (en) Tablet appearance inspection method, tablet appearance inspection device and blister sheet packaging machine
CN102313741A (en) Automatic optical detection system
JPH0829357A (en) Appearance inspection device for automation line
JP3177945B2 (en) Surface defect inspection equipment
KR101056392B1 (en) Surface inspection method and device
JP2701872B2 (en) Surface inspection system
JPH0554127A (en) Visual recognizing device
JPH03110453A (en) Label inspecting device
JPS6211985A (en) Picture binary coding system
JPS62203048A (en) Apparatus for inspecting shape
JPH03235011A (en) Method of selecting container of different kind
JPH0394144A (en) Device for inspecting film-like member