JP2973789B2 - Label area perimeter calculation device - Google Patents

Label area perimeter calculation device

Info

Publication number
JP2973789B2
JP2973789B2 JP5217578A JP21757893A JP2973789B2 JP 2973789 B2 JP2973789 B2 JP 2973789B2 JP 5217578 A JP5217578 A JP 5217578A JP 21757893 A JP21757893 A JP 21757893A JP 2973789 B2 JP2973789 B2 JP 2973789B2
Authority
JP
Japan
Prior art keywords
data
label
output
port memory
value
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
Application number
JP5217578A
Other languages
Japanese (ja)
Other versions
JPH0773322A (en
Inventor
勉 遠藤
政裕 河野
雅弘 加藤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nippon Steel Corp
Original Assignee
Sumitomo Metal Industries Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sumitomo Metal Industries Ltd filed Critical Sumitomo Metal Industries Ltd
Priority to JP5217578A priority Critical patent/JP2973789B2/en
Publication of JPH0773322A publication Critical patent/JPH0773322A/en
Application granted granted Critical
Publication of JP2973789B2 publication Critical patent/JP2973789B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

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

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】この発明はラベル領域周囲長算出
装置に関し、特に、ラベル領域境界点同士の縦方向,横
方向および斜め方向それぞれの隣接数をラベル領域別
に、画像取込中に高速リアルタイムで算出できるような
ラベル領域周囲長算出装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an apparatus for calculating the perimeter of a label area, and more particularly to a method for real-time high-speed real-time reading of an image for each label area by determining the number of adjacent label area boundary points in the vertical, horizontal and oblique directions. The present invention relates to a label region perimeter calculating device that can be calculated by the following formula.

【0002】[0002]

【従来の技術】図10は特開昭61−221982号公
報に記載されているラベル領域周囲長算出回路の原理を
示すブロック図である。図10において、2値化回路1
01と遅延回路103には画像クロックの入力データで
各画素のラベルデータがラスタスキャン入力される。2
値化回路101はラベルリングされた画像を2値化す
る。より具体的には2値化回路101は1以上のラベル
値を有する画素を「1」とし、ラベル値0を有する背景
画素を「0」とする。縁部画素検出回路102は2値化
回路101の出力を受け、各連結領域の縁部を構成する
画素を検出する。例として、図11に縁部画素検出回路
102によって検出される各連結領域縁部の画素を示
す。図11において、数字はラベル値を示しており、数
字のない画素はラベル値「0」の背影であり、影のある
画素が各連結領域縁部の画素である。
2. Description of the Related Art FIG. 10 is a block diagram showing the principle of a label area perimeter calculation circuit described in Japanese Patent Application Laid-Open No. 61-221982. In FIG. 10, the binarization circuit 1
01 and the delay circuit 103 receive raster scan input of the label data of each pixel by the input data of the image clock. 2
The binarizing circuit 101 binarizes the labeled image. More specifically, the binarization circuit 101 sets a pixel having a label value of 1 or more to “1” and a background pixel having a label value of 0 to “0”. The edge pixel detection circuit 102 receives the output of the binarization circuit 101 and detects pixels forming the edge of each connected region. As an example, FIG. 11 shows the pixels at the edge of each connected region detected by the edge pixel detection circuit 102. In FIG. 11, numbers indicate label values, pixels without numbers are behind the label value “0”, and pixels with shadows are pixels at the edge of each connected region.

【0003】遅延回路103は入力ラベルデータに一定
の遅延を与え、縁部画素検出回路102の出力と同期化
させるために設けられている。遅延回路103の出力は
計数回路104に与えられる。計数回路104は縁部画
素検出回路102によって検出された画素の数をラベル
領域ごとに計数する。
A delay circuit 103 is provided for giving a fixed delay to input label data and synchronizing with the output of the edge pixel detection circuit 102. The output of the delay circuit 103 is provided to the counting circuit 104. The counting circuit 104 counts the number of pixels detected by the edge pixel detection circuit 102 for each label area.

【0004】図12は計数回路104の具体的なブロッ
ク図であり、図13は図12の動作を説明するためのタ
イムチャートである。
FIG. 12 is a specific block diagram of the counting circuit 104, and FIG. 13 is a time chart for explaining the operation of FIG.

【0005】図12において、計数回路104はシング
ルポートメモリ301と加算器302とラッチ303と
フリップフロップ304とを含む。フリップフロップ3
04のイネーブル端子には、図13(c)に示す縁部画
素検出回路102の出力が与えられており、フリップフ
ロップ304は縁部画素検出回路102で検出された図
13(b)に示すような縁部画素のラベルデータを、図
13(a)に示すクロック信号CLKに同期して保持す
る。フリップフロップ304で保持されたデータは、図
13(d)に示すように、メモリ301のドレスとして
与えられる。メモリ301に格納されているデータは、
各ラベル領域の縁部画素数の計数データとなる。メモリ
301のアドレスとして、縁部画素のラベルデータが与
えられ、かつ図13(f)に示すアウトプットイネーブ
ル信号が与えられると、図13(e)に示すようにその
アドレスに記憶されている計数データが読出され、加算
器302に与えられる。加算器302は、その読出され
たデータに「+1」し、メモリ301へ送り返す。メモ
リ301は、図13(h)に示す書込イネーブル信号が
与えられると、加算器302から送られてきた図13
(g)に示す加算済のデータを元のアドレスへ書込む。
このような処理が反復されることにより、各連結領域の
周囲長を求めることができる。すなわち、各連結領域の
周囲長は、その領域の縁部を構成する画素によって求め
る。
In FIG. 12, a counting circuit 104 includes a single-port memory 301, an adder 302, a latch 303, and a flip-flop 304. Flip-flop 3
The enable terminal of 04 is supplied with the output of the edge pixel detection circuit 102 shown in FIG. 13C, and the flip-flop 304 is detected by the edge pixel detection circuit 102 as shown in FIG. The label data of the edge pixel is held in synchronization with the clock signal CLK shown in FIG. The data held by the flip-flop 304 is given as a dress of the memory 301 as shown in FIG. The data stored in the memory 301 is
It becomes count data of the number of edge pixels of each label area. When the label data of the edge pixel is given as the address of the memory 301 and the output enable signal shown in FIG. 13 (f) is given, the count stored in that address as shown in FIG. The data is read and applied to adder 302. The adder 302 adds “+1” to the read data and sends it back to the memory 301. When the write enable signal shown in FIG. 13H is given, the memory 301 receives the write enable signal shown in FIG.
The added data shown in (g) is written to the original address.
By repeating such processing, the perimeter of each connected region can be obtained. That is, the perimeter of each connected region is determined by the pixels forming the edge of the region.

【0006】[0006]

【発明が解決しようとする課題】上述のごとく構成され
た装置では、連結領域の周囲長は、その領域の縁部を構
成する画素の数によって求めるものであり、精度が劣る
という問題点がある。具体的には、斜め方向の距離が反
映されておらず、また一般に実物と画像の縦横アスペク
ト比も異なっており、この点についても反映されていな
い。
In the apparatus configured as described above, the perimeter of the connected area is determined by the number of pixels constituting the edge of the area, and there is a problem that the accuracy is inferior. . Specifically, the distance in the oblique direction is not reflected, and in general, the aspect ratio of the real thing and the image is also different, and this point is not reflected.

【0007】さらに各クロックごとに入力されるデータ
を高速にリアルタイムで処理する必要がある場合には、
図13に示した計数回路では困難である。なぜならば、
1クロックサイクルタイム(=画像データ入力レート)
内で、メモリ301からその処理対象のデータを読出
し、加算器302によって演算処理を行ない、その演算
結果を再度メモリ1に書込んで格納しているため、図1
3に示すように、1回の処理時間に少なくともメモリ読
出し時間+加算処理時間+メモリ書込時間を要するから
である。
Further, when it is necessary to process data input at each clock at high speed in real time,
It is difficult with the counting circuit shown in FIG. because,
One clock cycle time (= image data input rate)
1, the data to be processed is read from the memory 301, the arithmetic processing is performed by the adder 302, and the arithmetic result is written and stored in the memory 1 again.
As shown in FIG. 3, one processing time requires at least a memory read time + an addition processing time + a memory write time.

【0008】それゆえに、この発明の主たる目的は、ラ
ベル領域の周囲長を正確かつ高速にリアルタイムで算出
できるようなラベル領域周囲長算出装置を提供すること
である。
SUMMARY OF THE INVENTION Therefore, a main object of the present invention is to provide a label region perimeter calculating device capable of calculating the perimeter of a label region accurately and at high speed in real time.

【0009】[0009]

【課題を解決するための手段】請求項1に係る発明は、
ラベリングされた画像の周囲長を算出するラベル領域周
囲長算出装置であって、ラスタスキャン入力データ2×
2の局所領域において、各画素の値を判別してラベル領
域の境界を検出し、縦方向,横方向および斜め方向のい
ずれに隣接するかを判定するラベル領域境界点検出手段
と、検出された局所領域における境界点同士の隣接数を
加算する加算手段と、一方が読出し専用ポートとされ他
方が書込専用ポートとされ、加算された隣接数を記憶す
る2ポートメモリと、2ポートメモリからの読出しデー
タまたは加算手段の出力結果のいずれかを選択して2ポ
ートメモリに与えるパスと、入力された2ポートメモリ
のアドレスとして与えられるデータ値と既に入力されて
いる1クロック前のデータ値とを比較するとともに、入
力された2ポートメモリのアドレスとして与えられるデ
ータ値と既に入力されている2クロック前のデータ値と
の比較を行なってパスを選択するパス選択手段を備えて
構成される。
The invention according to claim 1 is
An apparatus for calculating a perimeter of a label area for calculating a perimeter of a labeled image, comprising:
In 2 of the local area, and detects the boundary of the label area to determine the value of each pixel in the vertical direction, and determines a label area boundary point detection means or adjacent to any of the transverse and oblique directions, is detected The number of neighbors between boundary points in the local area
Addition means for adding, one of which is a read-only port and the other
Is the write-only port and stores the added neighbor number.
2-port memory and data read from 2-port memory
Select either the output result of the
Path to port memory and input 2-port memory
The data value given as the address of the already entered
While comparing the data value one clock before
Data provided as the address of the input two-port memory.
Data value and the already input data value two clocks ago.
And a path selecting means for selecting a path by comparing the above .

【0010】請求項2に係る発明は、請求項1に係る発
明に加えて、加算手段の出力には、その出力結果を保持
して2ポートメモリの書込専用ポートに与える記憶素子
を含む。
[0010] The invention according to claim 2 is the invention according to claim 1.
In addition to the above, the output result of the addition means holds the output result
Element to be applied to write-only port of 2-port memory
including.

【0011】請求項3に係る発明は、請求項1または
の発明に加えて、2ポートメモリのある時刻での書込ア
ドレス値が1クロック後の書込アドレス値または2クロ
ック後の書込アドレス値と同じであるかを比較して、2
ポートメモリの書込を制御する書込制御手段を含む。
The invention according to claim 3 is the invention according to claim 1 or 2
In addition to the invention of the above, the write
If the dress value is the write address value one clock later or two
The write address value after the
Write control means for controlling writing to the port memory is included.

【0012】請求項4に係る発明は、請求項1または2
発明に加えて、ある時刻での読出しアドレス値が1ク
ロック前の読出しアドレス値または2クロック前の読出
アドレス値と同じであるかを比較して2ポートメモリの
読出しを制御する読出制御手段とを備えて構成される。
[0012] The invention according to claim 4 is the invention according to claim 1 or 2.
In addition to the invention of the above , the read address value at a certain time is 1
Read address value before lock or read two clocks before
Compare whether the address value is the same as the 2-port memory
Read control means for controlling reading.

【0013】[0013]

【0014】[0014]

【0015】[0015]

【作用】この発明に係るラベル領域周囲長算出装置は、
ラスタスキャン入力データの2×2の局所領域において
各画素の値を判別してラベル領域の境界を検出し、縦方
向,横方向および斜め方向のいずれに隣接するかを判定
し、検出された局所領域における境界点同士の隣接数を
縦方向,横方向および斜め方向別に加算手段によって加
算して、読出し専用ポートと書込専用ポートとを有する
2ポートメモリに記憶し、入力された2ポートメモリの
アドレスとして与えられるデータ値と既に入力されてい
る1クロック前のデータ値と比較するとともに、入力さ
れた2ポートメモリのアドレスとして与えられるデータ
値と既に入力されている2クロック前のデータ値との比
較を行ない、その結果に応じて2ポートメモリから読出
しデータまたは加算手段の出力のいずれかを選択して2
ポートメモリに与えるパスを選択する。
According to the present invention, there is provided a label region perimeter calculating device,
In the 2 × 2 local area of the raster scan input data, the value of each pixel is determined to detect the boundary of the label area, and it is determined whether the label area is adjacent in the vertical direction, the horizontal direction, or the diagonal direction. The number of adjacencies between boundary points in the region is added by the adding means for each of the vertical, horizontal, and oblique directions.
Has a read-only port and a write-only port
It is stored in the 2-port memory, and the input 2-port memory
Data value given as address and already entered
The value is compared with the data value one clock before
Data provided as the address of the allocated 2-port memory
The ratio of the value to the already input data value two clocks ago
Compare and read from 2-port memory according to the result
Select either the output data or the output of the adder
Select the path to be given to the port memory.

【0016】[0016]

【実施例】図1はこの発明の一実施例におけるラベル領
域周囲長検出回路を示すブロック図である。図1に示し
たラベル領域境界点検出回路は、ラスタスキャン入力デ
ータの2×2の局所領域において各画素の値を調べ、ラ
ベル領域の境界を検出して、境界点同士が縦方向,横方
向および斜め方向のいずれに隣接するかを判定して、そ
の局所領域における境界点同士の隣接数を縦方向,横方
向および斜め方向いずれに隣接するかを判定して、その
局所領域における境界点同士の隣接数を縦方向,横方向
および斜め方向別に算出する。さらに、その局所領域が
属するラベル領域を求める。
FIG. 1 is a block diagram showing a label area perimeter detecting circuit according to an embodiment of the present invention. The label area boundary point detection circuit shown in FIG. 1 checks the value of each pixel in a 2 × 2 local area of the raster scan input data, detects the boundary of the label area, and sets the boundary points in the vertical and horizontal directions. And the adjacent points in the local region are determined, and the number of adjacent points between the boundary points in the local region is determined in the vertical direction, the horizontal direction, or the diagonal direction. Is calculated for each of the vertical, horizontal, and oblique directions. Further, a label area to which the local area belongs is obtained.

【0017】より具体的には、ラベル領域境界点検出回
路は各画素の同期信号である画像クロック信号CLKに
同期して動作するフリップフロップ708〜711を含
む。フリップフロップ708には、ラベルデータLBD
がラスタスキャン入力される。有効な水平方向1ライン
分のラベルデータLBDのうち、最後のデータがフリッ
プフロップ708に入力された次のサイクルで、フリッ
プフロップ708と710はリセットされ、それぞれ値
「0」を保持する。
More specifically, the label area boundary point detection circuit includes flip-flops 708 to 711 which operate in synchronization with an image clock signal CLK which is a synchronization signal of each pixel. The flip-flop 708 has label data LBD
Is input in raster scan. The flip-flops 708 and 710 are reset and hold the value “0” in the next cycle after the last data of the label data LBD for one line in the effective horizontal direction is input to the flip-flop 708.

【0018】さらに、ラベル領域境界点検出回路RO
M,RAMあるいはレジスタファイルなどで構成され、
後述の図9に示すような入出力関係を有する記憶回路7
01を含む、フリップフロップ708と710がリセッ
トされたとき、マルチプレクサ702の出力が水平方向
1ライン最後の有効局所領域ラベル値とされる。これは
水平方向1ライン最後の有効画素の縦方向隣接を調べる
ためである。フリップフロップ708の出力はラインバ
ッファ707に与えられる。ラインバッファ707はデ
ータを水平方向1ライン遅延させるものである。さら
に、2値化回路704と705と706を含み、これら
の2値化回路は1以上のラベル値を有する画素を「1」
とし、ラベル値0を有する背景画素を「0」とし、記憶
回路701は、局所領域2×2の2値化された各画素値
から境界点を検出し、その境界点同士が縦方向,横方
向,斜め方向いずれに隣接するかを判定して縦方向,横
方向,斜め方向別に隣接数を出力する。フリップフロッ
プ708,709,710の出力はマルチプレクサ70
2に与えられる。マルチプレクサ702は制御回路70
3によって制御される。ここで、制御回路703の入力
(P0,P2)とマルチプレクサ702との出力の関係
を次の表に示す。表中の*は任意の項であり、0、1の
どちらでもよいことを示す記号である。
Further, a label area boundary point detection circuit RO
M, RAM or register file, etc.
A storage circuit 7 having an input / output relationship as shown in FIG.
When the flip-flops 708 and 710, including 01, are reset, the output of the multiplexer 702 becomes the last effective local area label value in the horizontal one line. This is to check the vertical adjacentness of the last effective pixel in one horizontal line. The output of flip-flop 708 is provided to line buffer 707. The line buffer 707 delays data by one line in the horizontal direction. It further includes binarization circuits 704, 705 and 706, which binarize pixels having one or more label values to "1".
The background pixel having the label value 0 is set to “0”, the storage circuit 701 detects a boundary point from each binarized pixel value of the local area 2 × 2, and the boundary points are set in the vertical and horizontal directions. It is determined whether the direction is adjacent in the direction or the diagonal direction, and the number of neighbors is output for each of the vertical direction, the horizontal direction, and the diagonal direction. The outputs of the flip-flops 708, 709, and 710 are
2 given. Multiplexer 702 includes control circuit 70
3 is controlled. Here, the following table shows the relationship between the input (P0, P2) of the control circuit 703 and the output of the multiplexer 702. * In the table is an optional term, and is a symbol indicating that either 0 or 1 may be used.

【0019】[0019]

【表1】 これにより、マルチプレクサ702の出力(LRLB)
は、局所領域2×2の属するラベル値となり、その局所
領域が属するラベル領域が求まる。
[Table 1] Thereby, the output of the multiplexer 702 (LRLB)
Is the label value to which the local area 2 × 2 belongs, and the label area to which the local area belongs is obtained.

【0020】図2はこの発明の一実施例のに係るラベル
領域周囲長算出装置のブロック図である。図1に示した
ラベル領域境界点検出回路部901に加えて、ラベル領
域同士の縦方向,横方向および斜め方向それぞれの隣接
数をラベル領域別に計数する計数回路部を示している。
計数回路部は一方のポートを読出し専用とし、他方のポ
ートを書込専用とした2ポートメモリ902を含む。2
ポートメモリ902のアドレスにはラベル値が対応し、
各ラベル領域の境界点同士の縦方向,横方向および斜め
方向それぞれの隣接数を格納する。たとえば、2ポート
メモリ902のデータビット幅が24bit(b23か
らb0,MSBはb23,LSBはb0)の場合、上位
8bit(b23からb16)には縦方向の隣接数を格
納し、b15からb8には横方向の隣接数を格納し、b
7からb0には斜め方向の隣接数を格納する。さらに、
計数回路部は加算回路903を含み、この加算回路90
3はラベル領域境界点同士の縦方向,横方向および斜め
方向それぞれの隣接数を加算する。2ポートメモリ90
2のb23からb16には縦方向の隣接数が割り当てら
れ、b15からb8には横方向の隣接数が割り当てら
れ、b7からb0には斜め方向の隣接数が割り当てられ
ているので、加算回路903もそれに対応したフォーマ
ットでデータを出力する。
FIG. 2 is a block diagram of a label area perimeter calculating device according to one embodiment of the present invention. In addition to the label area boundary point detection circuit section 901 shown in FIG. 1, a counting circuit section which counts the number of adjacent label areas in the vertical, horizontal, and oblique directions for each label area is shown.
The counting circuit section includes a two-port memory 902 in which one port is dedicated to reading and the other port is dedicated to writing. 2
A label value corresponds to the address of the port memory 902,
The adjacent numbers of the boundary points of each label area in the vertical, horizontal and oblique directions are stored. For example, when the data bit width of the 2-port memory 902 is 24 bits (b23 to b0, MSB is b23, LSB is b0), the number of adjacent vertical bits is stored in the upper 8 bits (b23 to b16), and Stores the number of neighbors in the horizontal direction, and b
7 to b0 store the number of oblique neighbors. further,
The counting circuit section includes an adding circuit 903.
3 adds the adjacent numbers of the label area boundary points in the vertical, horizontal, and oblique directions. 2-port memory 90
Since the number of adjacent pixels in the vertical direction is assigned to b23 to b16 of 2, the number of adjacent pixels in the horizontal direction is assigned to b15 to b8, and the number of adjacent pixels in the oblique direction is assigned to b7 to b0. Also outputs data in the corresponding format.

【0021】計数回路部は、さらにマルチプレクサ90
6〜911と、フリップフロップ915〜928と、比
較器904,905とを含む。フリップフロップ915
〜928はすべて各画素の同期信号である画像クロック
信号CLKに同期して動作し、フリップフロップ915
にはラベル領域境界点検出回路部901で調べられる局
所領域が属するラベルデータLRLBが入力される。比
較器904,905はそれぞれ2入力を有し、2つの入
力値が等しい場合には「H」レベル信号を出力し、等し
くない場合には「L」レベル信号を出力する。すなわ
ち、比較器904はフリップフロップ915と916の
出力を入力とし、クロックとともに入力してくるラベル
データとその1クロック前に入力したラベルデータとを
比較する。比較器905はフリップフロップ915と9
17の出力を入力とし、クロックとともに入力してくる
ラベルデータとその2クロック前に入力したラベルデー
タとを比較する。
The counting circuit further includes a multiplexer 90
6 to 911, flip-flops 915 to 928, and comparators 904 and 905. Flip-flop 915
928 operate in synchronization with an image clock signal CLK which is a synchronization signal of each pixel.
Is input with label data LRLB to which the local area examined by the label area boundary point detection circuit unit 901 belongs. Each of the comparators 904 and 905 has two inputs, and outputs an “H” level signal when the two input values are equal, and outputs an “L” level signal when the two input values are not equal. That is, the comparator 904 receives the outputs of the flip-flops 915 and 916 and compares the label data input together with the clock with the label data input one clock before. Comparator 905 has flip-flops 915 and 9
The output of 17 is input, and the label data input together with the clock is compared with the label data input two clocks before.

【0022】さらに、計数回路部は読出し制御回路91
2と書込制御回路913とを含む。読出し制御回路91
2は、処理中、フリップフロップ919と921の出力
(出力信号がそれぞれEQ12,EQ13)を基に、2
ポートメモリ902の出力イネーブル信号を生成する。
そして、読出し制御回路912は、出力信号EQ12と
EQ13がともに「L」レベルのとき(すなわち、フリ
ップフロップ916の出力値がフリップフロップ91
7,918の出力値と両方とも異なるとき)、2ポート
メモリ902の出力イネーブル信号をアクティブ
(「L」レベル)にする。ただし、水平方向1ライン分
の有効データのうち、最初のラベルデータが2ポートメ
モリ902の読出しアドレスとして与えられたとき、出
力信号EQ12とEQ13のレベルに関係なく、読出し
制御回路912は2ポートメモリ902の出力イネーブ
ル信号をアクティブにする。なぜなら、このとき、出力
信号EQ12は、最初の有効ラベルデータとその直前
(1クロック前)の非有効ラベルデータとの比較結果で
あり、出力信号EQ13は最初の有効ラベルデータとそ
の2クロック前の非有効ラベルデータとの比較結果なの
で、出力信号EQ12,EQ13ともに意味がなく、フ
リップフロップ923,924,925に最初に有効ラ
ベルデータの周囲長データが保持されていないからであ
る。
Further, the counting circuit section includes a read control circuit 91.
2 and a write control circuit 913. Read control circuit 91
2 is based on the outputs of the flip-flops 919 and 921 (the output signals are EQ12 and EQ13, respectively) during processing.
An output enable signal for the port memory 902 is generated.
The read control circuit 912 outputs the signal when the output signals EQ12 and EQ13 are both at the “L” level (that is, when the output value of the flip-flop 916 is
7 and 918), the output enable signal of the 2-port memory 902 is activated (“L” level). However, when the first label data of the effective data for one line in the horizontal direction is given as the read address of the two-port memory 902, the read control circuit 912 controls the two-port memory irrespective of the levels of the output signals EQ12 and EQ13. The output enable signal 902 is activated. Because, at this time, the output signal EQ12 is the result of comparison between the first valid label data and the immediately preceding (one clock before) non-valid label data, and the output signal EQ13 is the first valid label data and two clocks before the first valid label data. This is because the output signals EQ12 and EQ13 have no meaning because of the comparison result with the ineffective label data, and the flip-flops 923, 924, and 925 do not initially hold the perimeter data of the effective label data.

【0023】また、水平方向1ライン分の有効データの
うち、2番目のラベルデータが、2ポートメモリ902
の読出しアドレスとして与えられたとき、出力信号EQ
12が「L」レベルであれば、出力信号EQ13のレベ
ルにかかわず、読出し制御回路912は2ポートメモリ
902の出力イネーブル信号をアクティブにする。なぜ
なら、このとき、出力信号EQ13は最初から2番目の
有効ラベルデータとその2クロック前の非有効ラベルデ
ータとの比較結果なので意味がなく、また出力信号EQ
12が「L」レベルでもあるので、フリップフロップ9
23,924,925に、最初から2番目の有効ラベル
データの周囲長データが保持されていないためである。
出力信号EQ12が「H」レベルのとき、出力信号EQ
13のレベルにかかわらず、読出し制御回路912は2
ポートメモリ902の出力イネーブル信号を非アクティ
ブにする。
The second label data of the effective data for one line in the horizontal direction is stored in the two-port memory 902.
Output signal EQ when given as a read address of
If 12 is at the “L” level, the read control circuit 912 activates the output enable signal of the two-port memory 902 regardless of the level of the output signal EQ13. Because, at this time, the output signal EQ13 is a comparison result between the first valid label data from the beginning and the non-valid label data two clocks before that, and is meaningless.
12 is also at the “L” level, the flip-flop 9
23, 924, and 925 do not hold the perimeter data of the second effective label data from the beginning.
When output signal EQ12 is at "H" level, output signal EQ
13, the read control circuit 912 outputs 2
The output enable signal of the port memory 902 is made inactive.

【0024】書込制御回路913は、処理中フリップフ
ロップ919と921の出力を基に(出力信号はそれぞ
れEQ13,EQ23)、2ポートメモリ902の書込
イネーブル信号を生成する。すなわち、書込制御回路9
13は、出力信号EQ23とEQ13がともに「L」レ
ベルのとき(すなわち、フリップフロップ918の出力
値がフリップフロップ917,916の出力値と両方と
も異なるとき)、2ポートメモリ902の書込イネーブ
ル信号をアクティブ(「L」レベル)にする。ただし、
書込制御回路913は、水平方向1ライン分最後の有効
データが2ポートメモリ902の書込アドレスとして与
えられたとき、出力信号EQ23とEQ13のレベルに
関係なく、書込イネーブル信号をアクティブにする。な
ぜならば、このとき、出力信号EQ23は、最後の有効
データとその直後(1クロック後)の非有効ラベルデー
タとの比較結果であり、出力信号EQ13は最後の有効
データとその2クロック後の非有効ラベルデータとの比
較結果なので、出力信号EQ23,EQ13ともに意味
がなく、周囲長データを書込んでおかなければならない
からである。また、最後から2番目の有効データが2ポ
ートメモリ902の書込アドレスとして与えられたと
き、書込制御回路913は出力信号EQ23が「L」レ
ベルであれば、出力信号EQ13のレベルにかかわず、
書込イネーブル信号をアクティブにする。なせなら、こ
のとき、出力信号EQ13は最後から2番目の有効デー
タとその2クロック後の非有効データとの比較結果なの
で意味がなく、出力信号EQ23が「L」レベルでもあ
るため、次のサイクルでは異なる値の最後の有効データ
が、2ポートメモリ902の書込アドレスとなるからで
ある。
The write control circuit 913 generates a write enable signal for the two-port memory 902 based on the outputs of the flip-flops 919 and 921 during processing (output signals are EQ13 and EQ23, respectively). That is, the write control circuit 9
13 is a write enable signal for the two-port memory 902 when both the output signals EQ23 and EQ13 are at "L" level (that is, when the output value of the flip-flop 918 is different from both the output values of the flip-flops 917 and 916). Is activated (“L” level). However,
Write control circuit 913 activates a write enable signal when the last valid data for one horizontal line is given as a write address of two-port memory 902 irrespective of the levels of output signals EQ23 and EQ13. . Because, at this time, the output signal EQ23 is the result of comparison between the last valid data and the ineffective label data immediately after (one clock later), and the output signal EQ13 is the last valid data and the non-effective label data two clocks later. This is because the output signals EQ23 and EQ13 are meaningless for the comparison result with the valid label data, and the perimeter data must be written. When the last valid data is given as the write address of the two-port memory 902, if the output signal EQ23 is at the "L" level, the write control circuit 913 does not depend on the level of the output signal EQ13. ,
Activate the write enable signal. In this case, the output signal EQ13 is meaningless at this time because it is the result of comparing the last valid data with the last valid data two clocks after the last, and the output signal EQ23 is also at the "L" level. This is because the last valid data of a different value becomes the write address of the two-port memory 902.

【0025】なお、書込制御回路913は、出力信号E
Q23が「H」レベルのとき、出力信号EQ13のレベ
ルにかかわらず、2ポートメモリ902の書込イネーブ
ル信号を非アクティブにする。なぜならば、次のサイク
ルで最後から2番目の有効データと同じ値である最後の
有効データが2ポートメモリ902の書込アドレスとし
て与えられ、周囲長データが書込まれるためである。さ
らに、マルチプレクサ906を制御するためにパス制御
回路914が設けられる。このパス制御回路914はフ
リップフロップ920,922の出力(出力信号がそれ
ぞれEQ23,EQ24)を基に、マルチプレクサ90
6を制御する。すなわち、パス制御回路914は出力信
号EQ24のレベルに関係なく、出力信号EQ23が
「H」レベルのとき、フリップフロップ925の出力を
加算回路903の入力に接続する(パス1)。出力信号
EQ23が「L」レベルであり、出力信号EQ24が
「H」レベルのとき、パス制御回路914はフリップフ
ロップ923の出力を加算回路903の入力に接続する
(パス2)。出力信号EQ23とEQ24がともに
「L」レベルのとき、パス制御回路914はフリップフ
ロップ924の出力を加算回路903の入力に接続する
(パス3)。
Note that the write control circuit 913 outputs the output signal E
When Q23 is at the "H" level, the write enable signal of the two-port memory 902 is made inactive regardless of the level of the output signal EQ13. This is because, in the next cycle, the last valid data having the same value as the second last valid data is given as the write address of the two-port memory 902, and the peripheral length data is written. Further, a path control circuit 914 is provided to control the multiplexer 906. The path control circuit 914 uses the outputs of the flip-flops 920 and 922 (the output signals are EQ23 and EQ24, respectively) for the multiplexer 90.
6 is controlled. That is, the path control circuit 914 connects the output of the flip-flop 925 to the input of the addition circuit 903 when the output signal EQ23 is at the “H” level, regardless of the level of the output signal EQ24 (path 1). When the output signal EQ23 is at the “L” level and the output signal EQ24 is at the “H” level, the path control circuit 914 connects the output of the flip-flop 923 to the input of the addition circuit 903 (path 2). When both the output signals EQ23 and EQ24 are at the “L” level, the path control circuit 914 connects the output of the flip-flop 924 to the input of the addition circuit 903 (path 3).

【0026】水平方向1ライン分の有効データのうち、
最初のラベルデータがフリップフロップ917に保持さ
れたとき、出力信号EQ23とEQ24のレベルに関係
なくフリップフロップ924の出力を加算回路903の
入力に接続する。なぜならば、このとき、出力信号EQ
23は最初の有効ラベルデータとその直前(1クロック
前)の非有効ラベルデータとの比較結果であり、出力信
号EQ24は最初の有効ラベルデータとその2クロック
前の非有効ラベルデータとの比較結果なので、出力信号
EQ23,EQ24ともに意味がなく、最初の有効ラベ
ルデータの周囲長データはフリップフロップ924にの
み保持されているからである。また、2番目の有効ラベ
ルデータがフリップフロップ917に保持されたとき、
出力信号EQ23が「L」レベルであれば、出力信号E
Q24のレベルに関係なく、フリップフロップ924の
出力を加算回路903の入力に接続する。なぜならば、
このとき、出力信号EQ24は最初の有効ラベルデータ
と2クロック前の非有効ラベルデータとの比較結果なの
で意味がなく、また出力信号EQ23が「L」レベルな
ので、最初から2番目の有効ラベルデータの周囲長デー
タはフリップフロップ924にのみ保持されているから
である。出力信号EQ23が「H」レベルのときは、出
力信号EQ24のレベルに関係なく、フリップフロップ
925の出力を加算回路903の入力に接続する。
Of the effective data for one line in the horizontal direction,
When the first label data is held in the flip-flop 917, the output of the flip-flop 924 is connected to the input of the adder circuit 903 regardless of the levels of the output signals EQ23 and EQ24. Because, at this time, the output signal EQ
23 is a comparison result between the first effective label data and the immediately preceding (one clock before) non-effective label data, and an output signal EQ24 is a comparison result between the first effective label data and the non-effective label data two clocks before the same. Therefore, both the output signals EQ23 and EQ24 have no meaning, and the perimeter data of the first valid label data is held only in the flip-flop 924. When the second valid label data is held in the flip-flop 917,
If the output signal EQ23 is at “L” level, the output signal E
Regardless of the level of Q24, the output of flip-flop 924 is connected to the input of adder circuit 903. because,
At this time, the output signal EQ24 has no meaning because it is the result of comparison between the first valid label data and the non-valid label data two clocks before. In addition, since the output signal EQ23 is at the "L" level, the output signal EQ24 has the low level. This is because the circumference length data is held only in the flip-flop 924. When the output signal EQ23 is at “H” level, the output of the flip-flop 925 is connected to the input of the adder circuit 903 regardless of the level of the output signal EQ24.

【0027】上述のごとく構成したラベル領域周囲長算
出装置の実施例の動作について以下に説明する。
The operation of the embodiment of the apparatus for calculating the perimeter of the label area constructed as described above will be described below.

【0028】まず、2ポートメモリ902の内容を0ク
リアする。マルチプレクサ909,910,911を制
御し、CPUなどから2ポートメモリ902の全アドレ
スに0を書込む。あるいは、クリア端子がある場合、そ
れを用いてもよい。次に、すべてのフリップフロップお
よびラインバッファ707の内容を0クリアする。
First, the contents of the two-port memory 902 are cleared to zero. The multiplexers 909, 910, and 911 are controlled, and 0 is written to all addresses of the two-port memory 902 from the CPU or the like. Alternatively, if there is a clear terminal, it may be used. Next, the contents of all the flip-flops and the line buffer 707 are cleared to zero.

【0029】次に、各ラベル領域の周囲長算出処理を行
なう。このとき、マルチプレクサ907,908を制御
して、2ポートメモリ902の読出しイネーブル端子O
*には読出し制御回路912の出力を入力し、2ポー
トメモリ902の読出しアドレス端子ARにはマルチプ
レクサ908を介してフリップフロップ916の出力を
入力する。また、マルチプレクサ910,909,91
1を制御し、2ポートメモリ902の書込イネーブル端
子WE* には書込制御回路913の出力を入力し、2ポ
ートメモリ902の書込アドレス端子AWにはマルチプ
レクサ909を介してフリップフロップ918の出力を
入力し、2ポートメモリ902の書込データ端子DWに
は、マルチプレクサ911を介してフリップフロップ9
25の出力を入力する。
Next, a process of calculating the perimeter of each label area is performed. At this time, the multiplexers 907 and 908 are controlled to control the read enable terminal O of the two-port memory 902.
The output of the read control circuit 912 is input to E *, and the output of the flip-flop 916 is input to the read address terminal AR of the two-port memory 902 via the multiplexer 908. Multiplexers 910, 909, 91
1, the output of the write control circuit 913 is input to the write enable terminal WE * of the two-port memory 902, and the write address terminal AW of the two-port memory 902 is connected to the flip-flop 918 via the multiplexer 909. The output is input and the flip-flop 9 is connected to the write data terminal DW of the two-port memory 902 via the multiplexer 911.
Input 25 outputs.

【0030】図3は8連結ラベルリング領域の周囲長を
ラスタスキャン入力データより計測する方法を示す図で
あり、図4は4連結ラベルリング領域の周囲長をラスタ
スキャン入力データより計測する方法を示す図であり、
図5〜図7は図8に示したような8連結ラベル画面をラ
スタスキャン入力した場合の、ラベル領域周囲長算出処
理時のタイムチャートを示す。特に、図5は入力画面1
行目(y=0)時のタイムチャートであり、図6は入力
画面2行目(y=1)時のタイムチャートであり、図7
は入力画面最終行目(y=17)時のタイムチャートで
ある。
FIG. 3 is a diagram showing a method for measuring the peripheral length of an 8-connected label ring area from raster scan input data, and FIG. 4 is a method for measuring the peripheral length of a 4-connected label ring area from raster scan input data. FIG.
FIG. 5 to FIG. 7 are time charts at the time of label area perimeter calculation processing in the case of performing raster scan input on the 8-connected label screen as shown in FIG. In particular, FIG.
FIG. 6 is a time chart for the second row (y = 1) of the input screen, and FIG. 7 is a time chart for the second row (y = 1) of the input screen.
Is a time chart at the time of the last line (y = 17) of the input screen.

【0031】ここで8連結ラベリング領域と4ラベルリ
ング領域とについて説明する。8連結ラベルリング領域
は、図3に示すように、中央の領域Paに対して、縦方
向Pb、Pc、横方向Pd、Pe、斜め方向Pf、Pg
とPh、Piの連結ラベルリングにより周囲長を計測す
る。すなわち、2×2の局所領域P0〜P3が0である
か*(0でないラベル値)であるかに応じて、縦、横、
斜めの周囲長を計測する。
Here, the 8-connected labeling area and the 4-label ring area will be described. As shown in FIG. 3, the eight connected label ring regions are arranged such that the central region Pa is in the vertical direction Pb, Pc, the horizontal direction Pd, Pe, the oblique direction Pf, Pg.
And the peripheral length is measured using the linked label rings of Ph and Pi. That is, depending on whether the 2 × 2 local areas P0 to P3 are 0 or * (a label value other than 0), the vertical, horizontal,
Measure the oblique perimeter.

【0032】4連結ラベルリング領域は、図4に示す中
央の領域Paに対して、縦方向Pb、Pc、縦方向P
d、Peの連結ラベルリングにより周囲長を計測する。
すなわち、8連結ラベルリング領域と同様にして、2×
2の局所領域P0〜P3が0であるか、*(0でないラ
ベル値)であるかに応じて、縦、横の周囲長を計測す
る。ただし、4連結ラベルリングの場合、2×2の局所
領域内に異なるラベル値が存在する可能性があり、それ
は斜めに2個のみのときであるが、その場合は周囲長を
0とする。
The 4-connected label ring area is different from the central area Pa shown in FIG.
The perimeter is measured by the d and Pe connecting label rings.
That is, in the same manner as the 8-connected label ring area, 2 ×
The vertical and horizontal perimeters are measured according to whether the two local regions P0 to P3 are 0 or * (a label value other than 0). However, in the case of a 4-connected label ring, there is a possibility that different label values exist in a 2 × 2 local area, which is a case where only two diagonally exist, in which case the peripheral length is set to 0.

【0033】図5〜図7において、画像クロック信号C
LK,各画素のラベルデータLBD,水平方向1ライン
分のラベルデータ有効信号HEN* が「L」レベルのと
き、ラベルデータLBDは有効となる。2ポートメモリ
902の読出しアドレスARはフリップフロップ916
の出力であり、フリップフロップ915,917の出力
も併わせて示している。出力信号EQ12,EQ23,
EQ13,EQ24は前述のとおりである。さらに、2
ポートメモリ902の読出しイネーブル信号OE* はア
クティブで「L」レベルとなり、2ポートメモリ902
の書込イネーブル信号WE* はアクティブで「L」レベ
ルになる。2ポートメモリ902の書込アドレスAWは
フリップフロップ918の出力であり、2ポートメモリ
902の書込データDWはフリップフロップ925の出
力である。なお、信号波形中の数字は16進数でデータ
値を示している。
In FIG. 5 to FIG. 7, the image clock signal C
When LK, the label data LBD of each pixel, and the label data valid signal HEN * for one horizontal line are at the “L” level, the label data LBD is valid. The read address AR of the two-port memory 902 is a flip-flop 916
And the outputs of the flip-flops 915 and 917 are also shown. The output signals EQ12, EQ23,
EQ13 and EQ24 are as described above. In addition, 2
The read enable signal OE * of the port memory 902 is active and becomes "L" level, and the 2-port memory 902
Is of the write enable signal WE * becomes "L" level in active. The write address AW of the two-port memory 902 is the output of the flip-flop 918, and the write data DW of the two-port memory 902 is the output of the flip-flop 925. The numbers in the signal waveform indicate data values in hexadecimal.

【0034】次に、ラベル領域周囲長算出処理時の動作
について説明する。各画素のラベルデータLBDが画像
クロック信号CLKに同期して境界点検出回路部901
にラスタスキャン入力される。境界点検出回路部901
は2×2の局所領域において各画素のラベル値を調べ、
ラベル領域の境界を検出し、境界点同士が縦方向,横方
向,斜め方向いずれに隣接するかを判定し、その局所領
域における境界点同士の隣接数を縦方向,横方向および
斜め方向別に算出し、フリップフロップ926に出力す
る。さらに、境界点検出回路部901は、その局所領域
が属するラベル領域を求め(LRLB)、フリップフロ
ップ915に出力する。
Next, the operation in the label area perimeter calculation processing will be described. The label data LBD of each pixel is synchronized with the image clock signal CLK and the boundary point detection circuit 901
Is input in a raster scan. Boundary point detection circuit section 901
Examines the label value of each pixel in a 2 × 2 local area,
Detects the boundaries of label areas, determines whether the boundary points are adjacent in the vertical, horizontal, or diagonal directions, and calculates the number of adjacent boundary points in the local area for each of the vertical, horizontal, and diagonal directions Then, the data is output to the flip-flop 926. Further, the boundary point detection circuit section 901 obtains a label area to which the local area belongs (LRLB), and outputs the label area to the flip-flop 915.

【0035】一方、図2に示した計数回路部では、順次
入力されてくるデータを1クロック前および2クロック
前に入力したデータと比較する。その比較結果を基に、
2ポートメモリ902の読み書きおよびマルチプレクサ
906の制御を行なう。すなわち、2ポートメモリ90
2の読出しアドレスとして与えられるデータ(フリップ
フロップ916の出力)が、1クロック前のデータ(フ
リップフロップ917の出力)とも、2クロック前のデ
ータ(フリップフロップ918の出力)とも異なってい
れば(EQ12=EQ13=「L」),そのデータ(フ
リップフロップ916の出力)の最新周囲長データを2
ポートメモリ902から読出す。そして、次のサイクル
でフリップフロップ924にデータを保持し、マルチプ
レクサ906を制御して(EQ23=EQ24=
「L」)、フリップフロップ924の出力を加算回路9
03に入力する(パス3)。
On the other hand, the counting circuit section shown in FIG. 2 compares sequentially input data with data input one clock before and two clocks before. Based on the comparison result,
The read / write of the two-port memory 902 and the control of the multiplexer 906 are performed. That is, the two-port memory 90
If the data (output of the flip-flop 916) given as the second read address is different from the data one clock before (the output of the flip-flop 917) and the data two clocks before (the output of the flip-flop 918) (EQ12) = EQ13 = “L”), and the latest peripheral length data of the data (output of the flip-flop 916) is 2
Read from port memory 902. Then, in the next cycle, the data is held in the flip-flop 924, and the multiplexer 906 is controlled (EQ23 = EQ24 =
"L"), the output of the flip-flop 924 is added to the addition circuit 9
Enter 03 (pass 3).

【0036】2ポートメモリ902の読出しアドレスと
して与えられるデータ(フリップフロップ916の出
力)が、1クロック前のデータ(フリップフロップ91
7の出力)と一致していれば(EQ12=「H」)、そ
のデータ(フリップフロップ916の出力)の最新周囲
長データは、加算回路903が出力中であるため、2ポ
ートメモリ902からデータを読出す必要はなく、次の
サイクルで加算回路903の出力をフリップフロップ9
25が保持し、マルチプレクサ906を制御し(EQ2
3=「H」)、フリップフロップ925の出力を加算回
路903に入力する(パス1)。2ポートメモリ902
の読出しアドレスとして与えられるデータ(フリップフ
ロップ916の出力)が2クロック前のデータ(フリッ
プフロップ921の出力)と一致し、1クロック前のデ
ータ(フリップフロップ917の出力)と異なっていれ
ば(EQ13=「H」,EQ12=「L」)、そのデー
タ(フリップフロップ916の出力)の最新周囲長デー
タはフリップフロップ925に保持されているので、2
ポートメモリ902からデータを読出す必要はなく、次
のサイクルでフリップフロップ923がフリップフロッ
プ925の出力を保持し、パス制御回路914はマルチ
プレクサ906を制御し(EQ24=「H」,EQ23
=「L」)、フリップフロップ923の出力を加算回路
903に入力する(パス2)。
Data (output of flip-flop 916) provided as a read address of two-port memory 902 is changed to data (clock of flip-flop 91) one clock before.
7 (the output of the flip-flop 916), the latest perimeter data of the data (the output of the flip-flop 916) is output from the 2-port memory 902 because the addition circuit 903 is outputting the data. Need not be read out, and in the next cycle, the output of the adder
25 and controls the multiplexer 906 (EQ2
3 = “H”), and inputs the output of the flip-flop 925 to the addition circuit 903 (pass 1). 2-port memory 902
If the data (output of flip-flop 916) given as the read address of the data coincides with the data (output of flip-flop 921) two clocks earlier and is different from the data (output of flip-flop 917) one clock earlier (EQ13) = “H”, EQ12 = “L”), and the latest perimeter data of the data (the output of the flip-flop 916) is held in the flip-flop 925.
There is no need to read data from the port memory 902, the flip-flop 923 holds the output of the flip-flop 925 in the next cycle, and the path control circuit 914 controls the multiplexer 906 (EQ24 = “H”, EQ23).
= “L”), the output of the flip-flop 923 is input to the addition circuit 903 (pass 2).

【0037】2ポートメモリ902でのデータの書込に
関しては、フリップフロップ918の出力値がフリップ
フロップ917,916の出力値の両方ともと異なると
き(EQ23=EQ13=「L」レベルのとき)、フリ
ップフロップ925の出力値を2ポートメモリ902に
書込む。フリップフロップ918の出力値がフリップフ
ロップ917の出力値と等しいとき(EQ23=「H」
レベルのとき)、次のサイクルで書込めばよいので書込
まない。また、フリップフロップ918の出力値がフリ
ップフロップ916と等しいとき(EQ13=「H」レ
ベルのとき)、2サイクル後(2クロック後)で書込め
ばよいので書込まない。このような動作を続けることで
ラベル領域ごとに、周囲長データが2ポートメモリ90
2に格納される。
Regarding data writing in the two-port memory 902, when the output value of the flip-flop 918 is different from both of the output values of the flip-flops 917 and 916 (when EQ23 = EQ13 = “L” level) The output value of the flip-flop 925 is written to the two-port memory 902. When the output value of the flip-flop 918 is equal to the output value of the flip-flop 917 (EQ23 = “H”)
At the time of the level), it is not necessary to write in the next cycle. When the output value of the flip-flop 918 is equal to that of the flip-flop 916 (when the EQ13 is at the “H” level), writing is performed two cycles later (two clocks later). By continuing such an operation, the perimeter data is stored in the 2-port memory 90 for each label area.
2 is stored.

【0038】最後の水平方向有効ライン(y=17)の
画素データが入力し終えると、最後の水平方向有効ライ
ン(y=17)の横方向隣接数を算出するために、水平
方向有効画素数と同じ分、値「0」のラベルデータを入
力する。対象とする画像データに対して、ラベル領域周
囲長算出処理が終了すると、マルチプレクサ907,9
08を制御して、2ポートメモリ902から結果を読出
す。
When the input of the pixel data of the last horizontal effective line (y = 17) is completed, the number of horizontal effective pixels is calculated in order to calculate the horizontal adjacent number of the last horizontal effective line (y = 17). The label data having the value “0” is input for the same amount as the above. When the label area perimeter calculation processing is completed for the target image data, the multiplexers 907 and 9
08 is read from the two-port memory 902.

【0039】上述のごとく、この発明の一実施例では、
ラベル領域における境界点同士の隣接数を縦方向,横方
向および斜め方向別に算出するようにしたので、従来例
よりも正確に周囲長を求めることができる。さらに、図
2に示したこの発明の一実施例のクロックサイクル時間
はメモリ読出し時間,メモリ書込時間あるいは決算処理
時間のいずれか長いほう程度なので、従来例よりも2倍
以上高速処理できる。そして、たとえば図8に示すよう
な8連結ラベル付け連結領域で、縦、横、斜め方向につ
いてそれぞれのラベル長を求めることができる。
As described above, in one embodiment of the present invention,
Since the number of adjacent border points in the label area is calculated for each of the vertical, horizontal, and oblique directions, the perimeter can be obtained more accurately than in the conventional example. Further, the clock cycle time of the embodiment of the present invention shown in FIG. 2 is about the longer of the memory read time, the memory write time and the settlement processing time, so that the processing can be performed at least twice as fast as the conventional example. Then, for example, in an eight-link labeling connection area as shown in FIG. 8, the respective label lengths in the vertical, horizontal, and oblique directions can be obtained.

【0040】[0040]

【発明の効果】以上のように、この発明によれば、ラス
タスキャン入力データの2×2の局所領域において、各
画素の値を判別してラベル領域の境界を検出し、縦方
向,横方向および斜め方向のいずれに隣接するかを判定
し、局所領域における境界点同士の隣接数を縦方向,横
方向および斜め方向別に加算して2ポートメモリに記憶
し、2ポートメモリのアドレスとして与えられるデータ
値と1クロック前のデータ値および2クロック前のデー
タ値との比較をそれぞれ行なって2ポートメモリからの
読出しデータまたは加算結果のいずれかを選択して2ポ
ートメモリに与えるようにしたので、ラベル領域ごとに
その周囲長を正確かつ高速リアルタイムに算出すること
ができ、ラベル領域算出処理装置の機能性能を高めるこ
とができる。
As described above, according to the present invention, in the 2 × 2 local area of raster scan input data, the value of each pixel is determined to detect the boundary of the label area, and the vertical and horizontal directions are detected. And the diagonal direction is determined, and the number of adjacent points between the boundary points in the local area is added in the vertical, horizontal, and diagonal directions and stored in the two-port memory.
And data given as a 2-port memory address
Value and the data value one clock before and the data two clocks before.
Data from the 2-port memory.
Select either the read data or the addition result and
Since the so that given to Tomemori, the perimeter can be calculated accurately and at high speed real-time for each label area
Can be, it is Rukoto enhance the function performance of label area calculation processing device.

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

【図1】この発明の一実施例におけるラベル領域境界点
検出回路の一例を示すブロック図である。
FIG. 1 is a block diagram showing an example of a label area boundary point detection circuit according to one embodiment of the present invention.

【図2】この発明の一実施例に係るラベル領域周囲長算
出装置の一例を示すブロック図である。
FIG. 2 is a block diagram illustrating an example of a label region perimeter calculating device according to an embodiment of the present invention.

【図3】8連結ラベルリング領域の周囲長をラスタスキ
ャン入力データより計測する方法を説明するための図で
ある。
FIG. 3 is a diagram for explaining a method of measuring the perimeter of an 8-connected label ring area from raster scan input data.

【図4】4連結ラベルリング領域の周囲長をラスタスキ
ャン入力データより計測する方法を説明するための図で
ある。
FIG. 4 is a diagram for explaining a method of measuring the perimeter of a 4-connected label ring area from raster scan input data.

【図5】y=0の処理タイムチャートを示す図である。FIG. 5 is a diagram showing a processing time chart when y = 0.

【図6】y=1の処理タイムチャートを示す図である。FIG. 6 is a diagram showing a processing time chart when y = 1.

【図7】y=17の処理タイムチャートを示す図であ
る。
FIG. 7 is a diagram showing a processing time chart when y = 17.

【図8】入力ラベル画像を示す図である。FIG. 8 is a diagram showing an input label image.

【図9】図1に示した記憶回路の入出力関係を示す図で
ある。
FIG. 9 is a diagram illustrating an input / output relationship of the storage circuit illustrated in FIG. 1;

【図10】従来のラベル領域周囲長算出装置の概略ブロ
ック図である。
FIG. 10 is a schematic block diagram of a conventional label region perimeter calculating device.

【図11】図10に示したラベル領域周囲長算出装置に
よるラベル領域周囲長計測方法を説明するための図であ
る。
FIG. 11 is a diagram for explaining a label area circumference measurement method by the label area circumference calculation apparatus shown in FIG. 10;

【図12】図10に示した計数回路の具体的なブロック
図である。
12 is a specific block diagram of the counting circuit shown in FIG.

【図13】図12に示した計数回路の処理タイムチャー
トを示す図である。
13 is a diagram showing a processing time chart of the counting circuit shown in FIG. 12;

【符号の説明】[Explanation of symbols]

701 記憶回路 702 マルチプレクサ 703 制御回路 704〜706 2値化回路 707 ラインバッファ 708〜711 フリップフロップ 901 ラベル領域境界点検出回路部 902 2ポートメモリ 903 加算回路 904、905 比較器 906〜911 マルチプレクサ 912 読出し制御回路 913 書込み制御回路 914 パス制御回路 915〜928 フリップフロップ 701 Storage circuit 702 Multiplexer 703 Control circuit 704-706 Binarization circuit 707 Line buffer 708-711 Flip-flop 901 Label area boundary point detection circuit section 902 2-port memory 903 Addition circuit 904, 905 Comparator 906-911 Multiplexer 912 Read control Circuit 913 Write control circuit 914 Path control circuit 915 to 928 Flip-flop

───────────────────────────────────────────────────── フロントページの続き (56)参考文献 特開 昭59−174977(JP,A) 特開 平5−20456(JP,A) 特開 昭62−70971(JP,A) 実開 昭58−195810(JP,U) (58)調査した分野(Int.Cl.6,DB名) G06T 7/00 ──────────────────────────────────────────────────続 き Continuation of the front page (56) References JP-A-59-174977 (JP, A) JP-A-5-20456 (JP, A) JP-A-62-70971 (JP, A) 195810 (JP, U) (58) Field surveyed (Int. Cl. 6 , DB name) G06T 7/00

Claims (4)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 ラベリングされた画像の周囲長を算出す
るラベル領域周囲長算出装置であって、 ラスタスキャン入力データ2×2の局所領域において、
各画素の値を判別してラベル領域の境界を検出し、縦方
向,横方向および斜め方向のいずれに隣接するかを判定
するラベル領域境界点検出手段、 前記ラベル領域境界点検出手段によって検出された前記
局所領域における境界点同士の隣接数を加算する加算手
段、 一方が読出し専用ポートとされ、他方が書込専用ポート
とされ、前記加算手段によって加算された隣接数を記憶
する2ポートメモリ、 前記2ポートメモリからの読出しデータまたは前記加算
手段の出力結果のいずれかを選択して前記2ポートメモ
リに与えるパス、および入力された前記2ポートメモリ
のアドレスとして与えられるデータ値と既に入力されて
いる1クロック前のデータ値とを比較するとともに、入
力された前記2ポートメモリのアドレスとして与えられ
るデータ値と既に入力されている2クロック前のデータ
値との比較を行なって、前記パスを選択するパス選択手
段を備えた、 ラベル領域周囲長算出装置。
An apparatus for calculating a perimeter of a label area for calculating a perimeter of a labeled image, comprising: a local area of raster scan input data 2 × 2;
Detecting a boundary of the label area to determine the value of each pixel, the vertical direction, horizontal direction and label area boundary point detection hand stage determines adjacent to either diagonal direction, it is detected by the label area boundary point detection means Adding means for adding the number of adjacencies between boundary points in the local area
Stage, one is read-only port, the other is write-only port
And stores the number of neighbors added by the adding means.
2-port memory, read data from the 2-port memory or the addition
Select one of the output results of the
Path given to the memory and the input 2-port memory
The data value given as the address of the already entered
While comparing the data value one clock before
Given as the address of the two-port memory
Data value and data already input two clocks ago
A path selection procedure for comparing with a value and selecting the path.
A label region perimeter calculation device having a step.
【請求項2】 さらに、前記加算手段の出力には、その
出力結果を保持して前記2ポートメモリの書込専用ポー
トに与える記憶素子を含む、請求項1のラベル領域周囲
長算出装置。
2. An output of said adding means,
The output result is held and the write-only port of the 2-port memory is
2. The apparatus according to claim 1, further comprising a storage element provided to the label area.
【請求項3】 さらに、前記2ポートメモリのある時刻
での書込アドレス値が1クロック後の書込アドレス値ま
たは2クロック後の書込アドレス値と同じであるかを比
較して、前記2ポートメモリの書込を制御する書込制御
手段を含む、請求項1または2のラベル領域周囲長算出
装置。
3. The method according to claim 2, further comprising the step of :
The write address value at
Or the same as the write address value two clocks later.
Write control for controlling writing of the two-port memory
Comprising means, according to claim 1 or 2 label area perimeter calculator.
【請求項4】 さらに、ある時刻での読出しアドレス値
が1クロック前の読出アドレス値または2クロック前の
読出しアドレス値と同じであるかを比較して、前記2ポ
ートメモリの読出を制御する読出制御手段を含む、請求
1または2のラベル領域周囲長算出装置。
4. A read address value at a certain time.
Is the read address value one clock before or
Compare whether the read address value is the same as the read address value.
Including a read control means for controlling the reading of Tomemori of claim 1 or 2 label area perimeter calculator.
JP5217578A 1993-09-01 1993-09-01 Label area perimeter calculation device Expired - Fee Related JP2973789B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5217578A JP2973789B2 (en) 1993-09-01 1993-09-01 Label area perimeter calculation device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5217578A JP2973789B2 (en) 1993-09-01 1993-09-01 Label area perimeter calculation device

Publications (2)

Publication Number Publication Date
JPH0773322A JPH0773322A (en) 1995-03-17
JP2973789B2 true JP2973789B2 (en) 1999-11-08

Family

ID=16706480

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5217578A Expired - Fee Related JP2973789B2 (en) 1993-09-01 1993-09-01 Label area perimeter calculation device

Country Status (1)

Country Link
JP (1) JP2973789B2 (en)

Also Published As

Publication number Publication date
JPH0773322A (en) 1995-03-17

Similar Documents

Publication Publication Date Title
JPH023229B2 (en)
JP2750226B2 (en) How to set the binarization threshold
JP3372111B2 (en) Watt hour meter character recognition device
JP2973789B2 (en) Label area perimeter calculation device
US6643395B1 (en) Defect information processing apparatus and method
US6597805B1 (en) Visual inspection method for electronic device, visual inspecting apparatus for electronic device, and record medium for recording program which causes computer to perform visual inspecting method for electronic device
JPH0129643Y2 (en)
JPH0795345B2 (en) Image processing method
JPH08178795A (en) Lcd panel detect inspection instrument
JPH11185037A (en) Device and method for processing defect information
JPS5994181A (en) Pattern recognizing device
JP2625429B2 (en) Image processing method
JP3009230B2 (en) Correlation processing device, correlation processing method, and image processing device
JPS5914782B2 (en) Binary pattern digitization processing method
JP2753427B2 (en) Binary threshold setting device
JP3041102B2 (en) 3D image processing device
JP3003925B2 (en) Defect inspection equipment
JP2861435B2 (en) Pipeline type arithmetic unit
JP2973788B2 (en) Image processing device
JPS6230114Y2 (en)
JP2001243419A (en) Image data reader
JPH07113975B2 (en) Center of gravity detector
JPH09167964A (en) Image input circuit for image processor
JPS63221487A (en) Threshold level detector
JPH0716106U (en) Outline discriminator

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 19990803

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080903

Year of fee payment: 9

LAPS Cancellation because of no payment of annual fees