JPH07220089A - Position detection method - Google Patents

Position detection method

Info

Publication number
JPH07220089A
JPH07220089A JP6009274A JP927494A JPH07220089A JP H07220089 A JPH07220089 A JP H07220089A JP 6009274 A JP6009274 A JP 6009274A JP 927494 A JP927494 A JP 927494A JP H07220089 A JPH07220089 A JP H07220089A
Authority
JP
Japan
Prior art keywords
point
image
contour
detected
contour line
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
JP6009274A
Other languages
Japanese (ja)
Inventor
Takashi Anezaki
隆 姉▲崎▼
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co 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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP6009274A priority Critical patent/JPH07220089A/en
Publication of JPH07220089A publication Critical patent/JPH07220089A/en
Pending legal-status Critical Current

Links

Landscapes

  • Length Measuring Devices By Optical Means (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

(57)【要約】 【目的】 任意の形状の物体に適用できて汎用性があ
り、且つ、高速に処理できて、耐ノイズ性が高い画像認
識による位置検出方法の提供。 【構成】 走査検出した画像輪郭点が既検出か未検出か
を、既検出画像輪郭点Gを記憶しているオーバレイメモ
リによって判断し、未検出の画像輪郭点Gを始点として
輪郭線追跡Hを開始し、参照点への到着方向番号別の画
像輪郭点探索方向番号表の探索方向順に基づいて2値化
画像をアクセスして次の画像輪郭点を検出し、前記オー
バレイメモリによって、輪郭線追跡終了点を検出して、
現輪郭線追跡を終了し、前記始点の次の点から走査を継
続して、外側画像輪郭線I、画像内部の輪郭線D、E、
Fを検出し、検出された輪郭線の特徴点を検出し、これ
らの特徴点間の距離角度の累積演算結果を用いて形状照
合し、位置を検出する。
(57) [Abstract] [Purpose] To provide a position detection method by image recognition that can be applied to an object of any shape, has general versatility, can be processed at high speed, and has high noise resistance. [Structure] Whether an image contour point detected by scanning is already detected or not is determined by an overlay memory which stores the already detected image contour point G, and the contour line tracking H is performed with the undetected image contour point G as a starting point. Start, and access the binarized image based on the search direction order of the image contour point search direction number table according to the arrival direction number to the reference point to detect the next image contour point, and the overlay memory traces the contour line. Detect the end point,
The current contour line tracking is ended, and the scanning is continued from the point next to the start point, and the outer image contour line I, the inner contour lines D and E,
F is detected, the characteristic points of the detected contour line are detected, shape matching is performed using the cumulative calculation result of the distance angle between these characteristic points, and the position is detected.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、視覚システムにおける
物体の位置検出方法に関し、特に、2値化画像上で対象
物の画像が有する輪郭線を検出しその輪郭線に基づいて
対象物の位置を検出する位置検出方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method for detecting the position of an object in a visual system, and more particularly to detecting the contour line of an image of the object on a binarized image and detecting the position of the object based on the contour line. To a position detection method for detecting

【0002】[0002]

【従来の技術】最近、米国や日本において、物体の識別
や位置認識等に使用する汎用の視覚システム(ビジョン
・システム)が多数開発されている。これらのシステム
で物体の識別や位置認識等に使用される従来の一般的な
方法は、主として、次の2種類である。
2. Description of the Related Art Recently, in the United States and Japan, a large number of general-purpose visual systems (vision systems) used for identifying objects, recognizing positions, etc. have been developed. The conventional general methods used for object identification and position recognition in these systems are mainly of the following two types.

【0003】第1の方法は、画像データ上の物体の画像
領域を統計的に処理する方法である。例えば、面積、長
径や短径、慣性モーメント等の統計量を基準として、物
体の形状、位置、方向を検出する方法である。
The first method is a method of statistically processing an image area of an object on image data. For example, it is a method of detecting the shape, position, and direction of an object with reference to statistics such as area, major axis, minor axis, and moment of inertia.

【0004】第2の方法は、物体が有する特徴ある形状
に合わせてテンプレート(基準画像)を使用し、このテ
ンプレートで、前記物体を撮像して得られた画像を走査
し、前記画像とテンプレートとの間で相関演算を行い、
その相関係数に基づいて、前記画像の中で前記特徴ある
形状が存在する位置を識別し、その位置によって前記物
体の位置を検出する方法である。
The second method uses a template (reference image) according to the characteristic shape of the object, scans the image obtained by picking up the object with this template, and scans the image and the template. Correlation calculation between
Based on the correlation coefficient, the position where the characteristic shape exists in the image is identified, and the position of the object is detected by the position.

【0005】しかし、第1の方法では、輪郭形状を直接
使用していないので、輪郭検出の精度が不足するという
問題点がある。
However, in the first method, since the contour shape is not directly used, there is a problem that the accuracy of contour detection is insufficient.

【0006】又、第2の方法では、使用するテンプレー
トの大きさや方向等の限定条件が派生し、汎用化が困難
であるという問題点がある。
In addition, the second method has a problem that it is difficult to generalize because the limiting conditions such as the size and direction of the template to be used are derived.

【0007】上記の問題点の対策として、図16に示す
ように、画像窓枠A内の対象物の画像Bの外形輪郭線を
計算機を使用してプログラムモードで追跡し、検出した
輪郭線から、物体の所定位置Cの位置検出を行う位置検
出方法がある。
As a measure against the above-mentioned problems, as shown in FIG. 16, the contour line of the image B of the object in the image window frame A is traced in program mode by using a computer, and the detected contour line is used. There is a position detection method for detecting the position of the predetermined position C of the object.

【0008】この位置検出方法における輪郭線追跡手順
は次の通りである。
The outline tracking procedure in this position detecting method is as follows.

【0009】(1) 画像窓枠A内を走査して、輪郭線
検出基準を満たす最初の点を画像輪郭点として検出す
る。最初に検出された画像輪郭点は、輪郭線追跡の始
点、即ち、第1参照点になる。この場合、輪郭線検出基
準はプログラム的にできている。
(1) The inside of the image window frame A is scanned to detect the first point satisfying the outline detection standard as an image outline point. The first detected image contour point becomes the start point of contour line tracking, that is, the first reference point. In this case, the outline detection reference is made programmatically.

【0010】(2) 輪郭点追跡基準に基づいて、第1
参照点の8近傍点をアクセスして、次の画像輪郭点を検
出する。検出した前記次の画像輪郭点が輪郭線終端条件
を満たしていない場合にはこの処理を繰り返す。この場
合、輪郭点追跡基準と輪郭線終端条件とはプログラム的
にできている。
(2) Based on the contour point tracking reference, the first
The eight neighboring points of the reference point are accessed to detect the next image contour point. If the detected next image contour point does not satisfy the contour end condition, this process is repeated. In this case, the contour point tracking reference and the contour end condition are made programmatically.

【0011】(3) 検出された画像輪郭点が前記輪郭
線終端条件を満たしている場合には、その時点で、この
アルゴリズムは終了する。
(3) When the detected image contour point satisfies the above-mentioned contour line end condition, at this point, this algorithm ends.

【0012】この手順で、輪郭線検出基準、輪郭点追跡
基準、輪郭線終端条件のプログラムを種々変更すること
により、さまざまな輪郭線追跡アルゴリズムを構成で
き、複雑な形状の物体でも輪郭線追跡が可能である。
[0012] In this procedure, various contour line tracking algorithms can be constructed by changing various programs of the contour line detection standard, the contour point tracking standard, and the contour line end condition, and the contour line tracking can be performed even for an object having a complicated shape. It is possible.

【0013】(4) 上記で得られた輪郭線について、
特徴点を検出し、検出した特徴点と、予め登録してある
対象物の形状に関する特徴点の基準データとを、プログ
ラム的な照合法で照合して位置を検出する。
(4) Regarding the contour line obtained above,
A characteristic point is detected, and the detected characteristic point and the reference data of the characteristic point relating to the shape of the object registered in advance are collated by a programmatic collation method to detect the position.

【0014】[0014]

【発明が解決しようとする課題】しかし、従来の位置検
出方法では、輪郭線を検出する輪郭線検出基準、輪郭点
追跡基準、輪郭線終端条件等の実行と、検出した輪郭線
の特徴点の位置と予め登録してある特徴点の基準データ
との照合の実行とをプログラム的に行っているために、
これを大容量の画像データに適用した場合に、処理量が
多くなり、時間がかかり過ぎて実用性が無くなるという
問題点がある。
However, in the conventional position detecting method, the contour line detection reference for detecting the contour line, the contour point tracking reference, the contour line end condition, and the like are executed, and the feature points of the detected contour line are detected. Since the position and the reference data of the feature points registered in advance are collated with each other programmatically,
When this is applied to a large amount of image data, there is a problem in that the amount of processing increases, it takes too much time, and practicality is lost.

【0015】特に、画像を走査して輪郭線追跡の始点を
求める段階で、走査して到達した画像輪郭点を、既検
出、未検出の区別をしないで始点にしている場合には、
この始点の検出は、対象物の画像の外郭に限定され、走
査が画像の内部に及ばないので、画像の内部にある輪郭
線の検出ができないという問題点があり、又、この既検
出、未検出の区別をプログラムで行うのでは時間が掛か
り過ぎ、実用的ではないという問題点がある。
In particular, in the step of obtaining the starting point of contour line tracing by scanning the image, if the image contour point reached by scanning is set as the starting point without distinguishing between detected and undetected points,
The detection of the starting point is limited to the outer contour of the image of the object, and since the scanning does not reach the inside of the image, there is a problem that the contour line inside the image cannot be detected. There is a problem that it takes too much time to distinguish detections by a program and it is not practical.

【0016】又、輪郭線追跡開始点を輪郭線追跡終了点
として記憶して終了処理をしている場合には、対象物の
画像Bの輪郭線が画像窓枠Aの4端辺に交差する場合に
は、実用可能な時間内で処理できる範囲のプログラムで
は、この交差点で終了できず、端辺では画像輪郭点を追
跡できないので、迷走してしまうという問題点があり、
閉じた外郭の輪郭線にしか適用できないという問題点が
ある。又、この問題をプログラム的に解決するのでは時
間が掛かり過ぎ、実用的ではないという問題点がある。
Further, when the contour line tracking start point is stored as the contour line tracking end point and the ending process is performed, the contour line of the image B of the object intersects the four edges of the image window frame A. In this case, a program that can be processed within a practical time cannot finish at this intersection and cannot trace the image contour point at the edge, so there is a problem of straying,
There is a problem that it can be applied only to the outline of a closed outline. Further, there is a problem in that it takes too much time to solve this problem programmatically and it is not practical.

【0017】本発明は上記の問題点を解決し、単純、迅
速で、汎用性があり、開いた輪郭線や画像の内部にある
輪郭線を検出し、これらの輪郭線の特徴点に基づいて位
置を検出する位置検出方法を提供することを課題として
いる。
The present invention solves the above problems and is simple, quick, and versatile, detects open contour lines and contour lines inside an image, and based on the characteristic points of these contour lines. An object is to provide a position detection method for detecting a position.

【0018】[0018]

【課題を解決するための手段】本発明の位置出方法は、
上記の課題を解決するために、第1ステップにおいて、
画像記憶手段に記憶した2値化画像データを線順次に走
査し、画像輪郭点に到達した位置で走査を一旦停止し、
第2ステップにおいて、前記到達した画像輪郭点を、そ
れまでの既検出画像輪郭点を記憶しているオーバレイメ
モリによって、既検出か未検出かを判断し、既検出であ
れば走査を再開し、未検出であれば前記到達した画像輪
郭点を、始点として前記オーバレイメモリに記憶させ、
第3ステップにおいて、前記始点を第1参照点として前
記2値化画像データについて輪郭線追跡を始め、第1参
照点では到着方向番号が7の、第2参照点以降では前参
照点から現参照点へ向かう方向である到着方向番号の画
像輪郭点探索方向番号表を、その参照点への到着方向番
号別に決まるその参照点での探索方向順を8つの到着方
向番号別に決めた画像輪郭点探索方向番号表から選択
し、選択した画像輪郭点探索方向番号表の探索方向順に
基づいて前記2値化画像をアクセスして次の画像輪郭点
を検出して前記オーバレイメモリに記憶させ、第4ステ
ップにおいて、前記オーバレイメモリに記憶されている
前記始点および既検出画像輪郭点のデータを、現参照点
の周囲の8近傍点についてアクセスし、このアクセス結
果で、第3ステップで検出された画像輪郭点が未検出か
既検出かを判断し、第5ステップにおいて、未検出であ
れば、前記第3〜第4ステップを繰り返し、既検出であ
れば、第3ステップで検出された画像輪郭点は輪郭線追
跡終了点であるので、現輪郭線追跡を終了して第1ステ
ップに戻り、前記始点の次の点から走査を続け、第6ス
テップにおいて、上記線順次走査が2値化画像の下端に
達したときに総ての輪郭線追跡を終了し、第7ステップ
において、これまでに検出した各輪郭線の曲率を計算し
曲率に基づく特徴点を検出し、第8ステップにおいて、
前記特徴点間の輪郭線長と角度とを各輪郭線毎に順次累
積演算して距離角度累積演算結果を記憶し、第9ステッ
プにおいて、予め登録してある対象物の形状に関する距
離角度累積演算基準データと、前記距離角度累積演算結
果とを、特徴点毎に照合しながらシフトし最適な照合位
置を検出することを特徴とする。
The positioning method of the present invention is
In order to solve the above problems, in the first step,
The binarized image data stored in the image storage means is line-sequentially scanned, and the scanning is temporarily stopped at the position where the image contour point is reached,
In the second step, the reached image contour point is judged as already detected or undetected by the overlay memory storing the already detected image contour points, and if already detected, the scanning is restarted, If not detected, the reached image contour point is stored in the overlay memory as a start point,
In the third step, contour tracing is started for the binarized image data using the starting point as a first reference point, the arrival direction number is 7 at the first reference point, and the second reference point and subsequent ones are currently referred to from the previous reference point. An image contour point search in which an image contour point search direction number table of arrival direction numbers that are directions toward a point is determined by the arrival direction number to the reference point and the search direction order at the reference point is determined by eight arrival direction numbers. Selecting from the direction number table, accessing the binarized image based on the search direction order of the selected image contour point search direction number table to detect the next image contour point and store it in the overlay memory; In, the data of the starting point and the already detected image contour point stored in the overlay memory is accessed for eight neighboring points around the current reference point, and the third step is used as a result of this access. It is determined whether the detected image contour point is undetected or already detected, and if it is not detected in the fifth step, the third to fourth steps are repeated, and if it is already detected, it is detected in the third step. Since the image contour point is the end point of the contour line tracking, the current contour line tracking is ended and the procedure returns to the first step, the scanning is continued from the point next to the starting point, and the line sequential scanning is performed in the sixth step. When the lower end of the binarized image is reached, all contour line tracking is terminated, and in the seventh step, the curvature of each contour line detected so far is calculated to detect the feature point based on the curvature, and the eighth step At
The contour line length and the angle between the feature points are sequentially cumulatively calculated for each contour line to store the distance angle cumulative calculation result, and in a ninth step, the distance angle cumulative calculation relating to the shape of the object registered in advance is stored. It is characterized in that the reference data and the distance / angle cumulative calculation result are shifted while matching for each feature point to detect the optimum matching position.

【0019】[0019]

【作用】プログラム処理で物体の画像の輪郭線を追跡
し、物体の位置を検出する位置検出方法では、所要時間
を実用的に短くすれば機能不足になり、機能を満たせば
時間がかかり過ぎて実用性が無いという従来例の問題点
を解決するために、プログラムの前記輪郭線検出基準、
輪郭点追跡基準、輪郭線終端条件、位置照合条件を単純
化して、処理時間を短縮する必要がある。
In the position detecting method of detecting the position of the object by tracing the contour line of the object image by the program processing, if the required time is practically shortened, the function becomes insufficient, and if the function is satisfied, it takes too much time. In order to solve the problem of the conventional example that is not practical, the contour line detection criteria of the program,
It is necessary to shorten the processing time by simplifying the contour point tracking reference, the contour end condition, and the position matching condition.

【0020】このために、本発明は、 (1) 輪郭点追跡基準の処理を、プログラムで逐次実
施する代わりに、プログラムの一部を画像輪郭点探索方
向番号表を使用して、単純、迅速化している。そして、
この画像輪郭点探索方向番号表は、参照点で8近傍点を
アクセスすべき順序が、その参照点への到着方向番号別
に決まることを利用したもので、どの方向に次の画像輪
郭点があっても、表を参照することによって、同一処理
で検出することができ、単純、迅速化できる。そして、
又、閉じた画像輪郭線の追跡だけではなく、後述のよう
に端点がある輪郭線の端点を検出して追跡を終了でき
る。従って、処理が単純化して所要時間が短縮するだけ
ではなく、略同じ短い時間で機能を拡大できる。
Therefore, the present invention (1) uses the image contour point search direction number table as a part of the program, instead of sequentially performing the contour point tracking reference processing by the program, and simply and quickly. It has become. And
This image contour point search direction number table uses the fact that the order of accessing 8 neighboring points at a reference point is determined by the arrival direction number to the reference point. In which direction the next image contour point is located. However, by referring to the table, it is possible to detect in the same process, and it is possible to simplify and speed up. And
In addition to tracking the closed image contour line, the tracking can be ended by detecting the end points of the contour line having the end points as described later. Therefore, not only the processing is simplified and the required time is shortened, but also the function can be expanded in the same short time.

【0021】(2) 輪郭線検出基準と輪郭線終端条件
との処理を、プログラムで逐次実施する代わりに、既検
出画像輪郭点を記憶しているオーバレイメモリによっ
て、既検出か未検出かを判断している。このオーバレイ
メモリには、既検出の画像輪郭点を総て記憶させること
ができるので、処理が単純化して所要時間が短縮するだ
けではなく、未検出の画像輪郭点が無くなるまで、繰り
返し輪郭線の追跡を続け、外側輪郭線を通過して外側輪
郭線の内部にある輪郭線も追跡することができる。
(2) Instead of sequentially executing the processing of the contour line detection reference and the contour line end condition by the program, the overlay memory storing the detected image contour points is used to judge whether it has been detected or not. is doing. Since all the detected image contour points can be stored in this overlay memory, not only the processing is simplified and the required time is shortened, but also repeated contour lines are stored until there are no undetected image contour points. Continuing the tracking, the contours that are inside the outer contour can also be traced through the outer contour.

【0022】(3) 又、検出した輪郭線の特徴点を曲
率計算によって検出し、検出した特徴点間の距離角度累
積演算結果を距離角度累積演算基準データと形状照合し
て位置を検出することにより、汎用性を有すると共に、
他の部分に影やノイズがあっても正確に位置を検出でき
るので、耐ノイズ性が高い位置検出を行うことができ
る。
(3) In addition, the characteristic points of the detected contour line are detected by curvature calculation, and the distance angle cumulative calculation result between the detected characteristic points is shape-matched with the distance angle cumulative calculation reference data to detect the position. Has versatility,
Since the position can be accurately detected even if there is a shadow or noise in other portions, it is possible to perform position detection with high noise resistance.

【0023】[0023]

【実施例】本発明の位置検出方法の第1実施例を図1〜
図15と表1〜表3と式(1)〜式(4)とに基づいて
説明する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS A first embodiment of the position detecting method of the present invention will be described with reference to FIGS.
It demonstrates based on FIG. 15, Table 1-Table 3, and a formula (1) -formula (4).

【0024】(1) 第1、第2ステップで、2値化画
像の画像窓枠Aを、上端より横方向に線順次に走査し、
到達した画像輪郭点Gで、オーバレイメモリによって、
この到達した画像輪郭点Gが未検出か否かを判断し未検
出であれば、この到達した画像輪郭点Gを輪郭線追跡の
始点にすると共に、この到達した画像輪郭点Gを既検出
画像輪郭点としてオーバレイメモリに記憶させる。
(1) In the first and second steps, the image window frame A of the binarized image is line-sequentially scanned in the lateral direction from the upper end,
At the reached image contour point G, by the overlay memory,
It is determined whether or not the reached image contour point G is undetected, and if it is not detected, the reached image contour point G is set as the start point of contour line tracking, and the reached image contour point G is detected image. The contour points are stored in the overlay memory.

【0025】(2) 第3ステップで、前記始点Gを第
1参照点として前記2値化画像データについて輪郭線追
跡Hを始め、第1参照点Gにおいては、図2に示す方向
コードの7を到着方向番号とし、第2参照点以降におい
ては、前参照点から現参照点へ向かう図2に示す方向番
号の方向を到着方向番号として、8つの到着方向番号別
に決めた表1に示すような画像輪郭点探索方向番号表を
選択し、選択した画像輪郭点探索方向番号表の探索方向
順に基づいて前記2値化画像をアクセスする。
(2) In the third step, the contour line tracing H is started for the binarized image data with the starting point G as the first reference point, and at the first reference point G, the direction code 7 shown in FIG. Is set as the arrival direction number, and after the second reference point, the direction of the direction number shown in FIG. 2 from the previous reference point to the current reference point is set as the arrival direction number. A different image contour point search direction number table is selected, and the binarized image is accessed based on the search direction order of the selected image contour point search direction number table.

【0026】表1に示す画像輪郭点探索方向番号表は、
到着方向番号が5のものである。
The image contour point search direction number table shown in Table 1 is
The arrival direction number is 5.

【0027】[0027]

【表1】 [Table 1]

【0028】表1を説明する。方向番号1〜8は、図2
(a)に示す8方向番号に対応する。P0 は現参照点で
ある。方向番号1〜8の方向に次の参照点P1 〜P8 が
あり、矢印Jの反時計回りにアクセスする。○印は背景
点、●印は対象物の領域点を示すビットパターンであ
る。次の方向番号は求めるべき次の参照点への方向番号
を示し、アクセスして得られた方向番号1〜8のビット
パターンで表を参照し、その方向番号と●印とが一致す
る欄の下にある次の方向番号を求めることによって、次
の参照点への方向番号が得られる。×印はエラーを示
す。表1で、次の方向番号が1になった場合には、次の
参照点が前の参照点に後戻りしていることになり、現参
照点は、端点がある輪郭線のその端点であることを示
す。即ち、表1で、端点がある輪郭線の端点を検出でき
ることになる。
Table 1 will be described. Direction numbers 1 to 8 are shown in FIG.
This corresponds to the 8-direction number shown in (a). P 0 is the current reference point. In direction ID Nos. 1-8 have the following reference points P 1 to P 8, accesses the counterclockwise arrow J. A circle mark is a background point, and a circle mark is a bit pattern indicating a region point of the object. The next direction number indicates the direction number to the next reference point to be obtained, and the table is referenced with the bit patterns of the direction numbers 1 to 8 obtained by accessing, and in the column where the direction number and the ● mark match. By finding the next underlying direction number, the direction number to the next reference point is obtained. A cross indicates an error. In Table 1, when the next direction number is 1, the next reference point has moved back to the previous reference point, and the current reference point is the end point of the contour line having the end point. Indicates that. That is, in Table 1, the end points of the contour line having the end points can be detected.

【0029】以下に述べる理由によって、一般的に、到
着方向番号がiであれば、図2(b)に示すi−3の方
向は必ず背景点になる。i−3の方向が領域点の場合に
はエラーとして扱う。従って、表1では、5−3=2の
方向は必ず背景点になるので、表1に示す到着方向番号
が5の場合には、図2に示す8方向番号1〜8の中の方
向番号2の方向から反時計回りに、現参照点の8近傍点
をアクセスし、最初に領域点を得た方向が、次の参照点
の方向である。
For the reasons described below, generally, if the arrival direction number is i, the direction i-3 shown in FIG. 2B always becomes the background point. If the direction of i-3 is a region point, it is treated as an error. Therefore, in Table 1, the direction of 5-3 = 2 always becomes the background point. Therefore, when the arrival direction number shown in Table 1 is 5, the direction number among the 8 direction numbers 1 to 8 shown in FIG. The direction in which eight neighboring points of the current reference point are accessed in the counterclockwise direction from the direction 2 and the area point is first obtained is the direction of the next reference point.

【0030】i−3の方向は必ず背景点になる説明は以
下の通りである。
The explanation that the direction of i-3 is always the background point is as follows.

【0031】対象物の画像Bの輪郭形状は、図3(a)
の閉じた画像B1 か、図3(b)の開いた画像B2 の何
れかである。
The contour shape of the image B of the object is shown in FIG.
3 is either the closed image B 1 of FIG. 3B or the open image B 2 of FIG.

【0032】閉じた図形B1 の参照点をS1 、開いた画
像B2 の参照点をS2 とすると、それぞれ図4(a)、
図4(b)に示すようになる。
Assuming that the reference point of the closed figure B 1 is S 1 and the reference point of the opened image B 2 is S 2 , respectively, as shown in FIG.
It becomes as shown in FIG.

【0033】図5、図6は、前参照点から現参照点への
方向番号が、5〜8の場合の背景点○と領域点●の位置
関係を示した図である。この場合、図5は閉じた図形B
1 の場合を、図6は開いた図形B2 の場合を示す。何れ
の場合も、i−3の方向は背景点になっており、i−3
の方向から反時計回りに探索を開始すれば、次の参照点
を検出できる。
FIGS. 5 and 6 are diagrams showing the positional relationship between the background point ◯ and the area point  when the direction number from the previous reference point to the current reference point is 5-8. In this case, FIG. 5 shows a closed figure B.
FIG. 6 shows the case of 1 and the case of the opened figure B 2 . In either case, the i-3 direction is the background point, and i-3
If the search is started counterclockwise from the direction, the next reference point can be detected.

【0034】図7は、輪郭線上での検出を示した図で、
図7(a)では、前参照点P10より例えば方向番号6の
方向に現参照点P0 が検出された場合、現参照点P0 か
ら見て6−3=3の方向は必ず背景点となり且つこれよ
り時計回り方向には次の参照点は存在しない。従って、
方向番号3から反時計回りに探索すれば次の参照点が検
出できる。同様に、図7(b)では、前参照点P10より
例えば方向番号5の方向に現参照点P0 が検出された場
合、現参照点P0 から見て5−3=2の方向は必ず背景
点となり且つこれより時計回り方向には次の参照点は存
在しない。従って、方向番号2から反時計回りに探索す
れば次の参照点が検出できる。
FIG. 7 is a diagram showing the detection on the contour line.
In FIG. 7A, when the current reference point P 0 is detected in the direction of the direction number 6 from the previous reference point P 10 , for example, the direction 6−3 = 3 from the current reference point P 0 is always the background point. And there is no next reference point in the clockwise direction. Therefore,
By searching counterclockwise from the direction number 3, the next reference point can be detected. Similarly, in FIG. 7B, when the current reference point P 0 is detected from the previous reference point P 10 in the direction of the direction number 5, for example, the direction 5-3 = 2 from the current reference point P 0 is It always becomes a background point, and there is no next reference point in the clockwise direction from this. Therefore, by searching counterclockwise from the direction number 2, the next reference point can be detected.

【0035】1〜8の各方向番号について、図4〜図7
を試みれば、何れも同様の結果が得られる。以上より帰
納して作成した、i−3の方向から反時計回りに探索を
開始するための画像輪郭点探索方向番号表が表1であ
る。
4 to 7 for each of the direction numbers 1 to 8
If you try, you can get the same result. Table 1 is an image contour point search direction number table for starting the search counterclockwise from the direction i-3, which is created by induction.

【0036】又、走査して到着した始点からの探索の場
合には、到着方向番号を7とすれば良いことが容易に判
る。
Further, in the case of a search from the starting point arrived by scanning, it is easily understood that the arrival direction number should be 7.

【0037】上記のようにして、表1の画像輪郭点探索
方向番号表でアクセスして次の画像輪郭点を検出し、こ
の検出した画像輪郭点を前記オーバレイメモリに記憶さ
せる。
As described above, the image contour point search direction number table of Table 1 is accessed to detect the next image contour point, and the detected image contour point is stored in the overlay memory.

【0038】(3) 第4ステップにおいて、前記オー
バレイメモリに記憶されている前記始点および既検出画
像輪郭点のデータを、現参照点の周囲の8近傍点につい
てアクセスし、前記の今回検出した画像輪郭点と重なる
前記始点および既検出画像輪郭点の有無を判断する。こ
の結果で、第3ステップで検出された画像輪郭点が未検
出か既検出かを判断できる。
(3) In the fourth step, the data of the starting point and the already detected image contour points stored in the overlay memory are accessed for eight neighboring points around the current reference point, and the image detected this time is accessed. The presence / absence of the start point and the detected image contour point which overlap the contour point is determined. From this result, it is possible to determine whether the image contour point detected in the third step is undetected or already detected.

【0039】(4) 第5ステップにおいて、未検出で
あれば、前記第3〜第4ステップを繰り返し、既検出で
あれば、第3ステップで検出された画像輪郭点は輪郭線
追跡終了点であるので、現輪郭線追跡を終了して第1ス
テップに戻り、前記始点の次の点から走査を続ける。
(4) In the fifth step, if not detected, the third to fourth steps are repeated, and if already detected, the image contour point detected in the third step is the contour tracing end point. Therefore, the tracing of the current contour line is terminated, the process returns to the first step, and the scanning is continued from the point next to the start point.

【0040】(5) 次の走査では、既検出の画像輪郭
点を検出しても、前記オーバレイメモリの判断で、これ
を始点にしないで通過し、未検出の画像輪郭点を検出し
てこれを始点として画像輪郭線の探索を行い、未検出の
画像輪郭点の検出がなくなるまで繰り返される。従っ
て、図1についていえば、先ず、輪郭線追跡Hによっ
て、対象物の画像Bの外側画像輪郭線Iを検出した後、
対象物の画像Bの内部の輪郭線D、E、Fが検出され、
所定位置Cの位置が認識される。この場合、対象物の画
像Bの外側画像輪郭線Iの走査と、対象物の画像Bの内
部の輪郭線D、E、Fの走査とでは、画像輪郭点の検出
位置での画像データの「0」→「1」、「1」→「0」
の変化が逆になる。
(5) In the next scan, even if an already detected image contour point is detected, the overlay memory judges that it passes without setting it as a starting point, and an undetected image contour point is detected. The image contour line is searched using as a starting point, and the process is repeated until no undetected image contour point is detected. Therefore, referring to FIG. 1, first, after detecting the outer side image contour line I of the image B of the object by the contour line tracking H,
The contour lines D, E, F inside the image B of the object are detected,
The position of the predetermined position C is recognized. In this case, in the scanning of the outer image contour line I of the image B of the object and the scanning of the contour lines D, E, and F of the inside of the image B of the object, "" of the image data at the detection position of the image contour point is detected. "0" → "1", "1" → "0"
Changes in the opposite.

【0041】(6) 尚、画像記憶手段に記憶した2値
化画像データの画像窓枠の4端辺上の点を既検出の画像
輪郭点として扱うようにすれば、図4(b)の開いた画
像の画像輪郭線を探索できる。これを簡単に行うには、
画像記憶手段に記憶した2値化画像データの画像窓枠の
4端辺上の点を既検出の画像輪郭点としてオーバレイメ
モリに記憶させれば良い。
(6) Incidentally, if the points on the four edges of the image window frame of the binarized image data stored in the image storage means are treated as the already detected image contour points, the image shown in FIG. You can search the image contour of the opened image. To do this easily,
The points on the four edges of the image window frame of the binarized image data stored in the image storage means may be stored in the overlay memory as already detected image contour points.

【0042】上記の本発明の位置検出方法を実施する第
1実施例を図8、図9に基づいて説明する。
A first embodiment for carrying out the position detecting method of the present invention will be described with reference to FIGS. 8 and 9.

【0043】本実施例は、輪郭線追跡の一部をプログラ
ム制御ではなくランダムロジックによるハードウェアで
行って迅速化するもので、図8において、画像記憶部1
02は画像メモリと、これに座標を重ね合わせたオーバ
レイメモリとで構成されており、このオーバレイメモリ
には始点と検出された画像輪郭点が順次書き込まれる。
制御部107は、画像記憶部102の画像メモリが記憶
している2値化画像に対して、DMA(ダイレクトメモ
リアクセス)部103を用いて走査を行いながら、画像
記憶部102のオーバレイメモリを使用して、既検出点
チェックを実施して、画像輪郭点を検出する。制御部1
07は上記の走査によって到達し検出した画像輪郭点を
画像輪郭線追跡の始点とし、始点アドレスと、到着方向
番号によって選択した画像輪郭点探索方向番号表に基づ
く探索方向順の開始方向数とをアドレス算出部105と
輪郭点探索部104とに送り、画像輪郭線追跡を開始さ
せる。DMA部103より追跡終了情報が出されて画像
輪郭線追跡が終了すると、引き続いて走査を行う。そし
て、未検出の画像輪郭点が検出されると、上記の動作を
繰り返し、これを、画像データが終了するまで、即ち、
上記の線順次走査が2値化画像の下端に達するまで実行
する。
In this embodiment, a part of the contour line tracking is performed by hardware based on random logic rather than program control to speed up the process. In FIG.
Reference numeral 02 is composed of an image memory and an overlay memory in which coordinates are superposed on the image memory, and the start point and the detected image contour point are sequentially written in this overlay memory.
The control unit 107 uses the overlay memory of the image storage unit 102 while scanning the binary image stored in the image memory of the image storage unit 102 using the DMA (direct memory access) unit 103. Then, the already detected points are checked to detect the image contour points. Control unit 1
Reference numeral 07 designates an image contour point which is reached and detected by the above scanning as a starting point of image contour line tracing, and the starting point address and the number of start directions in the search direction order based on the image contour point search direction number table selected by the arrival direction number are set. It is sent to the address calculation unit 105 and the contour point search unit 104 to start the image contour line tracking. When the tracking end information is output from the DMA unit 103 and the image contour line tracking is completed, the scanning is continued. Then, when an undetected image contour point is detected, the above operation is repeated until the image data ends, that is,
The above line-sequential scanning is executed until the lower end of the binarized image is reached.

【0044】DMA部103は、始点または参照点の8
近傍点を画像記憶部102の画像メモリよりアクセスす
る。この場合、1度のアドレス指定アクセスで、画像メ
モリとオーバレイメモリとの両方のアクセスが可であ
る。画像メモリからアクセスしたデータを輪郭点探索部
104に送り、オーバレイメモリからアクセスしたオー
バレイデータを一旦記憶する。輪郭点探索部104は、
下記のようにして画像輪郭点を検出し、DMA部103
は、輪郭点探索部104が検出した画像輪郭点を、オー
バレイメモリに記憶された始点および既検出画像輪郭点
と比較し、追跡終了情報を検出する。追跡終了情報を検
出した場合には、これを制御部107におくる。
The DMA unit 103 has a start point or a reference point of 8
The neighboring points are accessed from the image memory of the image storage unit 102. In this case, it is possible to access both the image memory and the overlay memory with one addressing access. The data accessed from the image memory is sent to the contour point searching unit 104, and the overlay data accessed from the overlay memory is temporarily stored. The contour point search unit 104
The image contour points are detected as described below, and the DMA unit 103
Compares the image contour point detected by the contour point searching unit 104 with the start point and the already detected image contour point stored in the overlay memory to detect the tracking end information. When the tracking end information is detected, it is sent to the control unit 107.

【0045】輪郭点探索部104は、DMA部103か
らの8近傍点のデータを前記の画像輪郭点探索方向番号
表に基づく探索方向順の開始方向数に基づいて画像輪郭
点を検出する。輪郭点探索方向番号表はROMで構成さ
れ、入力データは、到着方向番号の3ビットと8近傍点
のデータの8ビットとの合計11ビットがアドレスとし
て与えられ、これによって、次の方向番号のデータの3
ビットとエラー情報1ビットの合計4ビットが読み出さ
れる。エラー情報は、8近傍点が総て「1」又は総て
「0」のとき、及び方向番号i−3が「対象物の領域
点」のとき「1」が出力し、エラーを示すようにする。
読み出された次の方向番号はアドレス算出部105へ、
エラー情報は制御部107へ送られる。
The contour point searching unit 104 detects the image contour points of the data of the eight neighboring points from the DMA unit 103, based on the number of starting directions in the search direction order based on the image contour point searching direction number table. The contour point search direction number table is composed of a ROM, and the input data is given as an address by a total of 11 bits of 3 bits of the arrival direction number and 8 bits of the data of 8 neighboring points. Data 3
A total of 4 bits, which are a bit and 1 bit of error information, are read. As the error information, "1" is output when all 8 neighboring points are "1" or all "0", and when the direction number i-3 is "region point of the object", the error information is indicated as an error. To do.
The next direction number read out is sent to the address calculation unit 105.
The error information is sent to the control unit 107.

【0046】アドレス算出部105は、輪郭点探索部1
04で得られた次の方向番号に従ってアドレスをX、Y
方向に夫々増減させて、次の参照点のアドレスを作り、
このアドレスをDMA部103へ送り、また検出されて
いる次の方向番号と共に、輪郭データ記憶部106に送
り、輪郭データ記憶部106はこれを記憶する。
The address calculation unit 105 includes a contour point search unit 1
X, Y according to the next direction number obtained in 04
Increase or decrease in each direction to make the address of the next reference point,
This address is sent to the DMA unit 103, and also sent to the contour data storage unit 106 together with the detected next direction number, and the contour data storage unit 106 stores this.

【0047】図9は、図8のDMA部103、輪郭点探
索部104及びアドレス算出部105の詳細の一例を示
すブロック図である。
FIG. 9 is a block diagram showing an example of details of the DMA unit 103, the contour point searching unit 104 and the address calculating unit 105 of FIG.

【0048】図8、図9において、DMA部103の線
順次メモリアクセス回路1008へ制御部107より線
順次走査始点アドレスが送られ、線順次メモリアクセス
回路1008は前記始点アドレスより線順次走査を開始
する。
In FIGS. 8 and 9, the line-sequential memory access circuit 1008 of the DMA unit 103 is sent a line-sequential scanning start point address from the control unit 107, and the line-sequential memory access circuit 1008 starts line-sequential scanning from the start point address. To do.

【0049】線順次走査と同時に、画像記憶部102よ
り同一座標点の画像メモリデータとオーバレイデータと
を、線順次メモリアクセス回路1008が読み込む。こ
の読み込んだ同一座標点の画像メモリデータとオーバレ
イデータとを、比較回路1009で比較する。このと
き、画像メモリデータが「0」→「1」に変化する座標
で、オーバレイデータが「0」の場合には、その座標
は、輪郭線追跡始点であり、前記以外の場合は輪郭線追
跡始点ではない。
Simultaneously with the line-sequential scanning, the line-sequential memory access circuit 1008 reads the image memory data and the overlay data at the same coordinate point from the image storage unit 102. The comparison circuit 1009 compares the read image memory data at the same coordinate point with the overlay data. At this time, when the image memory data is a coordinate changing from “0” to “1” and the overlay data is “0”, the coordinate is the contour line tracing start point, and in other cases, the contour line tracing is performed. Not the starting point.

【0050】輪郭線追跡始点が検出されると、始点情報
が制御部107へ送られる。制御部107は始点情報を
受け取ると、線順次メモリアクセス中止指令を線順次メ
モリアクセス回路1008へ送り、始点の次のアドレス
を線順次走査始点アドレスとして記憶する。
When the contour tracing start point is detected, the start point information is sent to the control unit 107. When the control unit 107 receives the start point information, it sends a line-sequential memory access stop command to the line-sequential memory access circuit 1008 and stores the address next to the start point as the line-sequential scanning start point address.

【0051】続いて、制御部107より、線順次走査始
点アドレスがバッファ1007へ、開始方向数がバッフ
ァ1004へ送られる。バッファ1007が記憶する線
順次走査始点アドレスに従いメモリアクセス回路100
1は8近傍点データとオーバレイデータとをアクセス
し、探索表1003および比較回路1002に送る。比
較回路1002へ送られたオーバレイデータは一旦記憶
される。前記の表1の説明のようにして探索表1003
より次の方向番号が得られ、この方向番号はバッファ1
004と演算テーブル1005と輪郭データ記憶部10
6とに送られる。
Subsequently, the control unit 107 sends the line-sequential scanning start point address to the buffer 1007 and the start direction number to the buffer 1004. The memory access circuit 100 according to the line sequential scanning start point address stored in the buffer 1007.
1 accesses the 8-neighbor point data and the overlay data and sends them to the search table 1003 and the comparison circuit 1002. The overlay data sent to the comparison circuit 1002 is temporarily stored. Search table 1003 as described in Table 1 above.
The next direction number is obtained, and this direction number is stored in buffer 1.
004, calculation table 1005, and contour data storage unit 10
6 and sent to.

【0052】比較回路1002はバッファ1004が記
憶する方向番号を、先に記憶したオーバレイデータと比
較して追跡終了情報を得る。演算テーブル1005に
は、各方向番号に対応するX、Y方向の増減値ΔX、Δ
Yが書き込まれており、これが演算回路1006に送ら
れて、次の参照点アドレスが算出される。参照点アドレ
スは輪郭データ記憶部106とバッファ1007へ送ら
れる。
The comparison circuit 1002 compares the direction number stored in the buffer 1004 with the overlay data stored previously to obtain tracking end information. In the calculation table 1005, increase / decrease values ΔX, Δ in the X and Y directions corresponding to the respective direction numbers.
Y is written, and this is sent to the arithmetic circuit 1006 to calculate the next reference point address. The reference point address is sent to the contour data storage unit 106 and the buffer 1007.

【0053】特徴点検出部108は、検出した輪郭線を
細分して曲率計算し、その結果から特徴点位置を検出し
て記憶する。詳しく説明すると、特徴点検出部108
は、図10に示すように、曲率値算出部111と、曲率
値比較部112と、特徴点記憶部113とで構成され
る。輪郭データ記憶部106に記憶されている輪郭デー
タの実形状の一例を図11に示し、以下にこれを参照し
て説明する。
The feature point detection unit 108 subdivides the detected contour line and calculates the curvature, and detects and stores the feature point position from the result. More specifically, the feature point detection unit 108
As shown in FIG. 10, is composed of a curvature value calculation unit 111, a curvature value comparison unit 112, and a feature point storage unit 113. An example of the actual shape of the contour data stored in the contour data storage unit 106 is shown in FIG. 11, which will be described below with reference to this.

【0054】図11において、各輪郭点の番号は追跡番
号を示している。曲率値算出部111では、各輪郭点i
毎に、検出された方向 code i に基づいて、例えば、次
の(1)式に示す曲率計算式に従って、曲率値を算出す
る。
In FIG. 11, the number of each contour point indicates a tracking number. In the curvature value calculation unit 111, each contour point i
For each time, the curvature value is calculated based on the detected direction code i, for example, according to the curvature calculation formula shown in the following formula (1).

【0055】[0055]

【数1】 [Equation 1]

【0056】但し、加減算は modulo 8 で実施曲率値比
較部112では、曲率値算出部111で算出された曲率
値を輪郭点毎に、その曲率値の絶対値と、設定した閾値
とを比較して特徴点の判定を行う。例えば、 〔1〕|曲率計算値|≦閾値1 のときは直線 〔2〕閾値1<|曲率計算値|<閾値2 のときはカーブ 〔3〕閾値2≦|曲率計算値| のときはコーナ と判定する。図13の輪郭線における方向 code i と曲
率値と特徴点の判定結果を表2に示す。尚、この例で
は、n=2で演算している。
However, the addition / subtraction is modulo 8. The curvature value comparison unit 112 compares the curvature value calculated by the curvature value calculation unit 111 for each contour point with the absolute value of the curvature value and the set threshold value. Then, the characteristic points are determined. For example, when [1] | curvature calculation value | ≦ threshold value 1, straight line [2] threshold value 1 <| curvature calculation value | <threshold value 2 curve [3] threshold value 2 ≦ | curvature calculation value | To determine. Table 2 shows the determination results of the direction code i, the curvature value, and the feature points in the contour line of FIG. In this example, the calculation is performed with n = 2.

【0057】[0057]

【表2】 [Table 2]

【0058】そして、直線は特徴点とせず、カーブは連
続点となるがその最初の点をカーブ特徴点とし、コーナ
は1点又は連続点となるが、連続点の場合、最大値があ
る場合はその最大値の点を、最大値が無い場合は最初の
点をコーナ特徴点と判定する。こうして得られた特徴点
情報(x、y座標と特徴情報)を特徴点記憶部113に
記憶する。図11の結果を表3に示す。
The straight line is not a characteristic point, the curve is a continuous point, but the first point thereof is a curve characteristic point, and the corner is one point or a continuous point. In the case of a continuous point, there is a maximum value. Determines the point having the maximum value as the corner feature point when there is no maximum value. The feature point information (x, y coordinates and feature information) thus obtained is stored in the feature point storage unit 113. The results of FIG. 11 are shown in Table 3.

【0059】[0059]

【表3】 [Table 3]

【0060】このようにして、曲率計算を使用して輪郭
線の特徴点を求めることにより、輪郭線を特定するため
のデータ量を大幅に圧縮することができ、高速処理が可
能になる。
In this way, by calculating the characteristic points of the contour line by using the curvature calculation, the amount of data for specifying the contour line can be significantly reduced, and high-speed processing becomes possible.

【0061】距離角度累積演算部109は、特徴点検出
部108の特徴点記憶部113に記憶した特徴点位置間
の輪郭長と画像横方向に対する角度とを輪郭線毎に、順
次累積演算し、その結果を記憶する。即ち、特徴点記憶
部113に記憶した特徴点データについて、次の式
(2)、(3)を使用して、距離角度累積演算を行う。
The distance angle cumulative calculation unit 109 sequentially cumulatively calculates, for each contour line, the contour length between feature point positions stored in the feature point storage unit 113 of the feature point detection unit 108 and the angle with respect to the horizontal direction of the image, Memorize the result. That is, with respect to the feature point data stored in the feature point storage unit 113, the distance angle cumulative calculation is performed using the following equations (2) and (3).

【0062】[0062]

【数2】 [Equation 2]

【0063】[0063]

【数3】 [Equation 3]

【0064】但し、追跡点番号1では、S=0、Φ=0
とする。
However, in tracking point number 1, S = 0, Φ = 0
And

【0065】以上の演算による距離角度累積演算結果を
図12に示す。この距離角度演算結果を使用すると、輪
郭線に多少の凹凸や変形部分があっても、図12のライ
ンに微小かつ局部的な振れが現れるだけであり、全体と
して、形状が同一であれば、同一のラインパターンとな
るので、耐ノイズ性が高い輪郭線形状の検出ができる。
FIG. 12 shows the result of cumulative distance angle calculation by the above calculation. Using this distance angle calculation result, even if there are some irregularities or deformed portions on the contour line, only minute and local fluctuations appear on the line, and if the shape is the same as a whole, Since the line patterns are the same, it is possible to detect the contour line shape having high noise resistance.

【0066】形状照合部110は、距離角度累積演算部
109に記憶した演算結果に対し、予め登録してあるテ
ンプレートの距離角度累積演算基準データを、特徴点毎
にシフトしながら照合し、最適な照合位置を検出する。
図13(a)にテンプレートの実形状を示し、図13
(b)にその距離角度累積演算基準データを示す。そし
て、次の式(4)に示す、一致度Dを最小にする点を、
形状照合点とし、検出結果とする。
The shape matching unit 110 matches the distance angle cumulative calculation reference data of the template registered in advance with the calculation result stored in the distance angle cumulative calculation unit 109 while shifting each feature point to obtain the optimum value. Detect the matching position.
The actual shape of the template is shown in FIG.
(B) shows the distance angle cumulative calculation reference data. Then, the point that minimizes the degree of coincidence D shown in the following equation (4) is
The shape matching point is used as the detection result.

【0067】[0067]

【数4】 [Equation 4]

【0068】但し、Φは対象物、Φt はテンプレート 次に、本発明方法を使用する第2実施例を図14、図1
5に基づいて説明する。
However, Φ is the object, and Φt is the template. Next, the second embodiment using the method of the present invention is shown in FIGS.
It will be described based on 5.

【0069】図14は、第2実施例の構成を示すブロッ
ク図で、画像入力部1101と、画像記憶部1102
と、CPU1103と、一時記憶部1104とからな
る。このCPU1103の動作を、図15のフローチャ
ートで説明する。
FIG. 14 is a block diagram showing the configuration of the second embodiment, which is an image input section 1101 and an image storage section 1102.
And a CPU 1103 and a temporary storage unit 1104. The operation of the CPU 1103 will be described with reference to the flowchart of FIG.

【0070】ステップ#1において、記憶した画像を線
順次に走査して、境界点座標データを検出する。
In step # 1, the stored image is line-sequentially scanned to detect boundary point coordinate data.

【0071】ステップ#2において、検出された境界点
座標データより未検出の境界点を始点として検出する。
始点であれば、ステップ#3に進み、始点でなければ、
ステップ#1に戻る。
In step # 2, an undetected boundary point is detected as a starting point from the detected boundary point coordinate data.
If it is the start point, proceed to step # 3, and if it is not the start point,
Return to step # 1.

【0072】ステップ#3において、得られた始点より
輪郭線探索を開始し、その始点の次の走査点を次の始点
として記憶する。
In step # 3, the contour line search is started from the obtained starting point, and the scanning point next to the starting point is stored as the next starting point.

【0073】ステップ#4において、探索テーブルに従
い、次の輪郭点を検出する。
In step # 4, the next contour point is detected according to the search table.

【0074】ステップ#5において、オーバレイデータ
に基づいて、上記の検出された輪郭線が、探索終了条件
を満たすか否かを判定する。探索終了条件でない場合
は、ステップ#4に戻り、探索終了条件であれば、ステ
ップ#6に進む。
In step # 5, it is determined based on the overlay data whether or not the detected contour line satisfies the search end condition. If it is not the search end condition, the process returns to step # 4, and if it is the search end condition, the process proceeds to step # 6.

【0075】ステップ#6において、引き続いて画像輪
郭線の終端まで走査し、他の始点があるか否かを判定す
る。他の始点があれば、ステップ#3に戻り、他の始点
がなければ、走査を終了し、ステップ#7に進む。
In step # 6, scanning is continued up to the end of the image contour line, and it is determined whether or not there is another starting point. If there is another starting point, the process returns to step # 3, and if there is no other starting point, the scanning is ended and the process proceeds to step # 7.

【0076】ステップ#7において、検出した画像輪郭
線の曲率計算を行い、その結果に基づいて特徴点を検出
する。
In step # 7, the curvature of the detected image contour line is calculated, and the feature point is detected based on the result.

【0077】ステップ#8において、検出した特徴点間
の輪郭長と角度とを、輪郭線毎に順次累積演算した結果
を距離角度累積演算結果として記憶する。
In step # 8, the result of sequentially cumulatively calculating the contour length and the angle between the detected feature points for each contour line is stored as a distance angle cumulative calculation result.

【0078】ステップ#9において、登録したテンプレ
ートの距離角度累積演算基準データを、特徴点毎にシフ
トしながら、前記の距離角度累積演算結果と照合し、最
適な照合位置を検出し終了する。
In step # 9, the distance-angle cumulative calculation reference data of the registered template is checked against the above-mentioned distance-angle cumulative calculation result while shifting for each feature point, the optimum matching position is detected, and the process ends.

【0079】[0079]

【発明の効果】本発明の位置検出方法は、輪郭線追跡の
始点の走査検出と輪郭線追跡の終了点の検出とを、プロ
グラムで順次処理する代わりに、既使用の始点や既検出
の画像輪郭点を画像データに座標を重ね合わせて記憶さ
せたオーバレイメモリを利用して処理を単純化し、単純
化するにもかかわらず、従来技術ではできなかった、開
いた画像の輪郭線の追跡と、画像の内側にある閉じた輪
郭線の検出をすることができるという効果を奏する。
According to the position detecting method of the present invention, instead of sequentially processing the scanning of the starting point of contour line tracing and the detection of the ending point of contour line tracing by a program, a used starting point or an already detected image is detected. Tracking the contour line of an open image, which was not possible with the conventional technique, even though the processing is simplified by using the overlay memory in which the coordinates of the contour point are stored by superimposing the coordinates on the image data, and It is possible to detect a closed contour line inside the image.

【0080】又、検出した輪郭線の特徴点を曲率計算に
よって検出し、これらの特徴点間の距離角度累積演算結
果を用いて形状照合して物体の位置を検出することによ
り、汎用性を有し、他の部分に影やノイズがあっても、
正確に位置検出ができるという、耐ノイズ性が高い位置
検出が可能になるという効果を奏する。
Further, the feature points of the detected contour line are detected by curvature calculation, and the position of the object is detected by performing shape matching using the distance angle cumulative calculation result between these feature points, thereby providing versatility. However, even if there are shadows and noise in other parts,
This has the effect of enabling accurate position detection, which enables position detection with high noise resistance.

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

【図1】本発明の動作を示す図である。FIG. 1 is a diagram showing an operation of the present invention.

【図2】本発明の探索方向順を示す図である。FIG. 2 is a diagram showing a search direction order of the present invention.

【図3】閉じた画像と開いた画像とを示す図である。FIG. 3 is a diagram showing a closed image and an opened image.

【図4】閉じた画像と開いた画像の参照点を示す図であ
る。
FIG. 4 is a diagram showing reference points of a closed image and an open image.

【図5】閉じた画像の前参照点と現参照点と背景点とを
示す図である。
FIG. 5 is a diagram showing previous reference points, current reference points, and background points of a closed image.

【図6】開いた画像の前参照点と現参照点と背景点とを
示す図である。
FIG. 6 is a diagram showing previous reference points, current reference points, and background points of an opened image.

【図7】本発明の前参照点と現参照点と探索方向とを示
す図である。
FIG. 7 is a diagram showing a previous reference point, a current reference point, and a search direction according to the present invention.

【図8】本発明を使用する位置検出装置の第1実施例の
構成を示すブロック図である。
FIG. 8 is a block diagram showing a configuration of a first embodiment of a position detecting device using the present invention.

【図9】図8の一部詳細図である。9 is a partial detailed view of FIG. 8. FIG.

【図10】第1実施例の特徴点検出部の詳細ブロック図
である。
FIG. 10 is a detailed block diagram of a feature point detection unit of the first embodiment.

【図11】第1実施例の輪郭データ記憶部に記憶された
輪郭線の平面図である。
FIG. 11 is a plan view of a contour line stored in a contour data storage unit of the first embodiment.

【図12】第1実施例における距離角度累積演算結果の
平面図である。
FIG. 12 is a plan view of a distance angle cumulative calculation result in the first embodiment.

【図13】第1実施例において位置照合に用いるテンプ
レートとその距離角度累積演算基準データの平面図であ
る。
FIG. 13 is a plan view of a template used for position matching and its distance angle cumulative calculation reference data in the first embodiment.

【図14】本発明を使用する位置検出装置の第2実施例
の構成を示すブロック図である。
FIG. 14 is a block diagram showing the configuration of a second embodiment of the position detecting device using the present invention.

【図15】第2実施例の動作を示すフローチャートであ
る。
FIG. 15 is a flowchart showing the operation of the second embodiment.

【図16】従来例の動作を示す図である。FIG. 16 is a diagram showing an operation of a conventional example.

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

A 画像窓枠 B 対象物の画像 C 所定位置 D、E、F 内部の輪郭線 G 画像輪郭点(始点) H 輪郭線追跡 I 外側画像輪郭線 101 画像入力部 102 画像記憶部 103 DMA部 104 輪郭点探索部 105 アドレス算出部 106 輪郭データ記憶部 107 制御部 108 特徴点検出部 109 距離角度累積演算部 110 形状照合部 111 曲率値算出部 112 曲率値比較部 113 特徴点記憶部 1101 画像入力部 1102 画像記憶部 1103 CPU 1104 一時記憶部 A image window frame B image of object C predetermined position D, E, F inner contour line G image contour point (starting point) H contour line tracing I outer image contour line 101 image input unit 102 image storage unit 103 DMA unit 104 contour Point search unit 105 Address calculation unit 106 Contour data storage unit 107 Control unit 108 Feature point detection unit 109 Distance angle cumulative calculation unit 110 Shape matching unit 111 Curvature value calculation unit 112 Curvature value comparison unit 113 Feature point storage unit 1101 Image input unit 1102 Image storage unit 1103 CPU 1104 Temporary storage unit

フロントページの続き (51)Int.Cl.6 識別記号 庁内整理番号 FI 技術表示箇所 G06T 7/00 9/20 7459−5L G06F 15/70 335 Z Continuation of front page (51) Int.Cl. 6 Identification code Office reference number FI Technical display location G06T 7/00 9/20 7459-5L G06F 15/70 335 Z

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 第1ステップにおいて、画像記憶手段に
記憶した2値化画像データを線順次に走査し、画像輪郭
点に到達した位置で走査を一旦停止し、第2ステップに
おいて、前記到達した画像輪郭点を、それまでの既検出
画像輪郭点を記憶しているオーバレイメモリによって、
既検出か未検出かを判断し、既検出であれば走査を再開
し、未検出であれば前記到達した画像輪郭点を、始点と
して前記オーバレイメモリに記憶させ、第3ステップに
おいて、前記始点を第1参照点として前記2値化画像デ
ータについて輪郭線追跡を始め、第1参照点では到着方
向番号が7の、第2参照点以降では前参照点から現参照
点へ向かう方向である到着方向番号の画像輪郭点探索方
向番号表を、その参照点への到着方向番号別に決まるそ
の参照点での探索方向順を8つの到着方向番号別に決め
た画像輪郭点探索方向番号表から選択し、選択した画像
輪郭点探索方向番号表の探索方向順に基づいて前記2値
化画像をアクセスして次の画像輪郭点を検出して前記オ
ーバレイメモリに記憶させ、第4ステップにおいて、前
記オーバレイメモリに記憶されている前記始点および既
検出画像輪郭点のデータを、現参照点の周囲の8近傍点
についてアクセスし、このアクセス結果で、第3ステッ
プで検出された画像輪郭点が未検出か既検出かを判断
し、第5ステップにおいて、未検出であれば、前記第3
〜第4ステップを繰り返し、既検出であれば、第3ステ
ップで検出された画像輪郭点は輪郭線追跡終了点である
ので、現輪郭線追跡を終了して第1ステップに戻り、前
記始点の次の点から走査を続け、第6ステップにおい
て、上記線順次走査が2値化画像の下端に達したときに
総ての輪郭線追跡を終了し、第7ステップにおいて、こ
れまでに検出した各輪郭線の曲率を計算し曲率に基づく
特徴点を検出し、第8ステップにおいて、前記特徴点間
の輪郭線長と角度とを各輪郭線毎に順次累積演算して距
離角度累積演算結果を記憶し、第9ステップにおいて、
予め登録してある対象物の形状に関する距離角度累積演
算基準データと、前記距離角度累積演算結果とを、特徴
点毎に照合しながらシフトし最適な照合位置を検出する
ことを特徴とする位置検出方法。
1. In the first step, the binary image data stored in the image storage means is line-sequentially scanned, and the scanning is temporarily stopped at the position where the image contour point is reached. The image contour points are stored in the overlay memory that stores the previously detected image contour points.
Whether it is already detected or not is detected. If it is already detected, scanning is restarted. If it is not detected, the reached image contour point is stored in the overlay memory as a start point, and in the third step, the start point is determined. The contour line tracking is started for the binarized image data as the first reference point, and the arrival direction number is 7 at the first reference point, and the arrival direction is the direction from the previous reference point to the current reference point after the second reference point. Select the image contour point search direction number table of the number from the image contour point search direction number table that determines the search direction order at the reference point that is determined for each of the eight arrival direction numbers Based on the search direction order of the image contour point search direction number table, the binarized image is accessed to detect the next image contour point and stored in the overlay memory. In the fourth step, the overlay memo is stored. The data of the start point and the already detected image contour point stored in the above are accessed for eight neighboring points around the current reference point, and the access result indicates whether the image contour point detected in the third step is undetected or not detected. If it is not detected in the fifth step, it is judged in the third step.
~ Repeating the fourth step, if already detected, the image contour point detected in the third step is the contour line tracking end point, so the current contour line tracking is terminated and the procedure returns to the first step to return to the start point. Scanning is continued from the next point, and in the sixth step, when the line sequential scanning reaches the lower end of the binarized image, all contour line tracing is completed, and in the seventh step, each of the detected contour lines is detected. The curvature of the contour line is calculated, and the characteristic points based on the curvature are detected. In the eighth step, the contour line length and the angle between the characteristic points are sequentially cumulatively calculated for each contour line, and the distance / angle cumulative calculation result is stored. Then, in the ninth step,
Position detection characterized by shifting the distance angle cumulative calculation reference data relating to the shape of an object registered in advance and the distance angle cumulative calculation result while matching each feature point to detect an optimum matching position. Method.
JP6009274A 1994-01-31 1994-01-31 Position detection method Pending JPH07220089A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP6009274A JPH07220089A (en) 1994-01-31 1994-01-31 Position detection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP6009274A JPH07220089A (en) 1994-01-31 1994-01-31 Position detection method

Publications (1)

Publication Number Publication Date
JPH07220089A true JPH07220089A (en) 1995-08-18

Family

ID=11715889

Family Applications (1)

Application Number Title Priority Date Filing Date
JP6009274A Pending JPH07220089A (en) 1994-01-31 1994-01-31 Position detection method

Country Status (1)

Country Link
JP (1) JPH07220089A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005346391A (en) * 2004-06-02 2005-12-15 Toyota Motor Corp Object recognition method
WO2012160611A1 (en) * 2011-05-26 2012-11-29 富士通テレコムネットワークス株式会社 Position detecting apparatus, and appearance inspection apparatus having position detecting apparatus mounted therein

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005346391A (en) * 2004-06-02 2005-12-15 Toyota Motor Corp Object recognition method
WO2012160611A1 (en) * 2011-05-26 2012-11-29 富士通テレコムネットワークス株式会社 Position detecting apparatus, and appearance inspection apparatus having position detecting apparatus mounted therein
JP5671135B2 (en) * 2011-05-26 2015-02-18 富士通テレコムネットワークス株式会社 Position detecting device and visual inspection device equipped with the same

Similar Documents

Publication Publication Date Title
EP1678659B1 (en) Method and image processing device for analyzing an object contour image, method and image processing device for detecting an object, industrial vision apparatus, smart camera, image display, security system, and computer program product
US7403634B2 (en) Object tracking apparatus and method
JP3170299B2 (en) Image reading processing device
US7340089B2 (en) Geometric pattern matching using dynamic feature combinations
US5001765A (en) Fast spatial segmenter for handwritten characters
US5414228A (en) Handwritten character input device
CN113673518A (en) Target positioning candidate position screening strategy method
KR0145256B1 (en) Position detection method
JPH0765179A (en) Contour detection method
JPH024950B2 (en)
JP2001076142A (en) Fingerprint image collation method and apparatus, and recording medium recording this method
JPH01271883A (en) Detecting system for center of fingerprint
JPH06243256A (en) Position detector
CA2000023C (en) Fast spatial segmenter for handwritten characters
JPH06131467A (en) Position detection method
JPH06131459A (en) Contour detection method
JPH0132549B2 (en)
JP3077929B2 (en) Character extraction method
Sumi et al. Automated inspection vision using gray-level image
JPH05135208A (en) Online character recognition method and online character recognition device
JP2818317B2 (en) Fingerprint registration collation method
JPS589471B2 (en) link link
KR940011699B1 (en) Contour Extraction Method of Binary Image
JPH09282453A (en) Location recognition method
CN121191187A (en) A method for identifying dimensional data in design drawings