[go: up one dir, main page]

JP2004362186A - Template matching method and apparatus - Google Patents

Template matching method and apparatus Download PDF

Info

Publication number
JP2004362186A
JP2004362186A JP2003158774A JP2003158774A JP2004362186A JP 2004362186 A JP2004362186 A JP 2004362186A JP 2003158774 A JP2003158774 A JP 2003158774A JP 2003158774 A JP2003158774 A JP 2003158774A JP 2004362186 A JP2004362186 A JP 2004362186A
Authority
JP
Japan
Prior art keywords
matching
template
image
resolution image
low
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
JP2003158774A
Other languages
Japanese (ja)
Inventor
Yoshiaki Abe
好晃 安部
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.)
Juki Corp
Original Assignee
Juki 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 Juki Corp filed Critical Juki Corp
Priority to JP2003158774A priority Critical patent/JP2004362186A/en
Publication of JP2004362186A publication Critical patent/JP2004362186A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Image Analysis (AREA)

Abstract

【課題】ピラミッド構造データを使用したテンプレートマッチングを高速化することが可能な方法及び装置を提供する。
【解決手段】対象物の低解像度の画像11cとそのテンプレート画像11c’とのマッチング演算を開始し(状態A)、所定のマッチング結果が得られたときに(状態C)、高解像度の画像11bとそのテンプレート11b’とのマッチング演算も開始し、両マッチング演算を並列させてテンプレートマッチングを行う(状態D)。このような構成では、解像度の低い画像に対する下位の階層でのマッチングにおいて、所定値以上の相関値が得られマッチングが成功すると、その階層でのマッチングを続けながら、それより解像度の高い画像に対する上位の階層でのマッチングも並列して行うことができ、下位の階層でのマッチングの終了を待って上位の階層でのマッチングを開始するのに比較して、高速なテンプレートマッチングが可能となる。
【選択図】 図4
A method and an apparatus capable of speeding up template matching using pyramid structure data are provided.
A matching operation between a low-resolution image of an object and a template image thereof is started (state A), and when a predetermined matching result is obtained (state C), a high-resolution image 11b is obtained. And the template 11b 'is started, and both matching operations are performed in parallel to perform template matching (state D). In such a configuration, when a correlation value equal to or more than a predetermined value is obtained in matching at a lower hierarchical level for an image with a lower resolution and matching is successful, matching at a higher resolution is performed for an image with a higher resolution while continuing matching at the hierarchical level. Can be performed in parallel, and template matching can be performed at a higher speed as compared with waiting for the end of matching in a lower layer and starting matching in an upper layer.
[Selection diagram] Fig. 4

Description

【0001】
【発明の属する技術分野】
本発明は、テンプレートマッチング方法及び装置、さらに詳細には、対象物の低解像度の画像と高解像度の画像を、それぞれ低解像度画像用テンプレートと高解像度画像用テンプレートを用いてテンプレートマッチングを行う、ピラミッド構造データを使用したテンプレートマッチング方法及び装置に関する。
【0002】
【従来の技術】
従来から、フィーダーから供給される部品をヘッド部で吸着し、その部品を所定の基板上に搭載する部品実装機が知られている。このような部品実装機では、吸着した部品をCCDカメラで撮影し、その画像を処理して部品の位置(姿勢)を認識し、部品位置の補正をしてから搭載を行い、搭載精度を向上させている。このような部品の認識のために、撮影された画像の中から部品の画像がどの位置にあるかを知るために、撮影画像全体に対してテンプレート画像(部品の基準画像)を1画素づつずらしながらテンプレート画像と撮影画像との対応領域の相関値を計算してマッチングを行なうテンプレートマッチングが知られている。
【0003】
このようなテンプレートマッチングでは膨大な計算量が必要となり、多大な処理時間を要するので、処理を高速化する方法として、ピラミッド構造データを用いたテンプレートマッチング方法が知られている。この方法は、撮影画像とテンプレート画像を縮小し、縮小された画像間においてテンプレートマッチングを実行することによりおおまかなマッチング位置を求め、その後、順に縮小率を下げながら、前の処理で求めたマッチング位置によりその近傍に限定された領域内で詳細なテンプレートマッチングを行なうものであり、例えば、原画像に対して解像度を落とした解像度の異なる画像を複数用意し、一番解像度の低い画像からテンプレート画像でマッチングして、所定のしきい値以上の一致度を持つ候補点を複数見つけ、次に二番目に解像度の低い画像で前回の候補点付近をマッチングして、ここでも所定のしきい値以上の複数の候補点を見つけ、これを繰り返して最終的に原画像で候補点付近をマッチングして一致度の一番高い点をマッチング結果としている(特許文献1)。
【0004】
【特許文献1】
特開平10−21389号公報(請求項1)
【0005】
【発明が解決しようとする課題】
しかしながら、従来のピラミッド構造データを用いたテンプレートマッチング方法では、マッチング演算モジュールが1つしかないために、1枚の画像に対して画像全体をマッチングし終わらないと、次に解像度の高い画像の候補点を探せないため、高速化ができない、という問題があった。
【0006】
本発明は、このような問題点を解決するためになされたもので、簡単な構成でピラミッド構造データを使用したテンプレートマッチングを高速化することか可能なテンプレートマッチング方法及び装置を提供することを課題とする。
【0007】
【課題を解決するための手段】
本発明は、上記課題を解決するために、
対象物の低解像度の画像と高解像度の画像を、それぞれ低解像度画像用テンプレートと高解像度画像用テンプレートを用いてテンプレートマッチングを行うテンプレートマッチング方法において、
低解像度画像用テンプレートによるマッチング演算を開始し、
前記マッチング演算から所定のマッチング演算結果が得られたときに、高解像度画像用テンプレートによるマッチング演算を開始し、その後、低解像度画像用テンプレートと高解像度画像用テンプレートによる両マッチング演算を並列して行いテンプレートマッチングする構成を採用している。
【0008】
また、本発明では、
対象物の低解像度の画像と高解像度の画像を、それぞれ低解像度画像用テンプレートと高解像度画像用テンプレートを用いてテンプレートマッチングを行うテンプレートマッチング装置において、
低解像度画像用テンプレートによるマッチング演算を行う低解像度画像用マッチング演算手段と、
高解像度画像用テンプレートによるマッチング演算を行う高解像度画像用マッチング演算手段と、
前記低解像度画像用マッチング演算手段によるマッチング演算から所定のマッチング演算結果が得られたときに、高解像度画像用マッチング演算手段を起動し、低解像度画像用テンプレートと高解像度画像用テンプレートによる両マッチング演算が並列して行われるように、低解像度画像用マッチング演算手段と高解像度画像用マッチング演算手段を制御するマッチング制御手段とを備える構成も採用している。
【0009】
このような構成では、低解像度の画像に対するマッチングが成功すると、そのマッチングを継続させながら、それより高解像度の画像に対するマッチングも並列して行われるので、ピラミッド構造データを使用するテンプレートマッチングを高速化することが可能となる。
【0010】
【発明の実施の形態】
以下、図面に示す実施の形態に基づいて本発明を詳細に説明する。
【0011】
図1には、対象物11を、CCDカメラ10で撮像し、その対象物の画像を認識する画像認識回路12が図示されている。対象物11は、例えば、部品供給装置から供給され部品実装機で基板上に搭載される電子部品であるが、このような電子部品に限定されず、工場における組み立てや検査工程で組み立てられ、あるいは検査される部品など、カメラなどで撮影されその位置が認識される対象物など一般的な対象物も含むものである。
【0012】
画像認識回路12は、CCDカメラ10で撮影された対象物の画像を圧縮する画像圧縮回路17、対象物11の画像並びに圧縮された画像を格納する画像メモリ13、対象物の基準画像となるテンプレート画像を格納するテンプレートメモリ14、テンプレートによるマッチング演算を行うマッチング演算モジュール(マッチング演算手段)15、それにマッチング演算モジュール15を制御するマッチングコントローラ(マッチング制御手段)16などから構成される。
【0013】
画像認識回路12の詳細な構成が図2に図示されており、本発明では、ピラミッド構造データを用いたテンプレートマッチングを行うので、カメラ10で取り込んだ対象物の画像が、画像圧縮回路17を用いて圧縮され、例えば、1/4と1/16の圧縮画像が形成されて、それが画像メモリ13に格納される。そのために、画像メモリ13は、カメラ10から入力された対象物の原画像(非圧縮画像)を格納する画像メモリ13aと、面積比で1/4に圧縮した原画像より解像度の低い画像を格納する画像メモリ13bと、原画像並びに1/4圧縮画像より解像度の低い、面積比で1/16に圧縮した画像を格納する画像メモリ13cから構成されている。
【0014】
原画像、1/4圧縮画像、それに1/16圧縮画像は、ピラミッド構造データとなり、それに対応して原画像のテンプレート画像を格納するテンプレートメモリ14a、原画像のテンプレート画像を1/4に圧縮して得られるテンプレート画像を格納するテンプレートメモリ14b、原画像のテンプレート画像を1/16に圧縮して得られるテンプレート画像を格納するテンプレートメモリ14cが設けられ、また、マッチング演算モジュール15も、原画像に対してマッチング演算を行うマッチング演算モジュール15a、1/4圧縮画像に対してマッチング演算を行うマッチング演算モジュール15b、1/16圧縮画像に対してマッチング演算を行うマッチング演算モジュール15cが設けられる。
【0015】
マッチングコントローラ16は、各マッチング演算モジュール15a〜15cにマッチング命令を出力し、各マッチング演算モジュールからのマッチング結果を受信し各マッチング演算モジュールを制御する。マッチング演算モジュール15a〜15cは、マッチングコントローラ16からの演算命令によって、画像メモリ13a〜13c、テンプレートメモリ14a〜14cを参照してマッチング演算を行い、演算結果をマッチングコントローラ16に返す。
【0016】
このような構成により、ピラミッド構造の階層化が行われ、画像メモリ13a、テンプレートメモリ14a、マッチング演算モジュール15aにより階層1が形成され、画像メモリ13b、テンプレートメモリ14b、マッチング演算モジュール15bにより階層2が形成され、画像メモリ13c、テンプレートメモリ14c、マッチング演算モジュール15cにより階層3が形成される。
【0017】
以下、図2に示すマッチング装置の構成で、ピラミッド構造データを使用するマッチングがどのように行われるかを説明する。
【0018】
以下の説明中でマッチングコントローラ16は、各階層1〜3でのマッチングが開始されたらそのマッチング範囲が終了するまで、その階層のマッチング演算モジュール15a〜15cに演算命令を出力するものとする。
【0019】
また、画像メモリ13aには、図4に示したように、円形な対象物11の原画像11a、それにごみなどの異物の画像20aが撮像されて各画像が格納されており、また画像メモリ13b、13cには、その1/4、1/16に圧縮された対象物の画像11b、11c並びに異物の画像20b、20cが格納されているとする。また、テンプレートメモリ14a〜14cには、対象物11の各圧縮率に対応した基準画像(テンプレート画像)11a’〜11c’が格納されているとする。
【0020】
まず、マッチングコントローラ16は、図3のステップS1において、一番解像度の低い階層3でマッチングを開始するようにマッチング演算モジュール15cに命令を出力する。これにより、画像メモリ13cに格納されている1/16に圧縮された一番解像度の低い画像と、テンプレートメモリ14cに格納されている1/16圧縮の低解像度画像用テンプレート(画像)とのマッチングが開始され、マッチング演算モジュール15cにより、このテンプレートによるマッチング演算が開始される。
【0021】
階層3でのテンプレートマッチングは、テンプレートメモリ14cでの画像11c’を含む全画像領域をマッチング枠(テンプレート)30として、このマッチング枠30を、画像メモリ13c上で移動させてマッチング演算を行うことになるので、ステップS1でマッチングが開始されると、図4の状態Aで示したように、マッチング枠30の左上角が画像メモリ13cの左上角に合わせた状態から、マッチング枠が画素ごとに右方向に移動され、そのラインの移動が終わると、マッチング枠が次のラインに沿って画素ごとに移動し、その動作を繰り返してマッチング枠がメモリ画像の終端まで移動したときにマッチング演算が終了する。
【0022】
このようなマッチング枠の移動ごとに、マッチング演算モジュール15cは、テンプレート画像11c’と対象物の画像11cとのマッチング演算を行い、マッチング演算結果(相関値)を出力する。所定のマッチング演算結果が得られない場合には、ステップS2の判断が否定され、ステップS6に進む。ここでは、まだ所定のマッチング演算結果が得られていないので、そのステップS6の判断が否定され、またステップS8の判断も否定されるので、階層3でのマッチング演算が継続される。例えば、異物の画像20cがスキャンされても所定の相関値が得られないので、状態Bのように、階層3でのマッチングが継続する。
【0023】
マッチングが進んで、図4の状態Cのように、マッチング枠30が中央位置に進み、テンプレート画像11c’と対象物の画像11cがほぼ一致するようになると、相関値が所定のしきい値より大きくなり、所定のマッチング演算結果が得られるので、ステップS2の判断が肯定される。このとき、階層2でのマッチングはまだ行われていないので、ステップS3の判断が否定され、ステップS4で階層2でのマッチングが開始される。この状態が図4の状態Dに図示されている。
【0024】
階層2でのマッチング開始時のマッチング枠30’(テンプレートメモリ14bの全画像領域に対応し、階層2でのテンプレートとなる)の位置は、マッチング枠30’の左上角が画像メモリ13bの左上角と一致する初期位置ではなく、所定の画素並びにライン分進んだ位置に設定される。具体的には、階層3でのマッチング演算結果が所定のしきい値以上になる状態Cでのマッチング枠30の位置に対応するマッチング枠30’の位置より所定画素分左並びに上に戻った位置で、初期位置までは戻らない位置に設定される(階層2の状態D)。
【0025】
状態Dからは、マッチングコントローラ16は、マッチング演算モジュール15cのほかに、マッチング演算モジュール15bにもマッチング演算命令を出力するので(ステップS4)、テンプレートメモリ14cに格納された低解像度画像用テンプレートと、テンプレートメモリ14bに格納されたそれより高解像度画像用テンプレートによる両マッチング演算が並列して行われ、階層3と2でのマッチングが並列して行われるようになる。この階層2でのマッチングの流れがステップS11からS18で図示されており、各ステップは階層3でのステップS1からS18に対応している。
【0026】
階層3と2でマッチングが並列して行われている過程で、さらに、階層3でのマッチング演算結果が所定のしきい値以上になると、ステップS2、S3の判断が肯定され、ステップS5でマッチング演算結果が保存される。このとき、マッチングコントローラ16は、階層2でのマッチング演算が終了するまで、階層3でのマッチングを中断するように、マッチング演算モジュール15cを制御する。
【0027】
階層2でのマッチングが終了すると、マッチング演算モジュール15bが未使用となり、このとき上記マッチング演算結果が保存されているので、ステップS6の判断が肯定され、マッチングコントローラ16は、再びマッチング演算モジュール15bに演算命令を出力し、保存してある階層3でのマッチング演算結果に基づき階層2でのマッチング演算を再開させ、保存されているマッチング演算結果をクリアする(ステップS7)。この階層2でのマッチング再開位置は、保存したマッチング演算結果に依存し、所定のマッチング演算結果が得られたときのマッチング枠30の位置に対応するマッチング枠30’の位置より所定画素分左並びに上に戻った位置で、最初のマッチング枠30’のマッチング開始位置(図4の状態Dで示したマッチング枠30’の位置)までは戻らない位置に設定される。その後は、上述したような階層3と2での並列したマッチング演算が行われる。
【0028】
このように、解像度の低い階層でのマッチング演算結果が再度所定のしきい値以上になる場合には、解像度の高い階層でのマッチングが再度行われるので、より確実なテンプレートマッチングが可能となる。
【0029】
一番解像度の低い階層3(画像圧縮率1/16)と次に解像度の高い階層2(画像圧縮率1/4)でのマッチングの関係は、階層2とそれより解像度の高い階層1(画像圧縮率1/1で原画像)でのマッチングとの関係と同じであり、階層2で所定のマッチング演算結果が得られると、マッチングコントローラ16は、マッチング演算モジュール15aにも演算命令を出力するので(ステップS14)、階層3、2、1での3つのマッチング演算が並列して行われる。また、階層2で再度所定のマッチング演算結果が得られた場合に、階層1でのマッチングが階層2でのマッチング結果に基づき再開されることも、同様である。この階層1でのマッチングの流れが、図3でステップS21〜S24で図示されている。
【0030】
階層1では、それより高い解像度の階層がないので、マッチング演算結果が所定のしきい値以上になるまで、ループが繰り返される。なお、ステップS23では、マッチング演算結果が保存されるが、ループの過程で、複数回マッチング演算結果が所定のしきい値以上になる場合は、そのうち一番相関値が高いものをマッチング演算結果として上書き保存するようにする。最終的に、階層1で最も高い相関値が得られたときのテンプレートの位置が、撮像した対象物が存在する位置(エリア)とされる。
【0031】
このように複数のマッチング演算モジュールをマッチングコントローラで制御することによって、一番解像度の低い階層(3)でマッチングを行いながら、上位の階層(2、1)でのマッチングも平行して行うことが可能になる。
【0032】
上述した実施形態では、画像圧縮比は、1/1、1/4、1/16の3種類で、3階層であったが、2種類、あるいは3種類以上の圧縮比の画像を生成し、それに対応した複数の階層でのマッチング演算を行うことも可能である。マッチングコントローラ16は、例えばCPU、DSP、あるいはコントローラ専用回路で構成され、またマッチング演算モジュール15a〜15cも、同様に、CPU、DSP、あるいはマッチング専用回路で構成される。
【0033】
また、上述した実施形態では、各メモリ13a〜13c、14a〜14cがそれぞれ単独に存在しているが、マッチング演算モジュールからのメモリアクセスがマッチング演算モジュールの処理より十分に高速ならば、図5に示すように、一つの画像メモリ40、一つのテンプレートメモリ41を設け、画像メモリ40を3つに細分して、各階層1〜3用の画像を格納する画像メモリ40a〜40cとし、またテンプレートメモリ41も3分割して、各階層1〜3用のテンプレートメモリ41a〜41cとすることもできる。この時、メモリにアクセスできるバスは1つなので、複数のマッチング演算モジュールから同時にメモリアクセスされた時にバスを制御するバスコントローラ43、44を設けるようにする。
【0034】
図5のような構成であれば、1つの階層のマッチングに全てのマッチング演算モジュールを使用するようにマッチングコントローラで制御して、各階層のマッチングを順次実行することで高速化を図ることも可能である。
【0035】
【発明の効果】
以上説明したように、本発明では、解像度の低い画像に対する下位の階層でのマッチングを開始し、その階層で所定値以上の相関値が得られマッチングが成功すると、その階層でのマッチングを続けながら、それより解像度の高い画像に対する上位の階層でのマッチングも並列して行うことができ、下位の階層でのマッチングの終了を待って上位の階層でのマッチングを開始するのに比較して、高速なテンプレートマッチングが可能となる。
【図面の簡単な説明】
【図1】テンプレートマッチング装置の構成を示したブロック図である。
【図2】テンプレートマッチング装置の詳細な構成を示したブロック図である。
【図3】ピラミッド構造データを用いてテンプレートマッチングを行う流れを示したフローチャートである。
【図4】ピラミッド構造データを用いてテンプレートマッチングを行う流れを示した説明図である。
【図5】テンプレートマッチング装置の他の実施形態の詳細な構成を示したブロック図である。
【符号の説明】
10 CCDカメラ
11 対象物
13 画像メモリ
14 テンプレートメモリ
15 マッチング演算モジュール
16 マッチングコントローラ
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention provides a template matching method and apparatus, and more particularly, a pyramid that performs template matching of a low-resolution image and a high-resolution image of an object using a low-resolution image template and a high-resolution image template, respectively. The present invention relates to a template matching method and apparatus using structure data.
[0002]
[Prior art]
2. Description of the Related Art Conventionally, there has been known a component mounter that sucks a component supplied from a feeder by a head unit and mounts the component on a predetermined substrate. In such a component mounter, the picked-up component is photographed with a CCD camera, and the image is processed to recognize the position (posture) of the component, correct the component position, and mount the component, thereby improving the mounting accuracy. Let me. For such component recognition, the template image (component reference image) is shifted by one pixel with respect to the entire captured image in order to know the position of the component image in the captured image. Meanwhile, there is known template matching in which a correlation value of a corresponding region between a template image and a captured image is calculated and matching is performed.
[0003]
Such a template matching requires an enormous amount of calculation and a large amount of processing time. Therefore, a template matching method using pyramid structure data is known as a method for speeding up the processing. In this method, a captured image and a template image are reduced, a rough matching position is obtained by performing template matching between the reduced images, and then the matching position obtained in the previous process is sequentially reduced while sequentially reducing the reduction ratio. Performs detailed template matching within an area limited to the vicinity of the original image.For example, a plurality of images with different resolutions lower than the original image are prepared, and the image with the lowest resolution is used as a template image. By matching, find a plurality of candidate points having a matching degree equal to or more than a predetermined threshold value, and then match the vicinity of the previous candidate point with an image having the second lowest resolution, and here again, Find multiple candidate points, repeat this, and finally match the candidate points in the original image and map the point with the highest matching score. It is a bridging result (Patent Document 1).
[0004]
[Patent Document 1]
JP-A-10-21389 (Claim 1)
[0005]
[Problems to be solved by the invention]
However, in the conventional template matching method using the pyramid structure data, since there is only one matching operation module, if the entire image is not matched with one image, a candidate for the next highest resolution image is obtained. There was a problem that the speed could not be increased because a point could not be found.
[0006]
The present invention has been made to solve such a problem, and an object of the present invention is to provide a template matching method and apparatus capable of speeding up template matching using pyramid structure data with a simple configuration. And
[0007]
[Means for Solving the Problems]
The present invention has been made in order to solve the above problems.
In a template matching method for performing template matching of a low-resolution image and a high-resolution image of an object using a low-resolution image template and a high-resolution image template, respectively,
Start matching operation with low resolution image template,
When a predetermined matching operation result is obtained from the matching operation, the matching operation using the high-resolution image template is started, and then both the matching operations using the low-resolution image template and the high-resolution image template are performed in parallel. A configuration that performs template matching is adopted.
[0008]
In the present invention,
In a template matching device that performs template matching using a low-resolution image template and a high-resolution image template for a low-resolution image and a high-resolution image of an object,
A low-resolution image matching calculation unit that performs a matching calculation using the low-resolution image template;
A high-resolution image matching operation unit that performs a matching operation using the high-resolution image template;
When a predetermined matching operation result is obtained from the matching operation by the low-resolution image matching operation unit, the high-resolution image matching operation unit is activated, and both the matching operations by the low-resolution image template and the high-resolution image template are performed. , A matching control means for controlling the low-resolution image matching calculation means and the high-resolution image matching calculation means is adopted.
[0009]
In such a configuration, if matching for a low-resolution image succeeds, matching for a higher-resolution image is performed in parallel while continuing the matching, so that template matching using pyramid structure data is accelerated. It is possible to do.
[0010]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, the present invention will be described in detail based on embodiments shown in the drawings.
[0011]
FIG. 1 illustrates an image recognition circuit 12 that captures an image of an object 11 with a CCD camera 10 and recognizes an image of the object. The target object 11 is, for example, an electronic component supplied from a component supply device and mounted on a substrate by a component mounter, but is not limited to such an electronic component, and is assembled in a factory assembly or inspection process, or It also includes general objects such as parts to be inspected, such as objects that are photographed by a camera or the like and whose position is recognized.
[0012]
The image recognition circuit 12 includes an image compression circuit 17 for compressing an image of the object captured by the CCD camera 10, an image memory 13 for storing the image of the object 11 and the compressed image, and a template serving as a reference image of the object. It comprises a template memory 14 for storing images, a matching operation module (matching operation means) 15 for performing a matching operation based on the template, and a matching controller (matching control means) 16 for controlling the matching operation module 15.
[0013]
A detailed configuration of the image recognition circuit 12 is shown in FIG. 2. In the present invention, template matching using pyramid structure data is performed, so that an image of an object captured by the camera 10 is used by the image compression circuit 17. Then, compressed images of, for example, 1/4 and 1/16 are formed and stored in the image memory 13. For this purpose, the image memory 13 stores an original image (uncompressed image) of the object input from the camera 10 and an image having a lower resolution than the original image compressed to 1/4 in area ratio. And an image memory 13c for storing an original image and an image having a lower resolution than the 1/4 compressed image and compressed to an area ratio of 1/16.
[0014]
The original image, the 1/4 compressed image, and the 1/16 compressed image become pyramid-structured data. Correspondingly, a template memory 14a for storing the template image of the original image, the template image of the original image is compressed to 1/4. And a template memory 14c for storing a template image obtained by compressing the template image of the original image to 1/16, and a matching operation module 15 for storing the template image in the original image. A matching operation module 15a that performs a matching operation on the 、 compressed image, a matching operation module 15b that performs a matching operation on the 圧 縮 compressed image, and a matching operation module 15c that performs a matching operation on the 1/16 compressed image are provided.
[0015]
The matching controller 16 outputs a matching command to each of the matching operation modules 15a to 15c, receives a matching result from each of the matching operation modules, and controls each of the matching operation modules. The matching calculation modules 15a to 15c perform a matching calculation with reference to the image memories 13a to 13c and the template memories 14a to 14c according to a calculation command from the matching controller 16, and return a calculation result to the matching controller 16.
[0016]
With such a configuration, the pyramid structure is hierarchized, and the image memory 13a, the template memory 14a, and the matching operation module 15a form the layer 1, and the image memory 13b, the template memory 14b, and the matching operation module 15b form the layer 2. The layer 3 is formed by the image memory 13c, the template memory 14c, and the matching operation module 15c.
[0017]
Hereinafter, how the matching using the pyramid structure data is performed in the configuration of the matching device illustrated in FIG. 2 will be described.
[0018]
In the following description, it is assumed that the matching controller 16 outputs a calculation command to the matching calculation modules 15a to 15c of each layer, when the matching in each layer 1 to 3 starts, until the matching range ends.
[0019]
As shown in FIG. 4, an original image 11a of the circular object 11 and an image 20a of a foreign substance such as dust are captured and stored in the image memory 13a. , 13c store the images 11b and 11c of the object and the images 20b and 20c of the foreign matter, which have been compressed to 1/4 and 1/16, respectively. It is also assumed that reference images (template images) 11a 'to 11c' corresponding to the respective compression ratios of the object 11 are stored in the template memories 14a to 14c.
[0020]
First, in step S1 of FIG. 3, the matching controller 16 outputs an instruction to the matching operation module 15c to start matching at the lowest resolution layer 3. As a result, matching between the lowest resolution image compressed to 1/16 stored in the image memory 13c and the low resolution image template (image) of 1/16 compression stored in the template memory 14c is performed. Is started, and the matching calculation using the template is started by the matching calculation module 15c.
[0021]
The template matching at the third layer is performed by performing the matching operation by moving the entire matching image frame 30 including the image 11c 'in the template memory 14c as the matching frame (template) 30 on the image memory 13c. Therefore, when the matching is started in step S1, as shown in the state A of FIG. 4, the matching frame is shifted from the state where the upper left corner of the matching frame 30 is set to the upper left corner of the image memory 13c to the right for each pixel. When the movement of the line is completed, the matching frame moves for each pixel along the next line, and the operation is repeated, and the matching operation ends when the matching frame moves to the end of the memory image. .
[0022]
Each time such a matching frame moves, the matching calculation module 15c performs a matching calculation between the template image 11c 'and the image 11c of the target object, and outputs a matching calculation result (correlation value). If the predetermined matching calculation result cannot be obtained, the determination in step S2 is denied, and the process proceeds to step S6. Here, since a predetermined matching calculation result has not been obtained yet, the determination in step S6 is denied, and the determination in step S8 is also denied, so that the matching calculation in the hierarchy 3 is continued. For example, since a predetermined correlation value cannot be obtained even when the image 20c of the foreign substance is scanned, the matching in the layer 3 is continued as in the state B.
[0023]
When the matching is advanced and the matching frame 30 advances to the center position and the template image 11c 'substantially matches the image 11c of the target object as shown in a state C in FIG. 4, the correlation value becomes smaller than a predetermined threshold value. As the result becomes larger and a predetermined matching calculation result is obtained, the determination in step S2 is affirmed. At this time, since the matching in the hierarchy 2 has not been performed yet, the determination in step S3 is denied, and the matching in the hierarchy 2 is started in step S4. This state is illustrated in state D of FIG.
[0024]
The position of the matching frame 30 '(corresponding to the entire image area of the template memory 14b and serving as a template in the hierarchy 2) at the start of the matching in the layer 2 is such that the upper left corner of the matching frame 30' is the upper left corner of the image memory 13b. Is set at a position advanced by a predetermined number of pixels and lines, instead of the initial position that coincides with. Specifically, a position returned by a predetermined number of pixels to the left and above the position of the matching frame 30 ′ corresponding to the position of the matching frame 30 in the state C in which the matching calculation result in the hierarchy 3 is equal to or more than a predetermined threshold value Is set to a position that does not return to the initial position (state D of hierarchy 2).
[0025]
From the state D, the matching controller 16 outputs a matching calculation command to the matching calculation module 15b in addition to the matching calculation module 15c (step S4), so that the low-resolution image template stored in the template memory 14c Both matching operations using the high-resolution image template stored in the template memory 14b are performed in parallel, and matching in layers 3 and 2 is performed in parallel. The flow of the matching in the layer 2 is illustrated by steps S11 to S18, and each step corresponds to the steps S1 to S18 in the layer 3.
[0026]
If the result of the matching operation on the layer 3 becomes greater than or equal to a predetermined threshold value while the matching is performed in parallel on the layers 3 and 2, the determinations in steps S2 and S3 are affirmed, and the matching is performed in step S5. The calculation result is saved. At this time, the matching controller 16 controls the matching calculation module 15c so as to suspend the matching in the hierarchy 3 until the matching calculation in the hierarchy 2 ends.
[0027]
When the matching in the layer 2 is completed, the matching operation module 15b becomes unused. At this time, since the result of the matching operation is stored, the determination in step S6 is affirmed, and the matching controller 16 returns to the matching operation module 15b again. An operation instruction is output, and the matching operation in layer 2 is restarted based on the stored matching operation result in layer 3, and the stored matching operation result is cleared (step S7). The matching restart position in this layer 2 depends on the saved matching operation result, and a predetermined number of pixels to the left of the matching frame 30 'corresponding to the position of the matching frame 30 when the predetermined matching operation result is obtained. At the position returned to the upper side, the position is set so as not to return to the matching start position of the first matching frame 30 '(the position of the matching frame 30' shown in the state D in FIG. 4). After that, the above-described parallel matching operation in layers 3 and 2 is performed.
[0028]
As described above, when the result of the matching operation at the lower resolution layer becomes equal to or higher than the predetermined threshold value again, the matching at the higher resolution layer is performed again, so that more reliable template matching can be performed.
[0029]
The matching relationship between the lowest resolution layer 3 (image compression ratio 1/16) and the next highest resolution layer 2 (image compression ratio 1/4) is as follows: layer 2 and higher resolution layer 1 (image compression ratio). This is the same as the relationship with the matching in the original image (compression ratio 1/1), and when a predetermined matching calculation result is obtained in the layer 2, the matching controller 16 also outputs a calculation command to the matching calculation module 15a. (Step S14), three matching operations in layers 3, 2, and 1 are performed in parallel. Further, when a predetermined matching calculation result is obtained again in the hierarchy 2, the matching in the hierarchy 1 is restarted based on the matching result in the hierarchy 2. The flow of the matching in the layer 1 is illustrated in FIG. 3 by steps S21 to S24.
[0030]
In layer 1, there is no higher-resolution layer, so the loop is repeated until the matching calculation result becomes equal to or greater than a predetermined threshold. In step S23, the matching calculation result is stored. If the matching calculation result exceeds a predetermined threshold value a plurality of times in the loop, the one having the highest correlation value among them is determined as the matching calculation result. Overwrite and save. Finally, the position of the template when the highest correlation value is obtained in the layer 1 is set as the position (area) where the imaged target exists.
[0031]
By controlling the plurality of matching calculation modules by the matching controller in this manner, it is possible to perform matching at the lowest resolution (3) and also perform matching at the higher hierarchy (2, 1) in parallel. Will be possible.
[0032]
In the above-described embodiment, the image compression ratio is three types of 1/1, 1/4, and 1/16, and has three layers. However, images having two or three or more types of compression ratios are generated. It is also possible to perform a matching operation at a plurality of hierarchies corresponding thereto. The matching controller 16 is constituted by, for example, a CPU, a DSP, or a circuit dedicated to a controller, and the matching operation modules 15a to 15c are similarly constituted by a CPU, a DSP, or a circuit dedicated to matching.
[0033]
In the above-described embodiment, each of the memories 13a to 13c and 14a to 14c is independently provided. However, if the memory access from the matching operation module is sufficiently faster than the processing of the matching operation module, FIG. As shown, one image memory 40 and one template memory 41 are provided, and the image memory 40 is subdivided into three to form image memories 40a to 40c for storing images for each of the first to third layers. The template memory 41 can also be divided into three, and used as template memories 41a to 41c for the respective layers 1 to 3. At this time, since there is only one bus that can access the memory, the bus controllers 43 and 44 that control the bus when a plurality of matching operation modules simultaneously access the memory are provided.
[0034]
With the configuration as shown in FIG. 5, it is possible to control the matching controller so that all the matching calculation modules are used for matching of one layer, and to speed up by sequentially executing the matching of each layer. It is.
[0035]
【The invention's effect】
As described above, in the present invention, matching at a lower layer for an image with a low resolution is started, and if a correlation value equal to or more than a predetermined value is obtained at that layer and matching is successful, matching at that layer is continued. In addition, matching at a higher layer for an image with a higher resolution can be performed in parallel, which is faster than starting matching at a higher layer after waiting for matching at a lower layer. Template matching becomes possible.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a configuration of a template matching device.
FIG. 2 is a block diagram showing a detailed configuration of a template matching device.
FIG. 3 is a flowchart showing a flow of performing template matching using pyramid structure data.
FIG. 4 is an explanatory diagram showing a flow of performing template matching using pyramid structure data.
FIG. 5 is a block diagram showing a detailed configuration of another embodiment of the template matching apparatus.
[Explanation of symbols]
Reference Signs List 10 CCD camera 11 Object 13 Image memory 14 Template memory 15 Matching operation module 16 Matching controller

Claims (4)

対象物の低解像度の画像と高解像度の画像を、それぞれ低解像度画像用テンプレートと高解像度画像用テンプレートを用いてテンプレートマッチングを行うテンプレートマッチング方法において、
低解像度画像用テンプレートによるマッチング演算を開始し、
前記マッチング演算から所定のマッチング演算結果が得られたときに、高解像度画像用テンプレートによるマッチング演算を開始し、その後、低解像度画像用テンプレートと高解像度画像用テンプレートによる両マッチング演算を並列して行いテンプレートマッチングすることを特徴とするテンプレートマッチング方法。
In a template matching method for performing template matching of a low-resolution image and a high-resolution image of an object using a low-resolution image template and a high-resolution image template, respectively,
Start matching operation with low resolution image template,
When a predetermined matching operation result is obtained from the matching operation, the matching operation using the high-resolution image template is started, and then both the matching operations using the low-resolution image template and the high-resolution image template are performed in parallel. A template matching method characterized by performing template matching.
マッチング演算を並列して行っているときに、さらに、低解像度画像用テンプレートによるマッチング演算から所定のマッチング演算結果が得られたときは、高解像度画像用テンプレートによるマッチング演算が終了後、該マッチング演算結果に基づき、高解像度画像用テンプレートによるマッチング演算を再開することを特徴とする請求項1に記載のテンプレートマッチング方法。When the matching calculation is performed in parallel and a predetermined matching calculation result is obtained from the matching calculation using the low-resolution image template, the matching calculation using the high-resolution image template is completed. 2. The template matching method according to claim 1, wherein the matching operation using the high-resolution image template is restarted based on the result. 対象物の低解像度の画像と高解像度の画像を、それぞれ低解像度画像用テンプレートと高解像度画像用テンプレートを用いてテンプレートマッチングを行うテンプレートマッチング装置において、
低解像度画像用テンプレートによるマッチング演算を行う低解像度画像用マッチング演算手段と、
高解像度画像用テンプレートによるマッチング演算を行う高解像度画像用マッチング演算手段と、
前記低解像度画像用マッチング演算手段によるマッチング演算から所定のマッチング演算結果が得られたときに、高解像度画像用マッチング演算手段を起動し、低解像度画像用テンプレートと高解像度画像用テンプレートによる両マッチング演算が並列して行われるように、低解像度画像用マッチング演算手段と高解像度画像用マッチング演算手段を制御するマッチング制御手段と、
を有することを特徴とするテンプレートマッチング装置。
In a template matching device that performs template matching using a low-resolution image template and a high-resolution image template for a low-resolution image and a high-resolution image of an object,
A low-resolution image matching calculation unit that performs a matching calculation using the low-resolution image template;
A high-resolution image matching operation unit that performs a matching operation using the high-resolution image template;
When a predetermined matching operation result is obtained from the matching operation by the low-resolution image matching operation unit, the high-resolution image matching operation unit is activated, and both the matching operations by the low-resolution image template and the high-resolution image template are performed. Is performed in parallel, matching control means for controlling the low-resolution image matching calculation means and the high-resolution image matching calculation means,
A template matching device comprising:
前記マッチング制御手段は、マッチング演算を並列して行っているときに、さらに、低解像度画像用テンプレートによるマッチング演算から所定のマッチング演算結果が得られたときは、高解像度画像用テンプレートによるマッチング演算が終了後、該マッチング演算結果に基づき、高解像度画像用テンプレートによるマッチング演算を再開させる制御を行うことを特徴とする請求項3に記載のテンプレートマッチング装置。The matching control means performs the matching calculation using the high-resolution image template when the matching calculation is performed in parallel, and when a predetermined matching calculation result is obtained from the matching calculation using the low-resolution image template. 4. The template matching apparatus according to claim 3, wherein after completion, control is performed to restart the matching calculation using the high-resolution image template based on the matching calculation result.
JP2003158774A 2003-06-04 2003-06-04 Template matching method and apparatus Pending JP2004362186A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003158774A JP2004362186A (en) 2003-06-04 2003-06-04 Template matching method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003158774A JP2004362186A (en) 2003-06-04 2003-06-04 Template matching method and apparatus

Publications (1)

Publication Number Publication Date
JP2004362186A true JP2004362186A (en) 2004-12-24

Family

ID=34052017

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003158774A Pending JP2004362186A (en) 2003-06-04 2003-06-04 Template matching method and apparatus

Country Status (1)

Country Link
JP (1) JP2004362186A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006202184A (en) * 2005-01-24 2006-08-03 Konica Minolta Holdings Inc Detection device, detection method and detection program
WO2007004522A1 (en) 2005-06-30 2007-01-11 Olympus Corporation Search system and search method
JP2011158346A (en) * 2010-02-01 2011-08-18 Furuno Electric Co Ltd Image processing device, radar device, image processing method, and image processing program
US8238616B2 (en) 2008-12-16 2012-08-07 Sony Corporation Biometric authentication system and biometric authentication method
JP2016018422A (en) * 2014-07-09 2016-02-01 キヤノン株式会社 Image processing method, image processing device, program, storage medium, manufacturing apparatus, and manufacturing method for parts to be assembled
CN108319979A (en) * 2018-02-05 2018-07-24 哈工大机器人(合肥)国际创新研究院 A kind of framing recognition detection method based on scaling and rotation matching
JP2019175451A (en) * 2018-03-29 2019-10-10 トヨタ自動車株式会社 Real-time detection of traffic situation

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006202184A (en) * 2005-01-24 2006-08-03 Konica Minolta Holdings Inc Detection device, detection method and detection program
WO2007004522A1 (en) 2005-06-30 2007-01-11 Olympus Corporation Search system and search method
US8238616B2 (en) 2008-12-16 2012-08-07 Sony Corporation Biometric authentication system and biometric authentication method
JP2011158346A (en) * 2010-02-01 2011-08-18 Furuno Electric Co Ltd Image processing device, radar device, image processing method, and image processing program
JP2016018422A (en) * 2014-07-09 2016-02-01 キヤノン株式会社 Image processing method, image processing device, program, storage medium, manufacturing apparatus, and manufacturing method for parts to be assembled
CN108319979A (en) * 2018-02-05 2018-07-24 哈工大机器人(合肥)国际创新研究院 A kind of framing recognition detection method based on scaling and rotation matching
JP2019175451A (en) * 2018-03-29 2019-10-10 トヨタ自動車株式会社 Real-time detection of traffic situation

Similar Documents

Publication Publication Date Title
JP5523343B2 (en) Face detection device
JP2009130134A (en) Substrate inspection method and substrate inspection apparatus
JP2004362186A (en) Template matching method and apparatus
KR102557572B1 (en) Artificial neural network device and operating method for the same
JP6762737B2 (en) Image processing device
KR100303130B1 (en) Automatic teaching device and method using printed circuit board image processing
JP4763652B2 (en) Inspection condition determination method
JP4172728B2 (en) Image processing method
JP3762519B2 (en) Component recognition method, component recognition device, and component mounting device
JP5005482B2 (en) Pattern search method and apparatus
JP4823782B2 (en) Component positioning method and apparatus
JP3578658B2 (en) Matching method and device
JPH1063842A (en) Template matching method
JP2850641B2 (en) Semiconductor device manufacturing method and manufacturing apparatus
JP2001043317A (en) Character inspection device and dictionary automatic generation method
JP4172757B2 (en) Component mounting equipment
JPH10200297A (en) Electronic component mounting equipment
TWI694413B (en) Image processing circuit
JPH09326594A (en) Electronic component mounting method
JP2002099897A (en) Continuous recognition of parts
JP2004362367A (en) Image processing method and apparatus
JP2508075B2 (en) Image processing device
CN119473485A (en) A network map loading method, device, equipment and medium
JPH06337921A (en) Scanning system for picture recognizing device
JPH05143739A (en) Image processor