JPH07111736B2 - Thinning device - Google Patents
Thinning deviceInfo
- Publication number
- JPH07111736B2 JPH07111736B2 JP4949791A JP4949791A JPH07111736B2 JP H07111736 B2 JPH07111736 B2 JP H07111736B2 JP 4949791 A JP4949791 A JP 4949791A JP 4949791 A JP4949791 A JP 4949791A JP H07111736 B2 JPH07111736 B2 JP H07111736B2
- Authority
- JP
- Japan
- Prior art keywords
- pixel
- peripheral point
- edge
- pixels
- thinning
- 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)
Description
【0001】[0001]
【産業上の利用分野】本発明は文字、図面、指紋等の認
識あるいは回路パターンの欠陥検査等のように2値パタ
ーンの認識を行う際の前処理として、パターンを背景側
から1層ずつ削りとり、1画素幅まで細めるための細線
化処理装置に関するものである。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention scrapes a pattern from the background side one layer at a time as a pre-processing for recognizing a binary pattern such as recognition of characters, drawings, fingerprints or defect inspection of a circuit pattern. The present invention relates to a thinning processing device for narrowing the width to one pixel.
【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]
【発明が解決しようとする課題】しかしながら上記の方
法は、パターン周辺のわずかな凹凸でも不要な芯線が残
る場合がある。図11はその一例を示しており、パター
ンの角に微小な突起がある場合にその方向に芯線が残る
ことを示している。ただし図11において画素についた
番号は、細線化により消去された順番を示しており、●
が芯線を構成する画素であることを示す。図11におい
て不要な芯線が残る原因は、画素121及び122が各
々1回目及び2回目の処理において(数1)の条件を満
足せず、消去可能な周辺点として選択されないためであ
り、パターン周辺のノイズの影響を受けて、不要な芯線
が残りやすいという課題を有していた。However, in the above method, an unwanted core wire may remain even if slight irregularities around the pattern are left. FIG. 11 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. 11 indicate the order in which the pixels are erased by thinning.
Indicates that they are pixels forming the core line. The reason why the unnecessary core line remains in FIG. 11 is that the pixels 121 and 122 do not satisfy the condition of (Equation 1) in the first and second processes, respectively, and are not selected as erasable peripheral points. There is a problem that unnecessary core wires are likely to remain under the influence of the noise of.
【0010】本発明は上記従来技術の課題を解決するも
ので、1層の細線化の消去サイクルの軽減を図りつつ、
パターン周辺のノイズの影響を受けにくく、かつ等方性
や安定性を満足する良質の芯線を抽出する細線化処理装
置を提供することを目的とする。The present invention solves the above-mentioned problems of the prior art by reducing the erase cycle for thinning one layer,
It is an object of the present invention to provide a thinning processing apparatus that extracts a high-quality core wire that is less susceptible to noise around the pattern and that satisfies isotropicity and stability.
【0011】[0011]
【課題を解決するための手段】この目的を達成するため
に本発明は、入力パターンの8連結エッジを検出する第
1の周辺点検出手段と、入力パターンの4連結エッジま
たは8連結エッジを検出する第2の周辺点検出手段と、
前記第1の周辺点検出手段からのエッジ情報を参照し、
エッジ位置の画素のうち8近傍の画素の値の総和が2以
上かつ4近傍の画素の値の総和が2以下の画素を第1の
注目画素として選択し、3×3近傍のパターンが所定の
条件を満たすとき第1の注目画素を消去する第1の消去
判定手段と、前記第1の消去判定手段からの画像データ
に対し前記第2の周辺点検出手段によるエッジ情報を参
照し、エッジ位置の画素のうち8近傍の総和が2以上の
画素を第2の注目画素として選択し、3×3近傍のパタ
ーンが所定の条件を満たすとき第2の注目画素を消去す
る第2の消去判定手段とから構成したものであ。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 .
A first erasure determining unit that erases the first target pixel when the pattern of 3 × 3 neighborhood is selected as the target pixel and satisfies a predetermined condition; By referring to the edge information obtained by the two peripheral point detecting means, a pixel having a total of 2 or more in 8 neighborhoods is selected as a second pixel of interest among the pixels at the edge position, and a 3 × 3 neighborhood pattern satisfies a predetermined condition. And a second erasure determination means for erasing the second pixel of interest .
【0012】[0012]
【作用】本発明は上記構成において、第1の周辺点検出
手段により検出されたエッジ位置に対し、第1の消去判
定手段により8近傍の画素の総和が2以上かつ4近傍の
画素の総和が2以下の画素を選択し消去するため、予め
パターン周辺の凹凸を構成する画素が除去され、第2の
消去判定手段においては第2の周辺点検出手段により検
出されたエッジ位置に対し8近傍の画素の総和が2以上
の消去可能な画素を全て消去し、第1の消去判定手段で
削り残したエッジ位置を消去するため、パターンの周辺
のノイズの影響を受けることなく均一に細線化を行うこ
とができる。また前記第2の周辺点検出手段において、
検出すべき周辺点としてパターンの4連結エッジまたは
8連結エッジのいずれかを、細線化の繰り返し毎に所定
の順序にしたがって切り替えて検出するため、パターン
を水平・垂直方向と斜め方向ともに均等に細めることが
でき、方向性のない芯線を得ることができる。According to the present invention, in the above-mentioned structure, the sum of the pixels in the vicinity of 8 is 2 or more and the sum of the pixels in the vicinity of 4 is determined by the first erasure judging means with respect to the edge position detected by the first peripheral point detecting means. In order to select and erase not more than 2 pixels, the pixels that form the irregularities around the pattern are removed in advance, and in the second erasure determination means, the neighborhood of 8 with respect to the edge position detected by the second peripheral point detection means. All the erasable pixels having a total pixel count of 2 or more are erased, and the edge positions left uncut by the first erasure determination means are erased, so that thinning is performed uniformly without being affected by noise around the pattern. be able to. In the second peripheral point detecting means,
As the peripheral points to be detected, either the 4-connected edge or the 8-connected edge of the pattern is switched and detected in accordance with a predetermined order each time the thinning is repeated, so that the pattern is thinned equally in the horizontal / vertical direction and the diagonal direction. It is possible to obtain a core wire having no directivity.
【0013】[0013]
【実施例】(実施例1)以下、本発明の第1の実施例に
ついて、図面を参照しながら説明する。(Embodiment 1) A first 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からのエッジ情報を記憶する周辺点
記憶手段、105は画像メモリ101からの2値画像と
周辺点記憶手段104からの第1の周辺点検出手段10
2により検出されたエッジ情報とを参照し、前記エッジ
位置の画素のうち8近傍の画素の値の総和が2以上かつ
4近傍の画素の値の総和が2以下の画素を選択し、3×
3近傍のパターンが所定の条件を満たすとき注目画素を
消去する第1の消去判定手段、106は第1の消去判定
手段からの2値画像を記憶する補助記憶手段、107は
補助記憶手段106からの2値画像と周辺点記憶手段1
04からの第2の周辺点検出手段103により検出され
たエッジ情報とを参照し、前記エッジ位置の画素のうち
8近傍の画素の値の総和が2以上の画素を選択し、3×
3近傍のパターンが所定の条件を満たすとき注目画素を
消去する第2の消去判定手段、108は第2の消去判定
手段107からの2値画像を記憶する画像メモリであ
る。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 denotes a peripheral point storage unit that stores the edge information from the first and second peripheral point detection units 102 and 103, and 105 denotes a binary image from the image memory 101 and a first peripheral inspection from the peripheral point storage unit 104. Output means 10
With reference to the edge information detected by 2, the pixel whose sum of the values of the pixels in the neighborhood of 8 is 2 or more and the sum of the values of the pixels in the neighborhood of 4 is 2 or less is selected, and 3 ×
First erasure determination means for erasing the pixel of interest when patterns in the vicinity of three satisfy a predetermined condition, 106 is auxiliary storage means for storing the binary image from the first erasure determination means, 107 is auxiliary storage means 106. Binary image and peripheral point storage means 1
04, the edge information detected by the second peripheral point detection means 103 is referred to, and a pixel whose sum of the values of the eight neighboring pixels is 2 or more is selected, and 3 ×
A second erasure determination means for erasing the pixel of interest when the patterns in the vicinity of 3 satisfy a predetermined condition, and 108 is an image memory for storing the binary image from the second erasure determination means 107.
【0015】図2は上記細線化処理を繰り返しパターン
を1画素幅まで細めるCPUによる細線化処理装置の構
成図である。図2において、202は前記第1及び第2
の周辺点検出と、前記第1及び第2の消去判定における
3×3近傍画素の演算を含む細線化プロセスの制御プロ
グラムが格納されているROM、203は前記プログラ
ムがロードされる主記憶、201は前記主記憶203上
のプログラムを実行するCPU、204及び205は細
線化処理における入出力の2値画像を記憶する画像メモ
リ、206は前記第1及び第2の周辺点検出によって検
出された入力画像のエッジ情報を記憶するエッジ情報記
憶用メモリ、207は、前記第1の消去判定による出力
画像を記憶する補助メモリである。以下図2のCPUシ
ステムにおける細線化処理の動作を簡単に説明する。C
PU201は図1の画像メモリ101に相当する入力画
像が格納されている画像メモリ204から画像データを
読み込み、前記第1及び第2の周辺点検出手段102及
び103における演算を行い、演算結果をエッジ情報記
憶用メモリ206に格納する。次に画像メモリ204と
エッジ情報記憶用メモリ206から同時に同じ位置の画
像データを読み込み、前記第1の消去判定手段105に
おける消去判定演算を行い、演算結果を補助メモリ20
7に格納する。さらにエッジ情報記憶メモリ206と補
助メモリ207からの画像データを読み込み、前記第2
の消去判定手段における消去判定演算を行い、演算結果
を図1の画像メモリ108に相当する画像メモリ205
に格納する。以上の動作で画像メモリ204の2値パタ
ーンが背景側から1層細められ、画像メモリ205に格
納される。2回目の細線化は画像メモリ205の2値画
像に対して行い、上記手順を経てさらに1層細めた2値
画像を画像メモリ204に格納する。以降同様にn回目
の細線化は(n−1)回の細線化画像に対して行い、パ
ターンが1画素幅になるまで反復処理を行いパターンの
芯線を抽出する。FIG. 2 is a block diagram of a thinning processing device using a CPU that repeats the above thinning processing to narrow the pattern to one pixel width. In FIG. 2, 202 is the first and second
, A ROM storing a control program for a thinning process including the peripheral point detection and the operation of 3 × 3 neighboring pixels in the first and second erasure determinations, 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 205 are image memories for storing input and output binary images in the thinning process, and 206 is an input detected by the first and second peripheral point detection. An edge information storage memory that stores image edge information, and an auxiliary memory 207 that stores an output image according to the first erasure determination. The operation of the thinning process in the CPU system of FIG. 2 will be briefly described below. C
The PU 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. The data is stored in the information storage memory 206. Next, the image data at the same position is read from the image memory 204 and the edge information storage memory 206 at the same time, the erasure judgment calculation is performed by the first erasure judgment means 105, and the calculation result is stored in the auxiliary memory 20.
Store in 7. Further, the image data from the edge information storage memory 206 and the auxiliary memory 207 is read, and the second data is read.
The erasure determination means performs the erase determination calculation, and the calculation result is the image memory 205 corresponding to the image memory 108 in FIG.
To store. By the above operation, the binary pattern of the image memory 204 is thinned by one layer from the background side and stored in the image memory 205. 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 core line of the pattern is extracted by repeating the process until the pattern has a width of one 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縮
めることに相当するので、斜め45°方向に細める距離
と上下左右方向から細める距離を均等にするためには、
斜め45°方向において芯線との距離が等しいの画素の
連結状態と、毎回の細め処理で消滅させるエッジの連結
状態を一致させればよいわけであり、そのように考える
と毎回の細め処理で消去するエッジの連結状態が(表
1)のように決定される。 With respect to the thinning processing apparatus configured as described above, the specific thinning processing will be described with reference to the flowcharts shown in FIGS. In the figure, 301 is the second
This is a step of reading the peripheral point detection control table in which the connection of edges to be detected in the peripheral point detection 303 is 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 Here, the 4-connected edge is the pixel of interest
Contour line with at least one 0 in 8 neighborhoods
Then, the 8 connected edges are 4 neighborhoods on the top, bottom, left and right as seen from the pixel
There is at least one 0 in the contour line. That is,
The 8-connected edge is included in the 4-connected edge. Also, (table
The order of edge connection described in 1) is one layer by thinning.
When erasing one edge, 4 connected edges and 8 connected edges
Edge of the edge to be erased.
Equalized in all 8 directions by thinning
The purpose is to narrow it down. For example, with a series of thinning processing
When 4 connected edges are deleted every time, the target figure becomes
The slanted direction is made thinner than the up, down, left, and right directions.
If you delete 8 connected edges every time,
Is narrower in the vertical and horizontal directions than in the horizontal direction.
It Therefore, edge erasure is controlled in the order shown in (Table 1).
Then, thin it evenly in all directions, vertically and horizontally.
You can This is because one thinning process in thinning is
Reduce the distance between the outline of the figure and the core that remains as a result of the thinning processing by 1
Since it is equivalent to tilting, the distance to be slanted in the direction of 45 °
In order to make the distance from the top and bottom and the left and right directions even,
Pixels with the same distance from the core in the diagonal 45 ° direction
The connection state and the connection of the edge that disappears with each thinning process
You just have to match the states and think like that
And the connection state of the edges to be erased in each thinning process is (Table
It is determined as in 1).
【0017】[0017]
【表1】 [Table 1]
【0018】302は第1の周辺点を検出するプロセス
で、図5に示す3×3近傍の画素の値を用いて8連結エ
ッジを検出しエッジ位置にラベルeを与える。8連結エ
ッジは注目画素d0が1で上下左右の4近傍の画素に少
なくとも一つ0が存在すればよいので、(数5)に示す
論理式が真の場合、注目位置にラベルeを与え、偽の場
合0を与える。ただし・は論理積―は否定を示す。Reference numeral 302 denotes a process for detecting the first peripheral point, which is an 8-connected error using the values of pixels in the vicinity of 3 × 3 shown in FIG.
Edge is detected and a label e is given to the edge position. 8 connection d
In this case, the target pixel d0 is 1 and the number of pixels in
Since at least one 0 is required, if the logical expression shown in (Equation 5) is true, the label e is given to the target position, and if false, 0 is given. However, · is a logical product – indicates 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が与えられ
た画素位置は、後述する306における第1の消去判定
の対象となる画素であることを意味し、ラベルkが与え
られた画素位置は、後述する310における第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 erase determination in 306 described later.
And the label k
The determined pixel position is used for the second erasing in 310 described later.
It means that the pixel is a determination target.
【0021】[0021]
【数6】 [Equation 6]
【0022】以上の手続きを画像を走査し終わるまで継
続し、検出されたエッジ情報を図2のエッジ情報記憶用
メモリ206に出力する。また304において、その回
の細線化で消去した画素があったかどうかを示すフラグ
Fを消去判定を行う前に予めリセットしておく。次に3
05において前記エッジ情報記憶用メモリ206からの
エッジ画像を参照し、注目位置にエッジ情報としてラベ
ルeが与えられている場合306の処理を行い、ラベル
eが与えられていない場合次の画素を参照し再び305
の判定を行う。306は第1の周辺点として検出された
画素に対し、実際の消去を行うプロセスである。図2の
画像メモリ204とエッジ情報記憶用メモリ206か
ら、それぞれ注目画素の3×3近傍のデータを読み出し
消去判定を行う。306において、以下に示す条件1、
条件2及び条件3を用いて(数7)が真の場合注目画素
を消去する。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 206 of FIG. Further, at 304, the flag F indicating whether or not there is a pixel erased by the thinning of that time is reset in advance before performing the erase determination. Then 3
In 05, the edge image from the edge information storage memory 206 is referred to, the process of 306 is performed when the label e is provided as the edge information at the position of interest, and the next pixel is referred when the label e is not provided. 305 again
Is determined. 306 is a process of actually erasing the pixel detected as the first peripheral point. From the image memory 204 and the edge information storage memory 206 shown in FIG. 2, data in the vicinity of 3 × 3 of the pixel of interest is read out and an erase determination is performed. In 306, the following condition 1,
If (Equation 7) is true using Condition 2 and Condition 3, the pixel of interest is erased.
【0023】[0023]
【数7】 [Equation 7]
【0024】条件1は、302で検出したエッジ位置の
うち8近傍の総和が2以上かつ4近傍の総和が2以下の
画素を選択する条件で、前記画像メモリ204からのデ
ータについて(数8)に示す式の真偽を判定する。条件
1において8近傍の総和が2以上としたのは芯線の縮退
を防止するためで、例えば8近傍の総和が1以上という
条件に縮退を防止する新たな条件をつけ加えて表記する
ことも可能である。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). The truth of the expression shown in is judged. In condition 1, the reason why the sum total of 8 neighborhoods is 2 or more is to prevent the core wire from degenerating. For example, the condition that the sum total of 8 neighborhoods is 1 or more can be described by adding a new condition to prevent degeneracy. is there.
【0025】[0025]
【数8】 [Equation 8]
【0026】条件2は、パターンの連結性を保存するた
めの条件で、3×3領域において分岐のない位置を選択
するために、前記画像メモリ204からのデータについ
て(数9)に示す式の真偽を判定する。Condition 2 is a condition for preserving the connectivity of the pattern, and selects a position without branch in the 3 × 3 region.
In order to do so, the truth of the expression shown in (Equation 9) is judged for the data from the image memory 204.
【0027】[0027]
【数9】 [Equation 9]
【0028】ただし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 circumference of a figure with a value of 1 in a 3x3 area
It indicates the number of times the pixel d0 is reached, and naturally 4 connections
There may be different results in case of 8 and in case of 8 connection.
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.
【0029】[0029]
【数10】 [Equation 10]
【0030】条件3は、孤立した2×2画素のパターン
の消滅を防止する条件で、前記エッジ情報記憶用メモリ
206と前記画像メモリ204からのデータを参照し、
3×3近傍が図6(a)(b)のいずれかと一致するか
どうかの真偽判定を行う。なお図6においてラベルeの
位置は前記エッジ情報記憶用メモリ206からのデータ
を参照し、それ以外の位置は前記画像メモリ204から
のデータを参照するものとする。また空白は不定とす
る。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 206 and the image memory 204,
Whether or not the 3 × 3 neighborhood matches any of FIGS. 6A and 6B is determined. In FIG. 6, the position of the label e refers to the data from the edge information storage memory 206, and the other positions refer to the data from the image memory 204. Blanks are undefined.
【0031】307の判定では306で注目画素を消去
したかどうかを検出し、消去した場合308において消
去フラグFをセットする。以上の手続きを走査終了まで
継続し、処理結果を図2の補助メモリ207に格納す
る。以下第2の消去判定について説明する。309にお
いて前記エッジ情報記憶用メモリ206からのエッジ画
像を参照し、注目位置にエッジ情報としてラベルkが与
えられている場合310の処理を行い、ラベルkが与え
られていない場合次の画素を参照し再び309の判定を
行う。310において、以下に示す条件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 erasing flag F is set in 308. The above procedure is continued until the end of scanning, and the processing result is stored in the auxiliary memory 207 of FIG. The second erase determination will be described below. In 309, the edge image from the edge information storage memory 206 is referred to, the process of 310 is performed when the label k is provided as the edge information at the position of interest, and the next pixel is referred to when the label k is not provided. Then, the determination of 309 is performed again. In 310, if (Equation 11) is true using the following condition 4, condition 5, condition 6, and condition 7, the pixel of interest is erased.
【0032】[0032]
【数11】 [Equation 11]
【0033】条件4は、303で検出したエッジ位置の
うち8近傍の総和が2以上の画素を選択する条件で、前
記補助メモリ207からのデータについて(数12)に
示す式の真偽を判定する。条件4において8近傍の総和
が2以上としたのは芯線の縮退を防止するためで、例え
ば8近傍の総和が1以上という条件に縮退を防止する新
たな条件をつけ加えて表記することも可能である。Condition 4 is a condition for selecting a pixel whose sum total of 8 neighborhoods is 2 or more among the edge positions detected in 303, and judges the truth or falseness of the formula shown in (Equation 12) for the data from the auxiliary memory 207. To do. In condition 4, the sum total of 8 neighborhoods is set to 2 or more in order to prevent the core wire from degenerating. For example, the condition that the sum total of 8 neighborhoods is 1 or more can be described by adding a new condition to prevent degeneracy. is there.
【0034】[0034]
【数12】 [Equation 12]
【0035】条件5は、パターンの連結性を保存するた
めの条件で、3×3領域において分岐のない位置を選択
する。前記補助メモリ207のデータについて前記(数
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 207 is true or false in (Equation 9) is determined.
【0036】条件6は、2画素幅の線の消滅を防ぐ条件
であり、前記補助メモリ207及びエッジ情報記憶用メ
モリ206からのデータを参照し、3×3近傍が図7
(a)(b)に示すいずれかと一致するかどうかの真偽
判定を行う。なお図7においてラベルkの位置は前記エ
ッジ情報記憶用メモリ206からのデータを参照し、そ
れ以外の位置は前記補助メモリ207からのデータを参
照する事を示す。ここで図7(a)の条件は、横方向の
2画素幅の線のうち上側の線を選択する条件で、図7
(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 207 and the edge information storage memory 206, 3 × 3 neighborhood is shown in FIG.
(A) A true / false decision is made as to whether or not it matches any of the cases shown in (b). In FIG. 7, the position of the label k refers to the data from the edge information storage memory 206, and the other positions refer to the data from the auxiliary memory 207. Here, the condition of FIG. 7A is a condition for selecting the upper line of the lines having a width of 2 pixels in the horizontal direction.
The condition (b) is a condition for selecting the line on the left side of the lines having a width of 2 pixels in the vertical direction.
【0037】条件7は、斜め方向の2画素幅の線の縮退
を防止する条件であり、前記補助メモリ207及びエッ
ジ情報記憶用メモリ206からのデータを参照し、3×
3近傍が図8(a)(b)に示すいずれかと一致するか
どうかの真偽判定を行う。ただし図8においてX1とX
2のいずれかは1とする。The condition 7 is a condition for preventing the line of 2 pixels width in the diagonal direction from being degenerated, and the data from the auxiliary memory 207 and the memory 206 for storing edge information is referred to and 3 ×
True / False determination is performed as to whether or not the three neighborhoods match any of those shown in FIGS. However, in FIG. 8, X1 and X
Either 2 is 1.
【0038】311の判定では310で注目画素を消去
したかどうかを検出し、消去した場合308において消
去フラグFをセットする。以上の手続きを走査終了まで
継続し、処理結果を図2の画像メモリ205に格納す
る。313は細線化の終了条件をチェックするステップ
であり、消去フラグFが0の場合細線化を終了し、0で
ない場合、前記画像メモリ205の画像を入力として3
02のステップから再び細め処理を実行し、処理結果を
前記画像メモリ204へ格納する。すなわち細線化の反
復毎に入力画像として、メモリ204と205の画像を
交互に入力し、処理結果をもう一方の画像メモリに格納
し、画像が変化しなくなるまで処理を繰り返す。In the judgment of 311, it is detected in 310 whether or not the pixel of interest has been erased, and in the case of erasing, the erasing flag F is set in 308. The above procedure is continued until the end of scanning, and the processing result is stored in the image memory 205 of FIG. Reference numeral 313 is a step of checking the end condition of thinning. If the erasure flag F is 0, the thinning is finished, and if it is not 0, the image of the image memory 205 is input and 3
The thinning process is executed again from step 02, and the processing result is stored in the image memory 204. That is, the images in the memories 204 and 205 are alternately input as an input image for each repetition of thinning, the processing result is stored in the other image memory, and the process is repeated until the image does not change.
【0039】なお前記306のステップにおいて新たに
条件3’を設定し、消去条件を(数13)が真の場合と
すれば、細線化処理の結果パターン境界部の2×2画素
の突起は芯線として保存される。If the condition 3'is newly set in step 306 and the erasing condition (Equation 13) is true, the protrusion of 2 × 2 pixels at the pattern boundary portion as a result of the thinning process is the core line. Is saved as.
【0040】[0040]
【数13】 [Equation 13]
【0041】ここに条件3’は、前記エッジ情報記憶用
メモリ206と前記画像メモリ204からのデータを参
照し、3×3近傍が図9(a)(b)(c)(d)のい
ずれかと一致するかどうかを判定する条件である。なお
図9においてラベルeの位置は前記エッジ情報記憶用メ
モリ206からのデータを参照し、それ以外の位置は前
記画像メモリ204からのデータを参照するものとす
る。The condition 3'refers to the data from the memory 206 for storing edge information and the data from the image memory 204, and the neighborhood of 3 × 3 is one of FIGS. 9 (a) (b) (c) (d). This is a condition for determining whether or not they match. In FIG. 9, the position of the label e refers to the data from the edge information storage memory 206, and the other positions refer to the data from the image memory 204.
【0042】以上のように構成した細線化処理装置によ
り、境界部に凹凸のある2値パターンを細線化した例を
図10に示す。図10において画素についた番号は細め
処理により消去された順番を示している。さらに同図は
毎回の細め処理において、ラベルe及びkがどの位置に
与えられるかを示しており、ラベルeは図形に対し8連
結エッジの位置に与えられ、ラベルkは(表1)に定め
られた連結状態のエッジの位置に与えられる。(つま
り、1回目は4連結エッジ、2回目は8連結エッジ、3
回目は8連結エッジ、4回目は4連結エッジ・・・)図
3に示したように1回の細め処理は、まずステップ30
2及び303において消去する候補の画素位置にラベル
e及びkを与え、次にステップ306においてラベルe
が与えられている画素を注目位置として第1サイクルの
消去判定を行い、さらにステップ310においてラベル
kが与えられている画素を注目位置として第2サイクル
の消去判定を行う。図10において番号に○のついた画
素は、第1サイクルの消去判定で消去された画素であ
り、○のついていない画素は第2サイクルの消去判定で
消去された画素である事を示す。図10に示した図形の
場合、合計4回の細め処理により芯線(●の付いた画
素)が得られ、これ以上細め処理を繰り返しても、芯線
は変化しない。図10から明らかなように、本実施例に
よる細線化処理装置は境界部に凹凸のあるパターンに対
しても、その影響を受けることなく良質の芯線を抽出す
ることができる。図11に示すように、従来例において
画素121は1回目の細め処理の際、連結性保存の条件
(数2)により保存されるが、本実施例では画素92が
予め第1の消去判定で消去されるため、前記画素121
に対応する画素91は連結性保存条件(数9)に影響さ
れずに消去され、不要な芯線として残らない。なお連結
性保存の条件として前記(数9)と(数2)は等価な条
件であるが、2値画像を解析する際連結数が一般的に用
いられるので、本実施例では連結数を用いた表記とし
た。また図11に示すように、従来例では細め処理の進
行に伴い、パターンの8連結エッジが消去されていくた
め、斜め方向に対して水平・垂直方向が先に細められる
が、本実施例では図10に示すように前記周辺点検出制
御テーブル(表1)にしたがってエッジが消去されるた
め、方向性なく均等にパターンを細めることができる。FIG. 10 shows an example of thinning a binary pattern having irregularities at the boundary with 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 306 the label e
Is set as the pixel of interest in the first cycle
The erasure judgment is performed, and the label is added
The second cycle with the pixel for which k is given as the position of interest
The erasure judgment of In Figure 10, the image with a circle
A pixel is a pixel erased by the erase determination in the first cycle.
Pixels not marked with a circle are judged by the erase judgment 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. As shown in FIG. 11, in the conventional example, the pixel 121 is stored under the condition of the connectivity preservation (Equation 2) at the time of the first thinning processing. Since it is erased, the pixel 121
The pixel 91 corresponding to is erased without being affected by the connectivity preservation condition (Equation 9) and does not remain as an unnecessary core line. The equations (9) and (2) are equivalent conditions for preserving connectivity, but since the number of connections is generally used when analyzing a binary image, the number of connections is used in this embodiment. I used the notation. Further, as shown in FIG. 11, in the conventional example, the eight connected edges of the pattern are erased as the thinning process progresses, so that the horizontal and vertical directions are first thinned with respect to the diagonal direction. As shown in FIG. 10, the edge is erased according to the peripheral point detection control table (Table 1), so that the pattern can be thinned uniformly without directionality.
【0043】以上のように本実施例によれば、第1の周
辺点検出手段102で検出されたエッジ位置に対し、8
近傍の総和が2以上4近傍の総和が2以下の画素を選択
し消去判定を行う第1の消去判定手段105を設けるこ
とにより、予めパターン境界部の凹凸を構成する画素が
消去され、第2の消去判定手段107において、第2の
周辺点検出手段103で検出されたエッジ位置に対し、
8近傍の総和が2以上の画素が消去されるため、パター
ン境界部の凹凸に影響されることなく良質の芯線を抽出
できる。また前記第2の周辺点検出手段103におい
て、細線化の反復毎に検出する周辺点として、4連結エ
ッジと8連結エッジを所定の順序で検出することによ
り、パターンを斜め方向と縦横方向に均等に細めること
ができ、芯線をパターンのより中心にもってくることが
できる。As described above, according to the present embodiment, the edge position detected by the first peripheral point detecting means 102 is 8
By providing the first erasure determination unit 105 that selects pixels whose total sum of neighborhoods is 2 or more and 4 whose total sum of neighborhoods is 2 or less, the pixels forming the irregularities of the pattern boundary portion are erased in advance, and the second In the erasure determination means 107, the edge position detected by the second peripheral point detection means 103 is
Pixels having a total sum of 2 or more in the vicinity of 8 are erased, so that a good-quality core line can be extracted without being affected by the unevenness of the pattern boundary portion. The second peripheral point detecting means 103 detects 4 connected edges and 8 connected edges in a predetermined order as peripheral points to be detected each time the thinning is repeated, so that the pattern is evenly distributed in the diagonal and vertical and horizontal directions. The core wire can be centered in the pattern.
【0044】以下、上記細線化を高速に処理するハード
ウェア構成例について、図面を参照しながら説明する。
図12,図13は本発明における細線化処理装置のハー
ドウェア構成図で、図12は細線化処理装置のブロック
構成図、図13は図12における1つの細線化処理ブロ
ックの回路構成図である。図12において401と40
5はそれぞれ入力と出力の画像メモリ、402〜404
は第1から第nの細線化手段である。本構成において図
2の実施例と異なるのは、n回の細線化処理を実現する
ために、1回の細線化処理をn段カスケード接続し、図
2におけるエッジ情報記憶用メモリ206と補助メモリ
207の記憶容量の軽減を図った点である。図13に1
段の細線化処理における具体的処理の構成を示す。図1
3において、502は第1の周辺点検出手段、503は
第2の周辺点検出手段、504は第1の消去判定手段、
505は第2の消去判定手段で、以上は図1に示した処
理構成と同様なものである。図13に示す回路構成の特
徴は、画像の走査方法を1方向のラスタ走査とし、前記
502、503、504、505の処理で使用する3×
3近傍のデータを得るために3×3走査窓We、Wb、
Wf、Wk、Wsを設け、各窓走査に必要な2ラインの
バッファを接続することによりパイプライン処理を行う
点である。図13において508は周辺点検出用記憶手
段、509は第1の周辺点記憶手段、510は第1の消
去判定用記憶手段、511は第2の周辺点記憶手段、5
12は消去判定用記憶手段で、それぞれラインメモリを
用いて構成するものである。ラインメモリとシフトレジ
スタ用いた窓走査は一般的な技術であるので信号処理の
詳細な説明は省略し、図13の回路構成におけるデータ
処理の動作に関して以下に説明する。インプットポート
501からの画像データは走査窓Weの最新位置に読み
込まれ、以後周辺点検出用記憶手段508に記憶され
る。第1の周辺点検出手段502と第2の周辺点検出手
段503は、走査窓Weからの3×3近傍データ520
を参照し、それぞれエッジデータ521と522を出力
する。エッジデータ521は走査窓Wbの最新位置に読
み込まれ、以後第1の周辺点記憶手段509に記憶され
る。またエッジデータ522は遅延507により2ライ
ンの遅延をかけた後、走査窓Wkの最新位置に読み込ま
れ、以後第2の消去判定用記憶手段511に記憶され
る。次に第1の消去判定手段504は、走査窓Wbから
のエッジデータ523と走査窓Wfからの画像データ5
24を参照し、第1サイクルの消去判定を行い、判定結
果のデータ525を走査窓Wsの最新位置に書き込み、
以後第2の消去判定用記憶手段512に記憶させる。さ
らに第2の消去判定手段505は、走査窓Wkからのエ
ッジデータ526と走査窓Wsからの画像データ527
を参照し、第2サイクルの消去判定を行い、判定結果の
データ528をアウトプットポート506から出力す
る。以上一連の処理動作は図示しない画素クロックに同
期して行われるものとする。図13に示した処理ブロッ
クをn段カスケード接続することにより、n回の細線化
処理の高速化とデータの記憶容量の軽減を図ることがで
きる。An example of a hardware configuration for processing the above thinning at high speed will be described below with reference to the drawings.
12 and 13 are hardware configuration diagrams of the thinning processing apparatus according to the present invention, FIG. 12 is a block configuration diagram of the thinning processing apparatus, and FIG. 13 is a circuit configuration diagram of one thinning processing block in FIG. . In FIG. 12, 401 and 40
Reference numeral 5 denotes an input and output image memory, and 402 to 404.
Are first to nth thinning means. In this configuration, the difference from the embodiment of FIG. 2 is that, in order to realize thinning processing n times, one thinning processing is cascaded in n stages, and the edge information storage memory 206 and the auxiliary memory in FIG. This is a point to reduce the storage capacity of 207. 13 in FIG.
The structure of a specific process in the step thinning process is shown. Figure 1
3, 502 is a first peripheral point detecting means, 503 is a second peripheral point detecting means, 504 is a first erasing determination means,
Reference numeral 505 denotes a second erasing determination means, which has the same processing configuration as that shown in FIG. The circuit configuration shown in FIG. 13 is characterized in that the image scanning method is one-direction raster scanning, and 3 × used in the processing of 502, 503, 504, and 505.
3 × 3 scanning windows We, Wb,
The point is that pipeline processing is performed by providing Wf, Wk, and Ws, and connecting a 2-line buffer required for each window scan. In FIG. 13, 508 is a peripheral point detection storage means, 509 is a first peripheral point storage means, 510 is a first erasure determination storage means, 511 is a second peripheral point storage means, 5
Reference numeral 12 is an erasing determination 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 data processing operation in the circuit configuration of FIG. 13 will be described below. The image data from the input port 501 is read into the latest position of the scanning window We, and thereafter stored in the peripheral point detection storage means 508. The first peripheral point detecting means 502 and the second peripheral point detecting means 503 are 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. Further, the edge data 522 is delayed by two lines by the delay 507, read into the latest position of the scanning window Wk, and thereafter stored in the second erasure determination storage means 511. 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 525 is written in the latest position of the scanning window Ws,
After that, it is stored in the second erasure determination storage means 512. Further, the second erasure determination unit 505 uses the edge data 526 from the scanning window Wk and the image data 527 from the scanning window Ws.
The erasure judgment of the second cycle is carried out with reference to, and the judgment result data 528 is outputted from the output port 506. The above series of processing operations are performed in synchronization with a pixel clock (not shown). By connecting the processing blocks shown in FIG. 13 in an n-stage cascade connection, it is possible to speed up the thinning process n times and reduce the data storage capacity.
【0045】[0045]
【発明の効果】以上のように本発明は第1及び第2の周
辺点検出手段と第1及び第2の消去判定手段を設け、前
記第1の消去判定手段において前記第1の周辺点検出手
段で検出されたエッジ位置に対し、8近傍の総和が2以
上4近傍の総和が2以下の画素を選択し消去判定を行
い、予めパターン境界部の凹凸を構成する画素を消去
し、前記第2の消去判定手段において、前記第2の周辺
点検出手段で検出されたエッジ位置に対し、8近傍の総
和が2以上の画素を消去するため、パターン境界部の凹
凸に影響されることなく良質の芯線を抽出できる。また
前記第2の周辺点検出手段において、細線化の反復毎に
検出する周辺点として、4連結エッジと8連結エッジを
所定の順序で検出することにより、パターンを方向性な
く均等に細めることができ、芯線をパターンのより中心
にもってくることができる。As described above, the present invention is provided with the first and second peripheral point detecting means and the first and second erasing determining means, and the first erasing determining means detects the first peripheral point. With respect to the edge position detected by the means, a pixel having a sum total of 8 neighborhoods of 2 or more and a sum total of 4 neighborhoods of 2 or less is selected and an erasing determination is performed, and pixels forming unevenness of the pattern boundary are erased in advance, In the erasure determination means of No. 2, the pixels whose total sum of eight neighborhoods is two or more with respect to the edge position detected by the second peripheral point detection means are erased, so that it is not affected by the unevenness of the pattern boundary portion and is of good quality. The core line of can be extracted. Further, in the second peripheral point detecting means, by detecting 4 connected edges and 8 connected edges in a predetermined order as peripheral points to be detected at each repetition of thinning, the pattern can be thinned uniformly without directionality. Yes, you can bring the core to the center of the pattern.
【図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.
【図6】同装置による第1の消去判定における判定条件
を示す図FIG. 6 is a diagram showing a determination condition in a first erase determination by the device.
【図7】同装置による第2の消去判定における判定条件
を示す図FIG. 7 is a diagram showing a determination condition in a second erase determination by the device.
【図8】同装置による第2の消去判定における判定条件
を示す図FIG. 8 is a diagram showing a determination condition in a second erase determination by the device.
【図9】同装置による第1の消去判定における判定条件
を示す図FIG. 9 is a diagram showing a determination condition in a first erase determination by the device.
【図10】同装置における細線化処理による芯線を示し
た概念図FIG. 10 is a conceptual diagram showing a core wire by a thinning process in the same device.
【図11】従来の細線化処理による芯線を示した概念図FIG. 11 is a conceptual diagram showing a core wire by a conventional thinning process.
【図12】本発明の他の実施例における細線化処理装置
のブロック結線図FIG. 12 is a block connection diagram of a thinning processing apparatus according to another embodiment of the present invention.
【図13】同装置の1回の細線化処理ブロックの回路図FIG. 13 is a circuit diagram of a single thinning processing block of the device.
101 入力画像メモリ 102 第1の周辺点検出手段 103 第2の周辺点検出手段 104 周辺点記憶手段 105 第1の消去判定手段 106 補助記憶手段 107 第2の消去判定手段 108 出力画像メモリ 201 CPU 202 ROM 203 主記憶 206 エッジ情報記憶用メモリ 207 補助メモリ 402 第1の細線化手段 403 第2の細線化手段 404 第nの細線化手段 501 インプットポート 506 アウトプットポート 507 遅延メモリ 508 周辺点検出用記憶手段 509 第1の周辺点記憶手段 510 第1の消去判定用記憶手段 511 第2の周辺点記憶手段 512 第2の消去判定用記憶手段 101 Input Image Memory 102 First Peripheral Point Detection Means 103 Second Peripheral Point Detection Means 104 Peripheral Point Storage Means 105 First Erasure Determination Means 106 Auxiliary Storage Means 107 Second Erasure Determination Means 108 Output Image Memory 201 CPU 202 ROM 203 Main memory 206 Edge information storage memory 207 Auxiliary memory 402 First thinning means 403 Second thinning means 404 nth thinning means 501 Input port 506 Output port 507 Delay memory 508 Peripheral point detection memory Means 509 First peripheral point storage means 510 First erasure determination storage means 511 Second peripheral point storage means 512 Second erasure determination storage means
Claims (1)
ずつ細める細め処理を繰り返し、1画素幅のパターンに
変換する細線化処理装置において、入力画像の8連結エ
ッジを検出する第1の周辺点検出手段と、前記細め処理
の繰り返し毎に予め定められた順序で、入力画像の4連
結または8連結エッジを検出する第2の周辺点検出手段
と、前記第1及び第2の周辺点検出手段からのエッジ情
報を記憶する周辺点記憶手段と、前記入力画像と前記周
辺点記憶手段に記憶された前記第1の周辺点検出手段に
よるエッジ情報を参照し、エッジ位置の画素のうち8近
傍の画素の値の総和が2以上かつ4近傍の画素の値の総
和が2以下の画素を第1の注目画素として選択し、3×
3近傍のパターンが所定の条件を満たすとき前記第1の
注目画素を消去する第1の消去判定手段と、前記第1の
消去判定手段からの画像データを記憶する補助記憶手段
と、前記補助記憶手段からの画像データと前記周辺点記
憶手段に記憶された第2の周辺点検出手段によるエッジ
情報を参照し、エッジ位置の画素のうち8近傍の総和が
2以上の画素を第2の注目画素として選択し、3×3近
傍のパターンが所定の条件を満たすとき前記第2の注目
画素を消去する第2の消去判定手段とを備えた細線化処
理装置。1. A 1 and repeat one layer by make narrow narrowing process from the background side binary pattern of 0, the thinning processing apparatus for converting a pattern of one pixel width, the detecting 8-connected edge of the input image 1 Peripheral point detection means and the thinning processing
The second peripheral point detecting means for detecting 4-connected or 8-connected edges of the input image and the edge information from the first and second peripheral point detecting means are stored in a predetermined order for each repetition of By referring to the peripheral point storage means, the input image, and the edge information by the first peripheral point detection means stored in the peripheral point storage means, the sum of the values of the eight neighboring pixels among the pixels at the edge position is 2 A pixel whose sum of the values of the pixels above and in the vicinity of 4 is 2 or less is selected as the first pixel of interest , and 3 ×
When the patterns in the vicinity of 3 satisfy a predetermined condition, the first
The first erasure determination means for erasing the pixel of interest, the auxiliary storage means for storing the image data from the first erasure determination means, the image data from the auxiliary storage means and the peripheral point storage means are stored. By referring to the edge information by the second peripheral point detection means, a pixel having a total sum of 2 or more in 8 neighborhoods is selected as a second pixel of interest among the pixels at the edge position, and a pattern of 3 × 3 neighborhoods meets a predetermined condition. When meeting the second attention
A thinning processing apparatus comprising: a second erasing determination means for erasing pixels .
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP4949791A JPH07111736B2 (en) | 1991-03-14 | 1991-03-14 | Thinning device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP4949791A JPH07111736B2 (en) | 1991-03-14 | 1991-03-14 | Thinning device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH04284581A JPH04284581A (en) | 1992-10-09 |
| JPH07111736B2 true JPH07111736B2 (en) | 1995-11-29 |
Family
ID=12832783
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP4949791A Expired - Fee Related JPH07111736B2 (en) | 1991-03-14 | 1991-03-14 | Thinning device |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH07111736B2 (en) |
-
1991
- 1991-03-14 JP JP4949791A patent/JPH07111736B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JPH04284581A (en) | 1992-10-09 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US5373147A (en) | Apparatus and method for detecting line segment direction | |
| US7212672B2 (en) | Image processing apparatus and image processing method | |
| KR101655000B1 (en) | Edge tracing with hysteresis thresholding | |
| US5293433A (en) | Method and device for detecting patterns adapted automatically for the level of noise | |
| KR20020064897A (en) | Segmentation of digital images | |
| JP2981434B2 (en) | Pattern defect detection method and apparatus | |
| US6337926B2 (en) | Image recognition method, image recognition apparatus, and recording medium | |
| JPH07111736B2 (en) | Thinning device | |
| WO2021174506A1 (en) | Image edge detection method and apparatus, and image signal processor | |
| JPH07111737B2 (en) | Thinning device | |
| CN118587267A (en) | Image detection method, computer device and machine-readable storage medium | |
| JP2858530B2 (en) | Edge enhancement device | |
| JP2020201616A (en) | Image processing device, image processing program, and image processing method | |
| JPH0332723B2 (en) | ||
| JPH07200830A (en) | Defect checking device | |
| JPH04205271A (en) | Optimal binarization threshold determination method | |
| JP2522511B2 (en) | Image contour tracking unit | |
| JP3084726B2 (en) | Image processing area recognition device | |
| JP2025146078A (en) | Image processing device, image processing method, and program | |
| JP5505953B2 (en) | Image discrimination system, method and program | |
| JPH0812697B2 (en) | Pattern defect inspection system | |
| JPH0991426A (en) | Image processing method | |
| JP2800199B2 (en) | Image area identification device | |
| JP2004310292A (en) | Document image inspection method and apparatus, and program | |
| JPH09185718A (en) | Automatic pattern defect inspection system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| LAPS | Cancellation because of no payment of annual fees |