JP7402745B2 - Imaging device and image inspection system - Google Patents

Imaging device and image inspection system Download PDF

Info

Publication number
JP7402745B2
JP7402745B2 JP2020089467A JP2020089467A JP7402745B2 JP 7402745 B2 JP7402745 B2 JP 7402745B2 JP 2020089467 A JP2020089467 A JP 2020089467A JP 2020089467 A JP2020089467 A JP 2020089467A JP 7402745 B2 JP7402745 B2 JP 7402745B2
Authority
JP
Japan
Prior art keywords
image
height
setting
unit
imaging
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2020089467A
Other languages
Japanese (ja)
Other versions
JP2021183937A (en
Inventor
英和 勝山
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 JP2020089467A priority Critical patent/JP7402745B2/en
Publication of JP2021183937A publication Critical patent/JP2021183937A/en
Application granted granted Critical
Publication of JP7402745B2 publication Critical patent/JP7402745B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、例えばワーク等を撮像する撮像装置及び撮像したワーク等を検査する画像検査システムに関する。 The present invention relates to, for example, an imaging device that images a workpiece or the like, and an image inspection system that inspects the imaged workpiece or the like.

従来から、例えば特許文献1に開示されているように、パターン投影法を用いてワーク等の検査対象物の高さ情報を取得する画像処理装置が知られている。この特許文献1に開示されている画像処理装置では、複数のパターン投影光を検査対象物に順次照射しながら、カメラで複数の輝度画像を取得し、カメラで取得した複数の輝度画像をコントローラに転送して当該コントローラにおいて高さデータを生成する。コントローラでは、生成した高さデータのうち、所定の高さ範囲内の高さデータを、高さデータよりも階調数の低い高さ画像に変換する処理、即ち高さ抽出処理を実行する。高さ抽出処理後、コントローラでは、高さ画像を用いた画像処理を行って検査対象物の良否を判定し、判定信号をPLC等の外部機器に出力する。 2. Description of the Related Art Conventionally, as disclosed in Patent Document 1, for example, there has been known an image processing apparatus that uses a pattern projection method to obtain height information of an object to be inspected, such as a workpiece. The image processing device disclosed in Patent Document 1 acquires a plurality of brightness images with a camera while sequentially irradiating a plurality of pattern projection lights onto an object to be inspected, and sends the plurality of brightness images acquired with the camera to a controller. Then, height data is generated in the controller. The controller executes a process of converting height data within a predetermined height range out of the generated height data into a height image with a lower number of gradations than the height data, that is, a height extraction process. After the height extraction process, the controller performs image processing using the height image to determine the quality of the inspection object, and outputs a determination signal to an external device such as a PLC.

特開2019-168285号公報JP2019-168285A

ところで、コントローラには汎用パーソナルコンピュータ等で構成された設定装置が接続されており、この設定装置で高さ画像を用いた画像処理を行いたいというユーザニーズがある。このような場合、従来は、コントローラから出力された高さデータに対し、設定装置上で各種処理を行っていた。 By the way, a setting device constituted by a general-purpose personal computer or the like is connected to the controller, and there is a user need to perform image processing using a height image with this setting device. In such cases, conventionally, various processes have been performed on the setting device on the height data output from the controller.

しかし、設定装置に高さ画像を扱う二次元画像処理ライブラリしかインストールされていない場合、設定装置はコントローラから送られてきた高さデータを処理することができない。 However, if only a two-dimensional image processing library that handles height images is installed in the setting device, the setting device cannot process the height data sent from the controller.

この点、例えば設定装置において、高さデータから高さ画像に変換するためのプログラムコードを記述することも考えられるが、高さデータから高さ画像に変換するためのプログラムコードの記述は難易度が高く、熟練者でないと適切なコードの記述は容易ではない。仮にコードが記述できたとしても、その記述のための時間や手間がかかる。特に、検査対象物が水平面から傾いている場合、その傾きを補正するためのコード記述も必要となって、難易度がより一層高くなる。 Regarding this point, for example, it is possible to write a program code to convert height data to a height image in the setting device, but writing a program code to convert height data to a height image is difficult. It is difficult to write appropriate code unless you are an expert. Even if the code could be written, it would take time and effort to write it. In particular, when the object to be inspected is tilted from the horizontal plane, it is also necessary to write code to correct the tilt, making it even more difficult.

本開示は、かかる点に鑑みたものであり、その目的とするところは、撮像装置に接続される設定装置が画像処理に適した高さ画像を撮像装置から容易に取得して設定装置で高さ画像を用いた画像処理が行えるようにし、ひいては、ユーザの使い勝手を向上させることにある。 The present disclosure has been made in view of this point, and its purpose is to enable a setting device connected to an imaging device to easily obtain a height image suitable for image processing from the imaging device and use the setting device to heighten the image. The object of the present invention is to enable image processing using a digital image, and to improve usability for the user.

上記目的を達成するために、第1の開示では、撮像装置は、撮像対象物からの反射光の受光量に応じた輝度画像を取得するとともに、撮像対象物の高さ情報が二次元座標上に配置された高さデータを取得する取得部と、前記取得部により取得された高さデータに対し、該高さデータを階調変換する際の基準となる基準面を特定するための基準位置を設定する設定部と、前記基準位置の設定に用いた高さデータを取得した撮像対象物とは異なる新たな撮像対象物について、前記取得部により新たな輝度画像と新たな高さデータが取得された場合において、該新たな輝度画像の特徴部分をサーチして新たな撮像対象物の位置又は姿勢のずれを検出し、前記新たな高さデータに対する前記基準位置のずれを補正する補正部と、前記補正部により補正された前記基準位置に対応する高さ情報を用いて該新たな高さデータの基準面を算出する算出部と、前記算出部により算出された基準面を基準として、前記新たな高さデータを、該新たな高さデータの階調数よりも低い階調数を有する高さ画像に変換する変換部と、前記変換部により生成された高さ画像を標準化された規格により出力する出力部とを備える構成とすることができる。 In order to achieve the above object, in a first disclosure, an imaging device acquires a brightness image according to the amount of reflected light received from an object to be imaged, and also displays height information of the object to be imaged on two-dimensional coordinates. an acquisition unit that acquires height data arranged in the acquisition unit; and a reference position for specifying a reference plane that is a reference for gradation conversion of the height data acquired by the acquisition unit. and a setting unit that sets the reference position, and the acquisition unit acquires a new brightness image and new height data for a new imaging target different from the imaging target from which the height data used for setting the reference position was acquired. a correction unit that searches for a characteristic part of the new luminance image to detect a shift in the position or posture of the new imaged object, and corrects the shift in the reference position with respect to the new height data; , a calculation unit that calculates a reference plane of the new height data using the height information corresponding to the reference position corrected by the correction unit; a conversion unit that converts new height data into a height image having a lower number of gradations than the number of gradations of the new height data; and a standardized standard for converting the height image generated by the conversion unit. The configuration may include an output unit that outputs an output.

この構成によれば、取得部により撮像対象物の輝度画像と高さデータが取得されると、高さデータに対して基準位置を設定することができる。基準位置は、基準面を特定するための情報であり、その情報としては、例えば撮像対象物の平らな部分を囲むように設定した所定の領域であってもよいし、撮像対象物の平らな部分を示す点であってもよい。設定された基準位置に基づいて基準面が特定される。例えば所定の領域が設定されている場合には、その領域内の複数の点の平均高さにより特定される面を基準面とすることができ、また、点が設定されている場合には、その点を含む面を基準面とすることができる。設定されている点が1点の場合はその1点を含む面を基準面とすることができ、3点の場合は3点の高さにより特定される一の面を基準面とすることができる。 According to this configuration, when the brightness image and height data of the imaging target are acquired by the acquisition unit, a reference position can be set for the height data. The reference position is information for specifying the reference plane, and the information may be, for example, a predetermined area set to surround a flat part of the object to be imaged, or a flat area of the object to be imaged. It may also be a point indicating a part. A reference plane is specified based on the set reference position. For example, if a predetermined area is set, a plane specified by the average height of multiple points within the area can be used as the reference plane, and if points are set, A plane including that point can be used as a reference plane. If there is one point set, the plane containing that one point can be used as the reference plane, and if there are three points, the plane specified by the height of the three points can be used as the reference plane. can.

基準位置を設定するための高さデータを取得した撮像対象物を例えば設定用撮像対象物としたとき、設定用撮像対象物とは別の新たな撮像対象物について取得部により新たな輝度画像と新たな高さデータが取得されると、新たな輝度画像の特徴部分が補正部によりサーチされる。補正部によるサーチは、予め登録した登録画像に対する相関度に基づくパターンサーチであってもよいし、登録画像を用いずに、撮像対象物のエッジを抽出する方法であってもよい。サーチの結果、新たな撮像対象物の設定用撮像対象物に対する位置又は姿勢のずれが検出されると、新たな高さデータに対する基準位置のずれが補正される。 For example, when the imaging target for which height data for setting the reference position has been acquired is used as the setting imaging target, the acquisition unit creates a new brightness image of a new imaging target different from the setting imaging target. When new height data is acquired, the correction unit searches for a characteristic part of the new luminance image. The search by the correction unit may be a pattern search based on the degree of correlation with registered images registered in advance, or may be a method of extracting edges of the imaged object without using registered images. As a result of the search, when a shift in the position or orientation of the new imaging target with respect to the setting imaging target is detected, the shift in the reference position with respect to the new height data is corrected.

基準位置の補正後、基準位置に対応する高さ情報を用いて新たな高さデータの基準面が算出され、新たな高さデータの基準面を基準として、新たな高さデータが階調数の低い高さ画像に変換される。例えば、高さデータの階調数が16bitであったとすると、高さ画像は8bitの階調数に変換することができる。生成された高さ画像は、二次元画像処理ライブラリで扱うことができる二次元画像である。 After correcting the reference position, a new reference plane for height data is calculated using the height information corresponding to the reference position, and the new height data is calculated based on the reference plane for the new height data. is converted to a lower height image. For example, if the number of gradations of the height data is 16 bits, the height image can be converted to the number of gradations of 8 bits. The generated height image is a two-dimensional image that can be handled by a two-dimensional image processing library.

また、生成された高さ画像が標準化された規格により出力されるので、撮像装置を汎用パーソナルコンピュータ等の設定装置に接続して使用する場合に、高さ画像を設定装置で容易に受け取ることができる。さらに、受け取った高さ画像は、上述したように二次元画像処理ライブラリで扱うことができるものなので、二次元画像に変換のためのプログラムコードをユーザ側で記述しなくても、設定装置で画像処理を容易に行うことが可能になり、記述のための時間や手間が不要になる。 In addition, since the generated height image is output according to standardized standards, when the imaging device is connected to a setting device such as a general-purpose personal computer, the height image can be easily received by the setting device. can. Furthermore, since the received height image can be handled by the two-dimensional image processing library as described above, the user does not have to write program code for converting it into a two-dimensional image, and the setting device can process the image. It becomes possible to perform processing easily, and time and effort for writing are unnecessary.

また、例えば、撮像対象物が仮に水平面から傾いていたとしても、上述したように基準位置のずれが補正されてから基準面を算出し、算出された基準面を基準として低階調数の高さ画像に変換するので、傾きを補正するためのコードをユーザ側で記述する必要はない。このことによってもユーザ側の使い勝手が向上する。 For example, even if the object to be imaged is tilted from the horizontal plane, the reference plane is calculated after the deviation of the reference position is corrected as described above, and the number of low gradations is adjusted based on the calculated reference plane. Since the image is converted to a straight image, there is no need for the user to write code to correct the tilt. This also improves usability for the user.

第2の開示は、前記撮像装置は、前記基準位置からなる設定項目と、該設定項目の設定値が格納される場所を示すレジスタ情報とが記述されたファイルを外部から取得してユーザにより設定された該設定項目の設定値と、該ファイルに含まれる該設定項目に対応するレジスタ情報とを該撮像装置に送信可能な設定装置に、ネットワークを介して接続可能に構成することができる。さらに、前記撮像装置は、前記設定装置から受信した前記設定項目の設定値を、該設定項目に対応するレジスタ情報が示す場所に格納することができる。 In a second disclosure, the imaging device acquires from the outside a file in which a setting item including the reference position and register information indicating a location where the setting value of the setting item is stored is set by the user. The configuration can be configured to be connectable via a network to a setting device capable of transmitting the set value of the set item and register information included in the file corresponding to the set item to the imaging device. Furthermore, the imaging device can store the setting value of the setting item received from the setting device in a location indicated by register information corresponding to the setting item.

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

例えば、ユーザが基準位置を設定すると、基準位置の座標が設定値になり、基準位置という設定項目と、その座標とがレジスタ情報とともに撮像装置に送信される。これにより、撮像装置の基準位置に関する設定が行われるので、標準化規格に適合した撮像装置であれば設定装置で上記設定を自由に変更することができ、撮像装置の機種選定の自由度が向上する。 For example, when a user sets a reference position, the coordinates of the reference position become set values, and a setting item called the reference position and its coordinates are transmitted to the imaging device together with register information. As a result, settings related to the reference position of the imaging device are performed, so if the imaging device complies with the standardization specifications, the above settings can be changed freely using the setting device, increasing the degree of freedom in selecting the model of the imaging device. .

第3の開示では、前記取得部は、撮像対象物に対して所定の投影パターンを有する構造化照明を投光する投光部と、撮像対象物からの反射光の受光量に応じた輝度画像を取得するとともに、前記投光部により投光された構造化照明が撮像対象物で反射した反射光を受光して、複数のパターン投影画像を生成する画像生成部とを有するとともに、前記画像生成部により生成された複数のパターン投影画像に基づいて、高さデータを取得するように構成することができる。 In a third disclosure, the acquisition unit includes a light projecting unit that projects structured illumination having a predetermined projection pattern onto the imaging target, and a luminance image according to the amount of reflected light received from the imaging target. and an image generation section that generates a plurality of pattern projection images by receiving reflected light reflected by the structured illumination projected by the light projection section on the imaging target object, and the image generation section generates a plurality of pattern projection images. The height data can be configured to be acquired based on a plurality of pattern projection images generated by the unit.

すなわち、高さデータを取得する手法としては、ステレオ計測法などのパッシブ方式や、光切断法、パターン投影法などのアクティブ方式などがあり、これらのうち、どの方法を用いてもよいが、特に構造化照明を投光して撮像するパターン投影法を用いることで、正確な高さデータを取得することができる。 In other words, methods for acquiring height data include passive methods such as stereo measurement, active methods such as light cutting method and pattern projection method, and any of these methods may be used. Accurate height data can be obtained by using a pattern projection method that projects structured illumination and captures images.

第4の開示は、前記撮像装置とネットワークを介して接続され、当該撮像装置の設定項目と各設定項目の設定値が格納される場所を示すレジスタ情報とが記述されたファイルを外部から取得し、ユーザにより設定された各設定項目の設定値と、前記ファイルに含まれる各設定項目に対応するレジスタ情報を示すデータを前記撮像装置に送信し、当該撮像装置の設定を行う設定装置とを備えた画像検査システムを前提とすることができる。 A fourth disclosure is to obtain from an external file that is connected to the imaging device via a network and describes setting items of the imaging device and register information indicating a location where setting values of each setting item are stored. , a setting device that transmits data indicating the setting values of each setting item set by the user and register information corresponding to each setting item included in the file to the imaging device, and configures the imaging device. The image inspection system can be used as a prerequisite.

前記設定装置は、前記新たな高さデータの高さ情報を表示する表示部と、前記表示部に表示された高さ情報を利用して所定の高さ範囲を設定する高さ範囲設定部とを備えている。前記変換部は、前記算出部により算出された基準面と、前記高さ範囲設定部により設定された所定の高さ範囲とに基づいて、前記新たな高さデータを、該新たな高さデータの階調数よりも低い階調数を有する高さ画像に変換するように構成することができる。 The setting device includes a display section that displays height information of the new height data, and a height range setting section that sets a predetermined height range using the height information displayed on the display section. It is equipped with The conversion unit converts the new height data into new height data based on the reference plane calculated by the calculation unit and the predetermined height range set by the height range setting unit. The height image can be configured to be converted into a height image having a lower number of gradations than the number of gradations.

この構成によれば、取得された新たな高さデータの高さ情報が表示部に表示される。ユーザは、表示部に表示された高さ情報を利用することで、高さ画像として表現して欲しい高さ範囲を設定することができる。例えば、撮像対象物の下部については高さ画像中に表現しても画像検査上の意味がない場合には、高さ範囲として撮像対象物の下部を除外した範囲にすることができる。これにより、画像検査に必要な高さ範囲のみ含んだ高さ画像を用いて画像検査することができ、検査スピードの向上及び検査精度の向上を図ることができる。 According to this configuration, the height information of the acquired new height data is displayed on the display section. By using the height information displayed on the display unit, the user can set the height range that he/she wishes to express as a height image. For example, if expressing the lower part of the object to be imaged in the height image has no meaning in terms of image inspection, the height range can be a range excluding the lower part of the object to be imaged. Thereby, image inspection can be performed using a height image that includes only the height range necessary for image inspection, and it is possible to improve inspection speed and inspection accuracy.

第5の開示では、前記設定装置は、前記算出部により算出された基準面を基準として、前記新たな高さデータの高さ情報に含まれる画素ごとの高さについて度数分布を算出する度数分布算出部を有し、前記表示部は、前記度数分布算出部により算出された度数分布を表示し、前記高さ範囲設定部は、前記表示部に表示された度数分布上で、所定の高さ範囲の設定を可能にすることができる。 In a fifth disclosure, the setting device calculates a frequency distribution for the height of each pixel included in the height information of the new height data, using the reference plane calculated by the calculation unit as a reference. the display unit displays the frequency distribution calculated by the frequency distribution calculation unit, and the height range setting unit sets a predetermined height on the frequency distribution displayed on the display unit. It may be possible to set a range.

この構成によれば、画素ごとの高さについての度数分布が表示部に表示されるので、例えば画素が殆ど存在しない高さ範囲や、画素が多く存在する高さ範囲をユーザが容易に判別できる。例えば画素が殆ど存在しない高さ範囲については、高さ画像に表示する高さ範囲から除外したり、画素が多く存在する高さ範囲に絞って高さ画像を生成することができる。 According to this configuration, the frequency distribution of the height of each pixel is displayed on the display, so the user can easily determine, for example, a height range where there are few pixels and a height range where there are many pixels. . For example, a height range where there are few pixels can be excluded from the height range displayed in the height image, or a height image can be generated by narrowing the height range to a height range where there are many pixels.

第6の開示では、前記取得部は、高さデータに基づいて撮像対象物の三次元画像を生成することができる。また、前記表示部は、前記取得部で生成された三次元画像を表示するとともに、前記高さ範囲設定部で設定された高さ範囲を三次元画像上に表示するように構成することができる。 In a sixth disclosure, the acquisition unit can generate a three-dimensional image of the imaging target based on height data. Further, the display unit may be configured to display the three-dimensional image generated by the acquisition unit and to display the height range set by the height range setting unit on the three-dimensional image. .

この構成によれば、表示部に表示された三次元画像上に高さ範囲が示されるので、高さ範囲の設定がユーザの意図通りに行われているか否かを確認できる。例えば、高さ範囲を示す線や面を三次元画像に重ねて表示することができる。 According to this configuration, since the height range is shown on the three-dimensional image displayed on the display unit, it can be confirmed whether the height range has been set as intended by the user. For example, lines or planes indicating the height range can be displayed superimposed on the three-dimensional image.

第7の開示では、前記表示部は、前記高さ範囲設定部で設定された高さ範囲を度数分布上に表示するように構成することができる。 In a seventh disclosure, the display unit may be configured to display the height range set by the height range setting unit on a frequency distribution.

この構成によれば、表示部に表示された度数分布上に高さ範囲が示されるので、高さ範囲の設定がユーザの意図通りに行われているか否かを確認できる。例えば、高さ範囲を示す線を度数分布上に重ねて表示することができる。 According to this configuration, since the height range is shown on the frequency distribution displayed on the display unit, it can be confirmed whether the height range is set as intended by the user. For example, a line indicating the height range can be displayed superimposed on the frequency distribution.

第8の開示では、前記設定装置は、前記出力部から出力された高さ画像に対して画像処理を行う画像処理部と、該画像処理部により画像処理された画像に基づいて外観検査を行う検査部とを備えることができる。 In an eighth disclosure, the setting device includes an image processing unit that performs image processing on the height image output from the output unit, and performs an appearance inspection based on the image processed by the image processing unit. and an inspection section.

以上説明したように、本開示によれば、画像処理に適した高さ画像を設定装置が撮像装置から容易に取得でき、取得した高さ画像を用いて画像処理を行うことができるので、高さデータを高さ画像に変換するためのプログラムコードの記述、また、変換時に撮像対象物の傾きを補正するためのプログラムコードの記述等が不要になり、ユーザの使い勝手を向上させることができる。 As described above, according to the present disclosure, the setting device can easily acquire a height image suitable for image processing from the imaging device, and can perform image processing using the acquired height image. This eliminates the need to write program code to convert height data to a height image, or to correct the inclination of the object to be imaged during conversion, thereby improving usability for the user.

本発明の実施形態1に係る画像検査システムの概略構成及び運用状態を模式的に示す図である。1 is a diagram schematically showing a schematic configuration and operational state of an image inspection system according to Embodiment 1 of the present invention. 実施形態2に係る図1相当図である。2 is a diagram corresponding to FIG. 1 according to Embodiment 2. FIG. 実施形態3に係る図1相当図である。2 is a diagram corresponding to FIG. 1 according to Embodiment 3. FIG. 実施形態4に係る図1相当図である。2 is a diagram corresponding to FIG. 1 according to Embodiment 4. FIG. デフレクトメトリの原理に基づいて高さ画像を生成する手順を示すフローチャートである。It is a flowchart which shows the procedure of generating a height image based on the principle of deflectometry. フォトメトリックステレオ法を利用して高さ画像を生成する実施形態5に係る図1相当図である。FIG. 2 is a diagram corresponding to FIG. 1 according to a fifth embodiment of generating a height image using a photometric stereo method. 画像検査アプリケーションとカメラとの接続インターフェースを説明する図である。FIG. 2 is a diagram illustrating a connection interface between an image inspection application and a camera. 撮像装置の内部処理の一例を概念的に示すフローチャートである。2 is a flowchart conceptually illustrating an example of internal processing of the imaging device. デフレクトメトリの原理を利用した検査画像の生成を行う場合のパラメータセットを示す図である。FIG. 3 is a diagram showing a parameter set when generating an inspection image using the principle of deflectometry. マルチスペクトルイメージングにより検査画像の生成を行う場合のパラメータセットを示す図である。FIG. 3 is a diagram showing a parameter set when generating an inspection image by multispectral imaging. 撮像制御部のブロック図である。FIG. 3 is a block diagram of an imaging control section. 設定時の高さ抽出の手順の一例を示すフローチャートである。12 is a flowchart illustrating an example of a procedure for height extraction at the time of setting. 2D画像変換設定ダイアログの例を示す図である。FIG. 3 is a diagram showing an example of a 2D image conversion setting dialog. 2D画像変換設定ダイアログにワークを側方から見た画像を表示した例を示す図である。FIG. 6 is a diagram illustrating an example of displaying an image of a workpiece viewed from the side in a 2D image conversion setting dialog. 高さ抽出範囲を狭くした場合を示す図14相当図である。FIG. 14 is a diagram corresponding to FIG. 14 showing a case where the height extraction range is narrowed; 位置補正の設定手順の一例を示すフローチャートである。7 is a flowchart illustrating an example of a position correction setting procedure. パターンサーチ設定ダイアログの例を示す図である。FIG. 3 is a diagram showing an example of a pattern search setting dialog. 運用時の高さ抽出の手順の一例を示すフローチャートである。12 is a flowchart illustrating an example of a procedure for height extraction during operation. 運転時にゼロ面指定を行う手順の一例を示すフローチャートである。12 is a flowchart showing an example of a procedure for specifying a zero plane during operation. 運転時に三次元差分をとる手順の一例を示すフローチャートである。It is a flowchart which shows an example of the procedure of taking a three-dimensional difference during operation.

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

(実施形態1)
図1は、本発明の実施形態に係る画像検査システム1の運用状態を模式的に示すものである。画像検査システム1は、検査対象物であるワークWを撮像した画像を用いてワークWの欠陥の有無を検査するように構成されており、ワークWを照明する照明装置2と、ワークWを撮像する撮像部3と、撮像部3の設定を行うパーソナルコンピュータ(PC)等で構成された設定装置4とを備えている。ワークWは、撮像部3で撮像される対象となるものであることから、撮像対象物と呼ぶこともできる。照明装置2と撮像部3とにより、高さデータを取得する取得部Aが構成されている。画像検査システム1の一部を構成している画像検査用撮像装置300は取得部Aを含む装置である。また、撮像装置300と設定装置4とは切り離されたものであってもよく、撮像装置300単体を本発明の実施形態とすることもできる。
(Embodiment 1)
FIG. 1 schematically shows the operating state of an image inspection system 1 according to an embodiment of the present invention. The image inspection system 1 is configured to inspect the presence or absence of defects in the workpiece W using an image taken of the workpiece W, which is an object to be inspected. and a setting device 4 configured with a personal computer (PC) or the like that performs settings for the imaging section 3. Since the workpiece W is an object to be imaged by the imaging unit 3, it can also be called an imaged object. The illumination device 2 and the imaging section 3 constitute an acquisition section A that acquires height data. The imaging device 300 for image testing that constitutes a part of the image testing system 1 is a device that includes an acquisition unit A. Further, the imaging device 300 and the setting device 4 may be separated, and the imaging device 300 alone may be an embodiment of the present invention.

設定装置4は、表示部5と、キーボード6及びマウス7とを備えている。表示部5は、たとえば有機ELディスプレイや液晶ディスプレイ等からなるモニタを含むものであり、撮像装置300で撮像された画像、撮像装置300で撮像された画像を各種処理した処理後の画像、各種ユーザーインターフェース画像(GUI)等を表示することができる部分である。各種ユーザーインターフェース画像等は、設定装置4の本体部で生成される。表示部5の横方向を当該表示部5のX方向とし、表示部5の縦方向を当該表示部5のY方向とすることができる。 The setting device 4 includes a display section 5, a keyboard 6, and a mouse 7. The display unit 5 includes a monitor made of, for example, an organic EL display or a liquid crystal display, and displays images captured by the imaging device 300, images obtained by performing various processing on the images captured by the imaging device 300, and various users. This is a part that can display an interface image (GUI), etc. Various user interface images and the like are generated by the main body of the setting device 4. The horizontal direction of the display section 5 can be the X direction of the display section 5, and the vertical direction of the display section 5 can be the Y direction of the display section 5.

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

図1では、複数のワークWが搬送用ベルトコンベアBの上面に載置された状態で図1における白抜き矢印で示す方向へ搬送されている場合を示している。設定装置4には、搬送用ベルトコンベアB及び画像検査システム1をシーケンス制御するための機器として、プログラマブル・ロジック・コントローラ(PLC)等からなる外部制御機器8が接続されている。この外部制御機器8は、画像検査システム1の一部を構成するものとしてもよい。また、外部制御機器8は、画像検査システム1の構成要素としなくてもよい。 FIG. 1 shows a case where a plurality of workpieces W are placed on the upper surface of a conveyor belt B and are being conveyed in the direction indicated by the white arrow in FIG. An external control device 8 such as a programmable logic controller (PLC) is connected to the setting device 4 as a device for sequentially controlling the conveyor belt B and the image inspection system 1. This external control device 8 may constitute 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.

尚、この実施形態の説明では、搬送用ベルトコンベアBによるワークWの搬送方向(ワークWの移動方向)をY方向とし、搬送用ベルトコンベアBの平面視でY方向に直交する方向をX方向とし、X方向及びY方向に直交する方向(搬送用ベルトコンベアBの上面に直交する方向)をZ方向と定義するが、これは説明の便宜を図るために定義するだけである。 In the description of this embodiment, the direction in which the workpiece W is transported by the transporting belt conveyor B (the moving direction of the workpiece W) is defined as the Y direction, and the direction orthogonal to the Y direction in a plan view of the transporting belt conveyor B is defined as the X direction. The direction perpendicular to the X direction and the Y direction (the direction perpendicular to the top surface of the transport belt conveyor B) is defined as the Z direction, but this is only defined for the 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 to inspect the appearance of the workpiece W, that is, to inspect the surface of the workpiece W for defects such as scratches, dirt, and dents. It is also possible to make a pass/fail judgment. During operation, the image inspection system 1 receives an inspection start trigger signal that defines the start timing of a defect inspection (pass/fail determination inspection) from the external control device 8 via a signal line. The image inspection system 1 performs imaging and illumination of the workpiece W based on this inspection start trigger signal, and obtains an inspection image after predetermined processing. Thereafter, a visual inspection is performed based on the inspection image, and the inspection results are transmitted to the external control device 8 via the signal line. In this manner, during operation of the image inspection system 1, input of an inspection start trigger signal and output of inspection results are repeatedly performed between the image inspection system 1 and the external control device 8 via the signal line. The input of the inspection start trigger signal and the output of the inspection results may be performed via the signal line between the image inspection system 1 and the external control device 8, as described above, or via other signals (not shown). It may also be done via a line. For example, a sensor for detecting the arrival of the work W may be directly connected to the image inspection system 1, 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 and perform an inspection.

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

(取得部Aの構成)
取得部Aは、ワークWからの反射光の受光量に応じた輝度画像を取得するとともに、ワークWの高さ情報が二次元座標上に配置された高さデータを取得可能に構成された部分である。輝度画像は、照明装置2により照明されたワークWを撮像部3により撮像することによって取得することができる。ワークWに対する照明が不要な場合には、照明装置2により照明することなく、ワークWを撮像部3により撮像することによって輝度画像を取得できる。
(Configuration of acquisition unit A)
The acquisition unit A is configured to acquire a brightness image according to the amount of reflected light received from the workpiece W, and also acquire height data in which height information of the workpiece W is arranged on two-dimensional coordinates. It is. The brightness image can be acquired by imaging the workpiece W illuminated by the illumination device 2 using the imaging unit 3 . When the workpiece W does not need to be illuminated, a brightness image can be obtained by imaging the workpiece W with the imaging section 3 without illuminating it with the illumination device 2.

ワークWの高さ情報が二次元座標上に配置された高さデータを取得する手法は特に限定されるものではなく、どのような手法であってもよく、手法に応じたハードウェア及びソフトウェアを適宜選択できる。取得部Aは、高さデータを取得することで三次元画像を生成できる。 The method of acquiring height data in which the height information of the workpiece W is arranged on two-dimensional coordinates is not particularly limited, and any method may be used, and hardware and software suitable for the method may be used. You can choose as appropriate. The acquisition unit A can generate a three-dimensional image by acquiring height data.

すなわち、高さデータを取得する手法としては、大きく分けて2つの方式があり、一つは、通常の輝度画像を得るための照明条件で撮像した画像を用いて高さデータを取得するパッシブ方式(受動計測方式)、もう一つは、高さ方向の計測をするための光を能動的に照射して高さデータを取得するアクティブ方式(能動計測方式)である。パッシブ方式の代表的な手法は、ステレオ計測法である。これは、撮像部3を2台用意し、これら2台の撮像部3を所定の位置関係で配置してそれぞれ撮像を実行させ、生成された2枚の画像に基づいて周知の演算を行うことで高さデータを取得できる。 In other words, there are two main methods for acquiring height data: one is a passive method that acquires height data using images captured under lighting conditions for obtaining normal brightness images; (passive measurement method), and the other is an active method (active measurement method) in which height data is acquired by actively irradiating light for measuring in the height direction. A typical passive method is the stereo measurement method. This involves preparing two imaging units 3, arranging these two imaging units 3 in a predetermined positional relationship, performing imaging respectively, and performing well-known calculations based on the two images generated. You can get height data with .

アクティブ方式の代表的な手法は、光切断法とパターン投影法である。光切断法は、上述したステレオ計測法において、一方の撮像部3をレーザ投光器に置き換えて、ワークWに対してライン状のレーザ光を投光し、ワークWの表面の形状に応じたライン光の像の歪み具合に基づいてワークWの三次元形状を復元する。光切断法は、対応点の決定が不要であるので安定した計測が可能である。 Representative methods of the active method are the light cutting method and the pattern projection method. In the optical cutting method, in the stereo measurement method described above, one of the imaging units 3 is replaced with a laser projector, and a line-shaped laser beam is projected onto the workpiece W, so that the line light is generated according to the shape of the surface of the workpiece W. The three-dimensional shape of the workpiece W is restored based on the degree of distortion of the image. The optical cutting method does not require the determination of corresponding points, so stable measurement is possible.

パターン投影法は、ワークWに投光された所定の投影パターンの形状や位相等をずらして複数枚の画像を撮像し、撮像した複数枚の画像を解析することでワークWの三次元形状を復元する方法である。パターン投影法には幾つか種類があり、正弦波縞模様パターンの位相をずらして複数枚(最低3枚以上)の画像を撮像し、複数枚の画像から画素ごとに正弦波の位相を求め、求めた位相を利用してワーク表面上の三次元座標を求める位相シフト法や、2つの規則的なパターンが合成されるときに生じる一種の空間周波数のうねり現象を利用して三次元形状を復元するモアレポトグラフィ法、ワークWに投影するパターン自体を撮影毎に異ならせ、例えば白黒デューティ比50%で縞幅が画面半分、4分の1、8分の1、、、と細くなっていく縞パターンを順次投影し、それぞれのパターンにてパターン投影画像の撮影を行い、ワークWの高さの絶対位相を求める空間コード化法、ワークに複数の細線状のパターン照明(マルチスリット)を投影し、スリット周期より狭いピッチでパターンを移動させ、複数回撮影を行うマルチスリット法等が代表的である。 The pattern projection method captures multiple images by shifting the shape, phase, etc. of a predetermined projection pattern projected onto the workpiece W, and analyzes the captured multiple images to determine the three-dimensional shape of the workpiece W. This is the method to restore it. There are several types of pattern projection methods, in which the phase of the sine wave striped pattern is shifted, multiple images (at least 3 or more) are taken, and the phase of the sine wave is determined for each pixel from the multiple images. The phase shift method uses the determined phase to find three-dimensional coordinates on the work surface, and the three-dimensional shape is restored using a type of spatial frequency waviness phenomenon that occurs when two regular patterns are combined. In the moiré photography method, the pattern itself projected onto the workpiece W is different for each shot, and for example, at a black and white duty ratio of 50%, the stripe width becomes thinner by half the screen, one-fourth, one-eighth, etc. A spatial coding method in which a striped pattern is sequentially projected, a pattern projection image is taken for each pattern, and the absolute phase of the height of the workpiece W is determined, and multiple thin line pattern illuminations (multi-slits) are projected onto the workpiece. However, a typical example is a multi-slit method in which the pattern is moved at a pitch narrower than the slit period and images are taken multiple times.

また、上述した位相シフト法と空間コード化法とを組み合わせて高さデータを取得することもできるが、これに限られるものではなく、他の方法によって高さデータを取得しても構わない。また、上述した方法以外の方法、例えば光レーダ法(タイムオブフライト)、合焦点法、共焦点法、白色光干渉法等、高さデータを取得するために考え得る如何なる手法を採用しても構わない。 Further, although height data can be acquired by combining the above-described phase shift method and spatial coding method, the present invention is not limited to this, and height data may be acquired by other methods. Furthermore, any conceivable method other than the above-mentioned methods, such as optical radar method (time of flight), focused focus method, confocal method, white light interferometry, etc., may be used to obtain height data. I do not care.

上記照明装置2及び撮像部3は、パターン投影法を実現可能に構成されている。以下、照明装置2及び撮像部3の具体的な構成について説明する。 The illumination device 2 and the imaging unit 3 are configured to be able to implement a pattern projection method. The specific configurations of the illumination device 2 and the imaging section 3 will be described below.

(照明装置2の構成)
まず、照明装置2ついて説明する。照明装置2は、ワークWに対して所定の投影パターンを有する構造化照明を投光する投光部であり、発光部2aと、発光部2aを制御する照明制御部2bとを備えている。発光部2aと照明制御部2bとは、別体であってもよいし、一体化されたものであってもよい。また、照明制御部2bは、設定装置4に組み込まれていてもよい。発光部2aは、たとえば発光ダイオード、液晶パネルを用いたプロジェクタ、有機ELパネル、デジタルマイクロミラーデバイス(DMD)等で構成することができ、照明部と呼ぶこともできる。発光ダイオード、液晶パネル、有機ELパネル、DMDについては図示しないが、従来から周知の構造のものを用いることができる。照明装置2は、設定装置4に対して信号線100aを介して接続されており、撮像部3及び設定装置4から離して設置することができるようになっている。
(Configuration of lighting device 2)
First, the lighting device 2 will be explained. The illumination device 2 is a light projecting section that projects structured illumination having a predetermined projection pattern onto the workpiece W, and includes a light emitting section 2a and a lighting control section 2b that controls the light emitting section 2a. The light emitting section 2a and the illumination control section 2b may be separate bodies or may be integrated. Furthermore, the lighting control section 2b may be incorporated into the setting device 4. The light emitting section 2a can be configured with, for example, a light emitting diode, a projector using a liquid crystal panel, an organic EL panel, a digital micromirror device (DMD), etc., and can also be called a lighting section. Although light emitting diodes, liquid crystal panels, organic EL panels, and DMDs are not shown, those having conventionally known structures 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 imaging section 3 and the setting device 4.

実施形態1の照明装置2は、均一面発光を行うことができるように構成される。また、照明装置2は、所定の投影パターンを有する構造化照明の一例として、デフレクトメトリ処理を実現可能な照明を行うことができるように構成されており、従って、周期的な照度分布を有するパターン光をワークWに照射する発光部2aを有している。すなわち、照明装置2は、複数の異なるパターン光をワークWに対して順次照射するパターン光照明を実行するパターン光照明部とすることができる。以下、デフレクトメトリ処理を行うことによって高さデータを含む検査用画像を取得する場合に用いる照明装置2について説明する。 The lighting device 2 of Embodiment 1 is configured to be able to perform uniform surface emission. Furthermore, the illumination device 2 is configured to be able to perform illumination that can implement deflectometry processing, as an example of structured illumination having a predetermined projection pattern, and therefore has a periodic illuminance distribution. It has a light emitting section 2a that irradiates the workpiece W with pattern light. That is, the illumination device 2 can be a patterned light illumination unit that performs patterned light illumination in which the workpiece W is sequentially irradiated with a plurality of different patterned lights. The illumination device 2 used when acquiring an inspection image including height data by performing deflectometry processing will be described below.

複数の発光ダイオードを用いる場合には、複数の発光ダイオードをドットマトリクス状に配置して電流値制御によって周期的な照度分布を有するパターン光を生成することができる。たとえば、明暗がY方向に変化するY方向パターン光の場合、縞模様がY方向に繰り返されるパターン光という表現とすることもでき、このY方向パターン光を生成する際には、照度分布の位相をY方向にシフトさせることにより、照度分布の位相が異なった複数のY方向パターン光を生成することができる。Y方向パターン光の照度分布をsin波形に近似した波形で表すこともでき、この場合、たとえば位相を90゜ずつ変化させて、0゜の場合のY方向パターン光、90゜の場合のY方向パターン光、180゜の場合のY方向パターン光、270゜の場合のY方向パターン光を生成することができる。 When using a plurality of light emitting diodes, the plurality of light emitting diodes can be arranged in a dot matrix and a pattern of light having a periodic illuminance distribution can be generated by controlling the current value. For example, in the case of Y-direction pattern light in which brightness and darkness change in the Y-direction, it can also be expressed as pattern light in which a striped pattern is repeated in the Y-direction, and when generating this Y-direction pattern light, the phase of the illuminance distribution is By shifting in the Y direction, it is possible to generate a plurality of Y direction pattern lights with different phases of illuminance distribution. The illuminance distribution of the Y-direction pattern light can also be represented by a waveform that approximates a sinusoidal waveform. In this case, for example, by changing the phase by 90°, the Y-direction pattern light at 0° and the Y-direction pattern light at 90° can be expressed. It is possible to generate pattern light, Y-direction pattern light at 180°, and 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波形だけでなく、三角波等のパターン光でも可能である。 In addition, in the case of X-direction pattern light in which the brightness and darkness change in the X direction, it can also be expressed as pattern light in which a striped pattern is repeated in the By shifting in the X direction, it is possible to generate a plurality of X direction pattern lights with different phases of illuminance distribution. The illuminance distribution of the X-direction pattern light can also be represented by a waveform that approximates a sinusoidal waveform. In this case, for example, by changing the phase by 90°, the X-direction pattern light at 0° and the X-direction pattern light at 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 workpiece W in different lighting modes. When performing deflectometry processing, the pattern light irradiated onto the workpiece W can be not only a sin waveform but also a triangular wave pattern light.

尚、全ての発光ダイオードに同じ電流値の電流を流すことで照度分布が面内で均一な光を照射することもできる。全ての発光ダイオードに流す電流値を同じにして変化させていくと、暗い面発光状態から明るい面発光状態まで発光状態を変化させることができる。 It is also possible to irradiate light with a uniform illuminance distribution within 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 at the same value, the light emitting state can be changed from a dark side light emitting state to a bright side light emitting state.

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

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

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

カメラ31は、集光系光学系32を通して得られた光の強度を電気信号に変換するCCDやCMOS等の撮像素子からなるイメージセンサを有している。カメラ31は、ワークWからの反射光の受光量に応じた輝度画像を取得するとともに、照明装置2により投光された構造化照明がワークWで反射した反射光を受光して、複数のパターン投影画像を生成する画像生成部である。また、撮像制御部33は、記憶装置や信号処理装置を有するとともに、カメラ31の露光開始及び終了の制御、露光時間の制御、アナログゲインの調整等を行う部分である。内部の論理回路によってイメージセンサの駆動や、画像データの転送を制御することができる。また、撮像制御部33によって各種画像処理、フィルター処理、画像生成等を行うことができるようになっており、撮像部3は、フィルター処理機能を保有した装置である。 The camera 31 has an image sensor made of an image sensor such as a CCD or CMOS that converts the intensity of light obtained through the condensing optical system 32 into an electrical signal. The camera 31 acquires a brightness image according to the amount of reflected light received from the workpiece W, and also receives the reflected light reflected by the structured illumination device 2 from the workpiece W to create a plurality of patterns. This is an image generation unit that generates a projection image. The imaging control section 33 includes a storage device and a signal processing device, and is a section that controls the start and end of exposure of the camera 31, controls the exposure time, adjusts analog gain, and the like. The internal logic circuit can control the driving of the image sensor and the transfer of image data. Further, the imaging control section 33 is capable of performing various image processing, filter processing, image generation, etc., and the imaging section 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 includes one or more optical lenses. Further, the condensing optical system 32 is configured to be able to perform autofocus. The positional relationship between the imaging unit 3 and the illumination device 2 is set so that the light emitted from the illumination device 2 toward the surface of the workpiece W is reflected on the surface of the workpiece W and enters the condensing optical system 32. can do. When the workpiece W is a translucent member such as a transparent film or sheet, pattern light emitted from the illumination device 2 toward the surface of the workpiece W is transmitted through the workpiece W and collected by the imaging unit 3. The positional relationship between the imaging unit 3 and the illumination device 2 can be set so that the light enters the optical system 32 . In any of the above cases, the imaging unit 3 and the illumination device 2 are arranged so that the specular reflection component and the diffuse reflection component reflected from the surface of the work W enter the condensing optical system 32 of the imaging unit 3. Furthermore, a line camera in which light-receiving elements are arranged linearly in the Y direction can also be used for the imaging unit 3, but instead of a line camera, an area camera (in which the light-receiving elements are arranged in a line in the In the case of this area camera, an illumination form called coaxial illumination is also possible.

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

(実施形態3)
図3は、本発明の実施形態3に係る画像検査システム1の概略構成及び運用状態を模式的に示す図である。実施形態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 operational state of an image inspection system 1 according to Embodiment 3 of the present invention. In the third embodiment, the illumination control section 2b is incorporated into and integrated with the imaging control section 33, and the display section 5 and the mouse 7 are connected to the imaging control section 33. The setting device 4 is composed of, for example, a notebook computer, and is connected to the imaging control section 33. The setting device 4 has a keyboard 6. Further, a mouse may be connected to the setting device 4. Various user interfaces generated by the setting device 4 can be displayed on the display unit 5 via the imaging control unit 33.

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

(デフレクトメトリ処理)
実施形態1~4では、撮像部3により生成された複数のパターン投影画像に基づいて、高さデータを取得するように構成されている。具体的には、撮像部3が撮像した複数の輝度画像からデフレクトメトリの原理に基づいてワークWの表面の位相データを生成し、当該位相データに基づいて、ワークWの高さ情報が二次元座標上に配置された高さデータ、即ち、ワークWの形状を示す高さ画像を生成するデフレクトメトリ処理を行うように構成されている。
(Deflectometry processing)
Embodiments 1 to 4 are configured to acquire height data based on a plurality of pattern projection images generated by the imaging unit 3. Specifically, phase data of the surface of the workpiece W is generated based on the principle of deflectometry from a plurality of brightness images taken by the imaging unit 3, and height information of the workpiece W is calculated based on the phase data. It is configured to perform deflectometry processing to generate height data arranged on dimensional coordinates, that is, a height image indicating the shape of the workpiece W.

図5に一例を示すように、照明装置2の発光部2aは、第1発光部21、第2発光部22、第3発光部23及び第4発光部24を備えており、これら第1~第4発光部21~24がそれぞれパターン投影可能になっている。 As an example shown in FIG. 5, the light emitting section 2a of the illumination device 2 includes a first light emitting section 21, a second light emitting section 22, a third light emitting section 23, and a fourth light emitting section 24. Each of the fourth light emitting units 21 to 24 is capable of projecting a pattern.

以下、図5に基づいて高さ画像の生成について詳細に説明する。照明装置2の第1発光部21が空間コード法にしたがう4つのパターン光をワークWに照射した場合には、撮像部3が4つの異なる画像からなるグレーコードパターン画像セットを生成する。また、照明装置2の第1発光部21が位相シフト法にしたがう8つのパターン光をワークWに照射した場合には、撮像部3が8つの異なる画像からなる位相シフトパターン画像セットを生成する。 Hereinafter, generation of a height image will be explained in detail based on FIG. 5. When the first light emitting unit 21 of the illumination device 2 irradiates the workpiece W with four pattern lights according to the spatial code method, the imaging unit 3 generates a gray code pattern image set consisting of four different images. Further, when the first light emitting unit 21 of the illumination device 2 irradiates the workpiece W with eight pattern lights according to the phase shift method, the imaging unit 3 generates a phase shift pattern image set consisting of eight different images.

同様に、照明装置2の第2発光部22が空間コード法にしたがうパターン光をワークWに照射した場合には、グレーコードパターン画像セットが生成され、また、位相シフト法にしたがうパターン光をワークWに照射した場合には、位相シフトパターン画像セットが生成される。 Similarly, when the second light emitting unit 22 of the illumination device 2 irradiates the workpiece W with patterned light according to the spatial code method, a gray code pattern image set is generated, and the patterned light according to the phase shift method is irradiated onto the workpiece W. When irradiating W, a phase shift pattern image set is generated.

同様に、照明装置2の第3発光部23が空間コード法にしたがうパターン光をワークWに照射した場合には、グレーコードパターン画像セットが生成され、また、位相シフト法にしたがうパターン光をワークWに照射した場合には、位相シフトパターン画像セットが生成される。 Similarly, when the third light emitting unit 23 of the illumination device 2 irradiates the workpiece W with patterned light according to the spatial code method, a gray code pattern image set is generated, and the patterned light according to the phase shift method is irradiated onto the workpiece W. When irradiating W, a phase shift pattern image set is generated.

同様に、照明装置2の第4発光部24が空間コード法にしたがうパターン光をワークWに照射した場合には、グレーコードパターン画像セットが生成され、また、位相シフト法にしたがうパターン光をワークWに照射した場合には、位相シフトパターン画像セットが生成される。 Similarly, when the fourth light emitting unit 24 of the illumination device 2 irradiates the workpiece W with patterned light according to the spatial code method, a gray code pattern image set is generated, and the patterned light according to the phase shift method is irradiated onto the workpiece W. When irradiating W, a phase shift pattern image set is generated.

位相シフトパターン画像セットを生成した後、位相シフトパターン画像セットの各画像データを取得し、位相シフト法を利用することにより、相対位相計算処理を行うことができる。これにより、位相画像を取得できる。この位相は相対位相(Unwrapping前位相)である。 After generating the phase shift pattern image set, relative phase calculation processing can be performed by acquiring each image data of the phase shift pattern image set and using the phase shift method. Thereby, a phase image can be obtained. This phase is a relative phase (phase before unwrapping).

また、グレーコードパターン画像セットを生成した後、グレーコードパターン画像セットの各画像データを取得し、空間コード法を利用することにより、空間コード算出処理を行い、縞番号画像を得る。縞番号画像は、光が照射される空間を多数の小空間に分けた場合に、小空間に一連の空間コード番号を付して識別可能にした画像である。 Further, after generating the gray code pattern image set, each image data of the gray code pattern image set is acquired, and by using the spatial code method, a spatial code calculation process is performed to obtain a stripe number image. A stripe number image is an image in which a space to which light is irradiated is divided into a large number of small spaces, and each of the small spaces is given a series of space code numbers to be identified.

その後、絶対位相位相化処理を行う。絶対位相位相化処理では、位相画像と、縞番号画像とを合成(Unwrapping)して絶対位相画像(中間画像)を生成する。つまり、空間コード法によって得た空間コード番号により、位相シフト法による位相ジャンプの補正(位相アンラップ)ができるので、高さのダイナミックレンジを広く確保しつつ、高分解能な測定結果を得ることができる。 After that, absolute phase phasing processing is performed. In the absolute phase phasing process, the phase image and the fringe number image are combined (unwrapped) to generate an absolute phase image (intermediate image). In other words, the spatial code number obtained by the spatial code method can be used to correct phase jumps (phase unwrapping) by the phase shift method, making it possible to obtain high-resolution measurement results while ensuring a wide dynamic range of height. .

なお、位相シフト法のみで高さ測定を行うようにしてもよい。この場合は、高さの測定ダイナミックレンジが狭くなるので、位相が1周期以上ずれてしまうような高さの相違が大きいワークWの場合は、高さの測定が正しく行えない。逆に、高さの変化が小さなワークWの場合は、空間コード法による縞画像の撮像や合成を行わないので、その分だけ処理を高速化することができるメリットがある。例えば、高さ方向の差異が少ないワークWを測定する際には、ダイナミックレンジを大きく取る必要がないため、位相シフト法のみでも高精度な高さ測定性能を維持しつつ、処理時間を短くすることができる。また、絶対高さは判るので空間コード法のみで高さ測定するように構成してもよい。この場合、コードを増やすことによって精度を高めることができる。 Note that the height may be measured only by the phase shift method. In this case, the height measurement dynamic range is narrowed, so if the work W has a large difference in height such that the phase is shifted by one cycle or more, the height cannot be measured correctly. Conversely, in the case of a workpiece W with a small change in height, striped images are not captured or synthesized using the spatial code method, so there is an advantage that the processing speed can be increased accordingly. For example, when measuring a workpiece W with little height difference, it is not necessary to have a large dynamic range, so the phase shift method alone can maintain highly accurate height measurement performance and shorten processing time. be able to. Furthermore, since the absolute height is known, the height may be measured only by the spatial code method. In this case, accuracy can be increased by increasing the number of codes.

絶対位相画像は、各画素がワークWへのパターン光の照射角度情報を有する角度画像ということもできる。すなわち、第1パターン画像セット(位相シフトパターン画像セット)には、正弦波縞模様パターンの位相をずらして撮像した8枚の第1パターン画像が含まれているので、位相シフト法を利用することによってワークWへのパターン光の照射角度情報を各画素が有することになる。つまり、複数の第1パターン画像に基づいて、各画素がワークWへの第1測定用パターン光の照射角度情報を有する第1角度画像を生成することができる。第1角度画像は、第1発光部21からワークWへ照射される光の角度を画像化した画像である。 The absolute phase image can also be called an angle image in which each pixel has information on the irradiation angle of the pattern light onto the work W. That is, since the first pattern image set (phase shift pattern image set) includes eight first pattern images obtained by shifting the phase of the sine wave striped pattern, the phase shift method can be used. As a result, each pixel has information on the irradiation angle of the pattern light onto the workpiece W. That is, it is possible to generate a first angle image in which each pixel has information on the irradiation angle of the first measurement pattern light onto the workpiece W, based on the plurality of first pattern images. The first angle image is an image of the angle of light irradiated from the first light emitting unit 21 to the workpiece W.

同様に、複数の第2パターン画像に基づいて各画素がワークWへの第2測定用パターン光の照射角度情報を有する第2角度画像と、複数の第3パターン画像に基づいて各画素がワークWへの第3測定用パターン光の照射角度情報を有する第3角度画像と、複数の第4パターン画像に基づいて各画素がワークWへの第4測定用パターン光の照射角度情報を有する第4角度画像とを生成することができる。 Similarly, each pixel has information on the irradiation angle of the second measurement pattern light onto the workpiece W based on the plurality of second pattern images, and each pixel has the information on the irradiation angle of the second measurement pattern light on the workpiece W based on the plurality of third pattern images. A third angle image having irradiation angle information of the third measurement pattern light onto the workpiece W, and a third angle image having irradiation angle information of the fourth measurement pattern light onto the workpiece W based on a plurality of fourth pattern images. 4-angle images can be generated.

図5における中間画像の最も上の画像が第1角度画像であり、上から2番目の画像が第2角度画像であり、上から3番目の画像が第3角度画像であり、一番下の画像が第4角度画像である。各角度画像の真っ黒に塗りつぶされたように見える部分が照明の影になっている部分であり、角度情報の無い無効画素となる。 The uppermost image of the intermediate images in FIG. 5 is the first angle image, the second image from the top is the second angle image, the third image from the top is the third angle image, and the lowermost image is the first angle image. The image is a fourth angle image. The parts of each angle image that appear to be filled with black are the parts that are in the shadow of the illumination, and are invalid pixels with no angle information.

第1角度画像と第2角度画像とによって第1高さ画像を生成でき、また、第3角度画像と第4角度画像とによって第2高さ画像を生成できる。その後、第1高さ画像と第2高さ画像とを合成して合成後高さ画像を生成できる。これにより、合成後高さ画像では無効画素の数を少なくすることができる。 A first height image can be generated using the first angle image and the second angle image, and a second height image can be generated using the third angle image and the fourth angle image. Thereafter, the first height image and the second height image can be combined to generate a combined height image. This allows the number of invalid pixels to be reduced in the combined height image.

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

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

実施形態5に係る画像検査システム1は、たとえば特開2015-232486号公報に開示されている画像検査システムと同様に構成することができる。すなわち、画像検査システム1は、ワークWを一定の方向から撮像する撮像部3と、ワークWを異なる三以上の照明方向から照明するための照明装置200とを備えるとともに、実施形態1と同様な表示部5、キーボード6及びマウス7を少なくとも備えている。撮像部3と照明装置200とにより取得部Aが構成されている。 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 Publication No. 2015-232486. That is, the image inspection system 1 includes an imaging unit 3 that images the workpiece W from a fixed direction, and an illumination device 200 that illuminates the workpiece W from three or more different illumination directions. It includes at least a display section 5, a keyboard 6, and a mouse 7. An acquisition unit A is configured by the imaging unit 3 and the illumination device 200.

照明装置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 illumination device 200 is configured to irradiate light onto the workpiece W from different directions, and controls the first to fourth light emitting sections 201 to 204 and the first to fourth light emitting sections 201 to 204. The lighting control section 205 has a lighting control section 205. The illumination device 200 is a part that performs multidirectional illumination that irradiates light from different directions to the workpiece W, and is configured to be able to project structured illumination having a predetermined projection pattern. The first to fourth light emitting units 201 to 204 are arranged so as to surround the workpiece W at intervals from each other. The first to fourth light emitting units 201 to 204 can use light emitting diodes, incandescent bulbs, fluorescent lights, or the like. Further, the first to fourth light emitting sections 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 sections 201 to 204 are turned on in sequence, and the imaging section 3 images the workpiece W when any one of the first to fourth light emitting sections 201 to 204 is turned on. 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 imaging unit 3 receives the imaging trigger signal and images the workpiece W at the timing when the light is irradiated. When the illumination device 200 receives the second illumination trigger signal, the illumination control section 205 lights only the second light emitting section 202, and at this time the imaging section 3 images the workpiece W. In this way, four brightness images can be obtained. Note that the number of lights is not limited to four, but can be any number as long as it is three or more and can illuminate the workpiece W from different directions.

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

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

撮像部3は、光が照射されるタイミングでワークWを撮像して複数の輝度画像を得る。そして、複数の輝度画像を合成して検査用画像を得ることができる。これをマルチスペクトルイメージングと呼ぶ。複数の輝度画像をマルチスペクトルイメージングにより合成することでワークWの形状を示す形状画像を生成することができる。尚、照射する光には紫外線や赤外線も含むことができる。 The imaging unit 3 images the workpiece W at the timing when the light is irradiated to obtain a plurality of brightness 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 workpiece W can be generated by combining a plurality of brightness images using multispectral imaging. Note that the irradiated light can also include ultraviolet rays and infrared rays.

(カメラ31と画像検査アプリケーションとの接続インターフェース)
実施形態1~5のカメラ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 31 and image inspection application)
The camera 31 of the first to fifth embodiments is a GenICam standard compatible camera that is compatible with the GenICam standard. The GenICam standard is a standard that standardizes the connection interface between a PC application and the camera 31, and as shown in FIG. This standardizes the interface for controlling the camera 31 and acquiring images captured by the camera 31 using the image inspection application 40 of the setting device 4. If both the imaging unit 3 and the image inspection application 40 of the setting device 4 are compatible with 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, a case will be described in which the camera 31 and the setting device 4 comply with the GenICam standard as a standardized standard, but the standardized standard is not limited to the GenICam standard, and may be other standardized standards. good.

画像検査アプリケーション40を階層構造に分解した場合を想定すると、GenICam層41は、画像検査アプリケーション40における実際に画像検査や欠陥検査等を行う上位の階層(検査部4A、画像処理部4B)と、具体的なネットワーク通信規格に基づき制御を行う階層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 includes upper layers (inspection section 4A, image processing section 4B) that actually perform image inspection, defect inspection, etc. in the image inspection application 40; It is positioned as an intermediate layer located between the layer 42 that performs control based on specific network communication standards. The GenICam layer 41 can be roughly classified into two parts: GenApi 41a and GenTL (Transport Layer) 41b. GenApi 41a is a part that converts setting items of the camera 31 and register addresses inside the camera 31. This GenApi 41a allows the image inspection application 40 to abstractly input character strings such as "ExposureTime" for exposure time and "AnalogGain" for analog gain, without specifying the specific address of the camera 31. When the camera 31 is connected, the register address corresponding to the character string (called Feature) is determined by analyzing a file called DeviceXML (details will be described later) obtained from the camera 31. can be determined.

GenTL41bは、画像検査アプリケーション40とカメラ31との間のデータの転送を制御するインターフェース(API)を規定したものであり、具体的には、カメラ31のレジスタへの書き込み、読み出しAPIの仕様及びカメラ31から転送した画像データの画像検査アプリケーション40の上位の層への受け渡しを行うAPIの仕様を規定したものである。 GenTL41b specifies an interface (API) that controls data transfer between the image inspection application 40 and the camera 31, and specifically specifies the API specifications for writing and reading the register of the camera 31 and This defines the specifications of an API for passing image data transferred from the image inspection application 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 camera 31 may be any standard that uses a high-speed network; for example, GigE Vision standard 3A using an Ethernet cable 31a and a USB 3.0 compatible cable 31b. There is a USB3Vision standard 3B. Therefore, the imaging unit 3 and the setting device 4 are connected via a network, but this network may be wired using a high-speed network cable or wireless. Further, the network may be a network using a cable other than the Ethernet cable 31a or the USB 3.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 to be used as a physical communication standard, and only defines an abstract specification in the form of GenTL41b. As a layer 42 below this GenTL 41b, communication standards are defined using specific communication networks, such as the GigE Vision standard 3A and the USB3Vision standard 3B. The specific communication standard is not limited to the GigE Vision standard 3A or the USB3Vision standard 3B, but may be compatible with the GenICam standard. In FIG. 7, in order to explain the concept of the GigE Vision standard 3A and the USB3Vision standard 3B, cameras 31, 31 compatible with each standard are shown connected to the setting device 4, 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 called DeviceXML (DeviceXML file) 31c. The DeviceXML file 31c is stored in a storage device (internal memory) built into the camera 31. The image inspection application 40 compliant with the GenICam standard reads the DeviceXML file 31c from the camera 31 when the image inspection application 40 is connected to the camera 31 to be set. 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 in the GenApi 41a. The DeviceXML file 31c can be downloaded in response to a request from the image inspection application 40 or automatically when connected to the camera 31. By downloading the DeviceXML file 31c, the setting device 4 downloads the DeviceXML file 31c. Can be obtained. Furthermore, without downloading the DeviceXML file 31c from the camera 31 to be connected, it is also possible to obtain the DeviceXML file 31c corresponding to the camera 31 by another means (for example, downloading from a website) and specify it to the GenApi 41a at the time of connection. be.

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

DeviceXMLファイル31cにおいて、たとえば、「ExposureTime」(露光時間設定)という名称のFeatureがあり、その属性が「ExposureTimeReg」というレジスタアドレスを参照するように指示されており、具体的なアドレスとして、ある値が記載されていたとする。カメラ31が異なれば、アドレスが異なる値になることがあるが、「ExposureTime」というFeatureの名称については共通である。このように、多くのカメラ31で共通した設定項目として存在するものを統一した名称で管理することで、画像検査アプリケーション40においてはカメラ31の機種の違いやメーカーの違いを意識することなく、カメラ31を設定、制御することが可能になる。 In the DeviceXML file 31c, for example, there is a Feature named "ExposureTime" (exposure time setting), and its attribute is instructed to refer to a register address "ExposureTimeReg", and a certain value is specified as a specific address. Suppose it was written. If the camera 31 is different, the address may have a different value, but the name of the Feature "ExposureTime" is common. In this way, by managing common setting items for many cameras 31 using unified names, the image inspection application 40 can easily control the camera 31 without being aware of differences in model or 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, the GenApi 41a layer converts the Feature string passed as an argument from the image inspection application 40, which is a higher layer, into a register address by analyzing the contents of the DeviceXML file 31c. For example, when writing a value (value: 100.5) to a register corresponding to a Feature called "ExposureTime", there are two values: the address value and the value to be written, such as WriteRegister (address value, 100.5). By executing a function with the argument , it is possible to set the value of the register of the camera 31 via a physical communication standard such as the GigE Vision standard 3A or the USB3Vision standard 3B.

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

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

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

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

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

(パラメータセット)
画像検査アプリケーション40を実際の検査環境において動作させる場合、ワークWが切り替わったり、明るさなど、周囲の環境の変化を検知した場合には、撮像部3の設定パラメータを動的に変更することがある。露光時間など、ごく限られたパラメータのみ変更する場合は、画像検査アプリケーション40から、それに対応したFeatureの値を直接書き込むことで対応することもできる。
(parameter set)
When operating the image inspection application 40 in an actual inspection environment, the setting parameters of the imaging unit 3 can be dynamically changed when the workpiece W is switched or changes in the surrounding environment such as brightness are detected. be. If only a very limited parameter, such as exposure time, is to be changed, this can be done 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 a highly functional imaging unit 3, the number of items that can be set increases, and the number of parameters that must be changed at once when switching the workpiece W also increases. In this case, the time required to change settings increases in correlation with the number of parameters. In an actual image inspection line, when the workpiece W is switched, the time from when the new workpiece W reaches the imaging field of view of the imaging unit 3 to when it leaves the field of view is often short, making it possible to perform a series of setting changes at high speed. There will be cases where you want to do it. In such cases, a function called parameter set may be used.

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

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

画像検査アプリケーション40側から設定する対象を切り替えるセレクタと、動作時に撮像部3が内部的に参照するパラメータを切り替えるレジスタは、独立させることも、同一にすることも可能である。設定できるパラメータセットの数の上限は、撮像部3の内部に設けられた内部メモリのパラメータ保持空間に限定される。 The selector for switching the target set from the image inspection application 40 side and the register for switching the parameter internally referenced by the imaging unit 3 during operation can be independent or can be 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 imaging section 3.

パラメータセットの概念は、フィルター処理機能を保有した撮像部3に展開することも可能である。たとえば、パラメータセットIndexが1の時は2値化フィルターを実行し、パラメータセットIndexが2の時は膨張フィルターを実行し、パラメータセットIndexが3の時はフィルターを非実行とするように、パラメータセットIndexに対応したパラメータを設定していたとする。このようにすることで、撮像と、フィルター処理として実行する内容を、パラメータセットIndexにより動的に切り替えることができる。 The concept of a parameter set can also be applied to the imaging unit 3 having a filter processing 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. Assume that parameters corresponding to the set index have been set. By doing so, the content to be executed as imaging and filter processing can be dynamically switched using the parameter set Index.

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

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

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

GenICam規格の撮像パラメータを動的に切り替える機能を利用し、図8に示すように複数のパラメータセットを1つのフローチャートにまとめることができる。撮像部3の内部処理フローチャート上で、分岐ステップSB1から合流ステップSB2までの間のフローチャートを形成するユニット群をまとめてパラメータセットと呼ぶ。図8に示す例では、4つのパラメータセット、即ち、第1~第4パラメータセットを有している。つまり、ユーザにより設定された処理を実現するための複数のセレクタの値の組み合わせが複数パターン存在している。第1~第4パラメータセットのいずれを選択するかは、ユーザが設定することができ、たとえば、パラメータセット番号1を選択すると第1パラメータセットが自動的に選択される。 Using the GenICam standard's function of dynamically switching imaging parameters, multiple parameter sets can be combined into one flowchart as shown in FIG. On the internal processing flowchart of the imaging unit 3, a group of units forming the flowchart from branching step SB1 to merging step SB2 is collectively referred to as a parameter set. The example shown in FIG. 8 has four parameter sets, ie, first to fourth parameter sets. In other words, there are multiple patterns of combinations of multiple selector values to implement the processing set by the user. The user can set which of the first to fourth parameter sets to select. For example, when 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 flowchart shown in FIG. 8 starts, each unit constituting any one of the first to fourth parameter sets is passed through in a branching step SB1, and then merged in a merging step SB2 to proceed to the end. If parameter set number 1 is selected, the branch number becomes 1 in branch step SB1, and each process of the first parameter set is executed. If parameter set number 2 is selected, the branch number becomes 2 in branch step SB1, and each process of the second parameter set is executed. If parameter set number 3 is selected, the branch number becomes 3 in branch step SB1, and each process of the third parameter set is executed. If parameter set number 4 is selected, the branch number becomes 4 in 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 parameter sets are shown in FIGS. 9 and 10. FIG. 9 shows a parameter set for generating an inspection image using the principle of deflectometry. The unit UA1 executes multiple imaging processes with a single trigger signal in order to generate an inspection image using the principle of deflectometry, the unit UA2 executes an expansion filter process, and the unit UA3 executes an averaging filter. The process is executed, and the unit UA4 executes a grayscale inversion process. That is, multi-step processing defined by a parameter set including filter processing is sequentially performed on the captured image captured by unit UA1. Thereafter, in the unit UA5, the image data on which the multi-step processing has been sequentially executed is transferred to the PC, that is, outputted to the setting device 4 or the like which is an external device. Note that the image data may be held internally without being transferred. Depending on the parameter set, settings may be made so that multi-step processing is not performed. When transferred to the setting device 4, defect inspection and pass/fail determination can be performed in the inspection section 4A of the image inspection application 40 shown in FIG. Conventionally known algorithms can be used for defect inspection and pass/fail determination.

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

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

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

(ユニットの種類)
ユニットには複数の種類があり、たとえば、検査領域を決定するパターンサーチ処理を行うパターンサーチユニット、位置補正ユニット、内部で画像の位置補正や色抽出、フィルター処理などを行う画像演算ユニット、あるいは、これらの比較的単純な処理を行うユニットを複合させて高機能化させたものなどがある。各ユニットは、撮像部3が撮像した撮像画像を外部に出力する前に、当該撮像画像に対して適用される処理を実行するためのユニットである。
(Type of unit)
There are multiple types of units, such as 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, filter processing, etc. There are devices that are highly functional by combining units that perform these relatively simple processes. Each unit is a unit for executing processing applied to the captured image captured by the imaging section 3 before outputting the captured image to the outside.

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

画像検査システム1の設定後、画像検査システム1の運用時には、順次搬送されてくるワークWを撮像して検査用画像を得て、パターンサーチユニットが、得られた検査用画像上でワークWまたはワークWの検査対象部分の有無を、上記記憶されているモデルに基づいてサーチ処理を行うとともに、サーチ処理によってワークWの位置と角度を計測する。ワークWの位置はX座標及びY座標で特定することができる。また、ワークWの角度は、撮像部3の撮像軸回りの角度とすることや、図1に示すZ軸周りの角度とすることができる。 After the image inspection system 1 is set, when the image inspection system 1 is operated, images of the workpieces W that are sequentially conveyed are obtained to obtain inspection images, and the pattern search unit searches the workpieces W or the like on the obtained inspection images. A search process is performed to determine the presence or absence of the inspection target portion of the workpiece W based on the stored model, and the position and angle of the workpiece W are measured by the search process. The position of the workpiece W can be specified using the X and Y coordinates. Further, the angle of the workpiece W can be an angle around the imaging axis of the imaging unit 3 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 uses a pattern search unit to search for the work W or the inspection target part of the work W from among the images including the work W captured by the imaging unit 3, and after measuring the position and angle of the work W, This is a unit for correcting the position of the workpiece W in the image. During operation of the image inspection system 1, a plurality of workpieces W are not always transported in the same position and orientation, and workpieces W in various positions or in various postures may be transported. . Since the pattern search unit searches for the reference part of the workpiece W and the position correction unit can correct the position, the reference part of the workpiece W is always at a constant position and the workpiece W is kept at a predetermined position. Position correction is performed by rotating the image or moving the image vertically or horizontally so that the image has the correct orientation. A plurality of types of position correction tools, such as a pattern search tool, can be prepared for position correction.

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

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

図7に示すように、設定装置4は、UI生成部4aを備えている。UI生成部4aは、各種ユーザーインターフェース画像を生成する部分である。UI生成部4aで生成された各種ユーザーインターフェース画像は表示部5に表示される。 As shown in FIG. 7, the setting device 4 includes a UI generation section 4a. The UI generation section 4a is a section that generates various user interface images. Various user interface images generated by the UI generation section 4a are displayed on the display section 5.

ユーザーインターフェース画像上で、編集対象の画像を切り替えることや、設定項目の表示及び変更を行うこと、編集対象である画像を表示することができる。設定項目としては、例えば、位置補正設定やフィルター処理設定等があり、位置補正設定に対応するFeatureとして、位置補正を有効にするか否かの選択を行う部分と、位置補正ツールの種別選択を行う部分とが割り当てられる。また、フィルター処理設定に対応するFeatureとして、選択されたフィルターの種類と、抽出サイズや抽出色といったフィルターの設定に関するパラメータを選択、調整する部分とが割り当てられる。 On the user interface image, it is possible to switch images to be edited, display and change setting items, and display images to be edited. Setting items include, for example, position correction settings and filter processing settings, and the Feature corresponding to the position correction settings includes a part for selecting whether to enable position correction and a part for selecting the type of position correction tool. The parts to be performed are assigned. Further, as a Feature corresponding to the filter processing settings, the type of the selected filter and a part for selecting and adjusting parameters related to filter settings such as extraction size and extraction color are assigned.

例えば、ユーザが任意の画像を選択すると、内部的には、その画像を生成するために使用する前処理モジュールに対応したインデックスの値に、設定対象を指定するセレクタの値が切り替わり、これにより、設定可能な内容が画像に応じて切り替わる。設定対象を指定するセレクタの値が指定されると、その値に対応したセレクタが指し示す前処理モジュールの一つ又は複数のFeatureを読み取り、設定項目を反映した画像を生成して表示させるとともに、位置補正やフィルター設定としてそれぞれのパラメータ値を表示する。位置補正やフィルター設定のパラメータ値をユーザが操作すると、その操作が受け付けられて、設定対象を指定するセレクタの値に対応した前処理モジュールに該当するユニットの設定項目が変更される。 For example, when a user selects an arbitrary image, the selector value that specifies the setting target is internally switched to the index value corresponding to the preprocessing module used to generate that image. The configurable contents change depending on 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 reflecting the setting items is generated and displayed, and the position Display each parameter value as a correction or filter setting. When the user operates parameter values for position correction or filter settings, the operation is accepted and the setting items of the unit corresponding to the preprocessing module corresponding to the value of the selector specifying the setting target are changed.

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

したがって、ユーザが撮像部3の設定項目に対して設定値の変更を行うと、ユーザにより設定された各設定項目の設定値と、DeviceXMLファイルに含まれる各設定項目に対応するレジスタ情報を示すデータが撮像部3に送信されて、撮像部3の設定を行うことができるので、標準化規格に適合した撮像部3であれば設定装置4側から設定値を変更することができ、撮像部3の機種選定の自由度が向上する。 Therefore, when the user changes the setting values for the setting items of the imaging unit 3, the setting values of each setting item set by the user and data indicating register information corresponding to each setting item included in the DeviceXML file are is sent to the imaging unit 3 and the settings of the imaging unit 3 can be performed. Therefore, if the imaging unit 3 complies with the standardization specifications, the setting value can be changed from the setting device 4 side, and the setting value of the imaging unit 3 can be changed. Increased freedom in model selection.

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

(画像検査システム1の設定時に実行される処理)
図11のブロック図に示すように、撮像制御部33は、高さ抽出処理をはじめ、各種処理を実行する部分として、設定部33a、度数分布算出部33b、高さ範囲設定部33c、補正部33d、算出部33e、変換部33f及び出力部33gを備えている。以下、画像検査システム1の運用前に行う設定時について、図12に示すフローチャートに基づいて高さ抽出の設定手順を参照しながら説明する。
(Processing executed when setting up image inspection system 1)
As shown in the block diagram of FIG. 11, the imaging control section 33 includes a setting section 33a, a frequency distribution calculation section 33b, a height range setting section 33c, and a correction section as sections that execute various processes including height extraction processing. 33d, a calculation section 33e, a conversion section 33f, and an output section 33g. Hereinafter, the setting performed before operation of the image inspection system 1 will be described with reference to the setting procedure for height extraction based on the flowchart shown in FIG. 12.

図12に示すフローチャートは、画像検査システム1の設定時に行う高さ抽出の設定手順を示しており、「内部処理」と記載してあるステップは、画像検査システム1内で実行されるステップである。 The flowchart shown in FIG. 12 shows the setting procedure for height extraction performed when setting up the image inspection system 1, and the steps described as "internal processing" are steps executed within the image inspection system 1. .

スタート後のステップSC1では、取得部Aで取得された画像に対してフィルター処理が実行されたフィルター画像を追加する。このステップSC1はユーザが実行する。所望のフィルター画像を追加した後、ステップSC2に進み、対象画像として三次元画像(3D画像)を設定し、出力画像種別に二次元画像(2D画像)を設定する。 In step SC1 after the start, a filtered image that has been subjected to filter processing is added to the image acquired by the acquisition unit A. This step SC1 is executed by the user. After adding the desired filter image, the process proceeds to step SC2, where a three-dimensional image (3D image) is set as the target image, and a two-dimensional image (2D image) is set as the output image type.

ステップSC3では、図13に示す2D画像変換設定ダイアログ50を開く。ユーザが所定の操作を行うと、UI生成部4aは2D画像変換設定ダイアログ50を生成し、例えば表示部5に表示させる。2D画像変換設定ダイアログ50には、三次元画像を二次元画像に変換した画像を表示する変換後画像表示領域50aと、二次元画像に変換する前の三次元画像を表示するスルー表示領域50bとが設けられている。さらに、2D画像変換設定ダイアログ50には、詳細設定領域51が設けられている。図13では、スルー表示領域50bに、ワークWを上から見た三次元画像を表示した例を示している。一方、図14では、スルー表示領域50bに、ワークWを側方(水平方向)から見た三次元画像を表示した例を示している。 In step SC3, a 2D image conversion setting dialog 50 shown in FIG. 13 is opened. When the user performs a predetermined operation, the UI generation unit 4a generates a 2D image conversion setting dialog 50 and displays it on the display unit 5, for example. The 2D image conversion setting dialog 50 includes a converted image display area 50a that displays an image obtained by converting a 3D image into a 2D image, and a through display area 50b that displays a 3D image before being converted to a 2D image. is provided. Further, the 2D image conversion setting dialog 50 includes a detailed setting area 51. FIG. 13 shows an example in which a three-dimensional image of the workpiece W viewed from above is displayed in the through display area 50b. On the other hand, FIG. 14 shows an example in which a three-dimensional image of the workpiece W viewed from the side (horizontal direction) is displayed in the through display area 50b.

ステップSC3で2D画像変換設定ダイアログ50を表示させた後、ステップSC4に進む。ステップSC4では、2D画像変換設定ダイアログ50の詳細設定領域51を操作して、変換モードを「高さ濃淡」とし、基準面を特定するための基準位置を指定する指定方法として「平面基準」を設定する。指定方法の選択枝としては、例えば「点基準」もある。その後、ステップSC5に進んで、変換後画像表示領域50aに表示されている画像上で、基準面を特定するための平面の箇所に矩形の枠線52によって領域を設定する。 After displaying the 2D image conversion setting dialog 50 in step SC3, the process advances to step SC4. In step SC4, operate the detailed setting area 51 of the 2D image conversion setting dialog 50 to set the conversion mode to "height shading" and select "plane reference" as the specification method for specifying the reference position for specifying the reference plane. Set. As an option for the specification method, for example, there is a "point-based" method. Thereafter, the process proceeds to step SC5, and on the image displayed in the post-conversion image display area 50a, an area is set by a rectangular frame line 52 at a plane location for specifying the reference plane.

すなわち、図11に示す変換部33fは、後述するように基準面を基準とし、ある高さ範囲の高さデータを低階調の高さ画像に変換する部分であるが、高さデータを階調変換する際の基準となる基準面を特定する必要がある。ステップSC4、SC5の処理では、基準面を特定するための基準位置を、取得部Aにより取得された高さデータに対して設定することができる。ステップSC4、SC5の処理は、設定部33aで実行される。 That is, the conversion unit 33f shown in FIG. 11 is a part that converts height data in a certain height range into a low gradation height image using a reference plane as a reference as described later. It is necessary to specify a reference plane that will be used as a reference when converting the key. In the processes of steps SC4 and SC5, a reference position for specifying the reference plane can be set with respect to the height data acquired by the acquisition unit A. The processing in steps SC4 and SC5 is executed by the setting unit 33a.

設定部33aでは、ステップSC4で「平面基準」が設定されると、枠線52を変換後画像表示領域50aに表示されている画像に重ねて表示する。枠線52の位置、大きさ及び形状は、ユーザがマウス7等を操作することで自在に変更できる。ユーザは、ワークWの大まかな形状を予め把握しているので、ワークWの平らな部分を囲むように枠線52を配置することができる。所望の箇所に枠線52を配置して決定した後、ステップSC6に進んで、枠線52によって囲まれた領域内の高さ情報から基準面を特定する。この処理は、設定部33aによって実行することができ、設定部33aは、例えば枠線52で囲まれた領域内の複数の点の平均高さにより特定される面を基準面として特定する。 In the setting unit 33a, when the "plane reference" is set in step SC4, the frame line 52 is displayed superimposed on the image displayed in the converted image display area 50a. The position, size, and shape of the frame line 52 can be freely changed by the user operating the mouse 7 or the like. Since the user knows the rough shape of the workpiece W in advance, the user can arrange the frame line 52 so as to surround the flat part of the workpiece W. After arranging and determining the frame line 52 at a desired location, the process proceeds to step SC6, where a reference plane is specified from the height information within the area surrounded by the frame line 52. This process can be executed by the setting unit 33a, and the setting unit 33a specifies, for example, a plane specified by the average height of a plurality of points within the area surrounded by the frame line 52 as the reference plane.

設定部33aによる基準位置の設定は、領域の設定によるものに限られない。例えば、ステップSC4で指定方法として「点基準」を選択すると、ステップSC5ではユーザがマウス7等を操作し、基準位置を点として設定することができる。ステップSC5で1点のみ設定されている場合には、ステップSC6においてその1点を含む面を基準面とする。また、ステップSC5で3点設定されている場合には、ステップSC6においてそれら3点の高さにより特定される面を基準面とすることができる。基準面の設定手法は特に限定されるものではなく、上記以外の設定手法を用いてもよい。 The setting of the reference position by the setting unit 33a is not limited to setting a region. For example, if "point reference" is selected as the specification method in step SC4, the user can operate the mouse 7 or the like to set the reference position as a point in step SC5. If only one point is set in step SC5, the plane containing that one point is set as the reference plane in step SC6. Furthermore, if three points are set in step SC5, the plane specified by the heights of those three points can be used as the reference plane in step SC6. The reference plane setting method is not particularly limited, and setting methods other than those described above may be used.

ステップSC7では、ステップSC6で特定された基準面の傾きを0とする変換を高さデータに対して行う。これにより、図13に示すスルー表示領域50bに表示されている三次元画像の傾きが補正される。 In step SC7, the height data is converted so that the inclination of the reference plane specified in step SC6 is set to 0. As a result, the tilt of the three-dimensional image displayed in the through display area 50b shown in FIG. 13 is corrected.

その後、ステップSC8に進み、高さヒストグラムで抽出範囲を指定する。抽出範囲は、後述するが階調変換を実行する所定の高さ範囲のことである。このステップSC8では、まず、図11に示す度数分布算出部33bが、高さデータの高さ情報に含まれる画素ごとの高さについて度数分布を算出する。度数分布算出部33bが度数分布を算出すると、算出した度数分布を表すヒストグラムを生成し、図13に示す2D画像変換設定ダイアログ50のヒストグラム表示領域53に表示する。ヒストグラム表示領域53に表示されているヒストグラムの縦軸が高さであり、横軸が度数である。したがって、ユーザがヒストグラムを見ることで、度数の多い高さ範囲、度数の少ない高さ範囲、度数がない高さ範囲等を容易に把握することができる。 Thereafter, the process proceeds to step SC8, where the extraction range is specified using the height histogram. The extraction range, which will be described later, is a predetermined height range in which gradation conversion is performed. In step SC8, first, the frequency distribution calculation unit 33b shown in FIG. 11 calculates a frequency distribution for the height of each pixel included in the height information of the height data. When the frequency distribution calculation unit 33b calculates the frequency distribution, it generates a histogram representing the calculated frequency distribution and displays it in the histogram display area 53 of the 2D image conversion setting dialog 50 shown in FIG. The vertical axis of the histogram displayed in the histogram display area 53 is the height, and the horizontal axis is the frequency. Therefore, by viewing the histogram, the user can easily grasp the height range with a high frequency, the height range with a low frequency, the height range with no frequency, etc.

ヒストグラム表示領域53には、高さ範囲を表示する手段と一例として、中央表示線53aと、上側表示線53bと、下側表示線53cとが上記ヒストグラムに重なった状態で表示される。中央表示線53aは、抽出範囲の中央を示す線であり、後述するオフセット量が反映された基準面の位置を示している。図14に示すように、スルー表示領域50bに側方から見たワークWの画像が表示されている場合には、中央表示面54aがワークWの画像に重なった状態で表示される。 In the histogram display area 53, as an example of means for displaying the height range, a center display line 53a, an upper display line 53b, and a lower display line 53c are displayed in a state overlapping with the above-mentioned histogram. The center display line 53a is a line indicating the center of the extraction range, and indicates the position of the reference plane on which an offset amount, which will be described later, is reflected. As shown in FIG. 14, when the image of the work W seen from the side is displayed in the through display area 50b, the center display surface 54a is displayed in a state overlapping with the image of the work W.

上側表示線53b及び下側表示線53cは、それぞれ抽出範囲の上限及び下限を示す線である。上側表示線53bよりも低く、かつ、下側表示線53cよりも高い範囲が抽出範囲となる。上側表示線53b及び下側表示線53cを用いることにより、高さ範囲設定部で設定された高さ範囲をヒストグラム上に表示することができる。上側表示線53bと下側表示線53cとは同じ色や線種とすることができ、中央表示線53aのみ色や線種を変えてもよい。上側表示線53bと下側表示線53cとの間が高さ範囲になるので、他の領域との区別を明確にするために、上側表示線53bと下側表示線53cとの間を着色する等、表示形態を変えてもよい。 The upper display line 53b and the lower display line 53c are lines indicating the upper and lower limits of the extraction range, respectively. The extraction range is lower than the upper display line 53b and higher than the lower display line 53c. By using the upper display line 53b and the lower display line 53c, the height range set by the height range setting section can be displayed on the histogram. The upper display line 53b and the lower display line 53c may have the same color or line type, and only the center display line 53a may have a different color or line type. Since the height range is between the upper display line 53b and the lower display line 53c, the area between the upper display line 53b and the lower display line 53c is colored in order to clearly distinguish it from other areas. etc., the display form may be changed.

図14に示すように、スルー表示領域50bに側方から見たワークWの画像が表示されている場合には、上側表示線53bに対応する上側表示面54bと、下側表示線53cに対応する下側表示面54cとがワークWの画像に重なった状態で表示される。したがって、上側表示面54bと下側表示面54cを用いることにより、高さ範囲設定部33cで設定された高さ範囲を三次元画像上に表示することができる。上側表示面54bと下側表示面54cとは同じ色や線種とすることができ、中央表示面54aのみ色や線種を変えてもよい。 As shown in FIG. 14, when the image of the workpiece W seen from the side is displayed in the through display area 50b, the upper display surface 54b corresponds to the upper display line 53b, and the lower display line 53c corresponds to the upper display surface 54b. The lower display surface 54c is displayed superimposed on the image of the workpiece W. Therefore, by using the upper display surface 54b and the lower display surface 54c, the height range set by the height range setting section 33c can be displayed on the three-dimensional image. The upper display surface 54b and the lower display surface 54c may have the same color or line type, and only the center display surface 54a may have a different color or line type.

2D画像変換設定ダイアログ50には、抽出範囲設定領域55が設けられている。抽出範囲設定領域55は、Zオフセット調整部55aと、ゲイン調整部55bとを有している。高さ範囲設定部33cが抽出範囲設定領域55を生成し、各調整部55a、55bで行われたユーザによる操作を受け付ける。Zオフセット調整部55a及びゲイン調整部55bには、マウス等の操作によって値を上下させる入力部や、数値を直接入力可能な入力部を設けることができるとともに、入力した値を確認できる表示領域も設けることができる。 The 2D image conversion setting dialog 50 is provided with an extraction range setting area 55. The extraction range setting area 55 includes a Z offset adjustment section 55a and a gain adjustment section 55b. The height range setting unit 33c generates an extraction range setting area 55, and receives user operations performed in each adjustment unit 55a, 55b. The Z offset adjustment section 55a and the gain adjustment section 55b can be provided with an input section for increasing or decreasing the value by operating a mouse or the like, an input section for directly inputting numerical values, and a display area where the input values can be confirmed. can be provided.

Zオフセット調整部55aは、基準面の高さ方向(Z方向)のオフセット量をユーザの操作によって指定するための部分である。Zオフセット調整部55aで指定された値は、高さ範囲設定部33cで受け付けられた後、ステップSC9に進んで基準面のオフセット量が設定される。設定されたオフセット量に対応するように、中央表示線53aと中央表示面54a(図14に示す)の表示位置が更新される。プラス方向にオフセット量が調整されると、中央表示線53a及び中央表示面54aは上方向に移動し、マイナス方向にオフセット量が調整されると、中央表示線53a及び中央表示面54aは下方向に移動する。中央表示線53aの表示位置の更新に伴って上側表示線53b及び下側表示線53cの表示位置も更新され、また、中央表示面54aの表示位置の更新に伴って上側表示面54bと下側表示面54cの表示位置も更新される。 The Z offset adjustment section 55a is a section for specifying the amount of offset in the height direction (Z direction) of the reference plane by a user's operation. After the value specified by the Z offset adjustment section 55a is received by the height range setting section 33c, the process proceeds to step SC9, where the offset amount of the reference plane is set. The display positions of the center display line 53a and the center display surface 54a (shown in FIG. 14) are updated to correspond to the set offset amount. When the offset amount is adjusted in the positive direction, the center display line 53a and the center display surface 54a move upward, and when the offset amount is adjusted in the negative direction, the center display line 53a and the center display surface 54a move downward. Move to. As the display position of the center display line 53a is updated, the display positions of the upper display line 53b and the lower display line 53c are also updated, and as the display position of the center display surface 54a is updated, the display positions of the upper display surface 54b and the lower display line 53a are updated. The display position of the display surface 54c is also updated.

ゲイン調整部55bは、ユーザの操作によって抽出範囲を指定するための部分である(ステップSC8)。ゲイン値は、1階調が何mmに相当するかを示す値であり、階調/mmを単位とすることができる。ゲイン値を大きくすれば、コントラストがはっきりした階調変換になる。例えば、ゲイン値を100階調/mmに設定すると、1階調あたり0.010mmとなるような階調変換が行われる。 The gain adjustment section 55b is a section for specifying the extraction range by user operation (step SC8). The gain value is a value indicating how many mm corresponds to one gradation, and can be expressed in gradation/mm. Increasing the gain value results in gradation conversion with clear contrast. For example, when the gain value is set to 100 gradations/mm, gradation conversion is performed such that each gradation is 0.010 mm.

ゲイン調整部55bで指定されたゲイン値は、高さ範囲設定部33cで受け付けられた後、抽出範囲に基づいたゲイン値に設定される(ステップSC9)。指定された抽出範囲に対応するように、上側表示線53b及び下側表示線53cと、上側表示面54b及び下側表示面54c(図14に示す)の表示位置が更新される。抽出範囲を狭くすると、図15に示すようにヒストグラム上の上側表示線53bと下側表示線53cの間隔が狭くなるとともに、スルー表示領域50bの上側表示面54bと下側表示面54cの間隔が狭くなる。以上のようにして、図12に示すフローチャートのステップSC9が完了する。 The gain value specified by the gain adjustment section 55b is received by the height range setting section 33c, and then set to a gain value based on the extraction range (step SC9). The display positions of the upper display line 53b, the lower display line 53c, and the upper display surface 54b and lower display surface 54c (shown in FIG. 14) are updated to correspond to the specified extraction range. When the extraction range is narrowed, as shown in FIG. 15, the interval between the upper display line 53b and the lower display line 53c on the histogram becomes narrower, and the interval between the upper display surface 54b and the lower display surface 54c of the through display area 50b decreases. It gets narrower. As described above, step SC9 of the flowchart shown in FIG. 12 is completed.

ステップSC10では、ステップSC9で設定された基準面のオフセット量とゲイン値に従って三次元画像を二次元画像に変換する。具体的には、図11に示す変換部33fが、基準面のオフセット量とゲイン値とに基づいて、高さデータを該高さデータの階調数よりも低い階調数を有する高さ画像に変換する。高さデータが16bitであったとすると、高さ画像は8bitの階調数に変換することができる。以上が高さ抽出の設定手順である。 In step SC10, the three-dimensional image is converted into a two-dimensional image according to the offset amount and gain value of the reference plane set in step SC9. Specifically, the conversion unit 33f shown in FIG. 11 converts the height data into a height image having a lower number of gradations than the number of gradations of the height data based on the offset amount and gain value of the reference plane. Convert to If the height data is 16 bits, the height image can be converted to an 8-bit gradation number. The above is the setting procedure for height extraction.

上述したように、高さ抽出の設定では、基準面を算出するための領域の設定パラメータや、高さ抽出の設定パラメータ等がある。これら設定パラメータは、すべてFeatureとして用意されており、設定装置4から撮像部3に送出される。 As described above, height extraction settings include area setting parameters for calculating a reference plane, height extraction setting parameters, and the like. All of these setting parameters are prepared as features, and are sent from the setting device 4 to the imaging unit 3.

次に、画像検査システム1の設定時に行う位置補正の設定手順について図16に示すフローチャートに基づいて説明する。スタート後のステップSD1では、位置補正を有効にする。以後のステップは、例えば図11に示す補正部33dで行うことができる。ステップSD2では、ユーザがパターンサーチの設定ボタン(図示せず)を操作すると、UI生成部4aは図17に示すパターンサーチ設定ダイアログ56を生成し、例えば表示部5に表示させる。パターンサーチ設定ダイアログ56には、画像表示領域56aと、画像登録ボタン56bとが設けられている。画像表示領域56aには、撮像部3で撮像された画像が表示される。ユーザは画像表示領域56aに表示されている画像を確認し、所望の画像である場合には、画像登録ボタン56bを操作する(ステップSD3)。画像登録ボタン56bが操作されると、ステップSD4に進み、画像表示領域56aに現在表示されている画像をサーチ用モデル画像として撮像制御部33内に記憶しておく。 Next, the procedure for setting position correction performed when setting up the image inspection system 1 will be described based on the flowchart shown in FIG. 16. In step SD1 after the start, position correction is enabled. The subsequent steps can be performed by the correction section 33d shown in FIG. 11, for example. In step SD2, when the user operates a pattern search setting button (not shown), the UI generation unit 4a generates a pattern search setting dialog 56 shown in FIG. 17, and displays it on the display unit 5, for example. The pattern search setting dialog 56 is provided with an image display area 56a and an image registration button 56b. An image captured by the imaging section 3 is displayed in the image display area 56a. The user checks the image displayed in the image display area 56a, and if it is the desired image, operates the image registration button 56b (step SD3). When the image registration button 56b is operated, the process proceeds to step SD4, and the image currently displayed in the image display area 56a is stored in the imaging control unit 33 as a search model image.

ステップSD5ではサーチ領域を設定する。サーチ領域は、サーチする対象であるパターンの探索を実行する領域である。サーチ領域を設定する際には、図17に示すようにサーチ領域設定用の枠線57を画像表示領域56aに表示させ、ユーザがこの枠線57の位置、大きさ、形状を変更する。変更後の枠線57によって囲まれた領域がサーチ領域として設定される。 In step SD5, a search area is set. The search area is an area in which a search for a pattern to be searched is performed. When setting a search area, a frame line 57 for setting the search area is displayed in the image display area 56a as shown in FIG. 17, and the user changes the position, size, and shape of this frame line 57. The area surrounded by the changed frame line 57 is set as the search area.

また、ステップSD6ではパターン領域を設定する。パターン領域は、パターンサーチによって探索を行う領域であり、モデル画像の特徴部分とすることができる。パターン領域を設定する際には、図17に示すようにパターン領域設定用の枠線58を画像表示領域56aに表示させ、ユーザがこの枠線58の位置、大きさ、形状を変更する。変更後の枠線58によって囲まれた領域がパターン領域として設定される。ステップSD5とステップSD6はどちらが先でもよい。 Further, in step SD6, a pattern area is set. The pattern area is an area to be searched by pattern search, and can be a characteristic part of the model image. When setting a pattern area, a frame line 58 for pattern area setting is displayed in the image display area 56a as shown in FIG. 17, and the user changes the position, size, and shape of this frame line 58. The area surrounded by the changed frame line 58 is set as a pattern area. Either step SD5 or step SD6 may be performed first.

ステップSD7ではパターンサーチのパラメータを設定する。図17に示すパターンサーチ設定ダイアログ56には、パターンサーチのパラメータ設定領域56cが設けられている。パターンサーチのパラメータとしては、例えば、色抽出設定、サーチの角度範囲、サーチ感度、サーチ精度等が含まれている。ユーザは、パターンサーチのパラメータを任意に設定することができ、設定されたパラメータは記憶される。 In step SD7, pattern search parameters are set. The pattern search setting dialog 56 shown in FIG. 17 is provided with a pattern search parameter setting area 56c. Pattern search parameters include, for example, color extraction settings, search angle range, search sensitivity, search accuracy, and the like. The user can arbitrarily set pattern search parameters, and the set parameters are stored.

上述したように、位置補正の設定では、サーチ領域及びパターン領域の位置や大きさを表す設定パラメータや、パターンサーチの設定パラメータ等があり、これら設定パラメータがユーザの設定操作に応じて内部的に変更される。これら設定パラメータは、すべてFeatureとして用意されており、設定装置4から撮像部3に送出される。また、ステップSD4でパターンサーチの基準となる画像をモデル画像として登録するのであるが、この登録のための「モデル画像登録コマンド」もFeatureとして用意されている。設定装置4から撮像部3に対してモデル画像登録コマンドを発行することで、モデル画像の登録を実行できる。 As mentioned above, in the position correction settings, there are setting parameters that represent the position and size of the search area and pattern area, pattern search setting parameters, etc., and these setting parameters are internally changed according to the user's setting operations. Be changed. All of these setting parameters are prepared as features, and are sent from the setting device 4 to the imaging unit 3. Furthermore, in step SD4, the image that serves as the reference for the pattern search is registered as a model image, and a "model image registration command" for this registration is also prepared as a Feature. By issuing a model image registration command from the setting device 4 to the imaging unit 3, registration of the model image can be executed.

(画像検査システム1の運用時に実行される処理)
次に、画像検査システム1の運用時に実行される処理について、図18に示すフローチャートに基づいて高さ抽出の設定手順を参照しながら説明する。設定装置4から撮像部3にAcquisitionコマンドを発行すると、撮像部3の内部で以下の処理が順次実行される。
(Processing executed during operation of image inspection system 1)
Next, the processing executed during operation of the image inspection system 1 will be described with reference to the height extraction setting procedure based on the flowchart shown in FIG. 18. When the setting device 4 issues an Acquisition command to the imaging unit 3, the following processes are sequentially executed inside the imaging unit 3.

スタート後のステップSE1では、撮像部3がワークWの三次元画像と二次元画像を生成する。これにより、取得部Aは、ワークWからの反射光の受光量に応じた輝度画像を取得するとともに、高さ情報が二次元座標上に配置された高さデータを取得することができる。運用時に取得された高さデータは、設定時、即ち基準位置の設定に用いた高さデータを取得したワークWとは異なる新たなワークWについての高さデータである。輝度画像も設定時のワークWとは異なる新たなワークWについての輝度画像である。ステップSE1で取得された三次元画像と二次元画像は、表示部5に表示させることができる。 In step SE1 after the start, the imaging unit 3 generates a three-dimensional image and a two-dimensional image of the workpiece W. Thereby, the acquisition unit A can acquire a brightness image according to the amount of reflected light received from the workpiece W, and can also acquire height data in which height information is arranged on two-dimensional coordinates. The height data acquired during operation is height data for a new workpiece W that is different from the workpiece W from which height data was acquired at the time of setting, that is, for setting the reference position. The brightness image is also a brightness image of a new workpiece W different from the workpiece W at the time of setting. The three-dimensional image and two-dimensional image acquired in step SE1 can be displayed on the display unit 5.

ステップSE2では、ステップSE1で新たに取得された二次元画像を使って図11に示す補正部33dがパターンサーチを実行する。パターンサーチでは、位置補正設定で設定されたパターン領域、サーチ領域、サーチパラメータに従い、新たな二次元画像の特徴部分をサーチして新たなワークWの位置又は姿勢のずれを検出する。これにより、サーチ結果として、新たなワークWのモデル画像に対するX方向のずれ量、Y方向のずれ量及び回転角度を取得できる。その後、ステップSE3に進み、図11に示す補正部33dが、ステップSE2で取得されたサーチ結果を使い、ステップSE1で取得された新たな三次元画像を回転させて位置補正する。これにより、新たな高さデータに対する基準位置のずれを補正することができる。 In step SE2, the correction unit 33d shown in FIG. 11 executes a pattern search using the two-dimensional image newly acquired in step SE1. In the pattern search, a new shift in the position or posture of the workpiece W is detected by searching for a characteristic part of a new two-dimensional image according to the pattern area, search area, and search parameters set in the position correction settings. Thereby, the amount of deviation in the X direction, the amount of deviation in the Y direction, and the rotation angle of the new workpiece W with respect to the model image can be obtained as the search results. Thereafter, the process proceeds to step SE3, and the correction unit 33d shown in FIG. 11 uses the search result obtained in step SE2 to rotate and correct the position of the new three-dimensional image obtained in step SE1. Thereby, it is possible to correct the deviation of the reference position with respect to the new height data.

なお、基準位置のずれを補正する手法としては、パターンサーチの他に、例えば、モデル画像を使用しないエッジ抽出法であってもよい。 Note that as a method for correcting the deviation of the reference position, in addition to pattern search, for example, an edge extraction method that does not use a model image may be used.

基準位置のずれを補正した後、ステップSE4に進む。ステップSE4では、図11に示す算出部33eが、補正後の基準位置に対応する高さ情報を用いて新たな高さデータの基準面を算出する。「平面基準」が設定されていると、複数の点の平均高さにより特定される面を基準面として特定し、「点基準」が設定されていると、設定されている1点を含む面や、3点の高さにより特定される面を基準面とする。 After correcting the deviation of the reference position, the process proceeds to step SE4. In step SE4, the calculation unit 33e shown in FIG. 11 calculates a reference plane for new height data using the height information corresponding to the corrected reference position. If "Plane reference" is set, the plane specified by the average height of multiple points will be specified as the reference plane, and if "Point reference" is set, the plane containing the set one point will be specified. The plane specified by the heights of the three points is the reference plane.

基準面を算出した後、ステップSE5に進む。ステップSE5では、変換部33fが、基準面の傾きを0にする変換を行うことで三次元画像の傾きを補正する。ここで、上記ステップSE3を経ていない場合を想定する。ステップSE3では三次元画像の位置補正を行っているが、仮に、位置補正を行っていないと、ワークWがモデル画像に対して回転した状態で撮像されていた場合、その回転したままの画像上で基準面を算出することになる。基準面を算出する際には、上述したように、図14に示す枠線52によって設定された所定の領域内の情報を利用することになるが、この枠線52内の領域が、モデル画像と、ワークWが回転した状態の画像とでは異なっており、その結果、ワークWが回転した状態の画像で基準面を算出してしまうと、傾き補正が想定した通りに行われなくなり、正しい結果が得られなくなるおそれがある。 After calculating the reference plane, the process proceeds to step SE5. In step SE5, the converter 33f corrects the inclination of the three-dimensional image by converting the inclination of the reference plane to zero. Here, it is assumed that the above step SE3 has not been performed. In step SE3, the position of the three-dimensional image is corrected, but if the position is not corrected and the workpiece W is imaged in a rotated state with respect to the model image, the rotated image will be The reference surface will be calculated using When calculating the reference plane, as described above, information within a predetermined area set by the frame line 52 shown in FIG. 14 is used, but the area within this frame line 52 is The image of the rotated workpiece W is different from the image of the rotated workpiece W. As a result, if the reference plane is calculated using the image of the rotated workpiece W, the tilt correction will not be performed as expected and the result will not be correct. There is a risk that it will not be possible to obtain

これに対し、本例のようにステップSE3を経ることで、ワークWが回転した状態の画像であっても、モデル画像と同じ向きになるように画像を回転させて、図14に示す枠線52内の領域をモデル画像と同じ領域にすることができる。これにより、傾き補正が想定した通りに行われる。尚、ワークWが回転する可能性の無い場合には、位置補正のステップを省略してもよい。 On the other hand, by going through step SE3 as in this example, even if the image shows the rotated workpiece W, the image is rotated so that it is in the same direction as the model image, and the frame line shown in FIG. The area within 52 can be the same area as the model image. As a result, the tilt correction is performed as expected. Note that if there is no possibility that the workpiece W will rotate, the step of position correction may be omitted.

その後、ステップSE6に進み、新たな高さデータに対して階調変換を行う。すなわち、変換部33fが、算出部33eにより算出された基準面を基準として、新たな高さデータを、該新たな高さデータの階調数(例:16bit)よりも低い階調数(例:8bit)を有する高さ画像に変換する。 Thereafter, the process proceeds to step SE6, where gradation conversion is performed on the new height data. That is, the converting unit 33f converts the new height data into a number of gradations (e.g., 16 bits) lower than the number of gradations (e.g., 16 bits) of the new height data, using the reference plane calculated by the calculation unit 33e as a reference. :8bit).

階調変換の際、変換部33fは、算出部33eにより算出された基準面と、高さ範囲設定部33cにより設定された所定の高さ範囲とに基づいて変換することもできる。例えば、図14に示す2D画像変換設定ダイアログ50の上側表示面54bと下側表示面54cとの間(上側表示線53bと下側表示線53cとの間)が所定の高さ範囲として設定されている場合、新たな高さデータにおける所定の高さ範囲のみ抜き出して階調変換する。所定の高さ範囲が狭ければ狭いほど、階調変換時のゲインが高くなる。 At the time of gradation conversion, the converting unit 33f can also perform conversion based on the reference plane calculated by the calculating unit 33e and a predetermined height range set by the height range setting unit 33c. For example, the area between the upper display surface 54b and the lower display surface 54c (between the upper display line 53b and the lower display line 53c) of the 2D image conversion setting dialog 50 shown in FIG. 14 is set as the predetermined height range. If so, only a predetermined height range in the new height data is extracted and gradation-converted. The narrower the predetermined height range, the higher the gain during gradation conversion.

階調変換後にステップSE7で三次元表示処理を実行する。三次元表示処理は、例えば三次元ポリゴン表示や三次元点群(ポイントクラウド)表示のいずれでもよい。 After the gradation conversion, three-dimensional display processing is executed in step SE7. The three-dimensional display process may be, for example, a three-dimensional polygon display or a three-dimensional point cloud display.

その後、ステップSE8に進み、出力部33gが、変換部33fで生成された高さ画像を上述したGenICam規格等によって標準化された接続インターフェースにより設定装置4へ出力する。 Thereafter, the process proceeds to step SE8, and the output unit 33g outputs the height image generated by the conversion unit 33f to the setting device 4 using a connection interface standardized by the above-mentioned GenICam standard or the like.

高さ抽出の結果データやパターンサーチの結果データ等もすべてFeatureとして用意されており、設定装置4から撮像部3にAcquisitionコマンドを発行することで、設定装置4が撮像部3から上記結果データを読み出すことができる。 Height extraction result data, pattern search result data, etc. are all prepared as features, and by issuing an Acquisition command from the setting device 4 to the imaging section 3, the setting device 4 acquires the above result data from the imaging section 3. Can be read.

また、変換部33fで生成された高さ画像は、二次元画像処理ライブラリで扱うことができる二次元画像である。すなわち、設定装置4に高さ画像を扱う二次元画像処理ライブラリしかインストールされていない場合であっても、撮像部3から送られてきた画像が二次元画像であることから、設定装置4側で高さデータから高さ画像に変換するためのプログラムコードを記述することなく、画像検査等を実行できる。 Further, the height image generated by the converter 33f is a two-dimensional image that can be handled by a two-dimensional image processing library. In other words, even if only a two-dimensional image processing library that handles height images is installed on the setting device 4, since the image sent from the imaging unit 3 is a two-dimensional image, the setting device 4 Image inspection, etc. can be performed without writing program code to convert height data to a height image.

(ゼロ面指定)
次に、画像検査システム1の運転時にゼロ面指定を行う手順について図19に示すフローチャートに基づいて説明する。スタート後のステップSF1、SF2、SF3は、それぞれ図18に示すフローチャートのステップSE1、SE2、SE3と同じである。ステップSF4では、三次元画像に対して前処理を実行する。その後、ステップSF5、SF6に進む。ステップSF5、SF6は、それぞれ図18に示すフローチャートのステップSE4、SE5と同じである。
(Zero surface specified)
Next, the procedure for specifying the zero plane during operation of the image inspection system 1 will be described based on the flowchart shown in FIG. 19. Steps SF1, SF2, and SF3 after the start are the same as steps SE1, SE2, and SE3 in the flowchart shown in FIG. 18, respectively. In step SF4, preprocessing is performed on the three-dimensional image. After that, the process proceeds to steps SF5 and SF6. Steps SF5 and SF6 are the same as steps SE4 and SE5 in the flowchart shown in FIG. 18, respectively.

ステップSF7では、出力部33gが、ステップSF6で補正した後の三次元画像を上述した標準化された接続インターフェースにより設定装置4へ出力する。この例では、基準面の傾きを補正した三次元画像を設定装置4で利用することができる。 In step SF7, the output unit 33g outputs the three-dimensional image corrected in step SF6 to the setting device 4 using the standardized connection interface described above. In this example, the setting device 4 can use a three-dimensional image in which the inclination of the reference plane has been corrected.

(三次元差分)
次に、画像検査システム1の運用時に三次元差分を取得する手順について図20に示すフローチャートに基づいて説明する。スタート後のステップSG1、SG2、SG3は、それぞれ図18に示すフローチャートのステップSE1、SE2、SE3と同じである。ステップSG4では、ゼロ面指定時と同様に、三次元画像に対して前処理を実行する。その後、ステップSG5に進む。ステップSG5では、三次元画像と、設定時に登録したモデル画像との差分を取得する。これにより、画像上のワークWの位置を正確に合わせることができる。
(3D difference)
Next, a procedure for acquiring a three-dimensional difference during operation of the image inspection system 1 will be described based on the flowchart shown in FIG. 20. Steps SG1, SG2, and SG3 after the start are the same as steps SE1, SE2, and SE3 in the flowchart shown in FIG. 18, respectively. In step SG4, preprocessing is performed on the three-dimensional image in the same way as when specifying the zero plane. Thereafter, the process proceeds to step SG5. In step SG5, the difference between the three-dimensional image and the model image registered at the time of setting is obtained. Thereby, the position of the workpiece W on the image can be adjusted accurately.

ステップSG6では、出力部33gが、ステップSG5で差分をとった後の三次元画像を上述した標準化された接続インターフェースにより設定装置4へ出力する。 In step SG6, the output unit 33g outputs the three-dimensional image after taking the difference in step SG5 to the setting device 4 through the standardized connection interface described above.

(外観検査)
本例では、図7に示すように、設定装置4が検査部4A及び画像処理部4Bを備えている。画像処理部4Bは、撮像部3の出力部33gから出力された高さ画像に対して画像処理を行う部分である。画像処理部4Bが行う画像処理は、検査部4Aによる外観検査の精度を高めるための処理である。検査部4Aは、画像処理部4Bにより画像処理された画像に基づいて外観検査を行うので、検査精度を高めることができる。
(Visual inspection)
In this example, as shown in FIG. 7, the setting device 4 includes an inspection section 4A and an image processing section 4B. The image processing section 4B is a section that performs image processing on the height image output from the output section 33g of the imaging section 3. The image processing performed by the image processing section 4B is a process for increasing the accuracy of the visual inspection performed by the inspection section 4A. Since the inspection section 4A performs an appearance inspection based on the image processed by the image processing section 4B, inspection accuracy can be improved.

(実施形態の作用効果)
以上説明したように、この実施形態によれば、取得部AによりワークWの輝度画像と高さデータを取得すると、ユーザが基準位置を設定し、設定した基準位置に基づいて基準面を特定することができる。
(Operations and effects of embodiments)
As explained above, according to this embodiment, when the acquisition unit A acquires the brightness image and height data of the workpiece W, the user sets the reference position and identifies the reference plane based on the set reference position. be able to.

画像検査システム1の運用時には、設定時のワークWとは異なる別の新たなワークWについて取得部Aにより新たな輝度画像と新たな高さデータを取得できる。新たな輝度画像の特徴部分が撮像部3の補正部33dによりサーチされ、サーチの結果、基準位置がずれていると、そのずれを撮像部3内で補正できる。 During operation of the image inspection system 1, the acquisition unit A can acquire a new brightness image and new height data for a new workpiece W different from the workpiece W at the time of setting. The characteristic portion of the new luminance image is searched by the correction unit 33d of the imaging unit 3, and if the search results show that the reference position has shifted, the deviation can be corrected within the imaging unit 3.

基準位置の補正後、基準位置に対応する高さ情報を用いて新たな高さデータの基準面が算出され、新たな高さデータの基準面を基準として、新たな高さデータが階調数の低い高さ画像に変換され、二次元画像処理ライブラリで扱うことができる二次元画像が生成される。 After correcting the reference position, a new reference plane for height data is calculated using the height information corresponding to the reference position, and the new height data is calculated based on the reference plane for the new height data. is converted into a low-height image to generate a 2D image that can be handled by a 2D image processing library.

生成された高さ画像が標準化された規格により出力されるので、撮像部3を汎用パーソナルコンピュータ等の設定装置4に接続して使用する場合に、高さ画像を設定装置4で容易に受け取ることができる。さらに、受け取った高さ画像は、二次元画像処理ライブラリで扱うことができるものなので、二次元画像に変換のためのプログラムコードをユーザ側で記述しなくても、設定装置4で画像処理を容易に行うことが可能になり、記述のための時間や手間が不要になる。 Since the generated height image is output according to a standardized standard, when the imaging unit 3 is used by connecting to the setting device 4 such as a general-purpose personal computer, the height image can be easily received by the setting device 4. Can be done. Furthermore, since the received height image can be handled by a two-dimensional image processing library, image processing can be easily performed using the setting device 4 without the user having to write program code for converting it into a two-dimensional image. This makes it possible to do so without the need for time and effort for writing.

また、例えば、ワークWが仮に水平面から傾いていたとしても、上述したように基準位置のずれが補正されてから基準面を算出し、算出された基準面を基準として低階調数の高さ画像に変換するので、傾きを補正するためのコードをユーザ側で記述する必要はない。したがって、ユーザの使い勝手が向上する。 For example, even if the workpiece W is tilted from the horizontal plane, the reference plane is calculated after the deviation of the reference position is corrected as described above, and the height of the low gradation number is calculated based on the calculated reference plane. Since it is converted into an image, there is no need for the user to write code to correct the tilt. Therefore, user-friendliness is improved.

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

以上説明したように、本発明は、例えばワーク等を撮像する場合や撮像したワーク等を検査する場合に利用できる。 As described above, the present invention can be used, for example, when imaging a workpiece or the like or when inspecting an imaged workpiece or the like.

1 画像検査システム
2 照明装置(投光部)
4A 検査部
4B 画像処理部
31 カメラ(画像生成部)
33a 設定部
33b 度数分布算出部
33c 高さ範囲設定部
33d 補正部
33e 算出部
33f 変換部
33g 出力部
300 撮像装置
A 取得部
W ワーク(撮像対象物)
1 Image inspection system 2 Illumination device (light projector)
4A Inspection section 4B Image processing section 31 Camera (image generation section)
33a Setting section 33b Frequency distribution calculation section 33c Height range setting section 33d Correction section 33e Calculation section 33f Conversion section 33g Output section 300 Imaging device A Acquisition section W Work (imaged object)

Claims (8)

撮像対象物からの反射光の受光量に応じた輝度画像を取得するとともに、撮像対象物の高さ情報が二次元座標上に配置された高さデータを取得する取得部と、
前記取得部により取得された高さデータに対し、該高さデータを階調変換する際の基準となる基準面を特定するための基準位置を設定する設定部と、
前記基準位置の設定に用いた高さデータを取得した撮像対象物とは異なる新たな撮像対象物について、前記取得部により新たな輝度画像と新たな高さデータが取得された場合において、該新たな輝度画像の特徴部分をサーチして新たな撮像対象物の位置又は姿勢のずれを検出し、前記新たな高さデータに対する前記基準位置のずれを補正する補正部と、
前記補正部により補正された前記基準位置に対応する高さ情報を用いて該新たな高さデータの基準面を算出する算出部と、
前記算出部により算出された基準面を基準として、前記新たな高さデータを、該新たな高さデータの階調数よりも低い階調数を有する高さ画像に変換する変換部と、
前記変換部により生成された高さ画像を標準化された規格により出力する出力部とを備える撮像装置。
an acquisition unit that acquires a brightness image according to the amount of reflected light received from the imaged object and acquires height data in which height information of the imaged object is arranged on two-dimensional coordinates;
a setting unit that sets a reference position for specifying a reference plane that is a reference for gradation conversion of the height data acquired by the acquisition unit;
When the acquisition unit acquires a new luminance image and new height data for a new imaging target different from the imaging target from which the height data used for setting the reference position was acquired, the new a correction unit that searches for a characteristic part of a brightness image to detect a shift in the position or posture of a new object to be imaged, and corrects a shift in the reference position with respect to the new height data;
a calculation unit that calculates a reference plane of the new height data using height information corresponding to the reference position corrected by the correction unit;
a conversion unit that converts the new height data into a height image having a lower number of gradations than the number of gradations of the new height data, using the reference plane calculated by the calculation unit as a reference;
An imaging device comprising: an output section that outputs the height image generated by the conversion section according to a standardized standard.
請求項1に記載の撮像装置において、
前記撮像装置は、
前記基準位置からなる設定項目と、該設定項目の設定値が格納される場所を示すレジスタ情報とが記述されたファイルを外部から取得してユーザにより設定された該設定項目の設定値と、該ファイルに含まれる該設定項目に対応するレジスタ情報とを該撮像装置に送信可能な設定装置に、ネットワークを介して接続可能に構成されるとともに、
前記設定装置から受信した前記設定項目の設定値を、該設定項目に対応するレジスタ情報が示す場所に格納する撮像装置。
The imaging device according to claim 1,
The imaging device includes:
A file in which a setting item consisting of the reference position and register information indicating a location where the setting value of the setting item is stored is obtained from an external source, and the setting value of the setting item set by the user, and the setting value of the setting item set by the user are obtained. The device is configured to be connectable via a network to a setting device capable of transmitting register information corresponding to the setting items included in the file to the imaging device;
An imaging device that stores a setting value of the setting item received from the setting device in a location indicated by register information corresponding to the setting item.
請求項1または2に記載の撮像装置において、
前記取得部は、
撮像対象物に対して所定の投影パターンを有する構造化照明を投光する投光部と、
撮像対象物からの反射光の受光量に応じた輝度画像を取得するとともに、前記投光部により投光された構造化照明が撮像対象物で反射した反射光を受光して、複数のパターン投影画像を生成する画像生成部とを有するとともに、
前記画像生成部により生成された複数のパターン投影画像に基づいて、高さデータを取得するように構成されている撮像装置。
The imaging device according to claim 1 or 2,
The acquisition unit includes:
a light projecting unit that projects structured illumination having a predetermined projection pattern onto an imaging target;
In addition to acquiring a brightness image according to the amount of reflected light received from the imaging target, the structured illumination projected by the light projecting unit receives the reflected light reflected by the imaging target to project a plurality of patterns. and an image generation unit that generates an image,
An imaging device configured to acquire height data based on a plurality of pattern projection images generated by the image generation section.
請求項1から3のいずれか1つに記載の撮像装置と、
前記撮像装置とネットワークを介して接続され、当該撮像装置の設定項目と各設定項目の設定値が格納される場所を示すレジスタ情報とが記述されたファイルを外部から取得し、ユーザにより設定された各設定項目の設定値と、前記ファイルに含まれる各設定項目に対応するレジスタ情報を示すデータを前記撮像装置に送信し、当該撮像装置の設定を行う設定装置とを備えた画像検査システムであって、
前記設定装置は、
前記新たな高さデータの高さ情報を表示する表示部と、
前記表示部に表示された高さ情報を利用して所定の高さ範囲を設定する高さ範囲設定部とを備え、
前記変換部は、前記算出部により算出された基準面と、前記高さ範囲設定部により設定された所定の高さ範囲とに基づいて、前記新たな高さデータを、該新たな高さデータの階調数よりも低い階調数を有する高さ画像に変換するように構成されている画像検査システム。
An imaging device according to any one of claims 1 to 3,
A file that is connected to the imaging device via a network and that describes setting items of the imaging device and register information indicating a location where the setting values of each setting item are stored is obtained from an external source, and a file that is set by the user is obtained. An image inspection system comprising: a setting device that transmits data indicating setting values of each setting item and register information corresponding to each setting item included in the file to the imaging device, and configures settings of the imaging device. hand,
The setting device includes:
a display unit that displays height information of the new height data;
a height range setting section that sets a predetermined height range using the height information displayed on the display section;
The conversion unit converts the new height data into new height data based on the reference plane calculated by the calculation unit and the predetermined height range set by the height range setting unit. An image inspection system configured to convert a height image into a height image having a lower number of tones than a number of tones.
請求項4に記載の画像検査システムにおいて、
前記設定装置は、前記算出部により算出された基準面を基準として、前記新たな高さデータの高さ情報に含まれる画素ごとの高さについて度数分布を算出する度数分布算出部を有し、
前記表示部は、前記度数分布算出部により算出された度数分布を表示し、
前記高さ範囲設定部は、前記表示部に表示された度数分布上で、所定の高さ範囲の設定が可能に構成されている画像検査システム。
The image inspection system according to claim 4,
The setting device includes a frequency distribution calculation unit that calculates a frequency distribution for the height of each pixel included in the height information of the new height data, using the reference plane calculated by the calculation unit as a reference;
The display unit displays the frequency distribution calculated by the frequency distribution calculation unit,
The image inspection system is configured such that the height range setting section is capable of setting a predetermined height range on the frequency distribution displayed on the display section.
請求項4または5に記載の画像検査システムにおいて、
前記取得部は、高さデータに基づいて撮像対象物の三次元画像を生成し、
前記表示部は、前記取得部で生成された三次元画像を表示するとともに、前記高さ範囲設定部で設定された高さ範囲を三次元画像上に表示するように構成されている画像検査システム。
The image inspection system according to claim 4 or 5,
The acquisition unit generates a three-dimensional image of the object to be imaged based on the height data,
The image inspection system is configured such that the display unit displays the three-dimensional image generated by the acquisition unit and also displays the height range set by the height range setting unit on the three-dimensional image. .
請求項5に記載の画像検査システムにおいて、
前記表示部は、前記高さ範囲設定部で設定された高さ範囲を度数分布上に表示するように構成されている画像検査システム。
The image inspection system according to claim 5,
The display unit is an image inspection system configured to display the height range set by the height range setting unit on a frequency distribution.
請求項4から7のいずれか1つに記載の画像検査システムにおいて、
前記設定装置は、前記出力部から出力された高さ画像に対して画像処理を行う画像処理部と、該画像処理部により画像処理された画像に基づいて外観検査を行う検査部とを備えている画像検査システム。
The image inspection system according to any one of claims 4 to 7,
The setting device includes an image processing unit that performs image processing on the height image output from the output unit, and an inspection unit that performs an appearance inspection based on the image processed by the image processing unit. image inspection system.
JP2020089467A 2020-05-22 2020-05-22 Imaging device and image inspection system Active JP7402745B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2020089467A JP7402745B2 (en) 2020-05-22 2020-05-22 Imaging device and image inspection system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2020089467A JP7402745B2 (en) 2020-05-22 2020-05-22 Imaging device and image inspection system

Publications (2)

Publication Number Publication Date
JP2021183937A JP2021183937A (en) 2021-12-02
JP7402745B2 true JP7402745B2 (en) 2023-12-21

Family

ID=78767287

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2020089467A Active JP7402745B2 (en) 2020-05-22 2020-05-22 Imaging device and image inspection system

Country Status (1)

Country Link
JP (1) JP7402745B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115131211A (en) * 2022-07-04 2022-09-30 威海华菱光电股份有限公司 Image synthesis method, image synthesis device, portable scanner and non-volatile storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001004330A (en) 1999-04-23 2001-01-12 Matsushita Electric Works Ltd Image processor and its method
JP2007212590A (en) 2006-02-08 2007-08-23 Casio Comput Co Ltd Camera device and camera control program
JP2015031539A (en) 2013-07-31 2015-02-16 株式会社キーエンス Image processing device, image processing system, inspection method, and program
JP2015038466A (en) 2013-07-16 2015-02-26 株式会社キーエンス Three-dimensional image processing apparatus, three-dimensional image processing method, three-dimensional image processing program, computer-readable recording medium, and device for storage
JP2015127774A (en) 2013-12-27 2015-07-09 株式会社キーエンス Device, method, and program for magnifying observation, and computer readable recording medium
JP2015148568A (en) 2014-02-07 2015-08-20 株式会社キーエンス Exterior appearance inspection device, exterior appearance inspection method and program
JP2017083234A (en) 2015-10-26 2017-05-18 オムロン株式会社 Three-dimensional shape measurement device, three-dimensional shape measurement system, program, computer-readable recording medium, and three-dimensional shape measurement method
JP2017151066A (en) 2016-02-26 2017-08-31 株式会社キーエンス Image inspection device, image inspection method, image inspection program, and computer-readable recording medium and recorded device
JP2019074472A (en) 2017-10-18 2019-05-16 株式会社キーエンス Optical scanning height measuring device

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001004330A (en) 1999-04-23 2001-01-12 Matsushita Electric Works Ltd Image processor and its method
JP2007212590A (en) 2006-02-08 2007-08-23 Casio Comput Co Ltd Camera device and camera control program
JP2015038466A (en) 2013-07-16 2015-02-26 株式会社キーエンス Three-dimensional image processing apparatus, three-dimensional image processing method, three-dimensional image processing program, computer-readable recording medium, and device for storage
JP2015031539A (en) 2013-07-31 2015-02-16 株式会社キーエンス Image processing device, image processing system, inspection method, and program
JP2015127774A (en) 2013-12-27 2015-07-09 株式会社キーエンス Device, method, and program for magnifying observation, and computer readable recording medium
JP2015148568A (en) 2014-02-07 2015-08-20 株式会社キーエンス Exterior appearance inspection device, exterior appearance inspection method and program
JP2017083234A (en) 2015-10-26 2017-05-18 オムロン株式会社 Three-dimensional shape measurement device, three-dimensional shape measurement system, program, computer-readable recording medium, and three-dimensional shape measurement method
JP2017151066A (en) 2016-02-26 2017-08-31 株式会社キーエンス Image inspection device, image inspection method, image inspection program, and computer-readable recording medium and recorded device
JP2019074472A (en) 2017-10-18 2019-05-16 株式会社キーエンス Optical scanning height measuring device

Also Published As

Publication number Publication date
JP2021183937A (en) 2021-12-02

Similar Documents

Publication Publication Date Title
JP7222796B2 (en) Image inspection system and image inspection method
JP2018205005A (en) Image inspection device
JP7188870B2 (en) Image inspection equipment
JP2018204994A (en) Image inspection device
JP2017122614A (en) Image generation method and inspection device
JP5566707B2 (en) Appearance inspection apparatus and appearance inspection method
JP7402745B2 (en) Imaging device and image inspection system
JP7231462B2 (en) Image inspection system and image inspection method
JP6917780B2 (en) Image inspection equipment
JP2020076676A (en) Displacement measuring device
US10909702B2 (en) Inspection device
JP2020169950A (en) Image inspection system
JP7273659B2 (en) Image measurement system
JP2018204995A (en) Image inspection device
JP7231461B2 (en) Image inspection system and image inspection method
JP7222795B2 (en) Image inspection system and image inspection method
JP7474636B2 (en) Image Inspection System
JP2018205000A (en) Image inspection device
JP7306857B2 (en) Image inspection system
JP7306858B2 (en) Image inspection system and image inspection method
JP2021184180A (en) Image inspection system
KR102171773B1 (en) Inspection area determination method and visual inspection apparatus using the same
JP7311360B2 (en) Image measurement system
CN110278384B (en) Image processing system, image processing apparatus, image processing method, and computer readable medium
JP2020169959A (en) Image inspection system and image inspection method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20230303

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20231031

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20231211

R150 Certificate of patent or registration of utility model

Ref document number: 7402745

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150