JPS63213089A - Pattern signal processing circuit - Google Patents

Pattern signal processing circuit

Info

Publication number
JPS63213089A
JPS63213089A JP62047262A JP4726287A JPS63213089A JP S63213089 A JPS63213089 A JP S63213089A JP 62047262 A JP62047262 A JP 62047262A JP 4726287 A JP4726287 A JP 4726287A JP S63213089 A JPS63213089 A JP S63213089A
Authority
JP
Japan
Prior art keywords
data
register
pixel
gravity
center
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
JP62047262A
Other languages
Japanese (ja)
Inventor
Kenji Okamoto
賢司 岡本
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.)
Sumitomo Electric Industries Ltd
Original Assignee
Sumitomo Electric 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 Electric Industries Ltd filed Critical Sumitomo Electric Industries Ltd
Priority to JP62047262A priority Critical patent/JPS63213089A/en
Publication of JPS63213089A publication Critical patent/JPS63213089A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Analysis (AREA)

Abstract

PURPOSE:To accelerate processing by executing the processing of the center of gravity operation with the aid of a hardware. CONSTITUTION:The data aij on a picture element (i and j) is temporarily held by a flip flop 10. This data is transmitted to three arithmetic circuits which respectively operate X (i and j), Y (i and j) and Z (i and j). The multiplication of column numbers (j) and (aij) is executed by the X arithmetic circuit and the result of that is held by a first register 1. The partial sum X (i and j-1) up to the picture element (i and j-1) is held by a fourth register 4. The multiplication of row numbers (i) and (aij) is executed by the Y arithmetic circuit and the result of that is held by a second register 2. The partial sum Y (i and j-1) is held by a fifth register 5. The data is integrated as it is by the Z arithmetic circuit. The partial sum Z (i and j-1) up to the just before picture element (i and j-1) is held by a sixth register 6. When the scanning of one picture is finished, the total sum X, Y and Z are respectively inputted to a seventh to a ninth registers 7-9. The centers of gravity of an (x) direction and a (y) direction are obtained by these X, Y and Z.

Description

【発明の詳細な説明】 (7)技術分野 この発明は、2次元パターン認識の分野で頻繁に用いら
れる重心位置計算をハードウェアで高速に演算するよう
にしたものに関する。
DETAILED DESCRIPTION OF THE INVENTION (7) Technical Field The present invention relates to a system that uses hardware to perform high-speed calculation of the center of gravity position, which is frequently used in the field of two-dimensional pattern recognition.

画像処理の分野、面状接触上ンサによる接触パターンを
解析する技術分野などで、パターンの重心位置を計算す
る必要のある場合が多い。ここでパターンというのは、
マトリックス状に配置された画素の2値化されたデータ
の集まりのことである。
In the field of image processing, the technical field of analyzing contact patterns produced by planar contact sensors, etc., it is often necessary to calculate the position of the center of gravity of a pattern. The pattern here is
It is a collection of binarized data of pixels arranged in a matrix.

第1図はひとつの画像パターンの例を示している。ひと
つの画面の全体を縦横にNxNの画素に分割している。
FIG. 1 shows an example of one image pattern. The entire screen is divided into NxN pixels vertically and horizontally.

画素は画像を構成する最小の単位である。通常の行列と
同じように、縦方向に行の番号をつけ、横方向に列の番
号をつける。行番号を11列番号をjとする。画素の画
面上における位置は(i 、 j)によって表現するこ
とができる。
A pixel is the smallest unit that makes up an image. As with a regular matrix, number the rows vertically and number the columns horizontally. Let the row number be 11 and the column number be j. The position of a pixel on the screen can be expressed by (i, j).

i、jは0,1.2、・・・、(N−1)の値をとるも
のとする。i行目、j列目の画素を(iej)によって
表現する。
It is assumed that i and j take values of 0, 1.2, . . . , (N-1). The pixel in the i-th row and j-th column is expressed by (iej).

i = 0はO行目といい、j=oはθ列目という事に
する。
Let i=0 be the O-th row, and j=o be the θ-th column.

画素の中心を格子点という。画素の位置は(iej)で
表現できるが、格子点の位置によっても、画素の位置を
表現する事ができる。
The center of a pixel is called a grid point. The position of a pixel can be expressed by (iej), but it can also be expressed by the position of a grid point.

画面の最上最左方の画素(i=o 、 j=o )の格
子点全原点とする。これを原点とし右向きにX座標、下
向きにX座標をとる。格子間隔全簡単のため1とする。
Let all grid points of the uppermost leftmost pixel (i=o, j=o) on the screen be the origin. With this as the origin, take the X coordinate to the right and the X coordinate to the bottom. The grid spacing is set to 1 for simplicity.

そうすると画素(i、j)の格子点のX座標はj。Then, the X coordinate of the grid point of pixel (i, j) is j.

X座標はiである。The X coordinate is i.

格子点は画素の中心である。画素はひとつのデータを持
っている。白黒の2値化画像の場合、このデータはOか
1のいずれがである。
The grid point is the center of the pixel. A pixel has one piece of data. In the case of a black and white binary image, this data is either O or 1.

その画素についてデータはひとつ対応する。そこで画素
(ilj)に対するデータをaij と書くことにする
。これはOか1かいずれかである。画素は面積をもつ画
像の最小単位であるが、格子点は面積全もたない点であ
る。位置に関していえば、一対一に対応する。そこで、
重心を求める操作に於ては、画素と格子点とは区別をし
ないで用いても差支えない。
One piece of data corresponds to that pixel. Therefore, data for pixel (ilj) will be written as aij. This is either O or 1. A pixel is the smallest unit of an image that has an area, but a grid point is a point that does not have a total area. In terms of location, there is a one-to-one correspondence. Therefore,
In the operation of determining the center of gravity, pixels and grid points may be used without distinction.

一般に画素(i ej)の格子点のX座標をx(i、j
)、X座標をy(i、j)と書くことにする。
Generally, the X coordinate of the grid point of pixel (i ej) is x(i, j
), and the X coordinate is written as y(i, j).

既に述べたように、格子間隔を1とすればx(i。As already mentioned, if the lattice spacing is 1, then x(i.

j)=j、y(i、j)=iである。j)=j, y(i, j)=i.

第1図の図形は、任意のパターンであるが、たとえば、
ロボットハンドが把持すべき物体音、カメラで撮像し、
あるいは面状の接触七ンサによってとらえたものである
。2値化処理が施してあり、各画素のデータは、1か0
かの2値化号で与えられている。
The figure in Fig. 1 can be any pattern, for example,
The sound of the object to be grasped by the robot hand is captured by a camera,
Alternatively, it is captured by a planar contact sensor. Binarization processing is performed, and the data of each pixel is either 1 or 0.
It is given in the binary code.

この図で、白地の部分の画素のデータを1、黒地の部分
の画素のデータ全Oとする。白地の部分が物体の形状を
表わすとする。ここでロボットハンドが、この物体を把
持するためには、物体の位置情報を得る必要がある。
In this figure, it is assumed that the data of the pixels in the white background part is 1, and the data of all the pixels in the black background part is O. Assume that the white part represents the shape of the object. In order for the robot hand to grasp this object, it is necessary to obtain position information of the object.

物体の形状を把握し、位置を求めるには、黒白の境界線
よりなる輪郭の位置に求める事も必要である。これには
いくつかの方法がある。
In order to understand the shape of an object and find its position, it is also necessary to find the position of the outline formed by the black and white boundary line. There are several ways to do this.

それよりも、物体の位置を決定する上に重要なのは重心
の位置である。物体の形状が既に分っているとか、物体
の形状が極めて単純である、という場合、物体を示すパ
ターンの重心の位置が最も重要な情報という事になる。
Rather, what is important in determining the position of an object is the position of its center of gravity. If the shape of the object is already known or the shape of the object is extremely simple, the most important information is the position of the center of gravity of the pattern representing the object.

ただし、ここで重心というのは、2値化された画像に於
けるパターンの重心である。実物体の重心という事では
ない。
However, the center of gravity here refers to the center of gravity of the pattern in the binarized image. It is not the center of gravity of a real object.

データaij′f:、物体が存する画素について1、物
体が存しない画素についてOt一対応させるものとする
。この物体パターンの重心のX座標を”gsy座標をy
gとすると、 i=o  j=。
Data aij′f: 1 is associated with a pixel where an object exists, and Ot is associated with a pixel where an object is not present. The X coordinate of the center of gravity of this object pattern is "gsy coordinate is y"
If g, then i=o j=.

によって重心が計算される。The center of gravity is calculated by

重心を計算する事により、得られているパターン図形の
中心位置を求める事ができる。
By calculating the center of gravity, the center position of the obtained pattern figure can be found.

ピ)従来技術 2値化画像バクーンの重心’e(1)、(2)式によっ
て求める計算は、従来、コンピュータによって演算され
るのが普通であった。コンピュータによれば、他の処理
との併用も簡単なので、用途を拡げる事ができる。優れ
た汎用性があるため広く用いられている。
B) Prior art The calculation of the center of gravity of a binarized image Bakun using equations (1) and (2) has conventionally been generally performed by a computer. Computers can be easily used in combination with other processes, so the range of uses can be expanded. It is widely used because of its excellent versatility.

コンピュータを用い六画像処理であれば、フレームメモ
リと呼ばれる画像メモリ上に、マトリクス状のデータを
全て記憶させ、この後、データを画素ごとに読み出して
重心全演算することになる。
When processing six images using a computer, all matrix data is stored on an image memory called a frame memory, and then the data is read out pixel by pixel and all centroid calculations are performed.

(ロ)従来技術の問題点 画像全決定するデータがフレームメモリに記憶させであ
るので重心の演算以外に様々な演算、処理を行なう事が
できる。
(b) Problems with the Prior Art Since the data for determining the entire image is stored in the frame memory, various calculations and processes other than the calculation of the center of gravity can be performed.

シカシ、コンピュータによる画像処理ハ、メモリを介す
るため、処理時間が長くなる、という致命的な欠点があ
る。ひとつの画像があれば、これ’c7xんらかの方法
で走査して、A/D変換、2値化し、フレームメモリへ
書き込む。走査が終った時に書き込みが完成する。書き
込みが終ってから、データを読み出し、重心の演算をす
る。
However, since image processing by a computer involves memory, it has the fatal drawback of requiring a long processing time. If there is one image, it is scanned using some method, A/D converted, binarized, and written to frame memory. Writing is completed when scanning is completed. After writing is complete, read the data and calculate the center of gravity.

画面は多くの場合、短い時間で更新されてゆく。In many cases, the screen is updated in a short period of time.

画面の更新よりも速いスピードで重心演算をする必要が
ある。これは困難な事である。コンピュータによる重心
演算は、ある画面の走査が終り、次の画面の走査が始ま
るまでの短い時間になされなければならない。メモリか
らデータを読み出しながら演算をするから、重心演算に
は時間がかかる。
It is necessary to calculate the center of gravity faster than the screen is updated. This is difficult. The calculation of the center of gravity by a computer must be performed in a short period of time between the end of scanning one screen and the start of scanning the next screen. Calculating the center of gravity takes time because the calculation is performed while reading data from memory.

そうすると、画面を更新する周期が長くなりすぎる。If this happens, the screen update cycle becomes too long.

近年、オートメーション分野などに於る高速化の要求は
厳しいものがある。このためパターン処理の高速化も重
要な課題となっている。
In recent years, there has been a severe demand for higher speeds in the automation field. For this reason, increasing the speed of pattern processing is also an important issue.

に)  目      的 コンピュータによらず画像パターンの重心全、ハードウ
ェアによって演算するようにする事が本発明の目的であ
る。
2) Purpose It is an object of the present invention to calculate the entire center of gravity of an image pattern by hardware, without relying on a computer.

画面のデータを走査するのと同時に重心演算が進行し、
走査が完了した時に、重心演算も完了しているような高
速の処理を可能とする事が本発明の第2の目的である。
At the same time as the data on the screen is scanned, the center of gravity calculation progresses.
A second object of the present invention is to enable high-speed processing in which the center of gravity calculation is also completed when scanning is completed.

コンピュータによらない、という事は、画像データをい
ったんフレームメモリに書き込み、これを読み出して演
算するという2重の操作を行なわない、という事である
Not relying on a computer means that there is no double operation of writing image data into a frame memory and reading it out for calculation.

(イ)構 成 今まで、コンピュータによって演算していた重心に関す
る(1)、’ (2)式をコンピュータによらず、ハー
ドウェアによって求めようとするのが本発明の目的であ
る。
(a) Configuration It is an object of the present invention to obtain equations (1) and (2) regarding the center of gravity, which have been calculated by a computer, by using hardware instead of using a computer.

(1)、(2)、に於て求めなければならない値はであ
る。いずれも2重積算ΣΣ全行なわなければならない。
The values that must be found in (1) and (2) are. In both cases, double integration ΣΣ must be performed.

Nは有限の値であるから、積算の順序をどのように変更
しても結果が変わらない。
Since N is a finite value, no matter how the order of integration is changed, the result will not change.

画面を走査(スキャニング)する方式は、さまざまに考
える事ができる。最も単純なものはラスク順の走査であ
る。これは左上の画素(i=0.j=0)からはじめ、
左から右へ1行分走査しくj=0〜N−1)、次いで、
1行下って(i=1)、左から右への走査を行を変えて
行なう。
Various methods can be considered for scanning the screen. The simplest one is rask-order scanning. This starts from the upper left pixel (i=0.j=0),
Scan one line from left to right (j = 0 to N-1), then
Go down one line (i=1) and scan from left to right, changing lines.

このような走査は、jvoからN−1まで加え、これを
iについて0がらN−1まで加えるという(3)〜(5
)の2重積算と厳密に対応する。
Such a scan is performed by adding jvo to N-1 and adding this to i from 0 to N-1 (3) to (5).
) strictly corresponds to the double multiplication of

従って、TV画面などの走査をラスク順に行なう時、(
3)〜(5)の演算を走査と平行して行なう事ができる
のである。
Therefore, when scanning a TV screen etc. in rask order, (
The operations 3) to (5) can be performed in parallel with scanning.

しかし、本発明の可能性が走査方式に依存するというわ
けではない。
However, the possibilities of the invention are not dependent on the scanning method.

これ以外の走査方式であってもよい。この場合は2重積
算の順序を、その走査方式に合致するように変更すれば
よいのである。
Other scanning methods may be used. In this case, the order of double integration can be changed to match the scanning method.

さて、i行目のj列目までの部分和を考える。Now, consider the partial sum up to the i-th row and the j-th column.

これを全体和x、y、zに対してX(i、j)、Y(i
、j)Z(i、j)とする。
This is calculated as X(i, j), Y(i
, j) Z(i, j).

既に述べたように、X(i、j)=j1y(i、j)−
1であるので、(8)、(4)は次のように書くことが
できる。
As already mentioned, X(i,j)=j1y(i,j)−
1, so (8) and (4) can be written as follows.

これに対して部分和は として定義される。走査の終了時に於て、部分和は、全
体和x1y、zに等しくなる。
On the other hand, the partial sum is defined as. At the end of the scan, the partial sums are equal to the total sum x1y,z.

X (N−1、N−1) = X       (11
)Y(N−1,N−1) =Y(12) Z(N−1,N−1) =4        (13)
i行j列とその直前のi行(j−1)列との値を比較す
ると、これはjaij 、  1aij 、  aij
がそれぞれ直前の値に加えられたものにすぎない。
X (N-1, N-1) = X (11
)Y(N-1,N-1) =Y(12) Z(N-1,N-1) =4 (13)
Comparing the values of row i, column j and the previous row i, column (j-1), this is jaij, 1aij, aij
is simply added to the previous value.

X(i、j) = X(i、 j−1) + jaij
    (14)Y(i、j)=Y(i、j−1)+1
aij(15)Z(1−j) = Z(1−j−1) 
+ aij(16)走査を行なっている間、クロックパ
ルスを計数すれば、jとiはただちに分る。走査しなけ
ればならないのはデータaij Yt求めるためである
。データaijが分ると、これに11 jTi”乗じた
値はただちに求められる。
X(i, j) = X(i, j-1) + jaij
(14) Y(i, j)=Y(i, j-1)+1
aij(15)Z(1-j) = Z(1-j-1)
+ aij (16) By counting the clock pulses while scanning, j and i are immediately known. The reason for scanning is to obtain the data aij Yt. Once the data aij is known, the value obtained by multiplying it by 11 jTi'' is immediately obtained.

これは乗算を行なうという事ではすく、加算なのである
。aijはOか1であるから、jaij  は0かjな
のである。j X aijの乗算をすることなく、0か
jかが分る。乗算を伴えば、1画素分の走査時間でこの
値を得ることができない。しかし、jは既知であるので
、計算しなくてよい。
This is not a multiplication, but an addition. Since aij is O or 1, jaij is either 0 or j. You can tell whether it is 0 or j without multiplying by j x aij. If multiplication is involved, this value cannot be obtained in the scanning time of one pixel. However, since j is known, there is no need to calculate it.

1aijについても同じである。これはiか97iので
ある。
The same applies to 1aij. This is i or 97i.

aijについてはもつと単純で、これはOか1かなので
ある。
Regarding aij, it is simple: it is either O or 1.

本発明は、i行j列目の画素を走査し、データaijを
得るごとに、jaij 、  1aij 、  aij
  を直前の部分和に加え、(i、j)までの部分和X
(i、j)、Y(i、j)、Z(i、j)を求めてゆき
、走査の完了とともに全体和X、Y、Zi得る。そして
、xg=l(17) yg=7(1f3) によって重心を求めるのである。走査と平行してx、y
、zが求まっている。走査の完了後に(17)、(18
)の演算を行なうだけでよい。これは短時間に実行でき
る。
In the present invention, each time a pixel in the i-th row and j-th column is scanned and data aij is obtained, jaij, 1aij, aij
is added to the previous partial sum, and the partial sum up to (i, j) is
(i, j), Y (i, j), and Z (i, j) are obtained, and upon completion of scanning, the total sums X, Y, and Zi are obtained. Then, the center of gravity is found by xg=l(17) yg=7(1f3). x, y parallel to the scan
, z are found. After completion of scanning (17), (18
) is all you need to do. This can be done in a short amount of time.

従って、画面の走査と同じ速度で、パターンの重心の座
標に求める事ができる。
Therefore, the coordinates of the center of gravity of the pattern can be determined at the same speed as the screen is scanned.

図面によって説明する。This will be explained using drawings.

第3図は画面のマトリックス構造を示している。FIG. 3 shows the matrix structure of the screen.

左から右へ列番号が、上から下へ行番号が付されている
。θ行目はaoo 、aol 、a02 、・・・a0
7  となっている。これは8行8列のマトリックスで
ある。
Column numbers are numbered from left to right and row numbers are numbered from top to bottom. The θth row is aoo, aol, a02, ... a0
7. This is a matrix with 8 rows and 8 columns.

つまりN=8の例である。これはNが極めて少ない例で
ある。実際にこのように小さいNが使われる事もあるが
、多くの場合、Nは256.512.1024、などの
大きい値をとる。
In other words, this is an example where N=8. This is an example where N is extremely small. In practice, such a small N is sometimes used, but in many cases N takes a large value such as 256.512.1024.

第3図、第4図は単純化して説明するためN=8として
いる。
In FIGS. 3 and 4, N=8 is used to simplify the explanation.

第4図はラスク型走査によるデータの流れを示している
。aoo s・・・、ao7へ至り、次に1行下のal
oへ移る。この行の走査がa17で終り、次の行a20
へ移る。
FIG. 4 shows the flow of data by rask type scanning. aoo s..., leads to ao7, then al next line below
Move to o. The scanning of this row ends at a17, and the next row a20
Move to.

こうして、データの系列が得られる。In this way, a series of data is obtained.

これらデータの系列から、走査とともにj aijの部
分和X(i、j)、1at3の部分和Y(i、j)、a
ijの部分和Z(i、j)を求めてゆく。
From these data series, along with scanning, partial sums X(i, j) of j aij, partial sums Y(i, j) of 1at3, a
Find the partial sum Z(i, j) of ij.

第2図はこのような演算を行なうためのパターン信号処
理回路を示している。全体がフリップフロップ、レジス
タ、カウンタ、乗算器、除算器などよりなっている。
FIG. 2 shows a pattern signal processing circuit for performing such calculations. The whole consists of flip-flops, registers, counters, multipliers, dividers, etc.

ただし、乗算器、除算器については後に説明するが、通
常のアナログ又はディジタル乗算器、除算器ではない。
However, although the multipliers and dividers will be explained later, they are not ordinary analog or digital multipliers and dividers.

高速演算しなければならないから、乗算、除算は特別な
回路が使われる。
Because high-speed calculations are required, special circuits are used for multiplication and division.

第2図に於て、フリップフロップ1oは、画素(iej
)のデークaij’Th一時的に保持する。aijは1
かOかであるから、フリップフロップで十分である。デ
ータを保持する時間は、1画素の走査時間である。つま
り1クロツク分である。これはたとえば100nsec
〜150n secの短い時間である。
In FIG. 2, the flip-flop 1o has a pixel (iej
) is temporarily held. aij is 1
or O, so a flip-flop is sufficient. The time for holding data is the scanning time for one pixel. In other words, it is for one clock. For example, this is 100nsec
It is a short time of ~150 nsec.

このデータは、3つの演算回路へ送られる。This data is sent to three arithmetic circuits.

X(i、j)’e演算”r 7) タメ(7) X演算
回路ト、Y(i、j)を演算するためのY演算回路と、
Z(i、j)’e演算するためのZ演算回路である。
X(i,j)'e operation"r 7) Tame(7) X operation circuit, Y operation circuit for calculating Y(i,j),
This is a Z calculation circuit for calculating Z(i,j)'e.

X演算回路には、列番号j全発生する第1カウンクがあ
る。これは、1画素ごとに生ずるクロックごとにカウン
トアツプされ、1行のデータが入るとt j=o、・・
・、N−1)、  クリヤされる。つまり各行の画素に
於て、現在、走査されている画素の列番号jt生ずるこ
とになる。
The X operation circuit has a first count that generates all column numbers j. This is counted up every clock generated for each pixel, and when one row of data is input, t j = o...
・, N-1), cleared. In other words, for each row of pixels, the column number jt of the pixel currently being scanned is generated.

jとaijの乗算を乗算器13が行なう。これは1クロ
ツクより短い時間内で行なわれなければならないから、
通常の乗算器ではない。これは後述する。乗算の結果は
jaijである。これが第ルジスタ1に一時的に保持さ
れる。
A multiplier 13 multiplies j and aij. This must be done in less than one clock, so
It's not a normal multiplier. This will be explained later. The result of the multiplication is jaij. This is temporarily held in the first register.

第4レジスタ4は(i、j−1)画素までの部分和X(
i、j−1)が保持されている。このレジスタの出力と
、第ルジスタ1の出力とが加算器15で加算される。こ
の結果を巡回させてレジスタ4に入れる。つまり、レジ
スタ1.4、加算器15によって X(i、j−1) + jaij =  X(i、j)
  (19)という演算全行なっている。これは(14
)式と同一である。
The fourth register 4 stores the partial sum X(
i, j-1) are retained. The output of this register and the output of the first register are added by an adder 15. This result is circulated and placed in register 4. In other words, by register 1.4 and adder 15, X(i, j-1) + jaij = X(i, j)
The entire calculation (19) is performed. This is (14
) is the same as the expression.

第4レジスタにはX(i、j)までの部分和が常に格納
されている。行番号が変わった時も同じである。走査順
序と同じ順序で部分和を常に計算し、保持している事に
なる。
The fourth register always stores partial sums up to X(i,j). The same thing applies when the line number changes. Partial sums are always calculated and stored in the same order as the scan order.

行番号が変わるときは X(i、N−1) + (N−1)atN−1= X(
i+1,0)となるわけである。
When the line number changes, X(i, N-1) + (N-1) at N-1= X(
i+1,0).

さて、Y演算回路では、第2カウンタ12がある。これ
は行番号を発生するカウンタである。これは1行分のデ
ータが入力されている間は不変で、1行分のデータが大
男され終った時にひとつカウントアツプされる。つまり
Nクロックごとに値がひとつ上る。そして、1画面がす
べて走査されたときにクリヤされる。つまり走査の開始
に於てOであって、1行ごとに1つカウントアツプされ
るので、行番号iを出力することになる。
Now, in the Y calculation circuit, there is a second counter 12. This is a counter that generates line numbers. This remains unchanged while one line of data is input, and is counted up by one when one line of data is completed. In other words, the value increases by one every N clocks. Then, when one screen is completely scanned, it is cleared. In other words, it is O at the start of scanning, and is counted up by one for each row, so the row number i is output.

乗算器14は、データaijと行番号i=2乗算する。Multiplier 14 multiplies data aij by row number i=2.

第2レジスタ2は、この値1aij k一時保持する。The second register 2 temporarily holds this value 1aijk.

第5レジスタ5は、画素(itj)の走査の際には直前
の画素までの部分和Y(i、j−1)全記憶しているレ
ジスタである。このレジスタの出力と、第2レジスタ2
の出力とを加算器16で加える。そして、この結果を第
5レジスタ5へ入力する。この演算は Y(i、j−1) +1aij =Y(i、j)  (
21)によって表わされる。これは(15)式と同じで
ある。
The fifth register 5 is a register that stores the entire partial sum Y(i, j-1) up to the immediately preceding pixel when scanning a pixel (itj). The output of this register and the second register 2
An adder 16 adds the output of the . Then, this result is input to the fifth register 5. This operation is Y(i, j-1) +1aij = Y(i, j) (
21). This is the same as equation (15).

このようにして、第5レジスタ5は走査されている画素
(i I j)までの部分和Y(i、j)全計算し常に
保持しているポになる。
In this way, the fifth register 5 calculates all the partial sums Y(i, j) up to the pixel being scanned (i I j) and always holds the partial sum Y(i, j).

Z演算回路では、データをそのまま積算するから、列番
号11行番号iが不要である。このため、カウンタがな
い。画素(ilj)のデータaij ハレジスタ3に保
持される。
Since the Z calculation circuit integrates the data as is, the column number 11 and row number i are unnecessary. Therefore, there is no counter. Data aij of pixel (ilj) is held in register 3.

第6レジスタ6は直前の画素(i、j−1)までのZの
部分和Z(i、j−1)を記憶しているレジスタである
。第6レジスタ6の出力と第3レジスタのデータとを加
算器17で加算する。
The sixth register 6 is a register that stores the partial sum Z (i, j-1) of Z up to the immediately preceding pixel (i, j-1). An adder 17 adds the output of the sixth register 6 and the data of the third register.

加算した結果を第6レジスタ6へ入力する。ここに於け
る演算は Z(i、j−1) + atj= Z(i、j)   
  (22)と書くことができる。これは(16)式と
同一である。
The added result is input to the sixth register 6. The calculation here is Z(i, j-1) + atj= Z(i, j)
(22) can be written. This is the same as equation (16).

こうして、第6レジスタは走査されている画素までのデ
ータの部分和zci、、i)v常に保持している、とい
う事になる。
In this way, the sixth register always holds the partial sum zci, . . . i)v of the data up to the pixel being scanned.

こうして、1画面の走査が実行されている間、第4レジ
スタ4、第5レジスタ5、第6レジスタ6には、部分和
x(i、j)、Y(i、j)、Z(i、j)が保持され
ている事になる。走査が継続している間、第7レジスタ
7、第8レジスタ8、第9レジスタ9にはラッチ信号が
与えられない。つまり、途中ではデータを入力しない。
In this way, while one screen is being scanned, the fourth register 4, fifth register 5, and sixth register 6 contain partial sums x(i, j), Y(i, j), Z(i, j) is maintained. While scanning continues, no latch signal is applied to the seventh register 7, the eighth register 8, and the ninth register 9. In other words, do not enter data in the middle.

全行列要素の走査が終った時、つまり一画面の走査が終
った時に、第7レジスタ7、第8レジスタ8、第9レジ
スタ9にラッチ信号が与えられる。
When all matrix elements have been scanned, that is, when one screen has been scanned, a latch signal is applied to the seventh register 7, the eighth register 8, and the ninth register 9.

この時、前段のレジスタ4.5.6には全体和x1y、
zが求められている。
At this time, the previous stage register 4.5.6 contains the total sum x1y,
z is required.

第7レジスターは全体和Xを入力する。The seventh register inputs the total sum X.

第8レジスタ8は全体和Y″ft入力する。The eighth register 8 inputs the total sum Y″ft.

第9レジスタ9は全体和z2人力する。The ninth register 9 is operated by the total sum z2.

第7レジスタ7、第9レジスタ9の値X1Zから、除算
器18により除算を行ない、X方向の重心Xgを求める
。つまり、 xg=7(28) という除算をする。これは(17)式と同一である。
The value X1Z of the seventh register 7 and the ninth register 9 is divided by the divider 18 to obtain the center of gravity Xg in the X direction. In other words, perform the division xg=7(28). This is the same as equation (17).

第8レジスタ8、第9レジスタ9の値Y12から、除算
器19により除算全行ない、X方向の重心ygを求める
。つまり 7g =  −z           (冴)(2o
) という除算を行なう。これは(18)式と同一である。
From the value Y12 of the eighth register 8 and the ninth register 9, the center of gravity yg in the X direction is obtained by performing all divisions by the divider 19. In other words, 7g = -z (Sae) (2o
). This is the same as equation (18).

注意すべきことは、1画面の画素マトリックスの走査が
終了した時に全体和x1y、zが求まっているという事
である。除算器18.19の演算に必要な時間・たけず
れるが、1画面の走査ごとに、ただちに中心座標(xg
 e yg )が求まる、という事である。
What should be noted is that the total sum x1y,z is determined when the scanning of the pixel matrix of one screen is completed. Although the time and height required for the calculation of the divider 18 and 19 will vary, the center coordinates (xg
e yg ) can be found.

走査の完了から重心の算出までに殆ど遅延がない。There is almost no delay between the completion of scanning and the calculation of the center of gravity.

これは本発明の優れた効果である。This is an excellent effect of the present invention.

第2図に示した回路構成に於て問題となるのは乗算器゛
と除算器である。極めて高速の乗算、除算が要求される
The problems in the circuit configuration shown in FIG. 2 are the multipliers and the dividers. Extremely fast multiplication and division are required.

ビデオ信号全処理する場合、クロックは100nsec
〜150nsec程度である。たとえば、1秒間に30
画面が含まれ、1画面が512 X 512画素を含む
とすると、単純に配分し、1クロツクが127nsec
となる。
When processing all video signals, the clock is 100nsec
~150 nsec. For example, 30 per second
Assuming that one screen contains 512 x 512 pixels, simply distribute and one clock is 127 nsec.
becomes.

100nsec 〜150nsecの間に乗算、除算を
実行しなければならない。もつとも、除算については、
1画面の走査について1回行なうだけであるから、少し
は余裕がある。
Multiplication and division must be executed between 100nsec and 150nsec. However, regarding division,
Since scanning is performed only once for one screen, there is some leeway.

通常の方法では、この時間間隔で乗算全行なうという事
は不可能である。
With normal methods, it is impossible to perform all multiplications in this time interval.

ところが、乗算といっても、本発明ではデータaijが
0か1かの2値化号であるから、簡単な構成でこれ全実
現できる。第5図が乗算器の構成例を示す。
However, in the present invention, although it is called multiplication, since the data aij is a binary code of 0 or 1, all of this can be realized with a simple configuration. FIG. 5 shows an example of the configuration of a multiplier.

フリップフロップ10はデータaij k保持するもの
である。カウンタは、第2図のカウンタ11又は12に
対応する。カウンタ11の場合はクロックをそのまま数
えて列番号jを出力する。カウンタ12の場合は、1/
N分周して、行番号iを出力する。
Flip-flop 10 holds data aijk. The counter corresponds to counter 11 or 12 in FIG. In the case of the counter 11, the clocks are directly counted and the column number j is output. In the case of counter 12, 1/
The frequency is divided by N and the row number i is output.

バッファIC20は、カウンタ11.12につながれて
いる。バッファIC21は値0につながれている。
Buffer IC 20 is connected to counter 11.12. Buffer IC21 is connected to the value 0.

バッファIC20,21はセレクト端子を持ち、これが
電1“であるとき、入力データをそのまま出力する。セ
レクト端子がNO“であればデータを出力しない(出力
が高インピーダンスになる)。
The buffer ICs 20 and 21 have a select terminal, and when the voltage is 1", the input data is output as is. If the select terminal is NO", no data is output (the output becomes high impedance).

フリップフロップ10が保持しているデータaijが0
であれば、インバータ22で反転し、バッファxc21
が、値Ot出力することにlる。
The data aij held by the flip-flop 10 is 0
If so, it is inverted by the inverter 22 and the buffer xc21
will output the value Ot.

データaijが1であれば、バッファIC20が選ばれ
る。カウンタの保持している値j又はil、バッファI
C20が出力する。
If the data aij is 1, the buffer IC 20 is selected. Value j or il held by counter, buffer I
C20 outputs.

こうして、データがOであれば0を、データが1であれ
ばjを出力し、これがレジスタ1又は2に保持される。
In this way, if the data is 0, 0 is output, and if the data is 1, j is output, and this is held in register 1 or 2.

バッファIC20,21はひとつのセレクタICで構成
できる。これは2つの入力のいずれかを選択し、一方を
出力するだけの事であるから、乗算ではない。演算時間
は極めて短い。100nsec もかからない。
The buffer ICs 20 and 21 can be configured with one selector IC. This is not a multiplication because it simply selects one of two inputs and outputs one. Computation time is extremely short. It takes less than 100nsec.

このようにして乗算jaij 、  1aijはセレク
タによって行なうことができる。
In this way, the multiplications jaij, 1aij can be performed by selectors.

除算器は、これほど迅速な処理が要求されないが、それ
でも短時間の処理である事が望まれる。
Although the divider is not required to process as quickly as this, it is still desirable to be able to process in a short time.

ディジタル除算器を使うという事はできない。It is not possible to use a digital divider.

そこでROM″fc使用したテーブル参照法に用いるこ
とにする。
Therefore, we will use the table reference method using ROM''fc.

xg = X/Z ’f求める場合について説明する。The case where xg=X/Z'f is determined will be explained.

アドレス入力を2つのグループに分ける。一方のアドレ
ス入力群1kxによって指定する。他方のアドレス入力
群をZによって指定する。ここでXはΣΣjaij、Z
はΣΣaijである。
Divide address input into two groups. It is designated by one address input group 1kx. The other address input group is designated by Z. Here, X is ΣΣjaij, Z
is ΣΣaij.

全体のアドレスはXZにより指定される。このアドレス
で指定されるメモリ番地にX/Zの値を記憶させておく
ことにする。
The entire address is specified by XZ. The value of X/Z will be stored in the memory address specified by this address.

こうすればアドレスxZを指定し、メモリの出力として
、重心Xgを得ることになる。
In this way, the address xZ is designated and the center of gravity Xg is obtained as the output of the memory.

これはROMに固定メモリとして与えられており、これ
全読み出すのであり、除算をそのつど行なうわけではな
い。除算は予め行なっておきX/Zの値全記憶させてお
くのである。
This is provided as a fixed memory in ROM, and all of this is read out, and division is not performed each time. The division is performed in advance and all X/Z values are stored.

Z、XQビット数の和がROMのアドレスビット数にな
る。たとえば第3図、第4図に示すようにN=8であれ
ば、Z、Xは6ビツトの数となる。
The sum of the Z and XQ bit numbers becomes the ROM address bit number. For example, if N=8 as shown in FIGS. 3 and 4, Z and X are 6-bit numbers.

ROMのアドレスビットは12ビツトとなる。The address bits of the ROM are 12 bits.

N = 512であれば、ZlXは18ビツトの数とな
るから、ROMのアドレスビットは32ビツトになる。
If N = 512, ZlX will be an 18-bit number, so the address bits of the ROM will be 32 bits.

(至)効 果 パターン処理の分野で頻繁に行なわれる重心演算処理ビ
、コンピユータで行なわず、ハードウェアで実行してい
る。このハードウェアの構成によると、センサのスキャ
ニング(走査)と同じ速度で部分和を求め、一画面のス
キャニングの完了とともに重心が求まる。高速演算であ
る。
(To) Effect The centroid calculation process that is frequently performed in the field of pattern processing is not performed by a computer, but by hardware. According to this hardware configuration, partial sums are obtained at the same speed as the scanning of the sensor, and the center of gravity is obtained upon completion of scanning one screen. It is a high-speed calculation.

コンピユータを使う場合は不可能であった実時間処理が
可能となる。
Real-time processing, which was impossible when using a computer, becomes possible.

パターン処理に行なう分野、特に画像処理分野やマトリ
クス状のセンシングデータの得られる面状接触センサな
どのデータ処理に、好適に利用する事ができる。
It can be suitably used in the field of pattern processing, particularly in the field of image processing and data processing of planar contact sensors that can obtain sensing data in a matrix form.

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

第1図はマトリクス状に分割された画素の集合からなる
パターンの一例に示す2値画像。 第2図は本発明のパターン信号処理回路の構成図。 第3図は8×8マトリックス画像の平面図。 第4図は8×8画像をラスク順に走査した場合のデータ
列図。 第5図は第2図の回路で用いられる乗算器の回路構成図
。 第6図は第2図の回路で用いられる除算器の回路構成図
。 1〜9・・・レジスタ 10 ・・・・・・ フリップフロップ11.12・・
・カウンタ 13.14・・・乗算器 18.19・・・除算器
FIG. 1 is a binary image showing an example of a pattern consisting of a set of pixels divided into a matrix. FIG. 2 is a configuration diagram of a pattern signal processing circuit according to the present invention. FIG. 3 is a plan view of an 8×8 matrix image. FIG. 4 is a data string diagram when an 8×8 image is scanned in rask order. FIG. 5 is a circuit configuration diagram of a multiplier used in the circuit of FIG. 2. FIG. 6 is a circuit configuration diagram of a divider used in the circuit of FIG. 2. 1 to 9...Register 10...Flip-flop 11.12...
・Counter 13.14... Multiplier 18.19... Divider

Claims (1)

【特許請求の範囲】 画面を縦横に並ぶ矩形状の多数の画素に分割し、行番号
iと列番号jとによつて画素(i、j)を指定する事と
し、それぞれの画素(i、j)に2値データa_i_j
を対応させ、a_i_j=1である画素の作るパターン
の重心位置を、 xg=Σ_iΣ_jja_i_j/Σ_iΣ_ja_i
_jyg=Σ_iΣ_jia_i_j/Σ_iΣ_ja
_i_jの式によつて求めるための回路であつて、画面
を走査し、データa_i_jを時系列データとしてクロ
ックとともに入力し、x方向、y方向座標データである
列番号j、行番号iをクロックを計数することによつて
作動するカウンタを用いて発生させ、データa_i_j
が0である時は0を選択し、データa_i_jが1であ
る時は列番号j又は行番号iを選択してja_i_j又
はia_i_jを求め、ja_i_j、ia_i_j、
a_i_jを巡回型の加算器によつてクロックに同期し
て加え合わせ、一画面の走査が終ると同時に全体和X=
ΣΣja_i_j、Y=ΣΣia_i_j、Z=ΣΣa
_i_jを得、X、Z及びY、Zの組合せをアドレス入
力とし、除算の解X/Z、Y/Zを当該アドレスに対応
するデータとして記憶している記憶回路により、前記X
、Y、Zの値から重心(xg、yg)を求める事を特徴
とするパターン信号処理回路。
[Claims] The screen is divided into a large number of rectangular pixels arranged vertically and horizontally, and pixels (i, j) are specified by row number i and column number j, and each pixel (i, j) binary data a_i_j
The position of the center of gravity of the pattern created by the pixel with a_i_j=1 is xg=Σ_iΣ_jja_i_j/Σ_iΣ_ja_i
_jyg=Σ_iΣ_jia_i_j/Σ_iΣ_ja
This is a circuit for calculating by the formula _i_j, which scans the screen, inputs data a_i_j as time series data together with a clock, and inputs the column number j and row number i, which are coordinate data in the x direction and y direction, with the clock. The data a_i_j is generated using a counter that operates by counting
When is 0, select 0, and when data a_i_j is 1, select column number j or row number i to find ja_i_j or ia_i_j, ja_i_j, ia_i_j,
a_i_j are added by a cyclic adder in synchronization with the clock, and as soon as one screen is scanned, the total sum X=
ΣΣja_i_j, Y=ΣΣia_i_j, Z=ΣΣa
_i_j is obtained, the combination of
, Y, and Z values.
JP62047262A 1987-03-02 1987-03-02 Pattern signal processing circuit Pending JPS63213089A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62047262A JPS63213089A (en) 1987-03-02 1987-03-02 Pattern signal processing circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62047262A JPS63213089A (en) 1987-03-02 1987-03-02 Pattern signal processing circuit

Publications (1)

Publication Number Publication Date
JPS63213089A true JPS63213089A (en) 1988-09-05

Family

ID=12770376

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62047262A Pending JPS63213089A (en) 1987-03-02 1987-03-02 Pattern signal processing circuit

Country Status (1)

Country Link
JP (1) JPS63213089A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03243802A (en) * 1990-02-21 1991-10-30 Nec Corp Area gravity center detecting device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03243802A (en) * 1990-02-21 1991-10-30 Nec Corp Area gravity center detecting device

Similar Documents

Publication Publication Date Title
JPH0695012B2 (en) Device for a matrix-arranged photodiode array
JPS63213089A (en) Pattern signal processing circuit
US7522190B2 (en) Image detection processing device for calculating the moments of image data
US5887079A (en) Image processing apparatus
US5315540A (en) Method and hardware for dividing binary signal by non-binary integer number
JP2973819B2 (en) Image processing device
Elphinstone et al. RAPAC: a high-speed image-processing system
JP2840706B2 (en) Image processing method
JPS59197972A (en) Coordinate arithmetic circuit
JPS5914782B2 (en) Binary pattern digitization processing method
JP2962148B2 (en) Image processing device
JPH0687265B2 (en) Spatial filter circuit
JP2806436B2 (en) Arithmetic circuit
JPS6376062A (en) Digital differential analyzing device
JPS5923673B2 (en) Image signal conversion method
JPH03152623A (en) Semiconductor intergrated circuit
JPH04276886A (en) Histogram calculation cell and histogram calculation array
JPS63273176A (en) Space filtering device
JPH0546766A (en) Method and device for computing moment
JPH0817436B2 (en) Signal correction circuit and image sensor
JPH0684010A (en) Method and device for extracting feature
JPH07175932A (en) Image processor
JPS62254277A (en) Picture measuring instrument
JPH01295377A (en) Labeling processor
JPS63163579A (en) Graphic boundary vector generating circuit