JP5447641B2 - Model image acquisition support apparatus, model image acquisition support method, and model image acquisition support program - Google Patents

Model image acquisition support apparatus, model image acquisition support method, and model image acquisition support program Download PDF

Info

Publication number
JP5447641B2
JP5447641B2 JP2012285625A JP2012285625A JP5447641B2 JP 5447641 B2 JP5447641 B2 JP 5447641B2 JP 2012285625 A JP2012285625 A JP 2012285625A JP 2012285625 A JP2012285625 A JP 2012285625A JP 5447641 B2 JP5447641 B2 JP 5447641B2
Authority
JP
Japan
Prior art keywords
image
model image
model
candidates
measurement
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.)
Active
Application number
JP2012285625A
Other languages
Japanese (ja)
Other versions
JP2013065354A (en
Inventor
正広 高山
大輔 箕谷
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.)
Omron Corp
Original Assignee
Omron 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 Omron Corp filed Critical Omron Corp
Priority to JP2012285625A priority Critical patent/JP5447641B2/en
Publication of JP2013065354A publication Critical patent/JP2013065354A/en
Application granted granted Critical
Publication of JP5447641B2 publication Critical patent/JP5447641B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

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

Description

この発明は、被写体を撮像して得られる計測画像に対して予め設定されたモデル画像に基づくマッチング処理を行なう画像処理装置に向けられたものである。   The present invention is directed to an image processing apparatus that performs matching processing based on a preset model image with respect to a measurement image obtained by imaging a subject.

FA(Factory Automation)分野などにおいては、ワークなどの被測定物に生じる欠陥などを光学的に検査したり、その表面に印字されている文字などを認識したりする装置として、いわゆる視覚センサが実用化されている。このような検査や認識を行なう手法の典型例として、予め設定されたモデル画像の基づくマッチング処理が一般的に用いられている(たとえば、特許文献1参照)。   In the FA (Factory Automation) field, so-called visual sensors are practically used as devices for optically inspecting defects such as workpieces that are measured and recognizing characters printed on the surface. It has become. As a typical example of a technique for performing such inspection and recognition, matching processing based on a preset model image is generally used (see, for example, Patent Document 1).

このマッチング処理では、製造過程の半製品や出荷前の製品といった被写体を撮像することで得られる計測画像(計測画像)のうち、予め設定されたモデル画像との間の類似度(典型的には、相関値)が最も高い領域を探し出すような探索処理が実行される。そのため、マッチング処理は、サーチ処理とも称される。   In this matching process, a similarity (typically, a preset model image) among measurement images (measurement images) obtained by imaging a subject such as a semi-finished product in a manufacturing process or a product before shipment (typically) , A search process for searching for a region having the highest correlation value is executed. Therefore, the matching process is also referred to as a search process.

特開平11−085907号公報Japanese Patent Laid-Open No. 11-085907

実際の生産ラインでは、その上を流れるワークの撮像位置が微妙にずれたり、照明環境が変動したりする場合もある。このような外乱要因が生じた場合であっても、マッチング処理を安定して行なう必要がある。そのため、生産ラインに対して、上述のような視覚センサを実際に適用しようとする場合には、どのようなモデル画像を選定するのかが重要となる。   In an actual production line, there are cases where the imaging position of the workpiece flowing on the production line slightly shifts or the lighting environment fluctuates. Even when such a disturbance factor occurs, it is necessary to stably perform the matching process. Therefore, when actually applying the above-described visual sensor to a production line, what model image is selected is important.

現状、このようなモデル画像は、熟練した作業者が経験に基づいて設定している。具体的には、先に何らかのモデル画像を設定しておき、この設定したモデル画像に基づいて、実際に取得された計測画像に対してマッチング処理を行ない、その結果が芳しくなければ、他のモデル画像に変更するといった作業を繰返して、最終的に、最適と思われるモデル画像を選定する。そのため、安定したマッチング結果を得られるようになるまで、モデル画像を探す操作が反復的に繰返されることになる。そのため、モデル画像の選定に多大な時間および労力を要するという課題がある。また、このようなモデル画像の選定中には、視覚センサを実運用することができないという課題もある。   At present, such a model image is set by a skilled worker based on experience. Specifically, some model image is set in advance, and based on this set model image, matching processing is performed on the actually acquired measurement image. The process of changing to an image is repeated, and finally a model image that seems to be optimal is selected. Therefore, the operation of searching for a model image is repeated repeatedly until a stable matching result can be obtained. Therefore, there is a problem that it takes a lot of time and labor to select a model image. In addition, there is a problem that the visual sensor cannot be actually operated during the selection of the model image.

また、現実的には、生産ラインを流れ得るすべてのワークに対して、選定したモデル画像が安定してマッチング処理を行なうことができるのかを完全に確認することは、時間的および費用的に不可能である場合が多い。したがって、限られた数の計測画像に対して、その安定性が確認されたに過ぎないモデル画像を採用せざるを得ない。そのため、実運用開始後に、選定したモデル画像では、安定したマッチング処理を行なうことができないことが判明する場合も有り得る。   Also, in reality, it is not time and costly to completely check whether the selected model image can be stably matched for all the workpieces that can flow through the production line. Often it is possible. Therefore, it is necessary to adopt model images whose stability has only been confirmed for a limited number of measurement images. For this reason, after the actual operation is started, it may be found that the selected model image cannot be stably matched.

さらに、元の画像からどのようなモデル画像を切り出すか、あるいは、いずれのモデル画像を選定するかといった作業は、作業者の熟練度などに応じてバラツキを生じる。   Furthermore, the operation of what model image is cut out from the original image or which model image is selected varies depending on the skill level of the operator.

そこで、この発明は、これらの問題を解決するためになされたものであり、その目的は、被写体を撮像して得られる計測画像に対して予め設定されたモデル画像に基づくマッチング処理を行なう画像処理装置に対して、最適なモデル画像をより迅速かつ容易に取得できるモデル画像取得支援装置、モデル画像取得支援方法およびモデル画像取得支援プログラムを提供することである。   Accordingly, the present invention has been made to solve these problems, and an object thereof is image processing for performing matching processing based on a preset model image with respect to a measurement image obtained by imaging a subject. To provide a model image acquisition support device, a model image acquisition support method, and a model image acquisition support program that can acquire an optimum model image more quickly and easily.

この発明のある局面に従えば、被写体を撮像して得られる計測画像に対して予め設定されたモデル画像に基づくマッチング処理を行なう画像処理装置に向けられた、モデル画像の取得を支援する装置を提供する。本モデル画像取得支援装置は、モデルとなり得る被写体を撮像することで得られる参照画像からモデル画像の候補となる複数のモデル画像候補を抽出する抽出手段と、計測画像を受付ける入力手段と、計測画像に対して、複数のモデル画像のそれぞれに基づくマッチング処理を行なうことで複数の試行結果を生成する処理手段と、複数の試行結果をそれぞれ評価することで評価結果を生成する評価手段と、評価結果を、複数のモデル画像候補の別に出力する出力手段とを含む。   According to an aspect of the present invention, there is provided an apparatus for assisting acquisition of a model image, which is directed to an image processing apparatus that performs matching processing based on a preset model image with respect to a measurement image obtained by imaging a subject. provide. The model image acquisition support apparatus includes: an extracting unit that extracts a plurality of model image candidates that are model image candidates from a reference image obtained by imaging a subject that can be a model; an input unit that receives a measurement image; and a measurement image On the other hand, a processing means for generating a plurality of trial results by performing matching processing based on each of a plurality of model images, an evaluation means for generating an evaluation result by evaluating each of the plurality of trial results, and an evaluation result Output means for separately outputting a plurality of model image candidates.

好ましくは、本モデル画像取得支援装置は、出力される評価結果に対するユーザ選択に応答して、選択された評価結果に対応するモデル画像候補を、画像形成装置のモデル画像として設定する手段をさらに含む。   Preferably, the model image acquisition support apparatus further includes means for setting a model image candidate corresponding to the selected evaluation result as a model image of the image forming apparatus in response to a user selection for the output evaluation result. .

好ましくは、評価手段は、評価結果が満たすべき条件を受付ける手段と、複数の試行結果のうち、条件に最も適合しているモデル画像候補を決定する手段とを含む。   Preferably, the evaluation unit includes a unit that receives a condition to be satisfied by the evaluation result, and a unit that determines a model image candidate that best matches the condition among the plurality of trial results.

好ましくは、抽出手段は、同一の参照画像から複数のモデル画像候補を抽出する。
好ましくは、抽出手段は、同一の参照画像から、抽出する領域のサイズ、位置、方向の少なくとも1つを異ならせた、複数のモデル画像候補をそれぞれ抽出する。
Preferably, the extraction unit extracts a plurality of model image candidates from the same reference image.
Preferably, the extracting unit extracts a plurality of model image candidates from which at least one of a size, a position, and a direction of the region to be extracted is different from the same reference image.

好ましくは、抽出手段は、初期設定されているモデル画像に基づくマッチング処理を行なうことで、参照画像からモデル画像候補を抽出する。   Preferably, the extracting unit extracts a model image candidate from the reference image by performing a matching process based on the initially set model image.

さらに好ましくは、抽出手段は、画像処理装置から、初期設定されているモデル画像を取得する。   More preferably, the extraction unit acquires an initially set model image from the image processing apparatus.

好ましくは、入力手段は、計測画像に加えて、当該計測画像に対応付けられた期待クラスおよび期待値の少なくとも一方を受付ける。評価手段は、各計測画像に対応付けられた期待値および/または期待クラスに基づいて、対応する試行結果を評価する。   Preferably, the input unit receives at least one of an expected class and an expected value associated with the measurement image in addition to the measurement image. The evaluation unit evaluates the corresponding trial result based on the expected value and / or the expected class associated with each measurement image.

さらに好ましくは、期待クラスは、対応付けられた計測画像がモデル画像とマッチングすべき良品画像、および、対応付けられた計測画像がモデル画像とマッチングすべきではない不良品画像、のいずれであるかの区分を示す。   More preferably, the expected class is a non-defective image whose associated measurement image should be matched with the model image, or a defective product image whose associated measurement image should not be matched with the model image. Indicates the category.

さらに好ましくは、参照画像は、計測画像に含まれる良品画像からなる。
好ましくは、処理手段は、複数のモデル画像候補の各々について、複数の計測画像に対して処理を行なうことで得られる複数の試行結果からなる試行結果群を生成し、評価手段は、複数のモデル画像候補の各々について、対応の試行結果群についての統計的出力を算出する手段を含む。
More preferably, the reference image is a non-defective image included in the measurement image.
Preferably, the processing unit generates, for each of the plurality of model image candidates, a trial result group including a plurality of trial results obtained by performing processing on the plurality of measurement images, and the evaluation unit includes the plurality of models. Means for calculating a statistical output for the corresponding trial result group for each of the image candidates;

さらに好ましくは、統計的出力は、平均値、中間値、最大値、最小値、分散値の少なくとも1つを含む。   More preferably, the statistical output includes at least one of an average value, an intermediate value, a maximum value, a minimum value, and a variance value.

好ましくは、入力手段は、複数の計測画像を受付け、モデル画像取得支援装置は、さらに、複数の計測画像の全体に対してのマッチング処理結果を最適化するための、複数のモデル画像候補に含まれる2つ以上のモデル画像候補の組合わせを探索する探索手段を含む。   Preferably, the input unit receives a plurality of measurement images, and the model image acquisition support device is further included in a plurality of model image candidates for optimizing a matching processing result for the whole of the plurality of measurement images. Search means for searching for a combination of two or more model image candidates.

この発明の別の局面に従えば、被写体を撮像して得られる計測画像に対して予め設定されたモデル画像に基づくマッチング処理を行なう画像処理装置に向けられた、モデル画像の取得を支援する装置を提供する。本モデル画像取得装置は、モデルとなり得る被写体を撮像することで得られる参照画像からモデル画像の候補となる複数のモデル画像候補を抽出する抽出手段と、計測画像を受付ける入力手段と、計測画像に対して、複数のモデル画像のそれぞれに基づくマッチング処理を行なうことで複数の試行結果を生成する処理手段と、複数の試行結果をそれぞれ評価することで評価結果を生成する評価手段と、評価結果のうち所定の条件に最も適合しているモデル画像を決定する決定手段とを含む。   According to another aspect of the present invention, an apparatus for assisting acquisition of a model image directed to an image processing apparatus that performs matching processing based on a preset model image with respect to a measurement image obtained by imaging a subject. I will provide a. The model image acquisition apparatus includes an extraction unit that extracts a plurality of model image candidates that are model image candidates from a reference image obtained by imaging a subject that can be a model, an input unit that receives a measurement image, and a measurement image. On the other hand, a processing unit that generates a plurality of trial results by performing matching processing based on each of a plurality of model images, an evaluation unit that generates an evaluation result by evaluating each of the plurality of trial results, Determining means for determining a model image most suitable for a predetermined condition.

この発明のさらに別の局面に従えば、被写体を撮像して得られる計測画像に対して予め設定されたモデル画像に基づくマッチング処理を行なう画像処理装置に向けられた、モデル画像の取得を支援する方法を提供する。本モデル画像取得支援方法は、モデルとなり得る被写体を撮像することで得られる参照画像からモデル画像の候補となる複数のモデル画像候補を抽出するステップと、計測画像を受付けるステップと、計測画像に対して、複数のモデル画像のそれぞれに基づくマッチング処理を行なうことで複数の試行結果を生成するステップと、複数の試行結果をそれぞれ評価することで評価結果を生成するステップと、評価結果を、複数のモデル画像候補の別に出力するステップとを有する。   According to still another aspect of the present invention, the acquisition of a model image directed to an image processing apparatus that performs matching processing based on a preset model image with respect to a measurement image obtained by imaging a subject is supported. Provide a method. The model image acquisition support method includes a step of extracting a plurality of model image candidates as model image candidates from a reference image obtained by imaging a subject that can be a model, a step of receiving a measurement image, A step of generating a plurality of trial results by performing matching processing based on each of the plurality of model images, a step of generating an evaluation result by evaluating each of the plurality of trial results, and a plurality of evaluation results. And outputting a model image candidate separately.

この発明のさらに別の局面に従えば、被写体を撮像して得られる計測画像に対して予め設定されたモデル画像に基づくマッチング処理を行なう画像処理装置に向けられた、モデル画像の取得を支援するプログラムを提供する。本プログラムは、プロセッサに、モデルとなり得る被写体を撮像することで得られる参照画像からモデル画像の候補となる複数のモデル画像候補を抽出するステップと、計測画像を受付けるステップと、計測画像に対して、複数のモデル画像のそれぞれに基づくマッチング処理を行なうことで複数の試行結果を生成するステップと、複数の試行結果をそれぞれ評価することで評価結果を生成するステップと、評価結果を、複数のモデル画像候補の別に出力するステップとを実行させる。   According to still another aspect of the present invention, the acquisition of a model image directed to an image processing apparatus that performs matching processing based on a preset model image with respect to a measurement image obtained by imaging a subject is supported. Provide a program. The program includes a step of extracting a plurality of model image candidates as model image candidates from a reference image obtained by imaging a subject that can be a model, a step of receiving a measurement image, and a measurement image A step of generating a plurality of trial results by performing matching processing based on each of the plurality of model images, a step of generating an evaluation result by evaluating each of the plurality of trial results, and a plurality of models. And a step of outputting image candidates separately.

この発明によれば、被写体を撮像して得られる計測画像に対して予め設定されたモデル画像に基づくマッチング処理を行なう画像処理装置に対して、最適なモデル画像をより迅速かつ容易に取得できる。   According to the present invention, an optimal model image can be acquired more quickly and easily with respect to an image processing apparatus that performs a matching process based on a preset model image with respect to a measurement image obtained by imaging a subject.

この発明の実施の形態に従うシステム全体を示す図である。It is a figure which shows the whole system according to embodiment of this invention. この発明の実施の形態に従うモデル画像取得支援装置を実現するコンピュータの概略構成図である。It is a schematic block diagram of the computer which implement | achieves the model image acquisition assistance apparatus according to embodiment of this invention. この発明の実施の形態に従う画像処理装置を実現するコンピュータの概略構成図である。1 is a schematic configuration diagram of a computer that realizes an image processing apparatus according to an embodiment of the present invention. この発明の実施の形態に従う視覚センサを生産ラインで運用する場合のワークフローの一例である。It is an example of the workflow in the case of operating the visual sensor according to embodiment of this invention on a production line. この発明の実施の形態に従うモデル画像取得支援装置におけるモデル画像取得処理の概要を説明するための図である。It is a figure for demonstrating the outline | summary of the model image acquisition process in the model image acquisition assistance apparatus according to embodiment of this invention. この発明の実施の形態に従うモデル画像候補の抽出処理の一例を示す図である。It is a figure which shows an example of the extraction process of the model image candidate according to embodiment of this invention. この発明の実施の形態に従う支援装置および画像処理装置の機能構成を示す概略図である。It is the schematic which shows the function structure of the assistance apparatus and image processing apparatus according to embodiment of this invention. この発明の実施の形態に従う画像処理アプリケーションによって提供される設定モードにおける画面表示例を示す図である。It is a figure which shows the example of a screen display in the setting mode provided by the image processing application according to embodiment of this invention. この発明の実施の形態に従う画像処理装置のモニタに表示される稼動モードにおける画面表示例を示す図である。It is a figure which shows the example of a screen display in the operation mode displayed on the monitor of the image processing apparatus according to embodiment of this invention. この発明の実施の形態に従う支援装置の評価処理アプリケーションによって提供されるユーザインターフェイスの一例(その1)を示す図である。It is a figure which shows an example (the 1) of the user interface provided by the evaluation process application of the assistance apparatus according to embodiment of this invention. この発明の実施の形態に従う支援装置の評価処理アプリケーションによって提供されるユーザインターフェイスの一例(その2)を示す図である。It is a figure which shows an example (the 2) of the user interface provided by the evaluation process application of the assistance apparatus according to embodiment of this invention. この発明の実施の形態に従う支援装置の評価処理アプリケーションによって提供されるユーザインターフェイスの一例(その3)を示す図である。It is a figure which shows an example (the 3) of the user interface provided by the evaluation process application of the assistance apparatus according to embodiment of this invention. この発明の実施の形態に従う支援装置の評価処理アプリケーションによって提供されるユーザインターフェイスの一例(その4)を示す図である。It is a figure which shows an example (the 4) of a user interface provided by the evaluation process application of the assistance apparatus according to embodiment of this invention. この発明の実施の形態に従う支援装置の評価処理アプリケーションによって提供されるユーザインターフェイスの一例(その5)を示す図である。It is a figure which shows an example (the 5) of the user interface provided by the evaluation process application of the assistance apparatus according to embodiment of this invention. この発明の実施の形態に従う支援装置の制御構造を示す機能ブロック図である。It is a functional block diagram which shows the control structure of the assistance apparatus according to embodiment of this invention. 図15に示す支援装置の制御構造において生成されるファイル構造を示す図である。It is a figure which shows the file structure produced | generated in the control structure of the assistance apparatus shown in FIG. この発明の実施の形態に従う支援装置においてモデル画像候補のうち最も適切なものを選択する条件の入力インターフェイスの一例を示す図である。It is a figure which shows an example of the input interface of the conditions which select the most suitable thing among model image candidates in the assistance apparatus according to embodiment of this invention. この発明の実施の形態に従うシステムにおける全体処理を示すフローチャート(その1)である。It is a flowchart (the 1) which shows the whole process in the system according to embodiment of this invention. この発明の実施の形態に従うシステムにおける全体処理を示すフローチャート(その2)である。It is a flowchart (the 2) which shows the whole process in the system according to embodiment of this invention. この発明の実施の形態に従うシステムにおける全体処理を示すフローチャート(その3)である。It is a flowchart (the 3) which shows the whole process in the system according to embodiment of this invention. この発明の実施の形態に従うシステムにおける全体処理を示すフローチャート(その4)である。It is a flowchart (the 4) which shows the whole process in the system according to embodiment of this invention. この発明の実施の形態に従うシステムにおける全体処理を示すフローチャート(その5)である。It is a flowchart (the 5) which shows the whole process in the system according to embodiment of this invention. この発明の実施の形態の変形例1に従うシステムにおける全体処理の要部を示すフローチャートである。It is a flowchart which shows the principal part of the whole process in the system according to the modification 1 of embodiment of this invention. この発明の実施の形態の変形例2に従うシステムにおける全体処理の要部を示すフローチャートである。It is a flowchart which shows the principal part of the whole process in the system according to the modification 2 of embodiment of this invention. この発明の実施の形態の変形例3に従うマッチング処理の概要を説明するための図である。It is a figure for demonstrating the outline | summary of the matching process according to the modification 3 of embodiment of this invention. この発明の実施の形態の変形例3に従うマッチング処理におけるモデル画像セット取得処理の概要を説明するための図である。It is a figure for demonstrating the outline | summary of the model image set acquisition process in the matching process according to the modification 3 of embodiment of this invention. この発明の実施の形態の変形例3に従う手法1の概要を説明するための図である。It is a figure for demonstrating the outline | summary of the method 1 according to the modification 3 of embodiment of this invention. この発明の実施の形態の変形例3に従う手法1の手順を示すフローチャートである。It is a flowchart which shows the procedure of the method 1 according to the modification 3 of embodiment of this invention. この発明の実施の形態の変形例3に従う手法2の手順を示すフローチャートである。It is a flowchart which shows the procedure of the method 2 according to the modification 3 of embodiment of this invention. この発明の実施の形態の変形例3に従う手法3の概要を説明するための図である。It is a figure for demonstrating the outline | summary of the method 3 according to the modification 3 of embodiment of this invention. この発明の実施の形態の変形例3に従う手法3における試行結果の一例を示す図である。It is a figure which shows an example of the trial result in the method 3 according to the modification 3 of embodiment of this invention. この発明の実施の形態の変形例3に従う手法3の手順を示すフローチャートである。It is a flowchart which shows the procedure of the method 3 according to the modification 3 of embodiment of this invention. この発明の実施の変形例4に従う試行作成処理の一例を示す図である。It is a figure which shows an example of the trial creation process according to the modification 4 of implementation of this invention. この発明の実施の変形例5に従う処理項目の内容を説明するためのブロック図である。It is a block diagram for demonstrating the content of the process item according to the modification 5 of implementation of this invention. この発明の実施の変形例5に従うモデル画像の最適化を説明するための図である。It is a figure for demonstrating optimization of the model image according to the modification 5 of implementation of this invention.

この発明の実施の形態について、図面を参照しながら詳細に説明する。なお、図中の同一または相当部分については、同一符号を付してその説明は繰返さない。   Embodiments of the present invention will be described in detail with reference to the drawings. Note that the same or corresponding parts in the drawings are denoted by the same reference numerals and description thereof will not be repeated.

<概要>
この発明の実施の形態では、本実施の形態に従うモデル画像取得支援装置を、いわゆる視覚センサと称される画像処理装置に対して適用する場合の構成について例示する。この視覚センサは、典型的には、生産ラインなどを流れる被写体である計測対象物体(以下「ワーク」とも称す。)を撮像することで得られる計測画像を受付け、この計測画像に対して、予め設定されたモデル画像に基づくマッチング処理などを行なうことで、ワークの欠陥検査や文字列判別を提供する。
<Overview>
In the embodiment of the present invention, a configuration in the case where the model image acquisition support device according to the present embodiment is applied to an image processing device called a so-called visual sensor will be exemplified. This visual sensor typically receives a measurement image obtained by imaging a measurement target object (hereinafter also referred to as “work”) that is a subject flowing through a production line or the like, By performing matching processing based on the set model image, it provides workpiece defect inspection and character string discrimination.

この発明の実施の形態に従うモデル画像取得支援装置は、まず、モデルとなり得る被写体を撮像することで得られた参照画像から、モデル画像の候補となる複数のモデル画像候補を抽出する。そして、本実施の形態に従うモデル画像取得支援装置は、計測画像に対して、抽出した複数のモデル画像のそれぞれに基づくマッチング処理を行なうことで複数の試行結果を生成し、さらに、当該複数の試行結果をそれぞれ評価することで評価結果を生成する。最終的に、本実施の形態に従うモデル画像取得支援装置は、この生成した評価結果を、複数のモデル画像候補の別に出力する。たとえば、対象の計測画像がいずれもモデル画像とマッチングすべき画像であるとすれば、対象の計測画像と最もマッチング度合いが高いモデル画像が最適なものと判断することができる。   The model image acquisition support apparatus according to the embodiment of the present invention first extracts a plurality of model image candidates that are model image candidates from a reference image obtained by imaging a subject that can be a model. Then, the model image acquisition support apparatus according to the present embodiment generates a plurality of trial results by performing a matching process based on each of the extracted model images on the measurement image, and further, the plurality of trials An evaluation result is generated by evaluating each result. Finally, the model image acquisition support apparatus according to the present embodiment outputs the generated evaluation result separately for a plurality of model image candidates. For example, if all the target measurement images are images to be matched with the model image, it is possible to determine that the model image having the highest degree of matching with the target measurement image is optimal.

また、本実施の形態に従うモデル画像取得支援装置は、計測画像に対応付けられた期待クラスおよび/または期待値を受付ける。本明細書において、「期待クラス」および「期待値」とは、対応の計測画像に対してマッチング処理が行なわれた場合に、生成されるべき処理結果の内容を意味する。   In addition, the model image acquisition support apparatus according to the present embodiment accepts an expected class and / or an expected value associated with a measurement image. In this specification, “expected class” and “expected value” mean the contents of a processing result to be generated when matching processing is performed on a corresponding measurement image.

典型的に、「期待クラス」は、対象の計測画像に写っているワークがモデル画像を含んでいる「良品」であるか、あるいは、対象の計測画像に写っているワークがモデル画像とは異なる「不良品」であるかの区分を含む。言い換えれば、対象の計測画像がモデル画像とマッチングすべき「良品画像」、および、対象の計測画像がモデル画像とマッチングすべきではない「不良品画像」、のいずれであるかの区分を示す。以下の説明では、「良品」の期待クラスに対応付けられた計測画像を「良品画像」とも称し、「不良品」の期待クラスに対応付けられた計測画像を「不良品画像」とも称する。   Typically, the “expected class” is “good” in which the workpiece shown in the target measurement image includes a model image, or the workpiece shown in the target measurement image is different from the model image. Includes the category of “defective”. In other words, it indicates a classification of whether the target measurement image is a “non-defective product image” that should be matched with the model image, or a “defective product image” that should not be matched with the model image. In the following description, the measurement image associated with the “non-defective product” expected class is also referred to as “non-defective product image”, and the measurement image associated with the “defective product” expected class is also referred to as “defective product image”.

また、典型的に、「期待値」は、対象の計測画像と設定されているモデル画像との間の類似度(典型的には、相関値)を示す値を含む。すなわち、対象の計測画像に写っているワークがモデル画像を含んでいる場合には、「期待値」は相対的に高い値を示し、対象の計測画像に写っているワークがモデル画像を含んでいない場合には、「期待値」は相対的に低い値を示す。   Further, typically, the “expected value” includes a value indicating the degree of similarity (typically, a correlation value) between the target measurement image and the set model image. That is, when the workpiece shown in the target measurement image contains a model image, the “expected value” shows a relatively high value, and the workpiece shown in the target measurement image contains a model image. If not, the “expected value” indicates a relatively low value.

上述のように、本明細書において、「良品」および「不良品」との用語は、設定されて
いるモデル画像との相対的な関係において、対象の計測画像が当該モデル画像とマッチング判定されるべきか否かの区分を含む。そのため、同一の計測画像に対して、異なるモデル画像に基づくマッチング処理が複数回実行される場合も多いため、「期待クラス」および/または「期待値」は、1つのクラスおよび/または値とは限らない。
As described above, in this specification, the terms “non-defective product” and “defective product” are determined to match the target measurement image with the model image in a relative relationship with the set model image. Including whether or not it should be. For this reason, since matching processing based on different model images is often executed for the same measurement image a plurality of times, the “expected class” and / or “expected value” is one class and / or value. Not exclusively.

このような期待クラスおよび/または期待値を受付けると、本実施の形態に従うモデル画像取得支援装置は、生成された複数の試行結果と、入力された期待クラスおよび/または期待値に基づいて、当該複数の試行結果をそれぞれ評価することで評価結果を生成する。すなわち、良品画像に対してのマッチング度合いが高いものであって、かつ不良品画像に対してマッチング度合いが低いものが最適なモデル画像として評価される。そして、本実施の形態に従うモデル画像取得支援装置は、この生成した評価結果を、複数のモデル画像候補の別に出力する。   Upon accepting such an expected class and / or expected value, the model image acquisition support apparatus according to the present embodiment, based on the generated trial results and the input expected class and / or expected value, An evaluation result is generated by evaluating each of a plurality of trial results. That is, an image having a high matching degree with respect to a good product image and a low matching degree with respect to a defective product image is evaluated as an optimum model image. And the model image acquisition assistance apparatus according to this Embodiment outputs this produced | generated evaluation result according to a some model image candidate.

なお、本発明において「出力」とは、実際にモデル画像を決定するユーザもしくは装置などにその内容を提供することを意味し、典型的には、ディスプレイなどの表示装置にその内容を表わすこと、プリンタ装置などによって紙媒体上などにその内容を表わすこと、外部装置にその内容を表わすデータを送信すること、記憶装置などにその内容を表わすデータを格納することなどを含む。   In the present invention, “output” means providing the content to a user or device that actually determines the model image, typically representing the content on a display device such as a display, This includes expressing the content on a paper medium by a printer device or the like, transmitting data representing the content to an external device, storing data representing the content in a storage device or the like.

上述のような処理によって、複数のモデル画像のうち、実際の計測画像に対するマッチング処理の結果が最適となるものを、迅速かつ容易に決定することができる。   By the process as described above, it is possible to quickly and easily determine an optimal result of the matching process for an actual measurement image among a plurality of model images.

なお、以下の説明では、記載の簡略化のため、「期待クラス」および「期待値」を総称して、単に「期待クラス」とも記載する。しかしながら、この「期待クラス」との用語には、上述の意味における「期待クラス」および「期待値」が含まれる。   In the following description, for the sake of simplification, “expected class” and “expected value” are collectively referred to as “expected class”. However, the term “expected class” includes “expected class” and “expected value” in the above-mentioned meaning.

<全体装置構成>
図1は、この発明の実施の形態に従うシステム全体を示す図である。
<Overall device configuration>
FIG. 1 is a diagram showing an entire system according to an embodiment of the present invention.

図1を参照して、本実施の形態に従うシステムとしては、モデル画像取得支援装置(以下、単に「支援装置」とも称す。)100と、画像処理装置200とを含む。   Referring to FIG. 1, the system according to the present embodiment includes a model image acquisition support apparatus (hereinafter also simply referred to as “support apparatus”) 100 and an image processing apparatus 200.

画像処理装置200は、撮像部8および光電センサ4と電気的に接続される。撮像部8は、ベルトコンベヤなどの搬送ライン6上を搬送される被写体であるワーク2を撮像することで、ワーク2が写った計測画像を取得する。画像処理装置200は、撮像部8で取得された計測画像を格納するとともに、各計測画像に対して、予め設定されているモデル画像に基づくマッチング処理を行ない、その処理結果(たとえば、マッチングOKまたはマッチングNGの判断)を出力する。   The image processing apparatus 200 is electrically connected to the imaging unit 8 and the photoelectric sensor 4. The imaging unit 8 acquires a measurement image in which the workpiece 2 is captured by imaging the workpiece 2 that is a subject conveyed on a conveyance line 6 such as a belt conveyor. The image processing apparatus 200 stores the measurement image acquired by the imaging unit 8 and performs matching processing based on a preset model image for each measurement image, and the processing result (for example, matching OK or (Matching NG judgment) is output.

撮像部8によるワーク2の撮像タイミングは、搬送ライン6の両サイドに配置された光電センサ4(受光部および投光部)によって検出される。すなわち、光電センサ4は、同一の光軸上に配置された受光部と投光部とからなり、投光部から放射される光がワーク2で遮蔽されることを受光部が検出することによって、撮像タイミングを示すトリガ信号が出力される。また、撮像部8は、レンズなどの光学系に加えて、CCD(Coupled Charged Device)やCMOS(Complementary Metal Oxide Semiconductor)センサといった、
撮像素子を含む。なお、撮像部8で取得される計測画像は、白黒画像であってもよいし、カラー画像であってもよい。
The imaging timing of the workpiece 2 by the imaging unit 8 is detected by the photoelectric sensors 4 (light receiving unit and light projecting unit) arranged on both sides of the conveyance line 6. That is, the photoelectric sensor 4 includes a light receiving unit and a light projecting unit disposed on the same optical axis, and the light receiving unit detects that light emitted from the light projecting unit is shielded by the work 2. A trigger signal indicating the imaging timing is output. In addition to an optical system such as a lens, the imaging unit 8 includes a CCD (Coupled Charged Device) and a CMOS (Complementary Metal Oxide Semiconductor) sensor.
Includes an image sensor. The measurement image acquired by the imaging unit 8 may be a black and white image or a color image.

一方、支援装置100は、画像処理装置200に格納されている計測画像や設定パラメータ(初期設定モデル画像を含む)を受取り、最適なモデル画像を決定するためのモデル
画像取得処理を実行する。そして、支援装置100は、このモデル画像取得処理によって取得したモデル画像および設定パラメータなどを、画像処理装置200に設定することもできる。なお、支援装置100と画像処理装置200との間のデータを遣り取りする手段としては、USB(Universal Serial Bus)やイーサネット(登録商標)などの通信手段(有線または無線)を用いる方法や、SD(Secured Digital)カードなどの着脱可能な
記憶媒体を用いる方法などを採用することができる。
On the other hand, the support apparatus 100 receives a measurement image and setting parameters (including an initial setting model image) stored in the image processing apparatus 200, and executes a model image acquisition process for determining an optimal model image. Then, the support apparatus 100 can set the model image acquired by the model image acquisition process, the setting parameter, and the like in the image processing apparatus 200. As means for exchanging data between the support apparatus 100 and the image processing apparatus 200, a method using communication means (wired or wireless) such as USB (Universal Serial Bus) or Ethernet (registered trademark), SD ( For example, a method using a removable storage medium such as a Secured Digital card may be employed.

なお、後述するように、支援装置100の機能の全部または一部を画像処理装置200に組入れてもよいが、支援装置100と画像処理装置200とを別体とすることで、現場から離れた事務所の机上で、最適なモデル画像を決定する処理を独立して実行させることができる。   As will be described later, all or part of the functions of the support apparatus 100 may be incorporated into the image processing apparatus 200. However, the support apparatus 100 and the image processing apparatus 200 are separated from each other by separating them. The process of determining the optimum model image can be executed independently on the desk in the office.

<ハードウェア構成>
(1 モデル画像取得支援装置)
本実施の形態に従う支援装置100は、典型的に、コンピュータがインストールされたプログラムを実行することで具現化される。なお、代替的に、コンピュータがプログラムを実行することで提供される機能の一部もしくは全部を専用のハードウェア回路として具現化してもよい。
<Hardware configuration>
(1 Model image acquisition support device)
The support apparatus 100 according to the present embodiment is typically implemented by executing a program in which a computer is installed. Alternatively, some or all of the functions provided by the computer executing the program may be embodied as a dedicated hardware circuit.

図2は、この発明の実施の形態に従うモデル画像取得支援装置100を実現するコンピュータの概略構成図である。   FIG. 2 is a schematic configuration diagram of a computer that realizes model image acquisition support apparatus 100 according to the embodiment of the present invention.

図2を参照して、支援装置100を実現するコンピュータは、表示装置としてのモニタ102と、入力装置としてのキーボード103およびマウス104と、演算装置(プロセッサ)としてのCPU(Central Processing Unit)105と、記憶装置としてのメモリ
106および固定ディスク107と、記録媒体からのデータ読出装置としてのFD駆動装置111およびCD−ROM駆動装置113とを含む。これらの各部は、バスを介して相互にデータ通信可能に接続されている。
Referring to FIG. 2, a computer that implements support device 100 includes a monitor 102 as a display device, a keyboard 103 and a mouse 104 as input devices, and a CPU (Central Processing Unit) 105 as an arithmetic device (processor). , A memory 106 and a fixed disk 107 as storage devices, and an FD driving device 111 and a CD-ROM driving device 113 as data reading devices from a recording medium. These units are connected to each other via a bus so that data communication is possible.

支援装置100(コンピュータ)で実行されるプログラムは、典型的には、フレキシブルディスク(FD:Flexible Disk)112もしくはCD−ROM(Compact Disk Read Only Memory)114などに格納されて流通し、またはネットワーク接続された配信サーバ装置などからのダウンロードといった形で流通する。フレキシブルディスク112およびCD−ROM114に格納されたプログラムは、それぞれFD駆動装置111およびCD−ROM駆動装置113から読出されて、固定ディスク107に一旦格納される。さらに、固定ディスク107からメモリ106上に展開されて、CPU105により実行される。   A program executed by the support apparatus 100 (computer) is typically stored and distributed in a flexible disk (FD: Flexible Disk) 112 or a CD-ROM (Compact Disk Read Only Memory) 114, or connected to a network. It is distributed in the form of download from the distributed distribution server device. The programs stored in the flexible disk 112 and the CD-ROM 114 are read from the FD driving device 111 and the CD-ROM driving device 113, respectively, and temporarily stored in the fixed disk 107. Further, the data is expanded from the fixed disk 107 onto the memory 106 and executed by the CPU 105.

CPU105は、プログラムされた命令を逐次実行することで、各種の演算を実施する。メモリ106は、CPU105でのプログラム実行に応じて、各種の情報についても一時的に格納する。固定ディスク107は、CPU105で実行されるプログラムの他に、設定されるモデル画像、処理対象の計測画像、および各種設定値などを格納する不揮発性の記憶装置である。   The CPU 105 performs various operations by sequentially executing programmed instructions. The memory 106 temporarily stores various types of information according to the program execution by the CPU 105. The fixed disk 107 is a non-volatile storage device that stores a model image to be set, a measurement image to be processed, various setting values, and the like in addition to a program executed by the CPU 105.

キーボード103は、入力されるキーに応じたユーザからの指令を受付ける。マウス104は、クリックやスライドなどの動作に応じたユーザからの指令を受付ける。このように、キーボード103およびマウス104で受付けられた指令は、CPU105へ与えられる。   The keyboard 103 receives a command from the user corresponding to the input key. The mouse 104 receives a command from the user according to an operation such as click or slide. As described above, the command received by the keyboard 103 and the mouse 104 is given to the CPU 105.

また、支援装置100には、必要に応じて、プリンタなどの他の出力装置が接続されて
もよい。
In addition, other output devices such as a printer may be connected to the support apparatus 100 as necessary.

(2 画像処理装置)
本実施の形態に従う画像処理装置200は、支援装置100と同様に、典型的には、コンピュータがインストールされたプログラムを実行することで具現化される。なお、代替的に、コンピュータがプログラムを実行することで提供される機能の一部もしくは全部を専用のハードウェア回路として具現化してもよい。
(2 Image processing device)
Similar to support apparatus 100, image processing apparatus 200 according to the present embodiment is typically implemented by executing a program in which a computer is installed. Alternatively, some or all of the functions provided by the computer executing the program may be embodied as a dedicated hardware circuit.

図3は、この発明の実施の形態に従う画像処理装置200を実現するコンピュータの概略構成図である。   FIG. 3 is a schematic configuration diagram of a computer that implements image processing apparatus 200 according to the embodiment of the present invention.

図3を参照して、画像処理装置200を実現するコンピュータは、本体部201と、表示装置としてのモニタ202と、入力装置としてのキーボード203およびマウス204とを含む。本体部201は、演算装置(プロセッサ)としてのCPU205と、記憶装置としてのメモリ206および固定ディスク207と、記録媒体からのデータ読出装置としてのFD駆動装置211およびCD−ROM駆動装置213とを含む。さらに、本体部201は、本体部201の外部との間で信号を遣り取りするためのインターフェイスとして、カメラインターフェイス部209と、制御情報インターフェイス部215と、センサインターフェイス部217とを含む。これらの各部は、バスを介して相互にデータ通信可能に接続されている。   Referring to FIG. 3, a computer that realizes image processing apparatus 200 includes a main body 201, a monitor 202 as a display device, and a keyboard 203 and a mouse 204 as input devices. The main body 201 includes a CPU 205 as an arithmetic device (processor), a memory 206 and a fixed disk 207 as storage devices, and an FD driving device 211 and a CD-ROM driving device 213 as data reading devices from a recording medium. . Further, the main body unit 201 includes a camera interface unit 209, a control information interface unit 215, and a sensor interface unit 217 as interfaces for exchanging signals with the outside of the main body unit 201. These units are connected to each other via a bus so that data communication is possible.

画像処理装置200(コンピュータ)で実行されるプログラムについても、典型的には、フレキシブルディスク(FD)212もしくはCD−ROM214などに格納されて流通し、またはネットワーク接続された配信サーバ装置などからのダウンロードといった形で流通する。フレキシブルディスク212およびCD−ROM214に格納されたプログラムは、それぞれFD駆動装置211およびCD−ROM駆動装置213から読出されて、固定ディスク207に一旦格納される。さらに、固定ディスク207からメモリ206に展開されて、CPU205により実行される。   A program executed by the image processing apparatus 200 (computer) is also typically downloaded from a distribution server apparatus or the like that is stored and distributed on a flexible disk (FD) 212 or CD-ROM 214 or connected to a network. It is distributed in the form. The programs stored in the flexible disk 212 and the CD-ROM 214 are read from the FD driving device 211 and the CD-ROM driving device 213, respectively, and temporarily stored in the fixed disk 207. Further, the data is expanded from the fixed disk 207 to the memory 206 and executed by the CPU 205.

本体部201に含まれる構成のうち、CPU205、メモリ206、固定ディスク207、FD駆動装置211、およびCD−ROM駆動装置213については、上述の支援装置100の対応する部分と同様であるので、詳細な説明は繰返さない。   Among the configurations included in the main body unit 201, the CPU 205, the memory 206, the fixed disk 207, the FD drive device 211, and the CD-ROM drive device 213 are the same as the corresponding parts of the above-described support device 100, so The explanation will not be repeated.

カメラインターフェイス部209は、CPU205と撮像部8との間のデータ通信を仲介する。より具体的には、カメラインターフェイス部209は、画像バッファを含み、撮像部8で撮像されて連続的に伝送される計測画像のデータを一旦蓄積し、少なくとも1コマ分の計測画像のデータが蓄積されると、その蓄積されたデータをメモリ206または固定ディスク207へ転送する。また、カメラインターフェイス部209は、CPU205が発生した内部コマンドに従って、撮像部8に対して撮像指令を与える。   The camera interface unit 209 mediates data communication between the CPU 205 and the imaging unit 8. More specifically, the camera interface unit 209 includes an image buffer, temporarily accumulates measurement image data captured by the imaging unit 8 and continuously transmitted, and accumulates at least one frame of measurement image data. Then, the accumulated data is transferred to the memory 206 or the fixed disk 207. In addition, the camera interface unit 209 gives an imaging command to the imaging unit 8 in accordance with an internal command generated by the CPU 205.

制御情報インターフェイス部215は、CPU205と生産ラインを制御する図示しない制御装置(典型的には、PLC(Programmable Logic Controller)など)との間のデ
ータ通信を仲介する。制御情報インターフェイス部215は、外部の制御装置からライン情報などを受付けて、CPU205へ出力する。センサインターフェイス部217は、上述した光電センサなどからのトリガ信号を受信して、CPU205へ出力する。
The control information interface unit 215 mediates data communication between the CPU 205 and a control device (not shown) (typically, a programmable logic controller (PLC)) that controls the production line. The control information interface unit 215 receives line information and the like from an external control device and outputs them to the CPU 205. The sensor interface unit 217 receives a trigger signal from the above-described photoelectric sensor and outputs the trigger signal to the CPU 205.

その他の構成については、上述の支援装置100と同様であるので、詳細な説明は繰返さない。   Since other configurations are the same as those of support device 100 described above, detailed description will not be repeated.

<設置手順>
まず、本実施の形態に従う支援装置100を適用する視覚センサを生産ラインで運用する場合のワークフローについて説明する。
<Installation procedure>
First, a workflow when a visual sensor to which the support device 100 according to the present embodiment is applied is operated on a production line will be described.

図4は、視覚センサを生産ラインで運用する場合のワークフローの一例である。図4に示すように、まず、視覚センサを生産ラインに設置するまでの手順として、目的確定フェイズPH1および設置フェイズPH2がある。視覚センサが生産ラインに設置された後の手順として、初期撮像フェイズPH3、設置調整フェイズPH4、本格撮像フェイズPH5、初期設定フェイズPH6、調整フェイズPH7、および運用(改善)フェイズPH8がある。なお、初期撮像フェイズPH3と、設置調整フェイズPH4とは並列的に進行し、本格撮像フェイズPH5と、初期設定フェイズPH6および調整フェイズPH7とについても並列的に進行する。   FIG. 4 is an example of a workflow when the visual sensor is operated on the production line. As shown in FIG. 4, first, there are a purpose determination phase PH1 and an installation phase PH2 as procedures until the visual sensor is installed on the production line. As a procedure after the visual sensor is installed on the production line, there are an initial imaging phase PH3, an installation adjustment phase PH4, an actual imaging phase PH5, an initial setting phase PH6, an adjustment phase PH7, and an operation (improvement) phase PH8. Note that the initial imaging phase PH3 and the installation adjustment phase PH4 proceed in parallel, and the full-scale imaging phase PH5, the initial setting phase PH6, and the adjustment phase PH7 also proceed in parallel.

目的確定フェイズPH1では、作業者は、どのようなワークを検査対象とするか、およびどのような項目の検査をそのワークに行なうかを決定する。また、作業者は、ワーク全体のうち、どの範囲を検査対象とするのかを決定する。   In the purpose determination phase PH1, the operator determines what kind of work is to be inspected and what items are to be inspected for the work. Further, the worker determines which range of the entire workpiece is to be inspected.

続く設置フェイズPH2では、作業者は、設置環境に応じて、レンズおよびカメラの設置方法を検討し、撮像部等を駆動するための電源を確保した上で、必要な機材を設置する。   In the subsequent installation phase PH2, the worker examines the lens and camera installation methods according to the installation environment, secures a power source for driving the imaging unit and the like, and installs necessary equipment.

初期撮像フェイズPH3、設置調整フェイズPH4、本格撮像フェイズPH5、初期設定フェイズPH6では、作業者は、画像処理装置に対して、レンズおよびカメラの種類の選定、および画像処理装置で処理すべき項目を選択する。また、マッチング処理に用いる、処理項目に応じたモデル画像を登録する。さらに、作業者は、各処理項目のパラメータの初期値を設定する。このような各種設定が整った後、テスト的に撮像して得られた計測画像に対して、一連のフロー動作を確認する。   In the initial imaging phase PH3, the installation adjustment phase PH4, the full-scale imaging phase PH5, and the initial setting phase PH6, the operator selects the types of lenses and cameras for the image processing apparatus, and items to be processed by the image processing apparatus. select. In addition, a model image corresponding to a processing item used for matching processing is registered. Further, the operator sets initial values of parameters for each processing item. After such various settings have been made, a series of flow operations is confirmed for a measurement image obtained by taking a test image.

以上の作業によって、ワークを撮像する一連の設定(撮像部や撮像環境などの選定)は完了することになる。そして、画像処理装置に設定されるモデル画像およびパラメータが試行錯誤的に最適化される。それが、調整フェイズPH7であり、このフェイズでは、作業者は、試験ラインなどで画像処理によって得られる結果を検証するとともに、この検証内容に基づいて、モデル画像およびパラメータを最適化する。   With the above operation, a series of settings (selection of an imaging unit, an imaging environment, etc.) for imaging a workpiece is completed. Then, model images and parameters set in the image processing apparatus are optimized by trial and error. That is the adjustment phase PH7. In this phase, the operator verifies the result obtained by image processing on a test line or the like, and optimizes the model image and parameters based on the verification contents.

調整フェイズPH7でモデル画像およびパラメータが調整された後に、運用(改善)フェイズPH8に移り、視覚センサの運用が開始されるが、何らかの誤検出品が発生した場合などには、その要因を確認した上で、モデル画像および/またはパラメータが変更される。なお、誤検出品とは、たとえば、良品であるはずのワークを不良品と誤って判定したものや、不良品であるはずのワークを良品と誤って判定したものを意味する。なお、本明細書において、「安定」という用語は、上述のような誤検出品の発生が少ない状態を意味する。   After the model image and parameters have been adjusted in the adjustment phase PH7, the operation moves to the operation (improvement) phase PH8 and the operation of the visual sensor is started. Above, the model image and / or parameters are changed. The erroneously detected product means, for example, a product that is erroneously determined as a non-defective product or a product that is erroneously determined as a non-defective product. In the present specification, the term “stable” means a state in which the occurrence of erroneous detection products as described above is small.

本実施の形態に従う支援装置100は、これらのフェイズのうち、調整フェイズPH7および運用(改善)フェイズPH8における処理を効率化することを目的としている。また、一旦、モデル画像および/またはパラメータの調整が完了した後、運用中にロット変動などが生じた場合には、モデル画像および/またはパラメータを再度調整する必要があるが、このような場合にも、本実施の形態に従う支援装置100を活用することができる。さらに、運用(改善)フェイズPH8において、本実施の形態に従う支援装置100をインラインで用いることにより、生産ラインにおける状態に応じて、モデル画像を動的に変更することもできる。   The support device 100 according to the present embodiment aims to improve the efficiency of processing in the adjustment phase PH7 and the operation (improvement) phase PH8 among these phases. In addition, once the adjustment of the model image and / or parameters is completed, if a lot change occurs during operation, it is necessary to adjust the model image and / or parameters again. Also, the support device 100 according to the present embodiment can be utilized. Furthermore, in the operation (improvement) phase PH8, by using the support device 100 according to the present embodiment in-line, the model image can be dynamically changed according to the state in the production line.

<モデル画像取得手順の概要>
まず、本実施の形態に従う支援装置100におけるモデル画像取得処理の概要について説明する。
<Outline of model image acquisition procedure>
First, an overview of model image acquisition processing in support device 100 according to the present embodiment will be described.

図5は、この発明の実施の形態に従うモデル画像取得支援装置100におけるモデル画像取得処理の概要を説明するための図である。   FIG. 5 is a diagram for describing an overview of model image acquisition processing in model image acquisition support apparatus 100 according to the embodiment of the present invention.

(1)マッチング
図5を参照して、まず、モデルとなり得る被写体を撮像することで得られた参照画像からモデル画像の候補となる複数のモデル画像候補が抽出される。この参照画像は、典型的には、良品画像OK_IMGから構成されている。この参照画像は、後述する試行対象の画像群に含まれる良品画像OK_IMGと共通であってもよい。このモデル画像候補は、画像処理装置200に初期設定されている初期設定モデル画像に基づいて、参照画像(良品画像)に対してマッチング処理を行なうことで抽出される。
(1) Matching With reference to FIG. 5, first, a plurality of model image candidates that are model image candidates are extracted from a reference image obtained by imaging a subject that can be a model. This reference image is typically composed of a non-defective image OK_IMG. This reference image may be the same as a non-defective image OK_IMG included in a trial target image group described later. This model image candidate is extracted by performing a matching process on the reference image (non-defective image) based on the initial setting model image that is initially set in the image processing apparatus 200.

(2)モデル画像候補抽出
上述のマッチング処理は、一種のサーチ処理に相当し、初期設定モデル画像との類似度(相関値)が高い領域が、モデル画像として抽出される。なお、モデル画像は複数抽出されるが、この抽出方法としては、同一の参照画像から複数のモデル画像候補を抽出してもよいし、複数の参照画像の各々からモデル画像候補をそれぞれ抽出してもよいし、両者を適宜組み合わせてもよい。
(2) Model Image Candidate Extraction The above-described matching process corresponds to a kind of search process, and a region having a high similarity (correlation value) with the initially set model image is extracted as a model image. Although a plurality of model images are extracted, as this extraction method, a plurality of model image candidates may be extracted from the same reference image, or model image candidates are extracted from each of the plurality of reference images. Or they may be combined as appropriate.

同一の参照画像から複数のモデル画像候補を抽出する場合には、図6に示すように、複数の異なる条件(たとえば、抽出サイズや、抽出位置、抽出方向(回転方向)など)に従って、同一の参照画像から複数のモデル画像を抽出してもよい。あるいは、同一の条件に従って、複数の参照画像からそれぞれモデル画像を抽出してもよい。   When extracting a plurality of model image candidates from the same reference image, as shown in FIG. 6, the same model image is extracted according to a plurality of different conditions (for example, extraction size, extraction position, extraction direction (rotation direction), etc.). A plurality of model images may be extracted from the reference image. Alternatively, model images may be extracted from a plurality of reference images according to the same conditions.

図6は、この発明の実施の形態に従うモデル画像候補の抽出処理の一例を示す図である。図6(a)に示すように、同一の参照画像REFから、抽出サイズの異なる複数のモデル画像MDL1−1,MDL1−2,MDL1−3,・・・を抽出することができる。あるいは、図6(b)に示すように、同一の参照画像REFから、抽出方向の異なる複数のモデル画像MDL2−1,MDL2−2,・・・を抽出することもできる。   FIG. 6 is a diagram showing an example of model image candidate extraction processing according to the embodiment of the present invention. As shown in FIG. 6A, a plurality of model images MDL1-1, MDL1-2, MDL1-3,... With different extraction sizes can be extracted from the same reference image REF. Alternatively, as shown in FIG. 6B, a plurality of model images MDL2-1, MDL2-2,... With different extraction directions can be extracted from the same reference image REF.

本実施の形態に従う支援装置100は、複数のモデル画像候補の中から最適なモデル画像を決定することであるので、より多くのモデル画像を用意しておくことが好ましい。   Since support device 100 according to the present embodiment determines an optimal model image from among a plurality of model image candidates, it is preferable to prepare more model images.

(3)試行
再度図5を参照して、このように抽出された複数のモデル画像に従うマッチング処理を、上述の視覚センサが実際に取得した計測画像に対して実行することで、それぞれの試行結果を得る。この試行結果としては、典型的には、計測画像のそれぞれと、抽出された複数のモデル画像のそれぞれとの間の類似度(相関値)を含む。さらに、試行結果は、この算出された類似度と予め設定されたしきい値とを比較することで、マッチングOKまたはマッチングNGの判断結果を含んでいてもよい。
(3) Trial Referring again to FIG. 5, each trial result is obtained by executing matching processing according to the plurality of model images thus extracted on the measurement image actually acquired by the visual sensor. Get. The trial result typically includes a similarity (correlation value) between each of the measurement images and each of the extracted model images. Further, the trial result may include a determination result of matching OK or matching NG by comparing the calculated similarity with a preset threshold value.

(4)試行結果評価
さらに、対象の計測画像に対応付けられている期待クラスに基づいて、それぞれのモデル画像に従うマッチング処理の試行結果をそれぞれ評価することで、評価結果が生成される。より具体的には、あるモデル画像に従うマッチング処理を良品画像OK_IMGに対して行なった場合に得られる試行結果が「マッチングOK」となる度合いが高いほど、そのモデル画像はより適切であると評価できる。同様に、あるモデル画像に従うマッチング
処理を不良品画像NG_IMGに対して行なった場合に得られる試行結果が「マッチングNG」となる度合いが高いほど、そのモデル画像はより適切であると評価できる。
(4) Trial Result Evaluation Further, an evaluation result is generated by evaluating each trial result of the matching process according to each model image based on the expected class associated with the target measurement image. More specifically, the higher the degree that the trial result obtained when matching processing according to a certain model image is performed on the non-defective image OK_IMG is “matching OK”, the more appropriate the model image can be evaluated. . Similarly, it can be evaluated that the model image is more appropriate as the trial result obtained when the matching process according to a certain model image is performed on the defective product image NG_IMG is “matching NG”.

これに対して、あるモデル画像に従うマッチング処理を良品画像OK_IMGに対して行なった場合に得られる試行結果が「マッチングNG」と誤判断される度合いが高いほど、そのモデル画像は不適切であると評価できる。同様に、あるモデル画像に従うマッチング処理を不良品画像NG_IMGに対して行なった場合に得られる試行結果が「マッチングOK」と誤判断される度合いが高いほど、そのモデル画像は不適切であると評価できる。   In contrast, the higher the degree of misjudgment that the trial result obtained when matching processing according to a certain model image is performed on the non-defective image OK_IMG is “matching NG”, the more inappropriate the model image is. Can be evaluated. Similarly, the higher the degree of misjudgment that the trial result obtained when matching processing according to a certain model image is performed on the defective product image NG_IMG is “matching OK”, the more inappropriate the model image is evaluated. it can.

(5)最適モデル画像決定
本実施の形態に従う支援装置100は、このような試行結果と対象の計測画像の期待クラス(あるいは、期待値)との一致/不一致の度合いを統計的に評価する。そして、このような評価結果に基づいて、抽出されたモデル画像のうち最適なものを決定する。あるいは、最適なモデル画像を決定することを支援する。すなわち、本実施の形態に従う支援装置100が複数のモデル画像候補の別に評価結果を出力し、ユーザがこの評価結果に基づいて最適なモデル画像を任意に選択する構成、ならびに、本実施の形態に従う支援装置100が評価結果のうち所定の条件に最も適合しているモデル画像を自動的に決定する構成、のいずれをも採用することができる。
(5) Determination of Optimal Model Image Supporting apparatus 100 according to the present embodiment statistically evaluates the degree of coincidence / mismatch between such a trial result and the expected class (or expected value) of the target measurement image. And based on such an evaluation result, the optimal thing is determined among the extracted model images. Alternatively, it assists in determining an optimal model image. That is, the support apparatus 100 according to the present embodiment outputs an evaluation result for each of a plurality of model image candidates, and the user arbitrarily selects an optimal model image based on the evaluation result, as well as the present embodiment. Any of the configurations in which the support device 100 automatically determines a model image that best matches a predetermined condition among the evaluation results can be employed.

なお、本明細書における「最適なモデル画像」とは、ユーザが期待する結果を得ることができるモデル画像を探し出すことを意味する。この探し出す対象は、予め取得された計測画像に対して評価を行なうことで、ユーザが期待する(設定した)条件に合致するモデル画像を決定される。そのため、新たに計測画像が取得された場合や、ユーザが条件を変更した場合などには、別のモデル画像が「最適な」ものとして決定される場合もある。   Note that “optimum model image” in this specification means searching for a model image that can obtain the result expected by the user. As the object to be searched for, a model image that matches a condition expected (set) by the user is determined by evaluating a measurement image acquired in advance. Therefore, when a new measurement image is acquired or when the user changes the condition, another model image may be determined as “optimal”.

さらに、このように取得されたモデル画像を、画像処理装置200へ転送して設定することもできる。   Furthermore, the model image acquired in this way can be transferred to the image processing apparatus 200 and set.

なお、出力される評価結果としては、平均値、中間値、最大値、最小値、分散値などの統計的出力を含んでいてもよい。   The output evaluation result may include statistical outputs such as an average value, an intermediate value, a maximum value, a minimum value, and a variance value.

<機能構成>
図7は、この発明の実施の形態に従う支援装置100および画像処理装置200の機能構成を示す概略図である。
<Functional configuration>
FIG. 7 is a schematic diagram showing functional configurations of support apparatus 100 and image processing apparatus 200 according to the embodiment of the present invention.

図7(a)を参照して、本実施の形態に従う画像処理装置200は、計測画像取得アプリケーション10と、画像処理アプリケーション30Aとを含む。計測画像取得アプリケーション10は、撮像部8およびカメラインターフェイス部209(図3)に対して所定のコマンドを与えることで、ワークを撮像した計測画像を取得する。また、画像処理アプリケーション30Aは、計測画像取得アプリケーション10により取得される計測画像に対して、予め設定されているモデル画像およびパラメータに従う画像処理(本実施の形態では、主としてマッチング処理)を行なうことで、処理結果を出力する。   With reference to Fig.7 (a), the image processing apparatus 200 according to this Embodiment contains the measurement image acquisition application 10 and 30 A of image processing applications. The measurement image acquisition application 10 acquires a measurement image obtained by imaging a workpiece by giving a predetermined command to the imaging unit 8 and the camera interface unit 209 (FIG. 3). Further, the image processing application 30A performs image processing (mainly matching processing in the present embodiment) on the measurement image acquired by the measurement image acquisition application 10 according to a preset model image and parameters. , Output the processing result.

一方、支援装置100は、評価処理アプリケーション20と、画像処理アプリケーション30Bとを含む。画像処理アプリケーション30Bの機能は、基本的には、画像処理アプリケーション30Aと同様である。すなわち、画像処理アプリケーション30Bは、画像処理装置200で実行されるマッチング処理と同じ処理を実現するための、一種の「シミュレータ」として機能する。評価処理アプリケーション20は、本実施の形態に従うモデル画像取得処理を提供する主たる部分であり、参照画像から複数のモデル画像を抽出す
るとともに、それぞれのモデル画像に基づくマッチング処理(試行)を画像処理アプリケーション30Bに実行させる。そして、評価処理アプリケーション20は、画像処理アプリケーション30Bによる試行結果を、対象の計測画像に対応付けられた期待クラスに基づいて評価することで、最適なモデル画像の取得を支援する。
On the other hand, the support apparatus 100 includes an evaluation processing application 20 and an image processing application 30B. The function of the image processing application 30B is basically the same as that of the image processing application 30A. That is, the image processing application 30B functions as a kind of “simulator” for realizing the same processing as the matching processing executed by the image processing apparatus 200. The evaluation processing application 20 is a main part that provides the model image acquisition processing according to the present embodiment, extracts a plurality of model images from the reference image, and performs matching processing (trial) based on each model image. 30B is executed. Then, the evaluation processing application 20 supports the acquisition of an optimal model image by evaluating the trial result by the image processing application 30B based on the expected class associated with the target measurement image.

すなわち、図7(a)に示すシステム構成においては、画像処理装置200で取得された計測画像(および参照画像)に基づいて、支援装置100単体で最適なモデル画像の取得を支援することができる。   That is, in the system configuration shown in FIG. 7A, it is possible to support acquisition of an optimal model image by the support device 100 alone based on the measurement image (and the reference image) acquired by the image processing device 200. .

一方、図7(b)には、本実施の形態の別形態に従うシステム構成を示す。このシステムにおいては、支援装置100#は、画像処理アプリケーション30Bを含んでおらず、評価処理アプリケーション20のみを含む。この構成においては、評価処理アプリケーション20は、画像処理装置200の画像処理アプリケーション30Aと協働することで、最適なモデル画像の取得を支援する。すなわち、支援装置100と画像処理装置200とをデータ通信可能な状態に接続しておき、支援装置100の評価処理アプリケーション20が画像処理装置200の画像処理アプリケーション30Aに各種指令を与えてマッチング処理を実行させ、その処理結果を画像処理装置200の画像処理アプリケーション30Aが支援装置100の評価処理アプリケーション20へ返送するようにしてもよい。このように支援装置100と画像処理装置200とを同期させることで、処理を進めることもできる。   On the other hand, FIG. 7B shows a system configuration according to another embodiment of the present embodiment. In this system, support device 100 # does not include image processing application 30B, but includes only evaluation processing application 20. In this configuration, the evaluation processing application 20 supports the acquisition of an optimal model image by cooperating with the image processing application 30A of the image processing apparatus 200. That is, the support apparatus 100 and the image processing apparatus 200 are connected in a state where data communication is possible, and the evaluation processing application 20 of the support apparatus 100 gives various instructions to the image processing application 30A of the image processing apparatus 200 to perform matching processing. The image processing application 30A of the image processing apparatus 200 may return the processing result to the evaluation processing application 20 of the support apparatus 100. As described above, the processing can be advanced by synchronizing the support apparatus 100 and the image processing apparatus 200.

なお、以下の説明では、画像処理装置200に含まれる画像処理アプリケーション30Aと、支援装置100に含まれる画像処理アプリケーション30Bとを、その機能の共通性に着目して、単に「画像処理アプリケーション30」とも総称する。   In the following description, the image processing application 30A included in the image processing apparatus 200 and the image processing application 30B included in the support apparatus 100 are simply referred to as “image processing application 30”, focusing on the commonality of the functions. Also collectively referred to.

<画像処理アプリケーションのユーザインターフェイス>
まず、画像処理に係るマッチング処理についての理解を容易にするために、画像処理アプリケーション30(図7)によって提供されるユーザインターフェイスの一例について説明する。
<User interface of image processing application>
First, an example of a user interface provided by the image processing application 30 (FIG. 7) will be described in order to facilitate understanding of the matching processing related to image processing.

図8は、この発明の実施の形態に従う画像処理アプリケーション30によって提供される設定モードにおける画面表示例を示す図である。なお、この設定モードは、基本的には、上述の初期設定フェイズPH6において選択される。図8に示す表示画面は、画像処理装置200のCPU205(または、支援装置100のCPU105)および図示しないグラフィックボードなどが協働することで提供される。このような表示画面は、OS(Operating System)の一部として組込まれるGUI(Graphical User Interface)プログラムによって実現され、またGUIは、ユーザがキーボード103(または、203)やマウス104(または、204)により操作される画面上のカーソルを用いて、さまざまなユーザ設定を行なうための環境も提供する。   FIG. 8 is a diagram showing a screen display example in the setting mode provided by the image processing application 30 according to the embodiment of the present invention. This setting mode is basically selected in the above-described initial setting phase PH6. The display screen shown in FIG. 8 is provided by the cooperation of the CPU 205 of the image processing apparatus 200 (or the CPU 105 of the support apparatus 100) and a graphic board (not shown). Such a display screen is realized by a GUI (Graphical User Interface) program incorporated as a part of an OS (Operating System), and the user can use the keyboard 103 (or 203) or the mouse 104 (or 204). It also provides an environment for performing various user settings using the cursor on the screen operated by.

図8に示すように、マッチング処理を用いてサーチを行なうモードでは、一例として、「モデル登録」、「領域設定」、「検出点」、「基準位置」、「計測パラメータ」、「出力パラメータ」の設定項目に対応する計6個のタブが選択可能な画面が表示される。   As shown in FIG. 8, in the mode for performing the search using the matching process, as an example, “model registration”, “area setting”, “detection point”, “reference position”, “measurement parameter”, “output parameter” A screen on which a total of six tabs corresponding to the setting items can be selected is displayed.

図8を参照して、「モデル登録」のタブ301が選択されると、設定画面300が表示される。この設定画面300は、モデル登録エリア301#と、画像表示エリア304と、全体表示エリア306と、表示制御アイコン群308とを含む。   Referring to FIG. 8, when a “model registration” tab 301 is selected, a setting screen 300 is displayed. This setting screen 300 includes a model registration area 301 #, an image display area 304, an entire display area 306, and a display control icon group 308.

画像表示エリア304には、撮像部8により取得された計測画像が表示される。全体表示エリア306には、画像表示エリア304と同様に撮像部8で取得された計測画像が表
示される。但し、全体表示エリア306には、画像表示エリア304での表示範囲とは独立して、対象の計測画像の全体が表示される。さらに、表示制御アイコン群308に対するユーザ操作(拡大もしくは縮小など)に応じて、画像表示エリア304に表示される計測画像の表示範囲および表示精度が変更される。
In the image display area 304, a measurement image acquired by the imaging unit 8 is displayed. In the entire display area 306, the measurement image acquired by the imaging unit 8 is displayed as in the image display area 304. However, the entire measurement image is displayed in the entire display area 306 independently of the display range in the image display area 304. Further, the display range and display accuracy of the measurement image displayed in the image display area 304 are changed according to a user operation (enlargement or reduction) on the display control icon group 308.

一方、モデル登録エリア301#には、モデルパラメータ設定エリア310と、モデル編集ボタン330と、登録図形表示ボックス332と、モデルパラメータ設定エリア310と、モデル登録画像エリア340とが表示される。   On the other hand, a model parameter setting area 310, a model edit button 330, a registered figure display box 332, a model parameter setting area 310, and a model registration image area 340 are displayed in the model registration area 301 #.

ユーザがモデル画像を設定する場合には、モデルとなり得る被写体を撮像することで得られた参照画像を画像表示エリア304および全体表示エリア306に表示させた状態で操作を行なう。   When the user sets a model image, the operation is performed in a state where a reference image obtained by imaging a subject that can be a model is displayed in the image display area 304 and the entire display area 306.

まず、ユーザは、マウス204などを操作してモデル編集ボタン330を押下すると、図示しない描画ツールダイアログが表示される。ユーザは、この描画ツールダイアログを操作して、画像表示エリア304に表示される参照画像(計測画像)の上に重ねてモデル画像として設定すべき範囲を指定する。図8には、画像表示エリア304上に文字列「ABC」を含む長方形の範囲がモデル画像MDLとして設定されている場合を示す。何らかのモデル画像が設定済である場合には、登録図形表示ボックス332に、設定済のモデル画像の形状が表示される(図8の場合には、「長方形」)。なお、設定するモデル画像の形状は、長方形に限られず、丸、扇形、任意の多角形といった、いずれの形状であってもよい。   First, when the user operates the mouse 204 or the like and presses the model editing button 330, a drawing tool dialog (not shown) is displayed. The user operates this drawing tool dialog to designate a range to be set as a model image on the reference image (measurement image) displayed in the image display area 304. FIG. 8 shows a case where a rectangular range including the character string “ABC” is set as the model image MDL on the image display area 304. If any model image has been set, the shape of the set model image is displayed in the registered figure display box 332 (“rectangle” in the case of FIG. 8). Note that the shape of the model image to be set is not limited to a rectangle, and may be any shape such as a circle, a sector, or an arbitrary polygon.

また、設定済のモデル画像の設定変更などを行なう場合には、ユーザはモデル登録画像エリア340の必要なボタンを押下する。モデル画像の設定に用いられた参照画像(計測画像)が保存されており、後から設定済のモデル画像に関するパラメータだけを変更することもできる。より具体的には、登録画面表示ボタン342が押下されると、モデル画像の設定に用いられた参照画像(計測画像)が表示される。このボタン342が再度押下されると、現在入力されている計測画像の表示に切り替わる。また、モデル再登録ボタン344が押下されると、設定済のモデル画像はそのままで、それ以外のパラメータが変更された状態でモデル画像として再設定される。さらに、削除ボタン346が押下されると、設定済のモデル画像が削除される。   In addition, when changing the setting of a set model image, the user presses a necessary button in the model registration image area 340. A reference image (measurement image) used for setting the model image is stored, and only parameters relating to the set model image can be changed later. More specifically, when the registration screen display button 342 is pressed, the reference image (measurement image) used for setting the model image is displayed. When this button 342 is pressed again, the display switches to the display of the currently input measurement image. When the model re-registration button 344 is pressed, the set model image is left as it is and is reset as a model image with other parameters changed. Further, when the delete button 346 is pressed, the set model image is deleted.

モデルパラメータ設定エリア310は、設定項目として、サーチモードの選択を受付ける。サーチモードは、モデル画像との類似度を算出するためのアルゴリズムの選択である。このサーチモードについては、ラジオボタン312を操作することで、「相関」および「形状」のいずれかを選択できる。「相関」は、入力された計測画像の明るさを正規化した上でモデル画像との相関値を算出することで類似度を計測するアルゴリズムである。一方、「形状」は、モデル画像の輪郭形状との一致度に基づいて類似度を計測するアルゴリズムである。一般的には、「相関」モードの方が安定した計測が可能である。   Model parameter setting area 310 accepts selection of a search mode as a setting item. The search mode is selection of an algorithm for calculating the similarity with the model image. In this search mode, either “correlation” or “shape” can be selected by operating the radio button 312. “Correlation” is an algorithm for measuring similarity by calculating a correlation value with a model image after normalizing the brightness of an input measurement image. On the other hand, “shape” is an algorithm for measuring the similarity based on the degree of coincidence with the contour shape of the model image. Generally, more stable measurement is possible in the “correlation” mode.

このサーチモードにおいて「相関」が選択されると、「回転」、「安定度」、「精度」の設定が可能となる。一方、サーチモードにおいて「形状」が選択されると、「回転範囲」および「安定度」の設定が可能となる。   When “Correlation” is selected in this search mode, “Rotation”, “Stability”, and “Accuracy” can be set. On the other hand, when “shape” is selected in the search mode, “rotation range” and “stability” can be set.

「回転」では、ワークが回転するような場合に、設定済のモデル画像を所定の角度ずつ回転させた複数のモデル画像を内部的に生成し、生成したそれぞれのモデル画像に基づいて類似度を計測する処理に係るパラメータが指定される。すなわち、回転のチェックボックス314がチェックされると、回転の処理が有効化される。そして、数値ボックス315に、回転範囲(回転角度上限値および回転角度下限値)および刻み角度がそれぞれ入力
されると、回転範囲の範囲にわたって、刻み角度ずつ回転させたモデル画像を生成することが指定される。一般的には、刻み角度が小さいほど安定性は高くなるが、処理時間は長くなる。なお、高速に回転サーチを行なうことが可能なスマートモードを設定することも可能である。
In “Rotation”, when the workpiece rotates, a plurality of model images obtained by rotating a set model image by a predetermined angle are internally generated, and the similarity is calculated based on the generated model images. Parameters related to the process to be measured are specified. That is, when the rotation check box 314 is checked, the rotation process is validated. Then, when the rotation range (rotation angle upper limit value and rotation angle lower limit value) and the step angle are respectively input to the numerical value box 315, it is specified that a model image rotated by the step angle over the rotation range range is generated. Is done. In general, the smaller the step angle, the higher the stability, but the longer the processing time. It is also possible to set a smart mode capable of performing a rotation search at high speed.

「安定度」では、計測の安定度と処理速度とのいずれを優先するのかが設定される。すなわち、スライドバー316は、所定幅(たとえば、1〜15)の範囲でいずれかの値に設定され、この設定される値が小さいほど処理時間が短縮され、この値が大きいほど安定度が高められる。   In “Stability”, which of the measurement stability and the processing speed is prioritized is set. That is, the slide bar 316 is set to any value within a range of a predetermined width (for example, 1 to 15), and the processing time is shortened as the set value is smaller, and the stability is increased as the value is larger. It is done.

「精度」では、計測の位置精度と処理速度とのどちらを優先するのかが設定される。すなわち、スライドバー318は、所定幅(たとえば、1〜3)の範囲でいずれかの値に設定され、この設定される値が小さいほど処理時間が短縮され、この値が大きいほど精度が高められる。   In “Accuracy”, which of the measurement position accuracy and the processing speed is prioritized is set. That is, the slide bar 318 is set to any value in a range of a predetermined width (for example, 1 to 3). The smaller the set value, the shorter the processing time, and the larger the value, the higher the accuracy. .

上述したような内容がユーザによって設定された後、OKボタン307が押下されることで、画像処理装置200の内部パラメータとして反映される。なお、キャンセルボタン309が押下された場合には、未反映のパラメータはリセットされる。このようなモデル画像の設定に続いて、「領域設定」のタブ302が選択されると、モデル画像と一致する部分を探す範囲を指定するための設定画面が表示される(図示しない)。この設定画面では、ユーザは、画像表示エリア304上で任意の範囲をサーチ領域として設定することができる。なお、入力計測画像の全体をサーチ領域とすることもできるが、処理時間を短縮する観点からは、特定の範囲にサーチ領域を制限することが好ましい。   After the contents as described above are set by the user, when an OK button 307 is pressed, it is reflected as an internal parameter of the image processing apparatus 200. If the cancel button 309 is pressed, the unreflected parameter is reset. When the “area setting” tab 302 is selected following the setting of the model image, a setting screen for designating a range to search for a portion matching the model image is displayed (not shown). On this setting screen, the user can set an arbitrary range as a search area on the image display area 304. Although the entire input measurement image can be used as the search area, it is preferable to limit the search area to a specific range from the viewpoint of reducing the processing time.

領域設定の入力に続いて、「計測パラメータ」のタブ303が選択されると、計測された各座標における類似度(相関値)のうち、モデル画像とマッチングする(「OK」である)と判定するための条件などを受付ける。   When the “measurement parameter” tab 303 is selected following the input of the area setting, it is determined that the similarity (correlation value) in each measured coordinate matches the model image (is “OK”). Accept the conditions to do.

<計測画像の期待クラス>
視覚センサなどでは、設定済のモデル画像と実質的に同一の内容を含む計測画像に対してはマッチングOKを出力し、登録済のモデル画像と類似してはいるが本質的に異なる内容を含む計測画像に対してはマッチングNGを出力しなければならない。
<Expected class of measurement image>
In a visual sensor or the like, matching OK is output for a measurement image that includes substantially the same content as a set model image, and includes content that is similar to, but essentially different from, a registered model image. Matching NG must be output for the measurement image.

たとえば、上述の図8に示すように、文字列「ABC」を含むモデル画像MDLが設定されているものとする。このような場合に、図9に示す計測画像が入力された場合について考える。   For example, it is assumed that a model image MDL including a character string “ABC” is set as shown in FIG. Consider the case where the measurement image shown in FIG. 9 is input in such a case.

図9は、この発明の実施の形態に従う画像処理装置200のモニタに表示される稼動モードにおける画面表示例を示す図である。図9(a)に示すように、設定済のモデル画像MDLに含まれる文字列「ABC」がプリントされたワークを撮像した計測画像が入力された場合には、対応する領域が最も高い類似度(相関値)をもつ領域として検出される。このとき、検出された領域について計測された類似度(相関値)に基づいて、必ず、マッチングOKと判定されなければならない。一方、図9(b)に示すように、設定済のモデル画像MDLに含まれる文字列「ABC」とは異なる文字列「BCD」がプリントされたワークを撮像した計測画像が入力された場合には、マッチングNGと判定されなければならない。   FIG. 9 is a diagram showing a screen display example in the operation mode displayed on the monitor of the image processing apparatus 200 according to the embodiment of the present invention. As shown in FIG. 9A, when a measurement image obtained by capturing a work on which the character string “ABC” included in the set model image MDL is printed is input, the corresponding area has the highest similarity. It is detected as a region having (correlation value). At this time, matching OK must be determined based on the similarity (correlation value) measured for the detected area. On the other hand, as shown in FIG. 9B, when a measurement image obtained by imaging a work on which a character string “BCD” different from the character string “ABC” included in the set model image MDL is printed is input. Must be determined as matching NG.

したがって、文字列「ABC」を含むモデル画像MDLが設定されている場合において、図9(a)に示す計測画像の期待クラスは、「良品(良品画像)」あるいは「OK」であり、図9(b)に示す計測画像の期待クラスは、「不良品(不良品画像)」あるいは「
NG」である。
Therefore, when the model image MDL including the character string “ABC” is set, the expected class of the measurement image shown in FIG. 9A is “good product (good product image)” or “OK”. The expected class of the measurement image shown in (b) is “defective product (defective product image)” or “
NG ".

このように、本実施の形態に従う支援装置100では、計測画像のそれぞれについて、良品および不良品のいずれであるかといった期待クラスが既知である状態を前提とする。   As described above, in support device 100 according to the present embodiment, it is assumed that an expected class such as a non-defective product or a defective product is known for each measurement image.

なお、画像処理装置200のパラメータの調整フェイズにおいて、実際に計測画像を取得する方法としては、生産ラインにテスト用のワークを流して連続的にそれを撮像する。このとき、取得された計測画像のそれぞれについて、ユーザが内容を確認した上で、期待クラスをそれぞれに対して入力するようにしてもよい。あるいは、より省力化を図る観点からは、予め、「良品」として検出されるべきワークと、「不良品」として検出されるべきワークとを区別しておき、「良品」のワークのみを連続的に撮影し、続いて「不良品」のワークのみを連続的に撮影するといった方法が効率的である。このような方法を用いた場合には、「良品」のワークを撮像して得られた計測画像と、「不良品」のワークを撮像して得られた計測画像とを、異なるフォルダにそれぞれ格納することで、容易に両者を区別することができる。   Note that, in the parameter adjustment phase of the image processing apparatus 200, as a method of actually acquiring the measurement image, a test work is flowed on the production line and images are continuously captured. At this time, the expected class may be input to each of the acquired measurement images after the user confirms the contents. Alternatively, from the viewpoint of further labor saving, a workpiece that should be detected as “good” and a workpiece that should be detected as “defective” are distinguished in advance, and only “good” workpieces are continuously detected. It is efficient to take a picture, and then continuously photograph only the “defective product”. When such a method is used, a measurement image obtained by imaging a “good” workpiece and a measurement image obtained by imaging a “defective” workpiece are stored in different folders, respectively. By doing so, both can be easily distinguished.

<評価処理アプリケーションのユーザインターフェイス>
次に、図10〜図14を参照して、支援装置100の評価処理アプリケーション20(図7)によって提供されるユーザインターフェイスの一例について説明する。図10〜図14に示す表示画面は、支援装置100のCPU105および図示しないグラフィックボードなどが協働することで提供される。このような表示画面は、OS(Operating System)の一部として組込まれるGUI(Graphical User Interface)プログラムによって実現され、またGUIは、ユーザがキーボード103やマウス104により操作される画面上のカーソルを用いて、さまざまなユーザ設定を行なうための環境も提供する。
<User interface of evaluation processing application>
Next, an example of a user interface provided by the evaluation processing application 20 (FIG. 7) of the support apparatus 100 will be described with reference to FIGS. 10 to 14 are provided by the cooperation of the CPU 105 of the support apparatus 100 and a graphic board (not shown). Such a display screen is realized by a GUI (Graphical User Interface) program incorporated as part of an OS (Operating System), and the GUI uses a cursor on the screen operated by the user with the keyboard 103 or the mouse 104. Provides an environment for various user settings.

(1 変動設定)
まず、支援装置100において、評価処理アプリケーション20(図7)の実行がユーザにより指示されると、図10に示すような入力画面400Aが表示される。この入力画面400Aでは、評価処理アプリケーション20と画像処理アプリケーション30とを同期するためのボタン402と、計測画像および計測画像に対応付けられた期待クラスを入力するためのボタン404と、調整対象を指定するためのボタン406とが選択可能に表示される。
(1 Fluctuation setting)
First, in the support apparatus 100, when the user instructs execution of the evaluation processing application 20 (FIG. 7), an input screen 400A as shown in FIG. 10 is displayed. In this input screen 400A, a button 402 for synchronizing the evaluation processing application 20 and the image processing application 30, a button 404 for inputting a measurement image and an expected class associated with the measurement image, and an adjustment target are designated. A button 406 for performing selection is displayed so as to be selectable.

ユーザがマウス104などを操作してボタン402を押下すると、図示しない設定ダイアログが表示される。ユーザは、この設定ダイアログ上で、試行を実行するための画像処理アプリケーション30を選択する。すなわち、ユーザは、試行を実行するために用いる画像処理アプリケーション30として、画像処理装置200に実装されている画像処理アプリケーション30Aおよび支援装置100に実装されている画像処理アプリケーション30Bのいずれかを選択する。この選択により、評価処理アプリケーション20と画像処理アプリケーション30Aまたは30Bとの間で同期が確立される。   When the user operates the mouse 104 or the like to press the button 402, a setting dialog (not shown) is displayed. The user selects the image processing application 30 for executing the trial on this setting dialog. That is, the user selects one of the image processing application 30A installed in the image processing apparatus 200 and the image processing application 30B installed in the support apparatus 100 as the image processing application 30 used for executing the trial. . By this selection, synchronization is established between the evaluation processing application 20 and the image processing application 30A or 30B.

次に、図11を参照して、ユーザがマウス104などを操作してボタン404を押下すると、対象となる計測画像および計測画像に対応付けられた期待クラスを入力するためのダイアログ414などが表示される。ここでは、各計測画像が1つのファイルとして存在し、かつそれぞれのファイルはその期待クラス(この例では、「良品」(OK)あるいは「不良品」(NG)の2通り)に区別されたフォルダ416Aおよび416Bにそれぞれ格納されているものとする。このとき、ユーザが対象の計測画像が格納されているより上位のフォルダ416(図11に示す例では、フォルダ名が「111」)を指定することで、「111」フォルダ416の下位にある「OK」フォルダ416A内にある計測画像が「良品」の期待クラスに対応付けられており、一方、「NG」フォルダ416B内にある
計測画像が「不良品」の期待クラスに対応付けられていることが指定される。
Next, referring to FIG. 11, when the user operates the mouse 104 or the like and presses the button 404, a dialog 414 for inputting a target measurement image and an expected class associated with the measurement image is displayed. Is done. Here, each measurement image exists as one file, and each file is a folder that is distinguished by its expected class (in this example, “good product” (OK) or “defective product” (NG)). Assume that the data are stored in 416A and 416B, respectively. At this time, when the user designates a higher folder 416 (in the example shown in FIG. 11, the folder name is “111”) in which the target measurement image is stored, the “111” folder 416 is subordinate to “ The measurement image in the “OK” folder 416A is associated with the expected class of “non-defective product”, while the measurement image in the “NG” folder 416B is associated with the expected class of “defective product”. Is specified.

なお、計測画像および計測画像に対応付けられた期待クラスの入力方法の別形態については後述する。   In addition, another form of the input method of the expected class associated with the measurement image and the measurement image will be described later.

次に、図12を参照して、ユーザがマウス104などを操作してボタン406を押下すると、モデル画像取得処理の対象とする項目および最適なモデル画像を探索するためのパラメータを入力するためのダイアログ420が表示される。このダイアログ420には、調整対象ユニットを選択するためのプルダウンメニュー442と、参照対象ユニットを選択するためのプルダウンメニュー444と、調整モードを選択するためのプルダウンメニュー446とを含む。プルダウンメニュー442では、調整されるモデル画像が用いられる処理項目の指定を受付ける。プルダウンメニュー444では、他の画像処理の結果を用いて処理を行なう場合などに、参照対象の処理項目の指定を受付ける。プルダウンメニュー446では、調整モードの指定を受付ける。この調整モードは、典型的には、パラメータ変動モード、画像変動モード、領域変動モードの3つを含む。パラメータ変動モードが選択された場合には、画像処理に係るパラメータを最適化する場合に選択される。画像変動モードが選択された場合には、マッチング処理に用いられるモデル画像を最適化する場合に選択される。領域変動モードが選択された場合には、マッチング処理に用いられるモデル画像として抽出する領域を最適化する場合に選択される。   Next, referring to FIG. 12, when the user operates the mouse 104 or the like and presses the button 406, an item for inputting a model image acquisition process target and a parameter for searching for an optimal model image are input. A dialog 420 is displayed. This dialog 420 includes a pull-down menu 442 for selecting an adjustment target unit, a pull-down menu 444 for selecting a reference target unit, and a pull-down menu 446 for selecting an adjustment mode. In the pull-down menu 442, designation of a processing item in which the model image to be adjusted is used is accepted. The pull-down menu 444 accepts designation of a processing item to be referred to when processing is performed using the result of other image processing. In the pull-down menu 446, the designation of the adjustment mode is accepted. This adjustment mode typically includes three modes: a parameter variation mode, an image variation mode, and a region variation mode. When the parameter variation mode is selected, it is selected when optimizing the parameters related to image processing. When the image variation mode is selected, it is selected when optimizing the model image used for the matching process. When the region variation mode is selected, the region variation mode is selected when the region to be extracted as a model image used for the matching process is optimized.

これらの操作により、選択されたマッチング処理について既に設定されているモデル画像(初期設定モデル画像)および関連するパラメータの現在値が取得される。なお、支援装置100が画像処理装置200とデータ通信可能に接続されている場合には、画像処理装置200で設定されている内容が、支援装置100へ転送される。   By these operations, the model image (initial setting model image) that has already been set for the selected matching process and the current values of the related parameters are acquired. If the support apparatus 100 is connected to the image processing apparatus 200 so that data communication is possible, the contents set in the image processing apparatus 200 are transferred to the support apparatus 100.

以上のような内容の設定が完了すると、初期設定されているモデル画像の設定/変更を行なうためのボタン409と、試行対象のモデル画像候補を設定するためのボタン410と、試行の開始を指示するボタン408と、選択されたモデル画像を画像処理装置200などに反映するためのボタン412とが選択可能に表示される。   When the setting of the contents as described above is completed, a button 409 for setting / changing an initially set model image, a button 410 for setting a model image candidate to be tried, and an instruction to start trial And a button 412 for reflecting the selected model image on the image processing apparatus 200 and the like are displayed in a selectable manner.

次に、ユーザがマウス104などを操作してボタン409を押下すると、初期設定モデル画像の選択を受付けるためのダイアログ(図示しない)が表示される。ユーザは、このダイアログに対して操作を行なうことで、初期設定モデル画像とするべきファイルを指定する。   Next, when the user operates the mouse 104 or the like to press the button 409, a dialog (not shown) for accepting selection of the initial setting model image is displayed. The user designates a file to be used as the default model image by performing an operation on this dialog.

次に、ユーザがマウス104などを操作してボタン410を押下すると、参照画像の設定を受付けるためのダイアログ(図示しない)が表示される。ユーザは、このダイアログに対して操作を行なうことで、参照画像とするべきファイルを指定する。典型的には、参照画像として良品画像を用いる場合には、ユーザは、良品画像が格納されているフォルダを指定する。当然のことながら、良品画像とは独立して参照画像を用意している場合には、この参照画像のファイルを直接指定してもよい。このようにユーザによって参照画像が指定されると、図13に示すようなダイアログ430が表示される。このダイアログ430には、番号フィールド432と、画像ファイルパスフィールド434とを含むテーブルが表示される。番号フィールド432および画像ファイルパスフィールド434には、参照画像とすべき画像ファイル名がファイルパス名とともに一覧表示される。なお、番号フィールド432に表示される番号(ID)は、内部処理において参照画像を特定する識別情報であり、参照画像毎にユニークに定められている。   Next, when the user operates the mouse 104 or the like to press the button 410, a dialog (not shown) for accepting reference image settings is displayed. The user designates a file to be used as a reference image by operating this dialog. Typically, when a non-defective image is used as the reference image, the user designates a folder in which the non-defective image is stored. Of course, when a reference image is prepared independently of a non-defective image, the file of the reference image may be directly specified. When the reference image is designated by the user in this way, a dialog 430 as shown in FIG. 13 is displayed. In this dialog 430, a table including a number field 432 and an image file path field 434 is displayed. In the number field 432 and the image file path field 434, image file names to be used as reference images are listed together with file path names. The number (ID) displayed in the number field 432 is identification information for specifying the reference image in the internal processing, and is uniquely determined for each reference image.

そして、ユーザがマウス104などを操作して試行追加ボタン422を押下すると、その時点において設定されている参照画像に対して、モデル画像が抽出されるとともに、抽
出されたモデル画像に対して試行番号が内部的に割当てられる。この内部的に割当てられた試行番号に応じて、試行回数に相当する参照画像の枚数表示426が更新される。そして、閉じるボタン424が押下されると、ダイアログ430が閉じられる。
When the user operates the mouse 104 or the like and presses the trial addition button 422, a model image is extracted from the reference image set at that time, and the trial number is extracted from the extracted model image. Are allocated internally. The reference image number display 426 corresponding to the number of trials is updated according to the trial number assigned internally. When the close button 424 is pressed, the dialog 430 is closed.

さらに、ユーザがマウス104などを操作して、試行の開始を指示するボタン408を押下すると、ダイアログ430において入力された変動設定に従って、パラメータの評価処理が開始される。   Further, when the user operates the mouse 104 or the like and presses the button 408 for instructing the start of the trial, the parameter evaluation process is started according to the variation setting input in the dialog 430.

(2 評価結果)
図14には、すべての試行が完了した場合に表示される評価結果画面400Bを示す。なお、図14には、すべての試行が完了した結果を示すが、この結果を試行の完了後に一斉に表示する形態だけでなく、開始とともに枠自体は表示させておき、試行の進行に伴って、対応する数値が順次表示されるようにしてもよい。
(2 Evaluation results)
FIG. 14 shows an evaluation result screen 400B displayed when all trials are completed. FIG. 14 shows the result of all trials being completed. Not only is the result displayed all at once after the trials are completed, but also the frame itself is displayed at the start, and as the trials progress. Corresponding numerical values may be sequentially displayed.

評価結果画面400Bでは、モデル画像候補の別に評価結果が出力される。より具体的には、評価結果画面400Bには、試行番号フィールド452と、試行済フィールド454と、誤検出フィールド456と、良品画像誤検出フィールド458と、不良品画像誤検出フィールド460と、最大計測時間フィールド462と、良品画像相関値平均フィールド464と、不良品画像相関値平均フィールド466と、良品画像相関値3σフィールド468と、不良品画像相関値3σフィールド470とを含むテーブルが表示される。   On the evaluation result screen 400B, an evaluation result is output for each model image candidate. More specifically, the evaluation result screen 400B includes a trial number field 452, a tried field 454, a false detection field 456, a non-defective image false detection field 458, a bad product image false detection field 460, and a maximum measurement. A table including a time field 462, a non-defective product image correlation value average field 464, a non-defective product image correlation value average field 466, a non-defective product image correlation value 3σ field 468, and a non-defective product image correlation value 3σ field 470 is displayed.

試行番号フィールド452には、先に生成されたモデル画像候補にそれぞれ割当てられた試行番号が昇順に表示される。試行済フィールド454には、対応するモデル画像候補についての試行が実行済であるか否かを示すチェックボックスが表示される。   In the trial number field 452, trial numbers assigned to the model image candidates generated previously are displayed in ascending order. In the tried field 454, a check box indicating whether or not a trial for the corresponding model image candidate has been executed is displayed.

誤検出フィールド456、良品画像誤検出フィールド458、および不良品画像誤検出フィールド460には、対応するモデル画像候補についての評価結果のうち、誤検出されたものの総数が表示される。より具体的には、良品画像誤検出フィールド458には、良品画像を「不良品」と誤って判定した総数が表示され、不良品画像誤検出フィールド460には、不良品画像を「良品」と誤って判定した総数が表示される。そして、2つの誤検出数を合計した値が誤検出フィールド456に表示される。   In the erroneous detection field 456, the non-defective product image erroneous detection field 458, and the defective product image erroneous detection field 460, the total number of erroneously detected results of the corresponding model image candidates is displayed. More specifically, in the non-defective product image detection field 458, the total number of erroneously determined non-defective images as “defective products” is displayed, and in the defective product image detection field 460, the defective product image is “good”. The total number of erroneous judgments is displayed. A value obtained by adding up the two false detection numbers is displayed in the false detection field 456.

最大計測時間フィールド462には、各モデル画像候補についての試行の実行段階において計測された処理時間の最大値が表示される。支援装置100の画像処理アプリケーション30Bで処理が実行された場合には、この処理時間は、画像処理装置200の画像処理アプリケーション30Aにおいて実際に計測された時間とは異なる場合があるが、画像処理装置200において画像処理結果を生成するのに要すると見込まれる処理時間に相当する。この最大計測時間フィールド462に表示される時間は、モデル画像候補から最適なものを選択する場合に、実際の生産ラインのタクトタイムなどを考慮するための指標となる。   The maximum measurement time field 462 displays the maximum value of the processing time measured in the trial execution stage for each model image candidate. When processing is executed by the image processing application 30B of the support apparatus 100, the processing time may differ from the time actually measured by the image processing application 30A of the image processing apparatus 200. This corresponds to the processing time expected to be required to generate an image processing result at 200. The time displayed in the maximum measurement time field 462 serves as an index for considering the actual production line tact time and the like when selecting an optimal model image candidate.

良品画像相関値平均フィールド464、不良品画像相関値平均フィールド466、良品画像相関値3σフィールド468、および不良品画像相関値3σフィールド470には、それぞれの計測画像に対して特徴量として計測された類似度(相関値)についての統計的出力値が表示される。すなわち、良品画像相関値平均フィールド464には、入力された複数の良品画像に対して計測された相関値全体の平均値が表示され、不良品画像相関値平均フィールド466には、入力された複数の不良品画像に対して計測された相関値全体の平均値が表示される。また、良品画像相関値3σフィールド468には、入力された複数の良品画像に対して計測された相関値全体のばらつき度合いを示す3σ値が表示され、不良品画像相関値3σフィールド470には、入力された複数の不良品画像に対して計測さ
れた相関値全体のばらつき度合いを示す3σ値が表示される。
The non-defective product image correlation value average field 464, the non-defective product image correlation value average field 466, the non-defective product image correlation value 3σ field 468, and the non-defective product image correlation value 3σ field 470 are measured as feature quantities for the respective measurement images. A statistical output value for the similarity (correlation value) is displayed. That is, the average value of all correlation values measured for a plurality of input non-defective images is displayed in the non-defective image correlation value average field 464, and the plurality of input non-defective image correlation value fields 466 are input. An average value of all correlation values measured for the defective product image is displayed. The non-defective product image correlation value 3σ field 468 displays 3σ values indicating the degree of variation of the overall correlation values measured for the plurality of input non-defective products images. The defective product image correlation value 3σ field 470 displays A 3σ value indicating the degree of variation of the entire correlation value measured for the plurality of input defective images is displayed.

評価結果画面400Bでは、モデル画像候補のうち、対応する処理結果群に含まれる特徴量が相対的に高いモデル画像候補を他のモデル画像候補とは異なる態様で出力する。図14に示す例では、良品画像相関値平均が最も高い、試行番号「4」についてアスタリスクマーク453が表示される。   On the evaluation result screen 400B, among the model image candidates, model image candidates having relatively high feature amounts included in the corresponding processing result group are output in a mode different from other model image candidates. In the example shown in FIG. 14, an asterisk mark 453 is displayed for the trial number “4” having the highest quality image correlation value average.

図14に示すように、試行された複数のモデル画像候補の各々について、その判定結果および統計的出力が一覧表示されることで、ユーザは、最適なモデル画像を容易に選択することができる。一般的には、良品画像相関値が最も高く、かつ不良品画像相関値との差が最も大きいものが安定したマッチング処理が可能であり、図14に示す例では、試行番号「4」のモデル画像が最適であると言える。   As shown in FIG. 14, the determination result and the statistical output are displayed in a list for each of the plurality of tried model image candidates, so that the user can easily select an optimal model image. In general, the one having the highest non-defective image correlation value and the largest difference from the defective image correlation value is capable of stable matching processing. In the example shown in FIG. It can be said that the image is optimal.

このように最適なモデル画像が決定された後、ユーザがマウス104などを操作して、決定したモデル画像候補の試行番号を入力した後、ボタン412(図13)を押下すると、選択されたモデル画像が画像処理装置200に反映される。   After the optimal model image is determined in this way, the user operates the mouse 104 or the like to input the trial number of the determined model image candidate and then presses the button 412 (FIG. 13). The image is reflected on the image processing apparatus 200.

このような一連の手順によって、ユーザは、画像処理装置200におけるマッチング処理に用いるモデル画像をより迅速かつ容易に決定できる。   Through such a series of procedures, the user can more quickly and easily determine a model image used for matching processing in the image processing apparatus 200.

<期待クラスの入力方法>
計測画像に対応付けられた期待クラスの入力方法として、それぞれの計測画像が格納されたフォルダ名に期待クラスを付与する構成を例示したが、以下のような他の構成を採用することもできる。
<Input method of expected class>
As an input method of the expected class associated with the measurement image, the configuration in which the expected class is given to the folder name in which each measurement image is stored has been exemplified, but other configurations as described below may be adopted.

(1)計測画像のファイル名を用いる構成
計測画像のファイル名の一部に期待クラスを示す文字を埋込むことで、期待クラスを付与することができる。たとえば、上述の良品画像であれば、「OK_xxx.jpg」とのファイル名を与え、不良品画像であれば、「NG_xxx.jpg」とのファイル名を与えることで、両者を識別することができる。このような方法を採用することで、計測画像に対して、個別に期待クラスを入力することができる。また、相関値などを期待値として入力する場合にも、同様の手法で入力することができる。
(1) Configuration Using File Name of Measurement Image An expected class can be assigned by embedding characters indicating the expected class in a part of the file name of the measurement image. For example, a file name “OK_xxx.jpg” is given for the above-mentioned non-defective image, and a file name “NG_xxx.jpg” is given for a defective image, so that both can be identified. . By adopting such a method, the expected class can be individually input for the measurement image. In addition, when a correlation value or the like is input as an expected value, the same method can be used.

(2)画像ファイルのヘッダ部を用いる構成
計測画像のヘッダ部に期待クラスを示す埋込むことで、期待クラスを付与することができる。たとえば、jpegフォーマットであれば、Exif規格に従って、ヘッダ部が用意されているので、この部分に、期待クラスの区分(OKまたはNG)および/または期待値を格納することができる。
(2) Configuration Using Image File Header Part An expected class can be assigned by embedding an expected class in the header part of a measurement image. For example, in the case of the jpeg format, a header part is prepared in accordance with the Exif standard, and therefore an expected class classification (OK or NG) and / or an expected value can be stored in this part.

(3)定義ファイルを用いる構成
計測画像とは別に、各計測画像の期待クラスおよび/または期待値を記述した定義ファイルを用意することで、期待クラスを入力することができる。この定義ファイルには、各計測画像のファイル名などの識別情報に対応付けて、期待クラスの区分(OKまたはNG)、期待クラスを示す数値、条件などが記述される。この定義ファイルを用いた場合には、1つの計測画像に対して、複数の期待クラスを定義することができる。たとえば、同一の計測画像に対して、文字列「ABC」のマッチング処理、および文字列「BCD」のマッチング処理が連続的に実行される場合を考えると、文字列「ABC」を含む計測画像は、文字列「ABC」のマッチング処理にとってみれば良品画像であるが、文字列「BCD」のマッチング処理にとってみれば不良品画像となる。したがって、同一の計測画像に対して、複数のマッチング処理が実行されるような場合には、処理項目毎に期待クラスを付
与する必要があり、このような場合に、定義ファイルを用いるとより効果的である。
(3) Configuration Using Definition File In addition to the measurement image, an expected class can be input by preparing a definition file describing the expected class and / or expected value of each measurement image. In this definition file, an expected class classification (OK or NG), a numerical value indicating an expected class, a condition, and the like are described in association with identification information such as a file name of each measurement image. When this definition file is used, a plurality of expected classes can be defined for one measurement image. For example, considering the case where the matching process of the character string “ABC” and the matching process of the character string “BCD” are continuously performed on the same measurement image, the measurement image including the character string “ABC” When the matching process for the character string “ABC” is considered to be a non-defective image, the matching process for the character string “BCD” is a defective image. Therefore, when multiple matching processes are executed for the same measurement image, it is necessary to assign an expected class to each processing item. In such a case, using a definition file is more effective. Is.

(4)ユーザが個別/一括で設定する構成
特に、計測画像に良品/不良品の期待クラスを入力する場合には、支援装置100上での計測画像の選択時に入力するようにしてもよい。すなわち、ユーザは、対象の計測画像の選択時に、選択したファイル/フォルダが良品および不良品のいずれであるかを選択する。ここで、ファイル単位で選択すれば期待クラスの個別付与となり、フォルダ単位で選択すれば期待クラスの一括付与となる。
(4) Configuration set by user individually / collectively In particular, when an expected class of non-defective product / defective product is input to the measurement image, it may be input when the measurement image is selected on the support apparatus 100. That is, when the target measurement image is selected, the user selects whether the selected file / folder is a non-defective product or a defective product. Here, if the selection is made in units of files, the expected classes are individually assigned, and if the selection is made in units of folders, the expected classes are collectively given.

<制御構造>
図15は、この発明の実施の形態に従う支援装置100の制御構造を示す機能ブロック図である。なお、図15には、支援装置100に評価処理アプリケーション20および画像処理アプリケーション30Bが実装されている場合の構成(図7(a)参照)を示す。図15に示す制御構造は、典型的には、支援装置100のCPU105がプログラムを実行することで提供される。図16は、図15に示す支援装置100の制御構造において生成されるファイル構造を示す図である。
<Control structure>
FIG. 15 is a functional block diagram showing a control structure of support apparatus 100 according to the embodiment of the present invention. FIG. 15 shows a configuration when the evaluation processing application 20 and the image processing application 30B are mounted on the support apparatus 100 (see FIG. 7A). The control structure shown in FIG. 15 is typically provided by the CPU 105 of the support apparatus 100 executing a program. FIG. 16 is a diagram showing a file structure generated in the control structure of the support apparatus 100 shown in FIG.

図15を参照して、本実施の形態に従う支援装置100は、その制御構造として、入力部1010と、モデル画像候補生成部1020と、処理部1030と、評価部1040と、出力部1050とを含む。なお、入力部1010、評価部1040、および出力部1050の機能は、評価処理アプリケーション20によって提供され、処理部1030の機能は、画像処理アプリケーション30によって提供され、モデル画像候補生成部1020の機能は、評価処理アプリケーション20と画像処理アプリケーション30との共同によって提供される。   Referring to FIG. 15, support device 100 according to the present embodiment includes, as its control structure, input unit 1010, model image candidate generation unit 1020, processing unit 1030, evaluation unit 1040, and output unit 1050. Including. The functions of the input unit 1010, the evaluation unit 1040, and the output unit 1050 are provided by the evaluation processing application 20, the function of the processing unit 1030 is provided by the image processing application 30, and the function of the model image candidate generation unit 1020 is The evaluation processing application 20 and the image processing application 30 are provided jointly.

入力部1010は、ユーザから対象の計測画像の指定、およびそれぞれの計測画像に対応付けられた期待クラスを受付ける。なお、入力部1010は、指定された計測画像を自身にコピーすることもできるが、指定された計測画像へアクセス可能である場合には、対象の計測画像を必要なタイミングで取得して、その実体データを処理部1030へ出力する。より具体的には、入力部1010は、計測画像の指定に基づいて、対象の計測画像と内部的に使用する画像番号とを対応付けた画像リスト1011を生成するとともに、画像番号と対応する計測画像についての期待クラスとを対応付けた期待クラスリスト1012を生成する。図16(a)に示すように、画像リスト1011には、画像番号に対応付けて、対象の計測画像の存在する位置およびファイル名が記述される。また、図16(b)に示すように、期待クラスリスト1012には、画像番号に対応付けて、期待クラス(この例では、良品(OK)もしくは不良品(NG))が記述される。   The input unit 1010 accepts designation of a target measurement image from the user and an expectation class associated with each measurement image. The input unit 1010 can copy the specified measurement image to itself, but if the specified measurement image is accessible, the input unit 1010 acquires the target measurement image at a necessary timing, and The entity data is output to the processing unit 1030. More specifically, the input unit 1010 generates an image list 1011 in which a target measurement image and an image number to be used internally are associated with each other based on the specification of the measurement image, and the measurement corresponding to the image number. An expected class list 1012 in which an expected class for an image is associated is generated. As shown in FIG. 16A, the image list 1011 describes the position and file name where the target measurement image exists in association with the image number. As shown in FIG. 16B, the expected class list 1012 describes an expected class (in this example, a non-defective product (OK) or a defective product (NG)) in association with the image number.

次に、モデル画像候補生成部1020は、ユーザ設定に応答して、入力部1010から参照画像(良品画像)を取得して、複数のモデル画像候補40を抽出する。より具体的には、モデル画像候補生成部1020は、入力インターフェイス部1021と、モデル画像抽出部1022と、通信部1023とを含む。入力インターフェイス部1021は、ユーザ操作に応じて、図12に示すようなダイアログ420および図13に示すようなダイアログ430を表示する。さらに、入力インターフェイス部1021は、ダイアログ420および430に対してユーザが入力した変更設定をモデル画像抽出部1022へ出力する。すなわち、入力インターフェイス部1021は、モデル画像を抽出するサーチ範囲ARAなどを含む変動設定を受付ける。モデル画像抽出部1022は、このユーザが指定した変動設定に従って、複数のモデル画像候補を抽出する。これらのモデル画像候補は、処理部1030へ出力される。   Next, the model image candidate generation unit 1020 acquires a reference image (non-defective image) from the input unit 1010 in response to the user setting, and extracts a plurality of model image candidates 40. More specifically, the model image candidate generation unit 1020 includes an input interface unit 1021, a model image extraction unit 1022, and a communication unit 1023. The input interface unit 1021 displays a dialog 420 as shown in FIG. 12 and a dialog 430 as shown in FIG. 13 in response to a user operation. Further, the input interface unit 1021 outputs the change settings input by the user to the dialogs 420 and 430 to the model image extraction unit 1022. That is, the input interface unit 1021 accepts a variation setting including a search range ARA for extracting a model image. The model image extraction unit 1022 extracts a plurality of model image candidates according to the variation setting designated by the user. These model image candidates are output to the processing unit 1030.

通信部1023は、画像処理装置200とデータ通信可能に構成され、ユーザ操作に応
じて、画像処理装置200で設定されている処理項目、初期設定モデル画像、およびパラメータ値などを取得する。また、通信部1023は、支援装置100において決定されたモデル画像およびパラメータ値などを画像処理装置200へ転送することもできる。
The communication unit 1023 is configured to be capable of data communication with the image processing apparatus 200, and acquires processing items, initial setting model images, parameter values, and the like set in the image processing apparatus 200 in response to a user operation. The communication unit 1023 can also transfer the model image and parameter values determined by the support apparatus 100 to the image processing apparatus 200.

次に、処理部1030は、指定された計測画像に対して、複数のモデル画像にそれぞれ従ってマッチング処理を行なうことで複数の処理結果を生成する。より具体的には、処理部1030は、計測画像選択部1031と、モデル画像候補選択部1032と、類似度算出部1033と、判定部1034と、処理コントローラ1036とを含む。   Next, the processing unit 1030 generates a plurality of processing results by performing matching processing on the specified measurement image according to the plurality of model images, respectively. More specifically, the processing unit 1030 includes a measurement image selection unit 1031, a model image candidate selection unit 1032, a similarity calculation unit 1033, a determination unit 1034, and a processing controller 1036.

処理部1030における各部の処理は、処理コントローラ1036によって制御される。すなわち、入力部1010に複数の計測画像およびそれらにそれぞれ対応付けられた期待クラスが入力されると、複数のモデル画像候補の各々について、複数の計測画像のそれぞれについてのマッチング処理の結果を順次出力するように、処理コントローラ1036が計測画像選択部1031およびモデル画像候補選択部1032を適宜制御する。   Processing of each unit in the processing unit 1030 is controlled by the processing controller 1036. That is, when a plurality of measurement images and expected classes associated with them are input to the input unit 1010, the results of matching processing for each of the plurality of measurement images are sequentially output for each of the plurality of model image candidates. Thus, the processing controller 1036 controls the measurement image selection unit 1031 and the model image candidate selection unit 1032 as appropriate.

計測画像選択部1031は、処理コントローラ1036からの指令に従って、入力部1010から対象の計測画像を順次選択して、類似度算出部1033へ出力する。また、モデル画像候補選択部1032についても、処理コントローラ1036からの指令に従って、モデル画像候補生成部1020から対象のモデル画像候補を順次選択して、類似度算出部1033へ出力する。   The measurement image selection unit 1031 sequentially selects target measurement images from the input unit 1010 according to a command from the processing controller 1036 and outputs the selected measurement images to the similarity calculation unit 1033. The model image candidate selection unit 1032 also sequentially selects target model image candidates from the model image candidate generation unit 1020 in accordance with a command from the processing controller 1036 and outputs the selected model image candidates to the similarity calculation unit 1033.

類似度算出部1033は、計測画像選択部1031によって選択された計測画像に対して、モデル画像候補選択部1032によって選択されたモデル画像候補に基づくマッチング処理を行なうことで、対象の計測画像についての類似度(相関値)を算出する。類似度算出部1033は、算出した類似度(相関値)を判定部1034へ出力する。   The similarity calculation unit 1033 performs a matching process on the measurement image selected by the measurement image selection unit 1031 based on the model image candidate selected by the model image candidate selection unit 1032, so that the measurement image of the target is measured. The similarity (correlation value) is calculated. The similarity calculation unit 1033 outputs the calculated similarity (correlation value) to the determination unit 1034.

判定部1034は、類似度算出部1033において算出された類似度(相関値)を、予め定められたしきい値と比較することで、対象の計測画像についての処理結果を生成する。典型的には、判定部1034は、類似度(相関値)がしきい値以上であれば、マッチングOKと判断する。そうでなければ、判定部1034はマッチングNGと判断する。   The determination unit 1034 generates a processing result for the target measurement image by comparing the similarity (correlation value) calculated by the similarity calculation unit 1033 with a predetermined threshold value. Typically, the determination unit 1034 determines that the matching is OK if the similarity (correlation value) is equal to or greater than a threshold value. Otherwise, the determination unit 1034 determines that it is a matching NG.

判定部1034は、類似度算出部1033で算出された類似度とともに、判定結果を示す判定結果リスト1035を生成する。図16(c)に示すように、判定結果リスト1035には、画像番号に対応付けて、対象の計測画像の類似度および判定結果(この例では、OKまたはNG)が記述される。なお、判定結果リスト1035は、試行されたモデル画像候補毎に生成される。   The determination unit 1034 generates a determination result list 1035 indicating the determination result together with the similarity calculated by the similarity calculation unit 1033. As shown in FIG. 16C, the determination result list 1035 describes the similarity of the target measurement image and the determination result (in this example, OK or NG) in association with the image number. The determination result list 1035 is generated for each attempted model image candidate.

処理コントローラ1036は、モデル画像候補についての試行の実行に応じて、計測画像選択部1031およびモデル画像候補選択部1032へ指令を与える。   The processing controller 1036 gives a command to the measurement image selection unit 1031 and the model image candidate selection unit 1032 according to the execution of the trial for the model image candidate.

次に、評価部1040は、計測画像に対応付けられた期待クラスに基づいて、モデル画像候補の別にそれぞれ生成された複数の処理結果をそれぞれ評価して、その評価結果を生成する。より具体的には、評価部1040は、比較部1041と、一致/不一致カウンタ1043と、打ち切り処理部1044と、統計処理部1045と、ヒストグラム生成部1046と、決定部1047とを含む。   Next, the evaluation unit 1040 evaluates each of a plurality of processing results generated separately for each model image candidate based on the expected class associated with the measurement image, and generates the evaluation result. More specifically, the evaluation unit 1040 includes a comparison unit 1041, a match / mismatch counter 1043, an abort processing unit 1044, a statistical processing unit 1045, a histogram generation unit 1046, and a determination unit 1047.

比較部1041は、入力部1010から取得した各計測画像についての期待クラスと、判定部1034で生成された判定結果とを比較して、その内容が一致しているか否かを評価する。より具体的には、比較部1041は、画像番号に対応付けて、評価結果を示す評価結果リスト1042を生成する。図15(d)に示すように、評価結果リスト1042
には、画像番号に対応付けて、対象の計測画像の判定結果と期待クラスとの対応関係が記述される。この記述例としては、良品(OK)の期待クラスを付与された計測画像に対する評価結果が良品(OK)であったことを示す「OK−OK」や、良品(OK)の期待クラスを付与された計測画像に対する評価結果が良品(NG)であったことを示す「OK−NG」などである。なお、一致および不一致のいずれかのみを記述するようにしてもよいが、両者が不一致であった場合、すなわち誤判定が発生した場合に、その詳細を分析することができないので、その区分についても記録しておくことが好ましい。なお、評価結果リスト1042は、試行されたモデル画像候補毎に生成される。
The comparison unit 1041 compares the expected class for each measurement image acquired from the input unit 1010 with the determination result generated by the determination unit 1034, and evaluates whether or not the contents match. More specifically, the comparison unit 1041 generates an evaluation result list 1042 indicating the evaluation result in association with the image number. As shown in FIG. 15D, the evaluation result list 1042
Describes the correspondence between the determination result of the target measurement image and the expected class in association with the image number. As a description example, “OK-OK” indicating that the evaluation result for the measurement image to which the expected class of the non-defective product (OK) is assigned is OK (OK) or the expected class of the good product (OK) is given. For example, “OK-NG” indicating that the evaluation result for the measured image is a non-defective product (NG). Only one of the match and mismatch may be described. However, if they do not match, that is, if a misjudgment occurs, the details cannot be analyzed. It is preferable to record. The evaluation result list 1042 is generated for each attempted model image candidate.

一致/不一致カウンタ1043は、比較部1041で生成された複数の評価結果リスト1042に含まれる評価結果についての対応する期待クラスとの一致度合いを算出する。より具体的には、一致/不一致カウンタ1043は、評価結果リスト1042に含まれる評価結果のうち、対応する期待クラスと不一致となっているもの(誤検出されたもの)の数をカウントする。なお、「良品」(OK)の計測画像を「不良品」(NG)と誤判定した数、および「不良品」(NG)の計測画像を「良品」(OK)と誤判定した数をそれぞれ区別してカウントすることが好ましい。   The match / mismatch counter 1043 calculates the degree of match with the corresponding expected class for the evaluation results included in the plurality of evaluation result lists 1042 generated by the comparison unit 1041. More specifically, the match / mismatch counter 1043 counts the number of evaluation results included in the evaluation result list 1042 that do not match the corresponding expected class (those that are erroneously detected). Note that the number of erroneously determined “defective” (OK) measurement images as “defective” (NG) and the number of “defective” (NG) measurement images erroneously determined as “good” (OK), respectively. It is preferable to count separately.

打ち切り処理部1044は、ユーザによって指定される許容上限値を受付け、いずれかのモデル画像候補について、計測画像に対する処理結果の生成中に、対応する期待クラスと不一致である処理結果の数が指定された許容上限値を超えると、当該モデル画像候補についての残りの計測画像に対する処理結果の生成を打ち切る。この許容上限値は、対象の画像処理装置に要求される安定度などに応じて設定される。すなわち、誤検出の数が許容上限値を超えた時点で、安定した画像処理を行なうことのできないモデル画像候補であると判断できるので、それ以上の評価を行なう必要がないからである。このように、適用先の要求に基づいて、明らかに不適格なモデル画像候補についての試行を打ち切ることで、試行全体に要する時間を短縮することができる。なお、打ち切り処理部1044は、打ち切り指示を処理部1030の処理コントローラ1036へ与える。   The censoring processing unit 1044 accepts an allowable upper limit value specified by the user, and for any model image candidate, the number of processing results that do not match the corresponding expected class is specified during the generation of the processing results for the measurement image. If the allowable upper limit value is exceeded, generation of processing results for the remaining measurement images for the model image candidate is discontinued. This allowable upper limit value is set according to the stability required for the target image processing apparatus. That is, when the number of erroneous detections exceeds the allowable upper limit value, it can be determined that the model image candidate cannot perform stable image processing, and therefore no further evaluation is required. In this way, the time required for the entire trial can be reduced by aborting the trial for the model image candidate that is clearly ineligible based on the request of the application destination. Note that the abort processing unit 1044 gives an abort instruction to the processing controller 1036 of the processing unit 1030.

あるいは、ある試行において、所定数の計測画像に対し評価を行ない、その結果の平均値などが先に実行した試行の結果より悪い場合には、当該試行についての処理結果の生成を打ち切るようにしてもよい。   Alternatively, in a certain trial, evaluation is performed on a predetermined number of measurement images, and when the average value of the result is worse than the result of the trial executed earlier, generation of the processing result for the trial is aborted. Also good.

統計処理部1045は、処理部1030で算出された評価結果についての統計的出力を算出する。より具体的には、統計処理部1045は、類似度算出部1033で算出された判定結果リスト1035に含まれる相関値の統計量(たとえば、平均値、中間値、最大値、最小値、分散値、標準偏差など)を、モデル画像候補毎に算出する。   The statistical processing unit 1045 calculates a statistical output for the evaluation result calculated by the processing unit 1030. More specifically, the statistical processing unit 1045 calculates a statistical amount of correlation values (for example, average value, intermediate value, maximum value, minimum value, variance value) included in the determination result list 1035 calculated by the similarity calculation unit 1033. , Standard deviation, etc.) for each model image candidate.

ヒストグラム生成部1046は、統計処理部1045により算出された統計量に基づいて、特徴量を所定の区間に区切ったヒストグラム(度数分布)のデータを、モデル画像候補毎に生成する。   The histogram generation unit 1046 generates, for each model image candidate, histogram (frequency distribution) data obtained by dividing the feature amount into predetermined sections based on the statistical amount calculated by the statistical processing unit 1045.

決定部1047は、ユーザによって指定された条件に従って、モデル画像候補生成部1020で生成されたモデル画像候補のうち、最も適切なものを決定する。より具体的には、決定部1047は、評価結果が満たすべき条件を受付け、複数のモデル画像候補にそれぞれ従って処理を行なうことで生成される処理結果のうち、指定された条件に最も適合しているモデル画像候補を決定する。この決定部1047における処理については、後述する。   The determination unit 1047 determines the most appropriate model image candidate generated by the model image candidate generation unit 1020 according to the conditions specified by the user. More specifically, the determination unit 1047 accepts a condition that the evaluation result should satisfy, and among the process results generated by performing the process according to each of the plurality of model image candidates, the determination unit 1047 most closely matches the specified condition. A model image candidate is determined. The processing in the determination unit 1047 will be described later.

次に、出力部1050は、複数のモデル画像候補の別に、評価部1040で生成された評価結果を出力する。より具体的には、出力部1050は、各種の出力形態を用意してお
り、一例として上述した、テーブル出力機能、ヒストグラム出力機能、散布図出力機能などである。これらの出力形態は、ユーザ操作に応じて適宜切換えられる。出力部1050は、テーブル出力機能として、一致/不一致カウンタ1043により算出された評価結果についての対応する期待クラスとの一致度合いや、対応する期待クラスと不一致となっている処理結果の数を出力する。さらに、このテーブル出力機能として、出力部1050は、評価結果とともに計測された処理時間を出力する。
Next, the output unit 1050 outputs the evaluation result generated by the evaluation unit 1040 for each of the plurality of model image candidates. More specifically, the output unit 1050 provides various output forms such as the table output function, the histogram output function, and the scatter diagram output function described above as an example. These output forms are appropriately switched according to the user operation. The output unit 1050 outputs, as a table output function, the degree of match with the corresponding expected class for the evaluation result calculated by the match / mismatch counter 1043 and the number of processing results that do not match the corresponding expected class. . Further, as this table output function, the output unit 1050 outputs the processing time measured together with the evaluation result.

さらに、出力部1050は、テーブル出力機能として、複数のモデル画像候補のうち、対応する処理結果群に含まれる特徴量(相関値)が相対的に高いモデル画像候補を、他のモデル画像候補とは異なる態様で出力してもよい。すなわち、最も相関値の平均値が高いモデル画像候補については、赤色表示や点滅表示などによって、目立つように出力することが好ましい。これは、特徴量(相関値)が高いということは、当該モデル画像候補に従う画像処理によって、計測画像の特徴をうまく抽出できることを意味するので、このようなモデル画像候補を優先的にユーザに選択してもらうことを促すためである。   Further, the output unit 1050 has, as a table output function, a model image candidate having a relatively high feature amount (correlation value) included in the corresponding processing result group among a plurality of model image candidates as another model image candidate. May be output in different ways. That is, it is preferable that the model image candidate having the highest average correlation value is output conspicuously by red display or blinking display. This means that a high feature quantity (correlation value) means that the features of the measurement image can be successfully extracted by image processing according to the model image candidate, so such model image candidates are selected by the user with priority. This is to encourage them to do this.

<条件指定>
次に、図17を参照して、評価部1040の決定部1047(図15)がモデル画像候補のうち、最も適切なものを選択する条件の入力インターフェイスの一例について例示する。
<Condition specification>
Next, referring to FIG. 17, an example of an input interface for a condition for the determination unit 1047 (FIG. 15) of the evaluation unit 1040 to select the most appropriate model image candidate will be described.

ユーザは、上述の図13に示すダイアログ420上でのモデル画像候補についての設定後、図17に示すようなダイアログ499で、いずれの項目を優先するかについて設定する。ダイアログ499では、図14に示す評価結果画面400Bに出力される項目の一覧が表示されており、ユーザは、プルダウンメニューを操作して、優先すべきかを示す優先順を必要な項目に対して設定する。図17に示す例では、「誤検出数:少」が優先順位「1」に設定されており、「良品画像相関値平均:高」が優先順位「2」に設定されている。   After setting the model image candidates on the dialog 420 shown in FIG. 13, the user sets which item has priority in the dialog 499 as shown in FIG. 17. In the dialog 499, a list of items output on the evaluation result screen 400B shown in FIG. 14 is displayed, and the user operates a pull-down menu to set a priority order indicating whether priority should be given to the necessary items. To do. In the example shown in FIG. 17, “number of false detections: low” is set to priority “1”, and “non-defective image correlation value average: high” is set to priority “2”.

図17に示すような条件が設定されると、決定部1047は、生成されたモデル画像候補毎の評価結果を参照して、最も誤検出数の少ないモデル画像候補を検索する。この検索の結果、1つに絞ることができれば、そのモデル画像候補が最適なパラメータセットとして決定される。一方、誤検出数の条件だけでは、1つに絞りきることができなかった場合には、その中で、良品画像相関値平均が最も高いモデル画像候補が最適なモデル画像として決定される。   When the conditions as shown in FIG. 17 are set, the determination unit 1047 searches for a model image candidate with the smallest number of erroneous detections with reference to the generated evaluation result for each model image candidate. As a result of this search, if it can be narrowed down to one, the model image candidate is determined as the optimum parameter set. On the other hand, if the number of erroneous detections cannot be reduced to one, the model image candidate having the highest average of the non-defective image correlation values is determined as the optimum model image.

なお、ユーザによる条件の設定方法としては、図17に示すユーザインターフェイスによる方法以外にも、さまざまな方法を採用することができる。   As a method for setting conditions by the user, various methods other than the method using the user interface shown in FIG. 17 can be adopted.

<処理手順>
図18〜図22は、この発明の実施の形態に従うシステムにおける全体処理を示すフローチャートである。図18〜図22に示すフローチャートは、典型的には、支援装置100のCPU105が固定ディスク107などに予め格納されたプログラムをメモリ106に読出して実行することにより実現される。なお、図18〜図22に示すフローチャートでは、各処理の実行主体を明瞭化するために、評価処理アプリケーション20および画像処理アプリケーション30を区分して表現するが、これらのアプリケーションを統合したプログラムを実行してもよい。あるいは、上述したように、支援装置100が画像処理装置200に実装されている画像処理アプリケーション30Aを利用することもできる。この場合には、本実施の形態に従う支援装置100および画像処理装置200を含めたシステムが本発明に係るモデル画像取得支援装置に相当する。なお、この場合には、画像処理装置200のCPU205についても、固定ディスク207などに予め格納されたプログ
ラムをメモリ206に読出して実行することで、画像処理アプリケーション30Aの機能を実現する。
<Processing procedure>
18 to 22 are flowcharts showing the overall processing in the system according to the embodiment of the present invention. The flowcharts shown in FIGS. 18 to 22 are typically realized by the CPU 105 of the support apparatus 100 reading a program stored in advance in the fixed disk 107 or the like into the memory 106 and executing it. In the flowcharts shown in FIGS. 18 to 22, the evaluation processing application 20 and the image processing application 30 are divided and expressed in order to clarify the execution subject of each processing, but a program in which these applications are integrated is executed. May be. Alternatively, as described above, the support apparatus 100 can use the image processing application 30 </ b> A installed in the image processing apparatus 200. In this case, the system including the support apparatus 100 and the image processing apparatus 200 according to the present embodiment corresponds to the model image acquisition support apparatus according to the present invention. In this case, the CPU 205 of the image processing apparatus 200 also implements the function of the image processing application 30A by reading the program stored in advance in the fixed disk 207 or the like into the memory 206 and executing it.

図18〜図22を参照して、まず、起動が指示されると、評価処理アプリケーション20(支援装置100のCPU105(図2);以下同様)は、初期化処理の実行後、図10に示す入力画面400Aをモニタ102に表示する(ステップS100)。続いて、評価処理アプリケーション20は、入力画面400A上のボタン402が押下されたか否かを判断する(ステップS102)。ボタン402が押下されていない場合(ステップS102においてNOの場合)には、ステップS102の処理が繰返される。   18 to 22, first, when an activation is instructed, the evaluation processing application 20 (the CPU 105 of the support apparatus 100 (FIG. 2); the same applies hereinafter) is shown in FIG. 10 after executing the initialization process. The input screen 400A is displayed on the monitor 102 (step S100). Subsequently, the evaluation processing application 20 determines whether or not the button 402 on the input screen 400A has been pressed (step S102). If button 402 has not been pressed (NO in step S102), the process of step S102 is repeated.

ボタン402が押下された場合(ステップS102においてYESの場合)には、評価処理アプリケーション20は、試行を実行するための画像処理アプリケーション30の選択を受付ける(ステップS104)。画像処理アプリケーション30が選択されると、評価処理アプリケーション20は、選択先の画像処理アプリケーション30との間で同期確立処理を実行する。具体的には、評価処理アプリケーション20は、選択先の画像処理アプリケーション30に同期確立要求を送信する。選択先の画像処理アプリケーション30は、この同期確立要求に応答して、画像処理アプリケーション30(支援装置100のCPU105(図2)または画像処理装置200のCPU205(図3);以下同様)は、必要な情報を評価処理アプリケーション20へ返答する(ステップS106)。この画像処理アプリケーション30からのデータの返答によって、両者の同期が確立する。   When the button 402 is pressed (YES in step S102), the evaluation processing application 20 accepts the selection of the image processing application 30 for executing the trial (step S104). When the image processing application 30 is selected, the evaluation processing application 20 executes synchronization establishment processing with the image processing application 30 that is the selection destination. Specifically, the evaluation processing application 20 transmits a synchronization establishment request to the image processing application 30 that is the selection destination. In response to the synchronization establishment request, the selected image processing application 30 requires the image processing application 30 (the CPU 105 (FIG. 2) of the support apparatus 100 or the CPU 205 (FIG. 3) of the image processing apparatus 200; the same applies hereinafter). Information is returned to the evaluation processing application 20 (step S106). The synchronization of both is established by the response of the data from the image processing application 30.

続いて、評価処理アプリケーション20は、入力画面400A上のボタン404が押下されたか否かを判断する(ステップS108)。ボタン404が押下されていない場合(ステップS108においてNOの場合)には、ステップS108の処理が繰返される。   Subsequently, the evaluation processing application 20 determines whether or not the button 404 on the input screen 400A has been pressed (step S108). If button 404 is not pressed (NO in step S108), the process of step S108 is repeated.

ボタン404が押下された場合(ステップS108においてYESの場合)には、評価処理アプリケーション20は、図11に示すダイアログ414をモニタ102に表示する(ステップS110)。続いて、評価処理アプリケーション20は、対象となる計測画像および計測画像に対応付けられた期待クラスの指定を受付ける(ステップS112)。すなわち、ユーザは、「良品」の期待クラスに対応付けられている計測画像が格納されている「OK」フォルダを指定するとともに、必要に応じて、「不良品」の期待クラスに対応付けられている計測画像が格納されている「NG」フォルダを指定する。なお、本実施の形態に従うモデル画像取得支援装置では、少なくとも良品画像が存在すれば、モデル画像を決定することができるので、不良品画像を必ず指定する必要はない。   When the button 404 is pressed (YES in step S108), the evaluation processing application 20 displays the dialog 414 shown in FIG. 11 on the monitor 102 (step S110). Subsequently, the evaluation processing application 20 receives the measurement image to be a target and designation of an expectation class associated with the measurement image (step S112). That is, the user designates the “OK” folder in which the measurement image associated with the “non-defective” expected class is stored, and is associated with the “defective” expected class as necessary. The “NG” folder in which the measured image is stored is designated. In the model image acquisition support apparatus according to the present embodiment, a model image can be determined as long as at least a non-defective image exists. Therefore, it is not always necessary to designate a defective image.

計測画像が設定されると、評価処理アプリケーション20は、対象の計測画像と内部的に使用する画像番号とを対応付けた画像リスト1011(図16(a))を生成するとともに、画像番号と対応する計測画像についての期待クラスとを対応付けた期待クラスリスト1012(図16(b))を生成する(ステップS114)。そして、評価処理アプリケーション20は、ダイアログ414を閉じる。   When the measurement image is set, the evaluation processing application 20 generates an image list 1011 (FIG. 16A) in which the target measurement image is associated with the image number to be used internally, and also corresponds to the image number. An expected class list 1012 (FIG. 16B) that associates the expected class for the measurement image to be generated is generated (step S114). Then, the evaluation processing application 20 closes the dialog 414.

続いて、評価処理アプリケーション20は、入力画面400A上のボタン406が押下されたか否かを判断する(ステップS116)。ボタン406が押下されていない場合(ステップS116においてNOの場合)には、ステップS116の処理が繰返される。   Subsequently, the evaluation processing application 20 determines whether or not the button 406 on the input screen 400A has been pressed (step S116). If button 406 is not pressed (NO in step S116), the process in step S116 is repeated.

ボタン406が押下された場合(ステップS116においてYESの場合)には、評価処理アプリケーション20は、モデル画像取得処理の対象とする項目および最適なモデル画像を探索するためのパラメータを入力するためのダイアログ420(図12)をモニタ102に表示する(ステップS118)。続いて、評価処理アプリケーション20は、ユーザがプルダウンメニュー442を用いて入力する、調整されるモデル画像が用いられる
処理項目の指定を受付ける(ステップS120)。さらに、評価処理アプリケーション20は、ユーザがプルダウンメニュー444を用いて入力する、他の画像処理の結果を用いて処理を行なう場合などにおける、参照対象の処理項目の指定を受付ける(ステップS122)。さらに、評価処理アプリケーション20は、ユーザがプルダウンメニュー446を用いて入力する、調整モードの指定を受付ける(ステップS124)。
When the button 406 is pressed (YES in step S116), the evaluation processing application 20 is a dialog for inputting an item to be subjected to model image acquisition processing and parameters for searching for an optimal model image. 420 (FIG. 12) is displayed on the monitor 102 (step S118). Subsequently, the evaluation processing application 20 accepts designation of a processing item used by the model image to be adjusted, which is input by the user using the pull-down menu 442 (step S120). Furthermore, the evaluation processing application 20 accepts designation of a processing item to be referred to when the user inputs using the pull-down menu 444 and performs processing using the result of other image processing (step S122). Further, the evaluation processing application 20 accepts designation of the adjustment mode input by the user using the pull-down menu 446 (step S124).

このモデル画像取得処理の対象とする項目および最適なモデル画像を探索するためのパラメータの入力後、評価処理アプリケーション20は、選択された画像処理アプリケーション30に対して、初期設定モデル画像およびパラメータ値を要求する(ステップS126)。この要求に応答して、画像処理アプリケーション30は、現在設定されているモデル画像(初期設定モデル画像)および関連するパラメータの現在値を評価処理アプリケーション20へ応答する(ステップS128)。   After inputting the target items for the model image acquisition process and the parameters for searching for the optimum model image, the evaluation processing application 20 sets the initial model image and parameter values to the selected image processing application 30. A request is made (step S126). In response to this request, the image processing application 30 responds to the evaluation processing application 20 with the currently set model image (initial setting model image) and the current values of the related parameters (step S128).

続いて、評価処理アプリケーション20は、入力画面400A上のボタン409が押下されたか否かを判断する(ステップS130)。ボタン409が押下されていない場合(ステップS130においてNOの場合)には、処理はステップS136へ進む。   Subsequently, the evaluation processing application 20 determines whether or not the button 409 on the input screen 400A has been pressed (step S130). If button 409 has not been pressed (NO in step S130), the process proceeds to step S136.

ボタン409が押下された場合(ステップS130においてYESの場合)には、評価処理アプリケーション20は、図12に示すダイアログ430をモニタ102に表示する(ステップS132)。続いて、評価処理アプリケーション20は、モデル画像の抽出対象となる参照画像の指定を受付ける(ステップS134)。すなわち、ユーザは、マウス104などを操作してモデル画像を抽出する参照画像のファイルを設定する。この設定が完了すると、評価処理アプリケーション20は、ダイアログ430を閉じる。   If the button 409 is pressed (YES in step S130), the evaluation processing application 20 displays the dialog 430 shown in FIG. 12 on the monitor 102 (step S132). Subsequently, the evaluation processing application 20 accepts designation of a reference image from which a model image is to be extracted (step S134). That is, the user sets a reference image file from which a model image is extracted by operating the mouse 104 or the like. When this setting is completed, the evaluation processing application 20 closes the dialog 430.

続いて、評価処理アプリケーション20は、入力画面400A上のボタン410が押下されたか否かを判断する(ステップS136)。ボタン410が押下されていない場合(ステップS136においてNOの場合)には、ステップS130の処理が繰返される。   Subsequently, the evaluation processing application 20 determines whether or not the button 410 on the input screen 400A has been pressed (step S136). If button 410 has not been pressed (NO in step S136), the process of step S130 is repeated.

ボタン410が押下された場合(ステップS136においてYESの場合)には、評価処理アプリケーション20は、以下に示すように、参照画像から複数のモデル画像候補を抽出する。具体的には、評価処理アプリケーション20は、指定された参照画像のファイル名の一覧を取得した後、初期設定モデル画像に基づいてマッチング処理を行なわせるための指令を、画像処理アプリケーション30に対して与える(ステップS138)。このとき、参照画像からモデル画像を抽出する領域(サーチ範囲)などを指定する情報を付加してもよい。さらに、評価処理アプリケーション20は、参照画像の画像番号の1番目に対応する画像ファイル名の指定を、画像処理アプリケーション30に対して与える(ステップS140)。すなわち、評価処理アプリケーション20は、画像処理アプリケーション30に、初期設定モデル画像に基づいて、良品画像である参照画像から複数のモデル画像候補をサーチして抽出させる。   When the button 410 is pressed (YES in step S136), the evaluation processing application 20 extracts a plurality of model image candidates from the reference image as shown below. Specifically, the evaluation processing application 20 obtains a command for causing the matching processing based on the initial setting model image to the image processing application 30 after acquiring the list of file names of the designated reference images. (Step S138). At this time, information for designating an area (search range) for extracting the model image from the reference image may be added. Furthermore, the evaluation processing application 20 gives the image processing application 30 designation of the image file name corresponding to the first image number of the reference image (step S140). That is, the evaluation processing application 20 causes the image processing application 30 to search and extract a plurality of model image candidates from the reference image that is a non-defective image based on the initial setting model image.

画像処理アプリケーション30は、評価処理アプリケーション20からの通知に応答して、指定された計測画像をロードする(ステップS142)。続いて、画像処理アプリケーション30は、ロードされた計測画像に対して、現在設定されている初期設定モデル画像に基づくマッチング処理を実行することで、モデル画像候補を抽出する(ステップS144)。その後、画像処理アプリケーション30は、抽出したモデル画像候補を評価処理アプリケーション20へ返送する(ステップS146)。   In response to the notification from the evaluation processing application 20, the image processing application 30 loads the designated measurement image (step S142). Subsequently, the image processing application 30 extracts a model image candidate by executing a matching process based on the currently set initial setting model image with respect to the loaded measurement image (step S144). Thereafter, the image processing application 30 returns the extracted model image candidate to the evaluation processing application 20 (step S146).

評価処理アプリケーション20は、画像処理アプリケーション30から受信したモデル画像候補を記憶装置(メモリ106および/または固定ディスク107)に格納する(ステップS148)。続いて、評価処理アプリケーション20は、すべての参照画像(典型
的には、「良品」である計測画像)についてのモデル画像候補の抽出が完了したか否かを判断する(ステップS150)。すべての参照画像についてのモデル画像候補の抽出が完了していない場合(ステップS150においてNOの場合)には、評価処理アプリケーション20は、画像リスト1011を参照して、現在の画像番号の次にある画像番号に対応する画像ファイル名の指定を、画像処理アプリケーション30に対して与える(ステップS152)。その後、ステップS142以下の処理が繰返される。
The evaluation processing application 20 stores the model image candidate received from the image processing application 30 in the storage device (memory 106 and / or fixed disk 107) (step S148). Subsequently, the evaluation processing application 20 determines whether or not extraction of model image candidates for all reference images (typically, measurement images that are “good”) is completed (step S150). If extraction of model image candidates for all reference images has not been completed (NO in step S150), the evaluation processing application 20 refers to the image list 1011 and is next to the current image number. The designation of the image file name corresponding to the image number is given to the image processing application 30 (step S152). Thereafter, the processing after step S142 is repeated.

すべての参照画像についてのモデル画像候補の抽出が完了している場合(ステップS150においてNOの場合)には、評価処理アプリケーション20は、図13に示すダイアログ430をモニタ102に表示する(ステップS154)。   If the extraction of model image candidates for all reference images has been completed (NO in step S150), the evaluation processing application 20 displays a dialog 430 shown in FIG. 13 on the monitor 102 (step S154). .

続いて、評価処理アプリケーション20は、ダイアログ430上のボタン422が押下されたか否かを判断する(ステップS158)。ボタン422が押下された場合(ステップS158においてYESの場合)には、評価処理アプリケーション20は、選択されたモデル画像候補に試行番号を割当てる(ステップS160)。すなわち、評価処理アプリケーション20は、記憶装置に格納したモデル画像候補のうち、選択されたモデル画像候補と試行番号との対応付けを行なう。続いて、評価処理アプリケーション20は、割当てた試行番号に応じて、ダイアログ430上の枚数表示426を更新する(ステップS162)。   Subsequently, the evaluation processing application 20 determines whether or not the button 422 on the dialog 430 has been pressed (step S158). If the button 422 is pressed (YES in step S158), the evaluation processing application 20 assigns a trial number to the selected model image candidate (step S160). That is, the evaluation processing application 20 associates the selected model image candidate with the trial number among the model image candidates stored in the storage device. Subsequently, the evaluation processing application 20 updates the number display 426 on the dialog 430 in accordance with the assigned trial number (step S162).

ボタン422が押下されていない場合(ステップS158においてNOの場合)、もしくはステップS162の処理後、評価処理アプリケーション20は、ダイアログ430上のボタン424が押下されたか否かを判断する(ステップS164)。ボタン424が押下されていない場合(ステップS164においてNOの場合)には、ステップS156以下の処理が繰返される。一方、ボタン424が押下された場合(ステップS164においてYESの場合)には、評価処理アプリケーション20は、ダイアログ430を閉じる(ステップS166)。   If the button 422 has not been pressed (NO in step S158), or after the processing in step S162, the evaluation processing application 20 determines whether or not the button 424 on the dialog 430 has been pressed (step S164). If button 424 has not been pressed (NO in step S164), the processes in and after step S156 are repeated. On the other hand, when button 424 is pressed (YES in step S164), evaluation processing application 20 closes dialog 430 (step S166).

続いて、評価処理アプリケーション20は、入力画面400A上のボタン408が押下されたか否かを判断する(ステップS168)。ボタン408が押下されていない場合(ステップS168においてNOの場合)には、ステップS168の処理が繰返される。   Subsequently, the evaluation processing application 20 determines whether or not the button 408 on the input screen 400A has been pressed (step S168). If button 408 has not been pressed (NO in step S168), the process of step S168 is repeated.

ボタン408が押下された場合(ステップS168においてYESの場合)には、評価処理アプリケーション20は、以下に示すように、複数のモデル画像候補に対する試行を開始する。具体的には、評価処理アプリケーション20は、最も小さい試行番号(試行番号[0])に対応するモデル画像候補を記憶装置からロードする(ステップS170)。続いて、評価処理アプリケーション20は、ロードしたモデル候補画像および当該モデル候補画像に基づいてマッチング処理を行なわせるための指令を、画像処理アプリケーション30に対して与える(ステップS172)。さらに、評価処理アプリケーション20は、画像リスト1011を参照して、1番目の画像番号に対応する画像ファイル名の指定を、画像処理アプリケーション30に対して与える(ステップS174)。すなわち、評価処理アプリケーション20は、画像処理アプリケーション30に、モデル画像候補に基づくマッチング処理を実行させる。   When the button 408 is pressed (YES in step S168), the evaluation processing application 20 starts trials for a plurality of model image candidates as shown below. Specifically, the evaluation processing application 20 loads the model image candidate corresponding to the smallest trial number (trial number [0]) from the storage device (step S170). Subsequently, the evaluation processing application 20 gives the image processing application 30 a command for performing matching processing based on the loaded model candidate image and the model candidate image (step S172). Further, the evaluation processing application 20 refers to the image list 1011 and gives the image processing application 30 designation of the image file name corresponding to the first image number (step S174). That is, the evaluation processing application 20 causes the image processing application 30 to execute matching processing based on model image candidates.

画像処理アプリケーション30は、評価処理アプリケーション20からの通知に応答して、指定された計測画像をロードする(ステップS176)。続いて、画像処理アプリケーション30は、ロードされた計測画像に対して、評価処理アプリケーション20から受信したモデル画像候補に基づくマッチング処理を実行する(ステップS178)。その後、画像処理アプリケーション30は、マッチング処理により得られた類似度を評価処理アプリケーション20へ返送する(ステップS180)。   In response to the notification from the evaluation processing application 20, the image processing application 30 loads the designated measurement image (step S176). Subsequently, the image processing application 30 executes matching processing based on the model image candidate received from the evaluation processing application 20 with respect to the loaded measurement image (step S178). Thereafter, the image processing application 30 returns the similarity obtained by the matching process to the evaluation processing application 20 (step S180).

評価処理アプリケーション20は、画像処理アプリケーション30から受信した類似度を、試行番号および画像番号に対応付けて、判定結果リスト1035として記憶装置に格納する(ステップS182)。評価処理アプリケーション20は、受信した類似度と予め設定されているしきい値とを比較して、対象の計測画像に対する判定結果を算出して、判定結果リスト1035に追記する(ステップS184)。さらに、評価処理アプリケーション20は、算出した判定結果と、対象の計測画像に対応付けられている期待クラスとを比較して、その評価結果を試行番号および画像番号に対応付けて、評価結果リスト1042として記憶装置に格納する(ステップS186)。   The evaluation processing application 20 stores the similarity received from the image processing application 30 in the storage device as the determination result list 1035 in association with the trial number and the image number (step S182). The evaluation processing application 20 compares the received similarity with a preset threshold value, calculates a determination result for the target measurement image, and adds the determination result to the determination result list 1035 (step S184). Furthermore, the evaluation processing application 20 compares the calculated determination result with the expected class associated with the target measurement image, associates the evaluation result with the trial number and the image number, and evaluates the evaluation result list 1042. Is stored in the storage device (step S186).

続いて、評価処理アプリケーション20は、画像リスト1011を参照して、すべての計測画像についての現在のモデル画像候補についての試行が完了したか否かを判断する(ステップS188)。すべての計測画像についての試行が完了していない場合(ステップS188においてNOの場合)には、評価処理アプリケーション20は、画像リスト1011を参照して、現在の画像番号の次にある画像番号に対応する計測画像の画像ファイル名の指定を、画像処理アプリケーション30に対して与える(ステップS190)。その後、ステップS176以下の処理が繰返される。   Subsequently, the evaluation processing application 20 refers to the image list 1011 and determines whether or not the trial for the current model image candidate for all measurement images has been completed (step S188). If the trials for all measurement images have not been completed (NO in step S188), the evaluation processing application 20 refers to the image list 1011 and corresponds to the image number next to the current image number. The designation of the image file name of the measurement image to be performed is given to the image processing application 30 (step S190). Thereafter, the processing from step S176 onward is repeated.

すべての計測画像についての試行が完了している場合(ステップS188においてYESの場合)には、評価処理アプリケーション20は、判定結果リスト1035および評価結果リスト1042を参照して、現在の試行番号において算出された類似度および評価結果についての統計量を算出する(ステップS192)。   When trials for all measurement images have been completed (YES in step S188), the evaluation processing application 20 refers to the determination result list 1035 and the evaluation result list 1042, and calculates the current trial number. A statistic about the similarity and the evaluation result is calculated (step S192).

続いて、評価処理アプリケーション20は、試行対象のすべてのモデル画像候補についての試行が完了したか否かを判断する(ステップS194)。試行対象のすべてのモデル画像候補についての試行が完了していない場合(ステップS194においてNOの場合)には、評価処理アプリケーション20は、現在の試行番号の次にある試行番号に対応するモデル画像候補を記憶装置からロードする(ステップS196)。その後、ステップS174以下の処理が繰返される。   Subsequently, the evaluation processing application 20 determines whether or not the trial for all the model image candidates to be tried has been completed (step S194). When the trials for all the model image candidates to be tried have not been completed (NO in step S194), the evaluation processing application 20 selects the model image candidate corresponding to the trial number next to the current trial number. Is loaded from the storage device (step S196). Thereafter, the processing after step S174 is repeated.

試行対象のすべてのモデル画像候補についての試行が完了している場合(ステップS194においてYESの場合)には、評価処理アプリケーション20は、算出された類似度および/または評価結果に基づいて、最適なモデル画像を決定する(ステップS198)。続いて、評価処理アプリケーション20は、それぞれの試行番号について算出された類似度、評価結果、およびそれらの統計量に基づいて、図14に示すような評価結果画面をモニタ102に表示する(ステップS200)。   When trials for all model image candidates to be tried have been completed (YES in step S194), the evaluation processing application 20 determines the optimum based on the calculated similarity and / or evaluation result. A model image is determined (step S198). Subsequently, the evaluation processing application 20 displays an evaluation result screen as shown in FIG. 14 on the monitor 102 based on the similarity calculated for each trial number, the evaluation result, and their statistics (step S200). ).

続いて、評価処理アプリケーション20は、入力画面400A上のボタン412が押下されたか否かを判断する(ステップS202)。ボタン412が押下された場合(ステップS202においてYESの場合)には、評価処理アプリケーション20は、選択されているモデル画像候補を接続先の画像処理装置200の画像処理アプリケーション30Aへ転送する(ステップS204)。画像処理アプリケーション30は、受信したモデル画像候補を新たなモデル画像として設定する(ステップS206)。   Subsequently, the evaluation processing application 20 determines whether or not the button 412 on the input screen 400A has been pressed (step S202). When the button 412 is pressed (YES in step S202), the evaluation processing application 20 transfers the selected model image candidate to the image processing application 30A of the connection destination image processing apparatus 200 (step S204). ). The image processing application 30 sets the received model image candidate as a new model image (step S206).

ボタン412が押下されていない場合(ステップS202においてNOの場合)、もしくはステップS206の処理後、評価処理アプリケーション20は、評価処理アプリケーション20の終了が指示されたか否かを判断する(ステップS208)。評価処理アプリケーション20の終了が指示されていない場合(ステップS208においてNOの場合)には、ステップS202以下の処理が繰返される。   If the button 412 has not been pressed (NO in step S202), or after the processing in step S206, the evaluation processing application 20 determines whether or not the termination of the evaluation processing application 20 has been instructed (step S208). If termination of evaluation processing application 20 is not instructed (NO in step S208), the processing in step S202 and subsequent steps is repeated.

評価処理アプリケーション20の終了が指示された場合(ステップS208においてYESの場合)には、処理は終了する。   If the end of evaluation processing application 20 is instructed (YES in step S208), the process ends.

<本実施形態の作用効果>
この発明の実施の形態によれば、ユーザがモデル画像を抽出すべき参照画像を指定するだけで、それぞれの参照画像からモデル画像候補が抽出されるとともに、それぞれ抽出されたモデル画像候補を用いて実際にマッチング処理を行なった結果を評価内容が一覧表示される。そのため、ユーザは、一覧表示された評価結果に基づいて、容易に最適なモデル画像を選択することができる。
<Operational effects of this embodiment>
According to the embodiment of the present invention, the model image candidate is extracted from each reference image only by the user specifying the reference image from which the model image is to be extracted, and each extracted model image candidate is used. A list of evaluation contents of the results of the actual matching process is displayed. Therefore, the user can easily select an optimal model image based on the evaluation results displayed in a list.

すなわち、ユーザは、モデル画像となり得る参照画像を指定するだけで、それ以外はモデル画像取得支援装置が自動的に処理を実行するので、ユーザが現場に張付いて長時間に亘って調整を行なう必要がなくなる。そのため、モデル画像として採用できる可能性のある参照画像が大量に存在する場合であっても、より迅速かつ容易に最適なモデル画像を決定することができる。   That is, the user only specifies a reference image that can be a model image, and the model image acquisition support apparatus automatically performs processing for other than that, so the user sticks to the site and makes adjustments over a long period of time. There is no need. Therefore, even when there are a large number of reference images that may be adopted as model images, an optimal model image can be determined more quickly and easily.

また、モデル画像候補の間で、統計的な評価結果を比較可能に評価結果が一覧表示されるので、作業者の経験によらず、最適なモデル画像を客観的に決定することができる。そのため、ある程度の知識を有する作業者であれば、熟練した作業者による作業に遜色なく適切なモデル画像を決定することができる。   In addition, since the evaluation results are displayed in a list so that the statistical evaluation results can be compared among the model image candidates, an optimal model image can be objectively determined regardless of the operator's experience. Therefore, an appropriate model image can be determined by an operator who has a certain level of knowledge without inferior to the work performed by a skilled worker.

<変形例1>
上述の実施の形態に従う支援装置100における全体処理を示すフローチャートでは、それぞれのモデル画像候補をセットした後、対象の計測画像に対してマッチング処理を順次実行する手順について例示したが、先に対象の計測画像をロードした後、モデル画像候補の各々についてマッチング処理を順次実行するようにしてもよい(変形例1)。この方法は、計測画像のロードや転送などに時間を要する環境や、生産ラインを流れるワークを撮像して新たな計測画像を取得しながら、並行してモデル画像候補の評価を行なう場合に、有効である。
<Modification 1>
In the flowchart showing the overall process in the support device 100 according to the above-described embodiment, the procedure for sequentially executing the matching process on the target measurement image after setting each model image candidate is illustrated. After loading the measurement image, the matching process may be sequentially executed for each of the model image candidates (Modification 1). This method is effective in environments that require time to load and transfer measurement images, and when evaluating model image candidates in parallel while capturing a new measurement image by capturing a workpiece flowing through the production line. It is.

変形例1に従うシステムにおける全体処理は、本実施の形態に従うシステムにおける全体処理手順(図18〜図22)のうち、図21のフローチャートに示す処理手順を図23のフローチャートに示す処理のように変更したものに相当する。したがって、以下の説明では、本実施の形態と同様の処理手順については、説明を繰返さない。また、図23に示すフローチャートにおいて、図21に示すフローチャートに含まれる各ステップの処理と同様の処理を含むステップについては、同一のステップ番号を用いている。   The overall process in the system according to the first modification is changed from the overall process procedure (FIGS. 18 to 22) in the system according to the present embodiment to the process shown in the flowchart of FIG. Is equivalent to Therefore, in the following description, the description of the processing procedure similar to that of the present embodiment will not be repeated. Further, in the flowchart shown in FIG. 23, the same step numbers are used for steps including processes similar to the processes of the steps included in the flowchart shown in FIG.

図23を参照して、まず、評価処理アプリケーション20は、画像リスト1011を参照して、1番目の画像番号に対応する画像ファイル名の指定を、画像処理アプリケーション30に対して与える(ステップS174)。続いて、評価処理アプリケーション20は、最も小さい試行番号(試行番号[0])に対応するモデル画像候補を記憶装置からロードする(ステップS170)。さらに、評価処理アプリケーション20は、ロードしたモデル候補画像および当該モデル候補画像に基づいてマッチング処理を行なわせるための指令を、画像処理アプリケーション30に対して与える(ステップS172)。   Referring to FIG. 23, first, the evaluation processing application 20 refers to the image list 1011 and gives the image processing application 30 designation of the image file name corresponding to the first image number (step S174). . Subsequently, the evaluation processing application 20 loads the model image candidate corresponding to the smallest trial number (trial number [0]) from the storage device (step S170). Furthermore, the evaluation processing application 20 gives the image processing application 30 a command for performing matching processing based on the loaded model candidate image and the model candidate image (step S172).

画像処理アプリケーション30は、評価処理アプリケーション20からの通知に応答して、指定された計測画像をロードする(ステップS176)。続いて、画像処理アプリケーション30は、ロードされた計測画像に対して、評価処理アプリケーション20から受信したモデル画像候補に基づくマッチング処理を実行する(ステップS178)。その後、画像処理アプリケーション30は、マッチング処理により得られた類似度を評価処理ア
プリケーション20へ返送する(ステップS180)。
In response to the notification from the evaluation processing application 20, the image processing application 30 loads the designated measurement image (step S176). Subsequently, the image processing application 30 executes matching processing based on the model image candidate received from the evaluation processing application 20 with respect to the loaded measurement image (step S178). Thereafter, the image processing application 30 returns the similarity obtained by the matching process to the evaluation processing application 20 (step S180).

評価処理アプリケーション20は、画像処理アプリケーション30から受信した類似度を、試行番号および画像番号に対応付けて、判定結果リスト1035として記憶装置に格納する(ステップS182)。評価処理アプリケーション20は、受信した類似度と予め設定されているしきい値とを比較して、対象の計測画像に対する判定結果を算出して、判定結果リスト1035に追記する(ステップS184)。さらに、評価処理アプリケーション20は、算出した判定結果と、対象の計測画像に対応付けられている期待クラスとを比較して、その評価結果を試行番号および画像番号に対応付けて、評価結果リスト1042として記憶装置に格納する(ステップS186)。   The evaluation processing application 20 stores the similarity received from the image processing application 30 in the storage device as the determination result list 1035 in association with the trial number and the image number (step S182). The evaluation processing application 20 compares the received similarity with a preset threshold value, calculates a determination result for the target measurement image, and adds the determination result to the determination result list 1035 (step S184). Furthermore, the evaluation processing application 20 compares the calculated determination result with the expected class associated with the target measurement image, associates the evaluation result with the trial number and the image number, and evaluates the evaluation result list 1042. Is stored in the storage device (step S186).

続いて、評価処理アプリケーション20は、試行対象のすべてのモデル画像候補についての試行が完了したか否かを判断する(ステップS194)。試行対象のすべてのモデル画像候補についての試行が完了していない場合(ステップS194においてNOの場合)には、評価処理アプリケーション20は、現在の試行番号の次にある試行番号に対応するモデル画像候補を記憶装置からロードする(ステップS196)。その後、ステップS172以下の処理が繰返される。   Subsequently, the evaluation processing application 20 determines whether or not the trial for all the model image candidates to be tried has been completed (step S194). When the trials for all the model image candidates to be tried have not been completed (NO in step S194), the evaluation processing application 20 selects the model image candidate corresponding to the trial number next to the current trial number. Is loaded from the storage device (step S196). Thereafter, the processing after step S172 is repeated.

一方、試行対象のすべてのモデル画像候補についての試行が完了している場合(ステップS194においてYESの場合)には、評価処理アプリケーション20は、画像リスト1011を参照して、すべての計測画像についての試行が完了したか否かを判断する(ステップS188A)。すべての計測画像についての試行が完了していない場合(ステップS188AにおいてNOの場合)には、評価処理アプリケーション20は、画像リスト1011を参照して、現在の画像番号の次にある画像番号に対応する計測画像の画像ファイル名の指定を、画像処理アプリケーション30に対して与える(ステップS190)。その後、ステップS170以下の処理が繰返される。   On the other hand, when trials for all model image candidates to be tried have been completed (YES in step S194), the evaluation processing application 20 refers to the image list 1011 and performs the measurement for all measurement images. It is determined whether or not the trial is completed (step S188A). If trials for all measurement images have not been completed (NO in step S188A), the evaluation processing application 20 refers to the image list 1011 and corresponds to the image number next to the current image number. The designation of the image file name of the measurement image to be performed is given to the image processing application 30 (step S190). Thereafter, the processing after step S170 is repeated.

すべての計測画像についての試行が完了している場合(ステップS188AにおいてYESの場合)には、評価処理アプリケーション20は、判定結果リスト1035および評価結果リスト1042を参照して、それぞれの試行番号において算出された類似度および評価結果についての統計量をそれぞれ算出する(ステップS192A)。その後、処理はステップS198へ進む。   When trials for all measurement images have been completed (YES in step S188A), the evaluation processing application 20 refers to the determination result list 1035 and the evaluation result list 1042, and calculates for each trial number. Statistics about the similarity and the evaluation result are calculated (step S192A). Thereafter, the process proceeds to step S198.

<変形例2>
上述したマッチング処理における誤検出数に応じて、不適切と考えられるモデル画像候補についての試行を打ち切る処理を追加してもよい(変形例2)。変形例2に従うシステムにおける全体処理は、本実施の形態に従うシステムにおける全体処理手順(図18〜図22)のうち、図21のフローチャートに示す処理手順を図24のフローチャートに示す処理のように変更したものに相当する。したがって、以下の説明では、本実施の形態と同様の処理手順については、説明を繰返さない。また、図24に示すフローチャートは、図21に示すフローチャートにおいて、ステップS230,S232,S234を追加したものに相当する。
<Modification 2>
Depending on the number of erroneous detections in the above-described matching process, a process of aborting trials for model image candidates that are considered inappropriate may be added (Modification 2). The overall process in the system according to the second modification is changed from the overall process procedure (FIGS. 18 to 22) in the system according to the present embodiment to the process shown in the flowchart in FIG. Is equivalent to Therefore, in the following description, the description of the processing procedure similar to that of the present embodiment will not be repeated. The flowchart shown in FIG. 24 corresponds to the flowchart shown in FIG. 21 with steps S230, S232, and S234 added.

ステップS186の実行後、評価処理アプリケーション20は、算出した判定結果が対象の計測画像に対応付けられている期待クラスと不一致である場合に、誤検出数をカウントする(ステップS230)。続いて、評価処理アプリケーション20は、ステップS230においてカウントされた誤検出数が指定された許容上限値を超えているか否かを判断する(ステップS232)。   After execution of step S186, the evaluation processing application 20 counts the number of false detections when the calculated determination result does not match the expected class associated with the target measurement image (step S230). Subsequently, the evaluation processing application 20 determines whether or not the number of erroneous detections counted in step S230 exceeds a specified allowable upper limit value (step S232).

カウントされた誤検出数が指定された許容上限値を超えている場合(ステップS232
においてYESの場合)には、評価処理アプリケーション20は、現在のモデル画像候補についての残りの計測画像に対する試行を打ち切るための指令を画像処理アプリケーション30へ送信する(ステップS234)。そして、処理はステップS196へ進む。
When the counted number of erroneous detections exceeds the specified allowable upper limit value (step S232)
In the case of YES), the evaluation processing application 20 transmits to the image processing application 30 a command for aborting trials for the remaining measurement images for the current model image candidate (step S234). Then, the process proceeds to step S196.

<変形例3>
上述の実施の形態においては、主として1つのモデル画像に基づくマッチング処理を行なう構成について例示した。ところで、取得される計測画像が様々な外乱によって安定しない(不安定な)場合などには、予め複数のモデル画像を用意しておき、これらのモデル画像に基づいてマッチング処理を行なうことでマッチング処理をより安定化することができる。より具体的には、計測画像に対して、複数のモデル画像に基づくマッチング処理をそれぞれ実行するとともに、少なくともいずれか1つのモデル画像に基づくマッチング処理が成功すれば、対象の計測画像に対して全体としてマッチングOKと判断するようなアプリケーションが想定される。なお、このようなマッチング処理は、フレキシブルサーチなどと称される。
<Modification 3>
In the above-described embodiment, the configuration for performing the matching process mainly based on one model image has been illustrated. By the way, when the acquired measurement image is not stable (unstable) due to various disturbances, a plurality of model images are prepared in advance, and matching processing is performed by performing matching processing based on these model images. Can be further stabilized. More specifically, matching processing based on a plurality of model images is performed on the measurement image, and if matching processing based on at least one model image is successful, the entire measurement image on the target Assuming that matching is OK, an application is assumed. Such matching processing is called flexible search or the like.

図25は、この発明の実施の形態の変形例3に従うマッチング処理の概要を説明するための図である。図25(a)は、全体としてマッチングOKの場合を示し、図25(b)は、全体としてマッチングNGの場合を示す。   FIG. 25 is a diagram for describing the outline of the matching processing according to the third modification of the embodiment of the present invention. FIG. 25A shows the case of matching OK as a whole, and FIG. 25B shows the case of matching NG as a whole.

図25(a)を参照して、予め用意された複数のモデル画像MDL1〜MDL5(以下、これらのモデル画像を「(最適)モデル画像セット」とも称す。)と計測画像との間で、マッチング処理がそれぞれ行なわれる。すなわち、モデル画像MDL1〜MDL5の各々について、計測画像との間の類似度(相関値)が算出される。さらに、これらの算出された類似度(相関値)と予め設定されたしきい値とをそれぞれ比較することで、マッチングOKまたはマッチングNGがそれぞれ判断される。そして、少なくとも1つ(図25(a)に示す例では、モデル画像MDL2およびMDL4の2つ)のモデル画像について、マッチングOKと判断されると、当該計測画像の全体に対するマッチング処理としては「OK」と判断される。   Referring to FIG. 25A, matching is performed between a plurality of model images MDL1 to MDL5 prepared in advance (hereinafter, these model images are also referred to as “(optimum) model image set”) and measurement images. Each process is performed. That is, for each of the model images MDL1 to MDL5, the similarity (correlation value) with the measurement image is calculated. Further, matching OK or matching NG is determined by comparing the calculated similarity (correlation value) with a preset threshold value. When it is determined that the matching is OK for at least one model image (two model images MDL2 and MDL4 in the example shown in FIG. 25A), the matching processing for the entire measurement image is “OK”. Is determined.

これに対して、図25(b)に示すように、モデル画像MDL1〜MDL5のすべてについてマッチングNGと判断されると、当該計測画像の全体に対するマッチング処理としては「NG」と判断される。   On the other hand, as shown in FIG. 25B, when all the model images MDL1 to MDL5 are determined to be matching NG, the matching processing for the entire measurement image is determined to be “NG”.

このような複数のモデル画像を用いてマッチング処理を行なうようなアプリケーションに対しては、どのような組み合わせのモデル画像を設定するのかが重要である。そこで、本実施の形態の変形例3においては、より迅速かつ容易に最適なモデル画像セットを決定可能な構成について説明する。   For such an application that performs a matching process using a plurality of model images, what kind of combination of model images is set is important. Therefore, in Modification 3 of the present embodiment, a configuration that can determine an optimal model image set more quickly and easily will be described.

図26は、この発明の実施の形態の変形例3に従うマッチング処理におけるモデル画像セット取得処理の概要を説明するための図である。   FIG. 26 is a diagram for describing an overview of the model image set acquisition process in the matching process according to the third modification of the embodiment of the present invention.

図26を参照して、本変形例に従う支援装置は、複数の参照画像から抽出されたモデル画像候補のうち、複数のモデル画像候補を「最適モデル画像セット」として決定する。このような最適モデル画像セットを用いることで、取得される計測画像が様々な外乱に影響を受けたとしても、マッチング処理を安定して行なうことができる。すなわち、本変形例に従う支援装置は、複数の計測画像の全体に対してのマッチング処理結果を最適化するための、複数のモデル画像候補に含まれる2つ以上のモデル画像候補の組合わせを探索する。なお、以下では、典型的な3つの手法について例示する。   Referring to FIG. 26, the support apparatus according to the present modification determines a plurality of model image candidates as an “optimum model image set” from among model image candidates extracted from a plurality of reference images. By using such an optimal model image set, matching processing can be performed stably even if the acquired measurement image is affected by various disturbances. That is, the support device according to the present modification searches for a combination of two or more model image candidates included in the plurality of model image candidates for optimizing the matching processing result for the entire plurality of measurement images. To do. In the following, three typical techniques will be exemplified.

(手法1)
手法1は、図26に示すモデル画像候補から総当りでモデル画像セットの候補を試行対象として、この作成した試行対象のうち、最も安定したマッチング処理ができるものを選択するものである。
(Method 1)
Method 1 is to select model image set candidates from the model image candidates shown in FIG. 26 as trial targets, and select the one that can perform the most stable matching process from the created trial targets.

図27は、この発明の実施の形態の変形例3に従う手法1の概要を説明するための図である。図27に示すように、本変形例の手法1においては、予め定められた数で構成されるモデル画像候補の組み合わせを総当りで決定し、各組み合わせを試行対象とする。すなわち、図27に示す例では、3つのモデル画像候補の組み合わせを順次作成していき、各組み合わせに試行番号を割り当てる。そして、各試行番号を割り当てたモデル画像候補を用いて、上述と同様の試行を繰り返し実行する。そして、その実行結果をユーザに表示する。試行結果を提供するユーザインターフェイスについては、上述の図14と同様であるので、詳細な説明は繰返さない。   FIG. 27 is a diagram for describing an overview of Method 1 according to the third modification of the embodiment of the present invention. As shown in FIG. 27, in Method 1 of the present modification, combinations of model image candidates configured by a predetermined number are determined brute force, and each combination is set as a trial target. That is, in the example shown in FIG. 27, combinations of three model image candidates are sequentially generated, and a trial number is assigned to each combination. And the trial similar to the above is repeatedly performed using the model image candidate which assigned each trial number. Then, the execution result is displayed to the user. Since the user interface for providing the trial result is the same as that in FIG. 14 described above, detailed description will not be repeated.

なお、図27に示す例では、予め定められた数のモデル画像候補の組み合わせを作成する構成について例示したが、組み合わせに用いるモデル画像候補の数も変動するようにしてもよい。   In the example shown in FIG. 27, the configuration for creating a predetermined number of model image candidate combinations has been illustrated, but the number of model image candidates used for the combination may also vary.

上述のような手法1の手順は、図28に示すフローチャートに概略することができる。
図28は、この発明の実施の形態の変形例3に従う手法1の手順を示すフローチャートである。図28に示すフローチャートは、典型的には、支援装置100のCPU105が固定ディスク107などに予め格納されたプログラムをメモリ106に読出して実行することにより実現される。
The procedure of Method 1 as described above can be outlined in the flowchart shown in FIG.
FIG. 28 is a flowchart showing a procedure of method 1 according to the third modification of the embodiment of the present invention. The flowchart shown in FIG. 28 is typically realized by the CPU 105 of the support apparatus 100 reading a program stored in advance in the fixed disk 107 or the like into the memory 106 and executing it.

評価処理アプリケーション20(支援装置100のCPU105(図2);以下同様)は、モデル画像の抽出対象となる参照画像の指定を受付ける(ステップS400)。続いて、評価処理アプリケーション20は、指定された参照画像から複数のモデル画像候補を抽出する(ステップS402)。このステップS402の処理内容は、上述した図19のステップS138〜S152の処理内容と同様である。   The evaluation processing application 20 (the CPU 105 of the support apparatus 100 (FIG. 2); the same applies hereinafter) accepts designation of a reference image from which a model image is to be extracted (step S400). Subsequently, the evaluation processing application 20 extracts a plurality of model image candidates from the designated reference image (step S402). The processing content of step S402 is the same as the processing content of steps S138 to S152 of FIG. 19 described above.

その後、評価処理アプリケーション20は、抽出された複数のモデル画像候補から予め定められた数で構成される組み合わせを総当りで決定する(ステップS404)。さらに、評価処理アプリケーション20は、決定した組み合わせの各々について、試行番号を割り当てる(ステップS406)。   Thereafter, the evaluation processing application 20 determines a brute force combination composed of a predetermined number from the extracted model image candidates (step S404). Furthermore, the evaluation processing application 20 assigns a trial number to each determined combination (step S406).

さらに、評価処理アプリケーション20は、各試行番号に対応するモデル画像候補セットに対して、試行を実行する(ステップS408)。このステップS408の処理内容は、上述した図21のステップS170〜S196の処理内容と同様である。   Furthermore, the evaluation processing application 20 executes a trial for the model image candidate set corresponding to each trial number (step S408). The processing content of step S408 is the same as the processing content of steps S170 to S196 of FIG. 21 described above.

試行の完了後、評価処理アプリケーション20は、それぞれの試行番号について算出された類似度、評価結果、およびそれらの統計量などを示す評価結果画面をモニタ102に表示する(ステップS410)。さらに、評価処理アプリケーション20は、ユーザがいずれかのモデル画像候補セットを選択したか否かを判断する(ステップS412)。   After the trial is completed, the evaluation processing application 20 displays an evaluation result screen indicating the similarity calculated for each trial number, the evaluation result, and their statistics on the monitor 102 (step S410). Furthermore, the evaluation processing application 20 determines whether or not the user has selected any model image candidate set (step S412).

ユーザがいずれかのモデル画像候補セットを選択した場合(ステップS412においてYESの場合)には、評価処理アプリケーション20は、選択されたモデル画像候補セットを接続先の画像処理装置200の画像処理アプリケーション30Aへ転送する(ステップS414)。画像処理アプリケーション30は、受信したモデル画像候補を、フレキシブルサーチ用のモデル画像セットとして登録する。   When the user selects any model image candidate set (YES in step S412), the evaluation processing application 20 uses the selected model image candidate set as the image processing application 30A of the connection destination image processing apparatus 200. (Step S414). The image processing application 30 registers the received model image candidate as a model image set for flexible search.

本変形例に従う手法1によれば、モデル画像候補の組み合わせを総当りで評価できるの
で、最適モデル画像候補セットを確実に決定することができる。
According to Method 1 according to the present modification, the combination of model image candidates can be evaluated brute force, so that the optimal model image candidate set can be determined reliably.

(手法2)
手法2は、まず、図26に示すモデル画像候補のうち最も安定してマッチング処理ができるモデル画像を決定し、続いて、当該決定したモデル画像に対してマッチングNGとなった計測画像を抽出して、この抽出した計測画像との間でマッチングOKとなる他のモデル画像を補完的に決定するものである。この手法2の手順を図29を用いて説明する。
(Method 2)
In Method 2, first, a model image that can be most stably matched among the model image candidates shown in FIG. 26 is determined, and subsequently, a measurement image that is a matching NG with respect to the determined model image is extracted. Thus, another model image that is matched with the extracted measurement image is determined in a complementary manner. The procedure of Method 2 will be described with reference to FIG.

図29は、この発明の実施の形態の変形例3に従う手法2の手順を示すフローチャートである。図29に示すフローチャートは、典型的には、支援装置100のCPU105が固定ディスク107などに予め格納されたプログラムをメモリ106に読出して実行することにより実現される。   FIG. 29 is a flowchart showing a procedure of technique 2 according to the third modification of the embodiment of the present invention. The flowchart shown in FIG. 29 is typically realized by the CPU 105 of the support apparatus 100 reading out a program stored in advance in the fixed disk 107 or the like to the memory 106 and executing it.

評価処理アプリケーション20(支援装置100のCPU105(図2);以下同様)は、モデル画像の抽出対象となる参照画像の指定を受付ける(ステップS450)。続いて、評価処理アプリケーション20は、指定された参照画像から複数のモデル画像候補を抽出する(ステップS452)。このステップS452の処理内容は、上述した図19のステップS138〜S152の処理内容と同様である。   The evaluation processing application 20 (the CPU 105 (FIG. 2) of the support apparatus 100; the same applies hereinafter) accepts designation of a reference image from which a model image is to be extracted (step S450). Subsequently, the evaluation processing application 20 extracts a plurality of model image candidates from the designated reference image (step S452). The processing content of step S452 is the same as the processing content of steps S138 to S152 of FIG. 19 described above.

その後、評価処理アプリケーション20は、抽出された複数のモデル画像候補の各々に対して試行番号を割り当てる(ステップS454)。そして、評価処理アプリケーション20は、各試行番号に対応するモデル画像候補に対して、試行を実行する(ステップS456)。このステップS456の処理内容は、上述した図21のステップS170〜S196の処理内容と同様である。試行の完了後、評価処理アプリケーション20は、算出された類似度および/または評価結果に基づいて、対象としたモデル画像候補のうち最適なモデル画像(第1モデル画像)を決定する(ステップS458)。続いて、評価処理アプリケーション20は、ステップS458において決定した第1モデル画像に対してマッチングNGとなった計測画像を抽出する(ステップS460)。   Thereafter, the evaluation processing application 20 assigns a trial number to each of the extracted plurality of model image candidates (step S454). Then, the evaluation processing application 20 executes a trial for the model image candidate corresponding to each trial number (step S456). The processing content of step S456 is the same as the processing content of steps S170 to S196 of FIG. 21 described above. After completion of the trial, the evaluation processing application 20 determines an optimal model image (first model image) among the target model image candidates based on the calculated similarity and / or evaluation result (step S458). . Subsequently, the evaluation processing application 20 extracts a measurement image that becomes a matching NG with respect to the first model image determined in step S458 (step S460).

さらに、評価処理アプリケーション20は、抽出された複数のモデル画像候補のうち、ステップS458において決定した第1モデル画像を除いた他のモデル画像候補に対して、ステップS460で抽出した計測画像についての試行を実行する(ステップS462)。このステップS462の処理内容についても、上述した図21のステップS170〜S196の処理内容と同様である。試行の完了後、評価処理アプリケーション20は、算出された類似度および/または評価結果に基づいて、対象としたモデル画像候補のうち最適なモデル画像(第2モデル画像)を決定する(ステップS464)。   Further, the evaluation processing application 20 performs a trial on the measurement image extracted in step S460 with respect to other model image candidates excluding the first model image determined in step S458 among the extracted model image candidates. Is executed (step S462). The processing content of step S462 is the same as the processing content of steps S170 to S196 of FIG. 21 described above. After completion of the trial, the evaluation processing application 20 determines an optimal model image (second model image) among the target model image candidates based on the calculated similarity and / or evaluation result (step S464). .

続いて、評価処理アプリケーション20は、ステップS464において決定した第2モデル画像に対してマッチングNGとなった計測画像が存在するか否かを判断する(ステップS466)。第2モデル画像に対してマッチングNGとなった計測画像が存在しない場合(ステップS466においてNOの場合)には、評価処理アプリケーション20は、ステップS458において決定した第1モデル画像およびステップS464において決定した第2モデル画像を、モデル画像候補セットとして決定する(ステップS468)。   Subsequently, the evaluation processing application 20 determines whether or not there is a measurement image that is a matching NG with respect to the second model image determined in step S464 (step S466). If there is no measurement image matching NG with respect to the second model image (NO in step S466), the evaluation processing application 20 has determined in step S464 and the first model image determined in step S458. The second model image is determined as a model image candidate set (step S468).

これに対して、第2モデル画像に対してマッチングNGとなった計測画像が存在する場合(ステップS466においてYESの場合)には、評価処理アプリケーション20は、ステップS460以下の処理を繰返す。すなわち、評価処理アプリケーション20は、マッチングNGとなった計測画像が存在しなくなるまで、第2モデル画像を追加する。   On the other hand, when there is a measurement image that matches NG with respect to the second model image (YES in step S466), evaluation processing application 20 repeats the processing in step S460 and subsequent steps. In other words, the evaluation processing application 20 adds the second model image until there is no measurement image that is matched NG.

本変形例に従う手法2によれば、最低限必要な数のモデル画像からなるモデル画像候補
セットを決定できるので、より効率的なマッチング処理が可能となる。
According to the method 2 according to the present modification, a model image candidate set composed of a minimum number of model images can be determined, so that more efficient matching processing can be performed.

(手法3)
手法3は、図26に示すモデル画像候補の各々について試行を実行し、それぞれの試行結果に基づいて、最適なモデル画像候補のモデル画像候補の組み合わせを決定するものである。
(Method 3)
In Method 3, trials are executed for each of the model image candidates shown in FIG. 26, and an optimal model image candidate combination is determined based on the trial results.

図30は、この発明の実施の形態の変形例3に従う手法3の概要を説明するための図である。図31は、この発明の実施の形態の変形例3に従う手法3における試行結果の一例を示す図である。   FIG. 30 is a diagram for describing an overview of method 3 according to the third modification of the embodiment of the present invention. FIG. 31 is a diagram showing an example of a trial result in the technique 3 according to the third modification of the embodiment of the present invention.

図30(a)に示すように、本変形例の手法3においては、まず、抽出された複数のモデル画像候補の各々について、計測画像に対する試行をそれぞれ実行する。すると、図31に示すような、対象の計測画像の各々に対する類似度(相関値)がモデル画像候補の別に算出される。図31に示すような試行結果に基づいて、すべての計測画像についての類似度(相関値)が所定値を維持できるような組み合わせを決定する。典型的な決定処理方法としては、それぞれの計測画像との間で最も類似度(相関値)が高いモデル画像候補を特定する(図31に示すハッチング部分に対応)とともに、これらの特定されたモデル画像候補の集合をモデル画像候補セットとして決定する。すなわち、図31に示す例では、計測画像1,2,5については、モデル画像候補1が最も類似度(相関値)が高く、計測画像3,4については、モデル画像候補2が最も類似度(相関値)が高い。その結果、図30(b)に示すように、モデル画像候補1およびモデル画像候補2がモデル画像候補セットとして決定される。   As shown in FIG. 30A, in the method 3 of the present modification, first, a trial for a measurement image is executed for each of a plurality of extracted model image candidates. Then, as shown in FIG. 31, the similarity (correlation value) for each target measurement image is calculated for each model image candidate. Based on the trial results as shown in FIG. 31, a combination is determined such that the similarity (correlation value) for all measurement images can maintain a predetermined value. As a typical determination processing method, model image candidates having the highest similarity (correlation value) among the respective measurement images are identified (corresponding to the hatched portion shown in FIG. 31), and these identified models are also identified. A set of image candidates is determined as a model image candidate set. That is, in the example shown in FIG. 31, the model image candidate 1 has the highest similarity (correlation value) for the measurement images 1, 2, and 5, and the model image candidate 2 has the highest similarity for the measurement images 3 and 4. (Correlation value) is high. As a result, as shown in FIG. 30B, model image candidate 1 and model image candidate 2 are determined as a model image candidate set.

上述のような手法3の手順は、図32に示すフローチャートに概略することができる。
図32は、この発明の実施の形態の変形例3に従う手法3の手順を示すフローチャートである。図32に示すフローチャートは、典型的には、支援装置100のCPU105が固定ディスク107などに予め格納されたプログラムをメモリ106に読出して実行することにより実現される。
The procedure of Method 3 as described above can be outlined in the flowchart shown in FIG.
FIG. 32 is a flowchart showing a procedure of technique 3 according to the third modification of the embodiment of the present invention. The flowchart shown in FIG. 32 is typically realized by the CPU 105 of the support apparatus 100 reading a program stored in advance in the fixed disk 107 or the like into the memory 106 and executing it.

評価処理アプリケーション20(支援装置100のCPU105(図2);以下同様)は、モデル画像の抽出対象となる参照画像の指定を受付ける(ステップS500)。続いて、評価処理アプリケーション20は、指定された参照画像から複数のモデル画像候補を抽出する(ステップS502)。このステップS502の処理内容は、上述した図19のステップS138〜S152の処理内容と同様である。   The evaluation processing application 20 (the CPU 105 of the support apparatus 100 (FIG. 2); the same applies hereinafter) receives the designation of the reference image from which the model image is to be extracted (step S500). Subsequently, the evaluation processing application 20 extracts a plurality of model image candidates from the designated reference image (step S502). The processing content of step S502 is the same as the processing content of steps S138 to S152 of FIG. 19 described above.

その後、評価処理アプリケーション20は、抽出された複数のモデル画像候補の各々に対して試行番号を割り当てる(ステップS504)。そして、評価処理アプリケーション20は、各試行番号に対応するモデル画像候補に対して、試行を実行する(ステップS506)。このステップS506の処理内容は、上述した図21のステップS170〜S196の処理内容と同様である。試行の完了後、評価処理アプリケーション20は、対象の計測画像の各々に対する類似度(相関値)をモデル画像候補の別に一時的に格納する(ステップS508)。すなわち、図31に示すようなテーブルを内部的に生成する。続いて、評価処理アプリケーション20は、ステップS508において生成したテーブルに基づいて、最適なモデル画像候補の組み合わせを決定する(ステップS510)。この組み合わせの決定は、モデル画像候補の数やマッチングNGとなった計測画像の数などのファクタを考慮して行なわれる。また、組み合わせの決定アルゴリズムとして、線形計画法などを採用することもできる。なお、ステップS510においては、複数のモデル画像候補の組み合わせが決定されてもよい。   Thereafter, the evaluation processing application 20 assigns a trial number to each of the extracted plurality of model image candidates (step S504). Then, the evaluation processing application 20 executes a trial for the model image candidate corresponding to each trial number (step S506). The processing content of step S506 is the same as the processing content of steps S170 to S196 of FIG. After completion of the trial, the evaluation processing application 20 temporarily stores the similarity (correlation value) for each target measurement image for each model image candidate (step S508). That is, a table as shown in FIG. 31 is generated internally. Subsequently, the evaluation processing application 20 determines an optimal combination of model image candidates based on the table generated in step S508 (step S510). This combination is determined in consideration of factors such as the number of model image candidates and the number of measurement images that have become matching NG. Further, linear programming or the like can be adopted as a combination determination algorithm. In step S510, a combination of a plurality of model image candidates may be determined.

その後、評価処理アプリケーション20は、ステップS510において決定したモデル画像候補の組み合わせとともに、それぞれのモデル画像候補について算出された類似度、評価結果、およびそれらの統計量などを示す評価結果画面をモニタ102に表示する(ステップS512)。さらに、評価処理アプリケーション20は、ユーザがいずれかのモデル画像候補セットを選択したか否かを判断する(ステップS514)。   Thereafter, the evaluation processing application 20 displays, on the monitor 102, an evaluation result screen showing the similarity calculated for each model image candidate, the evaluation result, and their statistics, together with the combination of the model image candidates determined in step S510. It is displayed (step S512). Furthermore, the evaluation processing application 20 determines whether or not the user has selected any model image candidate set (step S514).

ユーザがいずれかのモデル画像候補セットを選択した場合(ステップS514においてYESの場合)には、評価処理アプリケーション20は、選択されたモデル画像候補セットを接続先の画像処理装置200の画像処理アプリケーション30Aへ転送する(ステップS516)。画像処理アプリケーション30は、受信したモデル画像候補を、フレキシブルサーチ用のモデル画像セットとして登録する。   If the user selects any model image candidate set (YES in step S514), the evaluation processing application 20 uses the selected model image candidate set as the image processing application 30A of the connection destination image processing apparatus 200. (Step S516). The image processing application 30 registers the received model image candidate as a model image set for flexible search.

本変形例に従う手法3によれば、モデル画像候補の各々についての類似度(相関値)に基づいて組み合わせを決定できるので、より最適モデル画像候補セットをより効率的に決定することができる。   According to the method 3 according to the present modification, the combination can be determined based on the similarity (correlation value) for each of the model image candidates, so that the optimal model image candidate set can be determined more efficiently.

<変形例4>
上述の実施の形態においては、同一の参照画像から複数のモデル画像候補が抽出され得る構成について例示した。一方、対象の処理項目によっては、同一のモデル画像について、異なる画像処理パラメータを対応付けたものをそれぞれモデル画像候補とすることが好ましい場合がある。以下、このような例について例示する。
<Modification 4>
In the above-described embodiment, the configuration in which a plurality of model image candidates can be extracted from the same reference image has been illustrated. On the other hand, depending on the target processing item, it may be preferable to use different image processing parameters associated with the same model image as model image candidates. Hereinafter, such an example will be illustrated.

上述のようなモデル画像との類似度(相関値)に基づくサーチ処理を行なう場合には、モデル画像に対応付けられるパラメータを最適化する必要性が低いため、複数のモデル画像候補を予め用意しておき、これらのうち最適なものを決定すれば十分である。しかしながら、処理項目によっては、モデル画像に対して設定するパラメータとの間に密接な関係が存在するものである。   When performing the search process based on the similarity (correlation value) with the model image as described above, since it is less necessary to optimize the parameters associated with the model image, a plurality of model image candidates are prepared in advance. It is sufficient to determine the most suitable of these. However, depending on the processing item, there is a close relationship with the parameters set for the model image.

たとえば、エッジコードモデルサーチと称される、エッジコードに基づくサーチ処理においては、そのモデル登録時に、エッジマスクレベルやエッジレベルを最適化する必要がある。言い換えれば、登録するモデルごとに対応するパラメータを調整する必要がある。さらに、モデル登録されているエッジが多いとマッチングさせる量が増大するので、計測時間に大きく影響するため、タクトタイムなどを考慮してパラメータを調整する必要がある。   For example, in an edge code-based search process called edge code model search, it is necessary to optimize the edge mask level and edge level when registering the model. In other words, it is necessary to adjust the corresponding parameter for each model to be registered. Furthermore, if there are many edges registered in the model, the amount of matching increases, which greatly affects the measurement time. Therefore, it is necessary to adjust the parameters in consideration of the tact time and the like.

このような処理項目においては、パラメータに起因する外乱が大きいため、複数のモデル画像候補のみを変動させて評価したとしても、エッジマスクレベルやエッジレベルなどのパラメータも連動させて変動させなければ、ユーザが求める条件に合う設定を取得することができない場合がある。   In such a processing item, since the disturbance caused by the parameters is large, even if only a plurality of model image candidates are changed and evaluated, parameters such as the edge mask level and the edge level are not changed in conjunction with each other. There are cases where it is not possible to acquire settings that meet the conditions required by the user.

そこで、このような場合には、複数のモデル画像候補と複数のパラメータとの組合わせに対して、試行を行なう。   Therefore, in such a case, a trial is performed for a combination of a plurality of model image candidates and a plurality of parameters.

図33は、この発明の実施の変形例4に従う試行作成処理の一例を示す図である。
図33(a)に示すように、最適化を行なうための変動要因としては、複数のモデル画像候補と、複数のパラメータ候補とが存在することになる。そこで、図33(b)に示すように、モデル画像候補とパラメータ候補との組合わせを、順次、試行1−1,1−2,1−3,1−4,2−1,2−2,2−3,2−4,・・・といった具合に設定し、これらの設定した試行をそれぞれ実行することで、モデル画像と対応するパラメータとの最適な組合わせを抽出することができる。
FIG. 33 shows an example of trial creation processing according to the fourth modification of the present invention.
As shown in FIG. 33 (a), there are a plurality of model image candidates and a plurality of parameter candidates as variation factors for performing optimization. Therefore, as shown in FIG. 33B, combinations of model image candidates and parameter candidates are sequentially performed as trials 1-1, 1-2, 1-3, 1-4, 2-1, 2-2. , 2-3, 2-4,..., And by executing each of the set trials, an optimal combination of the model image and the corresponding parameter can be extracted.

本変形例によれば、モデル画像とともに、対応するパラメータも最適化できるので、より複雑な処理項目であっても、短時間に適切な設定を行なうことができる。   According to this modification, the corresponding parameters can be optimized together with the model image, so that even a more complicated processing item can be set appropriately in a short time.

<変形例5>
上述の実施の形態においては、主として、撮像部8がワークなどを撮像して取得された計測画像そのものに対してマッチング処理を実行する構成について例示した。一方、対象の処理項目によっては、撮像部8において取得された計測画像に対してフィルタ(たとえば、カラーグレイフィルタ)などの前処理が適用される場合がある。この場合には、計測画像に適用される前処理に応じたモデル画像を登録しておく必要がある。以下、このような例について例示する。
<Modification 5>
In the above-described embodiment, the configuration in which the image capturing unit 8 executes the matching process on the measurement image itself obtained by capturing the workpiece or the like has been mainly illustrated. On the other hand, depending on the target processing item, preprocessing such as a filter (for example, a color gray filter) may be applied to the measurement image acquired by the imaging unit 8. In this case, it is necessary to register a model image corresponding to the preprocessing applied to the measurement image. Hereinafter, such an example will be illustrated.

図34は、この発明の実施の変形例5に従う処理項目の内容を説明するためのブロック図である。図35は、この発明の実施の変形例5に従うモデル画像の最適化を説明するための図である。   FIG. 34 is a block diagram for illustrating the contents of process items according to the fifth modification of the present invention. FIG. 35 is a diagram for explaining optimization of a model image according to the fifth modification of the embodiment of the present invention.

図34(a)を参照して、モデル画像抽出部520が所定の条件に従って参照画像からモデル画像を抽出して予め登録しておくとする。一方、撮像部によって取得された計測画像は、前処理部510においてユーザが所望するフィルタ処理を行なった上で、類似度算出部500へ出力される。類似度算出部500は、前処理部510から入力された計測画像に対して、予め登録されたモデル画像との類似度(相関値)を算出(サーチ)する。ここで、前処理部510に、モデル画像の登録時に用いられたときの設定とは異なる設定が与えられると、図35(a)に示すように、当該登録されているモデル画像は、前処理後の計測画像については適切なものとはならない場合がある。すなわち、図35(a)に示すように、モデル画像を前処理条件の変動に合わせて最適化しない場合には、両者の色濃度が異なるので、マッチング処理結果に大きなずれが生じ得る。   Referring to FIG. 34A, assume that model image extraction unit 520 extracts a model image from a reference image according to a predetermined condition and registers it in advance. On the other hand, the measurement image acquired by the imaging unit is output to the similarity calculation unit 500 after the filter processing desired by the user is performed in the preprocessing unit 510. The similarity calculation unit 500 calculates (searches) a similarity (correlation value) with a model image registered in advance for the measurement image input from the preprocessing unit 510. Here, if a setting different from the setting used when registering the model image is given to the pre-processing unit 510, the registered model image is pre-processed as shown in FIG. The later measurement image may not be appropriate. That is, as shown in FIG. 35A, when the model image is not optimized in accordance with the change in the preprocessing conditions, the color density of the two images is different, so that a large shift may occur in the matching processing result.

そこで、図34(b)に示すように、前処理部510と同様のフィルタ処理を行なう前処理部522に対して参照画像を入力するとともに、この前処理部522から出力されるフィルタ処理後の参照画像に基づいて、モデル画像を登録する。このように、モデル画像が前処理条件の変動に合わせて最適化すると、図35(b)に示すように、適切なマッチング処理が実行される。   Therefore, as shown in FIG. 34B, the reference image is input to the preprocessing unit 522 that performs the same filtering process as the preprocessing unit 510, and the filtered image output from the preprocessing unit 522 is input. A model image is registered based on the reference image. As described above, when the model image is optimized in accordance with the change in the preprocessing conditions, an appropriate matching process is executed as shown in FIG.

本変形例によれば、マッチング処理の対象となる計測画像に対する前処理に応じて、モデル画像が登録されるので、前処理の影響を受けることなく、適切なマッチング処理を実行することができる。   According to the present modification, the model image is registered in accordance with the preprocessing for the measurement image that is the target of the matching processing, so that appropriate matching processing can be executed without being affected by the preprocessing.

<変形例6>
上述の実施の形態においては、最適なモデル画像の探索処理を高速化するために、ある試行についての計測結果が所定条件を満たした場合には、その試行の計測を途中で打ち切る構成について例示したが、他の高速化手法を適用してもよい。
<Modification 6>
In the above-described embodiment, in order to speed up the process of searching for an optimal model image, when the measurement result for a certain trial satisfies a predetermined condition, the configuration for aborting the trial measurement in the middle is illustrated. However, other speed-up methods may be applied.

たとえば、上述の実施の形態においては、初期設定モデル画像との間のマッチング処理を行なうことで、対象の良品画像のすべてからモデル画像候補を抽出する処理について例示(たとえば、図5参照)したが、さらに条件を加えて、一部のみをモデル画像候補として抽出してもよい。   For example, in the above-described embodiment, the process of extracting model image candidates from all the target non-defective images by performing the matching process with the initial setting model image is exemplified (for example, see FIG. 5). Further, by adding further conditions, only a part may be extracted as model image candidates.

より具体的には、初期設定モデル画像との間の類似度(相関値)が相対的に高いものから所定数をモデル画像候補とすることができる。さらに、このモデル画像候補としては、初期設定モデル画像との間の類似度(相関値)が高い順に、所定数おきに抽出するように
してもよい。あるいは、初期設定モデル画像との間の類似度(相関値)が所定範囲内(典型的には、平均値近傍)であるものをモデル画像候補としてもよい。
More specifically, a predetermined number can be used as model image candidates from those having a relatively high similarity (correlation value) with the initially set model image. Further, the model image candidates may be extracted every predetermined number in descending order of similarity (correlation value) with the initially set model image. Alternatively, a model image candidate having a similarity (correlation value) with the initial setting model image within a predetermined range (typically in the vicinity of the average value) may be used.

さらに、モデル画像候補によって抽出される平均的な画像は、初期設定モデル画像に影響を受ける場合が多いので、初期設定モデル画像に基づいてモデル画像候補を抽出した後に、それらのうち最も平均的なモデル画像を特定し、この特定したモデル画像に基づいて再度モデル画像候補を抽出するようにしてもよい。   Furthermore, since the average image extracted by the model image candidate is often influenced by the initial setting model image, after extracting the model image candidate based on the initial setting model image, the average image among them is the most average A model image may be specified, and model image candidates may be extracted again based on the specified model image.

本変形例によれば、より高速に最適なモデル画像を決定することができる。
[その他の実施の形態]
本発明に係るプログラムは、コンピュータのオペレーティングシステム(OS)の一部として提供されるプログラムモジュールのうち、必要なモジュールを所定の配列で所定のタイミングで呼出して処理を実行させるものであってもよい。その場合、プログラム自体には上記モジュールが含まれずOSと協働して処理が実行される。このようなモジュールを含まないプログラムも、本発明にかかるプログラムに含まれ得る。
According to this modification, an optimal model image can be determined at higher speed.
[Other embodiments]
The program according to the present invention may be a program module that is provided as a part of a computer operating system (OS) and that calls necessary modules in a predetermined arrangement at a predetermined timing to execute processing. . In that case, the program itself does not include the module, and the process is executed in cooperation with the OS. A program that does not include such a module can also be included in the program according to the present invention.

また、本発明に係るプログラムは他のプログラムの一部に組込まれて提供されるものであってもよい。その場合にも、プログラム自体には上記他のプログラムに含まれるモジュールが含まれず、他のプログラムと協働して処理が実行される。このような他のプログラムに組込まれたプログラムも、本発明に係るプログラムに含まれ得る。   The program according to the present invention may be provided by being incorporated in a part of another program. Even in this case, the program itself does not include the module included in the other program, and the process is executed in cooperation with the other program. Such a program incorporated in another program can also be included in the program according to the present invention.

提供されるプログラム製品は、ハードディスクなどのプログラム格納部にインストールされて実行される。なお、プログラム製品は、プログラム自体と、プログラムが記憶された記録媒体とを含む。   The provided program product is installed in a program storage unit such as a hard disk and executed. Note that the program product includes the program itself and a recording medium in which the program is stored.

さらに、本発明に係るプログラムによって実現される機能の一部または全部を専用のハードウェアによって構成してもよい。   Furthermore, part or all of the functions realized by the program according to the present invention may be configured by dedicated hardware.

今回開示された実施の形態はすべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は、上記した説明ではなく、特許請求の範囲によって示され、特許請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。   The embodiment disclosed this time should be considered as illustrative in all points and not restrictive. The scope of the present invention is defined by the terms of the claims, rather than the description above, and is intended to include any modifications within the scope and meaning equivalent to the terms of the claims.

2 ワーク、4 光電センサ、6 搬送ライン、8 撮像部、10 計測画像取得アプリケーション、20 評価処理アプリケーション、30,30A,30B 画像処理アプリケーション、40 モデル画像候補、100 モデル画像取得支援装置(支援装置)、102,202 モニタ、103,203 キーボード、104,204 マウス、106,206 メモリ、107,207 固定ディスク、111,211 FD駆動装置、112,212 フレキシブルディスク、113,213 CD−ROM駆動装置、200 画像処理装置、201 本体部、209 カメラインターフェイス部、215 制御情報インターフェイス部、217 センサインターフェイス部、1010 入力部、1011 画像リスト、1012 期待クラスリスト、1020 モデル画像候補生成部、1021 入力インターフェイス部、1022 モデル画像抽出部、1023 通信部、1030 処理部、1031 計測画像選択部、1032 モデル画像候補選択部、1033 類似度算出部、1034 判定部、1035 判定結果リスト、1036 処理コントローラ、1040 評価部、1041 比較部、1042 評価結果リスト、1043
一致/不一致カウンタ、1044 打ち切り処理部、1045 統計処理部、1046
ヒストグラム生成部、1047 決定部、1050 出力部。
2 work, 4 photoelectric sensor, 6 transport line, 8 imaging unit, 10 measurement image acquisition application, 20 evaluation processing application, 30, 30A, 30B image processing application, 40 model image candidate, 100 model image acquisition support device (support device) , 102, 202 monitor, 103, 203 keyboard, 104, 204 mouse, 106, 206 memory, 107, 207 fixed disk, 111, 211 FD drive, 112, 212 flexible disk, 113, 213 CD-ROM drive, 200 Image processing apparatus 201 main body unit 209 camera interface unit 215 control information interface unit 217 sensor interface unit 1010 input unit 1011 image list 1012 expected class list 1020 model Image candidate generation unit, 1021 input interface unit, 1022 model image extraction unit, 1023 communication unit, 1030 processing unit, 1031 measurement image selection unit, 1032 model image candidate selection unit, 1033 similarity calculation unit, 1034 determination unit, 1035 determination result List, 1036 processing controller, 1040 evaluation unit, 1041 comparison unit, 1042 evaluation result list, 1043
Match / mismatch counter, 1044 abort processing unit, 1045 statistical processing unit, 1046
Histogram generation unit, 1047 determination unit, 1050 output unit.

Claims (6)

被写体を撮像して得られる計測画像に対して予め設定されたモデル画像およびパラメータに基づくマッチング処理を行なう画像処理装置に向けられた、モデル画像の取得を支援する装置であって、
モデルとなり得る被写体を撮像することで得られる参照画像から前記モデル画像の候補となる複数のモデル画像候補を抽出する抽出手段と、
前記複数のモデル画像候補の各々に対応する、前記パラメータの候補となる複数のパラメータ候補を設定する設定手段と、
計測画像を受付ける入力手段と、
前記計測画像に対して、前記複数のモデル画像候補および前記複数のパラメータ候補のそれぞれに基づく前記マッチング処理を行なうことで複数の試行結果を生成する処理手段と、を備え、
前記複数の試行結果をもとに前記モデル画像とそれに対応する前記パラメータとの最適な組み合わせを抽出する、モデル画像取得支援装置。
An apparatus for supporting acquisition of a model image, directed to an image processing apparatus that performs matching processing based on a preset model image and parameters for a measurement image obtained by imaging a subject,
Extraction means for extracting a plurality of model image candidates that are candidates for the model image from a reference image obtained by imaging a subject that can be a model;
Setting means for setting a plurality of parameter candidates that correspond to each of the plurality of model image candidates and that are candidates for the parameters;
An input means for receiving a measurement image;
Processing means for generating a plurality of trial results by performing the matching processing based on each of the plurality of model image candidates and the plurality of parameter candidates for the measurement image,
A model image acquisition support device that extracts an optimal combination of the model image and the corresponding parameter based on the plurality of trial results.
前記処理手段は、前記複数のモデル画像候補の各々を前記複数のパラメータ候補のそれぞれで調整して前記計測画像と前記マッチング処理を行なうことで前記複数の試行結果を生成する、請求項1に記載のモデル画像取得支援装置。2. The processing unit generates the plurality of trial results by adjusting each of the plurality of model image candidates with each of the plurality of parameter candidates and performing the matching process with the measurement image. Model image acquisition support device. 前記マッチング処理はエッジコードに基づくサーチ処理を含み、
前記パラメータはエッジに関するパラメータを含む、請求項1または2に記載のモデル画像取得支援装置。
The matching process includes a search process based on an edge code;
The parameters include parameters related to edge, the model image acquisition support apparatus according to claim 1 or 2.
前記入力手段は、前記計測画像を複数受付け、The input means receives a plurality of the measurement images,
前記複数の計測画像は、前記モデル画像とマッチングすべき良品画像、および、前記モデル画像とマッチングすべきではない不良品画像を含み、The plurality of measurement images include a non-defective image that should be matched with the model image, and a defective product image that should not be matched with the model image,
前記モデル画像取得支援装置は、前記計測画像に対して、前記複数のモデル画像候補のそれぞれに基づく前記マッチング処理を行なうことで複数の試行結果を生成する処理手段とをさらに備え、前記処理手段は、前記複数の良品画像のうち、前記モデル画像にマッチングしない良品画像の数と、前記複数の不良品画像のうち、前記モデル画像にマッチングする不良品画像の数とを含む指標が予め定められた条件に達した場合に、前記複数の試行結果の生成を打ち切る、請求項1〜3のいずれか1項に記載のモデル画像取得支援装置。The model image acquisition support apparatus further includes processing means for generating a plurality of trial results by performing the matching processing based on each of the plurality of model image candidates for the measurement image, and the processing means An index including a number of non-defective images that do not match the model image among the plurality of non-defective images and a number of defective images that match the model image among the plurality of defective images is predetermined. The model image acquisition support apparatus according to any one of claims 1 to 3, wherein generation of the plurality of trial results is terminated when a condition is reached.
被写体を撮像して得られる計測画像に対して予め設定されたモデル画像およびパラメータに基づくマッチング処理を行なう画像処理装置に向けられた、モデル画像の取得を支援する方法であって、
モデルとなり得る被写体を撮像することで得られる参照画像から前記モデル画像の候補となる複数のモデル画像候補を抽出するステップと、
前記複数のモデル画像候補の各々に対応する、前記パラメータの候補となる複数のパラメータ候補を設定するステップと、
計測画像を受付けるステップと、
前記計測画像に対して、前記複数のモデル画像候補および前記複数のパラメータ候補のそれぞれに基づく前記マッチング処理を行なうことで複数の試行結果を生成するステップと、を備え、
前記複数の試行結果をもとに前記モデル画像とそれに対応する前記パラメータとの最適な組み合わせを抽出する、モデル画像取得支援方法。
A method for supporting directed to an image processing apparatus for performing based Kuma etching process to preset the model image and the parameters for the measurement image obtained by imaging an object, the acquisition of the model image,
Extracting a plurality of model image candidates that are candidates for the model image from a reference image obtained by imaging a subject that can be a model;
Setting a plurality of parameter candidates corresponding to each of the plurality of model image candidates and serving as the parameter candidates;
Receiving a measurement image;
Generating a plurality of trial results by performing the matching process based on each of the plurality of model image candidates and the plurality of parameter candidates for the measurement image,
A model image acquisition support method for extracting an optimal combination of the model image and the corresponding parameter based on the plurality of trial results.
被写体を撮像して得られる計測画像に対して予め設定されたモデル画像およびパラメータに基づくマッチング処理を行なう画像処理装置に向けられた、モデル画像の取得を支援するプログラムであって、前記プログラムは、プロセッサに、
モデルとなり得る被写体を撮像することで得られる参照画像から前記モデル画像の候補となる複数のモデル画像候補を抽出するステップと、
前記複数のモデル画像候補の各々に対応する、前記パラメータの候補となる複数のパラメータ候補を設定するステップと、
計測画像を受付けるステップと、
前記計測画像に対して、前記複数のモデル画像候補および前記複数のパラメータ候補のそれぞれに基づく前記マッチング処理を行なうことで複数の試行結果を生成するステップと、を実行させ、
前記複数の試行結果をもとに前記モデル画像とそれに対応する前記パラメータとの最適な組み合わせを抽出する、モデル画像取得支援プログラム。
A program for supporting acquisition of a model image directed to an image processing apparatus that performs a matching process based on a model image and parameters set in advance for a measurement image obtained by imaging a subject, To the processor,
Extracting a plurality of model image candidates that are candidates for the model image from a reference image obtained by imaging a subject that can be a model;
Setting a plurality of parameter candidates corresponding to each of the plurality of model image candidates and serving as the parameter candidates;
Receiving a measurement image;
Generating a plurality of trial results by performing the matching process based on each of the plurality of model image candidates and the plurality of parameter candidates, with respect to the measurement image,
A model image acquisition support program for extracting an optimal combination of the model image and the corresponding parameter based on the plurality of trial results.
JP2012285625A 2012-12-27 2012-12-27 Model image acquisition support apparatus, model image acquisition support method, and model image acquisition support program Active JP5447641B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012285625A JP5447641B2 (en) 2012-12-27 2012-12-27 Model image acquisition support apparatus, model image acquisition support method, and model image acquisition support program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012285625A JP5447641B2 (en) 2012-12-27 2012-12-27 Model image acquisition support apparatus, model image acquisition support method, and model image acquisition support program

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2009050384A Division JP5381166B2 (en) 2009-03-04 2009-03-04 Model image acquisition support apparatus, model image acquisition support method, and model image acquisition support program

Publications (2)

Publication Number Publication Date
JP2013065354A JP2013065354A (en) 2013-04-11
JP5447641B2 true JP5447641B2 (en) 2014-03-19

Family

ID=48188722

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012285625A Active JP5447641B2 (en) 2012-12-27 2012-12-27 Model image acquisition support apparatus, model image acquisition support method, and model image acquisition support program

Country Status (1)

Country Link
JP (1) JP5447641B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6729081B2 (en) * 2016-06-30 2020-07-22 オムロン株式会社 Image processing system, image processing method, and image processing program
JP7324317B2 (en) 2020-02-04 2023-08-09 ファナック株式会社 Image processing device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002032753A (en) * 2000-07-19 2002-01-31 Matsushita Electric Ind Co Ltd Method for recognizing image
JP4023096B2 (en) * 2001-02-05 2007-12-19 オムロン株式会社 Image processing method and apparatus

Also Published As

Publication number Publication date
JP2013065354A (en) 2013-04-11

Similar Documents

Publication Publication Date Title
JP5381166B2 (en) Model image acquisition support apparatus, model image acquisition support method, and model image acquisition support program
JP5509773B2 (en) Parameter determination support apparatus and parameter determination support program
Kassir et al. Reliable automatic camera-laser calibration
JP3870872B2 (en) Inspection data creation method and substrate inspection apparatus using this method
US20220067907A1 (en) Image processing method and image processing apparatus
JP4492356B2 (en) Substrate inspection device, parameter setting method and parameter setting device
JP2015143951A (en) Object discrimination device, image sensor and object discrimination method
JP5447641B2 (en) Model image acquisition support apparatus, model image acquisition support method, and model image acquisition support program
KR20240025657A (en) Automatic generation of one or more machine vision tasks based on regions of interest (ROIs) of digital images
JP2010020581A (en) Image synthesizing system eliminating unnecessary objects
US10834281B2 (en) Document size detecting by matching between image of entire document and read size image
JP2007033126A (en) Substrate inspection device, parameter adjusting method thereof and parameter adjusting device
JP2004085503A (en) Classifying apparatus, yield control system, classifying method, substrate manufacturing method, and program
JP6979860B2 (en) Image processing system
JP7380332B2 (en) Image processing device, control method and program for the image processing device
JP6180889B2 (en) Printing inspection device
US20220261943A1 (en) Image processing device, image processing method, production system, product manufacturing method, and storage medium
US20130194613A1 (en) Processing images from multiple scanners
US20130194618A1 (en) Method of image processing from multiple scanners
Milecki et al. The application of a vision system to detect trajectory points for soldering robot programming
JP7508206B2 (en) IMAGE PROCESSING METHOD, EDGE MODEL CREATING METHOD, ROBOT SYSTEM, AND ARTICLE MANUFACTURING METHOD
US8675236B2 (en) Image processing method
JP2003204200A (en) Apparatus and method for setting teaching data, system and method for providing teaching data utilizing network
JP5757157B2 (en) Method, apparatus and program for calculating head position and axis direction for detection object
JP2021039457A (en) Image processing method, edge model creation method, robot system, and article manufacturing method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20121227

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20130913

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130924

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20131112

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20131203

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20131216

R150 Certificate of patent or registration of utility model

Ref document number: 5447641

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150