JPH011076A - Image processing device for real-time center of gravity position detection - Google Patents

Image processing device for real-time center of gravity position detection

Info

Publication number
JPH011076A
JPH011076A JP62-156947A JP15694787A JPH011076A JP H011076 A JPH011076 A JP H011076A JP 15694787 A JP15694787 A JP 15694787A JP H011076 A JPH011076 A JP H011076A
Authority
JP
Japan
Prior art keywords
area
label
partial
coordinate
storage device
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.)
Pending
Application number
JP62-156947A
Other languages
Japanese (ja)
Other versions
JPS641076A (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.)
Sharp Corp
Original Assignee
Sharp Corp
Filing date
Publication date
Application filed by Sharp Corp filed Critical Sharp Corp
Priority to JP62156947A priority Critical patent/JPS641076A/en
Priority claimed from JP62156947A external-priority patent/JPS641076A/en
Publication of JPH011076A publication Critical patent/JPH011076A/en
Publication of JPS641076A publication Critical patent/JPS641076A/en
Pending legal-status Critical Current

Links

Abstract

(57)【要約】本公報は電子出願前の出願データであるた
め要約のデータは記録されません。
(57) [Summary] This bulletin contains application data before electronic filing, so abstract data is not recorded.

Description

【発明の詳細な説明】 〈産業上の利用分野〉 本発明は実時間重心位置検出用画像処理装置に関し、例
えば組立ロボットにおいてワークの把持に際してパター
ン認識によるワークの重心位置の検出に用いられるもの
である。
[Detailed Description of the Invention] <Industrial Application Field> The present invention relates to an image processing device for detecting the center of gravity position in real time, and is used, for example, to detect the center of gravity position of a workpiece by pattern recognition when gripping the workpiece in an assembly robot. be.

〈従来の技術〉 パターン認識により物体の重心位置を検出する従来の方
法として、次の2種類がある。
<Prior Art> There are two types of conventional methods for detecting the center of gravity of an object using pattern recognition.

i)テレビカメラからの画像情報を一旦画像メモリーに
格納し、しかる後、ソフトウェアにより連結領域を判定
した後、各連結領域について有意画素のX座標とY座標
を累積し、この累積値を該当する連結領域の面積で割る
i) Image information from a television camera is temporarily stored in an image memory, and then connected areas are determined by software, and the X and Y coordinates of significant pixels are accumulated for each connected area, and this cumulative value is used as the corresponding Divide by the area of the connected region.

ii)テレビカメラからの画像情報に対して、専用回路
により有意画素のX座標とY座標の累積値及びパターン
の面積(有意画素数)を求め、映像信号の垂直同期期間
内に座標累積値を面積で割るソフトウェア処理によって
重心位置をビデオレートで求める。
ii) Based on the image information from the television camera, a dedicated circuit calculates the cumulative values of the X and Y coordinates of significant pixels and the area of the pattern (number of significant pixels), and calculates the cumulative coordinate values within the vertical synchronization period of the video signal. The center of gravity position is determined at video rate using software processing that divides by area.

〈発明が解決しようとする問題点〉 上述のi)の方法においでは、パターン面積が増加する
と一処理されるべきデータが飛躍的に増大するため、実
行速度が低下し、計算処理に長時間を要するようになる
。これは、例えば組立ロボソトにおいて製造ライン上を
流れるワークの把持には、致命的である。
<Problems to be Solved by the Invention> In the method i) described above, as the pattern area increases, the amount of data to be processed increases dramatically, which reduces the execution speed and requires a long time for calculation processing. It becomes necessary. This is fatal, for example, when gripping workpieces flowing on a production line in assembly robot sorting.

また、ii)の方法においては、視野内に2つ以上の独
立したパターンが存在する場合、全てのパターンをまと
めて総合的なひとつの重心位置を求めるので、複数のワ
ーク相互の相対的な位置関係を求めることは不可能であ
る。
In addition, in method ii), when two or more independent patterns exist within the field of view, all the patterns are combined to find one comprehensive center of gravity position, so the relative positions of multiple workpieces are It is impossible to seek a relationship.

〈問題点を解決するための手段〉 本発明に係る実時間重心位置検出用画像処理装置は、画
像平面が所定数の画素ごとに分割された部分領域におい
て各部分領域毎に有意画素のX座標とY座標並びに有意
画素数を累積加算する第1の演算手段と、有意画素の面
積が所定値以上である部分領域で互いに連結した部分領
域と連結しない部分領域とを区別するラベルを部分領域
に付すラベリング手段と、このラベルに基づいて連結し
た部分領域の集合体毎に第1の演算手段の累積加算値か
ら重心位置を計算する第2の演算手段とを備える。
<Means for solving the problem> The image processing device for real-time barycenter position detection according to the present invention calculates the X coordinate of a significant pixel for each partial region in which an image plane is divided into a predetermined number of pixels a first calculation means that cumulatively adds the Y coordinate and the number of significant pixels; and a first calculation means that cumulatively adds the Y coordinate and the number of significant pixels; and a label that distinguishes between connected partial areas and unconnected partial areas in partial areas in which the area of significant pixels is equal to or larger than a predetermined value, to the partial areas; and a second calculation means for calculating the center of gravity position from the cumulative addition value of the first calculation means for each set of connected partial regions based on the label.

〈作用〉 本発明に係る実時間重心位置検出用画像処理装置は、有
意画素のX座標、Y座標並びに有意画素数の累積加算を
部分領域毎に行なうとともに、有意画素の面積が所定値
以上である部分領域が連続するかしないかを区別するラ
ベリング処理を各部分領域に施し、各ラベルに基づいて
有意画素の面積が所定値以上である部分領域の集合体ご
とに累積加算値から重心位置を計算する。
<Operation> The image processing device for real-time barycenter position detection according to the present invention cumulatively adds the X coordinates, Y coordinates, and number of significant pixels of significant pixels for each partial region, and also performs cumulative addition of the A labeling process is applied to each partial region to distinguish whether a certain partial region is continuous or not, and the center of gravity position is determined from the cumulative addition value for each collection of partial regions where the area of significant pixels is greater than a predetermined value based on each label. calculate.

〈実施例〉 本実施例の重心位置検出用画像処理装置は、入力画像を
第2図に示すような256 X 256画素の平面内に
捉え、この平面内で分割された8×8画素の部分領域B
 (M、 N)において有意画素のX座標とY座標の各
々の累積値並びに有意画素の数を求め、計測結果を記憶
装置に格納する。部分領域内においては、画像に対する
走査点P (x、  y)が部分領域B (M、N)を
通過する期間に、有意画素のX座標とY座標の累積並び
に有意画素の計数の処理を実行する。さらに、1024
 (= 32 X 32)個の部分領域からなる1フレ
ームの処理完了を待たずに、処理の完了した部分領域か
ら逐次部分領域情報を処理し、ビデオレートで複数のパ
ターン個々について重心位置を求める。
<Example> The image processing device for detecting the center of gravity position of this example captures an input image within a plane of 256 x 256 pixels as shown in FIG. Area B
At (M, N), the cumulative value of each of the X and Y coordinates of significant pixels and the number of significant pixels are determined, and the measurement results are stored in a storage device. Within the partial area, during the period when the scanning point P (x, y) for the image passes through the partial area B (M, N), the process of accumulating the X and Y coordinates of significant pixels and counting the significant pixels is executed. do. Furthermore, 1024
Without waiting for the completion of processing of one frame consisting of (= 32 x 32) partial areas, partial area information is sequentially processed from the processed partial areas, and the center of gravity positions of each of a plurality of patterns are determined at a video rate.

第1図は本実施例の構成を示し、図中、1はテレビカメ
ラ、2.3は重心位置を求める対象となる物体、4は同
期分離回路、5は2値化回路、7はSカウンタ、8はY
カウンタ、9はXカウンタ。
FIG. 1 shows the configuration of this embodiment. In the figure, 1 is a television camera, 2.3 is an object whose center of gravity is to be determined, 4 is a synchronization separation circuit, 5 is a binarization circuit, and 7 is an S counter. , 8 is Y
Counter, 9 is the X counter.

12.16.20は全加算器、24は同期制御回路、2
5は記憶装置、26はCPU、27はROM。
12.16.20 is a full adder, 24 is a synchronous control circuit, 2
5 is a storage device, 26 is a CPU, and 27 is a ROM.

28はRAM、29は上位システムである。28 is a RAM, and 29 is a host system.

テレビカメラ1は、静止あるいは移動中の2個の物体2
,3の一部または全体を視野の中に捉え、同期信号を混
合した映像信号を同期分離回路4へ送出する。第1図は
一例として2個の対象物の場合を図示したが、対象物の
大きさや形状の複雑・単純の程度に応じて、さらに多数
の対象物が同−視野内に存在しても、本実施例では個々
の対象物の重心位置を実時間(ビデオレート)で計測し
得る。
A television camera 1 captures two stationary or moving objects 2.
, 3 within its field of view, and sends a video signal mixed with a synchronization signal to a synchronization separation circuit 4. Fig. 1 shows the case of two objects as an example, but depending on the size and complexity/simplicity of the shape of the objects, even if many more objects exist within the same field of view, In this embodiment, the center of gravity position of each object can be measured in real time (video rate).

同期分離回路4は、入力した映像信号から水平同期信号
HD、垂直同期信号VD並びにクロック信号φ。を分離
し、ビデオ信号を2値化回路5へ送出する。2値化回路
5は、このビデオ信号に対して予め設定された固定闇値
もしくは浮動闇値等の適切な闇値によって白黒に2値化
した2値情報系列VDATを実時間で生成する。
The synchronization separation circuit 4 extracts a horizontal synchronization signal HD, a vertical synchronization signal VD, and a clock signal φ from the input video signal. The video signal is sent to the binarization circuit 5. The binarization circuit 5 generates in real time a binary information series VDAT that is binarized into black and white using an appropriate darkness value such as a fixed darkness value or a floating darkness value set in advance for this video signal.

Sカウンタ7は、画素を同定するクロックをアンドゲー
ト6により2値情報系列VDATでマスクして得られた
クロックVCKを計数することにより、有意画素数を計
数する。Xカウンタ8は、水平同期信号HDを計数する
ことにより、点PのY座標yを同定する。Xカウンタ9
は、クロック信号φ。を計数することにより、点PのX
座標Xを同定する。全加算器12は、Xカウンタ8の出
力をフリップフロップ13に蓄えられたそれまでのY座
標の累積値に加算する。この加算値はフリップフロップ
13に蓄えられる。全加算器16は、Xカウンタ9の出
力をフリップフロップ17に蓄えられたそれまでのX座
標の累積値に加算する。
The S counter 7 counts the number of significant pixels by counting the clock VCK obtained by masking the clock for identifying pixels with the binary information series VDAT using the AND gate 6. The X counter 8 identifies the Y coordinate y of the point P by counting the horizontal synchronization signal HD. X counter 9
is the clock signal φ. By counting the
Identify the coordinate X. The full adder 12 adds the output of the X counter 8 to the cumulative value of the Y coordinate stored in the flip-flop 13 up to that point. This added value is stored in the flip-flop 13. The full adder 16 adds the output of the X counter 9 to the accumulated value of the X coordinate stored in the flip-flop 17 up to that point.

この加算値はフリップフロップ17に蓄えられる。This added value is stored in flip-flop 17.

全加算器20は、記憶装置25が記憶している有意画素
数、Y座標の累積値並びにX座標の累積値に、フリップ
フロップ10に蓄えられた有意画素数、フリ、7プフロ
ツプ14に蓄えられたY座標の累積値並びにフリップフ
ロップ18に蓄えられたX座標の累積値を夫々加算する
。これらの加算値は、記憶装置25に各々格納される。
The full adder 20 adds the number of significant pixels, the cumulative value of the Y coordinate, and the cumulative value of the The cumulative value of the Y coordinate and the cumulative value of the X coordinate stored in the flip-flop 18 are added. These added values are each stored in the storage device 25.

同期制御回路24は、垂直同期信号VDと水平同期信号
HDに同期して動作し、記憶装置25のアドレス信号並
びに各処理において必要な制御信号を生成する。記憶装
置25は、2ボ一トRAMで構成され、有意画素数、有
意画素のX座標累積加算値並びにY座標累積加算値を夫
々記憶する。
The synchronization control circuit 24 operates in synchronization with the vertical synchronization signal VD and the horizontal synchronization signal HD, and generates an address signal for the storage device 25 and control signals necessary for each process. The storage device 25 is composed of a two-bottom RAM, and stores the number of significant pixels, the cumulative addition value of the X coordinate, and the cumulative addition value of the Y coordinate of the significant pixels.

CPU26は、後述するラベリング処理や重心位置演算
並びに上位システム29とのデータ送受を含むシステム
全体の制御を実行する。
The CPU 26 executes control of the entire system including labeling processing, calculation of the center of gravity position, and data transmission/reception with the host system 29, which will be described later.

以下、処理の手順について説明する。The processing procedure will be explained below.

i)有意画素数の計数 Sカウンタ7にクロックVCKを入力することにより、
走査域8M≦X≦8M+7における有意画素数すなわち
有意画素の面積を計数する。この計数結果は、クロック
CKIによってフリップフロップ10に格納される。そ
の後、Sカウンタ7は、クリアパルスCL1によって0
に初期化され、次の部分領域B (M+1.N)内の有
意画素数の計数に備える。
i) By inputting the clock VCK to the S counter 7 for counting the number of significant pixels,
The number of significant pixels, that is, the area of significant pixels in the scanning area 8M≦X≦8M+7 is counted. This counting result is stored in the flip-flop 10 by the clock CKI. After that, the S counter 7 is set to 0 by the clear pulse CL1.
It is initialized to prepare for counting the number of significant pixels in the next partial region B (M+1.N).

フリップフロップ10に格納されたデータは、走査域が
8M+8≦X≦8M+15の期間に、記憶装置25が保
持する部分領域B (M、N)の有意画素の面積データ
に加算される。そして、この加算結果は、記憶装置25
の同じ領域に格納される。すなわち、クロックCKIO
によってパスバッファ22がディスエーブル状態になり
、同期制御回路24から記憶装置25に対して部分領域
B(M、N)の面積データが格納された領域のアドレス
が印加され、さらに記憶装置25に出力イネーブル信号
が印加される。これによって記憶装置25が出力した面
積データは、クロックCK9によってフリップフロップ
21に格納される。この処理と並行して、クロックCK
4によりパスバッファ11を介してフリップフロップ1
0が保持する面積データが全加算器20に入力される。
The data stored in the flip-flop 10 is added to the area data of the significant pixels of the partial area B (M, N) held in the storage device 25 during a period in which the scanning area is 8M+8≦X≦8M+15. The result of this addition is stored in the storage device 25.
are stored in the same area. That is, the clock CKIO
The path buffer 22 is disabled by this, and the address of the area where the area data of the partial area B (M, N) is stored is applied from the synchronization control circuit 24 to the storage device 25, and is further output to the storage device 25. An enable signal is applied. The area data output by the storage device 25 is thereby stored in the flip-flop 21 by the clock CK9. In parallel with this process, the clock CK
4 through the path buffer 11 to the flip-flop 1
The area data held by 0 is input to the full adder 20.

ただし、このときにはパスバッファ15.19はディス
エーブル状態である。次に、同期制御回路24により、
記憶装置25がデータ入力状態にされ且つパスバッファ
22がイネーブル状態にされる。
However, at this time, the path buffers 15 and 19 are in a disabled state. Next, the synchronization control circuit 24
Storage device 25 is brought into a data input state and path buffer 22 is enabled.

そして、全加算器20の加算結果は、記憶装置25の部
分領域B (M、N)の面積データを保持する領域に格
納される。
Then, the addition result of the full adder 20 is stored in the area of the storage device 25 that holds the area data of the partial area B (M, N).

1i)Y座標の累積加算 Yカウンタ8は、垂直同期信号VDによって0に初期化
さた後、水平同期信号HDを計数することによって点P
のY座標yを同定する。フリップフロップ13は、部分
領域B (M、N)内の計測に先立って、クリアパルス
CL2によってOに初期化される。走査域が8M≦X≦
8M+7の期間、Yカウンタ8の出力Yは全加算器12
において有意画素の度数だけ累積加算され、この加算結
果がクロックCK2によりフリップフロップ13に格納
される。このフリップフロップ13の内容は、クロック
CK5によってフリップフロップ14に格納される。そ
の後、フリップフロップ13は、クリアパルスCL2に
よって0に初期化され、次の部分領域B (M+1.N
)における有意画素のY座標の累積加算に備える。
1i) The Y-coordinate cumulative addition Y counter 8 is initialized to 0 by the vertical synchronizing signal VD, and then the point P is counted by counting the horizontal synchronizing signal HD.
Identify the Y coordinate y of . The flip-flop 13 is initialized to O by a clear pulse CL2 prior to measurement in the partial region B (M, N). Scan area is 8M≦X≦
During a period of 8M+7, the output Y of the Y counter 8 is sent to the full adder 12.
, the frequency of significant pixels is cumulatively added, and the addition result is stored in the flip-flop 13 by the clock CK2. The contents of this flip-flop 13 are stored in the flip-flop 14 by the clock CK5. Thereafter, the flip-flop 13 is initialized to 0 by the clear pulse CL2, and the next partial area B (M+1.N
) in preparation for cumulative addition of Y coordinates of significant pixels.

フリップフロップ14に格納されたデータは、走査域が
8M+8≦X≦8M+15の間に、記憶装置25が保持
する部分領域B (M、 N)のY座標の累積加算デー
タに加算され、この加算結果は記憶装置25の同じ領域
に格納される。すなわち、クロックCKIOによってパ
スバッファ22がディスエーブル状態になり、同期制御
回路24から記憶装置25に対して部分領域B (M、
 N)のY座標の累積データが格納された領域のアドレ
スが印加され、さらに記憶装置25に出力イネーブル信
号が印加される。これによって記憶装置25が出力した
Y座標累積データは、クロックCK9によってフリップ
フロップ21に格納される。この処理と並行して、クロ
ックCK7によりパスバッファ15を介してフリップフ
ロップ14が保持するY座標の累積データが全加算器2
0に入力される。ただし、このときはパスバッファ11
.19はディスエーブル状態である。次に、同期制御回
路24により、記憶装置25がデータ入力状態にされ且
つパスバッファ22がイネーブル状態にされる。そして
、全加算器20の加算結果は、記憶装置25の部分領域
B (M、 N)のY座標の累積データを保持する領域
に格納される。
The data stored in the flip-flop 14 is added to the cumulative addition data of the Y coordinate of the partial area B (M, N) held by the storage device 25 while the scanning area is 8M+8≦X≦8M+15, and the addition result is are stored in the same area of the storage device 25. That is, the pass buffer 22 is disabled by the clock CKIO, and the synchronization control circuit 24 transfers the partial area B (M,
The address of the area in which the accumulated data of the Y coordinate of N) is stored, and an output enable signal is also applied to the storage device 25. The Y-coordinate cumulative data output by the storage device 25 is thereby stored in the flip-flop 21 by the clock CK9. In parallel with this process, the accumulated data of the Y coordinate held by the flip-flop 14 is sent to the full adder 2 via the path buffer 15 by the clock CK7.
It is input to 0. However, in this case, the path buffer 11
.. 19 is in a disabled state. Next, the synchronization control circuit 24 places the storage device 25 in a data input state and enables the path buffer 22. Then, the addition result of the full adder 20 is stored in the area of the storage device 25 that holds the accumulated data of the Y coordinate of the partial area B (M, N).

1ii)X座標の累積加算 Xカウンタ9は、水平同期信号HDによってOに初期化
された後、クロック信号φ。を計数することによって点
PのXyi標Xを同定する。フリップフロップ17は、
部分領域B (M、N)内の計測に先立って、クリアパ
ルスCL3によってOに初期化される。走査域が8M≦
X≦8M+7の期間、Xカウンタ9の出力Xは点P (
x、  y)が有意画素のときに全加算器16において
累積加算され、この加算結果がクロックCK3によりフ
リップフロップ17に格納される。このフリップフロッ
プ17の内容は、クロックCK6によってフリップフロ
ップ18に格納さる。その後、フリップフロップ17は
、クリアパルスCL3によって0に初期化され、次の部
分領域B (M+1.N)における有意画素のX座標の
累積加算に備える。
1ii) X coordinate cumulative addition By counting, the Xyi mark X of the point P is identified. The flip-flop 17 is
Prior to measurement in partial region B (M, N), it is initialized to O by clear pulse CL3. Scanning area is 8M≦
During the period of X≦8M+7, the output X of the X counter 9 is at the point P (
x, y) are significant pixels, they are cumulatively added in the full adder 16, and the result of this addition is stored in the flip-flop 17 by the clock CK3. The contents of this flip-flop 17 are stored in the flip-flop 18 by the clock CK6. Thereafter, the flip-flop 17 is initialized to 0 by the clear pulse CL3, and prepares for cumulative addition of the X coordinates of significant pixels in the next partial area B (M+1.N).

フリップフロップ18に格納されたデータは、走査域が
8M+8≦X≦8M+15の期間に、記憶装置25が保
持する部分領域B (M、N)のX座標の累積加算デー
タに加算され、この加算結果は記憶装置25の同じ領域
に格納される。すなわち、クロックCKIOによってパ
スバッファ22がディスエーブル状態になり、同期制御
回路24から記憶装置25に対して部分領域B (M、
N)のX座標の累積加算データが格納された領域のアド
レスが印加され、さらに記憶装置25に出力イネーブル
信号が印加される。これによって記憶装置25が出力し
たX座標累積データは、クロックCK9によってフリッ
プフロップ21に格納される。この処理と並行して、ク
ロックCK8によりパスバッファ19を介してフリップ
フロップ18が保持するX座標累積データが全加算器2
0に入力される。ただし、このときはパスバッファ11
・15はディスエーブル状態である。次に、同期制御回
路24により、記憶装置25がデータ入力状態にされ且
つパスバッファ22がイネーブル状態にされる。そして
、全加算器20の加算結果は、記憶装置25の部分領域
B (M、N)のX座標累積データを保持する領域に格
納される。
The data stored in the flip-flop 18 is added to the cumulative addition data of the X coordinate of the partial area B (M, N) held by the storage device 25 during the period when the scanning area is 8M+8≦X≦8M+15, and the addition result is are stored in the same area of the storage device 25. That is, the pass buffer 22 is disabled by the clock CKIO, and the synchronization control circuit 24 transfers the partial area B (M,
The address of the area where the cumulative addition data of the X coordinate of N) is stored, and an output enable signal is also applied to the storage device 25. The X-coordinate cumulative data output by the storage device 25 is thereby stored in the flip-flop 21 by the clock CK9. In parallel with this process, the X coordinate accumulated data held by the flip-flop 18 is sent to the full adder 2 via the path buffer 19 by the clock CK8.
It is input to 0. However, in this case, the path buffer 11
-15 is disabled. Next, the synchronization control circuit 24 places the storage device 25 in a data input state and enables the path buffer 22. The addition result of the full adder 20 is stored in the area of the storage device 25 that holds the X-coordinate cumulative data of the partial area B (M, N).

以上のi )+ iiL iii )の処理を1フレー
ムの全体にわたって実行し、記憶装置25内の部分領域
の累積加算データ格納領域において、次式のデータが逐
次格納されていく。
The above processing i)+iiLiii) is executed over the entire one frame, and data of the following formula is sequentially stored in the cumulative addition data storage area of the partial area in the storage device 25.

X (M、N)=  Σ Σ X ’ C(X*  y
)  ;yxHXIIM X座標累積加算値 Y (M、N)=  Σ Σ y−C(x、y);y+
N    XIIM Y座標累積加算値 S (M、 N) =  Σ Σ C(x、  y) 
 ;  面積ymW    xmH ただし、C(x、y)は点P (x、  y)における
2値画像データを表わし、 とする。
X (M, N) = Σ Σ X 'C(X* y
) ;yxHXIIM X coordinate cumulative addition value Y (M, N) = Σ Σ y−C(x, y); y+
N XIIM Y coordinate cumulative addition value S (M, N) = Σ Σ C (x, y)
; Area ymW x mH where C(x, y) represents binary image data at point P (x, y);

同期制御回路24は、記憶装置25のアドレスと各種制
御パルスを次のように生成する。すなわち、Yカウンタ
8の出力中上位5桁とXカウンタ9の出力中上位7桁を
第4図に示す書式で合成して記憶装置25のアドレスを
生成する。この場合、ADRII、ADRIOによって
部分領域内面積格納部、部分領域内X座標累積加算値格
納部並びに部分領域内Y座標累積加算値格納部を各々同
定し、ADRO−ADR4によって部分領域B (M。
The synchronization control circuit 24 generates the address of the storage device 25 and various control pulses as follows. That is, the address of the storage device 25 is generated by combining the top five digits of the output of the Y counter 8 and the top seven digits of the output of the X counter 9 in the format shown in FIG. In this case, ADRII and ADRIO are used to identify the partial region internal area storage section, partial region internal X coordinate cumulative addition value storage section, and partial region Y coordinate cumulative addition value storage section, respectively, and ADRO-ADR4 is used to identify the partial region B (M).

N)のX座標0≦M≦31を同定し、ADR5〜ADR
9によって部分領域B (M、N)のY座標0≦N≦3
1を同定し、さらに、クロックパルス及びクリアパルス
を第3図に示すタイミングで生成する。
N) X coordinates 0≦M≦31 are identified, and ADR5 to ADR
9, Y coordinate of partial area B (M, N) 0≦N≦3
1 is identified, and furthermore, a clock pulse and a clear pulse are generated at the timing shown in FIG.

CPU26は、画像入力時に生じるノイズによる影響を
除くため、面積情報に対する閾値Thを用いて次に説明
する処理を実行し、重心位置を計算する。第6図はこの
処理手順を示し、以下この流れ図にしたがって説明する
In order to eliminate the influence of noise that occurs when inputting an image, the CPU 26 executes the process described below using a threshold Th for the area information, and calculates the center of gravity position. FIG. 6 shows this processing procedure, and will be explained below according to this flowchart.

同期制御回路24にスタート信号を送出しくステップ#
1)、続いて、後述するラベル関係対応表とラベル領域
データ表を初期化する(#2)。
Step # of sending a start signal to the synchronous control circuit 24
1), then a label relationship correspondence table and a label area data table, which will be described later, are initialized (#2).

パスバッファ23をクロックCKIIによってイネーブ
ル状態にしてYカウンタ8の計数値の上位5ビツトを読
み込み、現在処理中の部分領域B(M、 N)について
Y座標Nを読み込む(#3)。
The path buffer 23 is enabled by the clock CKII, the upper five bits of the count value of the Y counter 8 are read, and the Y coordinate N of the partial area B(M, N) currently being processed is read (#3).

CPO26が処理を完了した部分領域のY座標をCNと
すると、N−1≦CNのとき、記憶装置25内でのアド
レスの競合を避けるためにステップ#3に戻り、Nの値
の監視を続ける。N−1>CNのときは、CN=N−1
とし、CPU26が処理を開始する部分領域のX座標0
Mを−lとする(#5)。
Assuming that the Y coordinate of the partial area for which the CPO 26 has completed processing is CN, when N-1≦CN, the process returns to step #3 to avoid address conflict within the storage device 25 and continues monitoring the value of N. . When N-1>CN, CN=N-1
and the X coordinate of the partial area where the CPU 26 starts processing is 0.
Set M to -l (#5).

CM=CM+1の操作を施しく#6)、記憶装置25か
ら部分領域B (CM、CN)における有意画素の面積
S (CM、CN)を読み出しく#7)、S (CM、
CN)<Thの場合にはステップ付1フヘジヤンプして
新たな部分領域行の処理へ移行する。
Perform the operation CM=CM+1 #6) and read out the area S (CM, CN) of significant pixels in the partial area B (CM, CN) from the storage device 25 #7), S (CM, CN)
If CN)<Th, a stepwise jump is performed to proceed to processing of a new partial area row.

S (CM、CN)≧Thの場合には、部分領域B(M
、N)に隣接した部分領域の面積S(CM−1゜CN−
1)、S (CM−1,CN)、S (CM。
In the case of S (CM, CN)≧Th, partial region B(M
, N) is the area S(CM-1°CN-
1), S (CM-1, CN), S (CM.

CN−1)、S (0M+1.CN−1)(7)すべて
が閾値Thより小さいときすなわち8近傍連結でないと
きは、−ステップ#13へ移行する。ただし、CM−1
<OまたはCN−1<0(7)場合、S(CM−1,C
N−1)=0またはS (CM−1゜CN)=0または
S(CM、CN−1)=0またはS(CM+l、CN−
1)=Oとする。
CN-1), S (0M+1.CN-1) (7) are all smaller than the threshold Th, that is, when there is no 8-neighbor connection, the process moves to step #13. However, CM-1
<O or CN-1<0(7), then S(CM-1,C
N-1)=0 or S (CM-1°CN)=0 or S(CM, CN-1)=0 or S(CM+l, CN-
1)=O.

S (CM−1,CN−1)、S (CM−1,CN)
S (CM-1, CN-1), S (CM-1, CN)
.

S (CM、CN−1)、S (0M+1.CN−1)
の少なくとも一つが閾値Thより小さくないときは、注
目する部分領域B (CM、CN)の8近傍連結部分領
域内に既に後述するラベル付けがなされた部分領域が存
在するため、次の式に従ってB(CM、CN)(Dラベ
)LL  (CM、CN)を決定する(#10)、この
ラベルL (CM 、  CN )は、1〜256の整
数とし、■から順に採用され、初期状態において全ての
部分領域のラベルは零とする。
S (CM, CN-1), S (0M+1.CN-1)
If at least one of them is not smaller than the threshold Th, there is already a labeled partial area in the 8-neighbor connected partial areas of the partial area B (CM, CN) of interest, so B is determined according to the following formula. (CM, CN) (D label) Determine LL (CM, CN) (#10). This label L (CM, CN) is an integer from 1 to 256, and is adopted in order from ■. In the initial state, all The label of the subregion is zero.

L  (CM、CN)=MAX (L (CM−1,C
N)。
L (CM, CN) = MAX (L (CM-1, C
N).

L (CM−1,CN−1)、L (CM、CN−1)
L (CM-1, CN-1), L (CM, CN-1)
.

L (0M+1.CN−1)) 即ち、注目する正方部分領域をB (M、N)として、
第5図に示す部分領域の連結集合体において各部分領域
に付けられたラベルの中で最大のものを注目する部分領
域のラベルとする。
L (0M+1.CN-1)) That is, let the square partial region of interest be B (M, N),
The largest label among the labels attached to each partial area in the connected set of partial areas shown in FIG. 5 is taken as the label of the partial area of interest.

次に、第5図に示す部分領域の連結集合体において、ラ
ベルの連結状態を調査する。即ち、この部分領域の連結
集合体において、各部分領域のラベルが全て同じである
ときは、ステップ#16以降へ移行する。この連結集合
体において、L(CM。
Next, in the connected aggregate of partial areas shown in FIG. 5, the connected state of the labels is investigated. That is, in this connected set of partial areas, if the labels of all partial areas are the same, the process moves to step #16 and subsequent steps. In this connected collection, L(CM.

CN)と異なるラベルL (k、A)が存在するときは
、第7図に示すようなラベル関係対応表を作成する(#
12)。この後、ステップ#16以降へ移行する。
If there is a label L (k, A) different from CN), create a label relationship correspondence table as shown in Figure 7 (#
12). After this, the process moves to step #16 and subsequent steps.

第7図のラベル関係対応表は、−例としてラベルL(C
M、CN)によって同定される連結部分領域とラベルL
 (k、  l)によって同定される連結部分領域は8
近傍連結であることを示すものである。
The label relationship correspondence table in FIG.
M, CN) and the label L
The connecting subregion identified by (k, l) is 8
This indicates that it is a neighborhood connection.

このラベル関係対応表は、さらに、ラベルL (k、l
)によって同定される連結部分領域とラベルL(i、j
)によって同定される連結部分領域は8近傍連結であり
、また、ラベルL (p、q)によって同定される連結
部分領域とラベルL(i、j)によって同定される連結
部分領域はラベルL (k、Gによって同定される連結
部分領域を介して8近傍連結であることを示している。
This label relationship correspondence table further includes labels L (k, l
) and the label L(i, j
) is an 8-neighbor connection, and the connected subregion identified by label L (p, q) and the connected subregion identified by label L(i, j) are labeled L ( It shows that there is 8-neighbor connection through the connecting partial region identified by k and G.

第7図中、下位ラベルは新たに調査された部分領域のラ
ベルを表し、上位ラベルは調査の結果新たに連結状態が
確認された既存のラベル、を表す。
In FIG. 7, the lower label represents the label of a newly investigated partial area, and the upper label represents an existing label whose connection state has been newly confirmed as a result of the investigation.

注目する部分領域が既に処理が完了した部分領域のいず
れとも8近傍で連結していないと、次式にしたがって部
分領域B (CM、CN)に新たなラベルL (CM、
CN)を付ける(#13)。。
If the partial region of interest is not connected to any of the partial regions for which processing has already been completed, a new label L (CM, CN) is added to the partial region B (CM, CN) according to the following formula.
CN) (#13). .

L (CM、CN)=MAX (L (p、  q))
 +まただし、p=o〜CM、q=1〜CMである。
L (CM, CN) = MAX (L (p, q))
+ However, p=o~CM, q=1~CM.

続いて、ラベル関係対応表の下位ラベル欄に新規ラベル
を登録する(#14)。このときの上位うベルはOであ
る。次に、連結部分領域内のデータの累積加算処理のた
めに、第8図に示すラベル領域データ表の1欄の最後部
にラベルL(CM、CN)を追加登録する(#15)。
Next, a new label is registered in the lower label column of the label relationship correspondence table (#14). The upper level at this time is O. Next, for cumulative addition processing of data in the connected partial area, a label L (CM, CN) is additionally registered at the end of column 1 of the label area data table shown in FIG. 8 (#15).

ステップ#16では、X座標、Y座標1面積Sの各累積
加算値を更にラベル別に累積加算し、ラベル値lについ
て各々の累積加算値をLX(ff)。
In step #16, the cumulative addition values of the X coordinate and Y coordinate 1 area S are further cumulatively added for each label, and each cumulative addition value for the label value l is set as LX(ff).

LY (f)、Ls (Il)とする。そして、同一の
ラベルによって同定される正方部分頌域連結集合体のX
座標累積加算処理、Y座標累積加算処理並びに面積累積
加算処理を次式に従って実施し、ラベル領域データ表を
作成する。
Let LY (f) and Ls (Il). Then,
A coordinate cumulative addition process, a Y coordinate cumulative addition process, and an area cumulative addition process are performed according to the following equations to create a label area data table.

LX (L (CM、CN))=LX (L (CM、
CN))+X (CM、CN) LY (L (CM、CN))=LY (L (CM、
CN))+Y (CM、CN) LS (L (CM、CN))=LS (L (CM、
CN))+S (CM、CN) (CM、 CN) <(31,31)の場合、ステップ
#6または#3に戻り、新たな部分領域行の処理を実施
する。(CM、  CN) =(31,31)の場合、
各連結ラベル領域の重心位置を計算するため、ステップ
#19へ移行する。
LX (L (CM, CN)) = LX (L (CM, CN))
CN))+X (CM, CN) LY (L (CM, CN))=LY (L (CM,
CN))+Y (CM, CN) LS (L (CM, CN))=LS (L (CM,
CN))+S (CM, CN) (CM, CN) <(31, 31), the process returns to step #6 or #3 and processes a new partial area row. If (CM, CN) = (31, 31),
In order to calculate the center of gravity position of each connected label area, the process moves to step #19.

ステップ#19では、CPU26はラベル関係対応表(
第7図)を逆に辿って、最も若いラベル値inを得る。
In step #19, the CPU 26 executes the label relationship correspondence table (
7) in reverse to obtain the youngest label value in.

そして、このラベル値inを用いてLX (in)、L
Y (ln)、LS (/n)をラベル領域データ表(
第8図)より読み出す。次に、ラベル関係対応表からラ
ベル値lnの上位ラベル値1mを得る。このラベル値1
mによって示されるラベル領域の各データL X(j!
 m)、 L Y(1m)。
Then, using this label value in, LX (in), L
Y (ln), LS (/n) in the label area data table (
Figure 8). Next, the upper label value 1m of the label value ln is obtained from the label relationship correspondence table. This label value 1
Each data LX(j!) in the label area indicated by m
m), L Y (1m).

LS (1m)にラベル値lnによって示されるラベル
領域名データを累積加算し、且つ、ラベル関係対応表よ
りラベル(lffJnを削除する。以上のラベルデータ
の累積加算処理を、ラベル関係対応表において上位ラベ
ルが見出せなくなるまで繰り返す。
Cumulatively add the label area name data indicated by the label value ln to LS (1m), and delete the label (lffJn) from the label relationship correspondence table. Repeat until no more labels can be found.

次に、ステップ#20において連結ラベル領域別に重心
位置を計算する。ステップ#19の処理の結果、ラベル
関係対応表に残されたラベルを1゜l z、−、l i
  (iは入カバターンの個数)とする。
Next, in step #20, the center of gravity position is calculated for each connected label area. As a result of the processing in step #19, the labels remaining in the label relationship correspondence table are 1゜l z, -, l i
(i is the number of input patterns).

このとき、各パターンの重心位置をGXi、GYiとし
て、 なる計算処理を施すことにより、複数の入カバターンの
各々の重心位置が得られる。
At this time, the gravity center positions of each of the plurality of input pattern patterns can be obtained by performing the following calculation process, assuming that the gravity center positions of each pattern are GXi and GYi.

なお、上述の実施例においては、記憶装置25を時分割
方式で用いたが、面積、X座標、Y座標の各情報につい
てそれぞれ専用の記憶装置を備えたものは、原理的に本
発明と同様である。また、実施例においては、部分領域
の大きさとして一辺が8画素の正方形を採用したが、C
PUの待ち時間を削減し且つ処理速度を向上させるため
、数画素が連結した部分領域について前処理を施して重
心位置を求める方式は、本発明の部分領域の形状を変化
させた例である。
In the above-described embodiment, the storage device 25 was used in a time-sharing manner, but a device having a dedicated storage device for each information of area, X coordinate, and Y coordinate may be similar in principle to the present invention. It is. In addition, in the example, a square with 8 pixels on one side was used as the size of the partial area, but C
In order to reduce the waiting time of the PU and improve the processing speed, a method of performing preprocessing on a partial area in which several pixels are connected to obtain the center of gravity position is an example of the present invention in which the shape of the partial area is changed.

〈発明の効果〉 以上詳述したように本発明においては、入力画像を捉え
る平面を所定数の画素からなる部分領域に分割し、各部
分領域毎に有意画素のX座標、Y座標並びに画素数を累
積加算するとともに、部分領域のラベリングにより、有
意画素が連続した部分領域と連続しない部分領域との区
別を行い、各ラベル毎の累積加算値から重心位置を計算
するようにしたので、複数の入カバターンについて各々
の重心位置を実時間で同時並列処理により計算すること
ができる。
<Effects of the Invention> As described in detail above, in the present invention, a plane that captures an input image is divided into partial regions each consisting of a predetermined number of pixels, and the X and Y coordinates of significant pixels and the number of pixels are determined for each partial region. At the same time, by labeling the partial regions, we distinguish between partial regions with consecutive significant pixels and partial regions with non-consecutive significant pixels, and calculate the centroid position from the cumulative addition value for each label. The center of gravity position of each input cover turn can be calculated in real time by simultaneous parallel processing.

本発明は、ビデオレートで複数の物体の重心位置を検出
し得るため、製造ライン上でロボットによる物体の把持
、製品検査、高速移動物体の位置計測等に応用可能であ
る。また、ラベリング処理を実施しているので、視野内
対象物の個数の計数もビデオレートで実行できる。さら
に、パターン別の面積計測をも実施しているので、製品
検査における欠けやキズの検査を数個について同時並列
にビデオレートで処理し得る。これらの各機能は高速(
ビデオレート)で作用し得るため、各種製品の出荷時に
おける調整作業を自動化する際の視覚フィードバックに
おいて、核技術となり得るものである。また、複数のカ
メラをCPUの制御によって切り換える装置を付加する
ことにより、本発明の処理の高速性を生かして、本発明
の一つのシステムで複数の生産ラインに対処することが
できる。
Since the present invention can detect the center of gravity positions of multiple objects at a video rate, it can be applied to gripping objects by robots on production lines, product inspection, position measurement of high-speed moving objects, and the like. Furthermore, since labeling processing is performed, the number of objects within the field of view can be counted at the video rate. Furthermore, since area measurement is performed for each pattern, inspection for chips and scratches during product inspection can be performed simultaneously and in parallel at video rate. Each of these features is fast (
Since it can operate at video rates), it can become a core technology for visual feedback when automating adjustment work at the time of shipping of various products. Furthermore, by adding a device that switches between multiple cameras under the control of the CPU, one system of the present invention can handle multiple production lines by taking advantage of the high-speed processing of the present invention.

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

第1図は本発明実施例の構成を示すブロック図、第2図
は本発明実施例の画像解析平面の構成を示す図、 第3図は本発明実施例の信号のタイミングチャート、 第4図は本発明実施例の同期制御回路におけるアドレス
生成書式を示す図、 第5図は本発明実施例の部分領域の連結集合体を示す図
、 第6図は本発明実施例の処理手順を示すフローチャート
、 第7図は本発明実施例のラベル関係対応表を示す図、 第8図は本発明実施例のラベル領域データ表を示す図で
ある。 1・・・テレビカメラ 2.3・・・物体 4・・・同期分離回路 5・・・2値化回路 7・・・Sカウンタ 8・・・Yカウンタ 9・・・Xカウンタ 10.13,14.17,18.21 ・・・フリソプ
フロフブ 12.113.20・・・全加算器 24・・・同期制御回路 25・・・記憶装置 26・・・CPU 27・・・ROM 28・・・RAM 特許出願人    シャープ株式会社 代 理 人    弁理士 西1)新 第4図 第5父
FIG. 1 is a block diagram showing the configuration of the embodiment of the present invention, FIG. 2 is a diagram showing the configuration of the image analysis plane of the embodiment of the present invention, FIG. 3 is a signal timing chart of the embodiment of the present invention, and FIG. 4 5 is a diagram showing the address generation format in the synchronous control circuit according to the embodiment of the present invention, FIG. 5 is a diagram illustrating a connected aggregate of partial areas according to the embodiment of the present invention, and FIG. 6 is a flowchart showing the processing procedure of the embodiment of the present invention. , FIG. 7 is a diagram showing a label relationship correspondence table according to the embodiment of the present invention, and FIG. 8 is a diagram showing a label area data table according to the embodiment of the present invention. 1...TV camera 2.3...Object 4...Synchronization separation circuit 5...Binarization circuit 7...S counter 8...Y counter 9...X counter 10.13, 14.17, 18.21...Frissopflovub 12.113.20...Full adder 24...Synchronization control circuit 25...Storage device 26...CPU 27...ROM 28...RAM Patent Applicant Sharp Corporation Agent Patent Attorney Nishi 1) New Figure 4 Father

Claims (1)

【特許請求の範囲】[Claims] 画像平面が所定数の画素ごとに分割された部分領域にお
いて各部分領域毎に有意画素のX座標とY座標並びに有
意画素数を累積加算する第1の演算手段と、有意画素の
面積が所定値以上である部分領域で互いに連結した部分
領域と連結しない部分領域を区別するラベルを部分領域
に付すラベリング手段と、このラベルに基づいて連結し
た部分領域の集合体毎に第1の演算手段の累積加算値か
ら重心位置を計算する第2の演算手段とを備えたことを
特徴とする実時間重心位置検出用画像処理装置。
a first calculating means for cumulatively adding the X and Y coordinates and the number of significant pixels of a significant pixel for each partial region in a partial region in which the image plane is divided into a predetermined number of pixels; a labeling means for attaching a label to the partial region to distinguish between partial regions that are connected to each other and partial regions that are not connected; An image processing device for detecting a center of gravity position in real time, comprising: second calculation means for calculating a center of gravity position from an added value.
JP62156947A 1987-06-24 1987-06-24 Picture processor for detecting real time center of gravity position Pending JPS641076A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62156947A JPS641076A (en) 1987-06-24 1987-06-24 Picture processor for detecting real time center of gravity position

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62156947A JPS641076A (en) 1987-06-24 1987-06-24 Picture processor for detecting real time center of gravity position

Publications (2)

Publication Number Publication Date
JPH011076A true JPH011076A (en) 1989-01-05
JPS641076A JPS641076A (en) 1989-01-05

Family

ID=15638817

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62156947A Pending JPS641076A (en) 1987-06-24 1987-06-24 Picture processor for detecting real time center of gravity position

Country Status (1)

Country Link
JP (1) JPS641076A (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0431975A (en) * 1990-05-28 1992-02-04 Seikosha Co Ltd Image monitoring method
US7321687B2 (en) 2002-03-07 2008-01-22 Canon Kabushiki Kaisha Apparatus and method for image processing to label an object in a binary image
ES2197016B1 (en) * 2002-06-11 2005-02-01 Creaciones E Investigaciones Electronicas, S.L. MEANS OF RECOGNITION OF IMAGES.

Similar Documents

Publication Publication Date Title
WO1997039419A1 (en) Omnidirectional barcode locator
JPH011076A (en) Image processing device for real-time center of gravity position detection
JPH04147045A (en) Surface inspection device
Wang et al. Surface defect detection of sanitary ceramic product utilizing high-resolution image on two different scales
JPH02125375A (en) Position detecting device
JPH065545B2 (en) Figure recognition device
JPH0139651B2 (en)
JPH0259976A (en) Block integration processing method
JPH04169987A (en) Method for detecting character string in image information
JPH0514892A (en) Image monitoring device
JPS5830624B2 (en) End point detection method
JPH01173270A (en) Image processor
JPH1097634A (en) Method for recognizing object
JPS61286704A (en) Image border detection method
JPS5846475A (en) Pattern recording device
JPS6314281A (en) Picture fetching method
JP2959017B2 (en) Circular image discrimination method
JPS6365347A (en) Singular point detecting method by image processing
JPS61161582A (en) Pattern recognizing device
JPH01180075A (en) Position measuring method for feature point corner for pattern recognition
JPH05113315A (en) Center position detection method for circular image data
JPH0129643Y2 (en)
JPH0385681A (en) Picture processor
JPH03280173A (en) Image processing method
JPS61161583A (en) pattern recognition device