JPS61880A - 2-dimensional visual recognizer - Google Patents
2-dimensional visual recognizerInfo
- Publication number
- JPS61880A JPS61880A JP12328484A JP12328484A JPS61880A JP S61880 A JPS61880 A JP S61880A JP 12328484 A JP12328484 A JP 12328484A JP 12328484 A JP12328484 A JP 12328484A JP S61880 A JPS61880 A JP S61880A
- Authority
- JP
- Japan
- Prior art keywords
- pattern
- counter
- standard
- input pattern
- pixel
- 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
Links
Landscapes
- Image Input (AREA)
Abstract
Description
【発明の詳細な説明】
〈発明の技術分野〉
本発明は、静止若しくは移動中の被認識物体を画像化し
て入力パターンを求め、この入力パターンを複数種の標
準パターンと順次照合して、被認識物体を認識する二次
元視覚認識装置に関連し、殊に本発明は、夫々標準パタ
ーンに対する入力パターンの位置ずれ量を検知し且つパ
ターン間の位置ずれを修正した上でパターン照合を実施
する新規な二次元視覚認識装置を提供する。Detailed Description of the Invention <Technical Field of the Invention> The present invention obtains an input pattern by imaging a stationary or moving object to be recognized, and sequentially compares this input pattern with multiple types of standard patterns to identify the object to be recognized. In relation to a two-dimensional visual recognition device that recognizes a recognition object, the present invention particularly relates to a novel system that detects the amount of positional deviation of input patterns with respect to standard patterns, corrects the positional deviation between patterns, and then performs pattern matching. The present invention provides a two-dimensional visual recognition device.
〈発明の背景〉
一般に二次元視覚認識装置は、入力パターンと標準パタ
ーンとを画像上で重ね合わせ、両パターンの重合一致度
合を検出して、被認識物体を認識するものである。従っ
てパターン照合に際しては、両パターンを正確に位置合
わせする必要があり、従来はXYステージ等を用いて被
認識物体を所定停止位置決めした後、これをテレビカメ
ラで撮像して入力パターンを求め、この入力パターンに
つき標準パターンと照合処理を行なっている。ところが
この種方式の場合、被認識物体の位置決め機構が必要で
あるから、装置全体の構造が複雑化すると共に、位置決
め操作の時間分だけパターン照合に時間がかかる等、多
くの不利があった。<Background of the Invention> Generally, a two-dimensional visual recognition device recognizes an object by superimposing an input pattern and a standard pattern on an image, detecting the degree of superimposition and coincidence of both patterns. Therefore, when performing pattern matching, it is necessary to accurately align both patterns. Conventionally, an XY stage or the like is used to position the object to be recognized at a predetermined stop position, and then the object is imaged with a television camera to obtain the input pattern. The input pattern is matched against a standard pattern. However, this type of system requires a mechanism for positioning the object to be recognized, which complicates the overall structure of the apparatus and has many disadvantages, such as the time it takes for pattern matching to correspond to the time required for the positioning operation.
〈発明の目的〉
本発明は、標準パターンに対する入力パターンの位置ず
れ量を正確且つ高速に検知して、パターン間の位置修正
をデータ上で実施することによって、入力パターンが位
置ずれしても、迅速且つ容易に物体認識を行ない得る二
次元視覚認識装置を提供することを目的とする。<Object of the Invention> The present invention accurately and quickly detects the amount of positional deviation of an input pattern with respect to a standard pattern, and corrects the position between patterns on the data. It is an object of the present invention to provide a two-dimensional visual recognition device that can quickly and easily recognize objects.
〈発明の構成および効果〉
上記目的を達成するため、本発明では、標準パターンや
入力パターンをメモリに取り込む際、先頭黒画素列まで
の距離をカウンタで計測して、各パターン位置を検出す
ると共に、入力パターンの取込み時には、複数種の標準
パターンを順次切り換えつつ、夫々標準パターンに対す
る入力パターンの位置ずれ量を算出し且つこれをデータ
上で位置修正した上で、入力パターンを各標準パターン
と照合するようにした。<Structure and Effects of the Invention> In order to achieve the above object, the present invention measures the distance to the first black pixel column with a counter and detects the position of each pattern when importing a standard pattern or an input pattern into a memory. When importing an input pattern, the input pattern is sequentially switched between multiple types of standard patterns, the amount of positional deviation of the input pattern with respect to each standard pattern is calculated, the position is corrected on the data, and the input pattern is compared with each standard pattern. I decided to do so.
本発明によれば、被認識物体を所定停止位置に位置決め
する等の必要がなく、特別な位置決め機構が不要となり
、装置全体を簡易化できると共に、位置決め操作に要す
る時間を節約し得、物体認識処理の効率を向上できる。According to the present invention, there is no need to position the object to be recognized at a predetermined stop position, no special positioning mechanism is required, the entire device can be simplified, and the time required for positioning operations can be saved, and object recognition is possible. Processing efficiency can be improved.
また各パターン位置を、画像解析等の複雑なソフト処理
によらず、カウンタ等の簡易なハード構成にて求めて、
パターン間の位置ずれ修正を行なうから、入力パターン
を複数種の標準パターンと高速照合でさ、物体認識処理
効率の向上に一層貢献する等、発明目的を達成した顕著
な効果を奏する。In addition, the position of each pattern is determined using a simple hardware configuration such as a counter, without using complex software processing such as image analysis.
Since the positional deviation between patterns is corrected, the input pattern can be compared with a plurality of types of standard patterns at high speed, which further contributes to an improvement in object recognition processing efficiency, and achieves the remarkable effect of achieving the purpose of the invention.
〈実施例の説明〉
第1図は本発明にかかる二次元視覚認識装置の回路構成
例を示す。図中テレビカメラ1は、静止または移動中の
物体2を例えば上方より撮像し、飛越走査にかかる画像
出力(第3図(1)に示す)を同期分離回路3へ送出す
る。同期分離回路3は、前記画像出力より水平同期信号
HD、垂直同期信号VD、奇数フィールド信号OD(第
3図(2)に示す)、クロック信号CK(第3図(4)
に示す)等を分離し、ビデオ信号VDiを2値化回路4
へ出力する。2値化回路4は、第3図(3)に示す如く
、ビデオ信号VDiに対し一定のスレシュホールドレベ
ルTHを設定し、ビデオ信号VDiの奇数フィールドに
つき白黒2値化して2値パターンを形成出力する。2値
化回路4には、モード切換スイッチSWiを介して基準
メモリ群5およびバッファメモリ6が接続されており、
モード切換スイッチSWlを学習モード側aにセットし
、メモリ指定用スイッチss1.ss2.・・・を選択
操作しつつ、複数種の標準モデルを撮像するとき、夫々
基準メモIJ Ml 、 M2.・・・に例えは第2図
(1)に示す標準パターンPl + P2+・・・が格
納され、またモード切換スイッチSWiを認識モード側
すにセットして被認識物体を撮像するとき、バッファメ
モリ6に例えば第2図(2)に示す入力パターンPiが
格納される。本実施例の場合、各パターンは縦横256
ビツトの画素範囲に格納され、第2図t1) 12+に
示す例では、入力パターンPiは対応する第2番目の標
準パターンp、に対し右上方向へ位置ずれしている。<Description of Embodiments> FIG. 1 shows an example of a circuit configuration of a two-dimensional visual recognition device according to the present invention. In the figure, a television camera 1 images a stationary or moving object 2, for example from above, and sends an image output (shown in FIG. 3(1)) related to interlaced scanning to a synchronization separation circuit 3. The synchronization separation circuit 3 extracts a horizontal synchronization signal HD, a vertical synchronization signal VD, an odd field signal OD (shown in FIG. 3 (2)), and a clock signal CK (shown in FIG. 3 (4)) from the image output.
) etc., and converts the video signal VDi into a binarization circuit 4.
Output to. As shown in FIG. 3 (3), the binarization circuit 4 sets a certain threshold level TH for the video signal VDi, converts odd fields of the video signal VDi into black and white binarization, forms a binary pattern, and outputs it. do. A reference memory group 5 and a buffer memory 6 are connected to the binarization circuit 4 via a mode changeover switch SWi.
Set the mode changeover switch SWl to the learning mode side a, and set the memory designation switch ss1. ss2. When capturing images of multiple types of standard models while selecting and operating the reference memos IJ Ml, M2, . For example, the standard pattern Pl+P2+... shown in FIG. For example, the input pattern Pi shown in FIG. 2 (2) is stored in 6. In the case of this example, each pattern has 256 pixels in the vertical and horizontal directions.
In the example shown in FIG. 2 (t1) 12+, the input pattern Pi is shifted in the upper right direction with respect to the corresponding second standard pattern p.
尚図中、水平カウンタ7.9および垂直カウンタ8.1
0は、標準パターンP1 r PZ +・・・や入力パ
ターンPiの読み書きに際し、夫々メモリ内の画素位置
をアドレス指定する。またゲート回路11.12および
13.14は、奇数フィールド信号ODやクロック信号
CKで開閉制御され、有効画素範囲を規定する信号Wや
リセット信号kを各メモリ5.6へ供給する。更にゲー
ト回路15は奇数フィールド信号ODで開閉制御され、
クロック信号GKを水平カウンタ7.9および垂直カウ
ンタ8.10へ夫々供給する。In the figure, horizontal counter 7.9 and vertical counter 8.1
0 specifies the pixel position in the memory when reading or writing the standard pattern P1 r PZ + . . . or the input pattern Pi. Further, gate circuits 11.12 and 13.14 are controlled to open and close by odd field signal OD and clock signal CK, and supply signal W defining the effective pixel range and reset signal k to each memory 5.6. Further, the gate circuit 15 is controlled to open and close by an odd field signal OD.
A clock signal GK is supplied to a horizontal counter 7.9 and a vertical counter 8.10, respectively.
前記2値化回路4には、連動するモード切換スイッチs
w1.sw2を介して白画素検知回路16および黒画素
検知回路17が接続され、白画素検知回路16にはオア
回路25を介して画素カウンタ18が、また黒画素検知
回路17には他の画素カウンタ29が夫々接続されてい
る。黒画素検知回路17は各パターンを構成する黒画素
(第2図中、斜線部分)を検知し、白画素検知回路16
は背景部分に相当する白画素(第2図中、斜線以外の部
分)を検知する。一方の画素カウンタ18は、各メモリ
へのパターンの取込みに際し、これと同じ時間タイミン
グで白画素検知回路16の出力(白画素数)を計数し、
黒画素検知回路17が先頭の黒画素A、A’(第4図f
1+ +21参照)を検知したとき、画素計数動作を停
止すると共に、つぎに他方の画素カウンタ29が黒画素
検知回路17の出力(黒画素数)を計数する。これら画
素カウンタ18.29の計数データは水平ブランキング
期間毎にI 10 (InputlouLput)ポー
ト19を介してCPU (CentralProces
sing Unit ) 20 ニ取り込まれ、c P
U 20は取り込んだデータから後記の演算を実行し
、標準パターンに対する入力パターンPiの位置ずれ量
Δx1ΔYを算出する。The binarization circuit 4 includes an interlocking mode changeover switch s.
w1. A white pixel detection circuit 16 and a black pixel detection circuit 17 are connected via sw2, a pixel counter 18 is connected to the white pixel detection circuit 16 via an OR circuit 25, and another pixel counter 29 is connected to the black pixel detection circuit 17. are connected to each other. The black pixel detection circuit 17 detects the black pixels (shaded areas in FIG. 2) constituting each pattern, and the white pixel detection circuit 16
detects white pixels corresponding to the background portion (portions other than the shaded areas in FIG. 2). One pixel counter 18 counts the output (number of white pixels) of the white pixel detection circuit 16 at the same time timing when the pattern is loaded into each memory,
The black pixel detection circuit 17 detects the first black pixels A, A' (Fig. 4 f).
1++21), the pixel counting operation is stopped and the other pixel counter 29 then counts the output of the black pixel detection circuit 17 (the number of black pixels). The count data of these pixel counters 18 and 29 is sent to the CPU (Central Processes) via the I10 (Input Louput) port 19 every horizontal blanking period.
sing Unit) 20 D is taken in, c P
U 20 executes the calculation described later from the captured data and calculates the amount of positional deviation Δx1ΔY of the input pattern Pi with respect to the standard pattern.
また前記基準メモリ群5およびバッファメモリ6の読出
し出力側には、エクスクル−シブ・オア回路26(以下
、EX、オア回路26という)が接続され、更にEX、
オア回路26の出力側は前記オア回路25を介して画素
カウンタ18に接続されている。前記EX、オア回路2
6は、パターン照合に際し、両メモリ5.6から読み出
した画素データが不一致のとき、論理「1」の出力を出
すもので、従ってこの場合、画素カウンタ18は両パタ
ーンにおける不一致画素数を計数することになる。この
計数データはI10ポート19を経てCPU20に取り
込まれ、CPU20はこのデータ内容を表示部27に表
示すると共に、設定スイッチ28で設定された基準値N
Oと大小比較してパターンの一致、不一致を判定する。Further, an exclusive OR circuit 26 (hereinafter referred to as EX, OR circuit 26) is connected to the readout output sides of the reference memory group 5 and the buffer memory 6, and EX,
The output side of the OR circuit 26 is connected to the pixel counter 18 via the OR circuit 25. Said EX, OR circuit 2
6 outputs a logic "1" when the pixel data read from both memories 5.6 do not match during pattern matching.Therefore, in this case, the pixel counter 18 counts the number of mismatched pixels in both patterns. It turns out. This counting data is taken into the CPU 20 via the I10 port 19, and the CPU 20 displays the contents of this data on the display section 27, and also sets the reference value N set with the setting switch 28.
Compare the size with O to determine whether the pattern matches or does not match.
そして一致判定があると、現照合にかかる標準パターン
の番号が出力され、不一致判定があると、切換え回路3
0!こよりつぎの標準パターンが選択される。図示例の
切換え回路(9)は、不一致信号πおよび垂直同期信号
VDが入力されるアンド回路31と、このアンド回路3
1へつぎの奇数フィールドおよび続く偶数フィールドに
かかる2個の垂直同期信号VDの入力があったとき歩進
信号を出す2進カウンタ32と、2進カウンタ32から
の歩進信号が入力される毎に計数動作して基準メモリ群
5の各メモリMl。If there is a match, the number of the standard pattern currently being matched is output, and if there is a match, the switching circuit 3
0! The next standard pattern is then selected. The illustrated switching circuit (9) includes an AND circuit 31 to which the mismatch signal π and the vertical synchronization signal VD are input, and the AND circuit 3.
A binary counter 32 that outputs an increment signal when two vertical synchronizing signals VD for the next odd field and the following even field are input; Each memory Ml of the reference memory group 5 performs a counting operation.
M2.・・・を順次選択する信号を出力するパターン番
号カウンタ33と、カウンタ33の選択信号出力および
前記スイッチss1.552.・・・のスイッチ信号S
l、”2+・・・が入力されるオア回路34.35とを
含んでいる。尚図中、PROM (Prograrrm
ableRead 0nly Memory) 21は
位置ずれ修正等の一連のプログラムを格納し、またRA
M (Ra n d omAccess Momory
) 22は各種データの格納する他、処理実行のための
ワークエリアを有する。M2. . . . a pattern number counter 33 that outputs a signal for sequentially selecting . ... switch signal S
It includes OR circuits 34 and 35 to which ``1'', ``2+...'' are input.
21 stores a series of programs such as positional deviation correction, and also
M (Random Access Memory
) 22 has a work area for storing various data and for executing processing.
また、ゲート回路23はCPU20に対し割込み信号I
NTを発生させる回路であり、オア回路24・ は画
素カウンタ18.29をリセットする回路である。The gate circuit 23 also sends an interrupt signal I to the CPU 20.
This circuit generates NT, and the OR circuit 24 is a circuit that resets the pixel counters 18 and 29.
第4図(1)は基準メモリ群5の2番目の基準メモリM
zに格納された標準パターンP、を、また第4図(2)
はバッファメモリ6に格納された入力パターンPiを夫
々示すものであり、同図中、戊A′は標準パターンP2
および入力パターンPiにおける先頭黒画素XASXA
’は黒画素A、A’の位置データ、B、 B’は先・頭
黒画素A、 A’を含む黒画素列の後端黒画素、xB、
xB’は黒画素B、 B’の位置データc、 c’は
各黒画素列の中心位置に設定される基準点、Xl、X2
.Yl、Yzは基準点c、 c’の位置データを夫々示
しており、入力パターンPiの基準点C′は標準パター
ンPzの基準点Cに対し、水平方向にJX 、垂直方向
にΔYだけ位置ずれしている。FIG. 4 (1) shows the second reference memory M of the reference memory group 5.
The standard pattern P stored in z is also shown in Fig. 4 (2).
indicate the input patterns Pi stored in the buffer memory 6, and in the figure, A' indicates the standard pattern P2.
and the first black pixel XASXA in the input pattern Pi
' is the position data of black pixels A, A', B, B' is the first black pixel A, the trailing black pixel of the black pixel row containing A', xB,
xB' is the black pixel B, position data c of B', c' is the reference point set at the center position of each black pixel column, Xl, X2
.. Yl and Yz indicate the position data of the reference points c and c', respectively, and the reference point C' of the input pattern Pi is shifted by JX in the horizontal direction and ΔY in the vertical direction with respect to the reference point C of the standard pattern Pz. are doing.
然してモード切換スイッチSWI 、 SW2を学習モ
ード側aに設定し、例えばスイッチSS1を押操作した
後、テレビカメラ1により1番目の標準モデルを撮像す
ると、ビデオ信号VDiの最初の奇数フィールドにつき
2値化処理が実行さ汰標準パターンPlが基準メモリ群
5の1番目メモIJ Mlに書込み形成される。そして
これと同じ時間タイミングで2値化回路4の出力が白画
素検出回路16を経て画素カウンタ18へ送られ、画素
カウンタ18は白画素数を計数してゆくと共に、各水平
ブランキング期間毎にCPU20に対し割込み信号IN
Tが発生し、画素カウンタ18の計数内容がその都度読
み込まれる。However, when the mode selector switches SWI and SW2 are set to the learning mode side a and the first standard model is imaged by the television camera 1 after pressing the switch SS1, for example, the first odd field of the video signal VDi is binarized. When the process is executed, the standard pattern Pl is written and formed in the first memory IJMl of the reference memory group 5. Then, at the same time timing, the output of the binarization circuit 4 is sent to the pixel counter 18 via the white pixel detection circuit 16, and the pixel counter 18 counts the number of white pixels, and at the same time, every horizontal blanking period. Interrupt signal IN to CPU20
T occurs, and the count contents of the pixel counter 18 are read each time.
第5図はかかる割込み制御動作を示すもので、同図中、
xAは画素カウンタ18の計数内容を、’XB−XAは
画素カウンタ29の計数内容を、YlはRAM22に設
定された行カウンタの計数内容を、Flは同じRAM2
2に設定された検出フラグエリアの内容を夫々示す。FIG. 5 shows such an interrupt control operation, and in the figure,
xA is the count content of the pixel counter 18, 'XB-XA is the count content of the pixel counter 29, Yl is the count content of the row counter set in the RAM 22, and Fl is the count content of the same RAM 2.
2 shows the contents of the detection flag areas set in 2.
金弟Y1番目(但しYl(256)の走査ラインにつき
白画素計数動作を完了した時点を想定すると、まずCP
ξU20はステップ41で行カウンタの内容Ylに1加
算しておき、つぎにステップ42で検出フラグF1が設
定法か否かをチェックする。Assuming that the white pixel counting operation has been completed for the scanning line of Y1st Y1 (however, Y1 (256)), first the CP
ξU20 adds 1 to the content Yl of the row counter in step 41, and then checks in step 42 whether or not the detection flag F1 is the setting method.
この検出フラグFlはパターン位置が検出されたときに
セットされるものであり、この場合、その判定は“NO
〃となり、つぎのステップ43において、画素カウンタ
18の内容XAが各走査行の画素データ数(本実施例で
は256個)に達したか否か、すなわちその行の走査で
先頭の黒画素Aを検出したか否かがチェックされる。今
画素カウンタ18が黒画素検知回路17による計数停止
制御を受けずに、1行分の画素データ数(256個)を
計数した場合、ステツ′プ43が’YES“となり、つ
ぎにステップ44において、行カウンタYlの内容が最
終走査行(本実施例では256行)に達したか否かがチ
ェックされる。This detection flag Fl is set when the pattern position is detected, and in this case, the determination is "NO".
Then, in the next step 43, it is determined whether the content XA of the pixel counter 18 has reached the number of pixel data of each scanning line (256 in this embodiment), that is, the first black pixel A is checked in the scanning of that line. It is checked whether or not it has been detected. If the pixel counter 18 has now counted the number of pixel data for one row (256 pieces) without being subjected to counting stop control by the black pixel detection circuit 17, step 43 becomes ``YES'', and step 44 then proceeds to step 44. , it is checked whether the contents of the line counter Yl have reached the final scanning line (256 lines in this embodiment).
この場合、ステップ44の判定は’No’であるから、
スタート時点の割込み待の状態に戻り、つぎの行につき
同様の白画素計数動作が実行される。In this case, since the determination in step 44 is 'No',
The process returns to the interrupt waiting state at the start, and a similar white pixel counting operation is executed for the next row.
かくてこの計数過程において、黒画素検知回路17が先
頭の黒画素人を検知すると、画素カウンタ18はその時
点で計数動作を停止し、他方の画素カウンタ29はその
時点から黒画素Aを含む黒画素列の計数を開始する。従
ってこの行の走査においては画素カウンター8の内容顧
はr256Jに達せず、これによりつぎの水平ブランキ
ング期間の割込み処理ではステップ43の判定が1NO
’となって、ステップ45へ進・み、行カウンタYlの
内容が1減算される。ついでCPU20は、ステップ4
6.47で各画素カウンタ18.29の内容XA 、
XB−XA ヲ読b 出り、、ツキの演算を実行して基
準点Cの位置データxlを求める(ステップ48)。In this counting process, when the black pixel detection circuit 17 detects the first black pixel, the pixel counter 18 stops counting at that point, and the other pixel counter 29 starts counting black pixels including the black pixel A from that point on. Start counting pixel columns. Therefore, in scanning this row, the content review of the pixel counter 8 does not reach r256J, and as a result, the determination in step 43 is 1NO in the interrupt processing for the next horizontal blanking period.
'The program then proceeds to step 45, where the contents of the row counter Yl are decremented by 1. Then, the CPU 20 performs step 4.
At 6.47, the contents of each pixel counter 18.29 XA,
XB-XA wo reading b Executing calculations of entry, exit, and luck to obtain position data xl of reference point C (step 48).
上式から明らかなとおり、基準点Cは先頭黒画素列の中
心位置に設定されるものであり、上記位置データX1お
よび行カウンタの内容Y1はステップ49.50の判定
結果に応じてRAM22の対応するエリアへ格納される
(ステップ51,52)。As is clear from the above equation, the reference point C is set at the center position of the first black pixel column, and the position data X1 and the content Y1 of the row counter are determined by the correspondence of the RAM 22 according to the determination result in step 49.50. The data is stored in the area (steps 51, 52).
前記ステップ49,50は、いずれのメモリ指定用スイ
ッチss1.ss2.・・・が投入されているか否かを
判定しており、スイッチSS1が投入されているときは
、スイッチ信号Slの発生によりステップ49が#YE
S’となり、またスイッチSSzのの投入に対しては、
スイッチ信号Szの発生によりステップ50が’YES
“となる。そしてデータXl、Ylの格納後、続(ステ
ップ53で検出フラグFlがセットされ、更にステップ
54で行カウンタの内容Ylに1加算してステップ41
の状態に戻される。In steps 49 and 50, any memory designating switch ss1. ss2. ... is turned on, and when the switch SS1 is turned on, step 49 returns #YE due to the generation of the switch signal Sl.
S', and for turning on switch SSz,
Step 50 is 'YES' due to the generation of switch signal Sz.
After storing the data Xl and Yl, the detection flag Fl is set in step 53, and 1 is added to the row counter content Yl in step 54, and step 41
will be returned to the state of
以下各行の割込み処理においては、ステップ42のrF
=IJの判定が#Y E S ”となるから、ステップ
44で行カウンタの内容Yir256Jであると判定さ
れるまでステップ41の処理のみが繰返し実施される。In the interrupt processing for each line below, rF in step 42
Since the determination of =IJ is #YES'', only the process of step 41 is repeatedly executed until it is determined in step 44 that the content of the row counter is Yir256J.
そしてステップ44の判定が’YES’となったとき、
ステップ55で行カウンタの内容Ylがクリアされ、ス
テップ56で検知フラ′グF1もリセットされる。Then, when the determination in step 44 is 'YES',
In step 55, the content Yl of the row counter is cleared, and in step 56, the detection flag F1 is also reset.
上記により1番目の標準パターンP1についての処理が
完了すると、つぎにスイッチSS2を投入し、2番目の
標準パターンP2について、同様の処理を実行する。更
に3番目以降の標準パターンについても同様であり、全
ての用意されたパターン学習を完了した上で、つぎに物
体認識処理へ移行する。When the processing for the first standard pattern P1 is completed as described above, the switch SS2 is then turned on and the same processing is executed for the second standard pattern P2. Furthermore, the same applies to the third and subsequent standard patterns, and after completing learning of all prepared patterns, the next step is to proceed to object recognition processing.
かくして被認識物体の認識処理を実行する場合、モード
切換スイッチsw1 、 sw2を認識モード側すに設
定した後、同様の撮像操作を実行する。この場合入力パ
ターンPiはバッファメモリ6に格納されることになり
、前記同様に奇数フィールドの時間タイミングで入力パ
ターンPiの書込みが実行される。またこれと同じ時間
タイミングで白画素の計数動作が実行されると共に、各
水平ブランキング期間毎にCPU29に対し割込み信号
INTが発生せられる。In this way, when performing the recognition process for the object to be recognized, after setting the mode changeover switches sw1 and sw2 to the recognition mode side, a similar imaging operation is performed. In this case, the input pattern Pi will be stored in the buffer memory 6, and writing of the input pattern Pi will be executed at the odd field time timing as described above. Further, at the same time timing, a white pixel counting operation is executed, and an interrupt signal INT is generated to the CPU 29 for each horizontal blanking period.
第6図はかかる割込み制御動作を示すもので、同図中、
XA′は画素カウンタ18の白画素計数内容を、XB′
−xA′は画素カウンタ29の計数内容を、YzはRA
M22に設定された行カウンタの計数内容を、F2.F
8は同じRAM22に設定された検出フラグおよび演算
フラグの各内容を、X8は画素カウンタ18の不一致画
素計数内容を、夫々示している。FIG. 6 shows such an interrupt control operation, and in the figure,
XA' is the white pixel count content of the pixel counter 18, and XB'
-xA' is the count content of the pixel counter 29, and Yz is the RA
The count contents of the row counter set in M22 are displayed in F2. F
8 indicates the contents of the detection flag and calculation flag set in the same RAM 22, and X8 indicates the contents of the mismatched pixel count of the pixel counter 18, respectively.
金弟Y2番目(但しF2<256) の走査ラインに
つき白画素計数動作を完了した時点を想定すると、まず
CPU20はステップ61て行カウンタの内容Yzに1
加算しておき、つきにステップ62で演算フラグF8が
設定法か否かをチェックする。Assuming that the white pixel counting operation has been completed for the second scanning line of Y2 (F2<256), the CPU 20 first sets 1 to the content Yz of the row counter in step 61.
After addition, it is checked in step 62 whether the calculation flag F8 is the setting method or not.
この演算フラグF8はパターン間の位置ずれ修正処理を
完了したときにセットされるものであり、この場合、そ
の判定は“NO”となって、つぎにステップ63で検出
フラグF2がセット済か否か(この場合、’No“とな
る)、更にステップ64で画素カウンタ18の内容X/
が各走査行の最大画素データ数(256個)であるか否
か(この場合、’YES’となる)、更にステップ65
で行カウンタY2の内容が最終走査行(256行)に達
したか否か(この場合、1NO“となる)が順次チェッ
クされ、然る後スタート時点の割込み待の状態に戻って
、つぎの行につき同様の白画素数計数動作が実行される
。This calculation flag F8 is set when the positional deviation correction process between patterns is completed, and in this case, the determination is "NO", and then in step 63 it is determined whether the detection flag F2 has been set or not. (in this case, 'No'), and further, in step 64, the content of the pixel counter 18 is
is the maximum number of pixel data (256 pieces) for each scanning line (in this case, 'YES')
Then, it is sequentially checked whether the contents of the line counter Y2 have reached the final scanning line (256 lines) (in this case, it is 1NO), and then the process returns to the state of waiting for an interrupt at the start point and starts the next line. A similar white pixel counting operation is performed for each row.
か(して黒画素検知回路17が入力パターンPiにおけ
る先頭の黒画素A′を検知すると、画素カウンター8は
その時点て計数動作を停止し、他方の画素カウンタ29
はその時点から黒画素A′を含む黒画素列の計数を開始
する。従ってこの行の走査においては画素カウンター8
の内容xA′はr256Jに達せず、これによりステッ
プ64の判定が’No’となってステップ66へ進み、
行カウンタY2の内容が1減算される。ついでCPU2
0は、ステップ67.68で画素カウンタ18.29の
内容XKx ’ XKを読み出し、つぎの演算を実行し
て基準点C′の位置データX2を求める(ステップ69
)。(When the black pixel detection circuit 17 detects the first black pixel A' in the input pattern Pi, the pixel counter 8 stops counting at that point, and the other pixel counter 29
starts counting the black pixel columns including the black pixel A' from that point. Therefore, in scanning this row, the pixel counter 8
The content xA' does not reach r256J, so the determination at step 64 becomes 'No' and the process proceeds to step 66.
The contents of the row counter Y2 are decremented by 1. Then CPU2
0 reads out the contents XKx'
).
更にCPU20は、つきのステップ70.71において
、最初の標準パターンP1に対する入力パターンPiの
X方向およびY方向の各位置ずれ量ΔX、ΔYを次式に
より算出する。Furthermore, in step 70.71, the CPU 20 calculates the respective positional deviation amounts ΔX and ΔY in the X direction and the Y direction of the input pattern Pi with respect to the first standard pattern P1 using the following equations.
Δx = X2−Xl ΔY = F2−Y。Δx = X2-Xl ΔY = F2-Y.
しかる後ステップ72で検出フラグF2をセットし、続
くステップ73で行カウンタの内容Yzに1加算してス
テップ61の状態に戻す。Thereafter, the detection flag F2 is set in step 72, and in the following step 73, 1 is added to the content Yz of the row counter to return to the state of step 61.
か(して行カウンタの内容Y1が「256」に達したと
き、ステップ65が’YES’となり、つぎのステップ
74で前記位置ずれ量ΔXを水平カウンタ9に、位置ず
れ量ΔYを垂直カウンタ10に夫々プリセットした後、
ステップ75−77で行カウンタの内容Yzをクリアし
、検出フラグF2をリセットすると共に演算フラグFa
をセットする。(When the content Y1 of the row counter reaches "256", step 65 becomes ``YES'', and in the next step 74, the positional deviation amount ΔX is stored in the horizontal counter 9, and the positional deviation amount ΔY is stored in the vertical counter 10. After presetting each,
In steps 75-77, the content Yz of the row counter is cleared, the detection flag F2 is reset, and the calculation flag Fa is cleared.
Set.
そしてつぎの偶数フィールドにおいて、水平および垂直
カウンタ7.8にて基準メモリ5を、またプリセットし
た水平および垂直カウンタ9.10にてバッファメモリ
6を、夫々アドレス指定して、標準パターンPlおよび
入力パターンPiの構成画素データを順次読み出すとき
、両パターンP1.Pi は位置ずれが修正された重
なり状態でデータ比較されることになる。その結果、両
画素データが不一致のとき、EX、オア回路26が論理
「1」の信号を出力し、画素カウンタl8によってこの
不一致画素数が計数される。Then, in the next even field, the reference memory 5 is addressed by the horizontal and vertical counters 7.8, and the buffer memory 6 is addressed by the preset horizontal and vertical counters 9.10, respectively, and the standard pattern Pl and the input pattern are addressed. When sequentially reading constituent pixel data of Pi, both patterns P1. The data of Pi will be compared in an overlapping state in which positional deviations have been corrected. As a result, when both pixel data do not match, the EX/OR circuit 26 outputs a signal of logic "1", and the pixel counter 18 counts the number of mismatched pixels.
そして各水平ブランキング期間毎にCPU20に対し割
込みがかかり、ステップ61で行カウンタの内容Y1に
1加算された後、ステップ62の’YES’の判定を経
て、ステップ78で画素カウンタ18の内容X8が読み
出され、次々に加算されてゆく。そして同様の処理が全
行に亘り実行されたとき、ステップ79のrYz=25
6Jの判定が’YES’となり、つぎのステップ80で
表示部27に画素カウンタ18の内容Xa(不一致画素
総数)が表示されると共に、ステップ81においてCP
U20は画素カウンタ18の内容x8と基準値NOとの
大小を比較する。そして計数内容x8が基準値86
以上であるとき、入力パターンPiは最初の標準パター
ンPlと不一致であると判断され、ステップ82へ進み
、つぎに切換え回路30のパターン番号カウンタ33.
の内容Nが最大であるか否か、すなわち切換え回路30
によって最終の標準パターンが選定されているか否かが
チェックされる。この場合ステップ82の判定は’No
’となり、ステップ83てパターン番号カウンタ33の
内容Nが1加算されて、つぎの標準パターンP2が選択
され、更にステップ84で演算フラグF8がクリアされ
た後、割込みスタート時点へ戻って同様の処理が繰返し
実行される。Then, an interrupt is generated to the CPU 20 for each horizontal blanking period, and after 1 is added to the row counter content Y1 in step 61, a ``YES'' determination is made in step 62, and the content X8 of the pixel counter 18 is added to the pixel counter 18 content X8 in step 78. are read out and added one after another. When the same process is executed for all rows, rYz=25 in step 79.
6J becomes 'YES', the content Xa (total number of mismatched pixels) of the pixel counter 18 is displayed on the display section 27 in the next step 80, and the CP
U20 compares the content x8 of the pixel counter 18 with the reference value NO. And the count content x8 is the standard value 86
If this is the case, it is determined that the input pattern Pi does not match the first standard pattern Pl, and the process proceeds to step 82, where the pattern number counter 33.
Whether the content N is the maximum or not, that is, the switching circuit 30
It is checked whether the final standard pattern has been selected. In this case, the determination at step 82 is 'No.
', the content N of the pattern number counter 33 is incremented by 1 in step 83, the next standard pattern P2 is selected, and furthermore, after the calculation flag F8 is cleared in step 84, the process returns to the interrupt start point and the same processing is performed. is executed repeatedly.
これにより2番目の標準パターンP2に対する入力パタ
ーンの位置ずれ量ΔX、ΔYの検出(ステップ70.7
1)、水平および垂直カウンタ9.10への位置ずれ量
ΔX、ΔYのプリセット(ステップ74)、更には不一
致画素数の読出しくステップ78)等の各処理が順次遂
行される。As a result, the positional deviation amounts ΔX and ΔY of the input pattern with respect to the second standard pattern P2 are detected (step 70.7
1), presetting of the positional deviation amounts ΔX and ΔY to the horizontal and vertical counters 9.10 (step 74), and reading out the number of mismatched pixels (step 78), etc. are sequentially performed.
その結果、ステップ81のrXa<’NOJの判定が’
YES’となったとき、ステップ85において、パター
ン番号カウンタ33の計数内容Nに基づき、CPU20
はパターン番号を出力すると共に、ステップ86で一致
信号を出力し、然る後、ステップ87でカウンタ33の
内容Nを初期状態「1」に戻し、ステップ84で演算フ
ラグF8をクリアする。As a result, the determination of rXa<'NOJ in step 81 is '
When the answer is YES', in step 85, based on the count N of the pattern number counter 33, the CPU 20
outputs the pattern number and outputs a coincidence signal in step 86, then returns the content N of the counter 33 to the initial state "1" in step 87, and clears the calculation flag F8 in step 84.
尚入力パターンPiがいずれの標準パターンとも一致し
ないとき、ステップ82の判定は’YES#となり、ス
テップ88において、CPU20は認識不可出力を選出
するものである。Note that when the input pattern Pi does not match any standard pattern, the determination at step 82 becomes 'YES#', and at step 88 the CPU 20 selects an unrecognizable output.
第1図は本発明にかかる二次元視覚認識装置の回路ブロ
ック図、第2図[11(21は基準メモリ中の標準パタ
ーンおよびパップアメモリ中の入力パターンを示す説明
図、第3図は第1図に示す回路構成例の信号波形を示す
タイミングチャート、第4図(11(21は標準パター
ンに対する入力パターンの位置ずれ検出処理を示す説明
図、第5図は学習モードにおける割込み処理動作を示す
フローチャート、第6図は認識モードにおける割込み処
理動作を示すフローチャートである。FIG. 1 is a circuit block diagram of a two-dimensional visual recognition device according to the present invention, FIG. A timing chart showing signal waveforms of the circuit configuration example shown in FIG. FIG. 6 is a flowchart showing the interrupt processing operation in the recognition mode.
Claims (2)
を求めた後、入力パターンを標準 パターンと照合して被認識物体を認識する 装置において、前記の標準パターンを複数 種取り込むための第1のメモリと、入力パ ターンを取り込むための第2のメモリと、 各パターンにつき先頭の黒画素列までの距 離を計測するカウンタと、カウンタの計測 結果に基づき標準パターンに対する入力パ ターンの位置ずれ量を検出しこれを修正し た後、両パターンを照合する演算処理装置 と、照合すべき複数種の標準パターンを順 次切り換える切換え手段とを具備して成る 二次元視覚認識装置。(1) After obtaining an input pattern by converting the image of the object to be recognized into black and white, the device recognizes the object by comparing the input pattern with a standard pattern. 1 memory, a second memory for capturing the input pattern, a counter for measuring the distance to the first black pixel column for each pattern, and a positional shift amount of the input pattern with respect to the standard pattern based on the measurement result of the counter. A two-dimensional visual recognition device comprising: an arithmetic processing unit that detects and corrects the patterns, and then compares both patterns; and a switching device that sequentially switches between multiple types of standard patterns to be compared.
取込みと同時に並行実施する特許 請求の範囲第1項記載の二次元視覚認識装 置。(2) The two-dimensional visual recognition device according to claim 1, wherein the counting process of the counter is performed in parallel at the same time as the pattern is taken into the memory.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP12328484A JPS61880A (en) | 1984-06-14 | 1984-06-14 | 2-dimensional visual recognizer |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP12328484A JPS61880A (en) | 1984-06-14 | 1984-06-14 | 2-dimensional visual recognizer |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPS61880A true JPS61880A (en) | 1986-01-06 |
Family
ID=14856755
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP12328484A Pending JPS61880A (en) | 1984-06-14 | 1984-06-14 | 2-dimensional visual recognizer |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPS61880A (en) |
-
1984
- 1984-06-14 JP JP12328484A patent/JPS61880A/en active Pending
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP2591292B2 (en) | Image processing device and automatic optical inspection device using it | |
| US5793901A (en) | Device and method to detect dislocation of object image data | |
| JPH0644292B2 (en) | Two-dimensional visual recognition device | |
| JPH0591411A (en) | Image processing device | |
| JPS61880A (en) | 2-dimensional visual recognizer | |
| JPS60262289A (en) | 2-dimensional visual recognizer | |
| JPS619773A (en) | Two dimensional visual recognizer | |
| AU2023202635A1 (en) | Scanning method, electronic device and processing system for multiple barcodes | |
| JPS60262287A (en) | 2-dimensional visual recognizer | |
| JPS61879A (en) | 2-dimensional visual recognizer | |
| JPS6120179A (en) | Two-dimensional visual recognition device | |
| JPS60263274A (en) | Two-dimensional vision recognizing device | |
| JPS60262288A (en) | 2-dimensional visual recognizer | |
| JPS60263272A (en) | Two-dimensional vision recognizing device | |
| JPS60263273A (en) | Two-demensional vision recognizing device | |
| JPH1173510A (en) | Position detecting device | |
| JPS616776A (en) | Recognizing device of two-dimensional sight | |
| JPS6121579A (en) | Two-dimensional visual recognizer | |
| JPS63282889A (en) | Image processing method | |
| JPH051508B2 (en) | ||
| JPH07325906A (en) | Mobile object detection / tracking device | |
| JPS615385A (en) | Two-dimensional visual recognizer | |
| JPS628722B2 (en) | ||
| JPH0581949B2 (en) | ||
| JPS6116376A (en) | Two-dimensional visual recognizing device |