JP2973788B2 - Image processing device - Google Patents

Image processing device

Info

Publication number
JP2973788B2
JP2973788B2 JP5217370A JP21737093A JP2973788B2 JP 2973788 B2 JP2973788 B2 JP 2973788B2 JP 5217370 A JP5217370 A JP 5217370A JP 21737093 A JP21737093 A JP 21737093A JP 2973788 B2 JP2973788 B2 JP 2973788B2
Authority
JP
Japan
Prior art keywords
output
flip
value
coordinate
input
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
JP5217370A
Other languages
Japanese (ja)
Other versions
JPH0773314A (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 JP5217370A priority Critical patent/JP2973788B2/en
Publication of JPH0773314A publication Critical patent/JPH0773314A/en
Application granted granted Critical
Publication of JP2973788B2 publication Critical patent/JP2973788B2/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 image processing apparatus,
In particular, the present invention relates to an image processing apparatus that calculates a circumscribed rectangle of a connected region at high speed and in real time.

【0002】[0002]

【従来の技術】画像処理を利用した部品検査や医療分野
における血球検査,細胞診断などにおいては、画像中に
散在する複数の物体の領域を識別し、領域ごとにその大
きさ,位置,周囲長などの図形的特徴を算出する処理が
必要である。
2. Description of the Related Art In a component inspection using image processing, a blood cell inspection in the medical field, a cell diagnosis, etc., regions of a plurality of objects scattered in an image are identified, and the size, position, and perimeter of each region are determined. It is necessary to perform a process for calculating a graphic feature such as the above.

【0003】領域ごとに位置や大きさを知る場合は、そ
の領域の外接四角形を求めることにより、当該領域を他
の背景,領域などから分離する必要がある。すなわち、
入力画像がたとえば図7(a)に示すごときデジタル位
置画像であったとする。図7において、実線で区切られ
た各格子は、それぞれ1画素を示しており、各画素ごと
に「0」または「1」の明度値を有する。そして、実線
内の斜線で示される明度値が「1」の連続する2つの大
きな部分101,102がそれぞれ対象とする物体に対
応する領域を示している。以後、上述のような連続する
各領域を連結領域と呼ぶ。そして、図7(a)に示す入
力画素から、各連結領域101,102に対応する外接
四角形を、図7(b)および(c)に示す外接四角形1
03,104のように求める必要がある。図7(b),
(c)からわかるように、各連結領域101,102の
外接四角形103,104を求めることは、入力画像上
において水平方向をx,垂直方向をy方向として、図7
(b)または(c)のように、各連結領域の最小,最大
のx座標および最小,最大のy座標を求めることに等し
い。
In order to know the position and size of each area, it is necessary to separate the area from other backgrounds, areas, and the like by obtaining a circumscribed rectangle of the area. That is,
It is assumed that the input image is a digital position image as shown in FIG. In FIG. 7, each grid sectioned by a solid line indicates one pixel, and each pixel has a brightness value of “0” or “1”. Then, two continuous large portions 101 and 102 each having a lightness value of “1” indicated by a diagonal line in the solid line indicate an area corresponding to the target object. Hereinafter, each of the continuous regions as described above is referred to as a connected region. Then, from the input pixels shown in FIG. 7A, the circumscribed rectangles corresponding to the respective connected regions 101 and 102 are changed to the circumscribed rectangles 1 shown in FIGS. 7B and 7C.
03,104. FIG. 7B,
As can be seen from FIG. 7C, obtaining the circumscribed rectangles 103 and 104 of the connected regions 101 and 102 is performed by setting the horizontal direction to x and the vertical direction to y in FIG.
This is equivalent to obtaining the minimum and maximum x-coordinates and the minimum and maximum y-coordinates of each connected area as in (b) or (c).

【0004】ここで、部品検査や医療分野における血球
検査,細胞診断などを迅速に行なうために、上述の各連
結領域の外接四角形を高速に求めることのできる回路の
実現が望まれている。連結領域の外接四角形を算出する
回路の従来例を図8に示す。
Here, in order to quickly perform a component test, a blood cell test in the medical field, a cell diagnosis, and the like, it is desired to realize a circuit that can quickly obtain a circumscribed rectangle of each of the above-described connection regions. FIG. 8 shows a conventional example of a circuit for calculating a circumscribed rectangle of a connected region.

【0005】図8において、各連結領域にラベル付けさ
れたラベル画像が最小x座標算出部201と最大x座標
算出部202と最小y座標算出部203と最大y座標算
出部204に入力される。ラベル画像に対して、最小x
座標算出部201はあるラベルが付与された領域の最小
のx座標の値をラベルごとに算出し、最大x座標算出部
202はあるラベルが付与された領域の最大のx座標の
値をラベルごとに算出し、最小y座標算出部203はあ
るラベルが付与された領域の最小のy座標の値をラベル
ごとに算出し、最大y座標算出部204はあるラベルが
付与された領域の最大のy座標の値をラベルごとに算出
する。
[0005] In FIG. 8, a label image in which each connected region is labeled is input to a minimum x coordinate calculation unit 201, a maximum x coordinate calculation unit 202, a minimum y coordinate calculation unit 203, and a maximum y coordinate calculation unit 204. Minimum x
The coordinate calculation unit 201 calculates the minimum x-coordinate value of an area to which a certain label is assigned for each label, and the maximum x-coordinate calculation unit 202 calculates the maximum x-coordinate value of the area to which a certain label is assigned for each label. The minimum y-coordinate calculation unit 203 calculates, for each label, the minimum y-coordinate value of the area to which a certain label is assigned, and the maximum y-coordinate calculation unit 204 calculates the maximum y coordinate of the area to which a certain label is assigned. Calculate coordinate values for each label.

【0006】各ラベル値ごとに、そのラベル値に対応す
る連結領域の最小,最大のx座標の値および最小,最大
のy座標の値がそれぞれ最小x座標算出部201と最大
x座標算出部202と最小y座標算出部203と最大y
座標算出部204とで並列に算出される。
For each label value, the minimum and maximum x-coordinate values and the minimum and maximum y-coordinate values of the connected area corresponding to the label value are calculated by a minimum x-coordinate calculation unit 201 and a maximum x-coordinate calculation unit 202, respectively. And the minimum y coordinate calculation unit 203 and the maximum y
It is calculated in parallel with the coordinate calculation unit 204.

【0007】図9は上述のラベル付けされたラベル画像
を示す図であり、図10は図8に示した最小x座標算出
部201の具体的なブロック図である。次に、図10に
示した最小x座標算出部201の動作について説明す
る。たとえば、図9に示すような各連結領域に付与され
たラベルデータLBDは各画素の同期信号であるクロッ
ク信号CLKに同期して変化する。論理OR回路405
は、ラベルデータLBDを、背景である部分とそうでな
い部分、すなわち連結領域とに2値化する。すなわち、
ラベルデータLBDが0の値をとれば「0」を出力し、
0以外の値をとれば「1」を出力する。トリガ信号発生
回路406は、論理OR回路405の出力が0→1に変
化したとき、すなわち画素が背景の領域から背景以外の
ラベルが付与された領域になったときに、1クロックの
期間だけ0になる信号を出力する。
FIG. 9 is a diagram showing the above-labeled label image, and FIG. 10 is a specific block diagram of the minimum x-coordinate calculation unit 201 shown in FIG. Next, the operation of the minimum x coordinate calculation unit 201 shown in FIG. 10 will be described. For example, the label data LBD assigned to each connected area as shown in FIG. 9 changes in synchronization with a clock signal CLK which is a synchronization signal of each pixel. Logical OR circuit 405
Binarizes the label data LBD into a part which is a background and a part which is not, that is, a connected area. That is,
If the label data LBD takes a value of 0, "0" is output,
If a value other than 0 is taken, "1" is output. When the output of the logical OR circuit 405 changes from 0 to 1, that is, when the pixel changes from the background area to the area to which the label other than the background is assigned, the trigger signal generation circuit 406 outputs 0 for one clock period. The signal which becomes becomes.

【0008】計数回路404はラベルデータLBDの各
画素が入力するごとにそれに同期して入力するクロック
信号CLKを計数し、またラベルデータLBDの水平同
期信号HS* によってカウント値をクリアする。これに
より、計数回路404はラベルデータLBDの各画素の
水平方向、すなわちx方向の座標値を出力する。水平同
期信号HS* の1周期は、たとえば図7(a)の入力画
像または図9のラベル画像の横方向1行分を出力時間に
対応しているため、この信号でカウント値をクリアする
ことにより、計数回路404からは各行位置(y座標位
置)ごとにx座標値が出力される。
Each time a pixel of the label data LBD is input, the counting circuit 404 counts the clock signal CLK input in synchronization with the input, and clears the count value by the horizontal synchronization signal HS * of the label data LBD. Accordingly, the counting circuit 404 outputs the coordinate value of each pixel of the label data LBD in the horizontal direction, that is, in the x direction. One cycle of the horizontal synchronizing signal HS * corresponds to, for example, one horizontal line of the input image of FIG. 7A or the label image of FIG. 9 corresponding to the output time. Therefore, the count value should be cleared by this signal. Thus, the x-coordinate value is output from the counting circuit 404 for each row position (y-coordinate position).

【0009】上述のx座標値およびラベルデータLBD
は、トリガ信号発生回路406の出力が0→1に変化す
るところで、ラッチ回路402,403にラッチされ
る。これにより、背景の領域から背景以外のラベルが付
与された領域に変化した時点の当該ラベルデータLBD
とx座標が保持される。このx座標は、その行位置(y
座標位置)における背景以外の当該ラベルが付与された
領域の最小x座標である。
The above-mentioned x coordinate value and label data LBD
Are latched by the latch circuits 402 and 403 when the output of the trigger signal generation circuit 406 changes from 0 to 1. As a result, the label data LBD at the time of changing from the background area to an area to which a label other than the background is added is displayed.
And the x coordinate are held. This x-coordinate is determined by its row position (y
(Coordinate position) is the minimum x coordinate of the area other than the background to which the label is applied.

【0010】最小x座標格納メモリ401のアドレス入
力としては、ラッチ回路403に保持されたラベルデー
タLBDが入力される。今、最小x座標格納メモリ40
1の各ラベルデータLBDの値に対応するアドレスに
は、そのラベル値に対応する領域の現在の行位置(y座
標位置)までの最小x座標が格納されている。したがっ
て、上述の動作により、最小x座標格納メモリ401か
らは、ラッチ回路403で保持されたラベルデータLB
Dに対応する領域の現在までの最小のx座標値が出力さ
れる。
As the address input to the minimum x coordinate storage memory 401, the label data LBD held in the latch circuit 403 is input. Now, the minimum x coordinate storage memory 40
The address corresponding to the value of each label data LBD of 1 stores the minimum x coordinate up to the current row position (y coordinate position) of the area corresponding to the label value. Therefore, the label data LB held by the latch circuit 403 is read from the minimum x coordinate storage memory 401 by the above-described operation.
The minimum x coordinate value of the area corresponding to D until now is output.

【0011】なお、画像の1画面の入力が開始する時点
では、最小x座標格納メモリ401の内容を最大値(た
とえば8ビットデータであれば「FF」)にクリアされ
ている。最小x座標格納メモリ401からの出力値は、
比較器407のB側に入力される。比較器407はA側
から入力され新たにラッチ回路402でラッチされたx
座標と、B側から入力された最小x座標格納メモリ40
1からのx座標とを比較し、前者の方が小さい場合には
「1」を出力する。トリガ信号発生回路408は比較器
407の出力が「1」になったときに1クロックだけ書
込みパルス(「L」アクティブ)を出力し、このパルス
は最小x座標格納メモリ401に入力される。
When the input of one screen of an image is started, the contents of the minimum x coordinate storage memory 401 are cleared to the maximum value (for example, “FF” for 8-bit data). The output value from the minimum x coordinate storage memory 401 is
The signal is input to the B side of the comparator 407. The comparator 407 inputs x from the A side and newly latches x
Coordinate and minimum x-coordinate storage memory 40 input from B side
The x coordinate from 1 is compared, and if the former is smaller, “1” is output. The trigger signal generation circuit 408 outputs a write pulse (“L” active) for one clock when the output of the comparator 407 becomes “1”, and this pulse is input to the minimum x coordinate storage memory 401.

【0012】そして、このとき、最小x座標格納メモリ
401へのデータDi として、ラッチ回路402にラッ
チされた新たな最小x座標が入力され、ラベルデータL
BDで定まるアドレスに格納される。このようにして、
最小x座標格納メモリ401には、ラベル別にそのラベ
ルが付与されている領域の水平方向のx座標の最小値x
min が格納される。
[0012] At this time, as the data D i to the minimum x coordinate storage memory 401, a new minimum x coordinate is latched in the latch circuit 402 is input, label data L
It is stored at the address determined by BD. In this way,
The minimum x-coordinate storage memory 401 stores the minimum value x of the horizontal x-coordinate of the area to which the label is assigned for each label.
min is stored.

【0013】次に、図8に示した最大x座標算出部20
2の動作について説明する。この最大x座標算出部20
2の動作も、以上に説明した最小x座標算出部201の
場合とほぼ同じである。異なる点として、図10と同様
の最大x座標算出部202の構成において、図10のト
リガ信号発生回路406では領域の最後、すなわち論理
OR回路405の出力が1→0に変化した際に1クロッ
ク間だけ0を出力するようにし、図10の比較器407
ではA>Bのときに「1」を出力するようにすればよ
い。また、図10の最小x座標格納メモリ401のクリ
アは、各アドレスに値0をセットすることにより行なえ
ばよい。
Next, the maximum x coordinate calculation unit 20 shown in FIG.
Operation 2 will be described. This maximum x coordinate calculation unit 20
The operation 2 is almost the same as the case of the minimum x-coordinate calculation unit 201 described above. The difference is that in the configuration of the maximum x-coordinate calculation unit 202 similar to that of FIG. 10, the trigger signal generation circuit 406 of FIG. 10 outputs one clock when the output of the logical OR circuit 405 changes from 1 to 0 at the end of the area. 0 is output only during the period, and the comparator 407 in FIG.
Then, "1" may be output when A> B. Further, the minimum x-coordinate storage memory 401 in FIG. 10 may be cleared by setting a value 0 to each address.

【0014】次に、最小y座標算出部203の動作につ
いて説明する。この最小y座標算出部203の動作も、
最小x座標算出部201の動作とほぼ同じである。異な
る点として、図10と同様の最小y座標算出部203の
構成において、図10の計数回路404の入力は水平同
期信号HS* をクロック入力とし、垂直同期信号VS *
をクリア入力として、画像の垂直方向の座標、すなわち
y方向の座標値を出力するようにすればよい。
Next, the operation of the minimum y coordinate calculator 203 will be described.
Will be described. The operation of the minimum y coordinate calculation unit 203 also includes
The operation is almost the same as the operation of the minimum x coordinate calculation unit 201. Strange
As a point, similar to FIG.
In the configuration, the input of the counting circuit 404 in FIG.
Period signal HS*Is the clock input, and the vertical synchronizing signal VS *
As the clear input, the vertical coordinates of the image, that is,
What is necessary is just to output the coordinate value of ay direction.

【0015】次に、最大y座標算出部204の動作につ
いて説明する。最大y座標算出部204も、最小x座標
算出部201の動作とほぼ同様である。異なる点とし
て、図10と同様の最大y座標算出部204の構成にお
いて、図10の計数回路404の入力は水平同期信号H
* をクロック入力とし、垂直同期信号VS* をクリア
入力として、画像の垂直方向の座標、すなわちy方向の
座標値を出力する。また、図10のトリガ信号発生回路
406では領域の最後、すなわち論理OR回路405の
出力が1→0に変化した際に1クロック間だけ0を出力
するようにし、図10の比較器407ではA>Bのとき
に「1」を出力するようにすればよい。さらに、図10
の最小x座標格納メモリ401のクリアは、各アドレス
に値「0」をセットすることにより行なえばよい。
Next, the operation of the maximum y coordinate calculator 204 will be described. The operation of the maximum y coordinate calculation unit 204 is almost the same as the operation of the minimum x coordinate calculation unit 201. The difference is that in the configuration of the maximum y-coordinate calculation unit 204 similar to that of FIG. 10, the input of the counting circuit 404 of FIG.
Using S * as a clock input and the vertical synchronizing signal VS * as a clear input, output the vertical coordinate of the image, that is, the coordinate value in the y direction. Further, the trigger signal generation circuit 406 of FIG. 10 outputs 0 only for one clock when the output of the logical OR circuit 405 changes from 1 to 0 at the end of the area, and the comparator 407 of FIG. In the case of> B, "1" may be output. Further, FIG.
The minimum x-coordinate storage memory 401 may be cleared by setting a value “0” to each address.

【0016】[0016]

【発明が解決しようとする課題】図10に示した従来の
構成を使用して外接四角形算出処理を行なう場合、1ク
ロックサイクルタイム(=画像データ入力レート)内
で、それぞれのアドレスに格納されているデータに対し
て処理を行なう際、最小X座標格納メモリ401からそ
の処理対象のデータを一旦最小X座標格納メモリ401
外に読出し、比較器407によって比較処理を行なって
いる。このため、図11に示すように、1クロックサイ
クルタイムに少なくとも(メモリ読出し時間+比較処理
時間)を要する。また、従来例では、図10に示したよ
うに、各算出部に、結果格納メモリと座標計数用計数器
が必要であり、部品点数が多くなり、回路規模が大きく
なってしまうという欠点があった。
When performing the circumscribed rectangle calculation process using the conventional configuration shown in FIG. 10, the circumscribed rectangle is stored in each address within one clock cycle time (= image data input rate). When performing processing on existing data, the data to be processed is temporarily stored in the minimum X coordinate storage memory 401 from the minimum X coordinate storage memory 401.
The data is read out and compared by the comparator 407. Therefore, as shown in FIG. 11, one clock cycle time requires at least (memory read time + comparison processing time). In addition, in the conventional example, as shown in FIG. 10, each calculation unit requires a result storage memory and a counter for counting coordinates, which has the disadvantage of increasing the number of parts and increasing the circuit scale. Was.

【0017】それゆえに、この発明の主たる目的は、連
結領域の外接四角形算出処理を高速でリアルタイムに実
行し、しかも回路部品点数を少なくし得て、小型化でき
る画像処理装置を提供することである。
SUMMARY OF THE INVENTION Therefore, a main object of the present invention is to provide an image processing apparatus which can execute a process for calculating a circumscribed rectangle of a connected region at high speed in real time, can reduce the number of circuit components, and can be downsized. .

【0018】[0018]

【課題を解決するための手段】請求項1に係る発明は、
一方が読出し専用ポートとされ、他方が書込み専用ポー
トとされ、連結領域の外接四角形頂角座標を格納し、そ
のアドレスが連結領域に付与されたラベル値に対応する
2ポートメモリと、外接四角形頂角座標を算出するため
の算出手段および2ポートメモリからの読出しデータま
たは算出手段の出力結果のいずれかを選択して算出手段
に与えるパスと、入力された2ポートメモリのアドレス
として与えられるデータ値と、既に入力されている1ク
ロック前のデータ値および2クロック前のデータ値とを
比較してパスを選択するパス選択手段を備えて構成され
る。
The invention according to claim 1 is
One is a read-only port and the other is a write-only port.
And store the coordinates of the vertex angle of the bounding rectangle of the connection area.
Address corresponds to the label value assigned to the connection area
To calculate the coordinates of the vertex angle of a circumscribed rectangle with a 2-port memory
Calculation means and data read from the 2-port memory.
Or calculating means by selecting one of the output results of the calculating means.
And the address of the input 2-port memory
The data value given as
The data value before lock and the data value two clocks ago
It is provided with a path selecting means for comparing and selecting a path .

【0019】請求項2に係る発明は、さらに算出手段の
出力にはその出力結果を保持して2ポートメモリの書込
み専用ポートに与える記憶素子を含む。
The invention according to claim 2 further comprises a calculating means.
For output, hold the output result and write to 2-port memory
Only the storage element provided to the dedicated port is included.

【0020】請求項3に係る発明は、さらに2ポートメ
モリのある時刻での書込みアドレス値が1クロック後の
書込みアドレス値および2クロック後の書込みアドレス
値と同じであるかを比較して、2ポートメモリの書込み
を制御する書込み制御手段を含む。
The invention according to claim 3 further comprises a two-port method.
The write address value at a certain time in the memory
Write address value and write address after 2 clocks
Compare whether the value is the same and write to 2-port memory
Write control means for controlling the

【0021】請求項4に係る発明は、さらにある時刻で
の読出しアドレス値が1クロック前の読出しアドレス値
および2クロック前の読出しアドレス値と同じであるか
を比較して、2ポートメモリの読出しを制御する読出し
制御手段を含む。
According to a fourth aspect of the present invention, at a certain time,
Is the read address value one clock before
And the same as the read address value two clocks before
And read to control read of 2-port memory
Including control means.

【0022】[0022]

【0023】[0023]

【0024】[0024]

【作用】この発明は画像処理装置であって、一方が読出
し専用ポートとされ、他方が書込み専用ポートとされた
2ポートメモリに、連結領域に付与されたラベル値に対
応するアドレスに連結領域の外接四角形頂角座標を格納
し、2ポートメモリからの読出しデータまたは算出手段
によって算出された外接四角形頂角座標のいずれかを選
択して算出手段に与えるパスを、2ポートメモリのアド
レスとして与えられるデータ値と、既に入力されている
1クロック前のデータ値および2クロック前のデータ値
とを比較して選択する。
According to the present invention, there is provided an image processing apparatus, one of which is a readout device.
Dedicated port and the other is a write-only port
In the 2-port memory, the label value assigned to the connected area is
Store the vertices of the bounding rectangle of the connected area at the corresponding address
And data read from two-port memory or calculating means
One of the coordinates of the vertex angle of the circumscribed rectangle calculated by
Select the path to be given to the calculation means and add it to the 2-port memory.
Data value given as address and already entered
Data value one clock before and data value two clocks before
Select by comparing with.

【0025】[0025]

【実施例】図1はこの発明の一実施例の具体的なブロッ
ク図である。図1において、画像処理装置は、その一方
のポートを読出し専用,他方のポートを書込み専用とし
た2ポートメモリ601を含む。2ポートメモリ601
のアドレスにはラベル値が対応し、各ラベル値の外接四
角形の頂点座標(4点)を格納する。たとえば、入力画
像の範囲が最大16×16画素の場合、メモリ601の
ビット幅を16bit(b15からb0,MSBはb1
5,LSBはb0)とする。そして、上位4ビット(b
15からb12)には最大y座標を格納し、b11から
b8には最小y座標を格納し、b7からb4には最大x
座標を格納し、b3からb0には最小x座標を格納す
る。
FIG. 1 is a specific block diagram of one embodiment of the present invention. In FIG. 1, the image processing apparatus includes a two-port memory 601 in which one port is read-only and the other port is write-only. 2-port memory 601
The label value corresponds to the address of, and the vertex coordinates (four points) of the circumscribed rectangle of each label value are stored. For example, when the range of the input image is 16 × 16 pixels at the maximum, the bit width of the memory 601 is set to 16 bits (b15 to b0, MSB is b1
5, LSB is b0). Then, the upper 4 bits (b
15 to b12) store the maximum y coordinate, b11 to b8 store the minimum y coordinate, and b7 to b4 store the maximum x coordinate.
The coordinates are stored, and the minimum x coordinate is stored in b3 to b0.

【0026】さらに、画像処理装置は、マルチプレクサ
606,608〜612と、フリップフロップ616〜
629を含む。これらのフリップフロップ616〜62
9はすべて各画素の同期信号である画像クロック(CL
K)に同期して動作する。フリップフロップ629に
は、各画素のラベルデータ(LBD)が入力される。フ
リップフロップ629には、各画素のラベルデータが有
効か非有効かを示すイネーブル信号(LBDEN)が
入力される。イネーブル信号出力回路630は、フリッ
プフロップ617〜628に対してイネーブル(E
)を出力する。なお、このイネーブル信号出力回路
630は、フリップフロップ629の出力をそのまま出
力し、また最後の有効画素のラベルデータを入力した
後、2クロック期間、EN信号をアクティブにする。
Further, the image processing apparatus includes multiplexers 606, 608 to 612 and flip-flops 616 to 616.
629. These flip-flops 616-62
9 is an image clock (CL) which is a synchronization signal of each pixel.
It operates in synchronization with K). The label data (LBD) of each pixel is input to the flip-flop 629. The flip-flop 629 receives an enable signal (LBDEN * ) indicating whether the label data of each pixel is valid or invalid. The enable signal output circuit 630 enables the flip-flops 617 to 628 (E (E)).
N * ) is output. The enable signal output circuit 630 outputs the output of the flip-flop 629 as it is, and activates the EN * signal for two clock periods after inputting the label data of the last valid pixel.

【0027】さらに、画像処理装置は2入力の比較器6
04,605を含み、それぞれ2つの入力値が等しい場
合は「H」レベル信号を出力し、等しくない場合は
「L」レベル信号を出力する。比較器604はフリップ
フロップ616と617の出力を入力とする。すなわ
ち、比較器604はクロック信号とともに入力してくる
ラベルデータとその1クロック前に入力されたラベルデ
ータとを比較する。比較器605は、フリップフロップ
616と618の出力を入力とし、クロックとともに入
力してくるラベルデータとその2クロック前に入力した
ラベルデータとを比較する。
Further, the image processing apparatus comprises a two-input comparator 6
04, 605, 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. The comparator 604 receives the outputs of the flip-flops 616 and 617 as inputs. That is, the comparator 604 compares the label data input together with the clock signal with the label data input one clock before. The comparator 605 receives the outputs of the flip-flops 616 and 618 as inputs, and compares the label data input together with the clock with the label data input two clocks before the clock.

【0028】読出し制御回路613は、処理中にフリッ
プフロップ620,620の出力(出力信号がそれぞれ
EQ12,EQ13)をもとに2ポートメモリ601の
出力イネーブル信号を生成する。そして、読出し制御回
路613は、出力信号EQ12とEQ13がともに
「L」レベルのとき(すなわち、フリップフロップ61
7の出力値がフリップフロップ618,619の出力値
と両方とも異なるとき)、2ポートメモリ601の出力
イネーブル信号をアクティブ(「L」レベル)にする。
ただし、入力画面中、最初の有効画素のラベルデータが
メモリ601の読出しアドレスとして与えられたとき、
出力信号EQ12とEQ13のレベルに関係なく、読出
し制御回路613は2ポートメモリ601の出力イネー
ブル信号をアクティブにする。なぜなら、このとき出力
信号EQ12は、最初の有効画素のラベルデータと、そ
の直前(1クロック前)の非有効画素のラベルデータと
の比較結果であり、出力信号EQ13は最初の有効画素
のラベルデータとその2クロック前の非有効画素のラベ
ルデータとの比較結果であるため、出力信号EQ12,
EQ13ともに意味がなく、フリップフロップ624,
625,626に最初の有効画素のラベルデータの外接
四角形座標データが保持されていないからである。
The read control circuit 613 generates an output enable signal for the two-port memory 601 based on the outputs of the flip-flops 620 and 620 (output signals are EQ12 and EQ13, respectively) during processing. Then, the read control circuit 613 determines that the output signals EQ12 and EQ13 are both at the “L” level (that is, the flip-flop 61
7 is different from the output values of the flip-flops 618 and 619), the output enable signal of the two-port memory 601 is activated (“L” level).
However, when the label data of the first valid pixel in the input screen is given as a read address of the memory 601,
Regardless of the levels of the output signals EQ12 and EQ13, the read control circuit 613 activates the output enable signal of the two-port memory 601. Because the output signal EQ12 at this time is a result of comparison between the label data of the first valid pixel and the label data of the immediately preceding non-effective pixel (one clock before), and the output signal EQ13 is the label data of the first valid pixel. Is compared with the label data of the non-effective pixel two clocks before the output signal EQ12,
There is no point in both the EQ13 and the flip-flop 624,
This is because the circumscribed rectangle coordinate data of the label data of the first effective pixel is not held in 625 and 626.

【0029】また、2番目の有効画素のラベルデータが
2ポートメモリ601の読出しアドレスとして働いたと
き、出力信号EQ12が「L」レベルであれば、出力信
号EQ13のレベルに関わらず、読出し制御回路613
は2ポートメモリ601の出力イネーブル信号をアクテ
ィブにする。なぜなら、このとき、出力信号EQ13は
最初から2番目の有効画素のラベルデータとその2クロ
ック前の非有効画素のラベルデータとの比較結果である
ため意味がなく、また出力信号EQ12が「L」レベル
でもあるので、フリップフロップ624,625,62
6に最初から2番目の有効画素のラベルデータの外接四
角形座標データが保持されていないためである。なお、
出力信号EQ12が「H」レベルのとき、出力信号EQ
13のレベルに関わらず、読出し制御回路613は2ポ
ートメモリ601の出力イネーブル信号を非アクティブ
にする。
When the label data of the second effective pixel serves as the read address of the two-port memory 601, if the output signal EQ12 is at the "L" level, the read control circuit is independent of the level of the output signal EQ13. 613
Activates the output enable signal of the two-port memory 601. At this time, the output signal EQ13 is meaningless because it is a comparison result between the label data of the second effective pixel from the beginning and the label data of the non-effective pixel two clocks before the output signal EQ13. Level, so flip-flops 624, 625, 62
This is because the circumscribed rectangle coordinate data of the label data of the second effective pixel from the beginning is not held in No. 6. In addition,
When output signal EQ12 is at "H" level, output signal EQ
Regardless of the level of 13, the read control circuit 613 deactivates the output enable signal of the two-port memory 601.

【0030】書込み制御回路614は処理中、フリップ
フロップ621,622の出力(出力信号がそれぞれE
Q23,EQ13)をもとに、2ポートメモリ601の
書込みイネーブル信号を生成する。そして、書込み制御
回路614は、出力信号EQ23とEQ13がともに
「L」レベルのとき(すなわち、フリップフロップ61
9の出力値がフリップフロップ618,617の出力値
と両方とも異なるとき)、2ポートメモリ601の書込
みイネーブル信号をアクティブ(「L」レベル)にす
る。ただし、入力画面中、最後の有効画素のラベルデー
タが、2ポートメモリ601の書込みアドレスとして与
えられたとき、書込み制御回路614は出力信号EQ2
3とEQ13のレベルに関係なく、書込みイネーブル信
号をアクティブにする。なぜなら、このとき、出力信号
EQ23は最後の有効画素のラベルデータとその直後
(1クロック後)の非有効画素のラベルデータとの比較
結果であり、出力信号EQ13は最後の有効画素のラベ
ルデータとその2クロック後の非有効画素のラベルデー
タとの比較結果であるため、出力信号EQ23,EQ1
3ともに意味がなく、外接四角形座標データを書込んで
おかなければならないためである。
During the processing, the write control circuit 614 outputs the output of the flip-flops 621 and 622 (the output signal is
Q23, EQ13), a write enable signal for the two-port memory 601 is generated. Then, when both output signals EQ23 and EQ13 are at “L” level (ie, flip-flop 61
9 is different from the output values of the flip-flops 618 and 617), the write enable signal of the two-port memory 601 is activated (“L” level). However, when the label data of the last valid pixel in the input screen is given as a write address of the two-port memory 601, the write control circuit 614 outputs the output signal EQ2.
Activate the write enable signal irrespective of the levels of 3 and EQ13. Because, at this time, the output signal EQ23 is a comparison result between the label data of the last valid pixel and the label data of the non-valid pixel immediately after (one clock later), and the output signal EQ13 is the same as the label data of the last valid pixel. Since this is a result of comparison with the label data of the ineffective pixel two clocks later, the output signals EQ23 and EQ1
This is because circumscribed quadrangle coordinate data must be written.

【0031】また、最後から2番目の有効画素のラベル
データが2ポートメモリ601の書込みアドレスとして
与えられたとき、書込み制御回路614は出力信号EQ
23が「L」であれば、出力信号EQ13のレベルに関
わらず、書込みイネーブル信号をアクティブにする。な
ぜなら、このとき、出力信号EQ13は最後から2番目
の有効画素のラベルデータとその2クロック後の非有効
画素のラベルデータとの比較結果であるため意味がな
く、そして出力信号EQ23は「L」レベルであるの
で、次のサイクルでは異なる値の最後の有効ラベルデー
タがメモリ601の書込みアドレスとなるからである。
出力信号EQ23が「H」レベルのとき、出力信号EQ
13のレベルに関わらず、書込み制御回路614は、2
ポートメモリ601の書込みイネーブル信号を非アクテ
ィブにする。なぜならば、次のサイクルで、最後から2
番目の有効画素のラベルデータと同じ値である最後の有
効画素のラベルデータが、2ポートメモリ601の書込
みアドレスとして与えられ、外接四角形座標データが書
込まれるためである。
When the label data of the penultimate effective pixel is given as the write address of the two-port memory 601, the write control circuit 614 outputs the output signal EQ.
If 23 is "L", the write enable signal is activated regardless of the level of the output signal EQ13. Because, at this time, the output signal EQ13 is meaningless because it is a comparison result between the label data of the penultimate effective pixel and the label data of the non-effective pixel two clocks after that, and the output signal EQ23 is “L”. This is because, in the next cycle, the last valid label data having a different value becomes the write address of the memory 601 because it is the level.
When the output signal EQ23 is at "H" level, the output signal EQ23
13, the write control circuit 614 determines
The write enable signal of the port memory 601 is made inactive. Because, in the next cycle, the last two
This is because the label data of the last valid pixel having the same value as the label data of the second valid pixel is given as the write address of the two-port memory 601 and the circumscribed rectangular coordinate data is written.

【0032】パス制御回路615は、フリップフロップ
621,623の出力信号EQ23,EQ24をもと
に、マルチプレクサ606を制御する。すなわち、パス
制御回路615は、出力信号EQ24のレベルに関係な
く、出力信号EQ23が「H」レベルのとき、フリップ
フロップ626の出力をマルチプレクサ607の入力に
接続する(パス1)。出力信号EQ23が「L」レベル
で出力信号EQ24が「H」レベルのとき、パス制御回
路615はフリップフロップ624の出力をマルチプレ
クサ607の入力に与える(パス2)。出力信号EQ2
3とEQ24はともに「L」レベルのとき、パス制御回
路615はフリップフロップ625の出力をマルチプレ
クサ607の入力に与える(パス3)。ただし、入力画
面中、最初の有効画素のラベルデータがフリップフロッ
プ618に保持されたとき、出力信号EQ23とEQ2
4のレベルに関係なくフリップフロップ625の出力を
マルチプレクサ607の入力に与える。なぜならば、こ
のとき、出力信号EQ23は最初の有効画素のラベルデ
ータとその直前(1クロック前)の非有効画素のラベル
データとの比較結果で、出力信号EQ24は最初の有効
画素のラベルデータとその2クロック前の非有効画素の
ラベルデータとの比較結果であるため、出力信号EQ2
3,EQ24ともに意味がなく、最初の有効画素のラベ
ルデータの外接四角形座標データがフリップフロップ6
25にのみ保持されているからである。
The path control circuit 615 controls the multiplexer 606 based on the output signals EQ23 and EQ24 of the flip-flops 621 and 623. That is, the path control circuit 615 connects the output of the flip-flop 626 to the input of the multiplexer 607 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 615 supplies the output of the flip-flop 624 to the input of the multiplexer 607 (path 2). Output signal EQ2
When both 3 and EQ 24 are at the “L” level, the path control circuit 615 supplies the output of the flip-flop 625 to the input of the multiplexer 607 (path 3). However, when the flip-flop 618 holds the label data of the first valid pixel in the input screen, the output signals EQ23 and EQ2 are output.
The output of the flip-flop 625 is applied to the input of the multiplexer 607 regardless of the level of the fourth signal. This is because at this time, the output signal EQ23 is a comparison result between the label data of the first valid pixel and the label data of the non-valid pixel immediately before (one clock before), and the output signal EQ24 is the same as the label data of the first valid pixel. Since this is a comparison result with the label data of the ineffective pixel two clocks before, the output signal EQ2
3 and EQ24 are meaningless, and the circumscribed rectangle coordinate data of the label data of the first effective pixel is flip-flop 6
This is because it is held only at 25.

【0033】また、2番目の有効画素のラベルデータが
フリップフロップ618に保持されたとき、出力信号E
Q23が「L」レベルならば、出力信号EQ24のレベ
ルに関係なく、フリップフロップ625の出力をマルチ
プレクサ607の入力に与える。なぜなら、このとき、
出力信号EQ24は最初の有効画素のラベルデータと2
クロック前の非有効画素のラベルデータとの比較結果で
あるため意味がなく、また、出力信号EQ23が「L」
レベルなので、最初から2番目の有効画素のラベルデー
タの外接四角形座標データはフリップフロップ625に
のみ保持されているからである。出力信号EQ23が
「H」レベルのときは、出力信号EQ24のレベルに関
係なく、フリップフロップ626の出力をマルチプレク
サ607の入力に与える。
When the label data of the second valid pixel is held in the flip-flop 618, the output signal E
If Q23 is at "L" level, the output of flip-flop 625 is applied to the input of multiplexer 607, regardless of the level of output signal EQ24. Because at this time,
The output signal EQ24 has the label data of the first valid pixel and 2
It is meaningless because it is a comparison result with the label data of the ineffective pixel before the clock, and the output signal EQ23 is "L"
This is because the circumscribed rectangle coordinate data of the label data of the second effective pixel from the beginning is held only in the flip-flop 625 because of the level. When the output signal EQ23 is at the “H” level, the output of the flip-flop 626 is applied to the input of the multiplexer 607 regardless of the level of the output signal EQ24.

【0034】計数器602は画素の座標位置を計数する
ものであり、その計数出力はフリップフロップ627,
628を介して比較器603に与えられる。比較器60
3の出力はマルチプレクサ607に与えられる。なお、
図1に示す点線内は外四角形座標算出部であり、その詳
細なブロック図を図2に示す。
The counter 602 counts the coordinate position of a pixel, and its count output is a flip-flop 627,
628 to the comparator 603. Comparator 60
The output of 3 is provided to multiplexer 607. In addition,
The inside of the dotted line shown in FIG. 1 is an outer square coordinate calculator, and a detailed block diagram is shown in FIG.

【0035】図2において、計数器602はx座標を計
数する計数器701とy座標を計数する計数器702と
を含む。計数器701はラベルデータLBDの各画素が
入力するごとにそれに同期して入力される画像クロック
信号CLKをカウントし、またラベルデータLBDの水
平同期信号HS* によってカウント値をクリアする。こ
れにより、計数器701はラベルデータLBDの各画素
の水平方向、すなわちx方向の座標値を出力する。水平
同期信号HS* の1周期は、たとえば、図2の入力画面
の横方向1行分に対応しているため、この信号でカウン
ト値をクリアすることにより、計数器701からは、各
行位置(各y座標位置)ごとにx座標が出力される。計
数器702は、水平同期信号HS* をカウントする。こ
れにより、計数器702は、ラベルデータLBDの各画
素の垂直方向、すなわちy方向の座標値を出力する。
In FIG. 2, the counter 602 includes a counter 701 for counting the x coordinate and a counter 702 for counting the y coordinate. Each time a pixel of the label data LBD is input, the counter 701 counts the input image clock signal CLK in synchronization with the input, and clears the count value by the horizontal synchronization signal HS * of the label data LBD. Thereby, the counter 701 outputs the coordinate value of each pixel of the label data LBD in the horizontal direction, that is, in the x direction. Since one cycle of the horizontal synchronizing signal HS * corresponds to, for example, one horizontal row of the input screen in FIG. 2, by clearing the count value with this signal, the counter 701 outputs the position of each row ( The x coordinate is output for each (y coordinate position). The counter 702 counts the horizontal synchronization signal HS * . Thereby, the counter 702 outputs the coordinate value of each pixel of the label data LBD in the vertical direction, that is, the y direction.

【0036】フリップフロップ627はフリップフロッ
プ703と704とからなり、フリップフロップ703
は計数器701の出力を入力とし、フリップフロップ7
04は計数器702の出力を入力とする。フリップフロ
ップ628はフリップフロップ705と706とからな
り、フリップフロップ705はフリップフロップ703
の出力を入力とし、フリップフロップ706はフリップ
フロップ704の出力を入力とする。
The flip-flop 627 includes flip-flops 703 and 704.
Receives the output of the counter 701 as an input,
04 receives the output of the counter 702 as an input. The flip-flop 628 includes flip-flops 705 and 706, and the flip-flop 705 is
And the flip-flop 706 receives the output of the flip-flop 704 as an input.

【0037】マルチプレクサ606の出力(I〔15:
0〕)が入力される比較器603は、比較器707,7
08,709および710からなる。比較器707のA
入力にはI〔3:0〕が入力され、B入力にはフリップ
フロップ705の出力が入力され、B<Aのとき比較器
707は「1」を出力する。比較器708のA入力には
I〔7:4〕が入力され、B入力にはフリップフロップ
705の出力が入力され、B>Aのとき比較器708は
「1」を出力する。比較器709のA入力にはI〔1
1:8〕が入力され、B入力はフリップフロップ706
の出力が入力され、B<Aのとき比較器709は「1」
を出力する。比較器710のA入力にはI〔15:1
2〕が入力され、B入力にはフリップフロップ706の
出力が入力され、B>Aのとき比較器710は「1」を
出力する。
The output of the multiplexer 606 (I [15:
0]) are input to the comparators 707 and 7
08, 709 and 710. A of the comparator 707
I [3: 0] is input to the input, the output of the flip-flop 705 is input to the B input, and the comparator 707 outputs “1” when B <A. I [7: 4] is input to the A input of the comparator 708, the output of the flip-flop 705 is input to the B input, and the comparator 708 outputs "1" when B> A. The input A of the comparator 709 is I [1
1: 8] and the B input is a flip-flop 706
When B <A, the comparator 709 outputs “1”.
Is output. The input A of the comparator 710 is I [15: 1
2], the output of the flip-flop 706 is input to the B input, and when B> A, the comparator 710 outputs “1”.

【0038】マルチプレクサ607は、マルチプレクサ
711,712,713,714からなる。マルチプレ
クサ711は、比較器707の出力に従い、フリップフ
ロップ705の出力値とI〔3:0〕の小さい方を選択
して出力する。すなわち、最小x座標を更新する。マル
チプレクサ712は、比較器708の出力に従い、フリ
ップフロップ705の出力値とI〔7:4〕の大きい方
を選択して出力する。すなわち、最大x座標を更新す
る。マルチプレクサ713は、比較器709の出力に従
って、フリップフロップ706の出力に従って、フリッ
プフロップ706の出力値とI〔11:8〕の小さい方
を選択して出力する。すなわち、最小y座標を更新す
る。マルチプレクサ714は、比較器710の出力に従
って、フリップフロップ706の出力値とI〔15:1
2〕の大きい方を選択して出力する。すなわち、最大y
座標を更新する。
The multiplexer 607 includes multiplexers 711, 712, 713, and 714. The multiplexer 711 selects and outputs the smaller of the output value of the flip-flop 705 and I [3: 0] according to the output of the comparator 707. That is, the minimum x coordinate is updated. The multiplexer 712 selects and outputs the larger of the output value of the flip-flop 705 and I [7: 4] according to the output of the comparator 708. That is, the maximum x coordinate is updated. The multiplexer 713 selects and outputs the smaller of the output value of the flip-flop 706 and I [11: 8] in accordance with the output of the flip-flop 706 in accordance with the output of the comparator 709. That is, the minimum y coordinate is updated. The multiplexer 714 outputs the output value of the flip-flop 706 and I [15: 1] according to the output of the comparator 710.
2] is selected and output. That is, the maximum y
Update coordinates.

【0039】上述のごとく構成された画像処理装置の実
施例の外接四角形算出処理動作について以下に詳細に説
明する。
The circumscribing rectangle calculating operation of the embodiment of the image processing apparatus configured as described above will be described in detail below.

【0040】まず、2ポートメモリ601の内容を初期
設定する。すなわち、全アドレスのデータを0F0F
(16進数表記)にする。マルチプレクサ610,61
1および612はCPUなどによって制御され、2ポー
トメモリ601の全アドレスに0F0Fが書込まれる。
次に、連結領域別の外接四角形算出処理が行なわれる。
このとき、マルチプレクサ608,609が制御され、
2ポートメモリ601の読出しイネーブル端子OE*
は読出し制御回路613の出力が入力され、2ポートメ
モリ601の読出しアドレス端子ARにはフリップフロ
ップ617の出力が入力される。また、マルチプレクサ
611,610が制御され、2ポートメモリ601の書
込みイネーブル端子WE* には書込み制御回路614の
出力が入力され、2ポートメモリ601の書込みアドレ
ス端子AWにはフリップフロップ619の出力が入力さ
れる。マルチプレクサ612が制御され、2ポートメモ
リ601の書込みデータ端子DWにはフリップフロップ
626の出力が入力される。
First, the contents of the two-port memory 601 are initialized. That is, the data of all addresses is set to 0F0F
(Hexadecimal notation). Multiplexers 610 and 61
1 and 612 are controlled by a CPU or the like, and 0F0F is written to all addresses of the 2-port memory 601.
Next, a circumscribed rectangle calculation process for each connected region is performed.
At this time, the multiplexers 608 and 609 are controlled,
The output of the read control circuit 613 is input to the read enable terminal OE * of the two-port memory 601, and the output of the flip-flop 617 is input to the read address terminal AR of the two-port memory 601. The multiplexers 611 and 610 are controlled, the output of the write control circuit 614 is input to the write enable terminal WE * of the two-port memory 601, and the output of the flip-flop 619 is input to the write address terminal AW of the two-port memory 601. Is done. The multiplexer 612 is controlled, and the output of the flip-flop 626 is input to the write data terminal DW of the two-port memory 601.

【0041】図4,図5および図6は、図3に示すよう
なラベル画面をラスタスキャン入力した場合の、外接四
角形算出処理時のタイムチャートである。特に、図4は
入力画面1行目(y=0)時のタイムチャートであり、
図5は入力画面2行目(y=1)時のタイムチャートで
あり、図6は入力画面最終行目(y=15)時のタイム
チャートである。
FIGS. 4, 5 and 6 are time charts in the process of calculating a circumscribed rectangle when a label screen as shown in FIG. 3 is raster-scanned. In particular, FIG. 4 is a time chart at the time of the first line of the input screen (y = 0).
FIG. 5 is a time chart at the time of the second line of the input screen (y = 1), and FIG. 6 is a time chart at the time of the last line of the input screen (y = 15).

【0042】図4〜図6において、CLKは画素クロッ
クを示し、HS* は水平同期信号を示し、LBDはラベ
ルデータを示す。LBDEN* はラベルデータ有効信号
であり、「L」レベルのとき、ラベルデータLBDは有
効である。XposCNTは、各画素のx座標を計測す
る計数器701の出力であり、EN* はフリップフロッ
プ617から628のイネーブル信号(イネーブル信号
出力回路630の出力)であり、「L」アクティブであ
る。ARはフリップフロップ617の出力であり、2ポ
ートメモリ601の読出しアドレスでもあり、フリップ
フロップ616,618の出力もあわせて示す。OE*
は2ポートメモリ601の読出しイネーブル信号(アク
ティブ「L」),WE* は2ポートメモリ601の書込
みイネーブル信号(アクティブ「L」)であり、AWは
フリップフロップ619の出力、すなわち2ポートメモ
リ601の書込みアドレスである。DWは2ポートメモ
リ601の書込みデータ、すなわちフリップフロップ6
26の出力である。また、外接四角形の最大x座標,最
小x座標の算出過程をわかりやすくするために、フリッ
プフロップ628とマルチプレクサ606の下位8bi
t出力もあわせて示す。なお、信号波形中の数字は16
進数でデータ値を示している。
4 to 6, CLK indicates a pixel clock, HS * indicates a horizontal synchronizing signal, and LBD indicates label data. LBDEN * is a label data valid signal. When the signal is at “L” level, the label data LBD is valid. XposCNT is an output of the counter 701 that measures the x coordinate of each pixel, and EN * is an enable signal (output of the enable signal output circuit 630) of the flip-flops 617 to 628, and is “L” active. AR is the output of the flip-flop 617, is also the read address of the two-port memory 601, and also shows the outputs of the flip-flops 616 and 618. OE *
Is a read enable signal (active “L”) of the two-port memory 601, WE * is a write enable signal (active “L”) of the two-port memory 601, and AW is the output of the flip-flop 619, that is, the output of the two-port memory 601. Write address. DW is write data of the two-port memory 601, that is, flip-flop 6
26 is the output. Further, in order to make the calculation process of the maximum x coordinate and the minimum x coordinate of the circumscribed rectangle easy to understand, the lower 8 bi of the flip-flop 628 and the multiplexer 606 are used.
The t output is also shown. The number in the signal waveform is 16
Data values are shown in hexadecimal.

【0043】次に、外接四角形算出処理時の動作につい
て説明する。図4(c)に示す各画素のラベルデータL
BDが図4(a)に示す画像クロック信号CLKに同期
して入力される。順次入力されるラベルデータが1クロ
ック前および2クロック前に入力したラベルデータと比
較される。そして、その比較結果をもとに、2ポートメ
モリ601の読み書き,およびマルチプレクサ606の
制御が行なわれる。
Next, the operation at the time of the circumscribed rectangle calculation process will be described. The label data L of each pixel shown in FIG.
BD is input in synchronization with the image clock signal CLK shown in FIG. The sequentially input label data is compared with the label data input one clock before and two clocks before. Then, based on the comparison result, reading / writing of the 2-port memory 601 and control of the multiplexer 606 are performed.

【0044】すなわち、メモリ601の読出しアドレス
として与えられるラベルデータ(フリップフロップ61
7の出力)は、1クロック前のラベルデータ(フリップ
フロップ618の出力)と、2クロック前のラベルデー
タ(フリップフロップ619の出力)ともに異なってい
れば(EQ12=EQ13=「L」レベル)、そのラベ
ルデータ(フリップフロップ617の出力)の最新外接
四角形座標データを2ポートメモリ601から読出す。
そして、次のサイクルで、読出しデータをフリップフロ
ップ625に保存し、マルチプレクサ606を制御し
(EQ23=EQ24=「L」レベル)、フリップフロ
ップ625の出力を比較器603およびマルチプレクサ
607に入力する(パス3)。
That is, the label data (flip-flop 61) provided as the read address of memory 601
7) is different from the label data (output of flip-flop 618) one clock before (output of flip-flop 618) and the label data (output of flip-flop 619) two clocks before (EQ12 = EQ13 = “L” level). The latest circumscribed rectangular coordinate data of the label data (output of the flip-flop 617) is read from the two-port memory 601.
Then, in the next cycle, the read data is stored in the flip-flop 625, the multiplexer 606 is controlled (EQ23 = EQ24 = “L” level), and the output of the flip-flop 625 is input to the comparator 603 and the multiplexer 607 (path). 3).

【0045】2ポートメモリ601の読出しアドレスと
して与えられるラベルデータ(フリップフロップ617
の出力)は、1クロック前のラベルデータ(フリップフ
ロップ618の出力)と一致していれば(EQ12=
「H」レベル)、そのラベルデータ(フリップフロップ
617の出力)の最新外接四角形座標データは、マルチ
プレクサ607が出力中であるため、2ポートメモリ6
01からデータを読出す必要はなく、次のサイクルでマ
ルチプレクサ607の出力をフリップフロップ626が
保持し、マルチプレクサ606を制御し(EQ23=
「H」レベル)、フリップフロップ626の出力を比較
器603およびマルチプレクサ607に入力する(パス
1)。
Label data (flip-flop 617) provided as a read address of two-port memory 601
Is equal to the label data (output of the flip-flop 618) one clock before (EQ12 =
Since the multiplexer 607 is outputting the latest circumscribed quadrangle coordinate data of the “H” level) and the label data (output of the flip-flop 617), the 2-port memory 6
It is not necessary to read data from 01, the flip-flop 626 holds the output of the multiplexer 607 in the next cycle, and controls the multiplexer 606 (EQ23 =
(“H” level), the output of the flip-flop 626 is input to the comparator 603 and the multiplexer 607 (path 1).

【0046】2ポートメモリ601の読出しアドレスと
して与えられるラベルデータ(フリップフロップ617
の出力)が、2クロック前のラベルデータ(フリップフ
ロップ619の出力)と一致し、1クロック前のラベル
データ(フリップフロップ618の出力)と異なってい
れば(EQ13=「H」レベル,EQ12=「L」レベ
ル)、そのラベルデータ(フリップフロップ617の出
力)の最新外接四角形座標データは、フリップフロップ
626に保持されているので、2ポートメモリ601か
らデータを読出す必要はなく、次のサイクルで、フリッ
プフロップ624がフリップフロップ626の出力を保
持し、マルチプレクサ606を制御し(EQ24=
「H」レベル,EQ23=「L」レベル)、フリップフ
ロップ624の出力を比較器603およびマルチプレク
サ607に入力する(パス2)。
Label data (flip-flop 617) provided as a read address of two-port memory 601
Is equal to the label data (output of flip-flop 619) two clocks earlier and different from the label data (output of flip-flop 618) one clock earlier (EQ13 = “H” level, EQ12 = Since the latest circumscribed rectangular coordinate data of the label data (output of the flip-flop 617) and its label data (output of the flip-flop 617) are held in the flip-flop 626, there is no need to read data from the two-port memory 601 and the next cycle Then, the flip-flop 624 holds the output of the flip-flop 626 and controls the multiplexer 606 (EQ24 =
(“H” level, EQ23 = “L” level), and the output of the flip-flop 624 is input to the comparator 603 and the multiplexer 607 (path 2).

【0047】第1図点線内の構成は、前述のごとく、図
2に示したように構成されているので、外接四角形座標
が更新されていき、最新外接四角形座標がフリップフロ
ップ626に保持される。
Since the configuration within the dotted line in FIG. 1 is configured as shown in FIG. 2 as described above, the circumscribed rectangle coordinates are updated, and the latest circumscribed rectangle coordinates are held in the flip-flop 626. .

【0048】2ポートメモリ601へのデータ書込みに
関しては、フリップフロップ619の出力値がフリップ
フロップ618,617の出力値と両方とも異なるとき
(EQ23=EQ13=「L」レベルのとき)フリップ
フロップ626の出力値を2ポートメモリ601に書込
む。フリップフロップ619の出力値がフリップフロッ
プ618と等しいとき(EQ23=「H」レベルのと
き)、次のサイクルで書込めばよいので書込まない。ま
た、フリップフロップ619の出力値がフリップフロッ
プ617と等しいとき(EQ13=「H」レベルのと
き)、2サイクル後(2クロック後)で書込めばよいの
で書込まない。このような動作を続けることでラベル値
ごとに、外接四角形座標が2ポートメモリ601に格納
される。
Regarding data writing to two-port memory 601, when the output value of flip-flop 619 is different from both the output values of flip-flops 618 and 617 (when EQ23 = EQ13 = "L" level) The output value is written to the two-port memory 601. When the output value of the flip-flop 619 is equal to that of the flip-flop 618 (when EQ23 = “H” level), writing is not performed in the next cycle since writing is sufficient. When the output value of the flip-flop 619 is equal to that of the flip-flop 617 (when the EQ13 is at the “H” level), writing is performed only two cycles later (two clocks later), so writing is not performed. By continuing such an operation, the circumscribed rectangle coordinates are stored in the two-port memory 601 for each label value.

【0049】対象とする画像データに対して、ラベルデ
ータ別濃淡値累加算が終了すると、マルチプレクサ60
8,609を制御して、メモリ601から結果を読出
す。
When the cumulative addition of gray value by label data is completed for the target image data, the multiplexer 60
8, 609 to read the result from the memory 601.

【0050】図4,図5に示したこの発明の一実施例の
クロックサイクル時間は、メモリ読出し時間,メモリ書
込み時間あるいは比較処理時間のいずれか長い方程度な
ので、従来技術よりも高速処理できる。また、主要な回
路部の部品点数を比較すると、従来例では、各画素の座
標を計数する計数器を4個必要とするのに対して、この
発明の一実施例ではその半分で済む。必要なメモリ数
も、従来例では4個必要とするのに対して、この発明の
一実施例では1個で済み、全体の構成を簡略化できる。
Since the clock cycle time of the embodiment of the present invention shown in FIGS. 4 and 5 is the longer of the memory read time, the memory write time, and the comparison processing time, the clock processing can be performed at a higher speed than in the prior art. Comparing the number of components in the main circuit section, the conventional example requires four counters for counting the coordinates of each pixel, whereas the embodiment of the present invention requires only half of the number. The required number of memories is four in the conventional example, but only one in the embodiment of the present invention, and the entire configuration can be simplified.

【0051】[0051]

【発明の効果】以上のように、この発明によれば、一方
が読出し専用ポートとされ、他方が書込み専用ポートと
された2ポートメモリに、連結領域に付与されたラベル
値に対応するアドレスに連結領域の外接四角形頂角座標
を格納し、2ポートメモリからの読出しデータまたは算
出された外接四角形頂角座標のいずれかを選択して算出
手段に与えるパスを、2ポートメモリのアドレスとして
与えられるデータ値と、既に入力されている1クロック
前のデータ値および2クロック前のデータ値とを比較し
て選択することにより、連結領域ごとにその外接四角形
算出を高速に実現でき、また回路規模も縮小できるの
で、画像処理装置の機能性能を向上できる。
As is evident from the foregoing description, according to the present invention, whereas
Is a read-only port and the other is a write-only port.
Label assigned to the connection area in the assigned 2-port memory
At the address corresponding to the value, the circumscribed rectangle vertex angle coordinates of the connected area
And read data from the 2-port memory or calculate
Calculate by selecting any of the issued circumscribed square vertex coordinates
The path given to the means as a 2-port memory address
Given data value and one clock already input
Compare the previous data value and the data value two clocks ago
By selecting the connection area, the circumscribed rectangle can be calculated at high speed for each connected area, and the circuit scale can be reduced, so that the functional performance of the image processing apparatus can be improved.

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

【図1】この発明の一実施例の回路構成を示す図であ
る。
FIG. 1 is a diagram showing a circuit configuration of an embodiment of the present invention.

【図2】図1に示した点線内の外接四角形座標算出部の
詳細な回路図である。
FIG. 2 is a detailed circuit diagram of a circumscribed rectangle coordinate calculator within a dotted line shown in FIG. 1;

【図3】この発明の一実施例の入力画面の一例を示す図
である。
FIG. 3 is a diagram showing an example of an input screen according to an embodiment of the present invention.

【図4】入力画面1行目(y=0)時のタイムチャート
である。
FIG. 4 is a time chart at the time of the first line (y = 0) of the input screen.

【図5】入力画面2行目(y=1)時のタイムチャート
である。
FIG. 5 is a time chart at the time of the second line (y = 1) of the input screen.

【図6】入力画面最終行目(y=15)時のタイムチャ
ートである。
FIG. 6 is a time chart at the time of the last line (y = 15) of the input screen.

【図7】連結領域と外接四角形を説明するための図であ
る。
FIG. 7 is a diagram for explaining a connection region and a circumscribed rectangle;

【図8】従来の外接四角形算出回路のブロック図であ
る。
FIG. 8 is a block diagram of a conventional circumscribed rectangle calculation circuit.

【図9】ラベル画像の一例を示す図である。FIG. 9 is a diagram illustrating an example of a label image.

【図10】従来例の最小x座標算出部の回路構成を示す
図である。
FIG. 10 is a diagram showing a circuit configuration of a conventional minimum x-coordinate calculation unit.

【図11】従来例の処理タイムチャートを示す図であ
る。
FIG. 11 is a diagram showing a processing time chart of a conventional example.

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

601 2ポートメモリ 602,701,702 計数器 603〜605,707〜710 比較器 606〜612,711〜714 マルチプレクサ 613 読出し制御回路 614 書込み制御回路 616〜628,703,706 フリップフロップ 601 2-port memory 602, 701, 702 Counter 603-605, 707-710 Comparator 606-612, 711-714 Multiplexer 613 Read control circuit 614 Write control circuit 616-628, 703, 706 Flip-flop

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

Claims (4)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 外接四角形を算出する画像処理装置であ
って、一方が読出し専用ポートとされ、他方が書込み専用ポー
トとされ、連結領域の外接四角形頂角座標を格納し、そ
のアドレスが前記連結領域に付与されたラベル値に対応
する2ポートメモリと、 前記外接四角形頂角座標を算出するための算出手段およ
び前記2ポートメモリからの読出しデータまたは前記算
出手段の出力結果のいずれかを選択して前記算出手段に
与えるパスと、 入力された前記2ポートメモリのアドレスとして与えら
れるデータ値と、既に入力されている1クロック前のデ
ータ値および2クロック前のデータ値とを比較して前記
パスを選択するパス選択手段 を備えた、画像処理装置。
1. An image processing apparatus for calculating a circumscribed rectangle, wherein one is a read-only port and the other is a write-only port.
And store the coordinates of the vertex angle of the bounding rectangle of the connection area.
Address corresponds to the label value assigned to the connection area
A two-port memory, a calculating means for calculating the coordinates of the vertex angle of the circumscribed rectangle, and
And the read data from the 2-port memory or the
And selecting one of the output results of the output means to the calculation means.
The path to be given and the address given as the input address of the two-port memory
Data value and the already input data one clock before.
Data value and the data value two clocks before, and
An image processing apparatus comprising a path selection unit for selecting a path .
【請求項2】 さらに、前記算出手段の出力には、その
出力結果を保持して前記2ポートメモリの前記書込み専
用ポートに与える記憶素子を含む、請求項1の画像処理
装置。
2. An output of said calculating means,
The output result is held and the write
The image processing apparatus according to claim 1, further comprising a storage element provided to a port for use .
【請求項3】 さらに、前記2ポートメモリのある時刻
での書込みアドレス値が1クロック後の書込みアドレス
値および2クロック後の書込みアドレス値と同じである
かを比較して、前記2ポートメモリの書込みを制御する
書込み制御手段を含む、請求項1または2の画像処理装
置。
3. Furthermore, a certain time the two-port memory
Write address value at 1 clock after write address
Value and the same as the write address value two clocks later
To control the writing of the two-port memory.
3. The image processing apparatus according to claim 1, further comprising a writing control unit .
【請求項4】 さらに、ある時刻での読出しアドレス値
が1クロック前の読出しアドレス値および2クロック前
の読出しアドレス値と同じであるかを比較して、前記2
ポートメモリの読出しを制御する読出し制御手段を含
む、請求項1または2の画像処理装置。
4. A read address value at a certain time.
Is the read address value one clock before and two clocks ago
Is compared with the read address value of
Including read control means for controlling read of port memory
The image processing apparatus according to claim 1 .
JP5217370A 1993-09-01 1993-09-01 Image processing device Expired - Fee Related JP2973788B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5217370A JP2973788B2 (en) 1993-09-01 1993-09-01 Image processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5217370A JP2973788B2 (en) 1993-09-01 1993-09-01 Image processing device

Publications (2)

Publication Number Publication Date
JPH0773314A JPH0773314A (en) 1995-03-17
JP2973788B2 true JP2973788B2 (en) 1999-11-08

Family

ID=16703115

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5217370A Expired - Fee Related JP2973788B2 (en) 1993-09-01 1993-09-01 Image processing device

Country Status (1)

Country Link
JP (1) JP2973788B2 (en)

Also Published As

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

Similar Documents

Publication Publication Date Title
JPH0126072B2 (en)
US5621866A (en) Image processing apparatus having improved frame buffer with Z buffer and SAM port
US5195177A (en) Clipping processor
KR100281949B1 (en) Video drawing device
JP2973788B2 (en) Image processing device
US5887079A (en) Image processing apparatus
EP0250868A2 (en) Method and apparatus for area fill in a raster graphics system
JP3313527B2 (en) Graphics controller and pixel data transfer system
JPS6016634B2 (en) Graphic generation method in display devices
JPS6155677B2 (en)
JP2899838B2 (en) Storage device
JP2973819B2 (en) Image processing device
JPS642953B2 (en)
KR0145709B1 (en) Computer graphic system
JP2787487B2 (en) Circuit for determining the position of a line segment displayed and operated on a computer system
JPS595905B2 (en) Surface brightness generation method in display devices
JP2861105B2 (en) Spoke register generation circuit
US5305431A (en) Method and system for rendering polygons on a raster display
JP2594906B2 (en) Line type generation circuit in graphic processing equipment
JPH06161428A (en) Image-extracting device
JP2770514B2 (en) Shading device
JPH0315193B2 (en)
JP2973789B2 (en) Label area perimeter calculation device
JPH0112309Y2 (en)
JP2861159B2 (en) Window display control device

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