JPH07111737B2 - Thinning device - Google Patents
Thinning deviceInfo
- Publication number
- JPH07111737B2 JPH07111737B2 JP3346032A JP34603291A JPH07111737B2 JP H07111737 B2 JPH07111737 B2 JP H07111737B2 JP 3346032 A JP3346032 A JP 3346032A JP 34603291 A JP34603291 A JP 34603291A JP H07111737 B2 JPH07111737 B2 JP H07111737B2
- Authority
- JP
- Japan
- Prior art keywords
- peripheral point
- image
- edge
- pixel
- distance
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Landscapes
- Image Processing (AREA)
- Image Analysis (AREA)
Description
【0001】[0001]
【産業上の利用分野】本発明は回路パターンの欠陥検査
等のように2値パターンの幅の測定や接続関係の認識を
行うために、パターンを背景側から1層ずつ細めて芯線
を得るともに、画素に距離値を与えて距離画像を得るた
めの細線化処理装置に関するものである。BACKGROUND OF THE INVENTION 1. Field of the Invention In order to measure the width of a binary pattern and to recognize the connection relationship, such as in the case of defect inspection of a circuit pattern, the present invention thins the pattern from the background side by layer to obtain a core wire. , A thinning processing apparatus for giving a distance value to pixels to obtain a distance image.
【0002】[0002]
【従来の技術】細線化は線図形処理において頻繁に使用
され、図形認識の前処理して重要な処理であるため歴史
的に数多くの方法が提案されており、「田村:図形の細
線化についての比較研究,情報処理学会イメージプロセ
ッシング研資,1−1(1975)」では様々な方法の比較検
討を行っている。上記比較検討では、細線化の処理形式
として逐次型と並列型を挙げており、前者は処理条件が
複雑になるが計算時間が速いため計算機向きの方法であ
り、後者は計算時間は前者に劣るが芯線の位置がパター
ンの中心位置にもってきやすい事や、等方性や耐ノイズ
に優れることからハードウェア化した場合に向いている
としている。並列型処理は偶数幅の線の消滅を防ぐた
め、1層の画素消去を通常4つの消去サイクルに分けて
おり、この点が計算時間の増大の要因となっている。こ
のため近年では、並列型処理の消去サイクルの数を軽減
する方法が提案されている。一例としてホルト(Holt.
C.M. etal,"An improved parallel thinning algorith
m",Comm.ACM 30,3(Feb.1987),pp.156〜160)らの方法が
ある。以下本方法について、具体的処理を説明する。3
×3近傍の画素の値を図5のごとく定義する。まず(数
1)と(数2)が共に真の場合、注目画素d0が消去可
能なエッジであると決定する。2. Description of the Related Art Since thinning is frequently used in line figure processing and is an important preprocessing for figure recognition, many methods have been proposed historically. , “Information Processing Society of Japan Image Processing Research Institute, 1-1 (1975)”, a comparative study of various methods. In the above comparative study, the serialization type and the parallel type are listed as the thinning processing formats. The former is a computer-friendly method because the processing conditions are complicated but the calculation time is fast, and the latter is inferior in the calculation time to the former. It is said that it is suitable for the case where it is implemented as hardware because the position of the core wire easily comes to the center position of the pattern and it is excellent in isotropy and noise resistance. In parallel processing, in order to prevent disappearance of even-width lines, pixel erasing of one layer is usually divided into four erasing cycles, which is a factor of increasing the calculation time. Therefore, in recent years, a method of reducing the number of erase cycles of parallel processing has been proposed. As an example, Holt.
CM etal, "An improved parallel thinning algorith
m ", Comm. ACM 30,3 (Feb. 1987), pp.156-160), etc. The specific processing of this method will be described below.
The pixel values in the vicinity of × 3 are defined as shown in FIG. First, when (Equation 1) and (Equation 2) are both true, it is determined that the target pixel d0 is an erasable edge.
【0003】[0003]
【数1】 [Equation 1]
【0004】[0004]
【数2】 [Equation 2]
【0005】ただし(数2)において・は論理積、 ̄は
否定を示す。次に(数3)または(数4)を除く全ての
消去可能なエッジを消去する。However, in (Equation 2),-indicates logical product, and-indicates negation. Next, all erasable edges except (Equation 3) or (Equation 4) are erased.
【0006】[0006]
【数3】 [Equation 3]
【0007】[0007]
【数4】 [Equation 4]
【0008】すなわち上記の方法は、前半のプロセスで
予め消去可能なエッジを決定しておき、後半のプロセス
でエッジを使った遇奇判定によって画素の消去を行うも
のであり、1回の消去サイクルで1層の画素消去が実現
されている。このため従来の4サイクル型並列処理に較
べ、計算時間の高速化が図られている。That is, in the above method, an erasable edge is determined in advance in the first half process, and pixels are erased by the odd / odd judgment using the edge in the second half process. Thus, one layer of pixel erasure is realized. Therefore, the calculation time is shortened as compared with the conventional 4-cycle parallel processing.
【0009】[0009]
【発明が解決しようとする課題】しかしながら上記の方
法は、パターン周辺のわずかな凹凸でも不要な芯線が残
る場合がある。図15はその一例を示しており、パター
ンの角に微小な突起がある場合にその方向に芯線が残る
ことを示している。ただし図15において画素についた
番号は、細線化により消去された順番を示しており、●
が芯線を構成する画素であることを示す。図15におい
て不要な芯線が残る原因は、画素61及び62が各々1
回目及び2回目の処理において(数2)の条件を満足し
ないためで、ノイズの影響を受けて不要な芯線が残りや
すいという課題を有する。また(数1)と(数2)を満
足する画素は8連結エッジ位置に限定され、図15に示
すように細線化によってパターンの8連結エッジが消去
されていくため、斜め方向に比べ水平・垂直方向が速く
消去され、各画素に付与された番号が必ずしも背景まで
の最短距離値にならないという課題を有していた。However, in the above method, an unwanted core wire may remain even if slight irregularities around the pattern are left. FIG. 15 shows an example thereof, and shows that when there is a minute protrusion at the corner of the pattern, the core wire remains in that direction. However, the numbers attached to the pixels in FIG. 15 indicate the order in which the pixels are erased by thinning.
Indicates that they are pixels forming the core line. The cause of the unnecessary core wire remaining in FIG. 15 is that pixels 61 and 62 are each 1
This is because the condition of (Equation 2) is not satisfied in the second processing and the second processing, so that there is a problem that unnecessary core wires are likely to remain due to the influence of noise. Pixels satisfying (Equation 1) and (Equation 2) are limited to 8-connected edge positions, and the 8-connected edges of the pattern are erased by thinning as shown in FIG. There is a problem that the vertical direction is erased quickly, and the number given to each pixel does not always become the shortest distance value to the background.
【0010】本発明は上記従来技術の課題を解決するも
ので、1層の細線化の消去サイクルの軽減を図りつつ、
耐ノイズ性、等方性及び安定性を満足する良質の芯線を
得るとともに、パターンを全方向に等速度で細めてい
き、番号付けされた画素が背景からの最短距離値を有す
る距離画像を得ることのできる細線化処理装置を提供す
ることを目的とする。The present invention solves the above-mentioned problems of the prior art by reducing the erase cycle for thinning one layer,
A good quality core wire that satisfies noise resistance, isotropy and stability is obtained, and the pattern is thinned in all directions at a uniform speed to obtain a distance image in which the numbered pixels have the shortest distance value from the background. An object of the present invention is to provide a thinning processing device capable of performing the above.
【0011】[0011]
【課題を解決するための手段】この目的を達成するため
に本発明は、入力パターンの8連結エッジを検出する第
1の周辺点検出手段と、入力パターンの4連結エッジま
たは8連結エッジを検出する第2の周辺点検出手段と、
前記第1の周辺点検出手段からのエッジ情報を参照し、
エッジ位置の画素のうち8近傍の画素の値の総和が2以
上かつ4近傍の画素の値の総和が2以下の画素を第1の
注目画素として選択し、入力画像とエッジ画像の3×3
近傍のパターンが所定の条件を満たすとき第1の注目画
素を消去する第1の消去判定手段と、入力パターンと前
記第2の周辺点検出手段からのエッジ情報を参照して所
定の条件を満たすとき、前記エッジ情報の所定のデータ
を書き換えることによりエッジの位置を補正する周辺点
補正手段と、前記第1の消去判定手段からの画像データ
に対し前記周辺点補正手段によるエッジ情報を参照し、
エッジ位置の画素のうち8近傍の総和が2以上の画素を
第2の注目画素として選択し、入力画像とエッジ画像の
3×3近傍のパターンが所定の条件を満たすとき第2の
注目画素を消去する第2の消去判定手段と、前記周辺点
補正手段からの補正されたエッジ情報と、メモリからの
距離画像を参照し距離値Dを参照して所定の条件を満た
すとき、距離値DをD+1に更新して再び前記距離画像
メモリに書き込む距離変換手段とから構成したものであ
る。In order to achieve this object, the present invention provides a first peripheral point detecting means for detecting 8-connected edges of an input pattern and a 4-connected edge or 8-connected edges of an input pattern. Second peripheral point detecting means,
Referring to the edge information from the first peripheral point detection means,
Of the pixels at the edge position, the sum of the values of pixels near 8 is 2 or more and the sum of the values of pixels near 4 is 2 or less .
3x3 of the input image and the edge image selected as the pixel of interest
When the nearby pattern meets the specified condition, the first target image
A first removal determination means for erasing the element, with reference to the edge information from the second peripheral point detecting means and the input pattern Tokoro
When the specified condition is satisfied, the specified data of the edge information
Peripheral edge correction means for correcting the edge position by rewriting, and the edge information by the peripheral point correction means for the image data from the first erasure determination means,
Of the pixels at the edge position, the pixels in which the total of 8 neighborhoods is 2 or more
When the pattern in the vicinity of 3 × 3 of the input image and the edge image is selected as the second pixel of interest and satisfies a predetermined condition, the second pixel is selected .
The second erasure determination means for erasing the pixel of interest, the corrected edge information from the peripheral point correction means, the distance image from the memory are referred to, the distance value D is referred to, and a predetermined condition is satisfied.
When the distance value D is updated to D + 1,
It is composed of distance conversion means for writing in the memory .
【0012】[0012]
【作用】本発明は上記構成において、周辺点補正手段に
より第2の周辺点検出手段で検出されたエッジ位置に補
正を加えて細線化するため、水平・垂直・45°方向だ
けでなくその間の方向に対しても等速度で細めることが
でき、距離変換手段において細線化の番号付けを行うこ
とにより、背景からの最短距離値を有する高精度の距離
画像を得ることができる。また周辺点補正手段と距離変
換手段は、それぞれ第1の消去判定手段と第2の消去判
定手段に対し並列に処理できるため、処理をパイプライ
ン化する際、遅延を増大させることなく同時に芯線と距
離画像を得ることができる。According to the present invention, since the edge position detected by the second peripheral point detecting means is corrected and thinned by the peripheral point correcting means in the above structure, not only the horizontal / vertical / 45 ° directions but also the interval therebetween. It is possible to reduce the distance in the direction at a constant speed, and by performing the thinning numbering in the distance converting means, it is possible to obtain a highly accurate distance image having the shortest distance value from the background. Further, since the peripheral point correction means and the distance conversion means can perform processing in parallel with the first erasure determination means and the second erasure determination means, respectively, when the processing is pipelined, the core lines are simultaneously formed without increasing the delay. A range image can be obtained.
【0013】[0013]
(実施例1)以下、本発明の一実施例について、図面を
参照しながら説明する。(Embodiment 1) An embodiment of the present invention will be described below with reference to the drawings.
【0014】図1は本発明の一実施例における細線化処
理装置の構成図である。図1において、101は2値画
像が記憶されている画像メモリ、102は画像メモリ1
01からの2値画像の8連結エッジを検出する第1の周
辺点検出手段、103は画像メモリ101からの2値画
像の4連結エッジまたは8連結エッジを検出する第2の
周辺点検出手段、104は第1及び第2の周辺点検出手
段102及び103からの2ビットのエッジ情報を記憶
する第1の周辺点記憶手段、105は画像メモリ101
からの2値画像と第1の周辺点記憶手段104からの第
1の周辺点検出手段102により検出されたエッジ情報
とを参照し、前記エッジ位置の画素のうち8近傍の画素
の値の総和が2以上かつ4近傍の画素の値の総和が2以
下の画素を選択し、入力画像エッジ画像の3×3近傍の
パターンが所定の条件を満たすとき注目画素を消去する
第1の消去判定手段、106は第1の消去判定手段10
5からの2値画像を記憶する補助記憶手段、107は画
像メモリ101からの2値画像と第1の周辺点記憶手段
104からの第2の周辺点検出手段103により検出さ
れたエッジ情報とを参照し、エッジ位置の補正を行う周
辺点補正手段、108は周辺点補正手段107からの2
値画像を記憶する第2の周辺点記憶手段、109は補助
記憶手段106からの2値画像と第2の周辺点記憶手段
108からのエッジ情報とを参照し、エッジ位置の画素
のうち8近傍の画素の値の総和が2以上の画素を選択
し、入力画像とエッジ画像の3×3近傍のパターンが所
定の条件を満たすとき注目画素を消去する第2の消去判
定手段、110は第2の消去判定手段109からの2値
画像を記憶する画像メモリ、111は第2の周辺点記憶
手段108からのエッジ情報と距離画像メモリ112か
らの距離値を参照し、距離値を更新する距離変換手段で
ある。FIG. 1 is a block diagram of a thinning processing apparatus according to an embodiment of the present invention. In FIG. 1, 101 is an image memory in which binary images are stored, and 102 is an image memory 1.
01 first peripheral point detecting means for detecting 8 connected edges of the binary image from 01, 103 a second peripheral point detecting means for detecting 4 connected edges or 8 connected edges of the binary image from the image memory 101, Reference numeral 104 is a first peripheral point storage means for storing 2-bit edge information from the first and second peripheral point detection means 102 and 103, and 105 is an image memory 101.
The sum of the values of the eight neighboring pixels among the pixels at the edge positions with reference to the binary image from the first peripheral point storage means 104 and the edge information detected by the first peripheral point detection means 102. A first erasure determination means for erasing the pixel of interest when the sum of the values of the pixels in the vicinity of 2 and 4 and the sum of the values in the vicinity of 4 is selected and the pattern in the vicinity of 3 × 3 of the input image edge image satisfies a predetermined condition. , 106 is the first erasure determination means 10
5, an auxiliary storage unit for storing the binary image from 5 stores the binary image from the image memory 101 and the edge information detected by the second peripheral point detection unit 103 from the first peripheral point storage unit 104. Reference is made to the peripheral point correcting means for correcting the edge position, and reference numeral 108 denotes the peripheral point correcting means 107.
Second peripheral point storage means for storing the value image, 109 refers to the binary image from the auxiliary storage means 106 and the edge information from the second peripheral point storage means 108, and refers to eight neighborhoods of pixels at the edge position. Second erasure determination means for erasing the pixel of interest when a pixel having a total sum of the pixel values of 2 or more is selected and the pattern in the vicinity of 3 × 3 of the input image and the edge image satisfies a predetermined condition, and 110 is a second An image memory for storing the binary image from the erasure determination means 109, 111 refers to the edge information from the second peripheral point storage means 108 and the distance value from the distance image memory 112, and distance conversion for updating the distance value It is a means.
【0015】図2はCPUシステムを用いて上記細線化
処理を繰り返し、パターンを1画素幅まで細めるととも
に2値パターンを距離画像に変換する細線化処理装置の
構成図である。図2において、202は前記第1及び第
2の周辺点検出と、前記第1及び第2の消去判定と、前
記周辺点補正及び前記距離変換を含む細線化プロセスの
制御プログラムが格納されているROM、203は前記
プログラムがロードされる主記憶、201は前記主記憶
203上のプログラムを実行するCPU、204及び2
05は細線化処理における入出力の2値画像を記憶する
画像メモリ、206は距離画像を記憶する距離画像メモ
リ、207は前記第1及び第2の周辺点検出によって検
出された2ビットのエッジ情報を記憶するエッジ情報記
憶用メモリ、208は周辺点補正によって補正されたエ
ッジ位置を記憶する補正エッジ情報記憶メモリ、209
は前記第1の消去判定による出力画像を記憶する補助メ
モリである。以下図2のCPUシステムにおける細線化
処理の動作を簡単に説明する。CPU201は図1の画
像メモリ101に相当する入力画像が格納されている画
像メモリ204から画像データを読み込み、前記第1及
び第2の周辺点検出手段102及び103における演算
を行い、演算結果をエッジ情報記憶用メモリ207に格
納する。次に画像メモリ204とエッジ情報記憶用メモ
リ207から同時に同じ位置の画像データを読み込み、
前記第1の消去判定手段105における消去判定演算を
行い、演算結果を補助メモリ209に格納する。次に画
像メモリ204とエッジ情報記憶用メモリ207から同
時に同じ位置の画像データを読み込み、周辺点補正手段
107の補正判定を行い、補正されたエッジ情報を補正
エッジ情報記憶メモリ208に格納する。次に補正エッ
ジ情報記憶メモリ208と補助メモリ209からの画像
データを読み込み、前記第2の消去判定手段109にお
ける消去判定演算を行い、演算結果を図1の画像メモリ
108に相当する画像メモリ205に格納する。さらに
補正エッジ情報記憶メモリ208と距離画像メモリ20
6の画像データを読み込み、距離値を更新し再び距離画
像メモリ206に書き込む。以上の動作で画像メモリ2
04の2値パターンが背景側から1層細められ、画像メ
モリ205に格納されるとともに距離画像メモリ206
上で距離値が1更新される。2回目の細線化は画像メモ
リ205の2値画像に対して行い、上記手順を経てさら
に1層細めた2値画像を画像メモリ204に格納する。
以降同様にn回目の細線化は(n−1)回の細線化画像
に対して行い、パターンが1画素幅になるまで反復処理
を行う。FIG. 2 is a block diagram of a thinning processing apparatus that repeats the above thinning processing by using a CPU system to narrow the pattern to one pixel width and convert a binary pattern into a distance image. In FIG. 2, reference numeral 202 stores a control program of a thinning process including the first and second peripheral point detection, the first and second erasure determination, the peripheral point correction and the distance conversion. ROM, 203 is a main memory into which the program is loaded, 201 is a CPU for executing the program on the main memory 203, 204 and 2
Reference numeral 05 is an image memory for storing input / output binary images in thinning processing, 206 is a range image memory for storing range images, and 207 is 2-bit edge information detected by the first and second peripheral point detection. A memory for storing edge information, 208 denotes a corrected edge information storage memory for storing the edge position corrected by the peripheral point correction, 209
Is an auxiliary memory for storing the output image by the first erasure determination. The operation of the thinning process in the CPU system of FIG. 2 will be briefly described below. The CPU 201 reads the image data from the image memory 204 in which the input image corresponding to the image memory 101 of FIG. 1 is stored, performs the calculation in the first and second peripheral point detecting means 102 and 103, and outputs the calculation result as an edge. It is stored in the information storage memory 207. Next, the image data at the same position is simultaneously read from the image memory 204 and the edge information storage memory 207,
The first erasing judgment means 105 performs the erasing judgment calculation and stores the calculation result in the auxiliary memory 209. Next, the image data at the same position is read from the image memory 204 and the edge information storage memory 207 at the same time, the correction determination of the peripheral point correction means 107 is performed, and the corrected edge information is stored in the corrected edge information storage memory 208. Next, the image data from the corrected edge information storage memory 208 and the auxiliary memory 209 is read, the erasure judgment calculation is performed in the second erasure judgment means 109, and the calculation result is stored in the image memory 205 corresponding to the image memory 108 in FIG. Store. Further, the corrected edge information storage memory 208 and the range image memory 20
The image data of No. 6 is read, the distance value is updated, and the distance image memory 206 is written again. With the above operation, the image memory 2
The binary pattern 04 is thinned by one layer from the background side and stored in the image memory 205 and the distance image memory 206.
The distance value is updated by 1 above. The second thinning is performed on the binary image in the image memory 205, and the binary image further thinned by one layer is stored in the image memory 204 through the above procedure.
Similarly, the thinning of the nth time is performed on the (n-1) th thinned image, and the iterative process is repeated until the pattern has a width of 1 pixel.
【0016】以上のように構成された細線化処理装置に
ついて、図3、図4に示すフローチャートを用いて細線
化の具体的処理を説明する。同図において301は第2
の周辺点検出303で検出すべきエッジの連結性及びエ
ッジの補正の必要性の有無が登録された細線化制御テー
ブルを読み込むステップである。本テーブルには、例え
ば(表1)に示すデータが登録されており、細め処理の
繰り返し毎に第2の周辺点検出303で4連結エッジを
検出するか8連結エッジを検出するかが決定される。こ
こで4連結エッジは注目画素からみて8近傍に少なくと
も一つ0が存在する輪郭線で、8連結エッジは注目画素
からみて上下左右の4近傍に少なくとも一つ0が存在す
る輪郭線である。つまり、8連結エッジは4連結エッジ
に含まれる。また、(表1)に記述したエッジの連結の
順序は、細線化で1層ずつエッジを消去していくとき、
4連結エッジと8連結エッジのいずれのエッジを消去す
るかを示すもので、一連の細め処理により8方向のいず
れの方向にも均等な割合で細める事を目的としている。
例えば一連の細め処理で毎回4連結エッジを消去してい
くと、対象とする図形は上下左右方向に比べ斜め方向の
方がより大きく細められるし、また逆に毎回8連結エッ
ジを消去していくと、斜め方向に比べ上下左右方向の方
がより大きく細められる。そこで(表1)に示す順序で
エッジの消去を制御すると、上下左右斜め方向のいずれ
にも均等に細めることができる。これは、細線化におい
て1回の細め処理は、図形の輪郭と細線化処理の結果残
る芯線との距離を1縮めることに相当するので、斜め4
5°方向に細める距離と上下左右方向から細める距離を
均等にするためには、斜め45°方向において芯線との
距離が等しいの画素の連結状態と、毎回の細め処理で消
滅させるエッジの連結状態を一致させればよいわけであ
り、そのように考えると毎回の細め処理で消去するエッ
ジの連結状態が(表1)のように決定される。また(表
1)において第2の周辺点の補正を行うか否かを決定す
るのは、細める距離を斜め45°と上下左右方向に加え
その間の方向、例えば22.5°方向や67.5°方向
についても均等にするために行うものである。45°方
向の等距離線の連結状態と22.5°及び67.5°方
向の等距離線の連結状態が等しい場合は補正は必要ない
が、異なっている場合は補正が必要となる。例えば、あ
る点からの距離が水平垂直方 向の6画素分(その他の方
向では小数点以下四捨五入)の位置にある画素について
考えると、45°方向では4連結となるが22.5°及
び67.5°方向では逆に8連結となる。これは6回目
の細め処理において4連結エッジを消去すると、22.
5°及び67.5°方向では距離として余計に細められ
る事を示しており、これを防止するためには22.5°
及び67.5°方向については6回目の細め処理は行わ
ないようにしなければならない。また9画素分について
考えると逆になる。以上述べたとおり(表1)において
第2の周辺点の補正は、22.5°及び67.5°方向
にも等距離に細めるために、4連結エッジの場合は補正
によって消去の候補から取り下げ、8連結エッジの場合
は補正により逆に消去の候補として取り上げることを示
している。 With respect to the thinning processing apparatus configured as described above, the specific thinning processing will be described with reference to the flow charts shown in FIGS. In the figure, 301 is the second
This is a step of reading the thinning control table in which the connectivity of the edges to be detected by the peripheral point detection 303 and the presence / absence of the necessity of the edge correction are registered. In this table, for example, the data shown in (Table 1) is registered, and it is determined for each repetition of the narrowing process whether to detect 4 connected edges or 8 connected edges by the second peripheral point detection 303. It This
Here, at least 4 connected edges are in the vicinity of 8 from the pixel of interest.
Each edge is a contour line with 0, and 8 connected edges are the target pixel.
There are at least one 0 in 4 neighborhoods of up, down, left and right
It is a contour line. That is, 8 connected edges are 4 connected edges
include. In addition, the connection of edges described in (Table 1)
The order is as follows:
Erase either 4 or 8 connected edges
It shows whether or not it is in 8 directions by a series of thinning processing.
The aim is to reduce the ratio evenly in these directions.
For example, a series of thinning processes erases 4 connected edges each time.
If you do, the target figure will be
It is more narrowed, and on the contrary, it is 8 linked edges each time.
When you erase the
Is made thinner. Therefore, in the order shown in (Table 1)
If you control the erasure of edges, it will
Can be evenly thinned. This is the thinning odor
One thinning process is the result of the outline of the figure and the thinning process.
This is equivalent to shortening the distance from the core wire by 1.
The distance to narrow in 5 ° direction and the distance to narrow in up / down / left / right directions
In order to make it even, it should be
The connected state of pixels with the same distance and erase with each thinning process
You just have to match the connection state of the edges to be destroyed.
If you think in that way, you will be able to erase with each thinning process.
The connection state of the dice is determined as shown in (Table 1). Also (table
In 1) decide whether to correct the second peripheral point
What's more, add a narrowing distance of 45 ° diagonally and vertically and horizontally.
Direction between them, for example, 22.5 ° direction or 67.5 ° direction
This is also done for equality. 45 ° direction
22.5 ° and 67.5 ° directions with the equidistant lines connected in the same direction
No correction is required if the equidistant lines in the same direction are connected.
However, if they are different, correction is necessary. For example,
Write a distance of horizontal and vertical sides 6 pixels direction (Other terms that
For the pixel at the position after the decimal point)
If you think about it, there are 4 connections in the 45 ° direction, but 22.5 °
And 67.5 °, there are 8 connections. This is the sixth time
When 4 connected edges are deleted in the thinning processing of 22.
In the directions of 5 ° and 67.5 °, the distance is further reduced.
22.5 ° to prevent this.
And the sixth thinning process is performed in the 67.5 ° direction.
You have to be careful not to. For 9 pixels
The opposite is true when you think about it. As mentioned above (Table 1)
The correction of the second peripheral point is in the directions of 22.5 ° and 67.5 °.
Even if it is 4 connected edges, it is corrected in order to narrow it to the same distance.
Removed as a candidate for erasure by 8 edges
Indicates that it will be taken as a candidate for elimination by correction.
are doing.
【0017】[0017]
【表1】 [Table 1]
【0018】302は第1の周辺点を検出するプロセス
で、3×3窓で入力画像を走査し、図5に示す8近傍の
画素の値を用いて8連結エッジを検出しエッジ位置にラ
ベルeを与える。8連結エッジは注目画素d0が1で上
下左右の4近傍の画素に少なくとも一つ0が存在すれば
よいので、(数5)に示す論理式が真の場合、注目位置
にラベルeを与え、偽の場合0を与える。ただし・は論
理積、―は否定を示す。Reference numeral 302 denotes a process for detecting a first peripheral point, in which the input image is scanned with a 3 × 3 window, 8 connected edges are detected using the values of pixels in 8 neighborhoods shown in FIG.
Give bell e. The 8-connected edge has a target pixel d0 of 1
If there is at least one 0 in the four neighboring pixels on the bottom left and right
Since it is good , the label e is given to the position of interest when the logical expression shown in (Equation 5) is true, and 0 is given when it is false. However, -is the logical product and - is the negation.
【0019】[0019]
【数5】 [Equation 5]
【0020】303は第2の周辺点を検出するプロセス
で、(表1)の順序にしたがい8連結エッジを検出する
場合は(数5)の演算を行う。また4連結エッジを検出
する場合は注目画素d0が1で8近傍の画素に少なくと
も一つ0が存在すればよいので(数6)の演算を行う。
演算の結果、式の値が真の場合注目位置にラベルkを与
え、偽の場合0を与える。302及び303のプロセス
により、ラベルeが与えられた画素位置にはラベルkも
同時に与えられるが、逆にラベルkが与えられていても
必ずしもラベルeは与えられない。ラベルeが与えられ
た画素位置は、後述する308における第1の消去判定
の対象となる画素であることを意味し、ラベルkが与え
られた画素位置は、後述する312における第2の消去
判定の対象となる画素であることを意味する。 Reference numeral 303 denotes a process for detecting the second peripheral point. When the 8-connected edge is detected according to the order of (Table 1), the operation of (Equation 5) is performed. Also detects 4 connected edges
In this case, the pixel of interest d0 is 1 and there are at least 8 neighboring pixels.
Since it suffices that there is one 0, the calculation of (Equation 6) is performed.
As a result of the calculation , the label k is given to the position of interest when the value of the expression is true, and 0 is given when it is false. Processes 302 and 303
Therefore, the label k is also added to the pixel position given the label e.
It is given at the same time, but conversely even if the label k is given
The label e is not always given. Given the label e
The determined pixel position is the first erasure determination in 308 described later.
And the label k
The obtained pixel position is used for the second erasing in 312 described later.
It means that the pixel is a determination target.
【0021】[0021]
【数6】 [Equation 6]
【0022】以上の手続きを画像を走査し終わるまで継
続し、検出されたエッジ情報を図2のエッジ情報記憶用
メモリ207に出力する。The above procedure is continued until the scanning of the image is completed, and the detected edge information is output to the edge information storage memory 207 of FIG.
【0023】304、305は、前記第2の周辺点とし
て検出されたラベルkの位置を補正するプロセスで、入
力画像とメモリ207上のエッジ画像の同じ位置を3×
3窓で走査し補正判定を行う。ただし前記細線化制御テ
ーブルの補正の有無を参照し、無しの場合はいっさい補
正は行わず、メモリ207の内容をそのままメモリ20
8に書き込む。補正を必要とする場合304で補正判定
を行い、305に補正したエッジ情報を書き込む。以下
に図6を用いて補正条件について説明する。同図(a)
から(h)は補正する位置の3×3近傍のパターンを示
している。同図において1または0の位置は入力画像を
参照しパターンの一致を判定し、kの位置に関してはエ
ッジ画像を参照し、その位置にラベルkが付いているこ
とを判定する。(a)から(h)のいずれかのパターン
と一致する場合に、305で注目画素*のエッジ情報を
補正する。すなわちエッジ画像において注目画素*の位
置にラベルkが付いている場合はラベルkを取り除き、
逆にラベルkがついていない場合にラベルkを与えるこ
とによりエッジ位置を補正するものである。細線化制御
テーブルの順序に従って4連結エッジあるいは8連結エ
ッジを消去した場合、水平・垂直・45゜方向に関して
同じ割合でパターンを細めることができるが、例えば2
2.5゜方向に関しては前記方向に比べて速く細められ
たり、遅く細められたりする。補正処理は、22.5゜
の方向に関しても同じ割合で細めるように、細線化の消
去の位置を制御するものである。Reference numerals 304 and 305 denote processes for correcting the position of the label k detected as the second peripheral point, and the same position of the input image and the edge image on the memory 207 are 3 ×.
Scanning is performed in three windows to make correction determination. However, the presence / absence of correction in the thinning control table is referred to, and if there is no correction, no correction is performed and the contents of the memory 207 are directly stored in the memory 20.
Write to 8. When correction is required, correction determination is performed in 304, and the corrected edge information is written in 305. The correction conditions will be described below with reference to FIG. The same figure (a)
From (h) to (h) are shown patterns in the vicinity of 3 × 3 of the position to be corrected. In the figure, the position of 1 or 0 is referred to the input image to determine pattern matching, the position of k is referred to the edge image, and it is determined that the position is labeled k. If the pattern matches any one of (a) to (h), the edge information of the pixel of interest * is corrected at 305. That is, when the label k is attached to the position of the pixel of interest * in the edge image, the label k is removed,
On the contrary, when the label k is not attached, the label k is given to correct the edge position. When 4 or 8 connected edges are erased according to the order of the thinning control table, the pattern can be thinned at the same ratio in the horizontal / vertical / 45 ° directions.
The direction of 2.5 ° is narrowed faster or slower than the above direction. The correction processing is to control the erasing position of thinning so that the direction is also thinned in the direction of 22.5 °.
【0024】307から314は細線化の消去判定を行
うプロセスで、306において、消去した画素の有無を
示すフラグFを予めリセットする。307においてエッ
ジ情報記憶用メモリ207からのエッジ画像を参照し、
注目位置にエッジ情報としてラベルeが与えられている
場合308の処理を行い、ラベルeが与えられていない
場合次の画素を参照し再び307の判定を行う。308
は第1の周辺点として検出された画素に関して、実際の
消去判定を行うプロセスである。図2の画像メモリ20
4とエッジ情報記憶用メモリ207から、それぞれ注目
画素の3×3近傍のデータを読み出し消去判定を行う。
注目画素を消去するのは、以下に示す条件1、条件2及
び条件3を用いて(数7)が真の場合である。Reference numerals 307 to 314 are processes for determining whether or not thinning is to be performed. In step 306, a flag F indicating the presence or absence of erased pixels is reset in advance. At 307, the edge image from the edge information storage memory 207 is referred to,
If the label e is given as the edge information to the position of interest, the process of 308 is performed, and if the label e is not given, the next pixel is referred to and the determination of 307 is performed again. 308
Is a process of making an actual erasure decision with respect to the pixel detected as the first peripheral point. Image memory 20 of FIG.
4 and edge information storage memory 207, data in the vicinity of 3 × 3 of the pixel of interest is read out, and erase determination is performed.
The pixel of interest is erased when (Equation 7) is true using Condition 1, Condition 2 and Condition 3 shown below.
【0025】[0025]
【数7】 [Equation 7]
【0026】条件1は、302で検出したエッジ位置の
うち8近傍の総和が2以上かつ4近傍の総和が2以下の
画素を選択する条件で、前記画像メモリ204からのデ
ータについて(数8)に示す式の真偽を判定する。条件
1において8近傍の総和が2以上としたのは芯線の縮退
を防止するためである。Condition 1 is a condition for selecting a pixel in which the sum of 8 neighborhoods is 2 or more and the sum of 4 neighborhoods is 2 or less among the edge positions detected in 302, and the data from the image memory 204 (Equation 8) is selected. The truth of the expression shown in is judged. In condition 1, the sum of 8 neighborhoods is set to 2 or more in order to prevent the core wire from degenerating.
【0027】[0027]
【数8】 [Equation 8]
【0028】条件2は、パターンの連結性を保存するた
めの条件で、3×3領域において分岐のない位置を選択
するために、前記画像メモリ204からのデータについ
て(数9)に示す式の真偽を判定する。The condition 2 is a condition for preserving the connectivity of the pattern, and the position without branch is selected in the 3 × 3 area.
In order to do so, the truth of the expression shown in (Equation 9) is judged for the data from the image memory 204.
【0029】[0029]
【数9】 [Equation 9]
【0030】ただしN4は4連結数、N8は8連結数を
示し、4連結数及び8連結数はそれぞれ4連結の場合の
連結数及び8連結の場合の連結数を表す。連結数とは、
2値画像の画素の状態を分類する際に一般的に用いられ
る特徴量であり、図5の注目画素d0を除いた近傍領域
d1〜d8においてd0と連結できる単連結(オイラー
数1)の連結成分数であり、一般的に(数10)で表さ
れることが知られている。(「森 坂倉:画像認識の基
礎[I],p.53〜56,オーム社刊(1986)」
参照)言い換えれば、連結数は注目画素d0を中心とす
る3×3領域において値1の図形の外周を辿るとき、注
目画素d0に行き当たる回数を示しており、当然、4連
結の場合と8連結の場合では異なる結果となる場合があ
る。したがって(数9)に示すように、4連結数も8連
結数も1であるということは、4連結の画素を辿っても
8連結の画素を辿っても、図形の外周を周回したとき注
目画素d0に1度しか行き当たらない事に相当するの
で、注目画素からみて3×3領域に枝分かれが存在しな
いことになる。 However, N4 is the number of 4 connections, N8 is the number of 8 connections, and the number of 4 connections and the number of 8 connections are 4 connections respectively.
The number of connections and the number of connections in the case of 8 connections are shown. What is the number of connections?
Commonly used in classifying pixel states in binary images
5 is a feature amount that is a neighboring area excluding the pixel of interest d0 in FIG.
A single connection that can be connected to d0 in d1 to d8 (Euler
It is the number of connected components in (Equation 1), and is generally expressed by (Equation 10).
It is known that ("Mori Sakakura: The basis of image recognition
Foundation [I], p. 53-56, published by Ohmsha (1986) "
In other words, the number of connections is centered on the target pixel d0.
When tracing the perimeter of a figure with a value of 1 in a 3x3 area
It shows the number of times the eye pixel d0 is reached, and naturally, four consecutive
There may be different results for the case of 8 and the case of 8
It Therefore, as shown in (Equation 9), the number of 4 connections is 8
The number of connections is also one, which means that even if one follows four connected pixels
Even if the 8-connected pixels are traced, when the circle goes around the periphery of the figure.
This is equivalent to hitting the eye pixel d0 only once.
Therefore, there is no branching in the 3 × 3 area as seen from the pixel of interest.
It will be good.
【0031】[0031]
【数10】 [Equation 10]
【0032】条件3は、孤立した2×2画素のパターン
の消滅を防止する条件で、前記エッジ情報記憶用メモリ
207と前記画像メモリ204からのデータを参照し、
3×3近傍が図7(a)(b)のいずれかと一致するか
どうかの真偽判定を行う。同図において1または0の位
置は入力画像を参照しパターンの一致を判定し、eの位
置に関してはエッジ画像を参照し、その位置にラベルe
が付いていることを判定し、空白位置は不定とする。Condition 3 is a condition for preventing disappearance of an isolated 2 × 2 pixel pattern, and refers to data from the edge information storage memory 207 and the image memory 204,
Whether or not the 3 × 3 neighborhood matches any of FIGS. 7A and 7B is determined. In the figure, the position of 1 or 0 refers to the input image to determine pattern matching, the position of e refers to the edge image, and the position of the label e
It is determined that is attached, and the blank position is undefined.
【0033】307の判定では306で注目画素を消去
したかどうかを検出し、消去した場合310において消
去フラグFをセットする。以上の手続きを走査終了まで
継続し、処理結果を図2の補助メモリ209に格納す
る。以下第2の消去判定について説明する。311にお
いて前記補正エッジ情報記憶用メモリ208からのエッ
ジ画像を参照し、注目位置にエッジ情報としてラベルk
が与えられている場合312の処理を行い、ラベルkが
与えられていない場合次の画素を参照し再び311の判
定を行う。312において、以下に示す条件4、条件
5、条件6及び条件7を用いて(数11)が真の場合、
注目画素を消去する。In the judgment of 307, it is detected in 306 whether or not the pixel of interest has been erased, and in the case of erasing, the erase flag F is set in 310. The above procedure is continued until the end of scanning, and the processing result is stored in the auxiliary memory 209 in FIG. The second erase determination will be described below. In 311 the edge image from the corrected edge information storage memory 208 is referred to, and a label k is added to the target position as edge information.
Is given, the processing of 312 is performed, and if the label k is not given, the next pixel is referred to and the determination of 311 is performed again. In 312, using the following condition 4, condition 5, condition 6 and condition 7, if (Equation 11) is true,
Erase the pixel of interest.
【0034】[0034]
【数11】 [Equation 11]
【0035】条件4は、補正されたエッジ位置kのうち
8近傍の総和が2以上の画素を選択する条件で、前記補
助メモリ209からのデータについて(数12)に示す
式の真偽を判定する。条件4において8近傍の総和が2
以上としたのは芯線の縮退を防止するためで、例えば8
近傍の総和が1以上という条件に縮退を防止する新たな
条件をつけ加えて表記することも可能である。Condition 4 is a condition for selecting a pixel having a total sum of 2 or more in 8 neighborhoods of the corrected edge position k, and it is determined whether the data from the auxiliary memory 209 is true or false in the equation shown in (Equation 12). To do. Under condition 4, the sum of 8 neighborhoods is 2
The above is to prevent the contraction of the core wire, for example, 8
It is also possible to describe by adding a new condition for preventing degeneracy to the condition that the total sum of neighborhoods is 1 or more.
【0036】[0036]
【数12】 [Equation 12]
【0037】条件5は、パターンの連結性を保存するた
めの条件で、3×3領域において分岐のない位置を選択
する。前記補助メモリ209のデータについて前記(数
9)の真偽を判定する。The condition 5 is a condition for preserving the connectivity of the pattern, and selects a position having no branch in the 3 × 3 area. Whether the data in the auxiliary memory 209 is true or false is determined in (Equation 9).
【0038】条件6は、2画素幅の線の消滅を防ぐ条件
であり、前記補助メモリ209及び補正エッジ情報記憶
用メモリ208からのデータを参照し、3×3近傍が図
8(a)(b)に示すいずれかと一致するかどうかの真
偽判定を行う。同図において1または0の位置は入力画
像を参照しパターンの一致を判定し、kの位置に関して
はエッジ画像を参照し、その位置にラベルkが付いてい
ることを判定し、空白位置は不定とする。ここで図8
(a)の条件は、横方向の2画素幅の線のうち上側の線
を選択する条件で、図8(b)の条件は、縦方向の2画
素幅の線のうち左側の線を選択する条件である。Condition 6 is a condition for preventing the disappearance of a line having a width of 2 pixels, and referring to the data from the auxiliary memory 209 and the memory 208 for storing the correction edge information, the vicinity of 3 × 3 is shown in FIG. Whether or not it matches any of the values shown in b) is determined. In the figure, the position of 1 or 0 refers to the input image to determine the pattern match, the position of k refers to the edge image, and it is determined that the label k is attached to the position, and the blank position is undefined. And Figure 8 here
The condition (a) is a condition for selecting the upper line of the horizontal 2 pixel width lines, and the condition of FIG. 8B is the condition for selecting the left side line of the vertical 2 pixel width lines. It is a condition to do.
【0039】条件7は、斜め方向の2画素幅の線の縮退
を防止する条件であり、補助メモリ209及びメモリ2
08からのデータを参照し、3×3近傍が図9(a)
(b)に示すいずれかと一致するかどうかの真偽判定を
行う。ただし図9においてX1とX2のいずれかは1と
する。The condition 7 is a condition for preventing a line having a width of 2 pixels in the diagonal direction from being degenerated, and is the auxiliary memory 209 and the memory 2.
Referring to the data from 08, 3 × 3 neighborhood is shown in FIG. 9 (a).
Whether or not it matches any of the items shown in (b) is determined. However, in FIG. 9, either X1 or X2 is 1.
【0040】313の判定では312で注目画素を消去
したかどうかを検出し、消去した場合314において消
去フラグFをセットする。以上の手続きを走査終了まで
継続し、処理結果を図2の画像メモリ205に格納す
る。In the judgment of 313, it is detected in 312 whether or not the pixel of interest is erased, and in the case of erasing, the erasure flag F is set in 314. The above procedure is continued until the end of scanning, and the processing result is stored in the image memory 205 of FIG.
【0041】315は距離画像メモリ206を参照し、
距離値を更新するステップで、311で、ラベルkの付
いていない画素位置に対して更新の判定を行う。ラベル
kの付いている画素に対しては判定を行わない。更新の
判定は、細線化の順番を示す番号nと距離値Dとの比較
を行い、D=nの距離値をもつ画素にたいして新にD=
(n+1)の距離値を与える。ただし、最初の細線化
(n=1)を行う際には、距離画像メモリ206には、
パターン部が”01”、背景が”00”のデータが用意
されているものとする。以上の処理は、パターンの内部
点の距離値を1インクリメントするもので、芯線位置の
画素にも正しい距離値を与えることができる。Reference numeral 315 refers to the range image memory 206,
In the step of updating the distance value, in step 311, it is determined whether the pixel position without the label k is updated. No determination is made for pixels with label k. In the update determination, the number n indicating the thinning order is compared with the distance value D, and D = n is newly added to the pixel having the distance value D = n.
Give a distance value of (n + 1). However, when performing the first thinning (n = 1), the distance image memory 206 stores
It is assumed that the data of the pattern part "01" and the background "00" are prepared. The above process increments the distance value at the internal point of the pattern by 1, and can give the correct distance value to the pixel at the skeleton position.
【0042】316は細線化の終了条件をチェックする
ステップであり、消去フラグFが0の場合細線化を終了
し、0でない場合、前記画像メモリ205の画像を入力
として302のステップから再び細め処理を実行し、処
理結果を前記画像メモリ204へ格納する。すなわち細
線化の反復毎に入力画像として、メモリ204と205
の画像を交互に入力し、処理結果をもう一方の画像メモ
リに格納し、画像が変化しなくなるまで処理を繰り返
す。Reference numeral 316 is a step for checking the thinning end condition. If the erasure flag F is 0, the thinning is finished. If it is not 0, the image in the image memory 205 is input and the thinning process is performed again from the step 302. Is executed and the processing result is stored in the image memory 204. That is, the memories 204 and 205 are used as an input image for each iteration of thinning.
Images are alternately input, the processing result is stored in the other image memory, and the process is repeated until the image does not change.
【0043】以上のように構成した細線化処理装置によ
り、境界部に凹凸のある2値パターンを細線化した例を
図10に示す。図10において画素についた番号は細め
処理により消去された順番を示している。さらに同図は
毎回の細め処理において、ラベルe及びkがどの位置に
与えられるかを示しており、ラベルeは図形に対し8連
結エッジの位置に与えられ、ラベルkは(表1)に定め
られた連結状態のエッジの位置に与えられる。(つま
り、1回目は4連結エッジ、2回目は8連結エッジ、3
回目は8連結エッジ、4回目は4連結エッジ・・・)図
3に示したように1回の細め処理は、まずステップ30
2及び303において消去する候補の画素位置にラベル
e及びkを与え、次にステップ308においてラベルe
が与えられている画素を注目位置として第1サイクルの
消去判定を行い、さらにステップ312においてラベル
kが与えられている画素を注目位置として第2サイクル
の消去判定を行う。図10において番号に◯のついた画
素は、第1サイクルの消去判定で消去された画素であ
り、◯のついていない画素は第2サイクルの消去判定で
消去された画素である事を示す。図10に示した図形の
場合、合計4回の細め処理により芯線(●の付いた画
素)が得られ、これ以上細め処理を繰り返しても、芯線
は変化しない。図10から明らかなように、本実施例に
よる細線化処理装置は境界部に凹凸のあるパターンに対
しても、その影響を受けることなく良質の芯線を抽出す
ることができる。また図11は図10のパターンの距離
画像を示しており、各画素には背景までの最短距離値が
与えられていることを示すものである。FIG. 10 shows an example of thinning a binary pattern having irregularities at the boundary by the thinning processing apparatus configured as described above. The numbers attached to the pixels in Figure 10 are smaller
The order in which they are erased by the processing is shown. Furthermore, the figure
The position of the labels e and k in each thinning process
It is shown that the label e has 8 rows for the figure.
It is given to the position of the connecting edge, and the label k is defined in (Table 1).
It is given to the position of the edge of the connected state. (Tsuma
1st time is 4 connected edges, 2nd time is 8 connected edges, 3
8th connection edge for the 4th time, 4th connection edge for the 4th time ...)
As shown in FIG. 3, the thinning process is performed once in step 30.
Label at candidate pixel positions to be deleted in 2 and 303
e and k, then in step 308 the label e
Is set as the pixel of interest in the first cycle
The erasure judgment is performed, and further, in step 312, the label is
The second cycle with the pixel for which k is given as the position of interest
The erasure judgment of Image with ◯ in Figure 10
A pixel is a pixel erased by the erase determination in the first cycle.
Pixels not marked with ◯ are erased in the second cycle.
This indicates that the pixel has been erased. Of the figure shown in FIG.
In this case, the core wire (image marked with ●
The core wire is obtained, and the core wire can be
Does not change. As is apparent from FIG. 10, the thinning processing apparatus according to the present embodiment can extract a good-quality core line without being affected by a pattern having irregularities at the boundary. Further, FIG. 11 shows a distance image of the pattern of FIG. 10, and shows that each pixel is given the shortest distance value to the background.
【0044】以上のように本実施例によれば、第1の周
辺点検出手段102で検出されたエッジ位置に対し、第
1の消去判定手段105を設けて予めパターン境界部の
微小な凹凸を除去し、第2の周辺点検出手段103で細
線化の順番によって4連結エッジと8連結エッジを制御
して検出し、さらに周辺点補正手段107を設け、細線
化の所定の順番でエッジ位置を補正することにより、第
2の消去判定手段109において消去する位置を制御す
るため、パターンのいずれの方向にも背景から等距離で
細めることができ、距離変換手段111を設けてパター
ンの内部点の距離値を更新することにより、芯線を得る
と同時に背景までの最短距離値を有する距離画像を得る
ことができる。As described above, according to the present embodiment, the first erasure judging means 105 is provided for the edge position detected by the first peripheral point detecting means 102 so that the minute unevenness of the pattern boundary portion is formed in advance. The second peripheral point detecting means 103 controls and detects the 4-connected edge and the 8-connected edge according to the thinning order, and further, the peripheral point correcting means 107 is provided to detect the edge position in the predetermined thinning order. Since the position to be erased is controlled in the second erasure determination means 109 by the correction, the pattern can be thinned at an equal distance from the background in any direction of the pattern, and the distance conversion means 111 is provided to determine the internal point of the pattern. By updating the distance value, it is possible to obtain the core line and at the same time obtain the distance image having the shortest distance value to the background.
【0045】このようにして得られた芯線と距離画像を
用いて、パターンの幅を測定する例について図12を用
いて説明する。パターンの幅Wを求めるためには、芯線
位置で距離画像を参照し、3×3窓の距離値を用いて
(数13)により演算する。注目画素の距離値をD0、
8近傍の距離値をDi(i=1〜8)とするとAn example of measuring the width of the pattern using the core wire and the distance image thus obtained will be described with reference to FIG. In order to obtain the width W of the pattern, the distance image is referred to at the skeleton position, and the distance value of the 3 × 3 window is used to perform the calculation according to (Equation 13). The distance value of the pixel of interest is D0,
If the distance value of 8 neighborhoods is Di (i = 1 to 8)
【0046】[0046]
【数13】 [Equation 13]
【0047】ただし[j]intは、jの切捨てによる整
数化を示す。例えば図12の55の位置ではW=9とな
り、55の位置を中心とするパターンに内接する円56
の直径を測定することができ、本処理を回路パターンの
検査に適用すると、基準の幅との比較により、線細りな
どの欠陥検出が可能となる。However, [j] int indicates an integer by truncating j. For example, W = 9 at the position 55 in FIG. 12, and a circle 56 inscribed in the pattern centered at the position 55 is shown.
The diameter can be measured, and if this process is applied to the inspection of the circuit pattern, it becomes possible to detect defects such as line thinning by comparison with the reference width.
【0048】以下、上記細線化を高速に処理するハード
ウェア構成例について、図面を参照しながら説明する。
図13、図14は本発明における細線化処理装置のハー
ドウェア構成図で、図13は細線化処理装置のブロック
構成図、図14は図13における1つの細線化処理ブロ
ックの回路構成図である。図13において401と40
5はそれぞれ入力と出力の画像メモリ、406と407
は距離画像メモリ、402〜404は第1から第nの細
線化手段である。同図において画像メモリ401には細
線化すべき2値パターンが格納されており、距離画像メ
モリ406には背景を”00”、パターンを”01”と
する距離画像が格納されているものとする。本構成にお
いて図2の実施例と異なるのは、n回の細線化処理を実
現するために、1回の細線化処理をn段カスケード接続
し、図2におけるエッジ情報記憶用メモリ206と20
7及び補助メモリ208の記憶容量の軽減を図った点で
ある。図14に1段の細線化処理における具体的処理の
構成を示す。図14において、502は第1の周辺点検
出手段、503は第2の周辺点検出手段、504は第1
の消去判定手段、505は第2の消去判定手段、506
は周辺点補正手段、507は距離変換手段で、以上は図
1に示した処理構成と同様なものである。図14に示す
回路構成の特徴は、画像の走査方法を1方向のラスタ走
査とし、前記502、503、504、505の処理で
使用する3×3近傍のデータを得るために3×3走査窓
We、Wb、Wf、Wk、Ws、Whを設け、各窓走査
に必要な2ラインのバッファを接続することによりパイ
プライン処理を行う点である。図14において508は
周辺点検出用記憶手段、509は第1の周辺点記憶手
段、510は第1の消去判定用記憶手段、511は第2
の周辺点記憶手段、512は消去判定用記憶手段、51
3は周辺点補正用記憶手段で、それぞれラインメモリを
用いて構成するものである。ラインメモリとシフトレジ
スタ用いた窓走査は一般的な技術であるので信号処理の
詳細な説明は省略し、図14の回路構成におけるデータ
処理の動作に関して以下に説明する。インプットポート
501からの画像データは走査窓Weの最新位置に書き
込み、以後周辺点検出用記憶手段508に記憶される。
第1の周辺点検出手段502と第2の周辺点検出手段5
03は、走査窓Weからの3×3近傍データ520を参
照し、それぞれエッジデータ521と522を出力す
る。エッジデータ521は走査窓Wbの最新位置に読み
込まれ、以後第1の周辺点記憶手段509に記憶され
る。またエッジデータ522は走査窓Whの最新位置に
書き込み、以後周辺点補正用記憶手段513に記憶され
る。次に第1の消去判定手段504は、走査窓Wbから
のエッジデータ523と走査窓Wfからの画像データ5
24を参照し、第1サイクルの消去判定を行い、判定結
果のデータ526を走査窓Wsの最新位置に書き込み、
以後第2の消去判定用記憶手段512に記憶させる。周
辺点補正手段506は、走査窓Whからのエッジデータ
525と走査窓Wfからの画像データ524を参照し、
周辺点補正の判定を行い、判定結果のデータ527を走
査窓Wkの最新位置に書き込み、以後第2の周辺点記憶
手段511に記憶させる。さらに第2の消去判定手段5
05は、走査窓Wkからのエッジデータ528と走査窓
Wsからの画像データ529を参照し、第2サイクルの
消去判定を行い、判定結果のデータをアウトプットポー
ト541から出力する。距離変換手段507は、インプ
ットポート540からの距離データと周辺点補正手段5
06からのエッジデータ526を参照し、パターンの内
部点に対し距離値の更新を行い、アウトプットポート5
41から出力する。An example of a hardware configuration for processing the above thinning at high speed will be described below with reference to the drawings.
13 and 14 are hardware configuration diagrams of the thinning processing apparatus according to the present invention, FIG. 13 is a block configuration diagram of the thinning processing apparatus, and FIG. 14 is a circuit configuration diagram of one thinning processing block in FIG. . In FIG. 13, 401 and 40
5 is an input and output image memory, 406 and 407, respectively.
Is a range image memory, and 402 to 404 are first to n-th thinning means. In the figure, it is assumed that the image memory 401 stores a binary pattern to be thinned, and the distance image memory 406 stores a distance image having a background of "00" and a pattern of "01". The present configuration differs from the embodiment of FIG. 2 in that in order to realize the thinning processing n times, one thinning processing is cascaded in n stages, and the edge information storage memories 206 and 20 in FIG.
7 and the storage capacity of the auxiliary memory 208 are reduced. FIG. 14 shows the configuration of a specific process in the one-step thinning process. In FIG. 14, 502 is a first peripheral point detecting means, 503 is a second peripheral point detecting means, and 504 is a first peripheral point detecting means.
Erasing determination means 505, second erasing determination means 506
Is a peripheral point correction means, and 507 is a distance conversion means. The above is the same as the processing configuration shown in FIG. The circuit configuration shown in FIG. 14 is characterized in that the image scanning method is one-way raster scanning, and a 3 × 3 scanning window is used to obtain data in the vicinity of 3 × 3 used in the processing of 502, 503, 504, and 505. The point is that pipeline processing is performed by providing We, Wb, Wf, Wk, Ws, and Wh, and connecting a 2-line buffer required for each window scan. In FIG. 14, 508 is a peripheral point detection storage means, 509 is a first peripheral point storage means, 510 is a first erasure determination storage means, and 511 is a second.
Peripheral point storage means 512, erase determination storage means 51,
3 is a peripheral point correction storage means, each of which is configured by using a line memory. Since window scanning using a line memory and a shift register is a general technique, detailed description of signal processing will be omitted, and the data processing operation in the circuit configuration of FIG. 14 will be described below. The image data from the input port 501 is written in the latest position of the scanning window We, and thereafter stored in the peripheral point detection storage means 508.
First peripheral point detecting means 502 and second peripheral point detecting means 5
Reference numeral 03 refers to the 3 × 3 neighborhood data 520 from the scanning window We and outputs edge data 521 and 522, respectively. The edge data 521 is read into the latest position of the scanning window Wb, and thereafter stored in the first peripheral point storage means 509. The edge data 522 is written in the latest position of the scanning window Wh, and thereafter stored in the peripheral point correction storage means 513. Next, the first erasure determination means 504 determines the edge data 523 from the scanning window Wb and the image data 5 from the scanning window Wf.
24, the erase determination of the first cycle is performed, the determination result data 526 is written in the latest position of the scanning window Ws,
After that, it is stored in the second erasure determination storage means 512. The peripheral point correction means 506 refers to the edge data 525 from the scanning window Wh and the image data 524 from the scanning window Wf,
The determination of the peripheral point correction is performed, the determination result data 527 is written in the latest position of the scanning window Wk, and thereafter stored in the second peripheral point storage unit 511. Further, the second erasure determination means 5
Reference numeral 05 refers to the edge data 528 from the scan window Wk and the image data 529 from the scan window Ws, performs the erase determination in the second cycle, and outputs the determination result data from the output port 541. The distance conversion means 507 is the distance data from the input port 540 and the peripheral point correction means 5.
The edge value 526 from 06 is referred to, the distance value is updated with respect to the internal point of the pattern, and the output port 5
Output from 41.
【0049】以上一連の処理動作は図示しない画素クロ
ックに同期して行われるものとする。図14に示した処
理ブロックをn段カスケード接続することにより、n回
の細線化処理の高速化とデータの記憶容量の軽減を図る
ことができる。The above series of processing operations are performed in synchronization with a pixel clock (not shown). By connecting the processing blocks shown in FIG. 14 in an n-stage cascade connection, it is possible to speed up the thinning process n times and reduce the data storage capacity.
【0050】[0050]
【発明の効果】以上のように本発明は、第1の周辺点検
出手段で検出されたエッジ位置に対し、第1の消去判定
手段により予めパターン境界部の微小な凹凸を除去し、
第2の周辺点検出手段で細線化の順番によって4連結エ
ッジと8連結エッジを制御して検出し、さらに周辺点補
正手段により所定の細線化の順番で前記4連結または8
連結エッジ位置を補正し、第2の消去判定手段において
消去する位置を制御するため、パターンのいずれの方向
にも背景から等距離で細めることができ、距離変換手段
を設けてパターンの内部点の距離値を更新することによ
り、芯線を得ると同時に背景までの最短距離値を有する
距離画像を得ることができる。As described above, according to the present invention, the first erasure determining means removes minute unevenness in the pattern boundary portion in advance from the edge position detected by the first peripheral point detecting means,
The second peripheral point detecting means controls and detects the 4-connected edge and the 8-connected edge according to the order of thinning, and further the peripheral point correcting means detects the 4 connected or 8 in the predetermined thinning order.
Since the connection edge position is corrected and the erasing position is controlled by the second erasing determination means, it is possible to make the distance equal to the background in any direction of the pattern. By updating the distance value, it is possible to obtain the core line and at the same time obtain the distance image having the shortest distance value to the background.
【図1】本発明の一実施例における細線化処理装置のブ
ロック結線図FIG. 1 is a block connection diagram of a thinning processing apparatus according to an embodiment of the present invention.
【図2】本発明の一実施例におけるCPUによる細線化
処理装置のブロック結線図FIG. 2 is a block connection diagram of a thinning processing device using a CPU according to an embodiment of the present invention.
【図3】同細線化処理装置の動作フローチャートFIG. 3 is an operation flowchart of the thinning processing apparatus.
【図4】同細線化処理装置の動作フローチャートFIG. 4 is an operation flowchart of the thinning processing apparatus.
【図5】同細線化処理装置による3×3近傍の画素配置
を示す図FIG. 5 is a diagram showing a pixel arrangement in the vicinity of 3 × 3 by the thinning processing apparatus.
【図6】同細線化処理装置による周辺点補正における補
正条件を示す図FIG. 6 is a diagram showing correction conditions in peripheral point correction by the thinning processing apparatus.
【図7】同細線化装置による条件3における判定条件を
示す図FIG. 7 is a diagram showing a judgment condition in condition 3 by the thinning device.
【図8】同細線化装置による条件6における判定条件を
示す図FIG. 8 is a diagram showing a judgment condition in condition 6 by the thinning device.
【図9】同細線化装置による条件7における判定条件を
示す図FIG. 9 is a diagram showing a judgment condition in Condition 7 by the thinning device.
【図10】同細線化装置において境界部に凸凹のある2
値パターンを細線化した図FIG. 10 is a view showing an unevenness 2 at the boundary in the thinning device.
Value line thinned diagram
【図11】同細線化装置における距離変換による距離画
像を示した概念図FIG. 11 is a conceptual diagram showing a distance image by distance conversion in the thinning device.
【図12】同細線化装置による芯線と距離画像からパタ
ーン幅の測定法を示した概念図FIG. 12 is a conceptual diagram showing a method of measuring a pattern width from a core wire and a distance image by the thinning device.
【図13】本発明の他の実施例における細線化処理装置
のブロック結線図FIG. 13 is a block connection diagram of a thinning processing apparatus according to another embodiment of the present invention.
【図14】同細線化装置の1回の細線化処理ブロックの
回路図FIG. 14 is a circuit diagram of one thinning processing block of the thinning device.
【図15】従来の細線化処理による芯線を示した概念図FIG. 15 is a conceptual diagram showing a core wire by a conventional thinning process.
101 入力画像メモリ 102 第1の周辺点検出手段 103 第2の周辺点検出手段 104 第1の周辺点記憶手段 105 第1の消去判定手段 106 補助記憶手段 107 周辺点補正手段 108 第2の周辺点記憶手段 109 第2の消去判定手段 110 出力画像メモリ 111 距離変換手段 112 距離画像メモリ 201 CPU 202 ROM 203 主記憶 204 画像メモリ 205 画像メモリ 206 距離画像メモリ 207 エッジ情報記憶用メモリ 208 補正エッジ情報記憶用メモリ 209 補助メモリ 402 第1の細線化手段 403 第2の細線化手段 404 第nの細線化手段 501 インプットポート 508 周辺点検出用記憶手段 509 第1の周辺点記憶手段 510 第1の消去判定用記憶手段 511 第2の周辺点記憶手段 512 第2の消去判定用記憶手段 513 周辺点補正用記憶手段 550 遅延メモリ 101 Input Image Memory 102 First Peripheral Point Detection Means 103 Second Peripheral Point Detection Means 104 First Peripheral Point Storage Means 105 First Erasure Determination Means 106 Auxiliary Storage Means 107 Peripheral Point Correction Means 108 Second Peripheral Points Storage unit 109 Second erasure determination unit 110 Output image memory 111 Distance conversion unit 112 Distance image memory 201 CPU 202 ROM 203 Main memory 204 Image memory 205 Image memory 206 Distance image memory 207 Edge information storage memory 208 Corrected edge information storage Memory 209 Auxiliary memory 402 First thinning means 403 Second thinning means 404 nth thinning means 501 Input port 508 Peripheral point detection storage means 509 First peripheral point storage means 510 For first erasure determination Storage means 511 Second peripheral point storage means 512 second erasure determination storage means 513 peripheral point correction storage means 550 delay memory
Claims (1)
ずつ細める処理を繰り返し、1画素幅のパターンに変換
する細線化処理装置において、入力画像の8連結エッジ
を検出する第1の周辺点検出手段と、予め定められた順
序で入力画像の4連結または8連結エッジを検出する第
2の周辺点検出手段と、前記第1及び第2の周辺点検出
手段からの2ビットのエッジ情報を記憶する第1の周辺
点記憶手段と、入力画像と前記第1の周辺点記憶手段に
より検出されたエッジ情報を参照し、エッジ位置の画素
のうち8近傍の画素の値の総和が2以上かつ4近傍の画
素の値の総和が2以下の画素を第1の注目画素として選
択し、入力画像とエッジ画像の3×3近傍パターンが所
定の条件を満たすとき第1の注目画素を消去する第1の
消去判定手段と、入力画像と前記第2の周辺点検出手段
により検出されたエッジ情報を参照して所定の条件を満
たすとき、前記エッジ情報の所定のデータを書き換える
ことによりエッジ位置を補正する周辺点補正手段と、前
記第1の消去判定手段からの画像データを記憶する補助
記憶手段と、前記周辺点補正手段からの画像データを記
憶する第2の周辺点記憶手段と、前記補助記憶手段から
の画像データと前記第2の周辺点記憶手段に記憶された
エッジ情報を参照し、エッジ位置の画素のうち8近傍の
総和が2以上の画素を第2の注目画素として選択し、入
力画像とエッジ画像の3×3近傍パターンが所定の条件
を満たすとき第2の注目画素を消去する第2の消去判定
手段と、背景からの距離値をもつ距離画像を記憶する距
離画像メモリと、前記第2の周辺点記憶手段に記憶され
たエッジ情報と前記距離画像メモリからの距離値Dを参
照して所定の条件を満たすとき、距離値DをD+1に更
新して再び前記距離画像メモリに書き込む距離変換手段
とを備えた細線化処理装置。1. A thinning processing device which repeats a process of thinning a binary pattern of 1s and 0s from the background side by one layer and converts the binary pattern into a pattern having a width of 1 pixel . Peripheral point detection means and a predetermined order
A second peripheral point detecting means for detecting a 4-connected or 8-connected edge incidentally input image, a first peripheral point memory for storing two bits of edge information from the first and second peripheral point detecting means Means, the input image and the edge information detected by the first peripheral point storage means are referred to, and among the pixels at the edge position, the sum of the values of the eight neighboring pixels is 2 or more and the sum of the four neighboring pixel values. There were selected <br/>-option 2 following pixel as a first target pixel, first erase 3 × 3 neighborhood pattern of the input image and the edge image to erase the first target pixel when the predetermined condition is satisfied The determination means, the input image, and the edge information detected by the second peripheral point detection means are referenced to satisfy a predetermined condition.
When adding, rewrite the specified data of the edge information
Thus, the peripheral point correction means for correcting the edge position, the auxiliary storage means for storing the image data from the first erasure determination means, and the second peripheral point storage for storing the image data from the peripheral point correction means Means, the image data from the auxiliary storage means, and the edge information stored in the second peripheral point storage means are referred to, and a pixel having a sum total of 2 or more in eight neighborhoods of pixels at the edge position is a second target. select a pixel, storing a second removal determination means 3 × 3 neighborhood pattern of the input image and the edge image to erase the second target pixel when a predetermined condition is satisfied, a distance image with distance values from the background The distance image memory, the edge information stored in the second peripheral point storage means, and the distance value D from the distance image memory.
When the predetermined condition is satisfied, the distance value D is updated to D + 1.
A thinning processing apparatus comprising a distance conversion unit that is newly written again in the distance image memory .
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP3346032A JPH07111737B2 (en) | 1991-12-27 | 1991-12-27 | Thinning device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP3346032A JPH07111737B2 (en) | 1991-12-27 | 1991-12-27 | Thinning device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH0620041A JPH0620041A (en) | 1994-01-28 |
| JPH07111737B2 true JPH07111737B2 (en) | 1995-11-29 |
Family
ID=18380677
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP3346032A Expired - Fee Related JPH07111737B2 (en) | 1991-12-27 | 1991-12-27 | Thinning device |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH07111737B2 (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP3211676B2 (en) | 1996-08-27 | 2001-09-25 | 日本電気株式会社 | Image processing method and apparatus |
| JP7850454B2 (en) * | 2023-11-30 | 2026-04-23 | 学校法人 名城大学 | Method for detecting the center line |
-
1991
- 1991-12-27 JP JP3346032A patent/JPH07111737B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JPH0620041A (en) | 1994-01-28 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US5046109A (en) | Pattern inspection apparatus | |
| US7212672B2 (en) | Image processing apparatus and image processing method | |
| KR20140094541A (en) | Edge tracing with hysteresis thresholding | |
| JP2003057019A (en) | Pattern inspection device and inspection method using the same | |
| JPS6357831B2 (en) | ||
| CN116503382A (en) | Method and system for detecting scratch defects of display screen | |
| US5220647A (en) | Image processing method | |
| JP2810660B2 (en) | Particle image analyzer | |
| JPH07111737B2 (en) | Thinning device | |
| JP2981434B2 (en) | Pattern defect detection method and apparatus | |
| JPH07111736B2 (en) | Thinning device | |
| JP2815263B2 (en) | Fine line image shaping method | |
| JPH0364909B2 (en) | ||
| JPH0332723B2 (en) | ||
| JP3003925B2 (en) | Defect inspection equipment | |
| KR100295245B1 (en) | A parallel thinning method using weighted value | |
| JPH0812697B2 (en) | Pattern defect inspection system | |
| JP3147469B2 (en) | Image processing device | |
| JPH10312460A (en) | Image processing method and high-precision image processing device | |
| JP2522511B2 (en) | Image contour tracking unit | |
| JPH04205271A (en) | Optimal binarization threshold determination method | |
| JPH0762795B2 (en) | Image extractor | |
| JP2617135B2 (en) | Labeling device for connected areas | |
| CN119360287A (en) | Astronomical image star detection and sub-pixel centering method and system based on FPGA | |
| JPH1031738A (en) | Grayscale image data storage / readout method, grayscale image data binarization method, and grayscale image data processing apparatus |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| LAPS | Cancellation because of no payment of annual fees |