JP2009250739A - Method for processing image and program - Google Patents
Method for processing image and program Download PDFInfo
- Publication number
- JP2009250739A JP2009250739A JP2008097796A JP2008097796A JP2009250739A JP 2009250739 A JP2009250739 A JP 2009250739A JP 2008097796 A JP2008097796 A JP 2008097796A JP 2008097796 A JP2008097796 A JP 2008097796A JP 2009250739 A JP2009250739 A JP 2009250739A
- Authority
- JP
- Japan
- Prior art keywords
- matching
- image
- template
- mark
- candidate point
- 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.)
- Withdrawn
Links
Images
Landscapes
- Length Measuring Devices By Optical Means (AREA)
- Image Processing (AREA)
- Image Analysis (AREA)
Abstract
Description
本発明は、画像処理方法およびプログラムに関し、特に、画像内の所定のマークの位置を検出する画像処理方法およびプログラムに関する。 The present invention relates to an image processing method and program, and more particularly, to an image processing method and program for detecting the position of a predetermined mark in an image.
従来、基板上に回路パターンをプリントする工程などにおいて、予め基板にプリントされているアライメントマークを用いて基板の位置決めが行われている。その基板上のアライメントマークの位置を検出する手段の一つとして、テンプレートマッチングがよく用いられている(例えば、特許文献1参照)。 Conventionally, in a process of printing a circuit pattern on a substrate or the like, the substrate is positioned using an alignment mark that is printed in advance on the substrate. Template matching is often used as one of means for detecting the position of the alignment mark on the substrate (see, for example, Patent Document 1).
しかしながら、従来のテンプレートマッチングにおいて、基板の回転などによりアライメントマークが回転していても正確にアライメントマークの位置を検出できるようにするためには、例えば、正常な方向を向いているアライメントマークの他に、回転したアライメントマークを示すテンプレートを複数準備しておき、テンプレートの数だけ、基板を撮影した画像全体に対するマッチングを行うため、処理に時間がかかっていた。 However, in the conventional template matching, in order to be able to accurately detect the position of the alignment mark even if the alignment mark is rotated due to the rotation of the substrate or the like, for example, in addition to the alignment mark facing the normal direction, In addition, since a plurality of templates indicating rotated alignment marks are prepared and matching is performed on the entire image obtained by photographing the substrate by the number of templates, the processing takes time.
本発明は、このような状況を鑑みてなされたものであり、画像内の回転したマークの位置を迅速かつ正確に検出できるようにするものである。 The present invention has been made in view of such a situation, and makes it possible to quickly and accurately detect the position of a rotated mark in an image.
本発明の一側面の画像処理方法は、入力画像の所定エリア内の画素の信号パターンとテンプレートの信号パターンとのマッチングによりテンプレートと類似度の高い入力画像の領域を検出し、検出した領域の中心を候補点として抽出する候補点抽出ステップと、候補点のそれぞれについて、候補点を中心とする所定の形状の領域であって、候補点を中心として回転させた回転角の異なる複数の領域の画像をマッチング対象画像として抽出するマッチング対象画像抽出ステップと、抽出されたマッチング対象画像とテンプレートのマッチングを行い、マッチング対象画像とテンプレートの類似度を表すマッチングスコアを求めるマッチングステップと、マッチングスコアが最大となるマッチング対象画像の位置を入力画像におけるマークの位置として検出するマーク検出ステップとを含む。 An image processing method according to an aspect of the present invention detects an input image region having a high similarity to a template by matching a pixel signal pattern within a predetermined area of the input image with a template signal pattern, and the center of the detected region Candidate point extracting step for extracting candidate points, and for each of the candidate points, images of a plurality of regions having a predetermined shape centered on the candidate point and having different rotation angles rotated around the candidate point A matching target image extracting step for extracting a matching target image, a matching step for performing matching between the extracted matching target image and a template, obtaining a matching score representing a similarity between the matching target image and the template, and a matching score being maximum The position of the target image to be matched is the mark position in the input image And a mark detecting step of detecting in.
本発明の一側面のプログラムは、入力画像の所定エリア内の画素の信号パターンとテンプレートの信号パターンとのマッチングによりテンプレートと類似度の高い入力画像の領域を検出し、検出した領域の中心を候補点として抽出する候補点抽出ステップと、候補点のそれぞれについて、候補点を中心とする所定の形状の領域であって、候補点を中心として回転させた回転角の異なる複数の領域の画像をマッチング対象画像として抽出するマッチング対象画像抽出ステップと、抽出されたマッチング対象画像とテンプレートのマッチングを行い、マッチング対象画像とテンプレートの類似度を表すマッチングスコアを求めるマッチングステップと、マッチングスコアが最大となるマッチング対象画像の位置を入力画像におけるマークの位置として検出するマーク検出ステップとを含む処理をコンピュータに実行させる。 The program according to one aspect of the present invention detects a region of an input image having a high similarity to the template by matching a signal pattern of a pixel in a predetermined area of the input image with a signal pattern of the template, and selects the center of the detected region as a candidate Candidate point extraction step for extracting points, and for each of the candidate points, matching images of a plurality of regions having a predetermined shape centered on the candidate point and having different rotation angles rotated around the candidate point A matching target image extracting step for extracting as a target image, a matching step for performing matching between the extracted matching target image and a template and obtaining a matching score representing a similarity between the matching target image and the template, and a matching that maximizes the matching score The position of the target image is the mark position in the input image. The process including the mark detection step of detecting causing a computer to execute Te.
本発明の一側面においては、入力画像の所定エリア内の画素の信号パターンとテンプレートの信号パターンとのマッチングによりテンプレートと類似度の高い入力画像の領域が検出され、検出された領域の中心が候補点として抽出され、候補点のそれぞれについて、候補点を中心とする所定の形状の領域であって、候補点を中心として回転させた回転角の異なる複数の領域の画像がマッチング対象画像として抽出され、抽出されたマッチング対象画像とテンプレートのマッチングを行い、マッチング対象画像とテンプレートの類似度を表すマッチングスコアが求められ、マッチングスコアが最大となるマッチング対象画像の位置が入力画像におけるマークの位置として検出される。 In one aspect of the present invention, a region of an input image having a high degree of similarity to a template is detected by matching a signal pattern of a pixel in a predetermined area of the input image and a signal pattern of the template, and the center of the detected region is a candidate. For each of the candidate points, images of a plurality of regions having a predetermined shape centered on the candidate point and having different rotation angles rotated around the candidate point are extracted as matching target images. , Matching the extracted matching target image with the template, obtaining a matching score representing the similarity between the matching target image and the template, and detecting the position of the matching target image having the maximum matching score as the mark position in the input image Is done.
本発明の一側面によれば、画像内の回転したマークの位置を迅速かつ正確に検出することができる。 According to one aspect of the present invention, the position of a rotated mark in an image can be detected quickly and accurately.
以下、図面を参照して本発明を適用した実施の形態について説明する。 Embodiments to which the present invention is applied will be described below with reference to the drawings.
図1は、本発明を適用した画像処理装置の一実施の形態を示すブロック図である。図1の画像処理装置1は、例えば、外部から入力された画像(以下、入力画像と称する)において、与えられたテンプレートに示される画像(以下、マークと称する)と一致するマークが存在する位置、および、マークが回転している角度(以下、回転角とも称する)を検出する処理を行う。例えば、画像処理装置1は、基板を撮影した画像において、基板の位置決めに用いるアライメントマークの位置および回転角の検出を行う。
FIG. 1 is a block diagram showing an embodiment of an image processing apparatus to which the present invention is applied. The
画像処理装置1の候補点抽出部11は、図4および図5などを参照して後述するように、入力画像において、テンプレートに示されるマークが存在する可能性がありマークの探索対象とする領域の位置を示す候補点を抽出し、抽出した候補点の座標を示す情報をマッチング対象画像抽出部12に供給する。
As will be described later with reference to FIGS. 4 and 5, the candidate point extraction unit 11 of the
マッチング対象画像抽出部12は、図6などを参照して後述するように、抽出された各候補点について、候補点を中心とする所定の形状の領域であって、候補点を中心とする回転角が異なる複数の領域内の画像(以下、マッチング対象画像と称する)を入力画像から抽出する。マッチング対象画像抽出部12は、抽出したマッチング対象画像、および、各マッチング対象画像の回転角と対応する候補点の座標を示す情報をマッチング部13に供給する。
As will be described later with reference to FIG. 6 and the like, the matching target
マッチング部13は、図7および図8などを参照して後述するように、抽出されたマッチング対象画像とテンプレートの画素単位のマッチングを行い、各マッチング対象画像に対するマッチング結果、および、各マッチング対象画像の回転角と対応する候補点の座標を示す情報をマーク検出部14に供給する。
As will be described later with reference to FIGS. 7 and 8, the matching
マーク検出部14は、図2などを参照して後述するように、各マッチング対象画像とテンプレートの画素単位のマッチングの結果に基づいて、入力画像におけるマークの位置および回転角を検出する。マーク検出部14は、検出したマークの位置および回転角を示す情報を座標変換部15に供給する。
As will be described later with reference to FIG. 2 and the like, the
座標変換部15は、図9などを参照して後述するように、マッチング対象画像の座標系で表されているマークの位置の座標を入力画像の座標系における座標に変換する。座標変換部15は、入力画像の座標系に変換したマークの位置の座標、および、マークの回転角を示す情報を外部に出力する。
As will be described later with reference to FIG. 9 and the like, the
なお、以下、マッチング対象画像以外の画像(例えば、入力画像、テンプレートなど)の座標系を、画像の左上隅を原点、画像の水平方向をx軸方向、垂直方向をy軸方向とするとともに、右方向をx軸の正の方向、下方向をy軸の正の方向とする座標系とする。また、マッチング対象画像の座標系を、マッチング対象画像の中心を原点、マッチング対象画像の水平方向をx'軸方向、垂直方向をy'軸方向とするとともに、右方向をx'軸の正の方向、上方向をy'軸の正の方向とする座標系とする。 In the following, the coordinate system of an image other than the matching target image (for example, an input image, a template, etc.) is set such that the upper left corner of the image is the origin, the horizontal direction of the image is the x-axis direction, and the vertical direction is the y-axis direction. A coordinate system in which the right direction is the positive direction of the x axis and the downward direction is the positive direction of the y axis is used. Further, the coordinate system of the matching target image is set to the origin of the center of the matching target image, the horizontal direction of the matching target image is the x′-axis direction, the vertical direction is the y′-axis direction, and the right direction is a positive x′-axis. Let the direction and the upper direction be a coordinate system with the positive direction of the y ′ axis.
次に、図2のフローチャートを参照して、画像処理装置1により実行される画像処理について説明する。なお、この処理は、例えば、処理対象となる入力画像が候補点抽出部11に入力されたとき開始される。また、以下、探索対象となるマークを示すテンプレートは予め画像処理装置1に与えられており、テンプレートの形状は矩形であるものとする。
Next, image processing executed by the
ステップS1において、候補点抽出部11は、投影パターンを用いたマッチングにより候補点を抽出する。なお、投影パターンとは、2次元の画像において、x軸方向(水平方向)のライン毎に画素値の合計値を求め、求めた合計値のy軸方向(垂直方向)の分布を示す1次元の画素の信号パターン(以下、y軸方向の投影パターンと称する)、または、y軸方向(垂直方向)のライン毎に画素値の合計値を求め、求めた合計値のx軸方向(水平方向)の分布を示す1次元の画素の信号パターン(以下、x軸方向の投影パターンと称する)である。すなわち、投影パターンは、水平または垂直方向のライン単位の画素値の分布を示しており、画像をx軸またはy軸方向に投影したパターンであると言える。 In step S1, the candidate point extraction unit 11 extracts candidate points by matching using a projection pattern. Note that a projection pattern is a one-dimensional image that represents the total value of pixel values for each line in the x-axis direction (horizontal direction) in a two-dimensional image, and the distribution of the calculated total value in the y-axis direction (vertical direction). A pixel signal pattern (hereinafter referred to as a projection pattern in the y-axis direction) or a total pixel value for each line in the y-axis direction (vertical direction) is obtained, and the obtained total value in the x-axis direction (horizontal direction) ) Is a one-dimensional pixel signal pattern (hereinafter referred to as a projection pattern in the x-axis direction). That is, the projection pattern indicates a distribution of pixel values in units of lines in the horizontal or vertical direction, and can be said to be a pattern in which an image is projected in the x-axis or y-axis direction.
ここで、図3を参照して、投影パターンの具体例について説明する。図3のテンプレートT1には、同じ大きさの正方形のマークM1t乃至M4tが示されている。また、マークM1tとマークM3t、および、マークM2tとマークM4tは、x軸方向において同じ位置に配置され、マークM1tとマークM2t、および、マークM3tとマークM4tは、y軸方向において同じ位置に配置されている。そして、テンプレートT1の画素値を256階調とし、マークM1t乃至M4tの画素値を0(すなわち、黒色)、その他の領域の画素値を255(すなわち、白色)とした場合、テンプレートT1のx軸方向の投影パターンは、パターン51により表される。すなわち、投影パターン51は、マークM1tとマークM3t、および、マークM2tとマークM4tが存在する列のx座標において値が最小となり、それ以外の列のx座標において値が最大となる2値のパルス上の波形となる。
Here, a specific example of the projection pattern will be described with reference to FIG. In the template T1 of FIG. 3, square marks M1t to M4t having the same size are shown. The mark M1t and the mark M3t, and the mark M2t and the mark M4t are arranged at the same position in the x-axis direction, and the mark M1t and the mark M2t, and the mark M3t and the mark M4t are arranged at the same position in the y-axis direction. Has been. When the pixel value of the template T1 is 256 gradations, the pixel values of the marks M1t to M4t are 0 (ie, black), and the pixel values of other regions are 255 (ie, white), the x axis of the template T1 The direction projection pattern is represented by a
一方、領域R1には、テンプレートT1のマークM1t乃至M4tと同様のマークM1r乃至M4rが示されている。ただし、領域R1のマークM1r乃至M4rは、テンプレートT1のマークM1t乃至M4tと比較して反時計回りに回転している。その結果、領域R1のx軸方向の投影パターンは、パターン51とは異なるパターン52により表される。すなわち、投影パターン52は、各列のマークM1r乃至M4rに含まれる画素の数に応じて変化し、マークM1r乃至M4rに含まれる画素が最も多く存在する列のx座標において値が最小となり、マークM1r乃至M4rに含まれる画素が存在しない列のx座標において値が最大となる。
On the other hand, in the region R1, marks M1r to M4r similar to the marks M1t to M4t of the template T1 are shown. However, the marks M1r to M4r in the region R1 rotate counterclockwise as compared with the marks M1t to M4t in the template T1. As a result, the projection pattern in the x-axis direction of the region R1 is represented by a
候補点抽出部11は、入力画像の投影パターンとテンプレートの投影パターンのマッチングにより、テンプレートと類似度の高い入力画像の領域を検出し、検出した領域の中心を候補点として抽出する。ここで、図4および図5を参照して、候補点の抽出処理の具体例について説明する。なお、以下、図4に示される入力画像Giの大きさを幅wg×高さhgとし、図示せぬテンプレートの大きさを幅wt×高さhtとする。 The candidate point extraction unit 11 detects a region of the input image having a high similarity to the template by matching the projection pattern of the input image and the projection pattern of the template, and extracts the center of the detected region as a candidate point. Here, a specific example of candidate point extraction processing will be described with reference to FIGS. Hereinafter, the size of the input image Gi shown in FIG. 4 is defined as width wg × height hg, and the size of a template (not illustrated) is defined as width wt × height ht.
まず、候補点抽出部11は、図4に示されるように、幅wg×高さhtの窓W1を入力画像Giの上端にセットし、窓W1内の画像のx軸方向の投影パターンを生成する。次に、候補点抽出部11は、図5に示されるように、テンプレートと同じ大きさの幅wt×高さhtの窓W2を窓W1の左端にセットし、窓W2内の画像のx軸方向の投影パターンとテンプレートのx軸方向の投影パターンのマッチングを行い、窓W2内の画像とテンプレートの類似度を表すマッチングスコアを求める。候補点抽出部11は、窓W2を1画素ずつ右にずらしていきながら窓W2が窓W1の右端に来るまで同様の処理を繰り返し行い、窓W1内の各領域の画像とテンプレートとの間のマッチングスコアを求める。候補点抽出部11は、窓W1内においてマッチングスコアが極大となり、かつ、所定の閾値以上となる領域(すなわち、テンプレートとの類似度が所定の閾値以上となる領域)の中点を候補点として抽出する。従って、窓W1内において、複数の候補点が抽出される場合もあるし、1つも候補点が抽出されない場合もある。 First, as shown in FIG. 4, the candidate point extraction unit 11 sets a window W1 having a width wg × height ht at the upper end of the input image Gi, and generates a projection pattern in the x-axis direction of the image in the window W1. To do. Next, as shown in FIG. 5, the candidate point extraction unit 11 sets a window W2 having a width wt × height ht of the same size as the template at the left end of the window W1, and the x-axis of the image in the window W2 The projection pattern in the direction and the projection pattern in the x-axis direction of the template are matched, and a matching score representing the similarity between the image in the window W2 and the template is obtained. The candidate point extraction unit 11 repeatedly performs the same processing while shifting the window W2 to the right by one pixel until the window W2 comes to the right end of the window W1, and the image between each area image in the window W1 and the template. Find matching score. Candidate point extraction unit 11 uses, as a candidate point, a midpoint in a region where the matching score is maximal in window W1 and is equal to or greater than a predetermined threshold (that is, a region where the similarity to the template is equal to or greater than a predetermined threshold). Extract. Therefore, a plurality of candidate points may be extracted in the window W1, or no candidate points may be extracted.
候補点抽出部11は、窓W1を1画素ずつ下にずらしていきながら窓W1が入力画像Giの下端に来るまで、上述した処理を繰り返し、入力画像全体から候補点を抽出する。候補点抽出部11は、y軸方向についても、y軸方向の投影パターンを用いて同様の処理を行い、候補点を抽出する。そして、候補点抽出部11は、抽出した候補点の座標を示す情報をマッチング対象画像抽出部12に供給する。なお、抽出された候補点の座標は、入力画像の座標系により表される。
The candidate point extraction unit 11 repeats the above-described process until the window W1 comes to the lower end of the input image Gi while shifting the window W1 pixel by pixel, and extracts candidate points from the entire input image. The candidate point extraction unit 11 also performs the same process using the projection pattern in the y-axis direction for the y-axis direction, and extracts candidate points. Then, the candidate point extraction unit 11 supplies information indicating the coordinates of the extracted candidate points to the matching target
なお、投影パターンは画像の回転による値の変動が小さいため、投影パターンを用いたマッチングを行うことにより、画素単位でマッチングを行う場合と比較して、入力画像においてマークが回転していても、マークが存在する領域とテンプレートとの間のマッチングスコアの低下が抑制される。また、投影パターンを用いてマッチングを行う場合、画素単位でマッチングを行う場合と比較して演算量は少なくなる。従って、適切な候補点を迅速に抽出することが可能となる。 In addition, since the variation of the value of the projection pattern due to the rotation of the image is small, by performing the matching using the projection pattern, even if the mark is rotated in the input image as compared with the case of performing the matching on a pixel basis, A decrease in matching score between the region where the mark exists and the template is suppressed. In addition, when matching is performed using a projection pattern, the amount of calculation is smaller than when matching is performed in units of pixels. Therefore, it is possible to quickly extract appropriate candidate points.
なお、投影パターンの値として、ライン毎の画素値の合計値の他に、例えば、ライン毎の画素値の平均値を用いることも可能である。 In addition to the total value of pixel values for each line, for example, an average value of pixel values for each line can be used as the projection pattern value.
図2に戻り、ステップS2において、マッチング対象画像抽出部12は、各候補点を中心とする回転角の異なる複数のマッチング対象画像を抽出する。具体的には、マッチング対象画像抽出部12は、まず、候補点の1つを注目候補点して選択する。そして、マッチング対象画像抽出部12は、注目候補点を中心とするテンプレートより少し大きい(例えば、数ピクセル大きい)矩形の領域であって、各辺が入力画像の各辺と平行な領域(以下、基本抽出領域と称する)内の画像をマッチング対象画像として入力画像から抽出する。
Returning to FIG. 2, in step S <b> 2, the matching target
さらに、マッチング対象画像抽出部12は、アフィン変換を用いて、注目候補点を中心に基本抽出領域を所定の角度だけ回転させた領域内の画像をマッチング対象画像として抽出する処理を、所定の複数の回転角について実行する。例えば、マッチング対象画像抽出部12は、注目候補点を中心とし、注目候補点を通る垂直線に対する角度が±θの範囲内において、Δθの間隔で基本抽出領域を回転させた領域内の画像をマッチング対象画像として抽出する。この場合、1つの候補点につき、2θ÷Δθ+1個のマッチング対象画像が抽出される。
Further, the matching target
マッチング対象画像抽出部12は、全ての候補点について同様の処理を行い、各候補点について、同じ数および回転角のマッチング対象画像を抽出する。マッチング対象画像抽出部12は、抽出したマッチング対象画像、および、各マッチング対象画像の回転角と対応する候補点の座標を示す情報をマッチング部13に供給する。
The matching target
ここで、図6を参照して、マッチング対象画像の抽出処理の具体例について説明する。例えば、正方形のテンプレートT11に示される十字型のマークM11tと同じ入力画像上のマークM11rの中心Ps1が注目候補点として選択されている場合について考える。なお、図6の左側に示されるように、マークM11rは、マークM11tと比較して、反時計回りに回転しているものとする。 Here, a specific example of the matching target image extraction process will be described with reference to FIG. For example, consider a case where the center Ps1 of the mark M11r on the same input image as the cross-shaped mark M11t shown in the square template T11 is selected as the candidate point of interest. As shown on the left side of FIG. 6, it is assumed that the mark M11r rotates counterclockwise as compared with the mark M11t.
マッチング対象画像抽出部12は、最初に、候補点Ps1を中心とする正方形の領域であって、テンプレートT11より少し大きい基本抽出領域R13内の画像をマッチング対象画像として抽出する。そして、マッチング対象画像抽出部12は、基本抽出領域R13を反時計回りにθ1だけ回転させた領域R11、反時計回りにθ2(ただし、θ2<θ1)だけ回転させた領域R12、時計回りにθ2だけ回転させた領域R14、および、時計回りにθ1だけ回転させた領域R15内の画像をマッチング対象画像として抽出する。これにより、候補点Ps1について、図6の右側に示される5つのマッチング対象画像Gm11乃至Gm5が抽出される。
The matching target
なお、テンプレートより大きい領域内の画像をマッチング対象画像として抽出するのは、抽出された候補点の位置が、回転の影響で必ずしもマークの中心と一致するとは限らないためである。 The reason why the image in the region larger than the template is extracted as the matching target image is that the position of the extracted candidate point does not necessarily coincide with the center of the mark due to the influence of rotation.
図2に戻り、ステップS3において、マッチング部13は、各マッチング対象画像とテンプレートの画素単位のマッチングを実行する。具体的には、マッチング部13は、マッチング対象画像の1つを注目マッチング対象画像として選択する。マッチング部13は、注目マッチング対象画像内において、テンプレートとのマッチングを行う領域を上下または左右に1画素ずつずらしながら、テンプレートとの画素単位のマッチングを行う。
Returning to FIG. 2, in step S <b> 3, the matching
ここで、図7を参照して、マッチング対象画像とテンプレートの画素単位のマッチングの処理の具体例について説明する。マッチング部13は、図7に示されるように、テンプレートと同じ大きさの幅wt×高さhtの窓W21をマッチング対象画像Gm21の左上隅に配置し、窓W21内の画像とテンプレートの画素単位のマッチングを行い、窓W21内の画像とテンプレートの類似度を表すマッチングスコアを求める。マッチング部13は、窓W21を1画素ずつ右にずらしていきながら窓W21がマッチング対象画像Gm21の右端に来るまで同様の処理を繰り返し行う。また、マッチング部13は、窓W21がマッチング対象画像Gm21の右端に来たら、窓W21を1画素下にずらすとともに、マッチング対象画像Gm21の左端に戻し、以下、同様の処理を、窓W21がマッチング対象画像Gm21の右下隅に来るまで繰り返し実行する。これにより、マッチング対象画像Gm21の各領域内の画像とテンプレートとの間のマッチングスコアが求められる。
Here, with reference to FIG. 7, a specific example of the matching process of the matching target image and the template in the pixel unit will be described. As shown in FIG. 7, the matching
マッチング部13は、上述した処理を全てのマッチング対象画像について実行する。マッチング部13は、各マッチング対象画像に対するマッチング結果、および、各マッチング対象画像の回転角と対応する候補点の座標を示す情報をマーク検出部14に供給する。
The matching
なお、各マッチング対象画像に対するマッチング結果は、マッチング対象画像の各領域におけるマッチングスコアと各領域の中心の座標の組み合わせを含む。例えば、図7のマッチング対象画像Gm21の窓W21内の領域について考えた場合、窓W21内の領域の内の画像とテンプレートとの間のマッチングスコア、および、窓W21内の領域の中心Rm(図8)の座標の組み合わせが、マッチング結果に含まれる。 The matching result for each matching target image includes a combination of the matching score in each region of the matching target image and the coordinates of the center of each region. For example, when considering the region in the window W21 of the matching target image Gm21 in FIG. 7, the matching score between the image in the region in the window W21 and the template, and the center Rm of the region in the window W21 (FIG. The combination of coordinates in 8) is included in the matching result.
なお、マッチング対象画像の各領域の中心の座標は、マッチング対象画像の座標系により表される。例えば、図8に示されるように、窓W21内の領域の中心Rmの座標(Xr,Yr)は、候補点Ps21を原点とし、マッチング対象画像Gm21の水平方向をx'軸とし、垂直方向をy'軸とする座標系により表される。 Note that the coordinates of the center of each region of the matching target image are represented by the coordinate system of the matching target image. For example, as shown in FIG. 8, the coordinates (Xr, Yr) of the center Rm of the region in the window W21 have the candidate point Ps21 as the origin, the horizontal direction of the matching target image Gm21 as the x ′ axis, and the vertical direction It is represented by a coordinate system with y ′ axis.
図2に戻り、ステップS4において、マーク検出部14は、画素単位のマッチングの結果に基づいて、入力画像のマークの位置および回転角を検出する。具体的には、マーク検出部14は、候補点の1つを注目候補点に選択し、注目候補点について、マッチングスコアが最大となる領域を含むマッチング対象画像、および、マッチングスコアの最大値を求める。マーク検出部14は、全ての候補点について同様の処理を行い、マッチングスコアが最大となる領域を含むマッチング対象画像、および、マッチングスコアの最大値の組み合わせを、各候補点につき1つずつ求める。
Returning to FIG. 2, in step S <b> 4, the
さらに、マーク検出部14は、候補点ごとに求めたマッチングスコアの最大値を比較し、マッチングスコアの最大値が最大となる領域を含むマッチング対象画像(以下、マーク検出画像と称する)を求める。マーク検出部14は、マーク検出画像の回転角を入力画像におけるマークの回転角とし、マーク検出画像においてマッチングスコアが最大となる領域の中心を入力画像におけるマークの位置として検出する。マーク検出部14は、マーク検出画像の中心(すなわち、候補点)の座標、並びに、入力画像におけるマークの回転角およびマークの位置の座標を示す情報を座標変換部15に供給する。なお、マーク検出画像の中心の座標は入力画像の座標系により表され、マークの位置の座標はマーク検出画像の座標系により表される。
Further, the
ステップS5において、座標変換部15は、マークの位置の座標を入力画像の座標系に変換する。ここで、図9を参照して、この座標変換の処理の詳細について説明する。なお、図9において、点Pmは、検出された入力画像のマークの位置を表し、候補点Ps31は、マークの位置Pmが検出されたマーク検出画像の中心を表している。また、マーク検出画像の回転角を−θm(反時計回りの方向にθm)とする。さらに、候補点Ps31を中心とするx'軸およびy'軸により表される座標系を、マーク検出画像の座標系とする。また、マーク検出画像の座標系におけるマークの位置Pmの座標を(Xm',Ym')とする。
In step S5, the coordinate
マーク検出画像の座標系を、候補点Ps31を中心に時計回りにθmだけ回転させたx''軸およびy''軸により表される座標系(以下、回転座標系と称する)におけるマークの位置Pmの座標(Xm'',Ym'')は、以下の式(1)および式(2)により求められる。なお、x''軸は入力画像の座標系のx軸と平行になり、y''軸は入力画像のy軸と平行になる。 Mark position in a coordinate system (hereinafter referred to as a rotational coordinate system) represented by an x ″ axis and a y ″ axis obtained by rotating the coordinate system of the mark detection image clockwise by θm around the candidate point Ps31 The coordinates (Xm ″, Ym ″) of Pm are obtained by the following equations (1) and (2). Note that the x ″ axis is parallel to the x axis of the coordinate system of the input image, and the y ″ axis is parallel to the y axis of the input image.
Xm''=Xm'×cosθm−Ym'×sinθm ・・・(1)
Ym''=Xm'×sinθm+Ym'×sinθm ・・・(2)
Xm ″ = Xm ′ × cos θm−Ym ′ × sin θm (1)
Ym ″ = Xm ′ × sin θm + Ym ′ × sin θm (2)
入力画像の座標系における候補点Ps31の座標を(Xs,Ys)とすると、入力画像の座標系におけるマークの位置Pmの座標(Xm,Ym)は、以下の式(3)および式(4)により求められる。 If the coordinates of the candidate point Ps31 in the coordinate system of the input image are (Xs, Ys), the coordinates (Xm, Ym) of the mark position Pm in the coordinate system of the input image are expressed by the following equations (3) and (4). Is required.
Xm=Xs+Xm'' ・・・(3)
Ym=Ys−Ym'' ・・・(4)
Xm = Xs + Xm '' (3)
Ym = Ys−Ym ″ (4)
座標変換部15は、以上のようにして求めた入力画像の座標系におけるマークの位置の座標、および、入力画像におけるマークの回転角を示す情報を後段の装置に出力する。その後、画像処理は終了する。
The coordinate
このようにして、画素単位のマッチングを行う領域を削減できるとともに、各候補点ごとに、回転角が異なるマッチング対象画像を抽出し、テンプレートとのマッチングを行うので、入力画像におけるマークの位置および回転角を迅速かつ正確に検出することができる。また、複数のテンプレートを準備する必要がないため、テンプレートに必要なメモリの容量を削減することができる。 In this way, the area for pixel-by-pixel matching can be reduced, and a matching target image with a different rotation angle is extracted for each candidate point, and matching with the template is performed. Corners can be detected quickly and accurately. In addition, since it is not necessary to prepare a plurality of templates, the memory capacity required for the templates can be reduced.
上述した一連の処理は、ハードウエアにより実行することもできるし、ソフトウエアにより実行することもできる。一連の処理をソフトウエアにより実行する場合には、そのソフトウエアを構成するプログラムが、専用のハードウエアに組み込まれているコンピュータ、または、各種のプログラムをインストールすることで、各種の機能を実行することが可能な、例えば汎用のコンピュータなどに、プログラム記録媒体からインストールされる。 The series of processes described above can be executed by hardware or can be executed by software. When a series of processing is executed by software, a program constituting the software executes various functions by installing a computer incorporated in dedicated hardware or various programs. For example, the program is installed in a general-purpose computer from a program recording medium.
図10は、上述した一連の処理をプログラムにより実行するコンピュータのハードウエアの構成例を示すブロック図である。 FIG. 10 is a block diagram illustrating an example of a hardware configuration of a computer that executes the above-described series of processing by a program.
コンピュータにおいて、CPU(Central Processing Unit)201,ROM(Read Only Memory)202,RAM(Random Access Memory)203は、バス204により相互に接続されている。
In a computer, a central processing unit (CPU) 201, a read only memory (ROM) 202, and a random access memory (RAM) 203 are connected to each other by a
バス204には、さらに、入出力インタフェース205が接続されている。入出力インタフェース205には、キーボード、マウス、マイクロホンなどよりなる入力部206、ディスプレイ、スピーカなどよりなる出力部207、ハードディスクや不揮発性のメモリなどよりなる記憶部208、ネットワークインタフェースなどよりなる通信部209、磁気ディスク、光ディスク、光磁気ディスク、或いは半導体メモリなどのリムーバブルメディア211を駆動するドライブ210が接続されている。
An input /
以上のように構成されるコンピュータでは、CPU201が、例えば、記憶部208に記憶されているプログラムを、入出力インタフェース205及びバス204を介して、RAM203にロードして実行することにより、上述した一連の処理が行われる。
In the computer configured as described above, the
コンピュータ(CPU201)が実行するプログラムは、例えば、磁気ディスク(フレキシブルディスクを含む)、光ディスク(CD-ROM(Compact Disc-Read Only Memory),DVD(DiGital Versatile Disc)等)、光磁気ディスク、もしくは半導体メモリなどよりなるパッケージメディアであるリムーバブルメディア211に記録して、あるいは、ローカルエリアネットワーク、インターネット、デジタル衛星放送といった、有線または無線の伝送媒体を介して提供される。
The program executed by the computer (CPU 201) is, for example, a magnetic disk (including a flexible disk), an optical disk (CD-ROM (Compact Disc-Read Only Memory), DVD (DiGittal Versatile Disc), etc.), a magneto-optical disk, or a semiconductor. The program is recorded on a
そして、プログラムは、リムーバブルメディア211をドライブ210に装着することにより、入出力インタフェース205を介して、記憶部208にインストールすることができる。また、プログラムは、有線または無線の伝送媒体を介して、通信部209で受信し、記憶部208にインストールすることができる。その他、プログラムは、ROM202や記憶部208に、あらかじめインストールしておくことができる。
The program can be installed in the
なお、コンピュータが実行するプログラムは、本明細書で説明する順序に沿って時系列に処理が行われるプログラムであっても良いし、並列に、あるいは呼び出しが行われたとき等の必要なタイミングで処理が行われるプログラムであっても良い。 The program executed by the computer may be a program that is processed in time series in the order described in this specification, or in parallel or at a necessary timing such as when a call is made. It may be a program for processing.
また、本発明の実施の形態は、上述した実施の形態に限定されるものではなく、本発明の要旨を逸脱しない範囲において種々の変更が可能である。 The embodiments of the present invention are not limited to the above-described embodiments, and various modifications can be made without departing from the scope of the present invention.
1 画像処理装置, 11 候補点抽出部, 12 マッチング対象画像抽出部, 13 マッチング部, 14 マーク検出部, 15 座標変換部
DESCRIPTION OF
Claims (4)
前記入力画像の所定エリア内の画素の信号パターンと前記テンプレートの信号パターンとのマッチングにより前記テンプレートと類似度の高い前記入力画像の領域を検出し、検出した領域の中心を候補点として抽出する候補点抽出ステップと、
前記候補点のそれぞれについて、前記候補点を中心とする所定の形状の領域であって、前記候補点を中心として回転させた回転角の異なる複数の領域の画像をマッチング対象画像として抽出するマッチング対象画像抽出ステップと、
抽出された前記マッチング対象画像と前記テンプレートのマッチングを行い、前記マッチング対象画像と前記テンプレートの類似度を表すマッチングスコアを求めるマッチングステップと、
前記マッチングスコアが最大となる前記マッチング対象画像の位置を前記入力画像における前記マークの位置として検出するマーク検出ステップと
を含む画像処理方法。 In an image processing method of an image processing apparatus for detecting a position of a mark that matches a mark indicated on a template in an input image,
A candidate for detecting a region of the input image having a high similarity to the template by matching a signal pattern of a pixel in a predetermined area of the input image and a signal pattern of the template, and extracting a center of the detected region as a candidate point A point extraction step;
For each of the candidate points, a matching target for extracting, as matching target images, images of a plurality of regions having a predetermined shape centered on the candidate point and having different rotation angles rotated about the candidate point An image extraction step;
A matching step of performing matching between the extracted matching target image and the template and obtaining a matching score representing a similarity between the matching target image and the template;
An image processing method, comprising: a mark detection step of detecting a position of the matching target image having the maximum matching score as a position of the mark in the input image.
請求項1に記載の画像処理方法。 In the candidate point extraction step, a projection pattern indicating a distribution of pixel values in units of lines is used as a signal pattern of pixels in a predetermined area of the input image, and a distribution of pixel values in units of lines of the template is used as the signal pattern of the template. The image processing method according to claim 1, wherein a projection pattern is used.
請求項1に記載の画像処理方法。 The image processing method according to claim 1, wherein in the mark detection step, a rotation angle of the matching target image that maximizes the matching score is detected as a rotation angle of the mark in the input image.
前記入力画像の所定エリア内の画素の信号パターンと前記テンプレートの信号パターンとのマッチングにより前記テンプレートと類似度の高い前記入力画像の領域を検出し、検出した領域の中心を候補点として抽出する候補点抽出ステップと、
前記候補点のそれぞれについて、前記候補点を中心とする所定の形状の領域であって、前記候補点を中心として回転させた回転角の異なる複数の領域の画像をマッチング対象画像として抽出するマッチング対象画像抽出ステップと、
抽出された前記マッチング対象画像と前記テンプレートのマッチングを行い、前記マッチング対象画像と前記テンプレートの類似度を表すマッチングスコアを求めるマッチングステップと、
前記マッチングスコアが最大となる前記マッチング対象画像の位置を前記入力画像における前記マークの位置として検出するマーク検出ステップと
を含む処理をコンピュータに実行させるプログラム。 In a program for causing a computer to execute processing for detecting a position of a mark that matches a mark indicated on a template in an input image,
A candidate for detecting a region of the input image having a high similarity to the template by matching a signal pattern of a pixel in a predetermined area of the input image and a signal pattern of the template, and extracting a center of the detected region as a candidate point A point extraction step;
For each of the candidate points, a matching target for extracting, as matching target images, images of a plurality of regions that have a predetermined shape centered on the candidate point and are rotated about the candidate point and having different rotation angles An image extraction step;
A matching step of performing matching between the extracted matching target image and the template and obtaining a matching score representing a similarity between the matching target image and the template;
A program that causes a computer to execute a process including a mark detection step of detecting a position of the matching target image that maximizes the matching score as a position of the mark in the input image.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008097796A JP2009250739A (en) | 2008-04-04 | 2008-04-04 | Method for processing image and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008097796A JP2009250739A (en) | 2008-04-04 | 2008-04-04 | Method for processing image and program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2009250739A true JP2009250739A (en) | 2009-10-29 |
Family
ID=41311619
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008097796A Withdrawn JP2009250739A (en) | 2008-04-04 | 2008-04-04 | Method for processing image and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2009250739A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2011221747A (en) * | 2010-04-08 | 2011-11-04 | National Institute Of Advanced Industrial & Technology | Cross mark detection device, method, and program |
JP2013004014A (en) * | 2011-06-21 | 2013-01-07 | Konica Minolta Holdings Inc | Image processing apparatus, its program, and image processing method |
JP2014164528A (en) * | 2013-02-25 | 2014-09-08 | Mitsubishi Heavy Ind Ltd | Character recognition device, character recognition method, and program |
-
2008
- 2008-04-04 JP JP2008097796A patent/JP2009250739A/en not_active Withdrawn
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2011221747A (en) * | 2010-04-08 | 2011-11-04 | National Institute Of Advanced Industrial & Technology | Cross mark detection device, method, and program |
JP2013004014A (en) * | 2011-06-21 | 2013-01-07 | Konica Minolta Holdings Inc | Image processing apparatus, its program, and image processing method |
JP2014164528A (en) * | 2013-02-25 | 2014-09-08 | Mitsubishi Heavy Ind Ltd | Character recognition device, character recognition method, and program |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108491870B (en) | Electronic device, physical seal recognition method, and computer-readable storage medium | |
US9721387B2 (en) | Systems and methods for implementing augmented reality | |
JP4738469B2 (en) | Image processing apparatus, image processing program, and image processing method | |
JP2015173430A (en) | Projection system, semiconductor integrated circuit and image correction method | |
US20150090793A1 (en) | Method and system for determining edge line in qr code binary image | |
JP7046006B2 (en) | Authentication method and device and method and device for generating authentication information | |
US10810743B2 (en) | Image processing device, image processing method, and computer program product | |
TW201320231A (en) | Method and system for positioning round holes of motherboard | |
JP6530432B2 (en) | Image processing apparatus, image processing method and program | |
JP2009250739A (en) | Method for processing image and program | |
JP2007151082A (en) | Processing method, apparatus, program and computer- readable recording medium about estimation of grid orientation, magnification, parallel displacement and modulation | |
JP2009110070A (en) | Image processor, image processing method, and computer program | |
JP4565396B2 (en) | Image processing apparatus and image processing program | |
JP4041060B2 (en) | Image processing apparatus and image processing method | |
JP6261118B2 (en) | Two-dimensional code reading method and recording medium for the two-dimensional code | |
JP2013254242A (en) | Image recognition device, image recognition method, and image recognition program | |
JP2010231541A (en) | Information processor, character recognition method and program | |
JP5993100B2 (en) | Image processing apparatus and specific figure detection method | |
CN114495105A (en) | Image tilt correction method, device, storage medium and computer equipment | |
WO2021174506A1 (en) | Image edge detection method and apparatus, and image signal processor | |
JP2008269121A (en) | Electronic equipment, two-dimensional code recognition method, program and two-dimensional code | |
JP5003379B2 (en) | Image processing apparatus and program | |
JP7478628B2 (en) | Image processing device, control method, and control program | |
US9384415B2 (en) | Image processing apparatus and method, and computer program product | |
JP2010038881A (en) | Image processing apparatus, image processing method, and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A300 | Withdrawal of application because of no request for examination |
Free format text: JAPANESE INTERMEDIATE CODE: A300 Effective date: 20110607 |