[go: up one dir, main page]

JP2019060903A - Inspection device - Google Patents

Inspection device Download PDF

Info

Publication number
JP2019060903A
JP2019060903A JP2019013332A JP2019013332A JP2019060903A JP 2019060903 A JP2019060903 A JP 2019060903A JP 2019013332 A JP2019013332 A JP 2019013332A JP 2019013332 A JP2019013332 A JP 2019013332A JP 2019060903 A JP2019060903 A JP 2019060903A
Authority
JP
Japan
Prior art keywords
image
inspection
lighting
unit
light sources
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2019013332A
Other languages
Japanese (ja)
Other versions
JP6638098B2 (en
Inventor
一 松田
Hajime Matsuda
一 松田
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 JP2019013332A priority Critical patent/JP6638098B2/en
Publication of JP2019060903A publication Critical patent/JP2019060903A/en
Application granted granted Critical
Publication of JP6638098B2 publication Critical patent/JP6638098B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)

Abstract

【課題】フォトメトリックステレオ用の照明装置に使用される信号線の数を削減すること。【解決手段】照明装置3は、略環状に配置された複数のLEDと複数のLEDを点灯させる点灯制御部とを有している。とりわけ、照明装置3は点灯パターンを記憶する記憶部を有している。照明装置3は画像処理装置5から信号線8を介して受信した制御信号によって特定される点灯パターンにしたがって複数のLEDのいずれかを点灯させる。【選択図】図1PROBLEM TO BE SOLVED: To reduce the number of signal lines used in a lighting device for a photometric stereo. A lighting device 3 has a plurality of LEDs arranged in a substantially annular shape and a lighting control unit for lighting the plurality of LEDs. In particular, the lighting device 3 has a storage unit that stores a lighting pattern. The lighting device 3 lights any one of the plurality of LEDs according to a lighting pattern specified by a control signal received from the image processing device 5 via the signal line 8. [Selection diagram] Fig. 1

Description

本発明は検査装置に関する。   The present invention relates to an inspection apparatus.

フォトメトリックステレオの原理を使ってワーク(検査対象製品)について正確な三次元形状を計測するためには、ワークの各表面に対して均一な光量で照明光が入射するような照明光源が必要となる。また、照明光の入射角は既知である必要がある。さらに、ワークの部位に応じて光の入射角が変化してはならないため、検査したいワークのサイズに応じたサイズの照明光源が必要となる。また、カメラに映し出された画像のスケール情報(1画素あたりの実寸法)も必要となる。外観検査装置はユーザにより設置されることが多く、これらの厳格な設置条件をユーザに要求するのは困難である。そこで、特許文献1によれば、照明とカメラを一体化した専用装置を提案することで、ユーザの設置負担を軽減している。   In order to measure an accurate three-dimensional shape of a work (product to be inspected) using the principle of photometric stereo, it is necessary to use an illumination light source such that the illumination light is incident on each surface of the work with a uniform amount of light. Become. Also, the incident angle of the illumination light needs to be known. Furthermore, since the incident angle of light must not change according to the part of the work, an illumination light source of a size corresponding to the size of the work to be inspected is required. In addition, scale information (actual size per pixel) of the image projected on the camera is also required. Appearance inspection devices are often installed by the user, and it is difficult to request these strict installation conditions from the user. Then, according to patent document 1, the installation burden of the user is reduced by proposing the exclusive device which integrated illumination and a camera.

特開2007−206797号公報JP 2007-206797 A

特許文献1では4つのスポット照明光源によりそれぞれ平行光をワーク2に照射しているが、スポット照明であるがゆえに影が生じやすい。そのため、ワークの種類や置き方によってワークの表面のうち測定できない領域が多く生じてしまう。ワークの種類や置き方に応じて照明装置をワークから遠ざけて正反射光を利用したり、照明装置をワークに近づけて拡散反射光を利用したりできれば、このような課題を緩和できるであろう。ところで、フォトメトリックステレオ法では多数の照明方向からワークを照明する必要があるため、多数の光源を個別に制御するための多数の信号線が必要となる。しかし、信号線の数が多くなると、コストが増加するだけでなく、多数の信号線を内包するケーブルが太くなり、ケーブルの取り回しに支障を来す。   Although patent document 1 irradiates parallel light to work piece 2 respectively by four spot illumination light sources, since it is spot illumination, it is easy to produce a shadow. As a result, depending on the type and placement of the workpiece, many areas of the surface of the workpiece can not be measured. Depending on the type and placement of the work, if the lighting device can be moved away from the work to use specular light, or if the lighting device can be brought close to the work to use diffuse reflected light, such problems may be alleviated. . By the way, in the photometric stereo method, since it is necessary to illuminate the work from a large number of illumination directions, a large number of signal lines for individually controlling a large number of light sources are required. However, when the number of signal lines increases, not only the cost increases, but also the cable containing a large number of signal lines becomes thick, which hinders the cable management.

そこで、本発明は、フォトメトリックステレオ用の照明装置に使用される信号線の数を削減することを目的とする。   Therefore, the present invention aims to reduce the number of signal lines used in a lighting device for photometric stereo.

本発明によれば、たとえば、
検査対象物を撮像する撮像手段と、
略環状に配置された複数の光源と、前記複数の光源の点灯パターンを記憶した記憶部と、前記記憶部に記憶された点灯パターンであって信号線を介して受信した制御信号によって特定される点灯パターンにしたがって前記複数の光源を点灯させる点灯制御部とを有し、前記撮像手段とは独立して移動することで前記検査対象物に対する距離を調整する照明手段と、
前記撮像手段により取得された複数の輝度画像をフォトメトリックステレオ法により合成して、当該検査対象物の表面の傾きまたは反射率に応じた複数の画素値を有する検査画像を生成する検査画像生成手段と、
前記検査画像を用いて前記検査対象物の良否を判定する判定手段と
を有することを特徴とする検査装置が提供される。
According to the invention, for example
Imaging means for imaging an inspection object;
A plurality of light sources arranged in a substantially annular shape, a storage unit storing the lighting patterns of the plurality of light sources, and a lighting pattern stored in the storage unit, specified by a control signal received via a signal line A lighting control unit for lighting the plurality of light sources according to a lighting pattern, and illumination means for adjusting a distance to the inspection object by moving independently of the imaging means;
An inspection image generation unit that combines a plurality of luminance images acquired by the imaging unit according to a photometric stereo method, and generates an inspection image having a plurality of pixel values according to the inclination or reflectance of the surface of the inspection object When,
There is provided an inspection apparatus comprising: determination means for determining the quality of the inspection object using the inspection image.

本発明によれば、記憶部に記憶されている点灯パターンを指定する制御信号を伝達可能な信号線を配置し、制御信号にしたがって点灯パターンを特定して複数の光源を点灯させるため、各光源ごとに信号線を配置する場合と比較して、大幅に信号線の数を削減できるようになる。   According to the present invention, a signal line capable of transmitting a control signal for specifying the lighting pattern stored in the storage unit is disposed, and the lighting pattern is specified according to the control signal to light a plurality of light sources. The number of signal lines can be significantly reduced as compared to the case where signal lines are arranged for each.

検査装置の概要を示す図Diagram showing the outline of the inspection device フォトメトリックステレオの原理を説明するための図Diagram for explaining the principle of photometric stereo 積み上げ演算を説明するための図Diagram for explaining the stacked operation 特徴サイズに基づく重みの決定方法を示す図Diagram showing how to determine weights based on feature size 特徴サイズの異なる検査画像の一例を示す図A diagram showing an example of inspection images having different feature sizes 表面形状画像の生成に関与する画像を説明する図Diagram to explain the images involved in the generation of surface shape images テクスチャ画像の生成方法を説明する図Diagram explaining how to generate texture image 検査装置の機能ブロック図Functional block diagram of inspection device 設定モードを示すフローチャートFlow chart showing setting mode ユーザインタフェースの一例を示す図Diagram showing an example of a user interface ユーザインタフェースの一例を示す図Diagram showing an example of a user interface ユーザインタフェースの一例を示す図Diagram showing an example of a user interface ユーザインタフェースの一例を示す図Diagram showing an example of a user interface ユーザインタフェースの一例を示す図Diagram showing an example of a user interface ユーザインタフェースの一例を示す図Diagram showing an example of a user interface ユーザインタフェースの一例を示す図Diagram showing an example of a user interface ユーザインタフェースの一例を示す図Diagram showing an example of a user interface ユーザインタフェースの一例を示す図Diagram showing an example of a user interface ユーザインタフェースの一例を示す図Diagram showing an example of a user interface 検査モードを示すフローチャートFlow chart showing inspection mode ユーザインタフェースの一例を示す図Diagram showing an example of a user interface ユーザインタフェースの一例を示す図Diagram showing an example of a user interface ユーザインタフェースの一例を示す図Diagram showing an example of a user interface ユーザインタフェースの一例を示す図Diagram showing an example of a user interface ユーザインタフェースの一例を示す図Diagram showing an example of a user interface ユーザインタフェースの一例を示す図Diagram showing an example of a user interface 照明装置の構造を説明するための図Diagram for explaining the structure of the lighting device 照明装置の構造を説明するための図Diagram for explaining the structure of the lighting device 点灯制御に関するブロック図Block diagram for lighting control 点灯制御に関するタイミングシーケンスを示す図Diagram showing the timing sequence for lighting control 点灯パターンの一例を示す図Diagram showing an example of lighting pattern ユーザインタフェースの一例を示す図Diagram showing an example of a user interface ユーザインタフェースの一例を示す図Diagram showing an example of a user interface

以下に本発明の一実施形態を示す。以下で説明される個別の実施形態は、本発明の上位概念、中位概念および下位概念など種々の概念を理解するために役立つであろう。また、本発明の技術的範囲は、特許請求の範囲によって確定されるのであって、以下の個別の実施形態によって限定されるわけではない。   One embodiment of the present invention is shown below. The particular embodiments described below will help to understand various concepts such as the superordinate, intermediate and subordinate concepts of the present invention. Further, the technical scope of the present invention is determined by the scope of the claims, and is not limited by the following individual embodiments.

図1は外観検査システムの一例を示す図である。ライン1は検査対象物であるワーク2を搬送する搬送ベルトなどである。照明装置3はフォトメトリックステレオ法にしたがって検査対象物を照明する照明手段の一例である。カメラ4はフォトメトリックステレオ法にしたがって前記照明された検査対象物からの反射光を受光して輝度画像を生成する撮像手段の一例である。画像処理装置5は、カメラ4により取得された複数の輝度画像からワーク2の表面の法線ベクトルを算出し、複数の輝度画像から算出された法線ベクトルに基づく画素値により構成された傾き画像と、当該傾き画像の縮小画像とについて、注目画素に隣接する隣接画素の法線ベクトルを用いて注目画素の画素値を積み上げ演算し、画素値を有する検査画像を生成し、検査画像を用いて検査対象物の良否を判定する外観検査装置である。傾き画像は法線ベクトル画像と呼ばれることもある。画像処理装置5は輝度画像から反射率画像(アルベド画像)を作成してもよい。表示部7は検査に関連する制御パラメータを設定するためのユーザインタフェースや傾き画像、反射率画像、検査画像などを表示する。入力部6は、コンソール、ポインティングデバイス、キーボードなどであり、制御パラメータを設定するために使用される。画像処理装置5と照明装置3は信号線8によって接続されている。画像処理装置5とカメラ4は信号線9によって接続されている。   FIG. 1 is a diagram showing an example of an appearance inspection system. The line 1 is a conveyor belt or the like for conveying the workpiece 2 which is an inspection object. The illumination device 3 is an example of an illumination unit that illuminates the inspection object according to the photometric stereo method. The camera 4 is an example of an imaging unit that receives the reflected light from the illuminated inspection object in accordance with the photometric stereo method and generates a luminance image. The image processing device 5 calculates a normal vector of the surface of the work 2 from the plurality of luminance images acquired by the camera 4 and is an inclination image constituted by pixel values based on the normal vectors calculated from the plurality of luminance images For the reduced image of the inclined image, the pixel value of the pixel of interest is accumulated and calculated using the normal vector of the adjacent pixel adjacent to the pixel of interest to generate an inspection image having the pixel value, and using the inspection image This is an appearance inspection apparatus that determines the quality of an inspection object. The tilt image may be referred to as a normal vector image. The image processing device 5 may create a reflectance image (albedo image) from the luminance image. The display unit 7 displays a user interface for setting control parameters related to an examination, an inclination image, a reflectance image, an examination image, and the like. The input unit 6 is a console, a pointing device, a keyboard or the like, and is used to set control parameters. The image processing device 5 and the lighting device 3 are connected by a signal line 8. The image processing device 5 and the camera 4 are connected by a signal line 9.

とりわけ、図1によればカメラ4と照明装置3とが独立して移動可能なようにそれぞれ異なるフレームによって支持されている。このように照明装置3は、カメラ4から独立して移動可能となっているため、ワーク2から照明装置3までの距離を自在に調整できるようになっている。つまり、ワーク2の種類や置き方に応じて照明装置3をワーク2から遠ざけて配置させることで、カメラ4は正反射光を強く受光できるようになる。また、照明装置3をワーク2に近づけて配置することでカメラ4は拡散反射光を強く受光できるようになる。なお、同一のフレームによってカメラ4と照明装置3とが指示されていてもよい。この場合には、照明装置3の取り付け位置を調整するためのクランプ機構などで照明装置3をフレームに固定すればよい。   In particular, according to FIG. 1, the camera 4 and the lighting device 3 are supported by different frames so as to be able to move independently. As described above, since the lighting device 3 is movable independently of the camera 4, the distance from the work 2 to the lighting device 3 can be freely adjusted. That is, by disposing the illumination device 3 away from the work 2 depending on the type and placement of the work 2, the camera 4 can strongly receive the specular reflection light. Further, by disposing the illumination device 3 close to the work 2, the camera 4 can strongly receive the diffuse reflection light. Note that the camera 4 and the illumination device 3 may be instructed by the same frame. In this case, the lighting device 3 may be fixed to the frame by a clamp mechanism or the like for adjusting the mounting position of the lighting device 3.

<フォトメトリクスステレオの原理>
一般的なフォトメトリックステレオ法では、図2に示すように、ワーク2に対して4方向から照明光L1〜L4を切り替えながら照射し、4枚の輝度画像を生成する。各輝度画像を撮影する際に使用される照明光の方向は一方向だけである。なお、輝度画像は複数の画素により構成されており、4枚の輝度画像において座標が一致する4つの画素は同一のワーク表面に対応している。4つの画素の画素値(輝度値)I1、I2、I3、I4と、法線ベクトルnとの間には図2示した式1が成り立つ。ここでρは反射率である。Lは各方向からの照明光の光量であり、既知である。ここでは4方向とも光量は同一である。Sは照明方向行列であり、既知である。この数式を解くことで各座標(ワーク表面)ごとの反射率ρと法線ベクトルnが求められる。その結果、反射率画像と傾き画像とが得られる。
<Principle of Photometrics Stereo>
In a general photometric stereo method, as shown in FIG. 2, illumination light L1 to L4 is irradiated to the work 2 from four directions while being switched to generate four luminance images. The direction of the illumination light used when capturing each luminance image is only one direction. The luminance image is composed of a plurality of pixels, and in the four luminance images, four pixels having the same coordinates correspond to the same work surface. Equation 1 shown in FIG. 2 holds between the pixel values (brightness values) I1, I2, I3, I4 of four pixels and the normal vector n. Here, ρ is the reflectance. L is the amount of illumination light from each direction, which is known. Here, the amount of light is the same in all four directions. S is the illumination direction matrix and is known. By solving this equation, the reflectance ρ and the normal vector n for each coordinate (work surface) can be obtained. As a result, a reflectance image and a tilt image are obtained.

本実施形態では、さらに、傾き画像から高さ成分を抽出しワークの形状を示す形状画像を検査画像として作成する。検査画像は、図2に示し式2である積み上げ演算式により求められる。ここで、znはn回目の積み上げ結果であり、ワーク表面の形状を示している。x、yは画素の座標を示している。nは何回目の繰り返し計算であるかを示している。pは水平方向の傾き成分を示し、qは垂直方向の傾き成分を示している。p、qは法線ベクトルnから求められる。wは重みである。また、1回目の積み上げ演算では1/1の傾き画像を用い、2回目の積み上げには1/2の縮小傾き画像を用い、3回目の積み上げには1/4の縮小傾き画像を用いる。縮小画像を作成する際にはガウシアン処理を施してから縮小処理が施されてもよい。   In the present embodiment, the height component is further extracted from the tilt image, and a shape image indicating the shape of the workpiece is created as an inspection image. The inspection image is obtained by the accumulation calculation equation which is the equation 2 shown in FIG. Here, z n is the n-th accumulation result and indicates the shape of the work surface. x and y indicate the coordinates of the pixel. n indicates how many times the calculation is repeated. p indicates a horizontal inclination component, and q indicates a vertical inclination component. p and q are obtained from the normal vector n. w is a weight. Further, in the first accumulation operation, an inclination image of 1/1 is used, the reduced inclination image of 1/2 is used for the second accumulation, and a reduced inclination image of 1/4 is used for the third accumulation. When creating a reduced image, reduction processing may be performed after performing Gaussian processing.

本実施形態では積み上げ演算において特徴サイズというパラメータを採用する。特徴サイズは積み上げ演算において使用される縮小画像の成分に対する重みを与えるパラメータである。特徴サイズはワーク2の表面形状の大きさを示すパラメータである。たとえば、特徴サイズが1であればxy方向で注目画素に隣接した4つの画素についての重みが最も大きくされて積み上げ演算される。特徴サイズが2であればxy方向で注目画素に隣接した8つの画素についての重みが最も大きく設定されて積み上げ演算が実行される。ただし、8つの画素を用いて演算することは演算量の増大を招くため、上述した縮小画像を作成して演算に使用する。つまり、8つの隣接画素を用いる代わりに、傾き画像を1/2に縮小して演算を実行する。これにより、ある注目画素について縮小画像における4つの画素を演算に考慮すればよいことになる。これは特徴サイズが4、8、16、32と増加したときもそれに応じた縮小画像を作成し、特徴サイズに対応した縮小画像について重みを最大に設定することで、同様の演算負荷の軽減効果が得られる。   In the present embodiment, a parameter called feature size is adopted in the stacking operation. The feature size is a parameter that gives weight to the components of the reduced image used in the stacking operation. The feature size is a parameter indicating the size of the surface shape of the workpiece 2. For example, if the feature size is 1, the weights for the four pixels adjacent to the target pixel in the xy direction are maximized and the accumulation operation is performed. If the feature size is 2, the weights for the eight pixels adjacent to the target pixel in the xy direction are set the largest, and the stacking operation is performed. However, since calculation using eight pixels causes an increase in the amount of calculation, the above-described reduced image is created and used for the calculation. That is, instead of using eight adjacent pixels, the inclination image is reduced to 1⁄2 and the operation is performed. This makes it possible to take account of four pixels in the reduced image for a certain target pixel in the calculation. The same reduction effect of calculation load is achieved by creating a reduced image according to the feature size even when the feature size increases to 4, 8, 16, 32, and setting the weight to the maximum for the reduced image corresponding to the feature size. Is obtained.

図3は積み上げ演算の一例を示している。この例では法線ベクトルnから求められた2枚の傾き画像(水平方向の傾き成分pの画像と垂直方向の傾き成分qの画像)を入力としている。まず、縮小度の大きい傾き画像で全体の形状を積み上げ、それよりも縮小度の小さい画像で細部形状を積み上げる。これにより短時間で全体の形状を復元できるようになる。図3によれば、たとえば、1/32の縮小画像について式2により注目画素についてワーク表面の形状を示すパラメータであるzを算出する。重みwは特徴サイズに応じて決定される。縮小画像を構成する1つ1つの画素を注目画素として積み上げ演算をイタレーション(繰り返し処理)する。zの初期値はゼロである。次に式2にしたがって1/16の縮小画像についてzを算出する。ここでは、1/32の演算結果に対して1/16の縮小画像の傾き成分が積み上げられる。同様にして、1/8縮小画像から1/1画像まで積み上げ演算が実行される。   FIG. 3 shows an example of the stacking operation. In this example, two inclination images (an image of the inclination component p in the horizontal direction and an image of the inclination component q in the vertical direction) obtained from the normal vector n are input. First, the entire shape is stacked up with the tilt image with a large degree of reduction, and the detail shape is stacked with an image with a smaller degree of reduction than that. This makes it possible to restore the entire shape in a short time. According to FIG. 3, for example, z which is a parameter indicating the shape of the workpiece surface for the pixel of interest is calculated by Equation 2 for the 1/32 reduced image. The weight w is determined according to the feature size. Each pixel constituting the reduced image is set as a target pixel and the calculation is repeated (iterated). The initial value of z is zero. Next, z is calculated for the 1/16 reduced image according to Equation 2. Here, the inclination component of the 1/16 reduced image is accumulated with respect to the calculation result of 1/32. In the same manner, the calculation is performed by stacking 1/8 reduced images to 1/1 images.

図4は各特徴サイズごと重みの一例を示している。横軸は解像度レベル(縮小度)を示し、縦軸は重みを示している。図4からわかるように、特徴サイズ1では縮小度が最も小さいレベル0(1/1画像)の重みが最大となる。これにより微細な形状を積み上げることが可能となる。特徴サイズ2ではレベル1(1/2画像)の重みが最大となる。これによりさらに大きなサイズの形状を積み上げることが可能となる。このように各重みは、特徴サイズに対応したレベルでピークが生じるように決定される。   FIG. 4 shows an example of weights for each feature size. The horizontal axis indicates the resolution level (reduction degree), and the vertical axis indicates the weight. As can be seen from FIG. 4, at feature size 1, the weight of level 0 (1/1 image) having the smallest degree of reduction is maximum. This makes it possible to build up fine shapes. In feature size 2, the weight of level 1 (1/2 image) is maximum. This makes it possible to stack larger sized shapes. Thus, each weight is determined such that a peak occurs at a level corresponding to the feature size.

形状画像の復元方法としては、上記の積み上げ演算の他に公知のフーリエ変換積分法を採用することもできる(A Method for Enforcing Integrability in Shape from Shading Algorithms, IEEE Transactions on Pattern Analysis and Machine Intelligence, Vol.10, No.4 July 1988)。当該方法においても計算プロセスにおいて縮小画像を生成し、重み付け成分を調整することにより抽出する特徴サイズを変更することが可能である。   As a method of restoring the shape image, a known Fourier transform integral method can also be adopted in addition to the above-described accumulation operation (A Method for Enforcing Integrity in Shape from Shading Algorithms, IEEE Transactions on Pattern Analysis and Machine Intelligence, Vol. 10, No. 4 July 1988). Also in this method, it is possible to generate a reduced image in the calculation process and adjust the weighting component to change the extracted feature size.

図5は特徴サイズの違いに応じた検査画像の一例を示している。特徴サイズ4では細部の形状が抽出されており、特徴サイズ64では全体の形状が抽出されており、特徴サイズ16ではこれらの中間的なサイズの形状が抽出されていることがわかる。このように小さな特徴サイズは細かい傷を検査するのに役立ち、大きな特徴サイズは物体の有無の判別に適しており、中間の特徴サイズは凹凸文字のOCRなどに適している。つまり検査ツールに応じて適切な特徴サイズを選択することで検査精度を向上させることが可能となる。   FIG. 5 shows an example of an inspection image according to the difference in feature size. It can be seen that the feature size 4 extracts the shape of the detail, the feature size 64 extracts the entire shape, and the feature size 16 extracts the shape of these intermediate sizes. Such a small feature size is useful for inspecting fine flaws, a large feature size is suitable for determining the presence or absence of an object, and an intermediate feature size is suitable for OCR or the like of concavo-convex characters. That is, it is possible to improve the inspection accuracy by selecting an appropriate feature size according to the inspection tool.

図6はフォトメトリックステレオ法による検査画像の作成工程を示す図である。輝度画像601〜604はそれぞれ照明方向の異なる照明光によりワーク2を照明して取得された輝度画像である。なお、輝度画像600は4方向から同時に照明して得られた輝度画像である。それぞれ照明方向の異なる照明光によりワーク2を照明して取得された複数の輝度画像から演算によりワーク表面の法線ベクトルが求められる。傾き画像611は、輝度画像601〜604から求められた法線ベクトルのX方向の傾き成分を画素値とした傾き画像である。傾き画像612は、輝度画像601〜604から求められた法線ベクトルのY方向の傾き成分を画素値とした傾き画像である。反射率画像610は、輝度画像601〜604から求められた法線ベクトルから、ワーク表面の傾きによる輝度値の変動分を除去し、ワーク表面の反射率を画像にした反射率画像である。検査画像621〜623は傾き画像611、612から求められたそれぞれ特徴サイズの異なる画像である。なお、検査画像621〜623も傾き成分に基づく画素により構成されているため、傾き画像の一種である。このような手順でワーク2の検査画像が生成される。なお、検査ツールに依存して全方向照明画像である輝度画像600や反射率画像610が検査画像として採用されてもよい。全方向照明画像とは、照明装置3が備える複数の光源をすべて点灯させて取得された輝度画像のことである。   FIG. 6 is a diagram showing a process of creating an inspection image by the photometric stereo method. The luminance images 601 to 604 are luminance images obtained by illuminating the work 2 with illumination lights different in illumination direction. The luminance image 600 is a luminance image obtained by illuminating simultaneously from four directions. The normal vector of the work surface is determined from the plurality of luminance images acquired by illuminating the work 2 with illumination light different in illumination direction. The tilt image 611 is a tilt image in which the tilt component in the X direction of the normal vector obtained from the brightness images 601 to 604 is a pixel value. The inclination image 612 is an inclination image in which an inclination component in the Y direction of the normal vector obtained from the luminance images 601 to 604 is a pixel value. The reflectance image 610 is a reflectance image in which the variation of the brightness value due to the inclination of the work surface is removed from the normal vectors determined from the brightness images 601 to 604, and the reflectance of the work surface is an image. The inspection images 621 to 623 are images having different feature sizes obtained from the tilt images 611 and 612, respectively. Since the inspection images 621 to 623 are also composed of pixels based on the inclination component, they are a kind of inclination image. An inspection image of the workpiece 2 is generated in such a procedure. A luminance image 600 or a reflectance image 610 which is an omnidirectional illumination image may be adopted as an inspection image depending on the inspection tool. The omnidirectional illumination image is a luminance image acquired by turning on all the plurality of light sources provided in the illumination device 3.

<テクスチャ情報>
テクスチャ情報とはワーク2の表面の反射率ρに基づく情報である。式1によって反射率ρが求められる、つまり4枚の輝度画像から1枚の反射率画像が得られる。反射率画像はワーク表面の反射率ρに比例した画素値を有する画像である。図7に示すように、4枚の輝度画像701〜704から法線ベクトルを算出し、算出された法線ベクトルと複数の輝度画像の各々対応する画素の輝度値に基づいて各画素の反射率に比例した画素値を算出することで反射率画像であるテクスチャ画像711、712が求められる。この生成方法としては4枚の輝度画像の画素平均によってテクスチャ画像を求める方法や、4枚の輝度画像からハレーションを除去してから画素平均によってテクスチャ画像を求める方法などがある。テクスチャ画像711は画像平均によって求められたものであり、テクスチャ画像712はハレーション除去によって求められたものの一例である。4枚の輝度画像において座標が一致する画素が4つ存在する。4つの画素のうち画素値が1番大きい画素を除外したり、画素値の大きい順に1番目からN番目(Nは3以下の自然数)までの画素を除外したりすることでハレーションを除去することが可能である。ハレーションは高い輝度として画像に現れるからである。テクスチャ画像711、712はともに反射率に基づく画素により構成されているため、反射率画像の一種である。
<機能ブロック>
図8は検査装置のブロック図である。この例では照明装置3、カメラ4および画像処理装置5がそれぞれ個別の筐体に収容されているが、これは一例に過ぎず、適宜に一体化されてもよい。照明装置3は、フォトメトリックステレオ法にしたがって検査対象物を照明する照明手段の一例であり、光源群801とこれを制御する照明コントローラ802を備えている。複数の発光素子で1つのセグメントが構成され、さらに複数のセグメントによって光源群801が構成されていてもよい。セグメントの数は一般的には4つであるが、3つ以上であればよい。これは3方向以上の照明方向からワーク2を照明できれば、フォトメトリックステレオ法により検査画像を生成できるからである。図1に示したように照明装置3の外形はリング状をしていてもよい。また、照明装置3は、それぞれ分離した複数の照明ユニットにより構成されていてもよい。たとえば、市場にはワーク2を撮影するために使用される照明ユニットが存在しているが、これらはフォトメトリックステレオ用に開発されたものではない。ただし、このような照明ユニットを複数個用意するとともに、これらを制御する照明コントローラを接続することで、照明装置3を構成してもよい。照明コントローラ802は、画像処理装置5からの制御コマンドに応じて光源群801の点灯タイミングや照明パターン(点灯パターン)を制御する。照明コントローラ802は照明装置3に内蔵されているものとして説明するが、カメラ4に内蔵されていてもよいし、画像処理装置5に内蔵されていてもよいし、これらからは独立した筐体に収容されていてもよい。
<Texture information>
The texture information is information based on the reflectance ρ of the surface of the work 2. The reflectance ρ is determined by Equation 1, that is, one reflectance image is obtained from four luminance images. The reflectance image is an image having pixel values proportional to the reflectance ρ of the work surface. As shown in FIG. 7, normal vectors are calculated from the four luminance images 701 to 704, and the reflectance of each pixel is calculated based on the calculated normal vectors and the luminance values of the corresponding pixels of the plurality of luminance images. The texture images 711 and 712 which are reflectance images are obtained by calculating pixel values in proportion to. As the generation method, there are a method of obtaining a texture image by pixel averaging of four luminance images, and a method of obtaining a texture image by pixel averaging after removing halation from the four luminance images. The texture image 711 is obtained by image averaging, and the texture image 712 is an example obtained by halation removal. There are four pixels whose coordinates match in the four luminance images. Remove the halation by excluding the pixel having the largest pixel value among the four pixels, or excluding the first to N-th pixels (N is a natural number of 3 or less) in descending order of the pixel values. Is possible. This is because halation appears in the image as high luminance. The texture images 711 and 712 are both types of reflectance images because they are composed of pixels based on reflectance.
<Function block>
FIG. 8 is a block diagram of the inspection apparatus. In this example, the lighting device 3, the camera 4 and the image processing device 5 are respectively housed in separate housings, but this is merely an example, and may be integrated as appropriate. The illumination device 3 is an example of an illumination unit that illuminates an inspection object according to the photometric stereo method, and includes a light source group 801 and an illumination controller 802 that controls the light source group. A plurality of light emitting elements may constitute one segment, and a plurality of segments may further constitute a light source group 801. The number of segments is generally four, but may be three or more. This is because if the work 2 can be illuminated from illumination directions in three or more directions, an inspection image can be generated by the photometric stereo method. As shown in FIG. 1, the outer shape of the lighting device 3 may be ring-shaped. Moreover, the illuminating device 3 may be comprised by the several illumination unit isolate | separated each. For example, although there are lighting units in the market that are used to capture work 2, these have not been developed for photometric stereo. However, the lighting device 3 may be configured by preparing a plurality of such lighting units and connecting a lighting controller that controls them. The lighting controller 802 controls the lighting timing and lighting pattern (lighting pattern) of the light source group 801 according to the control command from the image processing device 5. Although the lighting controller 802 is described as being built in the lighting device 3, it may be built in the camera 4 or may be built in the image processing device 5, or in a housing independent of them. It may be accommodated.

カメラ4はフォトメトリックステレオ法にしたがって照明された検査対象物からの反射光を受光して輝度画像を生成する撮像手段の一例であり、画像処理装置5からの制御コマンドに応じて撮像処理を実行する。カメラ4はワーク2の輝度画像を作成して画像処理装置5に転送してもよいし、撮像素子から得られる輝度信号を画像処理装置5に転送し、画像処理装置5が輝度画像を生成してもよい。輝度信号は輝度画像の元になる信号であるため、広義には輝度信号も輝度画像である。   The camera 4 is an example of an imaging unit that receives the reflected light from the inspection object illuminated according to the photometric stereo method to generate a luminance image, and executes an imaging process according to a control command from the image processing device 5 Do. The camera 4 may create a luminance image of the work 2 and transfer it to the image processing device 5, or transfer the luminance signal obtained from the imaging device to the image processing device 5, and the image processing device 5 generates a luminance image May be Since the luminance signal is a signal that is the source of the luminance image, in a broad sense the luminance signal is also a luminance image.

画像処理装置5は、コンピュータの一種であり、CPUやASICなどのプロセッサ810と、RAM、ROM、可搬記憶媒体などの記憶装置820と、ASICなどの画像処理部830と、ネットワークインタフェースなどの通信部850とを有している。プロセッサ810は検査ツールの設定や、制御パラメータの調整、検査画像の生成・再生成・更新を担当する。フォトメトリック処理部811は、カメラ4により取得された複数の輝度画像からワーク2の表面の法線ベクトルnを算出し、複数の輝度画像から算出された法線ベクトルnに基づく画素値を有する傾き画像と、傾き画像の縮小画像とについて、注目画素に隣接する隣接画素の法線ベクトルnを用いて当該注目画素の画素値を積み上げ演算し、当該画素値を有する検査画像を生成する演算手段(検査画像生成手段)として機能する。なお、具体的には上述した数式などを使用して検査画像が生成される。照明制御部812は、照明コントローラ802に対して制御コマンドを送信することで点灯パターンや照明切り替えタイミングなどを制御する。撮像制御部813は、カメラ4を制御する。UI管理部814は、検査ツールを設定するためのユーザインタフェース(UI)や検査画像を生成するために必要となるパラメータを設定するためのUIなどを表示部7に表示し、入力部6から入力された情報したがって検査ツールやパラメータを設定する。とりわけ、特徴サイズ設定部815は積み上げ演算において使用される縮小画像の成分に対する重みwを与えるパラメータである特徴サイズを設定する設定手段として機能する。画像選択部816は複数の輝度画像や複数の検査画像、複数の傾き画像、複数の反射率画像のうち表示すべき画像などを選択したりする。画像選択部816はカメラ4により取得された複数の輝度画像および検査画像のうち保存対象もしくは出力対象となる画像を選択してもよい。検査ツール設定部817は画像選択部816により選択された検査画像に対して検査ツールを設定する。検査ツール設定部817は、たとえば、基準画像に対して傷検査領域を設定したり、文字認識領域を設定したりする。基準画像設定部818は良品から取得された検査画像である基準画像を設定する。表示制御部851は輝度画像と検査画像を切り替えて表示部7に表示させたり、または、輝度画像と検査画像とを同時に表示させたりする。また表示制御部851は制御パラメータが調整されると表示部7に表示されている画像を当該制御パラメータが反映された画像に更新する。検査ツール設定部817は、表示制御部851、特徴サイズ設定部815、画像選択部816、基準画像設定部818および条件設定部819を内包していてもよい。画像処理部830は基準画像を用いて検査画像にパターンサーチを実行し、検査画像に検査領域(例:傷検査領域や文字認識領域など)を設定する検査領域設定手段として機能する。検査領域は、たとえば、文字認識領域である。条件設定部819は画像を表示部7や通信部850に接続された外部機器に出力する条件や、可搬記憶媒体などに保存する条件を設定する。判定部840は検査画像を用いてワーク2の良否を判定する判定手段として機能する。たとえば、判定部840は画像処理部830において検査画像を用いて実行された検査の結果を受け取って検査結果が良品条件(公差など)を満たしているかどうかを判定する。   The image processing apparatus 5 is a type of computer, and communicates with a processor 810 such as a CPU or ASIC, a storage device 820 such as a RAM, ROM, or portable storage medium, an image processing unit 830 such as an ASIC, or a network interface. And a part 850. A processor 810 is in charge of setting an inspection tool, adjusting control parameters, and generating / regenerating / updating an inspection image. The photometric processing unit 811 calculates a normal vector n of the surface of the work 2 from the plurality of luminance images acquired by the camera 4 and an inclination having a pixel value based on the normal vector n calculated from the plurality of luminance images Arithmetic means for generating an inspection image having the pixel value by calculating the pixel value of the target pixel by using normal vectors n of adjacent pixels adjacent to the target pixel for the image and the reduced image of the inclination image It functions as inspection image generation means). Specifically, the inspection image is generated using the above-described equation or the like. The illumination control unit 812 transmits a control command to the illumination controller 802 to control a lighting pattern, illumination switching timing, and the like. The imaging control unit 813 controls the camera 4. The UI management unit 814 displays a user interface (UI) for setting an inspection tool, a UI for setting parameters necessary for generating an inspection image, and the like on the display unit 7, and inputs from the input unit 6. Set the inspection information and thus the inspection tools and parameters. In particular, the feature size setting unit 815 functions as a setting unit that sets a feature size, which is a parameter that gives a weight w to the component of the reduced image used in the stacking operation. The image selection unit 816 selects an image to be displayed among a plurality of luminance images, a plurality of inspection images, a plurality of tilt images, and a plurality of reflectance images. The image selection unit 816 may select an image to be stored or output among the plurality of luminance images and inspection images acquired by the camera 4. The inspection tool setting unit 817 sets an inspection tool for the inspection image selected by the image selection unit 816. The inspection tool setting unit 817 sets, for example, a flaw inspection area or a character recognition area on the reference image. The reference image setting unit 818 sets a reference image which is an inspection image acquired from a non-defective item. The display control unit 851 switches the luminance image and the inspection image to display them on the display unit 7 or displays the luminance image and the inspection image simultaneously. Further, when the control parameter is adjusted, the display control unit 851 updates the image displayed on the display unit 7 to an image on which the control parameter is reflected. The inspection tool setting unit 817 may include a display control unit 851, a feature size setting unit 815, an image selection unit 816, a reference image setting unit 818, and a condition setting unit 819. The image processing unit 830 performs pattern search on the inspection image using the reference image, and functions as an inspection area setting unit that sets an inspection area (eg, a flaw inspection area, a character recognition area, etc.) in the inspection image. The inspection area is, for example, a character recognition area. The condition setting unit 819 sets conditions for outputting an image to an external device connected to the display unit 7 or the communication unit 850, and conditions for saving the image in a portable storage medium or the like. The determination unit 840 functions as a determination unit that determines the quality of the work 2 using the inspection image. For example, the determination unit 840 receives the result of the inspection performed using the inspection image in the image processing unit 830, and determines whether the inspection result satisfies the non-defective condition (such as tolerance).

記憶装置820は、カメラ4によって取得された輝度画像のデータである輝度画像データ821、フォトメトリック処理部811により生成された傾き画像データ822や反射率画像データ823を記憶する。また、記憶装置820は各種の設定データやユーザインタフェースを生成するためのプログラムコードなども記憶している。記憶装置820は特徴サイズがそれぞれ異なる検査画像を記憶して保持していてもよい。また、記憶装置820は検査画像に加え、検査画像の元になった傾き画像データや反射率画像データを記憶してもよい。これらはワーク2の誤判定が見つかったときに、検査画像、傾き画像または反射率画像のいずれに問題があったのかを特定して、その制御パラメータを修正するのに役立つであろう。   The storage device 820 stores luminance image data 821 which is data of a luminance image acquired by the camera 4, tilt image data 822 and reflectance image data 823 generated by the photometric processing unit 811. The storage device 820 also stores various setting data, program codes for generating a user interface, and the like. The storage device 820 may store and hold inspection images having different feature sizes. In addition to the inspection image, the storage device 820 may store tilt image data and reflectance image data that are the origin of the inspection image. These will be useful for identifying which of the inspection image, the inclination image or the reflectance image had a problem and correcting its control parameters when an erroneous judgment of the work 2 is found.

画像処理部830は、フォトメトリック処理部811によって生成された検査画像(傾き画像データ822や反射率画像データ823)を用いて外観検査を実行する。傷検査部831は、それぞれ異なる特徴サイズ用いて生成された複数の検査画像の傷検査領域において傷検査を実行する。OCR部832はそれぞれ異なる特徴サイズ用いて生成された複数の検査画像に対して文字認識処理を実行する文字認識処理手段として機能する。傷検査部831やOCR部832は記憶装置820に記憶されている検査画像(傾き画像データ822や反射率画像データ823)を読み出し、文字認識領域において検査を実行し、検査結果を記憶装置820に書き込んだり、判定部840に渡したりしてもよい。判定部840はこの検査結果に基づきワーク2の良否を判定する。   The image processing unit 830 performs an appearance inspection using the inspection image (tilt image data 822 and reflectance image data 823) generated by the photometric processing unit 811. The flaw inspection unit 831 executes flaw inspection in flaw inspection areas of a plurality of inspection images generated using different feature sizes. The OCR unit 832 functions as a character recognition processing unit that executes character recognition processing on a plurality of inspection images generated using different feature sizes. The flaw inspection unit 831 and the OCR unit 832 read the inspection image (tilt image data 822 and reflectance image data 823) stored in the storage device 820, perform inspection in the character recognition area, and store the inspection result in the storage device 820. It may be written or passed to the determination unit 840. The determination unit 840 determines the quality of the work 2 based on the inspection result.

<設定モード>
検査システムには検査ツールを設定する設定モードと、設定された検査ツールにしたがってワーク2の外観検査を実行する検査モード(運転モード)とを有しいている。ここでは設定モードの一例について説明する。
<Setting mode>
The inspection system has a setting mode for setting an inspection tool, and an inspection mode (operation mode) for executing an appearance inspection of the workpiece 2 in accordance with the set inspection tool. Here, an example of the setting mode will be described.

図9は設定モードに関するフローチャートである。入力部6を通じて設定モードの開始が指示されると、プロセッサ810のUI管理部814は検査ツールを設定するためのUIを表示部7に表示する。   FIG. 9 is a flowchart relating to the setting mode. When the start of the setting mode is instructed through the input unit 6, the UI management unit 814 of the processor 810 displays a UI for setting an inspection tool on the display unit 7.

図10はUIの一例を示している。UI管理部814が表示部7に表示するUI1000には、検査結果の保存先を指定するプルダウンメニュー1001や検査ツールの名称を入力するテキストボックス1002が設けられている。UI管理部814は実行ボタンの押し下げを検出すると次のUIを表示する。   FIG. 10 shows an example of the UI. The UI 1000 displayed on the display unit 7 by the UI management unit 814 is provided with a pull-down menu 1001 for specifying the storage destination of the inspection result and a text box 1002 for inputting the name of the inspection tool. When detecting that the execution button is pressed, the UI management unit 814 displays the next UI.

図11に示すUI1100には、検査ツールを設定するためのガイダンス1101と、カメラ4に撮像を指示する計測実行ボタン1102と、カメラ4により撮像された画像を表示する表示領域1103と、カメラ設定の開始を指示するカメラ設定ボタン1104を有している。なお、画像選択部1105は、表示領域1103に表示する画像や検査に使用する画像を選択するためのボタンである。この例では画像選択部1105によって、形状1、形状2、テクスチャおよびノーマルのうちいずれか1つの画像が択一的に選択される。計測実行ボタン1102が操作されると、撮像制御部がカメラ4に撮像を指示する。UI管理部814はカメラ4により取得された輝度画像を表示領域1103にレンダリングする。なお、画像選択部1105によって別の画像が選択されると、UI管理部814は画像選択部1105によって選択された画像を表示領域1103にレンダリングする。このようにユーザは画像選択部1105を操作するか、入力部6を通じて画像の切り替えを指示することで表示領域1103に表示される画像を切り替えることができる。カメラ設定ボタン1104が操作されると、UI管理部814は次のUIに切り替える。   In the UI 1100 shown in FIG. 11, a guidance 1101 for setting an inspection tool, a measurement execution button 1102 for instructing the camera 4 to take an image, a display area 1103 for displaying an image taken by the camera 4 and camera settings A camera setting button 1104 for instructing start is provided. The image selection unit 1105 is a button for selecting an image to be displayed in the display area 1103 or an image to be used for an examination. In this example, the image selection unit 1105 alternatively selects any one image of shape 1, shape 2, texture and normal. When the measurement execution button 1102 is operated, the imaging control unit instructs the camera 4 to perform imaging. The UI management unit 814 renders the luminance image acquired by the camera 4 in the display area 1103. When another image is selected by the image selection unit 1105, the UI management unit 814 renders the image selected by the image selection unit 1105 in the display area 1103. In this manner, the user can switch the image displayed in the display area 1103 by operating the image selection unit 1105 or instructing switching of the image through the input unit 6. When the camera setting button 1104 is operated, the UI management unit 814 switches to the next UI.

S901でUI管理部814はカメラ4を設定するためUIを表示部7に表示し、カメラ設定を実行する。図12はカメラ設定UI1200の一例を示している。カメラ設定タブ1201には、カメラの機種を設定するプルダウンメニュー1202、画像サイズを設定するプルダウンメニュー1203、シャッタースピードを設定するプルダウンメニュー1204、カメラの感度を設定するスライダー1205などを有している。なお、計測実行ボタン1102が操作されると、UI管理部814は、その時点で設定されている撮像パラメータにしたがってカメラ4によって取得された輝度画像を表示領域1103に表示する。これによりユーザは設定したパラメータが適切かどうかを判定できる。   In step S901, the UI management unit 814 displays a UI on the display unit 7 in order to set the camera 4, and executes the camera setting. FIG. 12 shows an example of the camera setting UI 1200. The camera setting tab 1201 includes a pull-down menu 1202 for setting a camera model, a pull-down menu 1203 for setting an image size, a pull-down menu 1204 for setting a shutter speed, and a slider 1205 for setting a camera sensitivity. When the measurement execution button 1102 is operated, the UI management unit 814 displays a luminance image acquired by the camera 4 in the display area 1103 according to the imaging parameter set at that time. This allows the user to determine whether the set parameters are appropriate.

S902でUI管理部814はフォトメトリック処理を設定するためUIを表示部7に表示し、設定を実行する。たとえば、カメラ設定UI1200に設けられているフォトメトリックステレオ設定タブ1210が操作されたこと検知すると、UI管理部814は、図13に示すように、フォトメトリックステレオ設定タブ1210を有効に切り替える。有効に切り替えるとは、ユーザ操作可能な状態にフォトメトリックステレオ設定タブ1210の表示状態を切り替えることをいう。フォトメトリックステレオ設定タブ1210には、画像を選択するためのプルダウンメニュー1301と、特徴サイズ設定部1302とが含まれている。この例では、それぞれ特徴サイズが異なる3つの検査画像(形状1、形状2、形状3)のいずれかを選択できるものとする。プルダウンメニュー1301によって選択された画像ごとに特徴サイズ設定部1302により特徴サイズが設定される。   In step S902, the UI management unit 814 displays a UI on the display unit 7 to set the photometric process, and executes the setting. For example, when it is detected that the photometric stereo setting tab 1210 provided in the camera setting UI 1200 is operated, the UI management unit 814 effectively switches the photometric stereo setting tab 1210 as shown in FIG. To switch effectively means to switch the display state of the photometric stereo setting tab 1210 to a state in which the user can operate. The photometric stereo setting tab 1210 includes a pull-down menu 1301 for selecting an image and a feature size setting unit 1302. In this example, it is assumed that any one of three inspection images (shape 1, shape 2 and shape 3) having different feature sizes can be selected. A feature size is set by the feature size setting unit 1302 for each image selected by the pull-down menu 1301.

フォトメトリックステレオ設定タブ1210に点灯パターンを選択するための選択部が配置されてもよい。また、一回の照明あたりの発光量を指定する指定部が設けられてもよい。   A selection unit for selecting a lighting pattern may be disposed on the photometric stereo setting tab 1210. Further, a designation unit may be provided to designate the light emission amount per one illumination.

S903でUI管理部814は検査ツールを設定するためのUIを表示部7に表示し、設定を実行する。図14は検査ツールを設定するUI1400の一例である。画像選択ボタン1401は、複数ある検査画像のうち検査に使用する検査画像を選択するためのボタンである。検査カテゴリー選択ボタン1402は、複数ある検査カテゴリーのうち検査ツールとして追加すべきツールのカテゴリーを選択するためのボタンである。認識対象設定ボタン1403は複数ある認識対象のうち1つを選択するためのボタンである。この例では、検査画像として「形状1」が選択され、カテゴリーとして「認識」が選択され、認識処理として「文字認識」が選択されている。追加ボタン1404が操作されると、UI管理部814は次のUIに切り替える。図15は基準画像登録UI1500を示している。基準画像登録UI1500には、上述した計測実行ボタン1102、表示領域1103に加え、登録ボタン1501が配置されている。登録ボタン1501が操作されると、UI管理部814は計測実行ボタン1102によって取得され、表示領域1103に表示されている画像を基準画像として登録する。登録が完了すると、UI管理部814は次のUIに切り替える。   In step S903, the UI management unit 814 displays a UI for setting an inspection tool on the display unit 7 and executes the setting. FIG. 14 shows an example of the UI 1400 for setting an inspection tool. The image selection button 1401 is a button for selecting an examination image to be used for examination among a plurality of examination images. The examination category selection button 1402 is a button for selecting a category of tools to be added as an examination tool among a plurality of examination categories. A recognition target setting button 1403 is a button for selecting one of a plurality of recognition targets. In this example, “shape 1” is selected as the inspection image, “recognition” is selected as the category, and “character recognition” is selected as the recognition process. When the add button 1404 is operated, the UI management unit 814 switches to the next UI. FIG. 15 shows a reference image registration UI 1500. In addition to the measurement execution button 1102 and the display area 1103 described above, a registration button 1501 is disposed in the reference image registration UI 1500. When the registration button 1501 is operated, the UI management unit 814 registers the image acquired by the measurement execution button 1102 and displayed in the display area 1103 as a reference image. When the registration is completed, the UI management unit 814 switches to the next UI.

図16は計測領域設定UI1600を示している。計測領域設定UI1600の表示領域1103には基準画像1601と、計測領域を示すフレーム1602が配置される。UI管理部814は入力部6からの指示に応じてフレーム1602の位置とサイズを変更する。ユーザは基準画像1601のうち計測対象としたい部分の位置とサイズに合わせてフレーム1602の位置とサイズを調整する。なお、さらに、UI管理部814は、文字の切り出し設定や、認識すべき文字の具体例(文字画像)と文字画像に対応する文字キャラクタを登録するための辞書設定などを実行してもよい。   FIG. 16 shows a measurement area setting UI 1600. In the display area 1103 of the measurement area setting UI 1600, a reference image 1601 and a frame 1602 indicating the measurement area are arranged. The UI management unit 814 changes the position and size of the frame 1602 in accordance with an instruction from the input unit 6. The user adjusts the position and size of the frame 1602 in accordance with the position and size of the portion of the reference image 1601 to be measured. Furthermore, the UI management unit 814 may execute setting of clipping of characters, dictionary setting for registering a specific example of a character to be recognized (character image), and a character corresponding to the character image.

次に傷検査ツールについて説明する。図17に示すように、検査カテゴリー選択ボタン1402によって傷検査が選択されると、UI管理部814は、検査内容選択ボタン1701を表示する。この例では、検査内容選択ボタン1701によって傷の総面積を計測するツールが選択されている。追加ボタン1404が操作されると、UI管理部814はUIを切り替える。   Next, the flaw inspection tool will be described. As shown in FIG. 17, when a flaw inspection is selected by the inspection category selection button 1402, the UI management unit 814 displays an inspection content selection button 1701. In this example, a tool for measuring the total area of the wound is selected by the inspection content selection button 1701. When the add button 1404 is operated, the UI management unit 814 switches the UI.

図18は計測領域設定UI1800を示している。計測領域設定UI1800には、計測領域(傷検査領域)を示すフレーム1802が配置される。フレーム1802の形状は変更可能であり、たとえば、形状を選択するためのプルダウンメニュー1801によって複数の形状のうちいずれかの形状が選択される。UI管理部814はプルダウンメニュー1801によって選択された形状のフレーム1802を表示領域1103にレンダリングする。UI管理部814は入力部6からの指示に応じてフレーム1802の位置とサイズを変更する。   FIG. 18 shows a measurement area setting UI 1800. In the measurement area setting UI 1800, a frame 1802 indicating a measurement area (a flaw inspection area) is disposed. The shape of the frame 1802 can be changed, and for example, one of a plurality of shapes is selected by a pull-down menu 1801 for selecting the shape. The UI management unit 814 renders a frame 1802 of the shape selected by the pull-down menu 1801 in the display area 1103. The UI management unit 814 changes the position and size of the frame 1802 in accordance with an instruction from the input unit 6.

図19は傷の検出条件を設定するための設定UI1900を示している。設定UI1900には、傷の検出方向を選択するためのプルダウンメニュー1901と、傷のセグメントサイズを指定するためのボックス1902と、傷のレベルを指定するためのスライダー1903が配置されている。設定UI1900により設定された傷検出条件に基づいて傷検査領域内(フレーム1802内)で傷検査部831が傷を検出したときは、UI管理部814が傷の位置に傷検出マーク1910を表示してもよい。これにより、ユーザは、傷検出条件が適切かどうかを判断できよう。   FIG. 19 shows a setting UI 1900 for setting a flaw detection condition. In the setting UI 1900, a pull-down menu 1901 for selecting a flaw detection direction, a box 1902 for designating a flaw segment size, and a slider 1903 for designating a flaw level are disposed. When the flaw inspection unit 831 detects a flaw in the flaw inspection area (in the frame 1802) based on the flaw detection condition set by the setting UI 1900, the UI management unit 814 displays a flaw detection mark 1910 at the position of the flaw. May be This would allow the user to determine whether the flaw detection conditions are appropriate.

<検査モード>
図20は検査モードを示すフローチャートである。入力部6を通じて検査モードの開始が指示されると、プロセッサ810が動作モードを検査モードに移行させる。
<Inspection mode>
FIG. 20 is a flowchart showing an inspection mode. When the start of the inspection mode is instructed through the input unit 6, the processor 810 shifts the operation mode to the inspection mode.

S2001でプロセッサ810は設定された点灯パターンにしたがって照明方向を切り替えながらワーク2の画像を撮像して取得する。具体的には、照明制御部812が、記憶装置820に保持されている設定データを参照して点灯パターンを特定し、点灯パターンを指定するためのコマンドを照明コントローラ802に送出する。撮像制御部813は記憶装置820に保持されている設定データを参照してカメラ4に関する制御パラメータ(シャッタースピードや感度など)を特定し、これを指定するコマンドをカメラ4に送信する。フォトメトリック処理部811は照明の開始を指示するためのトリガー信号を照明コントローラ802に送信するとともに、これと連動して撮像の開始を指示するためのトリガー信号をカメラ4に送信する。照明コントローラ802はトリガー信号に同期して照明方向を切り替える。たとえば、照明コントローラ802はコマンドにより指定された点灯パターンにしたがって4つの照明方向について1つずつ順番に対応する発光素子を点灯させる。照明コントローラ802はコマンドと点灯パターンとの対応関係をメモリなどに保持していてもよい。トリガー信号は照明開始時に1つだけ発行されてもよいし、切り替えタイミングにおいても発行されてもよい。カメラ4は制御パラメータにしたがってワーク2を撮像し、輝度画像を画像処理装置5に転送する。このようにして、たとえば、1つの照明方向につき1枚の輝度画像が生成される。   In step S2001, the processor 810 captures and acquires an image of the work 2 while switching the illumination direction according to the set lighting pattern. Specifically, the lighting control unit 812 specifies the lighting pattern with reference to the setting data held in the storage device 820, and sends a command for specifying the lighting pattern to the lighting controller 802. The imaging control unit 813 refers to the setting data held in the storage device 820 to specify control parameters (shutter speed, sensitivity, etc.) regarding the camera 4, and transmits a command for specifying this to the camera 4. The photometric processing unit 811 transmits a trigger signal for instructing the start of illumination to the illumination controller 802, and in conjunction with this, transmits a trigger signal for instructing the start of imaging to the camera 4. The lighting controller 802 switches the lighting direction in synchronization with the trigger signal. For example, the lighting controller 802 turns on the light emitting elements corresponding to the four lighting directions one by one in accordance with the lighting pattern specified by the command. The lighting controller 802 may hold the correspondence between the command and the lighting pattern in a memory or the like. The trigger signal may be issued only at the start of lighting or may be issued at the switching timing. The camera 4 captures the work 2 in accordance with the control parameters, and transfers the luminance image to the image processing device 5. In this way, for example, one luminance image is generated per illumination direction.

S2002でプロセッサ810は複数の輝度画像から法線ベクトルnと反射率ρとを求める。上述したようにフォトメトリック処理部811は複数の輝度画像の画素値について式1を適用し、法線ベクトルnと反射率ρとを求める。   In step S2002, the processor 810 obtains the normal vector n and the reflectance ρ from the plurality of luminance images. As described above, the photometric processing unit 811 applies Equation 1 to pixel values of a plurality of luminance images to obtain a normal vector n and a reflectance ρ.

S2003でプロセッサ810は設定された特徴サイズにしたがって検査画像を生成する。上述したようにフォトメトリック処理部811は特徴サイズに対応する重みWを重みテーブルなどから決定し、式2を用いて積み上げ演算を実行して検査画像(傾き画像)を生成する。このように、フォトメトリック処理部811は複数の輝度画像からワーク2の表面の法線ベクトルnに基づく画素値を有する傾き画像を生成してもよい。なお、それぞれ値の異なる複数の特徴サイズを設定されている場合、フォトメトリック処理部811は設定された複数の特徴サイズのそれぞれについて検査画像を生成してもよい。また、フォトメトリック処理部811は上述した手法により反射率画像やテクスチャ画像を生成してもよい。たとえば、フォトメトリック処理部811は複数の輝度画像からワーク2の表面の法線ベクトルnとともにワーク2の表面の反射率ρを算出し、当該反射率ρに基づく画素値を有する反射率画像を生成してもよい。ここでは検査の対象とされる画像が生成され、検査の対象とさていない画像については生成が省略されてもよい。   In step S2003, the processor 810 generates an inspection image according to the set feature size. As described above, the photometric processing unit 811 determines the weight W corresponding to the feature size from the weight table or the like, and executes the accumulation operation using Equation 2 to generate an inspection image (tilt image). Thus, the photometric processing unit 811 may generate an inclination image having pixel values based on the normal vector n of the surface of the workpiece 2 from the plurality of luminance images. When a plurality of feature sizes having different values are set, the photometric processing unit 811 may generate an inspection image for each of the set feature sizes. Further, the photometric processing unit 811 may generate a reflectance image or a texture image by the method described above. For example, the photometric processing unit 811 calculates the reflectance ρ of the surface of the work 2 along with the normal vector n of the surface of the work 2 from a plurality of luminance images, and generates a reflectance image having pixel values based on the reflectance 当 該. You may Here, an image to be inspected may be generated, and generation of an image not to be inspected may be omitted.

S2004でプロセッサ810は検査画像を表示部7に表示する。UI管理部814は検査画像とともに、輝度画像、傾き画像、反射率画像を表示部7に同時または選択的に表示してもよい。選択的に表示する場合、UI管理部814は入力部6からの切り替え指示にしたがって、たとえば、4つの輝度画像を順番に切り替え表示してもよい。たとえば、入力部6のうちコンソールに設けられた特定のキーが画像の切替ボタンとして割り当てられていてもよい。   The processor 810 displays the inspection image on the display unit 7 in S2004. The UI management unit 814 may simultaneously or selectively display the luminance image, the tilt image, and the reflectance image on the display unit 7 together with the inspection image. When selectively displaying, the UI management unit 814 may switch and display four luminance images in order, for example, in accordance with a switching instruction from the input unit 6. For example, a specific key provided on the console of the input unit 6 may be assigned as an image switching button.

S2005でプロセッサ810は画像処理部830に検査の実行を指示する。画像処理部830は検査を指示されると、予め設定された検査ツールを起動して検査画像に対して検査を実行する。たとえば、傷検査部831は設定された計測領域や検出条件にしたがって傷のレベルを判別し、検査結果(傷のレベル)を判定部840に転送する。なお、傷検査部831は、上述した基準画像を用いてパターンサーチを実行して検査領域を設定し、検査領域において検査を実行してもよい。また、OCR部832は、予め設定された文字認識設定にしたがって検査画像に対して文字認識処理を実行し、文字認識結果を判定部840に転送する。OCR部832も上述した基準画像を用いてパターンサーチを実行して検査領域(文字認識領域)を設定し、検査領域において検査を実行してもよい。   In step S2005, the processor 810 instructs the image processing unit 830 to execute an examination. When instructed to perform an examination, the image processing unit 830 activates a preset examination tool to execute an examination on the examination image. For example, the flaw inspection unit 831 determines the level of the flaw according to the set measurement area and detection condition, and transfers the examination result (the level of the flaw) to the determination unit 840. The flaw inspection unit 831 may execute a pattern search using the above-described reference image to set an inspection area, and may perform inspection in the inspection area. Further, the OCR unit 832 executes character recognition processing on the inspection image according to the character recognition setting set in advance, and transfers the character recognition result to the determination unit 840. The OCR unit 832 may also execute a pattern search using the above-described reference image to set an inspection area (character recognition area) and execute an inspection in the inspection area.

S2006でプロセッサ810の判定部840は検査結果と判定閾値とを比較して、ワーク2が良品であるかどうかを判定する。たとえば、傷検査とOCRの両方を実行するように設定されている場合、判定部840は傷検査部831の検査結果とOCR部832の文字認識結果との両方が合格レベルにあるときに、ワーク2を良品と判定する。   In step S2006, the determination unit 840 of the processor 810 compares the inspection result with the determination threshold to determine whether the workpiece 2 is good. For example, in the case where both the flaw inspection and the OCR are set, the determination unit 840 determines that the workpiece is a workpiece when both the inspection result of the flaw inspection unit 831 and the character recognition result of the OCR unit 832 are at pass level. 2 is determined to be good.

<画像保存設定>
図21は検査フローを設定するUI2100の一例を示している。UI管理部814はUI2100を表示部7に表示させ、検査フローのスタートからエンドまでの間に実行される複数の工程を入力部6から入力される指示にしたがって設定して行く。この例では、撮像工程、パターンサーチ工程、位置補正工程および傷検査工程が検査フローに追加されている。たとえば、入力部6を通じて検査フローのエンドが指定されると、UI管理部814はエンドにおいて検査履歴を蓄積するように設定してもよい。検査履歴とは、検査結果や検査に使用された画像などである。
<Image save setting>
FIG. 21 shows an example of the UI 2100 for setting an inspection flow. The UI management unit 814 causes the display unit 7 to display the UI 2100, and sets a plurality of processes to be executed between the start and the end of the inspection flow in accordance with an instruction input from the input unit 6. In this example, an imaging process, a pattern search process, a position correction process and a flaw inspection process are added to the inspection flow. For example, when the end of the inspection flow is designated through the input unit 6, the UI management unit 814 may be set to accumulate the inspection history at the end. The inspection history is, for example, an inspection result or an image used for the inspection.

なお、各工程を追加するときにUI管理部814は各工程で使用される画像の選択を、入力部6を通じて受け付けてもよい。たとえば、ユーザは入力部6を通じて撮像工程に対しては照明方向と異なる4つの輝度画像や傾き画像、反射率画像などを取得対象として指定し、パターンサーチ工程に対してはいずれかの輝度画像(全方向照明画像など)をサーチ対象として指定し、傷検査工程に対しては傾き画像から生成された検査画像などを検査対象として指定してもよい。本実施例では撮像工程にて撮像された複数の輝度画像から生成された複数の形状画像や反射率画像を後段の検査工程に出力することができるため、ユーザは、共通の撮像工程から生成された複数の検査画像を各画像の特性に応じた様々な検査に応用することができる。   When adding each process, the UI management unit 814 may receive selection of an image used in each process through the input unit 6. For example, the user designates four luminance images, tilt images, reflectance images and the like different from the illumination direction for the imaging process through the input unit 6 as acquisition targets, and one of the luminance images for the pattern search process ( An omnidirectional illumination image or the like may be specified as a search target, and an inspection image or the like generated from a tilt image may be specified as an inspection target for the flaw inspection process. In this embodiment, since a plurality of shape images and reflectance images generated from a plurality of luminance images captured in the imaging step can be output to the inspection step in the subsequent stage, the user is generated from the common imaging step. The plurality of inspection images can be applied to various inspections according to the characteristics of each image.

図22は履歴を蓄積する条件を設定するUI2200の一例を示している。蓄積条件を識別するための識別情報を設定する設定部2201は複数ある識別情報から設定対象となる識別情報を選択するためのプルダウンメニューによって構成されている。この例では設定部2201において「0:」という識別情報の蓄積条件が選択されている。蓄積条件としては、たとえば、検査結果が良品ではないときにのみ画像を蓄積するといった条件や、検査結果に依存せずに各ワークごとに常に画像を蓄積するといった条件などがある。ここでは、プロセッサ810は詳細設定ボタンなどが押されたことを検知すると条件設定部819を起動する。条件設定部819は、たとえば、常に画像を保存または出力するモードと、判定部840により検査対象物が良品ではないと判定されたときに画像を保存または出力するモードとのうちいずれかを設定してもよい。画像選択部2202は蓄積条件が満たされたときに保存する画像を選択する。ここでは画像選択部2202によって「すべて」と「指定」とを選択することができる。保存先選択部2203は、画像の保存先(例:内蔵メモリ、メモリカードなどの可搬メディアやFTPサーバなどのネットワークストレージ)を選択するためのプルダウンメニューによって構成されている。   FIG. 22 illustrates an example of the UI 2200 for setting conditions for accumulating a history. A setting unit 2201 for setting identification information for identifying storage conditions is configured by a pull-down menu for selecting identification information to be set from among a plurality of pieces of identification information. In this example, the storage condition of the identification information “0:” is selected in the setting unit 2201. As the accumulation condition, there are, for example, a condition that an image is accumulated only when an inspection result is not a good product, a condition that an image is always accumulated for each work regardless of the inspection result, and the like. Here, the processor 810 activates the condition setting unit 819 when detecting that the detail setting button or the like is pressed. Condition setting unit 819 sets, for example, one of a mode for always storing or outputting an image and a mode for storing or outputting an image when determination unit 840 determines that the inspection object is not a non-defective item. May be The image selection unit 2202 selects an image to be stored when the storage condition is satisfied. Here, “all” and “designated” can be selected by the image selection unit 2202. The storage destination selection unit 2203 is configured by a pull-down menu for selecting a storage destination of an image (for example, a built-in memory, a portable medium such as a memory card, or a network storage such as an FTP server).

図23は画像選択部2202で「指定」が選択されたときにUI管理部814が表示部7に表示させるUI2300の一例を示している。この例では、検査フローにおいて扱われるすべての種類の画像のうち実際に保存すべき画像を選択するためのチェックボックス2301が設けられている。形状1、2は特徴サイズが異なる検査画像(傾き画像)である。テクスチャは反射率画像である。ノーマルは全方向照明により取得された画像である。4つの矢印は照明方向を示すアイコンである。つまり矢印マークによって照明方向が異なる4つの輝度画像が区別されている。チェックボックスにチェックされた画像が保存対象として設定される。   FIG. 23 illustrates an example of the UI 2300 displayed on the display unit 7 by the UI management unit 814 when “specified” is selected by the image selection unit 2202. In this example, a check box 2301 is provided to select an image to be actually stored among all types of images handled in the inspection flow. Shapes 1 and 2 are inspection images (tilt images) having different feature sizes. The texture is a reflectance image. The normal is an image acquired by omnidirectional illumination. The four arrows are icons indicating the illumination direction. That is, four luminance images having different illumination directions are distinguished by the arrow mark. The image checked in the check box is set as the save target.

ところで、プロセッサ810は判定部840が判定を終了した後で画像を保存または出力する条件が満たされているかどうかを判断する判断手段を備えていてもよい。すなわち、検査フローのエンド部において、プロセッサ810は、条件設定部819により設定された蓄積条件や出力条件が満たされているかどうかを判断してもよい。   The processor 810 may include determination means for determining whether the condition for storing or outputting the image is satisfied after the determination unit 840 completes the determination. That is, in the end portion of the inspection flow, the processor 810 may determine whether the accumulation condition or the output condition set by the condition setting unit 819 is satisfied.

図24は画像出力工程2401を検査フローに追加する例を示している。上述した実施例では検査フローの最後に画像を出力するように設定したが、この例では入力部6から入力されるユーザ指示にしたがってUI管理部814が検査フローの任意の位置に画像出力工程2401を設定する。このように、プロセッサ810は、判定部840が判定を終了する前に位置する画像出力工程2401で画像を保存または出力する条件が満たされているかどうかを判断してもよい。画像出力工程2401に関連する蓄積設定等は図21ないし図23を用いて説明したのと同様であってもよいし、異なってもよい。   FIG. 24 shows an example in which the image output process 2401 is added to the inspection flow. In the embodiment described above, the image is set to be output at the end of the inspection flow, but in this example, the UI management unit 814 outputs the image at an arbitrary position in the inspection flow according to the user instruction input from the input unit 6. Set As described above, the processor 810 may determine whether the condition for storing or outputting an image is satisfied in the image output process 2401 positioned before the determination unit 840 ends the determination. The storage settings and the like associated with the image output process 2401 may be the same as or different from those described with reference to FIGS.

図25は蓄積設定(出力設定)に関するUIの別の例を示している。画像出力工程2401が入力部6により選択された状態で、さらに入力部6により設定を開始する指示が入力されると、UI管理部814はUI2501を表示する。画像変数2502は出力すべき画像を選択する画像選択部として機能し、この例では検査フローにおける各工程に付与されている画像変数によって出力すべき画像が指定される。つまり、各工程ごとに出力すべき画像を選択できる。UI2501において画像の出力枚数や画像形式なども設定されてもよい。出力先選択部2503は画像の出力先(例:内蔵メモリ、メモリカードなどの可搬記憶メディアやFTPサーバなどのネットワークストレージ)を選択するためのプルダウンメニューである。   FIG. 25 shows another example of the UI regarding the storage setting (output setting). In the state where the image output process 2401 is selected by the input unit 6, when an instruction to start setting is further input by the input unit 6, the UI management unit 814 displays the UI 2501. The image variable 2502 functions as an image selection unit for selecting an image to be output. In this example, the image variable to be output is designated by the image variable given to each process in the inspection flow. That is, an image to be output can be selected for each process. The number of output images and the image format may also be set in the UI 2501. An output destination selection unit 2503 is a pull-down menu for selecting an image output destination (for example, a built-in memory, a portable storage medium such as a memory card, or a network storage such as an FTP server).

図26は画像を選択するUI2600の一例である。UI2501において詳細設定ボタンが押し下げられると、UI管理部814はUI2600を表示する。UI2600ではすべての画像を保存するか、個別指定するかを選択するためのラジオボタンや、画像を個別に選択するためのチェックボックスなどが配置されている。この例では、ラジオボタンにより個別指定が選択されているため、チェックボックスが有効となり、チェックボックスを通じていくつかの画像が選択されている。このように、複数の輝度画像、検査画像、全方向照明画像および複数の輝度画像を合成して得られた合成輝度画像から保存対象もしくは出力対象となる画像が選択されてもよい。また、それぞれ特徴サイズが異なる複数の検査画像から保存対象もしくは出力対象となる画像を選択できるようにUI2600が構成されてもよい。また、複数の輝度画像、検査画像および検査対象物の表面の反射率を画素値とした反射率画像から保存対象もしくは出力対象となる画像を選択できるようにUI2600が構成されてもよい。   FIG. 26 shows an example of the UI 2600 for selecting an image. When the detail setting button is pressed in the UI 2501, the UI management unit 814 displays the UI 2600. In the UI 2600, a radio button for selecting whether to save all the images or individual specification, a check box for individually selecting the images, and the like are arranged. In this example, since the individual designation is selected by the radio button, the check box is validated, and some images are selected through the check box. As described above, an image to be stored or output may be selected from a plurality of luminance images, an inspection image, an omnidirectional illumination image, and a composite luminance image obtained by combining a plurality of luminance images. Further, the UI 2600 may be configured to be able to select an image to be stored or output from a plurality of inspection images each having a different feature size. The UI 2600 may be configured to select an image to be stored or output from a plurality of luminance images, an inspection image, and a reflectance image in which the reflectance of the surface of the inspection object is a pixel value.

<照明装置の構成>
図27(A)は照明装置3の斜視図である。図27(B)は照明装置3の上面図である。図27(C)は照明装置3の底面図である。図27(D)は照明装置3の側面図である。照明装置3の筐体は上ケース2701と下ケース2702を有している。下ケース2の下部には複数の光源(LEDなどの発光素子)のそれぞれが出力する光を拡散させる光拡散部材2703が配置されている。図27(A)や図27(C)が示すように上ケース2701や下ケース2702と同様に光拡散部材2703も円環状を成している。図27(B)や図27(D)が示すように上ケース2701の上面にはコネクタ2704が設けられている。コネクタ2704には照明装置3に格納されている照明コントローラ802と画像処理装置5とが通信するためのケーブルが接続される。
<Configuration of lighting device>
FIG. 27A is a perspective view of the lighting device 3. FIG. 27B is a top view of the lighting device 3. FIG. 27C is a bottom view of the lighting device 3. FIG. 27D is a side view of the lighting device 3. The housing of the lighting device 3 has an upper case 2701 and a lower case 2702. At the lower part of the lower case 2, a light diffusion member 2703 for diffusing the light output from each of a plurality of light sources (light emitting elements such as LEDs) is disposed. As shown in FIG. 27A and FIG. 27C, the light diffusion member 2703 has an annular shape as well as the upper case 2701 and the lower case 2702. As shown in FIG. 27B and FIG. 27D, a connector 2704 is provided on the upper surface of the upper case 2701. The connector 2704 is connected with a cable for communication between the lighting controller 802 stored in the lighting device 3 and the image processing device 5.

図28(A)は照明装置3に格納されている制御基板2801とLED基板2802とを示す側面図である。制御基板2801は点灯制御部が実装された第二基板の一例である。LED基板2802は複数の光源が実装された第一基板の一例である。図28(B)はLED基板2802の上面図である。図28(C)は照明装置3のうちLED2803の付近を拡大した断面図である。図28(D)はLED基板2802の底面図である。図28(E)はLED基板2802のうちLED2803の付近を拡大した側面図である。   FIG. 28A is a side view showing the control substrate 2801 and the LED substrate 2802 stored in the lighting device 3. The control substrate 2801 is an example of a second substrate on which the lighting control unit is mounted. The LED substrate 2802 is an example of a first substrate on which a plurality of light sources are mounted. FIG. 28B is a top view of the LED substrate 2802. FIG. FIG. 28C is a cross-sectional view in which the vicinity of the LED 2803 in the lighting device 3 is enlarged. FIG. 28D is a bottom view of the LED substrate 2802. FIG. FIG. 28E is a side view in which the vicinity of the LED 2803 in the LED substrate 2802 is enlarged.

制御基板2801には照明コントローラ802やコネクタ2704が配置されている。光源群801を構成するLEDなどの発光素子はLED基板2802に搭載されている。図28(B)が示すように、本実施例は4つのLED基板2802が設けられている。4つのLED基板2802のそれぞれには4つのLED2803が配置されているものとする。これにより光源群801は16個の発光素子により構成されている。図28(C)、図28(D)および図28(E)が示すように、複数のLED2803のうち隣り合った2つのLED2803の間には遮光部材2805が配置されている。多数のLED2803を密接に配置すると、隣り合った2つのLED2803からそれぞれ照射される照明光が光拡散部材2703の同一の領域を通過することがある。この場合、点灯パターンに応じて一方のLED2803を非点灯とし、かつ、他方のLED2803を点灯した場合と、他方のLED2803を非点灯とし、かつ、一方のLED2803を点灯した場合とで、ワーク2の表面には同一の照明方向から同一の光量で照明光が照射されてしまう。これでは高い精度で検査画像を生成することが難しくなる。そこで、隣り合った2つのLED2803の間に遮光部材2805を配置することで、隣り合った2つのLED2803について光量の均一性と光源の独立性とのバランスを取っている。図28(C)が示すようにLED2803の光の射出方向2821と、主な照明方向2822とは一致していない。そこで、反射鏡2804を配置することでLED2803から射出される光を光拡散部材2703の方向へ偏向している。これによりLED2803が発光した光を効率よくワーク2へ照射できるようになろう。この例では射出方向2821と反射鏡2804の反射方向とが概ね直交しているが、これは光拡散部材2703の断面形状が円弧を成しており(図28(C))、円弧に関する角度(中心角)が約90度になっているからである。このように中心角を大きくすることで、照明装置3をワーク2に対して遠ざけたり、近づけたりしてもワーク2の表面に対してほぼ均一な平行光を照射しやすくなる。   A lighting controller 802 and a connector 2704 are disposed on the control board 2801. Light emitting elements such as LEDs constituting the light source group 801 are mounted on the LED substrate 2802. As shown in FIG. 28B, in this embodiment, four LED substrates 2802 are provided. It is assumed that four LEDs 2803 are disposed on each of the four LED substrates 2802. Thus, the light source group 801 is composed of 16 light emitting elements. As shown in FIG. 28C, FIG. 28D and FIG. 28E, the light shielding member 2805 is disposed between two adjacent LEDs 2803 among the plurality of LEDs 2803. When a large number of LEDs 2803 are closely arranged, illumination light emitted from two adjacent LEDs 2803 may pass through the same area of the light diffusion member 2703. In this case, according to the lighting pattern, one of the LEDs 2803 is not lit, the other is lit, the other LED 2803 is not lit, and one of the LEDs 2803 is lit. The illumination light is irradiated with the same light quantity from the same illumination direction on the surface. This makes it difficult to generate an inspection image with high accuracy. Therefore, by arranging a light shielding member 2805 between two adjacent LEDs 2803, the uniformity of the light amount and the independence of the light sources are balanced for the two adjacent LEDs 2803. As shown in FIG. 28C, the light emission direction 2821 of the LED 2803 and the main illumination direction 2822 do not match. Therefore, the light emitted from the LED 2803 is deflected in the direction of the light diffusing member 2703 by arranging the reflecting mirror 2804. Thus, the light emitted by the LED 2803 can be efficiently irradiated to the work 2. In this example, the emission direction 2821 and the reflection direction of the reflecting mirror 2804 are substantially orthogonal, but the cross-sectional shape of the light diffusion member 2703 forms a circular arc (FIG. 28C), and the angle with respect to the circular arc The central angle) is about 90 degrees. By thus enlarging the central angle, it becomes easy to irradiate a substantially uniform parallel light to the surface of the workpiece 2 even if the lighting device 3 is moved away from or brought close to the workpiece 2.

<照明装置の回路構成>
図29は照明装置3の回路構成の一例を示している。この例では光源群801を構成する4つのLEDグループのうち1つのグループを示している。4つのLED2803a〜LED2803dは直列に接続されている。電圧が可変の可変電源2900は照明コントローラ802によって指定される電圧値(例:2V〜20V)の電圧を生成して出力する。可変定電流源2901は、照明コントローラ802によって指定される電流値(例:0A〜1A)となるようにLEDグループに流れる電流を調整する。このような電流制御方式を採用することでリニアリティの高い調光を実現しやすくなる。また、可変定電流源2901は、可変定電流源2901に印加されている電圧の値を検出して照明コントローラ802にフィードバックし、過電圧から可変定電流源2901を保護している。LED2803a〜LED2803dのそれぞれには並列にスイッチ2903a〜LED2803dが接続されている。照明コントローラ802の点灯制御部2911はこれらのスイッチ2903a〜LED2803dを個別に開閉させることで、LED2803a〜LED2803dのそれぞれを個別に点灯と非点灯とを切り替えることができる。このように、LED2803a〜LED2803dのそれぞれに並列にスイッチ2903a〜LED2803dを接続することで、LED2803a〜LED2803dのいずれか1つを点灯させたり、すべてを点灯させたりするといった個別点灯が可能となる。これは様々な点灯パターンを実現するのに役立っている。なお、点灯制御部2911は可変定電流源2901とグランドとの間に挿入されたメインスイッチ2903eのオン/オフを切り替えることで1つのLEDグループ単位での点灯制御を実行する。通信部2910は点灯パターンを指示する制御信号や点灯の開始を指示するトリガー信号を画像処理装置5の照明制御部812から受信し、点灯制御部2911に渡す。点灯制御部2911は、制御信号に対応する点灯パターンデータ2920を記憶部803から読み出し、点灯パターンデータ2920にしたがってスイッチ2903a〜LED2803dを制御する。点灯パターンデータ2920には、複数の光源のうち1回の点灯タイミングで同時に点灯する光源の識別情報や複数の光源の点灯順序を示す情報などが含まれていてもよい。たとえば、16個のLEDは4ビットの識別情報によって区別可能である。点灯パターンデータ2920には、照明方向の数(分割数)を示す情報が含まれていてもよい。照明方向の数は基本的に4であるが、8であってもよい。点灯パターンデータ2920には、点灯幅(1回の点灯タイミングで同時に点灯する光源の数)を示す情報が含まれてもよい。たとえば、基本的な点灯幅では4つのLEDが点灯する。これに対して、1/2の点灯幅では2個のLEDが点灯し、1/4の点灯幅では1個のLEDが点灯する。点灯パターンデータ2920には、すべてのLEDが点灯するタイミングを指定する情報が含まれてもよい。たとえば、フォトメトリックステレオ法にしたがった点灯を実行する前に全点灯が指示されたり、フォトメトリックステレオ法にしたがった点灯を実行した後に全点灯が指示されたりしてもよい。また、点灯パターンデータ2920には、点灯開始位置を示す情報が含まれていてもよい。たとえば、16個のLEDのうち、最初に点灯すべきLEDを示す識別情報が含まれていてもよい。この場合、最初に点灯すべきLEDから時計回りの照明方向にしたがって点灯すべきLEDが変更されてゆく。なお、点灯パターンデータ2920は、1つの点灯サイクルにおける点灯回数(1回〜16回)を示す情報や点灯すべきLEDの識別情報(0x000〜0xFFFF)によって構成されていてもよい。点灯パターンデータ2920には、1つのLEDあたりの照明光量や点灯時間(露光時間)、点灯間隔を示すインターバル時間などが含まれてもよい。このように点灯制御部2911は記憶部803に記憶された点灯パターンデータ2920であって信号線8を介して受信した制御信号によって特定される点灯パターンデータ2920にしたがって複数のLED2803を点灯させる。よって、各LEDごとに信号線8を配置する場合と比較して、大幅に信号線の数を削減できるようになる。
<Circuit configuration of lighting device>
FIG. 29 shows an example of the circuit configuration of the lighting device 3. In this example, one of four LED groups constituting the light source group 801 is shown. The four LEDs 2803 a to 2803 d are connected in series. The variable power supply 2900 having a variable voltage generates and outputs a voltage of a voltage value (for example, 2 V to 20 V) specified by the lighting controller 802. The variable constant current source 2901 adjusts the current flowing in the LED group so as to have the current value (eg, 0 A to 1 A) specified by the lighting controller 802. Adopting such a current control method makes it easy to realize dimming with high linearity. The variable constant current source 2901 detects the value of the voltage applied to the variable constant current source 2901 and feeds it back to the lighting controller 802 to protect the variable constant current source 2901 from overvoltage. Switches 2903a to 2803d are connected in parallel to the LEDs 2803a to 2803d, respectively. The lighting control unit 2911 of the lighting controller 802 can individually switch each of the LEDs 2803a to 2803d between lighting and non-lighting by individually opening and closing the switches 2903a to 2803d. As described above, by connecting the switches 2903a to 2803d in parallel to the LEDs 2803a to 2803d, it is possible to individually light up any one of the LEDs 2803a to 2803d or to light all of the LEDs 2803a to 2803d. This helps to realize various lighting patterns. The lighting control unit 2911 switches on / off of the main switch 2903e inserted between the variable constant current source 2901 and the ground to execute lighting control in units of one LED group. The communication unit 2910 receives a control signal instructing a lighting pattern and a trigger signal instructing start of lighting from the illumination control unit 812 of the image processing apparatus 5, and passes it to the lighting control unit 2911. The lighting control unit 2911 reads lighting pattern data 2920 corresponding to the control signal from the storage unit 803, and controls the switches 2903a to 2803d according to the lighting pattern data 2920. The lighting pattern data 2920 may include identification information of light sources that are simultaneously lighted at one lighting timing among a plurality of light sources, information indicating a lighting order of the plurality of light sources, and the like. For example, 16 LEDs can be distinguished by 4-bit identification information. The lighting pattern data 2920 may include information indicating the number of illumination directions (the number of divisions). The number of illumination directions is basically four, but may be eight. The lighting pattern data 2920 may include information indicating a lighting width (the number of light sources simultaneously lit at one lighting timing). For example, four LEDs light up in the basic lighting width. On the other hand, two LEDs light in one half of the lighting width, and one LED lights in one quarter of the lighting width. The lighting pattern data 2920 may include information specifying the timing at which all the LEDs are lit. For example, all lighting may be instructed before performing lighting according to the photometric stereo method, or all lighting may be instructed after performing lighting according to the photometric stereo method. The lighting pattern data 2920 may include information indicating a lighting start position. For example, identification information indicating the LED to be lit first among the 16 LEDs may be included. In this case, the LED to be lit is changed in accordance with the clockwise illumination direction from the LED to be lit first. The lighting pattern data 2920 may be configured by information indicating the number of times of lighting (1 to 16 times) in one lighting cycle or identification information (0x000 to 0xFFFF) of the LED to be lit. The lighting pattern data 2920 may include an illumination light amount per one LED, a lighting time (exposure time), an interval time indicating a lighting interval, and the like. As described above, the lighting control unit 2911 turns on the plurality of LEDs 2803 according to the lighting pattern data 2920 which is the lighting pattern data 2920 stored in the storage unit 803 and specified by the control signal received through the signal line 8. Therefore, the number of signal lines can be significantly reduced as compared with the case where the signal lines 8 are arranged for each LED.

図30は点灯制御のタイミングシーケンスを示す図である。時刻t1で制御信号を受信すると点灯制御部2911は点灯パターンに応じて電圧値を決定して可変電源2900に設定する。可変電源2900が出力する電圧が目標電圧に安定するまでには時間がかかるため、最初に電圧設定が実行される。これにより点灯の応答性が向上する。   FIG. 30 is a diagram showing a timing sequence of lighting control. When the control signal is received at time t1, the lighting control unit 2911 determines a voltage value according to the lighting pattern and sets it in the variable power supply 2900. Since it takes time for the voltage output from variable power supply 2900 to stabilize at the target voltage, voltage setting is performed first. This improves the response of lighting.

時刻t2で点灯制御部2911は点灯パターンに応じてスイッチ2903a〜LED2803dのオンオフを個別に設定する。つまり、点灯パターンにより点灯することが指示されているLEDに対して並列に接続されているスイッチがオンに切り替えられ、点灯パターンにより非点灯を指示されているLEDに対して並列に接続されているスイッチがオフに切り替えられる。   At time t2, the lighting control unit 2911 individually sets on / off of the switches 2903a to 2803d in accordance with the lighting pattern. That is, the switch connected in parallel to the LED instructed to light by the lighting pattern is switched on, and the switch connected in parallel to the LED instructed not to light by the lighting pattern The switch is switched off.

時刻t3でトリガー信号を受信すると点灯制御部2911はメインスイッチ2903eをオンに切り替える。これにより、点灯パターンにしたがってLEDが点灯する。なお、点灯するLEDの数に応じて(過電圧フィードバックに応じて)点灯制御部2911はLEDグループに印加される電圧を調整する。時刻t4でこの電圧調整が終了する。   When the trigger signal is received at time t3, the lighting control unit 2911 turns on the main switch 2903e. As a result, the LED lights up according to the lighting pattern. The lighting control unit 2911 adjusts the voltage applied to the LED group in accordance with the number of LEDs to be lit (in accordance with the overvoltage feedback). This voltage adjustment ends at time t4.

時刻t5で点灯制御部2911はメインスイッチ2903eをオフに切り替え、点灯したLEDを消灯させる。点灯制御部2911は次の点灯サイクルに備えて可変電源2900の電圧を十分に高く設定する。可変電源2900の電圧を十分に高く設定することで点灯指令に対する点灯の応答性が向上する。とりわけ、フォトメトリックステレオ法では多数の輝度画像を取得する必要があるため、1回の撮影に要する時間を短縮することが求められる。とりわけ、ワーク2が移動しているときには、各輝度画像でのワーク2の位置がずれてしまうため、撮影時間が長くなればなるほど検査画像の精度が落ちてしまう。よって、照明装置3の応答性の向上がこれらの課題を緩和する。   At time t5, the lighting control unit 2911 turns off the main switch 2903e and turns off the lighted LED. The lighting control unit 2911 sets the voltage of the variable power supply 2900 high enough for the next lighting cycle. By setting the voltage of the variable power supply 2900 sufficiently high, responsiveness of lighting to the lighting command is improved. In particular, in the photometric stereo method, since it is necessary to acquire a large number of luminance images, it is required to reduce the time required for one shooting. In particular, when the workpiece 2 is moving, the position of the workpiece 2 in each luminance image is shifted, so the longer the imaging time, the lower the accuracy of the inspection image. Therefore, the improvement of the responsiveness of the lighting device 3 alleviates these problems.

<点灯パターン>
図31は点灯パターンの一例を示す図である。点灯パターンP1は16個のLEDを用いて4つの照明方向からの照明を実現するパターンである。点灯パターンP2は16個のLEDを用いて8つの照明方向からの照明を実現するパターンである。4つの照明方向からの輝度画像と比較して8つの照明方向からの輝度画像では、法線ベクトルnや反射率の演算精度が向上するため、検査画像の精度が向上するといったメリットがある。また、照明方向を増やすことで、斜め方向に存在するエッジの検出精度や円形ワークの外形検出精度が向上する。点灯パターンP3は16個のLEDを用いて4つの照明方向からの照明を実現するパターンである。点灯パターンP1と比較して点灯パターンP3では1回の点灯で点灯するLEDの数が半分になっている。光源面積が小さくなるため、ワーク2への光源の映り込みを低減できる。点灯パターンP4は16個のLEDを用いて8つの照明方向からの照明を実現するパターンである。点灯パターンP2と比較して点灯パターンP4では1回の点灯で点灯するLEDの数が2倍になっている。これは、検査画像の精度とともに光量も要求されるケースで有利となる。点灯パターンP5は、基本パターンである点灯パターンP1の前後に全点灯を追加したパターンである。全方向から照明して取得された2枚の輝度画像はワーク2の移動量を推定する上で役に立つ。これによりワーク2を移動させながら撮影を実行する場合にも精度よく輝度画像内でのワーク2の位置を補正しながら、検査画像を作成できるようになろう。点灯パターンP6は点灯パターンP1において時計回りに1つだけ点灯開始位置をシフトした点灯パターンである。本実施例では照明装置3がカメラ4から独立して移動できるため、カメラ4の設置方向と照明装置3の設置方向とがずれていることがある。また、一度固定した照明装置3の位置を修正することは簡単ではない。そこで、カメラ4の設置方向と照明装置3の設置方向とのずれの分だけ照明装置3の点灯開始位置を修正することで、輝度画像において想定されている照明方向と実際の照明方向とを一致させることができる。
<Lighting pattern>
FIG. 31 is a diagram showing an example of the lighting pattern. The lighting pattern P1 is a pattern for realizing illumination from four illumination directions using 16 LEDs. The lighting pattern P2 is a pattern for realizing illumination from eight illumination directions using 16 LEDs. With luminance images from eight illumination directions compared to luminance images from four illumination directions, the calculation accuracy of the normal vector n and the reflectance is improved, so that there is an advantage that the accuracy of the inspection image is improved. Further, by increasing the illumination direction, the detection accuracy of the edge present in the oblique direction and the outer shape detection accuracy of the circular workpiece are improved. The lighting pattern P3 is a pattern for realizing illumination from four illumination directions using 16 LEDs. Compared to the lighting pattern P1, in the lighting pattern P3, the number of LEDs lit by one lighting is half. Since the light source area is reduced, the reflection of the light source onto the work 2 can be reduced. The lighting pattern P4 is a pattern for realizing illumination from eight illumination directions using 16 LEDs. As compared with the lighting pattern P2, in the lighting pattern P4, the number of LEDs lit by one lighting is doubled. This is advantageous in the case where the light intensity as well as the accuracy of the inspection image is required. The lighting pattern P5 is a pattern in which all lighting is added before and after the lighting pattern P1 which is a basic pattern. The two luminance images obtained by illuminating from all directions are useful in estimating the amount of movement of the workpiece 2. As a result, it is possible to create an inspection image while correcting the position of the workpiece 2 within the luminance image with high accuracy even when performing shooting while moving the workpiece 2. The lighting pattern P6 is a lighting pattern in which the lighting start position is shifted by one clockwise in the lighting pattern P1. In the present embodiment, since the illumination device 3 can be moved independently from the camera 4, the installation direction of the camera 4 and the installation direction of the illumination device 3 may be shifted. Moreover, it is not easy to correct the position of the lighting device 3 once fixed. Therefore, the lighting start position of the lighting device 3 is corrected by the deviation between the mounting direction of the camera 4 and the mounting direction of the lighting device 3 to match the lighting direction assumed in the luminance image with the actual lighting direction. It can be done.

<点灯パターン照明位置の調整>
図32は点灯開始位置を調整するためのUI3200の一例を示している。検査ツール設定部817は上述した点灯開始位置を調整するための調整部を備えており、表示部7にUI3200を設定する。UI3200は輝度画像を表示する表示領域1103と点灯開始位置を調整するための調整ボタン3201を有している。検査ツール設定部817は輝度画像について想定されている照明方向を示すためのアイコンである矢印3202を輝度画像に対して重畳させて表示する。これにより、輝度画像について想定されている照明方向と実際の照明方向とが一致しているかどうかを確認しやすくなる。ユーザは入力部6を通じて調整ボタン3201を操作する。検査ツール設定部817はこの調整操作を検知し、調整量を照明制御部812に通知する。照明制御部812は点灯開始位置の調整量を照明コントローラ802に送信する。照明コントローラ802の点灯制御部2911は通信部2910を通じて調整量を受け取ると、記憶部803に保存する。これにより、点灯制御部2911は点灯パターンデータ2920によって指定されている点灯パターンにおける点灯開始位置を調整量に応じて修正する。なお、調整が正しいかどうかを判別するために、検査ツール設定部817は撮像制御部813を通じてカメラ4に撮像を実行させて、輝度画像を取得させ、表示領域1103に表示させてもよい。このように検査ツール設定部817は点灯すべきLEDが変更されたときは輝度画像を更新して表示してもよい。なお、図32が示すように、表示制御部851は表示領域1103に表示される輝度画像を切り替えて表示部7に表示してもよい。これにより照明方向の異なるすべての輝度画像において照明方向を正しく設定できるようになろう。図33は、点灯開始位置を調整するためのUI3300の一例を示している。図33が示すように検査ツール設定部817は表示領域1103に4つの輝度画像を並べて表示してもよい。これによりユーザは4つの輝度画像を切り替える手間を省けるようになろう。
<Adjustment of lighting pattern lighting position>
FIG. 32 shows an example of the UI 3200 for adjusting the lighting start position. The inspection tool setting unit 817 includes an adjustment unit for adjusting the lighting start position described above, and sets the UI 3200 in the display unit 7. The UI 3200 has a display area 1103 for displaying a luminance image and an adjustment button 3201 for adjusting the lighting start position. The inspection tool setting unit 817 superimposes and displays an arrow 3202 which is an icon for indicating the illumination direction assumed for the luminance image on the luminance image. This makes it easy to check whether the illumination direction assumed for the luminance image matches the actual illumination direction. The user operates the adjustment button 3201 through the input unit 6. The inspection tool setting unit 817 detects this adjustment operation, and notifies the illumination control unit 812 of the adjustment amount. The lighting control unit 812 transmits the adjustment amount of the lighting start position to the lighting controller 802. When the lighting control unit 2911 of the lighting controller 802 receives the adjustment amount through the communication unit 2910, the lighting control unit 2911 stores the adjustment amount in the storage unit 803. Thus, the lighting control unit 2911 corrects the lighting start position in the lighting pattern specified by the lighting pattern data 2920 according to the adjustment amount. In addition, in order to determine whether the adjustment is correct, the inspection tool setting unit 817 may cause the camera 4 to perform imaging through the imaging control unit 813 to acquire a luminance image and display it in the display area 1103. As described above, the inspection tool setting unit 817 may update and display the luminance image when the LED to be lighted is changed. Note that as shown in FIG. 32, the display control unit 851 may switch the luminance image displayed in the display area 1103 and display it on the display unit 7. This will allow the illumination direction to be set correctly in all luminance images with different illumination directions. FIG. 33 shows an example of the UI 3300 for adjusting the lighting start position. As shown in FIG. 33, the inspection tool setting unit 817 may display four luminance images side by side in the display area 1103. This will save the user the trouble of switching the four luminance images.

<まとめ>
本実施例によれば、フォトメトリック処理部811は、フォトメトリックステレオ法にしたがってカメラ4により取得された複数の輝度画像からワーク2の表面の法線ベクトルを算出し、複数の輝度画像から算出された法線ベクトルに基づく画素値により構成された傾き画像と、当該傾き画像の縮小画像とについて、注目画素に隣接する隣接画素の法線ベクトルを用いて当該注目画素の画素値を積み上げ演算し、当該画素値を有する検査画像を生成する。とりわけ、本実施例によれば、積み上げ演算において使用される縮小画像の成分に対する重みを与えるパラメータである特徴サイズを設定する特徴サイズ設定部815を設けている。このように特徴サイズという概念を導入することで、フォトメトリックステレオの原理を用いて取得された画像から検査用画像を生成する際のパラメータを容易に設定できるようになる。
<Summary>
According to the present embodiment, the photometric processing unit 811 calculates the normal vector of the surface of the work 2 from the plurality of luminance images acquired by the camera 4 according to the photometric stereo method, and calculates from the plurality of luminance images. The pixel value of the pixel of interest is accumulated and calculated using the normal vector of the adjacent pixel adjacent to the pixel of interest for the inclination image formed by the pixel values based on the normal vector and the reduced image of the inclination image. An inspection image having the pixel value is generated. In particular, according to the present embodiment, the feature size setting unit 815 is provided which sets a feature size which is a parameter for giving a weight to the component of the reduced image used in the stacking operation. By introducing the concept of the feature size in this manner, it is possible to easily set parameters for generating an inspection image from an image acquired using the principle of photometric stereo.

特徴サイズ設定部815はそれぞれ値の異なる複数の特徴サイズを設定してもよい。この場合、フォトメトリック処理部811は、特徴サイズ設定部815により設定された複数の特徴サイズのそれぞれについて検査画像を生成してもよい。検査ツールの種類に応じて適切な特徴サイズが異なることが考えられる。よって、それぞれ値の異なる複数の特徴サイズに応じて検査画像を生成することは、検査に対応したより適切な検査画像を選択する上で有利であろう。   The feature size setting unit 815 may set a plurality of feature sizes having different values. In this case, the photometric processing unit 811 may generate an inspection image for each of the plurality of feature sizes set by the feature size setting unit 815. It is conceivable that the appropriate feature size may differ depending on the type of inspection tool. Therefore, generating inspection images according to a plurality of feature sizes each having a different value may be advantageous in selecting a more appropriate inspection image corresponding to the inspection.

傷検査部831はそれぞれ異なる特徴サイズ用いて生成された複数の検査画像に対して傷検査を実行し、判定部840は、傷検査部831の検査結果を用いてワーク2の良否を判定してもよい。複数の検査画像に対して傷検査を実行することで、予め1つの検査画像を選択する必要がなくなり、ユーザにとっては便利であろう。OCR部832はそれぞれ異なる特徴サイズ用いて生成された複数の検査画像に対して文字認識処理を実行し、判定部840はOCR部832の文字認識結果を用いてワーク2の良否を判定してもよい。複数の検査画像に対して文字認識処理を実行することで、予め1つの検査画像を選択する必要がなくなり、ユーザにとっては便利であろう。   The flaw inspection unit 831 executes flaw inspection on a plurality of inspection images generated using different feature sizes, and the determination unit 840 determines the quality of the work 2 using the inspection result of the flaw inspection unit 831. It is also good. By performing flaw inspection on a plurality of inspection images, it is not necessary to select one inspection image in advance, which may be convenient for the user. The OCR unit 832 executes character recognition processing on a plurality of inspection images generated using different feature sizes, and the determination unit 840 determines the quality of the work 2 using the character recognition result of the OCR unit 832. Good. By performing character recognition processing on a plurality of inspection images, it is not necessary to select one inspection image in advance, which may be convenient for the user.

本来はフォトメトリックステレオ法によりワーク2の高さを示す高さ画像を生成することができる。しかし、ワーク2の表面の高さを計測するためには、かなり厳密にカメラ4と照明装置3の位置関係を設定する必要がある。一方で、フォトメトリックステレオ法により得られた画像のうち高さの情報を使用せずに形状の情報やテクスチャ(模様)の情報を使用することも可能である。たとえば、傷検査やOCRに高さ画像を使用するのであれば、カメラ4と照明装置3の厳密な設定は不要である。このように正確な高さデータの不要な検査ツールであれば、カメラ4と照明装置3の配置条件を緩和することができる。なお、照明方向は3方向以上であればよい。   Originally, it is possible to generate a height image indicating the height of the work 2 by the photometric stereo method. However, in order to measure the height of the surface of the work 2, it is necessary to set the positional relationship between the camera 4 and the lighting device 3 quite strictly. On the other hand, it is also possible to use shape information and texture (pattern) information without using height information among images obtained by the photometric stereo method. For example, if height images are used for flaw inspection or OCR, strict setting of the camera 4 and the illumination device 3 is not necessary. Thus, if it is an unnecessary inspection tool of accurate height data, arrangement conditions of camera 4 and lighting installation 3 can be eased. The illumination directions may be three or more.

フォトメトリック処理部811はカメラ4により取得された複数の輝度画像からワーク2の表面の法線ベクトルとともにワーク2の表面の反射率を算出し、当該反射率に基づく画素値により構成された反射率画像を生成し、判定部840は反射率画像を用いてワーク2の良否を判定してもよい。これは反射率画像が検査に適している検査ツールも存在するからである。フォトメトリック処理部811はカメラ4により取得された複数の輝度画像からワーク2の表面の法線ベクトルに基づく画素値により構成された傾き画像を生成し、判定部840は傾き画像を用いてワーク2の良否を判定してもよい。これは傾き画像が検査に適している検査ツールも存在するからである。判定部840は輝度画像を用いてワーク2の良否を判定してもよい。傾き画像や反射率画像に加工する前の輝度画像が検査に適している検査ツールも存在するからである。判定部840は、それぞれ照明方向が異なる複数の輝度画像のうち少なくとも1つの輝度画像を用いてワーク2の良否を判定してもよい。照明方向の違いによって明確になるような傷なども存在するため、そのような傷の検出にはある方向からワーク2を照明することで得られた輝度画像が好適であろう。   The photometric processing unit 811 calculates the reflectance of the surface of the workpiece 2 along with the normal vector of the surface of the workpiece 2 from the plurality of luminance images acquired by the camera 4, and the reflectance configured by pixel values based on the reflectance An image may be generated, and the determination unit 840 may determine the quality of the work 2 using the reflectance image. This is because there are inspection tools for which reflectance images are suitable for inspection. The photometric processing unit 811 generates an inclination image composed of pixel values based on the normal vector of the surface of the workpiece 2 from the plurality of luminance images acquired by the camera 4, and the determination unit 840 uses the inclination image to generate the workpiece 2. It may be judged whether or not This is because there are inspection tools for which the tilt image is suitable for inspection. The determination unit 840 may determine the quality of the work 2 using the luminance image. This is because there are inspection tools that are suitable for inspection of luminance images before being processed into tilt images and reflectance images. The determination unit 840 may determine the quality of the work 2 using at least one luminance image among a plurality of luminance images each having a different illumination direction. Since there are scratches that become clear due to the difference in the illumination direction, a luminance image obtained by illuminating the workpiece 2 from a certain direction would be preferable for detecting such scratches.

判定部840は照明装置3のすべて光源を同時に点灯してカメラ4により取得された輝度画像を用いてワーク2の良否を判定してもよい。いわゆる全方向照明画像を用いることでワーク2の良否が判定されてもよい。たとえば、ワーク2のある部分の面積計算や端子の長さの測定などは、全方向照明画像が好適なことがある。   The determination unit 840 may simultaneously turn on all the light sources of the lighting device 3 and determine the quality of the work 2 using the luminance image acquired by the camera 4. The quality of the work 2 may be determined by using a so-called omnidirectional illumination image. For example, an omnidirectional illumination image may be suitable for area calculation of a certain portion of the workpiece 2 and measurement of the length of a terminal.

判定部840はそれぞれ照明方向が異なる複数の輝度画像を合成して生成された合成輝度画像を用いてワーク2の良否を判定してもよい。合成輝度画像は全方向照明画像に類似した画像となる。よって、全方向照明画像に代えて合成輝度画像を用いることで、全方向照明画像を取得することなく、検査を実行することが可能となろう。全方向照明画像が必要な場合、それぞれ照明方向が異なる4枚の輝度画像と、同時に4方向から照明して得られた1枚の全方向照明画像とを取得しなければならない。つまり、5回の照明と5回の撮像とが必要となる。一方で、合成輝度画像を使用すれば、4回の照明と4回の撮像とを実行すればよい。このように合成輝度画像を採用することで、短時間で複数の検査画像を処理する必要があるときにはプロセッサ810の処理負荷を軽減できる。また、画像の取得枚数が多くなればなるほどライン1の搬送速度を低下させる必要が生じるが、本実施例では、画像の取得枚数を削減できるため、ライン1の搬送速度の高速化も可能である。   The determination unit 840 may determine the quality of the work 2 using a composite luminance image generated by combining a plurality of luminance images having different illumination directions. The synthetic luminance image is an image similar to the omnidirectional illumination image. Thus, using synthetic luminance images instead of omnidirectional illumination images would allow inspection to be performed without acquiring omnidirectional illumination images. When an omnidirectional illumination image is required, it is necessary to acquire four luminance images having different illumination directions and one omnidirectional illumination image obtained by illuminating from four directions simultaneously. That is, five illuminations and five imagings are required. On the other hand, if a synthetic luminance image is used, four illuminations and four imagings may be performed. By adopting the synthetic luminance image in this manner, the processing load on the processor 810 can be reduced when it is necessary to process a plurality of inspection images in a short time. In addition, although it is necessary to reduce the conveyance speed of line 1 as the number of acquired images increases, in the present embodiment, since the number of acquired images can be reduced, the conveyance speed of line 1 can also be increased. .

記憶装置820は検査画像を記憶して保持してもよい。判定部840または画像処理部830は記憶装置820から検査画像を読み出して検査を実行し、検査結果に基づいてワーク2の良否を判定してもよい。なお、記憶装置820は内蔵メモリや可搬型記憶メディア、ネットワークストレージのいずれであってもよい。たとえば、可搬型記憶メディア、ネットワークストレージに検査画像を記憶すれば、検査画像を生成した装置とは異なる装置において検査処理を実行することも可能となろう。   The storage device 820 may store and hold the inspection image. The determination unit 840 or the image processing unit 830 may read the inspection image from the storage device 820 and execute the inspection, and may determine the quality of the work 2 based on the inspection result. The storage device 820 may be any of a built-in memory, a portable storage medium, and a network storage. For example, if the inspection image is stored in a portable storage medium, network storage, it will be possible to execute the inspection process in a device different from the device that generated the inspection image.

記憶装置820はそれぞれ値の異なる特徴サイズを適用して生成された複数の検査画像を記憶してもよい。記憶装置820は、検査画像に加え、傾き画像および反射率画像のうち少なくとも一方を記憶してもよい。画像選択部816は複数の検査画像から1つの検査画像を選択してもよい。また、検査ツール設定部817は画像選択部816により選択された検査画像に対して検査ツールを設定してもよい。それぞれ値の異なる特徴サイズを適用して生成された複数の検査画像のうち検査に不要なものも存在しうる。よって、ユーザは検査ツールに応じて検査画像を設定してもよい。   The storage device 820 may store a plurality of inspection images generated by applying different feature sizes. The storage device 820 may store at least one of the tilt image and the reflectance image in addition to the inspection image. The image selection unit 816 may select one inspection image from a plurality of inspection images. The inspection tool setting unit 817 may set an inspection tool for the inspection image selected by the image selection unit 816. Among the plurality of inspection images generated by applying feature sizes different in value, there may be unnecessary ones for the inspection. Thus, the user may set the inspection image according to the inspection tool.

図15などを用いて説明したように、画像処理部830は良品から取得された基準画像を用いてパターンサーチを実行して検査領域を設定してもよい。判定部840は検査領域において実行された検査の結果を用いてワーク2の良否を判定してもよい。検査領域は、たとえば、文字認識領域である。   As described with reference to FIG. 15 and the like, the image processing unit 830 may set the inspection area by executing the pattern search using the reference image acquired from the non-defective item. The determination unit 840 may determine the quality of the work 2 using the result of the inspection performed in the inspection area. The inspection area is, for example, a character recognition area.

図11、図21ないし図26を用いて説明したように、画像選択部816はカメラ4により取得された複数の輝度画像および検査画像のうち保存対象もしくは出力対象となる画像を選択してもよい。また、画像選択部816は複数の輝度画像、検査画像、照明装置3が備える複数の光源をすべて点灯させて取得された輝度画像および複数の輝度画像を合成して得られた合成輝度画像から保存対象もしくは出力対象となる画像を選択してもよい。さらに、画像選択部816はそれぞれ特徴サイズが異なる複数の検査画像から保存対象もしくは出力対象となる画像を選択してもよい。さらに、画像選択部816は複数の輝度画像、検査画像およびワーク2の表面の反射率を画素値とした反射率画像から保存対象もしくは出力対象となる画像を選択してもよい。このように検査に関連する画像を適宜選択できるようにすることで、所望の画像を保存または出力することが容易となろう。   As described with reference to FIGS. 11 and 21 to 26, the image selection unit 816 may select an image to be stored or output among the plurality of luminance images and inspection images acquired by the camera 4. . In addition, the image selection unit 816 stores a plurality of luminance images, an inspection image, a luminance image acquired by lighting all of a plurality of light sources included in the lighting device 3 and a synthetic luminance image obtained by synthesizing a plurality of luminance images. An image to be a target or an output target may be selected. Furthermore, the image selection unit 816 may select an image to be stored or output from a plurality of examination images each having a different feature size. Furthermore, the image selection unit 816 may select an image to be stored or output from a plurality of luminance images, an inspection image, and a reflectance image in which the reflectance of the surface of the workpiece 2 is a pixel value. By appropriately selecting the image associated with the examination in this manner, it will be easy to store or output the desired image.

画像を保存または出力する条件を設定する条件設定部819がさらに設けられてもよい。たとえば、図22や図26を用いて説明したように、条件設定部819は常に画像を保存または出力するモードと判定部840によりワーク2が良品ではないと判定されたときに画像を保存または出力するモードとのうちいずれかを設定してもよい。図21ないし図26を用いて説明したように、プロセッサ810は、判定部840が判定を終了した後でまたは前に画像を保存または出力する条件が満たされているかどうかを判断してもよい。たとえば、検査フローにおいて検査が終了した時点で画像を保存するかどうかが判断されてもよいし、検査フローのいずれかの工程で画像を保存するかどうかが判断されてもよい。とりわけ、後者の場合は検査フローの途中で生じる中間画像についても保存することが可能となろう。このような中間画像は検査に失敗した原因を探り、制御パラメータを調整する際に役立つであろう。   A condition setting unit 819 may be further provided to set conditions for storing or outputting an image. For example, as described with reference to FIGS. 22 and 26, the condition setting unit 819 always stores or outputs an image when the determination unit 840 determines that the work 2 is not good. You may set any one of the following modes. As described with reference to FIGS. 21 to 26, the processor 810 may determine whether the condition for storing or outputting the image is satisfied after or before the determination unit 840 completes the determination. For example, it may be determined in the inspection flow whether or not to save the image when the inspection is completed, or it may be determined whether to save the image in any step of the inspection flow. In particular, in the latter case it will be possible to save also intermediate images that occur during the inspection flow. Such intermediate images may be useful in tracking down the cause of inspection failure and adjusting control parameters.

本実施例によれば、照明装置3は、略環状に配置された複数のLED2803と、複数のLED2803のそれぞれが出力する光を拡散させる光拡散部材2703と、点灯開始を指示されると所定の点灯パターンにしたがって複数の光源を点灯させる点灯制御部2911とを有している。とりわけ、照明装置3はカメラ4とは独立して移動することでワーク2に対する距離を調整する。これによりワークの種類や置き方に応じて照明装置3をワークから遠ざけて正反射光を利用したり、照明装置3をワークに近づけて拡散反射光を利用したりできるようになる。なお、点灯制御部2911などの照明コントローラ802は照明装置3の外部に配置されてもよい。   According to the present embodiment, the lighting device 3 includes the plurality of LEDs 2803 arranged in a substantially annular shape, the light diffusion member 2703 for diffusing the light output from each of the plurality of LEDs 2803, and a predetermined start when instructed to start lighting. And a lighting control unit 2911 for lighting a plurality of light sources according to the lighting pattern. In particular, the lighting device 3 adjusts the distance to the work 2 by moving independently of the camera 4. As a result, depending on the type and placement of the work, the illumination device 3 can be moved away from the work to use regular reflection light, or the illumination device 3 can be brought close to the work to use diffuse reflection light. The lighting controller 802 such as the lighting control unit 2911 may be disposed outside the lighting device 3.

図28(C)〜図28(E)を用いて説明したように、複数のLED2803のうち隣り合った2つのLED2803の間には遮光部材2805が設けられてもよい。これにより隣り合った2つのLED2803について光量の均一性と光源の独立性とのバランスが維持される。   As described with reference to FIGS. 28C to 28E, the light shielding member 2805 may be provided between two adjacent LEDs 2803 among the plurality of LEDs 2803. As a result, the balance between the uniformity of the light amount and the independence of the light source is maintained for the two adjacent LEDs 2803.

照明装置3は、複数のLED2803が実装された第一基板であるLED基板2802と、点灯制御部2911が実装された第二基板である制御基板2801とを有していてもよい。基板を分離することで複数のLED2803の発熱の影響を緩和できる。   The lighting apparatus 3 may include an LED substrate 2802 which is a first substrate on which a plurality of LEDs 2803 are mounted, and a control substrate 2801 which is a second substrate on which the lighting control unit 2911 is mounted. By separating the substrates, the effects of heat generation of the plurality of LEDs 2803 can be mitigated.

図27や図28を用いて複数のLED2803が円環状に配置される例を説明した。円環状配置は各照明方向から平行光を実現する上で有利である。なお、円環状は一例にすぎず、正多角形的な配置などが配置されてもよい。たとえば、16個のLED2803が正十六角形の各頂点に配置されてもよい。   An example in which the plurality of LEDs 2803 are arranged in an annular shape has been described with reference to FIGS. 27 and 28. A toroidal arrangement is advantageous for achieving collimated light from each illumination direction. In addition, annular | circular shape is only an example and arrangement | positioning etc. of a regular polygon may be arrange | positioned. For example, sixteen LEDs 2803 may be arranged at each vertex of a dodecagon.

照明装置3は、複数のLED2803の点灯パターンを記憶した記憶部803を有していてもよい。点灯制御部2911は、制御信号やトリガー信号により点灯開始を指示されると記憶部803に記憶された点灯パターンにしたがって複数のLED2803を点灯させてもよい。このように点灯制御部2911は記憶部803に記憶された点灯パターンデータ2920であって信号線8を介して受信した制御信号によって特定される点灯パターンデータ2920にしたがって複数のLED2803を点灯させてもよい。よって、各LEDごとに信号線8を配置する場合と比較して、大幅に信号線の数を削減できるようになる。たとえば、16個のLED2803を画像処理装置5から制御しようとすると少なくとも17本の信号線が必要となる。しかしながら、本実施例では点灯パターンを指示する制御信号を伝送できる信号線8を採用できるため、信号線の数を減らすことが可能となり、画像処理装置5と照明装置3とを接続するケーブルのコストを削減できる。   The lighting device 3 may have a storage unit 803 storing the lighting patterns of the plurality of LEDs 2803. The lighting control unit 2911 may turn on the plurality of LEDs 2803 according to the lighting pattern stored in the storage unit 803 when instructed to start lighting by the control signal or the trigger signal. Thus, even if the lighting control unit 2911 is the lighting pattern data 2920 stored in the storage unit 803 and lights the plurality of LEDs 2803 according to the lighting pattern data 2920 specified by the control signal received through the signal line 8 Good. Therefore, the number of signal lines can be significantly reduced as compared with the case where the signal lines 8 are arranged for each LED. For example, in order to control 16 LEDs 2803 from the image processing apparatus 5, at least 17 signal lines are required. However, in the present embodiment, since the signal line 8 capable of transmitting the control signal instructing the lighting pattern can be adopted, the number of signal lines can be reduced, and the cost of the cable connecting the image processing device 5 and the lighting device 3 Can be reduced.

記憶部803は、それぞれ同時に点灯する光源の数が異なる複数の点灯パターン(P1やP3など)を記憶していてもよい。これにより光量を簡単に半分または2倍に変更することが可能となる。記憶部803は、それぞれ照明方向の数が異なる複数の点灯パターン(P1やP2など)を記憶していてもよい。これにより照明方向の異なる輝度画像を容易に得られるようになる。記憶部803は、それぞれ4方向から順番に検査対象物を照明する複数の点灯パターン(P1やP3、P5、P6)や8方向から順番に検査対象物を照明する点灯パターン(P2やP4)を記憶していてもよい。これにより光量を簡単に半分または2倍に変更することが可能となる。記憶部803は、複数の光源のすべてを同時に点灯させる点灯パターン(P5など)を記憶しておいてもよい。これにより簡単に全方向照明画像を得られるようになる。画像処理部830の推定部833は全方向照明画像からワーク2の位置を推定する。点灯パターンP5が示すように照明制御部812および撮像制御部813は第1タイミングにおいて複数のLED2803のすべてを同時に点灯させてカメラ4に第1の輝度画像を取得させる。また、点灯パターンP5が示すように、照明制御部812および撮像制御部813は第Nタイミング(点灯パターンP5では6番目のタイミング)において複数のLED2803のすべてを同時に点灯させてカメラ4段に第2の輝度画像を取得させる。推定部833は第1の輝度画像と第2の輝度画像とからワーク2の移動量を推定する。つまり、推定部833は、点灯パターンP5のうち第1タイミングの輝度画像と第6タイミングの輝度画像とから第2タイミングないし第5タイミングの輝度画像におけるワーク2の位置を推定する。フォトメトリック処理部811は、推定部833から各タイミングでのワーク2の移動量を取得して、第2タイミングないし第5タイミングの輝度画像におけるワーク2の位置が一致するように各輝度画像を補正し、補正した輝度画像から検査画像を作成する。ワーク2の位置を推定するには、全方向照明画像が有利であるため、点灯パターンP5のように複数のLED2803のすべてを同時に点灯させることを含む点灯パターンが必要となる。   The storage unit 803 may store a plurality of lighting patterns (such as P1 and P3) in which the number of light sources to be simultaneously lighted is different. This makes it possible to easily change the amount of light by half or twice. The storage unit 803 may store a plurality of lighting patterns (such as P1 and P2) each having a different number of illumination directions. This makes it possible to easily obtain luminance images with different illumination directions. The storage unit 803 has a plurality of lighting patterns (P1, P3, P5, and P6) for illuminating the inspection object in order from four directions, and a lighting pattern (P2 and P4) for illuminating the inspection object in order from eight directions. You may memorize. This makes it possible to easily change the amount of light by half or twice. The storage unit 803 may store a lighting pattern (such as P5) for lighting all of the plurality of light sources simultaneously. This makes it possible to easily obtain an omnidirectional illumination image. The estimation unit 833 of the image processing unit 830 estimates the position of the workpiece 2 from the omnidirectional illumination image. As indicated by the lighting pattern P5, the illumination control unit 812 and the imaging control unit 813 simultaneously turn on all of the plurality of LEDs 2803 at the first timing to cause the camera 4 to acquire the first luminance image. Further, as indicated by the lighting pattern P5, the illumination control unit 812 and the imaging control unit 813 simultaneously turn on all the plurality of LEDs 2803 at the Nth timing (the sixth timing in the lighting pattern P5), To obtain a luminance image of The estimation unit 833 estimates the movement amount of the workpiece 2 from the first luminance image and the second luminance image. That is, the estimation unit 833 estimates the position of the work 2 in the luminance image of the second to fifth timings from the luminance image of the first timing and the luminance image of the sixth timing in the lighting pattern P5. The photometric processing unit 811 acquires the movement amount of the work 2 at each timing from the estimation unit 833, and corrects each luminance image so that the positions of the work 2 in the luminance images at the second to fifth timings coincide. And create an inspection image from the corrected luminance image. In order to estimate the position of the work 2, since the omnidirectional illumination image is advantageous, a lighting pattern including lighting all the plurality of LEDs 2803 at the same time as the lighting pattern P5 is required.

図29を用いて説明したように、複数のLED2803は、所定数(例:4個)のLED2803ごとに光源グループを形成しており、各光源グループにおいて複数のLED2803が直列に接続されていてもよい。複数のLED2803a〜2803dのそれぞれには点灯制御部2911によってオン/オフを切り替え可能なスイッチ2903a〜2903dが並列に接続されている。これにより、点灯パターンに応じて自在に複数のLED2803a〜2803dの点灯と非点灯とを切り替えることが可能となる。つまり、様々な点灯パターンを採用できる。   As described with reference to FIG. 29, the plurality of LEDs 2803 form a light source group for each of a predetermined number (for example, four) of LEDs 2803 and even if the plurality of LEDs 2803 are connected in series in each light source group Good. Switches 2903 a to 2903 d that can be switched on / off by the lighting control unit 2911 are connected in parallel to the respective LEDs 2803 a to 2803 d. Thereby, it becomes possible to freely switch between the lighting and non-lighting of the plurality of LEDs 2803 a to 2803 d according to the lighting pattern. That is, various lighting patterns can be adopted.

図29を用いて説明したように、点灯制御部2911は、複数のLED2803に電圧を供給する可変電源2900と、複数のLED2803に流れる電流を調整する可変定電流源2901と、可変定電流源2901のオン/オフを切り替えるメインスイッチ2903eを制御してもよい。つまり、図30を用いて説明したように、点灯制御部2911は、可変電源が供給する電圧が十分に高くなってから、点灯パターンに応じて複数のLED2803のそれぞれに並列に接続されているスイッチを切り替え、メインスイッチ2903eをオンに切り替えて点灯パターンに応じて複数のLED2803のいずれかを点灯させてもよい。これにより点灯の高い応答性と電力効率の向上とを達成できるであろう。点灯制御部2911は、可変定電流源2901に過電圧が印加されないように可変定電流源2901からフィードバックされる電圧値に応じて可変電源2900の電圧を制御してもよい。これにより可変定電流源2901を過電圧から保護できるようになろう。   As described with reference to FIG. 29, the lighting control unit 2911 includes a variable power supply 2900 that supplies voltages to the plurality of LEDs 2803, a variable constant current source 2901 that adjusts current flowing to the plurality of LEDs 2803, and a variable constant current source 2901. The main switch 2903 e may be controlled to switch on / off the switch. That is, as described with reference to FIG. 30, the lighting control unit 2911 is a switch connected in parallel to each of the plurality of LEDs 2803 according to the lighting pattern after the voltage supplied by the variable power supply is sufficiently high. , And the main switch 2903e may be switched on to light any one of the plurality of LEDs 2803 according to the lighting pattern. This will achieve high response of lighting and improved power efficiency. The lighting control unit 2911 may control the voltage of the variable power supply 2900 according to the voltage value fed back from the variable constant current source 2901 so that an overvoltage is not applied to the variable constant current source 2901. This will allow the variable constant current source 2901 to be protected from over voltage.

図2などを用いて説明したように、照明装置3は、それぞれ光量が等しい光源のペアを少なくとも2つ含んでいる。図2においては、照明光L1と照明光L2とはそれぞれ光量が等しく、照明方向も180度異なっており、ペアを構成している。同様に、照明光L3と照明光L4とはそれぞれ光量が等しく、照明方向も180度異なっており、ペアを構成している。このように少なくとも2つの光源ペアを用意することで、精度よく、ワークの各表面の法線ベクトルや反射率を算出できるようになる。図30などを用いて説明した点灯パターンについてもこのような光源ペアが形成されている。たとえば、点灯パターンP1、P3、P5、P6では2つの光源ペアが設けられており、点灯パターンP2、P4では4つの光源ペアが設けられている。   As described with reference to FIG. 2 and the like, the lighting device 3 includes at least two pairs of light sources each having the same light amount. In FIG. 2, the illumination light L1 and the illumination light L2 have equal light amounts, and the illumination directions are also different by 180 degrees to form a pair. Similarly, the illumination light L3 and the illumination light L4 have equal amounts of light, and the illumination directions are also different by 180 degrees to form a pair. By preparing at least two light source pairs in this manner, it is possible to accurately calculate the normal vector and the reflectance of each surface of the workpiece. Such a light source pair is formed also for the lighting pattern described using FIG. For example, two light source pairs are provided in the lighting patterns P1, P3, P5, and P6, and four light source pairs are provided in the lighting patterns P2 and P4.

1…ライン、2…ワーク、3…照明装置、4…カメラ、5…画像処理装置、6…入力部、7…表示部   DESCRIPTION OF SYMBOLS 1 ... Line, 2 ... Work, 3 ... Lighting apparatus, 4 ... Camera, 5 ... Image processing apparatus, 6 ... Input part, 7 ... Display part

本発明によれば、たとえば、
検査対象物を撮像する撮像手段と、
前記撮像手段とは個別に設けられた略環状の筐体に収容され、3つ以上の異なる複数の照明方向から検査対象物に光を個別に照射する複数の光源を有する照明手段と、
前記複数の光源の点灯開始位置を示す情報に基づいて最初に点灯すべき光源を点灯させてから、前記複数の照明方向について順番に対応する光源を点灯させることで照明方向を切り替える制御手段と、
前記撮像手段により取得された複数の輝度画像をフォトメトリックステレオ法により合成して、検査対象物の表面の形状または反射率に応じた複数の画素値を有する検査画像を生成する検査画像生成手段と、
前記検査画像を用いて前記検査対象物の良否を判定する判定手段と、
前記複数の輝度画像の実際の照明方向と、予め想定されている照明方向とを一致させるために、前記点灯開始位置の調整を受け付ける設定手段と、
を有することを特徴とする検査装置が提供される。
According to the invention, for example
Imaging means for imaging an inspection object;
Illumination means having a plurality of light sources individually housed in a substantially annular casing provided separately from the imaging means and individually illuminating the inspection object from three or more different illumination directions;
Control means for switching the illumination direction by lighting the light sources corresponding to the plurality of illumination directions in turn after lighting the light sources to be lit first based on the information indicating the lighting start position of the plurality of light sources ;
Inspection image generation means for synthesizing a plurality of luminance images acquired by the imaging means by photometric stereo method to generate an inspection image having a plurality of pixel values according to the shape or reflectance of the surface of the inspection object ,
A determination unit that determines the quality of the inspection object using the inspection image;
Setting means for receiving the adjustment of the lighting start position in order to match the actual illumination direction of the plurality of luminance images with the illumination direction assumed in advance;
An inspection apparatus is provided, characterized in that

Claims (17)

検査対象物を撮像する撮像手段と、
略環状に配置された複数の光源と、前記複数の光源の点灯パターンを記憶した記憶部と、前記記憶部に記憶された点灯パターンであって信号線を介して受信した制御信号によって特定される点灯パターンにしたがって前記複数の光源を点灯させる点灯制御部とを有し、前記撮像手段とは独立して移動することで前記検査対象物に対する距離を調整する照明手段と、
前記撮像手段により取得された複数の輝度画像をフォトメトリックステレオ法により合成して、当該検査対象物の表面の傾きまたは反射率に応じた複数の画素値を有する検査画像を生成する検査画像生成手段と、
前記検査画像を用いて前記検査対象物の良否を判定する判定手段と
を有することを特徴とする検査装置。
Imaging means for imaging an inspection object;
A plurality of light sources arranged in a substantially annular shape, a storage unit storing the lighting patterns of the plurality of light sources, and a lighting pattern stored in the storage unit, specified by a control signal received via a signal line A lighting control unit for lighting the plurality of light sources according to a lighting pattern, and illumination means for adjusting a distance to the inspection object by moving independently of the imaging means;
An inspection image generation unit that combines a plurality of luminance images acquired by the imaging unit according to a photometric stereo method, and generates an inspection image having a plurality of pixel values according to the inclination or reflectance of the surface of the inspection object When,
And a determination unit that determines the quality of the inspection object using the inspection image.
前記点灯パターンは、フォトメトリックステレオ法にしたがった点灯パターンであることを特徴とする請求項1に記載の検査装置。   The inspection apparatus according to claim 1, wherein the lighting pattern is a lighting pattern according to a photometric stereo method. 前記照明手段はさらに通信部を有し、
前記照明手段の前記制御部は前記通信部により受信した情報に対応する点灯パターンを前記記憶部から読み出して使用することを特徴とする請求項1または2に記載の検査装置。
The lighting means further comprises a communication unit,
The inspection apparatus according to claim 1, wherein the control unit of the illumination unit reads out a lighting pattern corresponding to the information received by the communication unit from the storage unit and uses the lighting pattern.
前記点灯パターンには、前記複数の光源のうち1回の点灯タイミングで同時に点灯する光源の識別情報が含まれていることを特徴とする請求項1ないし3のいずれか1項に記載の検査装置。   The inspection apparatus according to any one of claims 1 to 3, wherein the lighting pattern includes identification information of a light source which is simultaneously lighted at one lighting timing among the plurality of light sources. . 前記点灯パターンには、前記複数の光源の点灯順序を示す情報が含まれていることを特徴とする請求項1ないし3のいずれか1項に記載の検査装置。   The inspection apparatus according to any one of claims 1 to 3, wherein the lighting pattern includes information indicating a lighting order of the plurality of light sources. 前記記憶部は、それぞれ同時に点灯する光源の数が異なる複数の点灯パターンを記憶していることを特徴とする請求項1ないし5のいずれか1項に記載の検査装置。   The inspection apparatus according to any one of claims 1 to 5, wherein the storage unit stores a plurality of lighting patterns different in the number of light sources to be lighted simultaneously. 前記記憶部は、それぞれ照明方向の数が異なる複数の点灯パターンを記憶していることを特徴とする請求項1ないし6のいずれか1項に記載の検査装置。   The inspection apparatus according to any one of claims 1 to 6, wherein the storage unit stores a plurality of lighting patterns each having a different number of illumination directions. 前記記憶部は、それぞれ4方向から順番に前記検査対象物を照明する複数の点灯パターンを記憶していることを特徴とする請求項1ないし7のいずれか1項に記載の検査装置。   The inspection apparatus according to any one of claims 1 to 7, wherein the storage unit stores a plurality of lighting patterns for illuminating the inspection object in order from four directions. 前記記憶部は、8方向から順番に前記検査対象物を照明する点灯パターンを記憶していることを特徴とする請求項1ないし8のいずれか1項に記載の検査装置。   The inspection apparatus according to any one of claims 1 to 8, wherein the storage unit stores a lighting pattern for illuminating the inspection object in order from eight directions. 前記記憶部は、前記複数の光源のすべてを同時に点灯させる点灯パターンを記憶していることを特徴とする請求項1ないし9のいずれか1項に記載の検査装置。   The inspection apparatus according to any one of claims 1 to 9, wherein the storage unit stores a lighting pattern for lighting all of the plurality of light sources simultaneously. 第1タイミングにおいて前記複数の光源のすべてを同時に点灯させて前記撮像手段に第1の輝度画像を取得させ、第Nタイミングにおいて前記複数の光源のすべてを同時に点灯させて前記撮像手段に第2の輝度画像を取得させ、前記第1の輝度画像と前記第2の輝度画像とから前記検査対象物の移動量を推定する推定手段をさらに有し、
前記第1タイミングから前記第Nタイミングまでの間に存在する各タイミングにおいてフォトメトリックステレオ法にしたがって前記複数の光源のいずれかが点灯することを特徴とする請求項10に記載の検査装置。
At the first timing, all of the plurality of light sources are turned on simultaneously to cause the imaging unit to acquire the first luminance image, and at the Nth timing, all of the plurality of light sources are simultaneously turned on to cause the imaging unit to The image processing apparatus further comprises estimation means for acquiring a luminance image and estimating a movement amount of the inspection object from the first luminance image and the second luminance image.
The inspection apparatus according to claim 10, wherein any one of the plurality of light sources is turned on according to a photometric stereo method at each timing existing between the first timing and the Nth timing.
前記複数の光源は、所定数の光源ごとに光源グループを形成しており、各光源グループにおいて所定数の光源が直列に接続されており、
前記制御部は、前記点灯パターンに応じて定電流源を制御して各光源グループに電流を供給するとともに、前記定電流源に印加される電圧に応じて前記光源グループに電圧を供給する可変電源の出力電圧を調整することを特徴とする請求項1ないし11のいずれか1項に記載の検査装置。
The plurality of light sources form a light source group for each predetermined number of light sources, and a predetermined number of light sources are connected in series in each light source group,
The control unit controls a constant current source according to the lighting pattern to supply current to each light source group, and a variable power supply which supplies voltage to the light source group according to a voltage applied to the constant current source The inspection apparatus according to any one of claims 1 to 11, wherein the output voltage of the sensor is adjusted.
前記所定数の光源のそれぞれには並列にスイッチが接続されており、前記制御部は、当該スイッチを制御することで前記所定数の光源のそれぞれの消灯と点灯とを切り替えることを特徴とする請求項12に記載の検査装置。   A switch is connected in parallel to each of the predetermined number of light sources, and the control unit controls switching of the switches to switch on and off each of the predetermined number of light sources. An inspection device according to Item 12. 前記検査対象物の輝度画像を表示する表示手段と、
前記点灯パターンにおける点灯すべき光源を変更することで照明方向を調整する調整手段と
をさらに有することを特徴とする請求項1ないし12のいずれか1項に記載の検査装置。
Display means for displaying a luminance image of the inspection object;
The inspection apparatus according to any one of claims 1 to 12, further comprising: an adjusting unit configured to adjust an illumination direction by changing a light source to be lit in the lighting pattern.
前記表示手段は、前記検査対象物の輝度画像と、当該輝度画像を取得したときに適用された照明方向を示すアイコンとを同時に表示することを特徴とする請求項14に記載の検査装置。   The inspection apparatus according to claim 14, wherein the display unit simultaneously displays a luminance image of the inspection object and an icon indicating an illumination direction applied when the luminance image is acquired. 前記調整手段により点灯すべき光源が変更されると、前記表示手段は前記輝度画像を更新して表示することを特徴とする請求項14または15に記載の検査装置。   16. The inspection apparatus according to claim 14, wherein when the light source to be lit is changed by the adjustment unit, the display unit updates and displays the luminance image. 前記複数の光源は、それぞれ光量が等しい光源のペアを少なくとも2つ含むことを特徴とする請求項1ないし16のいずれか1項に記載の検査装置。   The inspection apparatus according to any one of claims 1 to 16, wherein the plurality of light sources include at least two pairs of light sources each having the same light amount.
JP2019013332A 2019-01-29 2019-01-29 Inspection device Active JP6638098B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2019013332A JP6638098B2 (en) 2019-01-29 2019-01-29 Inspection device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2019013332A JP6638098B2 (en) 2019-01-29 2019-01-29 Inspection device

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2018005771A Division JP6475875B2 (en) 2018-01-17 2018-01-17 Inspection device

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2019231949A Division JP2020042053A (en) 2019-12-23 2019-12-23 Image inspection device and image inspection method

Publications (2)

Publication Number Publication Date
JP2019060903A true JP2019060903A (en) 2019-04-18
JP6638098B2 JP6638098B2 (en) 2020-01-29

Family

ID=66177275

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019013332A Active JP6638098B2 (en) 2019-01-29 2019-01-29 Inspection device

Country Status (1)

Country Link
JP (1) JP6638098B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110609039A (en) * 2019-09-23 2019-12-24 上海御微半导体技术有限公司 An optical detection device and method thereof
WO2022259472A1 (en) * 2021-06-10 2022-12-15 日本電信電話株式会社 Deterioration degree determination device, deterioration degree determination method, and program

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001153808A (en) * 1999-11-30 2001-06-08 Ccs Kk Power supply for controlling lighting device
JP2002310935A (en) * 2001-04-19 2002-10-23 Murata Mfg Co Ltd Method and apparatus for extraction of illumination condition and visual inspection system
JP2005214720A (en) * 2004-01-28 2005-08-11 Fuji Photo Film Co Ltd Surface inspection device and surface inspection method
JP2006058170A (en) * 2004-08-20 2006-03-02 Dainippon Screen Mfg Co Ltd Visual confirmation device and inspection system
US20060072319A1 (en) * 2004-10-05 2006-04-06 Dziekan Michael E Method of using light emitting diodes for illumination sensing and using ultra-violet light sources for white light illumination
JP2007206797A (en) * 2006-01-31 2007-08-16 Omron Corp Image processing method and image processing apparatus
JP2012122870A (en) * 2010-12-09 2012-06-28 Juki Corp Three-dimensional shape recognition apparatus
JP2013186100A (en) * 2012-03-12 2013-09-19 Hitachi Ltd Shape inspection method and device
US20140002609A1 (en) * 2012-06-29 2014-01-02 Samsung Electronics Co., Ltd. Apparatus and method for generating depth image using transition of light source
JP2014009970A (en) * 2012-06-27 2014-01-20 Sumitomo Metal Mining Co Ltd Surface flaw inspection device and surface flaw inspection method

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001153808A (en) * 1999-11-30 2001-06-08 Ccs Kk Power supply for controlling lighting device
JP2002310935A (en) * 2001-04-19 2002-10-23 Murata Mfg Co Ltd Method and apparatus for extraction of illumination condition and visual inspection system
JP2005214720A (en) * 2004-01-28 2005-08-11 Fuji Photo Film Co Ltd Surface inspection device and surface inspection method
JP2006058170A (en) * 2004-08-20 2006-03-02 Dainippon Screen Mfg Co Ltd Visual confirmation device and inspection system
US20060072319A1 (en) * 2004-10-05 2006-04-06 Dziekan Michael E Method of using light emitting diodes for illumination sensing and using ultra-violet light sources for white light illumination
JP2007206797A (en) * 2006-01-31 2007-08-16 Omron Corp Image processing method and image processing apparatus
JP2012122870A (en) * 2010-12-09 2012-06-28 Juki Corp Three-dimensional shape recognition apparatus
JP2013186100A (en) * 2012-03-12 2013-09-19 Hitachi Ltd Shape inspection method and device
JP2014009970A (en) * 2012-06-27 2014-01-20 Sumitomo Metal Mining Co Ltd Surface flaw inspection device and surface flaw inspection method
US20140002609A1 (en) * 2012-06-29 2014-01-02 Samsung Electronics Co., Ltd. Apparatus and method for generating depth image using transition of light source

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110609039A (en) * 2019-09-23 2019-12-24 上海御微半导体技术有限公司 An optical detection device and method thereof
CN110609039B (en) * 2019-09-23 2021-09-28 上海御微半导体技术有限公司 Optical detection device and method thereof
WO2022259472A1 (en) * 2021-06-10 2022-12-15 日本電信電話株式会社 Deterioration degree determination device, deterioration degree determination method, and program
JP7574924B2 (en) 2021-06-10 2024-10-29 日本電信電話株式会社 Deterioration level determination device, deterioration level determination method, and program

Also Published As

Publication number Publication date
JP6638098B2 (en) 2020-01-29

Similar Documents

Publication Publication Date Title
JP6403445B2 (en) Inspection device, inspection method, and program
JP6290720B2 (en) Inspection device, inspection method, and program
JP6470506B2 (en) Inspection device
JP6857079B2 (en) Image inspection equipment
JP6278842B2 (en) Inspection device, inspection method, and program
JP6280451B2 (en) Inspection device
JP6405124B2 (en) Inspection device, inspection method, and program
JP6585793B2 (en) Inspection device, inspection method, and program
JP2020042053A (en) Image inspection device and image inspection method
JP6638098B2 (en) Inspection device
JP6395455B2 (en) Inspection device, inspection method, and program
JP6475875B2 (en) Inspection device
JP6825067B2 (en) Inspection equipment and its control method
JP6620215B2 (en) Inspection device
JP6864722B2 (en) Inspection equipment, inspection methods and programs

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20190129

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20190204

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20191121

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20191129

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20191223

R150 Certificate of patent or registration of utility model

Ref document number: 6638098

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250