JP2009157701A - Method and unit for image processing - Google Patents

Method and unit for image processing Download PDF

Info

Publication number
JP2009157701A
JP2009157701A JP2007335894A JP2007335894A JP2009157701A JP 2009157701 A JP2009157701 A JP 2009157701A JP 2007335894 A JP2007335894 A JP 2007335894A JP 2007335894 A JP2007335894 A JP 2007335894A JP 2009157701 A JP2009157701 A JP 2009157701A
Authority
JP
Japan
Prior art keywords
interest
sparse
image
region
image processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2007335894A
Other languages
Japanese (ja)
Inventor
Hiromi Noda
陽 野田
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.)
Shimadzu Corp
Original Assignee
Shimadzu 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 Shimadzu Corp filed Critical Shimadzu Corp
Priority to JP2007335894A priority Critical patent/JP2009157701A/en
Publication of JP2009157701A publication Critical patent/JP2009157701A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

<P>PROBLEM TO BE SOLVED: To perform accurate and high-speed positioning between a reference image and an inspection target image in template matching. <P>SOLUTION: In regard to a reference image R, an edge, which is a boundary of contrast, is extracted, and an initial ROI (Region Of Interest) having a predetermined ROI width centering the above edge is set. Then, sparse points uniformly distributed with a predetermined dot density among the initial ROI are set, and each sparse point is made to be a sparse ROI. By moving an inspection target image P in each of x axis direction, y axis direction and θ rotation direction, the degree of coincidence relative to the reference image R and the inspection target image P is calculated using a pixel value at the sparse point position, so that a positioning parameter (x, y, θ) producing the maximum degree of coincidence is obtained. Because the edge appears particularly in an industrial product, even when the sparse point is limited to the vicinity of the edge, sufficient positioning accuracy can be secured, and a high speed is obtainable because of a small data amount to obtain the degree of coincidence. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、物体(人物)探索、欠陥検出、認証など各種用途に利用される画像認識や画像識別のための画像処理方法及び画像処理装置に関し、さらに詳しくは、2つの画像のパターンマッチングを実施する画像処理方法及び画像処理装置に関する。   The present invention relates to an image processing method and image processing apparatus for image recognition and image identification used for various purposes such as object (person) search, defect detection, and authentication, and more specifically, pattern matching between two images is performed. The present invention relates to an image processing method and an image processing apparatus.

工場で製造された製品等の不良や欠陥を外観上検査する欠陥検査装置では、検査対象品を実際に撮影して得られた検査対象画像と基準となる基準画像とを比較し、その一致度を評価するという処理が行われる。こうした処理に際して、検査対象画像と基準画像との一致度を調べるには、まず両画像の位置合わせを行う必要がある。   In defect inspection equipment that visually inspects defects and defects of products manufactured at the factory, the inspection target image obtained by actually photographing the inspection target product is compared with the reference image, and the degree of coincidence The process of evaluating is performed. In such processing, in order to check the degree of coincidence between the inspection target image and the reference image, it is necessary to first align the images.

2枚の画像の位置合わせの一般的な手法としては、テンプレートマッチングと呼ばれる方法が知られている。従来の一般的なテンプレートマッチングでは、基準画像の位置を少しずつずらしながら、その全体又はその中の特定の領域と検査対象画像中の対象領域との比較を行い、両者が最も一致するとみなせる位置を見い出すようにする。しかしながら、従来の一般的なテンプレートマッチングの手法では、画像サイズが大きくなるとその計算量が膨大になり、結果が出るまでに時間が掛かるという問題がある。また、ノイズの影響を受けて、位置合わせの際に位置ずれを起こし易いという問題もある。   As a general technique for aligning two images, a method called template matching is known. In conventional general template matching, the position of the reference image is shifted little by little, and the whole or a specific area in it is compared with the target area in the image to be inspected, and the position where both are considered to be the best match is determined. Try to find it. However, the conventional general template matching technique has a problem that the calculation amount becomes enormous as the image size increases, and it takes time until the result is obtained. In addition, there is a problem that the position is likely to be displaced during the alignment due to the influence of noise.

これに対し、画像の中に適当なサイズの関心領域(ROI=Region Of Interest)を設定し、このROIについてのみ両画像の比較を行うという手法が従来より知られている(特許文献1、2など参照)。こうした手法によれば、計算量が従来よりも少なくて済むので、結果が出るまでの時間を短縮することができる。また、位置合わせに有意な領域にROIを絞ることで、ノイズの影響を減らすことができる。   On the other hand, a technique of setting a region of interest (ROI = Region Of Interest) of an appropriate size in an image and comparing both images only for this ROI has been known (Patent Documents 1 and 2). Etc.) According to such a method, since the calculation amount is smaller than that of the conventional method, the time until the result is obtained can be shortened. Further, the influence of noise can be reduced by narrowing the ROI to a region significant for alignment.

しかしながら、例えば工場の製造ラインなどにおいてインライン欠陥検査を行う場合には、上記のような画像処理に時間が掛かるとこの検査がラインの速度を制限することになるため、より一層の高速化が要求される。上記のような従来技術では、ROIの範囲(面積)を単純に狭めることで計算対象のデータ量が減るから、或る程度の高速化が可能である。ところが、ROIを単に狭くすると、位置合わせの精度や再現性が低下するという問題がある。   However, for example, when in-line defect inspection is performed in a factory production line or the like, if the image processing takes time as described above, this inspection will limit the speed of the line. Is done. In the conventional technology as described above, since the amount of data to be calculated is reduced by simply narrowing the ROI range (area), it is possible to increase the speed to some extent. However, when the ROI is simply narrowed, there is a problem in that the accuracy and reproducibility of the alignment deteriorate.

一方、特許文献3には、スパース相関と呼ばれる手法が開示されている。これは、スパース、つまりは疎らに分散する点(スパースROI)を設定し、そのスパースROIについてのみ両画像の比較を行うようにしている。こうしたスパース相関では、画像中に存在する着目すべきオブジェクトの位置を適切に評価できるようにするためにスパースROIの選び方が重要であり、特許文献3では、自動学習によりスパースROIが設定されるようになっている。しかしながら、こうした手法では、スパースROIの設定のための計算量が多くなり、上述のように高速で画像処理を行いたいという要求には反することになる。   On the other hand, Patent Literature 3 discloses a technique called sparse correlation. This is to set a sparse, that is, a sparsely distributed point (sparse ROI), and to compare both images only for the sparse ROI. In such sparse correlation, it is important to select a sparse ROI so that the position of an object of interest existing in an image can be appropriately evaluated. In Patent Document 3, a sparse ROI is set by automatic learning. It has become. However, with such a method, the amount of calculation for setting the sparse ROI increases, which is contrary to the demand for image processing at high speed as described above.

特開平11-3425号公報Japanese Patent Laid-Open No. 11-3425 特開2002-319022号公報JP 2002-319022 A 特表2002-516440号公報Special table 2002-516440 gazette

本発明は上記課題を解決するために成されたものであり、その目的とするところは、高い位置合わせの精度や再現性を確保しながら、パターンマッチングに際しての計算量を減らして高速化を図ることができる画像処理方法及び画像処理装置を提供することにある。   The present invention has been made to solve the above-described problems, and the object of the present invention is to increase the speed by reducing the amount of calculation for pattern matching while ensuring high alignment accuracy and reproducibility. Another object of the present invention is to provide an image processing method and an image processing apparatus.

上記課題を解決するために成された本発明に係る画像処理方法は、検査対象物について得られる検査対象画像と基準となる基準画像とのパターンマッチングを行う画像処理方法であって、
a)前記基準画像の中でエッジを抽出するエッジ抽出ステップと、
b)抽出された前記エッジに対して所定幅の初期関心領域を設定する初期関心領域設定ステップと、
c)前記初期関心領域内に所定の密度で以て分散した点をスパース関心領域として設定するスパース関心領域設定ステップと、
d)前記スパース関心領域に対応した複数の画素位置についての前記基準画像における画素値と前記検査対象画像における画素値とを用いて両画像の一致性を判定し、それに基づいて両画像間の位置ずれ量を評価する位置ずれ評価ステップと、
を有することを特徴としている。
An image processing method according to the present invention made to solve the above problems is an image processing method for performing pattern matching between an inspection object image obtained for an inspection object and a reference image as a reference,
a) an edge extraction step of extracting an edge in the reference image;
b) an initial region of interest setting step for setting an initial region of interest having a predetermined width for the extracted edge;
c) a sparse region-of-interest setting step of setting points dispersed with a predetermined density in the initial region of interest as a sparse region of interest;
d) using the pixel values in the reference image and the pixel values in the inspection target image for a plurality of pixel positions corresponding to the sparse region of interest to determine the coincidence of both images, and based on that, the position between the images A positional deviation evaluation step for evaluating the deviation amount;
It is characterized by having.

また、本発明に係る画像処理装置は本発明に係る画像処理方法を実施するための装置であり、検査対象物について得られる検査対象画像と基準となる基準画像とのパターンマッチングを行う画像処理装置であって、
a)前記基準画像の中でエッジを抽出するエッジ抽出手段と、
b)抽出された前記エッジに対して所定幅の初期関心領域を設定する初期関心領域設定手段と、
c)前記初期関心領域内に所定の密度で以て分散した点をスパース関心領域として設定するスパース関心領域設定手段と、
d)前記スパース関心領域に対応した複数の画素位置についての前記基準画像における画素値と前記検査対象画像における画素値とを用いて両画像の一致性を判定し、それに基づいて両画像間の位置ずれ量を評価する位置ずれ評価手段と、
を備えることを特徴としている。
The image processing apparatus according to the present invention is an apparatus for carrying out the image processing method according to the present invention, and performs image pattern matching between an inspection target image obtained for an inspection target and a reference image as a reference. Because
a) edge extraction means for extracting an edge in the reference image;
b) initial region of interest setting means for setting an initial region of interest having a predetermined width for the extracted edge;
c) Sparse region-of-interest setting means for setting, as sparse regions of interest, points dispersed at a predetermined density in the initial region of interest;
d) using the pixel values in the reference image and the pixel values in the inspection target image for a plurality of pixel positions corresponding to the sparse region of interest to determine the coincidence of both images, and based on that, the position between the images A positional deviation evaluation means for evaluating the deviation amount;
It is characterized by having.

特定の物体、例えば工場で製造される工業用部品などの製品は画像上での濃淡の境目が比較的明瞭であるため、高い精度でエッジを抽出することができる。そこで、本発明に係る画像処理方法では、まず基準画像に対してエッジ抽出を実行する。次に、抽出されたエッジを中心にして所定幅の初期関心領域を設定する。この初期関心領域は、エッジが所定幅を持つように拡幅されたものとみることもできる。その後、この初期関心領域内に所定の密度で例えば一様に分散する点を設定し、この各点をスパース関心領域とする。即ち、スパース関心領域を、基準画像の全体ではなく、その基準画像から抽出されるエッジの近傍にのみ限定して設ける。   Since a specific object, for example, a product such as an industrial part manufactured in a factory, has a comparatively clear shading boundary on an image, an edge can be extracted with high accuracy. Therefore, in the image processing method according to the present invention, edge extraction is first performed on the reference image. Next, an initial region of interest having a predetermined width is set around the extracted edge. This initial region of interest can be regarded as having been widened so that the edges have a predetermined width. Thereafter, for example, points that are uniformly distributed at a predetermined density are set in the initial region of interest, and each point is set as a sparse region of interest. That is, the sparse region of interest is limited to the vicinity of the edge extracted from the reference image, not the entire reference image.

基準画像から抽出されるエッジを挟んで設定される初期関心領域の面積は、画像全体の面積から比べれば格段に小さく、その初期関心領域内に疎らに設定されるスパース関心領域のトータルの面積はさらに小さい。したがって、基準画像と検査対象画像との位置ずれの評価のための演算に供されるデータ量は画像全体のデータ量に比べて遙かに少なくて済み、両画像の一致性をみるための計算量は従来よりも格段に少なくなる。それによって、パターンマッチングのために必要な時間を短縮することができる。   The area of the initial region of interest set across the edges extracted from the reference image is much smaller than the area of the entire image, and the total area of the sparse region of interest set sparsely in the initial region of interest is Even smaller. Therefore, the amount of data used for the calculation for evaluating the misalignment between the reference image and the image to be inspected is much smaller than the data amount of the entire image, and a calculation for checking the coincidence of both images. The amount is much smaller than before. Thereby, the time required for pattern matching can be shortened.

また、従来技術のように、単純に関心領域の面積を狭めたものとは異なり、スパース関心領域は或る程度広く設定された初期関心領域の中で広がって分布している。そのため、始めに低い精度で粗く位置合わせを行い、その後、位置合わせの可動範囲を絞りながら段階的に精度を上げてゆく、いわゆる粗密探索との組み合わせが容易である。一般的にこうした粗密探索は当初から高精度の密の探索を行うよりも平均的に探索に要する時間が短くて済むことが知られており、この粗密探索と上述したスパース関心領域の設定との組み合わせにより、一層の高速化を図ることができる。   Further, unlike the conventional technique in which the area of the region of interest is simply narrowed, the sparse region of interest is spread and distributed in the initial region of interest set to a certain extent. Therefore, it is easy to combine with so-called coarse / fine search, in which coarse alignment is first performed with low accuracy, and then the accuracy is gradually increased while narrowing the movable range of alignment. In general, it is known that such a coarse / fine search requires less time on average than the high-precision dense search from the beginning, and this coarse / fine search and the above-described setting of the sparse region of interest. Further speeding up can be achieved by the combination.

こうしたことから、本発明に係る画像処理方法では、好ましくは、前記初期関心領域設定ステップにおける所定幅を段階的に狭める、及び/又は、前記スパース関心領域設定ステップにおける所定の密度を段階的に高めながら、前記初期関心領域設定ステップ、前記スパース関心領域設定ステップ、及び前記位置ずれ評価ステップの処理を複数回繰り返すことにより、位置ずれ量の評価精度を高めるようとよい。   Therefore, in the image processing method according to the present invention, preferably, the predetermined width in the initial region-of-interest setting step is gradually reduced and / or the predetermined density in the sparse region-of-interest setting step is increased stepwise. However, it is preferable to improve the evaluation accuracy of the positional deviation amount by repeating the processes of the initial region of interest setting step, the sparse region of interest setting step, and the positional deviation evaluation step a plurality of times.

基準画像と検査対象画像との位置ずれ量の算出、換言すれば両画像の位置合わせの精度は、その検査目的や検査対象物自体の機械的精度などによって様々である。つまり、高い位置合わせ精度が要求される場合もあれば低い位置合わせ精度でよい場合もある。そこで、本発明に係る画像処理方法では、要求される精度に応じて前記初期関心領域設定ステップにおける所定幅、及び/又は、前記スパース関心領域設定ステップにおける所定の密度を決めるようにすることが好ましい。   The calculation of the amount of misalignment between the reference image and the inspection object image, in other words, the accuracy of the alignment of both images varies depending on the inspection purpose, the mechanical accuracy of the inspection object itself, and the like. In other words, high alignment accuracy may be required, and low alignment accuracy may be sufficient. Therefore, in the image processing method according to the present invention, it is preferable to determine a predetermined width in the initial region of interest setting step and / or a predetermined density in the sparse region of interest setting step according to required accuracy. .

これにより、位置合わせ精度が低くてもよい場合にはそれだけ処理を高速で行うことができる。また、高い位置合わせ精度が要求される場合には、速度をできるだけ落とさずに必要な精度を確実に確保することができる。   Thereby, when the alignment accuracy may be low, the processing can be performed at a higher speed. In addition, when high alignment accuracy is required, the necessary accuracy can be reliably ensured without reducing the speed as much as possible.

まず本発明に係る画像処理方法におけるテンプレートマッチングの原理について、図1を用いて説明する。   First, the principle of template matching in the image processing method according to the present invention will be described with reference to FIG.

ここでは、検査対象画像Pは、CCDカメラなどの撮像装置で検査対象物を撮影して得られる図1(e)に示すような濃淡画像であるとする。一方、基準画像Rは、図1(a)に示すように、検査対象物の基準物の濃淡画像である。説明を簡単にするために、両画像P、R内で検査対象物のサイズは同一である、つまり拡大や縮小、或いは変形はないものとし、x軸方向の直線的移動、y軸方向の直線的移動、及びθ角度軸方向の回転移動のみ、つまり位置の相違のみがあるものとする。   Here, it is assumed that the inspection target image P is a grayscale image as shown in FIG. 1E obtained by photographing the inspection target with an imaging device such as a CCD camera. On the other hand, the reference image R is a grayscale image of the reference object of the inspection object, as shown in FIG. In order to simplify the description, it is assumed that the size of the inspection object is the same in both images P and R, that is, there is no enlargement, reduction, or deformation, linear movement in the x-axis direction, straight line in the y-axis direction. It is assumed that there is only a target movement and a rotational movement in the θ angle axis direction, that is, only a position difference.

次のような手順で、基準画像Rと検査対象画像Pとの位置のずれ量である位置合わせパラメータ(x,y,θ)を求める。
まず基準画像Rについて、画像上の濃淡の境界線をエッジとして抽出する。エッジの抽出手法は周知の各種方法を利用することができる。図1(b)が基準画像Rに対するエッジ抽出画像である。一般的に、農産物や水産物のような自然界で得られる物体とは異なり、工業製品では濃淡の境目が明瞭であるため、エッジの抽出が容易であるとともに抽出されたエッジの信頼性が高い。
An alignment parameter (x, y, θ), which is a displacement amount between the reference image R and the inspection target image P, is obtained by the following procedure.
First, with respect to the reference image R, a light and dark boundary line on the image is extracted as an edge. Various known methods can be used as an edge extraction method. FIG. 1B is an edge extraction image with respect to the reference image R. In general, unlike objects obtained in the natural world such as agricultural products and fishery products, industrial products have clear boundaries between light and shade, so that the extraction of edges is easy and the reliability of the extracted edges is high.

次いで、抽出されたエッジの線を中心として所定のROI幅だけ領域を拡幅した初期関心領域(初期ROI)を設定する。この初期ROIは、図1(c)に示すように、エッジの線幅を広げたものに相当する。その後、設定された初期ROIの中で、所定の密度でほぼ一様に分散したスパース点を設定する。図1(d)に示すように、スパース点の集合により上記初期ROIが形成される。この各スパース点がそれぞれスパースROIであり、1つのスパース点は画像上の1画素に対応する。ここで特徴的であるのは、スパースROIが画像全体に広く設定されるのではなく、検査対象物のエッジ近傍にのみ設定されることである。こうした設定は上述のようにエッジ抽出の信頼性が高いために可能となっている。   Next, an initial region of interest (initial ROI) in which the region is widened by a predetermined ROI width around the extracted edge line is set. As shown in FIG. 1C, this initial ROI is equivalent to the one in which the line width of the edge is increased. Thereafter, sparse points that are distributed almost uniformly at a predetermined density are set in the set initial ROI. As shown in FIG. 1D, the initial ROI is formed by a set of sparse points. Each sparse point is a sparse ROI, and one sparse point corresponds to one pixel on the image. What is characteristic here is that the sparse ROI is not set widely in the entire image, but only in the vicinity of the edge of the inspection object. Such setting is possible because of the high reliability of edge extraction as described above.

スパースROIが決まったならば、基準画像R上の各スパース点に対応する画素値と検査対象画像Pの同位置の画素値とを用いて、両画像R、Pの一致度を計算するわけであるが、検査対象画像Pを、x軸方向、y軸方向、θ角度軸方向へそれぞれ所定画素ステップずつ移動させ、その移動毎に上記一致度を計算する。この一致度の計算には相関や差分などを用いることができる。そして、両画像R、Pの一致度が最も高くなる、移動量x、y、θを、位置合わせパラメータとして求める。このようにして、両画像R、Pを比較するための位置ずれが求まるから、そうして位置ずれを補正した状態で求まる一致度などから、検査対象物と基準物との相違、具体的には検査対象物の外観的欠陥や不良の有無を判断することができる。   When the sparse ROI is determined, the degree of coincidence between the images R and P is calculated using the pixel value corresponding to each sparse point on the reference image R and the pixel value at the same position of the inspection target image P. However, the inspection target image P is moved by predetermined pixel steps in the x-axis direction, the y-axis direction, and the θ-angle axis direction, and the degree of coincidence is calculated for each movement. For the calculation of the degree of coincidence, correlation, difference, or the like can be used. Then, the movement amounts x, y, and θ at which the degree of coincidence between the images R and P is the highest are obtained as alignment parameters. In this way, the positional deviation for comparing the images R and P is obtained, and therefore, the difference between the inspection object and the reference object, specifically, from the degree of coincidence obtained in the state where the positional deviation is corrected, Can determine the presence or absence of appearance defects or defects of the inspection object.

図5は基準画像Rに対する初期ROI、スパースROIの設定を実際に行った例である。図5(a)に示すように濃淡の境目が比較的明瞭である場合には、図5(b)に示すように良好に抽出されたエッジに対し適切に初期ROIが設定され、さらに図5(c)スパースROIも適切に設定されていることが分かる。   FIG. 5 shows an example in which the initial ROI and sparse ROI for the reference image R are actually set. When the shading boundary is relatively clear as shown in FIG. 5A, an initial ROI is appropriately set for a well-extracted edge as shown in FIG. (C) It can be seen that the sparse ROI is also set appropriately.

以上が本発明に係る画像処理方法におけるテンプレートマッチングの手順である。ここで、重要なのは、ROI幅とスパース点の密度である。図2はスパースROIの設定方法の説明図である。図2に示すように、ROI幅で決まる範囲にスパース点が分散されるから、理論的な位置合わせの精度(誤差)は、スパース点が存在しない間隙の範囲でエッジが移動可能(回転移動も含む)な量に相当する。したがって、スパース点が密であればあるほど、位置合わせ精度は向上する。但し、その場合には一致度を評価するためのデータ量が増えるため、演算処理に時間が掛かることになる。反対に、スパース点が疎らであると、位置合わせ精度は落ちるものの、演算の高速化が図れる。こうしたことから、位置合わせの精度は、おおよそ、エッジの長さに対するROI幅と点の数で求まる。換言すれば、或る要求精度を達成するためには、エッジの長さに対するROI幅と点の数、又は点の密度を規定すればよいことになる。   The above is the template matching procedure in the image processing method according to the present invention. Here, what is important is the ROI width and the density of sparse points. FIG. 2 is an explanatory diagram of a sparse ROI setting method. As shown in FIG. 2, since the sparse points are dispersed in the range determined by the ROI width, the theoretical alignment accuracy (error) is such that the edge can move within the gap range where the sparse points do not exist (rotational movement is also possible). Equivalent). Therefore, the denser the sparse points, the better the alignment accuracy. However, in this case, the amount of data for evaluating the degree of coincidence increases, so that calculation processing takes time. On the other hand, if the sparse point is sparse, the alignment accuracy is lowered, but the calculation speed can be increased. For this reason, the alignment accuracy is roughly determined by the ROI width and the number of points with respect to the edge length. In other words, in order to achieve a certain required accuracy, the ROI width with respect to the edge length and the number of points or the density of the points may be defined.

次に、本発明に係る画像処理方法を実施するための画像処理装置の一実施例の構成及び動作について説明する。図3は本実施例の画像処理装置の概略構成図、図4はこの画像処理装置における画像位置合わせ処理の手順を示すフローチャートである。この実施例の装置では、上述した位置合わせパラメータの算出手法と多段階の粗密探索とを組み合わせることで、高速化と精度向上とを達成している。   Next, the configuration and operation of an embodiment of an image processing apparatus for carrying out the image processing method according to the present invention will be described. FIG. 3 is a schematic configuration diagram of the image processing apparatus according to the present embodiment, and FIG. 4 is a flowchart showing a procedure of image alignment processing in the image processing apparatus. In the apparatus of this embodiment, speeding-up and accuracy improvement are achieved by combining the above-described alignment parameter calculation method and multistage coarse / fine search.

図3において、基準画像記憶部12には予め基準画像を構成する画像データが格納される。検査対象画像入力部10は例えばCCDカメラ又はCMOSカメラであり、検査対象物を撮影してその撮影画像を取り込む。この画像データは対象画像一時記憶部11に保存される。演算処理部20はその機能として、エッジ抽出部21、初期ROI設定部22、スパースROI設定部23、一致度計算部24、一致度判定部25、ROI幅/点密度設定部26、欠陥検出部27などを含む。この演算処理部20の各機能はCPUを中心とするコンピュータで実現することが可能であるが、実際には全てをCPUで処理すると時間が掛かることが多い。そのため、特定の機能については専用のハードウエアで処理を行うことが望ましい。また、出力部13は欠陥検出結果を表示するものである。   In FIG. 3, the reference image storage unit 12 stores image data constituting a reference image in advance. The inspection target image input unit 10 is, for example, a CCD camera or a CMOS camera, captures an inspection target, and captures the captured image. This image data is stored in the target image temporary storage unit 11. The arithmetic processing unit 20 functions as an edge extraction unit 21, an initial ROI setting unit 22, a sparse ROI setting unit 23, a matching degree calculation unit 24, a matching degree determination unit 25, an ROI width / point density setting unit 26, and a defect detection unit. 27 and the like. Each function of the arithmetic processing unit 20 can be realized by a computer centered on a CPU. However, in reality, when all of the functions are processed by the CPU, it often takes time. For this reason, it is desirable to process specific functions with dedicated hardware. The output unit 13 displays a defect detection result.

上記構成を有する画像処理装置の典型的な動作を図4に従って説明する。
処理が開始されると、演算処理部20は基準画像記憶部12に格納されている基準画像Rを読み出しエッジ抽出部21にセットする(ステップS1)。エッジ抽出部21はその基準画像Rの中で濃淡の境界をエッジとして抽出する(ステップS2)。ROI幅/点密度設定部26はROI幅の初期値を初期ROI設定部22に設定する(ステップS3)。ここではまず粗い精度で高速に探索するために例えば10画素ずつ飛ばしながら位置合わせの探索を行うが、それを十分にカバーできるようなROI幅を設定する必要がある。
A typical operation of the image processing apparatus having the above configuration will be described with reference to FIG.
When the processing is started, the arithmetic processing unit 20 reads the reference image R stored in the reference image storage unit 12 and sets it in the edge extraction unit 21 (step S1). The edge extraction unit 21 extracts a light / dark boundary as an edge in the reference image R (step S2). The ROI width / point density setting unit 26 sets the initial value of the ROI width in the initial ROI setting unit 22 (step S3). Here, in order to search at high speed with coarse accuracy, for example, a search for alignment is performed while skipping 10 pixels at a time, but it is necessary to set an ROI width that can sufficiently cover it.

初期ROI設定部22は上記のように設定されたROI幅を用いて、抽出されたエッジの両側に広がる初期ROIを設定する(ステップS4)。その後、スパースROI設定部23は、設定された初期ROI内で所定の点密度となるようにほぼ一様にスパース点を決めることでスパースROIの設定を行う(ステップS5)。このときの点密度もROI幅/点密度設定部26から指定されるが、当初は細かい精度は不要であるので点密度を極端に下げ、スパース点を疎らに分散させる。   The initial ROI setting unit 22 sets the initial ROI spreading on both sides of the extracted edge using the ROI width set as described above (step S4). Thereafter, the sparse ROI setting unit 23 sets the sparse ROI by determining the sparse points almost uniformly so as to obtain a predetermined point density within the set initial ROI (step S5). The point density at this time is also specified by the ROI width / point density setting unit 26. However, since fine accuracy is not required at the beginning, the point density is extremely lowered and sparse points are sparsely distributed.

こうしたスパースROIが決まると、各スパース点の位置情報が一致度計算部24に与えられる。また、一致度計算部24には基準画像記憶部12から読み出された基準画像Rの画像データと、対象画像一時記憶部11に保存されている検査対象画像Pの画像データも入力される。そして、スパースROIの位置情報に基づく位置にある画素についてのみ、基準画像Rの画素値とx軸、y軸、θ角度軸について移動される検査対象画像Pの画素値とから、両画像R、Pの一致度が計算される(ステップS6)。検査対象画像Pの移動の際に、例えば上述のようにROI幅の範囲で10画素ずつ飛ばしながらの移動を行い、その移動の毎に一致度を求める。   When such a sparse ROI is determined, positional information of each sparse point is given to the coincidence calculation unit 24. Further, the image data of the reference image R read from the reference image storage unit 12 and the image data of the inspection target image P stored in the target image temporary storage unit 11 are also input to the coincidence degree calculation unit 24. And only about the pixel in the position based on the positional information of the sparse ROI, both the image R, from the pixel value of the reference image R and the pixel value of the inspection target image P moved about the x axis, the y axis, and the θ angle axis, The degree of coincidence of P is calculated (step S6). When the inspection target image P is moved, for example, as described above, the movement is performed while skipping 10 pixels in the range of the ROI width, and the degree of coincidence is obtained for each movement.

このときの位置合わせパラメータの算出精度が予め設定された要求精度を未だ満たしていなければ(ステップS7でNo)、一致度判定部25は上述のように計算される一致度を判定し、例えば一致度の大きなものから順に所定個数を選んでそれに対応する位置合わせパラメータ(x,y,θ)を取得する。そして、この所定個数の、それぞれ異なる位置合わせパラメータだけ位置が修正された検査対象画像Pを(修正検査対象画像P’)を候補として対象画像一時記憶部11へ保存する(ステップS8)。その後に、ROI幅/点密度設定部26で新たなROI幅及び点密度を設定し(ステップS9)、ステップS4へと戻る。ステップS4へ戻った後には上述したステップS6のときよりも密な、つまり飛ばす画素の数を小さくした探索を実行するが、それに合わせてROI幅は狭くし、点密度は高くする。   If the calculation accuracy of the alignment parameter at this time does not yet satisfy the required accuracy set in advance (No in step S7), the coincidence determination unit 25 determines the coincidence calculated as described above. A predetermined number is selected in descending order of the degree, and alignment parameters (x, y, θ) corresponding thereto are acquired. Then, the predetermined number of inspection target images P whose positions are corrected by different alignment parameters are stored in the target image temporary storage unit 11 with (corrected inspection target image P ′) as candidates (step S8). Thereafter, a new ROI width and point density are set by the ROI width / point density setting unit 26 (step S9), and the process returns to step S4. After returning to step S4, a search that is denser than that in step S6 described above, that is, with a reduced number of pixels to be skipped, is executed, but the ROI width is narrowed and the point density is increased accordingly.

こうしてステップS4に戻った後、再び基準画像Rから抽出されたエッジに対し新たな初期ROIを設定し、その初期ROI内でスパース点を設定する。そして、設定された各スパース点の位置の画素値を用いて、上述のように位置が修正された各検査対象画像P’と基準画像Rとの一致度を調べ、精度を向上させた位置合わせパラメータを求める。通常、ステップS4〜S9の処理を複数回繰り返すことで、位置合わせ精度が要求精度を下回るようにROI幅、点密度などが定められており、ステップS7でYesと判定されると、そのときに一致度が最大となる位置合わせパラメータ(x,y,θ)が取得される(ステップS10)。このようにして元の検査対象画像の位置ずれが求まるから、欠陥検出部27はその位置ずれが修正された検査対象画像と基準画像とを比較し、その一致度などに基づいて検査対象物の欠陥や不良の有無を判断し、その結果を出力部13より出力する。   After returning to step S4 in this way, a new initial ROI is set again for the edge extracted from the reference image R, and a sparse point is set within the initial ROI. Then, by using the pixel value at the position of each set sparse point, the degree of coincidence between each inspection object image P ′ whose position has been corrected as described above and the reference image R is examined, and the alignment with improved accuracy is performed. Find the parameters. Usually, the ROI width, the point density, etc. are determined such that the alignment accuracy is lower than the required accuracy by repeating the processing of steps S4 to S9. When it is determined Yes in step S7, An alignment parameter (x, y, θ) that maximizes the degree of coincidence is acquired (step S10). Since the positional deviation of the original inspection target image is obtained in this way, the defect detection unit 27 compares the inspection target image whose positional deviation is corrected with the reference image, and determines the inspection target object based on the degree of coincidence. The presence or absence of a defect or a defect is determined, and the result is output from the output unit 13.

なお、位置合わせの要求精度は画像処理の目的などにより相違するから、必ずしも上述のように粗探索から段階的に密探索を行う必要があるわけではない。   Note that, since the required accuracy of alignment differs depending on the purpose of image processing and the like, it is not always necessary to perform the fine search step by step from the rough search as described above.

また、上記実施例は本発明の一例であり、本発明の趣旨の範囲で適宜変形、修正、追加を行っても本願特許請求の範囲に包含されることは明らかである。   Moreover, the said Example is an example of this invention, and even if it changes suitably in the range of the meaning of this invention, correction, and addition, it is clear that it is included by the claim of this application.

本発明に係る画像処理方法におけるテンプレートマッチングの原理説明図。Explanatory drawing of the principle of template matching in the image processing method which concerns on this invention. 本発明に係る画像処理方法におけるスパースROIの設定方法の説明図。Explanatory drawing of the setting method of sparse ROI in the image processing method which concerns on this invention. 本発明に係る画像処理方法を実施するための画像処理装置の一実施例の概略構成図。1 is a schematic configuration diagram of an embodiment of an image processing apparatus for carrying out an image processing method according to the present invention. 本発明に係る画像処理方法の一実施例の処理手順を示すフローチャート。3 is a flowchart showing a processing procedure of an embodiment of an image processing method according to the present invention. 本発明に係る画像処理方法の実施例の画像を示す図。The figure which shows the image of the Example of the image processing method which concerns on this invention.

符号の説明Explanation of symbols

10…検査対象画像入力部
11…対象画像一時記憶部
12…基準画像記憶部
13…出力部
20…演算処理部
21…エッジ抽出部
22…ROI設定部
23…スパースROI設定部
24…一致度計算部
25…一致度判定部
26…ROI幅/点密度設定部
27…欠陥検出部
DESCRIPTION OF SYMBOLS 10 ... Inspection object image input part 11 ... Target image temporary storage part 12 ... Reference | standard image storage part 13 ... Output part 20 ... Operation processing part 21 ... Edge extraction part 22 ... ROI setting part 23 ... Sparse ROI setting part 24 ... Matching degree calculation Unit 25 ... coincidence degree determination unit 26 ... ROI width / point density setting unit 27 ... defect detection unit

Claims (6)

検査対象物について得られる検査対象画像と基準となる基準画像とのパターンマッチングを行う画像処理方法であって、
a)前記基準画像の中でエッジを抽出するエッジ抽出ステップと、
b)抽出された前記エッジに対して所定幅の初期関心領域を設定する初期関心領域設定ステップと、
c)前記初期関心領域内に所定の密度で以て分散した点をスパース関心領域として設定するスパース関心領域設定ステップと、
d)前記スパース関心領域に対応した複数の画素位置についての前記基準画像における画素値と前記検査対象画像における画素値とを用いて両画像の一致性を判定し、それに基づいて両画像間の位置ずれ量を評価する位置ずれ評価ステップと、
を有することを特徴とする画像処理方法。
An image processing method for performing pattern matching between an inspection object image obtained for an inspection object and a reference image serving as a reference,
a) an edge extraction step of extracting an edge in the reference image;
b) an initial region of interest setting step for setting an initial region of interest having a predetermined width for the extracted edge;
c) a sparse region-of-interest setting step of setting points dispersed with a predetermined density in the initial region of interest as a sparse region of interest;
d) using the pixel values in the reference image and the pixel values in the inspection target image for a plurality of pixel positions corresponding to the sparse region of interest to determine the coincidence of both images, and based on that, the position between the images A positional deviation evaluation step for evaluating the deviation amount;
An image processing method comprising:
請求項1に記載の画像処理方法であって、前記初期関心領域設定ステップにおける所定幅を段階的に狭める、及び/又は、前記スパース関心領域設定ステップにおける所定の密度を段階的に高めながら、前記初期関心領域設定ステップ、前記スパース関心領域設定ステップ、及び前記位置ずれ評価ステップの処理を複数回繰り返すことにより、位置ずれ量の評価精度を高めることを特徴とする画像処理方法。   The image processing method according to claim 1, wherein the predetermined width in the initial region of interest setting step is gradually reduced and / or the predetermined density in the sparse region of interest setting step is increased stepwise. An image processing method characterized by improving the evaluation accuracy of the amount of misalignment by repeating the initial region of interest setting step, the sparse region of interest setting step, and the misregistration evaluation step a plurality of times. 請求項1又は2に記載の画像処理方法であって、要求される精度に応じて前記初期関心領域設定ステップにおける所定幅、及び/又は、前記スパース関心領域設定ステップにおける所定の密度を決めることを特徴とする画像処理方法。   The image processing method according to claim 1 or 2, wherein a predetermined width in the initial region of interest setting step and / or a predetermined density in the sparse region of interest setting step are determined according to required accuracy. A featured image processing method. 検査対象物について得られる検査対象画像と基準となる基準画像とのパターンマッチングを行う画像処理装置であって、
a)前記基準画像の中でエッジを抽出するエッジ抽出手段と、
b)抽出された前記エッジに対して所定幅の初期関心領域を設定する初期関心領域設定手段と、
c)前記初期関心領域内に所定の密度で以て分散した点をスパース関心領域として設定するスパース関心領域設定手段と、
d)前記スパース関心領域に対応した複数の画素位置についての前記基準画像における画素値と前記検査対象画像における画素値とを用いて両画像の一致性を判定し、それに基づいて両画像間の位置ずれ量を評価する位置ずれ評価手段と、
を備えることを特徴とする画像処理装置。
An image processing apparatus that performs pattern matching between an inspection object image obtained for an inspection object and a reference image serving as a reference,
a) edge extraction means for extracting an edge in the reference image;
b) initial region of interest setting means for setting an initial region of interest having a predetermined width for the extracted edge;
c) Sparse region-of-interest setting means for setting, as sparse regions of interest, points dispersed at a predetermined density in the initial region of interest;
d) using the pixel values in the reference image and the pixel values in the inspection target image for a plurality of pixel positions corresponding to the sparse region of interest to determine the coincidence of both images, and based on that, the position between the images A positional deviation evaluation means for evaluating the deviation amount;
An image processing apparatus comprising:
請求項4に記載の画像処理装置であって、前記初期関心領域設定手段における所定幅を段階的に狭める、及び/又は、前記スパース関心領域設定手段における所定の密度を段階的に高めながら、前記初期関心領域設定手段、前記スパース関心領域設定手段、及び前記位置ずれ評価手段の処理を複数回繰り返すことにより、位置ずれ量の評価精度を高めることを特徴とする画像処理装置。   5. The image processing apparatus according to claim 4, wherein the predetermined width in the initial region-of-interest setting unit is gradually reduced and / or the predetermined density in the sparse region-of-interest setting unit is increased stepwise. An image processing apparatus characterized in that evaluation accuracy of a positional deviation amount is improved by repeating the processes of an initial region of interest setting means, the sparse interest area setting means, and the positional deviation evaluation means a plurality of times. 請求項4又は5に記載の画像処理装置であって、要求される精度に応じて前記初期関心領域設定手段における所定幅、及び/又は、前記スパース関心領域設定手段における所定の密度を決める演算パラメータ設定手段をさらに備えることを特徴とする画像処理装置。   6. The image processing apparatus according to claim 4, wherein the calculation parameter determines a predetermined width in the initial region-of-interest setting unit and / or a predetermined density in the sparse region-of-interest setting unit according to required accuracy. An image processing apparatus further comprising setting means.
JP2007335894A 2007-12-27 2007-12-27 Method and unit for image processing Pending JP2009157701A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007335894A JP2009157701A (en) 2007-12-27 2007-12-27 Method and unit for image processing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007335894A JP2009157701A (en) 2007-12-27 2007-12-27 Method and unit for image processing

Publications (1)

Publication Number Publication Date
JP2009157701A true JP2009157701A (en) 2009-07-16

Family

ID=40961650

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007335894A Pending JP2009157701A (en) 2007-12-27 2007-12-27 Method and unit for image processing

Country Status (1)

Country Link
JP (1) JP2009157701A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103345745A (en) * 2013-06-21 2013-10-09 宁波成电泰克电子信息技术发展有限公司 Quick secondary image partition method for alkaline battery tail end defect detection
CN109615610A (en) * 2018-11-13 2019-04-12 浙江师范大学 A kind of medical band-aid flaw detection method based on YOLO v2-tiny
CN112150423A (en) * 2020-09-16 2020-12-29 江南大学 Longitude and latitude sparse mesh defect identification method
CN116309036A (en) * 2022-10-27 2023-06-23 杭州图谱光电科技有限公司 Microscopic image real-time stitching method based on template matching and optical flow method

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103345745A (en) * 2013-06-21 2013-10-09 宁波成电泰克电子信息技术发展有限公司 Quick secondary image partition method for alkaline battery tail end defect detection
CN109615610A (en) * 2018-11-13 2019-04-12 浙江师范大学 A kind of medical band-aid flaw detection method based on YOLO v2-tiny
CN109615610B (en) * 2018-11-13 2023-06-06 浙江师范大学 Medical band-aid flaw detection method based on YOLO v2-tiny
CN112150423A (en) * 2020-09-16 2020-12-29 江南大学 Longitude and latitude sparse mesh defect identification method
CN112150423B (en) * 2020-09-16 2024-04-30 江南大学 Method for identifying defects of warp and weft sparse meshes
CN116309036A (en) * 2022-10-27 2023-06-23 杭州图谱光电科技有限公司 Microscopic image real-time stitching method based on template matching and optical flow method
CN116309036B (en) * 2022-10-27 2023-12-29 杭州图谱光电科技有限公司 Microscopic image real-time stitching method based on template matching and optical flow method

Similar Documents

Publication Publication Date Title
CN111474184B (en) AOI character defect detection method and device based on industrial machine vision
US7925076B2 (en) Inspection apparatus using template matching method using similarity distribution
CN107316047B (en) Image processing apparatus, image processing method, and storage medium
US10699400B2 (en) Image processing apparatus, image processing method, and storage medium
KR101523159B1 (en) Pattern matching apparatus, and a recording medium having a computer program stored thereon
US8019164B2 (en) Apparatus, method and program product for matching with a template
US20200134384A1 (en) Abnormality detection device
JP2009223414A (en) Matching degree computing device and method, program
CN113807378B (en) Training data increment method, electronic device and computer readable recording medium
JP2018096908A (en) Inspection device and inspection method
JP2009157701A (en) Method and unit for image processing
JP2006023178A (en) 3-dimensional measuring method and device
KR101583423B1 (en) Method for calibrating distortion of image in camera
JP2005345290A (en) Streak-like flaw detecting method and streak-like flaw detector
US20100091125A1 (en) Template matching device, camera with template matching device, and program for allowing computer to carry out template matching
US8971627B2 (en) Template matching processing device and template matching processing program
JP2005352543A (en) Template matching device
JP5195096B2 (en) Image processing inspection method and image processing inspection system
JP4951591B2 (en) Matching method corresponding to disappearance of pattern and inspection apparatus using the same
CN114187294B (en) Regular wafer positioning method based on prior information
JP4975688B2 (en) Image processing device
JP2008287338A (en) Image processor
US20230368349A1 (en) Template image creation method, template image creation system, and program
JP2009145161A (en) Method and apparatus for detecting defect
Richefeu et al. The particle image tracking technique: An accurate optical method for measuring individual kinematics of rigid particles