JP4525526B2 - Pattern matching method and apparatus - Google Patents

Pattern matching method and apparatus Download PDF

Info

Publication number
JP4525526B2
JP4525526B2 JP2005246751A JP2005246751A JP4525526B2 JP 4525526 B2 JP4525526 B2 JP 4525526B2 JP 2005246751 A JP2005246751 A JP 2005246751A JP 2005246751 A JP2005246751 A JP 2005246751A JP 4525526 B2 JP4525526 B2 JP 4525526B2
Authority
JP
Japan
Prior art keywords
graphic
pattern matching
score value
image
data
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.)
Expired - Fee Related
Application number
JP2005246751A
Other languages
Japanese (ja)
Other versions
JP2007058811A (en
Inventor
良介 三高
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 Corp
Panasonic Electric Works Co Ltd
Original Assignee
Panasonic Corp
Matsushita Electric Works 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 Panasonic Corp, Matsushita Electric Works Ltd filed Critical Panasonic Corp
Priority to JP2005246751A priority Critical patent/JP4525526B2/en
Publication of JP2007058811A publication Critical patent/JP2007058811A/en
Application granted granted Critical
Publication of JP4525526B2 publication Critical patent/JP4525526B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Analysis (AREA)

Description

本発明は、照合対象画像中に表示された照合対象図形に対して認識対象物の形状を表す図形テンプレートを照合して認識対象物を検出するパターンマッチング方法に関する。   The present invention relates to a pattern matching method for detecting a recognition target object by comparing a graphic template representing the shape of a recognition target object with a verification target graphic displayed in a verification target image.

2次元または3次元の認識対象物体の形状を表す図形データの集合を予め図形テンプレートとして登録し、この図形テンプレートと類似した図形を画像空間から検出する技術としてパターンマッチングがある。   There is pattern matching as a technique for previously registering a set of graphic data representing the shape of a two-dimensional or three-dimensional recognition target object as a graphic template and detecting a graphic similar to the graphic template from the image space.

このパターンマッチングでは、図形の有無、図形の位置・姿勢の認識、図形の弁別などを行うことができ、文字認識や文字検査、パターン(図形形状)認識による位置合わせ、ロボットビジョンによる物体認識などに応用することができる。   This pattern matching can recognize the presence / absence of figures, figure position / posture, figure discrimination, etc., for character recognition, character inspection, alignment by pattern (figure shape) recognition, object recognition by robot vision, etc. Can be applied.

パターンマッチング機能は、既知のパターンを画像中から検出し、その位置やパターンの回転角度、スケール等を求めるもので、画像処理を用いた検査や組み立てを目的とする位置決め用途において、エッジ検出やブロブ解析等の方法に比べて汎用性が高く、また直観的で画像処理に関する基礎知識やプログラム作成技術がないユーザーにも使い易いため、産業用の画像処理において頻繁に用いられる機能である。パターンマッチングのアルゴリズムとして公知の技術の中では正規化相関法と一般化Hough変換が最も有名である。   The pattern matching function detects a known pattern from an image and obtains its position, pattern rotation angle, scale, etc. In positioning applications for inspection and assembly using image processing, edge detection and blob It is a function that is frequently used in industrial image processing because it is more versatile than methods such as analysis, and is intuitive and easy to use for users who do not have basic knowledge and program creation techniques related to image processing. Of the techniques known as pattern matching algorithms, the normalized correlation method and the generalized Hough transform are the most famous.

正規化相関法は、パターン画像そのものを認識対象画像に重ね合わせ、パターン画像と認識対象画像の画素値の相互相関値が最大となる位置を検出する方法である。正規化相関法は、画像そのものをテンプレートとして類似度が高い位置を検出するので、マッチングミスの発生が少ない利点がある反面、処理量が多く実行速度が遅いという問題がある。特に、回転やスケール変動が生じる場合には、回転やスケール変動を施した変形済みのテンプレートを多数用意して逐次照合しなければならず、実用できる速度が得られない。また、画像を重ねた時の、テンプレート画像の画素値と認識対象画像の画素値の相互相関値を用いるので、画像の明度が全体的に変動してもマッチングミスは発生しないが、ノイズやシェーディング等によりパターンの明度が部分的に変動したり、背景が極端に変化したりすると大幅に相互相関値が低下してマッチングミスを発生する問題がある。   The normalized correlation method is a method in which the pattern image itself is superimposed on the recognition target image, and the position where the cross-correlation value between the pixel values of the pattern image and the recognition target image is maximized is detected. Since the normalized correlation method detects a position having a high degree of similarity using the image itself as a template, there is an advantage that there are few matching errors, but there is a problem that the processing amount is large and the execution speed is slow. In particular, when rotation or scale variation occurs, a large number of deformed templates subjected to rotation or scale variation must be prepared and sequentially verified, and a practical speed cannot be obtained. In addition, since the cross-correlation value between the pixel value of the template image and the pixel value of the recognition target image when the images are overlaid is used, no matching error occurs even if the overall brightness of the image fluctuates, but noise and shading If the lightness of the pattern partially changes or the background changes drastically due to the above, etc., there is a problem that the cross-correlation value is greatly lowered and a matching error occurs.

また、一般化Hough変換は、求めたい形状を数式化し、その数式の特徴ベクトルを構成する要素の次元数と同じだけの投票空間(Hough空間)に各エッジ点を写像した軌跡を投票していき、投票値が高い位置を検出することで画像中から求めたい形状を検出する方法で、回転やスケールの変動、他の物体による隠蔽などに伴うパターンの部分的欠落には強い反面、部分的にでも形状が一致すれば投票値が高くなるため、部分的に類似したパターンを含む画像の場合に誤認識を発生しやすいという問題がある。また、検出すべきパターンが複雑であればあるほどHough空間の次元数を高くしなくてはならないためメモリの消費量、処理時間ともに膨大になる欠点がある。   Also, the generalized Hough transform formulates the desired shape, and votes the trajectory that maps each edge point to the same voting space (Hough space) as the number of elements constituting the feature vector of the mathematical formula. Detecting the shape you want from the image by detecting the position where the vote value is high, it is strong against partial omission of patterns due to rotation, scale fluctuation, concealment by other objects, etc. However, since the vote value increases if the shapes match, there is a problem that erroneous recognition is likely to occur in the case of an image including a partially similar pattern. In addition, the more complicated the pattern to be detected, the higher the dimension of the Hough space has to be, so there is a disadvantage that both the memory consumption and the processing time become enormous.

これら既存の方法の問題点を解決する手段としては、特許文献1に開示されている方法が挙げられる。特許文献1の方法では、まず対象パターンの輪郭線を抽出し、輪郭線上の点ごとにパターン中心点とその点とを結ぶ線分の長さrと、その点における法線方向との角度θとを要素としてもつシフトベクトルを求めてテンプレートを生成する。その上で、マッチング時には対象画像のエッジ点ごとに法線ベクトルを求め、そのエッジ点にテンプレートの各エッジ点を当てはめた時のrとθの値を投票平面上に投票して最も高い投票値が得られる位置をパターン検出位置として抽出するようにしている。   As a means for solving the problems of these existing methods, there is a method disclosed in Patent Document 1. In the method of Patent Document 1, first, the contour line of the target pattern is extracted, the length r of the line segment connecting the pattern center point and the point for each point on the contour line, and the angle θ between the normal direction at that point. A template is generated by obtaining a shift vector having and as elements. In addition, a normal vector is obtained for each edge point of the target image at the time of matching, and the values of r and θ when the edge points of the template are applied to the edge points are voted on the voting plane to obtain the highest voting value. Is obtained as a pattern detection position.

また、既存の方法の問題点を解決する別の手段としては、特許文献2に開示されている方法が挙げられる。特許文献2の方法では、対象パターンの輪郭線を解析し、粗い位置決めに有効な部分、角度の検出に有効な部分、倍率の検出に有効な部分に分解し、粗い位置決めに有効なパターンを用いて高速にパターンの位置決めを行った後、角度と倍率の微調整を行うようにしている。   Further, as another means for solving the problems of the existing method, there is a method disclosed in Patent Document 2. In the method of Patent Document 2, the contour line of the target pattern is analyzed and decomposed into a portion effective for rough positioning, a portion effective for angle detection, and a portion effective for detection of magnification, and a pattern effective for rough positioning is used. After positioning the pattern at high speed, the angle and magnification are finely adjusted.

さらに、既存の方法の問題点を解決する別の手段としては、特許文献3に開示されている方法が挙げられる。特許文献3の方法では、正置したテンプレートを回転したパターンに照合した際に発生するズレ量を求めておき、テンプレートをパターンに照合した後、ズレ量を用いてパターンの検出位置を校正するようにしている。   Furthermore, as another means for solving the problems of the existing method, there is a method disclosed in Patent Document 3. In the method of Patent Document 3, an amount of deviation that occurs when a template placed in alignment with a rotated pattern is collated, and after the template is collated with the pattern, the pattern detection position is calibrated using the amount of deviation. I have to.

また、既存の方法の問題点を解決する別の手段として、特に3次元形状のパターンマッチングに関する手段として、特許文献4に開示されている方法が挙げられる。特許文献4の方法では、認識するべき物体の特徴点と、物体の外接直方体の寸法をデータベースとして持っており、まず外接直方体を用いて物体が存在する位置を検出した後、物体に定義した小ブロックごとのマッチングを行って照合するようにしている。   Further, as another means for solving the problems of the existing method, there is a method disclosed in Patent Document 4 as a means relating to pattern matching of a three-dimensional shape in particular. In the method of Patent Document 4, the feature points of the object to be recognized and the dimensions of the circumscribed cuboid of the object are stored as a database. First, the position where the object exists is detected using the circumscribed cuboid, and then the small object defined in the object is detected. Matching is performed for each block.

ここで、上述した特許文献に開示された従来技術における図形の照合処理では、測定点群を図形テンプレートに位置合わせして類似度を求める処理を、可能な全ての位置・姿勢に対して「しらみつぶし」に行い、最も高い類似度が得られる位置を求めるという処理が行なわれる。Hough変換やニューラルネットワークによるパターンマッチングも、主として「全く照合しない」場合に素早く処理を打ち切るための数理的な手法が違うだけで、可能な全ての位置・姿勢に対して類似度を求める処理である点では同じである。記号認識や文字認識のように単純な図形を扱う場合、Hough変換やニューラルネットワークのほうが総処理時間を短くできる場合が多く、複雑なパターンを扱うような汎用的なパターンマッチング処理では、テンプレートの図形データ量が増大するのでかえって処理時間を必要とする場合が多くなる。よって、このような汎用的なパターンマッチング処理では、1回の位置合わせについて類似度計算がなるべく高速な照合処理でしらみつぶしに位置合わせを行うほうが有効となっていた。
特許第3437141号公報 特開2004−219284号公報 特開2002−319028号公報 特開2004−226197号公報
Here, in the graphic matching process in the prior art disclosed in the above-mentioned patent document, the process of aligning the measurement point group with the graphic template to obtain the similarity is performed with respect to all possible positions / postures. The process of performing “crushing” and obtaining the position where the highest similarity is obtained is performed. Pattern matching using Hough transform or neural network is also a process for obtaining similarities for all possible positions and orientations, with the only difference being a mathematical method for quickly terminating the process when “no matching”. The point is the same. When dealing with simple graphics such as symbol recognition and character recognition, the Hough transform and neural network can often shorten the total processing time. In general pattern matching processing that handles complex patterns, template graphics Since the amount of data increases, processing time is often required. Therefore, in such a general-purpose pattern matching process, it is more effective to perform the position alignment in a collapsing manner by a collation process as fast as possible for a single position alignment.
Japanese Patent No. 3437141 JP 2004-219284 A JP 2002-319028 A JP 2004-226197 A

しかしながら、類似度計算を行うためには、測定点群と図形テンプレートとの対応付け処理(各点から図形テンプレートの構成要素図形のうち最も近い線までの距離と対応点を求める処理)が必要となるが、この処理では、各座標点から図形テンプレートの全構成要素図形までの距離と対応点を求め、距離が最小となるものを選択するという煩雑な処理となるので、処理時間が増大するという問題点があった。   However, in order to perform similarity calculation, a process for associating a measurement point group with a graphic template (a process for obtaining a distance and a corresponding point from each point to the closest line among the component graphic elements of the graphic template) is required. However, in this process, the distance and corresponding points from each coordinate point to all the component graphic elements of the graphic template are obtained, and the complicated process of selecting the one with the smallest distance is selected, so that the processing time is increased. There was a problem.

また、上述した特許文献1に開示された方法では、一般化Hough変換に比べて少ない次元数でパターンを検出できるのでメモリ消費量が少なく処理速度が速いという特長があり、また回転に対して不変な認識を行なうこともできる。ところが、スケールの変動がある場合には検出不能となり、また部分的に一致するパターンでも投票値が高くなるという現象は通常の一般化Hough変換と同様に生じてしまうので、パターンの欠けなどがあると誤認識を発生しやすいという問題点があった。   In addition, the method disclosed in Patent Document 1 described above has a feature that the pattern can be detected with a smaller number of dimensions compared to the generalized Hough transform, so that the memory consumption is small and the processing speed is high, and the rotation is invariant. Can also be recognized. However, when there is a change in the scale, detection becomes impossible, and the phenomenon that the vote value becomes high even in a partially matching pattern occurs in the same manner as in the generalized Hough transform, so there is a lack of pattern. There was a problem that misrecognition was likely to occur.

さらに、特許文献2に開示された方法では、角度の変動が大きくない場合には高速な処理が可能であるが、角度が大きく変動する場合には使えないという問題点があった。   Further, the method disclosed in Patent Document 2 has a problem that high-speed processing is possible when the angle variation is not large, but it cannot be used when the angle varies greatly.

また、特許文献3に開示された方法では、回転テンプレートを用いずに多少の回転が含まれるパターンの認識が可能であるため高速な処理が可能であるという利点はあるものの、精度が劣る上に大きな回転を含む場合には使えないという問題点があった。   In addition, the method disclosed in Patent Document 3 has an advantage that high-speed processing is possible because a pattern including some rotation can be recognized without using a rotation template, but accuracy is inferior. There was a problem that it could not be used when large rotations were involved.

さらに、特許文献4に開示された方法では、物体が単独で存在する場合には高速な物体認識が可能であるが、複数の物体が接触して存在する場合など、物体の見かけ寸法が変動する場合には認識不能になってしまう場合があるという問題点があった。   Furthermore, in the method disclosed in Patent Document 4, high-speed object recognition is possible when an object exists alone, but the apparent dimension of the object varies when a plurality of objects are in contact with each other. In some cases, there was a problem that it might become unrecognizable.

本発明の目的は、上記従来技術の課題を解決して、高速なパターンマッチング処理を行うことができるパターンマッチング方法を提供することにある。   An object of the present invention is to provide a pattern matching method that can solve the above-described problems of the prior art and perform high-speed pattern matching processing.

上述した課題を解決するために、本発明のパターンマッチング方法は、認識対象物の形状を表す図形テンプレートを照合対象画像に照合して前記認識対象物を検出するパターンマッチング方法であって、前記認識対象物が撮影された画像を画像処理して前記図形テンプレートを生成する図形テンプレート生成ステップと、前記照合対象画像を画像処理することによって、前記照合対象画像中に表示されている照合対象図形を測定点の集合として表示した測定点データを生成する測定点データ生成ステップと、前記図形テンプレートからの相対的な位置関係に基づいて設定されたスコア値を記録したポテンシャル空間データを生成するポテンシャル空間データ生成ステップと、前記測定点データと前記ポテンシャル空間データとを照合し、前記測定点におけるスコア値を求めるスコア値決定ステップと、前記スコア値決定ステップで求められたスコア値に基づいて前記照合対象図形と前記図形テンプレートとの類似度を算出し、前記類似度に基づいて前記照合対象図形が前記認識対象物であるか否かを判定する判定ステップとを含むことを特徴とする。   In order to solve the above-described problem, the pattern matching method of the present invention is a pattern matching method for detecting the recognition target object by comparing a graphic template representing the shape of the recognition target object with a verification target image, and A graphic template generation step of generating an image template by processing an image of an object photographed, and measuring a verification target graphic displayed in the verification target image by performing image processing on the verification target image A measurement point data generation step for generating measurement point data displayed as a set of points, and potential space data generation for generating potential space data in which score values set based on the relative positional relationship from the graphic template are recorded Step, collating the measurement point data with the potential space data, A score value determination step for obtaining a score value at a fixed point; a similarity between the verification target graphic and the graphic template is calculated based on the score value determined in the score value determination step; and the verification is performed based on the similarity And a determination step of determining whether or not the target graphic is the recognition target object.

本発明に係るパターンマッチング方法では、図形テンプレートからの相対的な位置関係に基づいてスコア値を設定したポテンシャル空間データを生成し、このポテンシャル空間データと測定点データとを照合することによってスコア値を求め、求められたスコア値に基づいて類似度を算出して照合対象図形が認識対象物であるか否かを判定するので、従来では必要であった対応点探索処理が不要となり、ポテンシャル空間データに測定点を照合した際に測定点毎に得られるスコア値を演算するだけで類似度を得ることでき、これによって従来に比べて遙かに高速なパターンマッチング処理を実現することが可能となる。   In the pattern matching method according to the present invention, potential space data in which a score value is set based on a relative positional relationship from a graphic template is generated, and the score value is determined by collating the potential space data with measurement point data. Since the similarity is calculated based on the obtained score value and it is determined whether or not the verification target graphic is a recognition target object, the corresponding point search process that has been necessary in the past is unnecessary, and potential space data Similarity can be obtained simply by calculating the score value obtained for each measurement point when the measurement points are collated with each other. This makes it possible to realize pattern matching processing much faster than conventional methods. .

以下、本発明に係わるパターンマッチング方法を実施するための装置構成および、この装置を用いたパターンマッチングの実施例について説明する。   An apparatus configuration for carrying out the pattern matching method according to the present invention and an example of pattern matching using this apparatus will be described below.

以下、本発明の実施例1を図面に基づいて説明する。図1は実施例1に係るパターンマッチング方法を実施するためのパターンマッチング装置の構成を示すブロック図である。   Embodiment 1 of the present invention will be described below with reference to the drawings. FIG. 1 is a block diagram illustrating a configuration of a pattern matching apparatus for performing the pattern matching method according to the first embodiment.

図1に示すように、本実施例のパターンマッチング装置1は、シート状の対象物2の画像を入力する画像入力装置としてのTVカメラ3と、TVカメラ3で撮像されたアナログ信号の画像をデジタル信号に変換するデジタル画像生成装置4と、デジタル画像生成装置4で生成されたデジタルデータを格納する記憶装置5と、画像処理を行なってパターンマッチングを実施する画像処理装置6とを備えている。   As shown in FIG. 1, the pattern matching device 1 of the present embodiment includes a TV camera 3 as an image input device that inputs an image of a sheet-like object 2, and an analog signal image captured by the TV camera 3. A digital image generating device 4 for converting into a digital signal, a storage device 5 for storing digital data generated by the digital image generating device 4, and an image processing device 6 for performing image processing and performing pattern matching are provided. .

このように構成されたパターンマッチング装置1において、対象物2の表面にはパターンが印刷されており、このパターンを含む画像をTVカメラ3で撮像すると、撮像されたアナログ信号の画像はデジタル画像生成装置4に入力されてデジタル信号に変換され、画素値が濃度値となる濃淡画像が生成される。この濃淡画像は記憶装置5に格納されており、画像処理装置6が記憶装置5に格納された濃淡画像に対して、以下に説明する画像処理を行なってパターンマッチングを実施する。   In the pattern matching apparatus 1 configured as described above, a pattern is printed on the surface of the object 2, and when an image including the pattern is captured by the TV camera 3, an image of the captured analog signal is generated as a digital image. A grayscale image in which the pixel value becomes a density value is generated by being input to the device 4 and converted into a digital signal. The grayscale image is stored in the storage device 5, and the image processing device 6 performs pattern matching by performing image processing described below on the grayscale image stored in the storage device 5.

なお、対象物2は上記のような平面パターンが印刷されたものに限らず、立方体などであっても同様に本発明の方法を用いることができる。   Note that the object 2 is not limited to the one in which the planar pattern as described above is printed, and the method of the present invention can be used similarly even if it is a cube or the like.

ここで、本実施例のパターンマッチング方法によって実施されるテンプレートマッチングの概念を図2に基づいて説明する。テンプレートマッチングとは、認識対象物を記録した図形テンプレート31を、照合対象図形が撮影された照合対象画像32のあらゆる位置に重ね合わせて類似度を求め、最も高い類似度を示す位置にある照合対象図形が認識対象物であるとして検出する方法である。例えば、図2中のaの位置では図形テンプレートは全く関係のない位置に位置合わせされているので類似度はゼロに近く、図2bの位置では異なったパターンに位置合わせされているので類似度は低い値となる。そして、図2cの位置では類似度が極めて高い値となり、cの位置が認識対象物の存在位置であると判断される。   Here, the concept of template matching performed by the pattern matching method of the present embodiment will be described with reference to FIG. In template matching, the graphic template 31 in which the recognition target object is recorded is superimposed on every position of the verification target image 32 where the verification target graphic is photographed to obtain the similarity, and the verification target at the position showing the highest similarity This is a method of detecting that a figure is a recognition object. For example, since the figure template is aligned at a position which is not related at the position a in FIG. 2, the similarity is close to zero, and at the position of FIG. 2b, the similarity is aligned with a different pattern. Low value. The similarity is extremely high at the position shown in FIG. 2c, and the position c is determined to be the position where the recognition target is present.

次に、本実施例のパターンマッチング方法による照合処理を図3のフローチャートに基づいて説明する。図3に示すように、まず図形テンプレートの生成を行なう(S301)。 Next, the collation process by the pattern matching method of a present Example is demonstrated based on the flowchart of FIG. As shown in FIG. 3, a graphic template is first generated (S301).

ここで、本実施例のパターンマッチング方法で利用される図形テンプレートの一例を図4に示す。図4(a)の図形テンプレートは、矢印型を7本の直線11〜17で記録したものである。この図形テンプレートは、予め7本の直線を表す数式をオフラインで作ったものでも良いし、CADなどで描かれた図形をインポートしたものでもよい。また、図4(b)に示すように、図形を構成するひとつながりの座標点をその連結順に並べたものであってもよい。図4(b)のような座標点は、3次元形状データであれば最初から座標点列としてのデータが与えられるが、画像処理によって抽出する場合には以下のような処理を行なうことによって生成することができる。   Here, an example of a graphic template used in the pattern matching method of this embodiment is shown in FIG. The graphic template in FIG. 4A is obtained by recording an arrow shape with seven straight lines 11 to 17. This graphic template may be a mathematical expression that represents seven straight lines in advance, or may be an imported graphic drawn with CAD or the like. Further, as shown in FIG. 4B, a series of coordinate points constituting a figure may be arranged in the order of connection. The coordinate points as shown in FIG. 4B are given as coordinate point sequences from the beginning if they are three-dimensional shape data, but are generated by performing the following processing when extracted by image processing. can do.

まず、画像処理装置6によって、記憶装置5に記録されている図5(a)に示す濃淡画像51から、図5(b)に示すエッジ強度画像52と図5(c)に示すエッジ方向画像53が抽出される。エッジ強度画像52は、明度の変化の大きさ(エッジ強度)を記録した画像であり、エッジ方向画像53は明度が上昇していく方向を記録した画像である。   First, from the grayscale image 51 shown in FIG. 5A recorded in the storage device 5 by the image processing device 6, the edge intensity image 52 shown in FIG. 5B and the edge direction image shown in FIG. 53 is extracted. The edge intensity image 52 is an image in which the magnitude of change in brightness (edge intensity) is recorded, and the edge direction image 53 is an image in which the direction in which the brightness increases is recorded.

ここで、エッジ強度画像52は単に全ての画素についてのエッジ強度を求めた画像であるので、このエッジ強度画像52に対してしきい値処理(しきい値以上のエッジ強度をもつ座標を抽出する処理)を行なうことにより図5(d)に示すエッジ点画像54を取得することができる。この処理は、公知技術であるSobelフィルタリングなどによって実施することができる。さらに、エッジ点画像54において線の幅が1になるように細線化を行い、任意のエッジ点を始点としてエッジ点を追跡する処理を行えば、図5(e)に示す測定点データ55が得られる。これをそのまま図形テンプレートとして用いればよい。   Here, since the edge strength image 52 is an image obtained by simply obtaining the edge strengths for all the pixels, threshold processing is performed on the edge strength image 52 (coordinates having edge strengths greater than or equal to the threshold value are extracted. By performing the processing, the edge point image 54 shown in FIG. 5D can be acquired. This process can be performed by Sobel filtering which is a known technique. Further, if the thinning process is performed so that the line width becomes 1 in the edge point image 54 and the edge point is traced starting from an arbitrary edge point, the measurement point data 55 shown in FIG. can get. What is necessary is just to use this as a figure template as it is.

また、図5(d)のエッジ点画像54を求める処理において、図5(b)のエッジ強度画像52のd1、d2の部分のようにエッジ強度が他の部分よりも低くなっている部分がある場合に、この部分のエッジ強度よりしきい値のほうが高いと、図6(a)に示すようにエッジが途切れてしまう。このような場合には追跡処理を行なって得られた線データ61、62の両端において線の方向を記録し、対向する方向に別の線が存在する場合には2つの線を1つに融合させる処理(エッジ延長処理)を行えば、図6(b)に示すように途切れたエッジを修復することができる。   Further, in the processing for obtaining the edge point image 54 of FIG. 5D, there are portions where the edge strength is lower than other portions, such as the portions d1 and d2 of the edge strength image 52 of FIG. In some cases, if the threshold is higher than the edge strength of this portion, the edge is interrupted as shown in FIG. In such a case, the direction of the line is recorded at both ends of the line data 61 and 62 obtained by the tracking process, and if another line exists in the opposite direction, the two lines are merged into one. If the process (edge extension process) is performed, the broken edge can be repaired as shown in FIG.

さらに、図4(b)、図5(e)の測定点データ55、図6(b)に示すような修復された測定点データから近似処理を行い、図4(a)に示すような数式によって記述された図形テンプレートを生成してもよい。この近似処理は、折れ線近似等の公知な方法を用いて行えばよい。   Further, approximation processing is performed from the measurement point data 55 of FIGS. 4B and 5E and the repaired measurement point data as shown in FIG. 6B, and the mathematical formula as shown in FIG. A graphic template described by the above may be generated. This approximation process may be performed using a known method such as broken line approximation.

なお、図形テンプレートを数式によって記述する場合には、近似した図形と元の測定点データとの誤差が許容範囲内であるという条件において、なるべく少ない線で表現するようにしたほうが図形テンプレートのデータ量を低く抑えることができ、また後述するポテンシャル空間データの生成の際にも処理量を少なくすることができ、有利である。そこで、本実施例では、認識対象物の画像を次数1次以上の方程式の集合で近似して図形テンプレートを生成している。   When describing a graphic template using mathematical formulas, the data amount of the graphic template should be expressed with as few lines as possible under the condition that the error between the approximate graphic and the original measurement point data is within the allowable range. This is advantageous because the amount of processing can be reduced and the amount of processing can be reduced when generating potential space data, which will be described later. Therefore, in this embodiment, a graphic template is generated by approximating an image of a recognition target object with a set of equations of order 1 or higher.

このためには、図7(a)に示すような測定点データから最初に折れ線近似を行って、図7(b)に示すような線分111〜118を生成し、これらの線分のうち弧の部分に生じた複数の折れ線l13〜116を統合して楕円に近似しなおすことによって図7(c)に示すような直線と円弧から形成される図形121〜125を形成することができる。この他に、Hough変換を応用する方法などを利用しても構わない。   For this purpose, a polygonal line approximation is first performed from the measurement point data as shown in FIG. 7A to generate line segments 111 to 118 as shown in FIG. By integrating a plurality of broken lines l13 to 116 generated in the arc portion and approximating the ellipse again, figures 121 to 125 formed from straight lines and arcs as shown in FIG. 7C can be formed. In addition to this, a method of applying Hough conversion may be used.

このようにして図形テンプレートが生成されると、次に照合対象画像を画像処理して測定点データを生成する(S302)。ただし、ここで行われる画像処理は上述した図形テンプレートを生成する処理と同一であり、生成される測定点データは図4や図7で示したように照合対象図形を測定点の集合として表示したものである。   When the graphic template is generated in this way, the image to be collated is subjected to image processing to generate measurement point data (S302). However, the image processing performed here is the same as the processing for generating the graphic template described above, and the generated measurement point data displays the verification target graphic as a set of measurement points as shown in FIGS. Is.

次に、図形テンプレートからの相対的な位置関係に基づいて設定されたスコア値を求めてポテンシャル空間データを生成する(S303)。   Next, a score value set based on the relative positional relationship from the graphic template is obtained to generate potential space data (S303).

図2を用いて説明したように、テンプレートマッチングでは図形テンプレートと照合対象画像とを重ね合わせた場合の類似度を逐次求める必要があり、類似度としてはテンプレートマッチングの方式によって様々な指標が用いられている。この中で代表的なものとしては、公知技術である正規化相関法における「重ね合わせたテンプレート画像の画素と認識対象物を撮影した画像の画素の相互相関値」がある。   As described with reference to FIG. 2, in template matching, it is necessary to sequentially obtain the similarity when the graphic template and the image to be collated are superimposed, and various indexes are used as the similarity depending on the template matching method. ing. A typical example is “a cross-correlation value between a pixel of a superimposed template image and a pixel of an image obtained by photographing a recognition object” in a normalized correlation method which is a known technique.

本実施例では、エッジの形状をベースとしたマッチングであるので、例えば、測定点と図形テンプレートとの距離を総和した値が小さい場合に数値が高くなるような指標を類似度として用いる必要がある。   In this embodiment, since the matching is based on the shape of the edge, for example, it is necessary to use, as the similarity, an index that increases the numerical value when the sum of the distances between the measurement points and the graphic template is small. .

ところが、このような処理を行なうためには、図形テンプレートを構成する要素について最も近い位置を求める処理を行なわなければならない。例えば、図8は直線11〜17で構成された図形テンプレートを示しており、この図形テンプレートを照合対象である測定点データ上に照合する場合には、図形テンプレートを測定点データ上の照合位置Pm(x、y)に位置合わせして、その後に各測定点p(px,py)について照合位置Pm(x、y)からの相対位置Pr(xr,yr)を求める。   However, in order to perform such processing, it is necessary to perform processing for obtaining the closest position for the elements constituting the graphic template. For example, FIG. 8 shows a graphic template composed of straight lines 11 to 17, and when this graphic template is collated on the measurement point data to be collated, the graphic template is collated on the measurement point data Pm. After aligning with (x, y), the relative position Pr (xr, yr) from the verification position Pm (x, y) is obtained for each measurement point p (px, py).

この相対位置Pr(xr,yr)は
xr=px−x
yr=py−y
によって求めることができる。
The relative position Pr (xr, yr) is expressed as xr = px−x
yr = py-y
Can be obtained.

そして、図形テンプレートの全ての構成要素(直線11〜17)について最も近い位置を求め、そのうち距離が最短値dmin(minは添え字)となる位置pcを対応点として求める処理が要求される。しかしながら、多数の測定点データの各々について、図形テンプレートの全ての構成要素との距離を評価する処理は非常に処理量が多く、実行速度が実用にならないほど遅くなってしまう。   And the process which calculates | requires the nearest position about all the components (straight lines 11-17) of a graphic template, and calculates | requires the position pc from which the distance becomes the shortest value dmin (min is a subscript) as a corresponding point is requested | required. However, for each of a large number of measurement point data, the process of evaluating the distances from all the components of the graphic template is extremely large in processing amount, and the execution speed becomes too slow to be practical.

そこで、本実施例では、測定点データと図形テンプレートとの対応関係は、図形テンプレートと測定点データとの相対的な位置関係に依存して決まることを利用して、予め図形テンプレートの周囲に図形テンプレートとの相対的な位置関係に基づいてスコア値を割り当てたポテンシャル空間データを生成しておくようにする。そして、図形テンプレートと測定点データとを照合して類似度を求めるときには、上述した対応点を求める処理に替えてポテンシャル空間データを参照して各測定点のスコア値を求め、全ての測定点についてスコア値を合算したものを類似度として用いることによって高速なテンプレートマッチングを実現するようにしている。   Therefore, in this embodiment, the correspondence between the measurement point data and the graphic template is determined depending on the relative positional relationship between the graphic template and the measurement point data. Potential space data to which score values are assigned based on the relative positional relationship with the template is generated. Then, when the similarity is obtained by comparing the graphic template with the measurement point data, the score value of each measurement point is obtained by referring to the potential space data instead of the processing for obtaining the corresponding point described above, and for all measurement points. High-speed template matching is realized by using the sum of score values as the similarity.

ここで、ポテンシャル空間データを説明する。ポテンシャル空間データは、図形テンプレートとの相対的な位置関係に基づいて規定された式によって求められたスコア値を記録したデータである。最も単純な例としては、図形テンプレートからの距離が遠くなるにつれてスコア値が低くなるようにスコア値を割り当てたポテンシャル空間データがあり、この一例を図9に示す。   Here, the potential space data will be described. The potential space data is data in which a score value obtained by an expression defined based on a relative positional relationship with the graphic template is recorded. As the simplest example, there is potential space data to which a score value is assigned so that the score value decreases as the distance from the graphic template increases. An example of this is shown in FIG.

図9に示すポテンシャル空間データでは、スコア値sは

Figure 0004525526
In the potential space data shown in FIG. 9, the score value s is
Figure 0004525526

によって定義され、式(1)は、距離d(xr,yr)が0以上10未満の場合には距離d(xr,yr)=0でスコア値s=10となり、距離d(xr,yr)が大きくなるにしたがって線形にスコア値が小さくなり、距離d(xr,yr)が10以上になるとスコア値s=0となる。これによって生成されるポテンシャル空間データは、図9に示すように図形テンプレートを尾根とする2次元の等高線状の図形となる。 When the distance d (xr, yr) is 0 or more and less than 10, the equation (1) is the distance d (xr, yr) = 0 and the score value s = 10, and the distance d (xr, yr) As the value increases, the score value decreases linearly, and when the distance d (xr, yr) is 10 or more, the score value s = 0. The potential space data generated thereby becomes a two-dimensional contour figure having a graphic template as a ridge as shown in FIG.

また、上述したポテンシャル空間データの定義の仕方では、距離のみに依存する式(1)によって定義されているが、ポテンシャル空間データのスコア値を規定する方法としては式(1)に限らず、照合したときの性能を実現できればその他の関数であってもよい。   Further, in the above-described method of defining the potential space data, it is defined by the equation (1) that depends only on the distance, but the method for defining the score value of the potential space data is not limited to the equation (1), Other functions may be used as long as the performance can be realized.

そこで、スコア値を規定するための別の方法として、例えば下記の式(2)に示す関数であってもよい。

Figure 0004525526
Therefore, as another method for defining the score value, for example, a function represented by the following equation (2) may be used.
Figure 0004525526

この式(2)では、距離の自乗に比例してスコア値s(xr,yr)が減少するようになっており、式(1)の関数に比べて図形テンプレートとの距離が近い領域で急峻にスコア値が上がるため、類似したパターンが多い場合のマッチング等に適している。   In this equation (2), the score value s (xr, yr) decreases in proportion to the square of the distance, and is steep in a region closer to the graphic template than the function of equation (1). Since the score value increases, it is suitable for matching when there are many similar patterns.

また、対応点における図形テンプレート表面の法線ベクトルθ(xr,yr)(図8)と測定点p(px,py)におけるエッジ方向δ(px,py)を併用した下記の式(3)であってもよい。

Figure 0004525526
Further, the following equation (3) using the normal vector θ (xr, yr) (FIG. 8) on the surface of the graphic template at the corresponding point and the edge direction δ (px, py) at the measurement point p (px, py) together. There may be.
Figure 0004525526

この式(3)では、図5(c)のエッジ方向画像53の測定点p(px,py)における値を利用しており、式(1)ではスコア値が距離に対して線形に減少していたが、式(3)では距離に加えてさらに対応点における図形テンプレート表面の法線ベクトルθ(xr,yr)と測定点データにおける法線方向δ(px,py)の差が90度以内である場合に、この方向差の余弦値を乗じるようにしたので、「距離が近く、尚且つ面の法線方向が一致している場合に高いスコア値が与えられる」ようになっており、式(1)よりも照合の信頼性を高めることが可能となる。   In this equation (3), the value at the measurement point p (px, py) of the edge direction image 53 in FIG. 5C is used. In equation (1), the score value decreases linearly with respect to the distance. However, in Expression (3), in addition to the distance, the difference between the normal vector θ (xr, yr) on the surface of the graphic template at the corresponding point and the normal direction δ (px, py) in the measurement point data is within 90 degrees. In this case, the cosine value of this direction difference is multiplied, so that “a high score value is given when the distance is close and the normal direction of the surface is the same”. Compared to equation (1), the collation reliability can be increased.

式(3)の場合、スコア値s(xr,yr,δ)は相対位置Pr(xr,yr)とともに、測定点データの法線方向δに依存するので、ポテンシャル空間データは図10に示すように、図形テンプレートの周囲の各点についてδの1次元配列のスコア値が割り振られた3次元のデータとなっている。また、データ量を抑えるためには、スコア値s(xr,yr,δ)を直接的にポテンシャル空間データとして記録するのではなく、法線方向θ(xr,yr)のみを記録しておき、照合処理を実行する際に重みcos(θ(xr,yr)−δ(px,py))を計算するようにしてもよい。   In the case of Expression (3), the score value s (xr, yr, δ) depends on the normal direction δ of the measurement point data together with the relative position Pr (xr, yr), so the potential space data is as shown in FIG. In addition, three-dimensional data in which score values of a one-dimensional array of δ are assigned to each point around the graphic template. In order to reduce the data amount, the score value s (xr, yr, δ) is not directly recorded as potential space data, but only the normal direction θ (xr, yr) is recorded. The weight cos (θ (xr, yr) −δ (px, py)) may be calculated when executing the matching process.

このようにして生成されたポテンシャル空間データでは、図形テンプレートとその周囲にある測定点との相対的な位置関係にのみ依存して一意に求めることができる。したがって、「天体には周囲に重力場が生じ、天体の周辺に接近した物体にはその質量と天体との距離に応じた重力(ポテンシャルエネルギー)がかかる」、「磁石の周囲には磁場が生じ、磁石に接近した磁性体には磁性体自体の磁力、磁性体の着磁方向と相互の距離に応じた反力または引力を受ける」のと同じように、図形テンプレートの周囲に「テンプレートまでの距離の短さ」と「表面の法線ベクトルの一致度」に応じてポテンシャル値が与えられるような「ポテンシャル場」を設定し、そのポテンシャル場に入った測定点の各点について、図形テンプレートとの相対的な位置関係に基づいて一意に得られるポテンシャル値を合計すれば、このポテンシャル値の合計が大きいほど「ポテンシャル場に入った測定点の数が多く」「図形テンプレートとの位置や法線ベクトルが類似」していることになり、照合処理における類似度が高い位置を容易に検出できる。   The potential space data generated in this way can be uniquely determined depending only on the relative positional relationship between the graphic template and the measurement points around it. Therefore, “A celestial body has a gravitational field around it, and an object approaching the celestial body is subject to gravity (potential energy) according to the distance between the mass and the celestial body.” “A magnetic field is created around the magnet. The magnetic material close to the magnet receives the reaction force or attractive force according to the magnetic force of the magnetic material itself, the magnetization direction of the magnetic material, and the mutual distance. Set a “potential field” that gives a potential value according to the “shortness of distance” and “the degree of coincidence of normal vectors on the surface”, and for each of the measurement points that entered the potential field, If the potential values uniquely obtained based on the relative positional relationship between the two are larger, the larger the total potential value, the greater the number of measurement points that have entered the potential field. It will be located and the normal vector of the plate is similar "can easily detect the position degree of similarity in the verification process.

ポテンシャル場に入った測定点に対して与えられるポテンシャル値は、前述のように測定点と図形テンプレートとの相対的な位置関係にのみ依存して求められるので、先に図8を用いて説明したような煩雑な対応付け処理は一切要らず、予め求められたポテンシャル空間上の「その位置でのポテンシャル値」を記録した「ポテンシャル空間データ」を参照するだけであるので、極めて高速な類似度計算が可能となり、しらみつぶしに位置合わせ照合処理を行ったとしても、従来のような対応付け処理を必要とするパターンマッチング法はもとより、Hough変換やニューラルネットワークなどを応用した数理的解法に比べても遙かに高速なパターンマッチングを可能にすることができる。   Since the potential value given to the measurement point that has entered the potential field can be obtained only depending on the relative positional relationship between the measurement point and the graphic template as described above, it has been described with reference to FIG. There is no need for such a complicated association process, and it is only necessary to refer to “potential space data” that records the “potential value at that position” in the potential space determined in advance. Even if the alignment matching process is performed in a brilliant manner, not only the conventional pattern matching method that requires the matching process but also the mathematical solution method using Hough transform, neural network, etc. Much faster pattern matching can be achieved.

このようにしてポテンシャル空間データが生成されると、次に照合対象画像にポテンシャル空間データを照合して認識対象物の検出を行なう。ここでは、図2で示した照合対象画像に、図9で示したポテンシャル空間データを利用して照合する例を図11に基づいて説明する。   When the potential space data is generated in this way, the recognition target object is detected by collating the potential space data with the collation target image. Here, an example in which the image to be collated shown in FIG. 2 is collated using the potential space data shown in FIG. 9 will be described based on FIG.

図3のステップS303の処理に続いて、まず、ポテンシャル空間データを照合対象画像に照合するための照合位置Pm(x,y)をサーチ始点にセットする(S304)。通常、サーチ始点は照合対象画像の左上端に設定され、そこから右端までサーチしてから1画素下の左端へ移動し、再び右端までサーチするというラスタ走査が行なわれる。   Following the processing of step S303 in FIG. 3, first, a collation position Pm (x, y) for collating the potential space data with the collation target image is set as a search start point (S304). Usually, the search start point is set at the upper left end of the image to be collated, and the raster scanning is performed in which the search is made from there to the right end, then moved to the left end one pixel below, and the search is made to the right end again.

こうしてラスタ走査を行なっていき、例えば図11bの位置にポテンシャル空間データが照合されると、星型の照合対象図形上にある測定点のうち測定点番号を最初の測定点に設定するとともに、この照合(1)Pm(x,y)における類似度S(x,y)の値を0にリセットする(S305)。ここで、ポテンシャル空間データと重なり合う測定点p101〜p120の各々に割り振られた測定点番号は、ラスタ順に割り振られているものと仮定する。   In this way, raster scanning is performed. For example, when the potential space data is collated at the position shown in FIG. 11b, the measurement point number is set as the first measurement point among the measurement points on the star-shaped verification target graphic. Collation (1) The value of similarity S (x, y) in Pm (x, y) is reset to 0 (S305). Here, it is assumed that the measurement point numbers assigned to the measurement points p101 to p120 overlapping with the potential space data are assigned in raster order.

次に、各測定点におけるスコア値をポテンシャル空間データを参照することにより求めて類似度S(x,y)を計算する過程(S306〜S310)を実施する。まず、最初の測定点p101について、その座標値をテンプレート基準位置を原点とする相対座標に変換する。この処理は、テンプレート基準位置は照合位置Pm(x,y)に位置合わせているので、図3のS306に示すように測定点座標p101(px,py)の照合位置Pm(x,y)からの相対位置Pr(xr,yr)を求めればよい。ポテンシャル空間データは相対位置Pr(xr,yr)の位置におけるスコア値s(xr,yr)を保持しているので、このスコア値s(xr,yr)を参照(S307)して照合位置Pm(x,y)における類似度S(x,y)に加算する(S308)。例えば測定点p101の場合、スコア値s(xr,yr)は図11から分かるように8である。さらに、他に測定点がある場合には次の測定点に移動(S309〜S310)し、同様の処理をポテンシャル空間データと重なり合う測定点p101〜p120すべてについて行うことにより、照合位置Pm(x,y)における類似度S(x,y)が求められる。   Next, the process (S306 to S310) of calculating the similarity S (x, y) by obtaining the score value at each measurement point by referring to the potential space data is performed. First, the coordinate value of the first measurement point p101 is converted into relative coordinates with the template reference position as the origin. In this process, since the template reference position is aligned with the collation position Pm (x, y), as shown in S306 of FIG. 3, the collation position Pm (x, y) of the measurement point coordinates p101 (px, py) is used. The relative position Pr (xr, yr) may be obtained. Since the potential space data holds the score value s (xr, yr) at the position of the relative position Pr (xr, yr), the score value s (xr, yr) is referred to (S307) and the matching position Pm ( Add to the similarity S (x, y) in x, y) (S308). For example, in the case of the measurement point p101, the score value s (xr, yr) is 8, as can be seen from FIG. Further, if there are other measurement points, the process moves to the next measurement point (S309 to S310), and the same processing is performed for all the measurement points p101 to p120 that overlap with the potential space data, so that the collation position Pm (x, The similarity S (x, y) in y) is obtained.

ここで、上記類似度S(x,y)の値と最大の類似度Smax(maxは添え字)を比較する(S311)。照合位置Pm(x,y)における類似度S(x,y)がSmaxよりも大きければ現在の照合位置Pm(x,y)を検出位置m(x,y)に代入する(S312)。その後、照合位置Pm(x,y)のラスタ走査が終了していない(次候補がある)場合には、照合位置Pm(x,y)を次候補に設定してさらに上記と同様に類似度S(x,y)を求める処理を繰り返す(S313〜S314)。過程S313において、ラスタ走査が終了しており次候補が存在しない場合には、その次点での検出位置m(x,y)がパターンマッチングの結果となるのである。   Here, the value of the similarity S (x, y) is compared with the maximum similarity Smax (max is a subscript) (S311). If the similarity S (x, y) at the collation position Pm (x, y) is larger than Smax, the current collation position Pm (x, y) is substituted into the detection position m (x, y) (S312). After that, when the raster scanning of the collation position Pm (x, y) is not completed (there is a next candidate), the collation position Pm (x, y) is set as the next candidate and the similarity is further similar to the above. The process for obtaining S (x, y) is repeated (S313 to S314). In step S313, when raster scanning is completed and there is no next candidate, the detection position m (x, y) at the next point is the result of pattern matching.

ここで、上述したパターンマッチングによる処理結果を図11を用いて説明する。まず、ラスタ走査を実施して照合位置Pm(x,y)が図11aの位置に来た時点で得られる類似度S(x,y)は、測定点が存在しないため0である。   Here, the processing result by the pattern matching mentioned above is demonstrated using FIG. First, the similarity S (x, y) obtained when raster scanning is performed and the collation position Pm (x, y) reaches the position shown in FIG. 11a is 0 because there is no measurement point.

次に、照合位置Pm(x,y)が図形テンプレートの図形とは異なる星型の図形が存在する図11bの位置に来た時点で得られる類似度S(x,y)は、測定点p101〜120が存在するので、上述のような過程により各測定点におけるスコア値をポテンシャル空間データを参照して合算することにより類似度S(x,y)=156と低い値が求められる。   Next, the similarity S (x, y) obtained when the collation position Pm (x, y) comes to the position of FIG. 11b where a star-shaped figure different from the figure of the figure template exists is the measurement point p101. ˜120 exist, the score S at each measurement point is summed with reference to the potential space data by the above-described process, and a low value of similarity S (x, y) = 156 is obtained.

次に、照合位置Pm(x,y)が図形テンプレートの図形とは同じ図形が存在する図11cの位置に来た時点で得られる類似度S(x,y)は、測定点p201〜223が存在し、これらがポテンシャル空間データのスコアの高い部分と重なりあっているので、類似度S(x,y)=230と高い値が求められ、この値が画像中において最大の類似度となるので、最終的に図11cの位置が認識対象物の検出位置m(x,y)として得られるのである。   Next, the similarity S (x, y) obtained when the collation position Pm (x, y) comes to the position of FIG. 11c where the same figure as the figure of the figure template exists is measured by the measurement points p201 to 223. Since these exist and overlap with a high score portion of the potential space data, a high value of similarity S (x, y) = 230 is obtained, and this value is the maximum similarity in the image. Finally, the position of FIG. 11c is obtained as the detection position m (x, y) of the recognition object.

このように、本発明のパターンマッチング方法によれば、ポテンシャル空間データを用いて類似度を求めるようにしたので、先にポテンシャル空間データ生成処理の説明において述べたような、測定点から図形テンプレート上の対応点の検出や測定点との距離の計算、距離に基づくスコア値の計算などの煩雑な処理がテンプレートと測定点データを照合する処理の際には不要となり、各測定点におけるスコアをポテンシャル空間データを参照して求め単純に合算処理するだけで類似度が得られるので、極めて高速なテンプレートマッチングが可能となるのである。   As described above, according to the pattern matching method of the present invention, the similarity is obtained by using the potential space data, so that the measurement point is displayed on the graphic template as described in the description of the potential space data generation processing. Complicated processing such as detection of corresponding points, calculation of distances to measurement points, and calculation of score values based on distances are not required for the process of matching templates and measurement point data. Since the similarity can be obtained by simply referring to the spatial data and simply performing the summing process, extremely fast template matching is possible.

なお、上述した例では類似度をスコア値の合計としているが、例えば類似度の平均値を用いるようにしてもよい。平均値を用いた場合には、図11aの位置における類似度は0、図11bの位置では類似度7.8、図11cの位置では類似度10となり、図11cの位置が最大の類似度となって認識対象物の検出位置となる。   In the example described above, the similarity is the sum of the score values, but for example, an average value of the similarities may be used. When the average value is used, the similarity at the position of FIG. 11a is 0, the similarity at the position of FIG. 11b is 7.8, the similarity at the position of FIG. 11c is 10, and the position of FIG. It becomes the detection position of the recognition object.

また、上述した例では照合対象図形の向きは図形テンプレートの向きと同一、すなわち回転が生じないことが既知である場合について説明しているが、回転やスケール変動を伴う場合には、測定点もしくはポテンシャル空間データにアフィン変換(拡大縮小・回転変換)を施す必要がある。しかし、測定点のすべてにアフィン変換を行う処理は処理量が多くて実用的ではなく、また回転やスケールの変動範囲が大きいような場合にはポテンシャル空間データにアフィン変換を行う処理も処理量が多くなる。そこで、そのような場合には図12に示すように、ポテンシャル空間データに予めアフィン変換を施したデータを用意しておき、照合処理を行う際にアフィン変換を施したポテンシャル空間データを順次照合していくようにすることで、回転やスケール変動がある場合でも認識を可能にすることができる。   In the above-described example, the direction of the figure to be collated is the same as the direction of the figure template, that is, it is known that rotation does not occur. It is necessary to perform affine transformation (enlargement / reduction / rotation transformation) on the potential space data. However, the process of performing affine transformation on all measurement points is not practical due to the large amount of processing, and the processing of performing affine transformation on potential space data is also necessary when the range of rotation or scale fluctuation is large. Become more. Therefore, in such a case, as shown in FIG. 12, data that has been subjected to affine transformation in advance is prepared for potential space data, and the potential space data that has been subjected to affine transformation is sequentially collated when performing collation processing. By doing so, it is possible to recognize even when there is rotation or scale fluctuation.

上述したように、本実施例のパターンマッチング方法では、図形テンプレートからの相対的な位置関係に基づいてスコア値を設定したポテンシャル空間データを生成し、このポテンシャル空間データと測定点データとを照合することによってスコア値を求め、求められたスコア値に基づいて類似度を算出して照合対象図形が認識対象物であるか否かを判定するので、従来では必要であった対応点探索処理が不要となり、ポテンシャル空間データに測定点を照合した際に測定点毎に得られるスコア値を演算するだけで類似度を得ることでき、これによって従来に比べて遙かに高速なパターンマッチング処理を実現することが可能となる。   As described above, in the pattern matching method of the present embodiment, potential space data in which score values are set based on the relative positional relationship from the graphic template is generated, and the potential space data and the measurement point data are collated. Since the score value is obtained and the similarity is calculated based on the obtained score value to determine whether or not the figure to be collated is a recognition target object, the corresponding point search process that was necessary in the past is unnecessary. Therefore, it is possible to obtain a similarity by simply calculating the score value obtained for each measurement point when matching the measurement point with the potential space data, thereby realizing a much faster pattern matching process than before. It becomes possible.

また、本実施例のパターンマッチング方法では、生成した図形テンプレートに欠落部があるときには修復するので、図形テンプレートに欠落がある場合でも認識対象物の本来の形状を正しく表すことができ、ノイズの多いパターンでも本方法を適用することが可能となる。さらに、このような構成にすることで、冗長な直線部分では図形テンプレートの座標点密度を低くすることができ、図形テンプレートの容量を抑えることが可能となる。   Further, in the pattern matching method of the present embodiment, since the generated graphic template is repaired when there is a missing portion, the original shape of the recognition target can be correctly represented even when there is a missing graphic template, and there is a lot of noise. This method can be applied even to a pattern. Further, with such a configuration, the coordinate point density of the graphic template can be lowered in the redundant straight line portion, and the capacity of the graphic template can be suppressed.

また、本実施例のパターンマッチング方法では、認識対象物の画像を次数1次以上の方程式の集合で近似して図形テンプレートを生成するので、図形テンプレートの容量を最小限に抑えることが可能となり、高速なパターンマッチング処理を実現することが可能となる。   Further, in the pattern matching method of the present embodiment, the graphic template is generated by approximating the image of the recognition target object with a set of equations of the first order or higher, so that the capacity of the graphic template can be minimized. High-speed pattern matching processing can be realized.

次に、本発明の実施例2を図面に基づいて説明する。本実施例のパターンマッチング方法では、照合対象図形の特徴が失われない範囲で最小限の測定点を選択し、この測定点に対してスコア値を求めるようにしたことが実施例1と異なっている。ただし、その他の処理は実施例1と同一なので詳しい説明は省略する。   Next, a second embodiment of the present invention will be described with reference to the drawings. The pattern matching method of this embodiment is different from the first embodiment in that the minimum measurement points are selected within a range in which the features of the figure to be collated are not lost, and the score value is obtained for these measurement points. Yes. However, since other processes are the same as those in the first embodiment, detailed description thereof is omitted.

実施例1のパターンマッチング処理の一例を示す図11では、測定点の全てについてポテンシャル空間データを参照してスコア値を求めるようにしていたが、図形の特徴を損なわない範囲内で測定点を間引くことにより、より高速な処理を可能にすることができる。   In FIG. 11 showing an example of the pattern matching process of the first embodiment, the score values are obtained with reference to the potential space data for all the measurement points, but the measurement points are thinned out within a range that does not impair the feature of the figure. As a result, higher-speed processing can be realized.

そこで、本実施例では、照合対象図形の特徴が失われない範囲で最小限の測定点を選択し、この測定点に対してスコア値を求めるようにしている。   Therefore, in this embodiment, a minimum measurement point is selected within a range in which the feature of the verification target graphic is not lost, and a score value is obtained for this measurement point.

ここで、図11の例における測定点の中から最小限の測定点を選択して間引いた状態を図13に示す。図13に示すように、図13bの位置にある星型の照合対象図形では測定点の数が20から10に間引かれており、図13cの位置では測定点の数が23から12に減らされている。   Here, FIG. 13 shows a state in which the minimum measurement points are selected from the measurement points in the example of FIG. As shown in FIG. 13, the number of measurement points is thinned from 20 to 10 in the star-shaped verification target graphic at the position of FIG. 13b, and the number of measurement points is reduced from 23 to 12 at the position of FIG. 13c. Has been.

この場合に類似度を算出すると、図13bの位置では66、図13cの位置では120となり、図13cの位置で類似度が最大となるので、正しいマッチング結果が得られることが分かる。なお、この場合の間引き間隔は、図形テンプレートにおいて、例えば最も短い線分の長さの半分程度とするように選ぶことで図形の特徴を損なわない範囲内で測定点を間引くことが可能となる。   If the similarity is calculated in this case, it is 66 at the position of FIG. 13b and 120 at the position of FIG. 13c, and the similarity is maximum at the position of FIG. In this case, by selecting the thinning interval in the graphic template so as to be, for example, about half the length of the shortest line segment, the measurement points can be thinned out within a range that does not impair the characteristics of the graphic.

このように本実施例のパターンマッチング方法では、照合対象図形の特徴が失われない範囲で最小限の測定点を選択し、この測定点に対してスコア値を求めるようにしたので、図形テンプレートと照合する際に誤判定を起こすことなく処理の負荷を軽減することが可能となる。   As described above, in the pattern matching method of the present embodiment, the minimum measurement points are selected within a range in which the features of the verification target graphic are not lost, and the score value is obtained for the measurement points. It is possible to reduce the processing load without causing erroneous determination when collating.

次に、本発明の実施例3を図面に基づいて説明する。本実施例のパターンマッチング方法では、スコア値を表すサンプリング点群によってポテンシャル空間データを構成し、このサンプリング点群の中から測定点に近接するサンプリング点を複数選択してこれらのサンプリング点のスコア値に基づいて測定点のスコア値を求めるようにしたことが実施例1と異なっている。ただし、その他の処理は実施例1と同一なので詳しい説明は省略する。   Next, Embodiment 3 of the present invention will be described with reference to the drawings. In the pattern matching method of this embodiment, potential space data is configured by sampling point groups representing score values, and a plurality of sampling points close to the measurement points are selected from the sampling point groups, and the score values of these sampling points are selected. The difference from the first embodiment is that the score value of the measurement point is obtained based on the above. However, since other processes are the same as those in the first embodiment, detailed description thereof is omitted.

実施例1で説明した図9および図10に示すポテンシャル空間データは、説明の便宜上領域ごとにスコア値が割り振られているように描かれているが、実際に計算機で生成されるポテンシャル空間データは、図形テンプレートの周囲に適宜なサンプリング間隔でサンプリング点を配置し、サンプリング点毎にスコア値を割り当てたポテンシャル空間データとなるので、図14(a)に示すような形態になっている。   The potential space data shown in FIG. 9 and FIG. 10 described in the first embodiment is drawn so that score values are assigned for each region for convenience of explanation, but the potential space data actually generated by a computer is Since the sampling point is arranged at an appropriate sampling interval around the graphic template and the potential space data is assigned a score value for each sampling point, the form is as shown in FIG.

また、サンプリング点の間隔は、図形テンプレートの形状をもとに、元の図形の形状を損なわない程度の間隔を定めておけばよいので、図14(b)のように冗長な線分の周囲ではサンプリング間隔を大きく取り、複雑な部分ではサンプリング間隔を細かく設定するようにすれば、ポテンシャル空間データのデータ量を低く抑えることが可能となる。   In addition, the sampling point interval may be determined based on the shape of the graphic template so as not to impair the shape of the original graphic. Therefore, as shown in FIG. Then, if the sampling interval is set large and the sampling interval is set finely in a complicated part, the amount of potential space data can be kept low.

このように、本実施例のポテンシャル空間データにおけるスコア値は、あるサンプリング間隔をもって離散的に配置されているので、図15に示す測定点の相対位置pr(xr、yr)は必ずしもサンプリング点の座標s(xr’,yr’)と一致するとは限らない。したがって、スコア値を求めるためには、測定点の相対位置pr(xr、yr)に近接する4つのサンプリング点のスコア値s(xr’,yr’)、s(xr’+1,yr’)、s(xr’,yr’+1)、s(xr’+1,yr’+1)から式(4)に示す補間処理を行なって求めることが必要となる。

Figure 0004525526
As described above, since the score values in the potential space data of the present embodiment are discretely arranged with a certain sampling interval, the relative position pr (xr, yr) of the measurement point shown in FIG. 15 is not necessarily the coordinates of the sampling point. It does not always match s (xr ′, yr ′). Therefore, in order to obtain the score value, the score values s (xr ′, yr ′), s (xr ′ + 1, yr ′) of four sampling points close to the relative position pr (xr, yr) of the measurement point, It is necessary to perform the interpolation processing shown in Expression (4) from s (xr ′, yr ′ + 1) and s (xr ′ + 1, yr ′ + 1).
Figure 0004525526

このように、本実施例のパターンマッチング方法では、スコア値を表すサンプリング点群によってポテンシャル空間データを構成し、サンプリング点群の中から測定点に近接するサンプリング点を複数選択してこれらのサンプリング点のスコア値に基づいて測定点のスコア値を求めるので、ポテンシャル空間データを生成する際にサンプリング間隔を粗くして図形テンプレートのデータ量を抑えることが可能となる。また、サブピクセル検出を行うためにサンプリング間隔を細かくしたポテンシャル空間データを生成する代わりに本実施例の方法を用いることによって、データ量を増大させることなく高精度化することが可能になる。   As described above, in the pattern matching method of this embodiment, the potential space data is configured by the sampling point group representing the score value, and a plurality of sampling points close to the measurement point are selected from the sampling point group, and these sampling points are selected. Since the score value of the measurement point is obtained based on the score value, it is possible to reduce the data amount of the graphic template by roughening the sampling interval when generating the potential space data. In addition, by using the method of this embodiment instead of generating potential space data with a narrow sampling interval in order to perform sub-pixel detection, it becomes possible to increase the accuracy without increasing the amount of data.

次に、本発明の実施例4を図面に基づいて説明する。本実施例のパターンマッチング方法では、照合対象図形に近似させたクラスタを生成し、このクラスタの特徴を表すブロブ情報に基づいて認識対象物ではない照合対象図形を検出してスコア値を求める対象から削除するようにしたことが実施例1と異なっている。ただし、その他の処理は実施例1と同一なので詳しい説明は省略する。   Next, a fourth embodiment of the present invention will be described with reference to the drawings. In the pattern matching method of the present embodiment, a cluster approximated to a matching target graphic is generated, and a matching target graphic that is not a recognition target is detected based on blob information representing the characteristics of the cluster, and a score value is obtained from the target. This is different from the first embodiment. However, since other processes are the same as those in the first embodiment, detailed description thereof is omitted.

実施例1において図11に示す例では、図11aの位置は測定点が全く無い位置になるので照合処理を行っても意味がない。また。図11bの位置についても全く形状が異なることが予め予測できれば、照合処理を行う必要がなくなる。したがって、このようなケースを簡単に抽出できれば、大幅に処理速度を向上させることができる。   In the example shown in FIG. 11 in the first embodiment, the position shown in FIG. 11a is a position where there is no measurement point, so it is meaningless to perform the collation process. Also. If it can be predicted in advance that the positions in FIG. Therefore, if such a case can be extracted easily, the processing speed can be greatly improved.

そこで、本実施例では、図16に示すように、まず比較的相互の距離が近い測定点の集まりをクラスタとする処理を行い、次にこの処理によって得られたクラスタc1〜c4について、領域の幅や高さ、測定点の密度などパターンの特徴を表すブロブ情報を抽出し、明らかにブロブ情報が異なる場合には照合を行わないようにする。   Therefore, in this embodiment, as shown in FIG. 16, first, a process is performed in which a collection of measurement points that are relatively close to each other is used as a cluster, and then, for clusters c1 to c4 obtained by this process, the region Blob information representing pattern features such as width, height, density of measurement points, etc. is extracted, and collation is not performed when the blob information is clearly different.

例えば、図16ではc1とc2のクラスタは、高さと幅の情報が図形テンプレートと全く異なるので、この付近では照合処理を実施しない。また、c3とc4の位置ではクラスタの中心付近を重点的に照合することで、高速なマッチング処理を実行することができる。   For example, in FIG. 16, the c1 and c2 clusters are completely different from the graphic template in height and width information, so that the matching process is not performed in this vicinity. In addition, high-speed matching processing can be executed by focusing on the vicinity of the center of the cluster at the positions c3 and c4.

このように、本実施例のパターンマッチング方法では、照合対象図形に近似させたクラスタを生成し、このクラスタの特徴を表すブロブ情報に基づいて認識対象物ではない照合対象図形を検出してスコア値を求める対象から削除するので、多数の部品が同時に計測された3次元形状データから部品認識を行なうような処理量が非常に多くなる場合に、認識対象となる部品とノイズなどの認識対象物以外の物体を迅速に見分けることができ、処理速度を高速化することができる。   As described above, in the pattern matching method of this embodiment, a cluster approximated to the verification target graphic is generated, and the verification target graphic that is not the recognition target is detected based on the blob information representing the feature of the cluster, and the score value is detected. If the amount of processing that recognizes parts from 3D shape data measured at the same time for a large number of parts is very large, the parts to be recognized and other objects to be recognized such as noise Can be quickly identified, and the processing speed can be increased.

次に、本発明の実施例5を説明する。本実施例のパターンマッチング方法では、照合対象図形と図形テンプレートとの類似度を示す統計値である相互相関値を算出して絶対的な類似度を算出するようにしたことが実施例1と異なっている。ただし、その他の処理は実施例1と同一なので詳しい説明は省略する。   Next, a fifth embodiment of the present invention will be described. The pattern matching method of this embodiment differs from that of the first embodiment in that the absolute similarity is calculated by calculating the cross-correlation value, which is a statistical value indicating the similarity between the matching target graphic and the graphic template. ing. However, since other processes are the same as those in the first embodiment, detailed description thereof is omitted.

実施例1では、認識対象物を撮影もしくは計測した照合対象画像にポテンシャル空間データを照合してパターンの位置・姿勢を認識して認識対象物を検出しているが、この処理によって出力される類似度はあくまで画面中で相対的に類似度の高い位置を出力しているだけであって、図形テンプレートの形状に対する絶対的な類似度が得られているわけではない。   In the first embodiment, the recognition target object is detected by collating the potential space data with the collation target image obtained by photographing or measuring the recognition target object and recognizing the position / orientation of the pattern. The degree is merely outputting a position having a relatively high degree of similarity in the screen, and an absolute degree of similarity to the shape of the figure template is not obtained.

そこで、本実施例では実施例1で説明した照合処理を行った後に、改めて式(5)に示す相互相関値Scを算出して絶対的な類似度を求めるようにしている。

Figure 0004525526
Therefore, in this embodiment, after the collation process described in the first embodiment is performed, the cross-correlation value Sc shown in Expression (5) is calculated again to obtain the absolute similarity.
Figure 0004525526

この相互相関値Scは、相対位置Pr(xr,yr)と、相対位置から最も近い図形テンプレートの要素に下ろした垂線の足、すなわち図8の対応点Pc(xc,yc)との間の位置関係における総合的な類似度を示す統計値であり、相対位置Prと対応点Pcとが完全に一致すると、相互相関値Sc=1となって図形テンプレートと照合対象図形とが完全に重なり合うことを示す。また、一致しない場合には相互相関値Scは0に近づいていく。したがって、相互相関値Scは絶対的な類似度を0〜1の値に正規化して求めている。   This cross-correlation value Sc is a position between the relative position Pr (xr, yr) and the foot of the perpendicular drawn to the element of the graphic template closest to the relative position, that is, the corresponding point Pc (xc, yc) in FIG. This is a statistical value indicating the overall similarity in the relationship. When the relative position Pr and the corresponding point Pc completely match, the cross correlation value Sc = 1 and the graphic template and the verification target graphic are completely overlapped. Show. If they do not match, the cross-correlation value Sc approaches zero. Therefore, the cross-correlation value Sc is obtained by normalizing the absolute similarity to a value of 0 to 1.

このように絶対的な類似度を求めることによって、例えば文字認識などに応用する場合に異なる複数の図形テンプレートを併用して、どの図形が撮影されているのかを弁別するような処理に利用することが可能となる。なお、上述したポテンシャル空間データには対応点Pcの座標値は記録されていないので、本実施例の方法を実施するためには、実施例1で説明した照合処理を行なった後に改めて対応点Pcを求める処理を行うか、あるいは対応点Pcの座標値をポテンシャル空間データのサンプリング点ごとに予め記録しておくようにすればよい。   By obtaining absolute similarity in this way, for example, when applying to character recognition, etc., it can be used for processing such as distinguishing which figure is photographed by using a plurality of different figure templates together Is possible. In addition, since the coordinate value of the corresponding point Pc is not recorded in the potential space data described above, the corresponding point Pc is anew after performing the matching process described in the first embodiment in order to carry out the method of the present embodiment. Or the coordinate value of the corresponding point Pc may be recorded in advance for each sampling point of the potential space data.

このように、本実施例のパターンマッチング方法では、照合対象図形と図形テンプレートとの類似度を示す統計値である相互相関値を算出するので、相対的な類似度ではなく、図形テンプレートと照合対象図形との絶対的な類似度を求めることができ、信頼性を向上させることができる。   As described above, in the pattern matching method of this embodiment, the cross-correlation value, which is a statistical value indicating the degree of similarity between the matching target graphic and the graphic template, is calculated. The absolute similarity to the figure can be obtained, and the reliability can be improved.

次に、本発明の実施例6を図面に基づいて説明する。実施例1では対象物が2次元データ(画像)の場合について説明したが、本実施例では3次元データ(立体形状データ)に対してパターンマッチングを行なう場合について説明する。   Next, a sixth embodiment of the present invention will be described with reference to the drawings. In the first embodiment, the case where the object is two-dimensional data (image) has been described. In this embodiment, a case where pattern matching is performed on three-dimensional data (three-dimensional shape data) will be described.

図17は実施例6に係るパターンマッチング方法を実施するためのパターンマッチング装置の構成を示すブロック図である。図17に示すように、本実施例のパターンマッチング装置71は、立体形状の対象物72の3次元形状を入力する画像入力装置としてのレーザ3次元センサ73と、レーザ3次元センサ73からの出力信号を3次元形状データに変換する3次元データ生成装置74と、3次元データ生成装置74で生成されたデータを格納する記憶装置75と、画像処理を行なってパターンマッチングを実施する画像処理装置76とを備えている。   FIG. 17 is a block diagram illustrating a configuration of a pattern matching apparatus for performing the pattern matching method according to the sixth embodiment. As shown in FIG. 17, the pattern matching device 71 of this embodiment includes a laser three-dimensional sensor 73 as an image input device that inputs a three-dimensional shape of a three-dimensional object 72, and an output from the laser three-dimensional sensor 73. A three-dimensional data generation device 74 that converts a signal into three-dimensional shape data, a storage device 75 that stores data generated by the three-dimensional data generation device 74, and an image processing device 76 that performs image processing and performs pattern matching. And.

このように構成されたパターンマッチング装置71において、立体形状の対象物72の表面をレーザ3次元センサ73がレーザ光線によって走査し、レーザ3次元センサ73からの出力信号が3次元データ生成装置74に入力されて処理され、対象物72表面の3次元座標点群に変換される。この3次元座標点群は記憶装置75に格納され、画像処理装置76は格納されている3次元座標点群に対して画像処理を行なってパターンマッチングを実施する。   In the pattern matching device 71 configured as described above, the laser three-dimensional sensor 73 scans the surface of the three-dimensional object 72 with a laser beam, and an output signal from the laser three-dimensional sensor 73 is sent to the three-dimensional data generation device 74. It is input and processed, and converted into a three-dimensional coordinate point group on the surface of the object 72. The three-dimensional coordinate point group is stored in the storage device 75, and the image processing device 76 performs image processing on the stored three-dimensional coordinate point group to perform pattern matching.

本実施例のパターンマッチング装置71によって実施される照合処理は、実施例1で説明した2次元データに対する処理と同様に実施することができるが、図形テンプレートを生成する処理では、図18(a)に示すような三角パッチやNURB、ベジェ等の曲面で構成された図形テンプレートを生成して利用する。また、図18(a)に示すように図形の分断や穴(図18中のh)などがある場合には図18(b)に示すような補完処理を行うようにする。   The matching process performed by the pattern matching apparatus 71 of the present embodiment can be performed in the same manner as the process for the two-dimensional data described in the first embodiment. However, in the process of generating a graphic template, FIG. A graphic template composed of curved surfaces such as triangular patches, NURB, and Bezier as shown in FIG. Also, as shown in FIG. 18A, when there is a division of a figure or a hole (h in FIG. 18), a complementing process as shown in FIG. 18B is performed.

このようにして生成された図形テンプレートを用いて、3次元のポテンシャル空間データを生成し、実施例1ないし5と同様に3次元の測定点データとの照合処理を行うことにより、本実施例のパターンマッチング方法によれば2次元データだけでなく3次元データに対してもパターンマッチングを実施することができる。   By using the graphic template generated in this way, three-dimensional potential space data is generated, and verification processing with the three-dimensional measurement point data is performed in the same manner as in the first to fifth embodiments. According to the pattern matching method, pattern matching can be performed not only on two-dimensional data but also on three-dimensional data.

以上、本発明のパターンマッチング方法について、図示した実施例に基づいて説明したが、本発明はこれに限定されるものではなく、各部の構成は同様の機能を有する任意の構成のものに置き換えることができる。   The pattern matching method of the present invention has been described based on the illustrated embodiment. However, the present invention is not limited to this, and the configuration of each part is replaced with an arbitrary configuration having the same function. Can do.

本発明の実施例1に係るパターンマッチング方法を実施するためのパターンマッチング装置の構成を示すブロック図である。It is a block diagram which shows the structure of the pattern matching apparatus for enforcing the pattern matching method which concerns on Example 1 of this invention. テンプレートマッチングの概念を説明するための図である。It is a figure for demonstrating the concept of template matching. 本発明の実施例1に係るパターンマッチング方法による照合処理を示すフローチャートである。It is a flowchart which shows the collation process by the pattern matching method which concerns on Example 1 of this invention. (a)、(b)は本発明の実施例1に係るパターンマッチング方法により生成された図形テンプレートの一例を示す図である。(A), (b) is a figure which shows an example of the figure template produced | generated by the pattern matching method based on Example 1 of this invention. (a)〜(e)は本発明の実施例1に係るパターンマッチング方法による画像処理を説明するための図である。(A)-(e) is a figure for demonstrating the image processing by the pattern matching method which concerns on Example 1 of this invention. (a)、(b)は本発明の実施例1に係るパターンマッチング方法による図形テンプレートの欠落部を修復する方法を説明するための図である。(A), (b) is a figure for demonstrating the method to repair the missing part of the figure template by the pattern matching method based on Example 1 of this invention. (a)〜(c)は本発明の実施例1に係るパターンマッチング方法による図形テンプレートの近似処理を説明するための図である。(A)-(c) is a figure for demonstrating the approximation process of the figure template by the pattern matching method which concerns on Example 1 of this invention. パターンマッチングにおける対応点を求める処理を説明するための図である。It is a figure for demonstrating the process which calculates | requires the corresponding point in pattern matching. 本発明の実施例1に係るパターンマッチング方法によるポテンシャル空間データの一例を示す図である。It is a figure which shows an example of the potential space data by the pattern matching method which concerns on Example 1 of this invention. 本発明の実施例1に係るパターンマッチング方法によるポテンシャル空間データの一例を示す図である。It is a figure which shows an example of the potential space data by the pattern matching method which concerns on Example 1 of this invention. 本発明の実施例1に係るパターンマッチング方法による照合処理の一例を示す図である。It is a figure which shows an example of the collation process by the pattern matching method which concerns on Example 1 of this invention. 本発明の実施例1に係るパターンマッチング方法による回転及びスケール変動がある場合のポテンシャル空間データの一例を示す図である。It is a figure which shows an example of potential space data in case there exists rotation and a scale fluctuation by the pattern matching method which concerns on Example 1 of this invention. 本発明の実施例2に係るパターンマッチング方法による照合処理の一例を示す図である。It is a figure which shows an example of the collation process by the pattern matching method which concerns on Example 2 of this invention. (a)、(b)は本発明の実施例3に係るパターンマッチング方法によるポテンシャル空間データの一例を示す図である。(A), (b) is a figure which shows an example of the potential space data by the pattern matching method based on Example 3 of this invention. 本発明の実施例3に係るパターンマッチング方法によるスコア値の求め方を説明するための図である。It is a figure for demonstrating how to obtain the score value by the pattern matching method which concerns on Example 3 of this invention. 本発明の実施例4に係るパターンマッチング方法による照合処理の一例を示す図である。It is a figure which shows an example of the collation process by the pattern matching method which concerns on Example 4 of this invention. 本発明の実施例6に係るパターンマッチング方法を実施するためのパターンマッチング装置の構成を示すブロック図である。It is a block diagram which shows the structure of the pattern matching apparatus for enforcing the pattern matching method based on Example 6 of this invention. (a)、(b)は本発明の実施例6に係るパターンマッチング方法による3次元の図形テンプレートと、その近似処理を説明するための図である。(A), (b) is a figure for demonstrating the three-dimensional figure template by the pattern matching method based on Example 6 of this invention, and its approximation process.

符号の説明Explanation of symbols

1、71 パターンマッチング装置
2、72 対象物
3 TVカメラ
4 デジタル画像生成装置
5、75 記憶装置
6、76 画像処理装置
31 図形テンプレート
32 照合対象画像
51 濃淡画像
52 エッジ強度画像
53 エッジ方向画像
54 エッジ点画像
55 測定点データ
61、62 線データ
73 レーザ3次元センサ
74 3次元データ生成装置
111〜118 線分
l13〜116 折れ線
121〜125 図形
DESCRIPTION OF SYMBOLS 1,71 Pattern matching apparatus 2,72 Object 3 TV camera 4 Digital image generation apparatus 5,75 Storage apparatus 6,76 Image processing apparatus 31 Graphic template 32 Matching target image 51 Grayscale image 52 Edge intensity image 53 Edge direction image 54 Edge Point image 55 Measurement point data 61, 62 Line data 73 Laser three-dimensional sensor 74 Three-dimensional data generators 111-118 Line segments l13-116 Polygonal lines 121-125 Graphic

Claims (9)

認識対象物の形状を表す図形テンプレートを照合対象画像に照合して前記認識対象物を検出するパターンマッチング方法であって、
前記認識対象物が撮影された画像の明度の変化の大きさから、前記認識対象物が撮影された画像のエッジを抽出し、前記認識対象物が撮影された画像のエッジの形状を表す線図形データからなる前記図形テンプレートを生成する図形テンプレート生成ステップと、
前記照合対象画像の明度の変化の大きさから、前記照合対称図形のエッジを抽出し、前記照合対称図形のエッジの形状を表す線図形データを測定点の集合として表示した測定点データを生成する測定点データ生成ステップと、
前記図形テンプレートからの距離が遠くなるにつれてスコア値が低くなるようにスコア値を記録したポテンシャル空間データを生成するポテンシャル空間データ生成ステップと、
前記測定点データと前記ポテンシャル空間データとを照合し、前記ポテンシャル空間データ上、前記測定点の位置に対応するスコア値を、前記測定点におけるスコア値として決定するスコア値決定ステップと、
前記測定点におけるスコア値を加算して前記照合対象図形と前記図形テンプレートとの類似度を算出し、前記類似度に基づいて前記照合対象図形が前記認識対象物であるか否かを判定する判定ステップと
を含むことを特徴とするパターンマッチング方法。
A pattern matching method for detecting the recognition target object by matching a graphic template representing the shape of the recognition target object with a verification target image,
A line figure representing the shape of the edge of the image in which the recognition object is photographed by extracting the edge of the image in which the recognition object is photographed from the magnitude of the change in brightness of the image in which the recognition object is photographed A graphic template generation step for generating the graphic template comprising data ;
From the magnitude of change in the brightness of the comparison target image, wherein an edge is extracted in collation symmetrical shape, generates a measurement point data displayed line graphic data representing the shape of the edge of the verification symmetrical shape as a set of measurement points A measurement point data generation step;
A potential space data generation step of generating potential space data in which the score value is recorded so that the score value decreases as the distance from the graphic template increases ;
A score value determining step of collating the measurement point data with the potential space data, and determining a score value corresponding to the position of the measurement point on the potential space data as a score value at the measurement point;
Determination of determining whether or not the verification target graphic is the recognition target based on the similarity by adding the score values at the measurement points to calculate the similarity between the verification target graphic and the graphic template A pattern matching method comprising: and steps.
前記テンプレート生成ステップでは、前記認識対象物が撮影された画像のエッジに欠落部があるときには、エッジの両端の線の方向を記録し、前記両端の線を、それぞれ前記両端の線の方向に延長して融合させることにより修復することを特徴とする請求項1に記載のパターンマッチング方法。 In the template generation step, when there is a missing portion at the edge of the image in which the recognition object is photographed , the direction of the line at both ends of the edge is recorded, and the line at both ends is extended in the direction of the line at both ends, respectively. The pattern matching method according to claim 1, wherein the pattern matching method is repaired by fusing . 前記図形テンプレート生成ステップでは、前記認識対象物の画像を次数1次以上の方程式の集合で近似して図形テンプレートを生成することを特徴とする請求項1または2のいずれかに記載のパターンマッチング方法。   3. The pattern matching method according to claim 1, wherein in the graphic template generation step, a graphic template is generated by approximating the image of the recognition target object with a set of equations of the first order or higher. . 前記スコア値決定ステップでは、前記図形テンプレートを構成する線分の内、最も短い線分の半分の長さの間隔で、前記照合対象図形の前記測定点を残すように、前記測定点を除外してスコア値を求めることを特徴とする請求項1から請求項3のいずれか1項に記載のパターンマッチング方法。 In the score value determining step, the measurement points are excluded so as to leave the measurement points of the verification target graphic at intervals of half the shortest of the line segments constituting the graphic template. 4. The pattern matching method according to claim 1, wherein a score value is obtained. 前記スコア値決定ステップでは、前記照合対象図形の各頂点を測定点として選択し、この測定点に対してスコア値を求めることを特徴とする請求項1から請求項3のいずれか1項に記載のパターンマッチング方法。 The score value determining step selects each vertex of the figure to be collated as a measurement point, and obtains a score value for the measurement point. Pattern matching method. 前記ポテンシャル空間データはスコア値を表すサンプリング点群によって構成され、前記スコア値決定ステップでは前記サンプリング点群の中から前記測定点に近接するサンプリング点を複数選択し、これらのサンプリング点のスコア値に基づいて補間法により前記測定点のスコア値を求めることを特徴とする請求項1から請求項のいずれか1項に記載のパターンマッチング方法。 The potential space data is composed of a sampling point group representing score values. In the score value determining step, a plurality of sampling points close to the measurement point are selected from the sampling point group, and the score values of these sampling points are used. pattern matching method as claimed in any one of claims 5, wherein the determination of the score value of the measuring points by interpolation based. 前記スコア値決定ステップでは、前記照合対象図形に近似させたクラスタを生成し、このクラスタの特徴を表すブロブ情報に基づいて前記認識対象物ではない照合対象図形を検出してスコア値を求める対象から削除することを特徴とする請求項1から請求項6のいずれか1項に記載のパターンマッチング方法。 In the score value determining step, a cluster approximated to the verification target graphic is generated, and a verification target graphic that is not the recognition target object is detected based on the blob information representing the characteristics of the cluster, and a score value is obtained from the target The pattern matching method according to claim 1, wherein the pattern matching method is deleted. 前記判定ステップでは、前記照合対象図形と前記図形テンプレートとの類似度を示す統計値である相互相関値を算出して前記照合対象図形が前記認識対象物であるか否かを判定することを特徴とする請求項1から請求項のいずれか1項に記載のパターンマッチング方法。 In the determining step, it is determined whether or not the verification target graphic is the recognition target object by calculating a cross-correlation value that is a statistical value indicating a similarity between the verification target graphic and the graphic template. The pattern matching method according to any one of claims 1 to 7 . 認識対象物を撮影するカメラと、前記カメラが撮影する画像、認識対象物の形状を表す図形テンプレートを記憶する記憶装置とを備え、前記図形テンプレートを照合対象画像に照合して前記認識対象物を検出するパターンマッチング装置であって、A camera that captures a recognition object; a storage device that stores an image captured by the camera; and a graphic template that represents a shape of the recognition object; A pattern matching device to detect,
前記認識対象物が撮影された画像の明度の変化の大きさから、前記認識対象物が撮影された画像のエッジを抽出し、前記認識対象物が撮影された画像のエッジの形状を表す線図形データからなる前記図形テンプレートを生成する図形テンプレート生成手段と、  A line figure representing the shape of the edge of the image in which the recognition object is photographed by extracting the edge of the image in which the recognition object is photographed from the magnitude of the change in brightness of the image in which the recognition object is photographed Graphic template generation means for generating the graphic template comprising data;
前記照合対象画像の明度の変化の大きさから、前記照合対称図形のエッジを抽出し、前記照合対称図形のエッジの形状を表す線図形データを測定点の集合として表示した測定点データを生成する測定点データ生成手段と、  The edge of the collation symmetrical figure is extracted from the magnitude of the change in the brightness of the collation target image, and measurement point data is generated in which line figure data representing the shape of the edge of the collation symmetrical figure is displayed as a set of measurement points. Measuring point data generating means;
前記図形テンプレートからの距離が遠くなるにつれてスコア値が低くなるようにスコア値を記録したポテンシャル空間データを生成するポテンシャル空間データ生成手段と、  Potential space data generating means for generating potential space data in which the score value is recorded so that the score value decreases as the distance from the graphic template increases;
前記測定点データと前記ポテンシャル空間データとを照合し、前記ポテンシャル空間データ上、前記測定点の位置に対応するスコア値を、前記測定点におけるスコア値として決定するスコア値決定手段と、  A score value determining means for collating the measurement point data with the potential space data, and determining a score value corresponding to the position of the measurement point on the potential space data as a score value at the measurement point;
前記測定点におけるスコア値を加算して前記照合対象図形と前記図形テンプレートとの類似度を算出し、前記類似度に基づいて前記照合対象図形が前記認識対象物であるか否かを判定する判定手段と  Determination of determining whether or not the verification target graphic is the recognition target based on the similarity by adding the score values at the measurement points to calculate the similarity between the verification target graphic and the graphic template Means and
を備えることを特徴とするパターンマッチング装置。  A pattern matching apparatus comprising:
JP2005246751A 2005-08-26 2005-08-26 Pattern matching method and apparatus Expired - Fee Related JP4525526B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005246751A JP4525526B2 (en) 2005-08-26 2005-08-26 Pattern matching method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005246751A JP4525526B2 (en) 2005-08-26 2005-08-26 Pattern matching method and apparatus

Publications (2)

Publication Number Publication Date
JP2007058811A JP2007058811A (en) 2007-03-08
JP4525526B2 true JP4525526B2 (en) 2010-08-18

Family

ID=37922208

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005246751A Expired - Fee Related JP4525526B2 (en) 2005-08-26 2005-08-26 Pattern matching method and apparatus

Country Status (1)

Country Link
JP (1) JP4525526B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5585826B2 (en) * 2010-06-15 2014-09-10 株式会社Ihi Object recognition method and apparatus
GB2569803B (en) * 2017-12-22 2021-11-24 Novarum Dx Ltd Analysis of a captured image to determine a test outcome
JP2022069828A (en) 2020-10-26 2022-05-12 セイコーエプソン株式会社 Identification method, image display method, identification system, image display system, and program

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000076378A (en) * 1998-08-27 2000-03-14 Victor Co Of Japan Ltd Character recognizing method
JP2000207494A (en) * 1999-01-12 2000-07-28 Nec Corp On-line character recognizing device with verification function
JP2001109885A (en) * 1999-10-05 2001-04-20 Sony Corp Method and device for image processing

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2909604B2 (en) * 1990-10-12 1999-06-23 株式会社山武 Fuzzy pattern recognition method and apparatus
JPH04313167A (en) * 1990-12-14 1992-11-05 Nippon Telegr & Teleph Corp <Ntt> Location confirmation system for characteristic point of picture
JP2739011B2 (en) * 1992-06-05 1998-04-08 山武ハネウエル株式会社 Security system
JP3148040B2 (en) * 1993-03-23 2001-03-19 株式会社東芝 Teacher signal creation device and image recognition device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000076378A (en) * 1998-08-27 2000-03-14 Victor Co Of Japan Ltd Character recognizing method
JP2000207494A (en) * 1999-01-12 2000-07-28 Nec Corp On-line character recognizing device with verification function
JP2001109885A (en) * 1999-10-05 2001-04-20 Sony Corp Method and device for image processing

Also Published As

Publication number Publication date
JP2007058811A (en) 2007-03-08

Similar Documents

Publication Publication Date Title
JP4825253B2 (en) System and method for deformable object recognition
Liang et al. Geometric rectification of camera-captured document images
JP5251080B2 (en) Object recognition method
JP4985166B2 (en) Self-position estimation device
US7068821B2 (en) Information processing method and apparatus
JP4709668B2 (en) 3D object recognition system
JP4877392B2 (en) Feature attribute calculation device, feature quantity extraction device, pattern matching device, method and program
JP6880618B2 (en) Image processing program, image processing device, and image processing method
Zhang et al. Symbol recognition with kernel density matching
US20090074299A1 (en) Increasing accuracy of discrete curve transform estimates for curve matching in four or more dimensions
JP4003465B2 (en) Specific pattern recognition method, specific pattern recognition program, specific pattern recognition program recording medium, and specific pattern recognition apparatus
CN113095187A (en) Examination paper correction method based on image feature matching alignment
JP4859061B2 (en) Image correction method, correction program, and image distortion correction apparatus
JP4525526B2 (en) Pattern matching method and apparatus
CN115018910A (en) Method and device for detecting target in point cloud data and computer readable storage medium
JP6016242B2 (en) Viewpoint estimation apparatus and classifier learning method thereof
Zhang et al. 4-D spatiotemporal detection and modeling of free-bending pipelines in cluttered 3-D point cloud
Wang et al. Similarity evaluation of 3D surface topography measurements
JP2006330872A (en) Fingerprint collation device, method and program
JP2006330874A (en) Fingerprint collation device, method and program
JP6946912B2 (en) Estimator program, estimator, and estimation method
CN116434221B (en) Workpiece shape recognition method, device, terminal equipment and computer storage medium
JPH064671A (en) Pattern processing method
CN103870846A (en) Image representation method and applications thereof in image matching and recognition
Song et al. Instrument recognition in transformer substation base on image recognition algorithm

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20080513

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20100201

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100216

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100416

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20100511

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20100524

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

Free format text: PAYMENT UNTIL: 20130611

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees