JP2020169962A - Image inspection system - Google Patents

Image inspection system Download PDF

Info

Publication number
JP2020169962A
JP2020169962A JP2019072977A JP2019072977A JP2020169962A JP 2020169962 A JP2020169962 A JP 2020169962A JP 2019072977 A JP2019072977 A JP 2019072977A JP 2019072977 A JP2019072977 A JP 2019072977A JP 2020169962 A JP2020169962 A JP 2020169962A
Authority
JP
Japan
Prior art keywords
setting
image
inspection
unit
image pickup
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2019072977A
Other languages
Japanese (ja)
Other versions
JP7306857B2 (en
Inventor
佐藤 秀明
Hideaki Sato
秀明 佐藤
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.)
Keyence Corp
Original Assignee
Keyence 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 Keyence Corp filed Critical Keyence Corp
Priority to JP2019072977A priority Critical patent/JP7306857B2/en
Publication of JP2020169962A publication Critical patent/JP2020169962A/en
Application granted granted Critical
Publication of JP7306857B2 publication Critical patent/JP7306857B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

To provide an image inspection system capable of facilitating implementation to easily output ledger sheets while preventing the settings from being restored by mistake when exchanging ledger sheets between an imaging apparatus conforming to the standard and a setting apparatus.SOLUTION: A setting apparatus is configured to output a ledger sheet that includes setting items each described according to the setting order based on the dependent relationship between the setting items and multiple categories, which are formed by classifying multiple setting items, and which have a dependent relationship where the validity or value of the other setting item changes depending on the setting of one setting item, according to their relevance.SELECTED DRAWING: Figure 28

Description

本発明は、例えばワーク等の検査対象物を検査する画像検査システムに関する。 The present invention relates to an image inspection system that inspects an inspection object such as a work.

従来より、検査対象物の三次元形状を計測し、計測結果に基づいて検査対象物の良否を判定するように構成された画像検査システムが知られている。特許文献1に開示された画像検査システムは、照明方向が異なる複数の輝度画像から検査対象物の表面の法線ベクトルを求め、この法線ベクトルに基づき検査対象物の表面形状を示す形状画像を生成する、いわゆるフォトメトリックステレオの原理を利用しており、フォトメトリックステレオの原理に基づいて生成された形状を示す検査画像を用いて検査対象物の良否を判定している。特許文献1では、検査画像にパターンサーチを実行して検査領域を設定した後、検査領域の位置補正を行い、その後、傷の有無を検査するようにしている。 Conventionally, there has been known an image inspection system configured to measure the three-dimensional shape of an inspection object and determine the quality of the inspection object based on the measurement result. The image inspection system disclosed in Patent Document 1 obtains a normal vector of the surface of an inspection object from a plurality of luminance images having different illumination directions, and obtains a shape image showing the surface shape of the inspection object based on this normal vector. The so-called photometric stereo principle of generation is used, and the quality of the inspection object is judged by using the inspection image showing the shape generated based on the principle of photometric stereo. In Patent Document 1, after performing a pattern search on the inspection image to set the inspection area, the position of the inspection area is corrected, and then the presence or absence of scratches is inspected.

このような画像検査システムは、例えばパーソナルコンピュータ等からなる制御装置と、制御装置に接続されたカメラとを備えており、制御装置がカメラを制御し、カメラで撮像した画像を制御装置が取得して各種画像処理や判定処理を行うように構成されているのが一般的である。このようなシステムにおいて適切な撮像をカメラで行うためにはカメラの露光時間やアナログゲインなどの設定値を状況や検査対象物に応じて変更する必要があり、これら各設定項目の設定値は制御装置から通信経路を経て変更することが可能になっている。ところが、各設定項目と、その設定値を保持するレジスタのアドレスとの対応関係は、カメラの機種毎、カメラのメーカー毎に異なっているのが通常であり、例えばカメラを別の機種に変更しようとすると、画像検査アプリケーションのプログラム修正やドライバソフトウェアの再インストールなど、多くの手間を伴うことになる。 Such an image inspection system includes, for example, a control device including a personal computer and a camera connected to the control device. The control device controls the camera, and the control device acquires an image captured by the camera. It is generally configured to perform various image processing and determination processing. In order to perform appropriate imaging with a camera in such a system, it is necessary to change the setting values such as the exposure time and analog gain of the camera according to the situation and the inspection target, and the setting values of each of these setting items are controlled. It is possible to change from the device via the communication path. However, the correspondence between each setting item and the address of the register that holds the set value is usually different for each camera model and camera manufacturer. For example, let's change the camera to another model. If this is the case, it will take a lot of time and effort to modify the program of the image inspection application and reinstall the driver software.

そこで、近年、制御装置とカメラとの接続インターフェースの標準化規格としてGenICam規格が策定され、制御装置で構築する画像検査アプリケーションからカメラを制御したり、カメラで撮像した画像を取得するインターフェースについて、GenICam(登録商標)規格を満たしたカメラとアプリケーション間で標準化することが行われている。 Therefore, in recent years, the GenICam standard has been established as a standardization standard for the connection interface between the control device and the camera. Regarding the interface for controlling the camera from the image inspection application constructed by the control device and acquiring the image captured by the camera, GenICam ( Standardization is being carried out between cameras and applications that meet the (registered trademark) standard.

また、標準化規格を満たしたカメラでは、設定内容をテキスト形式で書き出した帳票が利用されている。帳票の各設定項目は、設定名と設定値の組で表現され、これがリスト形式で羅列されて帳票が構成されている。 In addition, cameras that meet the standardization standards use forms in which the settings are written out in text format. Each setting item of the form is represented by a set of a setting name and a set value, and these are listed in a list format to form a form.

特開2015−232481号公報JP 2015-232481

ところで、GenICam規格などに対応した画像検査アプリケーションとカメラの接続インターフェースを用いることで、カメラの機種選定の自由度が向上するといったメリットがある。 By the way, by using an image inspection application compatible with the GenICam standard and a camera connection interface, there is an advantage that the degree of freedom in selecting a camera model is improved.

一方で、標準化規格を満たしたカメラと画像検査アプリケーションとの接続インターフェースの場合、設定項目をカメラ側から画像検査アプリケーション側に対してテキスト形式で出力して画像検査アプリケーション側で管理・保存しておき、必要に応じて画像検査アプリケーション側からカメラ側に対して書き戻せるようにしておく必要がある。 On the other hand, in the case of a connection interface between a camera that meets the standard and an image inspection application, the setting items are output from the camera side to the image inspection application side in text format and managed and saved on the image inspection application side. , It is necessary to be able to write back from the image inspection application side to the camera side as needed.

ここで、標準化規格を満たしたカメラに対して、特許文献1のように照明方向が異なる複数の輝度画像を撮像して合成するといった複数の処理を行わせようとした場合、複数の設定項目に順序が必要になり、帳票の設定項目の構造が複雑化することが考えられる。設定項目の構造が複雑化した帳票をカメラと画像検査アプリケーションとの間でやり取りさせようとすると、帳票出力処理の実装自体が困難になるとともに、設定内容が誤って復元されてしまう可能性が高くなる。 Here, when a camera satisfying the standardization standard is to be subjected to a plurality of processes such as capturing and synthesizing a plurality of luminance images having different illumination directions as in Patent Document 1, a plurality of setting items are used. It is conceivable that the order will be required and the structure of the form setting items will be complicated. If you try to exchange a form with a complicated structure of setting items between the camera and the image inspection application, it will be difficult to implement the form output processing itself, and there is a high possibility that the setting contents will be restored by mistake. Become.

本発明は、かかる点に鑑みてなされたものであり、その目的とするところは、標準化規格に適合した撮像装置と設定装置との間で帳票のやり取りを行う際に、簡単に帳票出力可能にして実装の容易化を図るとともに、設定内容が誤って復元されないようにすることにある。 The present invention has been made in view of the above points, and an object of the present invention is to enable easy form output when exchanging forms between an imaging device and a setting device conforming to a standardization standard. The purpose is to facilitate implementation and prevent accidental restoration of settings.

上記目的を達成するために、第1の発明は、検査対象物を撮像する画像検査装置用撮像装置と、前記撮像装置とネットワークを介して接続され、当該撮像装置の設定項目と各設定項目の設定値が格納される場所を示すレジスタ情報とが記述されたファイルを外部から取得し、使用者により設定された各設定項目の設定値と、前記ファイルに含まれる各設定項目に対応するレジスタ情報を示すデータを前記撮像装置に送信し、当該撮像装置の設定を行う設定装置とを備えた画像検査システムであって、前記設定装置は、一方の設定項目の設定により他方の設定項目の有効性又は値が変化する依存関係を有する複数の設定項目を関連度に応じて分類することによって形成された複数のカテゴリ間と、各設定項目間との依存関係に基づいて、設定順序に従って前記各設定項目が記述された帳票を出力するように構成されていることを特徴とする。 In order to achieve the above object, the first invention is connected to an image pickup device for an image inspection device that images an inspection object, the image pickup device, and the setting items of the image pickup device and each setting item. A file that describes the register information indicating the location where the setting value is stored is acquired from the outside, and the setting value of each setting item set by the user and the register information corresponding to each setting item included in the file are obtained. An image inspection system including a setting device that transmits data indicating the above to the imaging device and sets the imaging device. The setting device determines the effectiveness of the other setting item by setting one setting item. Alternatively, each of the above settings is made according to the setting order based on the dependency between a plurality of categories formed by classifying a plurality of setting items having a dependency relationship whose value changes according to the degree of relevance and between each setting item. It is characterized in that it is configured to output a form in which items are described.

この構成によれば、撮像装置とネットワークを介して接続された設定装置の両方が共通の標準化規格に適合している場合には、撮像装置の設定項目と、各設定項目の設定値が格納される場所を示すレジスタ情報とが記述されたファイルを設定装置が例えば撮像装置から取得する。このファイルは、例えば標準化規格がGenICam規格である場合には、Device XMLファイルなどである。このファイルは、設定装置が撮像装置から取得してもよいし、例えばウェブサイト等からダウンロードして別ファイルとしてGenApiに対して参照するファイルを指定するようにしてもよい。 According to this configuration, when both the image pickup device and the setting device connected via the network conform to a common standard, the setting items of the image pickup device and the setting values of each setting item are stored. The setting device acquires, for example, a file in which the register information indicating the location is described from the image pickup device. This file is, for example, a Device XML file when the standardization standard is the GenICam standard. This file may be acquired by the setting device from the imaging device, or may be downloaded from a website or the like and a file to be referred to GenApi may be specified as a separate file.

一方の設定項目により他方の設定項目の有効性又は値が変化する依存関係を有する複数の設定項目が関連度に応じて複数のカテゴリに分類されているので、構造が分かり易くなる。帳票には、複数のカテゴリ間と、各設定項目間との依存関係に基づいて、設定順序に従って各設定項目が記述されているので、帳票が簡単になるとともに、設定内容が誤って復元されにくくなる。 Since a plurality of setting items having a dependency relationship in which the validity or value of the other setting item changes depending on one setting item are classified into a plurality of categories according to the degree of relevance, the structure becomes easy to understand. Since each setting item is described in the form according to the setting order based on the dependency between multiple categories and each setting item, the form is easy and the setting contents are not easily restored by mistake. Become.

例えば、撮像装置のフレームレートの設定を例に説明すると、フレームレートの設定に関するカテゴリには、「フレームレートを設定可能にするか」という設定項目と、「フレームレートの設定値」という設定項目とが含まれる。「フレームレートの設定値」は、「フレームレートを設定可能にするか」をTrueにしなければ有効にならない。つまり、「フレームレートを設定可能にするか」という設定項目が、前記一方の設定項目に相当し、「フレームレートの設定値」という設定項目が、前記他方の設定項目に相当することになる。「フレームレートの設定値」という設定項目が「フレームレートを設定可能にするか」という設定項目よりも先に記述されていた場合、「フレームレートの設定値」を先に設定しようとし、このとき「フレームレートを設定可能にするか」という設定項目の設定が未だである場合には、エラーとなり、フレームレートを設定することができない。 For example, to explain the setting of the frame rate of the image pickup device as an example, the category related to the frame rate setting includes a setting item "whether the frame rate can be set" and a setting item "frame rate setting value". Is included. The "frame rate setting value" is not valid unless "whether the frame rate can be set" is set to True. That is, the setting item "whether the frame rate can be set" corresponds to the one setting item, and the setting item "frame rate setting value" corresponds to the other setting item. If the setting item "frame rate setting value" is described before the setting item "whether the frame rate can be set", the "frame rate setting value" is tried to be set first, and at this time. If the setting item "whether the frame rate can be set" is not set yet, an error occurs and the frame rate cannot be set.

本構成では、設定順序に従って各設定項目が記述された帳票が出力されるので、「フレームレートを設定可能にするか」という設定項目が先に記述されることになり、この設定を行った後、フレームレートの設定値を設定することができるようになる。 In this configuration, a form in which each setting item is described is output according to the setting order, so the setting item "whether the frame rate can be set" is described first, and after making this setting. , You will be able to set the frame rate setting value.

第2の発明は、前記設定順序は、使用者により設定されるべき順序であることを特徴とする。 The second invention is characterized in that the setting order is an order to be set by the user.

この構成によれば、使用者により設定されるべき順序に従って各設定項目を記述することができるので、帳票の構造がより一層分かり易くなる。 According to this configuration, each setting item can be described in the order to be set by the user, so that the structure of the form becomes easier to understand.

第3の発明は、前記撮像装置または前記設定装置は、前記他方の設定項目の有効性又は値を変化させる前記一方の設定項目が、前記他方の設定項目よりも先に記述されるように、前記各カテゴリ及び各設定項目を並び替えて記述した帳票を出力するように構成されていることを特徴とする。 In a third aspect of the invention, the imaging device or the setting device changes the validity or value of the other setting item so that the one setting item is described before the other setting item. It is characterized in that it is configured to output a form in which each category and each setting item are rearranged and described.

すなわち、一方の設定項目を先に記述することで、他方の設定項目との関係において帳票の構造の理解が容易になる。 That is, by describing one setting item first, it becomes easy to understand the structure of the form in relation to the other setting item.

また、前記各カテゴリ及び各設定項目を並び替えるのは、撮像装置が行っても、設定装置が行ってもよい。すなわち、撮像装置が、帳票を出力しやすくするために設定項目の順序をあらかじめ並び替えたうえで、その内容をDeviceXMLファイルとして設定装置側に提供することができる。一方、設定装置は、DeviceXMLファイルに記載された設定項目の順序を把握したうえで、セレクタレジスタが出現している個所については、同じ設定項目の値を、セレクタレジスタを切り替えながら繰り返し帳票に出力することができる。並び替えを実行するのは撮像装置でなくてもよく、例えば、撮像装置が設定装置に対して、並び替えの行われていないDeviceXMLファイルを送り、それを受け取った設定装置が直ちに並び替えを行った後、引き続きセレクタレジスタを意識した帳票出力を行うようにしてもよい。 Further, the image pickup apparatus or the setting apparatus may perform the rearrangement of the respective categories and the respective setting items. That is, the imaging device can rearrange the order of the setting items in advance in order to facilitate the output of the form, and then provide the contents as a DeviceXML file to the setting device side. On the other hand, the setting device grasps the order of the setting items described in the DeviceXML file, and then repeatedly outputs the value of the same setting item to the form while switching the selector register at the place where the selector register appears. be able to. It is not necessary for the image pickup device to perform the sorting. For example, the image pickup device sends an unsorted DeviceXML file to the setting device, and the setting device that receives the file immediately sorts the files. After that, the form output may be continued with the selector register in mind.

第4の発明は、前記カテゴリ及び前記設定項目は、階層的な依存関係を有し、前記撮像装置または前記設定装置は、前記階層的な依存関係を一層ずつ並び替えて記述した帳票を出力するように構成されていることを特徴とする。 In the fourth invention, the category and the setting item have a hierarchical dependency relationship, and the imaging device or the setting device outputs a form in which the hierarchical dependency relationship is rearranged layer by layer. It is characterized in that it is configured as follows.

この構成によれば、階層的な依存関係を一層ずつ並び替えて記述することで、帳票の構造の理解が容易になる。 According to this configuration, it is easy to understand the structure of the form by rearranging and describing the hierarchical dependencies layer by layer.

第5の発明は、前記撮像装置または前記設定装置は、最も下の階層の順序を並び替えた後、最も下の階層よりも1階層上の階層の順序を並び替えるように構成されていることを特徴とする。 According to a fifth aspect of the present invention, the imaging device or the setting device is configured to rearrange the order of the lowest layer and then rearrange the order of the layers one layer higher than the lowest layer. It is characterized by.

この構成によれば、依存関係を設定順序に従うように並び替える処理が容易に行えるようになる。 According to this configuration, the process of rearranging the dependencies according to the setting order can be easily performed.

本発明によれば、依存関係を有する複数の設定項目を関連度に応じて分類して複数のカテゴリを形成し、複数のカテゴリ間と各設定項目間との依存関係に基づいて、設定順序に従って各設定項目が記述された帳票を出力することができる。これにより、標準化規格に適合した撮像装置と設定装置との間でやり取りを行う帳票を簡単に出力することができ、実装の容易化を図ることができるとともに、設定内容が誤って復元されないようにすることができる。 According to the present invention, a plurality of setting items having a dependency relationship are classified according to the degree of relevance to form a plurality of categories, and the dependency relationships between the plurality of categories and each setting item are followed according to the setting order. A form in which each setting item is described can be output. As a result, it is possible to easily output a form that is exchanged between an imaging device and a setting device conforming to a standard, facilitate implementation, and prevent accidental restoration of setting contents. can do.

本発明の実施形態1に係る画像検査システムの概略構成及び運用状態を模式的に示す図である。It is a figure which shows typically the schematic structure and operation state of the image inspection system which concerns on Embodiment 1 of this invention. 実施形態2に係る図1相当図である。It is a figure corresponding to FIG. 1 which concerns on Embodiment 2. FIG. 実施形態3に係る図1相当図である。FIG. 1 is a view corresponding to FIG. 1 according to the third embodiment. 実施形態4に係る図1相当図である。FIG. 1 is a view corresponding to FIG. 1 according to the fourth embodiment. デフレクトメトリの原理に基づいて検査用画像を生成する手順を示すフローチャートである。It is a flowchart which shows the procedure which generates the inspection image based on the principle of deflation metric. フォトメトリックステレオ法を利用して検査用画像を生成する実施形態5に係る図1相当図である。FIG. 1 is a view corresponding to FIG. 1 according to the fifth embodiment in which an inspection image is generated by using a photometric stereo method. 画像検査アプリケーションとカメラとの接続インターフェースを説明する図である。It is a figure explaining the connection interface between an image inspection application and a camera. 撮像装置の内部処理の一例を概念的に示すフローチャートである。It is a flowchart which conceptually shows an example of the internal processing of an image pickup apparatus. デフレクトメトリの原理を利用した検査画像の生成を行う場合のパラメータセットを示す図である。It is a figure which shows the parameter set in the case of generating the inspection image using the principle of deflation metrics. マルチスペクトルイメージングにより検査画像の生成を行う場合のパラメータセットを示す図である。It is a figure which shows the parameter set when the inspection image is generated by multi-spectral imaging. 前処理モジュールの構成を示す図である。It is a figure which shows the structure of the preprocessing module. 撮像装置の内部処理のフローチャートにおいてあるユニットを特定する要領を説明する図である。It is a figure explaining the procedure of specifying a certain unit in the flowchart of the internal processing of an image pickup apparatus. 設定用ユーザーインターフェースを示す図である。It is a figure which shows the user interface for setting. パラメータセット番号の選択によって設定用ユーザーインターフェースが切り替えられる場合を示す模式図である。It is a schematic diagram which shows the case where the setting user interface is switched by the selection of a parameter set number. パラメータセット番号の選択によってパラメータセットが切り替えられる内部的な仕組みを説明する図である。It is a figure explaining the internal mechanism that a parameter set is switched by the selection of a parameter set number. 方向別フィルターの処理例を示す図である。It is a figure which shows the processing example of the filter by a direction. 位置補正後に方向別フィルターを実行する場合を説明する図である。It is a figure explaining the case which executes the filter by direction after position correction. フィルター設定用ユーザーインターフェースを示す図である。It is a figure which shows the user interface for filter setting. フィルター処理を実行可能な画像を一覧形式で示した図である。It is a figure which showed the image which can execute the filter processing in a list format. フィルター処理の詳細ユーザーインターフェースを示す図である。It is a figure which shows the detailed user interface of a filtering process. フィルターの方向依存性を示す図である。It is a figure which shows the direction dependence of a filter. 位置補正後に方向別フィルターを実行するフローチャートである。It is a flowchart which executes a filter for each direction after position correction. 複数の領域が設定されている場合に、位置補正後に方向別フィルターを実行するフローチャートである。It is a flowchart which executes a direction-specific filter after position correction when a plurality of areas are set. 移動体追従時のフローチャートである。It is a flowchart at the time of following a moving body. 依存関係を持った帳票の一例を示す図である。It is a figure which shows an example of the form which has a dependency relationship. 最も末節のカテゴリとレジスタの順序を入れ替えた状態を示す図25相当図である。It is a figure corresponding to FIG. 25 which shows the state which changed the order of the category and the register of the last section. 1階層上のカテゴリとレジスタの順序を入れ替えた状態を示す図25相当図である。FIG. 25 is a diagram corresponding to FIG. 25 showing a state in which the order of the categories and registers one level above is changed. 並べ替え前後のレジスタの出現順序と、出力された帳票とを示す図である。It is a figure which shows the appearance order of the register before and after sorting, and the output form. LumiTraxモードのレジスタの出現順序の一例を示す図である。It is a figure which shows an example of the appearance order of the register of LumiTrax mode. レジスタの前後関係が設定順となっていない場合の図29相当図である。FIG. 29 is a diagram corresponding to FIG. 29 when the context of the registers is not in the setting order. レジスタの並べ替えを行った場合の図29相当図である。FIG. 29 is a diagram corresponding to FIG. 29 when the registers are rearranged.

以下、本発明の実施形態を図面に基づいて詳細に説明する。尚、以下の好ましい実施形態の説明は、本質的に例示に過ぎず、本発明、その適用物或いはその用途を制限することを意図するものではない。 Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. It should be noted that the following description of the preferred embodiment is essentially merely an example and is not intended to limit the present invention, its application or its use.

(実施形態1)
図1は、本発明の実施形態に係る画像検査システム1の運用状態を模式的に示すものである。画像検査システム1は、ワークW(検査対象物)を撮像した画像を用いてワークWの欠陥の有無を検査するように構成されており、ワークWを照明する照明装置2と、ワークWを撮像する画像検査装置用撮像装置3と、撮像装置3の設定を行うパーソナルコンピュータ(PC)等で構成された設定装置4とを備えている。設定装置4は、表示部5と、キーボード6及びマウス7とを備えている。表示部5は、たとえば有機ELディスプレイや液晶ディスプレイ等からなるものであり、撮像装置3で撮像された画像、撮像装置3で撮像された画像を各種処理した処理後の画像、各種ユーザーインターフェース(GUI)等を表示することができる部分である。各種ユーザーインターフェース等は、設定装置4の本体部で生成される。表示部5の横方向を当該表示部5のX方向とし、表示部5の縦方向を当該表示部5のY方向とすることができる。
(Embodiment 1)
FIG. 1 schematically shows an operating state of the image inspection system 1 according to the embodiment of the present invention. The image inspection system 1 is configured to inspect the presence or absence of defects in the work W by using an image of the work W (inspection object), and images the lighting device 2 that illuminates the work W and the work W. It is provided with an image pickup device 3 for an image inspection device, and a setting device 4 composed of a personal computer (PC) or the like for setting the image pickup device 3. The setting device 4 includes a display unit 5, a keyboard 6, and a mouse 7. The display unit 5 is composed of, for example, an organic EL display, a liquid crystal display, or the like, and includes an image captured by the image pickup device 3, a processed image obtained by processing the image captured by the image pickup device 3, and various user interfaces (GUI). ) Etc. can be displayed. Various user interfaces and the like are generated in the main body of the setting device 4. The horizontal direction of the display unit 5 can be the X direction of the display unit 5, and the vertical direction of the display unit 5 can be the Y direction of the display unit 5.

また、キーボード6及びマウス7は、従来から周知のコンピュータ操作用の機器(操作手段)である。キーボード6またはマウス7の操作により、各種情報を設定装置4に入力することができるとともに、表示部5に表示されている画像等を選択することができる。尚、キーボード6及びマウス7の代わり、またはキーボード6及びマウス7に加えて、たとえば、音声入力機器、感圧式タッチ操作パネル等のコンピュータ操作用の機器を使用することもできる。 Further, the keyboard 6 and the mouse 7 are conventionally well-known devices (operating means) for operating a computer. By operating the keyboard 6 or the mouse 7, various information can be input to the setting device 4, and an image or the like displayed on the display unit 5 can be selected. In addition to the keyboard 6 and the mouse 7, or in addition to the keyboard 6 and the mouse 7, a computer operation device such as a voice input device and a pressure-sensitive touch operation panel can also be used.

たとえば、設定装置4には、プログラマブル・ロジック・コントローラ(PLC)等からなる外部制御機器8が接続されている。この外部制御機器8は、画像検査システム1の一部を構成するものとしてもよい。また、外部制御機器8は、画像検査システム1の構成要素としなくてもよい。 For example, an external control device 8 including a programmable logic controller (PLC) or the like is connected to the setting device 4. The external control device 8 may form a part of the image inspection system 1. Further, the external control device 8 does not have to be a component of the image inspection system 1.

図1では、複数のワークWが搬送用ベルトコンベアBの上面に載置された状態で図1における白抜き矢印で示す方向へ搬送されている場合を示している。外部制御機器8は、搬送用ベルトコンベアB及び画像検査システム1をシーケンス制御するための機器であり、汎用のPLCを利用することができる。 FIG. 1 shows a case where a plurality of works W are transported in the direction indicated by the white arrow in FIG. 1 in a state of being placed on the upper surface of the transport belt conveyor B. The external control device 8 is a device for sequence control of the transport belt conveyor B and the image inspection system 1, and a general-purpose PLC can be used.

尚、この実施形態の説明では、搬送用ベルトコンベアBによるワークWの搬送方向(ワークWの移動方向)をY方向とし、搬送用ベルトコンベアBの平面視でY方向に直交する方向をX方向とし、X方向及びY方向に直交する方向(搬送用ベルトコンベアBの上面に直交する方向)をZ方向と定義するが、これは説明の便宜を図るために定義するだけである。 In the description of this embodiment, the transport direction of the work W by the transport belt conveyor B (moving direction of the work W) is the Y direction, and the direction orthogonal to the Y direction in the plan view of the transport belt conveyor B is the X direction. The direction orthogonal to the X direction and the Y direction (the direction orthogonal to the upper surface of the conveyor belt B for transportation) is defined as the Z direction, but this is defined only for convenience of explanation.

画像検査システム1は、ワークWの外観検査、即ちワークWの表面の傷、汚れ、打痕等の欠陥の有無を検査する場合に使用することができるものであり、この検査結果からワークWの良否判定を行うこともできる。画像検査システム1は、その運用時において、外部制御機器8から信号線を介して、欠陥検査(良否判定検査)の開始タイミングを規定する検査開始トリガ信号を受信する。画像検査システム1は、この検査開始トリガ信号に基づいてワークWの撮像及び照明等を行って所定の処理後、検査用画像を得る。その後、検査用画像に基づいて外観検査し、その検査結果は、信号線を介して外部制御機器8へ送信される。このように、画像検査システム1の運用時には、画像検査システム1と外部制御機器8との間で、信号線を介して検査開始トリガ信号の入力と検査結果の出力が繰り返し行われる。なお、検査開始トリガ信号の入力や検査結果の出力は、上述したように、画像検査システム1と外部制御機器8との間の信号線を介して行ってもよいし、それ以外の図示しない信号線を介して行ってもよい。例えば、ワークWの到着を検知するためのセンサと画像検査システム1とを直接的に接続し、そのセンサから画像検査システム1へ検査開始トリガ信号を入力するようにしてもよい。また、画像検査システム1は、トリガ信号を内部で自動生成して検査を行うように構成してもよい。 The image inspection system 1 can be used for visual inspection of the work W, that is, for inspecting the presence or absence of defects such as scratches, stains, and dents on the surface of the work W, and the work W is based on the inspection results. It is also possible to make a pass / fail judgment. During its operation, the image inspection system 1 receives an inspection start trigger signal that defines the start timing of defect inspection (good / bad judgment inspection) from the external control device 8 via a signal line. The image inspection system 1 takes an image of the work W, illuminates, and the like based on the inspection start trigger signal, and obtains an inspection image after a predetermined process. After that, a visual inspection is performed based on the inspection image, and the inspection result is transmitted to the external control device 8 via the signal line. As described above, during the operation of the image inspection system 1, the inspection start trigger signal is repeatedly input and the inspection result is output between the image inspection system 1 and the external control device 8 via the signal line. As described above, the input of the inspection start trigger signal and the output of the inspection result may be performed via the signal line between the image inspection system 1 and the external control device 8, or other signals (not shown). It may be done via a line. For example, a sensor for detecting the arrival of the work W and the image inspection system 1 may be directly connected, and an inspection start trigger signal may be input from the sensor to the image inspection system 1. Further, the image inspection system 1 may be configured to automatically generate a trigger signal internally for inspection.

また、画像検査システム1は、専用のハードウェアで構成する他、汎用の機器にソフトウェアをインストールしたもの、たとえば汎用もしくは専用のコンピュータに画像検査プログラムをインストールした構成としてもよい。たとえば、グラフィックボードなどのハードウェアを画像検査処理に特化させた専用のコンピュータに、画像検査プログラムをインストールした構成とすることもできる。 In addition to being configured with dedicated hardware, the image inspection system 1 may be configured by installing software on a general-purpose device, for example, installing an image inspection program on a general-purpose or dedicated computer. For example, the image inspection program may be installed on a dedicated computer in which hardware such as a graphic board is specialized for image inspection processing.

(照明装置2の構成)
照明装置2は、発光部2aと、発光部2aを制御する照明制御部2bとを備えている。発光部2aと照明制御部2bとは、別体であってもよいし、一体化されたものであってもよい。また、照明制御部2bは、設定装置4に組み込まれていてもよい。発光部2aは、たとえば発光ダイオード、液晶パネルを用いたプロジェクタ、有機ELパネル、デジタルマイクロミラーデバイス(DMD)等で構成することができ、照明部と呼ぶこともできる。発光ダイオード、液晶パネル、有機ELパネル、DMDについては図示しないが、従来から周知の構造のものを用いることができる。照明装置2は、設定装置4に対して信号線100aを介して接続されており、撮像装置3及び設定装置4から離して設置することができるようになっている。
(Configuration of lighting device 2)
The lighting device 2 includes a light emitting unit 2a and a lighting control unit 2b that controls the light emitting unit 2a. The light emitting unit 2a and the lighting control unit 2b may be separate bodies or integrated. Further, the lighting control unit 2b may be incorporated in the setting device 4. The light emitting unit 2a can be composed of, for example, a light emitting diode, a projector using a liquid crystal panel, an organic EL panel, a digital micromirror device (DMD), or the like, and can also be called an illumination unit. Although the light emitting diode, the liquid crystal panel, the organic EL panel, and the DMD are not shown, those having a conventionally known structure can be used. The lighting device 2 is connected to the setting device 4 via a signal line 100a, and can be installed apart from the image pickup device 3 and the setting device 4.

実施形態1の照明装置2は、均一面発光を行うことができるように構成される。また、照明装置2は、デフレクトメトリ処理を実現可能な照明を行うことができるように構成されており、従って、周期的な照度分布を有するパターン光をワークWに照射する発光部2aを有している。すなわち、照明装置2は、複数の異なるパターン光をワークWに対して順次照射するパターン光照明を実行するパターン光照明部とすることができる。以下、デフレクトメトリ処理を行うことによって検査用画像を生成する場合に用いる照明装置2について説明する。 The lighting device 2 of the first embodiment is configured to be capable of performing uniform surface light emission. Further, the illuminating device 2 is configured to be able to perform illumination capable of realizing deflation metric processing, and therefore has a light emitting unit 2a that irradiates the work W with patterned light having a periodic illuminance distribution. are doing. That is, the illumination device 2 can be a pattern light illumination unit that executes pattern light illumination that sequentially irradiates the work W with a plurality of different pattern lights. Hereinafter, the lighting device 2 used when generating an inspection image by performing the deflation metric processing will be described.

複数の発光ダイオードを用いる場合には、複数の発光ダイオードをドットマトリクス状に配置して電流値制御によって周期的な照度分布を有するパターン光を生成することができる。たとえば、明暗がY方向に変化するY方向パターン光の場合、縞模様がY方向に繰り返されるパターン光という表現とすることもでき、このY方向パターン光を生成する際には、照度分布の位相をY方向にシフトさせることにより、照度分布の位相が異なった複数のY方向パターン光を生成することができる。Y方向パターン光の照度分布をsin波形に近似した波形で表すこともでき、この場合、たとえば位相を90゜ずつ変化させて、0゜の場合のY方向パターン光、90゜の場合のY方向パターン光、180゜の場合のY方向パターン光、270゜の場合のY方向パターン光を生成することができる。 When a plurality of light emitting diodes are used, the plurality of light emitting diodes can be arranged in a dot matrix to generate patterned light having a periodic illuminance distribution by controlling the current value. For example, in the case of Y-direction pattern light whose brightness changes in the Y direction, it can be expressed as pattern light in which a striped pattern is repeated in the Y direction, and when this Y-direction pattern light is generated, the phase of the illuminance distribution is generated. By shifting the light in the Y direction, it is possible to generate a plurality of Y direction pattern lights having different phases of the illuminance distribution. The illuminance distribution of the Y-direction pattern light can also be represented by a waveform similar to the sine waveform. In this case, for example, the phase is changed by 90 °, and the Y-direction pattern light at 0 ° and the Y-direction at 90 °. It is possible to generate a pattern light, a Y-direction pattern light at 180 °, and a Y-direction pattern light at 270 °.

また、明暗がX方向に変化するX方向パターン光の場合、縞模様がX方向に繰り返されるパターン光という表現とすることもでき、このX方向パターン光を生成する際には、照度分布の位相をX方向にシフトさせることにより、照度分布の位相が異なった複数のX方向パターン光を生成することができる。X方向パターン光の照度分布をsin波形に近似した波形で表すこともでき、この場合、たとえば位相を90゜ずつ変化させて、0゜の場合のX方向パターン光、90゜の場合のX方向パターン光、180゜の場合のX方向パターン光、270゜の場合のX方向パターン光を生成することができる。つまり、照明装置2は、異なる照明態様でワークWを照明することができる。デフレクトメトリ処理を行う場合、ワークWに照射するパターン光はsin波形だけでなく、三角波等のパターン光でも可能である。 Further, in the case of the X-direction pattern light in which the brightness changes in the X-direction, it can be expressed as a pattern light in which the striped pattern is repeated in the X-direction, and when the X-direction pattern light is generated, the phase of the illuminance distribution is generated. By shifting the light in the X direction, it is possible to generate a plurality of X-direction pattern lights having different phases of the illuminance distribution. The illuminance distribution of the X-direction pattern light can also be represented by a waveform similar to the sine waveform. In this case, for example, the phase is changed by 90 °, and the X-direction pattern light in the case of 0 ° and the X-direction in the case of 90 °. It is possible to generate pattern light, X-direction pattern light at 180 °, and X-direction pattern light at 270 °. That is, the lighting device 2 can illuminate the work W in different lighting modes. When the deflect metering process is performed, the pattern light irradiating the work W can be not only a sine waveform but also a pattern light such as a triangular wave.

尚、全ての発光ダイオードに同じ電流値の電流を流すことで照度分布が面内で均一な光を照射することもできる。全ての発光ダイオードに流す電流値を同じにして変化させていくと、暗い面発光状態から明るい面発光状態まで発光状態を変化させることができる。 It is also possible to irradiate light having a uniform illuminance distribution in the plane by passing a current having the same current value through all the light emitting diodes. By changing the current value flowing through all the light emitting diodes in the same way, the light emitting state can be changed from the dark surface emitting state to the bright surface emitting state.

また、液晶パネル及び有機ELパネルの場合は、各パネルを制御することで各パネルから照射される光が周期的な照度分布を有するパターン光となるようにすることができる。デジタルマイクロミラーデバイスの場合は、内蔵された微小鏡面を制御することで周期的な照度分布を有するパターン光を生成して照射することができる。尚、照明装置2の構成は上述したものに限られるものではなく、周期的な照度分布を有するパターン光を生成することができる機器や装置等であれば使用することができる。 Further, in the case of a liquid crystal panel and an organic EL panel, by controlling each panel, the light emitted from each panel can be made into a pattern light having a periodic illuminance distribution. In the case of a digital micromirror device, it is possible to generate and irradiate a pattern light having a periodic illuminance distribution by controlling the built-in micromirror surface. The configuration of the lighting device 2 is not limited to that described above, and any device or device capable of generating patterned light having a periodic illuminance distribution can be used.

また、後述するが、フォトメトリックステレオ法を利用して検査用画像を生成する場合に用いる照明装置2は、少なくとも3以上の異なる方向から照明を個別に照射可能な照明装置を用いることができる。また、照明装置2は、マルチスペクトル照明が可能に構成された照明装置であってもよく、照明装置2の構成は特に限定されるものではない。 Further, as will be described later, as the illuminating device 2 used when generating an inspection image by using the photometric stereo method, an illuminating device capable of individually irradiating illumination from at least three or more different directions can be used. Further, the lighting device 2 may be a lighting device configured to enable multispectral lighting, and the configuration of the lighting device 2 is not particularly limited.

(撮像装置3の構成)
撮像装置3は、カメラ31と、集光系光学系32と、撮像制御部33とを有している。撮像装置3は、設定装置4に対して信号線100bを介して接続されており、照明装置2及び設定装置4から離して設置することができるようになっている。
(Configuration of Imaging Device 3)
The image pickup apparatus 3 includes a camera 31, a condensing optical system 32, and an image pickup control unit 33. The image pickup device 3 is connected to the setting device 4 via a signal line 100b, and can be installed away from the lighting device 2 and the setting device 4.

カメラ31は、集光系光学系32を通して得られた光の強度を電気信号に変換するCCDやCMOS等の撮像素子からなるイメージセンサを有している。撮像制御部33は、記憶装置や信号処理装置を有するとともに、カメラ31の露光開始及び終了の制御、露光時間の制御、アナログゲインの調整等を行う部分である。内部の論理回路によってイメージセンサの駆動や、画像データの転送を制御することができる。また、撮像制御部33によって各種画像処理、フィルター処理等を行うことができるようになっており、撮像装置3は、フィルター処理機能を保有した装置である。 The camera 31 has an image sensor including an image sensor such as a CCD or CMOS that converts the intensity of light obtained through the condensing optical system 32 into an electric signal. The image pickup control unit 33 has a storage device and a signal processing device, and is a part that controls the exposure start and end of the camera 31, controls the exposure time, adjusts the analog gain, and the like. The drive of the image sensor and the transfer of image data can be controlled by the internal logic circuit. Further, the image pickup control unit 33 can perform various image processing, filter processing, and the like, and the image pickup device 3 is a device having a filter processing function.

集光系光学系32は、外部から入射する光を集光するための光学系であり、典型的には一以上の光学レンズを有している。また、集光系光学系32は、オートフォーカスを実行可能に構成されている。照明装置2からワークWの表面に向けて照射された光が該ワークWの表面で反射して集光系光学系32に入射するように、撮像装置3と照明装置2との位置関係を設定することができる。ワークWが透明フィルムやシートのように透光性を有する部材である場合、照明装置2からワークWの表面に向けて照射されたパターン光が該ワークWを透過して撮像装置3の集光系光学系32に入射するように、撮像装置3と照明装置2との位置関係を設定することができる。上記したいずれの場合も、ワークWの表面で反射した正反射成分及び拡散反射成分が撮像装置3の集光系光学系32に入射するように、撮像装置3と照明装置2とを配置する。また、撮像装置3には、受光素子がY方向に直線状に配置されたラインカメラを用いることもできるが、ラインカメラではなく、エリアカメラ(受光素子がX方向とY方向に並ぶように配置されたカメラ)を用いることもでき、このエリアカメラの場合は、同軸照明という形態も可能である。 The condensing optical system 32 is an optical system for condensing light incident from the outside, and typically has one or more optical lenses. Further, the condensing optical system 32 is configured to be capable of performing autofocus. The positional relationship between the image pickup device 3 and the lighting device 2 is set so that the light emitted from the lighting device 2 toward the surface of the work W is reflected by the surface of the work W and incident on the condensing optical system 32. can do. When the work W is a transparent member such as a transparent film or a sheet, the pattern light emitted from the lighting device 2 toward the surface of the work W passes through the work W and is condensed by the image pickup device 3. The positional relationship between the image pickup device 3 and the illumination device 2 can be set so as to be incident on the system optical system 32. In any of the above cases, the image pickup device 3 and the illumination device 2 are arranged so that the specular reflection component and the diffuse reflection component reflected on the surface of the work W are incident on the condensing optical system 32 of the image pickup device 3. Further, although a line camera in which the light receiving elements are arranged linearly in the Y direction can be used for the image pickup apparatus 3, an area camera (the light receiving elements are arranged so as to be arranged in the X direction and the Y direction) instead of the line camera. (Camera) can also be used, and in the case of this area camera, a form of coaxial illumination is also possible.

(実施形態2)
図2は、本発明の実施形態2に係る画像検査システムの概略構成及び運用状態を模式的に示す図である。実施形態2では、撮像制御部33が撮像素子を有するカメラ31及び集光系光学系32から分離しており、この撮像制御部33に照明制御部2bが取り込まれて一体化されている。撮像制御部33は、設定装置4に対して信号線100bを介して接続されている。撮像制御部33と照明制御部2bとは別体とすることもできる。
(Embodiment 2)
FIG. 2 is a diagram schematically showing a schematic configuration and an operating state of the image inspection system according to the second embodiment of the present invention. In the second embodiment, the image pickup control unit 33 is separated from the camera 31 having the image pickup element and the condensing optical system 32, and the illumination control unit 2b is incorporated into the image pickup control unit 33 and integrated. The image pickup control unit 33 is connected to the setting device 4 via a signal line 100b. The image pickup control unit 33 and the illumination control unit 2b can be separated from each other.

(実施形態3)
図3は、本発明の実施形態3に係る画像検査システムの概略構成及び運用状態を模式的に示す図である。実施形態3では、撮像制御部33に照明制御部2bが取り込まれて一体化されるとともに、撮像制御部33に表示部5及びマウス7が接続されている。設定装置4は、たとえばノートパソコン等で構成されており、撮像制御部33に接続されている。設定装置4は、キーボード6を有している。また、設定装置4には、マウスを接続してもよい。設定装置4が生成した各種ユーザーインターフェース等は、撮像制御部33を介して表示部5に表示することができる。
(Embodiment 3)
FIG. 3 is a diagram schematically showing a schematic configuration and an operating state of the image inspection system according to the third embodiment of the present invention. In the third embodiment, the lighting control unit 2b is incorporated into the image control unit 33 and integrated, and the display unit 5 and the mouse 7 are connected to the image control unit 33. The setting device 4 is composed of, for example, a notebook computer or the like, and is connected to the image pickup control unit 33. The setting device 4 has a keyboard 6. Further, a mouse may be connected to the setting device 4. Various user interfaces and the like generated by the setting device 4 can be displayed on the display unit 5 via the image pickup control unit 33.

(実施形態4)
図4は、本発明の実施形態4に係る画像検査システムの概略構成及び運用状態を模式的に示す図である。実施形態4では、照明装置2と撮像装置3とが一体化されており、照明制御部2bと撮像制御部33とも一体化されている。尚、実施形態2〜4において、実施形態1と同じ部分には同じ符号を付して説明を省略している。
(Embodiment 4)
FIG. 4 is a diagram schematically showing a schematic configuration and an operating state of the image inspection system according to the fourth embodiment of the present invention. In the fourth embodiment, the lighting device 2 and the imaging device 3 are integrated, and the lighting control unit 2b and the imaging control unit 33 are also integrated. In the first to fourth embodiments, the same parts as those in the first embodiment are designated by the same reference numerals and the description thereof is omitted.

(デフレクトメトリ処理)
実施形態1〜4では、撮像装置3が撮像した複数の輝度画像からデフレクトメトリの原理に基づいてワークWの表面の位相データを生成し、当該位相データに基づいてワークWの形状を示す検査用画像を生成するデフレクトメトリ処理を行うように構成されている。
(Deflation metric processing)
In the first to fourth embodiments, phase data on the surface of the work W is generated from a plurality of luminance images captured by the image pickup apparatus 3 based on the principle of deflation, and an inspection showing the shape of the work W based on the phase data. It is configured to perform a deflection metering process to generate an image for use.

以下、図5に示すフローチャートに従って検査用画像の生成について詳細に説明する。フローチャートのステップSA1では、照明装置2が所定の照明条件に従ってパターン光を生成し、ワークWを照明する。このときの照明条件は、位相が0゜の場合のY方向パターン光、90゜の場合のY方向パターン光、180゜の場合のY方向パターン光、270゜の場合のY方向パターン光、0゜の場合のX方向パターン光、90゜の場合のX方向パターン光、180゜の場合のX方向パターン光、270゜の場合のX方向パターン光を順番に生成する照明条件とすることができる。従って、照明装置2は、合計8種類のパターン光(X方向で4種類、Y方向で4種類)を生成してワークWに順次照射する。パターン光が照射される都度、撮像装置3がワークWを撮像する。撮像装置3による撮像の際、パターン光の照射回数が8回であることから、8つの輝度画像が得られる。尚、ワークWの形状等によっては、X方向パターン光のみ、またはY方向パターン光のみ照射するようにしてもよい。また、パターン光の数は3つであってもよい。 Hereinafter, the generation of the inspection image will be described in detail according to the flowchart shown in FIG. In step SA1 of the flowchart, the lighting device 2 generates pattern light according to a predetermined lighting condition and illuminates the work W. The illumination conditions at this time are Y-direction pattern light when the phase is 0 °, Y-direction pattern light when the phase is 90 °, Y-direction pattern light when the phase is 180 °, Y-direction pattern light when the phase is 270 °, and 0. The lighting conditions can be such that the X-direction pattern light in the case of °, the X-direction pattern light in the case of 90 °, the X-direction pattern light in the case of 180 °, and the X-direction pattern light in the case of 270 ° are sequentially generated. .. Therefore, the lighting device 2 generates a total of eight types of pattern light (four types in the X direction and four types in the Y direction) and sequentially irradiates the work W. Each time the pattern light is irradiated, the imaging device 3 images the work W. Since the number of times of irradiation of the pattern light is 8 times at the time of imaging by the image pickup apparatus 3, eight luminance images can be obtained. Depending on the shape of the work W and the like, only the X-direction pattern light or the Y-direction pattern light may be irradiated. Further, the number of pattern lights may be three.

その後、ステップSA2に進み、ステップSA1で得られた8つの輝度画像に対してデフレクトメトリ処理を行う。パターン光が照射されたワークWを撮像することで、得られた輝度画像の各画素値には、正反射成分と、拡散反射成分(+環境成分)とが含まれることになる。パターン光の照度分布の位相をX方向に90゜(π/2)ずつシフトさせて4回撮像しているので、各画素値はX方向パターン光の照射によって4種類得られる。拡散反射成分、正反射成分、正反射角度(位相)は、位相データであり、周知の計算式により算出することができる。 After that, the process proceeds to step SA2, and the eight luminance images obtained in step SA1 are subjected to deflation metrics processing. By imaging the work W irradiated with the pattern light, each pixel value of the obtained luminance image includes a specular reflection component and a diffuse reflection component (+ environmental component). Since the phase of the illuminance distribution of the pattern light is shifted by 90 ° (π / 2) in the X direction and the image is taken four times, four types of pixel values can be obtained by irradiating the pattern light in the X direction. The diffuse reflection component, the specular reflection component, and the specular reflection angle (phase) are phase data and can be calculated by a well-known calculation formula.

同様に、パターン光の照度分布の位相をY方向に90゜(π/2)ずつシフトさせて4回撮像しているので、各画素値はY方向パターン光の照射によって4種類得られる。Y方向についても同様に拡散反射成分、正反射成分、正反射角度(位相)を算出することができる。 Similarly, since the phase of the illuminance distribution of the pattern light is shifted by 90 ° (π / 2) in the Y direction and the image is taken four times, four types of pixel values can be obtained by irradiating the pattern light in the Y direction. Similarly, the diffuse reflection component, the specular reflection component, and the specular reflection angle (phase) can be calculated in the Y direction.

たとえば、正反射成分画像は、逆相同士の差分により、拡散成分を排除することで得ることができる。X方向とY方向でそれぞれ得られ、それらを合成することで正反射成分画像となる。また、正反射角度は、π/2ずれの正反射成分により、tanθ=sinθ/cosθとして角度を算出することで得られる。また、平均画像は、拡散成分と環境成分とを含んでおり、逆相同士の加算により、正反射成分を排除することで得られる。 For example, a specular reflection component image can be obtained by eliminating the diffusion component by the difference between the opposite phases. It is obtained in the X direction and the Y direction, respectively, and a specular reflection component image is obtained by synthesizing them. The specular reflection angle can be obtained by calculating the angle with tanθ = sinθ / cosθ based on the specular reflection component with a deviation of π / 2. Further, the average image contains a diffusion component and an environmental component, and is obtained by eliminating the specular reflection component by adding the opposite phases.

ステップSA3では拡散反射成分画像に対してコントラスト補正を行う。また、ステップSA4では正反射成分画像に対してコントラスト補正を行う。各コントラスト補正は、線形補正とすることができる。たとえば、ROIの平均が中央値になるように補正する。8ビットの場合は128レベルを中央値とすればよい。これによって、補正後の拡散成分、補正後の正反射成分が得られる。 In step SA3, contrast correction is performed on the diffuse reflection component image. Further, in step SA4, contrast correction is performed on the specular reflection component image. Each contrast correction can be a linear correction. For example, the ROI is corrected so that the average is the median. In the case of 8 bits, the median value may be 128 levels. As a result, the corrected diffusion component and the corrected specular reflection component can be obtained.

また、ステップSA5では位相成分について参照位相との差分を取る。このステップSA5では、参照平面の位相に対して差分を取得する。たとえば、使用者が、参照平面として球面状、円筒状、平面状等を指定し、これらとの差分を取得するようにする。あるいは、自由曲面で抽出させてもよい。X方向について補正後の位相(差分)が得られ、Y方向についても補正後の位相が得られる。拡散反射成分画像、正反射成分画像、参照位相差分画像は出力画像とすることができる。 Further, in step SA5, the difference between the phase component and the reference phase is taken. In this step SA5, the difference is acquired with respect to the phase of the reference plane. For example, the user specifies a spherical shape, a cylindrical shape, a flat shape, or the like as the reference plane, and obtains the difference from these. Alternatively, it may be extracted with a free curved surface. The corrected phase (difference) is obtained in the X direction, and the corrected phase is also obtained in the Y direction. The diffuse reflection component image, specular reflection component image, and reference phase difference image can be output images.

ステップSA6では、ステップSA5で得られた参照位相差分画像に基づいて階層化画像と深さ輪郭画像を得る。階層化画像は、1/2縮小を繰り返した画像である。これにより、階層化された位相の画像がX方向とY方向でそれぞれ得られる。 In step SA6, a layered image and a depth contour image are obtained based on the reference phase difference image obtained in step SA5. The layered image is an image in which 1/2 reduction is repeated. As a result, a layered phase image is obtained in the X direction and the Y direction, respectively.

一方、深さ輪郭画像とは、位相差分が大きい部分を強調した出力画像であり、曲率とは異なる概念である。深さ輪郭画像は、形状積み上げによって得られる形状画像に比べて高速に得られ、ワークWの線キズが極めて見やすく、しかも、輪郭の抽出がし易い等の利点がある。 On the other hand, the depth contour image is an output image in which a portion having a large phase difference is emphasized, and is a concept different from curvature. The depth contour image can be obtained at a higher speed than the shape image obtained by stacking the shapes, and has advantages such that line scratches on the work W are extremely easy to see and the contour can be easily extracted.

次に、ステップSA7では、階層化された位相の画像に対して形状積み上げを行って形状画像を生成する。X方向とY方向の正反射角度に対し、Gauss−Jacobi法などによる積み上げ計算を行うことで、形状画像を得ることができる。形状画像は出力画像となる。 Next, in step SA7, the shapes are stacked on the layered phase images to generate the shape images. A shape image can be obtained by performing a stacking calculation such as by the Gauss-Jacobi method for the specular reflection angles in the X direction and the Y direction. The shape image is an output image.

一般的には、unwrappingをしてから、三角測距などによって形状を復元する例が多いところ、本実施形態においては、unwappingを回避し、局所的な微分値をGauss−Jacobi法で積み上げ計算することで、三角測距によらずに形状を復元している。形状復元方法は、既知の方法が適宜利用できる。好ましくは、三角測距を用いない方法である。また、縮小画像を多段に持つ、階層型方法とすることもできる。また、縮小画像と通常画像との差分を持つ方法とすることもできる。 In general, there are many cases where the shape is restored by unwrapping and then triangular ranging, but in this embodiment, unwapping is avoided and the local differential values are accumulated and calculated by the Gauss-Jacobi method. As a result, the shape is restored without relying on triangular distance measurement. As a shape restoration method, a known method can be appropriately used. A method that does not use triangular ranging is preferable. It is also possible to use a hierarchical method in which reduced images are held in multiple stages. It is also possible to use a method having a difference between the reduced image and the normal image.

さらに、パラメータとして特徴サイズを設定することもできる。特徴サイズとは、検査の目的や種別に応じた検出対象の傷のサイズを設定するためのパラメータである。例えば、特徴サイズのパラメータ値が1のときに一番細かい傷が検出でき、この値を上げていくと大きな傷が検出できるようにする。これにより、特徴サイズを大きくすると、より大きな傷が検出し易い状態となり、ワークW表面の傷や凸凹が明瞭となる。 Furthermore, the feature size can be set as a parameter. The feature size is a parameter for setting the size of the scratch to be detected according to the purpose and type of inspection. For example, when the parameter value of the feature size is 1, the finest scratches can be detected, and when this value is increased, large scratches can be detected. As a result, when the feature size is increased, larger scratches are easily detected, and scratches and irregularities on the surface of the work W become clear.

ステップSA8では簡易欠陥抽出を行う。すなわち、ワークWの線キズ(欠陥)を検査し易い画像、ワークWの汚れ(欠陥)を検査し易い画像、ワークWの打痕(欠陥)を検査し易い画像をそれぞれ生成した後、画像に現れている欠陥を欠陥抽出画像に表示させる。欠陥抽出画像は、各画像に現れている欠陥を抽出して表示することができる画像であり、抽出した欠陥を1つの画像に合成して表示させることができるので合成欠陥画像と呼ぶこともできる。 In step SA8, simple defect extraction is performed. That is, after generating an image in which the line scratches (defects) of the work W are easily inspected, an image in which the stains (defects) in the work W are easily inspected, and an image in which the dents (defects) in the work W are easily inspected, the images are displayed. The appearing defects are displayed on the defect extraction image. The defect extraction image is an image that can extract and display the defects appearing in each image, and can also be called a composite defect image because the extracted defects can be combined and displayed in one image. ..

たとえば、正反射成分画像は、正反射を鈍らせる汚れや、形状変化はないものの正反射の鈍いキズ、あるいは形状変化によって正反射が返ってこないキズ等の確認をし易い画像である。拡散反射画像は、ワークWの表面のテクスチャの状態(具体的には印刷物の文字や黒ずんだ汚れ等)を確認し易い画像である。形状画像は、特徴サイズに応じて周囲画素を見ながら位相の変化を積み上げた画像である。ここで、形状画像の特徴サイズを大きく設定すると、形状変化のなかでも比較的浅くて面積の広い凹凸を捉えることができる。一方、形状画像の特徴サイズを小さく設定すると、線キズや面積の小さなキズを捉えることができる。また、形状画像に現れにくい欠陥(たとえば細いキズや深い傷)は、正反射成分画像に現れやすい傾向がある。また、深さ輪郭画像は、基準となる平面を算出し、この基準平面からのずれを画像化している。深さ輪郭画像からは、線キズや面積の小さなキズを捉えることができる。 For example, the specular reflection component image is an image in which it is easy to confirm stains that dull the specular reflection, scratches that have no shape change but dull specular reflection, or scratches that do not return specular reflection due to the shape change. The diffuse reflection image is an image in which it is easy to confirm the state of the texture on the surface of the work W (specifically, characters on the printed matter, dark stains, etc.). The shape image is an image in which the phase changes are accumulated while looking at the surrounding pixels according to the feature size. Here, if the feature size of the shape image is set large, it is possible to capture unevenness that is relatively shallow and has a large area even in the shape change. On the other hand, if the feature size of the shape image is set small, line scratches and scratches with a small area can be captured. In addition, defects that are difficult to appear in the shape image (for example, fine scratches and deep scratches) tend to appear easily in the specular reflection component image. Further, in the depth contour image, a reference plane is calculated and the deviation from the reference plane is imaged. From the depth contour image, line scratches and scratches with a small area can be captured.

ステップSA8で簡易欠陥抽出を行った後に抽出された欠陥が表示された欠陥抽出画像を出力する。 After performing simple defect extraction in step SA8, a defect extraction image displaying the extracted defects is output.

(実施形態5)
図6は、本発明の実施形態5に係る画像検査システムの概略構成及び運用状態を模式的に示す図である。上記実施形態1〜4は、デフレクトメトリの原理に基づいて検査用画像を生成する形態であるのに対し、実施形態5では、フォトメトリックステレオ法を利用して検査用画像を生成するように構成されている。
(Embodiment 5)
FIG. 6 is a diagram schematically showing a schematic configuration and an operating state of the image inspection system according to the fifth embodiment of the present invention. The above-described first to fourth embodiments are embodiments in which an inspection image is generated based on the principle of deflation metrics, whereas in the fifth embodiment, an inspection image is generated by using a photometric stereo method. It is configured.

以下、フォトメトリックステレオ法を利用して検査用画像を生成する具体的な方法について、図6を参照しながら、実施形態1と同じ部分には同じ符合を付して説明を省略し、異なる部分について詳細に説明する。 Hereinafter, a specific method for generating an inspection image by using the photometric stereo method will be described with reference to FIG. 6, with the same reference numerals being added to the same parts as those in the first embodiment and different parts. Will be described in detail.

実施形態5に係る画像検査システム1は、たとえば特開2015−232486号公報に開示されている画像検査システムと同様に構成することができる。すなわち、画像検査システム1は、ワークWを一定の方向から撮像する撮像装置3と、ワークWを異なる三以上の照明方向から照明するための照明装置200とを備えるとともに、実施形態1と同様な表示部5、キーボード6及びマウス7を少なくとも備えている。 The image inspection system 1 according to the fifth embodiment can be configured in the same manner as the image inspection system disclosed in, for example, Japanese Patent Application Laid-Open No. 2015-232486. That is, the image inspection system 1 includes an image pickup device 3 that images the work W from a certain direction, and an illumination device 200 for illuminating the work W from three or more different illumination directions, and is the same as the first embodiment. It includes at least a display unit 5, a keyboard 6, and a mouse 7.

照明装置200は、ワークWに対して、互いに異なる方向から光を照射するように構成されており、第1〜第4発光部201〜204と、第1〜第4発光部201〜204を制御する照明制御部205とを有している。この照明装置200は、ワークWに対して互いに異なる方向から光を照射する複数方向照明を実行する部分である。第1〜第4発光部201〜204は互いに間隔をあけてワークWを取り囲むように配置されている。第1〜第4発光部201〜204は、発光ダイオード、白熱球、蛍光灯等を利用することができる。また、第1〜第4発光部201〜204は別体であってもよいし、一体化されていてもよい。 The lighting device 200 is configured to irradiate the work W with light from different directions, and controls the first to fourth light emitting units 201 to 204 and the first to fourth light emitting units 201 to 204. It has a lighting control unit 205 and the like. The lighting device 200 is a portion that executes multi-directional lighting that irradiates the work W with light from different directions. The first to fourth light emitting units 201 to 204 are arranged so as to surround the work W at intervals from each other. Light emitting diodes, incandescent bulbs, fluorescent lamps, and the like can be used for the first to fourth light emitting units 201 to 204. Further, the first to fourth light emitting units 201 to 204 may be separate bodies or may be integrated.

この実施形態では、第1〜第4発光部201〜204を順次点灯させ、第1〜第4発光部201〜204のいずれかが点灯した時点で、撮像装置3がワークWを撮像する。たとえば、照明装置200が1回目の照明トリガ信号を受信すると、照明制御部205が第1発光部201のみ点灯させる。このとき撮像装置3は撮像トリガ信号を受信して光が照射されるタイミングでワークWを撮像する。照明装置200が2回目の照明トリガ信号を受信すると、照明制御部205が第2発光部202のみ点灯させ、このとき撮像装置3はワークWを撮像する。このようにして4枚の輝度画像を得ることができる。なお、照明の数は4つに限られるものではなく、3つ以上で、かつ、互いに異なる方向からワークWを照明することができれば任意の数にすることができる。 In this embodiment, the first to fourth light emitting units 201 to 204 are sequentially turned on, and when any of the first to fourth light emitting units 201 to 204 is turned on, the image pickup device 3 images the work W. For example, when the lighting device 200 receives the first lighting trigger signal, the lighting control unit 205 lights only the first light emitting unit 201. At this time, the image pickup device 3 receives the image pickup trigger signal and images the work W at the timing when the light is irradiated. When the lighting device 200 receives the second lighting trigger signal, the lighting control unit 205 lights only the second light emitting unit 202, and at this time, the image pickup device 3 images the work W. In this way, four luminance images can be obtained. The number of lights is not limited to four, but can be any number as long as the number of lights is three or more and the work W can be illuminated from different directions.

そして、撮像装置3によって撮像された複数の輝度画像同士で対応関係にある画素毎の画素値を用いて、各画素のワークWの表面に対する法線ベクトルを算出する。算出された各画素の法線ベクトルに対してX方向及びY方向に微分処理を施し、ワークWの表面の傾きの輪郭を示す輪郭画像を生成する。また、算出された各画素の法線ベクトルから、法線ベクトルと同個数の各画素のアルベドを算出し、アルベドから、ワークWの表面の傾き状態を除去した模様を示すテクスチャ描出画像を生成する。この手法は周知の手法であることから詳細な説明は省略する。複数の輝度画像をフォトメトリックステレオの原理に基づいて合成することで、ワークWの形状を示す形状画像を生成することができる。 Then, the normal vector for the surface of the work W of each pixel is calculated by using the pixel value for each pixel which is in a corresponding relationship between the plurality of luminance images captured by the imaging device 3. The calculated normal vector of each pixel is subjected to differential processing in the X and Y directions to generate a contour image showing the contour of the inclination of the surface of the work W. Further, from the calculated normal vector of each pixel, the same number of albedos of each pixel as the normal vector is calculated, and a texture drawing image showing a pattern in which the tilted state of the surface of the work W is removed is generated from the albedo. .. Since this method is a well-known method, detailed description thereof will be omitted. By synthesizing a plurality of luminance images based on the principle of photometric stereo, it is possible to generate a shape image showing the shape of the work W.

(マルチスペクトル照明)
他の実施形態として、マルチスペクトル照明が可能な照明装置2であってもよい。マルチスペクトル照明とは、波長が異なる光を、タイミングをずらしてワークWに照射することであり、印刷物(検査対象物)の色むらや汚れ等を検査するのに適している。たとえば、黄色、青色、赤色を順番にワークWに照射可能となるように、照明装置2を構成することができ、具体的には、多数色のLEDを有する照明装置2としてもよいし、液晶パネルや有機ELパネル等で照明装置2を構成してもよい。
(Multi-spectral lighting)
As another embodiment, the illuminating device 2 capable of multispectral illumination may be used. Multispectral illumination is to irradiate the work W with light having different wavelengths at different timings, and is suitable for inspecting color unevenness, stains, etc. of printed matter (inspection object). For example, the lighting device 2 can be configured so that the work W can be irradiated with yellow, blue, and red in order. Specifically, the lighting device 2 may have LEDs of a large number of colors, or may be a liquid crystal display. The lighting device 2 may be composed of a panel, an organic EL panel, or the like.

撮像装置3は、光が照射されるタイミングでワークWを撮像して複数の輝度画像を得る。そして、複数の輝度画像を合成して検査用画像を得ることができる。これをマルチスペクトルイメージングと呼ぶ。複数の輝度画像をマルチスペクトルイメージングにより合成することでワークWの形状を示す形状画像を生成することができる。尚、照射する光には紫外線や赤外線も含むことができる。 The image pickup device 3 takes an image of the work W at the timing when light is irradiated to obtain a plurality of luminance images. Then, a plurality of luminance images can be combined to obtain an inspection image. This is called multispectral imaging. A shape image showing the shape of the work W can be generated by synthesizing a plurality of luminance images by multispectral imaging. The light to be irradiated may include ultraviolet rays and infrared rays.

(カメラと画像検査アプリケーションとの接続インターフェース)
カメラ31は、GenICam規格に対応したGenICam規格対応カメラである。GenICam規格は、PCアプリケーションとカメラ31との接続インターフェースを標準化する規格であり、図7に示すように、主に設定装置4の本体部となるパーソナルコンピュータ上に構築する画像検査アプリケーション40からカメラ31を制御したり、カメラ31で撮像された画像を設定装置4の画像検査アプリケーション40で取得するインターフェースを標準化したものである。撮像装置3と設定装置4の画像検査アプリケーション40の双方がGenICam規格に対応していれば、カメラ31と、設定装置4の画像検査アプリケーション40とを接続することが可能になっている。画像検査アプリケーション40は、パーソナルコンピュータにインストールされたソフトウェアで構成される。尚、この実施形態では、カメラ31及び設定装置4が標準化規格としてGenICam規格に対応している場合について説明するが、標準化規格はGenICam規格に限られるものではなく、他の標準化規格であってもよい。
(Connection interface between camera and image inspection application)
The camera 31 is a GenICam standard compatible camera compatible with the GenICam standard. The GenICam standard is a standard for standardizing the connection interface between the PC application and the camera 31, and as shown in FIG. 7, the image inspection application 40 to the camera 31 built mainly on the personal computer which is the main body of the setting device 4 The interface for controlling the above and acquiring the image captured by the camera 31 with the image inspection application 40 of the setting device 4 is standardized. If both the image inspection device 3 and the image inspection application 40 of the setting device 4 support the GenICam standard, the camera 31 and the image inspection application 40 of the setting device 4 can be connected. The image inspection application 40 is composed of software installed on a personal computer. In this embodiment, the case where the camera 31 and the setting device 4 correspond to the GenICam standard as a standardization will be described, but the standardization standard is not limited to the GenICam standard, and other standardization standards may be used. Good.

画像検査アプリケーション40を階層構造に分解した場合を想定すると、GenICam層41は、画像検査アプリケーション40における実際に画像検査や欠陥検査等を行う上位の階層(検査部4A)と、具体的なネットワーク通信規格に基づき制御を行う階層42との間に位置する中間層の位置付けとなる。GenICam層41は、大きく2つの部分、GenApi41a及びGenTL(TL:Transport Layer)41bに分類することができる。GenApi41aは、カメラ31の設定項目と、カメラ31内部のレジスタアドレスの変換を行う部分である。このGenApi41aにより、画像検査アプリケーション40からはカメラ31の具体的なアドレスを指定することなく、抽象的に、露光時間であれば、「ExposureTime」、アナログゲインであれば「AnalogGain」といった文字列を引数に設定項目を指定し、カメラ31と接続した際に、カメラ31から取得したDeviceXML(詳細は後述する)と呼ばれるファイルを解析することで、その文字列(Featureと呼ばれる)に対応したレジスタアドレスを割り出すことができる。 Assuming that the image inspection application 40 is decomposed into a hierarchical structure, the GenICam layer 41 communicates with a higher layer (inspection unit 4A) that actually performs image inspection, defect inspection, etc. in the image inspection application 40 and specific network communication. It is positioned as an intermediate layer located between the layer 42 that controls based on the standard. The GenICam layer 41 can be roughly classified into two parts, GenApi41a and GenTL (TL: Transport Layer) 41b. The GenApi41a is a part that converts the setting items of the camera 31 and the register address inside the camera 31. With this GenApi41a, the image inspection application 40 does not specify the specific address of the camera 31, but abstractly, if it is an exposure time, it is an argument such as "ExposureTime", and if it is an analog gain, it is an argument such as "AnalogGain". By specifying the setting item in and analyzing the file called ExposureXML (details will be described later) acquired from the camera 31 when connecting to the camera 31, the register address corresponding to the character string (called Feature) can be obtained. Can be indexed.

GenTL41bは、画像検査アプリケーション40とカメラ31との間のデータの転送を制御するインターフェース(API)を規定したものであり、具体的には、カメラ31のレジスタへの書き込み、読み出しAPIの仕様及びカメラ31から転送した画像データの画像検査アプリケーション40の上位の層への受け渡しを行うAPIの仕様を規定したものである。 The GenTL41b defines an interface (API) that controls the transfer of data between the image inspection application 40 and the camera 31, and specifically, the specifications of the API for writing to and reading from the register of the camera 31 and the camera. It defines the specifications of the API that transfers the image data transferred from 31 to the upper layer of the image inspection application 40.

画像検査アプリケーション40とカメラ31を接続する物理的な規格は、高速ネットワークを使用した規格であればよく、例えば、Ethernetケーブル31aを利用したGigE Vision規格3Aと、USB3.0対応ケーブル31bを利用したUSB3Vision規格3Bとがある。よって、撮像装置3と設定装置4とは、ネットワークを介して接続されることになるが、このネットワークは、高速ネットワークケーブルを利用した有線であってもよいし、無線であってもよい。また、ネットワークは、Ethernetケーブル31aやUSB3.0対応ケーブル31b以外のケーブルを用いたネットワークであってもよく、特に限定されるものではない。 The physical standard for connecting the image inspection application 40 and the camera 31 may be a standard using a high-speed network. For example, a GigE Vision standard 3A using an Ethernet cable 31a and a USB3.0 compatible cable 31b are used. There is USB3Vision standard 3B. Therefore, the image pickup device 3 and the setting device 4 are connected via a network, and this network may be wired or wireless using a high-speed network cable. Further, the network may be a network using a cable other than the Ethernet cable 31a or the USB3.0 compatible cable 31b, and is not particularly limited.

GenICam規格は、物理的な通信規格として使用するものを具体的に特定しておらず、GenTL41bという形で抽象化した仕様を規定しているに留まっている。このGenTL41bの下位の階層42として、GigE Vision規格3AやUSB3Vision規格3Bといった、具体的な通信ネットワークを用いて通信規格が規定されている。具体的な通信規格は、GigE Vision規格3AやUSB3Vision規格3Bに限られるものではなく、GenICam規格に対応していればよい。図7では、GigE Vision規格3A及びUSB3Vision規格3Bの概念を説明するために、各規格に対応したカメラ31、31を設定装置4に接続した状態を示しているが、一方のカメラ31のみを設定装置4に接続して使用することができる。 The GenICam standard does not specifically specify what is used as a physical communication standard, but only defines an abstract specification in the form of GenTL41b. As the lower layer 42 of the GenTL41b, a communication standard is defined by using a specific communication network such as GigE Vision standard 3A or USB3 Vision standard 3B. The specific communication standard is not limited to the GigE Vision standard 3A and the USB3 Vision standard 3B, and may be compatible with the GenICam standard. FIG. 7 shows a state in which cameras 31 and 31 corresponding to each standard are connected to the setting device 4 in order to explain the concepts of the GigE Vision standard 3A and the USB3 Vision standard 3B, but only one camera 31 is set. It can be used by connecting to the device 4.

GenICam規格対応カメラ31には、DeviceXMLと呼ばれるファイル(DeviceXMLファイル)31cが記憶されている。DeviceXMLファイル31cは、カメラ31に内蔵された記憶装置(内部メモリ)に記憶されている。GenICam規格に対応した画像検査アプリケーション40では、画像検査アプリケーション40による設定対象であるカメラ31と接続する際に、そのカメラ31からDeviceXMLファイル31cを読み込む。DeviceXMLファイル31cの読み込みは、たとえば、カメラ31からDeviceXMLファイル31cをダウンロードする方法がある。ダウンロードされたDeviceXMLファイル31cはGenApi41aで保持される。DeviceXMLファイル31cのダウンロードは、画像検査アプリケーション40側からの要求によって行うことや、カメラ31との接続時に自動的に行うことができ、このDeviceXMLファイル31cのダウンロードにより、設定装置4はDeviceXMLファイル31cを取得できる。また、接続するカメラ31からダウンロードせずに、そのカメラ31に対応したDeviceXMLファイル31cを別の手段(例えばウェブサイトからのダウンロード)により入手して、接続時にGenApi41aに対して指定することも可能である。 The GenICam standard compatible camera 31 stores a file (DeviceXML file) 31c called a deviceXML. The DeviceXML file 31c is stored in a storage device (internal memory) built in the camera 31. The image inspection application 40 corresponding to the GenICam standard reads the DeviceXML file 31c from the camera 31 when connecting to the camera 31 which is the setting target by the image inspection application 40. To read the DeviceXML file 31c, for example, there is a method of downloading the DeviceXML file 31c from the camera 31. The downloaded DeviceXML file 31c is held by GenApi41a. The DeviceXML file 31c can be downloaded at the request of the image inspection application 40 or automatically when the camera 31 is connected. By downloading the DeviceXML file 31c, the setting device 4 downloads the DeviceXML file 31c. You can get it. It is also possible to obtain the DeviceXML file 31c corresponding to the camera 31 by another means (for example, download from a website) without downloading from the connected camera 31, and specify it for GenApi41a at the time of connection. is there.

DeviceXMLファイル31cには、カメラ31の内部に保持する全ての設定項目と、各設定項目の設定値が格納されるレジスタアドレス(レジスタ情報)とが関連付けられて記述されている。設定項目はFeatureと呼ばれ、各Featureには、個々のFeatureを特定するための文字列が割り当てられている。各Featureのノードには、具体的なレジスタアドレスが記載されたノードへの参照が記載される。レジスタ情報には、レジスタアドレスや、レジスタを特定する文字列も含まれる。 In the DeviceXML file 31c, all the setting items held inside the camera 31 and the register address (register information) in which the setting value of each setting item is stored are described in association with each other. The setting item is called a feature, and each feature is assigned a character string for specifying the individual feature. Each Featur node contains a reference to a node that contains a specific register address. The register information also includes a register address and a character string that identifies the register.

DeviceXMLファイル31cにおいて、たとえば、「ExposureTime」(露光時間設定)という名称のFeatureがあり、その属性が「ExposureTimeReg」というレジスタアドレスを参照するように指示されており、具体的なアドレスとして、ある値が記載されていたとする。カメラ31が異なれば、アドレスが異なる値になることがあるが、「ExposureTime」というFeatureの名称については共通である。このように、多くのカメラ31で共通した設定項目として存在するものを統一した名称で管理することで、画像検査アプリケーション40においてはカメラ31の機種の違いやメーカーの違いを意識することなく、カメラ31を設定、制御することが可能になる。 In the DeviceXML file 31c, for example, there is a Featur named "ExposureTime" (exposure time setting), and its attribute is instructed to refer to the register address "ExposureTimeReg", and a certain value is used as a specific address. It is assumed that it was described. If the cameras 31 are different, the addresses may have different values, but the name of the feature "ExposureTime" is common. In this way, by managing the setting items that are common to many cameras 31 with a unified name, the image inspection application 40 does not need to be aware of the difference in the model of the camera 31 or the difference in the manufacturer. 31 can be set and controlled.

上述したように、GenApi41aの階層では、DeviceXMLファイル31cの記載内容を解析することで、上位の階層である画像検査アプリケーション40から引数として渡されたFeature文字列をレジスタのアドレスに変換する。たとえば、「ExposureTime」というFeatureに対応したレジスタにある値(値:100.5)を書き込む場合、WriteRegister(アドレスの値,100.5)といったように、アドレスの値と、書き込む値との2つを引数とした関数を実行することで、GigE Vision規格3AまたはUSB3Vision規格3Bなど、物理通信規格を経由してカメラ31のレジスタの値を設定することができる。 As described above, in the hierarchy of GenApi41a, by analyzing the description contents of the DeviceXML file 31c, the Featur character string passed as an argument from the image inspection application 40, which is a higher hierarchy, is converted into the address of the register. For example, when writing a value (value: 100.5) in a register corresponding to the feature called "FunctionTime", there are two values, an address value and a write value, such as WriteRegister (address value, 100.5). By executing the function with the argument of, the value of the register of the camera 31 can be set via the physical communication standard such as GigE Vision standard 3A or USB3 Vision standard 3B.

尚、DeviceXMLファイル31cには、各メーカーで共通のFeatureとして盛り込むべきものが規定されているが、それ以外にベンダー独自のFeatureを定義することも可能である。独自性の高い機能を有しているカメラ31の場合、専用のFeatureを通じてカメラ31にアクセスすることで、汎用的なカメラに存在しない特殊な機能を利用することも可能である。 The DeviceXML file 31c stipulates what should be included as a common feature for each manufacturer, but it is also possible to define a vendor's own feature. In the case of the camera 31 having a highly unique function, it is possible to use a special function that does not exist in a general-purpose camera by accessing the camera 31 through a dedicated feature.

(撮像装置3の内部処理ユニット)
図8は、撮像装置3の内部処理の一例を概念的に示すフローチャートである。このフローチャートにおいて、位置補正1のグループは、当該グループに内包されるパターンサーチのユニットと位置補正のユニットとからなるように記載されているが、位置補正2〜5のグループは記載されていない。これは、図を簡略化するため、位置補正2〜5のグループを折り畳んであることによる。
(Internal processing unit of imaging device 3)
FIG. 8 is a flowchart conceptually showing an example of the internal processing of the image pickup apparatus 3. In this flowchart, the group of position correction 1 is described so as to include a pattern search unit and a position correction unit included in the group, but groups of position corrections 2 to 5 are not described. This is because the groups of position corrections 2 to 5 are folded to simplify the figure.

このフローチャートに示すように、複数のユニットの組み合わせで構成されている。ユニットは、撮像や画像処理を制御する単位であり、ユニットをフローチャート上で組み合わせることで、撮像装置3に所望の動作を実現させることができる。図8に示すフローチャートでは、ユニットを1つのステップとして記載している。 As shown in this flowchart, it is composed of a combination of a plurality of units. The unit is a unit that controls image pickup and image processing, and by combining the units on a flowchart, the image pickup apparatus 3 can realize a desired operation. In the flowchart shown in FIG. 8, the unit is described as one step.

たとえば、使用者の設定により、ある処理を行う機能を有効にした場合、その機能に対応したユニットを追加することで、処理を実行可能にすることができる。ユニットは、処理を実行するためのプログラムと、処理を実行するために必要なパラメータや、処理結果のデータを格納する記憶領域を一つにまとめたものと定義することができる。各処理は、図1に示す撮像制御部33で行うことができ、また、記憶領域は、撮像制御部33の記憶装置に確保することができる。尚、ユニットの概念自体は、GenICam規格に対応したカメラ31の外部仕様を実現する際に必須なものではない。 For example, when a function that performs a certain process is enabled by the user's setting, the process can be made executable by adding a unit corresponding to the function. A unit can be defined as a set of a program for executing a process, parameters required for executing the process, and a storage area for storing data of the process result. Each process can be performed by the image pickup control unit 33 shown in FIG. 1, and a storage area can be secured in the storage device of the image pickup control unit 33. The concept of the unit itself is not indispensable for realizing the external specifications of the camera 31 corresponding to the GenICam standard.

図8に示すフローチャートは、複数のユニットを縦方向及び横方向にフローチャート形式で並べたものであり、単にフローと呼ぶこともできる。複数のユニットを縦方向にのみ並べたフローチャートであってもよい。図8に示すフローチャートのスタートからエンドに向かって順に処理を実行していくが、途中に分岐ステップSB1を設けることで、分岐させることもできる。分岐した場合には、エンドまでの間に合流ステップSB2を設けることができ、これにより、合流させてからエンドに進むことができる。 The flowchart shown in FIG. 8 is a flow chart in which a plurality of units are arranged in the vertical direction and the horizontal direction, and may be simply called a flow. It may be a flowchart in which a plurality of units are arranged only in the vertical direction. The processing is executed in order from the start to the end of the flowchart shown in FIG. 8, but it is also possible to branch by providing the branch step SB1 in the middle. In the case of branching, a merging step SB2 can be provided before the end, whereby the merging step SB2 can be provided before proceeding to the end.

(パラメータセット)
画像検査アプリケーション40を実際の検査環境において動作させる場合、ワークWが切り替わったり、明るさなど、周囲の環境の変化を検知した場合には、撮像装置3の設定パラメータを動的に変更することがある。露光時間など、ごく限られたパラメータのみ変更する場合は、画像検査アプリケーション40から、それに対応したFeatureの値を直接書き込むことで対応することもできる。
(Parameter set)
When the image inspection application 40 is operated in an actual inspection environment, the setting parameters of the image pickup apparatus 3 may be dynamically changed when the work W is switched or a change in the surrounding environment such as brightness is detected. is there. When changing only a very limited parameter such as the exposure time, it can be dealt with by directly writing the corresponding Feature value from the image inspection application 40.

一方で、高機能な撮像装置3の場合、設定可能な項目の数が増え、ワークWの切り替え時などに、一度に変更すべきパラメータの数も多くなる。この場合、設定変更に要する時間が、パラメータの数に相関して長くなっていく。実際の画像検査ラインにおいては、ワークWが切り替わり、新しいワークWが撮像装置3の撮像視野範囲に到達してから当該視野範囲を外れるまでの時間が短いことが多く、一連の設定変更を高速に行いたいケースが出てくる。このようなときに、パラメータセットと呼ばれる機能を使用することがある。 On the other hand, in the case of the high-performance imaging device 3, the number of items that can be set increases, and the number of parameters that should be changed at one time also increases when the work W is switched. In this case, the time required to change the setting increases in correlation with the number of parameters. In an actual image inspection line, it is often the case that the work W is switched and the time from when the new work W reaches the imaging field of view of the imaging device 3 to when it goes out of the field of view is short, and a series of setting changes can be performed at high speed. There will be cases you want to do. At such times, a function called a parameter set may be used.

パラメータセットは、撮像装置3で撮像する際の各種パラメータの組合せを事前に複数パターン保有しておき、それぞれのパターンをパラメータセット番号によって管理できるようにしたものである。例えば、ワークWの品種が3種類あり、それぞれに異なるパラメータで撮像とその後の処理を行いたい場合、パラメータセットを3個用意しておく。 The parameter set holds a plurality of patterns of combinations of various parameters when imaging with the image pickup apparatus 3 in advance so that each pattern can be managed by the parameter set number. For example, if there are three types of work W and you want to perform imaging and subsequent processing with different parameters for each, prepare three parameter sets.

パラメータセットを利用すると、ワークWの撮像を行う前に、次に撮像するワークWの品種に対応したパラメータセット番号を指定するだけで、一連の設定変更を短時間で完了させることができる。画像検査アプリケーション40から見た場合、パラメータセット番号を指定するFeatureは、後述するセレクタの一種と考えることができる。 By using the parameter set, a series of setting changes can be completed in a short time by simply specifying the parameter set number corresponding to the type of the work W to be imaged next before imaging the work W. When viewed from the image inspection application 40, the feature that specifies the parameter set number can be considered as a kind of selector described later.

画像検査アプリケーション40側から設定する対象を切り替えるセレクタと、動作時に撮像装置3が内部的に参照するパラメータを切り替えるレジスタは、独立させることも、同一にすることも可能である。設定できるパラメータセットの数の上限は、撮像装置3の内部に設けられた内部メモリのパラメータ保持空間に限定される。 The selector for switching the target to be set from the image inspection application 40 side and the register for switching the parameter internally referenced by the image pickup apparatus 3 during operation can be independent or the same. The upper limit of the number of parameter sets that can be set is limited to the parameter holding space of the internal memory provided inside the image pickup apparatus 3.

パラメータセットの概念は、フィルター処理機能を保有した撮像装置3に展開することも可能である。たとえば、パラメータセットIndexが1の時は2値化フィルターを実行し、パラメータセットIndexが2の時は膨張フィルターを実行し、パラメータセットIndexが3の時はフィルターを非実行とするように、パラメータセットIndexに対応したパラメータを設定していたとする。このようにすることで、撮像と、フィルター処理として実行する内容を、パラメータセットIndexにより動的に切り替えることができる。 The concept of the parameter set can also be applied to the image pickup apparatus 3 having a filtering function. For example, when the parameter set Index is 1, the binarization filter is executed, when the parameter set Index is 2, the expansion filter is executed, and when the parameter set Index is 3, the filter is not executed. It is assumed that the parameters corresponding to the set Index have been set. By doing so, it is possible to dynamically switch between imaging and the content to be executed as the filtering process by the parameter set Index.

GenICam規格では、撮像パラメータを動的に切り替える機能をサポートしている。撮像装置3は、GenICam規格に則り、全ての設定パラメータをFeatureによってアクセスできるようにしている。撮像機能としては、照明装置2と撮像装置3とを同期させて複数パターンで撮像した画像を専用のアルゴリズムによって合成する機能(上述したデフレクトメトリの原理を利用した検査画像の生成)、波長が異なる光を照射して複数の画像を取得するマルチスペクトルイメージング機能など、複数の照明−撮像制御モードを有している。これらは、上記のパラメータセットごとに設定可能であり、条件に応じて動的に切り替えながら、撮像処理、フィルター処理、合成処理、画像出力を実行することが可能である。撮像機能によって生成される画像には、照明の点灯パターンを切り替えながら、イメージセンサで取得した画像そのものであってもよいし、上述した専用アルゴリズムによって合成された複数の画像が含まれていてもよい。 The GenICam standard supports the function of dynamically switching imaging parameters. The image pickup device 3 makes it possible to access all the setting parameters by the feature according to the GenICam standard. The image pickup function includes a function of synchronizing the lighting device 2 and the image pickup device 3 and synthesizing images captured in a plurality of patterns by a dedicated algorithm (generation of an inspection image using the above-mentioned principle of deflection metrics), and a wavelength. It has multiple illumination-imaging control modes, such as a multispectral imaging function that irradiates different lights to acquire multiple images. These can be set for each of the above parameter sets, and it is possible to execute imaging processing, filtering processing, compositing processing, and image output while dynamically switching according to conditions. The image generated by the imaging function may be the image itself acquired by the image sensor while switching the lighting pattern of the illumination, or may include a plurality of images synthesized by the above-mentioned dedicated algorithm. ..

フィルター処理は、同一パラメータセット内に、複数のパターンを設定することが可能である。例えば、上述の撮像機能では、一連の撮像実行により、複数パターンの画像が生成されることになるが、そこで生成された異なる複数の画像に対して、個別にフィルター処理を施すことが可能である。また、別のパターンでは、同一の画像に対して、特定の領域の範囲(ROI:Region Of Interest)を設定した上で、それぞれの領域内部のみをフィルター処理することも可能である。特定の領域の範囲の設定は、たとえばキーボード6やマウス7の操作によって行うことができる。特定の領域は、1つであってもよいし、複数であってもよい。特定の領域の大きさは任意に設定することができる。 In the filtering process, it is possible to set a plurality of patterns in the same parameter set. For example, in the above-mentioned imaging function, a plurality of patterns of images are generated by executing a series of imaging, and it is possible to individually filter a plurality of different images generated there. .. Further, in another pattern, it is possible to set a specific region range (ROI: Region Of Interest) for the same image and then filter only the inside of each region. The range of a specific area can be set by, for example, operating the keyboard 6 or the mouse 7. The specific area may be one or a plurality. The size of a specific area can be set arbitrarily.

フィルター処理は、同一の画像に対して複数種類を多段階に繰り返し設定することができる多段階フィルターであってもよい。たとえば、ある画像に対して膨張フィルター処理を実行した後、その画像に対して2値化フィルター処理を実行することができる。フィルター処理は多段階フィルターに限られるものではなく、1つのフィルター処理であってもよい。 The filter processing may be a multi-step filter in which a plurality of types can be repeatedly set in multiple steps for the same image. For example, after performing expansion filtering on a certain image, binarization filtering can be performed on that image. The filtering process is not limited to the multi-step filter process, and may be a single filtering process.

GenICam規格の撮像パラメータを動的に切り替える機能を利用し、図8に示すように複数のパラメータセットを1つのフローチャートにまとめることができる。撮像装置3の内部処理フローチャート上で、分岐ステップSB1から合流ステップSB2までの間のフローチャートを形成するユニット群をまとめてパラメータセットと呼ぶ。図8に示す例では、4つのパラメータセット、即ち、第1〜第4パラメータセットを有している。つまり、使用者により設定された処理を実現するための複数のセレクタの値の組み合わせが複数パターン存在している。第1〜第4パラメータセットのいずれを選択するかは、使用者が設定することができ、たとえば、パラメータセット番号1を選択すると第1パラメータセットが自動的に選択される。 By utilizing the function of dynamically switching the imaging parameters of the GenICam standard, it is possible to combine a plurality of parameter sets into one flowchart as shown in FIG. On the internal processing flowchart of the image pickup apparatus 3, the unit group forming the flowchart from the branch step SB1 to the merging step SB2 is collectively called a parameter set. The example shown in FIG. 8 has four parameter sets, that is, first to fourth parameter sets. That is, there are a plurality of patterns of combinations of values of a plurality of selectors for realizing the process set by the user. Which of the first to fourth parameter sets is selected can be set by the user. For example, when the parameter set number 1 is selected, the first parameter set is automatically selected.

図8に示すフローチャートのスタート後、分岐ステップSB1において第1〜第4パラメータセットのいずれかのパラメータセットを構成する各ユニットを経た後、合流ステップSB2で合流し、エンドに進むことができる。パラメータセット番号1が選択されていると、分岐ステップSB1において分岐番号が1になり、第1パラメータセットの各処理を実行する。パラメータセット番号2が選択されていると、分岐ステップSB1において分岐番号が2になり、第2パラメータセットの各処理を実行する。パラメータセット番号3が選択されていると、分岐ステップSB1において分岐番号が3になり、第3パラメータセットの各処理を実行する。パラメータセット番号4が選択されていると、分岐ステップSB1において分岐番号が4になり、第4パラメータセットの各処理を実行する。パラメータセットの数は4つに限られるものではなく、任意に設定することができる。 After the start of the flowchart shown in FIG. 8, in the branching step SB1, after passing through each unit constituting any of the first to fourth parameter sets, they can be merged in the merging step SB2 and proceed to the end. When the parameter set number 1 is selected, the branch number becomes 1 in the branch step SB1, and each process of the first parameter set is executed. When the parameter set number 2 is selected, the branch number becomes 2 in the branch step SB1, and each process of the second parameter set is executed. When the parameter set number 3 is selected, the branch number becomes 3 in the branch step SB1, and each process of the third parameter set is executed. When the parameter set number 4 is selected, the branch number becomes 4 in the branch step SB1, and each process of the fourth parameter set is executed. The number of parameter sets is not limited to four and can be set arbitrarily.

パラメータセットの具体例を図9及び図10に示す。図9は、デフレクトメトリの原理を利用した検査画像の生成を行う場合のパラメータセットである。ユニットUA1では、デフレクトメトリの原理を利用した検査画像の生成を行うべく、1回のトリガ信号で複数の撮像処理を実行し、ユニットUA2では膨張フィルター処理を実行し、ユニットUA3では平均化フィルター処理を実行し、ユニットUA4では濃淡反転処理を実行する。つまり、ユニットUA1で撮像された撮像画像に対して、フィルター処理を含むパラメータセットで定義された多段階の処理が逐次的に実行される。その後、ユニットUA5では、多段階の処理が逐次的に実行された画像データをPCへ転送、即ち外部機器である設定装置4等へ出力する。尚、画像データを転送することなく、内部に保持しておいてもよい。パラメータセットによっては、多段階の処理を行わないように設定することもできる。設定装置4に転送された場合、図7に示す画像検査アプリケーション40の検査部4Aにおいて欠陥検査、良否判定を行うことができる。欠陥検査及び良否判定のアルゴリズムは従来から周知のものを使用することができる。 Specific examples of the parameter set are shown in FIGS. 9 and 10. FIG. 9 is a parameter set for generating an inspection image using the principle of deflation metrics. The unit UA1 executes a plurality of imaging processes with one trigger signal in order to generate an inspection image using the principle of deflection metric, the unit UA2 executes an expansion filter process, and the unit UA3 performs an averaging filter. The processing is executed, and the unit UA4 executes the shading inversion processing. That is, the multi-step processing defined by the parameter set including the filter processing is sequentially executed for the captured image captured by the unit UA1. After that, the unit UA5 transfers the image data in which the multi-step processing is sequentially executed to the PC, that is, outputs the image data to the setting device 4 or the like which is an external device. The image data may be stored inside without being transferred. Depending on the parameter set, it is possible to set not to perform multi-step processing. When transferred to the setting device 4, the inspection unit 4A of the image inspection application 40 shown in FIG. 7 can perform defect inspection and pass / fail judgment. Conventionally known algorithms for defect inspection and quality determination can be used.

一方、図10は、マルチスペクトルイメージングにより検査画像の生成を行う場合のパラメータセットである。ユニットUB1ではマルチスペクトルイメージングにより検査画像の生成を行うべく、1回のトリガ信号で複数の撮像処理を実行し、ユニットUB2では、ある領域(領域0)に対して二値化フィルター処理を実行し、ユニットUB3では、領域0とは別の領域(領域1)に対して膨張フィルター処理を実行する。つまり、この例でも、ユニットUB1で撮像された撮像画像に対して、フィルター処理を含むパラメータセットで定義された多段階の処理が逐次的に実行される。その後、ユニットUB4では処理を非実行とする。ユニットUB5では図9に示す場合と同様に画像データをPCへ転送する。この例のように、パラメータセット内には処理を行わないユニット、即ち無効化されたユニットが存在していてもよく、有効化されたユニットと無効化されたユニットとが混在したパラメータセットであってもよい。 On the other hand, FIG. 10 is a parameter set when an inspection image is generated by multispectral imaging. The unit UB1 executes a plurality of imaging processes with one trigger signal in order to generate an inspection image by multispectral imaging, and the unit UB2 executes a binarization filter process for a certain region (region 0). , Unit UB3 executes an expansion filter process on a region (region 1) different from the region 0. That is, also in this example, the multi-step processing defined by the parameter set including the filter processing is sequentially executed for the captured image captured by the unit UB1. After that, the unit UB4 does not execute the process. The unit UB5 transfers the image data to the PC in the same manner as shown in FIG. As in this example, there may be units that are not processed, that is, invalidated units in the parameter set, and the parameter set is a mixture of enabled units and invalidated units. You may.

したがって、撮像装置3は、設定装置4で設定されたとおり、撮像した画像に対して多段階の処理を順序立てて実行することができるので、使用者は順序性のある手順を自由に設定することができ、複雑な画像処理を撮像装置3に行わせることができる。尚、露光時間のように順序性が無い設定も反映させることができる。 Therefore, since the image pickup device 3 can execute the multi-step processing in order for the captured image as set by the setting device 4, the user can freely set an ordered procedure. This allows the image pickup apparatus 3 to perform complicated image processing. It is also possible to reflect settings that are not in order, such as exposure time.

(ユニットの種類)
ユニットには複数の種類があり、たとえば、検査領域を決定するパターンサーチ処理を行うパターンサーチユニット、位置補正ユニット、内部で画像の位置補正や色抽出、フィルター処理などを行う画像演算ユニット、あるいは、これらの比較的単純な処理を行うユニットを複合させて高機能化させたものなどがある。各ユニットは、撮像装置3が撮像した撮像画像を外部に出力する前に、当該撮像画像に対して適用される処理を実行するためのユニットであり、図9や図10に示すように撮像画像に対して多段階の処理を行うように配置することができる。
(Unit type)
There are multiple types of units, for example, a pattern search unit that performs pattern search processing to determine the inspection area, a position correction unit, an image calculation unit that internally performs image position correction, color extraction, filtering, etc., or Some of these units that perform relatively simple processing are combined to enhance their functionality. Each unit is a unit for executing a process applied to the captured image before outputting the captured image captured by the imaging device 3 to the outside, and is a captured image as shown in FIGS. 9 and 10. Can be arranged to perform multi-step processing.

パターンサーチユニットは、撮像装置3が撮像したワークWを含む画像のなかから、当該ワークWや、ワークWにおける検査対象部分をサーチし、撮像画像中のワークWの位置補正を行うためのユニットである。たとえば、画像検査システム1の設定時に、ワークWを撮像した画像上で、周知のエッジ検出手法によってエッジ検出を行い、検出したエッジにより特定される領域をワークW、またはワークWの検査対象部分のモデル(サーチ用モデル画像)として撮像装置3の記憶装置に記憶させておくことができる。エッジ検出処理自体は従来から周知の手法を用いることができ、例えば、輝度画像上の各画素の画素値を取得し、輝度画像上の画素値の変化がエッジ検出用のしきい値以上となる領域が存在する場合に、その境界部分がエッジであるとして抽出する。エッジ抽出の閾値は使用者が任意に調整することができる。 The pattern search unit is a unit for searching the work W and the inspection target portion in the work W from the images including the work W captured by the imaging device 3 and correcting the position of the work W in the captured image. is there. For example, when the image inspection system 1 is set, edge detection is performed on the image obtained by capturing the work W by a well-known edge detection method, and the area specified by the detected edge is the work W or the inspection target portion of the work W. It can be stored in the storage device of the image pickup device 3 as a model (model image for search). A well-known method can be used for the edge detection process itself. For example, the pixel value of each pixel on the luminance image is acquired, and the change in the pixel value on the luminance image becomes equal to or greater than the threshold value for edge detection. If the area exists, the boundary part is extracted as an edge. The edge extraction threshold can be arbitrarily adjusted by the user.

画像検査システム1の設定後、画像検査システム1の運用時には、順次搬送されてくるワークWを撮像して検査用画像を得て、パターンサーチユニットが、得られた検査用画像上でワークWまたはワークWの検査対象部分の有無を、上記記憶されているモデルに基づいてサーチ処理を行うとともに、サーチ処理によってワークWの位置と角度を計測する。ワークWの位置はX座標及びY座標で特定することができる。また、ワークWの角度は、撮像装置Wの光軸回りの角度とすることや、図1に示すZ軸周りの角度とすることができる。 After setting the image inspection system 1, when the image inspection system 1 is in operation, the work W that is sequentially conveyed is imaged to obtain an inspection image, and the pattern search unit uses the work W or the work W or the obtained inspection image on the obtained inspection image. The presence or absence of the inspection target portion of the work W is searched based on the stored model, and the position and angle of the work W are measured by the search process. The position of the work W can be specified by the X coordinate and the Y coordinate. Further, the angle of the work W can be an angle around the optical axis of the image pickup apparatus W or an angle around the Z axis shown in FIG.

位置補正ユニットは、撮像装置3が撮像したワークWを含む画像のなかから、当該ワークWや、ワークWにおける検査対象部分をパターンサーチユニットでサーチし、ワークWの位置と角度を計測した後に、画像中のワークWの位置補正を行うためのユニットである。画像検査システム1の運用時には、複数のワークWが常に同じ位置及び姿勢で搬送されてくるとは限らず、様々な位置にあるワークWや様々な姿勢のワークWが搬送されてくることがある。パターンサーチユニットでワークWの基準となる部分をサーチしてから位置補正ユニットで位置補正することができるので、ワークWの基準となる部分が、常に一定の位置となり、かつ、ワークWが所定の姿勢となるように、画像を回転させたり、画像を縦方向や横方向に移動させることにより、位置補正を行う。位置補正を行うための位置補正ツールは、たとえばパターンサーチ等、複数の種類のツールを用意しておくことができる。 The position correction unit searches the image including the work W captured by the imaging device 3 with the pattern search unit for the work W and the inspection target portion in the work W, measures the position and angle of the work W, and then measures the position and angle of the work W. This is a unit for correcting the position of the work W in the image. When operating the image inspection system 1, a plurality of work Ws are not always transported in the same position and posture, and work Ws in various positions and work Ws in various postures may be transported. .. Since the pattern search unit can search the reference part of the work W and then the position correction unit can correct the position, the reference part of the work W is always at a constant position and the work W is predetermined. Position correction is performed by rotating the image or moving the image in the vertical or horizontal direction so that it is in the posture. As a position correction tool for performing position correction, a plurality of types of tools such as a pattern search can be prepared.

画像演算ユニットは、複数の種類があり、たとえば、フィルター処理を行うユニット、撮像装置3で撮像された複数の画像を合成する合成処理を行うユニット、デフレクトメトリ処理を行うユニット、フォトメトリックステレオ法を利用して検査用画像を生成するユニット、マルチスペクトルイメージングを行うユニット等がある。フィルター処理の種類は複数あるので、フィルター処理を行うユニットは、たとえば二値化フィルター、膨張フィルター等、複数の種類設けることができる。デフレクトメトリ処理による検査画像の生成は、上述したように複数の処理を経るので、処理毎にユニットを設けてもよく、正反射成分画像を生成するユニット、拡散反射成分画像を生成するユニット、参照位相差分画像を生成するユニット等を設けることができる。 There are a plurality of types of image calculation units, for example, a unit that performs filtering processing, a unit that performs compositing processing that synthesizes a plurality of images captured by the image pickup device 3, a unit that performs deflection metrics processing, and a photometric stereo method. There are units that generate inspection images, units that perform multispectral imaging, and the like. Since there are a plurality of types of filtering, a plurality of types of units for performing filtering can be provided, for example, a binarizing filter and an expansion filter. Since the generation of the inspection image by the deflection matrix processing undergoes a plurality of processes as described above, a unit may be provided for each process, and a unit for generating a specular reflection component image, a unit for generating a diffuse reflection component image, A unit or the like for generating a reference phase difference image can be provided.

(前処理モジュール)
図11は前処理モジュールの例を示すものである。前処理モジュールは、パターンサーチユニットと位置補正ユニットとからなるグループと、画像演算ユニットとが合わさったものとすることができるが、これは一例であり、1つのグループのみからなる前処理モジュールであってもよいし、他の任意のユニットを組み合わせた前処理モジュールであってもよい。前処理モジュールには、番号が付されており、「前処理モジュール0」、「前処理モジュール1」等と区別することができる。
(Pretreatment module)
FIG. 11 shows an example of a preprocessing module. The preprocessing module can be a combination of a group consisting of a pattern search unit and a position correction unit and an image calculation unit, but this is an example and is a preprocessing module consisting of only one group. It may be a preprocessing module in which any other unit is combined. The pre-processing modules are numbered and can be distinguished from "pre-processing module 0", "pre-processing module 1" and the like.

機能の拡張性を高めるために、前処理モジュールは複数追加することや設定することができ、それぞれは、たとえば「前処理モジュール0(PreprocessingModule0)」、「前処理モジュール1(PreprocessingModule1)」といったインデックスで識別される。 Multiple pre-processing modules can be added or set in order to enhance the extensibility of functions, and each has an index such as "pre-processing module 0 (Pre-processing Module 0)" and "pre-processing module 1 (Pre-processing Module 1)". Be identified.

(セレクタ)
図8に示すフローチャートの任意の1つのパラメータセットには、複数の前処理モジュールを追加することが可能である。たとえば、パターンサーチ処理を実行するための設定パラメータや、フィルター処理を実行するための設定パラメータにより、任意の前処理モジュールを追加することができる。
(selector)
A plurality of preprocessing modules can be added to any one parameter set in the flowchart shown in FIG. For example, an arbitrary preprocessing module can be added by the setting parameter for executing the pattern search process and the setting parameter for executing the filter process.

しかし、それぞれの前処理モジュールに個別の設定レジスタを設けると、同じレジスタ(Feature)が繰り返し現れることになるので、冗長になってしまう。この実施形態では、セレクタを用いることで、編集対象(設定対象)を動的に切り替えることができるようにしている。セレクタで切り替えることができる設定対象としては、たとえば、パラメータセット(分岐番号)、前処理モジュール番号、多段フィルターの場合のフィルター段数(何段目のフィルターを設定しているか)等である。つまり、パラメータセット番号を指定するFeatureや、前処理モジュール番号を指定するFeature、フィルター段数を指定するFeatureは、セレクタの一種である。このセレクタの値は、当該セレクタの値が格納される場所を示すレジスタ情報と共に、DeviceXMLファイルに含まれている。したがって、撮像装置3が撮像した撮像画像を外部に出力する前に、当該撮像画像に対して適用される多段階の処理を設定するための設定項目に関連付けられた複数のセレクタと、各セレクタの値が格納される場所を示すレジスタ情報とがDeviceXMLファイルには含まれることになる。 However, if individual setting registers are provided for each preprocessing module, the same register (Fature) will appear repeatedly, resulting in redundancy. In this embodiment, the editing target (setting target) can be dynamically switched by using the selector. The setting targets that can be switched by the selector are, for example, the parameter set (branch number), the preprocessing module number, the number of filter stages in the case of a multi-stage filter (how many stages the filter is set), and the like. That is, the Feature that specifies the parameter set number, the Feature that specifies the preprocessing module number, and the Feature that specifies the number of filter stages are a kind of selector. The value of this selector is included in the DeviceXML file, along with register information indicating where the value of the selector is stored. Therefore, before outputting the captured image captured by the imaging device 3 to the outside, a plurality of selectors associated with the setting items for setting the multi-step processing applied to the captured image, and each selector The DeviceXML file will contain register information indicating where the values are stored.

(多段セレクタ)
図8に示すように、フローチャートはパラメータセットによって横方向に分岐し、それぞれのパラメータセットの内部では、たとえば前処理モジュールを複数追加することができるようになっている。さらに、1つの前処理モジュールの中では、複数段の前処理(フィルター処理等)を設定することができる。設定用ユーザーインターフェース50の設定項目が関連付けられているFeatureと、そのFeatureによって実際に編集されるパラメータの実体を保持する編集対象のユニットとの関係は、これらのセレクタを複数段階経ることで特定される。この実施形態においては、セレクタの役割としては、大きく分けて、パラメータセットの指定、フィルター処理の指定、多段フィルターの指定の3つがあり、パラメータセットの指定が最上位に位置し、パラメータセットの下にフィルター処理の指定、フィルター処理の指定の下に多段フィルターの指定が位置する関係になるが、これに限られるものではない。フィルター処理を指定するセレクタは、パラメータセットを切り替えれば、異なるパラメータセット(フローチャート)の内部を指すことになる。さらに多段フィルターの指定によって、フィルター処理の内部に多段階に設定される実際のフィルターの設定が特定される。このように複数のセレクタの値の組み合わせにより、そのFeatureが関連づけられるパラメータを保持するユニットを特定することができる。尚、パラメータセットを指定するセレクタを切り替えた場合、少なくともパラメータの設定対象は切り替わるが、実行対象まで切り替わるかどうかは実装に依存する。
(Multi-stage selector)
As shown in FIG. 8, the flowchart is laterally branched according to the parameter set, and inside each parameter set, for example, a plurality of preprocessing modules can be added. Further, in one preprocessing module, a plurality of stages of preprocessing (filter processing, etc.) can be set. The relationship between the feature to which the setting items of the setting user interface 50 are associated and the unit to be edited that holds the substance of the parameter actually edited by the feature is specified by going through these selectors in a plurality of steps. To. In this embodiment, the role of the selector is roughly divided into three, parameter set specification, filter processing specification, and multi-stage filter specification. The parameter set specification is located at the highest level and is below the parameter set. The specification of the multi-stage filter is located under the specification of the filtering process and the specification of the filtering process, but it is not limited to this. The selector that specifies the filtering process will point to the inside of a different parameter set (flow chart) if the parameter set is switched. Furthermore, the specification of the multi-stage filter specifies the actual filter settings that are set in multiple stages inside the filtering process. By combining the values of the plurality of selectors in this way, it is possible to specify the unit that holds the parameter to which the feature is associated. When the selector that specifies the parameter set is switched, at least the parameter setting target is switched, but whether or not it is switched to the execution target depends on the implementation.

たとえば、図12に示すフローチャートにおいて、2重線で囲まれたユニットUXを特定する場合には、最上位のパラメータセットのセレクタがパラメータセット番号3であること、前処理モジュールのセレクタIndexが1であることの2つの値が決まることで、ユニットUXを特定することができる。セレクタの値で決めることができるのは、たとえば、パターンサーチユニット、位置補正ユニット、画像演算ユニット(フィルター処理ユニットを含む)などである。そして、アクセスするFeature名称に基づいて、パターンサーチユニット、位置補正ユニット、画像演算ユニットのどのユニットに属するFeatureなのかを画像検査アプリケーション40側から特定することで、目的とするユニットUXの保持するパラメータに辿り着くことができる。 For example, in the flowchart shown in FIG. 12, when the unit UX surrounded by the double line is specified, the selector of the uppermost parameter set is the parameter set number 3, and the selector Index of the preprocessing module is 1. The unit UX can be specified by determining the two values of something. For example, a pattern search unit, a position correction unit, an image calculation unit (including a filter processing unit), and the like can be determined by the value of the selector. Then, based on the feature name to be accessed, the parameter held by the target unit UX can be specified from the image inspection application 40 side to which unit of the pattern search unit, the position correction unit, and the image calculation unit belongs to the feature. Can be reached.

(設定装置4の構成)
設定装置4は、使用者により設定された各設定項目の設定値と、DeviceXMLファイル31cに含まれる各設定項目に対応するレジスタ情報を示すデータを撮像装置3に送信し、当該撮像装置3の設定を行うための装置である。
(Configuration of setting device 4)
The setting device 4 transmits to the imaging device 3 data indicating the setting values of each setting item set by the user and the register information corresponding to each setting item included in the DeviceXML file 31c, and sets the imaging device 3. It is a device for performing.

図7に示すように、設定装置4は、UI生成部4aを備えている。UI生成部4aは、各種ユーザーインターフェースを生成する部分であり、たとえば図13に示す設定用ユーザーインターフェース50を生成することができるように構成されている。UI生成部4aで生成された各種ユーザーインターフェースは表示部5に表示される。 As shown in FIG. 7, the setting device 4 includes a UI generation unit 4a. The UI generation unit 4a is a part that generates various user interfaces, and is configured to be able to generate, for example, the setting user interface 50 shown in FIG. Various user interfaces generated by the UI generation unit 4a are displayed on the display unit 5.

設定用ユーザーインターフェース50には、編集対象を切り替えるための第1領域50aと、設定項目の表示及び変更を行うための第2領域50bと、編集対象である画像を表示する画像表示領域50cとが設けられている。第1領域50aには、編集対象となる画像を切り替えるための画像切替操作領域51が設けられている。画像切替操作領域51には、撮像装置3で撮像された画像の識別情報がリスト形式で表示される。画像の識別情報は、たとえば画像の名称や画像に付された番号等を挙げることができる。この例では、4つの画像の名称が縦方向に並ぶように表示されているが、表示される画像の数や並び方向は任意に設定することができる。使用者は、キーボード6やマウス7の操作により、画像切替操作領域51に表示されている画像の名称の中から任意の名称を選択することができる。名称が選択されると、UI生成部4aは選択された名称に対応する画像を画像表示領域50cに表示させる。画像表示領域50cに表示された画像は、変更することもできる。 The setting user interface 50 includes a first area 50a for switching an editing target, a second area 50b for displaying and changing setting items, and an image display area 50c for displaying an image to be edited. It is provided. The first area 50a is provided with an image switching operation area 51 for switching an image to be edited. In the image switching operation area 51, the identification information of the image captured by the image pickup device 3 is displayed in a list format. Examples of the image identification information include the name of the image and the number attached to the image. In this example, the names of the four images are displayed so as to be arranged vertically, but the number and arrangement directions of the displayed images can be arbitrarily set. The user can select an arbitrary name from the names of the images displayed in the image switching operation area 51 by operating the keyboard 6 and the mouse 7. When the name is selected, the UI generation unit 4a displays the image corresponding to the selected name in the image display area 50c. The image displayed in the image display area 50c can also be changed.

第2領域50bには、設定項目としての位置補正設定を行うための位置補正設定領域52と、設定項目としてのフィルター処理設定を行うためのフィルター設定領域53とが設けられている。位置補正設定領域52には、位置補正設定に対応するFeatureとして、位置補正を有効にするか否かの選択を行う部分と、位置補正ツールの種別選択を行う部分とが割り当てられて表示される。位置補正ツールの種別選択は、位置補正を有効にすることで初めて設定可能になるので、位置補正を有効にするか否かの選択と、位置補正ツールの種別選択とは、依存関係にある。 The second area 50b is provided with a position correction setting area 52 for setting a position correction as a setting item and a filter setting area 53 for performing a filter processing setting as a setting item. In the position correction setting area 52, a part for selecting whether or not to enable position correction and a part for selecting the type of the position correction tool are assigned and displayed as a feature corresponding to the position correction setting. .. Since the type selection of the position correction tool can be set only by enabling the position correction, the selection of whether or not to enable the position correction and the type selection of the position correction tool have a dependency relationship.

フィルター設定領域53には、フィルター処理設定に対応するFeatureとして、選択されたフィルターの種類と、抽出サイズや抽出色といったフィルターの設定に関するパラメータを選択、調整する部分とが割り当てられて表示される。画像切替操作領域51で選択された1つの画像に対して複数種類のフィルター処理が行われる場合があり、その場合には、フィルター設定領域53が複数設けられ、各フィルター処理設定に対応するFeatureが割り当てられて表示される。 In the filter setting area 53, as a feature corresponding to the filter processing setting, a selected filter type and a portion for selecting and adjusting parameters related to the filter setting such as the extraction size and the extraction color are assigned and displayed. A plurality of types of filter processing may be performed on one image selected in the image switching operation area 51. In that case, a plurality of filter setting areas 53 are provided, and a feature corresponding to each filter processing setting is provided. Assigned and displayed.

使用者による設定作業について説明する。使用者が画像切替操作領域51に表示されている画像の名称のうち、任意の1つを選択すると、選択された名称の画像が画像表示領域50cに表示される。この選択された画像を生成するためのパラメータが編集、設定可能なものについては、第2領域50bの表示が自動的に切り替わる。内部的には、例えば画像切替操作領域51で、ある前処理画像を選択した場合、その画像を生成するために使用する前処理モジュールに対応したインデックスの値に、設定対象を指定するセレクタの値が切り替わり、これにより、第2領域50bに表示する設定内容が画像に応じて切り替わる。設定対象を指定するセレクタの値が指定されると、その値に対応したセレクタが指し示す前処理モジュールの一つ又は複数のFeatureを読み取り、設定項目を反映した画像を生成して画像表示領域50cに表示し、位置補正設定領域52やフィルター設定領域53にそれぞれのパラメータに設定された値を表示する。位置補正設定領域52やフィルター設定領域53に表示された操作部分を使用者が操作すると、その操作が受け付けられて、設定対象を指定するセレクタの値に対応した前処理モジュールに該当するユニットの設定項目が変更される。 The setting work by the user will be described. When the user selects any one of the image names displayed in the image switching operation area 51, the image with the selected name is displayed in the image display area 50c. If the parameters for generating the selected image can be edited and set, the display of the second area 50b is automatically switched. Internally, for example, when a certain preprocessed image is selected in the image switching operation area 51, the value of the selector that specifies the setting target is set to the index value corresponding to the preprocessing module used to generate the image. Is switched, and as a result, the setting contents to be displayed in the second area 50b are switched according to the image. When the value of the selector that specifies the setting target is specified, one or more features of the preprocessing module pointed to by the selector corresponding to that value are read, an image that reflects the setting item is generated, and the image display area 50c is displayed. It is displayed, and the values set for each parameter are displayed in the position correction setting area 52 and the filter setting area 53. When the user operates the operation part displayed in the position correction setting area 52 or the filter setting area 53, the operation is accepted and the unit corresponding to the preprocessing module corresponding to the value of the selector that specifies the setting target is set. The item is changed.

セレクタの値からアクセス対象のユニットを特定する方法は、以下の方法を使用することができる。すなわち、前処理モジュールは複数のユニットから構成されており、前処理モジュールのインデックスを切り替えるセレクタは、これらユニットで共通したものを使用することができ、前処理モジュールを構成する複数のユニットに対して、どのFeatureがどのユニットに属するかは、Feature名称によって一意に定まるように命名することが可能である。これにより、セレクタの値と、編集対象として選択されているFeatureの組合せからアクセス対象のユニットを特定することができる。 The following method can be used to identify the unit to be accessed from the selector value. That is, the preprocessing module is composed of a plurality of units, and the selector for switching the index of the preprocessing module can be the one common to these units, and for the plurality of units constituting the preprocessing module. , Which feature belongs to which unit can be named so as to be uniquely determined by the feature name. As a result, the unit to be accessed can be specified from the combination of the selector value and the feature selected as the editing target.

図14は、パラメータセット番号の選択によって設定用ユーザーインターフェース50の第2領域50bが切り替えられる場合を模式的に示した図であり、この図に示すようにユーザーインターフェースの表示を切り替えることができる。たとえば、図14の左側に示すようなパラメータセット番号選択部54を設定用ユーザーインターフェース50に設けておく。また、図14の右側に示すように、第1パラメータセットの設定用ユーザーインターフェース50Aと、第2パラメータセットの設定用ユーザーインターフェース50Bと、第3パラメータセットの設定用ユーザーインターフェース50Cと、第4パラメータセットの設定用ユーザーインターフェース50Dとがパラメータ番号と関連付けられた状態で存在している。パラメータセット番号選択部54でパラメータセット番号が切り替わると、UI生成部4aは、設定用ユーザーインターフェース50を、そのパラメータセット番号に合わせて再構築する。すなわち、使用者がパラメータセット番号3を選択すると、パラメータセット番号3の設定用ユーザーインターフェース50Cが生成されて表示部5に表示される。 FIG. 14 is a diagram schematically showing a case where the second area 50b of the setting user interface 50 is switched by selecting the parameter set number, and the display of the user interface can be switched as shown in this figure. For example, the parameter set number selection unit 54 as shown on the left side of FIG. 14 is provided in the setting user interface 50. Further, as shown on the right side of FIG. 14, the user interface 50A for setting the first parameter set, the user interface 50B for setting the second parameter set, the user interface 50C for setting the third parameter set, and the fourth parameter The set setting user interface 50D exists in association with the parameter number. When the parameter set number is switched by the parameter set number selection unit 54, the UI generation unit 4a reconstructs the setting user interface 50 according to the parameter set number. That is, when the user selects the parameter set number 3, the user interface 50C for setting the parameter set number 3 is generated and displayed on the display unit 5.

図15は、パラメータセット番号の選択によってパラメータセットが切り替えられる内部的な仕組みを概念的に説明する図である。撮像装置3は、パラメータセットの切替を実行するパラメータセット切替部30dを有している。パラメータセット切替部30dには、使用者が選択したパラメータセット番号(ParameterSetIndex)が入力される。パラメータセット切替部30dは、入力されたパラメータセット番号に対応したパラメータセットを選択し、選択したパラメータセットを撮像素子3cに適用する。 FIG. 15 is a diagram conceptually explaining an internal mechanism in which a parameter set is switched by selecting a parameter set number. The image pickup apparatus 3 has a parameter set switching unit 30d that executes parameter set switching. The parameter set number (ParameterSetIndex) selected by the user is input to the parameter set switching unit 30d. The parameter set switching unit 30d selects a parameter set corresponding to the input parameter set number, and applies the selected parameter set to the image sensor 3c.

したがって、設定装置4は、設定用ユーザーインターフェース50を表示部5に表示し、当該設定用ユーザーインターフェース50上で使用者による各種設定を受け付けることができる。撮像装置3が撮像した画像に対して多段階の処理を実行するように、使用者が設定すると、設定装置4は、その使用者により設定された多段階の処理を実現するための複数のセレクタの値の組み合わせを多段セレクタとして特定し、当該複数のセレクタの値と、当該複数のセレクタが格納される場所を示すレジスタ情報とを撮像装置3に送信することが可能に構成されている。そして、撮像装置3は、設定装置4から送信された複数のセレクタの値と、当該複数のセレクタが格納される場所を示すレジスタ情報とを受信し、複数のセレクタの値を対応するレジスタ情報が示す場所に格納するとともに、各セレクタの値の組み合わせにより特定される多段階の処理を逐次的に実行するように構成されている。 Therefore, the setting device 4 can display the setting user interface 50 on the display unit 5 and accept various settings by the user on the setting user interface 50. When the user sets the image captured by the image pickup device 3 to perform multi-step processing, the setting device 4 sets a plurality of selectors for realizing the multi-step processing set by the user. The combination of the values of is specified as a multi-stage selector, and the values of the plurality of selectors and the register information indicating the location where the plurality of selectors are stored can be transmitted to the image pickup apparatus 3. Then, the image pickup device 3 receives the values of the plurality of selectors transmitted from the setting device 4 and the register information indicating the location where the plurality of selectors are stored, and the register information corresponding to the values of the plurality of selectors is obtained. It is configured to be stored in the indicated location and to sequentially execute multi-step processing specified by the combination of the values of each selector.

また、使用者が撮像装置3の設定項目に対して設定値の変更を行うと、使用者により設定された各設定項目の設定値と、DeviceXMLファイルに含まれる各設定項目に対応するレジスタ情報を示すデータが撮像装置3に送信されて、撮像装置3の設定を行うことができるので、標準化規格に適合した撮像装置3であれば設定装置4側から設定値を変更することができ、撮像装置3の機種選定の自由度が向上する。 When the user changes the setting value for the setting item of the imaging device 3, the setting value of each setting item set by the user and the register information corresponding to each setting item included in the DeviceXML file are displayed. Since the indicated data is transmitted to the image pickup device 3 and the image pickup device 3 can be set, the set value can be changed from the setting device 4 side if the image pickup device 3 conforms to the standardization standard. The degree of freedom in selecting the model of 3 is improved.

また、セレクタの値の組合せによって、逐次的に実行される多段階の処理の一部を一意に特定することができるので、標準化規格に適合した撮像装置3で、例えば、フォトメトリックステレオやデフレクトメトリの原理を利用した検査画像の生成、マルチスペクトルイメージング、生成後の検査画像にフィルター処理を施すといった複数段階の処理が行えるようになる。 Further, since a part of the multi-step processing executed sequentially can be uniquely specified by the combination of the values of the selectors, the image pickup device 3 conforming to the standardization standard, for example, photometric stereo or deflect. It will be possible to perform multi-step processing such as generation of inspection images using the principle of metric, multispectral imaging, and filtering of the generated inspection images.

(仮想フローチャート及び仮想ユニット)
図8に示すようなフローチャートとは異なり、実際の運用環境では、横方向、あるいは縦方向に登場するユニットにセレクタの組合せだけで指定できるような規則性が無いことも多く、その状態では、フローチャート上のユニット構成が変わるたびに、カメラ3の内部でDeviceXMLを生成し直したり、PCソフト側もその都度DeviceXMLファイルを取得しなおす必要があって、使いづらいものになってしまう。
(Virtual flowchart and virtual unit)
Unlike the flowchart shown in FIG. 8, in an actual operating environment, there are many cases where units appearing in the horizontal or vertical direction do not have regularity that can be specified only by a combination of selectors, and in that state, the flowchart Every time the above unit configuration changes, it is necessary to regenerate the DeviceXML inside the camera 3 and to re-acquire the DeviceXML file each time on the PC software side, which makes it difficult to use.

固定的なDeviceXMLファイルを用い、なるべく少ないFeature表現でフローチャートに対応する場合、そのフローチャートは、縦方向にある程度決められたパターンを持ち、それがパラメータセットの概念によって、横方向にコピーされた形が望ましい。例えば縦方向にフローチャートを拡張可能にする、つまり、設定可能なフィルター処理の数を増やしていった場合、設定可能なフィルター処理の数だけ、フローチャート全体が縦方向に拡大していくことになる。また、利用可能なパラメータセットの数を増やせば、その分だけフローチャートが横方向に拡大していくことになる。しかし実際の運用環境においては、全てのパラメータセットに対して、設定可能な上限までフィルター処理を使用するケースは想定しにくく、特に設定可能な数の上限が大きな値になっている場合には、大半のユニットが、たとえば図10に示すユニットUB4のように「非実行」の設定となることが予想される。 When using a fixed DeviceXML file and corresponding to a flowchart with as few Featur representations as possible, the flowchart has a pattern that is determined to some extent in the vertical direction, and the shape that is copied horizontally by the concept of parameter set is desirable. For example, if the flowchart can be expanded in the vertical direction, that is, if the number of filter processes that can be set is increased, the entire flowchart will be expanded in the vertical direction by the number of filter processes that can be set. Also, if the number of available parameter sets is increased, the flowchart will be expanded in the horizontal direction accordingly. However, in an actual operating environment, it is difficult to imagine a case where filtering is used up to the settable upper limit for all parameter sets, especially when the upper limit of the settable number is a large value. It is expected that most units will be set to "non-executive", for example, unit UB4 shown in FIG.

また、使用者により設定された処理を実現するための複数のセレクタの値の組み合わせが複数パターン存在しているので、設定装置4は、撮像装置3に対して、複数パターンのセレクタの値の組み合わせを送信することができる。撮像装置3は、設定装置4から送信された複数パターンのセレクタの値の組み合わせを受信し、複数パターンのセレクタの値の組み合わせの中から使用者によって選択された任意の一のパターンのセレクタの値の組み合わせにより実行する処理を特定し、特定された処理を実行するための設定パラメータを撮像装置3の内部メモリに動的に展開するように構成されている。 Further, since there are a plurality of patterns of combinations of the values of the plurality of selectors for realizing the process set by the user, the setting device 4 sets the combination of the values of the selectors of the plurality of patterns with respect to the image pickup device 3. Can be sent. The image pickup device 3 receives the combination of the selector values of the plurality of patterns transmitted from the setting device 4, and the selector value of any one pattern selected by the user from the combination of the selector values of the plurality of patterns. The processing to be executed is specified by the combination of the above, and the setting parameters for executing the specified processing are dynamically expanded in the internal memory of the image pickup apparatus 3.

画像検査アプリケーション40の内部では、セレクタの組合せとFeatureの種類によってアクセス可能なユニットが決定され、実際に内部メモリ領域が割り当てられたユニットとFeatureとの関連付けを自動的に行う。これにより、使用者は、実際に内部で生成される仮想フローチャートの形状や仮想ユニットの配置を意識することなく、アクセスすることができる。 Inside the image inspection application 40, an accessible unit is determined by the combination of selectors and the type of feature, and the unit to which the internal memory area is actually allocated is automatically associated with the feature. As a result, the user can access without being aware of the shape of the virtual flowchart actually generated internally and the arrangement of the virtual units.

(位置補正とフィルター処理)
フィルター処理のなかには、画像の方向性に強く依存した効果を発揮するフィルターがある。具体的には、画像の所定方向に隣接する画素同士の輝度値の変化が所定の閾値以上である箇所を抽出する方向別フィルターや差分フィルター等である。方向別フィルターは、上記所定方向をX方向とY方向とから選択可能なフィルターである。
(Position correction and filtering)
Among the filtering processes, there is a filter that exerts an effect that strongly depends on the directionality of the image. Specifically, it is a direction-specific filter, a difference filter, or the like that extracts a portion where the change in the brightness value between pixels adjacent to each other in a predetermined direction of the image is equal to or greater than a predetermined threshold value. The direction-specific filter is a filter in which the predetermined direction can be selected from the X direction and the Y direction.

図16に示すように、ワークWの撮像画像として、Y方向の縞模様状の背景に白色及び黒色の欠陥部が映っている画像であった場合、この撮像画像に対してX方向及びY方向に均等な欠陥抽出フィルター処理を実行すると、欠陥抽出フィルターは、隣接する画素同士の変化の大きい所を抽出するフィルターであるため、背景の縞模様によって、Y方向にも変化を検出することになり、欠陥部が目立ちにくい。これに対し、X方向のみの変化を捉えるようフィルター処理を実行すると、背景の縞模様が消えて、欠陥部だけを抽出することができ、欠陥部の存在が分かり易くなる。 As shown in FIG. 16, when the captured image of the work W is an image in which white and black defect portions are reflected on a striped background in the Y direction, the X direction and the Y direction with respect to the captured image. When the defect extraction filter processing that is evenly executed is executed, the defect extraction filter is a filter that extracts the part where the change between adjacent pixels is large, so that the change is also detected in the Y direction by the striped pattern in the background. , Defects are less noticeable. On the other hand, when the filter process is executed so as to capture the change only in the X direction, the striped pattern in the background disappears and only the defective portion can be extracted, making it easy to understand the existence of the defective portion.

このようにしてワークWの欠陥を検査することができる。欠陥検査の手法は上述した手法に限られるものではなく、他の欠陥検査手法を用いるようにしてもよい。また、欠陥検査は、撮像装置3で行うようにしてもよいし、設定装置4で行うようにしてもよい。欠陥検査を撮像装置3で行う場合には、検査結果を撮像装置3から設定装置4へ出力して表示部5で表示させることができる。欠陥検査を設定装置4で行う場合には、撮像装置3で生成された検査用画像を設定装置4に出力して当該設定装置4で欠陥検査を行うようにすることもできるし、撮像装置3で撮像された画像を設定装置4に出力して当該設定装置4で検査用画像を生成して欠陥検査を行うようにすることもできる。 In this way, defects in the work W can be inspected. The defect inspection method is not limited to the above-mentioned method, and other defect inspection methods may be used. Further, the defect inspection may be performed by the imaging device 3 or the setting device 4. When the defect inspection is performed by the image pickup device 3, the inspection result can be output from the image pickup device 3 to the setting device 4 and displayed on the display unit 5. When the defect inspection is performed by the setting device 4, the inspection image generated by the imaging device 3 can be output to the setting device 4 so that the setting device 4 performs the defect inspection, or the imaging device 3 can perform the defect inspection. It is also possible to output the image captured by the setting device 4 to the setting device 4 and generate an inspection image by the setting device 4 to perform defect inspection.

このような画像の方向性に強く依存した効果を発揮するフィルターは、撮像するワークWの角度が変化してしまうと適切な処理結果を得ることができない。そのため、フィルター処理を実行する前に、撮像装置3がパターンサーチユニットによってワークWの位置と角度を計測し、撮像装置3が位置補正ユニットで位置補正を行うことで、ワークWが常に特定の方向を向いた画像に補正することができる。これが位置補正機能である。尚、サーチユニットとして使用するツールは、ワークWの検出に適したものが選択できるよう、複数の種類を設定可能にしている。サーチユニットによるサーチは、撮像画像中のワークWの位置補正を行うためのサーチ設定であり、この設定項目はDeviceXMLファイルに含まれている。 A filter that exerts an effect that strongly depends on the directionality of such an image cannot obtain an appropriate processing result if the angle of the work W to be imaged changes. Therefore, before executing the filter processing, the image pickup device 3 measures the position and angle of the work W by the pattern search unit, and the image pickup device 3 performs the position correction by the position correction unit, so that the work W always has a specific direction. It can be corrected to the image facing. This is the position correction function. It should be noted that a plurality of types of tools used as the search unit can be set so that a tool suitable for detecting the work W can be selected. The search by the search unit is a search setting for correcting the position of the work W in the captured image, and this setting item is included in the DeviceXML file.

位置補正機能によって位置補正した後に、画像の方向性に強く依存した効果を発揮するフィルター処理を実行することで、ワークWの撮像時における光軸回りの角度の影響を排除して、適切な処理結果を得ることができる。図17に示すように、画像検査システム1の設定時にサーチ用モデル画像を特定して撮像装置3に記憶させておき、画像検査システム1の運用時に撮像装置3の光軸回りに回転した状態でワークWが撮像された場合には、サーチ用モデル画像に基づいてワークWが特定の方向を向くように位置補正処理を行い、これにより、当該ワークWが映った領域を当該ワークWが特定の方向へ向くように回転させる。そして、位置補正処理後の画像に対して方向別フィルター処理を実行する。 After the position is corrected by the position correction function, a filter process that exerts an effect strongly depending on the directionality of the image is executed to eliminate the influence of the angle around the optical axis at the time of imaging the work W and perform appropriate processing. You can get the result. As shown in FIG. 17, the search model image is specified and stored in the image pickup device 3 when the image inspection system 1 is set, and is rotated around the optical axis of the image pickup device 3 during the operation of the image inspection system 1. When the work W is imaged, the position correction process is performed so that the work W faces a specific direction based on the search model image, whereby the work W can specify the area in which the work W is reflected. Rotate so that it faces in the direction. Then, the direction-specific filter processing is executed on the image after the position correction processing.

図18はフィルター設定用ユーザーインターフェース55を示すものである。フィルター設定用ユーザーインターフェース55は、図7に示す設定装置4のUI生成部4aによって生成され、図1等に示す表示部5に表示される。フィルター設定用ユーザーインターフェース55には、フィルター処理を実行する画像を選択する画像選択部55aと、色の抽出設定を行う色抽出設定部55bと、フィルター設定を行うフィルター設定部55cと、画像のなかの所定の領域を切り出してフィルタリング画像を生成する場合に使用する領域設定部55dと、位置補正の設定(サーチ設定)を行う位置補正設定部55eとが設けられている。 FIG. 18 shows the filter setting user interface 55. The filter setting user interface 55 is generated by the UI generation unit 4a of the setting device 4 shown in FIG. 7, and is displayed on the display unit 5 shown in FIG. 1 and the like. The filter setting user interface 55 includes an image selection unit 55a for selecting an image to be filtered, a color extraction setting unit 55b for performing color extraction settings, a filter setting unit 55c for performing filter settings, and an image. An area setting unit 55d used when a predetermined area is cut out to generate a filtered image, and a position correction setting unit 55e for setting a position correction (search setting) are provided.

図19は、フィルター処理を実行可能な画像を一覧形式で示した図であり、検査用画像を生成する方法や種別によってフィルター処理を実行可能な画像は異なっている。図18に示す画像選択部55aでは、図19に示す複数の画像のなかから任意の1つを選択することができるようになっている。尚、図19に示す画像は一例であり、これら画像に限定されるものではない。 FIG. 19 is a diagram showing images that can be filtered in a list format, and the images that can be filtered differ depending on the method and type of generating the inspection image. The image selection unit 55a shown in FIG. 18 can select any one of the plurality of images shown in FIG. The image shown in FIG. 19 is an example and is not limited to these images.

図20は、フィルター設定を具体的に行うための詳細ユーザーインターフェース56であり、図7に示す設定装置4のUI生成部4aによって生成され、図1等に示す表示部5に表示される。たとえば、図18に示すフィルター設定部55cの「追加」ボタンを押すと、図20に示す詳細ユーザーインターフェース56が表示されるように構成することができる。詳細ユーザーインターフェース56には、実行するフィルター種別を選択する選択部56aと、選択部56aで選択したフィルターの各種パラメータを変更するパラメータ変更部56bとが設けられている。 FIG. 20 is a detailed user interface 56 for concretely performing filter setting, which is generated by the UI generation unit 4a of the setting device 4 shown in FIG. 7 and displayed on the display unit 5 shown in FIG. 1 and the like. For example, when the "Add" button of the filter setting unit 55c shown in FIG. 18 is pressed, the detailed user interface 56 shown in FIG. 20 can be displayed. The detailed user interface 56 is provided with a selection unit 56a for selecting the filter type to be executed, and a parameter change unit 56b for changing various parameters of the filter selected by the selection unit 56a.

図21は、フィルターの種別と、各フィルターの方向依存性を示した図である。図18に示す選択部56aでは、図21に示す複数のフィルターのなかから任意の1または複数のフィルターを選択することができる。方向依存性を有するフィルターとしては、たとえば、膨張フィルター(X/Y方向)、収縮フィルター(X/Y方向)、エッジ抽出フィルター、リアルタイム濃淡補正フィルター(X/Y方向)、ぼかし処理フィルター(X/Y方向)、線欠陥抽出フィルター(角度)等がある。これらのフィルター処理は、位置補正の結果を用いて画像を事前に補正することによって、各フィルターの持つ方向別依存性の効果を発揮するフィルター設定であり、DeviceXMLファイルに含まれる設定項目である。 FIG. 21 is a diagram showing the types of filters and the direction dependence of each filter. In the selection unit 56a shown in FIG. 18, any one or a plurality of filters can be selected from the plurality of filters shown in FIG. Examples of the filter having direction dependence include an expansion filter (X / Y direction), a contraction filter (X / Y direction), an edge extraction filter, a real-time shading correction filter (X / Y direction), and a blurring processing filter (X / Y direction). There are Y direction), line defect extraction filter (angle), and the like. These filter processes are filter settings that exert the effect of the direction-specific dependence of each filter by correcting the image in advance using the result of the position correction, and are setting items included in the DeviceXML file.

図22は、位置補正後に方向別フィルターを実行するフローチャートを示している。スタート後のステップSC1では撮像を行う。その後、ステップSC2ではステップSC1で撮像した画像に対してパターンサーチを行ってから、ステップSC3でワークWが特定の方向を向くように位置補正を行う。ステップSC4では画像演算を行う。この中の一部の処理として方向別フィルター処理が行われる。その後、ステップSC5に進んで生成された画像を設定装置4等に出力する。 FIG. 22 shows a flowchart for executing the direction-specific filter after the position correction. In step SC1 after the start, imaging is performed. After that, in step SC2, a pattern search is performed on the image captured in step SC1, and then in step SC3, position correction is performed so that the work W faces a specific direction. In step SC4, image calculation is performed. Directional filter processing is performed as a part of the processing. After that, the process proceeds to step SC5 and the generated image is output to the setting device 4 or the like.

図23は、図18に示すフィルター設定用ユーザーインターフェース55の領域設定部55dで1つの画像のなかに複数の領域(領域1及び領域2)が設定されている場合に、位置補正後に方向別フィルターを実行するフローチャートである。スタート後のステップSD1で撮像を行うと、たとえば領域1についてはステップSD2においてパターンサーチを行った後、位置補正を行い、領域2については、ステップSD3においてパターンサーチを行った後、位置補正を行う。その後、ステップSD4では、領域1について画像演算を行った後、生成された画像を出力し、ステップSD5では、領域2について画像演算を行った後、生成された画像を出力する。 FIG. 23 shows a direction-specific filter after position correction when a plurality of areas (area 1 and area 2) are set in one image by the area setting unit 55d of the filter setting user interface 55 shown in FIG. It is a flowchart which executes. When imaging is performed in step SD1 after the start, for example, for region 1, pattern search is performed in step SD2 and then position correction is performed, and for region 2, pattern search is performed in step SD3 and then position correction is performed. .. After that, in step SD4, the image calculation is performed on the area 1 and then the generated image is output, and in step SD5, the image calculation is performed on the area 2 and then the generated image is output.

つまり、設定装置4は、フィルター設定用ユーザーインターフェース55及び詳細ユーザーインターフェース56を表示し、当該ユーザーインターフェース55、56上で使用者により設定されたサーチ設定及びフィルター設定を実現するための設定内容と、当該設定内容が格納される場所を示すレジスタ情報とを撮像装置3に送信可能に構成されている。撮像装置3は、設定装置4から送信された設定内容とレジスタ情報とを受信すると、設定内容を対応するレジスタ情報が示す場所に格納するとともに、撮像画像に対しサーチ設定に基づくワークWの位置補正を行い、当該サーチ設定による位置補正の結果に基づいてフィルター処理を実行するように構成されている。これにより、ワークWの撮像時の位置に依存するフィルター処理の効果が十分に得られるようになる。 That is, the setting device 4 displays the filter setting user interface 55 and the detailed user interface 56, and the setting contents for realizing the search setting and the filter setting set by the user on the user interface 55 and 56, and the setting contents. It is configured so that the register information indicating the location where the setting contents are stored can be transmitted to the image pickup apparatus 3. When the image pickup device 3 receives the setting contents and the register information transmitted from the setting device 4, the image pickup device 3 stores the setting contents in the location indicated by the corresponding register information, and corrects the position of the work W based on the search setting for the captured image. Is performed, and the filter processing is executed based on the result of the position correction by the search setting. As a result, the effect of the filtering process depending on the position of the work W at the time of imaging can be sufficiently obtained.

(移動体追従)
フォトメトリックステレオやマルチスペクトルの原理に基づいて検査用画像を生成する場合は、1回のトリガ信号で複数の撮像処理を実行し、得られた複数の画像を合成することになる。この場合、複数の撮像処理の間でワークWが移動していると、撮像後の合成処理が正しく行えないので、画像ごとのずれ量を検知する必要がある。このずれ量検知のためのサーチをサーチユニットで行うことができ、検知したずれ量に基づいてずれ量の補正を行ってから複数の画像の合成処理を実行する。
(Following moving objects)
When an inspection image is generated based on the principle of photometric stereo or multispectrum, a plurality of imaging processes are executed with one trigger signal, and the obtained plurality of images are combined. In this case, if the work W is moving between a plurality of imaging processes, the compositing process after imaging cannot be performed correctly, so it is necessary to detect the amount of deviation for each image. A search for detecting the amount of deviation can be performed by the search unit, and the amount of deviation is corrected based on the detected amount of deviation, and then a plurality of images are combined.

合成処理は、画像演算ユニットで行うことができる。複数の撮像画像を合成するための合成設定が設定項目としてDeviceXMLファイルに含まれている。したがって、撮像装置3が撮像した撮像画像を外部に出力する前に、当該撮像画像に対して適用される処理に関する設定項目として、複数の撮像画像を合成する合成設定がDeviceXMLファイルには含まれることになる。 The compositing process can be performed by the image calculation unit. A composition setting for synthesizing a plurality of captured images is included in the DeviceXML file as a setting item. Therefore, before outputting the captured image captured by the imaging device 3 to the outside, the DeviceXML file includes a composite setting for synthesizing a plurality of captured images as a setting item related to the processing applied to the captured image. become.

図24は、移動体追従を行う場合のフローチャートであり、ステップSE1の撮像ステップにおいて、プライベートフローチャートを実行することで、複数回の撮像処理を行うとともに、各画像でパターンサーチを行う。その後、ステップSE2では、複数の画像のずれ量を考慮して合成処理を行う。ステップSE3では合成後の画像を出力する。また、右に示すフローチャートのように、ステップSe1を経てステップSe2で撮像を行い、ステップSe3でパターンサーチを行い、これを所定回数繰り返すようにしてもよい。 FIG. 24 is a flowchart in the case of following a moving object. In the imaging step of step SE1, by executing the private flowchart, imaging processing is performed a plurality of times and a pattern search is performed on each image. After that, in step SE2, the compositing process is performed in consideration of the amount of deviation of the plurality of images. In step SE3, the combined image is output. Further, as shown in the flowchart on the right, the image may be taken in step Se2 through step Se1, the pattern search may be performed in step Se3, and this may be repeated a predetermined number of times.

また、設定装置4は、使用者によって合成設定を行うためのユーザーインターフェースを表示部5に表示させることができるとともに、このユーザーインターフェース上で使用者により設定された合成設定を実現するための設定内容と、当該設定内容が格納される場所を示すレジスタ情報とを撮像装置3に送信可能に構成されている。撮像装置3は、設定装置4から送信された設定内容とレジスタ情報とを受信し、設定内容を、対応するレジスタ情報が示す場所に格納するとともに、複数の撮像画像を合成する合成処理を実行するように構成されている。 Further, the setting device 4 can display the user interface for performing the composition setting by the user on the display unit 5, and the setting content for realizing the composition setting set by the user on this user interface. And the register information indicating the location where the setting contents are stored can be transmitted to the image pickup apparatus 3. The image pickup device 3 receives the setting contents and register information transmitted from the setting device 4, stores the setting contents in the location indicated by the corresponding register information, and executes a compositing process for synthesizing a plurality of captured images. It is configured as follows.

(帳票出力)
帳票とは、GenICam規格に対応した撮像装置3の設定内容をテキスト形式で出力したものである。個々の設定項目は、設定名と設定値の組で表現されており、これがリスト形式で羅列される。本実施形態では、画像検査アプリケーション40が設定装置4で動作するようになっており、この設定装置4と撮像装置3とを上述したように標準化規格で接続している。よって、設定した内容を撮像装置3から設定装置4側に読み出し、読み出した内容を設定装置4からテキスト形式で出力して設定装置4側で管理・保存しておき、必要に応じて、設定装置4側から撮像装置3側に対して書き戻せるようにしておく必要がある。
(Form output)
The form is an output of the setting contents of the image pickup apparatus 3 corresponding to the GenICam standard in a text format. Each setting item is represented by a set of setting name and setting value, which are listed in a list format. In the present embodiment, the image inspection application 40 operates on the setting device 4, and the setting device 4 and the image pickup device 3 are connected by a standardization standard as described above. Therefore, the set contents are read from the imaging device 3 to the setting device 4, the read contents are output from the setting device 4 in a text format, managed and saved on the setting device 4, and if necessary, the setting device. It is necessary to be able to write back from the 4 side to the 3 side of the imaging device.

ところが、フォトメトリックステレオの原理、デフレクトメトリの原理に基づいて検査用画像を生成する場合や、マルチスペクトルイメージングにより検査用画像を生成する場合は、設定項目が多くなるとともに、順序性が必要になる。従って、設定項目が複雑化することが考えられる。本実施形態では、複雑な設定項目の構造を簡単に帳票出力できる機能を搭載している。これは、図7に示す帳票出力部4bによって実現される機能である。 However, when generating an inspection image based on the principle of photometric stereo and the principle of deflation, or when generating an inspection image by multispectral imaging, there are many setting items and order is required. Become. Therefore, it is conceivable that the setting items become complicated. In this embodiment, a function that can easily output a form of a complicated setting item structure is installed. This is a function realized by the form output unit 4b shown in FIG. 7.

帳票を出力する際、単にレジスタ値をレジスタアドレスの小さい順で書き出す方法があるが、設定内容を正しく復元するには、レジスタ間の設定順序を守って各レジスタを設定していく必要がある。そのため、予め正しい設定順序で帳票に書き出しておくのが好ましい。 When outputting a form, there is a method of simply writing out the register values in ascending order of register addresses, but in order to restore the settings correctly, it is necessary to set each register in the order of setting between the registers. Therefore, it is preferable to write them out in the form in the correct setting order in advance.

設定順序には、以下(1)、(2)のようなものがある。
(1)あるレジスタを有効にすることで他のレジスタが設定可能になる場合
たとえば、GenICamの標準規格で定義されているレジスタの例として、フレームレートの設定項目がある。使用者が任意のフレームレートを設定したい場合、まずフレームレートを設定可能にするためのレジスタを制御する必要がある。フレームレートを設定不可のままとした場合、撮像装置3は内部的に決められているフレームレートで動作することになる。つまり、フレームレートを設定可能にするレジスタを有効にすることで、フレームレートの設定項目のレジスタが設定可能になる。よって、まず、フレームレートを設定可能にするレジスタの設定を書き出し、その後にフレームレートの設定項目のレジスタを書き出す必要がある。
The setting order includes the following (1) and (2).
(1) When another register can be set by enabling one register For example, there is a frame rate setting item as an example of a register defined by the GenICam standard. If the user wants to set an arbitrary frame rate, it is first necessary to control the register that enables the frame rate to be set. If the frame rate is left unset, the imaging device 3 will operate at an internally determined frame rate. That is, by enabling the register that enables the frame rate to be set, the register of the frame rate setting item can be set. Therefore, it is necessary to first write out the register settings that enable the frame rate to be set, and then write out the registers for the frame rate setting items.

また、デフレクトメトリの原理に基づいて形状画像を生成する際、形状画像の生成を有効にすることで形状画像の特徴サイズが設定可能になるように構成されている。よって、まず、形状画像の生成を有効にするレジスタ設定を書き出し、その後に形状画像の特徴サイズ設定レジスタを書き出す必要がある。
(2)セレクタのレジスタを書き換えると、他のレジスタの指し示す実体が切り替わる場合
本実施形態では、配列型パラメータのレジスタ消費量を減らすため、配列インデックスを意味するレジスタ(セレクタレジスタ)を別途導入している。セレクタレジスタがあれば、パラメータ本体のレジスタは1個だけ定義すれば済むからである。たとえば、端子を選択する端子セレクタと、選択された端子の信号を反転するかどうかを設定するセレクタとが上記(2)の関係になる。また、赤、緑、青のいずれかの値をとり得るホワイトバランス設定のセレクタと、選択された色のホワイトバランス設定値とが上記(2)の関係になる。したがって、セレクタレジスタの設定後に、パラメータ本体のレジスタを設定する必要がある。
Further, when a shape image is generated based on the principle of deflation metric, the feature size of the shape image can be set by enabling the generation of the shape image. Therefore, it is necessary to first write out the register settings that enable the generation of the shape image, and then write out the feature size setting register of the shape image.
(2) When the register pointed to by another register is switched by rewriting the register of the selector In this embodiment, a register (selector register) meaning an array index is separately introduced in order to reduce the register consumption of the array type parameter. There is. This is because if there is a selector register, only one register of the parameter body needs to be defined. For example, the terminal selector that selects a terminal and the selector that sets whether to invert the signal of the selected terminal have the relationship (2) above. Further, the white balance setting selector that can take any of red, green, and blue values and the white balance setting value of the selected color have the relationship of (2) above. Therefore, it is necessary to set the register of the parameter body after setting the selector register.

つまり、一方の設定項目の設定により他方の設定項目の有効性又は値が変化する依存関係を有する複数の設定項目が存在する。本実施形態では、上記(1)、(2)に示す順序性を考慮し、設定順序に関する逆方向の依存関係が存在しないように、予めDeviceXMLファイルにおけるレジスタの出現順序を決めておく。そして、その順序どおりに帳票に書き出すことで、複雑な設定項目の構造を正しい設定順序で帳票化することができる。 That is, there are a plurality of setting items having a dependency relationship in which the validity or value of the other setting item changes depending on the setting of one setting item. In the present embodiment, in consideration of the order shown in (1) and (2) above, the order of appearance of the registers in the DeviceXML file is determined in advance so that there is no dependency in the reverse direction regarding the setting order. Then, by writing out to the form in that order, the structure of complicated setting items can be made into a form in the correct setting order.

図25は、依存関係1と依存関係2の2つの依存関係を持ったレジスタが記載された帳票の例を示している。各レジスタは、関連のある者同士がカテゴリ(Category)と呼ばれるグループにまとめられて定義されている。各カテゴリを、さらに上位のカテゴリによって1つのグループにまとめることも可能である。各カテゴリと各レジスタとの関係は、図25に示すようなツリー構造になる。カテゴリは、一方の設定項目の設定により他方の設定項目の有効性又は値が変化する依存関係を有する複数の設定項目を関連度に応じて分類することによって形成されたものであるため、構造が分かり易くなる。また、カテゴリは1つの帳票のなかに複数存在している。 FIG. 25 shows an example of a form in which registers having two dependencies, dependency 1 and dependency 2, are described. Each register is defined by grouping related persons into a group called a category. It is also possible to group each category into one group by a higher category. The relationship between each category and each register has a tree structure as shown in FIG. The structure is formed because the category is formed by classifying a plurality of setting items having a dependency that the validity or value of the other setting item changes depending on the setting of one setting item according to the degree of relevance. It will be easier to understand. In addition, there are a plurality of categories in one form.

カテゴリによるレジスタの分類は、使用者が設定したい内容に対応するレジスタを一覧から探し出すときに有益である。よって、カテゴリの構造を無視して、レジスタの出現順序を依存関係の観点のみから正しい順序に整列してしまうと、カテゴリの構造が壊されてしまうことになり、使用者の利便性を著しく阻害することになる。よって、帳票出力部4bは、カテゴリによる分類構造を維持しながら、正しい出現順序になるようレジスタを整列させる。 Classification of registers by category is useful when searching the list for registers that correspond to the contents that the user wants to set. Therefore, if the register appearance order is arranged in the correct order only from the viewpoint of the dependency by ignoring the category structure, the category structure will be destroyed, which will significantly hinder the convenience of the user. Will be done. Therefore, the form output unit 4b arranges the registers so that the order of appearance is correct while maintaining the classification structure by category.

具体的には、まずはツリーの末節の方から、兄弟ノードどうしが正しい出現順序になるように並べ替える。その後、ツリー上の1階層上の兄弟ノードどうしで、正しい出現順序になるように並び替えを行う。これを、ツリーの根元の方へ向かって再帰的に繰り返していく。このとき、レジスタ同士の出現順序は、両者の依存関係が必ず後方から前方への方向になるように並び替える。また、カテゴリ同士の出現順序は、カテゴリ1内のレジスタからカテゴリ2内のレジスタへの依存関係がある場合に、まずカテゴリ2が出現し、その後カテゴリ1が出現するような順序に並び替える。 Specifically, first sort from the end of the tree so that the sibling nodes have the correct appearance order. After that, the sibling nodes one level above the tree are sorted so that they appear in the correct order. This is repeated recursively toward the base of the tree. At this time, the order of appearance of the registers is rearranged so that the dependency between the registers is always from the rear to the front. Further, the appearance order of the categories is rearranged so that the category 2 first appears and then the category 1 appears when there is a dependency relationship from the register in the category 1 to the register in the category 2.

また、ツリーの各階層で並び替えを行う際は、レジスタ/カテゴリ間の依存関係を有向辺とみなしたトポロジカルソートを行うようにする。トポロジカルソート自体は公知のものであり、各ノードを順序付けしておいて、いずれのノードもその出力辺の先のノードよりも前に位置するように並べることである。 In addition, when sorting in each layer of the tree, topological sort is performed by regarding the dependency between registers / categories as a directed edge. The topological sort itself is known, and each node is ordered so that each node is located before the node beyond its output side.

次に、並び替え手順の具体例について図26及び図27に基づいて説明する。この例では、カテゴリ及び設定項目が階層的な依存関係を有している。 Next, a specific example of the sorting procedure will be described with reference to FIGS. 26 and 27. In this example, categories and setting items have hierarchical dependencies.

手順1:最も末節のカテゴリ2−2とレジスタ2−3の順序を入れ替える。これにより、図26に示すように、レジスタ3−0からレジスタ2−3への依存関係2が、後方から前方への方向に正しく向くようになる。 Step 1: Swap the order of category 2-2 and register 2-3 at the end of the section. As a result, as shown in FIG. 26, the dependency 2 from the register 3-0 to the register 2-3 is correctly oriented in the direction from the rear to the front.

手順2:1階層上のカテゴリ1−0とレジスタ1−1の順序を入れ替える。これにより、図27に示すように、レジスタ2−1からレジスタ3−0への依存関係1が、後方から前方への方向に正しく向くようになる。更に上の階層があれば同様に順序を入れ替えればよい。 Step 2: Swap the order of categories 1-0 and registers 1-1 on the 1st hierarchy. As a result, as shown in FIG. 27, the dependency 1 from the register 2-1 to the register 3-0 is correctly oriented in the direction from the rear to the front. If there is a higher hierarchy, the order may be changed in the same way.

図28は、並べ替え前後のレジスタの出現順序と、出力された帳票とを示す図である。LtrxSh1ImageEnableは、フォトメトリックステレオの原理に基づいて形状画像を生成するか否かを設定するレジスタである。LineInverterは、選択した端子の出力信号を反転させるか否かを設定するレジスタである。LineSelecterは、端子を選択するレジスタである。LtrxSh1FeatureSizeは、形状画像の特徴サイズ設定レジスタである。並べ替え前のレジスタの出現順序では、LineSelecterの前に、LineInverterが出現しており、出現順序が設定順序とは異なっている。このため、レジスタの順序を設定順序となるように並べ替えてから帳票として出力する。「出力された帳票」として示すように、セレクタの個所では、セレクタのインデックスの数だけ出力処理をループさせる。 FIG. 28 is a diagram showing the appearance order of the registers before and after the sorting and the output form. The LtrxSh1ImageEnable is a register that sets whether or not to generate a shape image based on the principle of photometric stereo. The LineInverter is a register that sets whether or not to invert the output signal of the selected terminal. The LineSelecter is a register that selects terminals. LtrxSh1FatureSize is a feature size setting register for a shape image. In the order of appearance of the registers before rearrangement, LineInverter appears before LineSelecter, and the order of appearance is different from the setting order. Therefore, the order of the registers is rearranged so as to be the set order, and then the form is output. As shown as "output form", the output process is looped for the number of selector indexes at the selector.

フォトメトリックステレオのモードでは、ある画像が先に撮像されて存在していることが前提の上で、さらにその画像を設定装置4に対して出力するかどうかを選択する必要がある、というように、レジスタ間の設定順序を守る必要がある。つまり、図30に矢印で示すように、出力するかどうかのレジスタから撮像するかどうかのレジスタへ、前方から後方への方向の依存関係が存在しており、この例では、レジスタの前後関係が設定順(入力順)となっていない。従って、この順序のまま出力された帳票を入力しようとすると、入力の途中でエラーが発生してしまい、設定を完了することができない。 In the photometric stereo mode, it is necessary to select whether or not to output the image to the setting device 4 on the premise that a certain image is captured first and exists. , It is necessary to keep the setting order between registers. That is, as shown by an arrow in FIG. 30, there is a dependency in the direction from the front to the rear from the register of whether to output to the register of whether to image, and in this example, the context of the register is It is not in the setting order (input order). Therefore, if you try to input the forms output in this order, an error will occur during the input and the setting cannot be completed.

本実施形態では、上述した手順によってレジスタの並べ替えを自動的に行うことができる。図31は、図30に示す複数のレジスタの並べ替えを行った状態を示している。この定義順序は、使用者により設定されるべき順序(設定順序)であるため、出力された帳票に入力する際にエラーが発生することはない。 In the present embodiment, the registers can be automatically rearranged by the procedure described above. FIG. 31 shows a state in which the plurality of registers shown in FIG. 30 are rearranged. Since this definition order is the order that should be set by the user (setting order), no error will occur when inputting to the output form.

したがって、設定装置4は、一方の設定項目の設定により他方の設定項目の有効性又は値が変化する依存関係を有する複数の設定項目を関連度に応じて分類することによって形成された複数のカテゴリ間と、各設定項目間との依存関係に基づいて、設定順序に従って各設定項目が記述された帳票を出力するように構成されている。これにより、帳票には、複数のカテゴリ間と、各設定項目間との依存関係に基づいて、設定順序に従って各設定項目が記述されることになるので、帳票が簡単になるとともに、設定内容が誤って復元されにくくなる。 Therefore, the setting device 4 has a plurality of categories formed by classifying a plurality of setting items having a dependency relationship in which the validity or value of the other setting item changes depending on the setting of one setting item according to the degree of relevance. It is configured to output a form in which each setting item is described according to the setting order based on the dependency between the interval and each setting item. As a result, each setting item is described in the form according to the setting order based on the dependency relationship between a plurality of categories and each setting item, so that the form becomes simple and the setting contents can be changed. It is difficult to restore by mistake.

(実施形態の作用効果)
以上説明したように、この実施形態によれば、標準化規格に適合した撮像装置3で複数の撮像画像を合成することができるので、例えば、フォトメトリックステレオやデフレクトメトリの原理を利用した検査画像の生成や、マルチスペクトルイメージング等を行うことができる。
(Action and effect of the embodiment)
As described above, according to this embodiment, a plurality of captured images can be combined by the imaging device 3 conforming to the standardization standard. Therefore, for example, an inspection image using the principle of photometric stereo or deflation metrics. Can be generated, multispectral imaging, etc. can be performed.

また、標準化規格に適合した撮像装置3に対して多段階の処理を順序立てて行わせることができ、撮像装置3の機種選定の自由度向上と、画像検査の精度向上とを両立させることができる。 In addition, the image pickup device 3 conforming to the standardization standard can be subjected to multi-step processing in order, and the degree of freedom in selecting the model of the image pickup device 3 can be improved and the accuracy of image inspection can be improved at the same time. it can.

また、特定された処理を実行するための設定パラメータを撮像装置3の内部メモリに動的に展開するようにしたので、標準化規格に適合した撮像装置3に対して柔軟な機能拡張を実現しながら、撮像装置3のメモリ使用量を抑制できる。 In addition, since the setting parameters for executing the specified processing are dynamically expanded in the internal memory of the image pickup device 3, flexible function expansion is realized for the image pickup device 3 conforming to the standardization standard. , The memory usage of the image pickup apparatus 3 can be suppressed.

また、撮像画像中のワークWの位置補正を行った後に位置補正の結果に基づいてフィルター処理を行うことができるので、ワークWの撮像時の位置や向きに依存するフィルター処理の効果を十分に得ることができる。 Further, since the filter processing can be performed based on the result of the position correction after the position correction of the work W in the captured image is performed, the effect of the filter processing depending on the position and orientation of the work W at the time of imaging can be sufficiently obtained. Obtainable.

また、依存関係を有する複数の設定項目を関連度に応じて分類して複数のカテゴリを形成し、複数のカテゴリ間と各設定項目間との依存関係に基づいて、設定順序に従って各設定項目が記述された帳票を出力することができる。これにより、標準化規格に適合した撮像装置3と設定装置4との間でやり取りを行う帳票を簡単に出力することができ、実装の容易化を図ることができるとともに、設定内容が誤って復元されないようにすることができる。 In addition, a plurality of setting items having a dependency relationship are classified according to the degree of relevance to form a plurality of categories, and each setting item is set according to a setting order based on the dependency relationship between the plurality of categories and each setting item. The described form can be output. As a result, the form exchanged between the image pickup device 3 and the setting device 4 conforming to the standard can be easily output, the implementation can be facilitated, and the setting contents are not erroneously restored. Can be done.

上述の実施形態はあらゆる点で単なる例示に過ぎず、限定的に解釈してはならない。さらに、特許請求の範囲の均等範囲に属する変形や変更は、全て本発明の範囲内のものである。 The above embodiments are merely exemplary in all respects and should not be construed in a limited way. Furthermore, all modifications and modifications that fall within the equivalent scope of the claims are within the scope of the present invention.

以上説明したように、本発明は、たとえばワーク等の検査対象物を検査する場合に利用することができる。 As described above, the present invention can be used when inspecting an inspection object such as a work.

1 画像検査システム
2 照明装置
2a 発光部
2b 照明制御部
3 撮像装置
4 設定装置
4a UI生成部
4b 帳票出力部
5 表示部
6 キーボード
7 マウス
8 外部制御機器
31 カメラ
32 集光系光学系
33 撮像制御部
40 画像検査アプリケーション
50 設定用ユーザーインターフェース
200 照明装置
201〜204 第1〜第4発光部
205 照明制御部
W ワーク(検査対象物)
1 Image inspection system 2 Lighting device 2a Light emitting unit 2b Lighting control unit 3 Imaging device 4 Setting device 4a UI generation unit 4b Form output unit 5 Display unit 6 Keyboard 7 Mouse 8 External control device 31 Camera 32 Condensing system Optical system 33 Imaging control Unit 40 Image inspection application 50 User interface for setting 200 Lighting device 201-204 1st to 4th light emitting units 205 Lighting control unit W work (inspection object)

Claims (5)

検査対象物を撮像する画像検査装置用撮像装置と、
前記撮像装置とネットワークを介して接続され、当該撮像装置の設定項目と各設定項目の設定値が格納される場所を示すレジスタ情報とが記述されたファイルを外部から取得し、使用者により設定された各設定項目の設定値と、前記ファイルに含まれる各設定項目に対応するレジスタ情報を示すデータを前記撮像装置に送信し、当該撮像装置の設定を行う設定装置とを備えた画像検査システムであって、
前記設定装置は、一方の設定項目の設定により他方の設定項目の有効性又は値が変化する依存関係を有する複数の設定項目を関連度に応じて分類することによって形成された複数のカテゴリ間と、各設定項目間との依存関係に基づいて、設定順序に従って前記各設定項目が記述された帳票を出力するように構成されていることを特徴とする画像検査システム。
An image pickup device for an image inspection device that captures an image of an inspection object,
A file that is connected to the image pickup device via a network and describes the setting items of the image pickup device and the register information indicating the location where the setting value of each setting item is stored is acquired from the outside and set by the user. An image inspection system including a setting value of each setting item and a setting device for setting the image pickup device by transmitting data indicating register information corresponding to each setting item included in the file to the image pickup device. There,
The setting device is among a plurality of categories formed by classifying a plurality of setting items having a dependency relationship in which the validity or value of the other setting item changes depending on the setting of one setting item according to the degree of relevance. , An image inspection system characterized in that it is configured to output a form in which each setting item is described according to a setting order based on a dependency relationship between each setting item.
請求項1に記載の画像検査システムにおいて、
前記設定順序は、使用者により設定されるべき順序であることを特徴とする画像検査システム。
In the image inspection system according to claim 1,
An image inspection system, wherein the setting order is an order to be set by a user.
請求項1または2に記載の画像検査システムにおいて、
前記撮像装置または前記設定装置は、前記他方の設定項目の有効性又は値を変化させる前記一方の設定項目が、前記他方の設定項目よりも先に記述されるように、前記各カテゴリ及び各設定項目を並び替えて記述した帳票を出力するように構成されていることを特徴とする画像検査システム。
In the image inspection system according to claim 1 or 2.
The imaging device or the setting device changes the validity or value of the other setting item. The one setting item is described before the other setting item, so that each category and each setting is described. An image inspection system characterized in that it is configured to output a form in which items are rearranged and described.
請求項3に記載の画像検査システムにおいて、
前記カテゴリ及び前記設定項目は、階層的な依存関係を有し、
前記撮像装置または前記設定装置は、前記階層的な依存関係を一層ずつ並び替えて記述した帳票を出力するように構成されていることを特徴とする画像検査システム。
In the image inspection system according to claim 3,
The category and the setting item have a hierarchical dependency relationship.
The image inspection system is characterized in that the image pickup apparatus or the setting apparatus is configured to output a form in which the hierarchical dependencies are rearranged layer by layer and described.
請求項4に記載の画像検査システムにおいて、
前記撮像装置または前記設定装置は、最も下の階層の順序を並び替えた後、最も下の階層よりも1階層上の階層の順序を並び替えるように構成されていることを特徴とする画像検査システム。
In the image inspection system according to claim 4,
The image inspection device or the setting device is configured to rearrange the order of the lowest layer and then rearrange the order of the layers one layer higher than the lowest layer. system.
JP2019072977A 2019-04-05 2019-04-05 Image inspection system Active JP7306857B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2019072977A JP7306857B2 (en) 2019-04-05 2019-04-05 Image inspection system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2019072977A JP7306857B2 (en) 2019-04-05 2019-04-05 Image inspection system

Publications (2)

Publication Number Publication Date
JP2020169962A true JP2020169962A (en) 2020-10-15
JP7306857B2 JP7306857B2 (en) 2023-07-11

Family

ID=72747065

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019072977A Active JP7306857B2 (en) 2019-04-05 2019-04-05 Image inspection system

Country Status (1)

Country Link
JP (1) JP7306857B2 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003348404A (en) * 2002-05-27 2003-12-05 Sharp Corp Imaging apparatus
JP2010238085A (en) * 2009-03-31 2010-10-21 Fuji Electric Systems Co Ltd Production information management system
JP2011043928A (en) * 2009-08-19 2011-03-03 Keyence Corp Image processor, program creation support device, and image processing method
JP2015088784A (en) * 2013-10-28 2015-05-07 キヤノン株式会社 Imaging device
JP2019029888A (en) * 2017-08-01 2019-02-21 キヤノン株式会社 Imaging apparatus, information processing method, and program

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003348404A (en) * 2002-05-27 2003-12-05 Sharp Corp Imaging apparatus
JP2010238085A (en) * 2009-03-31 2010-10-21 Fuji Electric Systems Co Ltd Production information management system
JP2011043928A (en) * 2009-08-19 2011-03-03 Keyence Corp Image processor, program creation support device, and image processing method
JP2015088784A (en) * 2013-10-28 2015-05-07 キヤノン株式会社 Imaging device
JP2019029888A (en) * 2017-08-01 2019-02-21 キヤノン株式会社 Imaging apparatus, information processing method, and program

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
マシンビジョン用インターフェース標準規格〜デジタルカメラインターフェース選択の手引き〜, JPN6022055608, January 2014 (2014-01-01), ISSN: 0004958562 *

Also Published As

Publication number Publication date
JP7306857B2 (en) 2023-07-11

Similar Documents

Publication Publication Date Title
JP7222796B2 (en) Image inspection system and image inspection method
JP6917781B2 (en) Image inspection equipment
JP7188870B2 (en) Image inspection equipment
JP6967373B2 (en) Image inspection equipment
US20140010438A1 (en) Three dimensional shape measurement apparatus and method
JP2018040649A (en) Image inspection device, image inspection method, image inspection program, computer-readable recording medium and recording apparatus
JP6791631B2 (en) Image generation method and inspection equipment
US11012612B2 (en) Image inspection system and image inspection method
JP6917780B2 (en) Image inspection equipment
JP2020169950A (en) Image inspection system
JP7402745B2 (en) Imaging device and image inspection system
JP7306857B2 (en) Image inspection system
JP7231461B2 (en) Image inspection system and image inspection method
JP7222795B2 (en) Image inspection system and image inspection method
JP7306858B2 (en) Image inspection system and image inspection method
JP2020169959A (en) Image inspection system and image inspection method
JP7273659B2 (en) Image measurement system
JP2018205000A (en) Image inspection device
JP7311360B2 (en) Image measurement system
JP2018204995A (en) Image inspection device
CN110278384B (en) Image processing system, image processing apparatus, image processing method, and computer readable medium
JP7474636B2 (en) Image Inspection System
JP2021184180A (en) Image inspection system
JP2018204996A (en) Image inspection device
JP2018204999A (en) Image inspection device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20220309

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20221228

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20230110

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20230308

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20230315

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20230629

R150 Certificate of patent or registration of utility model

Ref document number: 7306857

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150