JPH0397079A - Device for detecting center of gravity - Google Patents

Device for detecting center of gravity

Info

Publication number
JPH0397079A
JPH0397079A JP1232944A JP23294489A JPH0397079A JP H0397079 A JPH0397079 A JP H0397079A JP 1232944 A JP1232944 A JP 1232944A JP 23294489 A JP23294489 A JP 23294489A JP H0397079 A JPH0397079 A JP H0397079A
Authority
JP
Japan
Prior art keywords
center
gravity
line
data
coordinates
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.)
Granted
Application number
JP1232944A
Other languages
Japanese (ja)
Other versions
JPH07113975B2 (en
Inventor
Yutaka Ogura
豊 小倉
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.)
Juki Corp
Original Assignee
Juki Corp
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 Juki Corp filed Critical Juki Corp
Priority to JP1232944A priority Critical patent/JPH07113975B2/en
Publication of JPH0397079A publication Critical patent/JPH0397079A/en
Publication of JPH07113975B2 publication Critical patent/JPH07113975B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

PURPOSE:To enable a successive processing at real time by extracting the first and final coordinates of effective picture data corresponding to an effective picture pattern in one scanning line and detecting the coordinates of a position for the center of gravity in a contour line pattern based on a cumulated result after scanning is finished. CONSTITUTION:A means 4 is provided to successively acquire th binary picture data of one picture element from the one-scanning line output signal of a picture reading means 1, and an extracting means 5 is provided to extract the first and final coordinates of the effective picture data corresponding to the effective picture pattern in the scanning line. Then, means 5 and 6 are provided to detect the coordinates of the position for the center of gravity in the contour line pattern for the effective picture pattern to be obtained for each scanning line based on the cumulated result of data in this prescribed form corresponding to the coordinates for the center of gravity in the picture pattern after scanning is finished. Thus, since the first and final coordinates of the effective picture data corresponding to the contour line of the effective picture pattern are converted to the prescribed data and cumulated for each line, the successive processing is enabled for each line and a processing to detect the center of gravity can be speedily detected at real time.

Description

【発明の詳細な説明】 [産業上の利用分野] 本発明は重心検出装置、特に画像読み取り手段により所
定画素からなるl走査ラインを単位として走査された画
像パターンの重心位置を検出する重心検出装置に関する
ものである。
Detailed Description of the Invention [Field of Industrial Application] The present invention relates to a center of gravity detection device, particularly a center of gravity detection device for detecting the center of gravity position of an image pattern scanned by an image reading means in units of l scanning lines each consisting of predetermined pixels. It is related to.

[従来の技術] 各種画像処理において、ある画像パターンの基準点とし
て重心位置を検出する技法が知られている。
[Prior Art] In various types of image processing, a technique is known in which the position of the center of gravity is detected as a reference point of a certain image pattern.

たとえば、プリント基板の位置を加工機械上の所定位置
に位置決めするために、?3fhの円形などのプリント
パターンをプリント基板上に形成しておき、このプリン
トパターンの重心位置をパターンの基準位置として検出
し、この位置を加工機械上の所定位置に位置決めする用
途が知られている。
For example, to position a printed circuit board at a predetermined position on a processing machine? It is known that a printed pattern such as a 3fh circle is formed on a printed circuit board, the center of gravity of this printed pattern is detected as a reference position of the pattern, and this position is positioned at a predetermined position on a processing machine. .

2次元の画像パターンすなわち図形の重心位置は,画像
濃度あるいは輝度を質量と考え、慣性モーメントを用い
て表現できることが知られている. ある図形が含まれるxy直交座標を考えた場合、重心位
置の座標(xG.yG)は次のように示される. x G =M107 MOO        − ( 
1 )y G =MOl/MOO        ・・
・(2)ただし、 M00:  図形の面積 MLO:  y軸に対する1次慣性モーメントMOI:
  x軸に対する1次慣性モーメント[発明が解決しよ
うとする課題1 コンピュータ処理などを利用して上記の重心位置の演算
を行なう場合には、光電変換手段を用いて図形を1ライ
ンづつ走査し、ラインデータを2値化することにより図
形のパターンデータが形成される. ここでは、2値化により図形が存在する領域ではライン
データは論理「l」を、また図形が存在しない領域では
ラインデータは論理「0」をとるものとする(データは
2値化されており図形の濃度は考慮しない)。
It is known that the position of the center of gravity of a two-dimensional image pattern, that is, a figure, can be expressed using the moment of inertia, considering image density or brightness as mass. When considering the xy orthogonal coordinates that include a certain figure, the coordinates of the center of gravity (xG.yG) are shown as follows. x G = M107 MOO − (
1)yG=MOl/MOO...
・(2) However, M00: Area of figure MLO: First moment of inertia with respect to the y-axis MOI:
The first moment of inertia with respect to the Geometric pattern data is created by binarizing the data. Here, line data assumes logic "l" in areas where figures exist due to binarization, and line data assumes logic "0" in areas where figures do not exist (data is binarized and (The density of the figure is not considered).

ここで、走査ラインがX軸に平行、ラインの配列方向が
y軸に平行であるとする。
Here, it is assumed that the scanning lines are parallel to the X-axis and the line arrangement direction is parallel to the y-axis.

この場合、y軸に対するl次慣性モーメントMIOは、
各走査ラインの論理rlJをとるデータのライン中−で
のアドレス(y軸からのデータ点までの距離すなわちX
座標に相当)を順次加算した値として検出できる。
In this case, the l-th moment of inertia MIO with respect to the y-axis is
The address in the line of data that takes the logic rlJ of each scan line (distance from the y-axis to the data point, i.e.
(equivalent to coordinates) can be detected as a value that is sequentially added.

またX軸に対する1次慣性モーメントMOIは、ライン
中の論理「l」をとるデータ数の総和とそのラインのア
ドレス(ラインのX軸からの距離すなわちy座標に相当
)の積を求め、これを各ラインについて累積した値とし
て検出できる.また、図形の面積は、各ラインの(論理
「l」)のデータの総和として検出できる。
The first-order moment of inertia MOI with respect to the X-axis is determined by calculating the product of the total number of data that takes a logical "l" in a line and the address of that line (corresponding to the distance from the X-axis of the line, that is, the y-coordinate). It can be detected as a cumulative value for each line. Further, the area of a figure can be detected as the sum of (logical "l") data of each line.

このようにして求めた図形のX.y軸に関する慣性モー
メント、面積から(1)、(2)式の演算により重心位
置の座標(xG.yG)を求めることができる。
The X of the figure obtained in this way. The coordinates (xG.yG) of the center of gravity can be determined from the moment of inertia regarding the y-axis and the area by calculating equations (1) and (2).

上記の処理方法では、図形中の全ての画素(質点)を参
照することになるので、図形作成プロセスあるいは画像
読み取りプロセスにおける障害により図形の画像データ
の一部が欠落している場合には、この欠落部分の評価も
含んだ重心位置が決定される. 図形が本来そのような欠落部分を含むのであれば算出さ
れる重心位置は本来の位置であり問題はない。
In the above processing method, all pixels (material points) in the figure are referred to, so if part of the image data of the figure is missing due to a failure in the figure creation process or image reading process, this The center of gravity position is determined, including the evaluation of the missing part. If the figure originally includes such a missing part, the calculated center of gravity position is the original position and there is no problem.

しかし、現実のアプリケーション、たとえば前述の所定
プリントパターンのプリント基板の位置決めなどにおい
ては、第2図に符号2lで示すように、基板形成プロセ
スにおいて画像パターン20そのものが欠落したり、あ
るいはゴミなどの異物により画像データが一部欠落した
りする可能性がある.なお、第2図において,左右方向
の矢印は走査ラインの方向を、また符号x.yはX、y
軸の方向を示している。
However, in actual applications, such as positioning a printed circuit board with the aforementioned predetermined printed pattern, the image pattern 20 itself may be missing during the board forming process, or foreign particles such as dust may be present, as shown by reference numeral 2l in FIG. Therefore, some image data may be missing. In FIG. 2, the left and right arrows indicate the direction of the scanning line, and the symbol x. y is X, y
Indicates the direction of the axis.

第2図のような場合に上記の処理方法を株用すると、プ
リントパターンの基準位置としての重心位置検出に誤差
が生じてしまう。当然、この検出誤差は検出結果を利用
する処理(上記用途においてはプリント基板の位置決め
)の精度に悪影響を与えるのはいうまでもない。
If the above-mentioned processing method is used in the case shown in FIG. 2, an error will occur in detecting the center of gravity position as the reference position of the printed pattern. Naturally, it goes without saying that this detection error has a negative effect on the accuracy of processing that uses the detection results (positioning of the printed circuit board in the above application).

本発明の課題は、以上の問題を解決することにある。An object of the present invention is to solve the above problems.

[課題を解決するための手段] 以上の課題を解決するために、本発明においては、画像
読み取り手段により所定画素からなるl走査ラインを単
位として走査された画像パターンの重心位置を検出する
重心検出装置において、前記画像読み取り手段のl走査
ラインを単位とする出力信号から、順次l画素の2値化
された画像データを取得する手段と、この画像データ取
得手段から順次I画素づつ出力される画像データに基づ
き当該走査ライン中の有効画像パターンに対応した有効
画像データの最初および最後の座標を抽出する抽出手段
と、この抽出手段から走査ラインごとに得られる有効画
像データの最初および最後の座標から所定形式のデータ
を求め累積し、走査終了後この所定形式のデータの累積
結果に基づき走査ラインごとに得られる有効画像データ
の最初および最後の座標全体が対応する有効画像パター
ンの輪郭線パターンの重心位置の座標を当該画像パター
ンの重心位置の座標に相当するとして検出する手段を設
けた構成を採用した. [作用] 以上の構成によれば、走査ラインごとに、そのラインで
得られる有効画像データの最初および最後の座標から所
定データを形成して累積し、走査終了後この累積結果か
ら有効画像パターンの輪郭轢パターンの重心位置の座標
をその有効画像パターンの重心位置の座標として検出す
る.この際、有効画像パターンの輪郭線に対応する有効
画像データの最初および最後の座標をラインごとに所定
のデータに変換、累積するため、ラインごとの逐次処理
が可能である。
[Means for Solving the Problems] In order to solve the above problems, the present invention provides a center of gravity detection method for detecting the position of the center of gravity of an image pattern scanned by an image reading means in units of l scanning lines each consisting of predetermined pixels. The apparatus includes means for sequentially obtaining binarized image data of l pixels from the output signal of the image reading means in units of l scanning lines, and an image sequentially outputted by I pixels from the image data obtaining means. Extracting means for extracting the first and last coordinates of the valid image data corresponding to the valid image pattern in the scanning line based on the data, and the first and last coordinates of the valid image data obtained from the extraction means for each scanning line. Data in a predetermined format is obtained and accumulated, and after scanning is completed, the first and last coordinates of the effective image data obtained for each scanning line based on the cumulative result of the data in the predetermined format are the center of gravity of the contour pattern of the corresponding effective image pattern. We adopted a configuration that includes means for detecting the coordinates of a position as corresponding to the coordinates of the center of gravity of the image pattern. [Operation] According to the above configuration, for each scanning line, predetermined data is formed and accumulated from the first and last coordinates of the effective image data obtained in that line, and after the scanning is completed, the effective image pattern is calculated from the cumulative result. The coordinates of the center of gravity of the outline pattern are detected as the coordinates of the center of gravity of the effective image pattern. At this time, since the first and last coordinates of the effective image data corresponding to the outline of the effective image pattern are converted and accumulated into predetermined data for each line, sequential processing for each line is possible.

[実施例] 以下、図面に示す実施例に基づき、本発明を詳細に説明
する. 第1図(A)に本発明を採用した重心検出装置の一実流
例を示す。第l図(A)において符号1は、ビデオカメ
ラなどからなる画像読み取り装置である. 画像読み取り装置lの読み取り出力はこA/D変換器2
により多値のデジタル信号に変換され、さらに2値化回
路4で所定の輝度しきい値と比較することなどにより、
論理rl」またはrQJをとる2値化データに変換され
る。論理rlJ、「0」はそれぞれ画像の明部、暗部に
対応づけられる。この対応づけは逆であってもよいが、
、以下では論理「l」を有効画像データとし、この部分
で、ある図形(画像パターン)が検出されているものと
する。
[Example] The present invention will be described in detail below based on the example shown in the drawings. FIG. 1(A) shows an example of an actual flow of a center of gravity detecting device employing the present invention. In FIG. 1(A), reference numeral 1 denotes an image reading device such as a video camera. The reading output of the image reading device 1 is the A/D converter 2.
is converted into a multivalued digital signal, and further compared with a predetermined luminance threshold in the binarization circuit 4,
The data is converted into binary data that takes the logic rl or rQJ. The logic rlJ, "0" is associated with the bright and dark parts of the image, respectively. This correspondence may be reversed, but
In the following, it is assumed that the logical "l" is valid image data, and that a certain figure (image pattern) is detected in this portion.

一方、画像読み取り装置lの出力はアドレス生成回路3
に人力され、同期信号などに基づき画像データのアドレ
スが生成される。
On the other hand, the output of the image reading device l is the address generation circuit 3.
The address of the image data is generated based on the synchronization signal and the like.

2値化回路4は、カウンタ回路などから構成され,l画
素に対応する1ビットの2値化画像デー夕を走査ライン
の最初のデータから直列に順次出力し、lライン分出力
すると次々に後続のラインのデータを同様に出力する.
2値化回路4のlビット出力に同期して、アドレス生成
回路3はそのビットに相当するアドレスを1組出力する
The binarization circuit 4 is composed of a counter circuit, etc., and sequentially outputs 1-bit binarized image data corresponding to l pixels in series starting from the first data of the scanning line, and after outputting l lines, it sequentially outputs 1-bit binarized image data corresponding to l pixels. Output the data for the line in the same way.
In synchronization with the l-bit output of the binarization circuit 4, the address generation circuit 3 outputs a set of addresses corresponding to the bits.

このアドレスは直交座標値に対応し、たとえば、ライン
番号(y座標に対応)!3よびライン中でのビットの位
置(X座標に対応)からなる。
This address corresponds to a Cartesian coordinate value, for example the line number (corresponding to the y-coordinate)! 3 and the position of the bit in the line (corresponding to the X coordinate).

2値化回路4が出力する2値化画像データおよび画像ア
ドレス信号は、重心パラメータ検出回路5、画像メモリ
7に人力される。画像メモリ7は別の画像処理などのた
めに画像データをバッファするもので従来周知のもので
ある。
The binarized image data and image address signal outputted from the binarization circuit 4 are manually input to the center of gravity parameter detection circuit 5 and the image memory 7. The image memory 7 buffers image data for other image processing, and is conventionally known.

重心パラメータ検出回路5はアドレスラッチ回路5a、
5bi5よびFIFOメモリ5c、5dにより構成され
る。重心パラメータ検出回路5は、2値化回路4、アド
レス生成回路3から出力されるデータおよびアドレスの
l走査ライン分を単位として動作する。
The center of gravity parameter detection circuit 5 includes an address latch circuit 5a,
5bi5 and FIFO memories 5c and 5d. The center of gravity parameter detection circuit 5 operates in units of l scanning lines of data and addresses output from the binarization circuit 4 and the address generation circuit 3.

アドレスラッチ回路5a、5bの構成、機能は次のよう
なものである。
The structure and function of address latch circuits 5a and 5b are as follows.

まず、アドレスラッチ回路5aは、■ラインの最初の有
効画像データ,すなわち、走査ラインの最初の論理rl
Jのビットのアドレスをラッチする。
First, the address latch circuit 5a receives the first valid image data of the line (1), that is, the first logic rl of the scanning line.
Latch the address of the J bit.

具体的には、アドレスラッチ回路5aは1ラインの走査
を開始後、データが論理「0」から論理rl」に転じた
とき、そのデータのアドレスをラッチする。したがって
、アドレスラッチ回路5aは、たとえば第1図(B)に
示すように2値化回路4の出力の立上りによりセットさ
れるJKフリップフロップ1lと、その出力により制御
されアドレス生成回路3の出力をラッチするデータラッ
チl2から構成できる。
Specifically, the address latch circuit 5a latches the address of data when the data changes from logic "0" to logic "rl" after starting scanning one line. Therefore, the address latch circuit 5a is controlled by the JK flip-flop 1l, which is set by the rising edge of the output of the binarization circuit 4, and the output of the address generation circuit 3, as shown in FIG. 1(B), for example. It can be composed of a data latch l2 that latches.

JKフリップフロップ1lには、クロックとして2値化
回路4の1ビット出力およびアドレス生成回路3の1組
のアドレス出力に同期したアドレスクロックclk (
第1図(D)4段目)が入力される。
The JK flip-flop 1l has an address clock clk (
FIG. 1(D) 4th row) is input.

第1図(D)の波形図のl段目に示すようなラインデー
タが2値化回路4から入力された場合、JKフリップフ
ロップ11は同図2段目(反転出力Q)に示すように最
初の有効データによりセットされる.2値化回路4の出
力と、JKフリップフロップ11の反転出力Qを入力す
るNANDゲートl3は同図3段目に示すラッチパルス
を出力し、データラッチ12はアドレス生成回路3の出
力アドレスをラッチする. 一方、アドレスラッチ回路5b’は、lラインの最後の
有効画像データ、すなわち、走査ラインの最初の論理「
1」のビットのアドレスをラッチする。具体的には、ア
ドレスラッチ回路5bは1ラインの走査中、データが論
理rlJの場合そのデータのアドレスをラッチする.ア
ドレスラッチ回路5bの場合には,論理「l」が検出さ
れるごとにライン終端まで繰り返しアドレスをラッチす
る。
When line data as shown in the lth stage of the waveform diagram of FIG. Set by the first valid data. The NAND gate l3, which receives the output of the binarization circuit 4 and the inverted output Q of the JK flip-flop 11, outputs the latch pulse shown in the third stage in the figure, and the data latch 12 latches the output address of the address generation circuit 3. do. On the other hand, the address latch circuit 5b' stores the last valid image data of the l line, that is, the first logic of the scanning line.
1" bit address is latched. Specifically, the address latch circuit 5b latches the address of the data when the data is logical rlJ during scanning of one line. In the case of the address latch circuit 5b, the address is repeatedly latched until the end of the line every time logic "1" is detected.

したがって、アドレスラッチ回路5bはたとえば第l図
(C)に示すように2値化回路4の出力によりセットさ
れるJKフリツプフロツブl5と、その出力により制御
されアドレス生成回路3の出力をラッチするデータラッ
チ16などから構成できる。
Therefore, the address latch circuit 5b includes, for example, a JK flip-flop l5 set by the output of the binarization circuit 4 as shown in FIG. It can be composed of 16, etc.

第l図(C)のJKフリツプフロツブl5には、アドレ
スラッチ回路5aのJKフリツブフロップ11同様のク
ロックcLkが入力される。
A clock cLk similar to the JK flip-flop 11 of the address latch circuit 5a is input to the JK flip-flop l5 in FIG. 1(C).

JKフリップフロップl5のJ.K入力には、第l図(
D)5段目のように2値化回路4の出力がインバータl
8により反転された信号が人力される。この結線では、
JKフリツブフロツブl5はDフリップフロツプと同様
に動作し、その反転出力は各有効画像データの先頭でク
ロツクclkに同期してハイレベルに制御される。この
結果、NANDゲートl7は各有効画像データの先頭で
データラッチl6をエネーブルし、そのラッチデータが
書き換えられる. アドレスラッチ回路5a、5bはアドレス生成回路3の
ラインアドレスの変化に同期して走査ラインの切り替わ
りを検出するが、lラインの処理を終了するとFIFO
メモリ5C、5dにそれぞれ最終的にラッチしているア
ドレスを入力する。
JK flip-flop l5 J. For K input, Fig.
D) As shown in the fifth stage, the output of the binarization circuit 4 is connected to the inverter l.
8, the inverted signal is input manually. In this connection,
JK flip-flop I5 operates similarly to a D flip-flop, and its inverted output is controlled to a high level in synchronization with clock clk at the beginning of each valid image data. As a result, NAND gate l7 enables data latch l6 at the beginning of each valid image data, and the latch data is rewritten. The address latch circuits 5a and 5b detect the switching of the scanning line in synchronization with the change in the line address of the address generation circuit 3.
The final latched addresses are input into the memories 5C and 5d, respectively.

その後、アドレスラッチ回路5a.5bはリセットされ
、上記のlラインの処理を繰り返す.このようにして、
FIFOメモリ5C、5dに1走査ラインの最初および
最後の有効画像データのアドレスが順次格納される.マ
イクロプロセッサなどからなるCPU6は、この2つの
アドレスを用いて重心位置の演算を行なう.なお、この
アドレスデータは、ラインアドレス(ライン番号)およ
びデータのライン中でのアドレスである.各走査ライン
の最初および最後の有効画像データは、実際の画像と第
3図のように対応する.第3図左側は、第1図(A)の
装置により従来例で示した第2図の図形を走査して得ら
れる各走査ラインの最初および最後の有効画像データの
位置を示している.第3図に明らかなように、各走査ラ
インの最初および最後の有効画像データの位置の連続は
,第2図の図形の輪郭線に相当するものである。
After that, address latch circuit 5a. 5b is reset, and the above process for line l is repeated. In this way,
The addresses of the first and last valid image data of one scanning line are sequentially stored in the FIFO memories 5C and 5d. A CPU 6 consisting of a microprocessor or the like uses these two addresses to calculate the center of gravity position. Note that this address data is the line address (line number) and the address within the data line. The first and last valid image data of each scan line correspond to the actual image as shown in FIG. The left side of FIG. 3 shows the positions of the first and last effective image data of each scanning line obtained by scanning the figure of FIG. 2 shown in the conventional example with the apparatus of FIG. 1(A). As is apparent in FIG. 3, the sequence of positions of the first and last valid image data of each scan line corresponds to the outline of the figure of FIG.

本実施例では、各走査ラインの最初および最後の有効画
像データのアドレスのみを用いて、つまり画像パターン
の輪郭線の情報のみを用いて重心位置の演算を行なう。
In this embodiment, the center of gravity position is calculated using only the addresses of the first and last valid image data of each scanning line, that is, only the information on the outline of the image pattern.

このとき、アドレス間のデータは評価せず,有効データ
のみにより構成されているものとみなす。
At this time, data between addresses is not evaluated, and it is assumed that the data consists only of valid data.

この結果、実際には得られる画像データに第2図のよう
に欠けがあり、第1図(D)中の破線で示すように本来
あるべき有効データが欠落していたとしても、第3図右
側に示すような欠落のない完全な画像パターンを処理し
たのと同じ結果を得られる。
As a result, even if the image data actually obtained is missing as shown in Figure 2, and effective data that should have been is missing as shown by the broken line in Figure 1 (D), as shown in Figure 3. The result is the same as processing a complete image pattern with no gaps, as shown on the right.

第4図に重心検出処理手順を示す。第4図では、CPU
6の制御と重心パラメータ検出回路5のハードウェアに
よる処理を同時に示している. 2値化回路4から1ビットの画像データが人力されると
、第4図のステップSL.S2において、第1図(B)
のアドレスラッチ回路5aの機能が実行される。ここで
は、有効画像データ(論理「l」)が検出されるとステ
ップS2でそのデータをラッチし,ステップS3以降に
より残りのラインデータを処理する. 一方、ステップSlで有効ラインデータが検出されなけ
れば、検出されるまでステップSt、S8のループが実
行される.ライン中に有効データが入力されなければ,
有効なアドレスデータはラッチされないので、ステップ
S9でFIFOメモリ5c.5dにアドレスO(無効ア
ドレス)が格納され,ステップSlOに移行する。
FIG. 4 shows the center of gravity detection processing procedure. In Figure 4, the CPU
6 and the hardware processing of the centroid parameter detection circuit 5 are shown simultaneously. When 1-bit image data is manually input from the binarization circuit 4, step SL. In S2, Fig. 1(B)
The function of the address latch circuit 5a is executed. Here, when valid image data (logical "l") is detected, that data is latched in step S2, and the remaining line data is processed in steps S3 and subsequent steps. On the other hand, if valid line data is not detected in step Sl, a loop of steps St and S8 is executed until it is detected. If no valid data is entered in the line,
Since valid address data is not latched, the FIFO memory 5c. Address O (invalid address) is stored in 5d, and the process moves to step SlO.

ステップS3〜S5では、アドレスラッチ回路5bの機
能が実行される.すなわち、前述のようにライン終端ま
で有効データが検出され(ステップS3)たら、その度
にアドレスをラッチする(ステップS4)処理が繰り返
される。
In steps S3 to S5, the function of the address latch circuit 5b is executed. That is, as described above, each time valid data is detected up to the end of the line (step S3), the process of latching the address (step S4) is repeated.

ステップS5でライン終端が検出されると、ステップS
6においてアドレスラッチ回路5aがラッチしているそ
のラインの最初および最後の有効データのアドレスをF
IFOメモリ5C、5dに格納する. ステップS7では、CPtJ6がFIFOメモリ5c.
5dに格納したアドレスに基づき、そのラインに関する
x.y軸回りの慣性モーメントおよびライン中の有効画
像データが占める面積を演算し、これをそれぞれ(1)
、(2)式中のM 00.MIO、MOIを累積するカ
ウンタに加算する演算処理を行なう。最初および最後の
有効データのアドレスを用いて行なう演算処理は次のよ
うなものである。
When the end of the line is detected in step S5, step S
6, the addresses of the first and last valid data of the line latched by the address latch circuit 5a are F.
Store in IFO memories 5C and 5d. In step S7, CPtJ6 stores FIFO memory 5c.
Based on the address stored in 5d, the x. Calculate the moment of inertia around the y-axis and the area occupied by the effective image data in the line, and calculate these by (1)
, M 00. in formula (2). Performs arithmetic processing to add MIO and MOI to a counter that accumulates them. The arithmetic processing performed using the addresses of the first and last valid data is as follows.

ここで、ラインl中のデータのアドレスをAiと表示す
るものとし、その最初および最後の有効画像データのア
ドレスをそれぞれAs.Aeとすると、ラインlのy軸
(ここではラインの配列方向に相当するものとする)回
りの1次慣性モーメント1 110は、 e 1&410=Σ  Ai         −・・ (
3)i=s により演算できる.つまり、AsからAeまでのアドレ
スを加算することでラインlOy軸回りの1次慣性モー
メントt utoが求められる.また,ラインlに関す
る有効画像の面積怯t wooは、1ビットの有効画像
データが「l」の重みを有するとすると、 11JOO =Ae−As+1     =− (4)
と示される。つまり、AsからAeの間は全て有効画像
データであるとみなしてその間の重み「l]のデータの
数をラインlに関する有効画像の面積を1 100とす
る。なお、3角形の頂点などにおいてl画素のみ有効画
像データが得られたラインでは、最初と最後のアドレス
が一致し、面積は1となる。
Here, the address of the data in line l is denoted as Ai, and the addresses of the first and last valid image data are respectively As. Assuming Ae, the first moment of inertia 1 110 of line l around the y-axis (corresponding to the line arrangement direction) is e 1 & 410 = Σ Ai -... (
3) It can be calculated by i=s. That is, by adding the addresses from As to Ae, the first moment of inertia about the line lOy axis can be found. Furthermore, the effective image area twoo for line l is 11JOO = Ae-As+1 =- (4), assuming that 1-bit effective image data has a weight of "l".
is shown. In other words, all data between As and Ae is considered to be valid image data, and the number of pieces of data with a weight of "l" between them is set to 1 100, where the area of the effective image with respect to line l is 1 100. In a line where valid image data is obtained only for pixels, the first and last addresses match, and the area becomes 1.

また、ラインアドレス(ライン番号)をAIとすると、
ラインlのX軸(ここではラインに平行な方向に相当す
るものとする)回りのl次慣性モーメントl&l01は
、 l MOI = l M00 ・AI       ・
−(5)により求められる。
Also, if the line address (line number) is AI,
The l-th moment of inertia l & l01 of line l around the X-axis (here, it corresponds to the direction parallel to the line) is l MOI = l M00 ・AI ・
− (5).

このようにラインごとに、面[ I MOOおよびx.
y軸回りのl次慣性モーメントI MOfI MIOを
求めることができ、CPU6はメモリ領域などに設定し
た累積カウンタにl画面分の面積l MGOおよびx.
y軸回りの1次慣性モーメントlMOl.l&l1ロを
累積することによりそれぞれ面積MOO. x. 3/
軸回りの1次慣性モーメントMOL. MIOを算出で
きる。
Thus, line by line, the planes [I MOO and x.
The l-th moment of inertia I MOfI MIO around the y-axis can be obtained, and the CPU 6 stores the area l MGO and x.
The first moment of inertia about the y-axis lMOl. By accumulating l&l1b, the area MOO. x. 3/
First moment of inertia around the axis MOL. MIO can be calculated.

ステップSlOでl画面の走査処理の終了を確認した後
,ステップSllにおいて上記MOO、MLO、MO+
を(1)、(2)式に代入することにより画像パターン
の重心座標(xG,yG)を求めることができる。
After confirming the completion of the scanning process for one screen in step SlO, the above-mentioned MOO, MLO, MO+
By substituting (1) and (2) into equations (1) and (2), the center of gravity coordinates (xG, yG) of the image pattern can be obtained.

なお、第4図ではステップS7のCPU6の演算は、便
宜上ステップS6、510の間の位置に記截しているが
、実際には、CPU6は図示の他の処理と並行してステ
ップs7の処理を行なう。
In addition, in FIG. 4, the calculation of the CPU 6 in step S7 is written at a position between steps S6 and 510 for convenience, but in reality, the CPU 6 performs the processing in step s7 in parallel with other processes shown in the figure. Do this.

すなわち、CPU6はステップs7の演算を行なえる状
態になると、FIFOメモリ5c、5dのフラグを参照
し、アドレスデータが用意されていればそのアドレスデ
ータについて順次ステップS7の処理を行なう。
That is, when the CPU 6 is ready to perform the calculation in step s7, it refers to the flags in the FIFO memories 5c and 5d, and if address data is prepared, it sequentially performs the process in step S7 on the address data.

以上の構成によれば、各走査ラインの最初および最後の
有効画像データのアドレスのみを用いて、つまり画像パ
ターンの輪郭線の情報のみを用いて重心位置の演算を行
なうため、第2図あるいは第3図左側のようにゴミや欠
けなどによりデータが一部欠落していたとしても、本来
の重心位置を正確に検出できる. したがって、この重心位置を他の部材の位置制御に利用
する場合でも、検出される重心位置誤差により制御誤差
を生じることがない. さらに、上記構成によれば、画像パターンの輪郭線を検
出する処理を1ラインごとにリアルタイムで実行できる
利点がある。従来の画像パターンの輪郭線検出処理では
、いったん画像データをメモリに格納してから画像パタ
ーンと背景の境界部をトラックする処理が必要であるが
、本実施例では第i図(C)、(D)に示したような簡
単なハードウェア構成により輪郭線を高速に検出でき、
これに基づき本来の重心位置の検出が可能となる。
According to the above configuration, the center of gravity position is calculated using only the addresses of the first and last valid image data of each scanning line, that is, only the information on the outline of the image pattern. Even if some data is missing due to dust or chips, as shown on the left side of Figure 3, the original center of gravity position can be detected accurately. Therefore, even when this center of gravity position is used to control the position of other members, no control error will occur due to the detected error in the center of gravity position. Further, according to the above configuration, there is an advantage that the process of detecting the outline of the image pattern can be executed line by line in real time. In conventional image pattern contour detection processing, it is necessary to once store the image data in memory and then track the boundary between the image pattern and the background. With a simple hardware configuration as shown in D), contour lines can be detected at high speed.
Based on this, it becomes possible to detect the original center of gravity position.

また、上記構成によれば、2値化回路4に設定するしき
い値の範囲を拡大できる。
Further, according to the above configuration, the range of threshold values set in the binarization circuit 4 can be expanded.

[発明の効果] 以上から明らかなように,本発明によれば、画像読み取
り手段により所定画素からなるl走査ラインを単位とし
て走査された画像パターンの重心位置を検出する重心検
出装置において、前記画像読み取り手段の1走査ライン
を単位とする出力信号から、順次i画素の2値化された
画像データを取得する手段と、この画像データ取得手段
から順次l画素づつ出力される画像データに基づき当該
走査ライン中の有効画像パターンに対応した有効画像デ
ータの最初および最後の座標を抽出する抽出手段と、こ
の抽出手段から走査ラインごとに得られる有効画像デー
タの最初および最後の座標から所定形式のデータを求め
累積し、走査終了後この所定形式のデータの累積結果に
基づき走査ラインごとに得られる有効画像データの最初
および最後の座標全体が対応する有効画像パターンの輪
郭線パターンの重心位置の座標を当該画像パターンの重
心位置の座標に相当するとして検出する手段を設けた構
成を探用しているので、走査ラインごとに、そのライン
で得られる有効画像データの最初および最後の座標から
所定データを形成して累積し、走査終了後この累積結果
から有効画像パターンの輪郭線パターンの重心位置の座
標をその有効画像パターンの重心位置の座標として検出
する。この際、有効画像パターンの輪郭線に対応する有
効画像データの最初および最後の座標をラインごとに所
定のデータに変換、累積するため、ラインごとの実時間
による逐次処理が可能であり、リアルタイムかつ高速な
重心検出処理が可能である6また,輪郭線パターンの重
心位置を有効画像パターンの重心として検出する、いい
がえれば、輪郭線内の画像データを無視し、あるいは輪
郭線内が全て有効画像データであるとみなし重心位置を
検出しているので、走査される画像そのものに欠陥があ
ったり、異物などにより走査プロセスで画像データに欠
陥が生じたとしても目的の画像パターンの本来の重心位
置を正確に検出できるなどの優れた効果がある.
[Effects of the Invention] As is clear from the above, according to the present invention, in the center of gravity detection device for detecting the center of gravity position of an image pattern scanned by an image reading means in units of l scanning lines each consisting of predetermined pixels, means for sequentially acquiring binarized image data of i pixels from the output signal of the reading means in units of one scanning line; Extraction means for extracting the first and last coordinates of valid image data corresponding to the valid image pattern in the line, and data in a predetermined format from the first and last coordinates of the valid image data obtained for each scanning line from this extraction means. After scanning is completed, the coordinates of the center of gravity of the outline pattern of the effective image pattern corresponding to the entire first and last coordinates of the effective image data obtained for each scanning line are calculated based on the accumulated results of this data in a predetermined format. Since we are looking for a configuration that includes means for detecting the coordinates as corresponding to the coordinates of the center of gravity of the image pattern, for each scanning line, predetermined data can be created from the first and last coordinates of the valid image data obtained in that line. After scanning is completed, the coordinates of the center of gravity of the outline pattern of the effective image pattern are detected from the accumulated results as the coordinates of the center of gravity of the effective image pattern. At this time, the first and last coordinates of the valid image data corresponding to the outline of the valid image pattern are converted and accumulated into predetermined data for each line, so sequential processing in real time for each line is possible, and real-time and High-speed center of gravity detection processing is possible 6 In addition, the center of gravity position of the contour line pattern is detected as the center of gravity of the valid image pattern.In other words, image data within the contour line is ignored, or all image data within the contour line is valid. Since the position of the center of gravity is detected based on the image data, even if there is a defect in the scanned image itself or a defect occurs in the image data during the scanning process due to foreign matter, the original center of gravity position of the target image pattern will be detected. It has excellent effects such as being able to accurately detect

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

第1図(A)は本発明を抹用した重心検出装置の構成を
示したブロック図、第l図(B)(C)は第l図(A)
のアドレスラッチ回路の構成を示したブロック図、第l
図(D)は第l図(B)、(C)のアドレスラッチ回路
の動作を示した波形図、第2図は重心検出装置で処理さ
れる欠落を含む画像パターンの説明図、第3図は本発明
による画像処理を示した説明図、第4図は重心検出制御
手順を示したフローチャート図である。 l・一画像読み取り装置 2・・・A/D変換器 3−・・アドレス生成回路 4−・・2値化回路 5−・一重心パラメータ検出回路 5a、5b・・・アドレスラッチ回路 5c.5d−F I FOメモリ 6・・・CPU 7・・一画像メモリ 1.15−・−JKフリップフロップ 2、l6−・−デークラッチ 3・・・NANDゲート 7・・・ORゲート 8・・・インバ一一夕 マド゜しスラ,,千〇訳デn#作と示しfこl給池口第
1図(D) 1b{釦ぐクー〉の誂e目0 第2図 画像バ7−〉ハ訛ef4め 第3図
FIG. 1(A) is a block diagram showing the configuration of a center of gravity detection device using the present invention, and FIG. 1(B) and (C) are FIG. 1(A).
A block diagram showing the configuration of the address latch circuit of
Figure (D) is a waveform diagram showing the operation of the address latch circuit in Figures 1 (B) and (C), Figure 2 is an explanatory diagram of an image pattern including omissions processed by the center of gravity detection device, and Figure 3 4 is an explanatory diagram showing image processing according to the present invention, and FIG. 4 is a flowchart diagram showing a center of gravity detection control procedure. l. Single image reading device 2...A/D converter 3--Address generation circuit 4--Binarization circuit 5--Single centroid parameter detection circuits 5a, 5b...Address latch circuit 5c. 5d-F I FO memory 6...CPU 7...One image memory 1.15--JK flip-flop 2, l6--D clutch 3...NAND gate 7...OR gate 8... Inba's all night madisura, 1,000 translations and written by de n# This is the supply pond mouth Figure 1 (D) accent ef4me fig.3

Claims (1)

【特許請求の範囲】 1)画像読み取り手段により所定画素からなる1走査ラ
インを単位として走査された画像パターンの重心位置を
検出する重心検出装置において、前記画像読み取り手段
の1走査ラインを単位とする出力信号から、順次1画素
の2値化された画像データを取得する手段と、 この画像データ取得手段から順次1画素づつ出力される
画像データに基づき当該走査ライン中の有効画像パター
ンに対応した有効画像データの最初および最後の座標を
抽出する抽出手段と、この抽出手段から走査ラインごと
に得られる有効画像データの最初および最後の座標から
所定形式のデータを求め累積し、走査終了後この所定形
式のデータの累積結果に基づき走査ラインごとに得られ
る有効画像データの最初および最後の座標全体が対応す
る有効画像パターンの輪郭線パターンの重心位置の座標
を当該画像パターンの重心位置の座標に相当するとして
検出する手段を設けたことを特徴とする重心検出装置。
[Scope of Claims] 1) A center of gravity detection device for detecting the position of the center of gravity of an image pattern scanned by an image reading means in units of one scanning line made up of predetermined pixels, wherein one scanning line of the image reading means is a unit. means for sequentially obtaining binarized image data of one pixel from the output signal; and effective image data corresponding to the effective image pattern in the scanning line based on the image data sequentially output pixel by pixel from the image data obtaining means. Extracting means for extracting the first and last coordinates of image data; data in a predetermined format is obtained and accumulated from the first and last coordinates of effective image data obtained for each scanning line from this extraction means; The coordinates of the center of gravity of the outline pattern of the corresponding effective image pattern correspond to the coordinates of the center of gravity of the corresponding image pattern, where the entire first and last coordinates of the effective image data obtained for each scanning line based on the cumulative result of data correspond to the coordinates of the center of gravity of the corresponding image pattern. What is claimed is: 1. A center of gravity detection device characterized by comprising means for detecting the center of gravity.
JP1232944A 1989-09-11 1989-09-11 Center of gravity detector Expired - Fee Related JPH07113975B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1232944A JPH07113975B2 (en) 1989-09-11 1989-09-11 Center of gravity detector

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1232944A JPH07113975B2 (en) 1989-09-11 1989-09-11 Center of gravity detector

Publications (2)

Publication Number Publication Date
JPH0397079A true JPH0397079A (en) 1991-04-23
JPH07113975B2 JPH07113975B2 (en) 1995-12-06

Family

ID=16947300

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1232944A Expired - Fee Related JPH07113975B2 (en) 1989-09-11 1989-09-11 Center of gravity detector

Country Status (1)

Country Link
JP (1) JPH07113975B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007286930A (en) * 2006-04-18 2007-11-01 Juki Corp Method for detecting gravity center of object
JP2013254380A (en) * 2012-06-07 2013-12-19 Konica Minolta Inc Image processing method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS4986747U (en) * 1972-11-16 1974-07-26
JPS5719882A (en) * 1980-07-10 1982-02-02 Toshiba Corp Extracting method for center of gravity in binary coded two dimensional pattern
JPS58217084A (en) * 1982-06-11 1983-12-16 Fujitsu Ltd Visual device for robot
JPS5958587A (en) * 1982-09-29 1984-04-04 Fuji Electric Co Ltd Pattern processing device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS4986747U (en) * 1972-11-16 1974-07-26
JPS5719882A (en) * 1980-07-10 1982-02-02 Toshiba Corp Extracting method for center of gravity in binary coded two dimensional pattern
JPS58217084A (en) * 1982-06-11 1983-12-16 Fujitsu Ltd Visual device for robot
JPS5958587A (en) * 1982-09-29 1984-04-04 Fuji Electric Co Ltd Pattern processing device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007286930A (en) * 2006-04-18 2007-11-01 Juki Corp Method for detecting gravity center of object
JP4707598B2 (en) * 2006-04-18 2011-06-22 Juki株式会社 Method for detecting the center of gravity of an object
JP2013254380A (en) * 2012-06-07 2013-12-19 Konica Minolta Inc Image processing method

Also Published As

Publication number Publication date
JPH07113975B2 (en) 1995-12-06

Similar Documents

Publication Publication Date Title
JPH05256796A (en) Inspecting system
JP3127434B2 (en) Pattern inspection method and pattern inspection device
JP2810660B2 (en) Particle image analyzer
JPH0397079A (en) Device for detecting center of gravity
JPS5821110A (en) Inspecting device for pattern
JP3116438B2 (en) Inspection apparatus and inspection method for printed wiring board
JPS5821107A (en) Inspecting device for pattern
KR100206258B1 (en) Image processing apparatus
JPH063541B2 (en) Pattern inspection equipment
JPH0490078A (en) Centroid detector
JP3122178B2 (en) Pattern inspection equipment
JPS59168312A (en) Pattern-defect judging device
JP2690936B2 (en) Digital image analyzer
JPH0410074A (en) Picture pattern inclination detecting method
JPH01318169A (en) Corner correcting device
JPH0743126A (en) Pattern inspection device
JPS61161582A (en) Pattern recognizing device
JPS62127987A (en) Method of checking printed board pattern
JPS6315823Y2 (en)
JPH0916766A (en) Image position identifying device
JPH03183147A (en) Inspection system of ic package
JP2598323B2 (en) Method for removing fine particles from binary image
JPS63204479A (en) Method for detecting present range of coupling component
JPH0418684A (en) Picture processor
JPH0145665B2 (en)

Legal Events

Date Code Title Description
S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

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

Free format text: PAYMENT UNTIL: 20081206

Year of fee payment: 13

LAPS Cancellation because of no payment of annual fees