JP2001297325A - Image processor - Google Patents

Image processor

Info

Publication number
JP2001297325A
JP2001297325A JP2001123351A JP2001123351A JP2001297325A JP 2001297325 A JP2001297325 A JP 2001297325A JP 2001123351 A JP2001123351 A JP 2001123351A JP 2001123351 A JP2001123351 A JP 2001123351A JP 2001297325 A JP2001297325 A JP 2001297325A
Authority
JP
Japan
Prior art keywords
image
template
variance
value
correlation value
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
JP2001123351A
Other languages
Japanese (ja)
Other versions
JP3464463B2 (en
Inventor
Miwako Hirooka
美和子 広岡
Kazuhiko Washimi
和彦 鷲見
Manabu 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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric 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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP2001123351A priority Critical patent/JP3464463B2/en
Publication of JP2001297325A publication Critical patent/JP2001297325A/en
Application granted granted Critical
Publication of JP3464463B2 publication Critical patent/JP3464463B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Image Analysis (AREA)

Abstract

PROBLEM TO BE SOLVED: To solve the problem that special know-how is required and a processing time can not be shortened without lowering recognition accuracy. SOLUTION: The image processor for performing recognition by means of template matching using prepared template data is provided with a variance calculating part for calculating a variance inside the same area as a template image in the template data of an inputted source image and a variance deciding part for deciding whether a target exists or not by comparing the variance found by the valiance calculating part wit a threshold.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】この発明はロボットや産業機
械の位置制御及び検査などに使われる視覚装置における
画像処理装置に係り、特にテンプレートマッチング法に
おけるテンプレート画像の生成に関するものである。
[0001] 1. Field of the Invention [0002] The present invention relates to an image processing device in a visual device used for position control and inspection of a robot or an industrial machine, and more particularly to generation of a template image in a template matching method.

【0002】[0002]

【従来の技術】ここで、具体的な従来の画像処理装置の
説明をはじめる前に、まず基本的なテンプレートマッチ
ング手法について説明しておく。テンプレートマッチン
グ法(Template Matching =TM手
法)は、ティーチング・バイ・ショーイング、すなわち
対象毎にプログラムを組まなくても対象の画像を登録す
るだけで、自動的にその対象を再認識することが出来る
ような機能、が特徴であり、画像処理に関する知識のな
いユーザでも簡単に使いこなせるため、ユーザのニーズ
が高い位置合わせ手法である。また、最近のファクトリ
ーオートメーション(以下、FAという)分野における
画像処理装置への要求として2値化処理だけで対応でき
ないような複雑な検査や位置決めを高速に精度よく行う
ことが要求されており、正規化相互相関係数に基づいた
位置合わせを行なう濃淡テンプレートマッチングへの期
待は大きい。しかし、濃淡テンプレートマッチングはそ
の膨大な計算量のために、従来専用ハードウエアなしに
は、実現不可能とされてきた。そのため、画像処理装置
が高価になり、市場開拓の障害となっていた。
2. Description of the Related Art Before starting a description of a specific conventional image processing apparatus, a basic template matching method will be described first. In the template matching method (Template Matching = TM method), teaching-by-showing, that is, the object can be automatically re-recognized simply by registering the image of the object without setting a program for each object Such a function is a feature of the method, and a user who has no knowledge of image processing can easily use the function easily. Further, as a recent demand for an image processing apparatus in the field of factory automation (hereinafter referred to as FA), it is required to perform complicated inspection and positioning at high speed and with high precision which cannot be dealt with only by binarization processing. There is great expectation for light and shade template matching that performs positioning based on the generalized cross-correlation coefficient. However, gray-scale template matching has heretofore been impossible to implement without dedicated hardware due to its enormous amount of calculation. For this reason, the image processing apparatus has become expensive and has been an obstacle to market development.

【0003】次に、この濃淡テンプレートマッチング処
理の概要を、図6を用いて説明する。濃淡テンプレート
マッチングは位置(x,y)から開始されるテンプレー
トと同じ大きさの局所領域Sx,yを順にずらしなが
ら、テンプレート画像Gi,jと探索画像Fi,jの相
関値Mx,yを計算し、相関値が最も高い位置(x,
y)をテンプレートが発見された位置として、出力す
る。なお、この相関値Mx, は次の式(1)で与えら
れる。
Next, an outline of the density template matching processing will be described with reference to FIG. In the gray-scale template matching , the correlation value M x, between the template image G i, j and the search image F i, j is shifted while sequentially shifting the local area S x, y having the same size as the template starting from the position (x, y) . y is calculated and the position (x,
y) is output as the position where the template is found. The correlation value M x, y is given by the following equation (1).

【0004】[0004]

【数1】 (Equation 1)

【0005】ただし、上記式(1)において、F,Gは
探索画像あるいはテンプレート画像の局所領域内におけ
る画像の輝度の平均値、nは局所領域Sx,yに含まれ
る画素の個数である。また、この式(1)には分母側に
画像の輝度分散を表す項が含まれていることからもわか
るように、この相関値Mx,yは、画像の明るさの線形
的な変動F’i,j=Fi,j×k1+k2に全く影響
を受けないことがわかる。従って、濃淡テンプレートマ
ッチングを用いることによってテンプレート画像と検査
画像とのコントラストが変化したり、画像全体の明るさ
の変化やノイズへの余裕度が大きい。
In the above equation (1), F and G are the average values of the brightness of the image in the local area of the search image or the template image, and n is the number of pixels included in the local area Sx, y . Further, as can be seen from the fact that the expression (1) includes a term representing the luminance variance of the image on the denominator side, the correlation value M x, y is represented by a linear variation F of the brightness of the image. It can be seen that ' i, j = F i, j × k1 + k2' is not affected at all. Therefore, the contrast between the template image and the inspection image is changed by using the gray-scale template matching, and the margin for the change in brightness of the entire image and noise is large.

【0006】しかしながら、このような濃淡テンプレー
トマッチングは相関値演算に時間がかかり、FA分野な
ど、高速化が要求される場合には時間の制限から実用的
に対応できなかった。たとえば、512×512の検査
画像中、128×128のテンプレート画像のサーチを
行う場合、次の式(2)による回数の積和演算が必要で
あり、100Mipsクラスの計算機をもってしても1
0秒以上の計算時間を要することとなる。
However, such gray-scale template matching takes a long time to calculate a correlation value, and when a high speed is required, such as in the FA field, it cannot be practically coped with due to time limitations. For example, when searching for a 128 × 128 template image in a 512 × 512 inspection image, the product-sum operation of the number of times according to the following equation (2) is required.
This requires a calculation time of 0 second or more.

【0007】 128×128×(512−128)×(512−128) =2.4×10 ・・・(2)128 × 128 × (512-128) × (512-128) = 2.4 × 10 9 (2)

【0008】これに対して、よく知られた高速化手法と
して粗精サーチ法があった。粗精サーチ法とは、図7に
示すように、第1ステップとして原画像を1/4や1/
8に縮退した画像(粗画像)を作り、粗画像のテンプレ
ート画像でだいたいの位置をサーチし、その周辺だけを
原画像で精サーチして正確な位置を求めるという方法で
ある。この方法で先ほどの例と同じ結果を得るのに必要
な演算量は、粗精サーチの比率を1:Nとすれば、次の
式(3)で与えられる回数で済む。
On the other hand, there is a coarse search method as a well-known high-speed technique. The coarse search method is, as shown in FIG. 7, as shown in FIG.
In this method, an image (coarse image) degenerated to 8 is created, a rough image is searched for a template image, and an approximate position of the rough image is searched for in the original image to obtain an accurate position. The amount of calculation required to obtain the same result as the previous example by this method can be the number of times given by the following equation (3), provided that the ratio of coarse / fine search is 1: N.

【0009】[0009]

【数2】 (Equation 2)

【0010】このようにNを変化させると、図8に示す
様に最適な粗精比が存在するが、このような場合にも、
FAラインでの実用化レベルとして目安にされる0.1
sec以内の認識を達成するにはまだ数百倍の時間短縮
を達成しなければならない。
[0010] When N is changed in this manner, there is an optimum coarse / fine ratio as shown in FIG. 8.
0.1 which is set as a standard for practical use in the FA line
To achieve recognition within seconds, a time reduction of several hundred times must still be achieved.

【0011】このように、従来の粗精サーチによるテン
プレートマッチング法では、処理速度が遅く実用的でな
いという問題点があった。
As described above, the conventional template matching method using the coarse / fine search has a problem that the processing speed is slow and impractical.

【0012】このようなテンプレートマッチング技術に
対して、いくつかの技術が開発されている。図9はたと
えば、特公平2−642号公報に示された従来の部分テ
ンプレートマッチング法を示す説明図である。図におい
て、11はパターン位置検出対象である半導体ペレット
の回路素子形成領域であり、12はその2辺に規則的に
配列された接続パッドである。13a,13bはパター
ン位置検出に際して探索されるパターン探索領域(目標
パターン)である。
Several techniques have been developed for such template matching techniques. FIG. 9 is an explanatory diagram showing a conventional partial template matching method disclosed in Japanese Patent Publication No. 2-642, for example. In the figure, reference numeral 11 denotes a circuit element forming region of a semiconductor pellet to be subjected to pattern position detection, and 12 denotes connection pads regularly arranged on two sides thereof. Reference numerals 13a and 13b denote pattern search areas (target patterns) searched for pattern position detection.

【0013】ここでは目標パターンとそれぞれ一致する
テンプレートを持ち、予め教示していた位置関係を利用
して、真のピークを検出しようとするものである。この
場合、対象としたいテンプレートを部分に分けて、それ
ぞれの部分でパターン探索領域13a,13bとテンプ
レートマッチングすることによって、同一の特徴を持っ
たパターンが複数個等間隔に配列されている場合でも、
目標パターンを識別できる。また、目標パターンを部分
に分けて撮像できるので、分解能を高めることができ
る。
In this case, a template that matches each of the target patterns is provided, and a true peak is to be detected using the positional relationship taught in advance. In this case, even if a plurality of patterns having the same characteristics are arranged at regular intervals by dividing the template to be targeted into parts and performing template matching with the pattern search areas 13a and 13b in each part,
The target pattern can be identified. In addition, since the target pattern can be imaged by being divided into portions, the resolution can be increased.

【0014】しかしながら、この方式ではどの部分をテ
ンプレートとすれば良いのか、ユーザが判断しなければ
ならず、ノウハウが必要とされた。
However, in this method, the user has to determine which part should be used as a template, and know-how is required.

【0015】一方、テンプレートの自己評価方法として
特開昭61−74082号公報では次のような方式が提
案されている。次に図10を用いてそれを説明する。図
において、14は検出対象を撮像する撮像手段、15は
撮像された画像データを2値化する2値化回路、16は
2値化された画像データを格納する画像メモリ、17は
シフトメモリ18、並列切出しレジスタ19、標準パタ
ーンレジスタ20、パターン照合回路21より成り、画
像データより切り出した部分パターンを標準パターンと
照合するマッチング回路、22はパターン照合回路21
の出力の最小値を検出する最小値検出回路、23は領域
限定回路、24はそれらに所定のタイミングを与えるタ
イミング発生回路、25は当該システムの全体制御を行
う計算機である。
On the other hand, as a method for self-evaluating a template, Japanese Patent Application Laid-Open No. 61-74082 proposes the following method. Next, this will be described with reference to FIG. In the figure, reference numeral 14 denotes an image pickup means for picking up an image of a detection target, 15 denotes a binarization circuit for binarizing imaged image data, 16 denotes an image memory for storing binarized image data, and 17 denotes a shift memory 18. A matching circuit for matching a partial pattern cut out from image data with a standard pattern, and a pattern matching circuit 22.
Is a minimum value detection circuit for detecting the minimum value of the output of the above, 23 is an area limiting circuit, 24 is a timing generation circuit for giving a predetermined timing to them, and 25 is a computer for performing overall control of the system.

【0016】この方式は、撮像手段14で撮像された検
出対象の画像から、求めるべき標準パターンの大きさの
部分パターンを切り出して、標準パターンの候補とし、
順次切り出された部分パターンあるいは部分パターンと
検出対象の画像から標準パターンとしての適性を表す評
価値を求め、その値に基づいて標準パターンを決定する
ように動作する。このように、この方式によれば、画面
内から自動的にパターンマッチングに適した標準パター
ンを選択できるので、ユーザのノウハウが不要となる。
In this method, a partial pattern having a size of a standard pattern to be obtained is cut out from an image of a detection target imaged by the image pickup means 14 and is set as a standard pattern candidate.
An operation is performed to obtain an evaluation value indicating suitability as a standard pattern from the sequentially extracted partial pattern or the partial pattern and the image to be detected, and determine the standard pattern based on the value. As described above, according to this method, a standard pattern suitable for pattern matching can be automatically selected from within a screen, so that user know-how is not required.

【0017】しかしながら、この方式では入力画像の中
からテンプレートを選択するのに、ユーザは予めテンプ
レートの大きさを決定しておかなければならず、せっか
く自己評価して最適なテンプレートが自動的に登録され
るとしても最適な大きさが選択されているかどうかは評
価できない。
However, in this method, in order to select a template from the input image, the user must determine the size of the template in advance, and the self-evaluation is performed to automatically register the optimal template. Even if it does, it cannot be evaluated whether the optimal size is selected.

【0018】また、この方式では入力画像全面をテンプ
レートの候補として順次切り出してそれぞれについて評
価しなければならないので、時間もかかる。多くのテン
プレートマッチングを用いて認識を行なう場合、ユーザ
が認識したい対象物は自明であることが多いのに、その
ユーザの知識が活かせず、評価値のみでテンプレートが
決定されてしまうので、不必要な処理にかかる時間が多
く、ユーザの意図も反映しにくいという問題点があっ
た。
In this method, the entire input image must be sequentially cut out as template candidates and evaluated for each template, which takes time. When performing recognition using many template matchings, the object that the user wants to recognize is often self-explanatory, but the user's knowledge cannot be used, and the template is determined only by the evaluation value, which is unnecessary. However, there is a problem that it takes a lot of time to perform various processes, and it is difficult to reflect the intention of the user.

【0019】さらに、特開平4−359388号公報で
は次のような方式が提案されている。次に図11を用い
てそれを説明する。この装置はサーチ画像を保存する探
索画像用記憶装置26、テンプレート画像を保存してお
くテンプレート画像用記憶装置27、両画像の0値を処
理する0値データ処理回路28、両画像値の比を求める
割算器29、割算器29の計算値を保存する計算値保存
用記憶装置30、割算器29の出力値と計数値保存用記
憶装置30の保存値との差の絶対値を求める絶対値計算
回路31、今回得られた絶対値と前回得られた絶対値を
加算する加算回路32、しきい値を保存するしきい値保
存回路33、加算回路32による加算値としきい値を比
較する比較回路34とで構成されている。この手法によ
れば、残差逐次検定法(Suquential Sim
ilarity Ditection Algorit
hm =SSDA法)による打ち切りを、画像間に明る
さの差があっても達成できるように変形している。従っ
て、画像取得時の周囲の明るさなどの制限がなくなっ
て、常時環境が変化するような状況でのアプリケーショ
ンに用いることができる。
Further, Japanese Patent Application Laid-Open No. 4-359388 proposes the following system. Next, this will be described with reference to FIG. This apparatus includes a search image storage device 26 for storing a search image, a template image storage device 27 for storing a template image, a 0-value data processing circuit 28 for processing 0 values of both images, and a ratio of both image values. The divider 29 to be obtained, a calculated value storage device 30 for storing the calculated value of the divider 29, and the absolute value of the difference between the output value of the divider 29 and the stored value of the counted value storage device 30 is obtained. An absolute value calculating circuit 31, an adding circuit 32 for adding the absolute value obtained this time to the absolute value obtained last time, a threshold value storing circuit 33 for storing the threshold value, and comparing the added value by the adding circuit 32 with the threshold value And a comparison circuit 34. According to this method, the sequential sequential test method (Sequential Sim
ilality Detection Algorit
hm = SSDA method) is modified so that it can be achieved even if there is a difference in brightness between images. Therefore, there is no restriction on the brightness of the surroundings at the time of acquiring an image, and the present invention can be used for an application in a situation where the environment constantly changes.

【0020】この手法では、入力画像全体の明るさのコ
ントラストの幅が変化しても対応できるようになってい
るが、画像全体の明るさがシフトアップもしくはシフト
ダウンしたときには、この両画像の比はテンプレートの
位置によって変化するので対応できない。また、しきい
値処理をしており、このしきい値を決定するにはノウハ
ウを要する。
Although this method can cope with a change in the width of the contrast of the brightness of the entire input image, when the brightness of the entire image is shifted up or down, the ratio of the two images is reduced. Cannot be handled because it changes depending on the position of the template. Further, threshold processing is performed, and know-how is required to determine the threshold.

【0021】また、サブピクセルの精度を求める方法と
して、特開平5−120436号公報では次のような方
式が提案されている。次に図12を用いてそれを説明す
る。この方式は画素位置を画素単位でずらしつつ被検出
画像とテンプレート画像との相関値を算出し、その相関
値が最大となる画素位置を探索し(第1段階)、その8
近傍画素の位置と相関値を求め(第2段階)、これらの
座標と相関値から多変数多項式回帰曲面を決定し(第3
段階)、その曲面のピークからサブピクセル精度のピー
ク検出を行なう(第4段階)ものである。この手法で
は、多変数多項式回帰曲面から、高精度でピーク位置の
変化に連続な推定ピーク位置を求めることができるの
で、画素単位を超越したサブピクセル精度で位置検出す
ることができる。
Further, as a method of obtaining the accuracy of the sub-pixel, the following method is proposed in Japanese Patent Application Laid-Open No. Hei 5-120436. Next, this will be described with reference to FIG. This method calculates a correlation value between the detected image and the template image while shifting the pixel position in pixel units, and searches for a pixel position having the maximum correlation value (first stage).
The position of a neighboring pixel and a correlation value are obtained (second stage), and a multivariable polynomial regression surface is determined from these coordinates and the correlation value (third stage).
Step), and a peak of sub-pixel accuracy is detected from the peak of the curved surface (fourth step). According to this method, since an estimated peak position that is continuous with a change in the peak position can be obtained with high accuracy from the multivariable polynomial regression surface, the position can be detected with sub-pixel accuracy beyond the pixel unit.

【0022】しかしながら、この手法では中心と8近傍
の全9点の相関値を最初に計算しなければならず、処理
時間がかかる。また、この手法ではXY平面と相関値の
関係が2次の曲面を形成することが仮定となっている
が、実際の相関値のピークと近傍の形状は2次曲面より
もするどいピークを描くことが多いので、2次曲面の近
似では正確にピークを求めることはできない。
However, in this method, the correlation values of all 9 points near the center and 8 must be calculated first, which takes a long processing time. Also, in this method, it is assumed that the relationship between the XY plane and the correlation value forms a quadratic surface, but the actual correlation value peak and the shape in the vicinity thereof draw a sharper peak than the quadratic surface. Therefore, a peak cannot be accurately obtained by approximation of a quadratic surface.

【0023】[0023]

【発明が解決しようとする課題】従来の画像処理装置は
以上のように構成されているので、通常の濃淡テンプレ
ートマッチングでは相関値の演算に多大な時間がかかる
ため実用的ではなく、粗精サーチによるテンプレートマ
ッチングでも処理時間の短縮は充分とはいえず、FAな
どの高速処理が要求される分野には時間の制約から実用
的に対応することができないものであり、さらに、部分
テンプレートマッチング法によるものでは、どの部分を
テンプレートとするかをユーザが判断するためのノウハ
ウが必要であり、テンプレートの自己評価を行う方式で
は評価値のみでテンプレートが決定されてしまうため、
ユーザの知識を生かせず、不必要な処理にかかる時間が
多く、ユーザの意図も反映しにくいものであり、SSD
A法によるものでは画像全体の明るさのシフトアップや
ダウンに対応できず、しきい値処理のためのしきい値の
決定にノウハウが必要であるなどの問題点があった。
Since the conventional image processing apparatus is constructed as described above, it takes a lot of time to calculate the correlation value in the ordinary shading template matching, so that it is not practical, and it is not practical. The processing time cannot be sufficiently shortened even by template matching by the method described above, and it is not practically possible to cope with the field requiring high-speed processing such as FA due to time constraints. In such a case, the user needs know-how to determine which part to use as a template, and in the method of performing self-evaluation of the template, the template is determined only by the evaluation value.
SSDs do not take advantage of the user's knowledge, take a lot of time for unnecessary processing, and hardly reflect the user's intention.
The method A cannot cope with the shift up or down of the brightness of the entire image, and has a problem that know-how is required to determine a threshold for threshold processing.

【0024】この発明は上記のような課題を解決するた
めになされたもので、特別なノウハウを必要とせず、認
識精度を低下させることなく処理時間を短縮できる画像
処理装置を得ることを目的とする。
The present invention has been made to solve the above-described problems, and has as its object to provide an image processing apparatus which does not require special know-how and can reduce the processing time without reducing the recognition accuracy. I do.

【0025】[0025]

【課題を解決するための手段】この発明に係る画像処理
装置は、予め用意されたテンプレートデータを用いたテ
ンプレートマッチング法によって認識を行う画像処理装
置において、入力された原画像のテンプレートデータ中
のテンプレート画像と同じ領域内の分散値を演算する分
散値計算部と、分散値計算部によって求められた分散値
としきい値との比較によって対象物が存在するか否かの
判定を行う分散値判定部とを備えるものである。
An image processing apparatus according to the present invention is an image processing apparatus for performing recognition by a template matching method using template data prepared in advance. A variance value calculation unit that calculates a variance value in the same region as the image, and a variance value determination unit that determines whether an object exists by comparing the variance value obtained by the variance value calculation unit with a threshold value Is provided.

【0026】[0026]

【発明の実施の形態】以下、この発明の実施の一形態を
説明する。 実施の形態1.図1はこの発明の実施の形態1による画
像処理装置の構成を示す図である。図において、40は
ユーザによって登録がなされるワーク等の対象物であ
り、41はこの対象物を撮像して原画像の入力を行うテ
レビカメラなどの画像入力部である。53は画像入力部
41にて入力された原画像が格納される画像メモリであ
り、54はテンプレートマッチングのために予め用意さ
れている、テンプレート画像、テンプレート画像の分散
値、相関値のしきい値、サーチ領域、サーチ照明状態パ
ラメータなどのテンプレートデータである。55は画像
メモリ53に格納されている原画像内の、テンプレート
データ54中のテンプレート画像と同じ領域の分散値を
演算する分散値計算部であり、56はこの分散値計算部
55にて求められた分散値に基づいて、対象物が存在す
るか否かの判定を行う分散値判定部である。57は画像
メモリ53に格納されている原画像とテンプレートデー
タ54中のテンプレート画像との相関値を演算する相関
値計算部であり、58はこの相関値計算部57にて求め
られた相関値を判定する相関値判定部である。59は分
散値判定部56と相関値判定部58の判定結果に基づく
認識結果の記録を行う認識結果記録部である。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS One embodiment of the present invention will be described below. Embodiment 1 FIG. FIG. 1 is a diagram showing a configuration of an image processing apparatus according to Embodiment 1 of the present invention. In the figure, reference numeral 40 denotes an object such as a work registered by a user, and reference numeral 41 denotes an image input unit such as a television camera which captures the object and inputs an original image. Reference numeral 53 denotes an image memory for storing the original image input by the image input unit 41, and reference numeral 54 denotes a template image, a variance value of the template image, and a threshold value of the correlation value, which are prepared in advance for template matching. , Search area, search illumination state parameters, and the like. Reference numeral 55 denotes a variance value calculation unit that calculates a variance value in the same area as the template image in the template data 54 in the original image stored in the image memory 53, and 56 denotes a variance value calculation unit. A variance value determination unit that determines whether an object exists based on the variance value obtained. Reference numeral 57 denotes a correlation value calculation unit that calculates a correlation value between the original image stored in the image memory 53 and the template image in the template data 54. Reference numeral 58 denotes a correlation value calculated by the correlation value calculation unit 57. It is a correlation value determining unit for determining. Reference numeral 59 denotes a recognition result recording unit that records a recognition result based on the determination results of the variance value determination unit 56 and the correlation value determination unit 58.

【0027】次に動作について説明する。ここで、図2
はこの実施の形態1による画像処理装置の処理の流れを
示すフローチャートである。ユーザは予めテンプレート
データ54を生成しておく、このテンプレートデータ5
4には前述のように、テンプレート画像、テンプレート
画像の分散値、相関値のしきい値、サーチ領域の範囲
(スタート座標、画像サイズ)、サーチ時の照明状態パ
ラメータなどが含まれている。処理が開始されると、ま
ずテンプレートデータ54のロードが行われ(ステップ
ST51)、次いでサーチ領域を撮像した入力画像が画
像メモリ53に格納される(ステップST52)。次
に、その入力画像に対してテンプレートデータ54内の
テンプレート画像の大きさと同じ領域内の分散値の和
が、分散値計算部55において次の式(4)にて計算さ
れる(ステップST53)。
Next, the operation will be described. Here, FIG.
4 is a flowchart showing a flow of processing of the image processing apparatus according to the first embodiment. The user generates the template data 54 in advance.
As described above, 4 includes a template image, a variance value of the template image, a threshold value of a correlation value, a range of a search area (start coordinates, image size), an illumination state parameter at the time of a search, and the like. When the process is started, the template data 54 is loaded first (step ST51), and an input image of the search area is stored in the image memory 53 (step ST52). Next, the sum of the variances of the input image in the same area as the size of the template image in the template data 54 is calculated by the variance value calculator 55 using the following equation (4) (step ST53). .

【0028】[0028]

【数3】 (Equation 3)

【0029】ただし、式(4)において、Fは局所領域
内における画像の輝度の平均値、nは局所領域Sx,y
に含まれる画素の個数である。
In the equation (4), F is the average value of the luminance of the image in the local area, and n is the local area S x, y
Is the number of pixels included in.

【0030】次に、分散値計算部55で算出された分散
値の和Vx,yの値がしきい値よりも小さければ、その
位置には対象物が存在しないと判定して以後の処理を打
ち切る。一方、分散値の和がしきい値よりも大きけれ
ば、その位置を対象物認識位置の候補として残し、最終
的な正確な位置は、相関値計算部57にてテンプレート
マッチングによる相関値を計算し(ステップST5
5)、その相関値をしきい値と比較して(ステップST
56)決定し、その結果を認識結果記録部59にて記録
する(ステップST57)。
Next, if the sum of the variance values Vx , y calculated by the variance value calculation unit 55 is smaller than the threshold value, it is determined that no object exists at that position, and the subsequent processing is performed. Censor. On the other hand, if the sum of the variances is larger than the threshold, the position is left as a candidate for the object recognition position, and the final accurate position is calculated by the correlation value calculation unit 57 by calculating a correlation value by template matching. (Step ST5
5) Compare the correlation value with the threshold value (step ST
56) Decide, and record the result in the recognition result recording unit 59 (step ST57).

【0031】なお、前記分散値のしきい値は、照明の変
動や対象物40の色あいの変動具合いなどの検査時の状
況をユーザにパラメータとして入力させて、それに応じ
て決定する。すなわち、照明条件の変動が大きい時に
は、テンプレート画像の分散値とサーチ画像の分散値は
大きく異なり、逆に照明条件が安定しているときには、
近い値をとる。このことを利用して、ユーザには照明状
態パラメータとして、照明条件が安定しているときには
テンプレート画像の分散値よりもサーチ画像の分散値が
大きな場合のみ候補として残す。また、照明条件が不安
定なときや外乱の影響を受けやすいときには、テンプレ
ート画像の数分の一、たとえば、1/5をしきい値とし
て、その値よりサーチ画像の分散値が大きいときには候
補として残し、最終的な判断は従来から用いられている
相関値によって判断する。
The threshold value of the variance value is determined in accordance with a condition at the time of inspection, such as a change in illumination or a change in color of the object 40, which is input by a user as a parameter. That is, when the fluctuation of the illumination condition is large, the variance of the template image and the variance of the search image are significantly different. Conversely, when the illumination condition is stable,
Take close values. By utilizing this fact, the user is left as a candidate as an illumination state parameter only when the variance of the search image is larger than the variance of the template image when the illumination condition is stable. Further, when the illumination condition is unstable or easily affected by disturbance, a threshold value of a fraction of the template image, for example, 1/5 is set as a threshold value, and when the variance of the search image is larger than the threshold value, it is determined as a candidate. The final decision is made based on a conventionally used correlation value.

【0032】参考例1.本願発明とは直接関係ないが、
その理解を助ける参考例1をここに示す。図3は参考例
1による画像処理装置を示す構成図で、相当部分には図
1と同一符号を付してその説明を省略する。図におい
て、60は相関値計算部57によって求められ、相関値
判定部58にてしきい値と比較されて候補として残され
た相関値について、ピークの位置および値の推定を行う
ピーク推定部である。
Reference Example 1 Although not directly related to the present invention,
Reference Example 1 to help the understanding is shown here. FIG. 3 is a block diagram showing the image processing apparatus according to the first embodiment. The corresponding parts are denoted by the same reference numerals as in FIG. In the figure, reference numeral 60 denotes a peak estimating unit for estimating a peak position and a value of a correlation value which is obtained by the correlation value calculating unit 57 and is compared with a threshold value by the correlation value determining unit 58 and remains as a candidate. is there.

【0033】次に動作について説明する。ここで、図4
はこの参考例1による画像処理装置の処理の流れを示す
フローチャートであり、図5はこの参考例1によるピー
ク推定の原理をイメージ的に示した説明図である。この
場合も、ユーザは予めテンプレートデータ54を生成し
ておく。このテンプレートデータ54にはテンプレート
画像、相関値のしきい値、サーチ領域の範囲スタート座
標、画像サイズなどが含まれている。処理が開始される
と、上記実施の形態1の場合と同様にしてテンプレート
データがロードされ(ステップST61)、サーチ領域
を撮像した入力画像が画像メモリ53に入力される(ス
テップST62)。次に、その入力画像に対して数画素
ごとに、テンプレートデータ54内のテンプレート画像
との相関値が相関値計算部57で計算され(ステップS
T63)、その極大値を検出して(ステップST64)
しきい値との比較を相関値判定部58において行う(ス
テップST65)。比較の結果その座標での相関値が周
辺の相関値よりも高いとき、その近傍に真のピークが存
在する可能性があると判断して、それを対象物認識位置
の候補として残す(ステップST66)。全サーチ領域
について処理が終了すると、ピーク推定部60は周辺の
相関値と座標とを求め(ステップST67)、得られた
周辺の相関値と座標およびそれ自身の座標と相関値か
ら、ピークの位置と値を推定する(ステップST6
8)。
Next, the operation will be described. Here, FIG.
FIG. 5 is a flowchart showing the flow of processing of the image processing apparatus according to the first embodiment, and FIG. 5 is an explanatory diagram conceptually showing the principle of peak estimation according to the first embodiment. Also in this case, the user generates the template data 54 in advance. The template data 54 includes a template image, a threshold value of a correlation value, a start coordinate of a search area, an image size, and the like. When the process is started, template data is loaded in the same manner as in the first embodiment (step ST61), and an input image of the search area is input to the image memory 53 (step ST62). Next, the correlation value of the input image with the template image in the template data 54 is calculated by the correlation value calculation unit 57 for every several pixels (Step S).
T63), the maximum value is detected (step ST64)
The comparison with the threshold value is performed in the correlation value determination section 58 (step ST65). As a result of the comparison, when the correlation value at that coordinate is higher than the surrounding correlation value, it is determined that there is a possibility that a true peak exists in the vicinity thereof, and it is left as a candidate for the object recognition position (step ST66). ). When the processing is completed for all the search areas, the peak estimating unit 60 obtains the peripheral correlation values and coordinates (step ST67), and determines the peak position from the obtained peripheral correlation values and coordinates, and the own coordinates and correlation values. And a value (step ST6)
8).

【0034】このピークの推定はX軸、Y軸ごとに行な
う。X軸について図中5に基づいて説明する。今、ある
座標(図5ではsO)ではその左右の相関値よりも高い
のでsOはピークの近くにあるとする。次にs_min
us1とs_plus1を比較してs_minus1の
方が大きいので、s_minus2を求め、その4点の
座標と相関値からピークを推定する。Y軸方向について
も同様に推定する。推定の結果、ピークの推定座標が範
囲を越えたり、ピークの相関値が負になったときは推定
不可なピークなので候補から外し(ステップST6
9)、適当なもののみを認識結果記録部59にて記録す
る(ステップST70)。
The estimation of the peak is performed for each of the X axis and the Y axis. The X axis will be described with reference to 5 in the figure. Now, at a certain coordinate (sO in FIG. 5), it is assumed that sO is near the peak since it is higher than the correlation value on the left and right. Next, s_min
Since us1 and s_plus1 are compared and s_minus1 is larger, s_minus2 is obtained, and a peak is estimated from the coordinates of the four points and the correlation value. The estimation is similarly performed in the Y-axis direction. As a result of the estimation, when the estimated coordinate of the peak exceeds the range or the correlation value of the peak becomes negative, the peak cannot be estimated and is excluded from the candidates (step ST6).
9) Record only appropriate ones in the recognition result recording unit 59 (step ST70).

【0035】なお、上記参考例では2直線の交点からピ
ーク推定を行なったが、近傍3点または4点の相関値を
用いてラグランジェ補間法で2次または3次の曲線当て
はめを行ない、ピークを求めるようにしてもよい。
In the above reference example, the peak was estimated from the intersection of the two straight lines. However, a quadratic or cubic curve was applied by Lagrange interpolation using the correlation values of three or four neighboring points to obtain a peak. May be obtained.

【0036】[0036]

【発明の効果】以上のように、この発明によれば、サー
チ領域を撮像した入力画像に対してテンプレートの大き
さと同じ領域内の分散値の和を計算して対象物の存在を
判定するように構成したので、その値から対象物が存在
する候補点を絞り込むことが可能となり、全ての領域の
相関値を計算しなくてもよくなるので、処理の時間を短
縮できるという効果があり、特に背景が一様で対象物だ
けが設置してあるサーチ画像でのサーチ時間を大きく短
縮することができ、さらに分散値によって対象物が存在
しない位置を検出するので、信頼性の高い認識が行なえ
るという効果がある。
As described above, according to the present invention, the presence of an object is determined by calculating the sum of the variance values in the same area as the size of the template for the input image obtained by capturing the search area. Since it is possible to narrow down the candidate points where the object is present from the values, and it is not necessary to calculate the correlation values of all the regions, there is an effect that the processing time can be shortened, and especially the background Can greatly reduce the search time for search images in which only the target object is installed, and detect the position where the target object does not exist based on the variance value, so that highly reliable recognition can be performed. effective.

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

【図1】 この発明の実施の形態1による画像処理装置
の構成を示す図である。
FIG. 1 is a diagram showing a configuration of an image processing device according to a first embodiment of the present invention.

【図2】 実施の形態1による画像処理装置における処
理の流れを示すフローチャートである。
FIG. 2 is a flowchart showing a flow of processing in the image processing apparatus according to the first embodiment.

【図3】 この発明の参考例1による画像処理装置の構
成を示す図である。
FIG. 3 is a diagram illustrating a configuration of an image processing apparatus according to Embodiment 1 of the present invention;

【図4】 参考例1による画像処理装置における処理の
流れを示すフローチャートである。
FIG. 4 is a flowchart illustrating a flow of processing in the image processing apparatus according to the first embodiment.

【図5】 参考例1におけるピーク検出の原理を示す説
明図である。
FIG. 5 is an explanatory diagram illustrating the principle of peak detection in Reference Example 1.

【図6】 従来の基本的なテンプレートマッチング方式
を示す概念図である。
FIG. 6 is a conceptual diagram showing a conventional basic template matching method.

【図7】 従来の粗精サーチ法を示す概念図である。FIG. 7 is a conceptual diagram showing a conventional coarse / fine search method.

【図8】 従来の粗精サーチによる高速化効果を示す説
明図である。
FIG. 8 is an explanatory diagram showing a speed-up effect by a conventional coarse / fine search.

【図9】 従来の画像処理装置によるテンプレートマッ
チング法を示す説明図である。
FIG. 9 is an explanatory diagram showing a template matching method by a conventional image processing apparatus.

【図10】 従来の他の画像処理装置を示す構成図であ
る。
FIG. 10 is a configuration diagram showing another conventional image processing apparatus.

【図11】 従来のさらに他の画像処理装置を示す構成
図である。
FIG. 11 is a configuration diagram showing still another conventional image processing apparatus.

【図12】 従来のさらに他の画像処理装置におけるピ
クセルの精度を求める方法を示すフローチャートであ
る。
FIG. 12 is a flowchart illustrating a method for obtaining pixel accuracy in still another conventional image processing apparatus.

【符号の説明】 40 対象物、41 画像入力部、53 画像メモリ、
54 テンプレートデータ、55 分散値計算部、56
分散値判定部、57 相関値計算部、58相関値判定
部、59 認識結果記録部。
[Description of Signs] 40 objects, 41 image input unit, 53 image memory,
54 template data, 55 variance calculator, 56
A variance value determination unit, 57 a correlation value calculation unit, 58 a correlation value determination unit, 59 a recognition result recording unit;

───────────────────────────────────────────────────── フロントページの続き (72)発明者 橋本 学 尼崎市塚口本町8丁目1番1号 三菱電機 株式会社産業システム研究所内 Fターム(参考) 5L096 AA06 FA33 FA34 JA03 JA09 JA11 JA26  ────────────────────────────────────────────────── ─── Continuation of the front page (72) Inventor Manabu Hashimoto 8-1-1, Tsukaguchi-Honmachi, Amagasaki-shi F-term (reference) 5L096 AA06 FA33 FA34 JA03 JA09 JA11 JA26

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 予め用意されたテンプレートデータを用
いたテンプレートマッチング法によって認識を行う画像
処理装置において、 入力された原画像の上記テンプレートデータ中のテンプ
レート画像と同じ領域内の分散値を演算する分散値計算
部と、 上記分散値計算部によって求められた分散値としきい値
との比較によって対象物が存在するか否かの判定を行う
分散値判定部とを備えたことを特徴とする画像処理装
置。
An image processing apparatus for performing recognition by a template matching method using template data prepared in advance, wherein a variance for calculating a variance value of an input original image in the same area as the template image in the template data is provided. Image processing, comprising: a value calculation unit; and a variance value determination unit that determines whether an object is present by comparing the variance value obtained by the variance value calculation unit with a threshold value. apparatus.
JP2001123351A 2001-04-20 2001-04-20 Image processing device Expired - Fee Related JP3464463B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001123351A JP3464463B2 (en) 2001-04-20 2001-04-20 Image processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001123351A JP3464463B2 (en) 2001-04-20 2001-04-20 Image processing device

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP27097793A Division JP3212777B2 (en) 1993-10-28 1993-10-28 Image processing device

Publications (2)

Publication Number Publication Date
JP2001297325A true JP2001297325A (en) 2001-10-26
JP3464463B2 JP3464463B2 (en) 2003-11-10

Family

ID=18972922

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001123351A Expired - Fee Related JP3464463B2 (en) 2001-04-20 2001-04-20 Image processing device

Country Status (1)

Country Link
JP (1) JP3464463B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2831304A1 (en) * 2001-10-23 2003-04-25 St Microelectronics Sa Method for detecting a motif within a digital image, whereby the image is compared by comparing a current and a reference window, containing a reference motif image, with the images divided into similarly sized pixel sub-blocks

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2831304A1 (en) * 2001-10-23 2003-04-25 St Microelectronics Sa Method for detecting a motif within a digital image, whereby the image is compared by comparing a current and a reference window, containing a reference motif image, with the images divided into similarly sized pixel sub-blocks
EP1306796A1 (en) * 2001-10-23 2003-05-02 STMicroelectronics S.A. Detection of a pattern in a digital image
US7116824B2 (en) 2001-10-23 2006-10-03 Stmicroelectronics S.A. Detection of a pattern in a digital image

Also Published As

Publication number Publication date
JP3464463B2 (en) 2003-11-10

Similar Documents

Publication Publication Date Title
JP3212777B2 (en) Image processing device
US8019164B2 (en) Apparatus, method and program product for matching with a template
US8422759B2 (en) Image processing method and image processing device
Wang et al. Flank wear measurement by a threshold independent method with sub-pixel accuracy
US7340089B2 (en) Geometric pattern matching using dynamic feature combinations
JP3308617B2 (en) Apparatus and method for detecting motion vector
CN113160161A (en) Method and device for detecting defects at edge of target
JP6197340B2 (en) Image processing apparatus, image processing method, and program
JP6177541B2 (en) Character recognition device, character recognition method and program
CN114936997A (en) Detection method, detection device, electronic equipment and readable storage medium
JP2002269545A (en) Face image processing method and face image processing device
JP3464463B2 (en) Image processing device
JP3447716B2 (en) Image processing device
US9582733B2 (en) Image processing device, image processing method, and image processing program
JP2018109824A (en) Electronic control device, electronic control system, and electronic control method
JP3872061B2 (en) Image processing device
CN111563883B (en) Screen vision positioning method, positioning equipment and storage medium
JP3447717B2 (en) Image processing device
JP3679958B2 (en) License plate recognition device
JP2001052183A (en) Image processor
JP2710685B2 (en) Defect detection method by visual inspection
CN109145899B (en) Automobile instrument pointer extraction method
JP2001195597A (en) Image processor
JP3041056B2 (en) Semiconductor pellet detection method
JPH07192134A (en) Image processing method

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20070822

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20080822

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20080822

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20090822

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20090822

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20100822

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20110822

Year of fee payment: 8

LAPS Cancellation because of no payment of annual fees