JP2018072937A - Template matching device, method and program - Google Patents

Template matching device, method and program Download PDF

Info

Publication number
JP2018072937A
JP2018072937A JP2016208802A JP2016208802A JP2018072937A JP 2018072937 A JP2018072937 A JP 2018072937A JP 2016208802 A JP2016208802 A JP 2016208802A JP 2016208802 A JP2016208802 A JP 2016208802A JP 2018072937 A JP2018072937 A JP 2018072937A
Authority
JP
Japan
Prior art keywords
image
template
geometric transformation
pixel
geometric
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
JP2016208802A
Other languages
Japanese (ja)
Other versions
JP6639369B2 (en
Inventor
小萌 武
Xiaomeng Wu
小萌 武
川西 隆仁
Takahito Kawanishi
隆仁 川西
森 稔
Minoru Mori
稔 森
薫 平松
Kaoru Hiramatsu
薫 平松
柏野 邦夫
Kunio Kashino
邦夫 柏野
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.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone Corp
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 Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP2016208802A priority Critical patent/JP6639369B2/en
Publication of JP2018072937A publication Critical patent/JP2018072937A/en
Application granted granted Critical
Publication of JP6639369B2 publication Critical patent/JP6639369B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

PROBLEM TO BE SOLVED: To allow a position of a template image to be accurately detected in consideration of geometric conversion between images.SOLUTION: A geometric verification unit 22 detects, with respect to a pair of an input template image and an observed image, corresponding points between the images in consideration of geometric conversion between the images and estimates each of candidates for a geometric conversion parameter on the basis of the detected corresponding points. An inter-image distance measure calculation unit 24 calculates an inter-image distance measure obtained by applying each of the candidates for the geometric conversion parameter. A determination unit 26 estimates a candidate for the geometric conversion parameter, which minimizes the inter-image distance measure, as the geometric conversion parameter for the pair of the template image and the observed image. A template position calculation unit 28 applies the estimated geometric conversion parameter to calculate the position of the template image in the observed image.SELECTED DRAWING: Figure 1

Description

本発明は、テンプレートマッチング装置、方法、及びプログラムに係り、特に、観測画像におけるテンプレート画像の位置を計算するテンプレートマッチング装置、方法、及びプログラムに関する。   The present invention relates to a template matching apparatus, method, and program, and more particularly, to a template matching apparatus, method, and program for calculating the position of a template image in an observed image.

テンプレートマッチングとは、特定の画像パターンを代表するテンプレート画像をあらかじめ用意し、それと同じパターンが観測画像内に存在するかを検出し、存在する場合それの当該箇所を検出するプロセスである。テンプレートマッチング方法は、画像パターンの位置認識、画像中の物体検出、製造部品の実装検査等に広く用いられている。テンプレートマッチング方法は、概ね特徴点ベースの方法と画素ベースの方法に分けられる。   Template matching is a process of preparing a template image representing a specific image pattern in advance, detecting whether the same pattern exists in the observed image, and detecting the corresponding portion if it exists. The template matching method is widely used for image pattern position recognition, object detection in an image, mounting inspection of manufactured parts, and the like. Template matching methods are roughly divided into feature point-based methods and pixel-based methods.

特徴点ベースの方法の一例として、非特許文献1の方法がある。この方法は、テンプレート画像と観測画像を入力とし、画像から複数の特徴点を抽出し、特徴点の照合に基づいてテンプレート画像の観測画像にある位置を算出する。特徴点を抽出する際に、各特徴点について、視覚特徴を表す局所特徴量と、スケール(大きさ)、方向、座標等の幾何形状パラメータが出力される。ここで、入力画像間において、局所特徴量の類似する特徴点のペアを対応点と呼ぶ。前記方法は、入力画像間から全ての対応点を検出した後に、各対応点について、特徴点の幾何形状パラメータに基づいて、拡大縮小倍率、回転角度、位置変動ベクトル等の幾何変換パラメータを算出する。ここで、幾何変換パラメータの類似する対応点を正対応点と呼ぶ。前記方法は、ハフ変換を用いて正対応点を検出し、正対応点の座標に基づいて最小二乗法を用いて入力画像間の幾何変換パラメータを算出する。最後に、前記パラメータを用いてテンプレート画像の観測画像にある位置を算出する。   As an example of the feature point-based method, there is a method of Non-Patent Document 1. In this method, a template image and an observation image are input, a plurality of feature points are extracted from the image, and a position of the template image in the observation image is calculated based on the matching of the feature points. When extracting feature points, local feature values representing visual features and geometric parameters such as scale (size), direction, and coordinates are output for each feature point. Here, a pair of feature points having similar local feature amounts between input images is referred to as a corresponding point. In the method, after all corresponding points are detected between input images, geometric conversion parameters such as an enlargement / reduction ratio, a rotation angle, and a position variation vector are calculated for each corresponding point based on a geometric parameter of a feature point. . Here, corresponding points with similar geometric transformation parameters are called positive corresponding points. In the method, a positive corresponding point is detected using Hough transform, and a geometric transformation parameter between input images is calculated using a least square method based on the coordinates of the positive corresponding point. Finally, the position of the template image in the observed image is calculated using the parameters.

画素ベースの方法の一例として、非特許文献2の方法がある。この方法は、テンプレート画像と観測画像を入力とし、画素の照合に基づいてテンプレート画像の観測画像にある位置を算出する。具体的に、幾何変換パラメータの候補を多数用意し、各候補を用いてテンプレート画像を観測画像に投影する。各候補について、投影されたテンプレート画像と観測画像と重複した画像領域について、テンプレート画像と観測画像との距離測度を算出する。全ての候補の中から、前記距離測度が最小の候補を入力画像間の幾何変換パラメータと推定する。最後に、推定された候補によって投影されたテンプレート画像の観測画像にある位置を出力する。   As an example of the pixel-based method, there is a method of Non-Patent Document 2. In this method, a template image and an observation image are input, and a position of the template image in the observation image is calculated based on pixel matching. Specifically, a large number of geometric transformation parameter candidates are prepared, and a template image is projected onto the observation image using each candidate. For each candidate, a distance measure between the template image and the observed image is calculated for an image region overlapping the projected template image and the observed image. Among all candidates, a candidate having the smallest distance measure is estimated as a geometric transformation parameter between input images. Finally, the position in the observed image of the template image projected by the estimated candidate is output.

David G. Lowe: Distinctive Image Features from Scale-Invariant Keypoints. International Journal of Computer Vision 60(2): 91-110 (2004)David G. Lowe: Distinctive Image Features from Scale-Invariant Keypoints. International Journal of Computer Vision 60 (2): 91-110 (2004) Chiou-Shann Fuh and Petros Maragos: "Motion displacement estimation using an affine model for image matching", Opt. Eng. 30(7), 881-887 (Jul 01, 1991).Chiou-Shann Fuh and Petros Maragos: "Motion displacement estimation using an affine model for image matching", Opt. Eng. 30 (7), 881-887 (Jul 01, 1991).

<課題1>
非特許文献1の方法は、正対応点の座標に基づいて最小二乗法を用いて入力画像間の幾何変換パラメータを算出する。最小二乗法は外れ値から大きく悪影響を受けるため、正対応点の座標に誤差がある場合、正確に幾何変換パラメータを算出するのが困難である。外れ値の悪影響を軽減する方法としてRandom Sample Consensus (RANSAC)があるが、外れ値の割合が高い場合、前記悪影響を完全に回避するのが困難である。
<Problem 1>
In the method of Non-Patent Document 1, a geometric transformation parameter between input images is calculated using a least square method based on the coordinates of a positive corresponding point. Since the least square method is greatly adversely affected by outliers, it is difficult to accurately calculate geometric transformation parameters when there is an error in the coordinates of the positive corresponding points. There is Random Sample Consensus (RANSAC) as a method for reducing the adverse effects of outliers. However, when the ratio of outliers is high, it is difficult to completely avoid the adverse effects.

<課題2>
非特許文献2の方法は、幾何変換パラメータの候補から最適なものを入力画像間の幾何変換パラメータと推定する。正確に幾何変換パラメータを推定するためには、前記候補を非常に多数用意しなければならない。そのため、入力画像間の距離測度の計算回数が膨大で、計算量が非常に大きい。
<Problem 2>
In the method of Non-Patent Document 2, an optimal geometric transformation parameter candidate is estimated as a geometric transformation parameter between input images. In order to accurately estimate the geometric transformation parameters, a large number of the candidates must be prepared. For this reason, the number of calculation of the distance measure between the input images is enormous, and the calculation amount is very large.

<課題3>
非特許文献2の方法は、入力画像間の距離測度を計算する際に、テンプレート画像の全ての画素を用いるため、計算量が非常に大きい。一部の画素のみを用いる方法として、均一サンプリングやランダムサンプリング等がある。しかし、これらの方法によって選択された画素は、前記距離測度の最適化において、全て識別力があるとは限らない。そのため、距離測度の近似が大きくずれる場合があり、その場合、正確に幾何変換パラメータを推定するのが困難である。
<Problem 3>
Since the method of Non-Patent Document 2 uses all the pixels of the template image when calculating the distance measure between the input images, the calculation amount is very large. As a method using only some pixels, there are uniform sampling, random sampling, and the like. However, the pixels selected by these methods are not all discriminating in the optimization of the distance measure. Therefore, the approximation of the distance measure may deviate greatly, and in that case, it is difficult to accurately estimate the geometric transformation parameter.

本発明は、上記課題を解決するために成されたものであり、画像間の幾何変換を考慮して、精度よくテンプレート画像の位置を検出することができるテンプレートマッチング装置、方法、及びプログラムを提供することを目的とする。   The present invention has been made to solve the above problems, and provides a template matching apparatus, method, and program capable of accurately detecting the position of a template image in consideration of geometric transformation between images. The purpose is to do.

また、計算量を抑制し、かつ、画像間の幾何変換を考慮して、テンプレート画像の位置を検出することができるテンプレートマッチング装置、方法、及びプログラムを提供することを目的とする。   It is another object of the present invention to provide a template matching apparatus, method, and program capable of detecting the position of a template image in consideration of geometrical transformation between images while suppressing the amount of calculation.

上記目的を達成するために、第1の発明に係るテンプレートマッチング装置は、入力されたテンプレート画像と観測画像とのペアについて、画像間の幾何変換を考慮して、画像間の対応点を検出し、検出された対応点に基づいて、画像間の幾何変換を表す幾何変換パラメータの候補の各々を推定する幾何検証部と、前記幾何検証部によって推定された前記幾何変換パラメータの候補の各々について、前記幾何変換パラメータの候補を適用したときの前記テンプレート画像と前記観測画像との画像間距離測度を計算する画像間距離測度計算部と、画像間距離測度が最小となる前記幾何変換パラメータの候補を、前記テンプレート画像と前記観測画像とのペアにおける幾何変換パラメータとして推定する判断部と、前記判断部によって推定された前記幾何変換パラメータを適用して、前記観測画像における前記テンプレート画像の位置を計算するテンプレート位置計算部と、を含んで構成されている。   In order to achieve the above object, the template matching apparatus according to the first aspect of the present invention detects a corresponding point between images in consideration of geometric transformation between images for a pair of an input template image and an observed image. A geometric verification unit that estimates each of the geometric transformation parameter candidates representing the geometric transformation between images based on the detected corresponding points, and each of the geometric transformation parameter candidates estimated by the geometric verification unit, An inter-image distance measure calculation unit that calculates an inter-image distance measure between the template image and the observed image when the geometric transformation parameter candidate is applied, and the geometric transformation parameter candidate that minimizes the inter-image distance measure. A determination unit that estimates as a geometric transformation parameter in a pair of the template image and the observation image, and the estimation unit By applying the serial geometric transformation parameters, is configured to include a, a template position calculation unit for calculating the position of the template image in the observed image.

第2の発明に係るテンプレートマッチング方法は、幾何検証部が、入力されたテンプレート画像と観測画像とのペアについて、画像間の幾何変換を考慮して、画像間の対応点を検出し、検出された対応点に基づいて、画像間の幾何変換を表す幾何変換パラメータの候補の各々を推定し、画像間距離測度計算部が、前記幾何検証部によって推定された前記幾何変換パラメータの候補の各々について、前記幾何変換パラメータの候補を適用したときの前記テンプレート画像と前記観測画像との画像間距離測度を計算し、判断部が、画像間距離測度が最小となる前記幾何変換パラメータの候補を、前記テンプレート画像と前記観測画像とのペアにおける幾何変換パラメータとして推定し、テンプレート位置計算部が、前記判断部によって推定された前記幾何変換パラメータを適用して、前記観測画像における前記テンプレート画像の位置を計算する。   In the template matching method according to the second invention, the geometric verification unit detects a corresponding point between images for a pair of an input template image and an observed image in consideration of geometric transformation between images. Based on the corresponding points, each of the geometric transformation parameter candidates representing the geometric transformation between the images is estimated, and the inter-image distance measure calculation unit calculates each of the geometric transformation parameter candidates estimated by the geometric verification unit. , Calculating an inter-image distance measure between the template image and the observed image when the geometric transformation parameter candidate is applied, and a determination unit determines the geometric transformation parameter candidate that minimizes the inter-image distance measure, Estimated as a geometric transformation parameter in a pair of a template image and the observed image, the template position calculation unit was estimated by the determination unit By applying the serial geometric transformation parameters, to calculate the position of the template image in the observed image.

第3の発明に係るテンプレートマッチング装置は、入力されたテンプレート画像と観測画像とのペアについて、画像間の幾何変換を表す幾何変換パラメータの候補を推定する幾何検証部と、前記テンプレート画像の各画素の画素値の二次微分係数に基づいて、前記テンプレート画像における複数の画素を選択する画素選択部と、前記幾何検証部によって推定された前記幾何変換パラメータの候補の各々について、前記画素選択部によって選択された画素の各々に対し、前記幾何変換パラメータの候補を適用したときの、前記観測画像における画素の各々との画素間距離測度を計算する画素間距離測度計算部と、前記選択された画素の各々に対して計算された前記画素間距離測度に基づく画像間距離測度が最小となる前記幾何変換パラメータの候補を、前記テンプレート画像と前記観測画像とのペアにおける幾何変換パラメータとして推定する判断部と、前記判断部によって推定された前記幾何変換パラメータを適用して、前記観測画像における前記テンプレート画像の位置を計算するテンプレート位置計算部と、を含んで構成されている。   A template matching device according to a third aspect of the present invention includes a geometric verification unit that estimates a candidate for a geometric transformation parameter representing a geometric transformation between images for each pair of an input template image and an observed image, and each pixel of the template image For each of the pixel selection unit that selects a plurality of pixels in the template image based on the second derivative of the pixel value of the pixel value and the geometric transformation parameter candidate estimated by the geometric verification unit, the pixel selection unit An inter-pixel distance measure calculation unit that calculates an inter-pixel distance measure with each of the pixels in the observed image when the geometric transformation parameter candidate is applied to each of the selected pixels; and the selected pixel Of the geometric transformation parameter that minimizes the inter-image distance measure based on the inter-pixel distance measure calculated for each of the Determining a complement as a geometric transformation parameter in a pair of the template image and the observation image; and applying the geometric transformation parameter estimated by the judgment unit to determine the position of the template image in the observation image A template position calculation unit for calculation.

第4の発明に係るテンプレートマッチング方法は、幾何検証部が、入力されたテンプレート画像と観測画像とのペアについて、画像間の幾何変換を表す幾何変換パラメータの候補を推定し、画素選択部が、前記テンプレート画像の各画素の画素値の二次微分係数に基づいて、前記テンプレート画像における複数の画素を選択し、画素間距離測度計算部が、前記幾何検証部によって推定された前記幾何変換パラメータの候補の各々について、前記画素選択部によって選択された画素の各々に対し、前記幾何変換パラメータの候補を適用したときの、前記観測画像における画素の各々との画素間距離測度を計算し、判断部が、前記選択された画素の各々に対して計算された前記画素間距離測度に基づく画像間距離測度が最小となる前記幾何変換パラメータの候補を、前記テンプレート画像と前記観測画像とのペアにおける幾何変換パラメータとして推定し、テンプレート位置計算部が、前記判断部によって推定された前記幾何変換パラメータを適用して、前記観測画像における前記テンプレート画像の位置を計算する。   In the template matching method according to the fourth aspect of the present invention, the geometric verification unit estimates a candidate for a geometric transformation parameter representing a geometric transformation between images for a pair of an input template image and an observation image, and the pixel selection unit includes: Based on the second derivative of the pixel value of each pixel of the template image, a plurality of pixels in the template image are selected, and an inter-pixel distance measure calculation unit calculates the geometric transformation parameter estimated by the geometric verification unit. For each candidate, calculate the inter-pixel distance measure with each of the pixels in the observed image when applying the geometric transformation parameter candidate to each of the pixels selected by the pixel selection unit; Is the geometric transformation path that minimizes the inter-image distance measure based on the inter-pixel distance measure calculated for each of the selected pixels. A candidate for a meter is estimated as a geometric transformation parameter in the pair of the template image and the observation image, and a template position calculation unit applies the geometric transformation parameter estimated by the determination unit, and Calculate the position of the template image.

本発明に係るプログラムは、コンピュータを、上記のテンプレートマッチング装置を構成する各部として機能させるためのプログラムである。   The program according to the present invention is a program for causing a computer to function as each unit constituting the template matching apparatus.

本発明のテンプレートマッチング装置、方法、及びプログラムによれば、入力されたテンプレート画像と観測画像とのペアについて、画像間の幾何変換を考慮して、画像間の対応点を検出し、幾何変換パラメータの候補の各々を推定し、幾何変換パラメータの候補を適用したときの前記テンプレート画像と前記観測画像との画像間距離測度を計算し、画像間距離測度が最小となる前記幾何変換パラメータの候補を適用して、前記観測画像における前記テンプレート画像の位置を計算することにより、画像間の幾何変換を考慮して、精度よくテンプレート画像の位置を検出することができる、という効果が得られる。   According to the template matching apparatus, method, and program of the present invention, for a pair of an input template image and an observation image, corresponding points between images are detected in consideration of geometric transformation between images, and geometric transformation parameters are obtained. And calculating a distance measure between the template image and the observed image when applying the geometric transformation parameter candidate, and obtaining the geometric transformation parameter candidate that minimizes the inter-image distance measure. By applying and calculating the position of the template image in the observed image, it is possible to obtain the effect that the position of the template image can be accurately detected in consideration of the geometric transformation between the images.

また、本発明のテンプレートマッチング装置、方法、及びプログラムによれば、入力されたテンプレート画像と観測画像とのペアについて、幾何変換パラメータの候補の各々を推定し、テンプレート画像の画素値の二次微分係数に基づいて、複数の画素を選択し、選択された画素の各々に対し、前記幾何変換パラメータの候補を適用したときの、前記観測画像における画素の各々との画素間距離測度を計算し、画素間距離測度に基づく画像間距離測度が最小となる前記幾何変換パラメータの候補を適用して、前記観測画像における前記テンプレート画像の位置を計算することにより、計算量を抑制し、かつ、画像間の幾何変換を考慮して、テンプレート画像の位置を検出することができる、という効果が得られる。   Further, according to the template matching apparatus, method, and program of the present invention, each of the candidates for the geometric transformation parameter is estimated for a pair of the input template image and the observed image, and the second derivative of the pixel value of the template image is estimated. Selecting a plurality of pixels based on a coefficient, and calculating a distance measure between the pixels in each of the observed images when applying the geometric transformation parameter candidates to each of the selected pixels; By applying the geometric transformation parameter candidate that minimizes the inter-image distance measure based on the inter-pixel distance measure, and calculating the position of the template image in the observed image, the amount of calculation is reduced, and between the images In this way, the effect that the position of the template image can be detected in consideration of the geometric transformation is obtained.

本発明の第1の実施の形態に係るテンプレートマッチング装置の構成を示すブロック図である。It is a block diagram which shows the structure of the template matching apparatus which concerns on the 1st Embodiment of this invention. 本発明の第1の実施の形態に係るテンプレートマッチング装置の画像間距離測度計算部の構成を示すブロック図である。It is a block diagram which shows the structure of the distance measurement calculation part between images of the template matching apparatus which concerns on the 1st Embodiment of this invention. 本発明の第1の実施の形態に係るテンプレートマッチング装置におけるテンプレートマッチング処理ルーチンを示すフローチャートである。It is a flowchart which shows the template matching process routine in the template matching apparatus which concerns on the 1st Embodiment of this invention. 本発明の第1の実施の形態に係るテンプレートマッチング装置における画像間距離測度を計算する処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the process which calculates the distance measure between images in the template matching apparatus which concerns on the 1st Embodiment of this invention.

以下、図面を参照して本発明の実施の形態を詳細に説明する。   Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.

<概要>
前記課題1、2を解決するために、本発明の実施の形態に係るテンプレートマッチング装置は、幾何検証方法を用いて正対応点を検出し、正対応点から算出された幾何変換パラメータのみを候補と見なし、候補の中から、テンプレート画像と観測画像との距離測度が最小の候補を画像間の幾何変換パラメータと推定する。
<Overview>
In order to solve the problems 1 and 2, the template matching apparatus according to the embodiment of the present invention detects a positive corresponding point using a geometric verification method, and selects only the geometric transformation parameter calculated from the positive corresponding point. And the candidate having the smallest distance measure between the template image and the observed image is estimated as a geometric transformation parameter between the images.

これにより、非特許文献1の方法と比べて、正対応点の中に誤差の小さいものが一点だけでもあれば、より正確に幾何変換パラメータを推定するのが可能である。そのため、正対応点の特徴点の幾何形状パラメータに誤差がある場合やそのような正対応点の割合が高い場合でも、誤差の悪影響を大幅に抑えるのが可能である。   As a result, compared to the method of Non-Patent Document 1, it is possible to estimate the geometric transformation parameter more accurately if there is only one point with a small error among the positive corresponding points. Therefore, even when there is an error in the geometric parameter of the feature point of the positive corresponding point or when the ratio of such a positive corresponding point is high, it is possible to greatly suppress the adverse effect of the error.

また、非特許文献2の方法と比べて、幾何変換パラメータの候補の数を非常に少数に絞るのが可能になり、画像間の距離測度の計算回数を大幅に減らし、計算量を抑えるのが可能になる。   Compared with the method of Non-Patent Document 2, the number of geometric transformation parameter candidates can be reduced to a very small number, and the number of calculation of the distance measure between images can be greatly reduced, thereby reducing the amount of calculation. It becomes possible.

[第1の実施の形態]
<第1の実施の形態に係るテンプレートマッチング装置の構成>
本発明の第1の実施の形態に係るテンプレートマッチング装置の構成について説明する。図1に示すように、本発明の第1の実施の形態に係るテンプレートマッチング装置100は、CPUと、RAMと、後述するテンプレートマッチング処理ルーチンを実行するためのプログラムや各種データを記憶したROMと、を含むコンピュータで構成することが出来る。このテンプレートマッチング装置100は、機能的には図1に示すように、入力部10、演算部20と、出力部90とを備えている。
[First Embodiment]
<Configuration of Template Matching Device According to First Embodiment>
A configuration of the template matching apparatus according to the first embodiment of the present invention will be described. As shown in FIG. 1, a template matching apparatus 100 according to the first embodiment of the present invention includes a CPU, a RAM, a ROM for storing a program and various data for executing a template matching processing routine described later, and , Can be configured with a computer including. Functionally, the template matching apparatus 100 includes an input unit 10, a calculation unit 20, and an output unit 90, as shown in FIG.

入力部10は、テンプレート画像と観測画像とを受け付ける。   The input unit 10 receives a template image and an observation image.

演算部20は、幾何検証部22と、画像間距離測度計算部24と、判断部26と、テンプレート位置計算部28と、を含んで構成されている。   The calculation unit 20 includes a geometric verification unit 22, an inter-image distance measure calculation unit 24, a determination unit 26, and a template position calculation unit 28.

幾何検証部22は、入力部10により入力されたテンプレート画像と観測画像とのペアについて、画像間の幾何変換を考慮して、画像間の対応点を検出し、検出された対応点に基づいて、画像間の幾何変換を表す幾何変換パラメータの候補の各々を推定する。   The geometric verification unit 22 detects the corresponding points between the images for the pair of the template image and the observation image input by the input unit 10 in consideration of the geometric conversion between the images, and based on the detected corresponding points. Each of the candidates for the geometric transformation parameter representing the geometric transformation between the images is estimated.

具体的には、幾何検証部22は、テンプレート画像と観測画像を入力とし、幾何検証方法によって幾何変換パラメータの候補を推定し、出力する。例えば、入力画像から複数の特徴点を抽出し、ハフ変換(非特許文献1)やRANSAC等を用いて正対応点を検出する。正対応点から算出された幾何変換パラメータを候補と見なし、出力する。   Specifically, the geometric verification unit 22 receives a template image and an observation image as input, estimates a geometric transformation parameter candidate by a geometric verification method, and outputs it. For example, a plurality of feature points are extracted from the input image, and positive corresponding points are detected using Hough transform (Non-Patent Document 1), RANSAC, or the like. The geometric transformation parameter calculated from the positive corresponding point is regarded as a candidate and output.

本実施形態では、各正対応点について、それを構成した特徴点において、テンプレート画像側の特徴点をpで、観測画像側の特徴点をqで表す。特徴点pについて、スケールをσ(p)で、方向をθ(p)で、二次元の座標をt(p)=[x(p),y(p)]Tで表す。特徴点qについても、同様に記す。テンプレート画像から観測画像への拡大縮小倍率は、 In this embodiment, with respect to each positive corresponding point, the feature point on the template image side is represented by p and the feature point on the observation image side is represented by q. For the feature point p, the scale is represented by σ (p), the direction is represented by θ (p), and the two-dimensional coordinate is represented by t (p) = [x (p), y (p)] T. The same applies to the feature point q. The scaling factor from the template image to the observed image is

で計算される。テンプレート画像から観測画像への回転角度は、 Calculated by The rotation angle from the template image to the observed image is

で計算される。ここで、テンプレート画像から観測画像への変換行列 Calculated by Here, transformation matrix from template image to observation image

を用意する。テンプレート画像から観測画像への位置変動ベクトルは、 Prepare. The position variation vector from the template image to the observation image is

で計算される。従って、各幾何変換パラメータの候補は、2×2の行列Mと2×1の行列dによって表現される。 Calculated by Therefore, each geometric transformation parameter candidate is represented by a 2 × 2 matrix M and a 2 × 1 matrix d.

画像間距離測度計算部24は、幾何検証部22によって推定された幾何変換パラメータの候補の各々について、当該幾何変換パラメータの候補を適用したときのテンプレート画像と観測画像との画像間距離測度を計算する。   The inter-image distance measure calculation unit 24 calculates, for each of the geometric transformation parameter candidates estimated by the geometric verification unit 22, an inter-image distance measure between the template image and the observed image when the geometric transformation parameter candidate is applied. To do.

画像間距離測度計算部24は、図2に示すように、画素選択部30、幾何変換部32、画素間距離測度計算部34、及び判断部36を備えている。   As shown in FIG. 2, the inter-image distance measure calculation unit 24 includes a pixel selection unit 30, a geometric conversion unit 32, an inter-pixel distance measure calculation unit 34, and a determination unit 36.

画素選択部30は、テンプレート画像における一部の画素を選択し、選択された画素の座標を出力する。   The pixel selection unit 30 selects some pixels in the template image and outputs the coordinates of the selected pixels.

例えば、テンプレート画像に対して、2次元の画像平面上で横と縦の両方向において、一定間隔毎に一個の画素を選択し、選択された全ての画素を出力する。あるいは、テンプレート画像に対して、画素をランダムにn個選択し、選択された画素を出力する。   For example, for a template image, one pixel is selected at regular intervals in both the horizontal and vertical directions on a two-dimensional image plane, and all the selected pixels are output. Alternatively, n pixels are randomly selected for the template image, and the selected pixels are output.

幾何変換部32は、幾何検証部22によって推定された幾何変換パラメータの候補の各々と、画素選択部30から出力されるテンプレート画像の画素座標とを入力とし、幾何変換パラメータの候補の各々について、当該幾何変換パラメータの候補を適用してテンプレート画像の画素座標を観測画像に投影し、投影された画素の座標を出力する。   The geometric transformation unit 32 inputs each of the geometric transformation parameter candidates estimated by the geometric verification unit 22 and the pixel coordinates of the template image output from the pixel selection unit 30, and for each of the geometric transformation parameter candidates, By applying the geometric transformation parameter candidates, the pixel coordinates of the template image are projected onto the observation image, and the coordinates of the projected pixels are output.

本実施形態では、幾何変換パラメータの候補は、2×2の行列Mと2×1の行列dによって表現される。テンプレート画像の画素座標をt=[x,y]Tで表し、投影された観測画像の画素座標をt'=[x',y']Tで表す。ここで、t'は In the present embodiment, geometric transformation parameter candidates are represented by a 2 × 2 matrix M and a 2 × 1 matrix d. The pixel coordinates of the template image are represented by t = [x, y] T , and the pixel coordinates of the projected observation image are represented by t ′ = [x ′, y ′] T. Where t ′ is

で計算される。 Calculated by

画素間距離測度計算部34は、幾何検証部22によって推定された幾何変換パラメータの候補の各々について、画素選択部30によって選択された画素の各々に対し、幾何変換部32によって出力された観測画像における画素の各々との画素間距離測度を計算する。   The inter-pixel distance measure calculation unit 34 outputs an observation image output by the geometric conversion unit 32 for each of the pixels selected by the pixel selection unit 30 for each of the geometric conversion parameter candidates estimated by the geometric verification unit 22. Compute an inter-pixel distance measure with each of the pixels in.

テンプレート画像の画素と観測画像の画素との間の距離測度は、絶対差や二乗差等を用いて計算する。ここで、テンプレート画像の画素座標tの画素値をI(t)で表し、観測画像の画素座標t'の画素値をI'(t')で表す。絶対差を用いる場合、   The distance measure between the pixel of the template image and the pixel of the observation image is calculated using an absolute difference, a square difference, or the like. Here, the pixel value of the pixel coordinate t of the template image is represented by I (t), and the pixel value of the pixel coordinate t ′ of the observed image is represented by I ′ (t ′). When using absolute difference:

を計算する。二乗差を用いる場合、 Calculate When using the square difference,

を計算する。前記SADとSSDは、画像間の距離測度であり、画素間距離測度(絶対差|I(t)−I'(t')|又は二乗差(I(t)−I'(t'))2)の総和である。各幾何変換パラメータの候補について、最初はSAD又はSSDを0に初期化し、テンプレート画像の画素座標と観測画像の画素座標のペアの各々について画素間距離測度計算部34の処理を行う度に、上記式(6)又は式(7)にしたがって、画素間距離測度を加算するようにSAD又はSSDを更新する。 Calculate The SAD and SSD are distance measures between images, and a pixel distance measure (absolute difference | I (t) −I ′ (t ′) | or square difference (I (t) −I ′ (t ′)). 2 ) The sum of For each geometric transformation parameter candidate, SAD or SSD is initially initialized to 0, and each time the inter-pixel distance measure calculation unit 34 performs processing for each of the pixel coordinate pair of the template image and the pixel coordinate of the observation image, SAD or SSD is updated to add the inter-pixel distance measure according to equation (6) or equation (7).

判断部36は、画素選択部30から出力されたテンプレート画像の画素座標について、幾何変換部32と画素間距離測度計算部34の処理が全て終了したかを判断し、全て終了した場合、画像間距離測度SAD或いはSSDを出力し、そうでない場合、全て終了するまで反復する。   The determination unit 36 determines whether or not the processes of the geometric conversion unit 32 and the inter-pixel distance measure calculation unit 34 have been completed for the pixel coordinates of the template image output from the pixel selection unit 30. Output distance measure SAD or SSD, otherwise repeat until all are finished.

判断部26は、全ての幾何変換パラメータの候補について、画像間距離測度計算部の処理が終了したかを判断し、全て終了した場合、画像間距離測度が最小となる幾何変換パラメータの候補を、テンプレート画像と観測画像とのペアにおける幾何変換パラメータとして推定して出力し、そうでない場合、全て終了するまで反復する。   The determination unit 26 determines whether or not the processing of the inter-image distance measure calculation unit has been completed for all the geometric transformation parameter candidates. Estimate and output as a geometric transformation parameter in the template image / observed image pair, otherwise repeat until all are finished.

テンプレート位置計算部28は、判断部26によって推定された幾何変換パラメータを適用して、観測画像におけるテンプレート画像の位置を計算する。   The template position calculation unit 28 applies the geometric transformation parameter estimated by the determination unit 26 and calculates the position of the template image in the observation image.

例えば、テンプレート画像の観測画像にある当該箇所を境界ボックスで表現する場合、境界ボックスの左上の座標をt'min=[x'min,y'minTで、右下の座標をt'max=[x'max,y'maxTで表す。テンプレート画像の左上の座標をtmin=[0,0]Tで表し、右下の座標をtmaxで表す。ここで、t'minFor example, when the portion in the observed image of the template image is represented by a bounding box, the upper left coordinate of the bounding box is t ′ min = [x ′ min , y ′ min ] T , and the lower right coordinate is t ′ max. = [X ′ max , y ′ max ] T The upper left coordinate of the template image is represented by t min = [0, 0] T , and the lower right coordinate is represented by t max . Where t ' min

で計算し、t'maxAnd calculate t ' max

で計算する。 Calculate with

出力部90は、テンプレート位置計算部28によって計算された観測画像内におけるテンプレート画像の位置を結果として出力する。   The output unit 90 outputs the position of the template image in the observation image calculated by the template position calculation unit 28 as a result.

<本発明の第1の実施の形態に係るテンプレートマッチング装置の作用>
次に、本発明の第1の実施の形態に係るテンプレートマッチング装置100の作用について説明する。入力部10によって、テンプレート画像と観測画像とを受け付けると、テンプレートマッチング装置100は、図3に示すテンプレートマッチング処理ルーチンを実行する。
<Operation of Template Matching Device According to First Embodiment of the Present Invention>
Next, the operation of the template matching apparatus 100 according to the first embodiment of the present invention will be described. When a template image and an observation image are received by the input unit 10, the template matching apparatus 100 executes a template matching processing routine shown in FIG.

ステップS100において、入力部10により入力されたテンプレート画像と観測画像とのペアについて、画像間の幾何変換を考慮して、画像間の対応点を検出し、検出された対応点に基づいて、画像間の幾何変換を表す幾何変換パラメータの候補の各々を推定する。   In step S100, for a pair of a template image and an observation image input by the input unit 10, corresponding points between the images are detected in consideration of geometric transformation between the images, and the image is determined based on the detected corresponding points. Each of the geometric transformation parameter candidates representing the geometric transformation between is estimated.

ステップS102において、推定された幾何変換パラメータの候補のうちの処理対象の幾何変換パラメータの候補をテンプレート画像に適用し、テンプレート画像と観測画像との画像間距離測度を計算する。   In step S102, the candidate geometric transformation parameter to be processed among the estimated geometric transformation parameter candidates is applied to the template image, and an inter-image distance measure between the template image and the observed image is calculated.

ステップS104において、上記ステップS100で推定された全ての幾何変換パラメータの候補について、上記ステップS102の処理が実行されたか否かを判定する。全ての幾何変換パラメータの候補について、上記ステップS102の処理が実行された場合には、画像間距離測度が最小となる幾何変換パラメータの候補を、テンプレート画像と観測画像とのペアにおける幾何変換パラメータとして推定して出力し、ステップS106へ進む。一方、上記ステップS102の処理が実行されていない幾何変換パラメータの候補が存在する場合には、当該幾何変換パラメータの候補を処理対象としてステップS102へ戻る。   In step S104, it is determined whether or not the process in step S102 has been executed for all the geometric transformation parameter candidates estimated in step S100. When the process of step S102 is executed for all the geometric transformation parameter candidates, the geometric transformation parameter candidate that minimizes the inter-image distance measure is used as the geometric transformation parameter in the template image / observation image pair. Estimate and output, and proceed to step S106. On the other hand, if there is a geometric transformation parameter candidate for which the process of step S102 has not been performed, the process returns to step S102 with the geometric transformation parameter candidate as a processing target.

ステップS106において、推定された幾何変換パラメータを適用して、観測画像におけるテンプレート画像の位置を計算して出力部90により出力して、テンプレートマッチング処理ルーチンを終了する。   In step S106, the estimated geometric transformation parameter is applied, the position of the template image in the observed image is calculated and output by the output unit 90, and the template matching processing routine is terminated.

上記ステップS102は、図4に示す処理ルーチンにより実現される。   Step S102 is realized by the processing routine shown in FIG.

まず、ステップS110において、テンプレート画像における一部の画素を選択し、選択された画素の座標を出力する。   First, in step S110, some pixels in the template image are selected, and the coordinates of the selected pixels are output.

ステップS112において、処理対象の幾何変換パラメータの候補と、上記ステップS110で出力されたテンプレート画像の画素の座標のうちの処理対象の画素の座標とを入力とし、処理対象の幾何変換パラメータの候補について、当該幾何変換パラメータの候補を用いて、テンプレート画像の処理対象の画素の座標を観測画像に投影し、投影された画素の座標を出力する。   In step S112, the processing target geometric transformation parameter candidate and the coordinates of the processing target pixel among the coordinates of the pixel of the template image output in step S110 are input. Then, using the geometric transformation parameter candidates, the coordinates of the pixel to be processed of the template image are projected onto the observation image, and the coordinates of the projected pixel are output.

ステップS114において、処理対象の画素の座標に対し、上記ステップS112で出力された観測画像における画素の座標との画素間距離測度を計算し、画像間距離測度に加算する。   In step S114, an inter-pixel distance measure between the coordinates of the pixel to be processed and the pixel coordinates in the observation image output in step S112 is calculated and added to the inter-image distance measure.

ステップS116において、上記ステップS110で出力されたテンプレート画像の画素の座標の全てについて、上記ステップS112、S114の処理が終了したかを判断し、全て終了した場合、画像間距離測度を出力する。一方、上記ステップS112、S114の処理が終了していないテンプレート画像の画素の座標が存在する場合、当該画素の座標を処理対象として上記ステップS112へ戻る。   In step S116, it is determined whether or not the processing in steps S112 and S114 has been completed for all the coordinates of the pixels of the template image output in step S110. If all the coordinates have been completed, an inter-image distance measure is output. On the other hand, when the coordinates of the pixel of the template image for which the processes of steps S112 and S114 have not been completed exist, the process returns to step S112 with the coordinates of the pixel as a processing target.

以上説明したように、本発明の第1の実施の形態に係るテンプレートマッチング装置によれば、入力されたテンプレート画像と観測画像とのペアについて、画像間の幾何変換を考慮して、画像間の対応点を検出し、幾何変換パラメータの候補の各々を推定し、幾何変換パラメータの候補を適用したときのテンプレート画像と観測画像との画像間距離測度を計算し、画像間距離測度が最小となる幾何変換パラメータの候補を適用して、観測画像におけるテンプレート画像の位置を計算することにより、画像間の幾何変換を考慮して、効率的かつ精度よくテンプレート画像の位置を検出することができる。   As described above, according to the template matching apparatus according to the first embodiment of the present invention, with respect to a pair of an input template image and an observation image, the geometric transformation between images is taken into consideration, Corresponding points are detected, each of the geometric transformation parameter candidates is estimated, and an inter-image distance measure between the template image and the observed image when the geometric transformation parameter candidate is applied is calculated, and the inter-image distance measure is minimized. By applying the geometric transformation parameter candidates and calculating the position of the template image in the observed image, the position of the template image can be detected efficiently and accurately in consideration of the geometric transformation between the images.

なお、上記の実施の形態では、テンプレート画像の一部の画素を選択して、画像間距離測度を計算する場合を例に説明したが、これに限定されるものではなく、テンプレート画像の全画素を用いて、画像間距離測度を計算してもよい。この場合には、テンプレート画像の全画素の各々について、幾何変換パラメータの候補を用いて、観測画像に投影し、画素間距離測度を計算すればよい。   In the above embodiment, a case where a part of pixels of the template image is selected and the inter-image distance measure is calculated has been described as an example. However, the present invention is not limited to this, and all pixels of the template image are calculated. May be used to calculate the inter-image distance measure. In this case, it is only necessary to project each pixel of the template image onto the observation image using the geometric transformation parameter candidates and calculate the inter-pixel distance measure.

[第2の実施の形態]
次に、本発明の第2の実施の形態に係るテンプレートマッチング装置の構成について説明する。なお、第2の実施の形態に係るテンプレートマッチング装置は、第1の実施の形態と同様であるため、同一符号を付して説明を省略する。
[Second Embodiment]
Next, the configuration of the template matching apparatus according to the second embodiment of the present invention will be described. Note that the template matching apparatus according to the second embodiment is the same as that of the first embodiment, and thus the same reference numerals are given and description thereof is omitted.

第2の実施の形態では、テンプレート画像において、画像間距離測度を計算するための画素として、画素値の二次微分係数の絶対値が大きい画素を選択する点が、第1の実施の形態と異なる。   The second embodiment is different from the first embodiment in that, in the template image, a pixel having a large absolute value of the second derivative of the pixel value is selected as a pixel for calculating the inter-image distance measure. Different.

<概要>
前記課題3を解決するために、本発明の実施の形態に係るテンプレートマッチング装置は、テンプレート画像の全ての画素に対して、画素の座標における画素値の二次微分係数を算出し、二次微分係数の絶対値が最大の画素を複数選択し、選択された画素のみを用いて画像間距離測度を計算する。
<Overview>
In order to solve the problem 3, the template matching apparatus according to the embodiment of the present invention calculates the second derivative of the pixel value at the coordinates of the pixel for all the pixels of the template image. A plurality of pixels having the largest absolute value of the coefficient are selected, and an inter-image distance measure is calculated using only the selected pixels.

これにより、画像間距離測度の計算に用いる画素の数を大幅に減らし、計算量を抑えるのが可能になる。座標における画素値の二次微分係数が顕著な画素は、画像平面上における周辺の画素との画素値の差分が大きい。そのような画素は、距離測度の計算に用いられる際に、正しい幾何変換パラメータと誤っている幾何変換パラメータとの区別において、識別力が高い。そのため、均一サンプリングやランダムサンプリング等の方法と比べて、識別力のより高い画素を選択するのが可能になり、より正確に距離測度を近似し、幾何変換パラメータを推定するのが可能になる。   As a result, the number of pixels used for calculating the distance measure between images can be greatly reduced, and the amount of calculation can be reduced. A pixel in which the secondary differential coefficient of the pixel value in the coordinates is remarkable has a large difference in pixel value from the surrounding pixels on the image plane. Such pixels have high discriminating power in distinguishing between correct and incorrect geometric transformation parameters when used for distance measure calculations. Therefore, it is possible to select pixels with higher discrimination power than methods such as uniform sampling and random sampling, and it is possible to approximate the distance measure more accurately and estimate the geometric transformation parameters.

<第2の実施の形態に係るテンプレートマッチング装置の構成>
第2の実施の形態のテンプレートマッチング装置100の画素選択部30は、テンプレート画像の各画素の画素値の二次微分係数に基づいて、テンプレート画像における、画素値の二次微分係数の絶対値が大きい複数の画素を選択する。
<Configuration of Template Matching Device According to Second Embodiment>
The pixel selection unit 30 of the template matching apparatus 100 according to the second embodiment calculates the absolute value of the secondary differential coefficient of the pixel value in the template image based on the secondary differential coefficient of the pixel value of each pixel of the template image. Select multiple large pixels.

例えば、テンプレート画像の全ての画素に対して、画素の座標における画素値の二次微分係数を算出し、二次微分係数の絶対値が最大の画素をn個選択し、選択された画素を出力する。画素値の二次微分係数は、2次元のラプラシアンフィルタ、Laplacian of Gaussian (LoG)フィルタ、Difference of Gaussian (DoG)フィルタ等を用いて、画像と前記フィルタとの畳み込みを行うことによって算出される。   For example, for all the pixels of the template image, the secondary differential coefficient of the pixel value at the pixel coordinates is calculated, n pixels having the maximum absolute value of the secondary differential coefficient are selected, and the selected pixel is output. To do. The secondary differential coefficient of the pixel value is calculated by convolving the image with the filter using a two-dimensional Laplacian filter, Laplacian of Gaussian (LoG) filter, Difference of Gaussian (DoG) filter, or the like.

なお、第2の実施の形態に係るテンプレートマッチング装置の他の構成及び作用については、第1の実施の形態と同様であるため、説明を省略する。   Note that the other configuration and operation of the template matching apparatus according to the second embodiment are the same as those in the first embodiment, and thus the description thereof is omitted.

以上説明したように、本発明の第2の実施の形態に係るテンプレートマッチング装置によれば、入力されたテンプレート画像と観測画像とのペアについて、幾何変換パラメータの候補の各々を推定し、テンプレート画像の画素値の二次微分係数に基づいて、複数の画素を選択し、選択された画素の各々に対し、幾何変換パラメータの候補を適用したときの、観測画像における画素の各々との画素間距離測度を計算し、画素間距離測度に基づく画像間距離測度が最小となる幾何変換パラメータの候補を適用して、観測画像におけるテンプレート画像の位置を計算することにより、計算量を抑制し、かつ、画像間の幾何変換を考慮して、精度よくテンプレート画像の位置を検出することができる。   As described above, according to the template matching apparatus according to the second embodiment of the present invention, each of the candidates for the geometric transformation parameter is estimated for the pair of the input template image and the observed image, and the template image The inter-pixel distance from each of the pixels in the observed image when a plurality of pixels are selected based on the second derivative of the pixel value of the pixel and a geometric transformation parameter candidate is applied to each of the selected pixels. Calculating a measure, applying a candidate for a geometric transformation parameter that minimizes an inter-image distance measure based on an inter-pixel distance measure, and calculating the position of the template image in the observed image, thereby reducing the amount of calculation, and The position of the template image can be accurately detected in consideration of the geometric transformation between the images.

[第3の実施の形態]
次に、本発明の第3の実施の形態に係るテンプレートマッチング装置の構成について説明する。なお、第3の実施の形態に係るテンプレートマッチング装置は、第1の実施の形態と同様であるため、同一符号を付して説明を省略する。
[Third Embodiment]
Next, the configuration of the template matching apparatus according to the third embodiment of the present invention will be described. Note that the template matching apparatus according to the third embodiment is the same as that of the first embodiment, and thus the same reference numerals are given and description thereof is omitted.

第3の実施の形態では、テンプレート画像において、画像間距離測度を計算するための画素として、画素値の二次微分係数が顕著な特徴点に対応する画素を選択する点が、第1の実施の形態と異なる。   In the third embodiment, in the template image, a pixel corresponding to a feature point with a significant second derivative of the pixel value is selected as a pixel for calculating the inter-image distance measure. The form is different.

<概要>
前記課題3を解決するために、本発明の実施の形態に係わるテンプレートマッチング装置は、テンプレート画像から二次微分係数が顕著な特徴点を抽出し、特徴点の座標にある画素のみを用いて画像間距離測度を計算する。
<Overview>
In order to solve the problem 3, the template matching apparatus according to the embodiment of the present invention extracts a feature point having a significant second derivative from a template image, and uses only the pixels at the coordinates of the feature point. Calculate the distance measure.

特徴点は、複数の画像スケールにおいて二次微分係数が顕著な局所領域である。より大きい画像スケールで検出された特徴点(=スケールの小さい特徴点)は、正しい幾何変換パラメータと誤っている幾何変換パラメータとの差分(誤差)が小さい場合において、識別力が高い。逆に、より小さい画像スケールで検出された特徴点(=スケールの大きい特徴点)は、前記差分が大きい場合において、識別力が高い。従って、特徴点の座標にある画素を距離測度の計算に用いることによって、正しい幾何変換パラメータと誤っている幾何変換パラメータとの差分が小さい場合でも大きい場合でも、より正確に距離測度を近似し、幾何変換パラメータを推定するのが可能である。   A feature point is a local region where the second order differential coefficient is remarkable in a plurality of image scales. A feature point detected at a larger image scale (= feature point with a small scale) has high discrimination power when the difference (error) between the correct geometric transformation parameter and the wrong geometric transformation parameter is small. Conversely, feature points detected on a smaller image scale (= feature points with a large scale) have high discrimination power when the difference is large. Therefore, by using the pixel at the coordinates of the feature point for the calculation of the distance measure, the distance measure is approximated more accurately regardless of whether the difference between the correct geometric conversion parameter and the incorrect geometric conversion parameter is small or large, It is possible to estimate the geometric transformation parameters.

<第3の実施の形態に係るテンプレートマッチング装置の構成>
第3の実施の形態のテンプレートマッチング装置100の画素選択部30は、テンプレート画像から画素値の二次微分係数に基づいて複数の特徴点を抽出し、抽出された複数の特徴点に対応する、テンプレート画像における複数の画素を選択する。
<Configuration of Template Matching Device According to Third Embodiment>
The pixel selection unit 30 of the template matching apparatus 100 according to the third embodiment extracts a plurality of feature points from the template image based on the secondary differential coefficients of the pixel values, and corresponds to the extracted plurality of feature points. A plurality of pixels in the template image are selected.

例えば、テンプレート画像から二次微分係数が顕著な特徴点を抽出し、特徴点の座標にある画素を選択し、選択された全ての画素を出力する。前記特徴点は、LoG特徴点検出方法、DoG特徴点検出方法、Hessian-Laplace特徴点検出方法等を用いることによって抽出される。   For example, a feature point with a significant second-order differential coefficient is extracted from the template image, pixels at the coordinates of the feature point are selected, and all the selected pixels are output. The feature points are extracted by using a LoG feature point detection method, a DoG feature point detection method, a Hessian-Laplace feature point detection method, or the like.

なお、第3の実施の形態に係るテンプレートマッチング装置の他の構成及び作用については、第1の実施の形態と同様であるため、説明を省略する。   In addition, about the other structure and effect | action of the template matching apparatus concerning 3rd Embodiment, since it is the same as that of 1st Embodiment, description is abbreviate | omitted.

以上説明したように、本発明の第3の実施の形態に係るテンプレートマッチング装置によれば、入力されたテンプレート画像と観測画像とのペアについて、幾何変換パラメータの候補の各々を推定し、テンプレート画像の画素値の二次微分係数に基づいて、二次微分係数が顕著な特徴点の画素を選択し、選択された画素の各々に対し、幾何変換パラメータの候補を適用したときの、観測画像における画素の各々との画素間距離測度を計算し、画素間距離測度に基づく画像間距離測度が最小となる幾何変換パラメータの候補を適用して、観測画像におけるテンプレート画像の位置を計算することにより、計算量を抑制し、かつ、画像間の幾何変換を考慮して、精度よくテンプレート画像の位置を検出することができる。   As described above, according to the template matching apparatus according to the third embodiment of the present invention, each of the candidates for the geometric transformation parameter is estimated for the pair of the input template image and the observed image, and the template image Based on the second derivative of the pixel value of, the pixel of the feature point where the second derivative is noticeable is selected, and the candidate of the geometric transformation parameter is applied to each of the selected pixels. By calculating an inter-pixel distance measure with each of the pixels, applying a geometric transformation parameter candidate that minimizes the inter-image distance measure based on the inter-pixel distance measure, and calculating the position of the template image in the observed image, It is possible to detect the position of the template image with high accuracy in consideration of the amount of calculation and considering the geometric transformation between images.

[第4の実施の形態]
次に、本発明の第4の実施の形態に係るテンプレートマッチング装置の構成について説明する。なお、第4の実施の形態に係るテンプレートマッチング装置は、第1の実施の形態と同様であるため、同一符号を付して説明を省略する。
[Fourth Embodiment]
Next, the configuration of the template matching apparatus according to the fourth embodiment of the present invention will be described. Note that the template matching apparatus according to the fourth embodiment is the same as that of the first embodiment, and thus the same reference numerals are given and description thereof is omitted.

第4の実施の形態では、テンプレート画像において、画像間距離測度を計算するための画素として、画素値の二次微分係数が顕著な特徴点のうち、スケールが上位n個の特徴点に対応する画素を選択する点が、第1の実施の形態と異なる。   In the fourth embodiment, in the template image, as the pixels for calculating the inter-image distance measure, among the feature points where the second derivative of the pixel value is remarkable, the scale corresponds to the top n feature points. The point of selecting a pixel is different from the first embodiment.

<概要>
前記課題3を解決するために、本発明に係わるテンプレートマッチング装置は、テンプレート画像から二次微分係数が顕著な特徴点を抽出し、特徴点の座標にある画素のみを用いて画像間距離測度を計算する。特徴点の数が距離測度の計算に必要な画素の数より大きい場合、スケールが小さい順に特徴点を並べ替え、上位の特徴点の座標にある画素のみを用いる。
<Overview>
In order to solve the problem 3, the template matching apparatus according to the present invention extracts a feature point having a significant second derivative from a template image, and calculates an inter-image distance measure using only pixels at the coordinates of the feature point. calculate. When the number of feature points is larger than the number of pixels necessary for the calculation of the distance measure, the feature points are rearranged in order from the smallest scale, and only the pixels at the coordinates of the upper feature points are used.

正しい幾何変換パラメータと誤っている幾何変換パラメータとの差分について、差分が小さい場合、区別がより困難である。そこで、スケールが小さい順に特徴点を並べ替え、上位の特徴点の座標にある画素を選択することによって、正しい幾何変換パラメータと誤っている幾何変換パラメータとを区別する際に、識別力のより高い画素を選択するのが可能になり、より正確に距離測度を近似し、幾何変換パラメータを推定するのが可能になる。   When the difference between the correct geometric conversion parameter and the incorrect geometric conversion parameter is small, it is more difficult to distinguish. Therefore, when distinguishing between correct geometric transformation parameters and wrong geometric transformation parameters by rearranging feature points in ascending order of scale and selecting pixels at the coordinates of higher feature points, the discrimination power is higher. Pixels can be selected, and distance measures can be approximated more accurately and geometric transformation parameters can be estimated.

<第4の実施の形態に係るテンプレートマッチング装置の構成>
第4の実施の形態のテンプレートマッチング装置100の画素選択部30は、テンプレート画像から画素値の二次微分係数に基づいて複数の特徴点を抽出し、抽出された複数の特徴点を、スケールが大きい順に並べ替え、上位n個の特徴点に対応する、テンプレート画像における複数の画素を選択する。
<Configuration of Template Matching Device According to Fourth Embodiment>
The pixel selection unit 30 of the template matching apparatus 100 according to the fourth embodiment extracts a plurality of feature points from the template image based on the secondary differential coefficients of the pixel values, and the scales are extracted from the extracted feature points. A plurality of pixels in the template image corresponding to the top n feature points are selected in the descending order.

例えば、テンプレート画像から二次微分係数が顕著な特徴点を抽出し、特徴点の座標にある画素を選択する。特徴点の数が距離測度の計算に必要な画素の数より大きい場合、スケールが小さい順に特徴点を並べ替え、上位n個の特徴点の座標にある画素を出力する。   For example, a feature point with a significant second order differential coefficient is extracted from the template image, and a pixel at the coordinate of the feature point is selected. When the number of feature points is larger than the number of pixels necessary for calculating the distance measure, the feature points are rearranged in order from the smallest scale, and the pixels at the coordinates of the top n feature points are output.

なお、第4の実施の形態に係るテンプレートマッチング装置の他の構成及び作用については、第1の実施の形態と同様であるため、説明を省略する。   Note that other configurations and operations of the template matching apparatus according to the fourth embodiment are the same as those in the first embodiment, and thus the description thereof is omitted.

以上説明したように、本発明の第4の実施の形態に係るテンプレートマッチング装置によれば、入力されたテンプレート画像と観測画像とのペアについて、幾何変換パラメータの候補の各々を推定し、テンプレート画像の画素値の二次微分係数に基づいて、二次微分係数が顕著な特徴点の画素を選択し、選択された画素の各々に対し、幾何変換パラメータの候補を適用したときの、観測画像における画素の各々との画素間距離測度を計算し、画素間距離測度に基づく画像間距離測度が最小となる幾何変換パラメータの候補を適用して、観測画像におけるテンプレート画像の位置を計算することにより、計算量を抑制し、かつ、画像間の幾何変換を考慮して、精度よくテンプレート画像の位置を検出することができる。   As described above, according to the template matching apparatus according to the fourth embodiment of the present invention, each of the candidates for the geometric transformation parameter is estimated for the pair of the input template image and the observed image, and the template image Based on the second derivative of the pixel value of, the pixel of the feature point where the second derivative is noticeable is selected, and the candidate of the geometric transformation parameter is applied to each of the selected pixels. By calculating an inter-pixel distance measure with each of the pixels, applying a geometric transformation parameter candidate that minimizes the inter-image distance measure based on the inter-pixel distance measure, and calculating the position of the template image in the observed image, It is possible to detect the position of the template image with high accuracy in consideration of the amount of calculation and considering the geometric transformation between images.

なお、本発明は、上述した実施の形態に限定されるものではなく、この発明の要旨を逸脱しない範囲内で様々な変形や応用が可能である。   The present invention is not limited to the above-described embodiment, and various modifications and applications can be made without departing from the gist of the present invention.

例えば、上述のテンプレートマッチング装置は、内部にコンピュータシステムを有しているが、「コンピュータシステム」は、WWWシステムを利用している場合であれば、ホームページ提供環境(あるいは表示環境)も含むものとする。   For example, the above-described template matching apparatus has a computer system therein, but the “computer system” includes a homepage providing environment (or display environment) if a WWW system is used.

また、本願明細書中において、プログラムが予めインストールされている実施形態として説明したが、当該プログラムを、コンピュータ読み取り可能な記録媒体に格納して提供することも可能である。   In the present specification, the embodiment has been described in which the program is installed in advance. However, the program can be provided by being stored in a computer-readable recording medium.

10 入力部
20 演算部
22 幾何検証部
24 画像間距離測度計算部
26 判断部
28 テンプレート位置計算部
30 画素選択部
32 幾何変換部
34 画素間距離測度計算部
36 判断部
40 出力部
100 テンプレートマッチング装置
DESCRIPTION OF SYMBOLS 10 Input part 20 Calculation part 22 Geometric verification part 24 Inter-image distance measure calculation part 26 Judgment part 28 Template position calculation part 30 Pixel selection part 32 Geometric conversion part 34 Inter-pixel distance measure calculation part 36 Judgment part 40 Output part 100 Template matching apparatus

Claims (8)

入力されたテンプレート画像と観測画像とのペアについて、画像間の幾何変換を考慮して、画像間の対応点を検出し、検出された対応点に基づいて、画像間の幾何変換を表す幾何変換パラメータの候補の各々を推定する幾何検証部と、
前記幾何検証部によって推定された前記幾何変換パラメータの候補の各々について、前記幾何変換パラメータの候補を適用したときの前記テンプレート画像と前記観測画像との画像間距離測度を計算する画像間距離測度計算部と、
画像間距離測度が最小となる前記幾何変換パラメータの候補を、前記テンプレート画像と前記観測画像とのペアにおける幾何変換パラメータとして推定する判断部と、
前記判断部によって推定された前記幾何変換パラメータを適用して、前記観測画像における前記テンプレート画像の位置を計算するテンプレート位置計算部と、
を含むテンプレートマッチング装置。
For a pair of input template image and observation image, consider the geometric transformation between images, detect corresponding points between images, and represent the geometric transformation between images based on the detected corresponding points A geometric verification unit that estimates each of the parameter candidates;
An inter-image distance measure calculation that calculates an inter-image distance measure between the template image and the observed image when the geometric transformation parameter candidate is applied to each of the geometric transformation parameter candidates estimated by the geometric verification unit. And
A determination unit that estimates a candidate for the geometric transformation parameter that minimizes an inter-image distance measure as a geometric transformation parameter in a pair of the template image and the observed image;
Applying the geometric transformation parameter estimated by the determination unit to calculate the position of the template image in the observed image;
Template matching device including
入力されたテンプレート画像と観測画像とのペアについて、画像間の幾何変換を表す幾何変換パラメータの候補の各々を推定する幾何検証部と、
前記テンプレート画像の各画素の画素値の二次微分係数に基づいて、前記テンプレート画像における複数の画素を選択する画素選択部と、
前記幾何検証部によって推定された前記幾何変換パラメータの候補の各々について、前記画素選択部によって選択された画素の各々に対し、前記幾何変換パラメータの候補を適用したときの、前記観測画像における画素の各々との画素間距離測度を計算する画素間距離測度計算部と、
前記選択された画素の各々に対して計算された前記画素間距離測度に基づく画像間距離測度が最小となる前記幾何変換パラメータの候補を、前記テンプレート画像と前記観測画像とのペアにおける幾何変換パラメータとして推定する判断部と、
前記判断部によって推定された前記幾何変換パラメータを適用して、前記観測画像における前記テンプレート画像の位置を計算するテンプレート位置計算部と、
を含むテンプレートマッチング装置。
A geometric verification unit that estimates each of the candidates for the geometric transformation parameter representing the geometric transformation between the images for the pair of the input template image and the observed image;
A pixel selection unit that selects a plurality of pixels in the template image based on a second derivative of a pixel value of each pixel of the template image;
For each of the geometric transformation parameter candidates estimated by the geometric verification unit, the pixel of the observed image when the geometric transformation parameter candidate is applied to each of the pixels selected by the pixel selection unit. An inter-pixel distance measure calculator for calculating an inter-pixel distance measure with each;
The geometric transformation parameter candidate that minimizes the inter-image distance measure based on the inter-pixel distance measure calculated for each of the selected pixels is defined as a geometric transformation parameter in the template image / observation image pair. A determination unit that estimates as
Applying the geometric transformation parameter estimated by the determination unit to calculate the position of the template image in the observed image;
Template matching device including
前記画素選択部は、前記テンプレート画像から画素値の二次微分係数に基づいて複数の特徴点を抽出し、前記抽出された複数の特徴点に対応する、前記テンプレート画像における複数の画素を選択する請求項2記載のテンプレートマッチング装置。   The pixel selection unit extracts a plurality of feature points from the template image based on secondary differential coefficients of pixel values, and selects a plurality of pixels in the template image corresponding to the extracted feature points. The template matching apparatus according to claim 2. 前記画素選択部は、前記テンプレート画像から画素値の二次微分係数に基づいて複数の特徴点を抽出し、前記抽出された複数の特徴点を、スケールが大きい順に並べ替え、上位n個の特徴点に対応する、前記テンプレート画像における複数の画素を選択する請求項3記載のテンプレートマッチング装置。   The pixel selection unit extracts a plurality of feature points from the template image based on a second derivative of a pixel value, rearranges the extracted feature points in descending order of scale, and sets the top n features The template matching apparatus according to claim 3, wherein a plurality of pixels in the template image corresponding to a point are selected. 幾何検証部が、入力されたテンプレート画像と観測画像とのペアについて、画像間の幾何変換を考慮して、画像間の対応点を検出し、検出された対応点に基づいて、画像間の幾何変換を表す幾何変換パラメータの候補の各々を推定し、
画像間距離測度計算部が、前記幾何検証部によって推定された前記幾何変換パラメータの候補の各々について、前記幾何変換パラメータの候補を適用したときの前記テンプレート画像と前記観測画像との画像間距離測度を計算し、
判断部が、画像間距離測度が最小となる前記幾何変換パラメータの候補を、前記テンプレート画像と前記観測画像とのペアにおける幾何変換パラメータとして推定し、
テンプレート位置計算部が、前記判断部によって推定された前記幾何変換パラメータを適用して、前記観測画像における前記テンプレート画像の位置を計算する
テンプレートマッチング方法。
The geometric verification unit detects the corresponding points between the images in consideration of the geometric transformation between the images for the input template image and observation image pair, and based on the detected corresponding points, the geometry between the images is detected. Estimating each of the geometric transformation parameter candidates representing the transformation;
The inter-image distance measure calculation unit calculates the inter-image distance measure between the template image and the observed image when the geometric conversion parameter candidate is applied to each of the geometric conversion parameter candidates estimated by the geometric verification unit. Calculate
The determination unit estimates the geometric transformation parameter candidate that minimizes the distance measure between images as a geometric transformation parameter in the pair of the template image and the observation image,
A template matching method in which a template position calculation unit calculates the position of the template image in the observed image by applying the geometric transformation parameter estimated by the determination unit.
幾何検証部が、入力されたテンプレート画像と観測画像とのペアについて、画像間の幾何変換を表す幾何変換パラメータの候補の各々を推定し、
画素選択部が、前記テンプレート画像の各画素の画素値の二次微分係数に基づいて、前記テンプレート画像における複数の画素を選択し、
画素間距離測度計算部が、前記幾何検証部によって推定された前記幾何変換パラメータの候補の各々について、前記画素選択部によって選択された画素の各々に対し、前記幾何変換パラメータの候補を適用したときの、前記観測画像における画素の各々との画素間距離測度を計算し、
判断部が、前記選択された画素の各々に対して計算された前記画素間距離測度に基づく画像間距離測度が最小となる前記幾何変換パラメータの候補を、前記テンプレート画像と前記観測画像とのペアにおける幾何変換パラメータとして推定し、
テンプレート位置計算部が、前記判断部によって推定された前記幾何変換パラメータを適用して、前記観測画像における前記テンプレート画像の位置を計算する
テンプレートマッチング方法。
The geometric verification unit estimates each of the geometric transformation parameter candidates representing the geometric transformation between images for the input template image and observed image pair,
The pixel selection unit selects a plurality of pixels in the template image based on the second derivative of the pixel value of each pixel of the template image,
When the inter-pixel distance measure calculation unit applies the geometric transformation parameter candidate to each of the pixels selected by the pixel selection unit for each of the geometric transformation parameter candidates estimated by the geometric verification unit. Calculating an inter-pixel distance measure with each of the pixels in the observed image,
The determination unit determines a candidate for the geometric transformation parameter that minimizes the inter-image distance measure based on the inter-pixel distance measure calculated for each of the selected pixels as a pair of the template image and the observed image. Estimated as a geometric transformation parameter in
A template matching method in which a template position calculation unit calculates the position of the template image in the observed image by applying the geometric transformation parameter estimated by the determination unit.
前記画素選択部によって画素を選択することでは、前記テンプレート画像から画素値の二次微分係数に基づいて複数の特徴点を抽出し、前記抽出された複数の特徴点に対応する、前記テンプレート画像における複数の画素を選択する請求項6記載のテンプレートマッチング方法。   In selecting a pixel by the pixel selection unit, a plurality of feature points are extracted from the template image based on a secondary differential coefficient of a pixel value, and the template image corresponds to the extracted plurality of feature points. The template matching method according to claim 6, wherein a plurality of pixels are selected. コンピュータを、請求項1〜請求項4の何れか1項記載のテンプレートマッチング装置を構成する各部として機能させるためのプログラム。   The program for functioning a computer as each part which comprises the template matching apparatus of any one of Claims 1-4.
JP2016208802A 2016-10-25 2016-10-25 Template matching apparatus, method, and program Active JP6639369B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2016208802A JP6639369B2 (en) 2016-10-25 2016-10-25 Template matching apparatus, method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016208802A JP6639369B2 (en) 2016-10-25 2016-10-25 Template matching apparatus, method, and program

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2019070422A Division JP6682167B2 (en) 2019-04-02 2019-04-02 Template matching device, method, and program

Publications (2)

Publication Number Publication Date
JP2018072937A true JP2018072937A (en) 2018-05-10
JP6639369B2 JP6639369B2 (en) 2020-02-05

Family

ID=62114186

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016208802A Active JP6639369B2 (en) 2016-10-25 2016-10-25 Template matching apparatus, method, and program

Country Status (1)

Country Link
JP (1) JP6639369B2 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62236090A (en) * 1986-04-07 1987-10-16 Mitsubishi Electric Corp Pattern collating system
JPH064669A (en) * 1992-06-19 1994-01-14 Omron Corp Pattern matching device for gradation picture
JP2010086268A (en) * 2008-09-30 2010-04-15 Mazda Motor Corp Display object recognition device for vehicle
JP2015179426A (en) * 2014-03-19 2015-10-08 富士通株式会社 Information processing apparatus, parameter determination method, and program

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62236090A (en) * 1986-04-07 1987-10-16 Mitsubishi Electric Corp Pattern collating system
JPH064669A (en) * 1992-06-19 1994-01-14 Omron Corp Pattern matching device for gradation picture
JP2010086268A (en) * 2008-09-30 2010-04-15 Mazda Motor Corp Display object recognition device for vehicle
JP2015179426A (en) * 2014-03-19 2015-10-08 富士通株式会社 Information processing apparatus, parameter determination method, and program

Also Published As

Publication number Publication date
JP6639369B2 (en) 2020-02-05

Similar Documents

Publication Publication Date Title
JP5671281B2 (en) Position / orientation measuring apparatus, control method and program for position / orientation measuring apparatus
CN105021124B (en) A kind of planar part three-dimensional position and normal vector computational methods based on depth map
CN105160641B (en) X-ray welded seam area extracting method based on image procossing
TWI520078B (en) Optical flow tracking method and device
CN102034101B (en) Method for quickly positioning circular mark in PCB visual detection
WO2015037178A1 (en) Posture estimation method and robot
US11676301B2 (en) System and method for efficiently scoring probes in an image with a vision system
CN110378906B (en) Ellipse detection method based on chord tangent distance
CN105894521A (en) Sub-pixel edge detection method based on Gaussian fitting
JP2014523572A (en) Generating map data
US9569850B2 (en) System and method for automatically determining pose of a shape
CN106340010A (en) Corner detection method based on second-order contour difference
CN111222507A (en) Automatic identification method of digital meter reading and computer readable storage medium
KR20180098945A (en) Method and apparatus for measuring speed of vehicle by using fixed single camera
JP2017130067A (en) Automatic image processing system for improving position accuracy level of satellite image and method thereof
JP6682167B2 (en) Template matching device, method, and program
TWI543117B (en) Method for recognizing and locating object
JP2015111128A (en) Position attitude measurement device, position attitude measurement method, and program
CN111445480B (en) Image rotation angle and zoom coefficient measuring method based on novel template
JP2008116206A (en) Apparatus, method, and program for pattern size measurement
JP2011133954A (en) Edge extraction method and edge extraction device
JP2009146150A (en) Method and device for detecting feature position
JP6639369B2 (en) Template matching apparatus, method, and program
Kröger et al. Performance evaluation on contour extraction using Hough transform and RANSAC for multi-sensor data fusion applications in industrial food inspection
JP4887820B2 (en) Image position measuring method, image position measuring apparatus, and image position measuring program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20180207

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20190128

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20190212

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20190402

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20190910

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20191111

A911 Transfer to examiner for re-examination before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20191120

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: 20191211

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20191224

R150 Certificate of patent or registration of utility model

Ref document number: 6639369

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150