JPH08101913A - Method and device for indicating coordinate of circular inspection object area and inspection device using same device - Google Patents

Method and device for indicating coordinate of circular inspection object area and inspection device using same device

Info

Publication number
JPH08101913A
JPH08101913A JP6259751A JP25975194A JPH08101913A JP H08101913 A JPH08101913 A JP H08101913A JP 6259751 A JP6259751 A JP 6259751A JP 25975194 A JP25975194 A JP 25975194A JP H08101913 A JPH08101913 A JP H08101913A
Authority
JP
Japan
Prior art keywords
area
access
circular
coordinate
center
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP6259751A
Other languages
Japanese (ja)
Other versions
JP3362191B2 (en
Inventor
Suguru Ishihara
英 石原
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.)
Omron Corp
Original Assignee
Omron Corp
Omron Tateisi Electronics Co
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 Omron Corp, Omron Tateisi Electronics Co filed Critical Omron Corp
Priority to JP25975194A priority Critical patent/JP3362191B2/en
Publication of JPH08101913A publication Critical patent/JPH08101913A/en
Application granted granted Critical
Publication of JP3362191B2 publication Critical patent/JP3362191B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
  • Image Input (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

PURPOSE: To provide a coordinate indication method capable of performing coordinate access for performing a prescribed inspection by using an area (model picture) smaller than an inspection object area at a high speed. CONSTITUTION: For picture data obtained by picking up the image of an object K provided with a circular inspection object area, a window W in contact with the X axis of an orthogonal coordinate system is set, the circular inspection object area is parallelly moved and the center O is positioned at an original point (0, 0.) Also, it is rotated for a prescribed angle, an affine transformation parameter for which the picture data inside divided areas divided by each prescribed angle with the center of the circle as a reference are virtually present inside the window is used, affin transformation is performed to coordinate input in an access area and the picture data inside the corresponding prescribed divided area are accessed. Thus, for the instruction of coordinates, by specifying only the coordinate inside the window at all times and performing the affin transformation based on the entire angle θ, the entire inspection object area is made accessible.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、円形検査対象領域の座
標指示方法及び装置並びにその装置を用いた検査装置に
関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a coordinate pointing method and apparatus for a circular inspection target area and an inspection apparatus using the apparatus.

【0002】[0002]

【従来の技術】例えば、製品の外観上の欠陥の有無を検
査する視覚検査装置では、検査対象物をカメラで撮像
し、得られた画像データと、予め登録しておいた比較対
象となる基準画像とを比較(パターン認識)し、一致す
るか否かを判断するようにしている。
2. Description of the Related Art For example, in a visual inspection apparatus for inspecting a product for defects in appearance, an image of an object to be inspected is picked up by a camera, and the obtained image data is compared with a reference to be registered in advance. The image is compared (pattern recognition) to determine whether or not they match.

【0003】[0003]

【発明が解決しようとする課題】ところで、比較対象と
して登録する基準画像は、検査対象領域と同一の形状と
なり、検査対象領域が大きくなると、それにともない基
準画像も大きくなる。その結果、係る基準画像を記憶し
ておくメモリ容量も大きなものが必要となる。
By the way, the reference image registered as the comparison target has the same shape as the inspection target area, and the larger the inspection target area, the larger the reference image accordingly. As a result, a large memory capacity for storing the reference image is required.

【0004】また、通常は前記登録する基準画像は、正
常(良品)な製品(対象物)を撮像し、その撮像した画
像データ中の検査対象領域を抽出し、それを所定の記憶
手段に登録するが、係る抽出は、検査対象領域を含む矩
形状の領域(n×mの局所領域)を指定することになる
ので、例えば検査対象領域がリング状の場合には、中央
部分は検査用のモデル画像としては不要な部分となるに
もかかわらず、その部分に対してもメモリを使用するこ
とになり、メモリ使用効率が悪い。
[0004] Normally, the reference image to be registered captures a normal (non-defective) product (object), extracts an inspection target area in the captured image data, and registers it in a predetermined storage means. However, since such extraction specifies a rectangular region (n × m local region) including the inspection target region, for example, when the inspection target region is a ring, the central portion is for inspection. Although it becomes an unnecessary part as a model image, the memory is also used for that part, and the memory use efficiency is poor.

【0005】さらには、係る認識処理は、処理対象の対
象物が、基準画像と一致するか否かが判定されるだけ
で、検査対象領域の中のどの部分が一致しないかまでの
判断はできなかった。
Furthermore, in the recognition process, it is only determined whether the object to be processed matches the reference image, and it is possible to determine which part in the inspection area does not match. There wasn't.

【0006】本発明は、上記した背景に鑑みてなされた
もので、その目的とするところは、上記した問題点を解
決し、検査対象領域よりも小さな領域からなるモデル画
像を用いて所定の認識・検査処理を行うことができ、基
準画像のメモリ使用効率を高め、処理対象の対象物上の
汚れや欠け・バリ等の基準画像と異なる位置を検出する
ことができ、また、係る新たな構成を用いつつ高速処理
が行え、認識・検査処理のために撮像した画像データ中
のデータ読み出しの制御アルゴリズムが簡単で、構成も
簡略化することのできる円形検査対象領域の座標指示方
法及び装置並びにその装置を用いた検査装置を提供する
ことにある。
The present invention has been made in view of the above background, and an object of the present invention is to solve the above problems and perform a predetermined recognition by using a model image composed of an area smaller than an inspection target area. -Inspection processing can be performed, the memory efficiency of the reference image can be improved, and a position different from the reference image such as stains, chips, burrs on the object to be processed can be detected. And a method and apparatus for designating coordinates of a circular inspection target area, which has a simple control algorithm for reading data in image data captured for recognition / inspection processing and can be simplified in structure, An object is to provide an inspection device using the device.

【0007】[0007]

【課題を解決するための手段】上記した目的を達成する
ために、本発明に係る円形検査対象領域の座標指示方法
では、円形の検査対象領域を持つ対象物を撮像して得ら
れた画像データに対し、直交座標系の直交軸のいずれか
1方と平行になるアクセス領域を設定し、前記円形の検
査対象領域を、少なくとも回転移動させることによりそ
の円形の中心を基準に所定角度毎に分割した分割領域内
の画像データが前記アクセス領域に仮想的に存在するよ
うなアフィン変換パラメータを用い、前記アクセス領域
中の座標入力に対してアフィン変換を行い、対応する前
記所定の分割領域内の画像データをアクセスするように
した。
In order to achieve the above-mentioned object, in the coordinate pointing method for a circular inspection target area according to the present invention, image data obtained by imaging an object having a circular inspection target area. On the other hand, an access area that is parallel to any one of the orthogonal axes of the orthogonal coordinate system is set, and the circular inspection target area is at least rotationally moved to divide the circular inspection area at predetermined angles based on the center of the circle. Using the affine transformation parameter such that the image data in the divided area virtually exists in the access area, the affine transformation is performed on the coordinate input in the access area, and the corresponding image in the predetermined divided area I tried to access the data.

【0008】そして、好ましくは、前記アクセス領域の
1辺が、前記直交軸のいずれか1方と接し、かつ、前記
円形の検査対象領域を平行移動させてその円形の中心が
直交座標系の原点に位置させるとともに所定角度回転さ
せた時に、前記分割領域が前記アクセス領域に仮想的に
存在するような所定位置に前記アクセス領域を設定し、
前記アフィン変換パラメータが、前記円形の検査対象領
域を、平行移動及び回転移動させることにより前記分割
領域内の画像データが前記アクセス領域に仮想的に存在
するように決定することである。
Preferably, one side of the access area is in contact with any one of the orthogonal axes, and the circular inspection area is translated so that the center of the circle is the origin of the orthogonal coordinate system. The access area is set to a predetermined position such that the divided area is virtually present in the access area when rotated at a predetermined angle while being positioned at
The affine transformation parameter is to determine that the image data in the divided area is virtually present in the access area by moving the circular inspection area in parallel and rotating.

【0009】そして、上記方法を実施するために適した
本発明に係る指示装置では、円形の検査対象領域を持つ
対象物が撮像された画像データを格納する画像メモリ
と、前記円形の検査対象領域をその円形の中心を基準に
所定角度毎に分割した分割領域内の画像データをアクセ
スするアクセス手段とを備え、前記アクセス手段が、ア
フィン変換を用い、少なくとも前記円形の中心を基準に
前記所定角度毎に回転させ、アクセス領域が直交座標系
の直交軸のいずれか一方と平行になるように前記アクセ
ス手段に対してアフィン変換パラメータを設定するパラ
メータ設定手段とから構成した。
In the pointing device according to the present invention suitable for carrying out the above method, an image memory for storing image data of an object having a circular inspection target area, and the circular inspection target area are stored. And an access means for accessing image data in a divided area obtained by dividing the circle by a predetermined angle with respect to the center of the circle, the access means using affine transformation, and the predetermined angle based on at least the center of the circle. And an affine transformation parameter for the access means so that the access area is parallel to one of the orthogonal axes of the orthogonal coordinate system.

【0010】さらに、円形の検査対象領域を持つ対象物
が撮像された画像データを格納する画像メモリと、前記
円形の検査対象領域をその円形の中心を基準に所定角度
毎に分割した分割領域内の画像データをアクセスするア
クセス手段とを備え、前記アクセス手段が、アフィン変
換を用い、前記円形の中心を直交座標系の原点位置に平
行移動するとともに、その円形の中心を基準に前記所定
角度毎に回転させ、アクセス領域が直交座標系の直交軸
のいずれか一方に接するように前記アクセス手段に対し
てアフィン変換パラメータを設定するパラメータ設定手
段とから構成するとなおよい。
Further, an image memory for storing image data of an object having a circular inspection target area, and a divided area obtained by dividing the circular inspection target area at a predetermined angle with the center of the circle as a reference. Access means for accessing the image data of, the access means uses affine transformation to translate the center of the circle in parallel to the origin position of the Cartesian coordinate system, and at the predetermined angle based on the center of the circle. It is more preferable to include a parameter setting unit for rotating the affine transformation parameter and setting the affine transformation parameter for the access unit so that the access region contacts one of the orthogonal axes of the orthogonal coordinate system.

【0011】そして、上記各装置において、前記円形の
検査対象領域が、中心を同じにした2つの円形ウインド
ウの重なる領域とすることができ、また、前記アクセス
領域に所定のマスク領域を付加するようにしてもよい。
In each of the above devices, the circular inspection target area may be an overlapping area of two circular windows having the same center, and a predetermined mask area may be added to the access area. You may

【0012】さらに本発明に係る検査装置では、上記し
たいずれかの円形領域の座標指示装置を有し、前記分割
領域に対応する比較基準データを有するモデルメモリ
と、前記アクセス領域中の所定座標を指示する座標指示
手段と、前記座標指示手段により指示された座標に基づ
いて前記アクセス手段により求められた画像メモリ中の
分割領域中の画像データを前記モデルメモリに記憶され
た比較基準データとマッチングをとる認識手段とから構
成するようにした。
Further, in the inspection apparatus according to the present invention, any one of the above circular area coordinate pointing devices is provided, and a model memory having comparison reference data corresponding to the divided areas and predetermined coordinates in the access area are stored. The image data in the divided area in the image memory obtained by the access means based on the coordinate instructing means for instructing and the coordinates instructed by the coordinate instructing means is matched with the comparison reference data stored in the model memory. The recognition means is used.

【0013】[0013]

【作用】直交座標系の一方の軸と平行に設定したアクセ
ス領域中の座標を順次指定すると、それに基づいて所定
のアフィン変換パラメータにしたがってアフィン変換を
行う。すると、画像メモリに格納された対象物中の所定
の分割領域のアドレスがアクセス手段により出力され
る。
When the coordinates in the access area set parallel to one axis of the orthogonal coordinate system are sequentially designated, the affine transformation is performed based on the designated coordinates according to the predetermined affine transformation parameter. Then, the address of the predetermined divided area in the object stored in the image memory is output by the access means.

【0014】したがって、そのアドレスに基づいて画像
メモリをアクセスすると、所定の画像データが読み出さ
れ、これは、対象物の画像をその円の中心を基準に、所
定角度毎に回転させることにより、対象物の一部の領域
ずつ順に上記アクセス領域内に仮想的に移動させ、最終
的に対象物の検査対象領域の全部をアクセス領域内に仮
想的に存在させることができる。
Therefore, when the image memory is accessed on the basis of the address, predetermined image data is read out. This is because the image of the object is rotated by a predetermined angle with the center of the circle as a reference. It is possible to virtually move the partial regions of the target object into the access region in order, and finally allow the entire inspection target region of the target object to virtually exist in the access region.

【0015】また、アクセス領域は、一方の座標系と平
行になっているため、そのアクセス領域内のすべて或い
は所定の座標の指示は、例えばラスタ方向に順次指示す
るようにすると、そのアクセス領域の始点とその縦横の
幅がわかると、x座標,y座標を適宜1ずつインクリメ
ント及びリセットを繰り返すことにより、簡単に指示で
きる。
Further, since the access area is parallel to one of the coordinate systems, if all or predetermined coordinates in the access area are sequentially instructed, for example, in the raster direction, the access area will be Once the start point and its vertical and horizontal widths are known, the x and y coordinates can be easily incremented by one and repeated, and can be easily designated.

【0016】そして、アクセス領域を円の中心が直交座
標系の原点に位置するように移動させる場合に分割領域
が存在するように設定すると、アフィン変換パラメータ
が単純化されるとともに、その内の一部が定数になるの
で、より高速に座標指示が行える。
When the access area is moved so that the center of the circle is located at the origin of the Cartesian coordinate system, if the divided area is set to exist, the affine transformation parameters are simplified and one of them is set. Since the part becomes a constant, the coordinate designation can be performed faster.

【0017】そして、係る座標指示に従って画像メモリ
中の画像データを読み出すとともに、認識手段によりマ
ッチングを行うと、読み出した分割領域が、比較基準デ
ータと一致するか否かが判断される。これにより、検査
領域の全部に対して小さなモデル画像とのマッチングに
伴う検査処理が行える。そして、読み出された分割領域
は回転角度θからわかるため、一致しなかった部分(不
良部分)を簡単に検出される。
Then, when the image data in the image memory is read according to the coordinate instruction and the matching is performed by the recognition means, it is determined whether or not the read divided area matches the comparison reference data. As a result, the inspection process accompanying the matching with the small model image can be performed on the entire inspection region. Then, since the read divided areas can be known from the rotation angle θ, the non-matching portion (defective portion) can be easily detected.

【0018】[0018]

【実施例】以下、本発明に係る円形検査対象領域の座標
指示方法及び装置並びにその装置を用いた検査装置の好
適な実施例を添付図面を参照にして詳述する。本発明
は、円形(円及び中央が抜けているリング状も含む)の
検査対象領域をもつ対象物に対する認識・検査処理を行
うための各種装置及び方法に関するもので、本実施例で
は、平座金全体やボトルのキャップ,飲料水用の罐及び
罐詰め等の円形の底面または天面を有する物体の係る天
面等の周縁部分等のリング状の検査対象領域を有する物
体に対する検査装置及びそれに実装される円形領域の座
標指示装置について適用した例を示している。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS A preferred embodiment of a method and apparatus for pointing coordinates of a circular inspection target area according to the present invention and an inspection apparatus using the apparatus will be described in detail with reference to the accompanying drawings. The present invention relates to various devices and methods for performing recognition / inspection processing on an object having a circular (including a circle and a ring shape with a missing center) inspection object. In the present embodiment, a flat washer is used. Inspection device for an object having a ring-shaped area to be inspected, such as a peripheral portion such as the top surface of an object having a circular bottom surface or a top surface such as the whole or a bottle cap, a can for drinking water and canning, and mounting it The example applied to the coordinate pointing device of the circular area is shown.

【0019】そして、対象物についてさらに詳述する
と、例えば平座金や缶詰の底等のように、上記円形の検
査対象領域全体に渡って、無模様である等の特徴量が均
一(模様などがあっても特徴量として抽出されない場合
も含む)になっていたり、或いは、歯車等のように、全
周に渡って特徴量が均一ではなくても、一定の回転角度
毎に繰り返し同一の特徴量データ(画像データ)が現わ
れるようになっているものが処理対象物となる。そし
て、係る検査対象領域が、上記条件になっていれば、対
象物自体の形状は必ずしも円形になっている必要はな
い。
The object will be described in more detail. For example, a flat washer or the bottom of a can of food, such as a flat washer or the like, has a uniform feature amount such as no pattern (the pattern is Even if it is not extracted as a feature amount), or even if the feature amount is not uniform over the entire circumference such as a gear, the same feature amount is repeated every fixed rotation angle. The object whose data (image data) appears is the object to be processed. If the inspection target area satisfies the above conditions, the shape of the target object does not necessarily have to be circular.

【0020】次に、本実施例の装置について説明する
と、図1に示すように、まず、対象物をカメラ1で撮像
し、得られた画像(ビデオ信号)をA/D変換器2にて
デジタル信号に変換後、画像メモリ3に格納するように
し、さらに画像メモリ3に格納された画像データをD/
A変換器4にてビデオ信号に再変換してモニタ5に出力
するようにしている。そして、画像メモリ3内への画像
取り込みは、対象物が、カメラ1の撮像領域内に存在し
ている間の所定のタイミングで行うようになる。これに
より、例えば、製造ラインの搬出側コンベア上をランダ
ムに搬送される対象物であっても、ある瞬間の画像デー
タを取り込むことにより、モニタ5には対象物の全体が
表示された静止画像として出力されるようになる。
Next, the apparatus of the present embodiment will be described. As shown in FIG. 1, first, an object is imaged by the camera 1, and the obtained image (video signal) is A / D converter 2. After being converted into a digital signal, the image data is stored in the image memory 3, and the image data stored in the image memory 3 is D /
The A converter 4 converts the video signal again and outputs the video signal to the monitor 5. Then, the image is taken into the image memory 3 at a predetermined timing while the object is present in the image pickup area of the camera 1. As a result, for example, even if an object is randomly transported on the unloading side conveyor of the manufacturing line, by capturing image data at a certain moment, the monitor 5 displays a still image of the entire object. It will be output.

【0021】ここで本発明では、CPU6からの制御信
号に基づいて、画像メモリ3に格納された所定の領域の
画像データをアクセス手段たるアフィン変換部8に送
り、そこにおいて所定のアフィン変換を行い、所定のア
ドレスに格納された画素データを読み出し、マッチング
処理部8にて所定の特徴量抽出を行ったり、モデルメモ
リ9に格納されたモデル画像と比較する等の所定の認識
処理を行い、その認識結果をCPU6に出力するように
なっている。
Here, in the present invention, based on a control signal from the CPU 6, the image data of a predetermined area stored in the image memory 3 is sent to the affine transformation section 8 as an access means, and a predetermined affine transformation is performed there. , The pixel data stored at a predetermined address is read, a predetermined feature amount is extracted by the matching processing unit 8, a predetermined recognition process such as comparison with a model image stored in the model memory 9 is performed, and The recognition result is output to the CPU 6.

【0022】そして、画像メモリ3内には、図2に示す
ようにリング状の対象物Kが取り込まれる。また、モデ
ルメモリ9内には、所定の比較基準値(平均濃度などの
数値データ及び図示のようなリング状の対象物Kの一部
(所定角度分)を示すモデル画像M等)が格納されてい
る。なお、図示の例では便宜上モデル画像Mを拡大して
示している。
Then, a ring-shaped object K is taken into the image memory 3 as shown in FIG. Further, a predetermined comparison reference value (numerical data such as average density and a model image M showing a part (for a predetermined angle) of the ring-shaped object K as shown in the figure) is stored in the model memory 9. ing. In the illustrated example, the model image M is enlarged for convenience.

【0023】そして、画像メモリ3に格納された対象物
Kのうち座標(Xs,Ys)を始点としてWX ×WY の
矩形状のアクセス領域たるウインドウWに存在する画像
データを読出してマッチング処理部8に送り、そこにお
いてウインドウ内に存在する所定の画素の濃淡データを
取得し、積算するとともにその後平均濃度を求め、その
演算結果をCPU6に出力するようにしている。また、
平均濃度算出とともにまたはそれに替えてモデル画像と
所定のパターンマッチングを行うようにしてもよく、係
る場合にはその一致度データも出力されることになる。
なお、上記ウインドウWの設定位置は、直交座標系を構
成するX軸またはY軸の少なくとも一方と平行になって
いれば、その設置位置は図示のように角度0度の位置に
限ることなく任意である。
Then, of the object K stored in the image memory 3, the image data existing in the window W, which is a rectangular access area of WX × WY from the coordinates (Xs, Ys) as a starting point, is read out and the matching processing section 8 is read. To obtain the density data of a predetermined pixel existing in the window, integrate the data, and then calculate the average density, and output the calculation result to the CPU 6. Also,
A predetermined pattern matching may be performed with the model image in addition to or instead of calculating the average density, and in such a case, the matching degree data is also output.
If the setting position of the window W is parallel to at least one of the X axis and the Y axis forming the Cartesian coordinate system, the installation position is not limited to the position at an angle of 0 degree as shown in the drawing Is.

【0024】また、係る平均濃度を求める際に、ウイン
ドウW中に所定のマスクをかけ、例えばモデル画像中の
対象物以外の領域M1に相当する部分は読み取らない
(積算しない)ようにしてもよい。そして、係るマスク
を設ける領域M1は、例えば対象物上の汚れや欠けを検
出する場合には、対象物の外形とほぼ等しく設定すれば
よく、また、対象物の周縁に形成されたバリ等を検出す
る場合には、対象物の外形よりも一回り大きい領域が処
理(積算)対象領域になるように設定するなど、その画
像処理の用途等に基づいて適宜変更実施される。
Further, when obtaining the average density, a predetermined mask may be applied to the window W so that, for example, a portion corresponding to the region M1 other than the object in the model image is not read (not integrated). . The area M1 in which the mask is provided may be set to have substantially the same shape as the outer shape of the object when, for example, detecting stains or chips on the object. In the case of detection, a region that is slightly larger than the outer shape of the target object is set as the processing (integration) target region, and the change is appropriately performed based on the application of the image processing.

【0025】さらに、対象物Kの画像を円の中心Oを基
準に、所定角度毎に回転させることにより、対象物Kの
一部の領域ずつ順に上記ウインドウW内に仮想的に移動
させ、最終的に対象物Kの検査領域(本例では対象物全
体)の全部をウインドウ内に位置させ、モデルメモリ9
に格納したモデル画像とのマッチングを行なう。これに
より、検査領域の全部に対して小さなモデル画像とのマ
ッチングに伴う検査処理が行える。
Further, by rotating the image of the object K by a predetermined angle with the center O of the circle as a reference, a partial area of the object K is virtually moved into the window W sequentially, and finally, The entire inspection area of the object K (the entire object in this example) is positioned within the window, and the model memory 9
Matches with the model image stored in. As a result, the inspection process accompanying the matching with the small model image can be performed on the entire inspection region.

【0026】そして、対象物Kの各部分を係るウインド
ウW内へ順次仮想的に移動させる処理を、アフィン変換
部7からの画像メモリ中の読出すべき画素のアドレスの
指令による座標変換によって行うようにしている。
The process of virtually moving each part of the object K sequentially into the window W is performed by coordinate conversion in accordance with an instruction of the address of the pixel to be read in the image memory from the affine conversion unit 7. I have to.

【0027】すなわち、たとえば画像メモリのサイズ
が、図3に示すようにX方向の画素数がXsizeでY方向
の画素数がYsizeであったとし、左上の原点(0,0)
を登録した画像メモリ中の先頭アドレスをVPとする
と、画像メモリ中の任意の点Pの座標(x,y)が格納
される画像メモリ(CPUメモリ空間)上のアドレス
は、 アドレス=VP+y×Xsize+x となっている。
That is, assuming that the size of the image memory is, for example, the number of pixels in the X direction is Xsize and the number of pixels in the Y direction is Ysize as shown in FIG. 3, the upper left origin (0,0)
Letting VP be the start address in the image memory in which is registered, the address in the image memory (CPU memory space) where the coordinates (x, y) of an arbitrary point P in the image memory is stored is: address = VP + y × Xsize + x Has become.

【0028】そして、図4に示すように、ある円周上の
点P′(x′,y′)を、その円の中心O(xc ,yc
)を中心に角度θだけ回転移動させた時の点Pの座標
(x,y)でアクセスできるようにするための点P′の
座標は、
Then, as shown in FIG. 4, a point P '(x', y ') on a certain circumference is defined by the center O (xc, yc) of the circle.
) Is rotated by an angle θ, and the coordinates of the point P ′ for making access at the coordinates (x, y) of the point P are:

【0029】[0029]

【数1】 x′=xc +(x−xc )cos θ+(y−yc )sin θ xc −xc cos θ−yc sin θ+xcos θ+ysin θ …(1) y′=yc −xsin θ+xc sin θ+ycos θ−yc cos θ yc +xc sin θ−yc cos θ−xsin θ+ycos θ …(2) となる。X ′ = xc + (x−xc) cos θ + (y−yc) sin θxc−xc cos θ−yc sin θ + xcos θ + ysin θ (1) y ′ = yc−xsin θ + xc sin θ + ycos θ−yc cos θ yc + xc sin θ−yc cos θ−xsin θ + y cos θ (2)

【0030】ここで、 RegA=xc −xc cos θ−yc sin θ RegB=yc +xc sin θ−yc cos θ RegC=cos θ RegS=sin θ とおくと、上記式(1),(2)は、下記式のように置
き換えることができる。
When RegA = xc-xc cos θ-yc sin θ RegB = yc + xc sin θ-yc cos θ RegC = cos θ RegS = sin θ, the above equations (1) and (2) are given by It can be replaced by the following formula.

【0031】[0031]

【数2】 x′=RegA+x・RegC+y・RegS …(3) y′=RegB−x・RegS+y・RegC …(4) となり、係る点Pの画素のデータが格納されたCPUメ
モリ空間上のアドレスは、
## EQU2 ## x '= RegA + x.RegC + y.RegS (3) y' = RegB-x.RegS + y.RegC (4), and the address in the CPU memory space where the pixel data of the point P is stored. ,

【0032】[0032]

【数3】 アドレス=VP+y′Xsize+x′ …(5) となる。## EQU3 ## Address = VP + y'Xsize + x '(5)

【0033】そして、上記RegA,RegB,Reg
C,RegSは、画像メモリ中の中心座標(xc ,yc
)は固定であるので、回転させる角度θが決まると、
すべて定数になる。従って、式(3),(4)にウイン
ドウW内の点Pの座標(x,y)を入力すると、対応す
る画像メモリ中の点P′の座標(x′,y′)を求める
ことができ、さらに係る座標(x′,y′)を式(5)
に入力すると、係る点P′の濃淡データが格納された画
像メモリ中のアドレスが求まる。
Then, the above RegA, RegB, Reg
C and RegS are the center coordinates (xc, yc in the image memory.
) Is fixed, so once the rotation angle θ is determined,
All become constants. Therefore, when the coordinates (x, y) of the point P in the window W are input to the equations (3) and (4), the coordinates (x ', y') of the corresponding point P'in the image memory can be obtained. Then, the coordinate (x ′, y ′) can be calculated by the equation (5).
When input to, the address in the image memory in which the grayscale data of the point P'is stored is obtained.

【0034】そして、本例では、図2に示すように、上
記RegA,RegB,RegC,RegSの算出をC
PU6で行い、それをアフィン変換パラメータとしてア
フィン変換部7に設定し、またウインドウW中の座標
(x,y)の指定は、CPU6から処理領域を決定する
データ(ウインドウの開始点となるXs ,Ys 及びウイ
ンドウ幅(WX ,WY )をマッチング処理部8に与える
ことにより、そのマッチング処理部8が、そのウインド
ウ内の座標(x,y)を順次アフィン変換部7に与える
ようにしている。そして、この座標(x,y)の指示
は、ウインドウWをX軸,Y軸と平行に設定しているた
め、ラスタ方向に走査するようにすると、特別な座標変
換等することなく、x,yを適宜インクリメント及びリ
セットすることにより簡単に指示することができる。
Then, in this example, as shown in FIG. 2, the calculation of RegA, RegB, RegC and RegS is performed by C.
This is performed by the PU 6, is set in the affine transformation unit 7 as an affine transformation parameter, and the coordinates (x, y) in the window W are specified by the data for determining the processing area from the CPU 6 (Xs which is the start point of the window, By supplying Ys and the window width (WX, WY) to the matching processing unit 8, the matching processing unit 8 sequentially supplies the coordinates (x, y) within the window to the affine transformation unit 7. The coordinate (x, y) instruction sets the window W in parallel with the X axis and the Y axis. Therefore, when scanning is performed in the raster direction, x, y does not need special coordinate conversion. Can be easily instructed by appropriately incrementing and resetting.

【0035】そしてアフィン変換部7では、与えられた
パラメータRegA,RegB,RegC,RegS
と、座標(x,y)に基づいて、上記(3)〜(5)の
式を順次実行し、該当する画素の画像メモリ中のアドレ
スを算出するようになる。そして、係る算出されたアド
レスに基づいて画像メモリ3からデータが読み出され、
マッチング処理部8に送られるようになる。すなわち、
アフィン変換部7は、上記各式を実行する加算器及び乗
算器を適宜組み合わせて構成される。
Then, in the affine transformation unit 7, the given parameters RegA, RegB, RegC, RegS are given.
Then, based on the coordinates (x, y), the equations (3) to (5) are sequentially executed to calculate the address of the corresponding pixel in the image memory. Then, data is read from the image memory 3 based on the calculated address,
The data is sent to the matching processing unit 8. That is,
The affine transformation unit 7 is configured by appropriately combining an adder and a multiplier that execute the above equations.

【0036】そして、図2に示す画像メモリに格納され
た対象物Kに対するマッチング処理を行う場合には、上
記所定角度θを、θs からθe まで、所定間隔dθ毎に
インクリメントし、その都度ウインドウW中の座標
(x,y)を、例えばそのウインドウの左上のスタート
座標からラスタ方向に順次指定することにより、対応す
る画像メモリ3に格納された所定領域(図中ハッチング
で示す)の画像データを読み出し、それとモデル画像を
比較することになる。
Then, when performing the matching process on the object K stored in the image memory shown in FIG. 2, the predetermined angle θ is incremented from θs to θe at predetermined intervals dθ, and the window W is updated each time. By sequentially designating the coordinates (x, y) in the raster direction from the upper left start coordinate of the window, the image data of a predetermined area (shown by hatching in the figure) stored in the corresponding image memory 3 is displayed. It will read out and compare it with the model image.

【0037】そして、本例では画像メモリ中の所定領域
の平均濃度を求めるようにしたため、モデルメモリに格
納されるのは、係るウインドウの幅WX ,WY 並びに基
準となる平均濃度が格納されており、ウインドウの幅W
X ,WY は、一旦CPU6が受け取った後、マッチング
処理部8に与え、また、基準となる平均濃度はCPU6
が受け取り、マッチング処理部8では画像メモリ中の平
均濃度のみを求めその演算結果をCPU6に与え、CP
U6にてその演算結果とモデルメモリから取得した基準
の平均濃度を比較し、その差が許容範囲内か否かを判断
することになる。
In this example, since the average density of the predetermined area in the image memory is obtained, the model memory stores the widths WX and WY of the windows and the average density as a reference. , Window width W
After the CPU 6 once receives X and WY, they are given to the matching processing unit 8, and the reference average density is the CPU 6.
And the matching processing unit 8 obtains only the average density in the image memory and gives the calculation result to the CPU 6,
At U6, the calculation result is compared with the reference average density obtained from the model memory, and it is determined whether or not the difference is within the allowable range.

【0038】なお、マッチング処理部における処理とし
て、本例では平均濃度を求めるようにしたが、具体的な
マッチング(認識処理)は、種々のものを用いることが
でき、例えばモデルメモリに実際の基準となる画像デー
タ(モデル画像)を格納しておき、マッチング処理部8
にて、モデル画像に対する画像メモリ中の画像データの
一致度(適合度・類似度)を求めるようにした場合に
は、係るモデル画像は、マッチング処理部8に送られ、
マッチング処理部8では、求められた一致度等をCPU
6に与え、CPU6にてその一致度が所定のしきい値以
上か否かを判断することになるなど、使用するマッチン
グ処理のアルゴリズムにより、データの送受の経路やモ
デルメモリ7に格納する比較基準データも適宜変化す
る。
As the processing in the matching processing unit, the average density is obtained in this example, but various kinds of concrete matching (recognition processing) can be used. Image data (model image) to be stored in advance, and the matching processing unit 8
When the matching degree (fitness / similarity) of the image data in the image memory with respect to the model image is obtained, the model image is sent to the matching processing unit 8.
In the matching processing unit 8, the obtained matching degree and the like are calculated by the CPU.
6, the CPU 6 determines whether or not the degree of coincidence is greater than or equal to a predetermined threshold value, and the comparison criteria stored in the model memory 7 or the data transmission / reception path depending on the algorithm of the matching process used. The data also changes accordingly.

【0039】そして、その時の具体的なCPU6の処
理、すなわち、本発明に係る指示方法の一実施例は、図
5に示すフローチャートのように、まず、撮像した画像
メモリ中の対象物の存在位置を特定し、その中心座標
(xc ,yc )を求め、それに基づいてウインドウの開
始点(Xs ,Ys )を求める。すなわち、中心座標は、
例えばエッジ抽出のアルゴリズムに基づいて対象物Kの
内周または外周を検出し、その直径の中点を求めること
により決定できる。そして、係る直径は、例えばX軸方
向に走査した時に検出される上記一対のエッジ(円の水
平方向両端部分)の間隔を求め、その値が最大に離れて
いる時が、その円の直径と判定できる。なお、係る中心
の検出は、本例ではCPUによるソフトで稼働させた
が、ハードウエアで構成してもよく、また係る検出のた
めのアルゴリズムは、上記したものに限ることなく種々
の対応をとることができる。
Then, in the concrete processing of the CPU 6 at that time, that is, one embodiment of the instruction method according to the present invention, as shown in the flowchart of FIG. Is specified, the center coordinates (xc, yc) thereof are calculated, and the start point (Xs, Ys) of the window is calculated based on the calculated center coordinates (xc, yc). That is, the center coordinates are
For example, it can be determined by detecting the inner circumference or the outer circumference of the object K based on an edge extraction algorithm and determining the midpoint of the diameter. For the diameter, for example, the interval between the pair of edges (horizontal both ends of the circle) detected when scanning in the X-axis direction is obtained, and when the value is the maximum, the diameter is the diameter of the circle. You can judge. In addition, although the detection of the center is operated by the software by the CPU in this example, it may be configured by hardware, and the algorithm for the detection is not limited to the above-described one, and various measures are taken. be able to.

【0040】そして、対象物(検査対象領域)の寸法形
状は既知であるので、中心から容易に座標(Xs ,Ys
)を算出でき、係る求めた(Xs ,Ys )とともにウ
インドウ幅WX ,WY を、マッチング処理部8に設定す
る(ST1)。
Since the size and shape of the object (inspection area) is known, the coordinates (Xs, Ys) can be easily measured from the center.
) Can be calculated, and the window widths WX and WY are set in the matching processing section 8 together with the obtained (Xs, Ys) (ST1).

【0041】次いで、nをリセットするとともに、回転
角度θを決定し(ST2〜ST3)、求めたθに基づい
て、4つのアフィン変換パラメータを求め、それをアフ
ィン変換部7に設定する(ST4)。
Next, n is reset, the rotation angle θ is determined (ST2 to ST3), four affine transformation parameters are obtained based on the obtained θ, and these are set in the affine transformation unit 7 (ST4). .

【0042】そして、上記のようにして求めた各値及び
マッチング処理部8からアフィン変換部7に送られるウ
インドウ中の各画素の座標(x,y)に基づいて、その
アフィン変換部7で求められる対応する画像メモリ中の
アドレスに従い、そのアドレスに格納されたデータを読
み出してマッチング処理部8に与える。そして、マッチ
ング処理部8では、与えられた画素のデータを積算する
とともに、その積算回数で除することにより平均濃度を
求め、ウインドウ中のすべての対象画素(ウインドウ全
体または所定のマスクがかけられている場合には当該部
分を除いた領域に存在する画素)についての平均濃度算
出が終了したならば、その演算結果をCPU6が受けと
る(ST5)。なお、ウインドウ中の各座標(x,y)
の指定は、CPU6から与えるようにしてももちろんよ
い。
Then, based on each value obtained as described above and the coordinates (x, y) of each pixel in the window sent from the matching processing unit 8 to the affine transformation unit 7, the affine transformation unit 7 obtains the value. According to the corresponding address in the corresponding image memory, the data stored at that address is read and given to the matching processing unit 8. Then, the matching processing unit 8 integrates the data of the given pixels and obtains an average density by dividing the data by the number of times of integration, and all the target pixels in the window (entire window or a predetermined mask is applied). If the average density calculation is completed for the pixels existing in the area excluding the portion), the CPU 6 receives the calculation result (ST5). Each coordinate (x, y) in the window
Of course, the designation may be given from the CPU 6.

【0043】そして、CPU6は、与えられた平均濃度
が所定の基準値に対して一定の範囲内にあるか否か(良
否)を判断する。1つの領域についてのマッチング処理
が終了したならば、現在処理した回転角度θが終了角度
になっているか否かを判断し、未処理の領域が存在する
(終了角度未満)場合には、θを角度間隔dθだけイン
クリメントした(ST6,7,3)後、ステップ4以降
の処理を実行する。そして、すべての角度について実行
したならば処理を終了する。
Then, the CPU 6 determines whether or not the given average density is within a certain range with respect to a predetermined reference value (good or bad). When the matching process for one area is completed, it is determined whether the currently processed rotation angle θ is the end angle, and if there is an unprocessed area (less than the end angle), θ is set. After incrementing by the angular interval dθ (ST6, 7, 3), the processing from step 4 onward is executed. Then, if the processing is performed for all the angles, the processing ends.

【0044】このようにして、小さなモデル画像を用い
て、それにより大きな円形の検査領域をもつ対象物に対
しての検査処理が実行できる。しかも、部分的にその一
致度を検査していくため、モデル画像と異なる領域(不
良部分)が検出されたなら、その時の角度θから対象物
のどの部分に不良があったかを容易に抽出することがで
きる。そして、本実施例では、CPU6がパラメータ設
定手段を構成し、マッチング処理部8が認識手段及び座
標指示手段を構成している。
In this way, using a small model image, an inspection process can be performed on an object having a large circular inspection area. Moreover, since the degree of coincidence is partially inspected, if a region (defective portion) different from the model image is detected, it is possible to easily extract which portion of the object has a defect from the angle θ at that time. You can In the present embodiment, the CPU 6 constitutes a parameter setting means, and the matching processing section 8 constitutes a recognition means and a coordinate designating means.

【0045】一方、図6に示すように、ある円周上の点
P′(x′,y′)を、その円の中心O(xc ,yc )
を中心に角度θだけ回転移動させ、さらにその後所定方
向にdx,dyだけ平行移動した時の点Pの座標(x,
y)でアクセスできるようにするための点P′の座標
は、
On the other hand, as shown in FIG. 6, the point P '(x', y ') on a certain circumference is the center O (xc, yc) of the circle.
Is moved by an angle θ around the center, and then the coordinates (x,
The coordinates of the point P'to make it accessible in y) are

【0046】[0046]

【数4】 x′=xc +(x−xc −dx)cos θ+(y−yc −dy)sin θ =xc −(xc +dx)cos θ−(yc +dy)sin θ +xcos θ+ysin θ …(6)(4) x '= xc + (x-xc-dx) cos θ + (y-yc-dy) sin θ = xc- (xc + dx) cos θ- (yc + dy) sin θ + xcos θ + ysin θ (6)

【0047】[0047]

【数5】 y′=yc −(x−xc −dx)sin θ+(y−yc −dy)cos θ =yc −(xc +dx)cos θ−(yc +dy)sin θ −xsin θ+ycos θ …(7) となり、係る点Pの画素のデータが格納されたCPUメ
モリ空間上のアドレスは、
Y '= yc- (x-xc-dx) sin θ + (y-yc-dy) cos θ = yc- (xc + dx) cos θ- (yc + dy) sin θ-xsin θ + ycos θ (7) ), And the address in the CPU memory space where the data of the pixel at the point P is stored is

【0048】[0048]

【数6】 アドレス=VP+y′Xsize+x′ …(8) となる。なお、上記関係式は、まず平行移動により円の
中心O(xc ,yc )をdx,dyだけ平行移動した
後、その移動した円の中心を回転中心として所定角度θ
だけ回転させた場合も同様である。
## EQU6 ## Address = VP + y'Xsize + x '(8) In the above relational expression, first, the center O (xc, yc) of the circle is moved in parallel by dx, dy by the parallel movement, and then the center of the moved circle is set as the rotation center, and the predetermined angle θ is obtained.
The same is true when only rotating.

【0049】そして、図7に示すように、画像メモリ3
に格納された対象物Kの中心O(xc,yc )を、仮想的
に画像メモリの左上の原点(0,0)位置に平行移動す
るとともに、所定角度θだけ回転させることにより、マ
ッチングを行う処理領域(ウインドウW)内に仮想移動
してきた画像データと、モデル画像とを比較するように
した。
Then, as shown in FIG. 7, the image memory 3
Matching is performed by moving the center O (xc, yc) of the object K stored in the virtual image to the origin (0,0) position at the upper left of the image memory and rotating it by a predetermined angle θ. The image data virtually moved into the processing area (window W) is compared with the model image.

【0050】すると、X軸方向の移動距離dxの絶対値
は、中心OのX座標であるxc となり、Y軸方向の移動
距離dyの絶対値は、中心OのY座標であるyc とな
る。そして、共に移動方向は負の方向であるため、従っ
て、上記式(6),(7)中のdx,dyにそれぞれ−
xc ,−yc を代入すると、
Then, the absolute value of the moving distance dx in the X-axis direction is xc which is the X coordinate of the center O, and the absolute value of the moving distance dy in the Y-axis direction is yc which is the Y coordinate of the center O. Since the moving directions are both negative, therefore, dx and dy in the above equations (6) and (7) are respectively −
Substituting xc and -yc,

【0051】[0051]

【数7】 x′=xc −(xc +(−xc )cos θ−(yc +(−yc )sin θ +xcos θ+ysin θ =xc +xcos θ+ysin θ …(9)X ′ = xc− (xc + (− xc) cos θ− (yc + (− yc) sin θ + xcos θ + ysin θ = xc + xcos θ + ysin θ ... (9)

【0052】[0052]

【数8】 y′=yc −(xc +(−xc ))cos θ−(yc +(−yc ))sin θ −xsin θ+ycos θ =yc −xsin θ+ycos θ …(10) というように、簡単な演算式が得られる。そして、上記
式(9),(10)を上記した回転のみする場合の実施
例と同様に、アフィン変換パラメータRegで置き換え
た場合の各パラメータは、 RegA=xc RegB=yc RegC=cos θ RegS=sin θ となる。
Y ′ = yc− (xc + (− xc)) cos θ− (yc + (− yc)) sin θ−xsin θ + ycos θ = yc−xsin θ + ycos θ ... (10) An arithmetic expression is obtained. Then, as in the case of only rotating the above equations (9) and (10), each parameter when replaced by the affine transformation parameter Reg is: RegA = xc RegB = yc RegC = cos θ RegS = sin θ.

【0053】そして、上記と同様に、所定角度θを、θ
s からθe まで、所定間隔dθ毎にインクリメントし、
その都度ウインドウW中の座標(x,y)を、例えばそ
のウインドウの左上のスタート座標からラスタ方向に順
次指定することにより、対応する画像メモリ3に格納さ
れた所定領域(図中ハッチングで示す)の画像データを
読み出し、モデル画像を比較する処理を考えると、その
場合のCPU6の処理機能すなわち本発明に係る指示方
法の他の実施例は、図8に示すフローチャートのように
なる。
Then, similarly to the above, the predetermined angle θ is set to θ
From s to θe, increment by a predetermined interval dθ,
Each time, the coordinate (x, y) in the window W is sequentially designated in the raster direction from the start coordinate at the upper left of the window, for example, so that a predetermined area stored in the corresponding image memory 3 (shown by hatching in the figure). Considering the processing of reading the image data of 1 and comparing the model images, the processing function of the CPU 6 in that case, that is, another embodiment of the instruction method according to the present invention, is as shown in the flowchart of FIG.

【0054】すなわち、まず、本例ではウインドウWの
位置は、画像メモリ3中の対象物Kの存在位置に関係な
く常に一定であるので、そのウインドウの開始点(X'
s,Y's)及びウインドウ幅WX ,WY を、マッチング
処理部8に設定する(ST11)。
That is, first, in this example, the position of the window W is always constant regardless of the position of the object K in the image memory 3, so that the starting point (X ') of the window is set.
s, Y's) and window widths WX and WY are set in the matching processing unit 8 (ST11).

【0055】次いで、撮像した画像メモリ中の対象物の
存在位置を特定し、その中心座標(xc ,yc )を求
め、アフィン変換パラメータの一つであるRegA,R
egBを求め、それをアフィン変換部8に設定する(S
T12)。そして、nをリセットするとともに、回転角
度θを決定し(ST13〜ST14)、求めたθに基づ
いて、残りの2つのアフィン変換パラメータ(Reg
C,RegS)を求め、それをアフィン変換部7に設定
する(ST15)。
Next, the existence position of the object in the imaged image memory is specified, its center coordinates (xc, yc) are determined, and RegA, R which is one of the affine transformation parameters.
EgB is obtained and set in the affine transformation unit 8 (S
T12). Then, n is reset, the rotation angle θ is determined (ST13 to ST14), and the remaining two affine transformation parameters (Reg
C, RegS) is obtained and set in the affine transformation unit 7 (ST15).

【0056】そして、上記のようにして求めた各値及び
マッチング処理部8からアフィン変換部7に送られるウ
インドウ中の各画素の座標(x,y)に基づいて、その
アフィン変換部7で求められる対応する画像メモリ中の
アドレスに従い、そのアドレスに格納されたデータを読
み出してマッチング処理部8に与える。そして、マッチ
ング処理部8では、与えられた画素のデータを積算する
とともに、その積算回数で除することにより平均濃度を
求め、ウインドウ中のすべての対象画素(ウインドウ全
体または所定のマスクがかけられている場合には当該部
分を除いた領域に存在する画素)についての平均濃度算
出が終了したならば、その演算結果をCPU6が受けと
る(ST16)。
Then, based on each value obtained as described above and the coordinates (x, y) of each pixel in the window sent from the matching processing unit 8 to the affine transformation unit 7, the affine transformation unit 7 obtains the value. According to the corresponding address in the corresponding image memory, the data stored at that address is read and given to the matching processing unit 8. Then, the matching processing unit 8 integrates the data of the given pixels and obtains an average density by dividing the data by the number of times of integration, and all the target pixels in the window (entire window or a predetermined mask is applied). If the average density calculation is completed for the pixels existing in the area excluding the portion), the CPU 6 receives the calculation result (ST16).

【0057】そして、CPU6は、平均濃度が一定の範
囲内にあるか否かを判断する。そして、1つの領域につ
いてのマッチング処理が終了したならば、現在処理した
回転角度θが終了角度になっているか否かを判断し、未
処理の領域が存在する(終了角度未満)場合には、θを
角度間隔dθだけインクリメントした(ST17,1
8,14)後、ステップ15以降の処理を実行する。そ
して、すべての角度について実行したならば処理を終了
する。
Then, the CPU 6 determines whether or not the average density is within a certain range. When the matching process for one area is completed, it is determined whether or not the currently processed rotation angle θ is the end angle. If there is an unprocessed area (less than the end angle), θ is incremented by the angular interval dθ (ST17, 1
8 and 14), the processes after step 15 are executed. Then, if the processing is performed for all the angles, the processing ends.

【0058】そして、本実施例では、アフィン変換パラ
メータのうちA,Bは回転角度θに依存しない定数とな
るので、図8から明らかなように、一度RegA,Re
gBを求めたならば、その後のCPU6での演算はRe
gC,RegSのみとなるので、演算処理を行うステッ
プ数が削減され、しかも、RegA,RegBについて
は、xc ,yc を代入するだけでよいため、上記したそ
の場で回転させる場合のCPU6の演算処理(図5)に
比べ、非常に高速に処理することができる。その結果、
検査処理も高速に行える。なお、その他の構成並びに作
用効果は、上記した実施例と同様であるため、その詳細
な説明を省略する。
In the present embodiment, A and B of the affine transformation parameters are constants that do not depend on the rotation angle θ, so that as is clear from FIG.
Once gB is obtained, the subsequent calculation in CPU 6 is Re
Since only gC and RegS are used, the number of steps for performing arithmetic processing can be reduced, and since RegA and RegB need only be substituted with xc and yc, the arithmetic processing of the CPU 6 in the case of rotating on the spot described above. Compared with (Fig. 5), it can be processed at extremely high speed. as a result,
Inspection processing can also be performed at high speed. Note that the other configurations and effects are the same as those of the above-described embodiment, so detailed description thereof will be omitted.

【0059】なお、上記した実施例では、いずれも検査
対象領域としてリング状にした例について説明したが、
本発明はこれに限ることなく、円でもよい。そして、円
の場合にたとえば図9に示すような対象物Kに対して処
理領域であるウインドウWを図示のように設定しそのウ
インドウWの中全部に対してマッチング処理を行っても
よく、或いは、所定領域M1をマスクをかけてマッチン
グの処理対象にしないようにすることにより、図中ハッ
チングに示すような扇形の処理領域に基づいてマッチン
グ処理をするようにしてもよく、種々変更実施が可能で
ある。そして、図9に示す例では対象物Kの全面が検査
対象領域となる。
In each of the above-described embodiments, an example in which the inspection target area has a ring shape has been described.
The present invention is not limited to this, and may be a circle. Then, in the case of a circle, for example, a window W, which is a processing area, may be set for the object K as shown in FIG. 9 and the matching processing may be performed for all of the windows W, or By masking the predetermined area M1 so as not to be a matching processing target, the matching processing may be performed based on a fan-shaped processing area shown by hatching in the drawing, and various modifications can be implemented. Is. Then, in the example shown in FIG. 9, the entire surface of the object K is the inspection target area.

【0060】[0060]

【発明の効果】以上のように、本発明に係る円形検査対
象領域の座標指示方法及び装置並びにその装置を用いた
検査装置では、直交座標系の一方の軸と平行に設定した
アクセス領域中の座標を順次指定すると、それに基づい
て所定のアフィン変換パラメータにしたがってアフィン
変換を行い、画像メモリに格納された対象物中の所定の
分割領域のアドレスがアクセス手段により出力可能とな
る。すなわち、実際に画像データ,モデルを回転させる
のではなく、画像の読み出しを行う際に適宜変換するこ
とにより仮想的にモデルメモリに格納される画像データ
等と同一姿勢の状態で画像読み出しを行うことができ
る。よって高速処理が可能となる。
As described above, in the coordinate pointing method and apparatus for a circular inspection target area according to the present invention and the inspection apparatus using the apparatus, in the access area set parallel to one axis of the orthogonal coordinate system. When the coordinates are sequentially designated, the affine transformation is performed based on the designated affine transformation parameters, and the address of the predetermined divided area in the object stored in the image memory can be output by the access means. That is, instead of actually rotating the image data and the model, the image is read in the same posture as the image data and the like virtually stored in the model memory by appropriately converting the image when reading the image. You can Therefore, high-speed processing becomes possible.

【0061】しかも、そのアドレスに基づいて画像メモ
リをアクセスすると、所定の画像データが読み出され、
これは、対象物の画像をその円の中心を基準に、所定角
度毎に回転させることにより、対象物の一部の領域ずつ
順に上記アクセス領域内に仮想的に移動させ、最終的に
対象物の検査対象領域の全部をアクセス領域内に仮想的
に存在させることができるので、検査対象領域よりも小
さな領域からなるモデル画像を用いて所定の認識・検査
処理を行うことができ、基準画像のメモリ使用効率を高
める。
Moreover, when the image memory is accessed based on the address, predetermined image data is read out,
This is because the image of the object is rotated by a predetermined angle with respect to the center of the circle to virtually move the partial areas of the object into the access area in order, and finally the object. Since the entire inspection target area can virtually exist in the access area, a predetermined recognition / inspection process can be performed using a model image including an area smaller than the inspection target area, Improve memory usage efficiency.

【0062】また、アクセス領域は、一方の座標系と平
行になっているため、座標指示手段によるそのアクセス
領域内のすべて或いは所定の座標の指示が、簡単な演算
処理により求めることができ、簡単かつ高速に指示でき
る。
Further, since the access area is parallel to one of the coordinate systems, the instruction of all or predetermined coordinates in the access area by the coordinate instruction means can be obtained by a simple calculation process, which is simple. And can be instructed quickly.

【0063】さらに、アクセス領域を円の中心が直交座
標系の原点に位置するように移動させる場合に分割領域
が存在するように設定すると、アフィン変換パラメータ
が単順化されてそのうちの一部が定数になるので、回転
角度を変えた時に行う演算処理のステップ数が少なく、
また演算も簡単であるので、より高速に座標指示が行え
る。
Further, when the access area is moved so that the center of the circle is located at the origin of the Cartesian coordinate system, if the divided area is set to exist, the affine transformation parameters are uni-ordered and a part of them is converted. Since it becomes a constant, the number of steps of the arithmetic processing when changing the rotation angle is small,
In addition, since the calculation is simple, the coordinates can be designated at a higher speed.

【0064】そして、係る座標指示に従って画像メモリ
に中の画像データを読み出すとともに、認識手段により
マッチングを行うと、読み出した分割領域が比較基準デ
ータと一致するか否かを判断されるが、係る判断は分割
領域単位であるため、一致しないと判定された時の分割
領域が不良であると簡単に検出することができる。すな
わち、処理対象の対象物上の汚れや欠け・バリ等の基準
画像と異なる位置を検出することができる。
Then, when the image data in the image memory is read according to the coordinate instruction and matching is performed by the recognition means, it is judged whether or not the read divided area matches the comparison reference data. Is a unit of divided area, and therefore it is possible to easily detect that the divided area is defective when it is determined that they do not match. That is, it is possible to detect a position different from the reference image such as dirt, chipping, or burr on the object to be processed.

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

【図1】本発明の好適な一実施例を示す図である。FIG. 1 is a diagram showing a preferred embodiment of the present invention.

【図2】その要部を示すブロック構成図である。FIG. 2 is a block configuration diagram showing a main part thereof.

【図3】動作原理を説明する図である。FIG. 3 is a diagram illustrating an operation principle.

【図4】動作原理を説明する図である。FIG. 4 is a diagram illustrating an operation principle.

【図5】本実施例におけるCPUの機能を説明するフロ
ーチャートである。
FIG. 5 is a flowchart illustrating the functions of the CPU in this embodiment.

【図6】他の実施例の動作原理を説明する図である。FIG. 6 is a diagram illustrating the operating principle of another embodiment.

【図7】他の実施例の動作原理を説明する図である。FIG. 7 is a diagram illustrating the operating principle of another embodiment.

【図8】本実施例におけるCPUの機能を説明するフロ
ーチャートである。
FIG. 8 is a flowchart illustrating the functions of the CPU in this embodiment.

【図9】他の検査対象領域の説明をする図である。FIG. 9 is a diagram illustrating another inspection target area.

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

1 カメラ 3 画像メモリ 6 CPU(パラメータ設定手段) 7 アフィン変換部(アクセス手段) 8 マッチング処理部(座標指示手段,認識手段) 9 モデルメモリ W ウインドウ(アクセス領域) 1 camera 3 image memory 6 CPU (parameter setting means) 7 affine transformation section (access means) 8 matching processing section (coordinate pointing means, recognition means) 9 model memory W window (access area)

───────────────────────────────────────────────────── フロントページの続き (51)Int.Cl.6 識別記号 庁内整理番号 FI 技術表示箇所 G06T 3/60 G06F 15/64 340 B 15/66 350 A ─────────────────────────────────────────────────── ─── Continuation of the front page (51) Int.Cl. 6 Identification number Internal reference number FI Technical display location G06T 3/60 G06F 15/64 340 B 15/66 350 A

Claims (7)

【特許請求の範囲】[Claims] 【請求項1】 円形の検査対象領域を持つ対象物が撮像
された画像データを格納する画像メモリと、 前記円形の検査対象領域をその円形の中心を基準に所定
角度毎に分割した分割領域内の画像データをアクセスす
るアクセス手段とを備え、 前記アクセス手段が、アフィン変換を用い、少なくとも
前記円形の中心を基準に前記所定角度毎に回転させ、ア
クセス領域が直交座標系の直交軸のいずれか一方と平行
になるように前記アクセス手段に対してアフィン変換パ
ラメータを設定するパラメータ設定手段とを備えた円形
領域の座標指示装置。
1. An image memory for storing image data in which an object having a circular inspection target area is imaged, and a divided area obtained by dividing the circular inspection target area at a predetermined angle based on the center of the circle. Access means for accessing the image data of, the access means, using the affine transformation, to rotate at every predetermined angle with respect to at least the center of the circle, the access region is one of the orthogonal axes of the orthogonal coordinate system A coordinate pointing device for a circular area, comprising: parameter setting means for setting an affine transformation parameter for the access means so as to be parallel to the one side.
【請求項2】 円形の検査対象領域を持つ対象物が撮像
された画像データを格納する画像メモリと、 前記円形の検査対象領域をその円形の中心を基準に所定
角度毎に分割した分割領域内の画像データをアクセスす
るアクセス手段とを備え、 前記アクセス手段が、アフィン変換を用い、前記円形の
中心を直交座標系の原点位置に平行移動するとともに、
その円形の中心を基準に前記所定角度毎に回転させ、ア
クセス領域が直交座標系の直交軸のいずれか一方に接す
るように前記アクセス手段に対してアフィン変換パラメ
ータを設定するパラメータ設定手段とを備えた円形領域
の座標指示装置。
2. An image memory for storing image data in which an object having a circular inspection target area is imaged, and a divided area obtained by dividing the circular inspection target area at a predetermined angle based on the center of the circle. And an access unit for accessing the image data, wherein the access unit uses an affine transformation to move the center of the circle in parallel to the origin position of the orthogonal coordinate system,
And a parameter setting means for rotating the circular center with respect to each of the predetermined angles and setting an affine transformation parameter for the access means so that the access region contacts one of the orthogonal axes of the orthogonal coordinate system. Coordinate pointing device for circular area.
【請求項3】 前記円形の検査対象領域が、中心を同じ
にした2つの円形ウインドウの重なる領域とした請求項
1または2に記載の円形領域の座標指示装置。
3. The coordinate pointing device for a circular area according to claim 1, wherein the circular inspection target area is an overlapping area of two circular windows having the same center.
【請求項4】 前記アクセス領域に所定のマスク領域を
付加するようにした請求項1〜3のいずれか1項に記載
の円形領域の座標指示装置。
4. The circular area coordinate pointing device according to claim 1, wherein a predetermined mask area is added to the access area.
【請求項5】 請求項1〜4のいずれかに記載の円形領
域の座標指示装置を有し、 前記分割領域に対応する比較基準データを有するモデル
メモリと、 前記アクセス領域中の所定座標を指示する座標指示手段
と、 前記座標指示手段により指示された座標に基づいて前記
アクセス手段により求められた画像メモリ中の分割領域
中の画像データを前記モデルメモリに記憶された比較基
準データとマッチングを取る認識手段とを備えた円形領
域の検査装置。
5. The circular area coordinate pointing device according to claim 1, further comprising a model memory having comparison reference data corresponding to the divided area, and pointing a predetermined coordinate in the access area. And the image data in the divided area in the image memory obtained by the access means based on the coordinates instructed by the coordinate instructing means and the comparison reference data stored in the model memory are matched. An inspection device for a circular area, comprising a recognition means.
【請求項6】 円形の検査対象領域を持つ対象物を撮像
して得られた画像データに対し、 直交座標系の直交軸のいずれか1方と平行になるアクセ
ス領域を設定し、 前記円形の検査対象領域を、少なくとも回転移動させる
ことによりその円形の中心を基準に所定角度毎に分割し
た分割領域内の画像データが前記アクセス領域に仮想的
に存在するようなアフィン変換パラメータを用い、前記
アクセス領域中の座標入力に対してアフィン変換を行
い、対応する前記所定の分割領域内の画像データをアク
セスするようにした円形領域の座標指示方法。
6. An access area parallel to any one of orthogonal axes of an orthogonal coordinate system is set for image data obtained by imaging an object having a circular inspection area, The access is performed by using an affine transformation parameter such that the image data in the divided area obtained by dividing the inspection area at least by rotating the inspection area at a predetermined angle based on the center of the circle is virtually present in the access area. A coordinate designating method for a circular area, wherein affine transformation is performed on a coordinate input in the area to access image data in the corresponding predetermined divided area.
【請求項7】 前記アクセス領域の1辺が、前記直交軸
のいずれか1方と接し、かつ、前記円形の検査対象領域
を平行移動させてその円形の中心が直交座標系の原点に
位置させるとともに所定角度回転させた時に、前記分割
領域が前記アクセス領域に仮想的に存在するような所定
位置に前記アクセス領域を設定し、 前記アフィン変換パラメータが、前記円形の検査対象領
域を、平行移動及び回転移動させることにより前記分割
領域内の画像データが前記アクセス領域に仮想的に存在
するように決定するようにした請求項6に記載の円形領
域の座標指示方法。
7. One side of the access area is in contact with any one of the orthogonal axes, and the circular inspection target area is translated so that the center of the circle is located at the origin of the orthogonal coordinate system. And when rotated by a predetermined angle, the access area is set to a predetermined position such that the divided area virtually exists in the access area, and the affine transformation parameter moves the circular inspection target area in parallel and 7. The method for instructing coordinates of a circular area according to claim 6, wherein the image data in the divided area is determined to virtually exist in the access area by rotating and moving.
JP25975194A 1994-09-30 1994-09-30 Method and apparatus for indicating coordinates of circular inspection target area and inspection apparatus using the apparatus Expired - Fee Related JP3362191B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP25975194A JP3362191B2 (en) 1994-09-30 1994-09-30 Method and apparatus for indicating coordinates of circular inspection target area and inspection apparatus using the apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP25975194A JP3362191B2 (en) 1994-09-30 1994-09-30 Method and apparatus for indicating coordinates of circular inspection target area and inspection apparatus using the apparatus

Publications (2)

Publication Number Publication Date
JPH08101913A true JPH08101913A (en) 1996-04-16
JP3362191B2 JP3362191B2 (en) 2003-01-07

Family

ID=17338452

Family Applications (1)

Application Number Title Priority Date Filing Date
JP25975194A Expired - Fee Related JP3362191B2 (en) 1994-09-30 1994-09-30 Method and apparatus for indicating coordinates of circular inspection target area and inspection apparatus using the apparatus

Country Status (1)

Country Link
JP (1) JP3362191B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000266685A (en) * 1999-03-18 2000-09-29 Fujisawa Pharmaceut Co Ltd Method and apparatus for visual inspection of object
WO2012050074A1 (en) * 2010-10-13 2012-04-19 オムロン株式会社 Image processor and image processing method
JP2018072312A (en) * 2016-10-24 2018-05-10 株式会社デンソーテン Device and method for detecting deposit

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000266685A (en) * 1999-03-18 2000-09-29 Fujisawa Pharmaceut Co Ltd Method and apparatus for visual inspection of object
WO2012050074A1 (en) * 2010-10-13 2012-04-19 オムロン株式会社 Image processor and image processing method
JP2012084000A (en) * 2010-10-13 2012-04-26 Omron Corp Image processing apparatus and image processing method
KR101525759B1 (en) * 2010-10-13 2015-06-09 오므론 가부시키가이샤 Image processor and image processing method
JP2018072312A (en) * 2016-10-24 2018-05-10 株式会社デンソーテン Device and method for detecting deposit
JP2021051802A (en) * 2016-10-24 2021-04-01 株式会社デンソーテン Device and method for detecting deposit

Also Published As

Publication number Publication date
JP3362191B2 (en) 2003-01-07

Similar Documents

Publication Publication Date Title
US11367276B2 (en) Target detection method and apparatus
US5793901A (en) Device and method to detect dislocation of object image data
JPH09501234A (en) Method for identifying spatial and rotational positions of properly marked objects in a digital image sequence
WO2020037466A1 (en) Image matching method and visual system
JP3362191B2 (en) Method and apparatus for indicating coordinates of circular inspection target area and inspection apparatus using the apparatus
JPH1027839A (en) Wafer rotating direction detecting method
JP4512778B2 (en) Illegal dumping point detection device, method, and program
CN115187989A (en) Image processing method and device, electronic equipment, scanning pen and storage medium
JPH0854222A (en) Method for detecting displacement by image processing
JP3427230B2 (en) Image processing device
JP3627249B2 (en) Image processing device
JP3422147B2 (en) Position shift amount detecting device and image measuring device
JP2000194861A (en) Method and device for recognizing image
JPH09198485A (en) Method and device for detecting rotary fingerprint
JPH08101139A (en) Defect inspection method and device
JP2787149B2 (en) 3D shape recognition device
JPH10288514A (en) Objective turning angle detecting method
JPH0718816B2 (en) Method and device for inspecting defects such as bottles
JP2635303B2 (en) Wafer orientation flat detector
JPH08272929A (en) Moving body three-dimensional position extraction device
JPH09288068A (en) Appearance inspecting instrument
JPH08226961A (en) Automatic target identifying apparatus
JPS62148838A (en) Defect recognizing method
JPH0783614A (en) Distance image processing method
JPH06215136A (en) Picture processor

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20020910

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

Free format text: PAYMENT UNTIL: 20071025

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20081025

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20091025

Year of fee payment: 7

LAPS Cancellation because of no payment of annual fees