JP5759133B2 - Shape-based matching parameter adjustment device and component mounting device - Google Patents

Shape-based matching parameter adjustment device and component mounting device Download PDF

Info

Publication number
JP5759133B2
JP5759133B2 JP2010214489A JP2010214489A JP5759133B2 JP 5759133 B2 JP5759133 B2 JP 5759133B2 JP 2010214489 A JP2010214489 A JP 2010214489A JP 2010214489 A JP2010214489 A JP 2010214489A JP 5759133 B2 JP5759133 B2 JP 5759133B2
Authority
JP
Japan
Prior art keywords
parameter
edge
image
search
template
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
JP2010214489A
Other languages
Japanese (ja)
Other versions
JP2012069003A (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.)
Juki Corp
Original Assignee
Juki Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Juki Corp filed Critical Juki Corp
Priority to JP2010214489A priority Critical patent/JP5759133B2/en
Priority to CN201110288632.9A priority patent/CN102421279B/en
Publication of JP2012069003A publication Critical patent/JP2012069003A/en
Application granted granted Critical
Publication of JP5759133B2 publication Critical patent/JP5759133B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Analysis (AREA)
  • Supply And Installment Of Electrical Components (AREA)

Description

本発明は、エッジ勾配などの形状情報を比較してサーチ対象画像から対象物を探し出す形状ベースマッチングに用いるパラメータの調整装置、当該パラメータの調整方法、及び形状ベースマッチングにより搭載部品の位置決めを行う部品実装装置に関する。   The present invention relates to a shape adjusting device used for shape base matching for finding an object from a search target image by comparing shape information such as an edge gradient, a method for adjusting the parameter, and a component for positioning a mounted component by shape base matching. The present invention relates to a mounting apparatus.

予め作成したテンプレートデータを用いて、サーチ対象画像内に存在する対象物を探し出す方法として、エッジ勾配などの形状情報を比較する、形状ベースのマッチング方法がある。この形状ベースのマッチング方法では、エッジ判定用のパラメータ設定が非常に重要である。このパラメータの設定の違いにより、検出されるエッジ線の形状が微妙に変わり、マッチング処理及びこれを用いた位置検出処理における位置検出精度や処理時間、ロバスト性等の特性に影響を与える。   As a method for searching for an object existing in a search target image using template data created in advance, there is a shape-based matching method for comparing shape information such as an edge gradient. In this shape-based matching method, parameter setting for edge determination is very important. Due to the difference in the parameter settings, the shape of the detected edge line changes slightly, which affects characteristics such as position detection accuracy, processing time, and robustness in the matching processing and position detection processing using the matching processing.

ところが、これらの特性は、対象物毎に要求特性も調整レベルも異なり、このような微妙なパラメータ調整は、従来、ユーザが使用環境に合わせて調整しなければならなかった。従来装置では、エッジ検出に係わるパラメータ、例えば最小濃度値、最小エッジ強さ、フィルタサイズ等について数値入力機能を設けたり、エッジの有効/無効をウインドウで囲んで指定したりする等、ユーザが対話形式で調整できる仕組みを設けていた。
また、位置検出処理を行う際の処理性能に係る評価を行い、評価値の最も高いテンプレート候補を実際のテンプレートとして決定するなど、テンプレートデータを自動的に作成するものもある(例えば、特許文献1参照)。
However, these characteristics have different required characteristics and adjustment levels for each object, and such subtle parameter adjustment has conventionally been required to be adjusted by the user according to the usage environment. In the conventional device, the user interacts by providing numerical input functions for parameters related to edge detection, such as minimum density value, minimum edge strength, filter size, etc., and specifying whether the edge is valid / invalid by surrounding it with a window. There was a mechanism that can be adjusted in the form.
In addition, there is an apparatus that automatically creates template data, for example, by performing evaluation related to processing performance when performing position detection processing and determining a template candidate having the highest evaluation value as an actual template (for example, Patent Document 1). reference).

特許第4470503号公報Japanese Patent No. 4470503

しかしながら、上記のような微妙なパラメータ調整をユーザが行う場合、位置検出処理のアルゴリズムや挙動についてのノウハウがないと適切に設定できず、性能を最大限に引き出せないという問題がある。また、形状ベースマッチング処理を用途に合わせた所望の精度と処理速度できめ細かに調整したいとの要望もあり、従来装置にあっては、これを実現するのは困難であった。   However, when the user performs the fine parameter adjustment as described above, there is a problem in that it cannot be set properly without knowing the position detection processing algorithm and behavior, and the performance cannot be maximized. In addition, there is a demand to finely adjust the shape base matching processing with desired accuracy and processing speed according to the application, and it has been difficult to realize this with conventional devices.

また、部品実装装置において、形状ベースマッチング処理を用いた位置検出処理を行って搭載部品の位置決めを行う場合、部品ロットの切り替わりで部品の材質や色等が変わったり、製造誤差による微妙なサイズ変動等でティーチング時のテンプレートデータとの差異が生じたりすることで、微妙に位置決め精度が悪化したりタクトタイムが延びたりする等の問題が発生する場合がある。このようなエラーとならないレベルの悪化は、注意深く観察していないと検出できず、パラメータの再調整のタイミングが見極め難い。   In addition, when positioning a mounted component by performing position detection processing using shape-based matching processing in a component mounting device, the material or color of the component changes due to component lot switching, or subtle size fluctuations due to manufacturing errors. As a result, a difference from the template data during teaching may occur, which may cause problems such as a slight deterioration in positioning accuracy and an increase in tact time. Such deterioration of the level that does not cause an error cannot be detected unless carefully observed, and it is difficult to determine the timing of readjustment of parameters.

そこで、本発明は、形状ベースマッチング処理における精度や処理時間、ロバスト性等の特性に関して最適化されたテンプレートデータを作成するための形状ベースマッチングパラメータの調整装置、形状ベースマッチングパラメータの調整方法および部品実装装置を提供することを課題としている。   Therefore, the present invention provides a shape base matching parameter adjustment device, a shape base matching parameter adjustment method, and a component for creating template data optimized for characteristics such as accuracy, processing time, and robustness in shape base matching processing. It is an object to provide a mounting apparatus.

上記課題を解決するために、請求項1に係る形状ベースマッチングパラメータの調整装置は、形状ベースマッチング処理に用いるパラメータの調整を行う形状ベースマッチングパラメータの調整装置であって、形状ベースマッチング処理の要求精度および要求タクトタイムを指定する指定手段と、基準姿勢に対して任意の変動を加えた姿勢の対象物の画像を、前記パラメータの評価用画像として取得する評価用画像取得手段と、前記評価用画像取得手段で取得した前記評価用画像をもとに前記パラメータを調整するパラメータ調整手段と、を備え、前記パラメータ調整手段は、形状ベースマッチングの処理の精度が、前記指定手段でユーザが指定した要求精度を満たすように、前記パラメータを自動設定するパラメータ設定手段と、前記パラメータ設定手段で設定した前記パラメータを用いて、前記評価用画像に対して形状ベースマッチング処理を行った結果、タクトタイムが、前記指定手段でユーザが指定した要求タクトタイムを満たしていないとき、当該タクトタイムが短縮する方向に前記パラメータ設定手段で設定した前記パラメータを徐変しながら形状ベースマッチング処理の精度を評価し、当該精度が前記要求精度を保てる限界のパラメータ値に前記パラメータを更新するパラメータ更新手段と、を備え、前記対象物を撮像する撮像手段と、前記撮像手段で基準姿勢の前記対象物を撮像し、これをテンプレート画像として取得するテンプレート画像取得手段と、を備え、前記評価用画像取得手段は、前記撮像手段で基準姿勢に対して任意の変動を加えた姿勢の前記対象物を複数撮像し、これらを前記評価用画像として取得し、前記パラメータ設定手段は、前記評価用画像取得手段で取得した同一撮像条件での複数の評価用画像から、相対的なエッジの変動量が最も大きい2枚の評価用画像を抽出する抽出手段と、前記抽出手段で抽出した2枚の評価用画像のエッジの一致度が所定の判定閾値よりも低い不安定エッジを抽出する不安定エッジ抽出手段と、前記不安定エッジ抽出手段で抽出した不安定エッジに対応するエッジ部位を、形状ベースマッチング処理の対象から除外する方向に前記パラメータを徐変しながら形状ベースマッチング処理の精度を評価し、当該精度が前記要求精度を満たすパラメータ値を前記パラメータとして決定するパラメータ徐変手段と、を備えることを特徴としている。
このように、コントラストが弱いエッジ等、撮像除件によってエッジ検出結果が不安定となる部位については、形状ベースマッチング処理の対象から除外することができる。したがって、要求精度を満たす最適なパラメータ設定が可能となる。
In order to solve the above problem, a shape-based matching parameter adjusting device according to claim 1 is a shape-based matching parameter adjusting device that adjusts parameters used for shape-based matching processing, and is required for shape-based matching processing. A specifying means for specifying the accuracy and the required tact time, an evaluation image acquiring means for acquiring an image of a target object having an arbitrary variation with respect to a reference posture as an evaluation image of the parameter, and the evaluation Parameter adjustment means for adjusting the parameter based on the evaluation image acquired by the image acquisition means, wherein the parameter adjustment means specifies the accuracy of the shape-based matching process by the user using the specification means Parameter setting means for automatically setting the parameters so as to satisfy the required accuracy; and When the shape-based matching process is performed on the evaluation image using the parameter set by the data setting unit, the tact time does not satisfy the required tact time specified by the user by the specifying unit. The accuracy of the shape base matching process is evaluated while gradually changing the parameter set by the parameter setting means in a direction that shortens the tact time, and the parameter is updated to a parameter value that is the limit that the accuracy can maintain the required accuracy. Parameter updating means, and imaging means for imaging the object; and template image acquisition means for imaging the object in a reference posture by the imaging means and acquiring the image as a template image, and the evaluation The image acquisition means is the object having a posture obtained by adding an arbitrary change to the reference posture by the imaging means. A plurality of images are acquired, and these are acquired as the evaluation images, and the parameter setting means has the largest amount of relative edge variation from the plurality of evaluation images under the same imaging conditions acquired by the evaluation image acquisition means. Extraction means for extracting two large evaluation images, and unstable edge extraction means for extracting unstable edges whose edge coincidence between the two evaluation images extracted by the extraction means is lower than a predetermined determination threshold And evaluating the accuracy of the shape base matching process while gradually changing the parameter in a direction to exclude the edge portion corresponding to the unstable edge extracted by the unstable edge extraction means from the target of the shape base matching process, Parameter gradual change means for determining, as the parameter, a parameter value whose accuracy satisfies the required accuracy.
As described above, a part where the edge detection result becomes unstable due to the imaging exclusion, such as an edge with low contrast, can be excluded from the target of the shape-based matching process. Therefore, it is possible to set an optimum parameter that satisfies the required accuracy.

さらに、請求項に係る形状ベースマッチングパラメータの調整装置は、請求項に係る発明において、前記パラメータは、前記テンプレート画像から前記対象物のエッジ点の座標とエッジ勾配ベクトルとで構成されるテンプレートデータを作成する際に用いるテンプレートパラメータと、前記テンプレートデータをもとにサーチ対象画像から前記対象物を検出する際に用いるサーチ用パラメータとを含み、前記パラメータ徐変手段は、前記不安定エッジ抽出手段で抽出した不安定エッジに対応するエッジ部位を、前記テンプレートデータから除外する方向に前記テンプレートパラメータを徐変することを特徴としている。
このように、テンプレートパラメータのうち最小エッジ強さを大きくしたり、エッジスケール値を小さくしたりすることで、テンプレート画像からテンプレートデータを作成する際に、不安定エッジを抽出しないようにすることができる。これにより、不安定エッジを確実に形状ベースマチング処理の対象から除外することができる。
Furthermore, the shape-based matching parameter adjusting apparatus according to claim 2 is the template according to claim 1 , wherein the parameter is composed of coordinates of an edge point of the object and an edge gradient vector from the template image. A template parameter used when creating data, and a search parameter used when detecting the target object from a search target image based on the template data, and the parameter gradual change means includes the unstable edge extraction The template parameter is gradually changed in a direction in which an edge portion corresponding to the unstable edge extracted by the means is excluded from the template data.
In this way, by increasing the minimum edge strength or decreasing the edge scale value among the template parameters, it is possible to prevent extraction of unstable edges when creating template data from a template image. it can. Thereby, the unstable edge can be surely excluded from the object of the shape-based matching process.

また、請求項3に係る形状ベースマッチングパラメータの調整装置は、請求項1又は2に係る発明において、前記パラメータは、前記テンプレート画像から前記対象物のエッジ点の座標とエッジ勾配ベクトルとで構成されるテンプレートデータを作成する際に用いるテンプレートパラメータと、前記テンプレートデータをもとにサーチ対象画像から前記対象物を検出する際に用いるサーチ用パラメータとを含み、前記パラメータ徐変手段は、前記不安定エッジ抽出手段で抽出した不安定エッジに対応するエッジ部位を、前記サーチ対象画像から検出し難い方向に前記サーチ用パラメータを徐変することを特徴としている。
このように、サーチ用パラメータのうち最小エッジ強さを小さくしたり、エッジスケール値を大きくしたりすることで、サーチ対象画像からエッジを抽出する際に、不安定エッジを抽出しないようにすることができる。これにより、不安定エッジを確実に形状ベースマッチング処理の対象から除外することができる。
According to a third aspect of the present invention, there is provided the shape base matching parameter adjusting device according to the first or second aspect, wherein the parameter is composed of coordinates of an edge point of the object and an edge gradient vector from the template image. A template parameter used when creating the template data and a search parameter used when detecting the target object from the search target image based on the template data, and the parameter gradual change means includes the unstable parameter The search parameter is gradually changed in a direction in which an edge portion corresponding to the unstable edge extracted by the edge extraction means is difficult to detect from the search target image.
In this way, by reducing the minimum edge strength or increasing the edge scale value of the search parameters, it is possible to prevent extraction of unstable edges when extracting edges from the search target image. Can do. As a result, unstable edges can be reliably excluded from the shape-based matching process.

さらにまた、請求項に係る形状ベースマッチングパラメータの調整装置は、請求項1〜3の何れかに係る発明において、形状ベースマッチング処理の精度は、前記複数の評価用画像に対して形状ベースマッチング処理を行った結果を統計処理した繰り返し精度で評価することを特徴としている。
このように、繰り返し精度評価を行うので、ロバスト性の高い評価を行うことができる。
Furthermore, the shape base matching parameter adjusting device according to claim 4 is the invention according to any one of claims 1 to 3 , wherein the accuracy of the shape base matching process is shape base matching for the plurality of evaluation images. It is characterized in that the result of processing is evaluated with repeated accuracy obtained by statistical processing.
In this way, since the repeatability evaluation is performed, highly robust evaluation can be performed.

また、請求項に係る形状ベースマッチングパラメータの調整装置は、請求項1〜4の何れかに係る発明において、形状ベースマッチング処理は、サーチ対象画像に対してエッジ検出処理を行った結果に対して粗サーチ処理を行い、当該粗サーチ処理の結果をもとに精サーチ処理を行うものであって、前記パラメータ更新手段は、前記エッジ検出処理、前記粗サーチ処理及び前記精サーチ処理のタクトタイムがそれぞれ短縮する方向に、当該各処理で用いる前記パラメータを徐変しながら形状ベースマッチング処理の精度を評価し、当該精度が前記要求精度を保てる限界のパラメータ値に前記パラメータを更新することを特徴としている。 According to a fifth aspect of the present invention, there is provided the shape base matching parameter adjusting apparatus according to any one of the first to fourth aspects, wherein the shape base matching processing is performed on the result of performing the edge detection processing on the search target image. A coarse search process is performed, and a fine search process is performed based on a result of the coarse search process, wherein the parameter update means includes a tact time of the edge detection process, the coarse search process, and the fine search process. The accuracy of the shape-based matching process is evaluated while gradually changing the parameters used in the respective processes in the direction of shortening, and the parameters are updated to the limit parameter values that can maintain the required precision. It is said.

また、請求項6に係る部品実装装置は、吸着ノズルにより電子部品を吸着し、基板上の所定位置に当該電子部品を装着する部品実装装置であって、前記請求項1〜5の何れか1項に記載の形状ベースマッチングパラメータの調整装置と、形状ベースマッチング処理に用いるパラメータを記憶する記憶手段と、前記吸着ノズルによって吸着した電子部品の画像を撮像し、これをサーチ対象画像として取得するサーチ対象画像取得手段と、前記サーチ対象画像取得手段で取得したサーチ対象画像に対して、前記記憶手段に記憶されたパラメータを用いて形状ベースマッチング処理を行い、前記電子部品の搭載位置決めを行う位置決め手段と、部品ロットの切り替わりを検知する検知手段と、前記検知手段で部品ロットの切り替わりを検知したとき、前記記憶手段に記憶されたパラメータの調整の要否を判断する判断手段と、を備え、前記判断手段で前記パラメータの調整が必要であると判断したとき、前記形状ベースマッチングパラメータの調整装置によって前記パラメータの調整を行うことを特徴としている。
このように、生産中に部品ロットが切り替わったことを検知して、パラメータ調整の要否を判断するので、適切なタイミングでパラメータの再調整を行うことができる。したがって、常に最適なパラメータを用いた形状ベースマッチング処理(位置決め処理)が可能となり、適切な部品実装が可能となる。
A component mounting apparatus according to claim 6 is a component mounting apparatus that sucks an electronic component by a suction nozzle and mounts the electronic component at a predetermined position on a substrate. The shape base matching parameter adjusting device described in the above section, storage means for storing parameters used for shape base matching processing, and a search for capturing an image of an electronic component sucked by the suction nozzle and acquiring this as a search target image Target image acquisition means and positioning means for performing positioning based matching processing on the search target image acquired by the search target image acquisition means using the parameters stored in the storage means, and positioning the electronic component And detecting means for detecting the change of the parts lot, and when detecting the change of the parts lot by the detecting means Determining means for determining whether or not adjustment of the parameter stored in the storage means is necessary, and when the determination means determines that the adjustment of the parameter is necessary, the shape-based matching parameter adjusting device adjusts the parameter. It is characterized by adjusting parameters.
In this way, since it is detected that the part lot has been switched during production and the necessity of parameter adjustment is determined, it is possible to readjust the parameter at an appropriate timing. Therefore, shape-based matching processing (positioning processing) using always optimal parameters is possible, and appropriate component mounting is possible.

本発明によれば、形状ベースマッチング処理における精度やタクトタイム、ロバスト性等の特性に関して最適化された形状ベースマッチングパラメータを設定することができる。このとき、ユーザが指定した要求精度及び要求タクトタイムに応じて、パラメータを自動的に調整するので、ユーザに形状ベースマッチング処理のアルゴリズム等についてのノウハウがなくても、用途に合わせたきめ細やかなパラメータ調整が可能となる。   According to the present invention, it is possible to set a shape base matching parameter optimized with respect to characteristics such as accuracy, tact time, and robustness in shape base matching processing. At this time, since the parameters are automatically adjusted according to the required accuracy and required tact time specified by the user, even if the user has no know-how about the algorithm of shape-based matching processing, etc. Parameter adjustment is possible.

また、本発明における部品実装装置によれば、部品ロットの切り替わりを検知してパラメータを再調整するので、適切なタイミングでパラメータの再調整を行うことができる。したがって、部品ロットの切り替わりで部品の材質や色等が変わったり、製造誤差による微妙なサイズ変動等でティーチング時のテンプレートデータとの差異が生じたりすることに起因して、微妙に精度が悪化したりタクトタイムが延びたりするのを防止することができる。   In addition, according to the component mounting apparatus of the present invention, since the change of the component lot is detected and the parameter is readjusted, the parameter can be readjusted at an appropriate timing. Therefore, the accuracy of the parts slightly deteriorates due to changes in the material and color of the parts due to the change of part lots, and differences from the template data during teaching due to subtle variations in size due to manufacturing errors. It is possible to prevent the tact time from extending.

本発明における部品実装装置の構成を示すブロック図である。It is a block diagram which shows the structure of the component mounting apparatus in this invention. 画像処理装置12内のタスク構成を示す図である。3 is a diagram showing a task configuration in the image processing apparatus 12. FIG. 第1の実施形態の最適パラメータ取得処理手順を示すフローチャートである。It is a flowchart which shows the optimal parameter acquisition process procedure of 1st Embodiment. 最小エッジ強さ設定処理手順を示すフローチャートである。It is a flowchart which shows the minimum edge strength setting process sequence. 第2の実施形態のテンプレート作成用画像撮像処理手順を示すフローチャートである。It is a flowchart which shows the image imaging processing procedure for template creation of 2nd Embodiment. 第2の実施形態の最適パラメータ取得処理手順を示すフローチャートである。It is a flowchart which shows the optimal parameter acquisition process procedure of 2nd Embodiment. 精度パラメータ調整処理手順を示すフローチャートである。It is a flowchart which shows a precision parameter adjustment process procedure. 不安定エッジの抽出方法について説明する図である。It is a figure explaining the extraction method of an unstable edge. タクトタイムパラメータ調整処理手順を示すフローチャートである。It is a flowchart which shows a tact time parameter adjustment processing procedure. 特徴点上の平行移動ベクトル、拡大縮小ベクトル及び回転ベクトルの関係を示す図である。It is a figure which shows the relationship between the parallel movement vector on a feature point, an expansion / contraction vector, and a rotation vector.

以下、本発明の実施の形態を図面に基づいて説明する。
(第1の実施形態)
(構成)
図1は、本発明に係る形状ベースマッチングテンプレートの調整装置を部品実装装置に適用した場合のブロック図である。
図中、符号1は部品実装装置である。この部品実装装置1は、電子部品2を吸着する吸着ノズル3と、吸着ノズル3の移動によって所定の撮像位置に移動された電子部品2に光を照射する照明装置4と、上記撮像位置に配置された電子部品2を撮像する標準カメラ5a及び高解像度カメラ5bと、を備える。また、部品実装装置1は、吸着ノズル3や照明装置4の動作を制御するマシン制御装置11と、カメラ5a,5bを制御すると共に、カメラ5a,5bで撮像した画像を処理して撮像画像内に存在する対象物(電子部品2)の位置検出(サーチ処理)を行い、電子部品2の位置決めを行う画像処理装置12とを備える。本実施形態では、位置決め処理に形状ベースマッチング処理を用いる。
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
(First embodiment)
(Constitution)
FIG. 1 is a block diagram when the shape base matching template adjusting apparatus according to the present invention is applied to a component mounting apparatus.
In the figure, reference numeral 1 denotes a component mounting apparatus. The component mounting apparatus 1 includes a suction nozzle 3 that sucks an electronic component 2, a lighting device 4 that irradiates light to the electronic component 2 that has been moved to a predetermined imaging position by the movement of the suction nozzle 3, and the imaging position. A standard camera 5a and a high-resolution camera 5b that capture the captured electronic component 2. In addition, the component mounting apparatus 1 controls the machine control device 11 that controls the operation of the suction nozzle 3 and the illumination device 4 and the cameras 5a and 5b, and processes the images captured by the cameras 5a and 5b to process the captured images. And an image processing device 12 that performs position detection (search processing) of an object (electronic component 2) existing in the electronic component 2 and positions the electronic component 2. In this embodiment, a shape-based matching process is used for the positioning process.

マシン制御装置11は、通常、電子部品2の電極サイズによって撮像するカメラ5a又は5bを選択し、電子部品2を吸着ノズル3で吸着した後、選択したカメラの撮像位置に電子部品2が位置するように吸着ノズル3を移動する。さらにこのとき、マシン制御装置11は、照明装置4を選択したカメラで撮像できるよう移動し、点灯させる。そして、マシン制御装置11は、画像処理装置12に対して、選択したカメラチャネル情報と共に位置決め処理の実行を指示するコマンドを送信する。マシン制御装置11は、画像処理装置12からこのコマンド送信に対するレスポンス(位置決め処理結果)を受信すると、吸着ノズル3を所定の部品搭載位置に移動し、電子部品2を基板上に搭載する。このとき、位置決め処理結果から得られる電子部品2の吸着位置ずれ量および吸着角度ずれ量をもとに、部品搭載位置を決定するようにする。   The machine control device 11 normally selects the camera 5a or 5b to be imaged according to the electrode size of the electronic component 2, and after the electronic component 2 is sucked by the suction nozzle 3, the electronic component 2 is positioned at the imaging position of the selected camera. The suction nozzle 3 is moved as follows. Further, at this time, the machine control device 11 moves the lighting device 4 so that it can be imaged by the selected camera, and lights it. Then, the machine control device 11 transmits a command for instructing execution of the positioning process together with the selected camera channel information to the image processing device 12. When the machine control device 11 receives a response (positioning processing result) to the command transmission from the image processing device 12, the machine control device 11 moves the suction nozzle 3 to a predetermined component mounting position and mounts the electronic component 2 on the substrate. At this time, the component mounting position is determined based on the suction position deviation amount and the suction angle deviation amount of the electronic component 2 obtained from the positioning processing result.

また、マシン制御装置11は、部品ロットの切り替わりに際し、画像処理装置12に対してこれを通知する機能を有する。このとき、マシン制御装置11は、位置決め処理で使用するテンプレートデータの調整に関する各種コマンドパラメータを送信する。コマンドパラメータとしては、位置決め処理の要求精度や要求タクトタイムがある。これらのパラメータは、マシン制御装置11に接続されたマンマシンインタフェース6を介して、オペレータが指定することができる(指定手段)。
画像処理装置12は、マシン制御装置11から送信されるコマンドに従って、指定されたカメラ5a又は5bを制御して電子部品2の画像を撮像し、撮像した画像に対して各種処理を行う。
Further, the machine control device 11 has a function of notifying the image processing device 12 of this when the part lot is switched. At this time, the machine control device 11 transmits various command parameters related to adjustment of template data used in the positioning process. Command parameters include required accuracy of positioning processing and required tact time. These parameters can be designated by the operator via the man-machine interface 6 connected to the machine control device 11 (designating means).
The image processing device 12 controls the designated camera 5a or 5b in accordance with a command transmitted from the machine control device 11, takes an image of the electronic component 2, and performs various processes on the captured image.

具体的には、画像処理装置12は、マシン制御装置11から位置決め処理を実行するコマンドを受信したとき、カメラチャネル情報に基づいてカメラ5a又は5bを制御して撮像位置にある電子部品2を撮像し(サーチ対象画像取得手段)、撮像画像に対して位置決め処理を行い、その結果をマシン制御装置11に返信する(位置決め手段)。また、画像処理装置12は、マシン制御装置11から生産開始のコマンドを受信したとき、生産開始から所定時間(例えば、所定の数の電子部品2を搭載する時間)、位置決め処理毎に当該位置決め処理の精度及びタクトタイムを計測し、その繰り返し精度及びタクトタイムを後述する作業メモリ24に保持する処理を行う。さらに、画像処理装置12は、マシン制御装置11から部品ロットの切り替わりを通知するコマンドを受信したとき、位置決め処理で用いるテンプレートデータを作成するためのテンプレートパラメータ及びサーチ処理で用いるサーチ用パラメータを調整する処理(最適パラメータ取得処理)を行う。   Specifically, when the image processing apparatus 12 receives a command for executing the positioning process from the machine control apparatus 11, the image processing apparatus 12 controls the camera 5a or 5b based on the camera channel information and images the electronic component 2 at the imaging position. (Search target image acquisition means), positioning processing is performed on the captured image, and the result is returned to the machine control device 11 (positioning means). Further, when the image processing apparatus 12 receives a production start command from the machine control apparatus 11, the positioning process is performed for each positioning process for a predetermined time from the start of production (for example, a time for mounting a predetermined number of electronic components 2). The accuracy and tact time are measured, and the repetition accuracy and tact time are stored in the work memory 24 described later. Further, when the image processing apparatus 12 receives a command for notifying the switching of the parts lot from the machine control apparatus 11, the image processing apparatus 12 adjusts the template parameter for creating the template data used in the positioning process and the search parameter used in the search process. Processing (optimum parameter acquisition processing) is performed.

画像処理装置12は、A/D変換部21と、画像メモリ22と、演算部23と、作業用メモリ24と、パラメータ格納部25と、制御部26と、並列演算部27と、インタフェース28と、D/A変換部29と、を備える。
A/D変換部21は、カメラ5a,5bで撮像した画像データをA/D変換し、画像メモリ22に多値画像データとして記憶する。演算部23は、画像メモリ22に記憶された画像データをもとに、位置決め処理や最適パラメータ取得処理を行う。作業用メモリ24は、演算部23による処理中に生成される処理データを記憶する。パラメータ格納部25は、テンプレートパラメータ、テンプレートデータ及びサーチ用パラメータを格納する。制御部26は、カメラ5a,5bを制御する。並列演算部27は、フィルタ演算などの処理速度が要求される処理を演算部23での処理と並行して行う。インタフェース28は、マシン制御装置11との間で信号の送受信を行う。D/A変換部29は、画像メモリ22に記憶した画像データをD/A変換し、カメラ5a,5bで撮像した画像をモニタ7に表示する。
The image processing apparatus 12 includes an A / D conversion unit 21, an image memory 22, a calculation unit 23, a work memory 24, a parameter storage unit 25, a control unit 26, a parallel calculation unit 27, an interface 28, And a D / A conversion unit 29.
The A / D conversion unit 21 performs A / D conversion on the image data captured by the cameras 5 a and 5 b and stores the image data in the image memory 22 as multi-value image data. The calculation unit 23 performs positioning processing and optimum parameter acquisition processing based on the image data stored in the image memory 22. The work memory 24 stores processing data generated during processing by the calculation unit 23. The parameter storage unit 25 stores template parameters, template data, and search parameters. The control unit 26 controls the cameras 5a and 5b. The parallel computing unit 27 performs processing requiring a processing speed such as filter computation in parallel with the processing in the computing unit 23. The interface 28 transmits and receives signals to and from the machine control device 11. The D / A conversion unit 29 performs D / A conversion on the image data stored in the image memory 22 and displays the images captured by the cameras 5 a and 5 b on the monitor 7.

図2は、画像処理装置12内のタスク構成を示す図である。
この図2に示すように、画像処理装置12は、コマンド解析タスク12a、画像入力タスク12b、認識実行タスク12cおよびテンプレート調整タスク12dで構成される。
コマンド解析タスク12aは、マシン制御装置11からのコマンドの受信、及びマシン制御装置11への位置決め処理結果等のレスポンスの送信を行う。また、並列処理が不要なコマンドの実行はコマンド解析タスク12aで行なわれる。
FIG. 2 is a diagram showing a task configuration in the image processing apparatus 12.
As shown in FIG. 2, the image processing apparatus 12 includes a command analysis task 12a, an image input task 12b, a recognition execution task 12c, and a template adjustment task 12d.
The command analysis task 12 a receives a command from the machine control device 11 and transmits a response such as a positioning processing result to the machine control device 11. The command analysis task 12a executes a command that does not require parallel processing.

マシン制御装置11から、部品位置決め処理などの高速なタクトタイムが要求される処理の実行コマンドを受信した場合には、コマンド解析タスク12aは画像入力タスク12b、認識実行タスク12cにそれぞれ実行要求を出す。これにより、認識実行タスク12cで位置決め処理を行っている間に、画像入力タスク12bで次の部品画像を撮像することができ、画像入力と並列で位置決め処理を行うことができる。
さらに、コマンド解析タスク12aは、マシン制御装置11から部品ロットの切り替え通知を受けたとき、テンプレート調整タスク12dに実行要求を出し、バックグラウンド処理にて最適パラメータ取得処理を行う。
When an execution command for processing that requires a high tact time such as component positioning processing is received from the machine control device 11, the command analysis task 12a issues an execution request to the image input task 12b and the recognition execution task 12c, respectively. . Thus, while the positioning process is performed by the recognition execution task 12c, the next component image can be taken by the image input task 12b, and the positioning process can be performed in parallel with the image input.
Further, when the command analysis task 12a receives a part lot switching notification from the machine control device 11, it issues an execution request to the template adjustment task 12d and performs an optimum parameter acquisition process in the background process.

次に、画像処理装置12で実行する最適パラメータ取得処理の全体フローについて説明する。
画像処理装置12は、マシン制御装置11から部品ロットの切り替わりを通知するコマンドを受けた場合、コマンド解析タスク12aがテンプレート調整タスク12dを起床し(検知手段)、位置決め処理の精度及びタクトタイムを計測し、作業用メモリ24に保持している値と比較する。ここでは、位置決め処理の精度及びタクトタイムを評価するために電子部品2を撮像したサーチ評価画像を取得し、サーチ評価画像に対して、その時点でパラメータ格納部25に格納されているテンプレートデータ及びサーチ用パラメータを用いて位置決め処理を行うことで、精度及びタクトタイムを計測する。
Next, the overall flow of the optimum parameter acquisition process executed by the image processing device 12 will be described.
When the image processing apparatus 12 receives a command to notify the part lot change from the machine control apparatus 11, the command analysis task 12a wakes up the template adjustment task 12d (detection means), and measures the accuracy and tact time of the positioning process. Then, the value is compared with the value held in the work memory 24. Here, a search evaluation image obtained by imaging the electronic component 2 in order to evaluate the accuracy and tact time of the positioning process is acquired, and the template data stored in the parameter storage unit 25 at that point in time for the search evaluation image and Accuracy and tact time are measured by performing positioning processing using search parameters.

そして、計測した位置決め処理の精度又はタクトタイムが、作業用メモリ24に保持している値に対してある許容範囲を越えて悪化していた場合、テンプレートデータの調整(最適パラメータ取得処理)が必要であると判断し、コマンド解析タスク12aは作業用メモリ24に設けた処理フラグをONにする(判断手段)。このとき、テンプレート調整タスク12dは、一旦、休止状態となる。
画像入力タスク12bは、上記処理フラグがONとなっていることを検知すると、生産用の撮像処理に割り込み、テンプレートデータ調整用の画像(テンプレート画像)を撮像し、画像メモリ22に蓄積する。
If the measured positioning processing accuracy or tact time has deteriorated beyond a certain allowable range with respect to the value held in the work memory 24, template data adjustment (optimum parameter acquisition processing) is required. Therefore, the command analysis task 12a turns on the processing flag provided in the work memory 24 (determination means). At this time, the template adjustment task 12d temporarily enters a dormant state.
When the image input task 12b detects that the processing flag is ON, the image input task 12b interrupts the production imaging process, captures an image for template data adjustment (template image), and stores it in the image memory 22.

画像入力タスク12bによりテンプレートデータ調整用の画像が撮像されると、コマンド解析タスク12aは、再びテンプレート調整タスク12dを起床し、最適パラメータ取得処理を開始する。このとき、テンプレート調整タスク12dの優先度は、精度及びタクトタイムの悪化度合いに応じて決定するものとし、緊急度(悪化度合い)が低い場合は、空き時間で処理する等、できるだけ生産効率を落とさないようにする。一方、緊急度(悪化度合い)が高い場合は、即テンプレートの再調整を行う等、生産安定性を落とさないようにする。
最適パラメータ取得処理が終了すると、コマンド解析タスク12aは、位置決め処理の精度及びタクトタイムを再計測し、作業用メモリ24に保持していた値を更新すると共に処理フラグをOFFにする。このとき、テンプレート調整タスク12dは休止状態となる。
When an image for template data adjustment is taken by the image input task 12b, the command analysis task 12a wakes up the template adjustment task 12d again and starts the optimum parameter acquisition process. At this time, the priority of the template adjustment task 12d is determined according to the accuracy and the degree of deterioration of the tact time, and when the urgency (deterioration degree) is low, the production efficiency is reduced as much as possible, such as processing in idle time. Do not. On the other hand, when the degree of urgency (the degree of deterioration) is high, the production stability is not reduced, for example, the template is immediately readjusted.
When the optimum parameter acquisition process is completed, the command analysis task 12a re-measures the accuracy and tact time of the positioning process, updates the values held in the work memory 24, and turns off the process flag. At this time, the template adjustment task 12d is in a dormant state.

以下、画像処理装置12で実行する最適パラメータ取得処理について、詳細に説明する。
図3は、最適パラメータ取得処理手順を示すフローチャートである。
この最適パラメータ取得処理は、画像入力タスク12bが、上記処理フラグがONとなっていることを検知したときに実行開始される。本実施形態では、1枚のテンプレート画像から最適パラメータの取得(テンプレートデータの調整)を行うものとする。
Hereinafter, the optimum parameter acquisition process executed by the image processing apparatus 12 will be described in detail.
FIG. 3 is a flowchart showing an optimal parameter acquisition processing procedure.
The optimum parameter acquisition process is started when the image input task 12b detects that the process flag is ON. In the present embodiment, it is assumed that optimum parameters are acquired (template data adjustment) from one template image.

先ずステップS1で、画像処理装置12は、マシン制御装置11から指定されたカメラ5a又は5bを制御し、基準姿勢の対象物(電子部品)2の画像を撮像する。撮像した画像はA/D変換部21でデジタル化し、画像メモリ22にテンプレート画像データとして記憶する。   First, in step S1, the image processing device 12 controls the camera 5a or 5b designated by the machine control device 11, and takes an image of the target object (electronic component) 2 in the reference posture. The captured image is digitized by the A / D converter 21 and stored as template image data in the image memory 22.

次にステップS2では、画像処理装置12は、テンプレートパラメータの初期設定を行い、これをパラメータ格納部25に格納してステップS3に移行する。本実施形態では、テンプレートパラメータとして、最小濃度値(対象物とみなす濃度値の最小値)、最小エッジ強さ(エッジとみなす最小のエッジ強さ)、エッジスケール(エッジ勾配の幅=フィルタサイズ)、最大エッジ点数(テンプレートデータとして登録するエッジの数)を用いる。ここでは、各パラメータの初期値を、例えば、最小濃度値=80、最小エッジ強さ=32、エッジスケール=2、エッジ点数=1024に設定する。
ステップS3では、画像処理装置12は、画像メモリ22に記憶しているテンプレート画像データについて、公知の判別分析法を用いて背景領域と対象物領域を分離する閾値を求め、これを最小濃度値として取得する。
In step S2, the image processing apparatus 12 performs initial setting of template parameters, stores them in the parameter storage unit 25, and proceeds to step S3. In this embodiment, as template parameters, the minimum density value (minimum value of density value regarded as an object), minimum edge strength (minimum edge strength regarded as edge), edge scale (edge gradient width = filter size). The maximum number of edge points (the number of edges registered as template data) is used. Here, the initial value of each parameter is set to, for example, minimum density value = 80, minimum edge strength = 32, edge scale = 2, and number of edge points = 1024.
In step S3, the image processing apparatus 12 obtains a threshold value for separating the background area and the object area from the template image data stored in the image memory 22 using a known discriminant analysis method, and uses this as the minimum density value. get.

次に、ステップS4では、画像処理装置12は、前記ステップS3で取得した最小濃度値を用いて、テンプレート画像データを二値化する。さらに、エッジ検出フィルタサイズに合わせて膨張処理を行い、エッジ勾配区間が対象物領域側になるよう最小濃度値を調整する。そして、調整後の最小濃度値でパラメータ格納部25に格納した初期値を更新する。
次に、ステップS5では、画像処理装置12は、画像メモリ22に記憶しているテンプレート画像データについて、フィルタ処理を行い、ステップS6に移行する。ここでは、精度的に最も良好な結果を得るために、予め設定したエッジスケール候補値の中で最大のエッジスケール値(2.5)を用いてフィルタ処理を行う。
Next, in step S4, the image processing apparatus 12 binarizes the template image data using the minimum density value acquired in step S3. Further, dilation processing is performed according to the edge detection filter size, and the minimum density value is adjusted so that the edge gradient section is on the object area side. Then, the initial value stored in the parameter storage unit 25 is updated with the adjusted minimum density value.
Next, in step S5, the image processing apparatus 12 performs a filtering process on the template image data stored in the image memory 22, and proceeds to step S6. Here, in order to obtain the most accurate result, the filtering process is performed using the maximum edge scale value (2.5) among the preset edge scale candidate values.

ステップS6では、画像処理装置12は、前記ステップS4で求めた二値化データを用いて、前記ステップS5で求めたフィルタ出力値について、背景領域、対象物領域別にそれぞれ統計処理を行い、各領域の濃度分布の平均値、分散値、最小値、最大値を求める。そして、これらの値を用いて、図4に示す処理を行い、最小エッジ強さMinPwrを取得する。
図4に示すように、先ずステップS6aで、背景最大エッジ強さaを最小エッジ強さMinPwrとして設定し、ステップS6bに移行して背景最大エッジ強さaが対象物最小エッジ強さbより小さいか否かを判定する。そして、a<bである場合にはステップS6cに移行し、背景最大エッジ強さaと対象物最小エッジ強さbとの平均値(a+b)/2を、最終的な最小エッジ強さMinPwrとして設定して処理を終了する。
In step S6, the image processing apparatus 12 uses the binarized data obtained in step S4 to perform statistical processing on the filter output value obtained in step S5 for each of the background area and the object area. The average value, variance value, minimum value, and maximum value of the concentration distribution are obtained. Then, using these values, the process shown in FIG. 4 is performed to obtain the minimum edge strength MinPwr.
As shown in FIG. 4, first, in step S6a, the maximum background edge strength a is set as the minimum edge strength MinPwr, and the process proceeds to step S6b where the maximum background edge strength a is smaller than the minimum object edge strength b. It is determined whether or not. If a <b, the process proceeds to step S6c, where the average value (a + b) / 2 of the maximum background edge strength a and the minimum object edge strength b is defined as the final minimum edge strength MinPwr. Set and finish the process.

また、ステップS6bでa≧bであると判断した場合には、ステップS6dに移行し、背景最大エッジ強さaが対象物平均エッジ強さcより小さいか否かを判定する。そして、a<cである場合にはステップS6eに移行し、a≧cである場合には、最小エッジ強さMinPwrをステップS6aで設定した背景最大エッジ強さaのままとするものとして、そのまま処理を終了する。   If it is determined in step S6b that a ≧ b, the process proceeds to step S6d to determine whether the background maximum edge strength a is smaller than the average object edge strength c. If a <c, the process proceeds to step S6e. If a ≧ c, the minimum edge strength MinPwr remains as the background maximum edge strength a set in step S6a. The process ends.

ステップS6eでは、次式をもとに対象物最小エッジ強さbを算出してステップS6fに移行する。
b=c−d・k ………(1)
ここで、dは対象物分散値、kは補正係数である。
そして、ステップS6fでは、背景最大エッジ強さaが対象物最小エッジ強さbより小さいか否かを判定する。そして、a<bである場合にはステップS6gに移行し、背景最大エッジ強さaと対象物最小エッジ強さbとの平均値(a+b)/2を、最終的な最小エッジ強さMinPwrとして設定して処理を終了する。
In step S6e, the minimum object edge strength b is calculated based on the following equation, and the process proceeds to step S6f.
b = cd−k (1)
Here, d is an object dispersion value, and k is a correction coefficient.
In step S6f, it is determined whether the maximum background edge strength a is smaller than the minimum object edge strength b. If a <b, the process proceeds to step S6g, where the average value (a + b) / 2 of the maximum background edge strength a and the minimum object edge strength b is defined as the final minimum edge strength MinPwr. Set and finish the process.

一方、ステップS6fでa≧bであると判断した場合には、最小エッジ強さMinPwrをステップS6aで設定した背景最大エッジ強さaのままとするものとして、そのまま処理を終了する。
すなわち、ここでは、背景最大エッジ強さaと対象物最小エッジ強さbとの間に閾値(最小エッジ強さMinPwr)を設ければ、最適なエッジ検出ができるという考えに基づいて、最小エッジ強さ取得処理を行っている。このように、本実施形態では、テンプレート画像のエッジ領域を抽出し、コントラスト、エッジ強さ、エッジスケール等のエッジ特性値の分布に基づいて、最適なエッジ検出パラメータ(最小エッジ強さ)を設定する。
図3に戻って、ステップS7では、画像処理装置12は、前記ステップS6で設定した最小エッジ強さMinPwrを用いて、前記ステップS5で求めたフィルタ出力値について閾値処理を行い、エッジ点を検出する。
On the other hand, if it is determined in step S6f that a ≧ b, the minimum edge strength MinPwr is left as the background maximum edge strength a set in step S6a, and the processing is ended as it is.
That is, here, based on the idea that if a threshold (minimum edge strength MinPwr) is provided between the background maximum edge strength a and the object minimum edge strength b, the minimum edge can be detected. Strength acquisition processing is performed. As described above, in this embodiment, the edge region of the template image is extracted, and the optimum edge detection parameter (minimum edge strength) is set based on the distribution of edge characteristic values such as contrast, edge strength, and edge scale. To do.
Returning to FIG. 3, in step S7, the image processing apparatus 12 performs threshold processing on the filter output value obtained in step S5 using the minimum edge strength MinPwr set in step S6, and detects an edge point. To do.

次に、ステップS8では、画像処理装置12は、エッジスケール値の調整が終了したか否かを判定する。ここでは、前記ステップS7で検出したエッジ点について、予め設定したすべてのエッジスケール候補値を用いてそれぞれフィルタ演算を行い、各フィルタ演算結果について評価(エッジ評価)を行ったか否かを判定する。エッジスケール候補値は、例えば、1、2、2.5とする。そして、すべてのエッジ評価が終了していないと判断した場合にはステップS9に移行し、すべてのエッジ評価が終了していると判断した場合には、後述するステップS12に移行する。   Next, in step S8, the image processing apparatus 12 determines whether or not the adjustment of the edge scale value has been completed. Here, with respect to the edge point detected in step S7, a filter calculation is performed using all preset edge scale candidate values, and it is determined whether or not each filter calculation result has been evaluated (edge evaluation). For example, the edge scale candidate values are 1, 2, and 2.5. If it is determined that all edge evaluations have not been completed, the process proceeds to step S9. If it is determined that all edge evaluations have been completed, the process proceeds to step S12 described later.

ステップS9では、画像処理装置12は、エッジスケール値を、フィルタ演算を行っていない1段階小さい値に切り替え、ステップS10に移行する。なお、初回時には、エッジスケール値を最大値(2.5)とし、これをエッジスケール基準値とする。
ステップS10では、画像処理装置12は、前記ステップS7検出したエッジ点について、前記ステップS9で設定したエッジスケール値でフィルタ演算を行う。
In step S9, the image processing apparatus 12 switches the edge scale value to a value that is smaller by one step without performing the filter operation, and proceeds to step S10. At the first time, the edge scale value is set to the maximum value (2.5), which is set as the edge scale reference value.
In step S10, the image processing apparatus 12 performs a filter operation on the edge point detected in step S7 using the edge scale value set in step S9.

次に、ステップS11では、画像処理装置12は、前記ステップS10で行ったフィルタ演算結果(フィルタ出力値)についてエッジ評価を行い、前記ステップS8に移行する。具体的には、各エッジ点において、前記ステップS10でのフィルタ出力値と、エッジスケール基準値でのフィルタ出力値とを比較し、フィルタ出力値が大きい(フィルタの反応が強い)方のエッジスケール値を、そのエッジ点の最適なエッジスケール値として選択する。そして、最も多くのエッジ点で選ばれた最適なエッジスケール値を、テンプレートパラメータとして最適なエッジスケール値とし、これをエッジスケール基準値とすると共に、パラメータ格納部25に格納されたエッジスケール値をこの値に更新する。なお、フィルタサイズ(エッジスケール)が大きくなればフィルタ出力値も大きくなるので、異なるフィルタサイズでも大小関係が比較できるよう、それぞれのフィルタサイズの出力値を正規化してエッジ評価を行うものとする。   Next, in step S11, the image processing apparatus 12 performs edge evaluation on the filter calculation result (filter output value) performed in step S10, and proceeds to step S8. Specifically, at each edge point, the filter output value in step S10 is compared with the filter output value at the edge scale reference value, and the edge scale having the larger filter output value (strong filter response) The value is selected as the optimal edge scale value for that edge point. Then, the optimum edge scale value selected at the most edge points is set as the optimum edge scale value as a template parameter, which is used as the edge scale reference value, and the edge scale value stored in the parameter storage unit 25 is Update to this value. Since the filter output value increases as the filter size (edge scale) increases, the edge evaluation is performed by normalizing the output values of the respective filter sizes so that the magnitude relationship can be compared even with different filter sizes.

以上の処理により、位置決め処理の精度に関する最適なテンプレートパラメータ値の取得が完了する。すなわち、この時点では、テンプレートパラメータのうちエッジ検出精度に関するパラメータ(最小濃度値、最小エッジ強さ、エッジスケール値)が、予め設定したパラメータ候補値の範囲内で最も良好なエッジ検出精度が得られる値となっており、オペレータが指定した要求精度を満たした状態となっている。   With the above processing, the acquisition of the optimum template parameter value regarding the accuracy of the positioning processing is completed. In other words, at this time, among the template parameters, the edge detection accuracy parameters (minimum density value, minimum edge strength, edge scale value) provide the best edge detection accuracy within the preset parameter candidate value range. It is in a state that satisfies the required accuracy specified by the operator.

したがって、以下の処理では、タクトタイムに関する最適なテンプレートパラメータ値の取得を行う。ここでは、タクトタイムが短縮される方向にテンプレートパラメータ(最大エッジ点数)を変更していき、その都度サーチ処理を行って精度及びタクトタイムを評価する。そして、要求精度を保持できる限界タクトタイムでのパラメータ値を最適なパラメータ値として取得する手法を用いる。   Therefore, in the following process, an optimal template parameter value related to the tact time is acquired. Here, the template parameter (maximum number of edge points) is changed in the direction in which the tact time is shortened, and the search process is performed each time to evaluate the accuracy and the tact time. And the method of acquiring the parameter value in the limit tact time which can hold | maintain required precision as an optimal parameter value is used.

ステップS12では、画像処理装置12は、この時点でパラメータ格納部25に格納されているテンプレートパラメータ値を用いてテンプレートデータを作成し、ステップS13に移行する。ここでは、テンプレートパラメータ値を用いてテンプレート画像のエッジを検出し、エッジ点の座標とエッジ勾配ベクトルとで構成されるリストを作成し、これをテンプレートデータとする。このとき、最大エッジ点数を越えないよう間引き処理を行って、テンプレートデータに登録するエッジ点が決定される。作成したテンプレートデータは、パラメータ格納部25に格納する。   In step S12, the image processing apparatus 12 creates template data using the template parameter value stored in the parameter storage unit 25 at this time, and proceeds to step S13. Here, the template parameter value is used to detect the edge of the template image, a list composed of the coordinates of the edge point and the edge gradient vector is created, and this is used as template data. At this time, thinning processing is performed so as not to exceed the maximum number of edge points, and edge points to be registered in the template data are determined. The created template data is stored in the parameter storage unit 25.

ステップS13では、画像処理装置12は、サーチ評価用の画像を生成し、画像メモリ22に記憶する。ここでは、画像メモリ22に記憶されたテンプレート画像データに対して、任意の変動(平行移動、回転、拡大・縮小)を加えた画像データを生成し、これをサーチ評価画像とする。なお、ここで与えた変動量は、位置決め処理結果の真値として、位置決め処理の絶対精度評価値として使用する。   In step S <b> 13, the image processing apparatus 12 generates an image for search evaluation and stores it in the image memory 22. Here, image data obtained by adding arbitrary fluctuations (parallel movement, rotation, enlargement / reduction) to the template image data stored in the image memory 22 is generated and used as a search evaluation image. The fluctuation amount given here is used as an absolute accuracy evaluation value of the positioning process as a true value of the positioning process result.

次に、ステップS14では、画像処理装置12は、前記ステップS12で作成したテンプレートデータを用いて、前記ステップS13で生成したサーチ評価画像についてサーチ処理を行う。
ここで、サーチ処理手順について簡単に説明する。
本実施形態におけるサーチ処理は、ピラミッド構造サーチを使用したパターンマッチング処理であり、パラメータ格納部25に格納したサーチ用パラメータをもとに、撮像画像内に存在する対象物の位置を検出する。サーチ用パラメータとしては、最小濃度値、最小エッジ強さ、エッジスケール値、ピラミッド開始層を用いる。
Next, in step S14, the image processing apparatus 12 performs a search process on the search evaluation image generated in step S13, using the template data created in step S12.
Here, the search processing procedure will be briefly described.
The search process in the present embodiment is a pattern matching process using a pyramid structure search, and detects the position of an object existing in the captured image based on the search parameters stored in the parameter storage unit 25. As the search parameters, the minimum density value, the minimum edge strength, the edge scale value, and the pyramid start layer are used.

ピラミッド構造サーチでは、先ずサーチ対象画像から上記サーチ用パラメータを用いてエッジを検出し、その画像をピラミッド開始層に応じた圧縮率で圧縮する。次に圧縮画像に対して粗処理(粗サーチ)を行い、対象物の存在する大まかな座標位置を検出する。その後、検出された座標の近辺においてテンプレートデータを用いて詳細処理(精サーチ)を行い、さらに正確な位置を検出する。この精サーチを、階層が進む毎に徐々に精度を上げて行う。このように、粗いサーチを行って大体の位置を特定した後、この結果に基づいて特定された範囲に詳細なサーチを行うことにより、画像全体にわたって詳細なサーチを行うことなく必要な部分のみを順次精査していくことができ、総処理タクトタイムを短縮できる。   In the pyramid structure search, first, an edge is detected from the search target image using the search parameters, and the image is compressed at a compression rate corresponding to the pyramid start layer. Next, rough processing (coarse search) is performed on the compressed image to detect a rough coordinate position where the object exists. Thereafter, detailed processing (fine search) is performed using the template data in the vicinity of the detected coordinates to detect a more accurate position. This fine search is performed with gradually increasing accuracy each time the hierarchy advances. In this way, after performing a rough search and specifying an approximate position, a detailed search is performed on the specified range based on this result, so that only the necessary portion is searched without performing a detailed search over the entire image. Sequential inspection can be performed, and the total processing tact time can be shortened.

すなわち、このステップS14では、前記ステップS13で生成したサーチ評価画像を上記サーチ対象画像としてサーチ処理を行う。ここでのサーチ処理で用いるサーチ用パラメータは、この時点で取得されているテンプレートデータをもとに、以下のルールで設定する。
(1)テンプレート用パラメータ値がデフォルト値の場合、デフォルト値とする。
(2)デフォルト値でない場合、テンプレート用パラメータより緩め(例えば、表1に示す各パラメータの候補値をもとに1段階下)に設定する。
(3)ピラミッド開始層は対象物の外形サイズに合わせて設定する。
That is, in step S14, search processing is performed using the search evaluation image generated in step S13 as the search target image. The search parameters used in the search process here are set according to the following rules based on the template data acquired at this time.
(1) If the template parameter value is the default value, the default value is used.
(2) If it is not the default value, it is set to be looser than the template parameter (for example, one level lower based on the candidate values of each parameter shown in Table 1).
(3) The pyramid start layer is set according to the external size of the object.

Figure 0005759133
Figure 0005759133

ステップS15では、画像処理装置12は、前記ステップS14のサーチ処理結果から、タクトタイム及び精度(位置決め処理結果と真値(前記ステップS13で与えた変動量)とのずれ量)を求め、これらを基準値として作業メモリ24に保持する。
次にステップS16では、タクトタイム調整処理を終了するか否かの判定を行う。ここでは、作業メモリ24に保持しているタクトタイムが要求タクトタイムに達している場合や、タクトタイムが前回値より短縮されていない場合、調整回数が予め設定した所定回数を越えた場合に、タクトタイム調整処理を終了すると判断する。そして、タクトタイム調整処理を継続すると判断した場合にはステップS17に移行し、タクトタイム調整処理を終了すると判断した場合には後述するステップS23に移行する。
In step S15, the image processing apparatus 12 obtains the tact time and accuracy (deviation amount between the positioning processing result and the true value (variation amount given in step S13)) from the search processing result in step S14, and these are obtained. It is stored in the work memory 24 as a reference value.
Next, in step S16, it is determined whether or not to end the tact time adjustment process. Here, when the tact time held in the work memory 24 has reached the required tact time, when the tact time is not shortened from the previous value, or when the number of adjustments exceeds a predetermined number of times, It is determined that the tact time adjustment process is finished. If it is determined that the tact time adjustment process is to be continued, the process proceeds to step S17. If it is determined that the tact time adjustment process is to be terminated, the process proceeds to step S23 described later.

ステップS17では、画像処理装置12は、最大エッジ点数の最適化を行う。位置決め処理のタクトタイムは、テンプレートデータに登録されているエッジ点の数に依存している。したがって、このエッジ点数を減らせばタクトタイムは短縮できる。但し、精度は悪化する。
本実施形態では、テンプレートデータに登録されているエッジ点数を段階的に削減し、その度に位置決め処理の精度を確認することで、要求精度を保つことのできる限界タクトタイムでのエッジ点数を取得する。そして、このエッジ点数を最適なエッジ点数とする。ここで、エッジ点数の削減は、エッジ点がエッジ線上に均等に配置されるよう、間引き処理にて行う。すなわち、間引き点数を1、2、3、…の順に増やしていくことで、段階的にエッジ点数を削減する。
In step S17, the image processing apparatus 12 optimizes the maximum number of edge points. The tact time of the positioning process depends on the number of edge points registered in the template data. Therefore, the tact time can be shortened by reducing the number of edge points. However, accuracy deteriorates.
In this embodiment, the number of edge points registered in the template data is reduced step by step, and the accuracy of the positioning process is confirmed each time, thereby obtaining the number of edge points at the limit tact time that can maintain the required accuracy. To do. The number of edge points is set as the optimum number of edge points. Here, the number of edge points is reduced by thinning processing so that the edge points are evenly arranged on the edge line. That is, the number of edge points is gradually reduced by increasing the number of thinning points in the order of 1, 2, 3,.

テンプレートパラメータからテンプレートデータを作成するとき、最大エッジ点数を越えないよう自動的に間引き処理が行われるので、最大エッジ点数を小さくすることでエッジ点数の削減(間引き点数の増加)を行うことができる。したがって、このステップS17では最大エッジ点数を、パラメータ格納部25に格納されている値より所定値小さい値に設定する。   When creating template data from template parameters, the thinning process is automatically performed so as not to exceed the maximum number of edge points, so the number of edge points can be reduced (the number of thinning points increased) by reducing the maximum number of edge points. . Therefore, in step S17, the maximum number of edge points is set to a value smaller than the value stored in the parameter storage unit 25 by a predetermined value.

次にステップS18では、画像処理装置12は、前記ステップS17で設定したテンプレートパラメータを用いて、テンプレートデータを作成し直し、ステップS19に移行する。
ステップS19では、画像処理装置12は、前記ステップS18で作成し直したテンプレートデータを用いて、前記ステップS13で生成したサーチ評価画像についてサーチ処理を行い、ステップS20に移行する。
In step S18, the image processing apparatus 12 recreates template data using the template parameter set in step S17, and proceeds to step S19.
In step S19, the image processing apparatus 12 performs a search process on the search evaluation image generated in step S13 using the template data recreated in step S18, and proceeds to step S20.

ステップS20では、画像処理装置12は、前記ステップS19のサーチ処理結果からタクトタイム及び精度を求め、ステップS21に移行して、前記ステップS20で求めた位置決め処理の精度と作業メモリ24に保持しておいた基準値とを比較する。そして、このときの位置決め処理の精度が基準値と比較して悪化していない(精度の悪化が許容範囲内である)場合にはステップS22に移行し、タクトタイム及び精度の基準値を更新して前記ステップS16に移行する。   In step S20, the image processing apparatus 12 obtains the tact time and accuracy from the search processing result of step S19, proceeds to step S21, and holds the positioning processing accuracy obtained in step S20 and the work memory 24. Compare the set standard value. Then, if the accuracy of the positioning process at this time is not deteriorated compared to the reference value (deterioration of accuracy is within the allowable range), the process proceeds to step S22, and the reference time and accuracy reference values are updated. Then, the process proceeds to step S16.

一方、このときの位置決め処理の精度が基準値と比較して悪化している(精度の悪化が許容範囲外である)場合には、ひとつ前の最大エッジ点数が、要求精度を保持できる限界値であったと判断する。したがって、この場合にはステップS23に移行して、サーチ処理用パラメータの初期設定を行う。ここでは、ここまでの処理で得た最適なテンプレート用パラメータ値をもとに、サーチ処理用パラメータの初期値を上述したルール(1)〜(3)を用いて設定する。   On the other hand, if the accuracy of the positioning process at this time is worse than the reference value (deterioration of accuracy is outside the allowable range), the previous maximum number of edge points is the limit value that can maintain the required accuracy. Judge that it was. Therefore, in this case, the process proceeds to step S23, and initial setting of search processing parameters is performed. Here, based on the optimum template parameter values obtained by the processing so far, the initial values of the search processing parameters are set using the rules (1) to (3) described above.

なお、標準カメラ5a及び高解像度カメラ5bが撮像手段に対応し、パラメータ格納部25が記憶手段に対応している。また、図3において、ステップS1がテンプレート画像取得手段に対応し、ステップS3〜S5がエッジ領域抽出手段に対応し、ステップS6がエッジ検出パラメータ設定手段に対応し、ステップS13が評価用画像取得手段に対応している。また、ステップS3〜S11がパラメータ設定手段に対応し、ステップS12〜S22がパラメータ更新手段に対応している。   Note that the standard camera 5a and the high-resolution camera 5b correspond to an imaging unit, and the parameter storage unit 25 corresponds to a storage unit. In FIG. 3, step S1 corresponds to the template image acquisition means, steps S3 to S5 correspond to the edge region extraction means, step S6 corresponds to the edge detection parameter setting means, and step S13 corresponds to the evaluation image acquisition means. It corresponds to. Steps S3 to S11 correspond to parameter setting means, and steps S12 to S22 correspond to parameter updating means.

(動作)
次に、第1の実施形態の動作について説明する。
今、画像処理装置12のパラメータ格納部25に、最適なテンプレートデータ及び最適なサーチ用パラメータが格納されているものとする。この状態で部品実装装置1が電子部品2の搭載処理を行う場合、マシン制御装置11は吸着ノズル3を電子部品供給装置(不図示)の部品供給位置へ移動し、電子部品2の吸着を行う。電子部品2を吸着すると、マシン制御装置11は、吸着ヘッド3を所定の撮像位置へ移動する。このとき、吸着部品に応じて撮像するカメラ5a又は5bを選択し、選択したカメラの撮像位置に電子部品2が位置するように吸着ノズル3を移動する。吸着ノズル3を撮像位置に移動すると、マシン制御装置11は、照明装置4を制御して電子部品2に照明光を照射し、画像処理装置12に対して、選択したカメラチャネル情報と共に位置決め処理の実行を指示するコマンドを送信する。
(Operation)
Next, the operation of the first embodiment will be described.
Now, it is assumed that optimum template data and optimum search parameters are stored in the parameter storage unit 25 of the image processing apparatus 12. When the component mounting apparatus 1 performs the mounting process of the electronic component 2 in this state, the machine control device 11 moves the suction nozzle 3 to a component supply position of an electronic component supply device (not shown) and sucks the electronic component 2. . When the electronic component 2 is picked up, the machine control device 11 moves the suction head 3 to a predetermined imaging position. At this time, the camera 5a or 5b to be imaged is selected according to the suction component, and the suction nozzle 3 is moved so that the electronic component 2 is positioned at the imaging position of the selected camera. When the suction nozzle 3 is moved to the imaging position, the machine control device 11 controls the illumination device 4 to irradiate the electronic component 2 with illumination light, and performs positioning processing on the image processing device 12 together with the selected camera channel information. Send a command to execute.

画像処理装置12は、このコマンドを、インタフェース28を介して受信する。するとコマンド解析タスク12aは画像入力タスク12bを起床し、制御部26がカメラを制御することで撮像位置にある電子部品2を撮像する。撮像した電子部品2の画像は、A/D変換部21でデジタル化されて画像メモリ22に記憶される。この画像データがサーチ対象画像となる。また、このとき画像メモリ22に記憶される画像データは、D/A変換部29でアナログ化されてモニタ7に表示される。   The image processing apparatus 12 receives this command via the interface 28. Then, the command analysis task 12a wakes up the image input task 12b, and the control unit 26 controls the camera to image the electronic component 2 at the imaging position. The captured image of the electronic component 2 is digitized by the A / D converter 21 and stored in the image memory 22. This image data becomes the search target image. At this time, the image data stored in the image memory 22 is converted to analog by the D / A converter 29 and displayed on the monitor 7.

サーチ対象画像の準備ができると、コマンド解析タスク12aは認識実行タスク12cを起床し、演算部23及び並列演算部27によって電子部品2の位置決め処理を実行する。この位置決め処理では、先ず、サーチ対象画像に対して、パラメータ格納部25にサーチ用パラメータとして格納されているエッジスケールに応じたフィルタをかけ、最小エッジ強さを用いて閾値処理を行ってサーチ対象画像内のエッジ点を抽出する。   When the search target image is prepared, the command analysis task 12a wakes up the recognition execution task 12c, and executes the positioning process of the electronic component 2 by the calculation unit 23 and the parallel calculation unit 27. In this positioning process, first, a filter according to the edge scale stored as a search parameter in the parameter storage unit 25 is applied to the search target image, and threshold processing is performed using the minimum edge strength to perform the search target image. Extract edge points in the image.

次に、このエッジ画像をサーチ用パラメータであるピラミッド開始層に応じた圧縮率で圧縮し、パラメータ格納部25に格納されたテンプレートデータを用いて粗サーチを行う。この粗サーチでは、エッジサーチ、正規化相関サーチ、一般化ハフ変換、ジオメトリックハッシング等の既知のサーチ技術を用いて、サーチ対象画像から対象物の大まかな位置及び姿勢を取得する。   Next, the edge image is compressed at a compression rate corresponding to the pyramid start layer which is a search parameter, and a rough search is performed using the template data stored in the parameter storage unit 25. In this coarse search, a rough position and orientation of an object are acquired from a search target image using known search techniques such as edge search, normalized correlation search, generalized Hough transform, and geometric hashing.

続いて、粗サーチで取得した検索領域に対して精サーチを行い、対象物の詳細な位置を検出する。この精サーチでは、粗サーチで得られた対象物の位置及び姿勢を開始位置及び開始姿勢とし、テンプレートデータから作成されるテンプレート(パターンモデル)をサーチ対象画像に重ね、テンプレートの平行移動や回転移動、スケール変動を繰り返し行うことでサーチ対象画像内の対象物との一致度が最も高くなる位置を検出する。そして、このテンプレートの移動量に基づいて、サーチ対象画像内の対象物の詳細位置を取得する。これにより、位置決め処理結果(テンプレートに対するサーチ対象画像内の対象物の平行移動量、回転移動量、スケール変動量)を得ることができ、吸着ノズル3で吸着した電子部品2の吸着位置ずれ量、吸着角度ずれ量が分かり、搭載位置決めが可能となる。   Subsequently, a fine search is performed on the search area acquired by the coarse search, and a detailed position of the object is detected. In this fine search, the position and orientation of the object obtained in the coarse search are used as the start position and the start orientation, and a template (pattern model) created from the template data is overlaid on the search target image to translate and rotate the template. The position where the degree of coincidence with the object in the search target image becomes the highest is detected by repeatedly performing the scale variation. Then, based on the movement amount of the template, the detailed position of the target object in the search target image is acquired. As a result, positioning processing results (a parallel movement amount, a rotational movement amount, and a scale fluctuation amount of the target object in the search target image with respect to the template) can be obtained. The amount of suction angle deviation is known, and mounting positioning is possible.

位置決め処理が終了すると、認識実行タスク12cは休止状態となり、コマンド解析タスク12aは、位置決め処理結果をマシン制御装置11へのレスポンスとしてインタフェース28を介してマシン制御装置11へ送信する。
マシン制御装置11は、画像処理装置12から位置決め処理結果を受信すると、当該位置決め処理結果に応じて部品搭載位置を調整して、電子部品2を基板上に搭載する。これにより、電子部品2を所望の位置に適切に搭載することができる。
その後、部品ロットが切り替わると、マシン制御装置11は、画像処理装置12に対してこれを通知する。このとき、マシン制御装置11は、画像処理装置12に対して、オペレータが指定した位置決め処理の要求精度や要求タクトタイムも送信する。
When the positioning process is completed, the recognition execution task 12c enters a sleep state, and the command analysis task 12a transmits the positioning process result to the machine control apparatus 11 through the interface 28 as a response to the machine control apparatus 11.
When the machine control device 11 receives the positioning processing result from the image processing device 12, it adjusts the component mounting position according to the positioning processing result and mounts the electronic component 2 on the substrate. Thereby, the electronic component 2 can be appropriately mounted at a desired position.
Thereafter, when the part lot is switched, the machine control device 11 notifies the image processing device 12 of this. At this time, the machine control device 11 also transmits to the image processing device 12 the required accuracy of the positioning process designated by the operator and the required tact time.

画像処理装置12がマシン制御装置11からインタフェース28を介して部品ロットの切り替わり通知を受信すると、コマンド解析タスク12aは画像入力タスク12bを起床し、制御部26がカメラを制御することで基準姿勢の電子部品2の画像を撮像する。撮像した電子部品2の画像は、A/D変換部21でデジタル化されて画像メモリ22に記憶される。次に、コマンド解析タスク12aは、テンプレート調整タスク12dを起床し、画像メモリ22に記憶された画像データに対して任意の変動(平行移動、回転、拡大・縮小)を加えた画像データを生成し、これを作業メモリ24に記憶する。この画像データは、位置決め処理の精度及びタクトタイムを計測してパラメータ調整の要否を判断するためのサーチ評価画像となる。そして、生成したサーチ評価画像に対して、パラメータ格納部25に格納されたテンプレートデータを用いてサーチ処理を行い、位置決め処理結果を得る。   When the image processing apparatus 12 receives the part lot change notification from the machine control apparatus 11 via the interface 28, the command analysis task 12a wakes up the image input task 12b, and the control unit 26 controls the camera to control the reference posture. An image of the electronic component 2 is taken. The captured image of the electronic component 2 is digitized by the A / D converter 21 and stored in the image memory 22. Next, the command analysis task 12a wakes up the template adjustment task 12d and generates image data obtained by adding arbitrary fluctuations (translation, rotation, enlargement / reduction) to the image data stored in the image memory 22. This is stored in the work memory 24. This image data becomes a search evaluation image for determining the necessity of parameter adjustment by measuring the accuracy of the positioning process and the tact time. Then, search processing is performed on the generated search evaluation image using template data stored in the parameter storage unit 25, and a positioning processing result is obtained.

このとき、得られる位置決め処理結果と真値(サーチ評価画像の生成時に用いた変動量)とを比較することで位置決め処理の精度を求める。また、同時に位置決め処理のタクトタイムも計測する。そして、これらを作業用メモリ24に保持している値と比較し、許容範囲を超えて悪化している場合、パラメータ格納部25に格納されたテンプレートデータ及びサーチ用パラメータを調整すべきであると判断し、最適パラメータ取得処理を実行する。   At this time, the accuracy of the positioning process is obtained by comparing the positioning process result obtained and the true value (variation amount used when generating the search evaluation image). At the same time, the tact time of the positioning process is also measured. Then, these values are compared with the values held in the work memory 24. If the values are worse than the allowable range, the template data and search parameters stored in the parameter storage unit 25 should be adjusted. Determine and execute the optimum parameter acquisition process.

最適パラメータ取得処理では、テンプレートデータを作成するためのパラメータである最小濃度値、最小エッジ強さ、エッジスケール、最大エッジ点数を最適な値に調整する。本実施形態では、テンプレート作成用の画像であるテンプレート画像を撮像し(図3のステップS1)、このテンプレート画像を処理して、位置決め処理の精度に関するテンプレートパラメータ(最小濃度値、最小エッジ強さ、エッジスケール)を、精度が最も良くなる最適な値に設定する(ステップS3〜S11)。   In the optimum parameter acquisition process, the minimum density value, the minimum edge strength, the edge scale, and the maximum edge number, which are parameters for creating template data, are adjusted to optimum values. In the present embodiment, a template image that is an image for creating a template is captured (step S1 in FIG. 3), and this template image is processed to obtain template parameters (minimum density value, minimum edge strength, Edge scale) is set to an optimum value that provides the best accuracy (steps S3 to S11).

そして、これらのテンプレートパラメータをもとに作成したテンプレートデータを用いて、テンプレート画像から生成したサーチ評価画像についてサーチ処理(サーチテスト)を行って、位置決め処理の精度を求め、これを基準値として保持しておく(ステップS12〜S15)。次に、位置決め処理のタクトタイムに関するテンプレートパラメータ(最大エッジ点数)を、初期値から徐々にタクトタイムが良くなる方向へ変更していき、調整毎に精度を評価して、当該精度が要求精度を満たしている上記基準値を保てる限界の値を最適なパラメータ値として取得する(ステップS16〜S22)。   Then, using the template data created based on these template parameters, search processing (search test) is performed on the search evaluation image generated from the template image to determine the accuracy of the positioning processing, and this is retained as a reference value. (Steps S12 to S15). Next, the template parameter (maximum number of edge points) related to the tact time of the positioning process is gradually changed from the initial value to the direction in which the tact time is improved, and the accuracy is evaluated for each adjustment. A limit value that can satisfy the above-described reference value is acquired as an optimum parameter value (steps S16 to S22).

ところで、従来のテンプレートパラメータの調整では、オペレータが実際にパラメータ値の数値入力を行ったり、エッジの有効/無効をウインドウで囲んで指定したりするなど、オペレータが自身で使用環境に合わせて調整しなければならなかった。したがって、対象物毎に微妙なパラメータ調整を行うためには、位置決め処理のアルゴリズムや挙動についてのノウハウが必要であり、高精度かつ高速な最適調整だけでなく、用途に合わせたきめ細やかな調整を行うのは非常に困難であった。   By the way, in the conventional template parameter adjustment, the operator actually adjusts the parameters according to the usage environment, for example, by entering numerical values of the parameter values or by specifying whether the edge is valid / invalid surrounded by a window. I had to. Therefore, in order to make fine parameter adjustments for each object, it is necessary to know the algorithm and behavior of positioning processing, and not only high-precision and high-speed optimum adjustments, but also fine-tuned adjustments according to the application. It was very difficult to do.

これに対して、本実施形態では、要求精度および要求タクトタイムを満たすテンプレートパラメータを自動的に取得することができるので、微妙なパラメータ調整を適切に行うことができる。また、オペレータが要求精度および要求タクトタイムを指示することができる構成であるため、例えば、精度は多少犠牲にしても良いからより高速に行いたい等、用途に合わせた調整が可能となる。
また、部品ロットの切り替え時にパラメータ調整の要否を判断し、必要に応じてパラメータ調整を行うので、部品ロットの切り替えに起因して部品の材質や色、サイズの変動が生じた場合であっても、適切なパラメータに更新することができる。したがって、自動的に精度およびタクトタイムの悪化を検知し、自動的にこれを修復することができる。
On the other hand, in the present embodiment, template parameters satisfying the required accuracy and required tact time can be automatically acquired, so that delicate parameter adjustment can be performed appropriately. In addition, since the operator can instruct the required accuracy and the required tact time, for example, the accuracy may be sacrificed to some extent, so that it is possible to make adjustments according to the application, for example, to perform at a higher speed.
In addition, the necessity of parameter adjustment is determined at the time of part lot switching, and parameter adjustment is performed as necessary.Therefore, when the part material, color, and size change due to part lot switching, Can also be updated with appropriate parameters. Therefore, it is possible to automatically detect deterioration of accuracy and tact time and automatically repair it.

(効果)
このように、第1の実施形態では、位置検出が可能なテンプレートデータであるのみならず、位置検出処理に用いた場合の位置検出精度やタクトタイム、ロバスト性等の特性に関しても最適化されたテンプレートデータを作成するためのパラメータを設定することができる。また、オペレータが指定した要求精度及び要求タクトタイムに応じて、パラメータを自動的に調整するので、オペレータに形状ベースマッチング処理のアルゴリズム等についてのノウハウがなくても、用途に合わせたきめ細やかなパラメータ調整が可能となる。
(effect)
As described above, in the first embodiment, not only the template data capable of position detection but also the characteristics such as position detection accuracy, tact time, and robustness when used for the position detection processing are optimized. Parameters for creating template data can be set. In addition, the parameters are automatically adjusted according to the required accuracy and required tact time specified by the operator, so even if the operator has no know-how about the shape-based matching processing algorithm, etc. Adjustment is possible.

このとき、テンプレート画像に対して内部的に変動を加えてサーチ評価画像を生成し、生成したサーチ評価画像を用いてパラメータ調整を行うので、テンプレート画像を1枚撮像するだけでパラメータ調整が可能となる。したがって、撮像画像を記憶するメモリの容量が少ないシステムや、評価用の実画像を用意できないシステムにも対応可能である。また、テンプレート画像に対して加えた変動量を、位置決め処理結果の真値とし、位置決め処理の絶対精度評価値として使用することができるので、形状ベースマッチング処理の精度評価が容易である。   At this time, a search evaluation image is generated by internally changing the template image, and parameter adjustment is performed using the generated search evaluation image. Therefore, parameter adjustment can be performed only by capturing one template image. Become. Therefore, the present invention can be applied to a system having a small memory capacity for storing captured images and a system in which an actual image for evaluation cannot be prepared. Further, since the fluctuation amount added to the template image can be used as the true value of the positioning processing result and used as the absolute accuracy evaluation value of the positioning processing, the accuracy evaluation of the shape base matching processing is easy.

さらに、パラメータ調整を行う際には、先ず、位置決め処理の精度が要求精度を満たすようにパラメータを設定する。このとき、テンプレート画像のエッジ領域を抽出し、コントラスト、エッジ強さ、エッジスケール等のエッジ特性値の分布を計測することで、最適なエッジ検出パラメータ(エッジ検出の閾値処理で用いる閾値)を設定する。このように、エッジ検出精度が最良となるようにパラメータを設定することができるので、確実に要求精度を満たすパラメータ設定が可能となる。   Furthermore, when performing parameter adjustment, first, parameters are set so that the accuracy of the positioning process satisfies the required accuracy. At this time, the edge region of the template image is extracted, and the distribution of edge characteristic values such as contrast, edge strength, and edge scale is measured, and optimal edge detection parameters (threshold values used in edge detection threshold processing) are set. To do. As described above, since the parameters can be set so that the edge detection accuracy is the best, it is possible to reliably set the parameters that satisfy the required accuracy.

また、パラメータ調整を行う際には、最大エッジ点数を段階的に削減し、調整毎に位置決め処理の精度を評価し、要求精度を保てる限界タクトで必要なエッジ点数を取得する。このように、最大エッジ点数を段階的に削減するので、確実にタクトタイムが短縮する方向にパラメータを徐変させることができる。また、タクトタイムが短縮する方向にパラメータを徐変しながら位置決め処理の精度を評価し、最適なパラメータ値を取得するので、よりきめ細やかなパラメータ調整が可能となる。   Further, when performing parameter adjustment, the maximum number of edge points is reduced stepwise, the accuracy of positioning processing is evaluated for each adjustment, and the necessary number of edge points is acquired with a limit tact that can maintain the required accuracy. Thus, since the maximum number of edge points is reduced step by step, the parameter can be gradually changed in a direction in which the tact time is surely shortened. In addition, since the accuracy of the positioning process is evaluated while gradually changing the parameters in the direction of shortening the tact time and the optimum parameter value is acquired, finer parameter adjustment becomes possible.

さらに、生産中に部品ロットの切り替わりを検知し、パラメータ調整の要否を判断するので、部品ロットの切り替わりで部品の材質や色等が変わったり、製造誤差による微妙なサイズ変動等でティーチング時のテンプレートデータとの差異が生じたりした場合には、自動的にパラメータの再調整を行い、最適なパラメータに更新することができる。そのため、部品ロットの切り替わりに起因して微妙に精度が悪化したりタクトタイムが延びたりするのを防止することができる。
したがって、このような部品実装装置では、常に高精度な部品搭載が可能となる。
In addition, since the change of parts lots is detected during production and the necessity of parameter adjustment is judged, the material and color of parts change due to the change of parts lots, and subtle size fluctuations due to manufacturing errors cause teaching. When a difference from the template data occurs, the parameters can be readjusted automatically and updated to the optimum parameters. For this reason, it is possible to prevent the accuracy from deteriorating slightly and the tact time from extending due to the change of the parts lot.
Therefore, in such a component mounting apparatus, component mounting with high accuracy is always possible.

(第2の実施形態)
次に、本発明の第2の実施形態について説明する。
この第2の実施形態は、前述した第1の実施形態において、テンプレート画像から生成したサーチ評価画像を用いて最適パラメータ取得処理を行っているのに対し、実際に撮像した複数のサーチ評価画像を用いて最適パラメータ取得処理を行うようにしたものである。生産前のテンプレートの初期作成で用いる場合は、生産時に起こり得る、姿勢の変動範囲、照明の変動範囲を考慮してサーチ評価画像を用意する。
(Second Embodiment)
Next, a second embodiment of the present invention will be described.
In the second embodiment, the optimum parameter acquisition process is performed using the search evaluation image generated from the template image in the first embodiment described above, whereas a plurality of actually acquired search evaluation images are displayed. In this way, the optimum parameter acquisition process is performed. When used in the initial creation of a template before production, a search evaluation image is prepared in consideration of a posture variation range and illumination variation range that may occur during production.

(構成)
本実施形態のマシン制御装置11は、テンプレートデータの調整に関するコマンドパラメータとして、位置決め処理での要求精度、要求タクトタイムに加えて、サーチ評価画像の撮像姿勢(評価姿勢)、撮像枚数、撮像時の照明の明るさなど、サーチ評価画像の撮像条件を画像処理装置12へ送信する。これらのサーチ評価画像の撮像条件は、マンマシンインタフェース6を介して、オペレータが指定することができる。
図5は、第2の実施形態のテンプレート作成用画像撮像処理手順を示すフローチャートである。
(Constitution)
The machine control device 11 according to the present embodiment includes, as command parameters relating to template data adjustment, in addition to the required accuracy in positioning processing and the required tact time, the imaging posture (evaluation posture) of the search evaluation image, the number of images to be taken, The imaging conditions for the search evaluation image, such as the brightness of the illumination, are transmitted to the image processing device 12. The imaging conditions for these search evaluation images can be specified by the operator via the man-machine interface 6.
FIG. 5 is a flowchart illustrating a template creation image capturing process procedure according to the second embodiment.

先ずステップS31で、画像処理装置12は、マシン制御装置11から指定されたカメラ5a又は5bを制御し、基準姿勢の対象物(電子部品)2の画像を撮像する。撮像した画像はA/D変換部21でデジタル化し、画像メモリ22にテンプレート画像データとして記憶する。
次にステップS32では、画像処理装置12は、サーチ評価画像の撮像処理を終了するか否かを判定する。ここでは、マシン制御装置11から指定された撮像条件でサーチ評価画像を撮像し終わっているか否かを判定し、終わっていない場合にはステップS33に移行し、終わっている場合には後述するステップS34に移行する。
First, in step S31, the image processing device 12 controls the camera 5a or 5b designated by the machine control device 11, and takes an image of the target object (electronic component) 2 in the reference posture. The captured image is digitized by the A / D converter 21 and stored as template image data in the image memory 22.
In step S32, the image processing apparatus 12 determines whether to end the search evaluation image capturing process. Here, it is determined whether or not the search evaluation image has been imaged under the imaging conditions specified by the machine control device 11. If not, the process proceeds to step S33. The process proceeds to S34.

ステップS33では、画像処理装置12は、マシン制御装置11に対して、対象物(電子部品2)を吸着した吸着ノズル3を撮像条件である一評価姿勢に移動させると共に、その評価姿勢での照明の明るさを指定するコマンドを送信する。マシン制御装置11からのレスポンス(サーチ評価画像の撮像コマンド)を受けると、画像処理装置12は、指定されたカメラ5a又は5bを制御し、評価姿勢での対象物(電子部品2)を撮像する。このとき、指定された枚数分、撮像する。一評価姿勢でのサーチ評価画像の撮像が終了すると、前記ステップS32に移行する。このように、ステップS32及びS33の処理を繰り返すことで、すべての撮像条件でサーチ評価画像が撮像される。
ステップS34では、画像処理装置12は、撮像したサーチ評価画像のリストを作成し、これを画像メモリ22に添付データとして記憶する。
In step S <b> 33, the image processing apparatus 12 moves the suction nozzle 3 that sucks the object (electronic component 2) to the machine control apparatus 11 to one evaluation posture that is an imaging condition, and performs illumination in the evaluation posture. Send a command to specify the brightness of the. Upon receiving a response (search evaluation image capturing command) from the machine control device 11, the image processing device 12 controls the designated camera 5a or 5b to image the object (electronic component 2) in the evaluation posture. . At this time, the designated number of images are taken. When imaging of the search evaluation image in one evaluation posture is completed, the process proceeds to step S32. In this way, by repeating the processes of steps S32 and S33, the search evaluation image is captured under all imaging conditions.
In step S <b> 34, the image processing apparatus 12 creates a list of captured search evaluation images, and stores this in the image memory 22 as attached data.

次に、本実施形態における最適パラメータ取得処理について説明する。
図6は、第2の実施形態の最適パラメータ取得処理手順を示すフローチャートである。
先ずステップS41で、画像処理装置12は、テンプレートパラメータの初期設定を行い、ステップS42に移行する。ここでは、テンプレートパラメータをデフォルト値である最小濃度値=80、最小エッジ強さ=32、エッジスケール=2、エッジ点数=1024に設定する。設定したテンプレートパラメータは、作業用メモリ24に記憶する。
Next, the optimum parameter acquisition process in this embodiment will be described.
FIG. 6 is a flowchart illustrating an optimal parameter acquisition processing procedure according to the second embodiment.
First, in step S41, the image processing apparatus 12 performs initial setting of template parameters, and proceeds to step S42. Here, the template parameters are set to the default values of minimum density value = 80, minimum edge strength = 32, edge scale = 2, and number of edge points = 1024. The set template parameters are stored in the work memory 24.

なお、このステップS41では、前述した図3に示す最適パラメータ取得処理を行ってテンプレートパラメータの初期設定を行うようにしてもよい。この場合、テンプレートパラメータの初期値を有用な値とすることができるため、以下の処理において比較的容易にテンプレートパラメータ値を最適な値に収束させることができる。
ステップS42では、画像処理装置12は、作業用メモリ24に記憶されているテンプレートパラメータを用いてテンプレートデータの作成を行い、ステップS43に移行する。
In step S41, the template parameters may be initialized by performing the optimum parameter acquisition process shown in FIG. In this case, since the initial value of the template parameter can be a useful value, the template parameter value can be converged to an optimal value relatively easily in the following processing.
In step S42, the image processing apparatus 12 creates template data using the template parameters stored in the work memory 24, and proceeds to step S43.

ステップS43では、画像処理装置12は、図5に示す処理で撮像したすべてのサーチ評価画像についてサーチ処理を行ったか否かを判定する。そして、すべてのサーチ処理が終了していない場合にはステップS44に移行し、すべてのサーチ処理が終了している場合には後述するステップS46に移行する。
ステップS44では、画像処理装置12は、前記ステップS42で作成したテンプレートデータを用いて、同一評価姿勢の対象物を撮像した複数のサーチ評価画像について、それぞれサーチ処理を行い、位置決め処理結果を得る。
In step S43, the image processing apparatus 12 determines whether or not search processing has been performed for all search evaluation images captured in the processing illustrated in FIG. If all search processes have not been completed, the process proceeds to step S44. If all search processes have been completed, the process proceeds to step S46, which will be described later.
In step S44, using the template data created in step S42, the image processing device 12 performs search processing for each of a plurality of search evaluation images obtained by imaging the object in the same evaluation posture, and obtains a positioning processing result.

次にステップS45では、画像処理装置12は、前記ステップS44で求めた位置決め処理結果について統計処理データを取得し、前記ステップS43に移行する。ここで、統計処理される位置決め処理結果データは、テンプレートの中心座標(x,y)、最遠点座標(x,y)であり、それぞれ平均値及び標準偏差(3σ)を求める。また、タクトタイムについても、総処理タクトタイム、エッジ検出タクトタイム、粗サーチタクトタイム、精サーチタクトタイムの4つを計測し、それぞれ平均タクトタイム、最小タクトタイム、最大タクトタイムを求める。さらに、ここでは位置決め処理結果(テンプレートに対するサーチ評価画像内の対象物の平行移動量、回転量、スケール変動量)についても求めておく。
また、ステップS46では、画像処理装置12は、前記ステップS45で求めたテンプレートの中心座標の標準偏差(3σ)と最遠点座標の標準偏差(3σ)とが、それぞれ要求精度に応じた所定の許容範囲内であるか否かの評価を行う。
In step S45, the image processing apparatus 12 acquires statistical processing data for the positioning processing result obtained in step S44, and proceeds to step S43. Here, the positioning processing result data subjected to statistical processing are the center coordinates (x, y) and the farthest point coordinates (x, y) of the template, and an average value and a standard deviation (3σ) are obtained, respectively. As for the tact time, the total processing tact time, the edge detection tact time, the coarse search tact time, and the fine search tact time are measured, and the average tact time, the minimum tact time, and the maximum tact time are obtained, respectively. Further, here, the positioning processing result (a translation amount, a rotation amount, and a scale variation amount of the object in the search evaluation image with respect to the template) is also obtained.
In step S46, the image processing apparatus 12 determines whether the standard deviation (3σ) of the central coordinates of the template obtained in step S45 and the standard deviation (3σ) of the farthest point coordinates are predetermined according to the required accuracy. Evaluate whether it is within the allowable range.

そして、ステップS47では、画像処理装置12は、前記ステップS46で各標準偏差(3σ)が許容範囲内であると判断した場合には、テンプレートデータの精度に関するパラメータ(精度パラメータ)を調整する必要はないものとして、後述するステップS52に移行する。一方、許容範囲外であると判断した場合には、テンプレートデータの精度パラメータを調整するべくステップS48に移行する。   In step S47, if the image processing apparatus 12 determines in step S46 that each standard deviation (3σ) is within the allowable range, it is necessary to adjust a parameter (accuracy parameter) relating to the accuracy of the template data. If not, the process proceeds to step S52 described later. On the other hand, if it is determined that it is outside the allowable range, the process proceeds to step S48 to adjust the accuracy parameter of the template data.

精度パラメータの調整は、テンプレートパラメータのうちの最小エッジ強さ及びエッジスケール、並びにサーチパラメータのうちの最小エッジ強さ及びエッジスケールを調整することにより行う。本実施形態では、上記パラメータを、複数の候補値の中から精度が良くなる方向に1段階ずつ厳しく、若しくは1段階ずつ緩くなるよう変更し、その都度、サーチ処理を行って精度を評価する。この処理を、要求精度を満足するまで繰り返し行う(リトライする)。
ステップS48では、画像処理装置12は、精度パラメータ調整のリトライ回数が予め設定した最大回数を超えたか否かを判定する。そして、最大回数を超えていない場合にはステップS49に移行し、精度パラメータ調整処理を行う。
The accuracy parameter is adjusted by adjusting the minimum edge strength and edge scale of the template parameters and the minimum edge strength and edge scale of the search parameters. In the present embodiment, the above parameters are changed so that the accuracy is improved step by step in a direction in which the accuracy is improved, or gradually decreased by one step, and the accuracy is evaluated by performing a search process each time. This process is repeated (retry) until the required accuracy is satisfied.
In step S48, the image processing apparatus 12 determines whether or not the number of retries for accuracy parameter adjustment exceeds a preset maximum number. If the maximum number of times has not been exceeded, the process proceeds to step S49, and accuracy parameter adjustment processing is performed.

図7は、ステップS49で実行する精度パラメータ調整処理手順を示すフローチャートである。
先ずステップS49aで、複数枚のサーチ評価画像データに対する統計処理の結果、最も差異が大きい2枚の画像を抽出する。ここでは、同一の撮像条件(撮像姿勢、照明の明るさ等)の組について、それぞれ処理する。
FIG. 7 is a flowchart showing the accuracy parameter adjustment processing procedure executed in step S49.
First, in step S49a, two images having the largest difference are extracted as a result of statistical processing on a plurality of search evaluation image data. Here, each group of the same imaging conditions (imaging posture, illumination brightness, etc.) is processed.

次に、ステップS49bでは、前記ステップS49aで抽出した2枚の画像について、それぞれエッジ検出を行い、ステップS49cに移行する。
ステップS49cでは、先ず、前記ステップS49bで得られた2枚のサーチ評価画像のエッジを、前記ステップS45で得られた位置決め処理結果(平行移動量、回転量、スケール変動量)をもとにテンプレート画像の座標系に変換する。そして、図8に示すように、変換した2枚のサーチ評価画像のエッジ(a)及び(b)と、テンプレート画像のエッジ(c)とを重ね合わせ、一致しない部位(不安定エッジ)を抽出する。このとき、重ね合わせた3枚の画像のエッジの一致度が所定の判定閾値よりも低い部位を不安定エッジとして抽出する。最後に、2枚のサーチ評価画像データとテンプレート画像データの計3枚について、それぞれ不安定エッジ点の座標値リスト(不安定エッジリスト)を作成する。このとき、リスト上のエッジ点について、エッジ検出パラメータ値(最小エッジ強さ、エッジスケール値)を対応付けておく。
Next, in step S49b, edge detection is performed for each of the two images extracted in step S49a, and the process proceeds to step S49c.
In step S49c, first, the edges of the two search evaluation images obtained in step S49b are converted into templates based on the positioning processing results (parallel movement amount, rotation amount, scale variation amount) obtained in step S45. Convert to image coordinate system. Then, as shown in FIG. 8, the edges (a) and (b) of the two converted search evaluation images and the edge (c) of the template image are overlapped to extract a non-matching part (unstable edge). To do. At this time, a part where the degree of coincidence of the edges of the three superimposed images is lower than a predetermined determination threshold is extracted as an unstable edge. Finally, a coordinate value list (unstable edge list) of unstable edge points is created for a total of three search evaluation image data and template image data. At this time, the edge detection parameter values (minimum edge strength, edge scale value) are associated with the edge points on the list.

次にステップS49dでは、前記ステップS49cの画像重ね合わせ処理の結果、不安定エッジ(差異エッジ)が抽出されているか否かを判定する。そして、不安定エッジが抽出されている場合にはステップS49eに移行し、不安定エッジが抽出されていない場合には、精度パラメータ調整処理を終了する。
ステップS49eでは、不安定エッジが無くなるように、精度パラメータである最小エッジ強さを調整する。テンプレートパラメータの最小エッジ強さについては、テンプレートの差異エッジを削除するべく、値が大きくなるよう調整する。また、サーチ用パラメータの最小エッジ強さについては、抽出されるエッジ点を増やし、テンプレート画像のエッジとの一致度合いを向上させることで不安定エッジを無くすよう、値が小さくなるよう調整する。なお、最小エッジ強さの調整は、不安定エッジリストに格納されているエッジ検出パラメータ値を基準に、1段階厳しく若しくは1段階緩くなるよう、上述した表1に示す候補値の中から選択することで行う。
Next, in step S49d, it is determined whether or not an unstable edge (difference edge) has been extracted as a result of the image overlay processing in step S49c. If an unstable edge has been extracted, the process proceeds to step S49e. If an unstable edge has not been extracted, the accuracy parameter adjustment process ends.
In step S49e, the minimum edge strength, which is an accuracy parameter, is adjusted so that unstable edges are eliminated. The minimum edge strength of the template parameter is adjusted so as to increase in order to delete the difference edge of the template. Further, the minimum edge strength of the search parameter is adjusted so that the value is decreased so as to eliminate unstable edges by increasing the number of extracted edge points and improving the degree of coincidence with the edges of the template image. The adjustment of the minimum edge strength is selected from the candidate values shown in Table 1 so as to be stricter by one step or gradual by one step based on the edge detection parameter value stored in the unstable edge list. Do that.

次にステップS49fでは、不安定エッジが無くなるように、精度パラメータであるエッジスケール値を調整し、精度パラメータ調整処理を終了する。テンプレートパラメータのエッジスケール値については、テンプレートの差異エッジを削除するべく、値が大きくなるよう調整する。また、サーチ用パラメータのエッジスケール値については、抽出されるエッジ点を増やし、テンプレート画像のエッジとの一致度合いを向上させることで不安定エッジを無くすよう、値が小さくなるよう調整する。なお、エッジスケール値の調整は、不安定エッジリストに格納されているエッジ検出パラメータ値を基準に、1段階厳しく若しくは1段階緩くなるよう、上述した表1に示す候補値の中から選択することで行う。
図6に戻って、ステップS50では、画像処理装置12は、精度パラメータ調整のリトライ回数に相当するリトライカウンタをインクリメントして、前記ステップS42に移行する。
Next, in step S49f, the edge scale value, which is a precision parameter, is adjusted so that unstable edges are eliminated, and the precision parameter adjustment process ends. The edge scale value of the template parameter is adjusted so as to increase the value in order to delete the difference edge of the template. Further, the edge scale value of the search parameter is adjusted so that the value is decreased so as to eliminate unstable edges by increasing the number of extracted edge points and improving the degree of coincidence with the edges of the template image. Note that the adjustment of the edge scale value is selected from the candidate values shown in Table 1 above so as to be one step stricter or one step gradual based on the edge detection parameter value stored in the unstable edge list. To do.
Returning to FIG. 6, in step S <b> 50, the image processing apparatus 12 increments the retry counter corresponding to the number of retries for accuracy parameter adjustment, and proceeds to step S <b> 42.

また、前記ステップS48で、精度パラメータ調整のリトライ回数が予め設定した最大回数に達したと判断すると、ステップS51に移行し、サーチ処理の精度が要求精度に達しなかったとして、その時点でのテンプレートパラメータを最終的なパラメータとして設定する。そして、そのパラメータをもとにテンプレートデータを作成し、最適パラメータ取得処理を終了する。   If it is determined in step S48 that the number of retries for adjusting the accuracy parameter has reached the preset maximum number, the process proceeds to step S51, where the accuracy of the search process has not reached the required accuracy. Set the parameter as the final parameter. Then, template data is created based on the parameters, and the optimum parameter acquisition process is terminated.

ステップS52では、画像処理装置12は、前記ステップS45で得られた統計データを解析し、エッジ検出タクトタイム、粗サーチタクトタイム、精サーチタクトタイムの3つについて、それぞれ目標タクトタイムに達しているか否かを判定する。ここで、各処理の目標タクトタイムは、要求タクトタイム値を、位置決め処理アルゴリズムを考慮して設定した内訳比率で配分することで設定する。そして、すべてのタクトタイムが目標タクトタイムに達している場合には、最適パラメータの取得に成功したものとして、ステップS53に移行する。そして、ステップS53では、画像処理装置12は、その時点でのテンプレートパラメータを最終的なパラメータとして設定し、そのパラメータをもとにテンプレートデータを作成してから、最適パラメータ取得処理を終了する。   In step S52, the image processing apparatus 12 analyzes the statistical data obtained in step S45, and whether the target tact time has been reached for each of the edge detection tact time, the coarse search tact time, and the fine search tact time. Determine whether or not. Here, the target tact time of each process is set by distributing the requested tact time value at a breakdown ratio set in consideration of the positioning process algorithm. If all the tact times have reached the target tact time, it is determined that the optimum parameter has been successfully acquired, and the process proceeds to step S53. In step S53, the image processing apparatus 12 sets the template parameter at that time as a final parameter, creates template data based on the parameter, and ends the optimum parameter acquisition process.

一方、前記ステップS52で、上記3つのタクトタイムのうち少なくとも1つのタクトタイムが目標タクトタイムに達していないと判断した場合には、ステップS54に移行してタクトタイムパラメータ調整処理を行う。
図9は、ステップS54で実行されるタクトタイムパラメータ調整処理手順を示すフローチャートである。
On the other hand, if it is determined in step S52 that at least one of the three tact times has not reached the target tact time, the process proceeds to step S54 to perform tact time parameter adjustment processing.
FIG. 9 is a flowchart showing the tact time parameter adjustment processing procedure executed in step S54.

先ずステップS54aで、エッジ検出タクトタイムが目標タクトタイムに達しているか否かを判定する。そして、目標タクトタイムに達していない場合には、エッジ検出タクトタイムの調整が必要であると判断してステップS54bに移行し、目標タクトタイムに達している場合には、エッジ検出タクトタイムの調整が不要であると判断して後述するステップS54cに移行する。   First, in step S54a, it is determined whether or not the edge detection tact time has reached the target tact time. If the target tact time has not been reached, it is determined that the edge detection tact time needs to be adjusted, and the process proceeds to step S54b. If the target tact time has been reached, the edge detection tact time is adjusted. Is determined to be unnecessary, and the process proceeds to step S54c described later.

ステップS54bでは、エッジ検出タクトタイムの調整を行う。エッジ検出タクトタイムは、フィルタサイズやエッジ候補点数に依存する。したがって、ここでは、テンプレートパラメータのエッジスケール値を小さくすると共に、テンプレートパラメータの最小エッジ強さを大きくすることで、エッジ検出タクトタイムを短縮する方向に調整する。
各パラメータの調整は、現在値を基準に1段階厳しく若しくは1段階緩くなるよう、上述した表1に示す候補値の中から選択することで行う。また、サーチ用パラメータについては、テンプレートパラメータより厳しくならないよう考慮して調整する。
In step S54b, the edge detection tact time is adjusted. The edge detection tact time depends on the filter size and the number of edge candidate points. Therefore, here, the edge scale value of the template parameter is decreased, and the minimum edge strength of the template parameter is increased to adjust the edge detection tact time in a direction to be shortened.
Adjustment of each parameter is performed by selecting from the candidate values shown in Table 1 described above so that one step is stricter or one step is lenient based on the current value. Further, the search parameters are adjusted in consideration of not being stricter than the template parameters.

次に、ステップS54cでは、粗サーチタクトタイムが目標タクトタイムに達しているか否かを判定する。そして、目標タクトタイムに達していない場合には、粗サーチタクトタイムの調整が必要であると判断してステップS54dに移行し、目標タクトタイムに達している場合には、粗サーチタクトタイムの調整が不要であると判断して後述するステップS54eに移行する。   Next, in step S54c, it is determined whether or not the rough search tact time has reached the target tact time. If the target tact time has not been reached, it is determined that the coarse search tact time needs to be adjusted, and the process proceeds to step S54d. If the target tact time has been reached, the coarse search tact time is adjusted. Is determined to be unnecessary, and the process proceeds to step S54e described later.

ステップS54dでは、粗サーチタクトタイムの調整を行う。粗サーチ処理は特徴点ベースで対象物をサーチするものであるため、粗サーチタクトタイムは、特徴点数、すなわち特徴点間距離に依存する。したがって、ここでは、テンプレートパラメータとして設定されている特徴点間距離を大きくすることで特徴点数を少なくし、粗サーチタクトタイムを短縮する方向に調整する。特徴点間距離の調整は、現在値に対して予め設定した所定の調整用加算値を加算することで行う。なお、このとき、特徴点間距離が予め設定した上限値を超えないよう考慮して調整する。   In step S54d, the coarse search tact time is adjusted. Since the coarse search process searches for an object on the basis of feature points, the coarse search tact time depends on the number of feature points, that is, the distance between feature points. Therefore, here, the distance between the feature points set as the template parameter is increased to reduce the number of feature points, and the coarse search tact time is adjusted to be shortened. The adjustment of the distance between feature points is performed by adding a predetermined adjustment addition value set in advance to the current value. At this time, adjustment is performed in consideration that the distance between feature points does not exceed a preset upper limit value.

次に、ステップS54eでは、精サーチタクトタイムが目標タクトタイムに達しているか否かを判定する。そして、目標タクトタイムに達していない場合には、精サーチタクトタイムの調整が必要であると判断してステップS54fに移行し、目標タクトタイムに達している場合には、精サーチタクトタイムの調整が不要であると判断してタクトタイムパラメータ調整処理を終了する。   Next, in step S54e, it is determined whether or not the fine search tact time has reached the target tact time. If the target tact time has not been reached, it is determined that the fine search tact time needs to be adjusted, and the process proceeds to step S54f. If the target tact time has been reached, the fine search tact time is adjusted. The tact time parameter adjustment process is terminated.

ステップS54fでは、精サーチタクトタイムの調整を行ってから、タクトタイムパラメータ調整処理を終了する。精サーチタクトタイムは、テンプレートデータに登録されているエッジ点数に依存する。したがって、ここでは、テンプレートパラメータの最大エッジ点数を小さくすることで、精サーチタクトタイムを短縮する方向に調整する。最大エッジ点数の調整は、現在値に対して予め設定した所定の調整用減算値を減算することで行う。これは、エッジ点がエッジ線上に均等に配置されるよう、間引き処理にてエッジ点の削減を行うことと等価であり、間引き点数を1,2,3,…の順に増やしていくことで、段階的にエッジ点数を削減するようにする。
ところで、精サーチ処理は、上述したように、テンプレートをサーチ対象画像に重ね、テンプレートの平行移動や回転移動、スケール変動を繰り返し行うことでサーチ対象画像内の対象物との一致度が最も高くなる位置を検出するものである。
In step S54f, the fine search tact time is adjusted, and then the tact time parameter adjustment process is terminated. The fine search tact time depends on the number of edge points registered in the template data. Therefore, here, the fine search tact time is adjusted to be shortened by reducing the maximum number of edge points of the template parameter. The maximum number of edge points is adjusted by subtracting a predetermined adjustment subtraction value set in advance from the current value. This is equivalent to reducing the edge points in the thinning process so that the edge points are evenly arranged on the edge line, and by increasing the number of thinning points in the order of 1, 2, 3,. Reduce the number of edge points step by step.
By the way, in the fine search process, as described above, the template is superimposed on the search target image, and the degree of coincidence with the target object in the search target image becomes the highest by repeatedly performing parallel movement, rotational movement, and scale fluctuation of the template. The position is detected.

ある特徴点は、サーチ対象画像上のエッジの近傍にあるとき、画像エネルギー(画像の濃度データをx,y方向それぞれに2階微分したもの)から力を受け、エッジに引き寄せられる。この画像エネルギーから受ける力が、その特徴点の平行移動ベクトルである。図10に示すように、特徴点の平行移動ベクトルgを、その特徴点とテンプレートの重心とを結ぶ直線(重心法線)方向を基準に垂直成分および水平成分に分解したとき、水平成分が拡大縮小ベクトルhとなり、垂直成分が回転ベクトルvとなる。本実施形態では、平行移動ベクトルg、回転ベクトルv及び拡大縮小ベクトルhを、それぞれ所定の補正係数を用いて移動量(平行移動量、回転角度、スケール変動量)に変換することで、1回のループ処理でのテンプレートの移動量を算出する。移動量は、下記(2)〜(4)式をもとに算出する。
m=Γ・γg・Σg ………(2)
θ=Γ・γθ・Σv/ΣRd ………(3)
scl=Γ・γscl・Σh/ΣRd ………(4)
When a certain feature point is in the vicinity of the edge on the search target image, it receives a force from the image energy (second-order differentiation of the image density data in the x and y directions) and is attracted to the edge. The force received from the image energy is the translation vector of the feature point. As shown in FIG. 10, when the translation vector g of a feature point is decomposed into a vertical component and a horizontal component with respect to a straight line (centroid normal) direction connecting the feature point and the center of gravity of the template, the horizontal component is expanded. A reduced vector h is obtained, and a vertical component is a rotation vector v. In the present embodiment, the translation vector g, the rotation vector v, and the enlargement / reduction vector h are each converted into a movement amount (a parallel movement amount, a rotation angle, and a scale fluctuation amount) using predetermined correction coefficients. The amount of movement of the template in the loop processing is calculated. The amount of movement is calculated based on the following formulas (2) to (4).
m = Γ · γg · Σg (2)
θ = Γ · γθ · Σv / ΣRd (3)
scl = Γ · γscl · Σh / ΣRd (4)

ここで、mは平行移動量(単位:画素)、θは回転角度(単位:rad)、sclはスケール変動量(単位:倍率)、Rdは重心−特徴点間距離である。また、Γは全体の補正係数(デフォルト値:0.2)、γgは平行移動の補正係数(デフォルト値:1.0)、γθは回転の補正係数(デフォルト値:1.0)、γsclは拡大縮小の補正係数(デフォルト値:0.007)である。
そして、平行移動ベクトルg、回転ベクトルv及び拡大縮小ベクトルhの大きさを足し合わせたエネルギー総和が、所定の収束判定閾値以下となるまでテンプレートの移動を繰り返し行う。
Here, m is a parallel movement amount (unit: pixel), θ is a rotation angle (unit: rad), scl is a scale variation amount (unit: magnification), and Rd is a center-to-feature point distance. Γ is an overall correction coefficient (default value: 0.2), γg is a translation correction coefficient (default value: 1.0), γθ is a rotation correction coefficient (default value: 1.0), and γscl is The enlargement / reduction correction coefficient (default value: 0.007).
Then, the template is repeatedly moved until the energy sum obtained by adding the sizes of the translation vector g, the rotation vector v, and the enlargement / reduction vector h is equal to or less than a predetermined convergence determination threshold value.

したがって、精サーチタクトタイムは、精サーチ処理のループ回数や、移動ベクトルを移動量に変換する際の補正係数(Γ、γg、γθ、γscl)に依存する。そこで、ここでは、上記ループ回数を小さくすると共に、上記補正係数を大きくすることで、精サーチタクトタイムを短縮する方向に調整する。ループ回数及び補正係数の調整は、現在値に対して所定の調整値を減算もしくは加算することで行う。当該調整値は適用環境に応じて設定するものとし、ループ回数及び補正係数が予め設定した限界値に達しないよう考慮して調整する。
図6に戻って、ステップS55では、画像処理装置12は、現時点で設定されているテンプレートパラメータを用いて、テンプレートデータの作成を行う。作成したテンプレートデータは、パラメータ格納部25に格納する。
Therefore, the fine search tact time depends on the number of loops of the fine search process and the correction coefficients (Γ, γg, γθ, γscl) for converting the movement vector into the movement amount. Therefore, here, the fine search tact time is adjusted to be shortened by reducing the number of loops and increasing the correction coefficient. The number of loops and the correction coefficient are adjusted by subtracting or adding a predetermined adjustment value to the current value. The adjustment value is set according to the application environment, and is adjusted in consideration of the number of loops and the correction coefficient not reaching preset limit values.
Returning to FIG. 6, in step S <b> 55, the image processing apparatus 12 creates template data using the template parameters set at the present time. The created template data is stored in the parameter storage unit 25.

次にステップS56では、画像処理装置12は、前記ステップS55で作成したテンプレートデータを用いて、すべてのサーチ評価画像についてサーチ処理が終了したか否かを判定する。そして、すべてのサーチ処理が終了していないと判断した場合にはステップS57に移行し、すべてのサーチ処理が終了していると判断した場合には後述するステップS60に移行する。
ステップS57では、画像処理装置12は、前記ステップS55で作成したテンプレートデータを用いて、同一評価姿勢の対象物を撮像した複数のサーチ評価画像について、それぞれサーチ処理を行い、位置決め処理結果を得る。
In step S56, the image processing apparatus 12 determines whether or not the search processing has been completed for all search evaluation images using the template data created in step S55. If it is determined that all search processes have not been completed, the process proceeds to step S57. If it is determined that all search processes have been completed, the process proceeds to step S60 described later.
In step S57, the image processing apparatus 12 performs a search process for each of the plurality of search evaluation images obtained by imaging the object in the same evaluation posture using the template data created in step S55, and obtains a positioning process result.

次にステップS58では、画像処理装置12は、前記ステップS57でのサーチ処理における、総処理タクトタイム、エッジ検出タクトタイム、粗サーチタクトタイム、精サーチタクトタイムの4つを計測し、ステップS59に移行する。
ステップS59では、画像処理装置12は、前記ステップS57で求めた位置決め処理結果について統計処理データを取得し、前記ステップS56に移行する。ここでは、テンプレートの中心座標(x,y)、最遠点座標(x,y)について、それぞれ平均値及び標準偏差(3σ)を求める。また、前記ステップS58で計測した4つのタクトタイムについても、それぞれ平均タクトタイム、最小タクトタイム、最大タクトタイムを求める。
Next, in step S58, the image processing apparatus 12 measures the total processing tact time, edge detection tact time, rough search tact time, and fine search tact time in the search processing in step S57, and then proceeds to step S59. Transition.
In step S59, the image processing apparatus 12 acquires statistical processing data for the positioning process result obtained in step S57, and proceeds to step S56. Here, an average value and a standard deviation (3σ) are obtained for the center coordinates (x, y) and the farthest point coordinates (x, y) of the template. For the four tact times measured in step S58, the average tact time, the minimum tact time, and the maximum tact time are obtained.

また、ステップS60では、画像処理装置12は、前記ステップS59で求めたテンプレートの中心座標の標準偏差(3σ)と最遠点座標の標準偏差(3σ)とが、それぞれ要求精度に応じた所定の許容範囲内であるか否かの評価を行う。
そして、ステップS61では、画像処理装置12は、前記ステップS60で各標準偏差(3σ)が許容範囲内であると判断した場合には、タクトタイムパラメータ調整処理を継続するものとして前記ステップS52に移行する。一方、許容範囲外であると判断した場合には、ステップS62に移行し、タクトタイムが目標タクトタイムに達する前にサーチ処理の精度が要求精度を下回ってしまったものとして、その時点でのテンプレートパラメータを最終的なパラメータとして設定する。そして、そのパラメータをもとにテンプレートデータを作成し、最適パラメータ取得処理を終了する。
In step S60, the image processing apparatus 12 determines whether the standard deviation (3σ) of the center coordinates of the template obtained in step S59 and the standard deviation (3σ) of the farthest point coordinates are predetermined according to the required accuracy. Evaluate whether it is within the allowable range.
In step S61, if the image processing apparatus 12 determines in step S60 that each standard deviation (3σ) is within the allowable range, the process proceeds to step S52 on the assumption that the tact time parameter adjustment process is continued. To do. On the other hand, if it is determined that the value is out of the allowable range, the process proceeds to step S62, and it is assumed that the accuracy of the search process has fallen below the required accuracy before the tact time reaches the target tact time. Set the parameter as the final parameter. Then, template data is created based on the parameters, and the optimum parameter acquisition process is terminated.

なお、図5において、ステップS31がテンプレート画像取得手段に対応し、ステップS32〜S34が評価用画像取得手段に対応している。また、図6において、ステップS42〜S50がパラメータ設定手段に対応し、ステップS52〜S61がパラメータ更新手段に対応している。さらに、図7において、ステップS49aが抽出手段に対応し、ステップS49b及びS49cが不安定エッジ抽出手段に対応し、ステップS49d〜49fがパラメータ徐変手段に対応している。   In FIG. 5, step S31 corresponds to the template image acquisition unit, and steps S32 to S34 correspond to the evaluation image acquisition unit. In FIG. 6, steps S42 to S50 correspond to parameter setting means, and steps S52 to S61 correspond to parameter updating means. Further, in FIG. 7, step S49a corresponds to the extraction means, steps S49b and S49c correspond to the unstable edge extraction means, and steps S49d to 49f correspond to the parameter gradual change means.

(動作)
次に、第2の実施形態の動作について説明する。
部品ロットが切り替わると、マシン制御装置11は、画像処理装置12に対してこれを通知する。このとき、マシン制御装置11は、画像処理装置12に対して、位置決め処理の要求精度や要求タクトタイムも送信する。
画像処理装置12がマシン制御装置11からインタフェース28を介して部品ロットの切り替わり通知を受信すると、前述した第1の実施形態と同様に、画像処理装置12は位置決め処理の精度及びタクトタイムを計測し、作業用メモリ24に保持している値と比較する。そして、計測した精度及びタクトタイムが、作業用メモリ24に保持している値に対して許容範囲を超えて悪化している場合、パラメータ格納部25に格納されたテンプレートデータ及びサーチ用パラメータを調整すべきであると判断し、最適パラメータ取得処理を実行する。
(Operation)
Next, the operation of the second embodiment will be described.
When the part lot is switched, the machine control device 11 notifies the image processing device 12 of this. At this time, the machine control device 11 also transmits the required accuracy of the positioning process and the required tact time to the image processing device 12.
When the image processing apparatus 12 receives the part lot change notification from the machine control apparatus 11 via the interface 28, the image processing apparatus 12 measures the accuracy and tact time of the positioning process as in the first embodiment. Compare with the value held in the work memory 24. If the measured accuracy and tact time have deteriorated beyond the allowable range with respect to the values held in the work memory 24, the template data and search parameters stored in the parameter storage unit 25 are adjusted. The optimum parameter acquisition process is executed.

最適パラメータ取得処理では、テンプレートパラメータ及びサーチ用パラメータを最適な値に調整する。本実施形態では、テンプレート画像を撮像すると共に(図5のステップS31)、所定の撮像条件で複数のサーチ評価画像を撮像する(ステップS32及びS33)。そして、初期状態のテンプレートデータを用いて、撮像した複数のサーチ評価画像についてサーチ処理を行い、繰り返し精度を計測して位置決め処理の精度が要求精度を満たしているかを判定する(図6のステップS43〜S47)。要求精度を満たしていない場合は、要求精度を満たすように位置決め処理の精度に関するパラメータ(最小エッジ強さ、エッジスケール)を調整する(ステップS49)。   In the optimum parameter acquisition process, the template parameter and the search parameter are adjusted to optimum values. In the present embodiment, a template image is captured (step S31 in FIG. 5), and a plurality of search evaluation images are captured under predetermined imaging conditions (steps S32 and S33). Then, using the template data in the initial state, search processing is performed on the plurality of captured search evaluation images, and iterative accuracy is measured to determine whether the positioning processing accuracy satisfies the required accuracy (step S43 in FIG. 6). To S47). If the required accuracy is not satisfied, parameters (minimum edge strength, edge scale) regarding the accuracy of the positioning process are adjusted so as to satisfy the required accuracy (step S49).

具体的には、複数のサーチ評価画像の中から相対的なエッジの変動量が最も大きくなる2枚のサーチ評価画像を抽出し(図7のステップS49a)、その2枚のサーチ評価画像とテンプレート画像とを重ね合わせることで不安定エッジを抽出する(ステップS49b及びS49c)。そして、不安定エッジに対応するテンプレートのエッジ部分が削除されるように、テンプレートパラメータの最小エッジ強さ及びエッジスケールを調整すると共に、サーチ処理にて不安定エッジが安定してサーチできるように、サーチ用パラメータの最小エッジ強さ及びエッジスケールを調整する(ステップS49e,S49f)。   Specifically, two search evaluation images having the largest relative edge variation are extracted from a plurality of search evaluation images (step S49a in FIG. 7), and the two search evaluation images and the template are extracted. Unstable edges are extracted by overlapping the image (steps S49b and S49c). Then, the minimum edge strength and the edge scale of the template parameter are adjusted so that the edge portion of the template corresponding to the unstable edge is deleted, and the unstable edge can be stably searched in the search process. The minimum edge strength and edge scale of the search parameters are adjusted (steps S49e and S49f).

精度に関するパラメータの調整が終了すると、次にタクトタイムに関するパラメータの調整を行う。ここでは、タクトタイムが要求タクトタイムを満たしているかを判定し(図6のステップS52)、要求タクトタイムを満たしていない場合に、要求タクトタイムを満たすように位置決め処理のタクトタイムに関するパラメータ(最小エッジ強さ、エッジスケール値、特徴点間距離、最大エッジ点数、ループ回数、移動量補正係数)を調整する(ステップS54)。   When the adjustment of the parameter related to accuracy is completed, the parameter related to the tact time is adjusted next. Here, it is determined whether or not the tact time satisfies the required tact time (step S52 in FIG. 6). If the required tact time is not satisfied, a parameter (minimum) regarding the tact time of the positioning process so as to satisfy the required tact time. Edge strength, edge scale value, distance between feature points, maximum number of edge points, number of loops, movement amount correction coefficient are adjusted (step S54).

具体的には、最小エッジ強さ及びエッジスケール値を徐々にエッジ検出タクトタイムが短縮する方向へ変化させていき、要求精度を保てる限界値を最適なパラメータ値とする。また、特徴点間距離を徐々に粗サーチタクトタイムが短縮する方向へ変化させていき、要求精度を保てる限界値を最適なパラメータ値とする。さらに、最大エッジ点数、ループ回数及び移動量補正係数を、精サーチタクトタイムが短縮する方向へ変化させていき、要求精度を保てる限界値を最適なパラメータ値とする。このように、要求精度を保つことのできる限界タクトタイムでエッジ検出、粗サーチ及び精サーチを行うように、各パラメータ値を調整する(ステップS55〜S61)。   Specifically, the minimum edge strength and the edge scale value are gradually changed in a direction that shortens the edge detection tact time, and the limit value that can maintain the required accuracy is set as the optimum parameter value. Also, the distance between feature points is gradually changed in a direction that shortens the coarse search tact time, and the limit value that can maintain the required accuracy is set as the optimum parameter value. Furthermore, the maximum number of edge points, the number of loops, and the movement amount correction coefficient are changed in a direction that shortens the fine search tact time, and the limit value that can maintain the required accuracy is set as the optimum parameter value. As described above, the parameter values are adjusted so that the edge detection, the coarse search, and the fine search are performed with the limit tact time that can maintain the required accuracy (steps S55 to S61).

(効果)
このように、上記第2の実施形態では、実際のサーチ対象画像の変動範囲を示す複数の撮像条件でサーチ評価画像を撮像し、撮像したサーチ評価画像をもとにパラメータ調整を行うので、ロバスト性の高いテンプレートデータを作成することができる。したがって、他のマシンへも調整不要でテンプレートを展開することができる。
また、パラメータ調整を行う際には、コントラストが弱いエッジ等、撮像条件によってエッジ検出結果が不安定となる部位については、サーチ処理の対象から除外するようにパラメータを調整する。したがって、要求精度を満たす最適なパラメータ設定が可能となる。
(effect)
As described above, in the second embodiment, the search evaluation image is captured under a plurality of imaging conditions indicating the actual fluctuation range of the search target image, and parameter adjustment is performed based on the captured search evaluation image. It is possible to create highly template data. Therefore, the template can be expanded to other machines without adjustment.
Further, when performing parameter adjustment, parameters such as edges with weak contrast are adjusted so as to exclude portions where the edge detection result is unstable depending on the imaging conditions from the search processing target. Therefore, it is possible to set an optimum parameter that satisfies the required accuracy.

このとき、テンプレートパラメータのうち最小エッジ強さを大きくしたり、エッジスケール値を小さくしたりするので、テンプレート画像からテンプレートデータを作成する際に不安定エッジを抽出しないようにすることができ、不安定エッジを確実にサーチ処理の対象から除外することができる。また、同様に、サーチ用パラメータのうち最小エッジ強さを小さくしたり、エッジスケール値を大きくしたりするので、サーチ対象画像からエッジを抽出する際に不安定エッジを抽出しないようにすることができ、不安定エッジを確実にサーチ処理の対象から除外することができる。   At this time, since the minimum edge strength among the template parameters is increased or the edge scale value is decreased, it is possible to prevent unstable edges from being extracted when creating template data from the template image. Stable edges can be reliably excluded from search processing targets. Similarly, since the minimum edge strength among the search parameters is reduced or the edge scale value is increased, it is possible not to extract unstable edges when extracting edges from the search target image. It is possible to reliably exclude the unstable edge from the search processing target.

さらに、パラメータ調整を行う際には、エッジ検出処理、粗サーチ処理及び精サーチ処理のタクトタイムに関するパラメータを、各処理のタクトタイムがそれぞれ短縮する方向に調整することができる。これにより、より最適なパラメータ調整が可能となる。
このとき、最小エッジ強さを大きくしたりエッジスケール値を小さくしたりするので、確実にエッジ検出タクトタイムを短縮することができる。また、特徴点間距離を大きくするので、確実に粗サーチタクトタイムを短縮することができる。さらに、最大エッジ点数を削減したり、精サーチ処理のループ回数を少なくしたり、精サーチ処理において移動ベクトルを移動量に変換する際の補正係数を大きくしたりするので、確実に精サーチタクトタイムを短縮することができる。
Furthermore, when performing parameter adjustment, the parameters relating to the tact time of the edge detection process, the coarse search process, and the fine search process can be adjusted in a direction in which the tact time of each process is shortened. Thereby, more optimal parameter adjustment is possible.
At this time, since the minimum edge strength is increased or the edge scale value is decreased, the edge detection tact time can be surely shortened. Further, since the distance between the feature points is increased, the coarse search tact time can be surely shortened. In addition, since the maximum number of edge points is reduced, the number of loops of the fine search process is reduced, and the correction coefficient when converting the movement vector to the movement amount in the fine search process is increased, the fine search tact time is reliably ensured. Can be shortened.

1…部品実装装置、2…電子部品、3…吸着ノズル、4…照明装置、5a…標準カメラ、5b…高解像度カメラ、6…マンマシンインタフェース、7…モニタ、11…マシン制御装置、12…画像処理装置、21…A/D変換部、22…画像メモリ、23…演算部、24…作業用メモリ、25…パラメータ格納部、26…制御部、27…並列演算部、28…インタフェース、29…D/A変換部   DESCRIPTION OF SYMBOLS 1 ... Component mounting apparatus, 2 ... Electronic component, 3 ... Adsorption nozzle, 4 ... Illumination device, 5a ... Standard camera, 5b ... High resolution camera, 6 ... Man-machine interface, 7 ... Monitor, 11 ... Machine control apparatus, 12 ... Image processing device 21... A / D conversion unit 22... Image memory 23... Arithmetic unit 24 .. working memory 25 .. parameter storage unit 26 .. control unit 27. ... D / A converter

Claims (6)

形状ベースマッチング処理に用いるパラメータの調整を行う形状ベースマッチングパラメータの調整装置であって、
形状ベースマッチング処理の要求精度および要求タクトタイムを指定する指定手段と、
基準姿勢に対して任意の変動を加えた姿勢の対象物の画像を、前記パラメータの評価用画像として取得する評価用画像取得手段と、
前記評価用画像取得手段で取得した前記評価用画像をもとに前記パラメータを調整するパラメータ調整手段と、
を備え、
前記パラメータ調整手段は、
形状ベースマッチングの処理の精度が、前記指定手段でユーザが指定した要求精度を満たすように、前記パラメータを自動設定するパラメータ設定手段と、
前記パラメータ設定手段で設定した前記パラメータを用いて、前記評価用画像に対して形状ベースマッチング処理を行った結果、タクトタイムが、前記指定手段でユーザが指定した要求タクトタイムを満たしていないとき、当該タクトタイムが短縮する方向に前記パラメータ設定手段で設定した前記パラメータを徐変しながら形状ベースマッチング処理の精度を評価し、当該精度が前記要求精度を保てる限界のパラメータ値に前記パラメータを更新するパラメータ更新手段と、を備え、
前記対象物を撮像する撮像手段と、
前記撮像手段で基準姿勢の前記対象物を撮像し、これをテンプレート画像として取得するテンプレート画像取得手段と、を備え、
前記評価用画像取得手段は、
前記撮像手段で基準姿勢に対して任意の変動を加えた姿勢の前記対象物を複数撮像し、これらを前記評価用画像として取得し、
前記パラメータ設定手段は、
前記評価用画像取得手段で取得した同一撮像条件での複数の評価用画像から、相対的なエッジの変動量が最も大きい2枚の評価用画像を抽出する抽出手段と、
前記抽出手段で抽出した2枚の評価用画像のエッジの一致度が所定の判定閾値よりも低い不安定エッジを抽出する不安定エッジ抽出手段と、
前記不安定エッジ抽出手段で抽出した不安定エッジに対応するエッジ部位を、形状ベースマッチング処理の対象から除外する方向に前記パラメータを徐変しながら形状ベースマッチング処理の精度を評価し、当該精度が前記要求精度を満たすパラメータ値を前記パラメータとして決定するパラメータ徐変手段と、を備えることを特徴とする形状ベースマッチングパラメータの調整装置。
A shape-based matching parameter adjusting device that adjusts parameters used for shape-based matching processing,
A specifying means for specifying the required accuracy and required tact time of the shape-based matching process;
Evaluation image acquisition means for acquiring an image of a target object having an arbitrary variation with respect to a reference posture as an evaluation image of the parameter;
Parameter adjusting means for adjusting the parameter based on the evaluation image acquired by the evaluation image acquiring means;
With
The parameter adjusting means includes
Parameter setting means for automatically setting the parameters so that the accuracy of the shape-based matching process satisfies the required precision specified by the user with the specifying means;
As a result of performing shape-based matching processing on the evaluation image using the parameters set by the parameter setting means, when the tact time does not satisfy the required tact time specified by the user by the specifying means, The accuracy of the shape base matching process is evaluated while gradually changing the parameter set by the parameter setting means in a direction that shortens the tact time, and the parameter is updated to a parameter value that is the limit that the accuracy can maintain the required accuracy. Parameter updating means,
Imaging means for imaging the object;
A template image acquisition unit that images the target object in a reference posture with the imaging unit and acquires the target image as a template image;
The evaluation image acquisition means includes
A plurality of images of the object in a posture obtained by adding an arbitrary change with respect to a reference posture by the imaging means, and acquiring these as the evaluation image,
The parameter setting means includes
Extraction means for extracting two evaluation images having the largest relative edge variation amount from a plurality of evaluation images under the same imaging condition acquired by the evaluation image acquisition means;
Unstable edge extraction means for extracting unstable edges whose degree of coincidence between the two evaluation images extracted by the extraction means is lower than a predetermined determination threshold;
The accuracy of the shape base matching process is evaluated while gradually changing the parameter in a direction to exclude the edge portion corresponding to the unstable edge extracted by the unstable edge extracting means from the target of the shape base matching process. And a parameter gradual change means for determining a parameter value satisfying the required accuracy as the parameter.
前記パラメータは、前記テンプレート画像から前記対象物のエッジ点の座標とエッジ勾配ベクトルとで構成されるテンプレートデータを作成する際に用いるテンプレートパラメータと、前記テンプレートデータをもとにサーチ対象画像から前記対象物を検出する際に用いるサーチ用パラメータとを含み、
前記パラメータ徐変手段は、前記不安定エッジ抽出手段で抽出した不安定エッジに対応するエッジ部位を、前記テンプレートデータから除外する方向に前記テンプレートパラメータを徐変することを特徴とする請求項1に記載の形状ベースマッチングパラメータの調整装置。
The parameters are template parameters used when creating template data composed of coordinates of edge points of the object and edge gradient vectors from the template image, and the object from the search object image based on the template data. Including search parameters used when detecting objects,
The said parameter gradual change means gradually changes the said template parameter in the direction which excludes the edge part corresponding to the unstable edge extracted by the said unstable edge extraction means from the said template data. Apparatus for adjusting shape-based matching parameter as described.
前記パラメータは、前記テンプレート画像から前記対象物のエッジ点の座標とエッジ勾配ベクトルとで構成されるテンプレートデータを作成する際に用いるテンプレートパラメータと、前記テンプレートデータをもとにサーチ対象画像から前記対象物を検出する際に用いるサーチ用パラメータとを含み、
前記パラメータ徐変手段は、前記不安定エッジ抽出手段で抽出した不安定エッジに対応するエッジ部位を、前記サーチ対象画像から検出し難い方向に前記サーチ用パラメータを徐変することを特徴とする請求項1又は2に記載の形状ベースマッチングパラメータの調整装置。
The parameters are template parameters used when creating template data composed of coordinates of edge points of the object and edge gradient vectors from the template image, and the object from the search object image based on the template data. Including search parameters used when detecting objects,
The parameter gradual change means gradually changes the search parameter in a direction in which an edge portion corresponding to the unstable edge extracted by the unstable edge extraction means is difficult to detect from the search target image. Item 3. The apparatus for adjusting a shape-based matching parameter according to Item 1 or 2.
形状ベースマッチング処理の精度は、前記複数の評価用画像に対して形状ベースマッチング処理を行った結果を統計処理した繰り返し精度で評価することを特徴とする請求項1〜3の何れか1項に記載の形状ベースマッチングパラメータの調整装置。   The accuracy of the shape base matching process is evaluated with a repetition accuracy obtained by statistically processing a result of performing the shape base matching process on the plurality of evaluation images. Apparatus for adjusting shape-based matching parameter as described. 形状ベースマッチング処理は、サーチ対象画像に対してエッジ検出処理を行った結果に対して粗サーチ処理を行い、当該粗サーチ処理の結果をもとに精サーチ処理を行うものであって、
前記パラメータ更新手段は、前記エッジ検出処理、前記粗サーチ処理及び前記精サーチ処理のタクトタイムがそれぞれ短縮する方向に、当該各処理で用いる前記パラメータを徐変しながら形状ベースマッチング処理の精度を評価し、当該精度が前記要求精度を保てる限界のパラメータ値に前記パラメータを更新することを特徴とする請求項1〜4の何れか1項に記載の形状ベースマッチングパラメータの調整装置。
The shape-based matching process performs a rough search process on the result of the edge detection process on the search target image, and performs a fine search process based on the result of the rough search process.
The parameter updating means evaluates the accuracy of the shape-based matching process while gradually changing the parameters used in each of the processes in such a direction that the tact times of the edge detection process, the coarse search process, and the fine search process are shortened. The shape-based matching parameter adjusting apparatus according to claim 1, wherein the parameter is updated to a parameter value whose limit is such that the accuracy can maintain the required accuracy.
吸着ノズルにより電子部品を吸着し、基板上の所定位置に当該電子部品を装着する部品実装装置であって、
前記請求項1〜5の何れか1項に記載の形状ベースマッチングパラメータの調整装置と、
形状ベースマッチング処理に用いるパラメータを記憶する記憶手段と、
前記吸着ノズルによって吸着した電子部品の画像を撮像し、これをサーチ対象画像として取得するサーチ対象画像取得手段と、
前記サーチ対象画像取得手段で取得したサーチ対象画像に対して、前記記憶手段に記憶されたパラメータを用いて形状ベースマッチング処理を行い、前記電子部品の搭載位置決めを行う位置決め手段と、
部品ロットの切り替わりを検知する検知手段と、
前記検知手段で部品ロットの切り替わりを検知したとき、前記記憶手段に記憶されたパラメータの調整の要否を判断する判断手段と、を備え、
前記判断手段で前記パラメータの調整が必要であると判断したとき、前記形状ベースマッチングパラメータの調整装置によって前記パラメータの調整を行うことを特徴とする部品実装装置。
A component mounting apparatus that sucks an electronic component by a suction nozzle and mounts the electronic component at a predetermined position on a substrate,
The shape-based matching parameter adjusting device according to any one of claims 1 to 5,
Storage means for storing parameters used for shape-based matching processing;
A search target image acquisition means for capturing an image of an electronic component sucked by the suction nozzle and acquiring the image as a search target image;
A positioning unit that performs a shape-based matching process on the search target image acquired by the search target image acquisition unit using a parameter stored in the storage unit, and performs mounting positioning of the electronic component;
A detecting means for detecting a change of parts lot;
A determination means for determining whether or not adjustment of a parameter stored in the storage means is necessary when the detection means detects a change of a part lot;
The component mounting apparatus, wherein when the determination unit determines that the parameter needs to be adjusted, the shape adjustment parameter adjustment apparatus adjusts the parameter.
JP2010214489A 2010-09-24 2010-09-24 Shape-based matching parameter adjustment device and component mounting device Active JP5759133B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2010214489A JP5759133B2 (en) 2010-09-24 2010-09-24 Shape-based matching parameter adjustment device and component mounting device
CN201110288632.9A CN102421279B (en) 2010-09-24 2011-09-22 The shape basis adjusting device of match parameter, method of adjustment and apparatus for mounting component

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010214489A JP5759133B2 (en) 2010-09-24 2010-09-24 Shape-based matching parameter adjustment device and component mounting device

Publications (2)

Publication Number Publication Date
JP2012069003A JP2012069003A (en) 2012-04-05
JP5759133B2 true JP5759133B2 (en) 2015-08-05

Family

ID=45945431

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010214489A Active JP5759133B2 (en) 2010-09-24 2010-09-24 Shape-based matching parameter adjustment device and component mounting device

Country Status (2)

Country Link
JP (1) JP5759133B2 (en)
CN (1) CN102421279B (en)

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014002813A1 (en) * 2012-06-26 2014-01-03 コニカミノルタ株式会社 Image processing device, image processing method, and image processing program
JP6370038B2 (en) 2013-02-07 2018-08-08 キヤノン株式会社 Position and orientation measurement apparatus and method
JP6418739B2 (en) * 2014-01-09 2018-11-07 ヤマハ発動機株式会社 Evaluation device, surface mounter, evaluation method
JP6413071B2 (en) * 2014-07-17 2018-10-31 パナソニックIpマネジメント株式会社 Component mounting method and component mounting system
BR112019011836A2 (en) * 2016-12-13 2019-10-22 Koninklijke Philips Nv method for modifying a contour, method for creating a contour, computer program product, and apparatus for modifying a contour
EP3404583A1 (en) 2017-05-19 2018-11-21 MVTec Software GmbH System and method for model adaptation
JP6897431B2 (en) * 2017-08-30 2021-06-30 オムロン株式会社 Image processing device, setting support method, and setting support program
JP7088809B2 (en) * 2018-11-06 2022-06-21 ヤマハ発動機株式会社 Work work device, work work system, and control method of work work device
WO2020194979A1 (en) * 2019-03-28 2020-10-01 パナソニックIpマネジメント株式会社 Production data creation device and production data creation method
CN113361553B (en) * 2020-03-06 2024-02-02 株式会社理光 Image processing method, image processing apparatus, storage medium, and system
US11816754B2 (en) 2020-03-13 2023-11-14 Omron Corporation Measurement parameter optimization method and device, and computer control program stored on computer-readable storage medium
CN113378886B (en) * 2021-05-14 2022-11-08 珞石(山东)智能科技有限公司 Method for automatically training shape matching model
WO2023162476A1 (en) * 2022-02-28 2023-08-31 パナソニックIpマネジメント株式会社 Feature registration device and feature registration method

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000260699A (en) * 1999-03-09 2000-09-22 Canon Inc Position detector and semiconductor aligner employing the same
JP2002140693A (en) * 2000-10-31 2002-05-17 Keyence Corp Image processing parameter determination device, its method and recording medium with recorded image processing parameter determination program
JP2003042970A (en) * 2001-07-31 2003-02-13 Matsushita Electric Ind Co Ltd Visual inspection device and visual inspection method for mounting board
JP3834297B2 (en) * 2003-05-12 2006-10-18 ファナック株式会社 Image processing device
JP4470503B2 (en) * 2004-01-30 2010-06-02 株式会社ニコン Reference pattern determination method and apparatus, position detection method and apparatus, and exposure method and apparatus
JP2007004829A (en) * 2006-09-11 2007-01-11 Mitsubishi Electric Corp Image processing device
JP5160366B2 (en) * 2008-10-10 2013-03-13 Juki株式会社 Pattern matching method for electronic parts

Also Published As

Publication number Publication date
CN102421279B (en) 2016-04-13
CN102421279A (en) 2012-04-18
JP2012069003A (en) 2012-04-05

Similar Documents

Publication Publication Date Title
JP5759133B2 (en) Shape-based matching parameter adjustment device and component mounting device
JP5075757B2 (en) Image processing apparatus, image processing program, image processing method, and electronic apparatus
US8581162B2 (en) Weighting surface fit points based on focus peak uncertainty
JP5074322B2 (en) Image processing apparatus, image processing method, image processing program, and imaging apparatus
CN101122457A (en) Image border scanning system and method
CN106707674A (en) Automatic focusing method of projection equipment and the projection equipment
JP2013197918A5 (en)
JP6309694B2 (en) Mark having design of focus and tilt correction and alignment method thereof
US11620732B2 (en) Multi-projection system, image projection method and projector
US10996569B2 (en) Measurement device, method and display device
CN106289678B (en) A kind of bent detection device of cylindrical body abnormity drum and recognition methods
CN114289332A (en) Visual identification and positioning method and device for workpiece sorting and sorting system
TW202300896A (en) Sample observation device and method
JP4933961B2 (en) Camera module focus adjustment apparatus and focus adjustment method
JP4943228B2 (en) Image matching processing method
JP3684799B2 (en) Device for detecting displacement amount of stop position of moving object
JP2021111929A (en) Imaging device, control method of imaging device, and program
CN115020174A (en) Method for measuring and monitoring actual pixel size of charged particle beam scanning imaging equipment
CN113079318B (en) System and method for automatically focusing edge defects and computer storage medium
JP6025400B2 (en) Work position detection device and work position detection method
US11528410B2 (en) Calibration operation support device for industrial camera
CN107959767B (en) Focusing and dimming method using television tracking result as guide
CN113808212A (en) Line scanning image synchronization calibration method and system
US20080008381A1 (en) Coordinate acquisition apparatus for test of printed board, and coordinate acquisition method and program for test thereof
CN112085799A (en) Power equipment autonomous registration method and system

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20130821

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140314

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140415

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140612

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20141111

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20141226

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: 20150519

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20150605

R150 Certificate of patent or registration of utility model

Ref document number: 5759133

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150