JPS6329304B2 - - Google Patents
Info
- Publication number
- JPS6329304B2 JPS6329304B2 JP59054236A JP5423684A JPS6329304B2 JP S6329304 B2 JPS6329304 B2 JP S6329304B2 JP 59054236 A JP59054236 A JP 59054236A JP 5423684 A JP5423684 A JP 5423684A JP S6329304 B2 JPS6329304 B2 JP S6329304B2
- Authority
- JP
- Japan
- Prior art keywords
- label
- section
- image
- edge
- information
- 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
Links
- 238000000034 method Methods 0.000 claims description 18
- 238000005192 partition Methods 0.000 claims description 10
- 230000001902 propagating effect Effects 0.000 claims description 4
- 230000000644 propagated effect Effects 0.000 description 10
- 238000010586 diagram Methods 0.000 description 8
- 238000001514 detection method Methods 0.000 description 7
- 230000002093 peripheral effect Effects 0.000 description 5
- 238000002372 labelling Methods 0.000 description 3
- 238000006243 chemical reaction Methods 0.000 description 2
- 230000001174 ascending effect Effects 0.000 description 1
- 210000000601 blood cell Anatomy 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 239000002245 particle Substances 0.000 description 1
Landscapes
- Image Processing (AREA)
- Image Analysis (AREA)
Description
【発明の詳細な説明】
〔発明の利用分野〕
本発明は雨滴像、粒子像、血球細胞像などを処
理対象とする画像処理装置に関する。DETAILED DESCRIPTION OF THE INVENTION [Field of Application of the Invention] The present invention relates to an image processing apparatus that processes raindrop images, particle images, blood cell images, and the like.
パターンが比較的稠密にある画像を、適当なし
きい値を用いて二値化し、パターン部Pとそれ以
外、即ち非パターン部に分けた場合を第1図に
示す。このような二値画像を処理する場合、パタ
ーン部Pは
1 画像の端にかかつている不完全な対象Q
2 複数個の対象Oi(object)
があり、また非パターン部には
1 対象Oiの外側すなわち背景B(back)
2 対象Oiに囲まれた領域、すなわち穴H(hole)
があり、これらの区別を行なう必要がある。例え
ば、二値化パターン(P、)から多値パターン
(O1、O2、O3、H、B)に変換する必要がある。
しかしながらこのような処理をラスタスキヤン方
式で行なう有効かつ簡便な方法はまだ提案されて
いない。
FIG. 1 shows a case where an image having a relatively dense pattern is binarized using an appropriate threshold value and divided into a pattern part P and the other part, that is, a non-pattern part. When processing such a binary image, the pattern part P has 1 incomplete object Q over the edge of the image 2 multiple objects O i (object), and the non-pattern part has 1 object O There is an area outside i , that is, background B (back) 2 and an area surrounded by object O i , that is, hole H, and it is necessary to distinguish between these. For example, it is necessary to convert a binary pattern (P,) to a multi-value pattern (O 1 , O 2 , O 3 , H, B).
However, an effective and simple method for performing such processing using a raster scan method has not yet been proposed.
本発明は、画像内の独立したパターンの全域に
同一のラベルを伝播する処理を高速に行ない得る
装置を提供することを目的とし、もつて前述した
二値画像の多値化などの処理に対して解決を与え
るものである。
SUMMARY OF THE INVENTION The present invention aims to provide a device that can rapidly propagate the same label over the entire area of independent patterns in an image, and is capable of processing such as multi-value conversion of a binary image as described above. It provides a solution.
本発明は隣接する画素に対し定められた伝播規
則に従つて逐次情報を伝播し、周辺に接する不完
全対象物の検出、対象物内の穴の検出、分離した
対象物に対するラベリングを行なう手段を提供す
るものである。
The present invention provides a means for sequentially propagating information to adjacent pixels according to a predetermined propagation rule, detecting incomplete objects in contact with the periphery, detecting holes in the object, and labeling separated objects. This is what we provide.
第2図は隣接した区画に情報を逐次伝播させる
原理を説明するための図である。まずマスク
(処理に関連する区画の範囲を示す)を左上から
順方向(スキヤン)に走査し、右、右下、下、
左下方向に情報を逐次伝播させる。この場合対象
とする区画M(i、j)に伝播される情報は例え
ば、区画M(i、j)および隣接区画M(i−1、
j−1)、M(i、j−1)、M(i+1、j−1)、
M(i−1、j)の5つの情報x、a、b、c、
dにより決定する。次にマスクを右下から逆方
向(スキヤン)に走査し、左、左上、上、右上
方向に情報を逐次伝播させ、対象区画(i、j)
に伝播させる情報を、例えば区画M(i、j)お
よび隣接区画M(i+1、j+1)、M(i、j+
1)、M(i−1、j+1)、M(i+1、j)の5
つの情報x′、a′、b′、c′、d′により決定する。こ
れら順方向及び逆方向の2回の処理により、任意
の区画M(i、j)の情報を隣接する8区画(i
−1、j−1)、M(i、j−1)、M(i+1、j
−1)、M(i−1、j)、M(i+1、j)、M(i
−1、j+1)、M(i、j+1)、M(i+1、j
+1)に柔盾なく逐次伝播することができる。さ
らに対象が複雑な形状の場合これらの操作を、伝
播情報と対象区画の伝播処理前の情報(xまたは
x′)自身が全域で同一となるまで繰り返すことに
より矛盾をすべてなくすことができる。 FIG. 2 is a diagram for explaining the principle of sequentially propagating information to adjacent sections. First, scan the mask (indicating the range of sections related to processing) from the top left, right, bottom right, bottom,
The information is successively propagated in the lower left direction. In this case, the information propagated to the target partition M (i, j) is, for example, the information propagated to the partition M (i, j) and the adjacent partition M (i-1,
j-1), M(i, j-1), M(i+1, j-1),
Five pieces of information x, a, b, c, M(i-1, j)
Determined by d. Next, the mask is scanned in the reverse direction (scan) from the lower right, and information is sequentially propagated in the left, upper left, upper, and upper right directions, and the target section (i, j) is
For example, the information to be propagated to the partition M(i, j) and the adjacent partitions M(i+1, j+1), M(i, j+
1), M(i-1, j+1), M(i+1, j) 5
It is determined based on the following information x′, a′, b′, c′, and d′. By performing these two processes in the forward and reverse directions, the information of any partition M(i,
−1, j−1), M(i, j−1), M(i+1, j
-1), M(i-1, j), M(i+1, j), M(i
-1, j+1), M(i, j+1), M(i+1, j
+1) can be propagated sequentially without any flexibility. Furthermore, when the target has a complex shape, these operations are performed using the propagation information and the information before propagation processing of the target section (x or
x') can eliminate all contradictions by repeating it until it becomes the same over the entire area.
なお、本発明に類似する公知例としては特開昭
50−68039号公報を挙げることができる。これは、
異なるしきい値により二値化した2つの二値化パ
ターンを用い、この2つの二値化パターンで情報
の異なる区画、すなわち中間濃度の区画について
隣接する区画の情報を用いて改めて情報の二値化
を行なうに当り、順方向のスキヤンと逆方向のス
キヤンを順次行なうものである。 In addition, as a publicly known example similar to the present invention, JP-A-Sho
No. 50-68039 can be mentioned. this is,
Using two binarization patterns that are binarized using different thresholds, the two binarization patterns are used to re-binary information using information from adjacent sections for different sections of information, that is, sections of intermediate density. In performing the conversion, a forward scan and a reverse scan are performed sequentially.
第3図は対象物が二つある二値画像に対するラ
ベル伝播の過程及び結果の一例を示す図である。
まず順方向のスキヤンにおいて、上記情報xが
対象物で、かつ上記隣接情報a、b、c、dがす
べて背景となる区画M(i、j)には新しいラベ
ル(数値)を割当て、上記隣接情報a、b、c、
dに対象物を含む場合には既に付けられているラ
ベルの最小のものを伝播する。次に、逆方向のス
キヤンにおいては、上記のスキヤンにより既
に付けられた各区画のラベルをチエツクし、上記
隣接情報a′、b′、c′、d′のうち最小のラベルを伝
播する。この操作によりスキヤンで付けられた
ラベルの最小値が対象物の全域に伝播され、対象
物毎に異なつたラベル付けがなされ、対象物の区
別を行なうことができる。 FIG. 3 is a diagram showing an example of the process and result of label propagation for a binary image with two objects.
First, in the forward scan, a new label (numeric value) is assigned to the section M (i, j) where the information x is the object and the adjacent information a, b, c, and d are all background. Information a, b, c,
If d contains an object, the smallest label already attached is propagated. Next, in the reverse scan, the labels of each section already attached by the above scan are checked, and the smallest label among the neighboring information a', b', c', and d' is propagated. By this operation, the minimum value of the label given by the scan is propagated to the entire area of the object, and each object is given a different label, making it possible to distinguish the objects.
このような伝播規則を適切に定めることによ
り、(1)周辺の対象物の検出、(2)対象物内の穴検
出、(3)対象物のラベリングを行なうことが可能で
ある。すなわち、いま二値化パターンを対象物
(object)と背景(back)として、
(1) 不完全(周辺)対象物の検出
処理範囲の「縁」(edge)という情報を縁に
接する「対象物」(object)に逐次伝播させ、
目的の「対象物」(object)を「縁」(edge)に
置き換えることにより不完全対象物を検出す
る。すなわち、
スキヤン
x=edge
x:x=objectかつa,b,c,d
のいずれかがedge
:その他の場合
スキヤン
x′=edge
x′:x′=objectかつa′,b′,
c′,d′のいずれかがedge
:その他の場合
(2) 対象物内の穴検出
処理範囲の「縁」(edge)という情報を縁に
接する「背景」(back)に逐次伝播させ、本当
の「背景」(back)を「縁」(edge)に置き換
え、「背景」(back)として残る部分「穴」
(hole)として検出する。すなわち
スキヤン
x=edge
x:x=backかつa,b,c,d
のいずれかがedge
:その他の場合
スキヤン
x′=edge
x′:x′=backかつa′,b′,
c′,d′のいずれかがedge
:その他の場合
(3) 対象物のラベリング
スキヤン
x=New.label
Min(a,b,c,d)
x:x=objectかつ
a=b=c=d
=back
:x=objectかつ
a,b,c,d,の
いずれかがlabel
:x=back
スキヤン
x′=Min(a′,b′,c′,d′)
x′:x′=label
:x′=back
ここで、labelは上昇順につけるものとした。
このlabelは下降順に付けることも考えられるが
ここでは上記で代表する。 By appropriately defining such propagation rules, it is possible to (1) detect surrounding objects, (2) detect holes in objects, and (3) label objects. In other words, assuming that the binarized pattern is an object and a background, (1) Detection of incomplete (peripheral) objects Information on the "edge" of the processing range is used to detect "objects" that are in contact with the edges. ” (object),
Incomplete objects are detected by replacing the desired "object" with an "edge." In other words, scan x=edge Either d′ is an edge: Other cases (2) Hole detection in the object The information on the “edge” of the processing range is successively propagated to the “background” that is in contact with the edge, and the true “background” is detected. ” (back) is replaced with “edge”, and the part “hole” that remains as the “background” (back)
(hole). In other words, scan x = edge x: x = back and one of a, b, c, d is edge: otherwise scan x' = edge ′ is edge: Other cases (3) Labeling of object Scan x = New.label Min (a, b, c, d) x: x = object and a = b = c = d = back: x = object and one of a, b, c, d is label : x = back Scan x' = Min (a', b', c', d') x': x' = label : x' = back Here, labels are attached in ascending order.
Although it is possible to attach these labels in descending order, the above is representative here.
第4図は本発明の一実施例を示す図である。入
力画像は、撮影管、フライング・スポツト・スキ
ヤナーなどの画像入力装置によつて、複数個の網
目状区画の画像情報として、電気信号Sに変換さ
れる。この電気信号SをA/D変換器1を用いて
量子化し、デイジタル信号SAを得る。この信号
SAは切り換え器2に供給される。この切り換え
器2には、画像メモリ5の出力信号S0が供給され
ており、ラツチ21の値m1によつて上記信号SA、
S0のいずれか一方が出力される。この出力信号SB
は二値化回路3に供給される。今、上記m1を上
記信号SAが上記信号SBとなるように設定すると、
二値化回路3には信号SAが供給される。
FIG. 4 is a diagram showing an embodiment of the present invention. The input image is converted into an electrical signal S as image information of a plurality of mesh sections by an image input device such as a photographic tube or a flying spot scanner. This electric signal S is quantized using an A/D converter 1 to obtain a digital signal S A. this signal
S A is supplied to the switch 2 . This switch 2 is supplied with the output signal S 0 of the image memory 5, and the value m 1 of the latch 21 causes the signal S A ,
Either one of S 0 is output. This output signal S B
is supplied to the binarization circuit 3. Now, if the above m 1 is set so that the above signal S A becomes the above signal S B , then
A signal S A is supplied to the binarization circuit 3 .
上記二値化回路3の構成を第5図に示す。入力
信号SBは比較器31に供給され、ラツチ34に設
定されたしきい値Tと比較される。この比較器3
1の出力はゲート回路32又は33に供給され、
上記信号SBがしきい値T以上の場合はラツチ35
に設定された値PUがゲート回路32を通過し、
しきい値T未満の場合はラツチ36に設定された
値PLがゲート回路33を通過する。しかして、
入力信号SBは二値化回路3によつて値PUと値PL
とに二値化された信号SCとなる。 The configuration of the binarization circuit 3 is shown in FIG. The input signal S B is fed to a comparator 31 and compared with a threshold T set in a latch 34 . This comparator 3
The output of 1 is supplied to the gate circuit 32 or 33,
If the above signal S B is above the threshold value T, the latch 35
The value P U set in passes through the gate circuit 32,
If it is less than the threshold value T, the value P L set in the latch 36 passes through the gate circuit 33. However,
The input signal S B is converted into a value P U and a value P L by the binarization circuit 3.
The signal S C is binarized into .
上記信号SCは切り換え器4に供給される。この
切り換え器4には演算回路9からの信号S′0が供
給されており、ラツチ41の値m2によつて上記
信号SC,S′0のいずれか一方が出力される。この
出力信号SDは画像メモリ5の入力端子INに供給
される。今、上記値m2を上記信号SCが信号SDと
なるよう設定すると、メモリ5には上記信号SC即
ち値PUと値PLとに二値化された信号が供給され
る。画像メモリ5は入力画像の横幅I、縦幅Jに
対応した二次元のアドレスを持ち、下位アドレス
ALを横アドレスi、上位アドレスAUを縦アドレ
スjとして入力画像の実アドレスと対応してい
る。このメモリ5への書き込みは、アドレス制御
回路6により上記アドレスAL(横アドレスi)及
びAU(縦アドレス)を順次更新することによつて
行なわれる。 The signal S C is supplied to the switch 4. This switch 4 is supplied with the signal S' 0 from the arithmetic circuit 9, and depending on the value m 2 of the latch 41, one of the signals S C and S' 0 is output. This output signal S D is supplied to the input terminal IN of the image memory 5. Now, when the value m 2 is set so that the signal SC becomes the signal SD , the memory 5 is supplied with the signal SC , that is, a signal binarized into a value P U and a value PL . The image memory 5 has two-dimensional addresses corresponding to the width I and the height J of the input image, and has lower addresses.
A L is a horizontal address i, and an upper address A U is a vertical address j, which corresponds to the real address of the input image. Writing into the memory 5 is performed by sequentially updating the addresses A L (horizontal address i) and A U (vertical address) by the address control circuit 6.
アドレス制御回路6の構成を第6図に示す。ア
ドレス制御回路は2つのアドレスカウンタ61及
び62から構成され、カウンタ61のキヤリー端
子C、ボロー端子Bはそれぞれカウンタ62の加
算端子CU、減算端子CDに接続されている。カウ
ンタ61の出力が上記メモリ5の下位アドレス
ALとなり、カウンタ62の出力が上位アドレス
AUとなる。メモリ5の入力信号SDをメモリ5に
逐次書き込むには、順方向を示すラツチ72の値
Fを“1”と設定することによつてANDゲート
70を開き、制御回路10より発生される同期信
号φをカウンタ61の加算端子CUに供給する。
上記カウンタ61及び62では上記同期信号φの
パルス数がカウントされ、それぞれの値が逐次出
力される。しかして、カウンタ61の値を横アド
レスi、カウンタ62の値を縦アドレスjに対応
させて上記信号SDを上記メモリ5に逐次記憶す
る。 The configuration of the address control circuit 6 is shown in FIG. The address control circuit is composed of two address counters 61 and 62, and the carry terminal C and borrow terminal B of the counter 61 are connected to the addition terminal CU and subtraction terminal CD of the counter 62, respectively. The output of the counter 61 is the lower address of the memory 5.
A L , and the output of counter 62 is the upper address
It becomes A U. To sequentially write the input signal S D of the memory 5 to the memory 5, the value F of the latch 72 indicating the forward direction is set to "1" to open the AND gate 70, and the synchronization signal S D generated by the control circuit 10 is opened. The signal φ is supplied to the addition terminal CU of the counter 61.
The counters 61 and 62 count the number of pulses of the synchronization signal φ, and sequentially output the respective values. Thus, the signal S D is sequentially stored in the memory 5 with the value of the counter 61 corresponding to the horizontal address i and the value of the counter 62 corresponding to the vertical address j.
以上の説明により、入力画像の各区画から得ら
れる電気信号Sは、上記画像メモリ5に上記値
PUとPLとの二値画像として記憶される。 According to the above explanation, the electrical signal S obtained from each section of the input image is stored in the image memory 5 at the above value.
It is stored as a binary image of P U and P L.
次に、上記メモリ5の記憶内容(二値画像)を
順方向に読み出し、順方向処理を行なう。この読
み出しは、第6図に示したアドレス制御回路6に
よつて行なう。即ち、第6図において、ラツチ7
2によつてANDゲート70を開き、同期信号φ
をカウンタ61の加算端子CUに供給して、カウ
ンタ61及び62の値i及びjを順次増加させる
ことによつて、画像メモリ5のアドレスを順次更
新し、出力端子OUTより各区画M(i、j)記憶
内容S0(i、j)を順次読み出す。また、上記カ
ウンタ61の値iは比較器63及び64に供給さ
れる。比較器63では上記値iとラツチ75の値
ILとを比較し、i≧ILの場合にこの比較器63か
ら信号がANDゲート67に供給される。比較器
64では上記値iとラツチ76の値IUとを比較
し、i≦IUの場合にこの比較器64から信号が上
記ANDゲート67に供給される。一方、カウン
タ62の値jは比較器65及び66に供給され
る。比較器65では上記値jとラツチ77の値JL
とを比較し、j≧JLの場合にこの比較器65から
信号がANDゲート68に供給される。比較器6
6では上記値jとラツチ78の値JUとを比較し、
j≦JUの場合にこの比較器66から信号が上記
ANDゲート68に供給される。上記ANDゲート
67及び68の出力はANDゲート69に供給さ
れる。ここで、上記値IL、IU、JL、JUの画像の横
幅I及び縦幅Jの有効範囲を設定するためのもの
で、値ILは横幅Iの下限、値LUは横幅Iの上限、
値JLは縦幅Jの下限、値JUは縦幅Jの上限を示
す。このような構成とすることによつてIL≦i≦
IUかつJL≦j≦JUの場合だけANDゲート69よ
り信号eが出力され、演算回路9に供給される。
またラツチ74には、第1回目のスキヤンを示す
値Kを設定し、この値を示す信号kを演算回路9
に供給する。 Next, the stored contents (binary image) of the memory 5 are read out in the forward direction and forward processing is performed. This reading is performed by the address control circuit 6 shown in FIG. That is, in FIG.
2 opens the AND gate 70 and outputs the synchronizing signal φ
is supplied to the addition terminal CU of the counter 61 to sequentially increase the values i and j of the counters 61 and 62, thereby sequentially updating the address of the image memory 5, and inputting each section M(i, j) Read out the memory contents S 0 (i, j) sequentially. Further, the value i of the counter 61 is supplied to comparators 63 and 64. The comparator 63 uses the above value i and the value of the latch 75.
When i≧ IL , a signal is supplied from the comparator 63 to the AND gate 67. The comparator 64 compares the value i with the value I U of the latch 76 , and if i≦I U , a signal is supplied from the comparator 64 to the AND gate 67 . On the other hand, the value j of the counter 62 is supplied to comparators 65 and 66. The comparator 65 uses the above value j and the value J L of the latch 77.
When j≧J L , a signal is supplied from the comparator 65 to the AND gate 68. Comparator 6
In step 6, compare the above value j and the value J U of latch 78,
When j≦J U , the signal from this comparator 66 is
Supplied to AND gate 68. The outputs of the AND gates 67 and 68 are supplied to an AND gate 69. Here, the above values I L , I U , J L , and J U are used to set the effective range of the width I and height J of the image, where the value I L is the lower limit of the width I, and the value L U is the width. The upper limit of I,
The value J L indicates the lower limit of the vertical width J, and the value J U indicates the upper limit of the vertical width J. With this configuration, I L ≦i≦
Only when I U and J L ≦j≦J U , a signal e is output from the AND gate 69 and supplied to the arithmetic circuit 9.
Further, a value K indicating the first scan is set in the latch 74, and a signal k indicating this value is sent to the arithmetic circuit 9.
supply to.
上述のように、アドレス制御回路6に従つて画
像メモリ5から読み出された信号S0は、切り換え
器2及び演算レジスタ回路8に供給される。今、ア
ドレス制御回路6によつて読み出された信号を、
ある区画M(i、j)の信号S0(i、j)とする。 As mentioned above, the signal S 0 read out from the image memory 5 according to the address control circuit 6 is supplied to the switch 2 and the arithmetic register circuit 8 . Now, the signal read out by the address control circuit 6 is
Let it be a signal S 0 (i, j) of a certain section M (i, j).
演算レジスタ回路8の構成を第7図に示す。レ
ジスタ85にはメモリ5からの信号S0(i、j)
が供給される。また遅延回路80及びレジスタ8
4には、演算回路9で1区画前に処理された結果
得られた信号S′0が供給される。上記遅延回路8
0は(I−1)個の区画群の信号を記憶する手段
であり、シフトレジスタ又はRAM等を用いて実
現できる。この遅延回路80は画像処理における
マスク演算に常套手段である。上記信号S′0は、
遅延回路80によよつて(I−1)区画分遅れて
レジスタ83に、さらに1区画遅れでレジスタ8
2に、さらに1区画遅れでレジスタ81にシフト
される。上述のような構成とすることによつて、
5つのレジスタ81,82,83,84,85に
は、それぞれ信号S′0(i−1、j−1)、S′0(i、
j−1)、S′0(i+1、j−1)、S′0(I−1、
j)、S0(i、j)が蓄えられる。ここで、上記5
つのレジスタ81,82,83,84,85の内
容は順に前述の情報a、b、c、d、xに対応す
る。これらのa、b、c、d、xはメモリ5から
各区画の情報xが供給される毎に、制御回路10
から発生される同期信号に同期して演算回路9
に供給される。 The configuration of the arithmetic register circuit 8 is shown in FIG. The register 85 receives the signal S 0 (i, j) from the memory 5.
is supplied. In addition, the delay circuit 80 and the register 8
4 is supplied with the signal S' 0 obtained as a result of processing one section before by the arithmetic circuit 9. The above delay circuit 8
0 is means for storing signals of (I-1) partition groups, and can be realized using a shift register, RAM, or the like. This delay circuit 80 is a common means for mask calculation in image processing. The above signal S′ 0 is
By the delay circuit 80, it is sent to register 83 with a delay of (I-1) sections, and then to register 8 with a delay of one section.
2, it is further shifted to register 81 with a delay of one block. By having the above configuration,
The five registers 81, 82, 83, 84, and 85 have signals S' 0 (i-1, j-1) and S' 0 (i,
j-1), S' 0 (i+1, j-1), S' 0 (I-1,
j), S 0 (i, j) are stored. Here, the above 5
The contents of the three registers 81, 82, 83, 84, and 85 correspond to the aforementioned information a, b, c, d, and x in that order. These a, b, c, d, x are sent to the control circuit 10 every time information x of each section is supplied from the memory 5.
The arithmetic circuit 9 synchronizes with the synchronization signal generated from the
supplied to
演算回路9では、上記5つの情報をもとに所定
の処理が行なわれ、その処理の結果得られた信号
S′0(i、j)が演算レジスタ8及び切り換え器4
に供給される。上記信号S′0(i、j)は、演算レ
ジスタ8では、前述のようにレジスタ84及び遅
延回路80に供給され、レジスタ84に信号S′0
(i、j)が蓄えられる。一方、切り換え器4に
供給された信号S′0(i、j)は画像メモリ5の入
力端子INに印加され、区画M(i、j)に書き込
まれる。次に、アドレス制御回路6によつてアド
レスを更新し、区画M(i+1、j)の信号S0(i
+1、j)を読み出し上述と同様の処理を行な
い、その結果得られた信号S′0(i+1、j)を画
像メモリ5に書き込む。これらの処理をすべての
区画について順次行ない、第1回目の順方向処理
を終了する。 In the arithmetic circuit 9, predetermined processing is performed based on the above five pieces of information, and the signal obtained as a result of the processing is
S′ 0 (i, j) is the calculation register 8 and switch 4
supplied to In the arithmetic register 8, the signal S' 0 (i, j) is supplied to the register 84 and the delay circuit 80 as described above, and the signal S' 0 (i, j) is supplied to the register 84 as described above.
(i, j) are stored. On the other hand, the signal S' 0 (i, j) supplied to the switch 4 is applied to the input terminal IN of the image memory 5 and written into the section M (i, j). Next, the address is updated by the address control circuit 6, and the signal S 0 (i
+1, j) is read out and subjected to the same processing as described above, and the resulting signal S' 0 (i+1, j) is written into the image memory 5. These processes are sequentially performed for all the partitions, and the first forward process is completed.
次に、第6図に示したアドレス制御回路のラツ
チ72の値Fを“0”としてANDゲート70を
閉じるとともに、ラツチ73の逆方向走査を示す
値Rを“1”と設定することによつてANDゲー
ト71を開き、同期信号φをカウンタ61の減算
端子CDに供給し、アドレスを順次減少させる。
このとき、ラツチ74の第1回目のスキヤンを示
す値Kを他の値に設定する。この逆方向の走査に
ついても、順方向の走査と同様の処理を行なう。
即ち、画像メモリ5の内容を逆方向に順次読み出
し、演算レジスタ8の情報のうちレジスタ81,
82,83,84の内容である情報a′、b′、c′、
d′、及びレジスタ85に新たに書き込まれた情報
x′を用いて演算回路9で所定の処理を行ない、そ
の結果を画像メモリ5に書き込む。 Next, the value F of the latch 72 of the address control circuit shown in FIG. 6 is set to "0" to close the AND gate 70, and the value R of the latch 73 indicating backward scanning is set to "1". Then, the AND gate 71 is opened and the synchronizing signal φ is supplied to the subtraction terminal CD of the counter 61 to sequentially decrease the address.
At this time, the value K indicating the first scan of the latch 74 is set to another value. The same processing as the forward scanning is performed for this backward scanning.
That is, the contents of the image memory 5 are sequentially read in the reverse direction, and among the information in the calculation register 8, the registers 81,
Information a′, b′, c′, which is the content of 82, 83, 84,
d' and the information newly written to register 85
A predetermined process is performed in the arithmetic circuit 9 using x', and the result is written into the image memory 5.
次に演算回路9の構成を第8図に示す。演算レ
ジスタ8からの情報a、b、c及びdは最小値検
出回路90に供給され、最小値mが求められる。
この最小値mは比較器91及び93とゲート回路
97に供給される。一方、演算レジスタ8からの
情報xを比較器92及び93とゲート回路98に
供給される。比較器91ではラツチ94の値C1
に対するmの関係α1が求められる。比較器92で
はラツチ95の値C2に対するxの関係α2が求め
られる。また比較器93ではmに対するxの関係
α3が求められる。ゲート回路97及び98は、そ
れぞれゲート信号β1、β2によつて開かれ、m、x
をANDゲート100に供給する。96はカウン
タで、ゲート回路99のゲート信号β3の数をカウ
ントし、その出力Lをゲート回路99を介してゲ
ート回路100に供給する。またkはアドレス制
御回路6からの信号で、スキヤン状態を示すもの
である。なお、上記ゲート回路97,98及び9
9はゲート信号β1、β2、β3によつて1つだけ開か
れ、m、x、Eのいずれか1つx*をゲート回路
100に供給する。このゲート回路100にはア
ドレス制御回路6からの信号eが供給される。ま
た、上記eは反転器102を介してゲート回路1
01に供給される。このゲート回路101には無
効域を示す値PEを有するラツチ103の信号が
供給されている。しかして、上記x*は、上記信
号eの有無により、x*もしくはPEのいずれか一
方が出力される。この出力信号S′0は、前述した
ように演算レジスタ8と、切り換え器4を介して
画像メモリ5とに供給される。なお、この演算回
路は、対象とする処理に応じて第9図に示すよう
に初期値(object、back、hole、edge、C1、C2)
を設定し、条件(k、α1、α2、α3)に応じてゲー
ト信号(β1、β2、β3)を定めることにより実行さ
れる。 Next, the configuration of the arithmetic circuit 9 is shown in FIG. Information a, b, c, and d from the arithmetic register 8 are supplied to a minimum value detection circuit 90, and the minimum value m is determined.
This minimum value m is supplied to comparators 91 and 93 and gate circuit 97. On the other hand, information x from the arithmetic register 8 is supplied to comparators 92 and 93 and a gate circuit 98. In the comparator 91, the value C 1 of the latch 94
The relationship α 1 of m to is determined. Comparator 92 determines the relationship α 2 of x to the value C 2 of latch 95. Further, the comparator 93 determines the relationship α 3 of x to m. Gate circuits 97 and 98 are opened by gate signals β 1 and β 2 , respectively, and m, x
is supplied to the AND gate 100. A counter 96 counts the number of gate signals β 3 of the gate circuit 99 and supplies its output L to the gate circuit 100 via the gate circuit 99. Further, k is a signal from the address control circuit 6 and indicates a scan state. Note that the gate circuits 97, 98 and 9
Only one of gates 9 is opened by gate signals β 1 , β 2 , and β 3 and supplies one of m, x, and E, x * , to the gate circuit 100 . This gate circuit 100 is supplied with a signal e from the address control circuit 6. Further, the above e is connected to the gate circuit 1 through the inverter 102.
01. This gate circuit 101 is supplied with a signal from a latch 103 having a value P E indicating an invalid region. Therefore, either x * or P E is outputted from x * depending on the presence or absence of the signal e. This output signal S' 0 is supplied to the arithmetic register 8 and the image memory 5 via the switch 4 as described above. Note that this arithmetic circuit has initial values (object, back, hole, edge, C 1 , C 2 ) as shown in FIG. 9 depending on the target processing.
This is executed by setting the gate signals (β 1 , β 2 , β 3 ) according to the conditions (k, α 1 , α 2 , α 3 ).
第9図は、対象とする処理の初期値、条件、ゲ
ート信号を説明する図である。 FIG. 9 is a diagram illustrating initial values, conditions, and gate signals of the target processing.
まず、周辺に隣接する不完全対象物、即ち、周
辺対象物Qの検出について説明する。入力画像か
らの信号Sを適当なしきい値Tでスライスし、
PU=“2”とPL=“1”とに二値化して画像メモ
リ5に記憶する。ここで、“2”は(object)、
“1”は(hole)及び(back)に対応する。次
に、IL、IU、JL及びJUをそれぞれ“2”、“I−
1”、“2”、“J−1”に設定し、画像の有効範囲
を一区画内側とする。そして、PE=“0”として
非有効エリアに対しては、演算回路9からS′0と
して“0”を出力し、(edge)とする。また有効
エリアに対してはC1=“0”即ち、(edge)、C2=
“2”即ち(object)として、三つの関係α1、α2、
α3を求め、第9図の条件、出力に従つて演算回路
9でx*を求める。例えば、a、b、c、d、の
最小値mが“0”即ち(edge)で、かつxが
“2”(object)のとき、ゲート信号β1によりゲー
ト回路97を開き、x*に“0”即ち(edge)を
出力し、さらに信号eでゲート回路100を開
き、S′0にx*即ち“0”を出力する。このように
して、第9図に示した条件で、順方向及び逆方向
の走査を行なうことにより、周辺対象物Qは
“0”即ち(edge)となる。これにより“2”
(object)、“1”(back)及び(hole)、“0”
(edge)の三値画像が得られる。 First, detection of an incomplete object adjacent to the periphery, that is, a peripheral object Q will be described. Slice the signal S from the input image with an appropriate threshold T,
It is binarized into P U =“2” and P L =“1” and stored in the image memory 5. Here, "2" is (object),
“1” corresponds to (hole) and (back). Next, I L , I U , J L and J U are respectively "2" and "I-
1", "2", and "J-1", and set the effective range of the image to the inside of one section. Then, for the non-effective area by setting P E = "0", the arithmetic circuit 9 sends S' Output "0" as 0 and set it as (edge). Also, for the effective area, C 1 = "0", that is, (edge), C 2 =
As “2” (object), three relationships α 1 , α 2 ,
α 3 is determined, and x * is determined in the arithmetic circuit 9 according to the conditions and outputs shown in FIG. For example, when the minimum value m of a, b, c, d is "0" (edge) and x is "2" (object), the gate circuit 97 is opened by the gate signal β 1 , and x It outputs "0", ie (edge), opens the gate circuit 100 with the signal e, and outputs x * , ie "0" to S'0 . In this way, by scanning in the forward and reverse directions under the conditions shown in FIG. 9, the peripheral object Q becomes "0", that is, an edge. This results in “2”
(object), “1” (back) and (hole), “0”
(edge) ternary image is obtained.
次に、対象物内の穴Hの検出について説明す
る。例えば、上記の三値画像を、画像メモリ5か
ら読み出し、切り換え器2を介して二値化回路3
に供給する。この二値化回路3で、しきい値T=
“2”としてPU=“2”とPL=“1”とに二値化し
て画像メモリ5に記憶する。ここで“2”は
(object)、“1”は(back)及び(hole)に対応
する。上記画像メモリ5の内容を順方向及び逆方
向に順次読み出し、前述の周辺対象物の検出と同
様の処理を行なう。この処理は、第9図に示した
穴検出処理に従う。周辺対象処理とは、C1の条
件が異なるだけである。この処理により、
(object)は“2”(hole)は“1”、(back)は
“0”となる。 Next, detection of the hole H in the object will be explained. For example, the above ternary image is read out from the image memory 5 and passed through the switch 2 to the binarization circuit 3.
supply to. In this binarization circuit 3, threshold value T=
It is binarized into P U = "2" and P L = "1" as "2" and stored in the image memory 5. Here, "2" corresponds to (object), and "1" corresponds to (back) and (hole). The contents of the image memory 5 are sequentially read out in the forward and reverse directions, and the same processing as that for detecting the peripheral object described above is performed. This process follows the hole detection process shown in FIG. The only difference from peripheral object processing is the condition of C1 . With this process,
(object) is “2”, (hole) is “1”, and (back) is “0”.
次に、対象物のラベリングについて説明する。
例えば、上述の穴検出処理で得られた三値画像を
画像メモリ5から読み出し、切り換え器2を介し
て二値化回路3に供給する。この二値化回路3
で、しきい値T=“1”としてPU=“254”とPL=
“255”とに二値化して画像メモリ5に記憶する。
ここで、“254”は(object)、“255”は(back)
に対応する。 Next, labeling of objects will be explained.
For example, the ternary image obtained in the hole detection process described above is read out from the image memory 5 and supplied to the binarization circuit 3 via the switch 2. This binarization circuit 3
Then, assuming the threshold T = “1”, P U = “254” and P L =
It is binarized into "255" and stored in the image memory 5.
Here, “254” is (object) and “255” is (back)
corresponds to
なお、これら“254”、”255”の値は、画像メモ
リ5の深さ方向を8ビツトした場合の値である。
上記メモリ5の内容を順方向及び逆方向に順次読
み出し、処理を行なう。即ち、非有効エリア即ち
(edge)に対しては、PE=“255”として(back)
を書き込む。一方、有効エリアに対しては、C1
=“255”即ち(back)、C2=”254”即ち
(object)として、第9図の条件、出力に従つて
演算回路9でx*を求める。なおこのとき、最初
の順方向の走査に対してはk=“0”、その他に対
してはk=“1”とする。例えば、k=“0”で、
最小値m=“255”即ち(back)かつx=“254”
即ち(object)の条件の場合にゲート信号β3をカ
ウンタ96に加算するとともに、ゲート回路99
を開き、上記カウンタ96の値をx*として出力
する。この処理により異なる対象物毎に互いに異
なる値(ラベル)が書き込まれる。 Note that these values "254" and "255" are values when the depth direction of the image memory 5 is set to 8 bits.
The contents of the memory 5 are sequentially read out in forward and reverse directions and processed. In other words, for the ineffective area (edge), set P E = “255” (back)
Write. On the other hand, for the effective area, C 1
= "255" or (back), C 2 = "254" or (object), and the arithmetic circuit 9 calculates x * according to the conditions and outputs shown in FIG. At this time, k is set to "0" for the first forward scan, and k is set to "1" for the other scans. For example, if k=“0”,
Minimum value m = “255” (back) and x = “254”
That is, in the case of the condition (object), the gate signal β 3 is added to the counter 96, and the gate circuit 99
and output the value of the counter 96 as x * . Through this process, different values (labels) are written for different objects.
なお、上記3種類の処理の切換は、第9図に示
した3種類の処理のひとつをフラグ(第4図、
MD)に設定することにより行なう。各処理モー
ドでの各条件に対する出力ゲートの開閉は第9図
の各処理、及び、条件をアドレスとしそれぞれ対
応した出力β1、β2、β3の内容を出力信号とした
ROMを用いることにより容易に行なえる。さら
に各初期値の設定は、コンピユータ等を用い容易
に行なえる。 Note that switching between the three types of processing described above can be done by setting one of the three types of processing shown in Fig. 9 to the flag (Fig. 4,
MD). The opening/closing of the output gate for each condition in each processing mode is performed using each process and condition in Figure 9 as an address, and the contents of the corresponding outputs β 1 , β 2 , β 3 as output signals.
This can be easily done using ROM. Further, each initial value can be easily set using a computer or the like.
以上述べて来たように、本発明による装置を用
いれば、処理範囲の縁に接する、不完全対象物の
検出、対象物内の穴の検出、分離した対象物に対
するラベリングを、ラスタ走査のみを用いて簡潔
かつ効率的に行なうことができる。
As described above, the apparatus according to the present invention can be used to detect incomplete objects adjacent to the edges of the processing area, to detect holes in the objects, and to label separated objects using only raster scanning. This can be done simply and efficiently using
第1図は二値化パターンの一例を示す図、第2
図は本発明に係る逐次伝播の原理を説明するため
の図、第3図はラベル伝播の一例を示す図、第4
図は本発明の一実施例を示す図、第5図は第4図
の二値化回路の詳細を示す図、第6図はは第4図
のアドレス制御回路の詳細を示す図、第7図は第
4図の演算レジスタ回路の詳細を示す図、第8図
は第4図の演算回路の詳細を示す図、第9図は対
象とする処理の初期値、条件、出力ゲートを説明
する図である。
Figure 1 shows an example of a binarization pattern, Figure 2 shows an example of a binarization pattern.
The figures are diagrams for explaining the principle of sequential propagation according to the present invention, Figure 3 is a diagram showing an example of label propagation, and Figure 4 is a diagram for explaining the principle of sequential propagation according to the present invention.
5 shows details of the binarization circuit shown in FIG. 4, FIG. 6 shows details of the address control circuit shown in FIG. 4, and FIG. The figure shows the details of the arithmetic register circuit in Fig. 4, Fig. 8 shows the details of the arithmetic circuit in Fig. 4, and Fig. 9 explains the initial values, conditions, and output gates of the target processing. It is a diagram.
Claims (1)
する装置において、上記各区画から得られる濃度
信号を対象物であると認められる区画の信号Pu
と、それ以外の区画の信号PLとに分けた二値化
パターンとして画像メモリに記憶する手段と、上
記画像メモリを順方向に順次読み出し、読み出さ
れたPuもしくはPLのいずれか一方の区画に対し
て既に読み出されている隣接する区画の情報によ
りラベルを求めて書き込むことによりそのラベル
をパターン内で順方向に伝播する第1の処理と、
上記画像メモリを逆方向に順次読み出し、読み出
された区画にラベルが付されているとき既に読み
出されている隣接する区画のラベル情報により新
たにラベルを求めて当該区画に書き込むことによ
りラベルを求めて当該区画に書き込むことにより
ラベルをパターン内で逆方向に伝播する第2の処
理を行なう制御・演算手段を有することを特徴と
する画像処理装置。 2 上記制御・演算手段は、第1の処理にて読み
出された区画の情報がPuであり、かつ既に読み
出されている隣接する区画にラベルが付されてい
ない場合ごとに順次値が上昇するラベルを付し、
さらに第1、第2の処理におけるラベルの伝播は
既に読み出されている区画のラベルのうち最小の
値のラベルを当該区画に書き込むことにより行な
うことを特徴とする特許請求の範囲第1項に記載
の画像処理装置。 3 上記制御・演算手段は、上記第1、第2の処
理を個々の2値化パターン内の情報が同一になる
まで繰り返すことを特徴とする特許請求の範囲第
1項に記載の画像処理装置。 4 上記制御・演算手段は、画像の縁にて読み出
された区画がPuであるときに縁を示す特定のラ
ベルを付し、画像の縁以外にて読み出された区画
がPuであり、かつ既に読み出された隣接する区
画のいずれかに上記特定のラベルが付されている
ときに当該区画にも上記特定のラベルを付すこと
により不完全対象物パターンを検出することを特
徴とする特許請求の範囲第1項に記載の画像処理
装置。 5 上記制御・演算手段は、画像の縁にて読み出
された区画がPLであるときに縁を示す特定のラ
ベルを付し、画像の縁以外にて読み出された区画
がPLであり、かつ既に読み出された隣接する区
画のいずれかに上記特定のラベルが付されている
ときに当該区画にも上記特定のラベルを付すこと
により対象物パターンに対する背景と、対象物パ
ターン内の穴とを区別することを特徴とする特許
請求の範囲第1項に記載の画像処理装置。[Claims] 1. In a device that processes an image by dividing it into a finite number of mesh-like sections, the density signal obtained from each section is converted into a signal Pu of a section recognized to be an object.
means for storing in an image memory as a binarized pattern divided into signals Pu and P L of other sections, and means for sequentially reading out the image memory in the forward direction, a first process of propagating the label forward in the pattern by determining and writing a label using information of adjacent compartments that has already been read for the compartment;
The above image memory is sequentially read in the reverse direction, and when a label has been attached to the read out section, a new label is obtained from the label information of the adjacent section that has already been read out, and is written to the concerned section, thereby creating the label. An image processing device characterized by comprising a control/arithmetic means for performing a second process of propagating a label in a backward direction within a pattern by determining the label and writing it in the section. 2 The above control/calculation means sequentially increases the value each time the information of the section read in the first process is Pu and the adjacent section that has already been read is not labeled. with a label that
Furthermore, the propagation of the label in the first and second processing is performed by writing a label with a minimum value among the labels of the partitions that have already been read into the partition concerned. The image processing device described. 3. The image processing device according to claim 1, wherein the control/calculation means repeats the first and second processing until the information in each binarization pattern becomes the same. . 4. The control/calculation means attaches a specific label indicating the edge when the section read out at the edge of the image is Pu, and the section read out at the edge other than the edge of the image is Pu. A patent characterized in that, when the specific label is attached to any of the adjoining sections that have already been read out, an incomplete object pattern is detected by attaching the specific label to the section as well. An image processing device according to claim 1. 5 The above control/calculation means attaches a specific label indicating the edge when the section read out at the edge of the image is P L , and attaches a specific label indicating the edge when the section read out at the edge of the image is P L. If the above-mentioned specific label is attached to any of the adjoining sections that have already been read out, by attaching the above-mentioned specific label to that section as well, the background to the object pattern and the information within the object pattern can be distinguished. The image processing device according to claim 1, wherein the image processing device distinguishes between holes.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP59054236A JPS59188775A (en) | 1984-03-23 | 1984-03-23 | Picture processing device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP59054236A JPS59188775A (en) | 1984-03-23 | 1984-03-23 | Picture processing device |
Publications (2)
Publication Number | Publication Date |
---|---|
JPS59188775A JPS59188775A (en) | 1984-10-26 |
JPS6329304B2 true JPS6329304B2 (en) | 1988-06-13 |
Family
ID=12964902
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP59054236A Granted JPS59188775A (en) | 1984-03-23 | 1984-03-23 | Picture processing device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPS59188775A (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS63244276A (en) * | 1987-03-31 | 1988-10-11 | Ckd Corp | Image segmenting method and labeling device |
KR20030039969A (en) * | 2001-11-16 | 2003-05-22 | 주식회사 해피투웨어 | System for designing a garment using image file and method for controlling the same |
-
1984
- 1984-03-23 JP JP59054236A patent/JPS59188775A/en active Granted
Also Published As
Publication number | Publication date |
---|---|
JPS59188775A (en) | 1984-10-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US4538299A (en) | Method and apparatus for locating the boundary of an object | |
US4506382A (en) | Apparatus for detecting two-dimensional pattern and method for transforming the pattern into binary image | |
EP0521662B1 (en) | Improved automatic image segmentation | |
US4903316A (en) | Binarizing apparatus | |
US4400738A (en) | Image signal processing method and apparatus | |
EP0499875B1 (en) | Method of and apparatus for obtaining binary image | |
US5034992A (en) | Image processing method | |
EP0079175B1 (en) | Boolean filtering method and apparatus | |
JPS6329304B2 (en) | ||
JPH04227581A (en) | Binarizing-threshold calculation device for image | |
US4364023A (en) | Optical character reading system | |
US5680529A (en) | Image reduction conversion method | |
JPH0332723B2 (en) | ||
JPH0344349B2 (en) | ||
JP2853140B2 (en) | Image area identification device | |
JPH0357083A (en) | Image area determination method for binary images | |
JP3084726B2 (en) | Image processing area recognition device | |
JPH0225223B2 (en) | ||
JPH07271985A (en) | Motion detection apparatus and method | |
JP2800199B2 (en) | Image area identification device | |
JPH0414391B2 (en) | ||
JPH07322061A (en) | Method and device for distinguishing characters and photographs | |
JP2843185B2 (en) | Threshold value determination method and device | |
JPS62108381A (en) | Density histogram detecting system | |
JPH04205271A (en) | Optimal binarization threshold determination method |