JPS62145491A - Measuring method for number of holes - Google Patents

Measuring method for number of holes

Info

Publication number
JPS62145491A
JPS62145491A JP28743885A JP28743885A JPS62145491A JP S62145491 A JPS62145491 A JP S62145491A JP 28743885 A JP28743885 A JP 28743885A JP 28743885 A JP28743885 A JP 28743885A JP S62145491 A JPS62145491 A JP S62145491A
Authority
JP
Japan
Prior art keywords
pattern
dark
patterns
holes
workpiece
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP28743885A
Other languages
Japanese (ja)
Inventor
Keiji Iwasaki
岩崎 啓二
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.)
Komatsu Ltd
Original Assignee
Komatsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Komatsu Ltd filed Critical Komatsu Ltd
Priority to JP28743885A priority Critical patent/JPS62145491A/en
Publication of JPS62145491A publication Critical patent/JPS62145491A/en
Pending legal-status Critical Current

Links

Landscapes

  • Length Measuring Devices By Optical Means (AREA)

Abstract

PURPOSE:To measure the number of holes in a real time by storing a specific uneven pattern consisting of binary picture elements of the holes formed on a work and comparing a bright and dark pattern obtained by moving one by one picture element by a visual means and a memory pattern. CONSTITUTION:Light passing through the work 3 from a light source 1 is made incident to a line sensor 2 and the output thereof is inputted to a comparator 6. Every time when the sensor 2 is moved to the positions of the respective lines of the work 3, it scans respective columns by a signal from a driving circuit 5. From the comparator 6, the bright and dark pattern of binary signals of '1', '0' corresponding to the formation of the work is outputted. This bright and dark pattern is compared with the first and the second reference patterns indicating specific uneven corners of the holes stored in a counting circuit consisting of a memory controller 7, memories 8, 9, an up down gate 10, and an up down counter 11. The counter 11 outputs the difference between the numbers of the bright and dark patterns respectively coinciding with the first and the second reference patterns to a CPU4. The CPU4 displays the number obtained by adding '1' to the number of the inputs on a display device 12 as the number of the holes of the work.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明はワークに形成された穴の数を計測する穴数計測
方法に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a hole number counting method for counting the number of holes formed in a workpiece.

〔従来の技術〕[Conventional technology]

一般に、パンチあるいはドリル加工によってワークに穴
を穿設する製造工程において、ドリル折れなどの原因で
不良品を生産することがある。
Generally, in a manufacturing process in which holes are punched or drilled into a workpiece, defective products may be produced due to drill breakage or the like.

従来は抽出検査で製品を人間が目視で検査して穴あけミ
ス、穴数、良・不良品の検査をしていた。
In the past, products were visually inspected by humans using sampling inspection to check for drilling errors, number of holes, and good/defective products.

しかし、穴数が多い場合には、全ての穴を検査できない
こともある。また抽出検査ではすぐにシステムを停止で
きないため、不良品を大量に生産してしまうことがある
However, if there are many holes, it may not be possible to inspect all the holes. Additionally, since the system cannot be stopped immediately during sampling inspection, a large number of defective products may be produced.

そこで、TVカメラ等の視覚手段によりワークを捕え、
その画像データから穴のパターン認識する処理、あるい
は画像データから輪郭線を検出し、輪郭線が閉じた場合
にはそこに1つの穴が設けられていると判断する画像処
理等を行うことによって穴数を計測する方法が考えられ
る。
Therefore, the workpiece is captured by visual means such as a TV camera,
By performing image processing to recognize the hole pattern from the image data, or by detecting the contour line from the image data and determining that a hole is provided there if the contour line is closed. One possible method is to measure the number.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

しかしながら、上記方法では1画面分の画像データを一
旦メモリに取り込み、上記画像処理を行わなければなら
ないため、大きなメモリ容量が必要であるとともに、画
像処理するソフトも難しく、リアルタイム処理ができな
いという問題がある。
However, in the above method, one screen's worth of image data must be loaded into memory and then subjected to the above image processing, which requires a large memory capacity, the software for image processing is difficult, and real-time processing is not possible. be.

本発明は上記実情に鑑みてなされたもので、視覚手段を
用いてワークlζ守役された穴数をリアルタイムに計測
することができる穴数計測方法を提供することを目的と
する。
The present invention has been made in view of the above-mentioned circumstances, and an object of the present invention is to provide a method for measuring the number of holes in a workpiece lζ that can measure the number of holes guarded in a work lζ in real time using visual means.

〔問題点を解決するための手段〕[Means for solving problems]

かかる従来の問題点を解決するため、本発明では、ワー
クに形成された穴よりも小さい領域を示し、各画素につ
いて2値化された少くとも2×2画素からなる明暗パタ
ーンであって、その明暗パターンのうち穴の特定の凹コ
ーナを示す明暗パターンを第1の参照パターンとし、前
記凹コーナとは逆の方向に突出する凸コーナを示す明暗
パターンを第2の参照パターンとして予め記憶しておき
、前記ワークが存在する所定の視野を視覚手段で捕え、
この視覚手段の出力に基づいて前記明暗パターンを前記
所定の視野内において1画素づつ移動しながら順次抽出
し、この順次抽出した明暗パターンと前記第1、第2の
参照パターンとを比較し、前記第1の参照パターンと一
致する明暗パターンの数および前記第2の参照パターン
と一致する明暗パターンの数に基づいて前記ワークに形
成された穴数を計測するようにしている。
In order to solve such conventional problems, the present invention provides a bright and dark pattern consisting of at least 2 x 2 pixels, each pixel of which is binarized, indicating an area smaller than the hole formed in the workpiece. Among the light and dark patterns, a light and dark pattern indicating a specific concave corner of the hole is used as a first reference pattern, and a light and dark pattern indicating a convex corner protruding in the opposite direction to the concave corner is stored in advance as a second reference pattern. and capture a predetermined field of view in which the work exists using visual means,
Based on the output of the visual means, the bright and dark patterns are sequentially extracted while moving pixel by pixel within the predetermined field of view, and the sequentially extracted bright and dark patterns are compared with the first and second reference patterns, and the bright and dark patterns are compared with the first and second reference patterns. The number of holes formed in the workpiece is measured based on the number of bright and dark patterns that match the first reference pattern and the number of bright and dark patterns that match the second reference pattern.

〔実施例〕〔Example〕

以下、本発明の実施例を添付図面を参照して詳細に説明
する。
Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings.

まず、本発明の原理を述べる。First, the principle of the present invention will be described.

第′1図(a)はワークの部分形状を7×12画素のマ
トリックス状の2値化像で示したもので、3〜5行にお
ける5〜8列の明部(白い部分)がワークの穴を示し、
この明部以外の暗部(斜線の部分)がワークの面を示し
ている。
Figure 1(a) shows the partial shape of the workpiece as a binary image of a 7x12 pixel matrix, where the bright parts (white parts) in columns 5 to 8 in rows 3 to 5 are the parts of the workpiece. showing the hole;
A dark area (shaded area) other than the bright area indicates the surface of the workpiece.

ここで、第1表に示すように「1」を明るい画素、「0
」を暗い画素として、2×2の画素からなる第1の参照
パターンおよび第2の参照パターンを設定する。この第
1の参照パターンは、上記2値化像の5.6行における
4、5列の明暗パターンに一致し、これらの行列に係る
左下の凹コーナAを特定する。
Here, as shown in Table 1, "1" is a bright pixel, and "0" is a bright pixel.
'' as a dark pixel, a first reference pattern and a second reference pattern each consisting of 2×2 pixels are set. This first reference pattern matches the light-dark pattern of the 4th and 5th columns in the 5.6th row of the binarized image, and specifies the lower left concave corner A related to these matrices.

第1表 第1の参照パターン    第2の参照パターンしかし
て、このような穴においては、左下の凹コーナAを示す
第1の参照パターンの存在数が1である。
Table 1 First Reference Pattern Second Reference Pattern However, in such a hole, the number of first reference patterns that indicate the lower left concave corner A is one.

また、第2図(b)に示す穴においては、第1の参照パ
ターンが凹コーナA1に係る4、5行における4、5列
と、凹コーナA2に係る5、6行における5、6列とに
存在している。一方、このような場合には、上記凹コー
ナとは逆方向の凸コーナBが形成されることになる。こ
の凸コーナBに係る4、5行における5、6列の明暗パ
ターンは、前記第1表に示した第2の参照パターンに一
致し、この第2の参照パターンがこの凸コーナBを特定
する。そこで、第1の参照パターンの存在数2カ)ら第
2の参照パターンの存在数1を差し引くと1が求められ
る。
In addition, in the hole shown in FIG. 2(b), the first reference pattern is in the 4th and 5th columns in the 4th and 5th rows related to the concave corner A1, and in the 5th and 6th columns in the 5th and 6th rows related to the concave corner A2. It exists in On the other hand, in such a case, a convex corner B is formed in the opposite direction to the concave corner. The bright and dark patterns in the 5th and 6th columns in the 4th and 5th rows related to this convex corner B match the second reference pattern shown in Table 1, and this second reference pattern specifies this convex corner B. . Therefore, by subtracting the number of second reference patterns (1) from the number of first reference patterns (2), 1 is obtained.

同様に、第1図(C)に示される穴においては、第1の
参照パターンが凹コーナA3 、A4 、AsおよびA
6に係る各々の隣接2行における隣接2列に存在し、ま
た第2の参照パターンが凸コーナB1、B2およびB3
に係る各々の隣接2行における隣接2列に存在している
。よりて、第1の参照パターンの存在数4から第2の参
照パターンの存在数3を差し引くと1が求められる。
Similarly, in the hole shown in FIG. 1(C), the first reference pattern has concave corners A3, A4, As and A
6, and the second reference pattern is present in two adjacent columns in each two adjacent rows according to B1, B2 and B3.
exists in two adjacent columns in each adjacent two rows. Therefore, 1 is obtained by subtracting the number 3 of the second reference pattern from the number 4 of the first reference pattern.

このように、ワークに形成された穴がどのような形状で
あっても、1つの穴における第1の参照パターンの存在
数と第2の参照パターンの存在数との差が1化なる。し
たがって、ワークに複数の穴が形成されている場合、各
穴における上記差が1なので、総ての穴に係る上記差が
穴の数に等しくなる。それ故、その差を求めることによ
って、穴の数を計測することができる。
In this way, no matter what shape the holes formed in the workpiece have, the difference between the number of first reference patterns and the number of second reference patterns in one hole becomes one. Therefore, when a plurality of holes are formed in the workpiece, since the difference between each hole is 1, the difference between all the holes is equal to the number of holes. Therefore, by finding the difference, the number of holes can be measured.

また、第2図(a)に示されるような左上の凹コーナC
を特定する第1の参照パターンと、この凹コーナCとは
逆方向の凸コーナEを特定する第2の参照パターンとの
各存在数の差を求めてもよい。    ゛この場合の第
1の参照パターンと、第2の参照パターンとを第2表に
示す。
Also, the upper left concave corner C as shown in Fig. 2(a)
The difference in the number of occurrences between a first reference pattern that specifies the concave corner C and a second reference pattern that specifies the convex corner E in the opposite direction to the concave corner C may be determined.゛The first reference pattern and the second reference pattern in this case are shown in Table 2.

第2表 第1の参照パターン      第2の参照パターン同
様に、第2図Φ)に示すような右上の凹コーナFを特定
する第3表における第1の参照パターンと、この凹コー
ナFとは逆方向の凸コーナGを特定する第2の参照パタ
ーンとの各存在数の差を求めてもよい。
Table 2 First Reference Pattern Similarly to the second reference pattern, the first reference pattern in Table 3 identifies the upper right concave corner F as shown in Figure 2 Φ), and what is this concave corner F? The difference in the number of occurrences of each pattern may be calculated from a second reference pattern that specifies a convex corner G in the opposite direction.

第3表 第1の参照パターン    第2の参照パターンさらに
、第2図(CJに示すような右下の凹コーナHを特定す
る第4表における第1の参照パターンと、この凹コーナ
Hとは逆方向の凸コーナIを特定する第2の参照パター
ンとの各存在数の差を求めてもよい。
Table 3 First reference pattern Second reference pattern Furthermore, the first reference pattern in Table 4 that specifies the lower right concave corner H as shown in Figure 2 (CJ), and what is this concave corner H? The difference in the number of occurrences of each pattern may be calculated from the second reference pattern that specifies the convex corner I in the opposite direction.

第4表 第1の参照パターン     第2の参照パターン次に
、第3図(a)に示すようにワーク31の全体の形状を
示す2値化像においては、ワーク31の外周iこ例えば
上記凸コーナBが1つ存在している。
Table 4 First reference pattern Second reference pattern Next, in the binarized image showing the entire shape of the workpiece 31 as shown in FIG. 3(a), the outer circumference i of the workpiece 31 is There is one corner B.

したがって、ワーク3Iの全体の2値化像Iζ基づいて
第2の参照パターンの存在数を求めると、この存在数に
ワーク31の外周の凸コーナに係る第2の参照パターン
が1つ含まれる。このような場合、第1と第2の参照パ
ターンの各存在数の差を求めると、上記外周の凸コーナ
に係る第2の参照パターンが1つ余分に差し引かれてそ
の差が穴の数よりも1つ小さくなるので、その差に1を
加算することによって穴の数を求めねばならない。
Therefore, when the number of existing second reference patterns is calculated based on the entire binarized image Iζ of the workpiece 3I, one second reference pattern related to a convex corner on the outer periphery of the workpiece 31 is included in the number of existing second reference patterns. In such a case, when calculating the difference between the numbers of each of the first and second reference patterns, one extra second reference pattern related to the convex corner on the outer periphery is subtracted, and the difference is less than the number of holes. is also one smaller, so the number of holes must be found by adding 1 to the difference.

また、第3図(b)に示すような形状のワーク32にお
いては、上記凹コーナAと凸コーナBを特定する第1と
第2の参照パターンの各存在数の差が1になる。よって
、どのような形状のワークでもワークの外周についての
第1と第2の参照パターンの各存在数の差が必ず1にな
る。それ故、ワークの全体の2値化像に基づいて穴の数
を求める場合、ワークの外周右よぴ穴についての第1と
第2の参照パターンの各存在数の差に1を加えればよい
Further, in the workpiece 32 having the shape shown in FIG. 3(b), the difference in the number of the first and second reference patterns that specify the concave corner A and the convex corner B is 1. Therefore, regardless of the shape of the workpiece, the difference between the numbers of the first and second reference patterns on the outer periphery of the workpiece is always 1. Therefore, when calculating the number of holes based on the binarized image of the entire workpiece, it is sufficient to add 1 to the difference in the number of holes in the first and second reference patterns for holes located on the right side of the outer circumference of the workpiece. .

次に、本発明の方法を適用した装置の実施例を第4図を
用いて説明する。
Next, an embodiment of an apparatus to which the method of the present invention is applied will be described with reference to FIG.

この装置における光源1とラインセンサ2との間にはワ
ーク3が配置され、ワーク3によって遮断されない光源
1からの光のみがラインセンサ2に入射するようになっ
ている。なお、第5図に示すように上記ワーク3は穴3
a、3bおよび3Cを有した形状であり、ラインセンサ
2は1〜14行までの各位置に順次移行される。
A workpiece 3 is placed between a light source 1 and a line sensor 2 in this device, so that only light from the light source 1 that is not blocked by the workpiece 3 enters the line sensor 2. In addition, as shown in FIG. 5, the workpiece 3 has a hole 3.
It has a shape having a, 3b and 3C, and the line sensor 2 is sequentially moved to each position from 1st to 14th row.

CPU4はラインセンサ2が各行の位置に移行される毎
に、トリガ信号をセンサ駆動回路5に加え、センサ駆動
回路5はこのトリガ信号を入力すると、ラインセンサ駆
動用のクロック信号を2インセンサ2に加える。これに
よって、ラインセンサ2は上記クロック信号番こ同期し
て1列目のポイントPから18列目のポイントPまで走
査を行い、各ポイントでの受光量に比例した検出出力を
比較器6に順次加える。
The CPU 4 applies a trigger signal to the sensor drive circuit 5 each time the line sensor 2 is moved to the position of each row, and when the sensor drive circuit 5 receives this trigger signal, it sends a clock signal for driving the line sensor to the 2-in sensor 2. Add. As a result, the line sensor 2 scans from point P in the 1st column to point P in the 18th column in synchronization with the clock signal number, and sequentially sends a detection output proportional to the amount of light received at each point to the comparator 6. Add.

比較器6は2値化回路であり、上記検出出力が予設定さ
れたしきい値以上であれば上記ポイントで光を受光した
ことを示す信号′″1”を出力し、しきい値以下であれ
ば上記ポイントで光を受光しなかつたことを示す信号″
0”を出力する。したがって、第6図に示すようにライ
ンセンサ2が各行の位置で走査を行う毎に、ワーク形状
に応じた2値化信号が比較器6カ)ら出力される。
The comparator 6 is a binary circuit, and if the detection output is above a preset threshold value, it outputs a signal ``1'' indicating that light has been received at the above point; If so, a signal indicating that no light was received at the above point.''
Therefore, as shown in FIG. 6, each time the line sensor 2 scans at each row position, a binarized signal corresponding to the shape of the workpiece is output from the comparator 6).

上記2値化信号はメモリコントローラ7に加えられる。The binarized signal is applied to the memory controller 7.

メモリコントロー27は第1と第2のメモリ8および9
を交互に選択しており、上記走査が奇数行で行われてい
るときに第1のメモリ8を選択し、また偶数行で行われ
ているときに第2のメモリ9を選択する。そして、選択
したメモリに上記2値化信号を加えるとともに、この2
値化信号をアップダウンゲート10にも加える。
The memory controller 27 controls the first and second memories 8 and 9.
are selected alternately, and the first memory 8 is selected when the above-mentioned scanning is performed on odd-numbered rows, and the second memory 9 is selected when scanning is performed on even-numbered rows. Then, the above-mentioned binary signal is added to the selected memory, and this binary
The value signal is also applied to the up/down gate 10.

第1および第2のメモリ8および9は、第7図に示すよ
うに隣接する奇数行および偶数行の1列分の2値化信号
をそれぞれ記憶する。しかして、2インセンサ2が移動
して新たな2値化信号が加えられると記憶を消去してそ
の2値化信号を記憶する。
The first and second memories 8 and 9 respectively store binarized signals for one column of adjacent odd-numbered rows and even-numbered rows, as shown in FIG. When the 2-in sensor 2 moves and a new binarized signal is added, the memory is erased and the binarized signal is stored.

一方、アップダウンゲート10はメモリコントローラ7
から現走査に基づくn行の2値化信号を入力したときに
、第1または第2のメモリから1つ前の走査に基づくn
−1行の2値化信号を入力する。第8図はこのアップダ
ウンゲート10の構成を示しており、上記n行の2値化
信号が1列目から順次Dフリップフロップ81の端子D
1に印加されると同時に、上記n−1行の2値化信号が
1列目力1ら順次端子D3に加えられる。そして、端子
Q1から出力されたn行の2値化信号が端子D!に印加
され、端子Q3から出力されたn−1行の2値化信号が
端子D4に印加される。よって、端子Q1 、Q2.Q
sおよびQ4からは、それぞれ(n−1,m)、(n−
1,m−1)、(” +m)および(n、m−1)の位
置における2値化信号が出力される。
On the other hand, the up/down gate 10 is connected to the memory controller 7
When n binarized signals based on the current scan are input from the first or second memory, n lines based on the previous scan are input from the first or second memory.
- Input one row of binarized signals. FIG. 8 shows the configuration of this up-down gate 10, in which the binary signals of the n rows are sequentially input to the terminal D of the D flip-flop 81 starting from the first column.
At the same time, the binary signals of the n-1 rows are sequentially applied to the terminal D3 starting from the first column power 1. Then, the binary signals of n rows output from terminal Q1 are output from terminal D! The n-1 row of binarized signals output from the terminal Q3 are applied to the terminal D4. Therefore, terminals Q1, Q2 . Q
From s and Q4, (n-1, m) and (n-
Binarized signals at positions 1, m-1), (''+m) and (n, m-1) are output.

上記各端子Qs  + Qz + QsおよびQ4から
出力された2値化信夛は、各々アンド回路82および8
3に加えられる。アンド回路82は上記各端子Q1 #
Q2.93gよびQ4に係る各2値化信号が前述した第
1表における第1の参照パターンと一致した場合にアン
ド条件が成立し、アップカウント信号11”を出力し、
アンド回路83は第1表における第2の参照パターンと
一致した場合にアンド条件が成立し、ダウンカウント信
号”1″を出力する。
The binarized signals output from the terminals Qs + Qz + Qs and Q4 are sent to AND circuits 82 and 8, respectively.
Added to 3. The AND circuit 82 connects each of the above terminals Q1 #
When each of the binary signals related to Q2.93g and Q4 matches the first reference pattern in Table 1 described above, the AND condition is satisfied and an up count signal 11'' is output,
If the pattern matches the second reference pattern in Table 1, the AND condition is satisfied and the AND circuit 83 outputs a down count signal "1".

上記各カウント信号11”はアップダウンカウンタ11
に加えられる。アップダウンカウンタ11はアップカウ
ント信号′″1”をアップカウントするとともに、ダウ
ンカウント信号′″1”をダウンカウントする。
Each of the above count signals 11'' is an up/down counter 11
added to. The up/down counter 11 counts up the up count signal ``1'' and counts down the down count signal ``1''.

ところで、第7図の2値化偉かられかるように、第1の
参照パターンと同一のパターンは、凹コーナA、M−A
yに存在する。また、第2の参照パターンと同一のパタ
ーンは、凸コーナB1〜B、に存在している。よりて、
第1の参照パターンと同一のパターンの存在数が7であ
り、第2の参照パターンと同一のパターンの存在数が5
である。故に、アップダウンカウンタ11はラインセン
サ2が各行の走査を終了した時点で上記各存在数の差2
を計数し、この差2を示す信号をCPU4に加える。な
お、第7図からも明らかなように各穴3a、3bおよび
3Cにおける第1の参照パターンと同一のパターンの数
から第2の参照パターンと同一のパターンの数を引いた
値はそれぞれ1である。一方、ワークの外周における上
記値は−1となる。
By the way, as can be seen from the binarization process in FIG. 7, the same pattern as the first reference pattern is the concave corner A, M-A.
Exists in y. Moreover, the same pattern as the second reference pattern exists in the convex corners B1 to B. By the way,
The number of patterns that are the same as the first reference pattern is 7, and the number of patterns that are the same as the second reference pattern is 5.
It is. Therefore, the up/down counter 11 calculates the difference 2 between the numbers of each line when the line sensor 2 finishes scanning each row.
is counted, and a signal indicating this difference of 2 is added to the CPU 4. As is clear from FIG. 7, the value obtained by subtracting the number of patterns identical to the second reference pattern from the number of patterns identical to the first reference pattern in each hole 3a, 3b, and 3C is 1. be. On the other hand, the above value at the outer circumference of the workpiece is -1.

CPU4は上記差2に1を加算し、ワーク3における穴
3a 、3bおよび3Cのみに関係する凹コーナと凸コ
ーナの差3を求める。そして、求めた穴の数3を示す信
号を表示器12に加え、表示器12に穴の数3をデジタ
ル表示させる。
The CPU 4 adds 1 to the difference 2 to obtain the difference 3 between the concave corner and the convex corner, which is related only to the holes 3a, 3b, and 3C in the workpiece 3. Then, a signal indicating the determined number of holes, 3, is applied to the display 12, and the number of holes, 3, is digitally displayed on the display 12.

さて、1つのワークについて穴の数が計測されると、別
のワークが光源1とラインセンサ2の間に配置され、上
記計測が次々と行われる。しかして、CPU4はワーク
の穴の数が3以外の場合、そのワークを不良品と判断し
、ワークの製造システム13に停止信号を送出してこの
システム13を停止させ、不良品が製造され続けること
を防止する。
Now, once the number of holes in one workpiece has been measured, another workpiece is placed between the light source 1 and the line sensor 2, and the above measurements are performed one after another. However, if the number of holes in the workpiece is other than 3, the CPU 4 determines that the workpiece is a defective product, sends a stop signal to the workpiece manufacturing system 13 to stop this system 13, and defective products continue to be manufactured. prevent this from happening.

第9図は本発明の方法が適用された装置の他の実施例を
示しており、第4図に示された装置におけるメモリコン
トローラ7、第1と第2のメモリ8および9の代わりに
シフトレジスタ14を挿入して構成される。この実施例
の装置ではシフトレジスタ14に1行分の2値化信号が
蓄積され、これによってn−1行の2値化信号が得られ
るようにしている。
FIG. 9 shows another embodiment of the device to which the method of the invention is applied, in which the memory controller 7, first and second memories 8 and 9 in the device shown in FIG. It is configured by inserting a register 14. In the apparatus of this embodiment, one row of binary signals is stored in the shift register 14, so that n-1 rows of binary signals can be obtained.

なお、上記実施例ではラインセンサ2を各行の位置に移
行させているが、ワーク3の位置を移行させるようにし
てももちろんよい。
In the above embodiment, the line sensor 2 is moved to the position of each row, but the position of the workpiece 3 may of course be moved.

ところで、例えば総て信号″″0”で形成されるべき隣
接2行における隣接2列にノイズによる信号@l”が混
入して、第1の参照パターンと同一のパターンが誤りて
形成されたり、あるいは総て信号″′1″で形成される
べき隣接2行における隣接2列にノイズによる信号′″
0”が混入して、第2の参照パターンと同一のパターン
が誤って形成されたりすれば、これらの誤ったパターン
の存在をも計数してしまう。
By the way, for example, a signal @l due to noise may be mixed into two adjacent columns in two adjacent rows that should all be formed with the signal ""0", and a pattern identical to the first reference pattern may be formed by mistake. Or a signal ``'' due to noise in two adjacent columns in two adjacent rows that should all be formed by the signal ``'1''.
If a pattern identical to the second reference pattern is erroneously formed due to the mixing of 0'', the existence of these erroneous patterns will also be counted.

そこで、例えば#I5表に示すような第1と第2の参照
パターンが含まれる隣接2行における隣接4列の各参照
パターンを予設定すると、1つのノイズ信号によってこ
れらの参照パターンが形成されるようなことがなく、こ
れらの参照パターンの存在数の差に基づいて穴の数を計
測することができる。
Therefore, if each reference pattern in four adjacent columns in two adjacent rows containing the first and second reference patterns as shown in table #I5 is preset, these reference patterns are formed by one noise signal. Without this, the number of holes can be measured based on the difference in the number of these reference patterns.

第5表 第1の参照データパターンを含む参 照パターン 第2の参照データパターンを含む参 照パターン ところで、本実施例では上記第1表〜第4表のうちのい
ずれかに示される第1と第2の参照パターンに基づき、
ワークの2値化像に右ける上記第1と第2の参照パター
ンの存在数の差に1を加算して穴数を計測している。し
かして、第1表〜第4表に示される総ての第1の参照パ
ターンの存在数a、および総ての第2の参照パターンの
存在数すを求め、次式q)に示す演算を行って穴数Cを
計測することもできる。
Table 5 Reference pattern including the first reference data pattern Reference pattern including the second reference data pattern By the way, in this embodiment, the first and second reference data patterns shown in any of Tables 1 to 4 above are Based on the reference pattern of
The number of holes is measured by adding 1 to the difference between the numbers of the first and second reference patterns in the binarized image of the workpiece. Therefore, the number of existence a of all the first reference patterns shown in Tables 1 to 4 and the number of existence of all the second reference patterns are determined, and the operation shown in the following equation q) is calculated. You can also measure the number of holes C by going there.

−b C= −+ 1      ・−(1)なお、上記2×
2の画素の大きさは探索しようとする穴の大きさよりも
小さくなければならない。
−b C= −+ 1 ・−(1) Note that the above 2×
The size of the second pixel must be smaller than the size of the hole to be searched.

また、本発明はラインセンサに限らず2次元を捕えるテ
レビカメラ等、他の視覚手段を用いることもできる。
Further, the present invention is not limited to the line sensor, but can also use other visual means such as a television camera that captures two-dimensional images.

〔発明の効果〕〔Effect of the invention〕

以上説明したように本発明によれば、穴検出の処理をハ
ード化したため、リアルタイムに穴数の計測ができ、ま
た、装置も簡単になる。更に、この計測方法は、ワーク
の設置方向、形状及び穴の形状に力1力)わらず、いか
なるワークに対しても同一の処理により、そのワークの
穴数を計測することができる。
As explained above, according to the present invention, the hole detection process is made hardware, so the number of holes can be measured in real time, and the apparatus becomes simpler. Furthermore, this measurement method can measure the number of holes in any workpiece by the same process, regardless of the installation direction, shape, or hole shape of the workpiece.

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

第1図、第2図および第3図はワークの2値化偉を明暗
パターンで示した図、第4図は本発明に係る方法が適用
された装置の一実施例を示すブロック図、第5図は第4
図に示された実施例におけるワークとこのワークをとら
えるラインセンサの走査位置を示した図、第6図は第4
図に示された実施例における各走査線の2値化信号を示
すタイミングチャート、第7図は第4図に示された実施
例における2値化像を′″l”と@O”で示す図、第8
図は第4図に示された実施例におけるアップダウンゲー
トの構成を示すブロック図、第9図は本発明の方法が適
用された他の実施例を示すブロック図である。 l・・・光源、2・・・ラインセンサ、3・・・ワーク
、4・−CP U、5・・・センサ駆動回路、6・・・
比較器、7・・・メモリコントローラ、8・・・第1の
メモリ、9・・・第2のメモリ、10・・・アップダウ
ンゲート、11・・・アクプダウンカウンタ、12・・
・表示器、13・・・製造システム、14・・・シフト
レジスタ出願人代理人  木 村 高 久 第114 第2図
1, 2, and 3 are diagrams showing the binarization of a workpiece using bright and dark patterns, and FIG. 4 is a block diagram showing an embodiment of a device to which the method according to the present invention is applied. Figure 5 is the fourth
Figure 6 is a diagram showing the workpiece and the scanning position of the line sensor that captures the workpiece in the embodiment shown in the figure.
A timing chart showing the binarized signal of each scanning line in the embodiment shown in the figure, and FIG. 7 shows the binarized image in the embodiment shown in FIG. 4 with ``''l'' and @O''. Figure, 8th
This figure is a block diagram showing the configuration of the up-down gate in the embodiment shown in FIG. 4, and FIG. 9 is a block diagram showing another embodiment to which the method of the present invention is applied. l...Light source, 2...Line sensor, 3...Work, 4...-CPU, 5...Sensor drive circuit, 6...
Comparator, 7... Memory controller, 8... First memory, 9... Second memory, 10... Up/down gate, 11... Up/down counter, 12...
・Display device, 13... Manufacturing system, 14... Shift register applicant's agent Takahisa Kimura No. 114 Figure 2

Claims (2)

【特許請求の範囲】[Claims] (1)ワークに形成された穴よりも小さい領域を示し、
各画素について2値化された少なくとも2×2画素から
なる明暗パターンであって、その明暗パターンのうち穴
の特定の凹コーナを示す明暗パターンを第1の参照パタ
ーンとし、前記凹コーナとは逆の方向に突出する凸コー
ナを示す明暗パターンを第2の参照パターンとして予め
記憶しておき、前記ワークが存在する所定の視野を視覚
手段で捕え、この視覚手段の出力に基づいて前記明暗パ
ターンを前記所定の視野内において1画素づつ移動しな
がら順次抽出し、この順次抽出した明暗パターンと前記
第1、第2の参照パターンとを比較し、前記第1の参照
パターンと一致する明暗パターンの数から前記第2の参
照パターンと一致する明暗パターンの数を減算し、この
減算値に1を加算した値を前記ワークに形成された穴数
とすることを特徴とする穴数計測方法。
(1) Indicates an area smaller than the hole formed in the workpiece,
A light and dark pattern consisting of at least 2 x 2 pixels binarized for each pixel, and among the light and dark patterns, a light and dark pattern indicating a specific concave corner of the hole is used as a first reference pattern, and the light and dark pattern is opposite to the concave corner. A bright and dark pattern showing a convex corner protruding in the direction of is stored in advance as a second reference pattern, a predetermined visual field in which the workpiece is present is captured by visual means, and the bright and dark pattern is determined based on the output of this visual means. Sequentially extracting while moving pixel by pixel within the predetermined visual field, comparing the sequentially extracted light and dark patterns with the first and second reference patterns, and determining the number of light and dark patterns that match the first reference pattern. A method for measuring the number of holes, characterized in that the number of bright and dark patterns that match the second reference pattern is subtracted from the second reference pattern, and 1 is added to the subtracted value to determine the number of holes formed in the workpiece.
(2)ワークに形成された穴よりも小さい領域を示し、
各画素について2値化された少なくとも2×2画素から
なる明暗パターンであって、その明暗パターンのうち凹
コーナを示す明暗パターンを第1の参照パターンとし、
凸コーナを示す明暗パターンを第2の参照パターンとし
て予め記憶しておき、前記ワークが存在する所定の視野
を視覚手段で捕えこの視覚手段の出力に基づいて前記明
暗パターンを、前記所定の視野内において1画素づつ移
動しながら順次抽出し、この順次抽出した明暗パターン
と前記第1、第2の参照パターンとを比較し、前記第1
の参照パターンと一致する明暗パターンの第1の数aお
よび前記第2の参照パターンと一致する明暗パターンの
第2の数bを求め、前記第1の数aおよび第2の数bか
ら、前記ワークに形成された穴数cを、次式、 C=(a−b)/4+1 によって求めることを特徴とする穴数計測方法。
(2) Indicates an area smaller than the hole formed in the workpiece,
A light and dark pattern consisting of at least 2 x 2 pixels binarized for each pixel, a light and dark pattern indicating a concave corner among the light and dark patterns as a first reference pattern,
A bright and dark pattern indicating a convex corner is stored in advance as a second reference pattern, a predetermined visual field in which the workpiece is present is captured by a visual means, and the bright and dark pattern is determined based on the output of this visual means within the predetermined visual field. The sequentially extracted light and dark patterns are compared with the first and second reference patterns, and the first and second reference patterns are sequentially extracted while moving one pixel at a time.
A first number a of light and dark patterns that match the reference pattern of A method for measuring the number of holes, characterized in that the number c of holes formed in a workpiece is determined by the following formula: C=(a-b)/4+1.
JP28743885A 1985-12-20 1985-12-20 Measuring method for number of holes Pending JPS62145491A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP28743885A JPS62145491A (en) 1985-12-20 1985-12-20 Measuring method for number of holes

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP28743885A JPS62145491A (en) 1985-12-20 1985-12-20 Measuring method for number of holes

Publications (1)

Publication Number Publication Date
JPS62145491A true JPS62145491A (en) 1987-06-29

Family

ID=17717318

Family Applications (1)

Application Number Title Priority Date Filing Date
JP28743885A Pending JPS62145491A (en) 1985-12-20 1985-12-20 Measuring method for number of holes

Country Status (1)

Country Link
JP (1) JPS62145491A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04142691A (en) * 1990-09-27 1992-05-15 Opt Tec Corp Automatic photoelectric image count system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04142691A (en) * 1990-09-27 1992-05-15 Opt Tec Corp Automatic photoelectric image count system

Similar Documents

Publication Publication Date Title
US4056716A (en) Defect inspection of objects such as electronic circuits
EP0483966A2 (en) Method of and apparatus for inspecting a transparent or translucent article such as a bottle
US6621928B1 (en) Image edge detection method, inspection system, and recording medium
US6456318B1 (en) Defect inspection apparatus and method by comparing two pairs of areas adjacent to one another
EP0486701B1 (en) Line detection method
JP4581424B2 (en) Appearance inspection method and image processing apparatus
JPS62145491A (en) Measuring method for number of holes
US4984075A (en) Contour detecting apparatus
US5701362A (en) Wire breakage detecting method
JPH03291507A (en) Inspection instrument for cylindrical body
JP2733958B2 (en) Long sheet defect inspection equipment
JP2569543B2 (en) Hardness tester
JPH046404A (en) Image monitoring method
JPH03160309A (en) Image quality testing apparatus
JPS5914782B2 (en) Binary pattern digitization processing method
JPS60100076A (en) Inspecting apparatus for color mark omission
JP3473114B2 (en) Image processing method
JP2510480B2 (en) Image defect determination device
JPS6036120B2 (en) Chip-shaped component positional deviation inspection device
JPH0410173A (en) Picture monitoring method
JPS6160094A (en) Detection device of status change by tv camera
JPS6315116B2 (en)
JPH08193959A (en) Device and method for detecting surface scratch of inspection object
JP2513528Y2 (en) Gray image processor
JPH0670794B2 (en) Pattern detector