JPH07220076A - Image processing device - Google Patents

Image processing device

Info

Publication number
JPH07220076A
JPH07220076A JP6008649A JP864994A JPH07220076A JP H07220076 A JPH07220076 A JP H07220076A JP 6008649 A JP6008649 A JP 6008649A JP 864994 A JP864994 A JP 864994A JP H07220076 A JPH07220076 A JP H07220076A
Authority
JP
Japan
Prior art keywords
correlation value
step width
template matching
image
inspection
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
JP6008649A
Other languages
Japanese (ja)
Other versions
JP2957878B2 (en
Inventor
Tetsuo Hashimoto
哲生 橋本
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.)
Sanyo Electric Co Ltd
Original Assignee
Sanyo Electric Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sanyo Electric Co Ltd filed Critical Sanyo Electric Co Ltd
Priority to JP6008649A priority Critical patent/JP2957878B2/en
Publication of JPH07220076A publication Critical patent/JPH07220076A/en
Application granted granted Critical
Publication of JP2957878B2 publication Critical patent/JP2957878B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

PURPOSE:To provide an image processing device capable of detecting a corresponding area at high speed and accurately. CONSTITUTION:Data representing relation between a correlation value by inspection and a true correlation value is stored in program memory 16 at every step. Relation between the correlation value and a reliability section can be recognized by such data. The maximum correlation value when template matching can be obtained at certain step width is detected, and the reliability section in accordance with the maximum correlation value is detected by referring to data in the program memory 16. The template matching can be obtained by decreasing the step width of the reliability section when it overflows from the reliability section set in advance, decreasing it when the former is smaller than the latter, and with such step width when they are equal. The corresponding area with the reference image of a template can be detected from an image for inspection.

Description

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

【0001】[0001]

【産業上の利用分野】この発明は画像処理装置に関し、
特にたとえばテンプレートマッチングによって検査用画
像の中から基準画像との対応領域を検出し、定形性を有
する製造物が良品か不良品かを画像認識する製造物検査
システムに用いられる、画像処理装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an image processing device,
In particular, the present invention relates to an image processing apparatus used in a product inspection system that detects a region corresponding to a reference image from an inspection image by template matching and recognizes whether a product having a fixed shape is a good product or a defective product.

【0002】[0002]

【従来の技術】画像処理の技術の1つとして、撮像装置
等から入力された検査用画像(ディジタル画像)と予め
登録されている基準画像とを比較して検査用画像の中か
ら基準画像に対応する領域を求めるテンプレートマッチ
ングの手法がある。この手法は、図5に示すように、予
め用意されたテンプレート1に検査用画像2の一部(基
準画像)を登録し、一方、検査用画像に任意の領域(サ
ーチボックス)3を設ける。そして、そのサーチボック
ス3内をテンプレート1が矢印4のように走査すること
によって基準画像と検査用画像との相関度を調べ、最も
相関度の大きい領域を対応領域とするものである。
2. Description of the Related Art As one of image processing techniques, an inspection image (digital image) input from an image pickup device or the like is compared with a reference image registered in advance, and a reference image is selected from the inspection images. There is a template matching method for finding the corresponding region. In this method, as shown in FIG. 5, a part of the inspection image 2 (reference image) is registered in a template 1 prepared in advance, while an arbitrary area (search box) 3 is provided in the inspection image. Then, the template 1 is scanned in the search box 3 as shown by the arrow 4, and the degree of correlation between the reference image and the inspection image is examined, and the area having the highest degree of correlation is set as the corresponding area.

【0003】ここで、図6を参照して、テンプレートマ
ッチングについて説明する。図6において、検査用画像
を含むサーチボックス3の面積をM×N,基準画像を含
むテンプレート1の面積をMr×Nrとする。そして、
テンプレート1のステップ幅が決まればテンプレート1
がサーチボックス3内を所定のステップ幅で走査する。
Here, template matching will be described with reference to FIG. In FIG. 6, the area of the search box 3 including the inspection image is M × N, and the area of the template 1 including the reference image is Mr × Nr. And
If the step size of template 1 is decided, template 1
Scans the inside of the search box 3 with a predetermined step width.

【0004】たとえば、ステップ幅が1画素ずつの場
合、テンプレート1内の任意の画素を(mr,nr)と
すると、走査範囲は数1のように表される。
For example, when the step width is 1 pixel at a time, and the arbitrary pixel in the template 1 is (mr, nr), the scanning range is expressed by the formula 1.

【0005】[0005]

【数1】 |i−mr|≧Mr/2,|j−nr|≧Nr/2 (≧は定義域) ここで、テンプレート1の中心画素を(mc,nc)と
すると走査ステップは、mc+α,nc+α(α=1,
2,3,…)となる。また、ステップ幅が4画素ずつの
場合には、走査ステップはmc+β,nc+β(β=
1,5,9,…)となる。
## EQU00001 ## | i-mr | .gtoreq.Mr / 2, | j-nr | .gtoreq.Nr / 2 (.gtoreq.domain) where the central pixel of template 1 is (mc, nc), the scanning step is mc + .alpha. , Nc + α (α = 1,
2, 3, ...). Further, when the step width is 4 pixels each, the scanning step is mc + β, nc + β (β =
1, 5, 9, ...).

【0006】そして、テンプレートマッチングでは、検
査用画像とテンプレート1内の基準画像との相関値を求
める計算式として、たとえば数2に示すような相関関数
を用いた計算式が用いられる。
In the template matching, as a calculation formula for obtaining the correlation value between the inspection image and the reference image in the template 1, for example, a calculation formula using a correlation function shown in Formula 2 is used.

【0007】[0007]

【数2】 [Equation 2]

【0008】なお、数2の相関値は、−1≦相関値≦1
の値をとる。上述の手法では、検査用画像と基準画像と
を統計的に調べていくものであり、入力される検査用画
像がたとえば外乱などによって変化するなど多少不安定
であっても、正確な対応領域を求めることができる。
The correlation value of the equation 2 is -1≤correlation value≤1.
Takes the value of. In the above-mentioned method, the inspection image and the reference image are statistically examined, and even if the input inspection image is somewhat unstable such as changing due to disturbance, etc. You can ask.

【0009】[0009]

【発明が解決しようとする課題】しかしこの手法では計
算時間がかかってしまう。そこで高速で計算するために
は、一般的に図7に示すような手法がとられる。まず、
図7に示すステップSaにおいて、初期設定としてステ
ップ幅を設定する。そして、ステップSbにおいて図8
(A)に示すように、テンプレート1を検査用画像のサ
ーチボックス3内を大まかな間隔、すなわち1画素ずつ
テンプレート1を移動させるのではなく或るステップ幅
をもたせて走査するテンプレートマッチングによって相
関値の計算を行い、最大相関値を有する領域を検出す
る。テンプレート1がたとえば64×64画素の大きさ
であれば、ステップ幅をたとえば32画素ずつにする
と、図8(A)のようにテンプレート1が走査してい
く。そして、検出された領域がたとえば図8(B)に示
す領域5であれば、その領域5を中心に小さな(たとえ
ば100×200画素の)サーチボックス6を設ける。
なお、サーチボックス6内の位置と検査による相関値と
の関係は図9に示すようになる。図9からわかるよう
に、領域5の相関値が最大相関値である。そして、図7
のステップScにおいて、そのサーチボックス6内をテ
ンプレート1が1画素毎のステップ幅で走査してテンプ
レートマッチングをみて、ステップSdにおいて正確な
対応領域を検出する。
However, this method requires a long calculation time. Therefore, in order to calculate at high speed, a method as shown in FIG. 7 is generally adopted. First,
In step Sa shown in FIG. 7, a step width is set as an initial setting. Then, in step Sb, as shown in FIG.
As shown in (A), the correlation value is determined by template matching in which the template 1 is scanned within the search box 3 for the inspection image at a rough interval, that is, the template 1 is scanned with a certain step width instead of being moved pixel by pixel. Is calculated, and the region having the maximum correlation value is detected. If the template 1 has a size of 64 × 64 pixels, for example, if the step width is set to 32 pixels, the template 1 scans as shown in FIG. 8A. Then, if the detected area is, for example, the area 5 shown in FIG. 8B, a small (for example, 100 × 200 pixels) search box 6 is provided around the area 5.
The relationship between the position in the search box 6 and the correlation value obtained by the inspection is as shown in FIG. As can be seen from FIG. 9, the correlation value of area 5 is the maximum correlation value. And FIG.
In step Sc, the search box 6 is scanned by the template 1 with a step width for each pixel to check template matching, and an accurate corresponding area is detected in step Sd.

【0010】しかし、この手法では、ステップSbにお
いて最初に行われるステップ幅の大きなテンプレートマ
ッチングの計算結果の精度が最終的にテンプレートマッ
チングの精度を左右してしまうので、最初のテンプレー
トマッチングのステップ幅をあまり大きくすることがで
きず、計算時間をあまり短縮できなかった。また、ステ
ップSbのテンプレートマッチング処理において、撮像
装置にあてる照明部品の経時変化や外乱等による入力画
像の変化の影響を受けて正確な相関値が得られず、その
結果正確な対応領域を検出することができないことがあ
った。その結果、不良品でないのに不良と判断される場
合があった。
However, in this method, the accuracy of the calculation result of the template matching having a large step width performed first in step Sb finally affects the accuracy of the template matching, so that the step width of the first template matching is set. It could not be increased so much that the calculation time could not be shortened. Further, in the template matching process of step Sb, an accurate correlation value cannot be obtained due to the influence of a change in the input image due to a change with time of an illumination component attached to the image pickup device or a disturbance, and as a result, an accurate corresponding area is detected. There were things I couldn't do. As a result, there are cases where the product is judged to be defective even though it is not a defective product.

【0011】それゆえに、この発明の主たる目的は、計
算時間を短縮できかつ正確な対応領域を検出できる、画
像処理装置を提供することである。
Therefore, a main object of the present invention is to provide an image processing apparatus capable of reducing the calculation time and detecting an accurate corresponding area.

【0012】[0012]

【課題を解決するための手段】この発明は、基準画像を
含むテンプレートを所定ステップ幅で検査用画像上で移
動させてテンプレートマッチングをみることによって検
査用画像の中から基準画像との相関値の大きい領域を検
出する第1手段、および第1手段でのステップ幅より小
さいステップ幅でテンプレートを領域上で移動させてテ
ンプレートマッチングをみることによって領域の中から
基準画像と最も相関値の大きい領域を基準画像との対応
領域とする第2手段を含む画像処理装置において、各ス
テップ幅毎に相関値とそれに対応する信頼度区間との関
係を示すデータを記憶するメモリ、第1手段でのステッ
プ幅と所望の信頼度区間とを予め設定する手段、第1手
段のテンプレートマッチングをみたときの最大相関値に
対応する信頼度区間と予め設定された信頼度区間とを比
較する手段、および最大相関値に対応する信頼度区間が
予め設定された信頼度区間の範囲からはみ出している場
合にステップ幅を変更する手段を備える、画像処理装置
である。
According to the present invention, a template including a reference image is moved on the inspection image by a predetermined step width and template matching is performed to check template matching among the inspection images. The first means for detecting a large area, and the template with the step width smaller than the step width in the first means move the template over the area to check the template matching to find the area having the largest correlation value with the reference image. In an image processing apparatus including a second means as an area corresponding to a reference image, a memory for storing data showing a relationship between a correlation value and a reliability interval corresponding to each step width, a step width in the first means Means for presetting a desired confidence interval, and a confidence interval corresponding to the maximum correlation value in the template matching of the first means. And a preset reliability interval, and a means for changing the step width when the reliability interval corresponding to the maximum correlation value is out of the preset reliability interval range. It is a processing device.

【0013】[0013]

【作用】実験あるいは経験的に得られた相関値とそれに
対応する信頼度区間との関係を示すデータを予めメモリ
に格納しておく。そして、第1手段での比較的大きいス
テップ幅と所望の信頼度区間とを予め設定する。予め設
定されたステップ幅を用いて第1手段でテンプレートマ
ッチングをみて、そのときの最大相関値に対応する信頼
度区間をメモリのデータを参照して得る。この最大相関
値に対応する信頼度区間が予め設定された所望の信頼度
区間からはみ出していればステップ幅を小さくして、再
び第1手段でテンプレートマッチングをみる。この処理
を、最大相関値に対応する信頼度区間が予め設定された
信頼度区間と等しいかまたは予め設定された信頼度区間
内になるまで繰り返し、ステップ幅を決定する。そし
て、最大相関値に対応する信頼度区間が予め設定された
信頼度区間と等しければ、その後第1手段で大まかなテ
ンプレートマッチングをみた後、第2手段で細かなテン
プレートマッチングをみて、所望の対応領域を得る。ま
た、最大相関値に対応する信頼度区間が予め設定された
信頼度区間内であれば、ステップ幅を大きくして、その
後第1手段および第2手段でそれぞれテンプレートマッ
チングをみて、所望の対応領域を得る。
The data indicating the relationship between the correlation value obtained experimentally or empirically and the corresponding reliability interval is stored in advance in the memory. Then, a relatively large step width in the first means and a desired reliability interval are set in advance. Template matching is performed by the first means using a preset step width, and the reliability interval corresponding to the maximum correlation value at that time is obtained by referring to the data in the memory. If the reliability interval corresponding to this maximum correlation value is out of the preset desired reliability interval, the step size is reduced and the template matching is performed again by the first means. This process is repeated until the reliability interval corresponding to the maximum correlation value is equal to or within the preset reliability interval, and the step width is determined. Then, if the reliability interval corresponding to the maximum correlation value is equal to the preset reliability interval, then the first means is used for rough template matching, and then the second means is used for detailed template matching to obtain a desired correspondence. Get the area. If the reliability interval corresponding to the maximum correlation value is within the preset reliability interval, the step width is increased, and then the template matching is performed by the first means and the second means to determine the desired corresponding area. To get

【0014】[0014]

【発明の効果】この発明によれば、外乱や照明の経時変
化等の不安定要素があって、最大相関値に対応する信頼
度区間が予め設定された信頼度区間からはみ出している
場合にはステップ幅を小さくする。一方、安定してお
り、最大相関値に対応する信頼度区間が予め設定された
信頼度区間内である場合にはステップ幅を大きくする。
このように、動的にステップ幅を得ることができる。し
たがって、最初にテンプレートマッチングのステップ幅
を大きくとってもその後最適なステップ幅に設定し直せ
るので、問題なく高速に計算でき、また、外乱や照明の
経時変化等の不安定要素の影響を受けることなく正確に
対応領域を検出できる。したがって、この発明を製造物
検査システムに用いると、良品/不良品の判断をより正
確に行える。
According to the present invention, when there is an unstable element such as a disturbance or a temporal change of illumination and the reliability interval corresponding to the maximum correlation value is out of the preset reliability interval, Reduce the step width. On the other hand, when it is stable and the reliability interval corresponding to the maximum correlation value is within the preset reliability interval, the step width is increased.
In this way, the step width can be obtained dynamically. Therefore, even if the step width of template matching is made large at first, it can be set again to the optimum step width, so that it can be calculated at high speed without problems, and it is accurate without being affected by instability factors such as disturbance or aging of illumination. The corresponding area can be detected. Therefore, when the present invention is applied to the product inspection system, it is possible to more accurately judge whether the product is a good product or a defective product.

【0015】この発明の上述の目的,その他の目的,特
徴および利点は、図面を参照して行う以下の実施例の詳
細な説明から一層明らかとなろう。
The above-mentioned objects, other objects, features and advantages of the present invention will become more apparent from the detailed description of the following embodiments made with reference to the drawings.

【0016】[0016]

【実施例】図1を参照して、この実施例の画像処理装置
10はたとえば製造物検査システムに用いられ、CPU
12を含む。CPU12には、バス14を介して、プロ
グラムメモリ16,RAM18,画像メモリ20,A/
D変換回路22およびI/Oインタフェース24が接続
される。プログラムメモリ16には画像処理装置10の
動作を制御するためのプログラムおよび図2に示すグラ
フのデータなどが格納され、RAM18にはプログラム
の変数,計算を行うためのデータおよび計算結果などが
格納される。I/Oインタフェース24には照明装置2
6が接続され、A/D変換回路22には撮像装置28が
接続される。そして、検査対象物30を撮像装置28と
照明装置26との間に配置して、検査対象物30を撮像
装置28によって撮影して、その映像信号をA/D変換
回路22を介して検査用画像の映像データとして、画像
メモリ20に格納する。画像メモリ20には、そのほか
に、検査用画像の中から対応領域を検出するための基準
画像を含むテンプレートなどが格納される。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Referring to FIG. 1, an image processing apparatus 10 of this embodiment is used, for example, in a product inspection system and has a CPU.
Including 12. The CPU 12 has a program memory 16, a RAM 18, an image memory 20, and A / A via a bus 14.
The D conversion circuit 22 and the I / O interface 24 are connected. The program memory 16 stores a program for controlling the operation of the image processing apparatus 10 and the data of the graph shown in FIG. 2, and the RAM 18 stores variables of the program, data for performing calculations, calculation results, and the like. It The I / O interface 24 has a lighting device 2
6 is connected, and the imaging device 28 is connected to the A / D conversion circuit 22. Then, the inspection object 30 is arranged between the image pickup device 28 and the illumination device 26, the inspection object 30 is photographed by the image pickup device 28, and the video signal is inspected via the A / D conversion circuit 22. The image data of the image is stored in the image memory 20. In addition to the above, the image memory 20 also stores a template including a reference image for detecting a corresponding region from the inspection image, and the like.

【0017】図2に示すグラフのデータは、母集団の相
関値を区間推定するものであり、横軸に実際にテンプレ
ートマッチングをみたときの相関値(以下単に、「検査
による相関値」という)をとり、縦軸に実験や経験によ
って得られた相関値(以下単に、「真の相関値」とい
う)をとる。このようなデータが図2(A)ないし
(E)に示すように、たとえばステップ幅1ないしステ
ップ幅5といった各ステップ幅毎に得られる。たとえ
ば、ステップ幅1,2,3,4および5は、それぞれ1
画素ずつ,4画素ずつ,8画素ずつ,16画素ずつ,お
よび32画素ずつのステップ幅を有する。なお、図2
(A)ないし(E)の各曲線によって囲まれる範囲
(α)であれば、検査による相関値に対する真の相関値
のとり得る全ての値のうち、所定確率(この実施例では
たとえば95%)の範囲の真の相関値が含まれる。検査
による相関値に対する真の相関値の範囲(α)を信頼度
区間という。したがって、図2に示すグラフのデータか
ら検査による相関値と信頼度区間との関係がわかる。た
とえば図2(B)にステップ幅2のグラフを示すが、検
査による相関値が0.85の場合、真の相関値は95%
の確率で、0.50〜0.96となる。
The data of the graph shown in FIG. 2 is for estimating the correlation value of the population in a section, and the correlation value when template matching is actually observed on the horizontal axis (hereinafter, simply referred to as "correlation value by inspection"). And the vertical axis represents the correlation value obtained by experiment or experience (hereinafter simply referred to as “true correlation value”). Such data is obtained for each step width, for example, step width 1 to step width 5, as shown in FIGS. For example, the step widths 1, 2, 3, 4 and 5 are each 1
It has step widths of pixels, 4 pixels, 8 pixels, 16 pixels, and 32 pixels. Note that FIG.
Within the range (α) surrounded by the curves (A) to (E), a predetermined probability (for example, 95% in this embodiment) of all possible values of the true correlation value with respect to the correlation value by inspection. Includes true correlation values in the range. The range (α) of the true correlation value with respect to the correlation value obtained by the inspection is called the confidence interval. Therefore, the relationship between the correlation value by inspection and the reliability interval can be known from the data of the graph shown in FIG. For example, a graph of step width 2 is shown in FIG. 2B. When the correlation value by inspection is 0.85, the true correlation value is 95%.
The probability is 0.50 to 0.96.

【0018】このような画像処理装置の動作を、図3を
参照して説明する。まず、ステップS1において、初期
設定を行う。初期設定としては、最初(ステップS3)
に実行するテンプレートマッチングにおけるテンプレー
トのステップ幅および所望の信頼度区間をそれぞれ設定
する。次いで、ステップS3において、設定されたステ
ップ幅を用いてテンプレートマッチングをみて、最大相
関値を求め、プログラムメモリ16に格納されているグ
ラフのデータを参照して、最大相関値に対応する信頼度
区間を検出する。なお、この実施例では、検査対象物3
0の検査用画像はたとえば512×512画素で構成さ
れ、テンプレートはたとえば64×64画素で構成され
る。次いで、ステップS5では、その信頼度区間とステ
ップS1で初期設定した信頼度区間とを比較する。外乱
による影響等で最大相関値の信頼度区間が初期設定した
信頼度区間からはみ出していればステップS7におい
て、ステップ幅を小さくして、ステップS3において再
びテンプレートマッチングをみる。そして、ステップS
5において最大相関値の信頼度区間が、初期設定した信
頼度区間内になるかあるいは初期設定した信頼度区間と
等しくなるまでその処理を繰り返す。ステップS5にお
いて、最大相関値の信頼度区間が初期設定した信頼度区
間に収まれば、ステップS9においてステップ幅を大き
くしてステップS11に進む。2つの信頼度区間が等し
い場合もステップS11に進む。
The operation of such an image processing apparatus will be described with reference to FIG. First, in step S1, initial setting is performed. As initial setting, first (step S3)
The step width of the template and the desired reliability interval in the template matching executed in step 1 are set respectively. Next, in step S3, template matching is performed using the set step size to find the maximum correlation value, and the graph data stored in the program memory 16 is referenced to refer to the reliability interval corresponding to the maximum correlation value. To detect. In this embodiment, the inspection object 3
The inspection image of 0 is composed of, for example, 512 × 512 pixels, and the template is composed of, for example, 64 × 64 pixels. Next, in step S5, the reliability interval is compared with the reliability interval initially set in step S1. If the reliability interval of the maximum correlation value is out of the initially set reliability interval due to the influence of disturbance, the step width is reduced in step S7, and template matching is performed again in step S3. And step S
In step 5, the process is repeated until the reliability interval of the maximum correlation value falls within the initially set reliability interval or becomes equal to the initially set reliability interval. In step S5, when the reliability interval of the maximum correlation value falls within the initially set reliability interval, the step width is increased in step S9 and the process proceeds to step S11. If the two reliability intervals are equal, the process also goes to step S11.

【0019】以降、上述の従来と同様に2段階のテンプ
レートマッチングによって処理する。すなわち、ステッ
プS11において、上述の処理で設定されたステップ幅
を用いて大まかなテンプレートマッチングをみて、最大
相関値を有する対応領域を検出する。そして、ステップ
S13において、その対応領域を中心として小さなサー
チボックスを設定し、そのサーチボックス内で今度はス
テップ幅が1画素ずつのテンプレートマッチングをみ
る。なお、サーチボックスはたとえば縦100×横20
0画素で構成される。ステップS15において、ステッ
プS13のテンプレートマッチングでの最大相関値を有
する対応領域を検出し、その対応領域が検出すべき正確
な対応領域となり、終了する。そして、このように対応
領域を見つけることで対象検査物30の位置を知ること
ができ、製造物検査システムの良品/不良品の判断がよ
り正確となる。
Thereafter, processing is performed by two-step template matching as in the above-mentioned conventional method. That is, in step S11, rough template matching is performed using the step width set in the above process to detect the corresponding area having the maximum correlation value. Then, in step S13, a small search box is set with the corresponding area as the center, and template matching with a step width of one pixel is checked in the search box. Note that the search box is, for example, 100 vertical × 20 horizontal.
It consists of 0 pixels. In step S15, the corresponding area having the maximum correlation value in the template matching in step S13 is detected, and the corresponding area becomes the correct corresponding area to be detected, and the process ends. Then, by finding the corresponding area in this way, the position of the target inspection object 30 can be known, and the determination of the non-defective product / defective product in the product inspection system becomes more accurate.

【0020】図4(A)を参照して具体的に説明する。
図4(A)に示すように、検査による相関値が0.70
のとき、ステップ幅4の信頼度区間Aは0.06〜0.
89,ステップ幅3の信頼度区間Cは0.28〜0.8
6であり、初期設定した所望の信頼度区間Bを0.10
〜0.90(幅は0.80)とする。まず、ステップ幅
4で16画素ずつステップしてテンプレートマッチング
をみた結果、検査による最大相関値が0.70であれ
ば、その信頼度区間はAとなり0.06〜0.89の値
をとる。この範囲は信頼度区間Bの範囲からはみ出して
いるので、ステップ幅4でのテンプレートマッチングは
信頼度が低い。したがって、ステップ幅をステップ幅3
にして8画素ずつステップしてテンプレートマッチング
をみると、最大相関値が0.7であっても信頼度区間が
Cとなり0.28〜0.86となり、信頼度区間B内を
十分確保でき、テンプレートマッチングの信頼度が高く
なる。したがって、このように信頼度区間Bを満たすス
テップ幅3を用いてテンプレートマッチングをみる。
A detailed description will be given with reference to FIG.
As shown in FIG. 4A, the correlation value obtained by the inspection is 0.70.
, The reliability interval A of the step width 4 is 0.06 to 0.
89, the reliability interval C of step width 3 is 0.28 to 0.8
6 and the desired initial confidence interval B is set to 0.10.
˜0.90 (width is 0.80). First, as a result of performing template matching by stepping 16 pixels with a step width of 4, if the maximum correlation value by inspection is 0.70, the reliability interval is A and takes a value of 0.06 to 0.89. Since this range is out of the range of the reliability interval B, the template matching in the step width 4 has low reliability. Therefore, the step width is set to the step width 3
When the template matching is performed by stepping by 8 pixels and the maximum correlation value is 0.7, the reliability interval is C and is 0.28 to 0.86, and the reliability interval B can be sufficiently secured. Increases the reliability of template matching. Therefore, template matching is performed using the step width 3 that satisfies the reliability interval B in this way.

【0021】また、信頼度区間Bと信頼度区間Cとを比
較してわかるように、信頼度区間Bの幅にはまだ余裕が
あるので、信頼度区間B以内に収まるという条件をより
小さい相関値であっても満たすことができる。このよう
に低い相関値であっても判断できるので、多少のノイズ
に関係なく信頼性の高いテンプレートマッチングをみる
ことができる。たとえば、ステップ幅3とすることによ
って、相関値が0.67であっても信頼度区間B内とい
う条件を満たし、正確にテンプレートマッチングをみる
ことができるようになる。
Further, as can be seen by comparing the reliability interval B and the reliability interval C, the width of the reliability interval B still has a margin, so that the condition of being within the reliability interval B is smaller in correlation. Even a value can be met. Since such a low correlation value can be determined, reliable template matching can be seen regardless of some noise. For example, by setting the step width to 3, it is possible to satisfy the condition of being within the confidence interval B even when the correlation value is 0.67, and to accurately see template matching.

【0022】また、図4(B)に示すように、所望の信
頼度区間をB′に示すように0.05〜0.90とする
と、検査による相関値が0.70の場合ステップ幅4で
あっても信頼度区間B′内という条件を満たす。しか
し、検査による相関値がたとえば照明部品の経時変化や
何らかの外乱等によって0.60になったとすると、信
頼度区間は−0.26〜0.85の値をとることになり
信頼度区間B′からはみ出してしまい、テンプレートマ
ッチングの信頼度が下がってしまう。そこで、ステップ
幅をステップ幅3(8画素ずつステップする)に変更す
ると、検査による相関値が0.60となっても信頼度区
間は0.10〜0.83となり、信頼度区間B′内とい
う条件を満たす。したがって、高い信頼性でテンプレー
トマッチングをみることができる。このように、ステッ
プ幅を動的に変えることができるので、検査による相関
値が小さくなっても安定して対応領域を検出することが
できる。また、ステップ幅を動的に変えても、画像検査
に適した正規化された相関関数の式すなわち数2自体を
変える必要がないので、実用価値が高い。
As shown in FIG. 4 (B), if the desired reliability interval is 0.05 to 0.90 as shown in B ', when the correlation value by inspection is 0.70, the step width is 4 , The condition of being within the confidence interval B ′ is satisfied. However, if the correlation value obtained by the inspection becomes 0.60 due to, for example, a change with time of the illumination component or some disturbance, the reliability interval will take a value of -0.26 to 0.85, and the reliability interval B '. This causes the template matching to be less reliable. Therefore, when the step width is changed to the step width 3 (stepping by 8 pixels at a time), the reliability interval becomes 0.10 to 0.83 even if the correlation value obtained by the inspection becomes 0.60, and the reliability interval B'is Satisfy the condition. Therefore, template matching can be seen with high reliability. In this way, since the step width can be dynamically changed, it is possible to stably detect the corresponding area even if the correlation value due to the inspection becomes small. Further, even if the step width is dynamically changed, it is not necessary to change the equation of the normalized correlation function suitable for image inspection, that is, the equation 2 itself, and therefore the practical value is high.

【0023】なお、外乱の影響によってシェーディング
が起こり照明むらが発生すると検査による相関値が小さ
くなり、また、照明が暗くあるいは明るくなると検査に
よる相関値が小さくなる。
When shading occurs due to the influence of disturbance and uneven illumination occurs, the correlation value obtained by inspection becomes small, and when the illumination becomes dark or bright, the correlation value obtained by inspection becomes small.

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

【図1】この発明の一実施例を示すブロック図である。FIG. 1 is a block diagram showing an embodiment of the present invention.

【図2】母集団の相関値を区間推定するデータを示すグ
ラフである。
FIG. 2 is a graph showing data for interval estimation of a correlation value of a population.

【図3】この実施例の動作を示すフロー図である。FIG. 3 is a flowchart showing the operation of this embodiment.

【図4】ステップ幅3と4の場合の検査による相関値と
信頼度区間との関係を示すグラフである。
FIG. 4 is a graph showing a relationship between a correlation value and a confidence interval by inspection in the case of step widths 3 and 4.

【図5】テンプレートマッチングをみるための登録画像
と検査用画像とを示す図解図である。
FIG. 5 is an illustrative view showing a registration image and an inspection image for viewing template matching.

【図6】テンプレートマッチングを説明するための図解
図である。
FIG. 6 is an illustrative view for explaining template matching.

【図7】従来技術の動作を示すフロー図である。FIG. 7 is a flowchart showing the operation of the conventional technique.

【図8】2段階にテンプレートマッチングをみる場合を
説明するための図解図である。
FIG. 8 is an illustrative view for explaining a case where template matching is viewed in two stages.

【図9】サーチボックスの位置と検査による相関値との
関係を示すグラフである。
FIG. 9 is a graph showing the relationship between the position of the search box and the correlation value by inspection.

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

10 …画像処理装置 12 …CPU 16 …プログラムメモリ 18 …RAM 20 …画像メモリ 26 …照明装置 28 …撮像装置 30 …検査対象物 10 ... Image processing device 12 ... CPU 16 ... Program memory 18 ... RAM 20 ... Image memory 26 ... Illumination device 28 ... Imaging device 30 ... Inspection object

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】基準画像を含むテンプレートを所定ステッ
プ幅で検査用画像上で移動させてテンプレートマッチン
グをみることによって前記検査用画像の中から前記基準
画像との相関値の大きい領域を検出する第1手段、およ
び前記第1手段でのステップ幅より小さいステップ幅で
前記テンプレートを前記領域上で移動させてテンプレー
トマッチングをみることによって前記領域の中から前記
基準画像と最も相関値の大きい領域を前記基準画像との
対応領域とする第2手段を含む画像処理装置において、 各ステップ幅毎に前記相関値とそれに対応する信頼度区
間との関係を示すデータを記憶するメモリ、 前記第1手段でのステップ幅と所望の信頼度区間とを予
め設定する手段、 前記第1手段のテンプレートマッチングをみたときの最
大相関値に対応する信頼度区間と前記予め設定された信
頼度区間とを比較する手段、および前記最大相関値に対
応する信頼度区間が前記予め設定された信頼度区間の範
囲からはみ出している場合に前記ステップ幅を変更する
手段を備える、画像処理装置。
1. A method for detecting a region having a large correlation value with the reference image in the inspection image by moving a template including the reference image with a predetermined step width on the inspection image and checking template matching. 1 means, and by moving the template in the step width smaller than the step width in the first means and observing template matching, the area having the largest correlation value with the reference image is selected from the areas. In an image processing apparatus including a second means as an area corresponding to a reference image, a memory for storing data indicating a relationship between the correlation value and a reliability interval corresponding to the step width, the first means. Means for presetting a step width and a desired reliability interval, maximum correlation value when template matching of the first means is observed Means for comparing a corresponding reliability interval with the preset reliability interval, and the step when the reliability interval corresponding to the maximum correlation value is out of the range of the preset reliability interval. An image processing apparatus comprising means for changing the width.
JP6008649A 1994-01-28 1994-01-28 Image processing device Expired - Fee Related JP2957878B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP6008649A JP2957878B2 (en) 1994-01-28 1994-01-28 Image processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP6008649A JP2957878B2 (en) 1994-01-28 1994-01-28 Image processing device

Publications (2)

Publication Number Publication Date
JPH07220076A true JPH07220076A (en) 1995-08-18
JP2957878B2 JP2957878B2 (en) 1999-10-06

Family

ID=11698797

Family Applications (1)

Application Number Title Priority Date Filing Date
JP6008649A Expired - Fee Related JP2957878B2 (en) 1994-01-28 1994-01-28 Image processing device

Country Status (1)

Country Link
JP (1) JP2957878B2 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008015771A (en) * 2006-07-05 2008-01-24 Fujitsu Ten Ltd Image recognition device, image recognition method, and vehicle control device
JP2008112462A (en) * 2007-12-21 2008-05-15 Toshiba Corp Face area-tracing method by using face image, and device therefor
JP2008176555A (en) * 2007-01-18 2008-07-31 Fujitsu Ten Ltd Obstacle detector and obstacle detection method
JP2014023640A (en) * 2012-07-25 2014-02-06 Konica Minolta Inc Image processing device and program

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008015771A (en) * 2006-07-05 2008-01-24 Fujitsu Ten Ltd Image recognition device, image recognition method, and vehicle control device
JP2008176555A (en) * 2007-01-18 2008-07-31 Fujitsu Ten Ltd Obstacle detector and obstacle detection method
JP2008112462A (en) * 2007-12-21 2008-05-15 Toshiba Corp Face area-tracing method by using face image, and device therefor
JP4660534B2 (en) * 2007-12-21 2011-03-30 株式会社東芝 Method and apparatus for tracking face area based on face image
JP2014023640A (en) * 2012-07-25 2014-02-06 Konica Minolta Inc Image processing device and program

Also Published As

Publication number Publication date
JP2957878B2 (en) 1999-10-06

Similar Documents

Publication Publication Date Title
JP2003057019A (en) Pattern inspection device and inspection method using the same
CN109035167B (en) Method, device, equipment and medium for processing multiple faces in image
JP2005172559A (en) Method and device for detecting line defect on panel
JPH08292014A (en) Measuring method of pattern position and device thereof
US11493453B2 (en) Belt inspection system, belt inspection method, and recording medium for belt inspection program
JP2957878B2 (en) Image processing device
JP2019209734A (en) Track identification apparatus
CN110933304B (en) Method and device for determining to-be-blurred region, storage medium and terminal equipment
US8855401B2 (en) Methods and systems involving measuring complex dimensions of silicon devices
JP3788586B2 (en) Pattern inspection apparatus and method
JP2021052237A (en) Deposit detection device and deposit detection method
CN112950598B (en) Flaw detection method, device, equipment and storage medium for workpiece
JP2501076B2 (en) Fastener-Automatic inspection method and inspection device
JP2000331169A (en) Method and device for measuring motion vector of image
JPH10170817A (en) Method and device for calculating focal position, and electron microscope using the same
JP2021190515A (en) Workpiece left-over determination system
JP4560969B2 (en) Defect inspection method
JP2002163657A (en) Device and method for recognizing image and recording medium storing program therefor
CN113382134B (en) Focusing debugging method of linear array industrial camera
JP3050283B2 (en) Moving object recognition device
JPH09190533A (en) Vehicle detecting device
JPH0737085A (en) Reference pattern preparation device
JPH10206344A (en) Optical nonuniformity inspecting device and optical nonuniformity inspecting method
JP3252574B2 (en) Image processing device
JPH0894352A (en) Distance measuring instrument

Legal Events

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 19990622

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

Free format text: PAYMENT UNTIL: 20080723

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20080723

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20090723

Year of fee payment: 10

LAPS Cancellation because of no payment of annual fees