JP2018204999A - Image inspection device - Google Patents

Image inspection device Download PDF

Info

Publication number
JP2018204999A
JP2018204999A JP2017107416A JP2017107416A JP2018204999A JP 2018204999 A JP2018204999 A JP 2018204999A JP 2017107416 A JP2017107416 A JP 2017107416A JP 2017107416 A JP2017107416 A JP 2017107416A JP 2018204999 A JP2018204999 A JP 2018204999A
Authority
JP
Japan
Prior art keywords
image
inspection
unit
pattern light
position information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2017107416A
Other languages
Japanese (ja)
Inventor
典正 眞弓
Norimasa Mayumi
典正 眞弓
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 JP2017107416A priority Critical patent/JP2018204999A/en
Publication of JP2018204999A publication Critical patent/JP2018204999A/en
Pending legal-status Critical Current

Links

Abstract

To generate a plurality of images for inspection from which different types of defects can be detected, and when subsequently adding an image for inspection displayed on a display unit or changing the images for inspection, make it possible to accurately perform defect inspection by using the images for inspection after the addition or change, while eliminating the need of a complex setting operation.SOLUTION: When images for inspection are selected, an image inspection device reads out a plurality of pieces of position information indicating the position of a non-defective part or a defective part stored therein, and refers to pixel values corresponding to the position information to update a pixel value range to be the non-defective part.SELECTED DRAWING: Figure 33

Description

本発明は、検査対象物を撮像した画像を用いて検査対象物の欠陥を検査する画像検査装置に関する。   The present invention relates to an image inspection apparatus that inspects a defect of an inspection object using an image obtained by imaging the inspection object.

従来より、検査対象物の表面に対し、照明部から光を照射して、反射光を撮像部で受光し、受光した光の輝度分布を解析して、検査対象物に存在する傷等の欠陥を検査する画像検査装置が知られている。   Conventionally, the surface of the inspection object is irradiated with light from the illumination unit, the reflected light is received by the imaging unit, the luminance distribution of the received light is analyzed, and defects such as scratches existing on the inspection object are detected. An image inspection apparatus for inspecting the image is known.

この種の画像検査装置としては、特許文献1に開示されている、いわゆるデフレクトメトリの原理を応用した画像検査装置が知られている。この画像検査装置は、照度が周期的に変化するパターン光を検査対象物に照射する照明部と、パターン光が照射されている検査対象物を撮像する撮像部とを備えている。照度分布の位相をシフトさせた複数のパターン光を照明部によって順次照射し、パターン光を照射する都度、撮像部によって検査対象物を撮像し、得られた複数の輝度画像に基づいて検査対象物の形状を示す位相データを生成する。得られた位相データに基づいて検査用画像を生成し、この検査用画像を用いることにより、検査対象物の形状に係る欠陥検査を行うことができるようになっている。   As this type of image inspection apparatus, there is known an image inspection apparatus that applies the principle of so-called deflectometry disclosed in Patent Document 1. The image inspection apparatus includes an illumination unit that irradiates the inspection target with pattern light whose illuminance periodically changes, and an imaging unit that images the inspection target irradiated with the pattern light. The illumination unit sequentially irradiates a plurality of pattern lights with the phase of the illuminance distribution shifted, and each time the pattern light is emitted, the imaging unit images the inspection object, and the inspection object is based on the obtained plurality of luminance images. The phase data indicating the shape of is generated. An inspection image is generated based on the obtained phase data, and the defect inspection relating to the shape of the inspection object can be performed by using the inspection image.

また、他の画像検査装置として、特許文献2に開示されている、いわゆるフォトメトリックステレオ法を用いた画像検査装置も知られている。この画像検査装置は、検査対象物対して互いに異なる方向から照明するための3つ以上の照明部と、各照明部を順次点灯させる照明制御部と、各照明部が光を照射したタイミングにおいて検査対象物を一定方向から撮像する撮像部とを備えている。撮像された複数の画像毎の画素値から、フォトメトリックステレオ法を用いて法線ベクトルを算出し、法線ベクトルに基づいて検査用画像を生成することができるようになっている。   As another image inspection apparatus, an image inspection apparatus using a so-called photometric stereo method disclosed in Patent Document 2 is also known. This image inspection apparatus includes three or more illumination units for illuminating an inspection object from different directions, an illumination control unit for sequentially lighting each illumination unit, and an inspection at a timing when each illumination unit irradiates light. And an imaging unit that images the object from a certain direction. A normal vector is calculated from the pixel values of each of a plurality of captured images using a photometric stereo method, and an inspection image can be generated based on the normal vector.

米国特許第6,100,990号明細書US Pat. No. 6,100,990 特開2015−232486号公報Japanese Patent Laying-Open No. 2015-232486

ところで、特許文献1、2のいずれの画像検査装置も異なる種別の欠陥の検出が可能な複数の検査用画像を生成することができるので、使用者は異なる種別の欠陥の有無を複数の検査用画像を用いて検査でき、検査精度の向上に繋がると考えられる。   By the way, since any of the image inspection apparatuses of Patent Documents 1 and 2 can generate a plurality of inspection images capable of detecting different types of defects, the user can determine whether or not there are different types of defects for a plurality of inspections. It can be inspected using an image, which is thought to lead to improved inspection accuracy.

しかしながら、複数の検査用画像を生成できるといっても、生成された全ての検査用画像を同時にディスプレイに表示させてしまうと各検査用画像が小さくなって検査の用をなさなくなるので、そのような使用は現実的ではない。そのため、使用者が必要な検査用画像を選択してディスプレイに表示させて使用することが前提となる。   However, even though a plurality of inspection images can be generated, if all the generated inspection images are displayed on the display at the same time, each inspection image becomes smaller and cannot be used for inspection. Such use is not realistic. Therefore, it is assumed that the user selects a necessary inspection image and displays it on the display.

ここで、たとえば運用開始時に選択した検査用画像が欠陥を検査するのに適していないことが後から分かることや、より適した検査用画像が無いか後から探すことがある。その場合には、使用者が、現在表示されていない検査用画像を選択して当該検査用画像を追加する形でディスプレイに表示させたり、現在表示されている検査用画像を、現在表示されていない検査用画像に変更する形でディスプレイに表示させることが考えられる。   Here, for example, it may be found later that the inspection image selected at the start of operation is not suitable for inspecting a defect, or it may be searched later for a more suitable inspection image. In that case, the user selects an inspection image that is not currently displayed and adds the inspection image to the display, or the currently displayed inspection image is currently displayed. It is conceivable to display on the display in such a way that it is changed to a non-inspection image.

ところが、そのような画像の追加や変更を行った場合には次のような問題が発生することがある。すなわち、ディスプレイに表示されている検査用画像に対しては、使用者が、欠陥領域と非欠陥領域とのしきい値の設定作業等を既に行っている。一方、ディスプレイに表示されていない検査用画像に対してはそのような作業等が行われていない。従って、検査用画像の追加や変更のために、ディスプレイに表示されていない検査用画像を選択してディスプレイに表示させる操作を行うと、その選択した検査用画像に対して再び同じような作業等が必要になり、煩雑である。   However, when such an image is added or changed, the following problem may occur. That is, for the inspection image displayed on the display, the user has already performed a threshold value setting operation for the defective area and the non-defective area. On the other hand, such an operation is not performed on the inspection image that is not displayed on the display. Therefore, when an operation for selecting an inspection image that is not displayed on the display and displaying it on the display for adding or changing the inspection image, the same operation or the like is performed again on the selected inspection image. Is necessary and complicated.

本発明は、かかる点に鑑みてなされたものであり、その目的とするところは、異なる種別の欠陥の検出が可能な複数の検査用画像を生成し、表示部に表示される検査用画像を後から追加や変更した場合に、煩雑な設定作業を不要にしながら、追加や変更後の検査用画像を用いて欠陥検査を精度良く行えるようにすることにある。   The present invention has been made in view of such a point, and an object of the present invention is to generate a plurality of inspection images capable of detecting different types of defects and to display inspection images displayed on the display unit. When adding or changing later, it is possible to perform defect inspection with high accuracy by using the inspection image after addition or change without making complicated setting work.

上記目的を達成するために、本発明では、検査対象物を撮像した画像を用いて検査対象物の欠陥を検査する画像検査装置において、検査対象物に光を照射する照明部と、上記照明部によって照明されたタイミングで検査対象物を撮像して複数の輝度画像を得る撮像部と、上記撮像部が撮像した上記複数の輝度画像に基づいて、複数の検査対象物を生成する画像生成部と、上記画像生成部で生成された上記複数の検査用画像の中から、検査に用いる少なくとも一つの第1検査用画像を選択する画像選択部と、上記画像選択部により選択された上記第1検査用画像を表示可能な表示部と、上記表示部に表示されている上記第1検査用画像に対して、当該第1検査用画像における検査対象物の非欠陥部または欠陥部の位置の指定を複数回受け付け可能な受付部と、上記受付部により受け付けた複数の非欠陥部または欠陥部の位置情報を記憶する位置情報記憶部と、上記受付部により受け付けた非欠陥部または欠陥部の位置の画素値に基づいて、非欠陥部とすべき画素値範囲を、上記表示部に表示されている上記第1検査用画像に対して自動的に設定する設定部とを備え、上記設定部は、上記画像選択部により、上記表示部に表示されていない検査用画像が第2検査用画像として選択された際に、上記位置情報記憶部に記憶された非欠陥部または欠陥部の位置を示す複数の位置情報を読み出し、上記第2検査用画像における上記位置情報に対応する画素値を参照して上記非欠陥部とすべき画素値範囲を更新するように構成されている。   In order to achieve the above object, in the present invention, in an image inspection apparatus that inspects a defect of an inspection object using an image obtained by imaging the inspection object, an illumination unit that irradiates the inspection object with light, and the illumination unit An imaging unit that captures an inspection object at a timing illuminated by the imaging unit to obtain a plurality of luminance images; an image generation unit that generates a plurality of inspection objects based on the plurality of luminance images captured by the imaging unit; An image selection unit that selects at least one first inspection image used for inspection from the plurality of inspection images generated by the image generation unit, and the first inspection selected by the image selection unit For the display unit capable of displaying an image for use and the first inspection image displayed on the display unit, designation of the position of the non-defect portion or defect portion of the inspection object in the first inspection image Accepted multiple times Based on a pixel value of a position information storage unit that stores position information of a plurality of non-defective portions or defective portions received by the receiving portion, and a position of the non-defective portions or defective portions received by the receiving portion A setting unit that automatically sets a pixel value range to be a non-defective part for the first inspection image displayed on the display unit, and the setting unit includes the image selection unit Thus, when an inspection image that is not displayed on the display unit is selected as a second inspection image, a plurality of pieces of position information indicating the position of the non-defect portion or the defect portion stored in the position information storage unit is obtained. The pixel value range to be determined as the non-defective part is updated by reading and referring to the pixel value corresponding to the position information in the second inspection image.

この構成によれば、表示部に第1検査用画像が表示される。この第1検査用画像において検査対象物の非欠陥部または欠陥部の位置の指定を複数回行うと、指定された位置の画素値に基づいて、非欠陥部とすべき画素値範囲が第1検査用画像に対して自動的に設定されるので、欠陥部と非欠陥部を区別することができる。   According to this configuration, the first inspection image is displayed on the display unit. When the position of the non-defect portion or the defect portion of the inspection object is designated a plurality of times in the first inspection image, the pixel value range to be the non-defect portion is first based on the pixel value at the designated position. Since the inspection image is automatically set, the defective portion and the non-defective portion can be distinguished.

その後、使用者が、第1検査用画像とは別の検査用画像を欠陥の検査に用いるべく第2検査用画像として選択すると、上記非欠陥部または欠陥部の位置を示す位置情報に対応する画素値を参照して、非欠陥部とすべき画素値範囲を更新し、第2検査用画像に自動で適用することができる。   After that, when the user selects an inspection image different from the first inspection image as the second inspection image to be used for the defect inspection, it corresponds to the position information indicating the position of the non-defect portion or the defect portion. With reference to the pixel value, the pixel value range to be a non-defective portion can be updated and automatically applied to the second inspection image.

また、上記表示部は、複数の上記検査用画像を表示可能に構成され、上記画像生成部は、上記設定部により、上記表示部に表示されている複数の上記検査用画像に対して設定された非欠陥部とすべき画素値範囲の全てに含まれる領域を非欠陥領域とし、いずれかの画素値範囲に含まれない領域を欠陥領域とした合成欠陥画像を生成するように構成することができる。   Further, the display unit is configured to be able to display a plurality of the inspection images, and the image generation unit is set by the setting unit for the plurality of inspection images displayed on the display unit. It is configured to generate a composite defect image in which a region included in all pixel value ranges that should be non-defective portions is a non-defective region and a region not included in any pixel value range is a defective region. it can.

また、上記設定部は、上記画像選択部により、上記第2検査用画像が選択された後、上記表示部に表示されていない検査用画像が第3検査用画像として選択された際に、上記位置情報記憶部に記憶された非欠陥部または欠陥部の位置を示す複数の位置情報を読み出し、上記第3検査用画像における上記位置情報に対応する画素値を参照して上記非欠陥部とすべき画素値範囲を更新するように構成され、上記第3検査用画像にフィルタ処理を行うように構成することができる。   Further, the setting unit may be configured such that, after the second inspection image is selected by the image selection unit, an inspection image that is not displayed on the display unit is selected as a third inspection image. A plurality of position information indicating the position of the non-defect portion or the defect portion stored in the position information storage section is read out, and the pixel value corresponding to the position information in the third inspection image is referred to as the non-defect portion. The power pixel value range can be updated, and the third inspection image can be filtered.

また、上記受付部は、上記表示部に表示されている上記第2検査用画像に対して、当該第2検査用画像における検査対象物の非欠陥部または欠陥部の位置の指定を複数回受け付け可能に構成され、上記位置情報記憶部は、上記受付部により受け付けた上記第2検査用画像における非欠陥部または欠陥部の位置情報を記憶するように構成され、上記設定部は、上記画像選択部により上記第3検査用画像が選択された際に、上記位置情報記憶部に記憶された上記第2検査用画像における非欠陥部または欠陥部の位置を示す位置情報を読み出し、上記第3検査用画像における上記位置情報に対応する画素値を参照して上記非欠陥部とすべき画素値範囲を更新するように構成することができる。   Further, the receiving unit receives a plurality of designations of the position of the non-defective part or the defective part of the inspection object in the second inspection image for the second inspection image displayed on the display unit. The position information storage unit is configured to store position information of a non-defective part or a defective part in the second inspection image received by the receiving unit, and the setting unit is configured to select the image selection unit. When the third inspection image is selected by the unit, position information indicating the position of the non-defect portion or the defective portion in the second inspection image stored in the position information storage unit is read, and the third inspection is performed. The pixel value range to be the non-defective part can be updated with reference to the pixel value corresponding to the position information in the image for use.

また、上記設定部は、上記画像選択部により上記第3検査用画像が選択された際に、上記位置情報記憶部に記憶された上記第1検査用画像における非欠陥部または欠陥部の位置を示す位置情報と、上記第2検査用画像における非欠陥部または欠陥部の位置を示す位置情報とを読み出し、上記第3検査用画像における上記位置情報に対応する画素値を参照して上記非欠陥部とすべき画素値範囲を更新するように構成することができる。   In addition, when the third inspection image is selected by the image selection unit, the setting unit determines a position of a non-defective portion or a defective portion in the first inspection image stored in the position information storage unit. The position information indicating and the position information indicating the position of the non-defect portion or defect portion in the second inspection image are read, and the non-defect is referred to by referring to the pixel value corresponding to the position information in the third inspection image The pixel value range to be a part can be updated.

本発明によれば、異なる種別の欠陥の検出が可能な複数の検査用画像の中から、検査に用いるための検査用画像を表示部に表示した後、検査用画像を追加や変更した場合に、煩雑な設定作業を不要にしながら、追加や変更後の検査用画像を用いて欠陥検査を精度良く行うことができる。   According to the present invention, when an inspection image for use in inspection is displayed on the display unit from among a plurality of inspection images capable of detecting different types of defects, the inspection image is added or changed. In addition, it is possible to accurately perform defect inspection using the inspection image after addition or change, without requiring complicated setting work.

実施形態1に係る画像検査装置の運用状態を模式的に示す図である。It is a figure which shows typically the operation state of the image inspection apparatus which concerns on Embodiment 1. FIG. 実施形態1に係る画像検査装置のブロック図である。1 is a block diagram of an image inspection apparatus according to Embodiment 1. FIG. パターン光照明部の発光部の正面図である。It is a front view of the light emission part of a pattern light illumination part. 第1発光ダイオード列を示す図である。It is a figure which shows a 1st light emitting diode row | line | column. 第2発光ダイオード列を示す図である。It is a figure which shows a 2nd light emitting diode row | line | column. 照度分布の位相を90゜ずつ変化させた4種類のY方向パターン光の照射状態を示す図である。It is a figure which shows the irradiation state of four types of Y direction pattern light which changed the phase of illumination intensity distribution every 90 degrees. 照度分布の位相を90゜ずつ変化させた4種類のX方向パターン光の照射状態を示す図である。It is a figure which shows the irradiation state of four types of X direction pattern light which changed the phase of illumination intensity distribution every 90 degrees. ワークが円柱状の部材である場合の撮像部とパターン光照明部との位置関係を示す図である。It is a figure which shows the positional relationship of an imaging part and pattern light illumination part in case a workpiece | work is a cylindrical member. ワークが透光性を有する部材である場合の撮像部とパターン光照明部との位置関係を示す図である。It is a figure which shows the positional relationship of an imaging part and pattern light illumination part in case a workpiece | work is a member which has translucency. 照明設置方法選択用インターフェースを示す図である。It is a figure which shows the interface for illumination installation method selection. カメラ上下確認用インターフェースを示す図である。It is a figure which shows the interface for camera up-down confirmation. カメラ姿勢確認用インターフェースを示す図である。It is a figure which shows the interface for camera attitude | position confirmation. ワーク移動方向選択用インターフェースを示す図である。It is a figure which shows the interface for a workpiece | work moving direction selection. 照明方向選択用インターフェースを示す図である。It is a figure which shows the interface for illumination direction selection. ケーブル引き出し方向選択用インターフェースを示す図である。It is a figure which shows the interface for cable pull-out direction selection. 受光素子とパターン光照明部との位置関係情報を取得する際に照射する第1のパターン光及び第2のパターン光を示す図である。It is a figure which shows the 1st pattern light and 2nd pattern light irradiated when acquiring the positional relationship information of a light receiving element and a pattern light illumination part. 信号線が左方向に出るようにパターン光照明部が配置されている場合の第1画像及び第2画像を示す図である。It is a figure which shows the 1st image and 2nd image in case a pattern light illumination part is arrange | positioned so that a signal line may go out to the left direction. 信号線が上方向に出るようにパターン光照明部が配置されている場合の第1画像及び第2画像を示す図である。It is a figure which shows the 1st image and 2nd image in case a pattern light illumination part is arrange | positioned so that a signal line may go out upward. 信号線が下方向に出るようにパターン光照明部が配置されている場合の第1画像及び第2画像を示す図である。It is a figure which shows the 1st image and 2nd image in case a pattern light illumination part is arrange | positioned so that a signal line may go out below. 信号線が右方向に出るようにパターン光照明部が配置されている場合の第1画像及び第2画像を示す図である。It is a figure which shows the 1st image and 2nd image in case a pattern light illumination part is arrange | positioned so that a signal line may go out to the right direction. エリアカメラを使用した場合の受光素子とパターン光照明部との位置関係情報を取得する要領を説明する図である。It is a figure explaining the point which acquires the positional relationship information of a light receiving element and a pattern light illumination part at the time of using an area camera. 情報取得部の他の形態に係る撮像部及びパターン光照明部を示す図である。It is a figure which shows the imaging part and pattern light illumination part which concern on the other form of an information acquisition part. 方向選択用インターフェースを示す図である。It is a figure which shows the interface for direction selection. 検査用画像の生成手順を示すフローチャートである。It is a flowchart which shows the production | generation procedure of the image for a test | inspection. デフレクトメトリの原理を応用した検査用画像の生成手順を模式的に示す図である。It is a figure which shows typically the production | generation procedure of the image for an inspection which applied the principle of deflectometry. 実際の輝度画像の例を示す図である。It is a figure which shows the example of an actual luminance image. 簡易欠陥抽出の概念を模式的に示す図である。It is a figure which shows the concept of simple defect extraction typically. 欠陥抽出用インターフェースを示す図である。It is a figure which shows the interface for defect extraction. 検査用画像の一部を拡大して表示した場合の図25相当図である。FIG. 26 is a view corresponding to FIG. 25 when a part of the inspection image is enlarged and displayed. 欠陥部の強制抽出を行う場合の図25相当図である。FIG. 26 is a view corresponding to FIG. 25 in a case where a defective portion is forcibly extracted. しきい値設定時にヒストグラムとピンを表示させた例を示す図である。It is a figure which shows the example which displayed the histogram and the pin at the time of threshold value setting. 検査用画像の例を示す図である。It is a figure which shows the example of the image for a test | inspection. 各検査用画像に対するフィルタの適否を示す表である。It is a table | surface which shows the suitability of the filter with respect to each image for a test | inspection. フィルタ処理のパラメータ設定用インターフェースを示す図である。It is a figure which shows the parameter setting interface of a filter process. フィルタ処理前とフィルタ処理後の検査用画像の変化を示す図である。It is a figure which shows the change of the image for a test | inspection before a filter process and after a filter process. 背景選択を複数回行う場合のフローチャートである。It is a flowchart in the case of performing background selection a plurality of times. パターン光照明部と撮像部との位置関係が正しい場合と間違っている場合の検査用画像の例を示す図である。It is a figure which shows the example of the image for a test | inspection when the positional relationship of a pattern light illumination part and an imaging part is right and wrong. 撮像トリガ信号及び照明トリガ信号とエンコーダパルスとの関係を示すタイムチャートである。It is a time chart which shows the relationship between an imaging trigger signal and an illumination trigger signal, and an encoder pulse. パターン光照明部の電流制御部の回路構成の一部を示す図である。It is a figure which shows a part of circuit structure of the current control part of a pattern light illumination part. 電流制御部による電流値制御方法を説明する図である。It is a figure explaining the electric current value control method by an electric current control part. 実施形態2に係る画像検査装置のブロック図である。6 is a block diagram of an image inspection apparatus according to Embodiment 2. FIG. 実施形態3に係る画像検査装置のブロック図である。FIG. 6 is a block diagram of an image inspection apparatus according to a third embodiment. エッジ生成方法を示すフローチャートである。It is a flowchart which shows the edge production | generation method. エッジ上にポインタを置いた状態を示す検査用画像である。It is an image for a test | inspection which shows the state which put the pointer on the edge. 初期座標を表示した状態を示す検査用画像である。It is an image for a test | inspection which shows the state which displayed the initial coordinate. セグメントを形成してエッジ位置を求める方法を模式的に示す図である。It is a figure which shows typically the method of forming a segment and calculating | requiring an edge position. セグメント内の画素を投影してエッジ位置を求める方法を模式的に示す図である。It is a figure which shows typically the method of projecting the pixel in a segment and calculating | requiring an edge position. 連結処理を実行して輪郭を特定した状態を示す図である。It is a figure which shows the state which performed the connection process and specified the outline. 2つの輪郭が接近している場合の連結処理方法を示す図である。It is a figure which shows the connection processing method when two outlines are approaching. 2つの輪郭が接近している場合の別の連結処理方法を示す図である。It is a figure which shows another connection processing method when two outlines are approaching. 輪郭の曲率が小さい場合の処理方法を示す図である。It is a figure which shows the processing method when the curvature of an outline is small. 検査対象物がビード等である場合を示す図である。It is a figure which shows the case where a test target object is a bead etc. FIG. 両側の輪郭特定方法を示すフローチャートである。It is a flowchart which shows the outline identification method of both sides. 両側の輪郭特定方法において制御点P0を求める方法を模式的に示す図である。It is a figure which shows typically the method of calculating | requiring the control point P0 in the outline identification method of both sides. 両側の輪郭特定方法においてセグメントを形成してエッジ位置を求める方法を模式的に示す図である。It is a figure which shows typically the method of forming a segment in the outline identification method of both sides, and calculating | requiring an edge position. 実施形態4に係る画像検査装置のブロック図である。FIG. 10 is a block diagram of an image inspection apparatus according to a fourth embodiment. ワークの一部を検査対象領域とする手順を説明する図である。It is a figure explaining the procedure which makes a part of workpiece | work the inspection object area | region. ワークのほぼ全部を検査対象領域とする手順を説明する図である。It is a figure explaining the procedure which makes almost the whole workpiece | work the inspection object area | region. 複数の部分検査用画像を撮像して検査対象領域を設定する手順を説明する図である。It is a figure explaining the procedure which captures the image for a some partial test | inspection, and sets a test | inspection area | region. 実施形態の変形例1に係る図2相当図である。It is FIG. 2 equivalent view which concerns on the modification 1 of embodiment. 実施形態の変形例2に係る図2相当図である。It is FIG. 2 equivalent view which concerns on the modification 2 of embodiment. 実施形態の変形例3に係る図2相当図である。It is FIG. 2 equivalent figure which concerns on the modification 3 of embodiment.

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

(実施形態1)
(画像検査装置1の全体構成)
図1は、本発明の実施形態に係る画像検査装置1の運用状態を模式的に示すものである。画像検査装置1は、一方向に移動するワークW(検査対象物)を撮像した画像を用いてワークWの欠陥を検査するように構成されており、具体的には、複数のパターン光をワークWに対して照射するパターン光照明を実行するパターン光照明部2と、撮像部3と、制御ユニット4と、表示部5と、キーボード6及びマウス7とを少なくとも備えているが、これら以外の機器を備えることもできる。たとえば、制御ユニット4には、プログラマブル・ロジック・コントローラ(PLC)等からなる外部制御機器8が接続されている。この外部制御機器8は、画像検査装置1の一部を構成するものとしてもよい。また、外部制御機器8は、画像検査装置1の構成要素としなくてもよい。
(Embodiment 1)
(Overall configuration of image inspection apparatus 1)
FIG. 1 schematically shows an operational state of an image inspection apparatus 1 according to an embodiment of the present invention. The image inspection apparatus 1 is configured to inspect defects of the workpiece W using an image obtained by imaging the workpiece W (inspection target) moving in one direction. Specifically, the image inspection apparatus 1 applies a plurality of pattern lights to the workpiece. Although it comprises at least a pattern light illumination unit 2 that executes pattern light illumination to irradiate W, an imaging unit 3, a control unit 4, a display unit 5, a keyboard 6, and a mouse 7, other than these Equipment can also be provided. For example, an external control device 8 composed of a programmable logic controller (PLC) or the like is connected to the control unit 4. The external control device 8 may constitute a part of the image inspection apparatus 1. The external control device 8 may not be a component of the image inspection apparatus 1.

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

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

画像検査装置1は、ワークWの外観検査、即ちワークWの表面の傷、汚れ、打痕等の欠陥の有無を検査する場合に使用することができるものである。画像検査装置1は、その運用時において、外部制御機器8から信号線を介して、欠陥検査の開始タイミングを規定する検査開始トリガ信号を受信する。画像検査装置1は、この検査開始トリガ信号に基づいてワークWの撮像及び照明等を行って所定の処理後、検査用画像を得る。その後、検査結果は、信号線を介して外部制御機器8へ送信される。このように、画像検査装置1の運用時には、画像検査装置1と外部制御機器8との間で、信号線を介して検査開始トリガ信号の入力と検査結果の出力が繰り返し行われる。なお、検査開始トリガ信号の入力や検査結果の出力は、上述したように、画像検査装置1と外部制御機器8との間の信号線を介して行ってもよいし、それ以外の図示しない信号線を介して行ってもよい。例えば、ワークWの到着を検知するためのセンサと画像検査装置1とを直接的に接続し、そのセンサから画像検査装置1へ検査開始トリガ信号を入力するようにしてもよい。   The image inspection apparatus 1 can be used for appearance inspection of the workpiece W, that is, when inspecting the surface of the workpiece W for defects such as scratches, dirt, and dents. During operation, the image inspection apparatus 1 receives an inspection start trigger signal that defines the start timing of defect inspection from the external control device 8 via a signal line. The image inspection apparatus 1 captures and illuminates the workpiece W based on the inspection start trigger signal, and obtains an inspection image after predetermined processing. Thereafter, the inspection result is transmitted to the external control device 8 through the signal line. As described above, when the image inspection apparatus 1 is operated, the input of the inspection start trigger signal and the output of the inspection result are repeatedly performed between the image inspection apparatus 1 and the external control device 8 through the signal line. Note that the inspection start trigger signal and the inspection result may be input via the signal line between the image inspection apparatus 1 and the external control device 8 as described above, or other signals (not shown). It may be done via a line. For example, a sensor for detecting the arrival of the workpiece W and the image inspection apparatus 1 may be directly connected, and an inspection start trigger signal may be input from the sensor to the image inspection apparatus 1.

また、画像検査装置1は、専用のハードウェアで構成する他、汎用の機器にソフトウェアをインストールしたもの、たとえば汎用もしくは専用のコンピュータに画像検査プログラムをインストールした構成としてもよい。以下の例では、グラフィックボードなどのハードウェアを画像検査処理に特化させた専用のコンピュータに、画像検査プログラムをインストールした構成とした場合について説明する。   The image inspection apparatus 1 may be configured by dedicated hardware, or may be configured by installing software in a general-purpose device, for example, by installing an image inspection program in a general-purpose or dedicated computer. In the following example, a case in which an image inspection program is installed in a dedicated computer that specializes hardware such as a graphic board for image inspection processing will be described.

(パターン光照明部2の構成)
パターン光照明部2は、周期的な照度分布を有するパターン光をワークWに照射するためのものであり、たとえば複数の発光ダイオード、液晶パネル、有機ELパネル、デジタルマイクロミラーデバイス(DMD)等で構成することができ、単に照明部と呼ぶこともできる。液晶パネル、有機ELパネル、DMDについては図示しないが、従来から周知の構造のものを用いることができる。パターン光照明部2は、制御ユニット4に対して信号線100aを介して接続されており、撮像部3及び制御ユニット4から離して設置することができるようになっている。
(Configuration of pattern light illumination unit 2)
The pattern light illumination unit 2 is for irradiating the workpiece W with pattern light having a periodic illuminance distribution. For example, a plurality of light emitting diodes, liquid crystal panels, organic EL panels, digital micromirror devices (DMD), etc. It can be configured and can also be simply referred to as an illumination unit. Although a liquid crystal panel, an organic EL panel, and a DMD are not shown, those having a conventionally known structure can be used. The pattern light illumination unit 2 is connected to the control unit 4 via a signal line 100a, and can be installed apart from the imaging unit 3 and the control unit 4.

パターン光照明部2に複数の発光ダイオードを用いる場合には、複数の発光ダイオードをドットマトリクス状に配置して電流値制御によって周期的な照度分布を有するパターン光を生成することができる。液晶パネル及び有機ELパネルの場合は、各パネルを制御することで各パネルから照射される光が周期的な照度分布を有するパターン光となるようにすることができる。デジタルマイクロミラーデバイスの場合は、内蔵された微小鏡面を制御することで周期的な照度分布を有するパターン光を生成して照射することができる。尚、パターン光照明部2の構成は上述したものに限られるものではなく、周期的な照度分布を有するパターン光を生成することができる機器や装置等であれば使用することができる。   In the case where a plurality of light emitting diodes are used for the pattern light illuminating unit 2, it is possible to generate a pattern light having a periodic illuminance distribution by arranging a plurality of light emitting diodes in a dot matrix and controlling the current value. In the case of a liquid crystal panel and an organic EL panel, by controlling each panel, the light emitted from each panel can be a pattern light having a periodic illuminance distribution. In the case of a digital micromirror device, pattern light having a periodic illuminance distribution can be generated and irradiated by controlling a built-in micromirror surface. In addition, the structure of the pattern light illumination part 2 is not restricted to what was mentioned above, If it is an apparatus, an apparatus, etc. which can produce | generate the pattern light which has periodic illumination intensity distribution, it can be used.

以下、パターン光照明部2に複数の発光ダイオードを用いる場合について詳細に説明する。この場合、パターン光照明部2は、2次元状に配置された複数の発光ダイオード20、21を基板23aに実装してなる発光部23(図3に示す)と、発光ダイオード20、21から照射された光を拡散させる拡散部材24(図1、図5A、図5Bに示す)とを備えている。発光部23は全体として略矩形状をなしている。発光部23の発光面は、該発光部23のX方向の中央部を通ってY方向に延びる仮想区画線J1と、発光部23のY方向の中央部を通ってX方向に延びる仮想区画線J2とによって仮想的に第1〜第4領域S1〜S4に分けることができるようになっている。第1〜第4領域S1〜S4は全て同じ大きさの略矩形状である。各領域S1〜S4をブロックと呼ぶこともでき、1ブロックは、LEDが12個×12列×2方向からなる。   Hereinafter, the case where a plurality of light emitting diodes are used in the pattern light illumination unit 2 will be described in detail. In this case, the pattern light illumination unit 2 emits light from the light emitting unit 23 (shown in FIG. 3) in which a plurality of light emitting diodes 20 and 21 arranged in a two-dimensional manner are mounted on the substrate 23a, and the light emitting diodes 20 and 21. A diffusing member 24 (shown in FIGS. 1, 5A, and 5B) for diffusing the emitted light is provided. The light emitting unit 23 has a substantially rectangular shape as a whole. The light emitting surface of the light emitting unit 23 includes a virtual dividing line J1 extending in the Y direction through the central portion in the X direction of the light emitting unit 23, and a virtual dividing line extending in the X direction through the central portion in the Y direction of the light emitting unit 23. J2 can be virtually divided into first to fourth regions S1 to S4. The first to fourth regions S1 to S4 are all substantially rectangular with the same size. Each region S1 to S4 can also be called a block, and one block is composed of 12 LEDs × 12 rows × 2 directions.

第1領域S1には、図4Aに示すようにY方向に等間隔に並ぶように配置されて直列接続された複数の発光ダイオード20からなる12列の第1発光ダイオード列A1〜A12と、図4Bに示すようにX方向に等間隔に並ぶように配置されて直列接続された複数の発光ダイオード21からなる12列の第2発光ダイオード列B1〜B12とが形成されている。図3に示すように、第1領域S1における第1発光ダイオード列A1〜A12の並び方向はX方向であり、互いに平行に配置されている。各第1発光ダイオード列A1〜A12には、個別に電力が供給されるようになっている。   In the first region S1, as shown in FIG. 4A, twelve first light-emitting diode rows A1 to A12 including a plurality of light-emitting diodes 20 arranged in series at equal intervals in the Y direction, As shown in 4B, 12 rows of second light emitting diode rows B1 to B12 made up of a plurality of light emitting diodes 21 arranged in series at equal intervals in the X direction are formed. As shown in FIG. 3, the arrangement direction of the first light emitting diode rows A1 to A12 in the first region S1 is the X direction, and they are arranged in parallel to each other. Electric power is individually supplied to each of the first light emitting diode rows A1 to A12.

図3に示すように、第1領域S1における第2発光ダイオード列B1〜B12の並び方向はY方向であり、互いに平行に配置されている。各第2発光ダイオード列B1〜B12には、個別に電力が供給されるようになっている。   As shown in FIG. 3, the arrangement direction of the second light emitting diode rows B1 to B12 in the first region S1 is the Y direction, and they are arranged in parallel to each other. Electric power is individually supplied to each of the second light emitting diode rows B1 to B12.

第1発光ダイオード列A1〜A12及び第2発光ダイオード列B1〜B12は、第1領域S1内で互いに交差するように配置されることになる。第1発光ダイオード列A1〜A12を構成する発光ダイオード20と、第2発光ダイオード列B1〜B12を構成する発光ダイオード21とが、光の照射方向には重ならないように配置されている。これにより、第1領域S1内で複数の発光ダイオード20、21がドットマトリクス状に配置されることになる。   The first light emitting diode rows A1 to A12 and the second light emitting diode rows B1 to B12 are arranged so as to cross each other in the first region S1. The light emitting diodes 20 constituting the first light emitting diode rows A1 to A12 and the light emitting diodes 21 constituting the second light emitting diode rows B1 to B12 are arranged so as not to overlap in the light irradiation direction. As a result, the plurality of light emitting diodes 20 and 21 are arranged in a dot matrix in the first region S1.

12個の発光ダイオード20、21を直列に接続して各列A1〜A12、B1〜B12を構成しているので、発光ダイオード20、21毎に制御線を設けることなく、制御線は各列に1組で済む。また、第2領域S2、第3領域S3及び第4領域S4の各領域も第1領域S1と同様に、第1発光ダイオード列A1〜A12及び第2発光ダイオード列B1〜B12が互いに交差するように配置されている。つまり、この実施形態では、発光ダイオード20、21の数を増やして発光部23の光源を緻密に配置しながら、制御対象となる発光ダイオード列は、第1領域S1の第1発光ダイオード列A1〜A12及び第2発光ダイオード列B1〜B12と、第2領域S2の第1発光ダイオード列A1〜A12及び第2発光ダイオード列B1〜B12と、第3領域S3の第1発光ダイオード列A1〜A12及び第2発光ダイオード列B1〜B12と、第4領域S4の第1発光ダイオード列A1〜A12及び第2発光ダイオード列B1〜B12の合計96列分(12列×2×4領域)の制御で済む。   Since twelve light emitting diodes 20 and 21 are connected in series to form each column A1 to A12 and B1 to B12, a control line is provided in each column without providing a control line for each light emitting diode 20 and 21. One set is enough. Similarly to the first region S1, the first light emitting diode rows A1 to A12 and the second light emitting diode rows B1 to B12 intersect each other in the second region S2, the third region S3, and the fourth region S4. Is arranged. That is, in this embodiment, while increasing the number of the light emitting diodes 20 and 21 and arranging the light sources of the light emitting unit 23 densely, the light emitting diode rows to be controlled are the first light emitting diode rows A1 to A1 in the first region S1. A12 and the second light emitting diode rows B1 to B12, the first light emitting diode rows A1 to A12 and the second light emitting diode rows B1 to B12 in the second region S2, the first light emitting diode rows A1 to A12 in the third region S3, and The total of 96 columns (12 columns × 2 × 4 regions) of the second light emitting diode columns B1 to B12 and the first light emitting diode columns A1 to A12 and the second light emitting diode columns B1 to B12 in the fourth region S4 are sufficient. .

第1領域S1の第2発光ダイオード列B1〜B12と、第2領域S2の第2発光ダイオード列B1〜B12とは、それぞれ、X方向に延びる同一直線上に並ぶように配置されている。第3領域S3の第2発光ダイオード列B1〜B12と、第4領域S4の第2発光ダイオード列B1〜B12とは、それぞれ、X方向に延びる同一直線上に並ぶように配置されている。   The second light emitting diode rows B1 to B12 in the first region S1 and the second light emitting diode rows B1 to B12 in the second region S2 are arranged so as to be aligned on the same straight line extending in the X direction. The second light emitting diode rows B1 to B12 in the third region S3 and the second light emitting diode rows B1 to B12 in the fourth region S4 are arranged so as to be aligned on the same straight line extending in the X direction.

また、第1領域S1の第1発光ダイオード列A1〜A12と、第3領域S2の第1発光ダイオード列A1〜A12とは、それぞれ、Y方向に延びる同一直線上に並ぶように配置されている。第2領域S2の第1発光ダイオード列A1〜A12と、第4領域S4の第1発光ダイオード列A1〜A12とは、それぞれ、Y方向に延びる同一直線上に並ぶように配置されている。   The first light emitting diode rows A1 to A12 in the first region S1 and the first light emitting diode rows A1 to A12 in the third region S2 are arranged so as to be aligned on the same straight line extending in the Y direction. . The first light emitting diode rows A1 to A12 in the second region S2 and the first light emitting diode rows A1 to A12 in the fourth region S4 are arranged so as to be aligned on the same straight line extending in the Y direction.

図5A、図5B等に示す拡散部材24は、第1〜第4領域S1〜S4の発光ダイオード20、21の全てを覆うことができるように配置された透光性板材で構成されている。拡散部材24を構成する板材は周知のものを用いることができ、入射した光を拡散させて出射させることができる。   The diffusion member 24 shown in FIG. 5A, FIG. 5B, and the like is made of a translucent plate material arranged so as to cover all of the light emitting diodes 20 and 21 in the first to fourth regions S1 to S4. As the plate material constituting the diffusing member 24, a known material can be used, and incident light can be diffused and emitted.

第1〜第4領域S1〜S4の第1発光ダイオード列A1〜A12及び第2発光ダイオード列B1〜B12に流す電流値を個別に制御することで、図5Aに示すようにY方向に照度が変化してX方向には照度が均一なY方向パターン光と、図5Bに示すようにX方向に照度が変化してY方向には照度が均一なX方向パターン光とを生成することができる。発光ダイオード20、21が上述のようにドットマトリクス状に配置されているので、発光部23においては、光源が点状に配置されることになるが、拡散部材24を設けることで、各発光ダイオード20、21の光が拡散して外部に照射されることになり、各図に示すように外部から見ると照度が徐々に変化したパターン光にすることができる。   By individually controlling the current values passed through the first light emitting diode rows A1 to A12 and the second light emitting diode rows B1 to B12 in the first to fourth regions S1 to S4, the illuminance is increased in the Y direction as shown in FIG. 5A. It is possible to generate Y direction pattern light with uniform illuminance in the X direction and X direction pattern light with uniform illuminance in the Y direction as shown in FIG. 5B. . Since the light emitting diodes 20 and 21 are arranged in a dot matrix as described above, the light source is arranged in a dot shape in the light emitting unit 23, but each light emitting diode is provided by providing the diffusing member 24. The light of 20, 21 is diffused and applied to the outside, and as shown in each figure, when viewed from the outside, the pattern light with the illuminance gradually changed can be obtained.

また、各発光ダイオード20、21の制御としては、たとえばPWM制御や電流値による制御(電流値制御)があるが、電流値制御とするのが特に好ましい。電流値制御とすることで、発光ダイオード20、21が持っている応答速度の速さを十分に活かした素早い照度変化を実現でき、たとえば、あるパターン光を別のパターン光に切り替える時間間隔を2μ秒程度の短い間隔にすることができる。   The light emitting diodes 20 and 21 may be controlled by, for example, PWM control or current value control (current value control), and current value control is particularly preferable. By controlling the current value, it is possible to realize a quick change in illuminance that fully utilizes the speed of response of the light emitting diodes 20 and 21. For example, a time interval for switching one pattern light to another pattern light is 2 μm. The interval can be as short as 2 seconds.

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

図5Aに示すY方向パターン光の場合、明暗がY方向に変化しているので、縞模様がY方向に繰り返されるパターン光という表現とすることもできる。Y方向パターン光を生成する場合に、照度分布の位相をY方向にシフトさせることにより、照度分布の位相が異なった複数のY方向パターン光を生成することができる。Y方向パターン光の照度分布をsin波形に近似した波形で表すこともでき、この場合、たとえば位相を90゜ずつ変化させて、0゜の場合のY方向パターン光、90゜の場合のY方向パターン光、180゜の場合のY方向パターン光、270゜の場合のY方向パターン光を生成することができる。   In the case of the Y-direction pattern light shown in FIG. 5A, since the brightness changes in the Y direction, it can also be expressed as pattern light in which the stripe pattern is repeated in the Y direction. When generating the Y direction pattern light, a plurality of Y direction pattern lights having different illuminance distribution phases can be generated by shifting the phase of the illuminance distribution in the Y direction. The illuminance distribution of the Y direction pattern light can also be represented by a waveform that approximates a sine waveform. In this case, for example, the phase is changed by 90 °, the Y direction pattern light at 0 °, and the Y direction at 90 °. Pattern light, Y direction pattern light at 180 °, and Y direction pattern light at 270 ° can be generated.

また、図5Bに示すX方向パターン光の場合、明暗がX方向に変化しているので、縞模様がX方向に繰り返されるパターン光という表現とすることもできる。X方向パターン光を生成する場合に、照度分布の位相をX方向にシフトさせることにより、照度分布の位相が異なった複数のX方向パターン光を生成することができる。X方向パターン光の照度分布をsin波形に近似した波形で表すこともでき、この場合、たとえば位相を90゜ずつ変化させて、0゜の場合のX方向パターン光、90゜の場合のX方向パターン光、180゜の場合のX方向パターン光、270゜の場合のX方向パターン光を生成することができる。つまり、パターン光照明部2は、異なる照明態様でワークWを照明することができる。   Further, in the case of the X direction pattern light shown in FIG. 5B, since the brightness changes in the X direction, it can also be expressed as a pattern light in which the stripe pattern is repeated in the X direction. When generating the X direction pattern light, by shifting the phase of the illuminance distribution in the X direction, a plurality of X direction pattern lights having different illuminance distribution phases can be generated. The illuminance distribution of the X direction pattern light can also be represented by a waveform approximating a sin waveform. In this case, for example, the phase is changed by 90 ° to change the X direction pattern light at 0 °, and the X direction at 90 °. Pattern light, X direction pattern light at 180 °, and X direction pattern light at 270 ° can be generated. That is, the pattern light illumination unit 2 can illuminate the workpiece W in different illumination modes.

後述するデフレクトメトリ処理を行う場合、ワークWに照射するパターン光はsin波形だけでなく、三角波等のパターン光でも可能である。   When performing a later-described deflectometry process, the pattern light applied to the workpiece W can be not only a sin waveform but also a pattern light such as a triangular wave.

また、発光部23の一辺の長さは、たとえば100mmに設定することができる。100mm四方の内側に発光ダイオード20、21が縦24個、横24個配置されることになる。発光ダイオード20、21を電流値制御することで、高速にかつ高階調のパターン光を生成することができる。尚、発光部23の一辺の長さ、発光ダイオード20、21の数、列の数、発光部23の領域の数は一例であり、特に限定されるものではない。パターン光の照度分布をsin波形に近似した波形で表すことができる場合、発光部23の一辺の長さをsin波形の一波長分とすることができる。   Further, the length of one side of the light emitting unit 23 can be set to 100 mm, for example. Inside the 100 mm square, 24 light emitting diodes 20 and 21 are arranged 24 in length and 24 in width. By controlling the current value of the light emitting diodes 20 and 21, pattern light with high gradation and high gradation can be generated. The length of one side of the light emitting unit 23, the number of light emitting diodes 20 and 21, the number of columns, and the number of regions of the light emitting unit 23 are merely examples, and are not particularly limited. When the illuminance distribution of the pattern light can be represented by a waveform that approximates a sin waveform, the length of one side of the light emitting unit 23 can be set to one wavelength of the sin waveform.

(撮像部3の構成)
図2に示すように、撮像部3は、ライン状に配列された複数の受光素子3aを有するとともに該受光素子3aの配列方向がワークWの移動方向(Y方向)と直交する方向(X方向)となるように設置可能なラインカメラ31と、集光系光学系32とを有している。受光素子3aは、集光系光学系32を通して得られた光の強度を電気信号に変換するCCD(charge-coupled device)やCMOS(complementary metal oxide semiconductor)等の撮像素子からなるイメージセンサである。集光系光学系32は、外部から入射する光を集光するための光学系であり、典型的には一以上の光学レンズを有している。
(Configuration of the imaging unit 3)
As shown in FIG. 2, the imaging unit 3 includes a plurality of light receiving elements 3a arranged in a line, and the direction in which the light receiving elements 3a are arranged is orthogonal to the moving direction (Y direction) of the workpiece W (X direction). ) And a condensing optical system 32. The light receiving element 3a is an image sensor composed of an imaging element such as a CCD (charge-coupled device) or a CMOS (complementary metal oxide semiconductor) that converts the intensity of light obtained through the condensing system optical system 32 into an electric signal. The condensing system optical system 32 is an optical system for condensing light incident from the outside, and typically includes one or more optical lenses.

撮像部3は、制御ユニット4に対して、パターン光照明部2の信号線100aとは別の信号線100bを介して接続されており、パターン光照明部2及び制御ユニット4から離して設置することができるようになっている。つまり、撮像部3は、パターン光照明部2とは独立して設置可能に構成されている。パターン光照明部2の信号線100aから撮像部3の信号線100bを分岐させてもよい。   The imaging unit 3 is connected to the control unit 4 via a signal line 100 b different from the signal line 100 a of the pattern light illumination unit 2, and is installed away from the pattern light illumination unit 2 and the control unit 4. Be able to. That is, the imaging unit 3 is configured to be installed independently of the pattern light illumination unit 2. The signal line 100 b of the imaging unit 3 may be branched from the signal line 100 a of the pattern light illumination unit 2.

撮像部3には、制御ユニット4の制御部41から送信される撮像トリガ信号が信号線100bを介して入力されるようになっている。撮像部3は、撮像トリガ信号を受信したら、その都度、撮像を実行するように構成されている。撮像トリガ信号については後述する。   An imaging trigger signal transmitted from the control unit 41 of the control unit 4 is input to the imaging unit 3 via the signal line 100b. The imaging unit 3 is configured to perform imaging every time an imaging trigger signal is received. The imaging trigger signal will be described later.

図1に示すように、平面形のワークWの場合、パターン光照明部2からワークWの表面に向けて照射されたパターン光が該ワークWの表面で反射して撮像部3の集光系光学系32に入射するように、撮像部3とパターン光照明部2との位置関係を設定することができる。   As shown in FIG. 1, in the case of a planar work W, the pattern light irradiated from the pattern light illumination unit 2 toward the surface of the work W is reflected by the surface of the work W and the light collecting system of the imaging unit 3. The positional relationship between the imaging unit 3 and the pattern light illumination unit 2 can be set so as to enter the optical system 32.

また、図6Aに示すように、ワークWが円柱状の部材である場合にも、パターン光照明部2からワークWの表面に向けて照射されたパターン光が該ワークWの表面で反射して撮像部3の集光系光学系32に入射するように、撮像部3とパターン光照明部2との位置関係を設定することができる。   As shown in FIG. 6A, even when the workpiece W is a cylindrical member, the pattern light irradiated from the pattern light illumination unit 2 toward the surface of the workpiece W is reflected by the surface of the workpiece W. The positional relationship between the imaging unit 3 and the pattern light illumination unit 2 can be set so as to be incident on the condensing system optical system 32 of the imaging unit 3.

また、図6Bに示すように、ワークWが透明フィルムやシートのように透光性を有する部材である場合、パターン光照明部2からワークWの表面に向けて照射されたパターン光が該ワークWを透過して撮像部3の集光系光学系32に入射するように、撮像部3とパターン光照明部2との位置関係を設定することができる。   In addition, as shown in FIG. 6B, when the workpiece W is a transparent member such as a transparent film or sheet, the pattern light irradiated from the pattern light illumination unit 2 toward the surface of the workpiece W is the workpiece W. The positional relationship between the imaging unit 3 and the pattern light illumination unit 2 can be set so that the light passes through W and enters the condensing optical system 32 of the imaging unit 3.

上記したいずれの場合も、ワークWの表面で反射した正反射成分が撮像部3の集光系光学系32に入射するように、パターン光照明部2と撮像部3とを配置する。   In any of the above cases, the pattern light illumination unit 2 and the imaging unit 3 are arranged so that the regular reflection component reflected by the surface of the workpiece W is incident on the condensing optical system 32 of the imaging unit 3.

図1に示す撮像部3とパターン光照明部2との位置関係及び図6Aに示す撮像部3とパターン光照明部2との位置関係は、それぞれ、パターン光照明部2から照射されてワークWで反射されたパターン光をラインカメラ31の受光素子3aが受光する反射光受光の位置関係である。   The positional relationship between the imaging unit 3 and the pattern light illuminating unit 2 shown in FIG. 1 and the positional relationship between the imaging unit 3 and the pattern light illuminating unit 2 shown in FIG. The light receiving element 3a of the line camera 31 receives the pattern light reflected by the reflected light receiving positional relationship.

一方、図6Bに示す撮像部3とパターン光照明部2との位置関係は、パターン光照明部2から照射されて検査対象物を透過したパターン光をラインカメラ31の受光素子3aが受光する透過光受光の位置関係である。この場合、パターン光の反射回数は0回になる。   On the other hand, the positional relationship between the imaging unit 3 and the pattern light illumination unit 2 shown in FIG. 6B is such that the light receiving element 3a of the line camera 31 receives the pattern light irradiated from the pattern light illumination unit 2 and transmitted through the inspection object. This is the positional relationship of light reception. In this case, the number of pattern light reflections is zero.

反射光受光の位置関係ではパターン光の反射回数は1回になり、透過光受光の位置関係ではパターン光の反射回数は0回になる。また、撮像部3にラインカメラ31ではなく、エリアカメラ(受光素子がX方向とY方向に並ぶように配置されたカメラ)を用いることもでき、このエリアカメラの場合は、同軸照明という形態も可能である。この場合、反射光設置とするのにハーフミラーでの反射が加わるため、反射回数は2回となる。、パターン光の反射回数を使用者に入力させることによって、反射光受光の位置関係にあるか否か、透過光受光の位置関係にあるか否かを判定することもできる。   The number of reflections of the pattern light is one in the positional relationship of the reflected light reception, and the number of reflections of the pattern light is zero in the positional relationship of the transmitted light reception. Further, instead of the line camera 31, an area camera (a camera in which the light receiving elements are arranged in the X direction and the Y direction) can be used for the imaging unit 3. In the case of this area camera, a form of coaxial illumination is also possible. Is possible. In this case, since reflection by a half mirror is added to the reflected light installation, the number of reflections is two. By allowing the user to input the number of times the pattern light is reflected, it is possible to determine whether or not the reflected light is in a positional relationship and whether or not the transmitted light is in a positional relationship.

図2に示すように、撮像部3には、LEDポインタ34が設けられている。LEDポインタ34は、集光系光学系32の軸方向にポインタ光を照射するためのものであり、制御ユニット4からの制御信号によって照射状態と非照射状態とに切り替えることもできるように構成されている。ポインタ光の照射形態の例としては、たとえば図8に示すように、ラインカメラ31の上下方向を確認するための形態にすることができる。図8では、ラインカメラ31の上側と下側とにポインタ光をそれぞれ照射し、上側を連続点灯、下側を点滅させている。ポインタ光はどのような形態であってよく、たとえば文字等をポインタ光とすることもできる。ラインカメラ31を受光側から見て受光素子3aの配列方向と直交する方向をラインカメラ31の上下方向とすることができる。   As shown in FIG. 2, the imaging unit 3 is provided with an LED pointer 34. The LED pointer 34 is for irradiating the pointer light in the axial direction of the condensing system optical system 32 and is configured to be switched between an irradiation state and a non-irradiation state by a control signal from the control unit 4. ing. As an example of the irradiation form of the pointer light, for example, as shown in FIG. 8, a form for confirming the vertical direction of the line camera 31 can be used. In FIG. 8, pointer light is irradiated to the upper side and the lower side of the line camera 31, respectively, and the upper side is continuously lit and the lower side is blinked. The pointer light may have any form. For example, a character or the like may be used as the pointer light. The direction perpendicular to the arrangement direction of the light receiving elements 3 a when the line camera 31 is viewed from the light receiving side can be set as the vertical direction of the line camera 31.

また、図2に示すように、撮像部3には、重力加速度を検出する重力加速度センサ35が設けられている。重力加速度センサ35は、撮像部3の姿勢(集光系光学系32の軸方向と水平面とのなす角度、集光系光学系32の軸方向と鉛直面とのなす角度等)を把握するためのものであり、重力加速度センサ35の出力値を利用して従来から周知の手法に従って撮像部3の姿勢をほぼリアルタイムで得ることができる。   As shown in FIG. 2, the imaging unit 3 is provided with a gravitational acceleration sensor 35 that detects gravitational acceleration. The gravitational acceleration sensor 35 grasps the posture of the imaging unit 3 (an angle formed between the axial direction of the condensing optical system 32 and the horizontal plane, an angle formed between the axial direction of the condensing optical system 32 and the vertical plane, etc.). By using the output value of the gravitational acceleration sensor 35, the posture of the imaging unit 3 can be obtained almost in real time according to a conventionally known method.

(表示部5の構成)
表示部5は、たとえば有機ELディスプレイや液晶ディスプレイ等からなるものである。表示部5は、制御ユニット4に接続され、たとえば、撮像部3で撮像された画像、撮像部3で撮像した画像に基づいて生成された各種画像、ワークWの欠陥検査結果、操作用のインターフェース、各種設定用のインターフェース、設定値等を表示させることができるように構成されている。表示部5には、一度に複数の検査用画像等を表示させることもできるようになっている。
(Configuration of display unit 5)
The display part 5 consists of an organic EL display, a liquid crystal display, etc., for example. The display unit 5 is connected to the control unit 4. For example, the image captured by the imaging unit 3, various images generated based on the image captured by the imaging unit 3, the defect inspection result of the workpiece W, and an operation interface It is configured so that various setting interfaces, setting values, and the like can be displayed. The display unit 5 can also display a plurality of inspection images and the like at a time.

表示部5をタッチパネルとすることで、表示部5に各種情報の入力機能を持たせることができる。   By using the display unit 5 as a touch panel, the display unit 5 can have various information input functions.

(キーボード6及びマウス7の構成)
キーボード6及びマウス7は、従来から周知のコンピュータ操作用の機器であり、制御ユニット4が有する入力情報受付部44(図2に示す)に接続されている。キーボード6またはマウス7の操作により、各種情報を制御ユニット4に入力することができるとともに、表示部5に表示されている画像等を選択することができる。
(Configuration of keyboard 6 and mouse 7)
The keyboard 6 and the mouse 7 are conventionally well-known devices for computer operation, and are connected to an input information receiving unit 44 (shown in FIG. 2) of the control unit 4. Various information can be input to the control unit 4 by operating the keyboard 6 or the mouse 7, and an image or the like displayed on the display unit 5 can be selected.

具体的には、キーボード6またはマウス7の操作により、ラインカメラ31の受光素子3aの配列方向に対するワークWの移動方向に関する移動方向情報と、ラインカメラ31の受光素子3aとパターン光照明部2との位置関係に関する位置関係情報とを入力情報受付部44に入力すると、入力情報受付部44が入力された移動方向情報及び位置関係情報を受け付けることができるようになっている。キーボード6、マウス7及び入力情報受付部44は、本発明の情報取得部9である。   Specifically, by operating the keyboard 6 or the mouse 7, movement direction information regarding the moving direction of the workpiece W with respect to the arrangement direction of the light receiving elements 3 a of the line camera 31, the light receiving elements 3 a of the line camera 31, and the pattern light illumination unit 2 When the positional relationship information regarding the positional relationship is input to the input information receiving unit 44, the input information receiving unit 44 can receive the input movement direction information and positional relationship information. The keyboard 6, the mouse 7, and the input information reception unit 44 are the information acquisition unit 9 of the present invention.

移動方向情報は、図1に例示しているワークWの移動方向であり、白抜きの矢印の方向か、白抜きの矢印とは反対方向かのいずれかとすることができる。この移動方向情報には、ラインカメラ31を受光側から見て受光素子3aの配列方向と直交する方向をラインカメラ31の上下方向としたとき、ラインカメラ31の上下方向と、ワークWの移動方向とを含むことができる。また、位置関係情報は、上述した反射光受光の位置関係と、透過光受光の位置関係とを含んでいる。   The moving direction information is the moving direction of the workpiece W illustrated in FIG. 1 and can be either the direction of a white arrow or the direction opposite to the white arrow. The movement direction information includes the vertical direction of the line camera 31 and the movement direction of the workpiece W when the direction perpendicular to the arrangement direction of the light receiving elements 3a when the line camera 31 is viewed from the light receiving side is defined as the vertical direction of the line camera 31. Can be included. The positional relationship information includes the above-described positional relationship of reflected light reception and the positional relationship of transmitted light reception.

尚、キーボード6及びマウス7の代わり、またはキーボード6及びマウス7に加えて、たとえば、音声入力機器、タッチ操作パネル等のコンピュータ操作用の機器を使用することもできる。   In addition, instead of the keyboard 6 and the mouse 7, or in addition to the keyboard 6 and the mouse 7, for example, a computer input device such as a voice input device or a touch operation panel can be used.

(制御ユニット4の構成)
制御ユニット4は、画像検査装置1の各部を制御するためのユニットであり、CPUやMPU、システムLSI、DSPや専用ハードウェア等で構成することができる。制御ユニット4は、後述するように様々な機能を搭載しているが、これらは論理回路によって実現されていてもよいし、ソフトウェアを実行することによって実現されていてもよい。
(Configuration of control unit 4)
The control unit 4 is a unit for controlling each part of the image inspection apparatus 1 and can be constituted by a CPU, MPU, system LSI, DSP, dedicated hardware, or the like. The control unit 4 is equipped with various functions as will be described later, but these may be realized by a logic circuit or may be realized by executing software.

図2に示すように、制御ユニット4は、フィルタ処理部40と、制御部41と、画像生成部42と、UI生成部43と、入力情報受付部44と、画像解析部45と、操作受付部46と、表示制御部47と、位置指定受付部48と、設定部49とを有している。制御ユニット4には、記憶装置10が接続されている。記憶装置10は、画像検査装置1の構成要素の一部とすることもできるし、画像検査装置1とは別の装置とすることもできる。記憶装置10は、半導体メモリやハードディスク等で構成することができる。また、記憶装置10には、CD−ROMやDVD−ROM等の各種記憶媒体に記憶されている情報を読み取り可能な読み取り装置を設けることもできる。   As shown in FIG. 2, the control unit 4 includes a filter processing unit 40, a control unit 41, an image generation unit 42, a UI generation unit 43, an input information reception unit 44, an image analysis unit 45, and an operation reception. A unit 46, a display control unit 47, a position designation receiving unit 48, and a setting unit 49. A storage device 10 is connected to the control unit 4. The storage device 10 can be a part of the components of the image inspection device 1 or can be a device different from the image inspection device 1. The storage device 10 can be composed of a semiconductor memory, a hard disk, or the like. The storage device 10 can also be provided with a reading device that can read information stored in various storage media such as a CD-ROM and a DVD-ROM.

(UI生成部43の構成)
UI生成部43は、表示部5に表示させる各種インターフェースを生成するための部分であり、このUI生成部43で生成された各種インターフェースは、制御ユニット4から表示部5に出力されて表示部5に表示される。
(Configuration of UI generation unit 43)
The UI generation unit 43 is a part for generating various interfaces to be displayed on the display unit 5, and the various interfaces generated by the UI generation unit 43 are output from the control unit 4 to the display unit 5 to be displayed on the display unit 5. Is displayed.

UI生成部43で生成されるインターフェースは、たとえば図7に示す照明設置方法選択用インターフェース50、図8に示すカメラ上下確認用インターフェース51、図9に示すカメラ姿勢確認用インターフェース52、図10に示すワーク移動方向選択用インターフェース53、図11に示す照明方向選択用インターフェース54がある。インターフェース50〜54は、画像検査装置1を運用する前に行われる該画像検査装置1の設定時に表示部5に表示される。   The interfaces generated by the UI generation unit 43 include, for example, an illumination installation method selection interface 50 shown in FIG. 7, a camera up / down confirmation interface 51 shown in FIG. 8, a camera posture confirmation interface 52 shown in FIG. There is a work movement direction selection interface 53 and an illumination direction selection interface 54 shown in FIG. The interfaces 50 to 54 are displayed on the display unit 5 when the image inspection apparatus 1 is set before the image inspection apparatus 1 is operated.

図7に示す照明設置方法選択用インターフェース50は、ラインカメラ31の受光素子3aとパターン光照明部2との位置関係情報を入力するためのインターフェースであり、受光素子3aとパターン光照明部2との位置関係が、反射光受光の位置関係と、透過光受光の位置関係とのいずれであるかを入力可能に構成されている。照明設置方法選択用インターフェース50には、反射光受光の位置関係を模式的に示すための反射光設置イラスト50aと、透過光受光の位置関係を模式的に示すための透過光設置イラスト50bが表示されている。使用者は、表示部5に表示されている反射光設置イラスト50a及び透過光設置イラスト50bを見て、実際の現場に設置されている受光素子3aとパターン光照明部2との位置関係と同じ位置関係になっているイラストをマウス7等で選択すればよいので、入力間違いが起こりにくくなる。使用者の入力操作は、入力内容が入力情報受付部44によって受け付けられる。これにより、位置関係情報を容易にかつ誤ることなく入力することができる。   The illumination installation method selection interface 50 shown in FIG. 7 is an interface for inputting positional relationship information between the light receiving element 3a of the line camera 31 and the pattern light illumination unit 2, and the light receiving element 3a, the pattern light illumination unit 2, and the like. The positional relationship between the reflected light reception and the transmitted light reception positional relationship can be input. The illumination installation method selection interface 50 displays a reflected light installation illustration 50a for schematically showing the positional relationship of reflected light reception and a transmitted light installation illustration 50b for schematically showing the positional relationship of transmitted light reception. Has been. The user looks at the reflected light installation illustration 50a and the transmitted light installation illustration 50b displayed on the display unit 5, and has the same positional relationship between the light receiving element 3a installed at the actual site and the pattern light illumination unit 2. Since it is sufficient to select an illustration in a positional relationship with the mouse 7 or the like, input errors are less likely to occur. As for the input operation of the user, the input content is received by the input information receiving unit 44. Thereby, positional relationship information can be input easily and without error.

図8に示すカメラ上下確認用インターフェース51は、ラインカメラ31の上下方向を確認するためのインターフェースである。撮像部3のLEDポインタ34からポインタ光を照射したときに、点滅する側がラインカメラ31の下側であることが使用者に分かるように、ポインタ光を含むイラスト50aが表示されるようになっている。また、どちら側がラインカメラ31の下側であるか文章で記載されている。   The camera up / down confirmation interface 51 shown in FIG. 8 is an interface for confirming the up / down direction of the line camera 31. When the pointer light is irradiated from the LED pointer 34 of the imaging unit 3, the illustration 50a including the pointer light is displayed so that the user can know that the blinking side is the lower side of the line camera 31. Yes. In addition, the text indicates which side is the lower side of the line camera 31.

図9に示すカメラ姿勢確認用インターフェース52もラインカメラ31の上下方向を確認するためのインターフェースである。カメラ姿勢確認用インターフェース52には、撮像部3の重力加速度センサ35により得られた撮像部3の現在の姿勢を模式的に表示する姿勢表示領域52aが組み込まれている。姿勢表示領域52aには、撮像部3を背面から見たときの水平面に対する傾きを示す背面図52bと、撮像部3を側面から見たときの鉛直面に対する傾きを示す側面図52cと、撮像部3を上面から見たときの姿勢を示す上面図52dとが表示される。使用者は、姿勢表示領域52aに表示されている各図52b、52c、52dを見ることでラインカメラ31の上下方向を確認することができる。   9 is also an interface for confirming the vertical direction of the line camera 31. The camera posture confirmation interface 52 incorporates a posture display area 52 a that schematically displays the current posture of the imaging unit 3 obtained by the gravitational acceleration sensor 35 of the imaging unit 3. The posture display area 52a includes a rear view 52b showing an inclination with respect to a horizontal plane when the imaging unit 3 is viewed from the back, a side view 52c showing an inclination with respect to a vertical plane when the imaging unit 3 is viewed from the side, and an imaging unit. A top view 52d showing a posture when 3 is viewed from above is displayed. The user can check the vertical direction of the line camera 31 by looking at the respective figures 52b, 52c, and 52d displayed in the posture display area 52a.

図10に示すワーク移動方向選択用インターフェース53は、ワークWの移動方向を選択して入力するためのインターフェースである。ワーク移動方向選択用インターフェース53には、図8に示すカメラ上下確認用インターフェース51を組み込むことができる。ワーク移動方向選択用インターフェース53には、ラインカメラ31の下側(底面側)から上側に向かってワークWが移動する様子を示す上方向移動イラスト53aと、ラインカメラ31の上側から下側に向かってワークWが移動する様子を示す下方向移動イラスト53bとが表示されている。使用者は、表示部5に表示されているカメラ上下確認用インターフェース51を見てラインカメラ31の上下方向を把握した上で、上方向移動イラスト53aと、下方向移動イラスト53bとを見てワークWのラインカメラ31に対する移動方向を選択して入力することができる。   A workpiece movement direction selection interface 53 shown in FIG. 10 is an interface for selecting and inputting the movement direction of the workpiece W. A camera up / down confirmation interface 51 shown in FIG. 8 can be incorporated in the work movement direction selection interface 53. The workpiece movement direction selection interface 53 includes an upward movement illustration 53a showing a state in which the workpiece W moves from the lower side (bottom surface side) to the upper side of the line camera 31, and from the upper side to the lower side of the line camera 31. A downward movement illustration 53b showing how the workpiece W moves is displayed. The user looks at the camera vertical confirmation interface 51 displayed on the display unit 5 to grasp the vertical direction of the line camera 31, and then looks at the upward movement illustration 53a and the downward movement illustration 53b to work. The moving direction of W with respect to the line camera 31 can be selected and input.

図11に示す照明方向選択用インターフェース54は、ラインカメラ31とパターン光照明部2との位置関係を選択して入力するためのインターフェースである。照明方向選択用インターフェース54は、使用者がラインカメラ31の向き(上側または下側がどちらであるか)を知っていることを前提として表示することができるものであり、ラインカメラ31に対するパターン光照明部2の向きを複数のイラストの中から選択することができるように構成されている。   The illumination direction selection interface 54 shown in FIG. 11 is an interface for selecting and inputting the positional relationship between the line camera 31 and the pattern light illumination unit 2. The illumination direction selection interface 54 can be displayed on the assumption that the user knows the direction of the line camera 31 (whether it is the upper side or the lower side). The direction of the section 2 is configured so that it can be selected from a plurality of illustrations.

すなわち、照明方向選択用インターフェース54には、パターン光照明部2をラインカメラ31に対して信号線100aが左側へ出るように配置した状態を示す第1のイラスト54aと、パターン光照明部2をラインカメラ31に対して信号線100aが上側へ出るように配置した状態を示す第2のイラスト54bと、パターン光照明部2をラインカメラ31に対して信号線100aが下側へ出るように配置した状態を示す第3のイラスト54cと、パターン光照明部2をラインカメラ31に対して信号線100aが右側へ出るように配置した状態を示す第4のイラスト54dとが表示されている。使用者は、表示部5に表示されている第1〜第4のイラスト54a〜54dを見て、実際の現場に設置されているラインカメラ31とパターン光照明部2との位置関係を選択して入力することができる。   That is, the illumination direction selection interface 54 includes the first illustration 54a showing the state in which the pattern light illumination unit 2 is arranged so that the signal line 100a protrudes to the left side with respect to the line camera 31, and the pattern light illumination unit 2. The second illustration 54b showing a state in which the signal line 100a is arranged so as to protrude upward with respect to the line camera 31, and the pattern light illumination unit 2 are arranged so that the signal line 100a protrudes downward with respect to the line camera 31. A third illustration 54c showing the state of the pattern light and a fourth illustration 54d showing the state where the pattern light illumination unit 2 is arranged so that the signal line 100a protrudes to the right side with respect to the line camera 31 are displayed. The user looks at the first to fourth illustrations 54a to 54d displayed on the display unit 5, and selects the positional relationship between the line camera 31 and the pattern light illumination unit 2 installed at the actual site. Can be entered.

UI生成部43で生成されるインターフェースは、図12に示すケーブル引き出し方向選択用インターフェース55を含むことができる。「ケーブル」とは、パターン光照明部2に接続されている信号線100aのことである。ケーブル引き出し方向選択用インターフェース55は、いわゆるプルダウンメニューボタンを含む形態として構成することができる。このケーブル引き出し方向選択用インターフェース55は、使用者がラインカメラ31の向き(上側または下側がどちらであるか)を知っていることを前提として表示することができるものであり、ラインカメラ31に対するパターン光照明部2の向きを複数の選択肢の中から選択することができるように構成されている。   The interface generated by the UI generation unit 43 can include a cable drawing direction selection interface 55 shown in FIG. “Cable” refers to the signal line 100 a connected to the pattern light illumination unit 2. The cable drawing direction selection interface 55 can be configured to include a so-called pull-down menu button. This cable drawing direction selection interface 55 can be displayed on the premise that the user knows the direction of the line camera 31 (whether the upper side or the lower side). It is comprised so that the direction of the light illumination part 2 can be selected from several choices.

すなわち、ケーブル引き出し方向選択用インターフェース55のプルダウンメニュー55aには、「基準方向」、「時計回りに90゜」、「時計回りに180゜」及び「時計回りに270゜」の4つの選択肢が含まれている(図12では「基準方向」のみ表示した状態となっている)。ここで、「基準方向」とは、図11に示す照明方向選択用インターフェース54の第1のイラスト54aで示す方向(左方向)に信号線100aが出るようにパターン光照明部2を配置した状態のときに選択する選択肢である。「時計回りに90゜」とは、上方向に信号線100aが出るようにパターン光照明部2を配置した状態のときに選択する選択肢である。「時計回りに180゜」とは、右方向に信号線100aが出るようにパターン光照明部2を配置した状態のときに選択する選択肢である。「時計回りに270゜」とは、下方向に信号線100aが出るようにパターン光照明部2を配置した状態のときに選択する選択肢である。各選択肢の表現は一例であり、上記した表現に限られるものではない。   That is, the pull-down menu 55a of the cable drawing direction selection interface 55 includes four options of “reference direction”, “90 ° clockwise”, “180 ° clockwise”, and “270 ° clockwise”. (In FIG. 12, only the “reference direction” is displayed). Here, the “reference direction” refers to a state in which the pattern light illumination unit 2 is arranged so that the signal line 100a comes out in the direction (left direction) shown in the first illustration 54a of the illumination direction selection interface 54 shown in FIG. It is an option to select when. “90 ° clockwise” is an option to be selected when the pattern light illumination unit 2 is arranged so that the signal line 100a comes out upward. “Clockwise 180 °” is an option selected when the pattern light illumination unit 2 is arranged so that the signal line 100a comes out in the right direction. “270 ° clockwise” is an option to be selected when the pattern light illumination unit 2 is arranged so that the signal line 100a comes out downward. The expression of each option is an example, and is not limited to the above expression.

(画像解析部45の構成)
図2に示す画像解析部45は、撮像部3で撮像された複数の画像を解析することにより、ラインカメラ31の受光素子3aとパターン光照明部2との位置関係に関する位置関係情報を取得するための部分であり、情報取得部9の一部とすることができる。
(Configuration of the image analysis unit 45)
The image analysis unit 45 illustrated in FIG. 2 acquires positional relationship information regarding the positional relationship between the light receiving element 3a of the line camera 31 and the pattern light illumination unit 2 by analyzing a plurality of images captured by the imaging unit 3. And can be a part of the information acquisition unit 9.

具体的には、画像解析部45は、画像検査装置1を運用する前に行われる該画像検査装置1の設定時に、初めのステップとして、一方向に周期的な照度分布を有する第1のパターン光を照射した照射面を撮像した第1画像と、上記一方向に直交する方向に周期的な照度分布を有する第2のパターン光を照射した照射面を撮像した第2画像とを生成するように、パターン光照明部2及び撮像部3を制御する。照射面はワークWであってもよいし、他の部材であってもよい。   Specifically, the image analysis unit 45 sets the first pattern having a periodic illuminance distribution in one direction as a first step when setting the image inspection apparatus 1 before the image inspection apparatus 1 is operated. Generating a first image obtained by imaging an irradiation surface irradiated with light, and a second image obtained by imaging the irradiation surface irradiated with a second pattern light having a periodic illuminance distribution in a direction orthogonal to the one direction. In addition, the pattern light illumination unit 2 and the imaging unit 3 are controlled. The irradiation surface may be a workpiece W or another member.

初めのステップにおける第1のパターン光は、図13の左側に示すようにX方向に照度が変化するX方向パターン光とすることができ、図13の右側へ行くほど暗くなるパターン光としておく。第2のパターン光は、図13の右側に示すようにY方向に照度が変化するY方向パターン光とすることができ、図13の下側へ行くほど暗くなるパターン光としておく。   The first pattern light in the first step can be X-direction pattern light whose illuminance changes in the X direction as shown on the left side of FIG. 13, and is set as pattern light that becomes darker toward the right side of FIG. The second pattern light can be a Y-direction pattern light whose illuminance changes in the Y direction as shown on the right side of FIG. 13 and is a pattern light that becomes darker toward the lower side of FIG.

まず、図13の左側のX方向パターン光を任意の照射面に照射してX方向パターン光が照射されている照射面を撮像部3で撮像して第1画像を得る。第1画像は図14に示すように右側へ行くほど暗くなるグラデーションありの画像になったとする。その後、図13の右側のY方向パターン光を任意の照射面に照射してY方向パターン光が照射されている照射面を撮像部3で撮像して第2画像を得る。第2画像は図14に示すようにグラデーションなしの画像になったとする。受光素子3aの配列方向がX方向であるので、図14に示す第1画像及び第2画像が得られた場合には、図14の下側に示すように信号線100aが左方向に出るようにパターン光照明部2が配置されていると推定できる。尚、この関係は事前に定義しておけばよい。   First, the X-direction pattern light on the left side of FIG. 13 is irradiated on an arbitrary irradiation surface, and the irradiation surface irradiated with the X-direction pattern light is imaged by the imaging unit 3 to obtain a first image. Assume that the first image is an image with a gradation that becomes darker toward the right as shown in FIG. Thereafter, the Y-direction pattern light on the right side of FIG. 13 is irradiated on an arbitrary irradiation surface, and the irradiation surface irradiated with the Y-direction pattern light is imaged by the imaging unit 3 to obtain a second image. Assume that the second image is an image without gradation as shown in FIG. Since the arrangement direction of the light receiving elements 3a is the X direction, when the first image and the second image shown in FIG. 14 are obtained, the signal line 100a comes out to the left as shown in the lower side of FIG. It can be estimated that the pattern light illumination unit 2 is arranged. This relationship may be defined in advance.

図15に示すように第1画像がグラデーションなしの画像で、第2画像が右側へ行くほど暗くなるグラデーションありの画像になった場合には、図15の下側に示すように信号線100aが上方向に出るようにパターン光照明部2が配置されていると推定できる。   As shown in FIG. 15, when the first image is an image without gradation and the second image is an image with gradation that becomes darker toward the right side, as shown in the lower side of FIG. It can be estimated that the pattern light illumination unit 2 is arranged so as to come out upward.

図16に示すように第1画像がグラデーションなしの画像で、第2画像が左側へ行くほど暗くなるグラデーションありの画像になった場合には、図16の下側に示すように信号線100aが下方向に出るようにパターン光照明部2が配置されていると推定できる。   As shown in FIG. 16, when the first image is an image without gradation and the second image is an image with gradation that becomes darker toward the left side, as shown in the lower side of FIG. It can be estimated that the pattern light illumination unit 2 is arranged so as to come out downward.

図17に示すように第1画像が左側へ行くほど暗くなるグラデーションありの画像で、第2画像がグラデーションなしの画像になった場合には、図17の下側に示すように信号線100aが右方向に出るようにパターン光照明部2が配置されていると推定できる。   As shown in FIG. 17, when the first image is a gradation image that becomes darker toward the left side and the second image is an image without gradation, a signal line 100a is displayed as shown in the lower side of FIG. It can be estimated that the pattern light illumination unit 2 is arranged so as to come out in the right direction.

つまり、画像解析部45は撮像部3で撮像された第1画像及び第2画像を解析するステップを実行し、その結果、第1画像及び第2画像がグラデーションありの画像であるかグラデーションなしの画像であるかを得て、グラデーションありの画像の場合、どちら側に向かって暗くなっている(または明るくなっている)かを得ることによって受光素子3aとパターン光照明部2との位置関係情報を取得することができる。   That is, the image analysis unit 45 performs a step of analyzing the first image and the second image captured by the imaging unit 3, and as a result, the first image and the second image are images with gradation or no gradation. Information on the positional relationship between the light receiving element 3a and the pattern light illuminating unit 2 is obtained by obtaining which side is darker (or brighter) in the case of an image with gradation by obtaining whether it is an image. Can be obtained.

また、撮像部3にラインカメラ31ではなく、エリアカメラ(受光素子がX方向とY方向に並ぶように配置されたカメラ)を用いることもできる。このエリアカメラの場合、画像解析部45は、撮像部3で撮像された1枚の画像を解析することにより、エリアカメラとパターン光照明部2との位置関係情報を取得することができる。   Further, instead of the line camera 31, an area camera (a camera in which light receiving elements are arranged in the X direction and the Y direction) can be used for the imaging unit 3. In the case of this area camera, the image analysis unit 45 can acquire the positional relationship information between the area camera and the pattern light illumination unit 2 by analyzing one image captured by the imaging unit 3.

具体的には、図18Aに示すように、パターン光照明部2からアルファベットの「R」を表示可能なパターン光を任意の照射面に照射してパターン光が照射されている照射面を撮像部3で撮像する。その結果、図18の最も上に記載されている「R」の画像が得られた場合には、信号線100aが左方向に出るようにパターン光照明部2が配置されていると推定できる。図18の上から2番目に記載されている「R」の画像が得られた場合には、信号線100aが上方向に出るようにパターン光照明部2が配置されていると推定できる。図18の上から3番目に記載されている「R」の画像が得られた場合には、信号線100aが右方向に出るようにパターン光照明部2が配置されていると推定できる。図18の最も下に記載されている「R」の画像が得られた場合には、信号線100aが下方向に出るようにパターン光照明部2が配置されていると推定できる。パターン光は「R」以外を示すものであってもよく、たとえば文字、記号、図形、それらの組み合わせ等であってもよい。   Specifically, as shown in FIG. 18A, an imaging surface is irradiated with the pattern light by irradiating an arbitrary irradiation surface with pattern light capable of displaying the alphabet “R” from the pattern light illumination unit 2. 3 to take an image. As a result, when the “R” image described at the top of FIG. 18 is obtained, it can be estimated that the pattern light illumination unit 2 is arranged so that the signal line 100a is leftward. When the image of “R” described second from the top in FIG. 18 is obtained, it can be estimated that the pattern light illumination unit 2 is arranged so that the signal line 100a comes out upward. When the “R” image described third from the top in FIG. 18 is obtained, it can be estimated that the pattern light illumination unit 2 is arranged so that the signal line 100a comes to the right. When the image of “R” described at the bottom of FIG. 18 is obtained, it can be estimated that the pattern light illumination unit 2 is arranged so that the signal line 100a protrudes downward. The pattern light may indicate other than “R”, and may be, for example, a character, a symbol, a figure, a combination thereof, or the like.

(情報取得部の他の形態)
図19に示すように、撮像部3に所定のマーク3cを設けておき、パターン光照明部2には4つの方向をそれぞれ示す左側記号A、下側記号B、右側記号C及び上側記号Dを設けておく。UI生成部43は図20に示す方向選択用インターフェース56を生成する。生成された方向選択用インターフェース56は表示部5に表示される。方向選択用インターフェース56には、左側記号A、下側記号B、右側記号C及び上側記号Dを選択できるプルダウンメニュー56aを設けておく。
(Other forms of information acquisition unit)
As shown in FIG. 19, a predetermined mark 3 c is provided in the imaging unit 3, and the left side symbol A, the lower side symbol B, the right side symbol C, and the upper side symbol D indicating the four directions are respectively displayed on the pattern light illumination unit 2. Prepare it. The UI generation unit 43 generates a direction selection interface 56 shown in FIG. The generated direction selection interface 56 is displayed on the display unit 5. The direction selection interface 56 is provided with a pull-down menu 56a for selecting a left symbol A, a lower symbol B, a right symbol C, and an upper symbol D.

使用者は、撮像部3のマーク3cがパターン光照明部2のどちら側に位置しているかを目視で確認した後、方向選択用インターフェース56のプルダウンメニュー56aにより、撮像部3のマーク3cが指す方向にある記号A〜Dを選択する。これにより、ラインカメラ31の受光素子3aとパターン光照明部2との位置関係情報を入力することができる。   The user visually confirms which side of the pattern light illumination unit 2 the mark 3c of the imaging unit 3 is located on, and then points to the mark 3c of the imaging unit 3 from the pull-down menu 56a of the direction selection interface 56. Select the symbols A to D in the direction. Thereby, positional relationship information between the light receiving element 3a of the line camera 31 and the pattern light illumination unit 2 can be input.

(注意喚起機能)
図11の照明方向選択用インターフェース、図12のケーブル引き出し方向選択用インターフェース及び図20の方向選択用インターフェースを利用することで、使用者が受光素子3aとパターン光照明部2との位置関係情報を入力することができる。しかし、使用者が入力操作を誤ってしまうことや、そもそもラインカメラ31の上下方向を誤って認識している場合があり、使用者の入力結果が実際の設置状況と異なる場合が考えられる。
(Warning function)
By using the illumination direction selection interface of FIG. 11, the cable drawing direction selection interface of FIG. 12, and the direction selection interface of FIG. 20, the user can obtain positional relationship information between the light receiving element 3a and the pattern light illumination unit 2. Can be entered. However, there is a case where the user makes an input operation mistakenly, or the vertical direction of the line camera 31 is recognized in the first place, and the user's input result is different from the actual installation state.

このことに対して、画像検査装置1に注意喚起機能を設けることができる。注意喚起機能は、図11の照明方向選択用インターフェース、図12のケーブル引き出し方向選択用インターフェース及び図20の方向選択用インターフェースを利用して使用者が受光素子3aとパターン光照明部2との位置関係情報を入力した後、図13〜図17に示す解析を行うか、エリアカメラの場合には図18に示す解析を行うことで、入力された位置関係情報が実際の設置状況と一致しているか否かを判定し、判定の結果、入力された位置関係情報が実際の設置状況と一致していない場合には、表示部5にたとえばメッセージを表示して使用者に再度確認及び入力を促す機能である。   In contrast, the image inspection apparatus 1 can be provided with a warning function. The alerting function uses the illumination direction selection interface shown in FIG. 11, the cable drawing direction selection interface shown in FIG. 12, and the direction selection interface shown in FIG. 20 to allow the user to position the light receiving element 3 a and the pattern light illumination unit 2. After inputting the relationship information, the analysis shown in FIGS. 13 to 17 is performed, or in the case of an area camera, the analysis shown in FIG. 18 is performed, so that the input positional relationship information matches the actual installation status. If the input positional relationship information does not match the actual installation status, for example, a message is displayed on the display unit 5 to prompt the user to confirm and input again. It is a function.

(制御部41の構成)
図2に示す制御部41は、パターン光照明部2及び撮像部3の制御を行うための撮像制御部である。具体的には、照度分布の位相を受光素子3aの配列方向及びワークWの移動方向の少なくとも一方向にシフトさせた複数のパターン光を生成してワークWに順次照射し、当該パターン光が照射されるタイミングでワークWにおけるパターン光の照射面を少なくとも含んだ領域を撮像して複数の輝度画像を得るように、パターン光照明部2及び撮像部3を制御する。複数の輝度画像を得る際、パターン光照明部2の照明条件及び撮像部3の撮像条件の両方を変化させてもよいし、一方のみ変化させてもよい。
(Configuration of control unit 41)
A control unit 41 illustrated in FIG. 2 is an imaging control unit for controlling the pattern light illumination unit 2 and the imaging unit 3. Specifically, a plurality of pattern lights in which the phase of the illuminance distribution is shifted in at least one direction of the arrangement direction of the light receiving elements 3a and the movement direction of the workpiece W are generated and sequentially irradiated onto the workpiece W. The pattern light illumination unit 2 and the imaging unit 3 are controlled so that a plurality of luminance images are obtained by capturing an area including at least the pattern light irradiation surface of the workpiece W at the timing of the above. When obtaining a plurality of luminance images, both the illumination conditions of the pattern light illumination unit 2 and the imaging conditions of the imaging unit 3 may be changed, or only one of them may be changed.

パターン光照明部2の照明条件は、たとえば生成するパターン光の種類、複数のパターン光を生成する場合にパターン光の生成の順番、パターン光の明るさ(光の強度)等を含むことができる。生成するパターン光の種類としては、たとえば図5Aに示す4つのY方向パターン光及び図5Bに示す4つのX方向パターン光を少なくとも含むことができるが、これら以外にも、波長が異なるパターン光等を含むことができる。パターン光の生成の順番としては、図5Aに示す0゜の場合のY方向パターン光、90゜の場合のY方向パターン光、180゜の場合のY方向パターン光、270゜の場合のY方向パターン光の順番とし、その後、図5Bに示す0゜の場合のX方向パターン光、90゜の場合のX方向パターン光、180゜の場合のX方向パターン光、270゜の場合のX方向パターン光とすることができる。   The illumination conditions of the pattern light illumination unit 2 can include, for example, the type of pattern light to be generated, the order of generation of pattern light when generating a plurality of pattern lights, the brightness of the pattern light (light intensity), and the like. . As the types of pattern light to be generated, for example, at least four Y-direction pattern lights shown in FIG. 5A and four X-direction pattern lights shown in FIG. 5B can be included. Can be included. The pattern light is generated in the order of Y direction pattern light at 0 °, Y direction pattern light at 90 °, Y direction pattern light at 180 °, and Y direction at 270 ° shown in FIG. 5A. 5B, the X direction pattern light in the case of 0 °, the X direction pattern light in the case of 90 °, the X direction pattern light in the case of 180 °, and the X direction pattern in the case of 270 °. Can be light.

パターン光照明部2の照明条件は、記憶装置10に設けられている照明条件記憶部10aに記憶させておくことができる。また、パターン光照明部2に、パターン光照明部2の照明条件を記憶することが可能な照明条件記憶部2bを有する演算装置(field programmable gate array : FPGA)2aを組み込むことができる。FPGAに限定されるものではなく、FPGA以外の演算部と照明条件記憶部2bを組み込むことができる。   The illumination conditions of the pattern light illumination unit 2 can be stored in the illumination condition storage unit 10 a provided in the storage device 10. Further, the pattern light illumination unit 2 can incorporate a computing device (field programmable gate array: FPGA) 2 a having an illumination condition storage unit 2 b capable of storing the illumination conditions of the pattern light illumination unit 2. The present invention is not limited to the FPGA, and a calculation unit other than the FPGA and the illumination condition storage unit 2b can be incorporated.

撮像部3の撮像条件は、たとえば、撮像時のゲイン及び露光時間(シャッタースピード)の少なくとも一方を含んでいる。制御部41は撮像部3のゲイン及び露光時間を任意に変化させることができ、撮像部3は制御部41により設定されたゲイン及び露光時間で撮像を実行する。   The imaging conditions of the imaging unit 3 include, for example, at least one of a gain at the time of imaging and an exposure time (shutter speed). The control unit 41 can arbitrarily change the gain and exposure time of the imaging unit 3, and the imaging unit 3 executes imaging with the gain and exposure time set by the control unit 41.

(トリガ信号の送信)
制御部41は、エンコーダパルス信号が外部から入力されたときに、エンコーダパルス信号を受け付けることが可能に構成されている。エンコーダパルス信号は、たとえば、搬送用ベルトコンベアBの回転軸に設けられたロータリエンコーダから出力されるパルス信号、外部制御機器8から出力されるパルス信号等、制御部41外で生成されたパルス信号である。
(Trigger signal transmission)
The control unit 41 is configured to receive an encoder pulse signal when the encoder pulse signal is input from the outside. The encoder pulse signal is, for example, a pulse signal generated outside the control unit 41, such as a pulse signal output from a rotary encoder provided on the rotating shaft of the conveyor belt B for conveyance, a pulse signal output from the external control device 8, or the like. It is.

制御ユニット4はトリガ信号送信部4bを有している。トリガ信号送信部4bは、制御部41の一部を構成するものとしてもよいし、制御部41とは別に構成してもよい。制御部41が外部からの一のエンコーダパルス信号を受け付けると、パターン光照明部2の照明条件及び撮像部3の撮像条件の少なくとも一方を変化させて複数の輝度画像が生成されるように、トリガ信号送信部4bが撮像部3に対して複数の撮像トリガ信号を順次送信するとともに、パターン光照明部2に対して複数の照明トリガ信号を送信するように構成されている。撮像部3に対してのみ複数の撮像トリガ信号を順次送信するように構成することもできる。   The control unit 4 has a trigger signal transmission unit 4b. The trigger signal transmission unit 4 b may constitute a part of the control unit 41 or may be configured separately from the control unit 41. When the control unit 41 receives one encoder pulse signal from the outside, a trigger is generated so that a plurality of luminance images are generated by changing at least one of the illumination conditions of the pattern light illumination unit 2 and the imaging conditions of the imaging unit 3. The signal transmission unit 4 b is configured to sequentially transmit a plurality of imaging trigger signals to the imaging unit 3 and to transmit a plurality of illumination trigger signals to the pattern light illumination unit 2. A plurality of imaging trigger signals can be sequentially transmitted only to the imaging unit 3.

この実施形態では、上述したように、パターン光照明部2が8種類のパターン光を順次照射するので、図35に示すように、トリガ信号送信部4bは、外部からの一のエンコーダパルス信号EP1を受け付けると、撮像トリガ信号を8回(C1〜C8)送信する。その後、エンコーダパルス信号EP2を受け付けると、同じように撮像トリガ信号を8回送信する。   In this embodiment, as described above, since the pattern light illumination unit 2 sequentially emits eight types of pattern light, as shown in FIG. 35, the trigger signal transmission unit 4b receives one encoder pulse signal EP1 from the outside. Is received, the imaging trigger signal is transmitted eight times (C1 to C8). Thereafter, when the encoder pulse signal EP2 is received, the imaging trigger signal is similarly transmitted eight times.

また、トリガ信号送信部4bは、外部からの一のエンコーダパルス信号を受け付けると、パターン光照明部2に対して複数の照明トリガ信号を撮像トリガ信号と同期させて順次送信するように構成されている。パターン光照明部2には、8種類のパターン光を順次照射させる必要があるので、トリガ信号送信部4bは、外部からの一のエンコーダパルス信号EP1を受け付けると、照明トリガ信号を8回(L1〜L8)送信する。その後、エンコーダパルス信号EP2を受け付けると、同じように照明トリガ信号を8回送信する。   The trigger signal transmission unit 4b is configured to sequentially transmit a plurality of illumination trigger signals to the pattern light illumination unit 2 in synchronization with the imaging trigger signal when receiving one encoder pulse signal from the outside. Yes. Since it is necessary to sequentially irradiate the pattern light illumination unit 2 with eight types of pattern light, when the trigger signal transmission unit 4b receives one encoder pulse signal EP1 from the outside, the illumination light trigger signal is transmitted eight times (L1). ~ L8) Transmit. Thereafter, when the encoder pulse signal EP2 is received, the illumination trigger signal is similarly transmitted eight times.

また、制御部41は、外部からの一のエンコーダパルス信号を受け付けると、撮像部3に対して複数の撮像トリガ信号を照明トリガ信号と同期させて順次送信するように構成することもできる。   In addition, when receiving one encoder pulse signal from the outside, the control unit 41 can also be configured to sequentially transmit a plurality of imaging trigger signals to the imaging unit 3 in synchronization with the illumination trigger signal.

(パターン光照明部によるパターン光の生成)
パターン光照明部2は、発光ダイオード20、21に流す電流値をトリガ信号送信部4bから送信された照明トリガ信号に基づいて制御することにより、複数のパターン光を生成する。パターン光は周期的な照度分布を有しているので、その照度分布が得られるように、各発光ダイオード20、21に流す電流値は、生成するパターン光に応じてそれぞれ設定されている。各発光ダイオード20、21に流す電流値は、照明条件に相当しており、記憶装置10の照明条件記憶部10aに記憶させておくことができる。
(Generation of pattern light by the pattern light illumination unit)
The pattern light illuminator 2 generates a plurality of pattern lights by controlling the value of the current passed through the light emitting diodes 20 and 21 based on the illumination trigger signal transmitted from the trigger signal transmitter 4b. Since the pattern light has a periodic illuminance distribution, the current value to be passed through each of the light emitting diodes 20 and 21 is set according to the generated pattern light so that the illuminance distribution can be obtained. The value of the current passed through each light emitting diode 20, 21 corresponds to the illumination condition, and can be stored in the illumination condition storage unit 10 a of the storage device 10.

照明条件は、パターン光照明部2の発光ダイオード20、21の照明タイミング情報(点灯時間、点灯間隔)、照明強度情報、照明パターン情報を含む照明設定データとすることができる。この照明設定データはいずれも、照明設定用のユーザインタフェースを表示部5に表示させ、使用者による調整を受け付けることができる。   The illumination condition can be illumination setting data including illumination timing information (lighting time, lighting interval), illumination intensity information, and illumination pattern information of the light emitting diodes 20 and 21 of the pattern light illumination unit 2. Any of the illumination setting data can display a user interface for illumination setting on the display unit 5 and accept adjustment by the user.

点灯タイミング情報とは、照明トリガ信号を受けてから発光ダイオード20、21を点灯させておく点灯時間と、点灯させる発光ダイオード20、21を切り替える際に、先に点灯している発光ダイオード20、21を消灯させてから次の発光ダイオード20、21を点灯させるまでの点灯間隔(インターバル)とからなる。また、照明強度情報とは、発光ダイオード20、21の照明強度(明るさ)を示す情報であり、具体的には電流値を挙げることができる。また、照明パターン情報とは、sin波状パターンを規定する情報であり、例えば周期、位相シフト量(1回の位相シフトでどの程度シフトさせるか)を含む。照明パターンはsin波でなくてもよく、例えば矩形波等であってもよい。   The lighting timing information includes a lighting time during which the light-emitting diodes 20 and 21 are turned on after receiving the illumination trigger signal, and the light-emitting diodes 20 and 21 that are lighted first when the light-emitting diodes 20 and 21 are turned on. And the lighting interval (interval) from when the LED is turned off until the next light emitting diode 20 or 21 is turned on. Further, the illumination intensity information is information indicating the illumination intensity (brightness) of the light emitting diodes 20 and 21, and specifically includes a current value. The illumination pattern information is information that defines a sin wave pattern, and includes, for example, a period and a phase shift amount (how much the phase is shifted by one phase shift). The illumination pattern may not be a sine wave, but may be a rectangular wave, for example.

上記照明設定データの作成は、照明条件記憶部10aに対してキーボード6及びマウス7等の入力手段によって可能にしてもよい。   The creation of the illumination setting data may be enabled by input means such as a keyboard 6 and a mouse 7 for the illumination condition storage unit 10a.

照明条件記憶部10aはパターン光照明部2に設けられていてもよいし、撮像部3に設けられていてもよく、画像検査装置1のどの構成要素に設けられていてもよい。   The illumination condition storage unit 10a may be provided in the pattern light illumination unit 2, may be provided in the imaging unit 3, or may be provided in any component of the image inspection apparatus 1.

記憶装置10の照明条件記憶部10aに記憶していた照明条件を制御部41が一旦読み込み、その照明条件記憶部10aに記憶していた照明条件をパターン光照明部2の演算装置2aに出力し、演算装置2aが有する照明条件記憶部2bに記憶させておくことができる。これにより、パターン光照明部2が外部から照明トリガ信号を受信すると、照明条件記憶部2bに記憶された照明条件に従ってワークWを照明することができるので、照明条件を記憶装置10の照明条件記憶部10aから読み込む場合に比べてパターン光照明部2のパターン光の生成速度を速くすることができる。   The control unit 41 once reads the illumination condition stored in the illumination condition storage unit 10a of the storage device 10, and outputs the illumination condition stored in the illumination condition storage unit 10a to the arithmetic device 2a of the pattern light illumination unit 2. Can be stored in the illumination condition storage unit 2b of the arithmetic device 2a. Thereby, when the pattern light illumination unit 2 receives an illumination trigger signal from the outside, the workpiece W can be illuminated according to the illumination condition stored in the illumination condition storage unit 2b, so that the illumination condition is stored in the illumination condition of the storage device 10. Compared with the case of reading from the unit 10a, the pattern light generation speed of the pattern light illumination unit 2 can be increased.

図36にも示すように、パターン光照明部2には、発光ダイオード20、21に流す電流値を制御する電流制御部2cが組み込まれている。電流制御部2cは、照明トリガ信号を受信可能に構成されており、照明トリガ信号を受信すると、照明条件記憶部2bに記憶された照明条件に従って発光ダイオード20、21に流す電流値を制御する。   As shown also in FIG. 36, the pattern light illumination unit 2 incorporates a current control unit 2c that controls the value of the current flowing through the light emitting diodes 20 and 21. The current control unit 2c is configured to be able to receive an illumination trigger signal. When receiving the illumination trigger signal, the current control unit 2c controls a current value that flows through the light emitting diodes 20 and 21 according to the illumination condition stored in the illumination condition storage unit 2b.

第1発光ダイオード列A1〜A12を制御する電流制御部2cと、第2発光ダイオード列B1〜B12を制御する電流制御部2cとが設けられており、いずれの電流制御部2cも同じ構成である。図36に示す電流制御部2cは、第1発光ダイオード列A1を制御するものであり、電流制御部2cは、1つのD/Aコンバータ2dと、複数のサンプルホールド回路2eと、複数の電圧/電流変換回路2fとを備えている。サンプルホールド回路2e及び電圧/電流変換回路2fは、第1発光ダイオード列A1を構成する発光ダイオード20の数(12個)と同じ数だけ設けられている。12個のサンプルホールド回路2eがD/Aコンバータ2dに接続されている。また、各サンプルホールド回路2eの出力側には、電圧/電流変換回路2fが接続されている。電圧/電流変換回路2fの出力側には、各発光ダイオード20が接続されている。   A current control unit 2c that controls the first light emitting diode arrays A1 to A12 and a current control unit 2c that controls the second light emitting diode arrays B1 to B12 are provided, and all the current control units 2c have the same configuration. . The current control unit 2c shown in FIG. 36 controls the first light emitting diode array A1, and the current control unit 2c includes one D / A converter 2d, a plurality of sample and hold circuits 2e, and a plurality of voltage / And a current conversion circuit 2f. The sample-and-hold circuit 2e and the voltage / current conversion circuit 2f are provided in the same number as the number (12) of the light-emitting diodes 20 constituting the first light-emitting diode array A1. Twelve sample and hold circuits 2e are connected to the D / A converter 2d. A voltage / current conversion circuit 2f is connected to the output side of each sample and hold circuit 2e. Each light emitting diode 20 is connected to the output side of the voltage / current conversion circuit 2f.

パターンを切り替える際、D/Aコンバータ2dは、図37に示すようにA1〜A12用の制御電圧を順次出力するように構成されている。12個のサンプルホールド回路2eは、外部から入力されるサンプリング信号に基づいて各々が所定のサンプルタイミングでD/Aコンバータ2dから出力される波形信号の電圧をサンプリングする。図37における第1サンプルホールド回路がサンプリングした後に、第2サンプルホールド回路がサンプリングし、このようにして電圧を順次サンプリングしていく。   When switching patterns, the D / A converter 2d is configured to sequentially output control voltages for A1 to A12 as shown in FIG. The twelve sample and hold circuits 2e each sample the voltage of the waveform signal output from the D / A converter 2d at a predetermined sample timing based on the sampling signal input from the outside. After the first sample and hold circuit in FIG. 37 samples, the second sample and hold circuit samples and thus sequentially samples the voltages.

第1サンプルホールド回路でサンプリングされた電圧値は、電圧/電流変換回路2fによって電圧値に応じた電流値に変換され、その電流値の電流が発光ダイオードA1に流れる。この例では、第1サンプルホールド回路でサンプリングされた電圧値が最も低く、第2、第3サンプルホールド回路の順にサンプリングされた電圧値が高くなっていく。つまり、第1電流値が最も低く、第2、第3電流値の順に電流値が高くなっていくので、発光ダイオードA1〜A12の明るさが電流値に応じて変わることになり、これにより、周期的な照度分布を有するパターン光が生成される。D/Aコンバータ2dから出力される波形信号を変化させることで、パターン光の照度分布が変化することになり、パターン光の照度分布を、上述したsin波形に近似した波形で表すことや、三角波に近似した波形、矩形波に近似した波形で表すこともできる。また、全ての発光ダイオード20の明るさが同じになるように電流値を設定することで、全面が一様な照度の照明とすることもできる。   The voltage value sampled by the first sample and hold circuit is converted into a current value corresponding to the voltage value by the voltage / current conversion circuit 2f, and the current of the current value flows to the light emitting diode A1. In this example, the voltage value sampled by the first sample and hold circuit is the lowest, and the voltage values sampled in the order of the second and third sample and hold circuits increase. That is, since the first current value is the lowest and the current value becomes higher in the order of the second and third current values, the brightness of the light emitting diodes A1 to A12 changes according to the current value. Pattern light having a periodic illuminance distribution is generated. By changing the waveform signal output from the D / A converter 2d, the illuminance distribution of the pattern light changes, and the illuminance distribution of the pattern light is expressed by a waveform that approximates the above-described sin waveform, or a triangular wave It can also be expressed by a waveform approximated to a square wave or a waveform approximated to a rectangular wave. Further, by setting the current value so that all the light emitting diodes 20 have the same brightness, it is possible to provide illumination with uniform illuminance on the entire surface.

この実施形態では、D/Aコンバータ2dの出力電圧を各発光ダイオード20の制御電圧とし、各発光ダイオード20用のサンプルホールド回路2eでタイミングを規定してサンプリングすることで、1つのD/Aコンバータ2dで複数の発光ダイオード20の光量を制御することができる。これにより、一般的にサイズの大きな高速・高階調のD/Aコンバータ2dの数を減らし、サイズの小さなサンプルホールド回路2eでパターン光を生成することができるので、基板面積を小さくできるとともにコストを低減することができる。   In this embodiment, the output voltage of the D / A converter 2d is used as the control voltage of each light emitting diode 20, and the sampling and holding circuit 2e for each light emitting diode 20 defines the timing, thereby sampling one D / A converter. The light quantity of the plurality of light emitting diodes 20 can be controlled by 2d. As a result, the number of high-speed, high-gradation D / A converters 2d having a large size can be reduced, and the pattern light can be generated by the small-sized sample hold circuit 2e. Therefore, the substrate area can be reduced and the cost can be reduced. Can be reduced.

第2発光ダイオード列B1〜B12の各列の発光ダイオード21はY方向に並んでいるので、第2発光ダイオード列B1〜B12の電流値制御によってX方向パターン光を生成することができる。また、第1発光ダイオード列A1〜A12の各列の発光ダイオード20はX方向に並んでいるので、第1発光ダイオード列A1〜A12の電流値制御によってY方向パターン光を生成することができる。   Since the light emitting diodes 21 of the second light emitting diode rows B1 to B12 are arranged in the Y direction, the X direction pattern light can be generated by controlling the current values of the second light emitting diode rows B1 to B12. In addition, since the light emitting diodes 20 in each of the first light emitting diode rows A1 to A12 are arranged in the X direction, the Y direction pattern light can be generated by controlling the current value of the first light emitting diode rows A1 to A12.

第2発光ダイオード列B1〜B12の各列の発光ダイオード21はX方向に並んでいるので、第2発光ダイオード列B1〜B12の電流値制御によってY方向パターン光を生成することができる。また、第1発光ダイオード列A1〜A12の各列の発光ダイオード20はY方向に並んでいるので、第1発光ダイオード列A1〜A12の電流値制御によってX方向パターン光を生成することができる。   Since the light emitting diodes 21 of the second light emitting diode rows B1 to B12 are arranged in the X direction, Y direction pattern light can be generated by controlling the current values of the second light emitting diode rows B1 to B12. In addition, since the light emitting diodes 20 in each of the first light emitting diode rows A1 to A12 are arranged in the Y direction, the X direction pattern light can be generated by controlling the current values of the first light emitting diode rows A1 to A12.

また、図5Aに示す4つのY方向パターン光の波長と、図5Bに示す4つのX方向パターン光の波長とが異なっていてもよい。たとえば、第1発光ダイオード列A1〜A12の発光ダイオード20から赤色のパターン光を照射し、第2発光ダイオード列B1〜B12の発光ダイオード21から青色のパターン光を照射することで、Y方向パターン光の波長とX方向パターン光の波長とを変えることができる。この場合、Y方向パターン光とX方向パターン光とを同時にワークWに照射し、カラーカメラを備えた撮像部3で撮像すれば、Y方向パターン光の照射による生画像と、X方向パターン光の照射による生画像とを同時に得ることができ、撮像に要する時間を短縮できる。   Further, the wavelengths of the four Y-direction pattern lights shown in FIG. 5A may be different from the wavelengths of the four X-direction pattern lights shown in FIG. 5B. For example, the pattern light in the Y direction is emitted by irradiating red pattern light from the light emitting diodes 20 of the first light emitting diode arrays A1 to A12 and irradiating blue pattern light from the light emitting diodes 21 of the second light emitting diode arrays B1 to B12. And the wavelength of the X direction pattern light can be changed. In this case, if the workpiece W is simultaneously irradiated with the Y-direction pattern light and the X-direction pattern light, and captured by the imaging unit 3 including the color camera, the raw image by the irradiation of the Y-direction pattern light and the X-direction pattern light A raw image by irradiation can be obtained at the same time, and the time required for imaging can be shortened.

(パターン光の照度分布の周期)
パターン光の照度分布をsin波形に近似した波形で表すことができる場合、そのsin波形の周期がたとえば100mmになるようにすることができる。周期を100mm程度にしておくことで、正反射性の少ない(完全拡散反射体ではない)ワークWの表面を撮像しても、後述する形状の積み上げ処理を行うことができ、ワークWへの対応範囲を広くすることができる。また、sin波形の周期を100mm程度にしておくことで、撮像部3の集光系光学系32のレンズのMTFによる減衰が抑制される。ただし、コーティング面等を検査する場合には、周期を短くする方が好ましい場合があるので、周期は100mmに限られるものではない。周期を短くすることで、コーティング面を検査する際に下地の影響を少なくすることができ、また、表面勾配の微妙な違いを検出し易くなる。
(Period of illumination distribution of pattern light)
When the illuminance distribution of the pattern light can be represented by a waveform that approximates the sin waveform, the period of the sin waveform can be set to 100 mm, for example. By setting the period to about 100 mm, even when imaging the surface of the work W with less regular reflection (not a perfect diffuse reflector), it is possible to perform a stacking process of a shape to be described later. The range can be widened. Moreover, attenuation by MTF of the lens of the condensing system optical system 32 of the imaging unit 3 is suppressed by setting the period of the sin waveform to about 100 mm. However, when inspecting a coating surface or the like, it may be preferable to shorten the cycle, and therefore the cycle is not limited to 100 mm. By shortening the period, it is possible to reduce the influence of the base when inspecting the coating surface, and it becomes easy to detect a subtle difference in the surface gradient.

(デフレクトメトリによる検査用画像の生成)
この実施形態では、パターン光照明部2によって照明されたタイミングで撮像部3がワークWを撮像して複数の輝度画像を得て、撮像部3が撮像した複数の輝度画像に基づいて位相変位測定法(Phase Measuring Deflectometry : PMD、以下、「デフレクトメトリ」と呼ぶ。)の原理を利用して算出した位相マップを加工し、異なる種別の欠陥の検出が可能な複数の検査用画像を生成し、検査用画像を用いてワークWの検査を行うことができるように構成されている。複数の輝度画像を得る工程は、上述したように制御部41が照明トリガ信号及び撮像トリガ信号を出力してパターン光照明部2及び撮像部3を制御することで実行できる。検査用画像を生成する工程は図2に示す画像生成部42で行うことができる。
(Generation of inspection images by deflectometry)
In this embodiment, the imaging unit 3 captures the workpiece W at a timing illuminated by the pattern light illumination unit 2 to obtain a plurality of luminance images, and the phase displacement is measured based on the plurality of luminance images captured by the imaging unit 3. The phase map calculated using the principle of phase measurement (PMD, hereinafter referred to as “deflectometry”) is processed to generate multiple inspection images that can detect different types of defects. The workpiece W can be inspected using the inspection image. The process of obtaining a plurality of luminance images can be executed by the control unit 41 outputting the illumination trigger signal and the imaging trigger signal to control the pattern light illumination unit 2 and the imaging unit 3 as described above. The process of generating the inspection image can be performed by the image generation unit 42 shown in FIG.

画像生成部42では、撮像部3が撮像した複数の輝度画像に基づいて、ワークWの表面の反射状態を示す検査用画像と、ワークWの形状を示す検査用画像とを少なくとも生成する。ワークWの表面の反射状態を示す検査用画像としては、例えば、正反射成分画像、拡散反射成分画像等を挙げることができる。ワークWの形状を示す検査用画像としては、例えば、形状画像、深さ輪郭画像、光沢比画像等を挙げることができる。   The image generation unit 42 generates at least an inspection image indicating the reflection state of the surface of the workpiece W and an inspection image indicating the shape of the workpiece W based on the plurality of luminance images captured by the imaging unit 3. Examples of the inspection image indicating the reflection state of the surface of the workpiece W include a regular reflection component image and a diffuse reflection component image. Examples of the inspection image indicating the shape of the workpiece W include a shape image, a depth contour image, and a gloss ratio image.

以下、図21に示すフローチャート及び図22に示す模式図に従って検査用画像の生成について詳細に説明する。フローチャートのステップSA1では、制御部41がパターン光照明部2及び撮像部3を制御して複数の輝度画像(生画像)を得る。ステップSA1で得られた輝度画像は中間画像であり、記憶装置10等に一旦記憶されるが、表示部5には表示されない画像である。輝度画像は、異なる照明態様(複数のパターン光による照明)で照明されたワークWを撮像して得られた画像である。   Hereinafter, the generation of the inspection image will be described in detail according to the flowchart shown in FIG. 21 and the schematic diagram shown in FIG. In step SA1 of the flowchart, the control unit 41 controls the pattern light illumination unit 2 and the imaging unit 3 to obtain a plurality of luminance images (raw images). The luminance image obtained in step SA1 is an intermediate image, and is an image that is temporarily stored in the storage device 10 or the like but is not displayed on the display unit 5. The luminance image is an image obtained by imaging the workpiece W illuminated in different illumination modes (illumination by a plurality of pattern lights).

ステップSA1では、制御部41がパターン光照明部2に照明トリガ信号を出力する。パターン光照明部2が照明トリガ信号を受信すると、照明条件記憶部2aに記憶された照明条件に従ってパターン光を生成し、ワークWを照明する。このときの照明条件は、図5Aに示す0゜の場合のY方向パターン光、90゜の場合のY方向パターン光、180゜の場合のY方向パターン光、270゜の場合のY方向パターン光、図5Bに示す0゜の場合のX方向パターン光、90゜の場合のX方向パターン光、180゜の場合のX方向パターン光、270゜の場合のX方向パターン光を順番に生成する照明条件となっている。従って、パターン光照明部2は、照度分布の位相を受光素子3aの配列方向及びワークWの移動方向の両方向にシフトさせた合計8種類のパターン光(X方向で4種類、Y方向で4種類)を生成してワークWに順次照射する。   In step SA1, the control unit 41 outputs an illumination trigger signal to the pattern light illumination unit 2. When the pattern light illumination unit 2 receives the illumination trigger signal, the pattern light is generated according to the illumination condition stored in the illumination condition storage unit 2a, and the work W is illuminated. The illumination conditions at this time are as follows: Y direction pattern light at 0 °, Y direction pattern light at 90 °, Y direction pattern light at 180 °, and Y direction pattern light at 270 ° shown in FIG. 5A. FIG. 5B shows an illumination that sequentially generates an X direction pattern light at 0 °, an X direction pattern light at 90 °, an X direction pattern light at 180 °, and an X direction pattern light at 270 °. It is a condition. Accordingly, the pattern light illuminator 2 has a total of eight types of pattern light (four types in the X direction and four types in the Y direction) in which the phase of the illuminance distribution is shifted in both the arrangement direction of the light receiving elements 3a and the movement direction of the workpiece W. ) And sequentially irradiate the work W.

同時に、制御部41は撮像部3に撮像トリガ信号を出力する。撮像部3は撮像トリガ信号を受信すると、上記パターン光が照射される都度、ワークWを撮像する。8Kの画面サイズ(8192列×1024行)にする場合、1024回(行数)×パターン光の照明回数(8回)が、1つの輝度画像を得るために必要な照明回数となり、同じ数が撮像回数となる。   At the same time, the control unit 41 outputs an imaging trigger signal to the imaging unit 3. When receiving the imaging trigger signal, the imaging unit 3 captures an image of the workpiece W every time the pattern light is irradiated. When the screen size is 8K (8192 columns × 1024 rows), 1024 times (number of rows) × number of times of pattern light illumination (8 times) is the number of times of illumination necessary to obtain one luminance image. This is the number of times of imaging.

この実施形態では、1つの輝度画像を得るために複数の撮像トリガ信号(具体的には、1つ輝度画像の画素の行数と同じ数の撮像トリガ信号)を順次送信しているので、撮像トリガ信号を受信する都度、撮像タイミングのずれを解消できる。パターン光照明部2に対しても同様に照明トリガ信号を送信しており、しかも、照明トリガ信号と撮像トリガ信号とを同期させているので、照明タイミングのズレも解消できる。したがって、複数の輝度画像を生成する際に照明回数及び撮像回数が多くなったとしても、撮像タイミングと照明タイミングとのずれを極めて小さな状態で維持することができる。   In this embodiment, a plurality of imaging trigger signals (specifically, the same number of imaging trigger signals as the number of rows of pixels of one luminance image) are sequentially transmitted to obtain one luminance image. Every time a trigger signal is received, the shift in imaging timing can be eliminated. Similarly, since the illumination trigger signal is transmitted to the pattern light illumination unit 2 and the illumination trigger signal and the imaging trigger signal are synchronized, the deviation of the illumination timing can be eliminated. Therefore, even when the number of times of illumination and the number of times of imaging are increased when generating a plurality of luminance images, the deviation between the imaging timing and the illumination timing can be maintained in an extremely small state.

撮像時、パターン光の照射回数が8回であることから、8つの輝度画像が得られる。図22に示すように、4種類のX方向パターン光の照射時に撮像された4枚の輝度画像(X)と、4種類のY方向パターン光の照射時に撮像された4枚の輝度画像(Y)とが得られる。   Since the number of times of pattern light irradiation is 8 at the time of imaging, 8 luminance images are obtained. As shown in FIG. 22, four luminance images (X) captured at the time of irradiation with four types of X direction pattern light and four luminance images (Y at the time of irradiation of four types of Y direction pattern light) ) Is obtained.

実際に金属製ワークWを撮像して得た8つの輝度画像を図23に示す。図23の左側の画像は、上から順に、0゜の場合のX方向パターン光、90゜の場合のX方向パターン光、180゜の場合のX方向パターン光、270゜の場合のX方向パターン光をそれぞれ照射して得られた輝度画像である。図23の右側の画像は、上から順に、0゜の場合のY方向パターン光、90゜の場合のY方向パターン光、180゜の場合のY方向パターン光、270゜の場合のY方向パターン光をそれぞれ照射して得られた輝度画像である。尚、X方向パターン光のみ、またはY方向パターン光のみ照射するようにしてもよい。   FIG. 23 shows eight luminance images obtained by actually imaging the metal workpiece W. FIG. The images on the left side of FIG. 23 are, in order from the top, the X direction pattern light at 0 °, the X direction pattern light at 90 °, the X direction pattern light at 180 °, and the X direction pattern at 270 °. It is the brightness | luminance image obtained by each irradiating light. The images on the right side of FIG. 23 are, in order from the top, the Y direction pattern light at 0 °, the Y direction pattern light at 90 °, the Y direction pattern light at 180 °, and the Y direction pattern at 270 °. It is the brightness | luminance image obtained by each irradiating light. In addition, you may make it irradiate only X direction pattern light or only Y direction pattern light.

その後、図21に示すフローチャートのステップSA2に進み、ステップSA1で得られた8つの輝度画像に対してデフレクトメトリ処理を行う。これは画像生成部42で行うことができる。パターン光が照射されたワークWを撮像することで、得られた輝度画像の各画素値には、正反射成分と、拡散反射成分(+環境成分)とが含まれることになる。パターン光の照度分布の位相をX方向に90゜(π/2)ずつシフトさせて4回撮像しているので、各画素値はX方向パターン光の照射によって4種類得られる。1回目に撮像された輝度画像の画素値をIとし、2回目に撮像された輝度画像の画素値をIとし、3回目に撮像された輝度画像の画素値をIとし、4回目に撮像された輝度画像の画素値をIとすると、画素値I〜Iは次式1で与えられる。 Thereafter, the process proceeds to step SA2 in the flowchart shown in FIG. 21, and the deflectometry process is performed on the eight luminance images obtained in step SA1. This can be performed by the image generation unit 42. By imaging the workpiece W irradiated with the pattern light, each pixel value of the obtained luminance image includes a regular reflection component and a diffuse reflection component (+ environment component). Since the phase of the illuminance distribution of the pattern light is shifted by 90 ° (π / 2) in the X direction and imaged four times, each pixel value can be obtained by irradiation with the X direction pattern light. The pixel values of the captured luminance image for the first time and I 1, the pixel values of the captured luminance image for the second time and I 2, the pixel values of the captured luminance image the third time and I 3, 4 time Assuming that the pixel value of the luminance image captured at I is I 4 , the pixel values I 1 to I 4 are given by the following equation 1.

式1におけるRdは拡散反射成分であり、Rsは正反射成分であり、φsは正反射角度(位相)である。拡散反射成分、正反射成分、正反射角度は位相データであり、撮像部3が撮像した複数のライン画像に基づいて1ライン分の位相データを得ることができる。   In Equation 1, Rd is a diffuse reflection component, Rs is a regular reflection component, and φs is a regular reflection angle (phase). The diffuse reflection component, the regular reflection component, and the regular reflection angle are phase data, and phase data for one line can be obtained based on a plurality of line images captured by the imaging unit 3.

同様に、パターン光の照度分布の位相をY方向に90゜(π/2)ずつシフトさせて4回撮像しているので、各画素値はY方向パターン光の照射によって4種類得られる。Y方向についても画素値I〜Iは上記式1で表すことができる。 Similarly, since the phase of the illuminance distribution of the pattern light is shifted 90 ° (π / 2) in the Y direction and imaged four times, each pixel value can be obtained by irradiation with the Y direction pattern light. Also in the Y direction, the pixel values I 1 to I 4 can be expressed by Equation 1 above.

(正反射成分画像)
正反射成分画像は次式2で与えられる。式2では、逆相同士の差分により、拡散成分を排除している。図22に示すように、X方向とY方向でそれぞれ得られ、それらを合成することで正反射成分画像となる。図29に正反射成分画像の例を示す。尚、図29におけるノーマル画像とは、正反射成分及び拡散反射成分を含んだ画像である。
(Specular reflection component image)
The regular reflection component image is given by the following equation 2. In Equation 2, the diffusion component is excluded due to the difference between the opposite phases. As shown in FIG. 22, they are obtained in the X direction and the Y direction, respectively, and are combined to form a regular reflection component image. FIG. 29 shows an example of a regular reflection component image. Note that the normal image in FIG. 29 is an image including a regular reflection component and a diffuse reflection component.

(正反射角度)
正反射角度は次式3で与えられる。π/2ずれの正反射成分により、tanθ=sinθ/cosθとして角度を算出する。
(Regular reflection angle)
The regular reflection angle is given by the following equation 3. The angle is calculated as tan θ = sin θ / cos θ based on the regular reflection component shifted by π / 2.

(平均画像)
平均画像は拡散成分と環境成分とを含んでおり、次式4で与えられる。逆相同士の加算により、正反射成分を排除している。
(Average image)
The average image includes a diffusion component and an environmental component, and is given by the following expression 4. The regular reflection component is eliminated by adding the opposite phases.

(拡散反射成分画像)
拡散反射成分画像は次式5で与えられる。拡散反射成分画像の例を図29に示す。
(Diffuse reflection component image)
The diffuse reflection component image is given by the following equation 5. An example of the diffuse reflection component image is shown in FIG.

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

また、ステップSA5では位相成分について参照位相との差分を取る。このステップSA5では、参照平面の位相に対して差分を取得する。たとえば、使用者が、参照平面として球面状、円筒状、平面状等を指定し、これらとの差分を取得するようにする。あるいは、自由曲面で抽出させてもよい。X方向について補正後の位相(差分)が得られ、Y方向についても補正後の位相が得られる。図22に示す位相画像に相当する。補正後の位相画像の例を図29に示す。   In step SA5, the phase component is compared with the reference phase. In step SA5, a difference is acquired with respect to the phase of the reference plane. For example, the user designates a spherical shape, a cylindrical shape, a planar shape, or the like as the reference plane, and obtains a difference from these. Or you may make it extract with a free-form surface. A corrected phase (difference) is obtained for the X direction, and a corrected phase is also obtained for the Y direction. This corresponds to the phase image shown in FIG. An example of the phase image after correction is shown in FIG.

拡散反射成分画像、正反射成分画像、参照位相差分画像は出力画像となる。   The diffuse reflection component image, the regular reflection component image, and the reference phase difference image are output images.

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

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

次に、ステップSA7では、階層化された位相の画像に対して形状積み上げを行って形状画像を生成する。X方向とY方向の正反射角度に対し、Gauss−Jacobi法などによる積み上げ計算を行うことで、形状画像を得ることができる。形状画像は出力画像となる。形状画像の例を図29に示す。   Next, in step SA7, shape images are generated by performing shape accumulation on the layered phase images. A shape image can be obtained by performing accumulation calculation by the Gauss-Jacobi method or the like on the regular reflection angles in the X direction and the Y direction. The shape image becomes an output image. An example of the shape image is shown in FIG.

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

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

ステップSA8では簡易欠陥抽出を行う。簡易欠陥抽出の詳細については後述する。ステップSA8で簡易欠陥抽出を行った後に抽出された欠陥が表示された欠陥抽出画像を出力する。   In step SA8, simple defect extraction is performed. Details of the simple defect extraction will be described later. In step SA8, a defect extraction image displaying the defects extracted after the simple defect extraction is output.

また、画像生成部42では、光沢比画像を生成することもできる。光沢比画像は、正反射成分と拡散反射成分の比を表す画像である。光沢比画像では、正反射成分と拡散反射成分の割合が異なる画素が強調される。光沢比画像の例を図29に示す。   The image generation unit 42 can also generate a gloss ratio image. The gloss ratio image is an image representing the ratio between the regular reflection component and the diffuse reflection component. In the gloss ratio image, pixels having different ratios of the regular reflection component and the diffuse reflection component are emphasized. An example of the gloss ratio image is shown in FIG.

(フィルタ処理部40の構成)
図2に示すフィルタ処理部40は、画像生成部42で生成された各検査用画像に対して、フィルタ処理適用及びフィルタ処理非適用を個別に設定可能なフィルタ処理設定部40aと、フィルタ処理設定部40aによりフィルタ処理適用と設定された検査用画像にフィルタ処理を実行するフィルタ処理実行部40bとを有している。適用するフィルタの種類は特に限定されるものではないが、たとえば、検査用画像の種類に応じて選択することができ、シェーディング補正フィルタや平滑化フィルタ等を挙げることができる。
(Configuration of the filter processing unit 40)
The filter processing unit 40 shown in FIG. 2 includes a filter processing setting unit 40a capable of individually setting filter processing application and filter processing non-application for each inspection image generated by the image generation unit 42, and filter processing setting. A filter processing execution unit 40b that executes the filter process on the inspection image set to be applied by the unit 40a. The type of filter to be applied is not particularly limited. For example, it can be selected according to the type of inspection image, and examples include a shading correction filter and a smoothing filter.

図30に示すように、シェーディング補正フィルタは、形状画像、光沢比画像、深さ輪郭画像及び位相画像には適していない。その理由について述べると、形状画像は明るさの画像ではなく凹凸を示す画像であることからシェーディング補正フィルタの効果が得られないからである。また、光沢比画像は比を求めた画像であるのでそもそもシェーディングが消えた画像となっているからである。また、深さ輪郭画像及び位相画像は位相を考慮した補正が施されていてシェーディング補正フィルタを適用することの意味が無いからである。一方、正反射成分画像、拡散反射成分画像及びノーマル画像にはシェーディング補正フィルタが適している。   As shown in FIG. 30, the shading correction filter is not suitable for a shape image, a gloss ratio image, a depth contour image, and a phase image. The reason for this is that the effect of the shading correction filter cannot be obtained because the shape image is not a brightness image but an image showing unevenness. In addition, since the gloss ratio image is an image for which the ratio has been obtained, the shading disappears in the first place. In addition, the depth contour image and the phase image are corrected in consideration of the phase, and there is no point in applying the shading correction filter. On the other hand, a shading correction filter is suitable for regular reflection component images, diffuse reflection component images, and normal images.

図30におけるメディアンフィルタは平滑化フィルタであり、形状画像には適していないが、光沢比画像、深さ輪郭画像、位相画像、正反射成分画像、拡散反射成分画像及びノーマル画像には適している。   The median filter in FIG. 30 is a smoothing filter and is not suitable for a shape image, but is suitable for a gloss ratio image, a depth contour image, a phase image, a regular reflection component image, a diffuse reflection component image, and a normal image. .

フィルタ処理設定部40aは、検査用画像の種類に関する情報を得て、検査用画像に応じてフィルタ処理適用及びフィルタ処理非適用を自動的に設定するように構成されている。検査用画像の種類に関する情報は、画像生成部42から得ることができる。フィルタ処理設定部40aは、図30に示すように、シェーディング補正フィルタを、正反射成分画像、拡散反射成分画像及びノーマル画像には自動的に適用し、形状画像、光沢比画像、深さ輪郭画像及び位相画像には自動的に適用しない。また、フィルタ処理設定部40aは、メディアンフィルタを形状画像には自動的に適用しないが、光沢比画像、深さ輪郭画像、位相画像、正反射成分画像、拡散反射成分画像及びノーマル画像には自動的に適用する。   The filter processing setting unit 40a is configured to obtain information on the type of inspection image and automatically set application of filter processing and non-application of filter processing in accordance with the inspection image. Information regarding the type of inspection image can be obtained from the image generation unit 42. As shown in FIG. 30, the filter processing setting unit 40a automatically applies the shading correction filter to the regular reflection component image, the diffuse reflection component image, and the normal image, thereby forming the shape image, the gloss ratio image, the depth contour image. And not automatically applied to phase images. The filter processing setting unit 40a does not automatically apply the median filter to the shape image, but automatically applies it to the gloss ratio image, the depth contour image, the phase image, the regular reflection component image, the diffuse reflection component image, and the normal image. Applicable.

つまり、フィルタ処理の有効度を事前に調査しておき、フィルタ処理を適用する検査用画像を画像検査装置1にプリセットしておくことで、フィルタ処理設定部40aが検査用画像の種類に応じてシェーディング補正フィルタ及び平滑化フィルタの少なくとも一方の適用及び非適用を自動的に設定することができる。尚、プリセット内容を使用者が変更可能にしてもよい。   In other words, the effectiveness of the filter process is investigated in advance, and an inspection image to which the filter process is applied is preset in the image inspection apparatus 1, so that the filter processing setting unit 40a can respond to the type of the inspection image. Application and non-application of at least one of the shading correction filter and the smoothing filter can be automatically set. The preset content may be changed by the user.

フィルタ処理実行部40bは、プリセット内容に応じてフィルタ処理を実行することができるので、使用者は検査用画像毎にフィルタ処理の適用及び非適用や、適用する場合のフィルタ処理の種類を選択しなくてもよくなり、操作性が向上する。また、フィルタ処理設定部40aは、検査に用いる検査用画像にのみフィルタ処理を設定するように構成されているので、検査に用いられない検査用画像にはフィルタ処理が実行されないようになっている。   Since the filter processing execution unit 40b can execute the filter processing according to the preset content, the user selects the application and non-application of the filter processing for each inspection image, and the type of the filter processing in the case of application. It is not necessary to improve the operability. Further, since the filter processing setting unit 40a is configured to set the filter processing only on the inspection image used for the inspection, the filtering processing is not executed on the inspection image that is not used for the inspection. .

プリセットしておくフィルタ処理の種類は、有効度を事前に調査することができるフィルタであって、かつ、検査用画像によって効果の有無が現れるフィルタであればよい。   The type of filter processing to be preset may be a filter whose effectiveness can be investigated in advance and a filter that shows the effect of the inspection image.

図25に示す欠陥抽出用インターフェース58の表示画像選択用プルダウンメニュー58eにより検査用画像を選択することができる。表示画像選択用プルダウンメニュー58eにより検査用画像として選択され、かつ、フィルタ処理実行部40bによるフィルタ処理実行後の検査用画像(正反射成分画像、拡散反射成分画像等)と、検査用画像として選択され、かつ、フィルタ処理実行部40bによるフィルタ処理が実行されていない検査用画像(形状画像等)とを同時に表示部5に表示させることができる。フィルタ処理に適した検査用画像であっても、検査用画像として選択されていない検査用画像(表示部5に表示されない検査用画像)に対してはフィルタ処理実行部40bがフィルタ処理を行わないようにすることができる。この時点でフィルタ処理が行われていなかったとしても、後に、検査用画像として選択された段階でフィルタ処理実行部40bがフィルタ処理を行えばよい。   An inspection image can be selected by a display image selection pull-down menu 58e of the defect extraction interface 58 shown in FIG. Selected as an inspection image by the display image selection pull-down menu 58e and selected as an inspection image (regular reflection component image, diffuse reflection component image, etc.) after the filter processing execution by the filter processing execution unit 40b and the inspection image In addition, the inspection image (shape image or the like) that has not been subjected to the filter processing by the filter processing execution unit 40b can be simultaneously displayed on the display unit 5. Even if the inspection image is suitable for the filter process, the filter processing execution unit 40b does not perform the filter process on the inspection image that has not been selected as the inspection image (the inspection image that is not displayed on the display unit 5). Can be. Even if the filtering process is not performed at this time, the filtering process execution unit 40b may perform the filtering process at a stage where the image is selected as the inspection image later.

尚、検査用画像の種類に応じてフィルタ処理適用及びフィルタ処理非適用を自動的に設定することを前提として、自動的に設定されたフィルタ処理を使用者が非適用にしたり、自動的に設定されたフィルタ処理の種類を使用者が変更することができるようにしてもよい。たとえば、使用者が、フィルタ処理が不要であると判断する検査用画像に対してフィルタ処理を非適用とする操作を受け付けるように、フィルタ処理設定部40aを構成することができる。操作の具体例としては、表示部5にインターフェースを表示させ、当該インターフェースに組み込まれている各種ボタンやプルダウンメニュー等の操作を挙げることができる。   In addition, on the premise that filter processing application and filter processing non-application are automatically set according to the type of inspection image, the user automatically disables or sets the automatically set filter processing. The user may be able to change the type of the filtered processing. For example, the filter processing setting unit 40a can be configured to accept an operation in which the user does not apply the filter processing to an inspection image that is determined to require no filter processing. As a specific example of the operation, an interface can be displayed on the display unit 5, and various buttons and pull-down menus incorporated in the interface can be exemplified.

フィルタ処理実行部40bは、複数の検査用画像に対してフィルタ処理を実行している場合に、フィルタ処理を実行した複数の検査用画像に対して該検査用画像に実行しているフィルタ処理を一括して非実行にすることが可能に構成されていてもよい。使用者が、検査用画像に対してフィルタ処理を非適用とする操作をした場合に、各検査用画像に対して自動的にフィルタ処理を非実行にすることができる。フィルタ処理を一括して非実行にした後、元に戻す操作、即ち、複数の検査用画像に対してフィルタ処理を実行する操作を受け付けるように構成することもできる。   The filter processing execution unit 40b performs the filter processing executed on the inspection image on the plurality of inspection images that have been subjected to the filter processing when the filter processing is executed on the plurality of inspection images. It may be configured to be non-executable in a batch. When the user performs an operation of not applying the filter process to the inspection image, the filter process can be automatically disabled for each inspection image. It is also possible to accept an operation for returning to the original state, that is, an operation for executing the filter processing on a plurality of inspection images, after the filter processing is collectively disabled.

各フィルタ処理を行う際には、図31に示すように、フィルタ処理の強さ等の各種パラメータを設定することができる。フィルタ処理実行部40bは、フィルタ処理設定部40aによりフィルタ処理適用と設定された検査用画像に対して、フィルタ処理のパラメータを一括に設定及び変更することが可能に構成されている。図31に示すパラメータ設定用インターフェースでパラメータを設定又は変更すると、その操作が、フィルタ処理適用と設定された他の検査用画像に対してフィルタ処理実行部40bによって反映される。   When performing each filter process, as shown in FIG. 31, various parameters such as the strength of the filter process can be set. The filter processing execution unit 40b is configured to be able to collectively set and change filter processing parameters for the inspection image set to be applied with the filter processing by the filter processing setting unit 40a. When a parameter is set or changed using the parameter setting interface shown in FIG. 31, the operation is reflected by the filter processing execution unit 40b on another inspection image set to apply the filter processing.

また、フィルタ処理を適用する検査用画像を画像検査装置1にプリセットしておかなくてもよい。この場合、使用者が、インターフェースに組み込まれている各種ボタンやプルダウンメニュー等を操作して、各検査用画像に対して個別にまたは一括してフィルタ処理の適用及び非適用を設定することになる。インターフェースに組み込まれている各種ボタンやプルダウンメニュー等が、フィルタ処理設定部になる。   In addition, the image for inspection to which the filter process is applied may not be preset in the image inspection apparatus 1. In this case, the user operates the various buttons and pull-down menus incorporated in the interface to set application / non-application of the filter processing individually or collectively for each inspection image. . Various buttons and pull-down menus incorporated in the interface serve as a filter processing setting unit.

図32は、フィルタ処理前の検査用画像と、フィルタ処理後の検査用画像とを示す図である。フィルタ処理は、第1画像表示領域58aに表示されている元画像1(正反射成分画像)と、第2画像表示領域58bに表示されている元画像2(拡散反射成分画像)とに適用している。図32に示すように、正反射成分画像及び拡散反射成分画像のシェーディングが補正されて欠陥部が見えやすくなる。一方、第3画像表示領域58cに表示されている元画像3(形状画像)にはフィルタ処理が適用されていないので、形状に係る欠陥部は見えやすいままとなっている。   FIG. 32 is a diagram illustrating an inspection image before filter processing and an inspection image after filter processing. The filtering process is applied to the original image 1 (regular reflection component image) displayed in the first image display area 58a and the original image 2 (diffuse reflection component image) displayed in the second image display area 58b. ing. As shown in FIG. 32, the shading of the regular reflection component image and the diffuse reflection component image is corrected, and the defect portion is easily seen. On the other hand, since the filtering process is not applied to the original image 3 (shape image) displayed in the third image display area 58c, the defect portion related to the shape remains easily visible.

(簡易欠陥抽出)
簡易欠陥抽出は、図24に簡易欠陥抽出の概念を示すように、ワークWの線キズ(欠陥)を検査し易い画像1、ワークWの汚れ(欠陥)を検査し易い画像2、ワークWの打痕(欠陥)を検査し易い画像3をそれぞれ生成した後、画像1〜3に現れている欠陥を欠陥抽出画像に表示させる工程である。欠陥抽出画像は、画像1〜3に現れている欠陥を抽出して表示することができる画像であり、抽出した欠陥を1つの画像に合成して表示させることができるので合成欠陥画像と呼ぶこともできる。
(Simple defect extraction)
As shown in the concept of simple defect extraction in FIG. 24, the simple defect extraction is an image 1 in which line flaws (defects) of the workpiece W are easily inspected, an image 2 in which dirt (defects) in the workpiece W is easily inspected, and This is a step of displaying the defects appearing in the images 1 to 3 on the defect extraction image after generating the images 3 that are easy to inspect dents (defects). The defect extraction image is an image that can extract and display the defects appearing in the images 1 to 3, and can be displayed by combining the extracted defects into one image, and is therefore referred to as a combined defect image. You can also.

たとえば、正反射成分画像は、正反射を鈍らせる汚れや、形状変化はないものの正反射の鈍いキズ、あるいは形状変化によって正反射が返ってこないキズ等の確認をし易い画像である。拡散反射画像は、ワークWの表面のテクスチャの状態(具体的には印刷物の文字や黒ずんだ汚れ等)を確認し易い画像である。形状画像は、特徴サイズに応じて周囲画素を見ながら位相の変化を積み上げた画像である。ここで、形状画像の特徴サイズを大きく設定すると、形状変化のなかでも比較的浅くて面積の広い凹凸を捉えることができる。一方、形状画像の特徴サイズを小さく設定すると、線キズや面積の小さなキズを捉えることができる。また、形状画像に現れにくい欠陥(たとえば細いキズや深い傷)は、正反射成分画像に現れやすい傾向がある。また、深さ輪郭画像は、基準となる平面を算出し、この基準平面からのずれを画像化している。深さ輪郭画像からは、線キズや面積の小さなキズを捉えることができる。つまり、画像生成部42は、撮像部3が撮像した複数の輝度画像に基づいて、異なる種別の欠陥の検出が可能な複数の検査用画像を生成することができる。また、画像生成部42が生成する画像は上述した画像に限られるものではない。   For example, the regular reflection component image is an image that makes it easy to check dirt that makes regular reflection dull, a scratch that does not change in shape but has a dull regular reflection, or a scratch that does not return regular reflection due to a shape change. The diffuse reflection image is an image in which it is easy to confirm the state of the texture on the surface of the workpiece W (specifically, characters on the printed matter, darkened stains, etc.). The shape image is an image obtained by accumulating changes in phase while viewing surrounding pixels according to the feature size. Here, when the feature size of the shape image is set to be large, it is possible to capture unevenness having a relatively shallow area and a large area even in the shape change. On the other hand, if the feature size of the shape image is set to be small, it is possible to catch a line scratch or a small scratch. In addition, defects that are difficult to appear in the shape image (for example, fine scratches or deep scratches) tend to appear in the regular reflection component image. In addition, the depth contour image calculates a reference plane, and images the deviation from the reference plane. From the depth contour image, it is possible to capture a line scratch or a small scratch. That is, the image generation unit 42 can generate a plurality of inspection images capable of detecting different types of defects based on the plurality of luminance images captured by the imaging unit 3. Further, the image generated by the image generation unit 42 is not limited to the image described above.

画像生成部42で生成された正反射成分画像、拡散反射画像、形状画像、深さ輪郭画像、光沢比画像、欠陥抽出画像等は、検査用画像であり、表示部5に表示させることができる。表示部5には、画像生成部42で生成された画像のうち、1つのみを表示させてもよいし、任意の複数の画像を表示させてもよい。表示部5に表示させる画像は、使用者が選択できるようにするのが好ましい。   The specular reflection component image, diffuse reflection image, shape image, depth contour image, gloss ratio image, defect extraction image, and the like generated by the image generation unit 42 are inspection images and can be displayed on the display unit 5. . Only one of the images generated by the image generation unit 42 may be displayed on the display unit 5 or a plurality of arbitrary images may be displayed. It is preferable that the image displayed on the display unit 5 can be selected by the user.

たとえば、図25に示す欠陥抽出用インターフェース58をUI生成部43が生成し、欠陥抽出用インターフェース58を表示部5に表示させることができる。欠陥抽出用インターフェース58には、元画像1を表示させる第1画像表示領域58aと、元画像2を表示させる第2画像表示領域58bと、元画像3を表示させる第3画像表示領域58cと、欠陥抽出画像を表示させる第4画像表示領域58dとが組み込まれている。画像表示領域の数は4つに限られるものではなく、3つ以下であってもよいし、5つ以上であってもよい。図25では、元画像1として正反射成分画像が選択され、元画像2として拡散反射成分画像が選択され、元画像3として形状画像が選択されているが、画像生成部42で生成された画像であれば、どの画像をどの領域に表示してもよい。   For example, the UI generation unit 43 can generate the defect extraction interface 58 shown in FIG. 25, and the defect extraction interface 58 can be displayed on the display unit 5. In the defect extraction interface 58, a first image display area 58a for displaying the original image 1, a second image display area 58b for displaying the original image 2, a third image display area 58c for displaying the original image 3, A fourth image display area 58d for displaying the defect extraction image is incorporated. The number of image display areas is not limited to four, but may be three or less, or may be five or more. In FIG. 25, the regular reflection component image is selected as the original image 1, the diffuse reflection component image is selected as the original image 2, and the shape image is selected as the original image 3, but the image generated by the image generation unit 42 Any image may be displayed in any region.

第1〜第3画像表示領域58a〜58cに表示されている画像を使用者が他の画像に切り替えることもできる。表示されている画像を切り替える場合には、たとえば表示領域をマウス7の操作等によって選択してアクティブ化しておき、欠陥抽出用インターフェース58に組み込まれている表示画像選択用プルダウンメニュー58eにより、画像の選択を行うことができる。この表示画像選択用プルダウンメニュー58eは、画像生成部42で生成された複数の検査用画像の中から、検査に用いる少なくとも一つの検査用画像を選択する画像選択部である。   The user can also switch the images displayed in the first to third image display areas 58a to 58c to other images. When switching the displayed image, for example, the display region is selected and activated by operating the mouse 7 or the like, and the display image selection pull-down menu 58e incorporated in the defect extraction interface 58 is used to select the image. Selection can be made. The display image selection pull-down menu 58e is an image selection unit that selects at least one inspection image used for inspection from a plurality of inspection images generated by the image generation unit 42.

表示画像選択用プルダウンメニュー58eには、正反射成分画像、拡散反射画像、形状画像、深さ輪郭画像、光沢比画像等が選択肢として表示されるようになっている。選択された検査用画像を使用して画像生成部42が欠陥抽出画像を生成する。表示画像選択用プルダウンメニュー58eは、画像生成部42により生成された複数の検査用画像のなかから、欠陥抽出画像を生成するための検査用画像の選択を受け付けることができる画像選択受付部である。   In the display image selection pull-down menu 58e, a specular reflection component image, a diffuse reflection image, a shape image, a depth contour image, a gloss ratio image, and the like are displayed as options. Using the selected inspection image, the image generation unit 42 generates a defect extraction image. The display image selection pull-down menu 58e is an image selection reception unit that can receive selection of an inspection image for generating a defect extraction image from among a plurality of inspection images generated by the image generation unit 42. .

画像検査装置1は、表示部5に表示された検査用画像のうち、一の検査用画像の一部の領域を指定して拡大することができるように構成されている。たとえば、使用者が、図25の第1画像表示領域58aに表示されている画像上で破線にて示す領域B1を拡大したい場合には、マウス7のポインタを始点PAに置き、そのまま終点PBまでマウス7でドラッグ操作を行うと、始点PAと終点PBとを結ぶ直線を対角線とする矩形領域が指定され、この領域が領域B1となる。この操作は、一の検査用画像の一部の領域を指定して拡大する拡大操作に相当する操作であり、この拡大操作は、制御ユニット4の操作受付部46で受け付けられる。拡大操作によって指定する領域の形状は、たとえば円形、自由曲線で囲まれた形状等であってもよい。また、拡大操作は、マウス7やキーボード6のいずれの操作で行うようにしてもよい。   The image inspection apparatus 1 is configured to be able to designate and enlarge a partial area of one inspection image among the inspection images displayed on the display unit 5. For example, when the user wants to enlarge the area B1 indicated by the broken line on the image displayed in the first image display area 58a of FIG. 25, the user places the pointer of the mouse 7 at the start point PA and continues to the end point PB. When a drag operation is performed with the mouse 7, a rectangular area whose diagonal is a straight line connecting the start point PA and the end point PB is designated, and this area becomes the area B1. This operation is an operation corresponding to an enlargement operation for enlarging by designating a partial region of one inspection image, and this enlargement operation is accepted by the operation accepting unit 46 of the control unit 4. The shape of the region designated by the enlargement operation may be, for example, a circle, a shape surrounded by a free curve, or the like. The enlargement operation may be performed by any operation of the mouse 7 and the keyboard 6.

使用者による拡大操作を受け付けると、制御ユニット4の表示制御部47は、第1画像表示領域58aに表示されている画像の領域B1を拡大して、図26に示すように第1画像表示領域58aに表示する。さらに、表示制御部47は、図25に示す表示部5に表示された他の検査用画像(第2〜第4画像表示領域58b〜58dに表示されている画像)において、第1画像表示領域58aに表示されている画像で指定された領域B1に対応する各領域B2を、上記拡大操作に連動して同倍率で拡大して表示部5に表示させる(図26参照)。領域B1の拡大と領域B2の拡大とを同時に行うことができるが、多少の時間的遅れを伴っていてもよい。拡大操作は、第1〜第4画像表示領域58a〜58dに表示されているどの検査用画像に対して行ってもよく、どの検査用画像に対して拡大操作を行っても他の検査用画像を拡大操作に連動して同倍率で拡大して表示部5に表示させることができる。   When the enlargement operation by the user is accepted, the display control unit 47 of the control unit 4 enlarges the area B1 of the image displayed in the first image display area 58a, and the first image display area as shown in FIG. 58a. Furthermore, the display control unit 47 displays the first image display area in the other inspection images (images displayed in the second to fourth image display areas 58b to 58d) displayed on the display unit 5 shown in FIG. Each area B2 corresponding to the area B1 designated in the image displayed at 58a is enlarged at the same magnification in conjunction with the enlargement operation and displayed on the display unit 5 (see FIG. 26). Although the expansion of the area B1 and the expansion of the area B2 can be performed at the same time, it may be accompanied by some time delay. The enlargement operation may be performed on any inspection image displayed in the first to fourth image display regions 58a to 58d, and any inspection image may be performed regardless of the inspection operation performed on any inspection image. Can be enlarged and displayed on the display unit 5 at the same magnification in conjunction with the enlargement operation.

また、操作受付部46は、表示部5に表示された検査用画像のうち、一の検査用画像を縮小する縮小操作を受け付け可能に構成されていてもよい。縮小操作は、たとえばマウス7のクリック操作やキーボード6のキー操作等で行うことができる。表示制御部47は、表示部5に表示された他の検査用画像を、縮小操作に連動して同倍率で縮小して表示部5に表示させるように構成されていてもよい。   Further, the operation receiving unit 46 may be configured to be able to receive a reduction operation for reducing one of the inspection images displayed on the display unit 5. The reduction operation can be performed by, for example, a click operation of the mouse 7 or a key operation of the keyboard 6. The display control unit 47 may be configured to reduce other inspection images displayed on the display unit 5 at the same magnification in conjunction with the reduction operation and display them on the display unit 5.

また、操作受付部46は、表示部5に表示された検査用画像のうち、一の検査用画像をスクロールするスクロール操作を受け付け可能に構成されていてもよい。スクロール操作は、たとえばマウス7のクリック操作やキーボード7のキー操作等で行うことができる。表示制御部46は、表示部5に表示された他の検査用画像を、スクロール操作に連動してスクロールさせるように構成されていてもよい。スクロールの方向は、表示部5の上下方向及び左右方向、斜め方向の任意の方向とすることができる。   Further, the operation receiving unit 46 may be configured to be able to receive a scroll operation for scrolling one of the inspection images displayed on the display unit 5. The scroll operation can be performed by, for example, a click operation of the mouse 7 or a key operation of the keyboard 7. The display control unit 46 may be configured to scroll other inspection images displayed on the display unit 5 in conjunction with the scroll operation. The direction of scrolling can be any direction of the display unit 5 in the vertical direction, the horizontal direction, and the diagonal direction.

図25に示す欠陥抽出用インターフェース58には詳細表示を行うか否かを選択する詳細表示ボタン58fが組み込まれている。詳細表示ボタン58fを操作して詳細表示を行うと、図26に示すように、しきい値設定用領域58iが表示される。しきい値設定用領域58iには、元画像1〜3の各しきい値を表示することができるようになっている。しきい値とは、非欠陥部とすべき画素値範囲を規定するための値である。たとえば、各画素の明るさレベルを0〜255の256段階とした場合に、非欠陥部とすべき画素値範囲を0〜255のうちの具体的な数値によって規定することができる。黒を非欠陥部としてもよいし、反対に白を非欠陥部としてもよい。   A defect display interface 58 shown in FIG. 25 incorporates a detail display button 58f for selecting whether to perform detail display. When detailed display is performed by operating the detailed display button 58f, a threshold setting area 58i is displayed as shown in FIG. Each threshold value of the original images 1 to 3 can be displayed in the threshold value setting area 58i. The threshold value is a value for defining a pixel value range to be a non-defective part. For example, when the brightness level of each pixel is set to 256 levels from 0 to 255, the pixel value range to be a non-defective part can be defined by a specific numerical value from 0 to 255. Black may be a non-defect portion, and white may be a non-defect portion.

(背景選択法)
しきい値の設定方法は2通りある。1つ目は背景を選択する方法である。図25に示す欠陥抽出用インターフェース58には、背景選択ボタン58gが設けられており、この背景選択ボタン58gを押してから、各検査用画像(元画像1〜3)の背景を選択する。背景選択は、上記拡大操作後の拡大表示された元画像1〜3に対して行うことができる。背景とは、ワークWの欠陥部以外の部分、即ちワークWの非欠陥部のことである。
(Background selection method)
There are two threshold setting methods. The first is a method for selecting a background. The defect extraction interface 58 shown in FIG. 25 is provided with a background selection button 58g, and the background of each inspection image (original images 1 to 3) is selected after the background selection button 58g is pressed. Background selection can be performed on the original images 1 to 3 that have been enlarged and displayed after the enlargement operation. The background is a portion other than the defective portion of the workpiece W, that is, a non-defective portion of the workpiece W.

背景を選択する方法としては、たとえばマウス7のポインタを、元画像1〜3におけるワークWの非欠陥部に置いてクリックする方法やタッチパネル操作する方法がある。これによってワークWの非欠陥部の位置(X座標、Y座標)を指定できる。非欠陥部の位置の指定は、元画像1〜3のうち、任意の1つの画像に対して複数回行うことができる。また、元画像1〜3のうち、任意の1つの画像(第1検査用画像)に対して非欠陥部の位置の指定を行った後、別の画像に対しても非欠陥部の位置の指定を行うことができる。尚、背景選択を行うと、非欠陥部とすべき画素値範囲が広がる方向に変わる。   As a method for selecting the background, for example, there are a method in which the pointer of the mouse 7 is placed on a non-defective part of the work W in the original images 1 to 3 and clicked, or a touch panel operation is performed. Thereby, the position (X coordinate, Y coordinate) of the non-defect portion of the workpiece W can be designated. The designation of the position of the non-defect portion can be performed a plurality of times for any one of the original images 1 to 3. In addition, after specifying the position of the non-defective portion with respect to any one image (first inspection image) among the original images 1 to 3, the position of the non-defective portion with respect to another image is also specified. You can specify. Note that when the background is selected, the pixel value range to be a non-defective portion is changed in a widening direction.

図33に示すフローチャートに基づいて説明する。使用者がワークWの非欠陥部の位置の指定(1回目)を行うと(ステップSB1)、制御ユニット4の内部処理として、その1回目の非欠陥部の位置の指定は、制御ユニット4の位置指定受付部48によって受け付けられる。位置指定受付部48で受け付けた非欠陥部の位置情報(第1非欠陥部位置情報)は座標形式として記憶装置10の位置情報記憶部10bに記憶される。   This will be described based on the flowchart shown in FIG. When the user designates the position of the non-defective part of the workpiece W (first time) (step SB1), the first designation of the position of the non-defective part is performed by the control unit 4 as internal processing of the control unit 4. It is received by the position specification receiving unit 48. The position information (first non-defect portion position information) received by the position designation receiving unit 48 is stored in the position information storage unit 10b of the storage device 10 as a coordinate format.

制御ユニット4の設定部49は、位置指定受付部48で受け付けた非欠陥部の位置情報を位置情報記憶部10bから読み出し、位置指定受付部48により受け付けた非欠陥部の位置の画素値を得る。具体的には、非欠陥部の位置の画素(クリックされた画素)だけではなく、その画素の周囲の3×3の領域の画素値(9つの画素値)を取得し、最大値と最小値とを求める。たとえば最大値が200であれば、背景選択の感度(たとえば5)の3倍をマージンとし、200+5×3=215を最大値とする。また、たとえば最小値が80であれば、80−5×3=65を最小値とする。この場合、非欠陥部とすべき画素値範囲は、215〜65となる。設定部49は、非欠陥部の位置の画素値に基づいて、非欠陥部とすべき画素値範囲を、表示部5に表示されている複数の検査用画像(上記第1検査用画像を含む)に対して自動的に設定する(ステップSC1)。上記感度やマージンは一例である。   The setting unit 49 of the control unit 4 reads out the position information of the non-defective part received by the position designation receiving unit 48 from the position information storage unit 10b, and obtains the pixel value of the position of the non-defective part received by the position designation receiving unit 48. . Specifically, not only the pixel at the position of the non-defective part (clicked pixel) but also the pixel values (9 pixel values) of the 3 × 3 region around the pixel are obtained, and the maximum value and the minimum value are obtained. And ask. For example, if the maximum value is 200, the margin of 3 times the background selection sensitivity (for example, 5) is set as the margin, and 200 + 5 × 3 = 215 is set as the maximum value. For example, if the minimum value is 80, 80−5 × 3 = 65 is set as the minimum value. In this case, the pixel value range to be a non-defect portion is 215 to 65. The setting unit 49 includes a plurality of inspection images (including the first inspection image) displayed on the display unit 5 based on the pixel value at the position of the non-defective portion. ) Is automatically set (step SC1). The above sensitivity and margin are examples.

その後、使用者がワークWの非欠陥部の位置の指定(2回目)を行うと(ステップSB2)、制御ユニット4の内部処理として、その2回目の非欠陥部の位置の指定は、制御ユニット4の位置指定受付部48によって受け付けられる。位置指定受付部48で受け付けた非欠陥部の位置情報(第2非欠陥部位置情報)は同様に記憶装置10の位置情報記憶部10bに記憶される。   Thereafter, when the user designates the position of the non-defective part of the workpiece W (second time) (step SB2), the second designation of the position of the non-defective part is performed as an internal process of the control unit 4. 4 is received by the position designation receiving unit 48. The position information of the non-defect portion (second non-defect portion position information) received by the position designation receiving unit 48 is similarly stored in the position information storage unit 10 b of the storage device 10.

制御ユニット4の設定部49は、位置指定受付部48で受け付けた2回目の非欠陥部の位置情報を位置情報記憶部10bから読み出し、位置指定受付部48により受け付けた2回目の非欠陥部の位置の画素値を得る。設定部49は、2回目の非欠陥部の位置の画素値に基づいて、非欠陥部とすべき画素値範囲を、表示部5に表示されている複数の検査用画像(上記第1検査用画像を含む)に対して自動的に設定する(ステップSC2)。   The setting unit 49 of the control unit 4 reads out the position information of the second non-defective portion received by the position designation receiving unit 48 from the position information storage unit 10b, and sets the second non-defective portion received by the position designation receiving unit 48. Get the pixel value of the position. Based on the pixel value at the position of the second non-defective part, the setting unit 49 sets a pixel value range that should be a non-defective part to a plurality of inspection images displayed on the display unit 5 (the first inspection-use image). (Including image) is automatically set (step SC2).

使用者がワークWの非欠陥部の位置の指定(3回目)を行うと(ステップSB3)、同様にして、3回目の非欠陥部の位置の画素値に基づいて、非欠陥部とすべき画素値範囲を、表示部5に表示されている複数の検査用画像(上記第1検査用画像を含む)に対して自動的に設定する(ステップSC3)。つまり、位置指定受付部48では、非欠陥部の位置の指定を複数回受け付けることができる。   When the user designates the position of the non-defect portion of the workpiece W (third time) (step SB3), the user should similarly make the non-defect portion based on the pixel value of the third non-defect portion position. The pixel value range is automatically set for a plurality of inspection images (including the first inspection image) displayed on the display unit 5 (step SC3). That is, the position designation receiving unit 48 can receive the designation of the position of the non-defective part a plurality of times.

また、表示部5に表示されておらずかつフィルタ処理が行われていない検査用画像(第2検査用画像)が、図25に示す欠陥抽出用インターフェース58の表示画像選択用プルダウンメニュー58eにより選択されると、表示部5に表示される画像の切り替えが行われる(ステップSB4)。表示部5に表示されておらずかつフィルタ処理が行われていない検査用画像が選択された際、設定部49は、位置情報記憶部10bに記憶された非欠陥部の位置を示す複数の位置情報(ステップSB1〜3で記憶した位置情報)を読み出し、当該検査用画像における位置情報に対応する画素値を参照する。その後、非欠陥部とすべき画素値範囲を更新する(ステップSC4)。この検査用画像に対してフィルタ処理部40がフィルタ処理を行う。切り替え後の検査用画像に対しても背景選択を行うことができ(ステップSB5)、このときに指定された位置情報(第2非欠陥部位置情報)は位置情報記憶部10bに記憶される。   Further, an inspection image (second inspection image) that is not displayed on the display unit 5 and that has not been filtered is selected by a display image selection pull-down menu 58e of the defect extraction interface 58 shown in FIG. Then, the image displayed on the display unit 5 is switched (step SB4). When an inspection image that is not displayed on the display unit 5 and that has not been filtered is selected, the setting unit 49 has a plurality of positions indicating the positions of the non-defective portions stored in the position information storage unit 10b. Information (position information stored in steps SB1 to SB3) is read, and a pixel value corresponding to the position information in the inspection image is referred to. Thereafter, the pixel value range to be a non-defect portion is updated (step SC4). The filter processing unit 40 performs filter processing on the inspection image. Background selection can also be performed on the inspection image after switching (step SB5), and the position information (second non-defective portion position information) designated at this time is stored in the position information storage unit 10b.

さらに、表示部5に表示されておらずかつフィルタ処理が行われていない検査用画像が上記第2検査用画像として選択された後、更に別の画像が第3検査用画像として選択されることがある(ステップSB6)。第3検査用画像が選択された際に、設定部49は、位置情報記憶部10bに記憶された非欠陥部の位置を示す複数の位置情報(ステップSB1〜3、SB5で記憶した位置情報)を読み出し、第3検査用画像における位置情報に対応する画素値を参照して非欠陥部とすべき画素値範囲を更新する。図示しないが、第3検査用画像に対しても背景選択を行うことができ、このときに指定された位置情報(第3非欠陥部位置情報)は位置情報記憶部10bに記憶される。フィルタ処理部40は第3検査用画像に対してフィルタ処理を行う。   Furthermore, after an inspection image that is not displayed on the display unit 5 and that has not been filtered is selected as the second inspection image, another image is selected as the third inspection image. (Step SB6). When the third inspection image is selected, the setting unit 49 stores a plurality of pieces of position information (position information stored in steps SB1 to SB5) indicating the position of the non-defective part stored in the position information storage unit 10b. , And a pixel value range to be a non-defective part is updated with reference to pixel values corresponding to position information in the third inspection image. Although not shown, background selection can also be performed for the third inspection image, and the position information (third non-defect portion position information) designated at this time is stored in the position information storage unit 10b. The filter processing unit 40 performs filter processing on the third inspection image.

すなわち、設定部49は、上記第3検査用画像が選択された際に、位置情報記憶部10bに記憶された上記第2検査用画像における非欠陥部の位置を示す位置情報(第2非欠陥部位置情報)を読み出し、第2検査用画像における位置情報に対応する画素値を参照して非欠陥部とすべき画素値範囲を更新することができる。また、設定部49は、第3検査用画像が選択された際に、位置情報記憶部10bに記憶された第1検査用画像における非欠陥部の位置を示す位置情報(第1非欠陥部位置情報)と、第2検査用画像における非欠陥部の位置を示す位置情報(第2非欠陥部位置情報)とを読み出し、第3検査用画像における第1及び第2非欠陥部位置情報に対応する画素値を参照して非欠陥部とすべき画素値範囲を更新するように構成されていてもよい。背景選択の履歴は、たとえば10回分だけ保存しておき、それ以降は古いものから削除することもできる。   That is, when the third inspection image is selected, the setting unit 49 has positional information (second non-defect) indicating the position of the non-defect portion in the second inspection image stored in the positional information storage unit 10b. Part position information) is read out, and a pixel value range to be a non-defective part can be updated by referring to a pixel value corresponding to the position information in the second inspection image. The setting unit 49 also includes position information (first non-defect portion position) indicating the position of the non-defect portion in the first inspection image stored in the position information storage unit 10b when the third inspection image is selected. Information) and position information indicating the position of the non-defect portion in the second inspection image (second non-defect portion position information) are read and correspond to the first and second non-defect portion position information in the third inspection image. The pixel value range to be a non-defective part may be updated with reference to the pixel value to be updated. The background selection history can be saved, for example, for 10 times, and thereafter the oldest can be deleted.

ワークWの欠陥部ではなく背景を選択する理由は次のとおりである。すなわち、仮に、欠陥部を表示部5の画面上で1つずつクリックして指定していく方法だと、複数の欠陥条件設定を行わなければならず、操作が煩雑になる。また、使用者はそれぞれの欠陥部のサンプルを用意しなければならないのに加えて、未知の欠陥部には対応できないし、線キズなどの小さい欠陥部の指定作業に使用者がストレスを感じることも考えられる。従って、背景選択の方が好ましい場面が多いが、以下に説明する欠陥部を指定する方法も有効な場合があり、本実施形態では、背景選択する方法と、欠陥部を指定する方法とを使用者が選択できるようにしている。   The reason for selecting the background instead of the defective portion of the workpiece W is as follows. That is, if it is a method of clicking and specifying a defective part on the screen of the display part 5 one by one, a plurality of defect conditions must be set, and the operation becomes complicated. In addition to having to prepare a sample of each defective part, the user cannot deal with unknown defective parts, and the user feels stress in the designated work of small defective parts such as line scratches. Is also possible. Therefore, there are many cases where background selection is preferred, but there are cases where the method of specifying a defective portion described below is also effective, and in this embodiment, a method of selecting a background and a method of specifying a defective portion are used. Can choose.

(強制抽出法)
しきい値の設定方法の2つ目の方法は欠陥部を指定する方法(強制抽出法)である。たとえば、欠陥部と非欠陥部との違いがあまり大きくない場合には、欠陥部を選択することでしきい値の設定を行いたい場合があり、この場合に強制抽出法は有効である。
(Forced extraction method)
The second method for setting the threshold is a method for specifying a defective portion (forced extraction method). For example, when the difference between the defective portion and the non-defective portion is not so large, it may be desired to set the threshold value by selecting the defective portion. In this case, the forced extraction method is effective.

図25に示す欠陥抽出用インターフェース58には、強制抽出ボタン58hが設けられており、この強制抽出ボタン58hを押してから、各検査用画像の欠陥部を選択する(図27に示す)。強制抽出とは、ワークWの欠陥部を抽出することである。強制抽出は、拡大表示された各検査用画像に対して行うことができる。強制抽出の流れは、図33に示す背景選択の場合とほぼ同様である。   The defect extraction interface 58 shown in FIG. 25 is provided with a forced extraction button 58h, and after the forced extraction button 58h is pressed, a defective portion of each inspection image is selected (shown in FIG. 27). The forced extraction is to extract a defective portion of the workpiece W. The forced extraction can be performed on each inspection image displayed in an enlarged manner. The flow of forced extraction is almost the same as in the case of background selection shown in FIG.

強制抽出する方法としては、たとえばマウス7のポインタを、元画像1〜3におけるワークWの欠陥部に置いてクリックする方法やタッチパネル操作する方法がある。これによってワークWの欠陥部の位置(X座標、Y座標)を指定できる。欠陥部の位置の指定は、元画像1〜3のうち、任意の1つの画像に対して複数回行うことができる。また、元画像1〜3のうち、任意の1つの画像(第1検査用画像)に対して欠陥部の位置の指定を行った後、別の画像に対しても欠陥部の位置の指定を行うことができる。尚、強制抽出を行うと、非欠陥部とすべき画素値範囲が狭まる方向に変わる。また、強制抽出と背景選択とを、1つの元画像に対して行うこともできる。   As a method of forcibly extracting, for example, there are a method of placing the pointer of the mouse 7 on a defective portion of the work W in the original images 1 to 3 and clicking and a method of operating a touch panel. Thereby, the position (X coordinate, Y coordinate) of the defective portion of the workpiece W can be designated. The designation of the position of the defective portion can be performed a plurality of times for any one of the original images 1 to 3. In addition, after specifying the position of the defective portion for any one of the original images 1 to 3 (first inspection image), the position of the defective portion is also specified for another image. It can be carried out. When forced extraction is performed, the pixel value range to be a non-defective portion is changed in a narrowing direction. Also, forced extraction and background selection can be performed on one original image.

ワークWの欠陥部の位置の指定は、図2に示す制御ユニット4の位置指定受付部48によって受け付けられる。位置指定受付部48では、欠陥部の位置の指定を複数回受け付けることができる。位置指定受付部48で受け付けた欠陥部の位置情報(座標)は記憶装置10の位置情報記憶部10bに記憶される。   The designation of the position of the defective part of the workpiece W is received by the position designation receiving unit 48 of the control unit 4 shown in FIG. The position designation accepting unit 48 can accept designation of the position of the defective part a plurality of times. The position information (coordinates) of the defective portion received by the position designation receiving unit 48 is stored in the position information storage unit 10 b of the storage device 10.

制御ユニット4の設定部49は、位置指定受付部48で受け付けた欠陥部の位置情報を位置情報記憶部10bから読み出し、位置指定受付部48により受け付けた欠陥部の位置の画素値を得る。強制抽出の場合は、背景選択の場合と異なり、欠陥部の位置の画素(クリックされた画素)の画素値を取得し、設定部49は、欠陥部の位置の画素値に基づいて、非欠陥部とすべき画素値範囲を、表示部5に表示されている複数の検査用画像(上記第1検査用画像を含む)に対して自動的に設定する。このとき、欠陥部の位置の画素値を含まないように、非欠陥部とすべき画素値範囲を設定する。ただし、変更後の画素値範囲が有効な範囲にならない場合には、上限値を0、下限値を255に設定する。   The setting unit 49 of the control unit 4 reads the position information of the defective portion received by the position designation receiving unit 48 from the position information storage unit 10b, and obtains the pixel value of the position of the defective portion received by the position designation receiving unit 48. In the case of forced extraction, unlike in the case of background selection, the pixel value of the pixel at the position of the defective portion (clicked pixel) is acquired, and the setting unit 49 determines that the non-defect is based on the pixel value of the position of the defective portion. A pixel value range to be a part is automatically set for a plurality of inspection images (including the first inspection image) displayed on the display unit 5. At this time, a pixel value range to be a non-defective part is set so as not to include a pixel value at the position of the defective part. However, when the pixel value range after the change is not an effective range, the upper limit value is set to 0 and the lower limit value is set to 255.

また、表示部5に表示されておらずかつフィルタ処理が行われていない検査用画像(第2検査用画像)が選択された際、設定部49は、位置情報記憶部10bに記憶された欠陥部の位置を示す複数の位置情報を読み出し、第2検査用画像における位置情報に対応する画素値を参照する。第2検査用画像において非欠陥部とすべき画素値範囲を更新する。この第2検査用画像に対してフィルタ処理部40がフィルタ処理を行う。第2検査用画像に対しても強制抽出を行うことができ、このときに指定された位置情報は位置情報記憶部10bに記憶される。   Further, when an inspection image (second inspection image) that is not displayed on the display unit 5 and that has not been filtered is selected, the setting unit 49 stores the defect stored in the position information storage unit 10b. A plurality of pieces of position information indicating the position of the part are read out, and pixel values corresponding to the position information in the second inspection image are referred to. The pixel value range to be a non-defect portion in the second inspection image is updated. The filter processing unit 40 performs filter processing on the second inspection image. Forcible extraction can also be performed on the second inspection image, and the position information designated at this time is stored in the position information storage unit 10b.

さらに、表示部5に表示されておらずかつフィルタ処理が行われていない検査用画像が上記第2検査用画像として選択された後、更に別の画像が第3検査用画像として選択された際に、設定部49は、位置情報記憶部10bに記憶された欠陥部の位置を示す複数の位置情報を読み出し、第3検査用画像における位置情報に対応する画素値を参照して非欠陥部とすべき画素値範囲を更新する。フィルタ処理部40は第3検査用画像に対してフィルタ処理を行う。   Furthermore, when another inspection image is selected as the third inspection image after the inspection image that is not displayed on the display unit 5 and is not filtered is selected as the second inspection image. In addition, the setting unit 49 reads a plurality of pieces of position information indicating the position of the defective part stored in the position information storage unit 10b, and refers to the pixel value corresponding to the position information in the third inspection image to determine the non-defective part. The pixel value range to be updated is updated. The filter processing unit 40 performs filter processing on the third inspection image.

また、設定部49は、上記第3検査用画像が選択された際に、位置情報記憶部10bに記憶された上記第2検査用画像における欠陥部の位置を示す位置情報(第2欠陥部位置情報)を読み出し、第2検査用画像における位置情報に対応する画素値を参照して非欠陥部とすべき画素値範囲を更新することができる。   Further, when the third inspection image is selected, the setting unit 49 includes position information (second defect portion position) indicating the position of the defect portion in the second inspection image stored in the position information storage unit 10b. Information) is read out, and the pixel value range to be a non-defect portion can be updated by referring to the pixel value corresponding to the position information in the second inspection image.

また、設定部49は、第3検査用画像が選択された際に、位置情報記憶部10bに記憶された第1検査用画像における欠陥部の位置を示す位置情報(第1欠陥部位置情報)と、第2検査用画像における欠陥部の位置を示す位置情報(第2欠陥部位置情報)とを読み出し、第3検査用画像における第1及び第2欠陥部位置情報に対応する画素値を参照して非欠陥部とすべき画素値範囲を更新するように構成されていてもよい。   The setting unit 49 also indicates position information (first defect portion position information) indicating the position of the defect portion in the first inspection image stored in the position information storage unit 10b when the third inspection image is selected. And position information (second defect portion position information) indicating the position of the defective portion in the second inspection image, and refer to pixel values corresponding to the first and second defect portion position information in the third inspection image. Thus, the pixel value range to be a non-defect portion may be updated.

画像生成部42は、設定部49により複数の検査用画像に対して設定された非欠陥部とすべき画素値範囲の全てに含まれる領域を非欠陥領域とし、いずれかの画素値範囲に含まれない領域を欠陥領域とした欠陥抽出画像を生成する。この欠陥抽出画像は、図26や図27の第4画像表示領域58dに表示することができる。また、背景選択または強制抽出が行われると非欠陥部とすべき画素値範囲が変更になるが、位置指定受付部48によって非欠陥部または欠陥部の位置の指定が受け付けられると、画像生成部42は欠陥抽出画像における非欠陥領域と欠陥領域とを自動的に更新することができる。   The image generation unit 42 sets a region included in all pixel value ranges to be non-defective portions set for a plurality of inspection images by the setting unit 49 as a non-defective region, and is included in any pixel value range. A defect extraction image is generated in which a non-defective area is a defective area. This defect extraction image can be displayed in the fourth image display area 58d in FIGS. In addition, when background selection or forced extraction is performed, the pixel value range to be a non-defective part is changed. However, when the designation of the position of the non-defective part or the defective part is received by the position designation receiving unit 48, the image generating unit 42 can automatically update the non-defect area and the defect area in the defect extraction image.

表示制御部47は、表示部5に表示された欠陥抽出画像において別の検査用画像で指定された領域に対応する領域を、その拡大操作に連動して同倍率で拡大して表示部5に表示させることができる。また、表示制御部47は、表示部5に表示された欠陥抽出画像において別の検査用画像で指定された領域に対応する領域を、その縮小操作に連動して同倍率で縮小して表示部5に表示させることができる。さらに、表示制御部47は、表示部5に表示された欠陥抽出画像を、上記スクロール操作に連動してスクロールさせることができる。   The display control unit 47 enlarges the region corresponding to the region designated by another inspection image in the defect extraction image displayed on the display unit 5 at the same magnification in conjunction with the enlargement operation, and displays it on the display unit 5. Can be displayed. Further, the display control unit 47 reduces the area corresponding to the area specified by another inspection image in the defect extraction image displayed on the display unit 5 at the same magnification in conjunction with the reduction operation. 5 can be displayed. Further, the display control unit 47 can scroll the defect extraction image displayed on the display unit 5 in conjunction with the scroll operation.

強制抽出を行った後に背景選択を行ったり、背景選択を行った後に強制抽出を行うこともできる。   Background selection can be performed after forced extraction, or forced extraction can be performed after background selection.

(ヒストグラム及びピン)
また、図28に示すように、しきい値設定時にヒストグラムとピンを表示させることもできる。たとえば、第1画像表示領域58aに表示されている元画像1の任意の位置をマウス7でクリックすると、「A」と付されたピンが表示される。すると、しきい値設定用領域58iにおいて、元画像1のクリックした点の画素値に対応するところに同じ「A」と付されたピンが表示され、元画像1のクリックした点の画素値を知ることができる。もう1点クリックすると、「B」と付されたピンが表示され、その位置の画素値を知ることができる。Aのピンと、Bのピンとのそれぞれ画素値を区別して知ることができる。ピンは3本以上表示させることもできる。元画像1でピンが表示されると、他の検査用画像の対応する位置に同じようにピンが表示される。検査用画像が切り替えられた場合には、切り替え後の検査用画像の対応する位置にピンを表示させることができる。
(Histogram and pin)
Further, as shown in FIG. 28, a histogram and a pin can be displayed at the time of setting a threshold value. For example, when an arbitrary position of the original image 1 displayed in the first image display area 58a is clicked with the mouse 7, a pin labeled “A” is displayed. Then, in the threshold setting area 58i, a pin with the same “A” is displayed at a position corresponding to the pixel value of the clicked point of the original image 1, and the pixel value of the clicked point of the original image 1 is displayed. I can know. When another point is clicked, a pin labeled “B” is displayed, and the pixel value at that position can be known. The pixel values of the A pin and the B pin can be distinguished and known. Three or more pins can be displayed. When a pin is displayed in the original image 1, the pin is similarly displayed at a corresponding position in another inspection image. When the inspection image is switched, a pin can be displayed at a corresponding position in the inspection image after switching.

尚、「ピン」とは、使用者が検査用画像の任意の位置を指定したことを表すものの一例であり、表示形状はピン状でなくてもよく、たとえば矢印やフラッグのような形態であってもよい。   Note that the “pin” is an example of what the user designates an arbitrary position of the inspection image, and the display shape may not be a pin shape, for example, an arrow or a flag. May be.

また、しきい値設定用領域58iには、画素値の度数分布であるヒストグラムも表示できる。ヒストグラムは、図2に示す制御ユニット4のヒストグラム生成部42aで生成することができる。ヒストグラム生成部42aでは、位置指定受付部48によって受け付けた非欠陥部または欠陥部の位置を含む領域のヒストグラムを生成する。   The threshold value setting area 58i can also display a histogram that is a frequency distribution of pixel values. The histogram can be generated by the histogram generation unit 42a of the control unit 4 shown in FIG. The histogram generation unit 42 a generates a histogram of a region including the position of the non-defect portion or the defect portion received by the position designation reception unit 48.

しきい値設定用領域58iには、非欠陥部とすべき画素値範囲の上限と下限をそれぞれ示す2本のしきい値表示線58jが表示されている。使用者が、たとえばしきい値設定用領域58iに表示されているヒストグラムを見ながら、マウス7によるしきい値表示線58jのドラッグ操作により、非欠陥部とすべき画素値範囲及び欠陥部とすべき画素値範囲の少なくとも一方を任意に変更することができる。このドラッグ操作は、操作受付部46によって受け付けることができる。つまり、ヒストグラム生成部42aで生成されたヒストグラム上で非欠陥部とすべき画素値範囲及び欠陥部とすべき画素値範囲の少なくとも一方の変更を受け付けることができる。設定部49は、操作受付部46により受け付けた変更後の画素値範囲に基づいて非欠陥部とすべき画素値範囲を複数の検査用画像に対して設定する。   In the threshold value setting area 58i, two threshold value display lines 58j each indicating an upper limit and a lower limit of a pixel value range to be a non-defective portion are displayed. The user sets the pixel value range to be a non-defective part and the defective part by dragging the threshold display line 58j with the mouse 7 while watching the histogram displayed in the threshold setting area 58i, for example. At least one of the power value range can be arbitrarily changed. This drag operation can be received by the operation receiving unit 46. That is, it is possible to accept a change in at least one of the pixel value range that should be a non-defective part and the pixel value range that should be a defective part on the histogram generated by the histogram generation part 42a. The setting unit 49 sets a pixel value range to be a non-defective part for a plurality of inspection images based on the changed pixel value range received by the operation receiving unit 46.

しきい値の設定方法は上述した方法に限られるものではなく、様々な方法を用いることができる。たとえば単純な画素値範囲ではなく、元画像1と元画像2の明るさ比率でしきい値を設定することもできる。また、複数の条件を組み合わせてしきい値を設定することもでき、この場合、論理演算(ORやNOT)を使用者がカスタム化できるようにしてもよい。   The threshold setting method is not limited to the above-described method, and various methods can be used. For example, the threshold value can be set by the brightness ratio of the original image 1 and the original image 2 instead of a simple pixel value range. In addition, a threshold value can be set by combining a plurality of conditions. In this case, the user may be able to customize the logical operation (OR or NOT).

また、マハラノビス距離などの統計学で使用される距離を使用して処理後画像の明るさを決め、しきい値からの外れ度合いに応じて、統計的に合理的な方法でグレー画像を生成することもできる。   In addition, the brightness of the processed image is determined using the distance used in statistics such as Mahalanobis distance, and a gray image is generated in a statistically rational manner according to the degree of deviation from the threshold. You can also.

また、背景選択する操作及び強制抽出する操作は、所定領域内の最小値、最大値を用いる方法とすることができるが、その所定領域内の画素値であっても他の画素値から大きく外れた画素値は除去して演算するようにしてもよい。また、所定領域内の画素値の標準偏差を使用して、外れ値のような値があってもロバストに動作可能にすることができる。上記所定領域は矩形領域であってもよいし、領域セグメンテーションを使用してもよい。これにより、ある程度似ている画素を大量に取得することができるため、しきい値の自動設定などがし易くなる。   In addition, the background selection operation and the forced extraction operation can be performed by using the minimum value and the maximum value in the predetermined area, but even the pixel value in the predetermined area greatly deviates from other pixel values. The calculated pixel value may be removed for calculation. In addition, the standard deviation of the pixel values in the predetermined area can be used to enable robust operation even if there is a value such as an outlier. The predetermined area may be a rectangular area, or area segmentation may be used. This makes it possible to acquire a large number of pixels that are similar to some extent, so that it is easy to automatically set a threshold value.

また、クラスタリングを用いて非欠陥部の画素値範囲を自動的に判定するようにしてもよい。これにより、複数回のクリック操作は不要になる。また、欠陥部を含む領域と、欠陥部の無い領域とを指定し、それらから欠陥に相当する外れ値を見つけることによって適切なしきい値を設定できるようにしてもよい。   Further, the pixel value range of the non-defective portion may be automatically determined using clustering. This eliminates the need for multiple click operations. Alternatively, an appropriate threshold value may be set by designating a region including a defective portion and a region having no defective portion and finding outliers corresponding to the defect from them.

また、背景選択と強制抽出の分布を比較して、欠陥部と非欠陥部との分離に適したしきい値を決めることもできる。背景選択と強制抽出の分布を比較して、2群が分離可能か否かを表示することもできる。背景選択と強制抽出の分布を比較して、2群を分離するにはどの画像種が最適か判定し、その画像種でしきい値の設定を行うこともできる。   Further, the threshold selection suitable for separating the defective portion from the non-defective portion can be determined by comparing the background selection and the forced extraction distribution. It is also possible to display whether or not the two groups are separable by comparing the background selection and the forced extraction distribution. It is also possible to compare the distribution of background selection and forced extraction, determine which image type is optimal for separating the two groups, and set a threshold value based on the image type.

さらに、背景選択または強制抽出を行う際に、検査用画像の表示を2値化してもよいし、グレースケールで表示してもよい。2値化の場合は、全て検査用画像のしきい値の範囲内を非欠陥部とし、それ以外の欠陥部とすることができる。   Furthermore, when performing background selection or forced extraction, the display of the inspection image may be binarized or displayed in gray scale. In the case of binarization, all the inspection image threshold values can be set as non-defective portions and other defective portions.

(制御部41によるパターン光照明部の制御)
この実施形態では、図23に示すように8つの輝度画像を得てからデフレクトメトリ処理を行うのであるが、デフレクトメトリ処理のアルゴリズムは、パターン光照明部2から照射されるパターン光の照射順番を仮に特定した上で構成されている。この実施形態では、アルゴリズム上でのパターン光の照射順番が、図5Aに示す0゜の場合のY方向パターン光、90゜の場合のY方向パターン光、180゜の場合のY方向パターン光、270゜の場合のY方向パターン光、図5Bに示す0゜の場合のX方向パターン光、90゜の場合のX方向パターン光、180゜の場合のX方向パターン光、270゜の場合のX方向パターン光の順番となっているとしてアルゴリズムが構成されている。
(Control of pattern light illumination unit by control unit 41)
In this embodiment, as shown in FIG. 23, the deflectometry process is performed after obtaining eight luminance images, but the algorithm of the deflectometry process is the irradiation of the pattern light emitted from the pattern light illumination unit 2. It is configured after specifying the order temporarily. In this embodiment, the irradiation order of the pattern light on the algorithm is Y direction pattern light in the case of 0 °, Y direction pattern light in the case of 90 °, Y direction pattern light in the case of 180 °, as shown in FIG. Y direction pattern light in the case of 270 °, X direction pattern light in the case of 0 °, X direction pattern light in the case of 90 °, X direction pattern light in the case of 180 ° shown in FIG. 5B, X in the case of 270 ° The algorithm is configured assuming that the direction pattern light is in order.

ここで、画像検査装置1の運用時には移動するワークWを撮像部3で撮像するのであるが、この撮像時に、パターン光照明部2と撮像部3との位置関係が所定の状態になっていないことが考えられる。特に、この実施形態では、パターン光照明部2と撮像部3とが別体であることから、使用者がパターン光照明部2と撮像部3を自由に設置することができるので、パターン光の照度分布の位相のシフト方向がアルゴリズムで特定されている方向とは異なる方向となるように設置されてしまうことが起こり易いと想定される。   Here, when the image inspection apparatus 1 is in operation, the moving workpiece W is imaged by the imaging unit 3, but the positional relationship between the pattern light illumination unit 2 and the imaging unit 3 is not in a predetermined state at the time of imaging. It is possible. In particular, in this embodiment, since the pattern light illumination unit 2 and the image pickup unit 3 are separate, the user can freely install the pattern light illumination unit 2 and the image pickup unit 3. It is assumed that the phase of the illuminance distribution is likely to be installed so that the phase shift direction is different from the direction specified by the algorithm.

たとえば、アルゴリズム上では、パターン光の照度分布の位相のシフト方向を1回目の照射から4回目の照射までをX方向と特定しているのに、実際の設置状態では1回目の照射から4回目の照射までY方向に位相がシフトしてしまうようになっていると、照明及び撮像を繰り返して複数の輝度画像を得ることはできるが、不適切な条件で撮像された輝度画像に基づいて検査用画像が生成されることになる。このため、ワークWに存在している凹みが検査用画像に現れにくくなったり、凹みを黒く表示するべきところが反対に白く表示されたり、凹みなのに白と黒とが混ざったような状態で表示されることがある。   For example, the algorithm specifies the phase shift direction of the illuminance distribution of the pattern light as the X direction from the first irradiation to the fourth irradiation, but in the actual installation state, the fourth time from the first irradiation. If the phase is shifted in the Y direction until irradiation, it is possible to obtain a plurality of luminance images by repeating illumination and imaging, but inspection based on luminance images captured under inappropriate conditions A business image is generated. For this reason, the dents present on the workpiece W are less likely to appear in the inspection image, the dents that should be displayed in black are displayed in white, or the dents are displayed in a state where white and black are mixed. Sometimes.

具体的には、図34に示すように、パターン光の照度分布の位相のシフト方向がアルゴリズムで特定されている方向であった場合には、同図における左側に示すように、凹んだ欠陥部が黒くなるように検査用画像に表示される。しかし、同図における中央部に示すように、パターン光撮像部2と撮像部3との向きが、アルゴリズムで仮定されている方向に対して180゜異なっていた場合には、凹んだ欠陥部が白く表示されてしまう。このため、使用者は凸状の欠陥部であると誤って認識してしまう恐れがある。また、同図における右側に示すように、パターン光撮像部2と撮像部3との位置関係が実際には反射光受光であるのに透過光受光であると設定してしまった場合、白い部分と黒い部分とが混ざって表示されることになる。   Specifically, as shown in FIG. 34, when the phase shift direction of the illuminance distribution of the pattern light is the direction specified by the algorithm, as shown on the left side of FIG. Is displayed on the inspection image so as to be black. However, as shown in the central part of the figure, when the orientations of the pattern light imaging unit 2 and the imaging unit 3 are 180 ° different from the direction assumed by the algorithm, a recessed defect portion is formed. It appears white. For this reason, there exists a possibility that a user may mistakenly recognize that it is a convex defect part. Also, as shown on the right side of the figure, when the positional relationship between the pattern light imaging unit 2 and the imaging unit 3 is actually reflected light reception but set to transmission light reception, a white portion And a black part are mixed and displayed.

このことに対し、この実施形態では、情報取得部9が、撮像部3のラインカメラ31の受光素子3aの配列方向に対するワークWの移動方向に関する移動方向情報と、受光素子3aとパターン光照明部2との位置関係に関する位置関係情報とを得て、制御部41が、情報取得部9により取得された移動方向情報及び位置関係情報にしたがい、パターン光照明部2により照射されるパターン光の位相シフト方向を決定することができる。   On the other hand, in this embodiment, the information acquisition unit 9 includes the moving direction information regarding the moving direction of the workpiece W with respect to the arrangement direction of the light receiving elements 3a of the line camera 31 of the imaging unit 3, and the light receiving elements 3a and the pattern light illumination unit. 2 is obtained, and the phase of the pattern light irradiated by the pattern light illumination unit 2 is obtained by the control unit 41 in accordance with the movement direction information and the positional relationship information acquired by the information acquisition unit 9. The shift direction can be determined.

すなわち、照度分布の位相のシフト方向がアルゴリズムで特定されている方向とは異なる方向となるようにパターン光照明部2及び撮像部3が設置されていたとしても、移動方向情報と位置関係情報とに基づいて、パターン光照明部2により照射されるパターン光の位相シフト方向を、アルゴリズムで特定している方向に設定し直すことができる。   That is, even if the pattern light illumination unit 2 and the imaging unit 3 are installed such that the phase shift direction of the illuminance distribution is different from the direction specified by the algorithm, the movement direction information and the positional relationship information Based on the above, the phase shift direction of the pattern light irradiated by the pattern light illumination unit 2 can be reset to the direction specified by the algorithm.

したがって、パターン光照明部2や撮像部3を設置し直す必要はなくなる。また、設置場所の制約や配線の関係から照度分布の位相のシフト方向がアルゴリズムで特定されている方向とは異なる方向となるようにしかパターン光照明部2や撮像部3を設置できない場合であってもデフレクトメトリの原理を応用した画像検査を行うことができる。   Therefore, it is not necessary to re-install the pattern light illumination unit 2 and the imaging unit 3. In addition, the pattern light illumination unit 2 and the imaging unit 3 can only be installed so that the phase shift direction of the illuminance distribution is different from the direction specified by the algorithm due to installation location restrictions and wiring relationships. However, it is possible to perform image inspection applying the principle of deflectometry.

つまり、照度分布の位相のシフト方向がアルゴリズムで特定されている方向とは異なる方向となるようにパターン光照明部2及び撮像部3が設置されていた場合には適切な検査用画像を得ることができないので、適切な検査用画像が得られるように第1発光ダイオード列A1〜A12及び第2発光ダイオード列B1〜B12を制御してパターン光の照射順番を変更することができる。   That is, when the pattern light illumination unit 2 and the imaging unit 3 are installed such that the phase shift direction of the illuminance distribution is different from the direction specified by the algorithm, an appropriate inspection image is obtained. Therefore, the irradiation order of the pattern light can be changed by controlling the first light emitting diode rows A1 to A12 and the second light emitting diode rows B1 to B12 so that an appropriate inspection image can be obtained.

(画像生成部42による検査用画像の生成)
画像生成部42は、情報取得部9により取得された移動方向情報及び位置関係情報にしたがい、ワークWの形状に係る検査用画像を生成することもできる。これにより、照度分布の位相のシフト方向がアルゴリズムで特定されている方向とは異なる方向となるようにパターン光照明部2及び撮像部3が設置されていた場合に、パターン光照明部2のパターン光の照射順番を変更することなく、画像生成部42の生成方法によって適切な検査用画像を得ることができる。
(Generation of inspection image by image generation unit 42)
The image generation unit 42 can also generate an inspection image related to the shape of the workpiece W according to the movement direction information and the positional relationship information acquired by the information acquisition unit 9. Thereby, when the pattern light illumination unit 2 and the imaging unit 3 are installed such that the phase shift direction of the illuminance distribution is different from the direction specified by the algorithm, the pattern of the pattern light illumination unit 2 An appropriate inspection image can be obtained by the generation method of the image generation unit 42 without changing the light irradiation order.

上記移動方向情報及び位置関係情報を得ておくことで、パターン光がワークWに対してどのように照射されるかを把握することができ、パターン光の位相のシフト方向がどのような方向であっても、画像生成部42は、アルゴリズムで特定されているパターン光の位相のシフト方向と一致するように、画像を取り扱ってワークWの形状に係る検査用画像を生成することができる。たとえば、アルゴリズム上では、パターン光の照度分布の位相のシフト方向を1回目の照射から4回目の照射までX方向と特定し、5回目の照射から8回目の照射までY方向と特定しているのに、実際の設置状態では1回目の照射から4回目の照射までY方向に位相がシフトし、5回目の照射から8回目の照射までX方向に位相がシフトしてしまうようになっていた場合、パターン光の照射順番は変更することなくそのまま撮像し、撮像後に、5回目の照射から8回目の照射で得られた輝度画像を、アルゴリズム上の1回目の照射から4回目の照射で得られた輝度画像として取り扱い、1回目の照射から4回目の照射で得られた輝度画像を、アルゴリズム上の5回目の照射から8回目の照射で得られた輝度画像として取り扱う。このように、実際に撮像した輝度画像を入れ替えて処理することで、パターン光照明部2及び撮像部3の設置状態を変更することなく、デフレクトメトリの原理を応用した画像検査を行うことができる。   By obtaining the moving direction information and positional relationship information, it is possible to grasp how the pattern light is irradiated onto the workpiece W, and in what direction the phase shift direction of the pattern light is. Even if it exists, the image generation part 42 can handle the image and generate | occur | produce the image for a test | inspection which concerns on the shape of the workpiece | work W so that it may correspond with the shift direction of the phase of the pattern light specified by the algorithm. For example, in the algorithm, the phase shift direction of the illuminance distribution of the pattern light is specified as the X direction from the first irradiation to the fourth irradiation, and specified as the Y direction from the fifth irradiation to the eighth irradiation. However, in the actual installation state, the phase is shifted in the Y direction from the first irradiation to the fourth irradiation, and the phase is shifted in the X direction from the fifth irradiation to the eighth irradiation. In this case, the pattern light irradiation order is captured as it is, and after the imaging, a luminance image obtained by the fifth irradiation to the eighth irradiation is obtained by the fourth irradiation from the first irradiation on the algorithm. The luminance image obtained from the first irradiation to the fourth irradiation is handled as the luminance image obtained from the fifth irradiation to the eighth irradiation on the algorithm. In this way, by performing processing by replacing the actually captured luminance images, it is possible to perform image inspection that applies the principle of deflectometry without changing the installation state of the pattern light illumination unit 2 and the imaging unit 3. it can.

(検査部の構成)
図2に示すように、制御ユニット4には検査部4aが設けられている。検査部4aは、画像生成部42により生成された検査用画像に基づいてワークWの欠陥検査を実行する。たとえば、ワークWに非欠陥部があるか否かを上記しきい値に基づいて判定し、非欠陥部があると判定される場合には報知することができる。
(Configuration of inspection department)
As shown in FIG. 2, the control unit 4 is provided with an inspection unit 4a. The inspection unit 4a performs a defect inspection of the workpiece W based on the inspection image generated by the image generation unit 42. For example, whether or not the workpiece W has a non-defective portion is determined based on the threshold value, and when it is determined that there is a non-defective portion, it can be notified.

(HDR機能)
画像検査装置1には、ハイダイナミックレンジ合成(high dynamic range imaging : HDR)機能を組み込むことができる。HDR機能では、制御部41は、明るさが異なる複数の輝度画像を得るようにパターン光照明部2及び撮像部3を制御する。HDR機能で得る輝度画像としては、たとえば、露光時間の異なる複数の輝度画像、パターン光照明部2の発光強度が異なる複数の輝度画像、露光時間及び発光強度の両方が異なる複数の輝度画像がある。画像生成部42は、たとえば、明るさが異なる3枚の輝度画像を合成することで、各輝度画像のダイナミックレンジよりも広いダイナミックレンジを有する検査用画像を生成することができる。HDR合成の手法については従来から周知の手法を用いることができる。
(HDR function)
The image inspection apparatus 1 can incorporate a high dynamic range imaging (HDR) function. In the HDR function, the control unit 41 controls the pattern light illumination unit 2 and the imaging unit 3 so as to obtain a plurality of luminance images having different brightnesses. As a luminance image obtained by the HDR function, for example, there are a plurality of luminance images having different exposure times, a plurality of luminance images having different light emission intensities of the pattern light illumination unit 2, and a plurality of luminance images having different exposure times and light emission intensities. . For example, the image generation unit 42 can generate an inspection image having a dynamic range wider than the dynamic range of each luminance image by combining three luminance images having different brightnesses. Conventionally known methods can be used for the HDR synthesis method.

HDR機能では複数の輝度画像を得る必要があり、この場合も、上記トリガ信号の送信の欄で説明したように、外部からの一のエンコーダパルス信号を受け付けると、パターン光照明部2の照明条件及び撮像部3の撮像条件の少なくとも一方を変化させて複数の輝度画像が生成されるように、パターン光照明部2及び撮像部3に対して複数の撮像トリガ信号を順次送信するように構成することができる。   In the HDR function, it is necessary to obtain a plurality of luminance images. In this case as well, as described in the trigger signal transmission section, when one encoder pulse signal from the outside is received, the illumination condition of the pattern light illumination unit 2 In addition, a plurality of imaging trigger signals are sequentially transmitted to the pattern light illumination unit 2 and the imaging unit 3 so that a plurality of luminance images are generated by changing at least one of the imaging conditions of the imaging unit 3. be able to.

(マルチスペクトル照明)
パターン光照明部2は、マルチスペクトル照明が可能に構成されていてもよい。マルチスペクトル照明とは、波長が異なる光を、タイミングをずらしてワークWに照射することであり、印刷物(検査対象物)の色むらや汚れ等を検査するのに適している。たとえば、黄色、青色、赤色を順番にワークWに照射可能となるように、パターン光照明部2を構成することができ、具体的には、多数色のLEDを有するパターン光照明部2としてもよいし、液晶パネルや有機ELパネル等でパターン光照明部2を構成してもよい。
(Multispectral lighting)
The pattern light illumination unit 2 may be configured to be capable of multispectral illumination. Multispectral illumination refers to irradiating the workpiece W with light having different wavelengths at different timings, and is suitable for inspecting color unevenness, dirt, and the like of a printed material (inspection object). For example, the pattern light illumination unit 2 can be configured so that yellow, blue, and red can be irradiated onto the workpiece W in order. Specifically, as the pattern light illumination unit 2 having a multi-color LED, Alternatively, the pattern light illumination unit 2 may be configured by a liquid crystal panel, an organic EL panel, or the like.

撮像部3は、光が照射されるタイミングでワークWを撮像して複数の輝度画像を得る。画像生成部42は、複数の輝度画像を合成して検査用画像を得ることができる。ここで、光には紫外線や赤外線も含むことができる。   The imaging unit 3 captures the workpiece W at the timing when light is irradiated to obtain a plurality of luminance images. The image generation unit 42 can obtain an inspection image by combining a plurality of luminance images. Here, the light can include ultraviolet rays and infrared rays.

(実施形態の作用効果)
以上説明したように、この実施形態によれば、複数のパターン光をワークWに順次照射し、パターン光が照射される都度、ワークWを撮像して複数の輝度画像を生成し、複数の輝度画像に基づいて、ワークWの形状を示す位相データを生成し、ワークWの形状に係る検査用画像を生成するようにしたので、デフレクトメトリの原理を応用した画像検査を行うことができる。
(Effect of embodiment)
As described above, according to this embodiment, a plurality of pattern lights are sequentially irradiated onto the workpiece W, and each time the pattern light is irradiated, the workpiece W is imaged to generate a plurality of luminance images. Since phase data indicating the shape of the workpiece W is generated based on the image and an inspection image related to the shape of the workpiece W is generated, an image inspection applying the principle of deflectometry can be performed.

仮に、照度分布の位相のシフト方向がアルゴリズムで想定されている方向とは異なる方向となるようにパターン光照明部2及び撮像部3が設置されていたとしても、受光素子3aの配列方向に対するワークWの移動方向に関する移動方向情報と、受光素子3aとパターン光照明部2との位置関係に関する位置関係情報とにしたがい、パターン光照明部2により照射されるパターン光の位相シフト方向を適切な方向にすることができる。   Even if the pattern light illumination unit 2 and the imaging unit 3 are installed such that the phase shift direction of the illuminance distribution is different from the direction assumed by the algorithm, the workpiece with respect to the arrangement direction of the light receiving elements 3a. According to the movement direction information regarding the movement direction of W and the positional relationship information regarding the positional relationship between the light receiving element 3a and the pattern light illumination unit 2, the phase shift direction of the pattern light irradiated by the pattern light illumination unit 2 is set to an appropriate direction. Can be.

また、照度分布の位相のシフト方向がアルゴリズムで想定されている方向とは異なる方向となるようにパターン光照明部2及び撮像部3が設置されていたとしても、上記移動方向情報及び位置関係情報とにしたがい、画像生成部42によってワークWの形状に係る検査用画像を生成することができる。   Even if the pattern light illumination unit 2 and the imaging unit 3 are installed such that the phase shift direction of the illuminance distribution is different from the direction assumed by the algorithm, the movement direction information and the positional relationship information Accordingly, an image for inspection related to the shape of the workpiece W can be generated by the image generation unit 42.

また、複数の検査用画像を表示部5に同時に表示することができる。複数の検査用画像を表示部5に同時に表示した状態で、使用者が、ある検査用画像を見て、ワークWの非欠陥部または欠陥部の位置を指定すると、その指定した結果を受け付け、非欠陥部または欠陥部の位置の画素値に基づいて、非欠陥部とすべき画素値範囲を複数の検査用画像に対して設定することができる。これにより、使用者が全ての検査用画像に対して非欠陥部または欠陥部の位置を指定しなくても、複数の検査用画像で欠陥の有無を判定することができる。   In addition, a plurality of inspection images can be displayed on the display unit 5 at the same time. In a state where a plurality of inspection images are displayed on the display unit 5 at the same time, when the user looks at a certain inspection image and designates the position of a non-defective part or a defective part of the workpiece W, the designated result is accepted, Based on the pixel value of the non-defect portion or the position of the defect portion, a pixel value range to be a non-defect portion can be set for a plurality of inspection images. Thereby, even if a user does not specify the position of a non-defect part or a defect part with respect to all the images for a test | inspection, the presence or absence of a defect can be determined with a some image for a test | inspection.

また、複数の検査用画像に対して設定された非欠陥部とすべき画素値範囲の全てに含まれる領域を非欠陥領域とし、いずれかの画素値範囲に含まれない領域を欠陥領域とした欠陥抽出画像を生成することができるので、使用者は、欠陥抽出画像を見るだけで異なる種別の欠陥の検出を行うことができる。   In addition, a region included in all pixel value ranges to be set as non-defective portions set for a plurality of inspection images is defined as a non-defective region, and a region not included in any pixel value range is defined as a defective region. Since the defect extraction image can be generated, the user can detect different types of defects only by looking at the defect extraction image.

また、複数の検査用画像を表示部5に同時に表示した状態で、使用者が、一の検査用画像の一部の領域を指定して拡大する操作を行うと、他の検査用画像において対応する領域が同倍率で拡大されて表示部に表示される。これにより、簡単な操作でもって複数の検査用画像を同じように拡大して表示することができる。同領域が同倍率で拡大表示された各検査用画像を使用者が見て、ある検査用画像においてワークWの非欠陥部または欠陥部の位置を指定することができる。   In addition, when a user performs an operation of specifying and enlarging a partial area of one inspection image in a state where a plurality of inspection images are displayed on the display unit 5 at the same time, other inspection images are supported. The area to be displayed is enlarged at the same magnification and displayed on the display unit. Accordingly, a plurality of inspection images can be enlarged and displayed in the same manner with a simple operation. The user can see each inspection image in which the same area is enlarged and displayed at the same magnification, and can specify the position of the non-defective portion or the defective portion of the workpiece W in a certain inspection image.

また、異なる種別の欠陥の検出が可能な複数の検査用画像を生成する場合に、フィルタ処理が実行された検査用画像と、フィルタ処理が実行されていない検査用画像とを使用者が同時に見ることができる。
(実施形態2)
上記実施形態1では、得られた輝度画像に対してデフレクトメトリ処理を行うことによって検査用画像を生成する機能について説明したが、本発明に係る画像検査装置1は、このデフレクトメトリ処理機能以外にも、たとえば、フォトメトリックステレオ法を利用して検査用画像を生成する機能を持たせることもできる。
In addition, when generating a plurality of inspection images that can detect different types of defects, the user views the inspection image that has been subjected to the filtering process and the inspection image that has not been subjected to the filtering process at the same time. be able to.
(Embodiment 2)
In the first embodiment, the function of generating the inspection image by performing the refractometry processing on the obtained luminance image has been described. However, the image inspection apparatus 1 according to the present invention has the deflectometry processing function. In addition, for example, a function of generating an inspection image using a photometric stereo method may be provided.

以下、フォトメトリックステレオ法を利用して検査用画像を生成する場合について、図38を参照しながら、実施形態1と同じ部分には同じ符合を付して説明を省略し、異なる部分について詳細に説明する。   Hereinafter, in the case of generating an inspection image using the photometric stereo method, the same portions as those in the first embodiment are denoted by the same reference numerals and description thereof is omitted with reference to FIG. explain.

実施形態2に係る画像検査装置1は、たとえば特開2015−232486号公報に開示されている画像検査装置と同様に構成することができる。すなわち、画像検査装置1は、ワークWを一定の方向から撮像する撮像部3と、ワークWを異なる三以上の照明方向から照明するための照明部200と、制御ユニット400とを備えるとともに、実施形態1と同様な表示部5、キーボード6及びマウス7を少なくとも備えている。   The image inspection apparatus 1 according to the second embodiment can be configured similarly to the image inspection apparatus disclosed in, for example, Japanese Patent Application Laid-Open No. 2015-232486. That is, the image inspection apparatus 1 includes an imaging unit 3 that images the workpiece W from a certain direction, an illumination unit 200 that illuminates the workpiece W from three or more different illumination directions, and a control unit 400. The display unit 5, the keyboard 6, and the mouse 7 similar to those in the first embodiment are provided.

照明部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 unit 200 is configured to irradiate the workpiece W with light from different directions, and controls the first to fourth light emitting units 201 to 204 and the first to fourth light emitting units 201 to 204. And an illumination control unit 205. The illumination unit 200 is a part that performs multi-directional illumination that irradiates the workpiece W with light from different directions. The 1st-4th light emission parts 201-204 are arrange | positioned so that the workpiece | work W may be surrounded at intervals. The first to fourth light emitting units 201 to 204 can use light emitting diodes, incandescent bulbs, fluorescent lamps, and the like. Moreover, the 1st-4th light emission parts 201-204 may be a different body, and may be integrated.

制御ユニット400は、制御部401と、法線ベクトル算出部402と、輪郭画像生成部403と、テクスチャ描出画像生成部404と、トリガ信号送信部405とを備えている。制御部401は、エンコーダパルス信号が外部から入力されたときに、エンコーダパルス信号を受け付けることが可能に構成されている。制御部401が外部からの一のエンコーダパルス信号を受け付けると、照明部200の照明条件及び撮像部3の撮像条件の少なくとも一方を変化させて複数の輝度画像が生成されるように、トリガ信号送信部405が撮像部3に対して複数の撮像トリガ信号を順次送信するように構成されている。また、制御部401が外部からの一のエンコーダパルス信号を受け付けると、トリガ信号送信部405は、照明部200に対して複数の照明トリガ信号を順次送信するように構成されている。この実施形態では、第1〜第4発光部201〜204を順次点灯させるので、照明トリガ信号を4回送信する。この照明トリガ信号の送信に同期させて撮像トリガ信号を4回送信する。   The control unit 400 includes a control unit 401, a normal vector calculation unit 402, a contour image generation unit 403, a texture rendered image generation unit 404, and a trigger signal transmission unit 405. The control unit 401 is configured to receive an encoder pulse signal when the encoder pulse signal is input from the outside. When the control unit 401 receives one encoder pulse signal from the outside, a trigger signal is transmitted so that a plurality of luminance images are generated by changing at least one of the illumination conditions of the illumination unit 200 and the imaging conditions of the imaging unit 3. The unit 405 is configured to sequentially transmit a plurality of imaging trigger signals to the imaging unit 3. In addition, when the control unit 401 receives one encoder pulse signal from the outside, the trigger signal transmission unit 405 is configured to sequentially transmit a plurality of illumination trigger signals to the illumination unit 200. In this embodiment, since the 1st-4th light emission parts 201-204 are lighted sequentially, an illumination trigger signal is transmitted 4 times. In synchronization with the transmission of the illumination trigger signal, the imaging trigger signal is transmitted four times.

たとえば、照明部200が1回目の照明トリガ信号を受信すると、照明制御部205が第1発光部201のみ点灯させる。このとき撮像部3は撮像トリガ信号を受信して光が照射されるタイミングでワークWを撮像する。照明部200が2回目の照明トリガ信号を受信すると、照明制御部205が第2発光部202のみ点灯させ、このとき撮像部3はワークWを撮像する。このようにして4枚の輝度画像を得ることができる。なお、照明の数は4つに限られるものではなく、3つ以上で、かつ、互いに異なる方向からワークWを照明することができれば任意の数にすることができる。   For example, when the illumination unit 200 receives the first illumination trigger signal, the illumination control unit 205 turns on 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 unit 200 receives the second illumination trigger signal, the illumination control unit 205 turns on only the second light emitting unit 202, and at this time, the imaging unit 3 captures the workpiece W. In this way, four luminance images can be obtained. Note that the number of illuminations is not limited to four, and can be any number as long as the number of illuminations is three or more and the workpiece W can be illuminated from different directions.

法線ベクトル算出部402は、撮像部3によって撮像された複数の輝度画像同士で対応関係にある画素毎の画素値を用いて、各画素のワークWの表面に対する法線ベクトルを算出する。輪郭画像生成部403は、算出された各画素の法線ベクトルに対してX方向及びY方向に微分処理を施し、ワークWの表面の傾きの輪郭を示す輪郭画像を生成する。テクスチャ描出画像生成部404は、算出された各画素の法線ベクトルから、法線ベクトルと同個数の各画素のアルベドを算出し、アルベドから、ワークWの表面の傾き状態を除去した模様を示すテクスチャ描出画像を生成する。   The normal vector calculation unit 402 calculates a normal vector with respect to the surface of the workpiece W of each pixel, using pixel values for each pixel that have a correspondence relationship between the plurality of luminance images captured by the imaging unit 3. The contour image generation unit 403 performs a differentiation process in the X direction and the Y direction on the calculated normal vector of each pixel, and generates a contour image indicating the contour of the inclination of the surface of the workpiece W. The texture rendered image generation unit 404 calculates the albedo of each pixel of the same number as the normal vector from the calculated normal vector of each pixel, and shows the pattern obtained by removing the tilt state of the surface of the workpiece W from the albedo. Generate a texture rendering image.

尚、図示しないが、実施形態2においても、実施形態1と同様に、表示部5に表示された各検査用画像に対して、当該検査用画像における検査対象物の非欠陥部または欠陥部の位置の指定を受け付け可能な受付部、受付部により受け付けた非欠陥部または欠陥部の位置の画素値に基づいて、非欠陥部とすべき画素値範囲を複数の検査用画像に対して設定する設定部を備えている。さらに、表示部5に表示された検査用画像のうち、一の検査用画像の一部の領域を指定して拡大する拡大操作を受け付け可能な操作受付部、表示部5に表示された他の検査用画像において上記一の検査用画像で指定された領域に対応する領域を、上記拡大操作に連動して同倍率で拡大して上記表示部に表示させる表示制御部も備えている。拡大操作の代わりに縮小操作やスクロール操作が可能であるのはもちろんである。さらにまた、図示しないフィルタ処理部も実施形態1と同様である。   Although not shown in the figure, also in the second embodiment, as in the first embodiment, for each inspection image displayed on the display unit 5, the non-defective part or defective part of the inspection object in the inspection image is displayed. A reception unit capable of receiving a designation of a position, and a non-defective part or a pixel value range to be determined as a non-defective part based on the pixel value of the position of the defective part received by the receiving part. A setting unit is provided. Furthermore, among the inspection images displayed on the display unit 5, an operation reception unit that can receive an enlargement operation for specifying and enlarging a partial region of one inspection image, and other display units displayed on the display unit 5. A display control unit is also provided that enlarges the region corresponding to the region specified in the one inspection image in the inspection image at the same magnification in conjunction with the enlargement operation and displays the region on the display unit. Of course, a reduction operation and a scroll operation can be performed instead of the enlargement operation. Furthermore, a filter processing unit (not shown) is the same as that in the first embodiment.

(実施形態の作用効果)
この実施形態2によれば、フォトメトリックステレオ法を利用して、異なる種別の欠陥の検出が可能な複数の検査用画像を得ることができ、得られた検査用画像を用いて欠陥検査を行うことができる。
(実施形態3)
図39は、本発明の実施形態3に係る画像検査装置1のブロック図である。この実施形態3は、画像検査装置1がエッジ生成部500を備えている点で実施形態1と異なっているが、他の部分は実施形態1と同じであるため、以下、実施形態1と同じ部分には同じ符合を付して説明を省略し、異なる部分について詳細に説明する。
(Effect of embodiment)
According to the second embodiment, a plurality of inspection images capable of detecting different types of defects can be obtained using the photometric stereo method, and defect inspection is performed using the obtained inspection images. be able to.
(Embodiment 3)
FIG. 39 is a block diagram of the image inspection apparatus 1 according to the third embodiment of the present invention. The third embodiment is different from the first embodiment in that the image inspection apparatus 1 includes an edge generation unit 500, but the other parts are the same as those in the first embodiment. The same reference numerals are given to the parts and the description thereof is omitted, and different parts will be described in detail.

ワークWの検査を行う際、たとえば複雑な形状の輪郭の欠陥検査をしたい場合や、複雑な形状を持った特定の領域内で欠陥検査をしたい場合等があり、このような場合には、検査用画像上で、輪郭を正確に抽出する必要がある。上記エッジ生成部500はワークWの輪郭を表示部5に表示されている画面上に生成するための部分であり、制御ユニット4の一部とすることもできる。   When inspecting the workpiece W, for example, there is a case where it is desired to inspect a defect of a contour having a complicated shape, or a case where it is desired to inspect a defect within a specific region having a complicated shape. It is necessary to accurately extract the contour on the image for use. The edge generation unit 500 is a part for generating the outline of the workpiece W on the screen displayed on the display unit 5, and can be a part of the control unit 4.

尚、ワークWの輪郭をエッジとも呼ぶが、エッジは、ワークWの外形線だけでなく、ワークWに形成された穴や凹みの周縁部、ワークWに形成された溝の縁、ワークWに設けられたビードの外形線、ワークWに設けられたシール部材の外形線、ワークWに塗布されたシール剤の縁部等の場合があり、本実施形態では基本的にどのようなエッジも画面上に生成して確認することが可能である。   The outline of the workpiece W is also referred to as an edge. The edge is not only the outline of the workpiece W, but also the edge of the hole or recess formed in the workpiece W, the edge of the groove formed in the workpiece W, the workpiece W. In some cases, the outer shape of the bead provided, the outer shape of the seal member provided on the workpiece W, the edge of the sealant applied to the workpiece W, etc. In this embodiment, basically any edge is a screen. It can be generated and confirmed.

エッジ生成部500は、表示部5に表示された検査用画像上で、ワークWのエッジ検出の初期位置となる任意の位置の指定を受け付ける位置受付部501と、位置受付部501で受け付けた初期位置または当該初期位置の近傍の初期エッジ位置を検出するとともに、当該エッジの勾配方向を特定するエッジ検出部502と、エッジ検出部502により検出されたエッジの勾配方向と略直交する方向をエッジ接線方向と仮定し、検出されたエッジからエッジ接線方向に所定距離離れた位置にエッジをサーチする領域であるサーチ領域を設定するサーチ領域設定部503と、サーチ領域設定部503により設定されたサーチ領域内の画素値に基づき、当該サーチ領域内で有効なエッジ位置検出用局所しきい値を設定するための局所しきい値設定部504と、エッジ連結部505とを備えている。   The edge generation unit 500 receives on the inspection image displayed on the display unit 5 a position reception unit 501 that accepts designation of an arbitrary position that is an initial position for edge detection of the workpiece W, and an initial that is received by the position reception unit 501. An edge detection unit 502 that detects a position or an initial edge position in the vicinity of the initial position and specifies the gradient direction of the edge, and an edge tangent that is substantially perpendicular to the gradient direction of the edge detected by the edge detection unit 502 A search area setting unit 503 for setting a search area, which is an area for searching for an edge at a position that is a predetermined distance away from the detected edge in the edge tangential direction, and a search area set by the search area setting unit 503 A local threshold value setting unit for setting an edge position detection local threshold value effective in the search region based on the pixel value in And 04, and a edge connecting portion 505.

エッジ検出部502は、サーチ領域内の画素値とエッジ位置検出用局所しきい値とに基づいて、当該サーチ領域におけるエッジ位置を検出するとともに、当該エッジの勾配方向を特定するエッジ検出処理を実行し、当該エッジ検出処理をサーチ領域設定部503により順次設定されるサーチ領域に対して繰り返し実行するように構成されている。エッジ連結部505が、各サーチ領域にて順次検出されたエッジ位置を連結する連結処理を実行することにより、ワークWの輪郭を特定するように構成されている。   The edge detection unit 502 detects an edge position in the search area based on a pixel value in the search area and a local threshold for edge position detection, and executes an edge detection process for specifying the gradient direction of the edge. The edge detection processing is repeatedly executed for the search areas sequentially set by the search area setting unit 503. The edge linking unit 505 is configured to specify the contour of the workpiece W by executing a linking process for linking edge positions sequentially detected in each search area.

尚、この実施形態では、エッジ検出部502がエッジ位置を検出してエッジの勾配方向を特定するようにしているが、こればエッジ接線方向を仮定するための処理であり、エッジの勾配方向を特定することなく、エッジ接線方向を仮定する場合には、エッジの勾配方向の特定は不要である。   In this embodiment, the edge detection unit 502 detects the edge position and specifies the edge gradient direction. However, this is a process for assuming the edge tangent direction, and the edge gradient direction is determined. If the edge tangent direction is assumed without being specified, it is not necessary to specify the edge gradient direction.

以下、エッジ生成部500による具体的なエッジ生成方法について図40に示すフローチャートに基づいて説明する。このフローチャートのステップSD1では、i=1と置く。その後、ステップSD2に進み、このステップSD2では、使用者が、表示部5に表示された検査用画像上で、ワークWのエッジ検出の初期位置となる任意の位置をマウス7のクリック操作によって指定する。初期位置の指定方法はマウス7の操作に限られるものではなく、他の入力機器の操作であってもよい。   Hereinafter, a specific edge generation method by the edge generation unit 500 will be described based on a flowchart shown in FIG. In step SD1 of this flowchart, i = 1 is set. Thereafter, the process proceeds to step SD2, in which the user designates an arbitrary position as an initial position for detecting the edge of the workpiece W on the inspection image displayed on the display unit 5 by clicking the mouse 7. To do. The method for specifying the initial position is not limited to the operation of the mouse 7, and may be an operation of another input device.

たとえば図41に示す検査用画像上で、使用者がエッジであると認識している線上にポインタ(白抜きの矢印で示す)を置き、マウス7をクリック操作する。使用者は検査用画像上でエッジが分かりやすい部分を指定すると考えられるので、使用者に初期位置の指摘を行わせることで、初期位置を正確に特定することができる。   For example, on the inspection image shown in FIG. 41, a pointer (indicated by a white arrow) is placed on a line that the user recognizes as an edge, and the mouse 7 is clicked. Since it is considered that the user designates a part where the edge is easily understood on the inspection image, the initial position can be accurately specified by causing the user to indicate the initial position.

クリック操作された位置は位置受付部501によって受け付けられる。クリックされた位置がエッジ上から多少外れている場合があるので、エッジ検出部502は、図42に示すようにクリックされた位置を含む所定範囲の領域S0内で最もエッジ強度の強い座標、即ち画素値の差が大きい部分の座標を求め、その位置に対応する座標を求めて初期座標P0とする(ステップSD3)。これにより、クリックされた位置がエッジ上から多少外れていても、位置を修正することができ、エッジ上に初期座標を置くことができる。また、ステップSD3ではエッジの勾配方向(画素値が変化する方向)も特定しておき、図43の左側に示すように、初期座標P0を通り、かつ、エッジの勾配方向を示す勾配ベクトルnを求める。これはエッジ検出部502が行う。尚、しきい値を超えるエッジが見つからなければ処理を終了する。   The clicked position is received by the position receiving unit 501. Since the clicked position may slightly deviate from the edge, the edge detection unit 502, as shown in FIG. 42, coordinates having the strongest edge strength within the region S0 within the predetermined range including the clicked position, The coordinates of the portion where the pixel value difference is large are obtained, and the coordinates corresponding to the position are obtained as the initial coordinates P0 (step SD3). Thereby, even if the clicked position is slightly off the edge, the position can be corrected, and the initial coordinates can be placed on the edge. In step SD3, the gradient direction of the edge (the direction in which the pixel value changes) is also specified. As shown on the left side of FIG. 43, the gradient vector n that passes through the initial coordinates P0 and indicates the gradient direction of the edge is obtained. Ask. This is performed by the edge detection unit 502. If no edge exceeding the threshold is found, the process is terminated.

ステップSD3に続くステップSD4では、勾配ベクトルnに略直交する接線ベクトルr(初期座標P0における接線ベクトル)を求め、この接線ベクトルrを進行ベクトル(単位ベクトル)とする。進行ベクトルの方向をエッジ接線方向と仮定することができる。   In step SD4 following step SD3, a tangent vector r (tangent vector at the initial coordinate P0) substantially orthogonal to the gradient vector n is obtained, and this tangent vector r is set as a progress vector (unit vector). The direction of the progression vector can be assumed to be the edge tangent direction.

その後、ステップSD5に進み、図43の右側に示すように、進行ベクトルr×L(所定距離)だけ離れた位置の座標(点Si)を求める。ステップSD6では、点Siを中心としたセグメントS1を進行ベクトルrと平行に形成する。このセグメントS1は、エッジをサーチする領域であるサーチ領域に相当する。これはサーチ領域設定部503が行う。   Thereafter, the process proceeds to step SD5, and as shown on the right side of FIG. In step SD6, a segment S1 centered on the point Si is formed in parallel with the progress vector r. The segment S1 corresponds to a search area that is an area for searching for an edge. This is performed by the search area setting unit 503.

セグメントS1を形成した後、ステップSD7では、図44の左側に示すセグメントS1内の画素をエッジ勾配方向と直交する方向に投影(縮退)することにより、同図の中央に示すように一次元の画素値にし、この一次元の画素値をエッジ情報として得る。得られたエッジ情報からエッジ位置を求める。セグメントS1内での2値化であることから、狭い領域で2値化のしきい値を決めることができる。セグメントS1内で求めたしきい値が、エッジ位置検出用局所しきい値である。エッジ位置検出用局所しきい値は大津法(判別分析法)によって求めることができる。これは局所しきい値設定部504で行う。また、たとえば一次元の画素値の微分値に対してエッジ位置検出用局所しきい値を設定し、エッジ位置を求めてもよい。   After the segment S1 is formed, in step SD7, the pixels in the segment S1 shown on the left side of FIG. A pixel value is obtained, and this one-dimensional pixel value is obtained as edge information. The edge position is obtained from the obtained edge information. Since the binarization is performed in the segment S1, the binarization threshold value can be determined in a narrow area. The threshold value obtained in the segment S1 is the edge position detection local threshold value. The local threshold for edge position detection can be obtained by the Otsu method (discriminant analysis method). This is performed by the local threshold value setting unit 504. For example, the edge position may be determined by setting a local threshold for edge position detection with respect to the differential value of the one-dimensional pixel value.

ステップSD8では、エッジ位置が求まったか否か判定する。ステップSD8でNOと判定された場合にはステップSD16、17を経てステップSD5に戻る。複数回試してもエッジ位置が求まらなかった場合には処理を終了する。   In step SD8, it is determined whether an edge position has been obtained. If NO in step SD8, the process returns to step SD5 via steps SD16 and SD17. If the edge position is not obtained even after a plurality of trials, the process is terminated.

一方、ステップSD8でYESと判定されてエッジ位置が求まった場合には、ステップSD9に進み、図43の右側に示すように、求まったエッジ位置をPiと置く。ステップSD10では、進行ベクトルをPi−1からPiへの単位ベクトルに更新する。   On the other hand, if YES is determined in step SD8 and the edge position is obtained, the process proceeds to step SD9, where the obtained edge position is set to Pi as shown on the right side of FIG. In step SD10, the progress vector is updated to a unit vector from Pi-1 to Pi.

その後、ステップSD11では、ステップSD9で求めた点Piを中心に、進行ベクトルと平行にセグメントを形成する。ステップSD12では、ステップSD11で形成したセグメントを縮退することによって2値化し、エッジ情報を得て、このエッジ情報からエッジ位置を求める。ステップSD13では、ステップSD12で求まったエッジ位置をPiと置く。ステップSD14では、進行ベクトルをPi−1からPiへの単位ベクトルに更新する。ステップSD15では、i=i+1とする。その後、ステップSD5に進む。   Thereafter, in step SD11, a segment is formed in parallel with the progress vector around the point Pi obtained in step SD9. In step SD12, the segment formed in step SD11 is binarized by degeneration, edge information is obtained, and an edge position is obtained from this edge information. In step SD13, the edge position obtained in step SD12 is set as Pi. In step SD14, the progress vector is updated to a unit vector from Pi-1 to Pi. In step SD15, i = i + 1. Thereafter, the process proceeds to step SD5.

つまり、順次設定されるサーチ領域に対してエッジ検出処理を繰り返し実行することで、図45Aに示すように、複数のエッジ位置(この例では点P0〜P10)を求めることができる。複数のエッジ位置を求めた後、エッジ連結部505が、エッジ位置を、求められた順(P0→P1→P2・・・P10→P0)に線で連結していくことにより、ワークWの輪郭を特定することができる。このとき、P0とP10の距離が所定距離以下であるか否かを判定し、所定距離以下ならP0とP10とを連結する方法と採用してもよい。   That is, by repeatedly executing the edge detection process for the search areas that are sequentially set, a plurality of edge positions (points P0 to P10 in this example) can be obtained as shown in FIG. 45A. After obtaining a plurality of edge positions, the edge connecting unit 505 connects the edge positions with lines in the order obtained (P0 → P1 → P2... P10 → P0). Can be specified. At this time, it may be determined whether or not the distance between P0 and P10 is equal to or smaller than a predetermined distance. If the distance is equal to or smaller than the predetermined distance, a method of connecting P0 and P10 may be adopted.

P10からP0に連結したときに閉領域フラグを持たせて処理を終了させることができる。P0は輪郭の始点及び終点になる。閉領域にならない輪郭の場合もある。こうして特定されたワークWの輪郭は、白及び黒以外の任意の色で検査用画面に合成された状態で表示できる。   When linked from P10 to P0, the process can be terminated with a closed region flag. P0 becomes the start point and end point of the contour. In some cases, the contour does not become a closed region. The contour of the workpiece W thus identified can be displayed in a state of being synthesized on the inspection screen in any color other than white and black.

図45Bでは、白い点(エッジ位置)によって既に輪郭が特定されていて、その後、エッジ位置としてP0〜P3を順に求めた場合を示している。P3を求めた後、既に特定されている輪郭と交差しないように処理を停止するのが好ましい。また、P3を求めた後、白い点ではなく、P0に連結して処理を終了させるようにしてもよく、これにより迷走を避けることができる。また、図45Bにおける白い点で示すエッジ位置のみで構成された閉領域としてもよい。尚、図面上の白い点は説明の便宜を図るために示しているだけであり、色や形態は任意に設定することができるが、既に求まったエッジ位置と、その後に求めたエッジ位置とは異なる色や形態で表示するのが好ましい。   FIG. 45B shows a case where a contour has already been specified by a white point (edge position), and then P0 to P3 are obtained in order as edge positions. After obtaining P3, it is preferable to stop the process so as not to intersect with the already specified contour. In addition, after obtaining P3, the process may be terminated by connecting to P0 instead of a white point, thereby avoiding stray. Moreover, it is good also as a closed area | region comprised only by the edge position shown with the white point in FIG. 45B. The white dots on the drawing are only shown for convenience of explanation, and the color and form can be arbitrarily set. However, the edge position already obtained and the edge position obtained thereafter are It is preferable to display in different colors and forms.

図45Cでは、白い点(エッジ位置)によって既に輪郭が特定されていて、その後、エッジ位置としてP0、P1を求めた場合を示している。P1を求めた後に形成されたセグメントS1内に、既に特定されている輪郭が存在している場合には処理を停止することができる。尚、セグメントS1内に、仮にP0が存在していた場合には処理を停止させることなく、P0と連結するようにすればよい。   FIG. 45C shows a case where a contour has already been specified by a white point (edge position), and then P0 and P1 are obtained as edge positions. If there is an already specified contour in the segment S1 formed after obtaining P1, the process can be stopped. If P0 exists in the segment S1, it is only necessary to connect P0 without stopping the processing.

図46は、輪郭の曲率が小さい場合の処理方法を示す図である。図46の上に示すように、エッジ位置P1を求めた後、次のエッジ位置を求めるために、進行ベクトル方向に所定距離Lだけ離れたところにセグメントS1を形成するのであるが、このとき、輪郭の曲率が小さいと、セグメントS1の外に輪郭が位置することになり、エッジ位置を検出できない場合がある。   FIG. 46 is a diagram illustrating a processing method when the curvature of the contour is small. As shown in FIG. 46, after obtaining the edge position P1, in order to obtain the next edge position, the segment S1 is formed at a predetermined distance L in the traveling vector direction. If the curvature of the contour is small, the contour is located outside the segment S1, and the edge position may not be detected.

このように、セグメントS1内でエッジ位置を検出できなかったときには、サーチ領域設定部503は、所定距離Lを短くしてセグメントS1を再設定するように構成されている。図46の上から2番目の図に示すように、所定距離LをたとえばL/2とすることができる。エッジ検出部502は、所定距離Lを短くして再設定されたセグメントS1内でエッジ位置を検出するとともに、エッジの勾配方向を特定する。尚、所定距離をL/2にしてもセグメントS1内にエッジを検出できなかった場合には、所定距離を更に短くしてセグメントS1を形成する。   Thus, when the edge position cannot be detected in the segment S1, the search area setting unit 503 is configured to shorten the predetermined distance L and reset the segment S1. As shown in the second diagram from the top in FIG. 46, the predetermined distance L can be set to L / 2, for example. The edge detection unit 502 detects the edge position in the segment S1 reset by shortening the predetermined distance L and specifies the edge gradient direction. If the edge cannot be detected in the segment S1 even if the predetermined distance is L / 2, the predetermined distance is further shortened to form the segment S1.

図46の上から2番目の図では、セグメントS1内の画素を投影すると、輪郭に対して斜めに投影することになるのでエッジがぼやけてしまい、正確なエッジが分かり難くなることがある。このことに対して、図46の下に示すように、エッジ検出部502は、サーチ領域設定部503で再設定されたセグメントS1内で検出されたエッジ位置を仮エッジ位置P2とし、サーチ領域設定部503は、仮エッジ位置P2と、該仮エッジ位置P2の直前に検出されたエッジ位置P1とを結ぶベクトルtと直交する方向に広がるセグメントS1’(再設定サーチ領域)を設定する。これにより、セグメントS1’内の画素を投影したときにエッジが明確になる。エッジ検出部502は、セグメントS1’内でエッジ位置を検出するとともに、当該エッジの勾配方向を特定し、検出されたエッジ位置を、上記仮エッジ位置P2と置き換えるように構成されている。   In the second diagram from the top in FIG. 46, when the pixels in the segment S1 are projected, the edges are projected obliquely with respect to the outline, so that the edges are blurred and the accurate edges may be difficult to understand. In contrast, as shown in the lower part of FIG. 46, the edge detection unit 502 sets the edge position detected in the segment S1 reset by the search area setting unit 503 as the temporary edge position P2, and sets the search area. The unit 503 sets a segment S1 ′ (reset search area) extending in a direction orthogonal to the vector t connecting the temporary edge position P2 and the edge position P1 detected immediately before the temporary edge position P2. Thereby, the edge becomes clear when the pixels in the segment S1 'are projected. The edge detection unit 502 is configured to detect an edge position in the segment S1 ', specify the gradient direction of the edge, and replace the detected edge position with the temporary edge position P2.

また、図47に示すような検査対象物、たとえばビードやシール剤、Oリング等では、当該検査対象物が所定の幅Cを持っており、幅方向の両側に輪郭がそれぞれある。本実施形態では、上述した方法を応用して幅方向の両側の輪郭を特定することもできる。以下、図48のフローチャートに基づいて両側の輪郭特定方法について詳細に説明する。   47, for example, a bead, a sealing agent, an O-ring, or the like, the inspection object has a predetermined width C and has contours on both sides in the width direction. In the present embodiment, the contours on both sides in the width direction can be specified by applying the above-described method. Hereinafter, the method of specifying the contours on both sides will be described in detail based on the flowchart of FIG.

図48のフローチャートのステップSE1では、i=1と置く。その後、ステップSE2に進む。ステップSE2では、使用者が、表示部5に表示された検査用画像上で、検査対象物のエッジ検出の初期位置となる任意の位置をマウス7のクリック操作によって指定する。たとえば図47に示す検査用画像上(一部を示している)で、使用者が検査対象物の幅方向中心部であると認識している所にポインタ(白抜きの矢印で示す)を置き、マウス7をクリック操作する。クリックされた位置は位置受付部501によって受け付けられる。   In step SE1 of the flowchart of FIG. 48, i = 1 is set. Thereafter, the process proceeds to step SE2. In step SE <b> 2, the user designates an arbitrary position, which is an initial position for edge detection of the inspection object, on the inspection image displayed on the display unit 5 by a click operation of the mouse 7. For example, on the inspection image shown in FIG. 47 (partially shown), a pointer (indicated by a white arrow) is placed where the user recognizes that it is the center in the width direction of the inspection object. The mouse 7 is clicked. The clicked position is received by the position receiving unit 501.

ステップSE3では、クリックされた位置を含む所定範囲の領域S0内(図49に示す)でエッジ強度の強い座標を求め、最初のエッジ位置E0を設定する。ステップSE4では、勾配ベクトルnをたどり、対応するエッジ位置E0’を求める。エッジ位置E0’における勾配ベクトルn’の方向は勾配ベクトルnと反対になる。エッジ位置E0とエッジ位置E0’との中間位置を初期座標(制御点)P0とする。   In step SE3, coordinates having a strong edge strength are obtained within a predetermined area S0 (shown in FIG. 49) including the clicked position, and the first edge position E0 is set. In step SE4, the gradient vector n is followed to find the corresponding edge position E0 '. The direction of the gradient vector n 'at the edge position E0' is opposite to the gradient vector n. An intermediate position between the edge position E0 and the edge position E0 'is set as an initial coordinate (control point) P0.

ステップSE5では、エッジ位置E0における勾配ベクトルnと、エッジ位置E0’における勾配ベクトルn’を平均して、進行ベクトルrを算出する。ステップSE6では、図50に示すように、進行ベクトルr×L(所定距離)だけ離れた位置の座標(点Si)を求める。ステップSE7では、点Siを中心としたセグメントS1を進行ベクトルrと平行に形成する。   In step SE5, the gradient vector n at the edge position E0 and the gradient vector n 'at the edge position E0' are averaged to calculate a progress vector r. In step SE6, as shown in FIG. 50, the coordinates (point Si) of the position separated by the progression vector r × L (predetermined distance) are obtained. In step SE7, a segment S1 centered on the point Si is formed in parallel with the progress vector r.

ステップSE8では、セグメントS1内の画素をエッジ勾配方向と直交する方向に投影(縮退)することによって一次元の画素値をエッジ情報として得て、このエッジ情報からエッジ位置Ei、Ei’を求める。ステップSE9では、エッジ位置が求まったか否か判定する。ステップSE9でNOと判定された場合にはステップSE17、18を経てステップSE6に戻る。複数回試してもエッジ位置が求まらなかった場合には処理を終了する。   In step SE8, one-dimensional pixel values are obtained as edge information by projecting (degenerate) the pixels in the segment S1 in a direction orthogonal to the edge gradient direction, and edge positions Ei and Ei 'are obtained from the edge information. In step SE9, it is determined whether an edge position has been obtained. If NO in step SE9, the process returns to step SE6 via steps SE17 and SE18. If the edge position is not obtained even after a plurality of trials, the process is terminated.

一方、ステップSE9でYESと判定されてエッジ位置Ei、Ei’が求まった場合には、ステップSE10に進み、エッジ位置Ei、Ei’の中間位置をPiと置く。ステップSE11では、進行ベクトルをPi−1からPiへの単位ベクトルに更新する。その後、ステップSE12では、ステップSE10で求めた点Piを中心に、進行ベクトルと平行にセグメントを形成する。ステップSE13では、ステップSE12で形成したセグメントを縮退することによって2値化し、エッジ情報を得て、このエッジ情報からエッジ位置を求める。ステップSE14では、ステップSE13で求まったエッジ位置をPiと置く。ステップSE15では、進行ベクトルをPi−1からPiへの単位ベクトルに更新する。ステップSE16では、i=i+1とする。その後、ステップSE6に進む。従って、順次設定されるサーチ領域に対してエッジ検出処理を検査対象物の幅方向両側で繰り返し実行することで、両側のエッジ位置をそれぞれ複数求めることができる。エッジ位置を求めた後、エッジ連結部505が、エッジ位置を線で連結していくことにより、両側の輪郭を特定することができる。   On the other hand, if YES is determined in step SE9 and the edge positions Ei and Ei 'are obtained, the process proceeds to step SE10, and the intermediate position between the edge positions Ei and Ei' is set to Pi. In step SE11, the progress vector is updated to a unit vector from Pi-1 to Pi. Thereafter, in step SE12, a segment is formed in parallel with the progress vector around the point Pi obtained in step SE10. In step SE13, the segment formed in step SE12 is binarized by degeneration, edge information is obtained, and an edge position is obtained from this edge information. In step SE14, the edge position obtained in step SE13 is set as Pi. In step SE15, the progress vector is updated to a unit vector from Pi-1 to Pi. In step SE16, i = i + 1. Thereafter, the process proceeds to Step SE6. Accordingly, it is possible to obtain a plurality of edge positions on both sides by repeatedly executing the edge detection process on both sides in the width direction of the inspection object for the search areas set in sequence. After obtaining the edge position, the edge connecting unit 505 can specify the contours on both sides by connecting the edge positions with lines.

エッジの生成は、画像検査装置1の設定時に行うことができ、生成したエッジを基準モデル線として記憶装置10に記憶させておくことができる。画像検査装置1の設定後、画像検査装置1の運用時には、検査対象物を撮像して検査用画像を得て、検査用画像の検査対象物の位置補正等を行った後、検査用画像上の検査対象物のエッジを検出し、検出したエッジと上記基準モデル線とを比較して差が所定以上である場合に欠陥部であると特定することができる。これは検査部4aが実行できる。   An edge can be generated when the image inspection apparatus 1 is set, and the generated edge can be stored in the storage device 10 as a reference model line. After setting the image inspection apparatus 1, when the image inspection apparatus 1 is in operation, the inspection object is imaged to obtain an inspection image, the position of the inspection object in the inspection image is corrected, and the like. The edge of the inspection object is detected, and the detected edge and the reference model line are compared, and when the difference is equal to or larger than a predetermined value, it can be identified as a defective portion. This can be executed by the inspection unit 4a.

(実施形態の作用効果)
この実施形態3によれば、使用者が表示部5に表示された検査用画像上で、ワークWのエッジまたはその近傍位置を指定すると、サーチ領域の設定、サーチ領域内におけるしきい値の設定、サーチ領域内でのエッジ位置の検出が繰り返し行われてワークWの輪郭に沿って複数のエッジ位置を順次得ることができ、得られたエッジ位置を連結してワークWの輪郭を自動的に特定することができる。よって、簡単な操作であっても高精度に輪郭を特定することができ、検査精度を向上させることができる。
(実施形態4)
図51は、本発明の実施形態4に係る画像検査装置1のブロック図である。この実施形態4は、画像検査装置1がエッジ生成部300を備えている点で実施形態1と異なっているが、他の部分は実施形態1と同じであるため、以下、実施形態1と同じ部分には同じ符合を付して説明を省略し、異なる部分いついて詳細に説明する。
(Effect of embodiment)
According to the third embodiment, when the user designates the edge of the workpiece W or a position near the workpiece W on the inspection image displayed on the display unit 5, the search area is set and the threshold value is set in the search area. The edge position in the search area is repeatedly detected, and a plurality of edge positions can be obtained sequentially along the contour of the work W. The obtained edge positions are connected to automatically contour the work W. Can be identified. Therefore, the contour can be specified with high accuracy even with a simple operation, and the inspection accuracy can be improved.
(Embodiment 4)
FIG. 51 is a block diagram of the image inspection apparatus 1 according to the fourth embodiment of the present invention. The fourth embodiment is different from the first embodiment in that the image inspection apparatus 1 includes the edge generation unit 300. However, the other parts are the same as those in the first embodiment, and hence the same as the first embodiment. The same reference numerals are given to the portions and the description thereof is omitted, and different portions will be described in detail.

エッジ生成部300は、表示部5に表示された検査用画像上の異なる位置に複数のエッジ検出領域を設定するためのエッジ検出領域設定部301と、各エッジ検出領域内で複数のエッジ点を検出し、隣接するエッジ点同士を連結することにより、検査対象物の輪郭の一部を構成する輪郭セグメントをエッジ検出領域ごとに形成する輪郭セグメント形成部302と、輪郭セグメント形成部302で形成された一の輪郭セグメントの端部と、該端部と最も近い他の輪郭セグメントの端部とを連結する連結処理を実行し、当該連結処理を輪郭セグメントの開放端が無くなるまで繰り返して閉領域を形成する閉領域形成部303とを備えている。   The edge generation unit 300 includes an edge detection region setting unit 301 for setting a plurality of edge detection regions at different positions on the inspection image displayed on the display unit 5, and a plurality of edge points in each edge detection region. By detecting and connecting adjacent edge points, a contour segment forming unit 302 that forms a contour segment constituting a part of the contour of the inspection object for each edge detection region and a contour segment forming unit 302 are formed. A connecting process for connecting the end of the other contour segment and the end of the other contour segment closest to the end, and repeating the connecting process until the open end of the contour segment disappears. And a closed region forming portion 303 to be formed.

すなわち、図52の上側はワークWを撮像した検査用画像を示しており、使用者は、検査用画像を見ながら図52の中央に示すように、検査用画像上の異なる位置にエッジ検出領域F1、F2を設定する。エッジ検出領域F1、F2は、たとえば使用者によるマウス7やキーボード6の入力操作によってワークWにおける所望部分を囲むことによって形成することができ、この操作によって囲まれた部分を、エッジ検出領域設定部301がエッジ検出領域F1、F2として設定する。   That is, the upper side of FIG. 52 shows the inspection image obtained by imaging the workpiece W, and the user can see the edge detection regions at different positions on the inspection image as shown in the center of FIG. 52 while viewing the inspection image. F1 and F2 are set. The edge detection areas F1 and F2 can be formed, for example, by surrounding a desired part in the workpiece W by an input operation of the mouse 7 or the keyboard 6 by the user, and the part surrounded by the operation is defined as an edge detection area setting unit. 301 sets the edge detection areas F1 and F2.

エッジ検出領域F1内では、図52の中央の図の一部を拡大して示すように、エッジ点P1、P2、P3、…を検出する。エッジ点は従来から周知の方法で検出することもできるし、実施形態3のような方法で検出することもできる。隣接するエッジ点(たとえばP1とP2)同士を連結することにより、ワークWの輪郭の一部を構成する輪郭セグメントK1が形成される。エッジ検出領域F2内においても同様に輪郭セグメントK2が形成される。これは輪郭セグメント形成部302で行う。   In the edge detection area F1, edge points P1, P2, P3,... Are detected as shown in an enlarged view of a part of the center of FIG. The edge point can be detected by a conventionally known method, or can be detected by a method as in the third embodiment. By connecting adjacent edge points (for example, P1 and P2) to each other, a contour segment K1 constituting a part of the contour of the workpiece W is formed. A contour segment K2 is similarly formed in the edge detection region F2. This is performed by the contour segment forming unit 302.

尚、輪郭セグメントは使用者がマウス7等の入力装置を使用して指定することによって形成してもよい。この場合、使用者が表示部5に表示された検査用画像を見ながら、マウス7の操作によって輪郭セグメントの始点と終点とを少なくとも指定する。使用者による始点及び終点の指定を受けた輪郭セグメント形成部302は、始点と終点とを結ぶ直線を輪郭セグメントとする。この場合、使用者は始点と終点の間の中間点を追加で指定するようにしてもよい。また、輪郭セグメントは直線に限られるものではなく、マウス7等の操作によって曲線に形成することもできる。   Note that the contour segment may be formed by the user specifying using an input device such as the mouse 7. In this case, the user designates at least the start point and the end point of the contour segment by operating the mouse 7 while viewing the inspection image displayed on the display unit 5. The contour segment forming unit 302 that has received the specification of the start point and the end point by the user sets a straight line connecting the start point and the end point as the contour segment. In this case, the user may additionally designate an intermediate point between the start point and the end point. Further, the contour segment is not limited to a straight line, and can be formed into a curved line by operating the mouse 7 or the like.

閉領域形成部303は、図52の下側に示すように、輪郭セグメントK1の端部K1aと、該端部K1aに最も近い輪郭セグメントK2の端部K2aとを直線からなる連結線L1によって連結する。また、輪郭セグメントK1の端部K1bと、該端部K1bに最も近い輪郭セグメントK2の端部K2bとを直線からなる連結線L2によって連結する。これにより、輪郭セグメントK1、K2の開放端が無くなって閉領域Mが形成される。この閉領域Mが検査対象領域となり、検査部4aが欠陥検査を実行する領域になる。   As shown in the lower side of FIG. 52, the closed region forming unit 303 connects the end K1a of the contour segment K1 and the end K2a of the contour segment K2 closest to the end K1a by a connecting line L1 formed of a straight line. To do. Further, the end K1b of the contour segment K1 and the end K2b of the contour segment K2 closest to the end K1b are connected by a connecting line L2 made of a straight line. As a result, the open ends of the contour segments K1, K2 are eliminated, and the closed region M is formed. This closed area M becomes an inspection target area, and becomes an area where the inspection unit 4a performs defect inspection.

連結処理を行う対象となっている輪郭セグメントK1の端部K1aと輪郭セグメントK2の端部K2aとの離間距離は、隣合うエッジ点同士(たとえばP1とP2)の間隔よりも長く設定されている。これにより、輪郭セグメントK1の端部K1aと、輪郭セグメントK2の端部K2aとがエッジ点であると誤って認識されにくくなる。   The separation distance between the end K1a of the contour segment K1 and the end K2a of the contour segment K2 to be connected is set longer than the interval between adjacent edge points (for example, P1 and P2). . As a result, the end K1a of the contour segment K1 and the end K2a of the contour segment K2 are less likely to be mistakenly recognized as edge points.

また、図53に示すようなワークWで当該ワークWの略全体を検査対象領域としたい場合には、同図の上側に示すように、ワークWの周縁部を囲むようにしてエッジ検出領域F1〜F6を形成する。エッジ検出領域F1〜F6には輪郭セグメントK1〜K6が形成される。   Further, in the case where it is desired to use the work W as shown in FIG. 53 as a region to be inspected, the edge detection regions F1 to F6 so as to surround the periphery of the work W as shown in the upper side of FIG. Form. Contour segments K1 to K6 are formed in the edge detection areas F1 to F6.

輪郭セグメントK1〜K6の形成後、同図の下側に示すように、輪郭セグメントK1〜K6の端部が、連結線L1〜L6で連結されて閉領域Mが形成される。この例では、ワークWの角部を外すように閉領域Mを形成することができるので、たとえばワークWの角部の面取り加工部やR加工部を外した検査対象領域を形成できる。   After the formation of the contour segments K1 to K6, as shown on the lower side of the figure, the ends of the contour segments K1 to K6 are connected by connecting lines L1 to L6 to form a closed region M. In this example, the closed region M can be formed so as to remove the corner portion of the workpiece W, and therefore, for example, an inspection target region from which the chamfered portion and the R portion of the corner portion of the workpiece W are removed can be formed.

図52に示す場合及び図53に示す場合の両方で、輪郭セグメントを連結する際には、全てのエッジ検出領域が形成されてから連結するようにしてもよいし、エッジ検出領域が形成された順に連結するようにしてもよい。また、輪郭セグメントを連結する際には、既に連結されている端部に対しては、連結処理を行うことができないようにすることもできる。また、互いに交差する関係にある輪郭セグメント同士を連結できないようにすることもできる。さらに、連結線が最も短くなるような連結処理を行うこともできる。さらにまた、連結する端部を使用者が手動で選択可能にして変更できるように構成してもよい。   When connecting the contour segments in both the case shown in FIG. 52 and the case shown in FIG. 53, the edge segments may be connected after all edge detection regions are formed, or the edge detection regions are formed. You may make it connect in order. Further, when connecting the contour segments, it is possible to prevent the connection processing from being performed on the already connected end portions. It is also possible to prevent the contour segments that are in a crossing relationship from being connected to each other. Furthermore, it is possible to perform a connection process that shortens the connection line. Furthermore, the end to be connected may be configured so that the user can manually select and change the end.

輪郭セグメントを連結する際の連結線が所定長さ以上になると連結処理を行うことができないようにすることもできる。この場合、輪郭セグメントが閉領域を構成しないことになる。連結線の長さが所定長さ以上になるということは、2つの輪郭セグメント間が大きく離れているということであり、この場合に連結処理を行わないことで、誤った連結処理が行われてしまうのを回避できる。尚、連結する端部を使用者が手動で選択可能にした場合には、連結線の長さが所定長さを超えていても連結可能するのが好ましい。   It is also possible to prevent the connection process from being performed when the connecting line for connecting the contour segments exceeds a predetermined length. In this case, the contour segment does not constitute a closed region. When the length of the connecting line is equal to or longer than the predetermined length, it means that the two contour segments are greatly separated. In this case, the connecting process is not performed, and thus an incorrect connecting process is performed. Can be avoided. In addition, when the user can manually select the end portion to be connected, it is preferable that the connection is possible even if the length of the connecting line exceeds a predetermined length.

また、連結線は直線に限られるものではなく、たとえば二次曲線、三次曲線等、特にペジエ曲線、スプライン曲線等の曲線とすることもできる。これにより、輪郭セグメントの端部を滑らかに連結することができる。また、連結線は、曲線と直線との組み合わせであってもよい。また、一の輪郭セグメントと他の輪郭セグメントとを、一の輪郭セグメントの端部の接線ベクトルと共通の接線ベクトルを持つ曲線によって連結することもできる。   Further, the connecting line is not limited to a straight line, and may be a curve such as a quadratic curve or a cubic curve, particularly a Pezier curve or a spline curve. Thereby, the edge part of a contour segment can be connected smoothly. Further, the connection line may be a combination of a curve and a straight line. Also, one contour segment and another contour segment can be connected by a curve having a tangent vector common to the tangent vector at the end of the one contour segment.

図54は、1つのワークWを2回に分けて撮像した場合について説明するための図である。撮像部3が、ワークWの撮像境界線R1よりも上側の部分を撮像して上側部分検査用画像(第1部分検査用画像)を得るとともに、ワークWの撮像境界線R2よりも下側の部分を撮像して下側部分検査用画像(第2部分検査用画像)を得る。従って、ワークWにおける撮像境界線R1と撮像境界線R2との間の所定の範囲が、上側部分検査用画像及び下側部分検査用画像の両方の撮像範囲に含まれる重複部分になる。尚、ワークWの撮像範囲の設定は上記した例に限られるものではなく、左右方向に分割する撮像形態であってもよいし、3つ以上に分割する撮像形態であってもよい。   FIG. 54 is a diagram for explaining a case where one workpiece W is imaged in two steps. The imaging unit 3 captures an upper portion of the workpiece W above the imaging boundary line R1 to obtain an upper partial inspection image (first partial inspection image), and is lower than the imaging boundary line R2 of the workpiece W. A part is imaged to obtain a lower partial inspection image (second partial inspection image). Accordingly, a predetermined range between the imaging boundary line R1 and the imaging boundary line R2 in the workpiece W is an overlapping portion included in the imaging ranges of both the upper partial inspection image and the lower partial inspection image. Note that the setting of the imaging range of the workpiece W is not limited to the above example, and may be an imaging mode that divides in the left-right direction or an imaging mode that divides into three or more.

この場合、図54の左側に示すように、上側部分検査用画像でエッジ検出領域F1〜F6を形成する。このとき、上側部分検査用画像では、撮像境界線R1に接するまでワークWが存在しているが、エッジ検出領域F1、F3、F4、F6の下端部を撮像境界線R1に接するぎりぎりまで延ばす操作を上側部分検査用画像上で行うのは難しいので、使用者がエッジ検出領域F1、F3、F4、F6の下端部を延ばす操作を行う際、撮像境界線R1に接する手前のところで止めてしまうことが考えられる。   In this case, as shown on the left side of FIG. 54, the edge detection areas F1 to F6 are formed by the upper partial inspection image. At this time, in the upper partial inspection image, the workpiece W exists until it comes into contact with the imaging boundary line R1, but an operation of extending the lower end portions of the edge detection areas F1, F3, F4, and F6 to the limit of contact with the imaging boundary line R1. Is difficult to perform on the upper partial inspection image, when the user performs an operation to extend the lower ends of the edge detection areas F1, F3, F4, and F6, the user stops at a position just before touching the imaging boundary line R1. Can be considered.

このことに対して、本実施形態では、上側部分検査用画像における下側部分検査用画像との重複部分に、エッジ検出領域F1、F3、F4、F6の下端部が達していて、輪郭セグメントK1、K3、K4、K6の端部が上記重複部分に位置している場合には、輪郭セグメントK1の下端部と輪郭セグメントK4の下端部とを連結線L1で連結し、輪郭セグメントK3の下端部と輪郭セグメントK6の下端部とを連結線L2で連結する。これにより、閉領域Mを形成することができる。図54の右側に示すように、下側部分検査用画像においても同様に処理することができる。   In contrast, in the present embodiment, the lower end portions of the edge detection regions F1, F3, F4, and F6 reach the overlapping portion of the upper partial inspection image with the lower partial inspection image, and the contour segment K1 , K3, K4, and K6 are located in the overlapping portion, the lower end of the contour segment K1 and the lower end of the contour segment K4 are connected by the connecting line L1, and the lower end of the contour segment K3 And the lower end of the contour segment K6 are connected by a connecting line L2. Thereby, the closed region M can be formed. As shown on the right side of FIG. 54, the same processing can be performed for the lower partial inspection image.

つまり、一の部分検査用画像(上側部分検査用画像)における他の部分検査用画像(下側部分検査用画像)との重複部分に、複数の輪郭セグメント(K1、K3、K4、K6)の端部が位置していると、当該輪郭セグメントの端部にエッジ検出領域が無くても、輪郭セグメントの端部同士を連結線で連結する処理を自動で行うことができる。   That is, a plurality of contour segments (K1, K3, K4, K6) are overlapped with another partial inspection image (lower partial inspection image) in one partial inspection image (upper partial inspection image). When the end portion is located, even if there is no edge detection region at the end portion of the contour segment, the processing of connecting the end portions of the contour segment with a connecting line can be automatically performed.

その後、閉領域M以外の部分を黒くして非検査対象領域とする一方、閉領域M(斜線領域)を白くして検査対象領域とする。下側部分検査用画像においても同様に非検査対象領域と検査対象領域を設定できる。これにより、ワークWを分けて撮像した場合であっても簡単な操作でもって検査したい範囲の全てを検査対象とすることができる。   Thereafter, the portions other than the closed region M are blackened as non-inspection target regions, while the closed region M (shaded region) is whitened as the inspection target region. Similarly, in the lower partial inspection image, a non-inspection target area and an inspection target area can be set. Thereby, even if it is a case where the workpiece | work W is image | photographed separately, all the range which wants to test | inspect with simple operation can be made into inspection object.

(実施形態の作用効果)
この実施形態4によれば、使用者が複数のエッジ検出領域を設定すると、各エッジ検出領域内で複数のエッジ点を検出してエッジ点同士を連結して複数の輪郭セグメントを形成することができ、これら輪郭セグメントの端部同士を連結して閉領域を形成し、この閉領域を検査対象領域としてワークWの欠陥検査を実行することができる。
(Effect of embodiment)
According to the fourth embodiment, when the user sets a plurality of edge detection areas, a plurality of edge points are detected in each edge detection area and the edge points are connected to form a plurality of contour segments. It is possible to connect the end portions of the contour segments to form a closed region, and to perform a defect inspection of the workpiece W using the closed region as an inspection target region.

(その他の実施形態)
本発明は上記実施形態1〜4の形態に限定されるものではない。例えば、図55に示す変形例1のように、画像検査装置1の構成としては、撮像部3に画像生成部42を組み込むことができる。これにより、デフレクトメトリ処理による検査用画像の作成までは撮像部3で行い、その他の処理を制御ユニット4で行う。つまり、撮像部3に画像処理機能を持たせたスマートカメラにすることもできる。
(Other embodiments)
The present invention is not limited to the embodiments 1 to 4 described above. For example, as in the first modification shown in FIG. 55, the image generation apparatus 42 can be incorporated in the imaging section 3 as the configuration of the image inspection apparatus 1. As a result, the imaging unit 3 performs up to the creation of the inspection image by the deflectometry process, and the control unit 4 performs other processes. That is, a smart camera in which the image pickup unit 3 has an image processing function can be provided.

また、図56に示す変形例2のように、パターン光照明部2と撮像部3が一体で、制御ユニット4を別体にすることもできる。この場合、パターン光照明部2に撮像部3を内蔵させることもできるし、撮像部3にパターン光照明部2を内蔵することもできる。   Further, as in Modification 2 shown in FIG. 56, the pattern light illumination unit 2 and the imaging unit 3 can be integrated, and the control unit 4 can be separated. In this case, the imaging unit 3 can be built in the pattern light illumination unit 2, or the pattern light illumination unit 2 can be built in the imaging unit 3.

また、図57に示す変形例3のように、撮像部3及び制御ユニット4の全てを一体にして、撮像部3に制御ユニット4が組み込まれた構成とすることもできる。   Further, as in Modification 3 shown in FIG. 57, all of the imaging unit 3 and the control unit 4 may be integrated so that the control unit 4 is incorporated in the imaging unit 3.

また、パターン光照明部2、撮像部3及び制御ユニット4の全てを一体にすることもできる。   Moreover, all of the pattern light illumination part 2, the imaging part 3, and the control unit 4 can also be integrated.

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

以上説明したように、本発明に係る画像検査装置は、各種検査対象物を撮像した画像を用いて検査対象物の欠陥を検査する場合に使用することができる。   As described above, the image inspection apparatus according to the present invention can be used when a defect of an inspection object is inspected using images obtained by imaging various inspection objects.

1 画像検査装置
2 パターン光照明部
3 撮像部
3a 受光素子
5 表示部
9 情報取得部
10 記憶装置
10b 位置情報記憶部
31 ラインカメラ
40 フィルタ処理部
41 制御部
42 画像生成部
48 位置指定受付部
49 設定部
58e 表示画像選択用プルダウンメニュー(画像選択部)
W 検査対象物(ワーク)
DESCRIPTION OF SYMBOLS 1 Image inspection apparatus 2 Pattern light illumination part 3 Imaging part 3a Light receiving element 5 Display part 9 Information acquisition part 10 Storage apparatus 10b Position information storage part 31 Line camera 40 Filter process part 41 Control part 42 Image generation part 48 Position designation reception part 49 Setting section 58e Display image selection pull-down menu (image selection section)
W Inspection object (work)

Claims (5)

検査対象物を撮像した画像を用いて検査対象物の欠陥を検査する画像検査装置において、
検査対象物に光を照射する照明部と、
上記照明部によって照明されたタイミングで検査対象物を撮像して複数の輝度画像を得る撮像部と、
上記撮像部が撮像した上記複数の輝度画像に基づいて、複数の検査用画像を生成する画像生成部と、
上記画像生成部で生成された上記複数の検査用画像の中から、検査に用いる少なくとも一つの第1検査用画像を選択する画像選択部と、
上記画像選択部により選択された上記第1検査用画像を表示可能な表示部と、
上記表示部に表示されている上記第1検査用画像に対して、当該第1検査用画像における検査対象物の非欠陥部または欠陥部の位置の指定を複数回受け付け可能な受付部と、
上記受付部により受け付けた複数の非欠陥部または欠陥部の位置情報を記憶する位置情報記憶部と、
上記受付部により受け付けた非欠陥部または欠陥部の位置の画素値に基づいて、非欠陥部とすべき画素値範囲を、上記表示部に表示されている上記第1検査用画像に対して自動的に設定する設定部とを備え、
上記設定部は、上記画像選択部により、上記表示部に表示されていない検査用画像が第2検査用画像として選択された際に、上記位置情報記憶部に記憶された非欠陥部または欠陥部の位置を示す複数の位置情報を読み出し、上記第2検査用画像における上記位置情報に対応する画素値を参照して上記非欠陥部とすべき画素値範囲を更新するように構成されていることを特徴とする画像検査装置。
In an image inspection apparatus that inspects a defect of an inspection object using an image obtained by imaging the inspection object,
An illumination unit for irradiating the inspection object with light;
An imaging unit that captures an inspection object at a timing illuminated by the illumination unit to obtain a plurality of luminance images;
An image generation unit that generates a plurality of inspection images based on the plurality of luminance images captured by the imaging unit;
An image selection unit that selects at least one first inspection image used for inspection from the plurality of inspection images generated by the image generation unit;
A display unit capable of displaying the first inspection image selected by the image selection unit;
A receiving unit capable of receiving a plurality of designations of a position of a non-defective part or a defective part of an inspection object in the first inspection image for the first inspection image displayed on the display unit;
A position information storage unit that stores position information of a plurality of non-defective portions or defective portions received by the receiving unit;
Based on the pixel value of the non-defective part or the position of the defective part received by the receiving part, the pixel value range to be the non-defective part is automatically set for the first inspection image displayed on the display part. And a setting section for setting automatically,
The setting unit includes a non-defect portion or a defect portion stored in the position information storage unit when an inspection image not displayed on the display unit is selected as a second inspection image by the image selection unit. A plurality of pieces of position information indicating the positions of the second inspection image, and a pixel value range to be the non-defective part is updated with reference to a pixel value corresponding to the position information in the second inspection image. An image inspection apparatus.
請求項1に記載の画像検査装置において、
上記表示部は、複数の上記検査用画像を表示可能に構成され、
上記画像生成部は、上記設定部により、上記表示部に表示されている複数の上記検査用画像に対して設定された非欠陥部とすべき画素値範囲の全てに含まれる領域を非欠陥領域とし、いずれかの画素値範囲に含まれない領域を欠陥領域とした合成欠陥画像を生成するように構成されていることを特徴とする画像検査装置。
The image inspection apparatus according to claim 1,
The display unit is configured to be able to display a plurality of the inspection images,
The image generation unit sets a region included in all pixel value ranges to be non-defective portions set for the plurality of inspection images displayed on the display unit by the setting unit. An image inspection apparatus configured to generate a composite defect image in which a region not included in any pixel value range is a defective region.
請求項1または2に記載の画像検査装置において、
検査用画像に対してフィルタ処理を行うフィルタ処理部を備え、
上記設定部は、上記画像選択部により、上記第2検査用画像が選択された後、上記表示部に表示されておらずかつフィルタ処理が行われていない検査用画像が第3検査用画像として選択された際に、上記位置情報記憶部に記憶された非欠陥部または欠陥部の位置を示す複数の位置情報を読み出し、上記第3検査用画像における上記位置情報に対応する画素値を参照して上記非欠陥部とすべき画素値範囲を更新するように構成され、
上記フィルタ処理部は、上記第3検査用画像にフィルタ処理を行うように構成されていることを特徴とする画像検査装置。
The image inspection apparatus according to claim 1 or 2,
A filter processing unit that performs a filter process on the inspection image;
After the second image for inspection is selected by the image selection unit, the setting unit is configured to use, as a third image for inspection, an image for inspection that is not displayed on the display unit and is not subjected to filter processing. When selected, a plurality of position information indicating the position of the non-defect portion or the defect portion stored in the position information storage unit is read, and a pixel value corresponding to the position information in the third inspection image is referred to. Configured to update the pixel value range to be the non-defect portion,
The image inspection apparatus, wherein the filter processing unit is configured to perform a filter process on the third inspection image.
請求項3に記載の画像検査装置において、
上記受付部は、上記表示部に表示されている上記第2検査用画像に対して、当該第2検査用画像における検査対象物の非欠陥部または欠陥部の位置の指定を複数回受け付け可能に構成され、
上記位置情報記憶部は、上記受付部により受け付けた上記第2検査用画像における非欠陥部または欠陥部の位置情報を記憶するように構成され、
上記設定部は、上記画像選択部により上記第3検査用画像が選択された際に、上記位置情報記憶部に記憶された上記第2検査用画像における非欠陥部または欠陥部の位置を示す位置情報を読み出し、上記第3検査用画像における上記位置情報に対応する画素値を参照して上記非欠陥部とすべき画素値範囲を更新するように構成されていることを特徴とする画像検査装置。
The image inspection apparatus according to claim 3.
The reception unit can receive the designation of the position of the non-defective part or the defective part of the inspection object in the second inspection image for the second inspection image displayed on the display unit a plurality of times. Configured,
The position information storage unit is configured to store position information of a non-defect portion or a defect portion in the second inspection image received by the reception unit,
The setting unit is a position indicating a position of a non-defect portion or a defect portion in the second inspection image stored in the position information storage unit when the third inspection image is selected by the image selection unit. An image inspection apparatus configured to read out information and update a pixel value range to be the non-defective portion with reference to a pixel value corresponding to the position information in the third inspection image .
請求項4に記載の画像検査装置において、
上記設定部は、上記画像選択部により上記第3検査用画像が選択された際に、上記位置情報記憶部に記憶された上記第1検査用画像における非欠陥部または欠陥部の位置を示す位置情報と、上記第2検査用画像における非欠陥部または欠陥部の位置を示す位置情報とを読み出し、上記第3検査用画像における上記位置情報に対応する画素値を参照して上記非欠陥部とすべき画素値範囲を更新するように構成されていることを特徴とする画像検査装置。
The image inspection apparatus according to claim 4,
The setting unit is a position indicating a position of a non-defect portion or a defect portion in the first inspection image stored in the position information storage unit when the third inspection image is selected by the image selection unit. Information and position information indicating the position of the non-defect portion or the defect portion in the second inspection image, and the non-defect portion by referring to the pixel value corresponding to the position information in the third inspection image An image inspection apparatus configured to update a pixel value range to be updated.
JP2017107416A 2017-05-31 2017-05-31 Image inspection device Pending JP2018204999A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2017107416A JP2018204999A (en) 2017-05-31 2017-05-31 Image inspection device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2017107416A JP2018204999A (en) 2017-05-31 2017-05-31 Image inspection device

Publications (1)

Publication Number Publication Date
JP2018204999A true JP2018204999A (en) 2018-12-27

Family

ID=64956959

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017107416A Pending JP2018204999A (en) 2017-05-31 2017-05-31 Image inspection device

Country Status (1)

Country Link
JP (1) JP2018204999A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023105849A1 (en) * 2021-12-07 2023-06-15 パナソニックIpマネジメント株式会社 Inspecting method and inspecting device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023105849A1 (en) * 2021-12-07 2023-06-15 パナソニックIpマネジメント株式会社 Inspecting method and inspecting device

Similar Documents

Publication Publication Date Title
JP6917781B2 (en) Image inspection equipment
JP6967373B2 (en) Image inspection equipment
JP7188870B2 (en) Image inspection equipment
JP6745173B2 (en) Image inspection apparatus, image inspection method, image inspection program, computer-readable recording medium, and recorded device
JP6259422B2 (en) Multimode imaging
JP6917780B2 (en) Image inspection equipment
KR20060107386A (en) Defect inspection method and defect inspection apparatus using the same
JP7222796B2 (en) Image inspection system and image inspection method
JP2017122614A (en) Image generation method and inspection device
JP2018204995A (en) Image inspection device
JP2018205000A (en) Image inspection device
TW201428278A (en) Appearance inspection device, and appearance inspection method
KR20140065347A (en) Visual inspecting apparatus and method
JP2018204999A (en) Image inspection device
JP2018204996A (en) Image inspection device
JP2018205001A (en) Image inspection device
JP7231462B2 (en) Image inspection system and image inspection method
JP7402745B2 (en) Imaging device and image inspection system
JP2020016471A (en) Image inspection device
JP7342616B2 (en) Image processing system, setting method and program
CN110278384B (en) Image processing system, image processing apparatus, image processing method, and computer readable medium
JP2020169950A (en) Image inspection system
JP7231461B2 (en) Image inspection system and image inspection method
JP7306857B2 (en) Image inspection system
JP2020169959A (en) Image inspection system and image inspection method