JPH0444985B2 - - Google Patents

Info

Publication number
JPH0444985B2
JPH0444985B2 JP59200401A JP20040184A JPH0444985B2 JP H0444985 B2 JPH0444985 B2 JP H0444985B2 JP 59200401 A JP59200401 A JP 59200401A JP 20040184 A JP20040184 A JP 20040184A JP H0444985 B2 JPH0444985 B2 JP H0444985B2
Authority
JP
Japan
Prior art keywords
line
memory
label
section
addresses
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP59200401A
Other languages
Japanese (ja)
Other versions
JPS6180376A (en
Inventor
Takanori Ninomya
Toshiaki Ichinose
Yasuo Nakagawa
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP59200401A priority Critical patent/JPS6180376A/en
Publication of JPS6180376A publication Critical patent/JPS6180376A/en
Priority to US07/158,125 priority patent/US4953224A/en
Publication of JPH0444985B2 publication Critical patent/JPH0444985B2/ja
Granted legal-status Critical Current

Links

Landscapes

  • Image Processing (AREA)
  • Image Analysis (AREA)

Description

【発明の詳細な説明】[Detailed description of the invention]

〔発明の利用分野〕 本発明は、検出された2値画像のパターン上に
複数の点を指定した場合に、それら点がパターン
によつて連結されているか否かを高速に検出する
ための連結関係検出装置に関するものである。 〔発明の背景〕 回路パターンの検査などでは、断線やシヨート
などの欠陥を検出するために回路パターンをリニ
アセンサ等で撮像してこれを二値化しした2値画
像を得、その特定の点の間が検出画像上のパター
ンによつて連結しているか否かをしらべることが
ある。このような2値画像のパターンの連結関係
を調べる方法としては、特公昭58−16217公報
「連結領域検出方法」や「連結領域のぬりつぶし
及び番号づけに関する一考察」(信学技報IE78−
9)に開示される方式が知られている。しかし、
これらの方式では、検出2値画像のパターン(値
が1または0の部分)のうち、すべての連結され
たパターン各々の分離抽出を目的としている。 このため、例えば第31図に示すような5個の
独立したパターン(各閉領域をレベル1のパター
ンとする)が2値画像の形で存在した時にはこれ
を上記の方法で処理するとラベルと呼ばれる番号
1〜5がすべてのパターンに付され、これらはテ
ーブル形式でメモリ上に格納される。しかし回路
パターンの断線等の検査のためにはこのようなす
べてのパターンの分離は必ずしも必要ではなく、
例えば第1図の×印を付けた3つの点相互間の連
結関係のみが検出できればよいという場合があ
り、このような場合にはラベル1,4,5は不要
である。また対象とするパターン全体が非常に複
雑なものである場合は、リニアセンサを用いて例
えば水平方向に1ラインづつ二値化画像を検出し
ながら同時に連続性も検出するという方法がとら
れる。この時には例えば第32図に示したように
上方から水平な検出ラインで順次二値化画像を検
出しその連結性をしらべていくとすると、検出ラ
インl1まで進んだ時点ではラベル1,2を付され
たパターンはまだ別のものと判定されている。こ
れが更に進んで検出ラインl2まで来た時にはラベ
ル1,2をもつパターンが連結していることがわ
かるから、このことをメモリ上のテーブルに記憶
しておく必要がある。第33図はそのテーブルの
構造を示す図で、各ラベル1,2に対応してアド
レス1,2(これは実際には相対アドレスと考え
てよい)が割当てられており、その内容のデータ
としては、ラベル1,2のパターンがまだ孤立し
ていると判断されている時はラベル1及び2がそ
のまま書込まれている。ところがこれらが連続し
たものであることが判ると、そのデータの小さい
方の値に書換えられる。第33図はこの書換え後
の状態を示しており、ラベル1,2をもつパター
ンは、そのデータが同一なので連結していること
がわかる。そしてもし第32図のようなパターン
が上方にn個に枝分れしていればn個のアドレス
をもつた第33図のようなテーブルが必要とな
る。 以上のように、従来方式を用いてリニアセンサ
などで二値画像を検出しながら、そのすべてのパ
ターの連結関係を抽出していく場合は、第31図
で説明した二値画像上に存在する連結したパター
ンの数に等しい個数のラベルと、第32図で説明
したような上方向に複数個枝分れしたパターンの
場合に余分に必要とするラベル(n分岐のときn
−1個)とをすべて格納するだけのメモリ容量が
必要となる。しかるに検出対象とするパターンが
第31図や第32図のように単純なものでなく、
極めて複雑で大規模な回路パターン等の場合に
は、上記のような作業用のメモリ容量が非常に大
きくなるという不具合がある。 〔発明の目的〕 本発明の目的は、検出された二値画像のパター
ン上に外部より複数の点が指定された場合に、そ
れら点がパターンによつて連結されているか否か
メモリ容量を少なくして、しかも高速に検出し得
る連結関係検出装置を供するにある。 〔発明の概要〕 この目的のため本発明は、その連結関係を検出
すべき点の各々に相異る番号を付けてメモリ上の
アドレスに夫々対応づけ、ある点がいずれかのパ
ターン上に見出された時にはそのパターンのラベ
ルとしてその点の番号を付けて当該点対応のアド
レスへデータとして書込むとともに、同一パター
ンに相異るラベルが付された時にはこれらを予め
定められた方法によつて上記メモリ上でそのうち
の1つに書換え、かくして任意の2つの点はその
点対応のアドレスに格納されたラベルが同一の
時、かつその時のみ結合関係にあると判定すべく
なしたものである。具体的には二値画像信号を前
処理する画像入力部、画素変化アドレスを検出す
るコード変換部、画素変化アドレス間に指定され
た点が存するか否かを検出するグリツド番号割付
部、画素変化アドレスより隣接ライン上での連結
関係を検出するラベル付け処理部などより構成さ
れるが、画像入力部とコード変換部との間にはラ
インバツフアメモリを、また、コード変換部とグ
リツド番号割付部との間にはFIFOを、更にグリ
ツド番号割付部とラベル付け処理部との間にはラ
インテーブルメモリを介在させることによつてそ
れぞれの部分が並行処理動作し得るようになした
ものである。 〔発明の実施例〕 以下、本発明をその理論的背景を説明したうえ
で詳細に説明する。 先ずその理論的背景であるが、例えば対象とす
るパターンが第2図に示す如くであつて、連結関
係をしらべたい点(以下グリツド点という)には
グリツド番号1〜6が付されているとする。 リニアセンサ等によつて第2図上方のラインよ
り順次パターンの検出が行われていつたときまだ
1つもグリツド点が検出されていない状況では、
各パターンには第3図のように共通のラベル0が
付される。ここで「パターンにラベルを付ける」
ということは、メモリ内に検出されたパターン毎
のエリアを作成しておき、そのエリア内のラベル
らんにラベル記号(番号)を記入することを意味
し、その具体的方法は後述する。このパターン対
応の作業エリアとすぐ後で説明する連結テーブル
Tとは別のものである。 さて上記のラベルは、0に限らずグリツド番号
にないものであれば何でもよく、これを仮想グリ
ツド番号と呼ぶが、以下では番号0を使うことに
する。次にさらに検出が進み、第4図に示す状況
になつた場合を考える。1つのパターンが2つに
分岐を始めているが、まだグリツド点は検出され
ていない。しかしこのままラベル0を付したまま
にしておくと、ラベル0がまだグリツド点が検出
されていない全パターンに共通のラベルであるた
め、後に分岐パターンにグリツド点が見出された
時にそれらと他のパターンとの区別ができなくな
る。そこでこのようにラベル0のパターンに分岐
が生じたときは、グリツド番号、仮想グリツド番
号にもなく、かつグリツド番号より常に大(又は
小)の番号(これを仮番号とよぶ)を仮ラベルと
して付す。ここではこの仮ラベルを7とする。さ
て、ここでグリツド点間の連結関係を記憶してお
くための連結テーブルTについて述べる。連結テ
ーブルTは、第5図に示すように、アドレスA(I)
の内容をデータD(I)とすると、グリツド点Iの属
するパターンにラベルD(I)が付されていることを
意味する。但しIが仮番号の時はその仮番号Iを
つけたパターンのラベルがD(I)であることを意味
し、また、D(I)=0はIがグリツド点の時はその
グリツド点がまだ見出されていないことを意味
し、Iが仮番号の時はその仮番号がまだ使われて
いなことを意味する。第4図の時点ではどのグリ
ツド点I=1〜6も見出されていないので第5図
のようにD(I)=0,I=1〜6であり、またI=
7に対しては、この分岐したパターンはまだ他の
ラベルとは連結状態になく、自分自身に連結して
いるという意味でD(7)=7とされている。次にさ
らに、検出が進み、第6図のようにはじめてグリ
ツド点1が検出されたとする。この時はグリツド
点1が発見されたがまだ他のラベルをもつたパタ
ーンとは連結関係にはないので、このパターンに
はラベル1を付け、更に連結テーブルT上でD(1)
=1とする(第7図)。次に、さらにパターンの
検出が進み第8図のようにグリツド点2が発見さ
れたとする。この場合は点2が発見されたパター
ンのラベルを2としたうえで連結テーブルTのア
ドレスA(2)のデータをD(2)=2とする。この時点
では連結テーブルTは第9図のようになつてい
る。しかしこの時はグリツド点2が見出されたパ
ターンにはすでに0以外のラベル7が付されてい
るので、これを1つのラベルに統一して1つのパ
ターンには1つのラベル付けが行われるようにす
る。このための一般的方法は、今同一パターンに
上記のように2つのラベルにα,βがついたとす
ると、連結テーブルTでD(α)=α1をよみ出しα
=α1ならここで止めてα0=α1とする。α≠ならD
(α1)=α2をよみ出しα1=α2ならα0=α2とする。

うでなければD(α2)=α3をよみ出すという操作を
くり返すと、必ずD(αk)=αkとなるαkがあるこ
とがテーブルTの作成方法から保証されるので、
αk=α0とする。この操作はフローチヤートで第
10図に示されている。この操作をβについても
実行しβ0を求め、min(α0,β0)をこのパターン
のラベルとし(仮信号がグリツド番号より常に小
の時はmax(α0,β0)をとる)、更に連結テーブル
TのD(α),D(β)もこの値とする。今の場合
はラベル2,7に対し第9図からわかるようにα0
=2,β0=7であるからこのパターンにはラベル
2を付け、同時にテーブルTのD(2),D(7)も2と
する。この時の連結テーブルTは第11図のよう
になる。更にパターン検出が進み第12図のよう
に、グリツド点3が発見されたとする。この場合
もグリツド点2が発見された場合と同様、分岐し
た右側のパターンにはラベル3がつけられ、かつ
D(3)=3が書き込まれるが、このパターンには既
にラベル7が付いていたからラベルの統一化の処
理が行われる。この処理ではα=3,β=7であ
りD(3)=3だからα0=α=3となるが、β=7に
対しては第11図からD(7)=2であるので続いて
第10図で説明したようにD(2)がしらべられD(2)
=2(第11図)だからβ0=2、従つてα0,β0
小さい方の2がグリツド点3を見出したパターン
にラベルとした付けられ、また連結テーブルTの
D(3)も2とされる。この時のテーブルTは第13
図に示されている。さらに検出が進み、第14図
のようにグリツド点4が発見されたとすると、こ
の場合はグリツド点2を発見した第8図の場合と
全く同様な規則で処理が行わわれ、グリツド点4
のあつたパターンのラベル及び連結テーブルTの
D(4)の値はともに1とされる。第15図はこの時
の連結テーブルTを示している。続いてグリツド
点5,6の発見が第16図のように行われるが、
この際の処理はグリツド点1の場合と全く同様で
あつて、それぞれのパターンにラベル5,6が付
けられ、かつ連結テーブルTでD(5)=5,D(6)=
6とされる(第17図)。さらに検出が進み、第
18図のようにラベル5のパターンとラベル6の
パターンが合流したとしよう。この場合には、1
つのパターンにやはり2つのラベルα=5,β=
6が現れるので、第10図で説明した方法により
α0=5,β0=6を求め、このうちの小さい方のラ
ベル5がこの合流したパターンにつけられ、また
D(6)=5と書きかえられる(第19図)。 以上のようにして第2図のパターンに対して得
られた第19図の連結テーブルTは、任意の2つ
のグリツド点I,Jに対してD(I)=D(J)ならそれ
らのグリツド点は連結ており、そうでなければ連
結してないことを示している。 以上では、検出したパターンにラベルを付け
る、更にはそのラベルを書換えるという処理を常
に行つており、説明上はこれを図面上で表してき
たが、ここでこのパターンへのラベル付けの具体
的な方法を述べる。 今ある走査時点tでリニアセンサ等により検出
した1ライン分の二値画像を第20図のようであ
つたとする。但しパターンの部分は太線でレベル
1とし、これと検出ラインとの交線(太線)を左
から順にセグメントS1 t,S2 t,S3 tと呼ぶ。更にこ
れらのセグメントの始点の座標をu1 t<u2 t<…と
し、終点の座標をv1 t<v2 t<…とすると、これら
は容易に検出可能であるから各セグメント対応の
先頭アドレスAPiをもつたラインテーブルLT1
が第21図のように作れる。更にこのテーブル
LT1のラベルらんには初期値としてはすべて0
(仮想ラベル)をセツトしておき、例えば走査時
にグリツド点(これは予めその座標が外部より入
力され、グリツド点位置テーブルとして与えられ
ているとする)があるセグメントSit上に見つか
ればそのセグメントのラベルLitに当該グリツド
点の番号Nを書込む。むろんこの時は前述したよ
うに常に連結テーブルTのD(N)もNとする。他の
ラベル付け、書換え等もすべてこのラインテーブ
ルLT1上のラベルらんで行えばよいが、このよ
うなラインテーブルは1走査毎に1つづつ出来る
から、これらをすべて別々に格納しておいたので
はぼう大なメモリ容量になる。そこで本実施例で
は、時点tに於て作成れたラインテーブルLT1
と、1時点前のt−1に作成されたラインテーブ
ルLT0の2ライン分のメモリだけを用いる。勿
論このラインテーブルLT0も第21図のテーブ
ルLT1と同様な構成であり、そのセグメント
S1 t-1,S2 t-1,…,始点u1 t-1<u2 t-1<…,終点を
v1 t-1<v2 t-1<…,ラベルをL1 t-1,L2 t-1…等とす
ると、ラインテーブルLT0,LT1の各セグメン
トSit-1とSjt-1とが同一パターンに含まれるセグ
メントであるための必要十分条件は、両セグメン
トを同一ライン上に書いた時に重る部分があるこ
とであり、これは容易にわかるように vjt≧uit-1かつvit-1≧ujt ……………(1) である。従つてラインテーブルLT0,LT1を参
照し、式(1)を満すセグメントSit-1,Sjtのすべて
の組について、これらは同一パターン上にあると
して第3図〜第19図で説明ししたような処理を
順次行い、それが終了するとラインテーブルLT
1の内容をラインテーブルLT0にそつくり移し、
次の時点t+1でのラインの走査へ移り新しくラ
インテーブルLT1の内容を作成して上記のよう
な処理をくり返す。このようにすればパターンへ
のラベル付けの記憶管理は2ライン分のラインテ
ーブルLT0,LT1だけ用意すれば十分で、少な
いメモリ容量で作業ができる。また、グリツド点
間の連結関係を検出するにはグリツド数分のデー
タ領域は必ずしも確保しておかなければならず、
本実施例の連結テーブルTでもそうなつている
が、更に作業用の仮ラベルに対応する部分、即ち
パターンに分岐が生じている場合での仮ラベルの
データ領域が余分に必要である。これは分岐があ
ればそれなりの数だけ必要だが、全体としては検
出画像上の独立した全パターンにラベルを付ける
従来方法に比べると、グリツド点に着目する本発
明では大幅に少ないメモリ容量でよいことにな
る。 なお、もし、分岐のあるパターンの数が不想よ
り多く、仮ラベルのテーブルが足りなくなつた場
合には次のような方法で復旧が可能である。即ち
連結テーブルTの仮番号のエリアに1ビツトのフ
ラグを設ける。これらのフラグは処理を始める前
の状態においてはすべて0に初期設定されてい
る。これが第4図のような分岐時に1つづつ使わ
れるとその使われた仮番号は、目下使用中である
ことを示すように対応フラグを1としておく。第
22図はこのようなフラグをもつた連結テーブル
Tの例を示しており、仮番号5〜8がすべて使用
済である場合を示している。このような状態でま
た新しい分岐が生じて仮ラベルが必要になると、
まず連結テーブルTをサーチし、各仮番号Jに対
しJ=αとして第10図の処理を実行し、その結
果得られたα0をD(J)の値とする。第22図のI=
5〜8にこれを実行すると、このIに対してすべ
てα0=5が得られ、連結テーブルTのデータらん
は第23図のように書しなおされる。次にこのよ
うにして得た連結テーブルTの仮番号をもつライ
ンテーブルLT0,LT1のセグメントに対するラ
ベルらんを今書き換えた連結テーブルTのラベル
に書きなおす。例えばラインテーブルLT0又は
LT1のあるセグメントのラベルが6であつたと
すると、これは第22図の結果から5に書換えら
れる。次に、このように処理された2つのライン
テーブルLT0,LT1のラベルをサーチし、仮ラ
ベル(ここでは5〜8)を探す。発見された仮ラ
ベル(ここでは5)のフラグには1を立て他のフ
ラグは0とする。この結果が第23図のフラグの
らんに示されている。 以上の処理で使用中の仮ラベルの数が4から1
へ減少し、再びフラグが0の仮ラベルを選ぶこと
によつて新たな仮ラベルの付与が可能になる。以
上の処理は、すでに処理し終つた領域で付与され
た仮ラベルのうち、以降の処理に関係のない仮ラ
ベル(今の例では6〜8)を再使用可能にするこ
とを意味する。 さて、本発明による連結関係検出装置について
具体的に説明する。第1図はその一例での全体的
構成を示したものである。これによりその構成と
その動作の概要について説明すれば、画像検出装
置、例えばリニアセンサからのシリアルな二値画
像信号は画像入力部1、切替回路2を介しライン
バツフアメモリ3A,3Bに交互に、しかもライ
ン単位に一時記憶されるようになつている。表1
は切替回路2の動作、即ち、ラインバツフアメモ
リ3A,3Bの何れに画像入力部からの二値画像
信号が入力され、また、何れより二値画像信号が
読み出されるかをライン位置との関係で示したも
のである。
[Field of Application of the Invention] The present invention relates to a connection method for quickly detecting whether or not the points are connected by a pattern when a plurality of points are specified on a pattern of a detected binary image. The present invention relates to a relationship detection device. [Background of the Invention] In circuit pattern inspection, etc., in order to detect defects such as wire breaks and shorts, the circuit pattern is imaged with a linear sensor, etc., and the image is converted into a binary image to obtain a binary image. It may be checked whether the spaces are connected by a pattern on the detected image. Methods for investigating the connection relationship between patterns in binary images include Japanese Patent Publication No. 58-16217 ``Method for Detecting Connected Areas'' and ``A Study on Filling in Connected Areas and Numbering'' (IEICE Technical Report IE78-
9) is known. but,
These methods aim to separate and extract all connected patterns among the patterns (portions where the value is 1 or 0) of the detected binary image. For this reason, for example, when five independent patterns (each closed region is a level 1 pattern) exist in the form of a binary image as shown in Figure 31, when these are processed using the above method, they are called labels. Numbers 1 to 5 are assigned to all patterns, and these are stored on memory in a table format. However, in order to inspect circuit patterns for disconnections, etc., it is not necessary to separate all such patterns.
For example, there may be a case where it is only necessary to detect the connection relationship between the three points marked with an x in FIG. 1, and in such a case, labels 1, 4, and 5 are unnecessary. If the entire target pattern is very complex, a method is used in which a linear sensor is used to detect the binarized image line by line in the horizontal direction while simultaneously detecting continuity. At this time, for example, if we sequentially detect the binarized images using horizontal detection lines from above and examine their connectivity, as shown in Fig. 32, when we reach detection line l 1 , labels 1 and 2 are The attached pattern has been determined to be different. When this progresses further and reaches the detection line l2 , it can be seen that the patterns with labels 1 and 2 are connected, so this must be stored in a table in memory. Figure 33 is a diagram showing the structure of the table, in which addresses 1 and 2 (which can actually be considered relative addresses) are assigned to each label 1 and 2, and the content data is In this case, when it is determined that the patterns of labels 1 and 2 are still isolated, labels 1 and 2 are written as they are. However, if it is found that these data are continuous, the data is rewritten to the smaller value. FIG. 33 shows the state after this rewriting, and it can be seen that the patterns with labels 1 and 2 are connected because their data are the same. If the pattern shown in FIG. 32 has n branches upward, a table with n addresses as shown in FIG. 33 is required. As described above, when extracting the connection relationships of all putters while detecting a binary image with a linear sensor etc. using the conventional method, it is necessary to The number of labels equal to the number of connected patterns and the extra labels required in the case of a pattern with multiple branches in the upward direction as explained in FIG.
-1 item) is required. However, the pattern to be detected is not as simple as in Figures 31 and 32;
In the case of extremely complex and large-scale circuit patterns, there is a problem in that the memory capacity for working as described above becomes extremely large. [Object of the Invention] An object of the present invention is to reduce the memory capacity by determining whether or not the points are connected by the pattern when a plurality of points are specified from the outside on a pattern of a detected binary image. Therefore, it is an object of the present invention to provide a connected relationship detection device that can detect connections at high speed. [Summary of the Invention] For this purpose, the present invention assigns a different number to each point whose connected relationship is to be detected and associates each point with an address in memory, so that when a certain point is found on any pattern, When issued, the number of the point is attached as a label of the pattern and written as data to the address corresponding to the point, and when different labels are attached to the same pattern, these are written in a predetermined method. This is done so that it can be determined that two arbitrary points are connected only when the labels stored in the addresses corresponding to the points are the same, by rewriting one of them on the memory. Specifically, it includes an image input section that preprocesses binary image signals, a code conversion section that detects pixel change addresses, a grid number assignment section that detects whether a specified point exists between pixel change addresses, and a pixel change address. It consists of a labeling processing section that detects connections on adjacent lines from addresses, etc., but a line buffer memory is installed between the image input section and the code conversion section, and a grid number assignment section and the code conversion section. By interposing a FIFO between the grid number assignment section and the labeling processing section, and a line table memory between the grid number assignment section and the labeling processing section, each section can perform parallel processing operations. . [Embodiments of the Invention] Hereinafter, the present invention will be described in detail after explaining its theoretical background. First, the theoretical background is that the target pattern is as shown in Figure 2, and the points (hereinafter referred to as grid points) whose connectivity is to be examined are assigned grid numbers 1 to 6. do. In a situation where no grid point has been detected when patterns are sequentially detected from the upper line in Figure 2 using a linear sensor, etc.,
A common label 0 is attached to each pattern as shown in FIG. "Label the pattern" here
This means that an area is created for each detected pattern in the memory, and a label symbol (number) is written in the label field in that area.The specific method will be described later. This pattern-compatible work area is different from the concatenation table T, which will be explained shortly. Now, the above label is not limited to 0, but can be any label that is not included in the grid number, and is called a virtual grid number, but below we will use the number 0. Next, consider a case where the detection progresses further and the situation shown in FIG. 4 is reached. One pattern has begun to diverge into two, but no grid points have been detected yet. However, if label 0 is left as it is, label 0 is a common label for all patterns for which no grid points have been detected, so when grid points are found in a branch pattern later, those and other It becomes impossible to distinguish between patterns. Therefore, when a branch occurs in the pattern with label 0 like this, a number that is not in the grid number or virtual grid number and is always larger (or smaller) than the grid number (this is called a temporary number) is used as a temporary label. attach Here, this temporary label is set to 7. Now, a connection table T for storing connection relationships between grid points will be described. As shown in FIG. 5, the concatenation table T has address A(I)
If the content of is data D(I), it means that the label D(I) is attached to the pattern to which grid point I belongs. However, when I is a temporary number, it means that the label of the pattern with that temporary number I is D(I), and D(I) = 0 means that when I is a grid point, that grid point is It means that it has not been found yet, and when I is a temporary number, it means that the temporary number has not been used yet. At the time of Fig. 4, no grid points I = 1 to 6 have been found, so as shown in Fig. 5, D(I) = 0, I = 1 to 6, and I =
For label 7, D(7)=7 means that this branched pattern is not yet connected to other labels but is connected to itself. Next, it is assumed that the detection progresses further and grid point 1 is detected for the first time as shown in FIG. At this time, grid point 1 has been found, but it is not yet connected to patterns with other labels, so this pattern is given a label of 1, and furthermore, it is written as D(1) on the connection table T.
= 1 (Figure 7). Next, it is assumed that the pattern detection progresses further and grid point 2 is discovered as shown in FIG. In this case, the label of the pattern in which point 2 was found is set to 2, and the data at address A(2) of the concatenation table T is set to D(2)=2. At this point, the concatenation table T is as shown in FIG. However, at this time, the pattern in which grid point 2 was found has already been assigned a label 7 other than 0, so it is possible to unify these labels into one label and assign one label to one pattern. Make it. The general method for this is to assume that the same pattern has two labels α and β as shown above, read D(α)=α 1 in the concatenation table T, and α
If = α 1 , stop here and set α 0 = α 1 . If α≠ then D
Read out (α 1 ) = α 2 and if α 1 = α 2 then set α 0 = α 2 .
Otherwise, if we repeat the operation of reading D(α 2 ) = α 3 , the method of creating table T guarantees that there will always be αk such that D(αk) = αk, so
Let αk= α0 . This operation is shown in a flowchart in FIG. Execute this operation for β to find β 0 , and set min (α 0 , β 0 ) as the label of this pattern (if the temporary signal is always smaller than the grid number, take max (α 0 , β 0 )) , Furthermore, D(α) and D(β) of the concatenation table T are also set to these values. In this case, α 0 for labels 2 and 7 as shown in Figure 9.
=2, β 0 =7, so this pattern is labeled 2, and at the same time D(2) and D(7) of table T are also assigned 2. The concatenation table T at this time becomes as shown in FIG. Assume that the pattern detection progresses further and grid point 3 is discovered as shown in FIG. In this case, as in the case where grid point 2 is discovered, the label 3 is attached to the pattern on the right side of the branch, and D(3)=3 is written, but since this pattern already had a label 7, the label A process of unification is performed. In this process, α = 3, β = 7, and D(3) = 3, so α 0 = α = 3, but for β = 7, D(7) = 2 from Figure 11, so continue. As explained in Figure 10, D(2) is examined and D(2)
= 2 (Fig. 11), so β 0 = 2, so the smaller 2 of α 0 and β 0 is attached as a label to the pattern that found grid point 3, and D(3) of the concatenation table T is also 2. At this time, table T is the 13th
As shown in the figure. If the detection progresses further and grid point 4 is discovered as shown in Fig. 14, in this case processing is performed according to exactly the same rules as in the case of Fig. 8 where grid point 2 was found, and grid point 4 is found.
Both the label of the pattern and the value of D(4) in the concatenation table T are set to 1. FIG. 15 shows the concatenation table T at this time. Next, grid points 5 and 6 are discovered as shown in Figure 16.
The processing at this time is exactly the same as that for grid point 1, in which labels 5 and 6 are attached to each pattern, and D(5)=5, D(6)=
6 (Figure 17). Suppose that the detection progresses further and the pattern of label 5 and the pattern of label 6 merge as shown in FIG. In this case, 1
Two patterns also have two labels α=5, β=
6 appears, so find α 0 = 5 and β 0 = 6 using the method explained in Figure 10, and label 5, the smaller of these, is attached to this merged pattern, and write D(6) = 5. It hatches (Figure 19). The concatenation table T in FIG. 19 obtained for the pattern in FIG. 2 as described above is Points are connected, otherwise they are not connected. In the above, the process of attaching a label to the detected pattern and furthermore rewriting the label is always performed, and for the purpose of explanation this is represented on the drawing, but here we will explain the specifics of labeling this pattern. I will explain the method. Assume that the binary image for one line detected by a linear sensor or the like at a certain scanning time point t is as shown in FIG. However, the pattern portion is defined as a level 1 by a thick line, and the intersection lines (thick lines) between this and the detection line are called segments S 1 t , S 2 t , and S 3 t in order from the left. Furthermore, if the coordinates of the starting points of these segments are u 1 t < u 2 t <... and the coordinates of the end points are v 1 t < v 2 t <..., then since these can be easily detected, the beginning of each segment Line table LT1 with address API
can be made as shown in Figure 21. Furthermore, this table
The initial values for the labels of LT1 are all 0.
For example, if a grid point (this assumes that the coordinates have been input from the outside and given as a grid point position table) is found on a segment Si t during scanning, that segment will be displayed. Write the number N of the grid point in the label Lit. Of course, at this time, D(N) of the concatenation table T is also always set to N as described above. All other labeling, rewriting, etc. can be done using the labels on line table LT1, but since one line table like this can be created for each scan, it is best to store them all separately. That would require a huge amount of memory. Therefore, in this embodiment, line table LT1 created at time t
Then, only the memory for two lines of the line table LT0 created at t-1, one time before, is used. Of course, this line table LT0 has the same configuration as table LT1 in Fig. 21, and its segments
S 1 t-1 , S 2 t-1 ,…, starting point u 1 t-1 < u 2 t-1 <…, ending point
If v 1 t-1 < v 2 t-1 <..., and the labels are L 1 t-1 , L 2 t-1 ..., etc., each segment Si t-1 and Sj t-1 of line tables LT0 and LT1 A necessary and sufficient condition for these segments to be included in the same pattern is that when both segments are written on the same line, there is an overlapping part, and this can be easily seen if vj t ≥ ui t-1 and vi t-1 ≧uj t ……………(1). Therefore, with reference to line tables LT0 and LT1, all pairs of segments Si t-1 and Sj t that satisfy equation (1) are explained in FIGS. 3 to 19 assuming that they are on the same pattern. Processing like above is performed sequentially, and when it is completed, the line table LT
Transfer the contents of 1 to line table LT0,
The process moves on to scanning the line at the next time point t+1, creates new contents of the line table LT1, and repeats the above process. In this way, it is sufficient to prepare only the line tables LT0 and LT1 for two lines for storage management for labeling patterns, and the work can be done with a small memory capacity. In addition, in order to detect the connection relationship between grid points, it is necessary to secure a data area for the number of grid points.
This is also the case with the concatenated table T of this embodiment, but an extra portion corresponding to the working temporary label, that is, an extra data area for the temporary label when a branch occurs in the pattern is required. This requires a certain number of branches if there are branches, but overall the present invention, which focuses on grid points, requires significantly less memory capacity than the conventional method of labeling all independent patterns on the detected image. become. Note that if the number of patterns with branches is larger than expected and the temporary label table is insufficient, recovery can be performed using the following method. That is, a 1-bit flag is provided in the temporary number area of the concatenation table T. These flags are all initialized to 0 before starting processing. When these numbers are used one by one at the time of branching as shown in FIG. 4, the corresponding flag is set to 1 to indicate that the used temporary number is currently in use. FIG. 22 shows an example of a concatenation table T having such flags, and shows a case where all temporary numbers 5 to 8 have been used. If a new branch occurs in this situation and a temporary label is required,
First, the concatenation table T is searched, and the process shown in FIG. 10 is executed for each temporary number J with J=α, and the resultant α 0 is taken as the value of D(J). I= in Figure 22
5 to 8, α 0 =5 is obtained for all I, and the data row of the concatenation table T is rewritten as shown in FIG. Next, the labels for the segments of line tables LT0 and LT1 that have the provisional numbers of the concatenation table T obtained in this way are rewritten to the labels of the concatenation table T that have just been rewritten. For example, line table LT0 or
If the label of a certain segment of LT1 is 6, this is rewritten to 5 from the result of FIG. 22. Next, the labels of the two line tables LT0 and LT1 processed in this way are searched for temporary labels (5 to 8 in this case). The flag of the discovered temporary label (5 in this case) is set to 1, and the other flags are set to 0. This result is shown in the flag box in FIG. With the above process, the number of temporary labels in use has changed from 4 to 1.
By selecting the temporary label whose flag is 0 again, it becomes possible to assign a new temporary label. The above process means that among the temporary labels assigned to the area that has already been processed, temporary labels (6 to 8 in the present example) that are unrelated to the subsequent process can be reused. Now, the connection relationship detection device according to the present invention will be specifically explained. FIG. 1 shows the overall configuration of one example. To explain the outline of its configuration and operation, a serial binary image signal from an image detection device, for example a linear sensor, is sent via an image input section 1 and a switching circuit 2 to line buffer memories 3A and 3B alternately. , and is temporarily stored line by line. Table 1
is the operation of the switching circuit 2, that is, which of the line buffer memories 3A and 3B receives the binary image signal from the image input section, and from which the binary image signal is read out is determined in relation to the line position. This is what is shown.

【表】 この表1からも判るようにラインバツフアメモ
リ3A,3Bからはまた切替回路2を介し交互に
1ライン前の二値画像信号がシリアルにコード変
換部4に読み出され、その二値画像信号からはラ
イン上におけるセグメントとその始点、終点のア
ドレス(座標位置)が検出されるものとなつてい
る。即ち、コード変換部4では二値画像信号が0
から1へ変化する時点でのアドレスをそのセグメ
ントの始点アドレスとして、また、この後初めて
1から0へ変化する時点でのアドレスを終点アド
レスとしてセグメントとその始点、終点のアドレ
スが検出されているものである。セグメント対応
の始点アドレスおよび終点アドレスは対となつ
て、セグメントが検出される度に一時蓄積用の
FIFO(First In First Out)5に順次書込される
が、FIFO5からは先入先出形式で始点アドレス
および終点アドレスが対としてグリツド番号割付
部6に読み出されるようになつている。グリツド
番号割付部6では始点アドレスおよび終点アドレ
スで規定されるセグメント上にグリツド点が存す
るか否かが検出されるが、グリツド点が存するか
否かはアクセス制御回路9を介する、グリツド点
位置テーブルメモリ10からのグリツド点位置座
標を参照することによつて検出されるものとなつ
ている。この検出でグリツド点が存する場合はそ
のセグメントにはラベルが付されるが、ラベルは
始点アドレスおよび終点アドレスとともに切替回
路7を介しラインテーブルメモリ8A〜8Cの何
れか1つに交互に書き込まれるものである。表2
は切替回路7の動作、即ち、ライン位置によつて
グリツド番号割付部6の出力がラインテーブルメ
モリ8A〜8Cの何れに入力され、また、ラベル
付け処理部14にはラインテーブルメモリ8A〜
8Cの何れかからの読出出力が入力されるかを示
したものである。
[Table] As can be seen from Table 1, the binary image signals of the previous line are serially read out alternately from the line buffer memories 3A and 3B via the switching circuit 2 to the code converter 4, and From the value image signal, the addresses (coordinate positions) of segments on the line and their starting and ending points are detected. That is, in the code converter 4, the binary image signal is 0.
The segment, its start point, and end point address are detected, with the address at the time it changes from 1 to 1 as the start point address of that segment, and the address at the time it changes from 1 to 0 for the first time after this as the end point address. It is. The start point address and end point address corresponding to a segment are paired and stored for temporary storage each time a segment is detected.
The data is sequentially written into a FIFO (First In First Out) 5, and the starting point address and ending point address are read out as a pair from the FIFO 5 in a first-in, first-out format to the grid number allocating unit 6. The grid number assignment unit 6 detects whether or not a grid point exists on the segment defined by the start point address and the end point address. The grid points are detected by referring to the grid point position coordinates from the memory 10. If a grid point exists in this detection, a label is attached to that segment, and the label is written alternately to any one of the line table memories 8A to 8C via the switching circuit 7 along with the start point address and end point address. It is. Table 2
Depending on the operation of the switching circuit 7, that is, the line position, the output of the grid number allocating section 6 is inputted to any of the line table memories 8A to 8C, and the labeling processing section 14 is inputted to any of the line table memories 8A to 8C.
This shows whether the read output from any of the 8C is input.

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

以上説明したように本発明による場合は、画像
入力部、コード変換部、グリツド番号割付部、ラ
ベル付け処理部に分割し、これらが並行に動作す
るようにし、これらの間のデータの授受はバツフ
アメモリを介して行なうようになしたものである
から、連結テーブルメモリのメモリ容量少なくし
て処理を高速に行なえるという効果がある。
As explained above, in the case of the present invention, the image input section, code conversion section, grid number assignment section, and labeling processing section are divided into an image input section, a code conversion section, a grid number assignment section, and a labeling processing section. Since the data processing is performed via the link table memory, there is an effect that the memory capacity of the concatenated table memory can be reduced and processing can be performed at high speed.

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

第1図は、本発明による連結関係検出装置の一
例での全体的構成を示す図、第2図,第3図,第
4図,第5図,第6図,第7図,第8図,第9
図,第10図,第11図,第12図,第13図,
第14図,第15図,第16図,第17図,第1
8図,第19図,第20図,第21図,第22
図,第23図は、本発明に係る連結関係検出方法
を説明するための図、第24図は、本発明に係る
グリツド点位置テーブルメモリ上でのグリツド点
位置座標とこれに対するグリツド番号の格納フオ
ーマツトを示す図、第25図は、FIFOに代わる
ンバツフアメモリおよび切替回路よりなる回路を
示す図、第26図は、連結テーブルメモリへのア
クセス制御方法を説明するための図、第27図,
第28図,第29図,第30図は、それぞれ画像
入力部、コード変換部、グリツド点番号割付部、
ラベル付け処理部の一例での構成を示す図、第3
1図,第32図、第33図は、これまでの連結関
係検出方法を説明するための図である。 1…画像入力部、2,7…切替回路、3A,3
B…ラインバツフアメモリ、4…コード変換部、
5…FIFO、6…グリツド番号割付部、8A,8
B,8C…ラインテーブルメモリ、10…グリツ
ド点位置テーブルメモリ、12…連結テーブルメ
モリ、14…ラベル付け処理部。
FIG. 1 is a diagram showing the overall configuration of an example of the connection relationship detection device according to the present invention, and FIGS. 2, 3, 4, 5, 6, 7, and 8 , 9th
Figure, Figure 10, Figure 11, Figure 12, Figure 13,
Figure 14, Figure 15, Figure 16, Figure 17, Figure 1
Figure 8, Figure 19, Figure 20, Figure 21, Figure 22
23 are diagrams for explaining the connection relationship detection method according to the present invention, and FIG. 24 is a diagram showing the storage of grid point position coordinates and corresponding grid numbers on the grid point position table memory according to the present invention. FIG. 25 is a diagram showing the format, and FIG. 25 is a diagram showing a circuit consisting of buffer memory and a switching circuit in place of FIFO. FIG. 26 is a diagram for explaining the access control method to the concatenated table memory.
28, 29, and 30 respectively show an image input section, a code conversion section, a grid point number assignment section,
FIG. 3 shows the configuration of an example of the labeling processing unit.
FIG. 1, FIG. 32, and FIG. 33 are diagrams for explaining the conventional connection relationship detection method. 1... Image input section, 2, 7... Switching circuit, 3A, 3
B...Line buffer memory, 4...Code converter,
5...FIFO, 6...Grid number assignment section, 8A, 8
B, 8C... Line table memory, 10... Grid point position table memory, 12... Connection table memory, 14... Labeling processing unit.

Claims (1)

【特許請求の範囲】[Claims] 1 順次シリアルに入力されるライン対応の二値
画像信号各々に含まれる画素に対し書込アドレス
を発生する画像入力部と、該入力部からの二値画
像信号をライン更新の度に交互に一時記憶すると
ともに、前ライン対応の二値画像信号がライン更
新の度に交互に読み出される2面のラインバツフ
アメモリと、該メモリに対する読出アドレスを発
生するとともに、該メモリから読み出された二値
画像信号より0から1、1から0への画素変化ア
ドレスを検出するコード変換部と、上記画像入力
部、ラインバツフアメモリおよびコード変換部の
間に介在され、二値画像信号のラインバツフアメ
モリへの一時記憶、該メモリからの読出を切替制
御する切替回路と、上記コード変換部からの0か
ら1、1から0への画素変化アドレスを対として
一時記憶するFIFOと、外部から指定される複数
の点の位置アドレスが予め記憶されるグリツド点
位置テーブルメモリと、上記FIFOからの対とし
ての画素変化アドレス間に指定された点が存する
か否かを上記グリツド点位置テーブルメモリを参
照して検出し、対としての画素変化アドレスにラ
ベルを所定に付すグリツド番号割付部と、該割付
部からの対としての画素変化アドレスと該アドレ
スに付されたラベルを交互に一時記憶するととも
に、前ラインおよび前々ライン対応の対としての
画素変化アドレスと該アドレスに付されたラベル
が交互に読み出される3面のラインテーブルメモ
リと、該メモリからの対としての画素変化アドレ
スにもとづき隣接ライン上での連結関係を検出し
たうえラベルを所定に変更するラベル付け処理部
と、上記グリツド番号割付部、ラインテーブルメ
モリおよびラベル付け処理部の間に介在され、対
としての画素変化アドレスと該アドレスに付され
たラベルのラインテーブルメモリへの一時記憶、
該メモリからの読出を切替制御する切替回路と、
上記複数の点対応のラベルが上記グリツド番号割
付部およびラベル付け処理部によつて更新可とし
て記憶される連結テーブルメモリとからなる構成
を特徴とする連結関係検出装置。
1 An image input section that generates a write address for each pixel included in each line-corresponding binary image signal input serially, and an image input section that generates a write address for each pixel included in each line-corresponding binary image signal that is input serially, and that temporarily temporarily writes the binary image signal from the input section alternately every time a line is updated. A two-sided line buffer memory in which binary image signals corresponding to the previous line are stored and read out alternately each time a line is updated; A code conversion unit that detects pixel change addresses from 0 to 1 and from 1 to 0 from the image signal, and a line buffer for binary image signals, which is interposed between the image input unit, line buffer memory, and code conversion unit. A switching circuit that switches and controls temporary storage in the memory and readout from the memory, a FIFO that temporarily stores the pixel change addresses from 0 to 1 and 1 to 0 from the code conversion section as a pair, and The grid point position table memory, in which the position addresses of multiple points are stored in advance, and the grid point position table memory are referred to to determine whether or not the specified point exists between the pixel change addresses as a pair from the FIFO. a grid number allocating unit that detects the pixel change address as a pair and attaches a label to the pixel change address in a predetermined manner; A three-sided line table memory in which pixel change addresses and labels attached to the addresses are read out alternately as pairs corresponding to lines and lines before the previous line, and pixel change addresses on adjacent lines are read out in pairs based on the pixel change addresses from the memory. A labeling processing section detects the connection relationship between the pixel change address and the labeling processing section, which changes the label to a predetermined value, and the grid number allocation section, the line table memory, and the labeling processing section. Temporary storage of labeled labels in line table memory,
a switching circuit that switches and controls reading from the memory;
A connection relationship detecting device comprising: a connection table memory in which the labels corresponding to the plurality of points are stored in an updatable manner by the grid number allocating section and the labeling processing section.
JP59200401A 1984-09-27 1984-09-27 Connection relationship detection device Granted JPS6180376A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP59200401A JPS6180376A (en) 1984-09-27 1984-09-27 Connection relationship detection device
US07/158,125 US4953224A (en) 1984-09-27 1988-02-16 Pattern defects detection method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP59200401A JPS6180376A (en) 1984-09-27 1984-09-27 Connection relationship detection device

Publications (2)

Publication Number Publication Date
JPS6180376A JPS6180376A (en) 1986-04-23
JPH0444985B2 true JPH0444985B2 (en) 1992-07-23

Family

ID=16423703

Family Applications (1)

Application Number Title Priority Date Filing Date
JP59200401A Granted JPS6180376A (en) 1984-09-27 1984-09-27 Connection relationship detection device

Country Status (1)

Country Link
JP (1) JPS6180376A (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62127987A (en) * 1985-11-28 1987-06-10 Yokogawa Electric Corp Method of checking printed board pattern
JPS6365304A (en) * 1986-09-06 1988-03-23 Yatsuka Nakamura Singular point position detecting method by image processing

Also Published As

Publication number Publication date
JPS6180376A (en) 1986-04-23

Similar Documents

Publication Publication Date Title
US4624013A (en) Linked component extraction circuit for image processor
US5056146A (en) Three-dimensional labeling apparatus for two-dimensional slice image information
JPH0152782B2 (en)
US5909507A (en) Method apparatus for assigning temporary and true labels to digital image
JPS61233878A (en) Image processing apparatus
JPH0444985B2 (en)
JPS59208667A (en) Labelling device
JPH0444984B2 (en)
JPS629478A (en) Labeling processor
EP0549328A2 (en) Labelling method and apparatus thereof
JPH01113880A (en) Extracting device for connection component of image
JP2536183B2 (en) Image processing method and apparatus
JP2839026B1 (en) Parallel image processing device
JP2658343B2 (en) Connection region labeling circuit
JPS6326784A (en) Image connection processor
JPH0570874B2 (en)
JPH07118013B2 (en) Image data labeling method
JPS61143883A (en) Pattern defect detection method
JP3108595B2 (en) Line labeling equipment
JPH0644289B2 (en) Connected area labeling circuit
JPS62281077A (en) Inter-temporary label connecting information memory system
JPH0656617B2 (en) Labeling method for labeling processor
JPH02205985A (en) High speed picture processor
JPS59119387A (en) Display indication control system
JPS61131084A (en) Picture processor

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees