[go: up one dir, main page]

JP6893826B2 - Image inspection equipment - Google Patents

Image inspection equipment Download PDF

Info

Publication number
JP6893826B2
JP6893826B2 JP2017093360A JP2017093360A JP6893826B2 JP 6893826 B2 JP6893826 B2 JP 6893826B2 JP 2017093360 A JP2017093360 A JP 2017093360A JP 2017093360 A JP2017093360 A JP 2017093360A JP 6893826 B2 JP6893826 B2 JP 6893826B2
Authority
JP
Japan
Prior art keywords
color
image
unit
foreground
designation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2017093360A
Other languages
Japanese (ja)
Other versions
JP2018189562A (en
Inventor
孫卓力
木戸学
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Keyence Corp
Original Assignee
Keyence Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Keyence Corp filed Critical Keyence Corp
Priority to JP2017093360A priority Critical patent/JP6893826B2/en
Publication of JP2018189562A publication Critical patent/JP2018189562A/en
Priority to JP2021091445A priority patent/JP7117420B2/en
Application granted granted Critical
Publication of JP6893826B2 publication Critical patent/JP6893826B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Description

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

商品(ワーク)が設計通りに生産されたかどうかを判定するためにワークを撮像して得られた画像を検査する画像検査装置は非常に有用である。このような画像検査ではワークの形状や寸法、色などが検査される。特許文献1によれば印刷物などの検査対象物を撮像して色情報を取得し、高精度に色検査を実行する色検査装置が提案されている。 An image inspection device that inspects the image obtained by imaging the work in order to determine whether the product (work) is produced as designed is very useful. In such an image inspection, the shape, dimensions, color, etc. of the work are inspected. According to Patent Document 1, a color inspection apparatus that captures an image of an inspection object such as a printed matter, acquires color information, and executes a color inspection with high accuracy has been proposed.

特開平09−126890号公報Japanese Unexamined Patent Publication No. 09-126890

色検査装置などの画像検査装置で、ユーザは、表示装置に表示されたカラー画像において抽出対象となる色をクリックするなどして選択する。ユーザの選択を容易にするために画像検査装置はスポイトツールなどを提供していることもある。画像検査装置は、スポイトツールにより選択された色とカラー画像における各画素の色との距離に応じてカラー画像をグレー画像(濃淡画像)に変換し、グレー画像を用いてワークの画像検査を実行することがある。また、画像検査装置は、ワークの表面のうち画像検査の対象となる特徴を含む前景領域と、このような特徴を含まない背景領域とのユーザによる指定を受け付けてそれぞれ色を抽出してもよい。これらの場合、ユーザが選択した一つの画素の色が抽出色となるため、ユーザが指定した画素に依存してグレー画像が異なってしまい、画像検査の結果にばらつきが生じてしまう。そこで、本発明は、抽出色の指定に関するユーザの負担を軽減することで、画像検査の結果のばらつきを小さくすることを目的とする。 In an image inspection device such as a color inspection device, a user selects a color to be extracted by clicking on a color to be extracted in a color image displayed on the display device. The image inspection device may provide a dropper tool or the like to facilitate the user's selection. The image inspection device converts a color image into a gray image (shade image) according to the distance between the color selected by the drop tool and the color of each pixel in the color image, and executes an image inspection of the work using the gray image. I have something to do. Further, the image inspection device may extract colors by accepting the user's designation of the foreground area including the feature to be image-inspected and the background area not including such the feature on the surface of the work. .. In these cases, since the color of one pixel selected by the user is the extraction color, the gray image differs depending on the pixel specified by the user, and the result of the image inspection varies. Therefore, an object of the present invention is to reduce the variation in the results of image inspection by reducing the burden on the user regarding the designation of the extraction color.

本発明の画像検査装置は、たとえば、
検査対象物についての分光画像を取得する取得部と、
前記取得部により取得された分光画像を表示する表示部と、
前記表示部に表示された分光画像において複数の画素を含む領域の指定を受け付ける領域指定部と、
前記領域指定部により指定された各領域に含まれる複数の画素の色空間座標における位置に応じて、前記分光画像を構成する各画素を、複数のクラスタのうちのいずれかのクラスタに所属させるクラスタリング部と、
前記複数のクラスタのそれぞれについて代表色を決定し、前記分光画像を構成する各画素の色を、各画素が属するクラスタの代表色に変換することでフォルスカラー画像を生成するフォルスカラー画像生成部と、
前記表示部に表示されたフォルスカラー画像において抽出対象となる抽出色の指定を受け付ける抽出色指定部と、
前記分光画像の各画素の色と前記抽出色との色空間内での距離に基づいて前記分光画像をグレー画像に変換する変換部と、
前記変換部により生成されたグレー画像を用いて画像検査を実行する検査部と
を有することを特徴とする。
The image inspection apparatus of the present invention is, for example,
An acquisition unit that acquires a spectroscopic image of the object to be inspected,
A display unit that displays the spectroscopic image acquired by the acquisition unit, and
An area designation unit that accepts designation of a region including a plurality of pixels in the spectroscopic image displayed on the display unit, and
Clustering in which each pixel constituting the spectroscopic image belongs to one of a plurality of clusters according to the position in the color space coordinates of a plurality of pixels included in each region designated by the region designation unit. Department and
A false color image generator that generates a false color image by determining a representative color for each of the plurality of clusters and converting the color of each pixel constituting the spectral image into a representative color of the cluster to which each pixel belongs. ,
An extraction color specification unit that accepts the specification of the extraction color to be extracted in the false color image displayed on the display unit, and
A conversion unit that converts the spectroscopic image into a gray image based on the distance between the color of each pixel of the spectroscopic image and the extracted color in the color space.
It is characterized by having an inspection unit that executes an image inspection using the gray image generated by the conversion unit.

本発明によれば、抽出色の指定に関するユーザの負担が軽減され、画像検査の結果のばらつきも小さくなる。 According to the present invention, the burden on the user regarding the designation of the extraction color is reduced, and the variation in the result of the image inspection is also reduced.

画像検査装置を示す図The figure which shows the image inspection apparatus 照明装置を示す図Diagram showing a lighting device 照明装置を構成する部品を示す図Diagram showing the parts that make up the lighting device 照明装置の電気的な構成を示す図Diagram showing the electrical configuration of a lighting device 画像処理システムの機能を示す図Diagram showing the function of the image processing system マルチスペクトルイメージングにおけるカラー濃淡変換の原理を示す図Diagram showing the principle of color shading conversion in multispectral imaging 自由形状の指定による色抽出手法を示す図The figure which shows the color extraction method by specifying a free shape クラスタ化領域の設定を補助するUIを示す図Diagram showing the UI that assists in setting the clustered area クラスタ化領域の設定を補助するUIを示す図Diagram showing the UI that assists in setting the clustered area 抽出色の指定を補助するUIを示す図Diagram showing the UI that assists in specifying the extraction color 抽出色の調整を補助するUIを示す図Diagram showing the UI that assists in adjusting the extraction color 抽出色の調整を補助するUIを示す図Diagram showing the UI that assists in adjusting the extraction color 抽出色の調整を補助するUIを示す図Diagram showing the UI that assists in adjusting the extraction color 色抽出処理を含む画像検査を示すフローチャートFlowchart showing image inspection including color extraction process 画像処理システムの機能を示す図Diagram showing the function of the image processing system 画像処理システムの機能を示す図Diagram showing the function of the image processing system 画像処理システムの機能を示す図Diagram showing the function of the image processing system

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

図1は外観検査システム(画像検査装置8)の一例を示す図である。ライン1は検査対象物であるワーク2を搬送する搬送ベルトなどである。照明装置3は互いに異なる波長の検査光(照明光)を発生する複数の発光素子を有し、各波長の照明光を個別に対象物に照射する照明部の一例である。なお、複数の方向から同時または順番に照明光をワーク2に対して照射するために、複数の同一波長の発光素子が設けられてもよい。カメラ4は照明光により照明された検査対象物からの反射光を受光して輝度画像(分光画像)を生成する撮像手段の一例である。画像処理装置5は、各波長について設定された照明強度で発光素子を順番に点灯させることで画像検査の対象となる検査対象物を照明し、撮像部により取得された複数の検査画像を用いて画像検査を実行する検査部を有する。表示部7は検査に関連する制御パラメータを設定するためのユーザインタフェースや検査画像などを表示する表示装置である。入力部6は、コンソール、ポインティングデバイス、キーボードなどであり、制御パラメータを設定するために使用される。 FIG. 1 is a diagram showing an example of an appearance inspection system (image inspection device 8). The line 1 is a transport belt or the like that conveys the work 2 which is an inspection target. The illuminating device 3 is an example of an illuminating unit that has a plurality of light emitting elements that generate inspection light (illumination light) having different wavelengths and individually irradiates an object with illumination light of each wavelength. In order to irradiate the work 2 with illumination light simultaneously or sequentially from a plurality of directions, a plurality of light emitting elements having the same wavelength may be provided. The camera 4 is an example of an imaging means that receives reflected light from an inspection object illuminated by illumination light and generates a luminance image (spectral image). The image processing device 5 illuminates the inspection object to be inspected by sequentially lighting the light emitting elements with the illumination intensity set for each wavelength, and uses a plurality of inspection images acquired by the imaging unit. It has an inspection unit that performs image inspection. The display unit 7 is a display device that displays a user interface for setting control parameters related to inspection, an inspection image, and the like. The input unit 6 is a console, a pointing device, a keyboard, or the like, and is used for setting control parameters.

<照明装置の構成>
図2(A)は照明装置3の斜視図である。図2(B)は照明装置3の上面図である。図2(C)は照明装置3の底面図である。図2(D)は照明装置3の側面図である。照明装置3の筐体は上ケース21と下ケース22を有している。下ケース22の下部には複数の光源(LEDなどの発光素子)のそれぞれが出力する光を拡散させる光拡散部材23が配置されている。図2(A)や図2(C)が示すように上ケース21や下ケース22と同様に光拡散部材23も円環状を成している。図2(B)や図2(D)が示すように上ケース21の上面にはコネクタ24が設けられている。コネクタ24には照明装置3に格納されている照明制御基板と画像処理装置5とが通信するためのケーブルが接続される。照明制御基板に実装される一部の機能は照明装置3の外部に照明コントローラとして設けられていてもよい。つまり、照明装置3と画像処理装置5との間には照明コントローラが介在してもよい。
<Construction of lighting device>
FIG. 2A is a perspective view of the lighting device 3. FIG. 2B is a top view of the lighting device 3. FIG. 2C is a bottom view of the lighting device 3. FIG. 2D is a side view of the lighting device 3. The housing of the lighting device 3 has an upper case 21 and a lower case 22. A light diffusing member 23 for diffusing the light output by each of the plurality of light sources (light emitting elements such as LEDs) is arranged in the lower part of the lower case 22. As shown in FIGS. 2A and 2C, the light diffusing member 23 also has an annular shape like the upper case 21 and the lower case 22. As shown in FIGS. 2B and 2D, a connector 24 is provided on the upper surface of the upper case 21. A cable for communicating between the lighting control board stored in the lighting device 3 and the image processing device 5 is connected to the connector 24. Some functions mounted on the lighting control board may be provided as a lighting controller outside the lighting device 3. That is, a lighting controller may be interposed between the lighting device 3 and the image processing device 5.

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

制御基板31には照明制御基板やコネクタ24が配置されている。光源群を構成するLEDなどの発光素子はLED基板32に搭載されている。図3(B)が示すように、本実施例では四方向から照明光を照射するために四つのLED基板32が設けられている。つまり、一つのLED基板32が一つの照明ブロックを形成している。四方向から照明光を照射可能とすることでフォトメトリックステレオ用の画像を取得できるようになる。つまり、照明装置3はマルチスペクトルイメージング(MSI)だけでなく、フォトメトリックステレオのために利用されてもよい。一つのLED基板32には四つのLED33が配置されている場合、光源群は16個の発光素子により構成される。ただし、より多数の発光素子が設けられてもよい。たとえば、一つのLED基板32には8つのLED33が配置されており、8つのLED33が発光する光の波長はいずれも異なっていてもよい。図3(C)、図3(D)および図3(E)が示すように、複数のLED33のうち隣り合った二つのLED33の間には遮光部材35が配置されている。多数のLED33を密接に配置すると、隣り合った二つのLED33からそれぞれ照射される照明光が光拡散部材23の同一の領域を通過することがある。この場合、点灯パターンに応じて一方のLED33を非点灯とし、かつ、他方のLED33を点灯した場合と、他方のLED33を非点灯とし、かつ、一方のLED33を点灯した場合とで、ワーク2の表面には同一の照明方向から同一の光量で照明光が照射されてしまう。これでは高い精度で検査画像を生成することが難しくなる。そこで、隣り合った二つのLED33の間に遮光部材35を配置することで、隣り合った二つのLED33について光量の均一性と光源の独立性とのバランスを取っている。図3(C)が示すようにLED33の光の射出方向A1と、主な照明方向A2とは一致していない。そこで、反射鏡34を配置することでLED33から射出される光を光拡散部材23の方向へ偏向している。これによりLED33が発光した光を効率よくワーク2へ照射できるようになろう。この例では射出方向A1と反射鏡34の反射方向とが概ね直交しているが、これは光拡散部材23の断面形状が円弧を成しており(図3(C))、円弧に関する角度(中心角)が約90度になっているからである。このように中心角を大きくすることで、照明装置3をワーク2に対して遠ざけたり、近づけたりしてもワーク2の表面に対してほぼ均一な平行光を照射しやすくなる。以上の図面によれば、複数のLED33が、ある円周上に並べられているが、半径の異なる別の円周上にも複数のLED33が配置されていてもよい。これにより、波長ごとのLED33の数が増えるため、照明光量を増加させることが可能となる。また、第一の円周上にはマルチスペクトルイメージング用のLED33が配置され、第二の円周上には白色LEDが配置されていてもよい。第一の円周の半径と第二の円周の半径とは異なっている。 A lighting control board and a connector 24 are arranged on the control board 31. A light emitting element such as an LED that constitutes a light source group is mounted on the LED substrate 32. As shown in FIG. 3B, in this embodiment, four LED substrates 32 are provided to irradiate the illumination light from four directions. That is, one LED substrate 32 forms one lighting block. By making it possible to irradiate illumination light from four directions, it becomes possible to acquire an image for photometric stereo. That is, the illuminator 3 may be used for photometric stereo as well as multispectral imaging (MSI). When four LEDs 33 are arranged on one LED substrate 32, the light source group is composed of 16 light emitting elements. However, a larger number of light emitting elements may be provided. For example, eight LEDs 33 are arranged on one LED substrate 32, and the wavelengths of the light emitted by the eight LEDs 33 may be different from each other. As shown in FIGS. 3 (C), 3 (D) and 3 (E), a light-shielding member 35 is arranged between two adjacent LEDs 33 among the plurality of LEDs 33. When a large number of LEDs 33 are closely arranged, the illumination light emitted from each of the two adjacent LEDs 33 may pass through the same region of the light diffusing member 23. In this case, one LED 33 is not lit and the other LED 33 is lit according to the lighting pattern, and the other LED 33 is not lit and one LED 33 is lit. The surface is irradiated with illumination light from the same illumination direction with the same amount of light. This makes it difficult to generate an inspection image with high accuracy. Therefore, by arranging the light-shielding member 35 between the two adjacent LEDs 33, the uniformity of the amount of light and the independence of the light source are balanced for the two adjacent LEDs 33. As shown in FIG. 3C, the light emission direction A1 of the LED 33 and the main illumination direction A2 do not match. Therefore, by arranging the reflecting mirror 34, the light emitted from the LED 33 is deflected toward the light diffusing member 23. As a result, the light emitted by the LED 33 can be efficiently applied to the work 2. In this example, the emission direction A1 and the reflection direction of the reflector 34 are substantially orthogonal to each other, but this is because the cross-sectional shape of the light diffusing member 23 forms an arc (FIG. 3C), and the angle with respect to the arc (FIG. 3C) This is because the central angle) is about 90 degrees. By increasing the central angle in this way, it becomes easy to irradiate the surface of the work 2 with substantially uniform parallel light even if the lighting device 3 is moved away from or closer to the work 2. According to the above drawings, a plurality of LED 33s are arranged on a certain circumference, but a plurality of LED 33s may be arranged on another circumference having a different radius. As a result, the number of LEDs 33 for each wavelength increases, so that the amount of illumination light can be increased. Further, the LED 33 for multispectral imaging may be arranged on the first circumference, and the white LED may be arranged on the second circumference. The radius of the first circumference and the radius of the second circumference are different.

<照明装置の回路構成>
図4は照明装置3の回路構成の一例を示している。この例では光源群を構成する四つの照明ブロックのうち一つの照明ブロックを示している。四つのLED33a〜LED33dは直列に接続されている。電圧が可変の可変電源41は照明制御基板40によって指定される電圧値(例:2V〜20V)の電圧を生成して出力する。可変定電流源42は、照明制御基板40によって指定される電流値(例:0A〜1A)となるように照明ブロックに流れる電流を調整する。このような電流制御方式を採用することでリニアリティの高い調光を実現しやすくなる。また、可変定電流源42は、可変定電流源42に印加されている電圧の値を検出して照明制御基板40にフィードバックし、過電圧から可変定電流源42を保護している。LED33a〜LED33dのそれぞれには並列にスイッチ43a〜スイッチ43dが接続されている。照明制御基板40の点灯制御部45はこれらのスイッチ43a〜スイッチ43dを個別に開閉させることで、LED33a〜LED33dのそれぞれを個別に点灯と非点灯とを切り替えることができる。このように、LED33a〜LED33dのそれぞれに並列にスイッチ43a〜スイッチ43dを接続することで、LED33a〜LED33dのいずれか一つを点灯させたり、すべてを点灯させたりするといった個別点灯が可能となる。これは様々な点灯パターンを実現するのに役立っている。なお、点灯制御部45は可変定電流源42とグランドとの間に挿入されたメインスイッチ43eのオン/オフを切り替えることで一つの照明ブロック単位での点灯制御を実行する。通信部44は点灯パターンを指示する制御信号や点灯の開始を指示するトリガー信号を画像処理装置5の照明制御部から受信し、点灯制御部45に渡す。点灯制御部45は、制御信号に対応する点灯パターンデータ47を記憶部46から読み出し、点灯パターンデータ47に従ってスイッチ43a〜スイッチ43dを制御する。なお、一つの照明ブロックが8つのLED33により構成される場合、8個のスイッチ43が設けられ、8個のスイッチ43は点灯制御部45によって制御される。8つのLED33は、たとえば、UVからIR2までの8つの波長に対応している。UVは紫外線波長の照明光により取得された分光画像を示している。Bは青波長の照明光により取得された分光画像を示している。Gは緑波長の照明光により取得された分光画像を示している。AMはアンバー波長の照明光により取得された分光画像を示している。ORはオレンジ波長の照明光により取得された分光画像を示している。Rは赤波長の照明光により取得された分光画像を示している。IR1、IR2はそれぞれ赤外波長の照明光により取得された分光画像を示している。ただし、IR1の波長はIR2の波長よりも短い。
<Circuit configuration of lighting device>
FIG. 4 shows an example of the circuit configuration of the lighting device 3. In this example, one of the four lighting blocks constituting the light source group is shown. The four LEDs 33a to 33d are connected in series. The variable power supply 41 having a variable voltage generates and outputs a voltage having a voltage value (eg, 2V to 20V) specified by the lighting control board 40. The variable constant current source 42 adjusts the current flowing through the lighting block so as to have a current value (eg, 0A to 1A) specified by the lighting control board 40. By adopting such a current control method, it becomes easy to realize dimming with high linearity. Further, the variable constant current source 42 detects the value of the voltage applied to the variable constant current source 42 and feeds it back to the illumination control board 40 to protect the variable constant current source 42 from overvoltage. Switches 43a to 43d are connected in parallel to each of the LEDs 33a to 33d. By opening and closing these switches 43a to 43d individually, the lighting control unit 45 of the lighting control board 40 can individually switch between lighting and non-lighting of each of the LEDs 33a to 33d. By connecting the switches 43a to 43d in parallel to each of the LEDs 33a to 33d in this way, individual lighting such as lighting any one of the LEDs 33a to LED33d or lighting all of them becomes possible. This helps to realize various lighting patterns. The lighting control unit 45 executes lighting control in units of one lighting block by switching on / off of the main switch 43e inserted between the variable constant current source 42 and the ground. The communication unit 44 receives a control signal instructing the lighting pattern and a trigger signal instructing the start of lighting from the lighting control unit of the image processing device 5, and passes the control signal to the lighting control unit 45. The lighting control unit 45 reads the lighting pattern data 47 corresponding to the control signal from the storage unit 46, and controls the switches 43a to 43d according to the lighting pattern data 47. When one lighting block is composed of eight LEDs 33, eight switches 43 are provided, and the eight switches 43 are controlled by the lighting control unit 45. The eight LEDs 33 correspond to, for example, eight wavelengths from UV to IR2. UV indicates a spectroscopic image acquired by illumination light having an ultraviolet wavelength. B shows a spectroscopic image acquired by illumination light having a blue wavelength. G indicates a spectroscopic image acquired by illumination light having a green wavelength. AM shows a spectroscopic image acquired by illumination light of amber wavelength. OR indicates a spectroscopic image acquired by illumination light of orange wavelength. R indicates a spectroscopic image acquired by illumination light having a red wavelength. IR1 and IR2 show spectroscopic images acquired by illumination light having an infrared wavelength, respectively. However, the wavelength of IR1 is shorter than the wavelength of IR2.

<機能ブロック>
図5は検査装置のブロック図である。この例では照明装置3、カメラ4および画像処理装置5がそれぞれ個別の筐体に収容されているが、これは一例に過ぎず、適宜に一体化されてもよい。照明装置3は、マルチスペクトルイメージングを実現する照明装置であるが、フォトメトリックステレオ法に従って検査対象物を照明する照明手段として利用されてもよい。照明装置3は光源群501とこれを制御する照明制御基板40を備えている。すでに図3に示したように、複数の発光素子で一つの照明ブロックが構成され、さらに複数の照明ブロックによって光源群501が構成されていてもよい。照明ブロックの数は一般的には四つであるが、三つ以上であればよい。これは3方向以上の照明方向からワーク2に照明光を照射できれば、フォトメトリックステレオ法により検査画像を生成できるからである。各照明ブロックにはそれぞれ波長が異なる照明光を出力する複数の発光素子(LED33)が設けられている。複数の発光素子には白色LEDが含まれていてもよい。白色LEDはマルチスペクトルイメージングには使用されず、他の検査画像を作成したり、ワーク2の移動補正用の画像を作成するために使用されたりする。図1や図3に示したように照明装置3の外形はリング状をしていてもよい。また、照明装置3は、それぞれ分離した複数の照明ユニットにより構成されていてもよい。照明制御基板40は、画像処理装置5から受信した制御コマンドに応じて光源群501の点灯タイミングや照明パターン(点灯パターン)を制御する。マルチスペクトルイメージングで分光画像を取得するには択一的に選択された波長の照明光をワーク2に照射するが、マルチスペクトルイメージング以外の手法が採用される場合は、複数の波長の照明光が同時に照射されてもよい。照明制御基板40は照明装置3に内蔵されているものとして説明するが、カメラ4に内蔵されていてもよいし、画像処理装置5に内蔵されていてもよいし、これらからは独立した筐体に収容されていてもよい。
<Functional block>
FIG. 5 is a block diagram of the inspection device. In this example, the lighting device 3, the camera 4, and the image processing device 5 are housed in separate housings, but this is only an example and may be appropriately integrated. The lighting device 3 is a lighting device that realizes multispectral imaging, but may be used as a lighting means for illuminating an inspection object according to a photometric stereo method. The lighting device 3 includes a light source group 501 and a lighting control board 40 for controlling the light source group 501. As already shown in FIG. 3, one lighting block may be formed by a plurality of light emitting elements, and the light source group 501 may be further formed by a plurality of lighting blocks. The number of lighting blocks is generally four, but it may be three or more. This is because if the work 2 can be irradiated with illumination light from three or more illumination directions, an inspection image can be generated by the photometric stereo method. Each illumination block is provided with a plurality of light emitting elements (LED 33) that output illumination light having a different wavelength. The plurality of light emitting elements may include a white LED. The white LED is not used for multispectral imaging, but is used to create another inspection image or an image for motion correction of the work 2. As shown in FIGS. 1 and 3, the outer shape of the lighting device 3 may be ring-shaped. Further, the lighting device 3 may be composed of a plurality of lighting units separated from each other. The lighting control board 40 controls the lighting timing and the lighting pattern (lighting pattern) of the light source group 501 according to the control command received from the image processing device 5. In order to acquire a spectroscopic image by multispectral imaging, the work 2 is irradiated with illumination light of an alternative wavelength, but when a method other than multispectral imaging is adopted, illumination light of multiple wavelengths is used. It may be irradiated at the same time. Although the lighting control board 40 will be described as being built in the lighting device 3, it may be built in the camera 4, it may be built in the image processing device 5, or it may be a housing independent of these. May be housed in.

照明装置3には記憶装置502が内蔵されており、ユーザにより設定された光源群501の点灯タイミングや照明パターンが記憶されている。照明制御基板40は、画像処理装置5からトリガー信号を受け取り、記憶装置502に記憶されている内容に応じて、光源群501を制御することができる。このような構成により、画像処理装置5は、トリガー信号を送信するだけで照明装置3を制御することができるので、画像処理装置5と照明装置3を接続する信号線の数を少なくすることができ、ケーブルの取り回しがよくなる。 The lighting device 3 has a built-in storage device 502, and stores the lighting timing and the lighting pattern of the light source group 501 set by the user. The illumination control board 40 can receive the trigger signal from the image processing device 5 and control the light source group 501 according to the contents stored in the storage device 502. With such a configuration, the image processing device 5 can control the lighting device 3 only by transmitting a trigger signal, so that the number of signal lines connecting the image processing device 5 and the lighting device 3 can be reduced. It can be done, and the cable can be easily routed.

カメラ4は照明装置3により照明された検査対象物からの反射光を受光して輝度画像を生成する撮像手段の一例であり、画像処理装置5からの制御コマンドに応じて撮像処理を実行する。カメラ4はワーク2の輝度画像を作成して画像処理装置5に転送してもよいし、カメラ4の撮像素子から得られる輝度信号を画像処理装置5に転送し、画像処理装置5が輝度画像を生成してもよい。輝度信号は輝度画像の元になる信号であるため、広義には輝度信号も輝度画像である。また、カメラ4は、照明装置3が出力する各波長の照明光ごとに対象物からの反射光を受光して対象物の画像(分光画像)を生成する撮像部として機能する。 The camera 4 is an example of an imaging means that receives reflected light from an inspection object illuminated by the lighting device 3 and generates a luminance image, and executes an imaging process in response to a control command from the image processing device 5. The camera 4 may create a brightness image of the work 2 and transfer it to the image processing device 5, or transfer the brightness signal obtained from the image pickup element of the camera 4 to the image processing device 5, and the image processing device 5 transfers the brightness image. May be generated. Since the luminance signal is a signal that is the basis of the luminance image, the luminance signal is also a luminance image in a broad sense. Further, the camera 4 functions as an imaging unit that receives reflected light from the object for each illumination light of each wavelength output by the illumination device 3 and generates an image (spectral image) of the object.

画像処理装置5は、コンピュータの一種であり、CPUやASICなどのプロセッサ510と、RAM、ROM、可搬記憶媒体などの記憶装置520と、ASICなどの画像処理部530と、ネットワークインタフェースなどの通信部550とを有している。プロセッサ510は検査ツールの設定や、制御パラメータの調整、検査画像の生成などを担当する。とりわけ、MSI処理部511は、マルチスペクトルイメージング(MSI)に従って、カメラ4により取得された複数の輝度画像(分光画像)からワーク2のグレー画像を作成したり、グレー画像から検査画像を作成したりする。グレー画像自体が検査画像であってもよい。MSI処理部511は、複数の分光画像から一つのカラー画像を作成してもよい。照明制御部512は、照明制御基板40に対して制御コマンドを送信することで点灯パターンや照明切り替えタイミング、照明強度などを制御する。撮像制御部513は、撮影条件(露光時間、ゲインなど)に従ってカメラ4を制御する。 The image processing device 5 is a type of computer, and communicates with a processor 510 such as a CPU or ASIC, a storage device 520 such as a RAM, ROM, or a portable storage medium, an image processing unit 530 such as an ASIC, and a network interface or the like. It has a unit 550 and a unit. The processor 510 is in charge of setting inspection tools, adjusting control parameters, generating inspection images, and the like. In particular, the MSI processing unit 511 creates a gray image of the work 2 from a plurality of luminance images (spectral images) acquired by the camera 4 according to multispectral imaging (MSI), or creates an inspection image from the gray image. To do. The gray image itself may be an inspection image. The MSI processing unit 511 may create one color image from a plurality of spectroscopic images. The lighting control unit 512 controls the lighting pattern, the lighting switching timing, the lighting intensity, and the like by transmitting a control command to the lighting control board 40. The image pickup control unit 513 controls the camera 4 according to shooting conditions (exposure time, gain, etc.).

UI管理部514は、検査ツールを設定するためのユーザインタフェース(UI)や検査画像を生成するために必要となるパラメータを設定するためのUIなどを表示部7に表示し、入力部6から入力された情報に従って検査ツールやパラメータを設定する。検査ツールには、ワーク2が備える特定の特徴(例:ピン)の長さを計測するツールや特徴の面積を計測するツールや、ある特徴から別の特徴までの距離(例:ピン間隔)を計測するツールや、特定の特徴の数を計測するツールや、特定の特徴に傷が有るか無いかを検査するツールなどが含まれてもよい。とりわけ、UI管理部514は色抽出に関する制御パラメータを設定するためのUIを表示部7に表示する。画像選択部515はUIを通じてユーザにより選択された画像の画像データを記憶装置520から読み出してUI内の画像表示領域に表示する。たとえば、画像選択部515はUIを通じて色抽出の対象となるカラー画像のデータを記憶装置520から取得する。領域指定部516は表示された画像に対して検査ツールの検査領域IWなどの指定をユーザから受け付ける。また、領域指定部516は表示されたカラー画像のうち色クラスタリングが施される複数の画素を含むクラスタ化領域の指定を受け付ける。抽出色指定部517は、表示部7に表示されたフォルスカラー画像において抽出対象となる抽出色の指定を受け付ける。抽出色指定部517は、フォルスカラー画像において前景領域の色である前景色と背景領域の色である背景色とのうち少なくとも一方の指定を受け付ける前景背景指定部を有していてもよい。なお、領域指定部516は、表示された画像に対して前景領域や背景領域の指定をユーザから受け付けてもよい。前景領域とは、ワーク2の表面領域のうち、色抽出の対象となる特徴を含む領域である。背景領域とは、前景領域の周囲に存在する領域であり、色抽出の対象となる特徴を含まない領域である。なお、前景領域は、色抽出の対象となる特徴を含むため、検査領域IWの少なくとも一部になることが多い。検査領域、前景領域、背景領域などの領域はユーザにより指定されることが多いため、指定領域と呼ばれてもよい。また、領域指定部516は、これらの指定領域の形状(例:矩形、円、楕円、任意形状)の選択を受け付けて指定領域を示す枠線の形状をUIに反映させてもよい。抽出色指定部517は、表示部7に表示されたフォルスカラー画像において複数のクラスタのうちいずれかのクラスタの代表色を注目色とするための指定を受け付ける抽出色指定部を有していてもよい。クラスタは複数の画素からなる画素群であり、グループと呼ばれてもよい。フォルスカラー画像は分光画像から作成される画像であり、ユーザによる抽出色の指定を補助するための画像である。クラスタ数指定部518は複数のクラスタの数の指定を受け付ける。クラスタ化領域に属する各画素の色は、指定された数のクラスタのいずれかに所属する。調整部519は、表示部7に表示された、二次元または三次元の色空間に投影された注目色の分布を囲む楕円の長軸、短軸および分布の中心座標のうち少なくとも一つの調整をユーザの指示に従って受け付ける。 The UI management unit 514 displays the user interface (UI) for setting the inspection tool, the UI for setting the parameters required for generating the inspection image, and the like on the display unit 7, and inputs from the input unit 6. Set inspection tools and parameters according to the information provided. The inspection tool includes a tool for measuring the length of a specific feature (example: pin) included in the work 2, a tool for measuring the area of the feature, and a distance (example: pin spacing) from one feature to another. It may include a tool for measuring, a tool for measuring the number of specific features, a tool for inspecting a specific feature for scratches, and the like. In particular, the UI management unit 514 displays a UI for setting control parameters related to color extraction on the display unit 7. The image selection unit 515 reads the image data of the image selected by the user through the UI from the storage device 520 and displays it in the image display area in the UI. For example, the image selection unit 515 acquires color image data to be color-extracted from the storage device 520 through the UI. The area designation unit 516 receives from the user the designation of the inspection area IW of the inspection tool for the displayed image. Further, the area designation unit 516 accepts the designation of the clustered area including a plurality of pixels to which color clustering is performed in the displayed color image. The extraction color designation unit 517 accepts the designation of the extraction color to be extracted in the false color image displayed on the display unit 7. The extraction color designation unit 517 may have a foreground background designation unit that accepts at least one of the foreground color, which is the color of the foreground region, and the background color, which is the color of the background region, in the false color image. The area designation unit 516 may accept designation of a foreground area or a background area from the user for the displayed image. The foreground region is a region of the surface region of the work 2 that includes features to be color-extracted. The background area is an area that exists around the foreground area and does not include a feature that is the target of color extraction. Since the foreground region includes features that are the target of color extraction, it often becomes at least a part of the inspection region IW. Areas such as an inspection area, a foreground area, and a background area are often designated by the user, and may be referred to as a designated area. Further, the area designation unit 516 may accept the selection of the shape (eg, rectangle, circle, ellipse, arbitrary shape) of these designated areas and reflect the shape of the frame line indicating the designated area in the UI. Even if the extraction color designation unit 517 has an extraction color designation unit that accepts a designation for setting the representative color of one of a plurality of clusters as the color of interest in the false color image displayed on the display unit 7. Good. A cluster is a pixel group composed of a plurality of pixels, and may be called a group. The false color image is an image created from a spectroscopic image, and is an image for assisting the user in designating an extracted color. The cluster number designation unit 518 accepts the designation of the number of a plurality of clusters. The color of each pixel that belongs to the clustered area belongs to one of the specified number of clusters. The adjustment unit 519 adjusts at least one of the major axis, the minor axis, and the center coordinates of the ellipse that surrounds the distribution of the color of interest projected on the two-dimensional or three-dimensional color space displayed on the display unit 7. Accept according to the user's instructions.

検査画像生成部560は、検査対象物(ライン1を搬送されるワーク2など)の分光画像から画像検査用の検査画像を生成する。検査画像はグレー画像であってもよいし、グレー画像に対してさらに画像処理(例:二値化など)を適用された画像であってもよい。検査画像生成部560は様々な機能を備えている。取得部561は、画像選択部515を通じてユーザにより指定された画像を記憶装置520やカメラ4から取得する。つまり、画像選択部515は取得部561を通じて画像データを取得する。クラスタリング部562は領域指定部516により指定された各領域に含まれる複数の画素の色空間座標における位置に応じて、分光画像を構成する各画素を、複数のクラスタのうちのいずれかのクラスタに所属させる。たとえば、クラスタリング部562は、色クラスタリングなどの手法を用いて各画素をいずれかのクラスタに所属させる。また、クラスタリング部562は、クラスタ数指定部518により指定された数のクラスタに、分光画像を構成する各画素を所属させてもよい。フォルスカラー画像生成部563は、複数のクラスタのそれぞれについて代表色を決定し、分光画像を構成する各画素の色を、各画素が属するクラスタの代表色に変換することでフォルスカラー画像を生成する。変換部564は、検査対象物の分光画像の各画素の色と抽出色との色空間内での距離に基づいて分光画像の各画素の色情報を一次元の色情報に変換することで検査画像を生成する。たとえば、変換部564は、カラーグレー変換を実行することで検査画像または検査画像の元になるグレー画像を生成してもよい。なお、クラスタリングの対象となる分光画像は、一般に複数の分光画像(例:UV画像、R画像、G画像、B画像、IR画像など)から構成される分光画像群である。 The inspection image generation unit 560 generates an inspection image for image inspection from a spectroscopic image of an inspection object (work 2 or the like conveyed on the line 1). The inspection image may be a gray image, or may be an image to which image processing (eg, binarization, etc.) is further applied to the gray image. The inspection image generation unit 560 has various functions. The acquisition unit 561 acquires an image designated by the user through the image selection unit 515 from the storage device 520 or the camera 4. That is, the image selection unit 515 acquires image data through the acquisition unit 561. The clustering unit 562 converts each pixel constituting the spectroscopic image into one of the plurality of clusters according to the position in the color space coordinates of the plurality of pixels included in each area designated by the area designation unit 516. Make it belong. For example, the clustering unit 562 makes each pixel belong to one of the clusters by using a technique such as color clustering. Further, the clustering unit 562 may assign each pixel constituting the spectroscopic image to the number of clusters designated by the cluster number designating unit 518. The false color image generation unit 563 determines a representative color for each of the plurality of clusters, and generates a false color image by converting the color of each pixel constituting the spectral image into the representative color of the cluster to which each pixel belongs. .. The conversion unit 564 inspects by converting the color information of each pixel of the spectral image into one-dimensional color information based on the distance in the color space between the color of each pixel of the spectral image of the inspection object and the extracted color. Generate an image. For example, the conversion unit 564 may generate an inspection image or a gray image that is a source of the inspection image by performing color gray conversion. The spectroscopic image to be clustered is generally a spectroscopic image group composed of a plurality of spectroscopic images (eg, UV image, R image, G image, B image, IR image, etc.).

UI管理部514はユーザにより設定されたこれらの制御パラメータを設定情報523に保存する。UI管理部514は照明条件や撮像条件を設定する設定部として機能したり、検査ツールを設定する設定部として機能したりしてもよい。 The UI management unit 514 stores these control parameters set by the user in the setting information 523. The UI management unit 514 may function as a setting unit for setting lighting conditions and imaging conditions, or may function as a setting unit for setting inspection tools.

画像処理部530は検査画像に対して検査ツールを適用して各種の計測を実行する検査部531などを有している。サーチ部532は画像検査の前に設定された特徴または画像検査中に動的に設定された特徴を、検査画像に配置されたサーチ領域SW内でサーチし、見つかった特徴の位置を求める。検査部531は、見つかった特徴の位置に応じて検査領域(計測領域)の位置を補正する。画像処理部530の機能はプロセッサ510に実装されてもよい。あるいは、プロセッサ510の機能が画像処理部530に実装されてもよい。また、プロセッサ510とプロセッサ510とが協働して単一または複数の機能を実現してもよい。 The image processing unit 530 has an inspection unit 531 and the like that apply an inspection tool to the inspection image and execute various measurements. The search unit 532 searches for a feature set before the image inspection or a feature dynamically set during the image inspection in the search area SW arranged in the inspection image, and finds the position of the found feature. The inspection unit 531 corrects the position of the inspection area (measurement area) according to the position of the found feature. The function of the image processing unit 530 may be implemented in the processor 510. Alternatively, the function of the processor 510 may be implemented in the image processing unit 530. Further, the processor 510 and the processor 510 may cooperate to realize a single function or a plurality of functions.

判定部540は検査画像を用いてワーク2の良否を判定する判定手段として機能する。たとえば、判定部540は画像処理部530において検査画像を用いて実行された検査の結果を受け取って検査結果が良品条件(公差など)を満たしているかどうかを判定する。 The determination unit 540 functions as a determination means for determining the quality of the work 2 using the inspection image. For example, the determination unit 540 receives the result of the inspection performed by the image processing unit 530 using the inspection image, and determines whether or not the inspection result satisfies the non-defective product condition (tolerance, etc.).

記憶装置520は、カメラ4によって取得された分光画像のデータである分光画像データ521、フォルスカラー画像生成部563により生成されたフォルスカラー画像のデータであるフォルスカラー画像データ522、検査画像の画像データである検査画像データ524や各種の制御パラメータを保持する設定情報523を記憶する。また、記憶装置520は各種の設定データやユーザインタフェースを生成するためのプログラムコードなども記憶している。記憶装置520はグレー画像から生成された検査画像なども記憶して保持していてもよい。 The storage device 520 includes spectral image data 521, which is the spectral image data acquired by the camera 4, false color image data 522, which is false color image data generated by the false color image generation unit 563, and image data of the inspection image. The inspection image data 524 and the setting information 523 holding various control parameters are stored. The storage device 520 also stores various setting data, a program code for generating a user interface, and the like. The storage device 520 may also store and retain an inspection image or the like generated from the gray image.

図15ないし図17は、本発明の画像処理装置に係る他の構成例を示す図である。図15は照明装置3とカメラ4が一体化され、カメラ4に照明装置3を制御するための照明制御基板40が設けられている例を示す図である。この構成では照明装置3とカメラ4が一体に設けられているため、照明装置3とカメラ4を設置する際に、位置合わせをする必要がない。また、照明装置3側には光源群501を制御するための照明制御基板40や記憶装置502は不要となり、これらを有さない汎用的な照明装置3も利用することができる。ユーザはカメラ4に接続されている照明装置3を取り外し、別の種類の照明装置に交換することができる。例えば、本発明におけるマルチスペクトルイメージングに用いる照明装置3に変えて、白色光のみを照射するリング照明など他の種類の照明装置を適宜に選択できる。カメラ4は接続された照明装置3の種類を認識し、設定ユーザインタフェースに反映することが好ましい。これにより、ユーザは接続されている照明装置3に設定が可能な項目に対応したユーザインタフェース上で、照明の設定を行うことができる。認識の方法としては、照明装置3が照明種別情報を記憶しており、カメラ4がその情報を参照する方法などが考えられる。また、画像処理装置5が有する照明制御部512と撮像制御部513を、カメラ4の内部に設ける構成とし、撮像・照明系の制御を画像処理装置5とは独立して実行させる構成としてもよい。 15 to 17 are diagrams showing other configuration examples according to the image processing apparatus of the present invention. FIG. 15 is a diagram showing an example in which the lighting device 3 and the camera 4 are integrated, and the camera 4 is provided with a lighting control board 40 for controlling the lighting device 3. In this configuration, since the lighting device 3 and the camera 4 are integrally provided, it is not necessary to align the lighting device 3 and the camera 4 when they are installed. Further, the lighting control board 40 and the storage device 502 for controlling the light source group 501 are not required on the lighting device 3 side, and a general-purpose lighting device 3 that does not have these can also be used. The user can remove the illuminating device 3 connected to the camera 4 and replace it with another type of illuminating device. For example, instead of the lighting device 3 used for multispectral imaging in the present invention, another type of lighting device such as ring lighting that irradiates only white light can be appropriately selected. It is preferable that the camera 4 recognizes the type of the connected lighting device 3 and reflects it in the setting user interface. As a result, the user can set the lighting on the user interface corresponding to the items that can be set to the connected lighting device 3. As a recognition method, a method in which the lighting device 3 stores the lighting type information and the camera 4 refers to the information can be considered. Further, the lighting control unit 512 and the image pickup control unit 513 of the image processing device 5 may be provided inside the camera 4, and the control of the image pickup / lighting system may be executed independently of the image processing device 5. ..

図16は画像処理装置5の一部の機能を、カメラ4側に設けた構成例を示している。カメラ4は分光画像データ521、フォルスカラー画像データ522、検査画像データ524、設定情報523を記憶する記憶装置520を備え、カメラ4の内部で分光画像データ521からフォルスカラー画像データ522を生成する処理をMSI処理部511や検査画像生成部560などが実行する。また、カメラ4に設けられた検査画像生成部560が検査画像データ524を作成する。照明装置3はカメラ4の照明制御部512が制御する。検査設定時に、カメラ4は画像処理装置4に各波長で撮像された分光画像データ521と、MSI処理部511により生成されたフォルスカラー画像データ522と、検査画像生成部560が作成した検査画像データ524を画像処理装置5に送信する。設定時には、各波長の照明強度や、各波長の分光画像データ521が検査に必要か否かをユーザが確認するために、画像処理装置5はカメラ4から分光画像データ521を取得し、表示部7に表示する。一方、検査運用時には、カメラ4から画像処理装置5への分光画像データ521の送信を行わず、検査対象である検査画像データ524のみを画像処理装置5に送信するようにしてもよい。このように、カメラ4に画像処理装置5の一部の機能を負担させることにより、カメラ4と画像処理装置5間の通信負荷が低減され、分散処理により処理が高速化する。 FIG. 16 shows a configuration example in which some functions of the image processing device 5 are provided on the camera 4 side. The camera 4 includes a storage device 520 that stores spectral image data 521, false color image data 522, inspection image data 524, and setting information 523, and processes to generate false color image data 522 from the spectral image data 521 inside the camera 4. Is executed by the MSI processing unit 511, the inspection image generation unit 560, and the like. Further, the inspection image generation unit 560 provided in the camera 4 creates the inspection image data 524. The lighting device 3 is controlled by the lighting control unit 512 of the camera 4. At the time of inspection setting, the camera 4 has the spectral image data 521 captured by the image processing device 4 at each wavelength, the false color image data 522 generated by the MSI processing unit 511, and the inspection image data created by the inspection image generation unit 560. 524 is transmitted to the image processing device 5. At the time of setting, the image processing device 5 acquires the spectroscopic image data 521 from the camera 4 and displays the spectroscopic image data 521 in order for the user to confirm the illumination intensity of each wavelength and whether or not the spectroscopic image data 521 of each wavelength is necessary for the inspection. Display in 7. On the other hand, during the inspection operation, the spectral image data 521 may not be transmitted from the camera 4 to the image processing device 5, and only the inspection image data 524 to be inspected may be transmitted to the image processing device 5. By causing the camera 4 to bear some functions of the image processing device 5 in this way, the communication load between the camera 4 and the image processing device 5 is reduced, and the processing speed is increased by the distributed processing.

図17は画像処理装置5の全ての機能をカメラ4に内蔵した構成例である。ユーザはカメラ4と照明装置3のみを設置するだけで良いため、設置時の手間がかからない。たとえば、カメラ4の大型化が許容され、高度な画像演算処理が不要な場合に、この構成は有利であろう。 FIG. 17 is a configuration example in which all the functions of the image processing device 5 are built into the camera 4. Since the user only needs to install the camera 4 and the lighting device 3, there is no need for installation. For example, this configuration may be advantageous when the size of the camera 4 is allowed to be increased and advanced image calculation processing is not required.

<マルチスペクトルイメージング>
マルチスペクトルイメージングでは点灯色(波長)の異なる照明光が一つずつ順番にワーク2に照射され、各波長ごとの画像(分光画像)が取得される。たとえば、8種類の波長の照明光が照射される場合、8個の画像(分光画像)が取得される。なお、四つの照明ブロックが存在する場合、四つの照明ブロックは同時に点灯する。つまり、同一の波長の四つのLED33が同時に点灯するため、四つの方向から同一波長の照明光がワーク2に照射される。8種類の波長は、たとえば、紫外波長から近赤外波長までの8種類の狭帯域波長である。狭帯域波長とは、白色LEDが発光する光の波長(広帯域波長)の幅と比較して狭い波長をいう。たとえば、青色LEDが発光する光の波長の幅は、白色LEDが発光する光の波長幅よりもずっと狭いため、青色LEDが発光する光の波長は狭帯域波長である。なお、画像検査の中には8個の分光画像のすべてを必要としない画像検査もありうる。この場合、必要な波長の照明光だけがワーク2に照射される。一般に、8個の画像がそのまま画像検査に利用されることは少なく、8個の画像から一個のグレー画像が作成され(カラー濃淡変換)、このグレー画像(カラー濃淡画像)が画像検査に利用される。カラー濃淡変換はカラーグレー変換と呼ばれることもある。たとえば、カラー濃淡画像に対して二値化処理が実行されたり、エッジ検出処理が実行されたり、ブロブ処理が実行されたりして、ワーク2における特徴(例:ピン)の位置や寸法(長さや面積)、色がそれぞれ公差の範囲内に収まっているかが検査される。
<Multispectral imaging>
In multispectral imaging, illumination light having a different lighting color (wavelength) is irradiated to the work 2 one by one, and an image (spectral image) for each wavelength is acquired. For example, when illumination light of eight kinds of wavelengths is irradiated, eight images (spectral images) are acquired. If there are four lighting blocks, the four lighting blocks are turned on at the same time. That is, since the four LEDs 33 having the same wavelength are turned on at the same time, the work 2 is irradiated with illumination light having the same wavelength from the four directions. The eight types of wavelengths are, for example, eight types of narrow-band wavelengths from ultraviolet wavelengths to near-infrared wavelengths. The narrow band wavelength means a wavelength narrower than the width of the wavelength (broadband wavelength) of the light emitted by the white LED. For example, the wavelength width of the light emitted by the blue LED is much narrower than the wavelength width of the light emitted by the white LED, so that the wavelength of the light emitted by the blue LED is a narrow band wavelength. It should be noted that some image inspections may not require all eight spectroscopic images. In this case, only the illumination light having the required wavelength is applied to the work 2. In general, eight images are rarely used for image inspection as they are, one gray image is created from eight images (color shading conversion), and this gray image (color shading image) is used for image inspection. To. Color shading conversion is sometimes called color gray conversion. For example, binarization processing is executed for a color shading image, edge detection processing is executed, blob processing is executed, and the position and dimensions (length and length) of features (example: pins) in the work 2 are executed. Area) and color are inspected to see if they are within tolerances.

図6を用いてカラー濃淡変換の一例を説明する。検査対象物であるワーク2のグレー画像を作成するには、良品(モデル)の登録色が必要となる。グレー画像は、登録色の色情報を基準に8個の分光画像を変換することで作成されるからである。 An example of color shading conversion will be described with reference to FIG. In order to create a gray image of the work 2 which is the inspection target, the registered color of a good product (model) is required. This is because the gray image is created by converting eight spectral images based on the color information of the registered color.

まず、設定モードにおいて、良品から取得された8個の分光画像においてユーザが指定した画像領域(指定領域)から登録色の色情報が抽出される。たとえば、良品がインスタント食品(例:ラーメン)であり、ある具材(例:海老)の数を画像検査により計数する場合、ユーザは、良品の画像を表示し、良品の画像おいて当該具材が含まれる矩形の指定領域を指定し、指定領域に含まれる画素から登録色の色情報が抽出される。登録色の色情報は、平均画素行列、分散共分散行列および指定領域に含まれる画素の数を含む。なお、色情報は、いわゆるスポイトツールにより抽出されてもよい。スポイトツールのUIは領域指定部516に実装されてもよい。 First, in the setting mode, the color information of the registered color is extracted from the image area (designated area) designated by the user in the eight spectroscopic images acquired from the non-defective product. For example, when a good product is an instant food (eg ramen) and the number of certain ingredients (eg shrimp) is counted by image inspection, the user displays an image of the good product and puts the ingredient in the image of the good product. The designated area of the rectangle including is specified, and the color information of the registered color is extracted from the pixels included in the designated area. The color information of the registered color includes the average pixel matrix, the variance-covariance matrix, and the number of pixels included in the designated area. The color information may be extracted by a so-called eyedropper tool. The UI of the eyedropper tool may be implemented in the area designation unit 516.

次に、検査モードにおいて、検査対象物であるワーク2について8個の分光画像が取得される。各分光画像に含まれるすべての画素について登録色に対する距離d(x)が求められる(xは8枚の分光画像の各画素値を要素とした8次元ベクトルである)。さらに、距離d(x)に予め定められたゲインgを乗算して積を求め、必要に応じてオフセットaを加え、各画素がとりうる最大階調Gmaxから積を減算することで得られる差Gが注目画素xのグレー階調となる。これは、G = Gmax − (g・d(x) + a)と表記される。 Next, in the inspection mode, eight spectroscopic images are acquired for the work 2 which is the inspection target. The distance d (x) with respect to the registered color is obtained for all the pixels included in each spectroscopic image (x is an 8-dimensional vector having each pixel value of eight spectroscopic images as an element). Further, the difference obtained by multiplying the distance d (x) by the predetermined gain g to obtain the product, adding the offset a as necessary, and subtracting the product from the maximum gradation Gmax that each pixel can take. G is the gray gradation of the pixel of interest x. This is written as G = Gmax − (g · d (x) + a).

なお、複数の登録色が存在する場合は、各登録色を基準として複数のグレー画像が作成されてもよいし、単一のグレー画像が作成されてもよい。 When a plurality of registered colors exist, a plurality of gray images may be created based on each registered color, or a single gray image may be created.

また、RGB画像などのカラー画像をグレー画像に変換する際にも上述したカラーグレー変換は採用可能である。この場合にもある登録色(ユーザにより指定された色)を基準として各画素の色情報が濃淡情報に変換されてグレー画像が生成される。また、分散共分散行列は明度を示す行列と色度を示す行列とに分解されてもよい。また、明度行列を調整するための明度スケール(係数Sy)が明度行列に乗算されてもよい。同様に色度行列を調整するための色度スケール(係数Sz)が色度行列に乗算されてもよい。これらのスケールは抽出色の分布を調整することで変更されてもよい。 Further, the above-mentioned color gray conversion can also be adopted when converting a color image such as an RGB image into a gray image. In this case as well, the color information of each pixel is converted into shade information based on a certain registered color (color specified by the user), and a gray image is generated. Further, the variance-covariance matrix may be decomposed into a matrix showing lightness and a matrix showing chromaticity. Further, the brightness scale (coefficient Sy) for adjusting the brightness matrix may be multiplied by the brightness matrix. Similarly, a chromaticity scale (coefficient Sz) for adjusting the chromaticity matrix may be multiplied by the chromaticity matrix. These scales may be changed by adjusting the distribution of the extracted colors.

<抽出色の指定>
図7(A)はワーク2の表面にある特徴fを含むカラー画像(例:RGB画像)を示している。ユーザが特徴fを画像検査するためには、まず、特徴fの色抽出を行う必要がある。人間の目には特徴fの色はいずれの位置でも同じ色に見えるかもしれないが、特徴fの画像を構成している複数の画素は必ずしも厳密に同じ色を有しているわけではない。
<Specify extraction color>
FIG. 7A shows a color image (eg, RGB image) including the feature f on the surface of the work 2. In order for the user to perform an image inspection of the feature f, it is first necessary to perform color extraction of the feature f. To the human eye, the color of feature f may appear to be the same color at any position, but the plurality of pixels constituting the image of feature f do not necessarily have exactly the same color.

たとえば、画素p1の色と画素p2の色とは異なっている。画素p1をポインタ706で選択して画素p1の色を抽出しても、画素p1は特徴fを構成している多数の画素のうちの一つの画素でしかない。そのため、画素p1の色に基づきワーク2のカラー画像を、グレー画像などの検査画像に変換しても、検査画像は特徴fの色や形状を正確に表していないことがある。 For example, the color of pixel p1 and the color of pixel p2 are different. Even if the pixel p1 is selected by the pointer 706 and the color of the pixel p1 is extracted, the pixel p1 is only one of a large number of pixels constituting the feature f. Therefore, even if the color image of the work 2 is converted into an inspection image such as a gray image based on the color of the pixel p1, the inspection image may not accurately represent the color and shape of the feature f.

図7(B)は特徴fのほぼ全体を囲むようにポインタ706により自由形状の領域を描画することを示している。画像検査装置8は自由形状の領域内の画素値の平均値を求め、この平均値に基づいてカラー画像を検査画像に変換する。これにより、検査画像のばらつきが小さくなる。しかし、特徴fの形状が複雑になればなるほど、ユーザが自由形状を描く負担が増加する。 FIG. 7B shows that a free-form region is drawn by the pointer 706 so as to surround almost the entire feature f. The image inspection device 8 obtains an average value of pixel values in a free-form region, and converts a color image into an inspection image based on this average value. This reduces the variation in the inspection image. However, the more complicated the shape of the feature f, the greater the burden on the user to draw a free shape.

そこで、本実施形態では、色クラスタリングによる色抽出を採用することでユーザの負担を軽減し、かつ、検査画像のばらつきを小さくする。 Therefore, in the present embodiment, by adopting color extraction by color clustering, the burden on the user is reduced and the variation of the inspection image is reduced.

●色抽出を補助するユーザインタフェース
図8はユーザによる色抽出を補助するためにUI管理部514が表示部7に表示するUI800を示している。UI800は、画像表示領域801と各種の設定を行うための設定タブを有している。図8においては、色クラスタリング(色面分割)に関するパラメータを設定するためのクラスタ化タブ810が選択されている。抽出タブ820はクラスタリング結果を利用したユーザによる色抽出を補助するタブである。調整タブ830は抽出色を調整するためのタブである。
● User Interface for Assisting Color Extraction FIG. 8 shows a UI 800 displayed on the display unit 7 by the UI management unit 514 to assist the color extraction by the user. The UI 800 has an image display area 801 and a setting tab for making various settings. In FIG. 8, the clustering tab 810 for setting parameters related to color clustering (color plane division) is selected. The extraction tab 820 is a tab that assists the user in color extraction using the clustering result. The adjustment tab 830 is a tab for adjusting the extraction color.

画像表示領域801は、プルダウンメニュー811により選択された画像を表示する領域である。プルダウンメニュー811は、記憶装置520に記憶されている複数の分光画像やカメラ4により取得された複数の分光画像などを指定するためのUIである。ここでは、複数の分光画像のうちの一つの分光画像や複数の分光画像を合成することで生成されたカラー画像やグレー画像が選択されてもよい。 The image display area 801 is an area for displaying the image selected by the pull-down menu 811. The pull-down menu 811 is a UI for designating a plurality of spectroscopic images stored in the storage device 520, a plurality of spectroscopic images acquired by the camera 4, and the like. Here, a color image or a gray image generated by synthesizing one spectroscopic image among a plurality of spectroscopic images or a plurality of spectroscopic images may be selected.

プルダウンメニュー811に登録されていない画像はプルダウンメニュー811内の"参照"を選択することにより、指定可能となっている。画像選択部515はプルダウンメニュー811により選択された画像を画像表示領域801に表示する。クラスタ化領域802は、色クラスタリング(分類)が実行される矩形や円形、楕円形などの規定形状の領域である。クラスタ化領域802の形状は、ユーザが領域形状を選択するためのプルダウンメニュー812を操作することにより選択される。編集ボタン813はクラスタ化領域802のサイズ(例:縦、横、半径など)と位置を編集するためのボタンである。編集ボタン813が操作されると、UI管理部514の領域指定部516は、ポインタ706によるクラスタ化領域802のサイズの変更を受け付ける。テキストボックス814は、クラスタ数の入力を受け付ける。クラスタ数指定部518は、テキストボックス814に入力された数値をクラスタ数として受け付ける。クラスタ数とは、クラスタ化領域802内の色をいくつの色(クラスタ)に分割するかを示す。クラスタ化ボタン815は、クラスタ化領域802により囲まれた画像について色クラスタリングの実行を指示するボタンである。確定ボタン816は、色抽出結果の確定を指示するボタンである。キャンセルボタン817は、色抽出結果を破棄するボタンである。 Images that are not registered in the pull-down menu 811 can be specified by selecting "reference" in the pull-down menu 811. The image selection unit 515 displays the image selected by the pull-down menu 811 in the image display area 801. The clustering area 802 is an area having a predetermined shape such as a rectangle, a circle, or an ellipse at which color clustering (classification) is executed. The shape of the clustered area 802 is selected by the user operating the pull-down menu 812 for selecting the area shape. The edit button 813 is a button for editing the size (eg, vertical, horizontal, radius, etc.) and position of the clustered area 802. When the edit button 813 is operated, the area designation unit 516 of the UI management unit 514 accepts the change in size of the clustered area 802 by the pointer 706. The text box 814 accepts the input of the number of clusters. The cluster number designation unit 518 accepts the numerical value entered in the text box 814 as the number of clusters. The number of clusters indicates how many colors (clusters) the colors in the clustered area 802 are divided into. The clustering button 815 is a button for instructing execution of color clustering for the image surrounded by the clustering area 802. The confirmation button 816 is a button for instructing confirmation of the color extraction result. The cancel button 817 is a button for discarding the color extraction result.

図9は色クラスタリングが実行された後のUI800を示している。プロセッサ510(クラスタリング部562)は、ポインタ706によるクラスタ化ボタン815の押し下げを検知すると、クラスタ化領域802により囲まれた各画素を解析し、ユーザにより指定されたN個のクラスタのうちのいずれかのクラスタに各画素を所属させる。Nはクラスタ数である。さらに、プロセッサ510(フォルスカラー画像生成部563)は、元の分光画像におけるクラスタ化領域802内の各画素の色を、各画素が所属しているクラスタの代表色に置換することでフォルスカラー画像を生成する。 FIG. 9 shows the UI 800 after color clustering has been performed. When the processor 510 (clustering unit 562) detects that the clustering button 815 is pressed down by the pointer 706, it analyzes each pixel surrounded by the clustering area 802, and any one of the N clusters specified by the user. Make each pixel belong to the cluster of. N is the number of clusters. Further, the processor 510 (false color image generation unit 563) replaces the color of each pixel in the clustered region 802 in the original spectral image with the representative color of the cluster to which each pixel belongs, thereby causing the false color image. To generate.

さらに、プロセッサ510(フォルスカラー画像生成部563)は、クラスタ化領域802内に表示されている画像をフォルスカラー画像に更新する。フォルスカラー画像とは、色クラスタリングが適用された画像である。クラスタ数が2であれば、クラスタ化領域802内の各画素の色は、第一クラスタの代表色と第二クラスタの代表色とのうち、いずれかの色となる。第一クラスタに分類されたすべての画素の色は第一クラスタの代表色に置換される。第二クラスタに分類されたすべての画素の色は第二クラスタの代表色に置換される。これにより、クラスタ化領域802内の画像は二色に分割されることになる。このようにクラスタ化領域802内が複数の領域(面)に分割されるため、クラスタリングは色面分割と呼ばれてもよい。 Further, the processor 510 (false color image generation unit 563) updates the image displayed in the clustered area 802 to the false color image. A false color image is an image to which color clustering is applied. When the number of clusters is 2, the color of each pixel in the clustered area 802 is one of the representative color of the first cluster and the representative color of the second cluster. The colors of all the pixels classified in the first cluster are replaced with the representative colors of the first cluster. The colors of all the pixels classified in the second cluster are replaced with the representative colors of the second cluster. As a result, the image in the clustered area 802 is divided into two colors. Since the clustered region 802 is divided into a plurality of regions (planes) in this way, clustering may be referred to as color plane division.

図9に示したクラスタ化領域802に表示されたフォルスカラー画像では、特徴fが第一クラスタの代表色により表現されており、特徴fの周囲は第二クラスタの代表色により表現されている。各クラスタの代表色はそのクラスタに所属する複数の画素の色の平均色、強調平均色、インデックス色などである。フォルスカラー画像は、分割化画像やクラスタ化画像、インデックス画像と呼ばれてもよい。 In the false color image displayed in the clustered area 802 shown in FIG. 9, the feature f is represented by the representative color of the first cluster, and the periphery of the feature f is represented by the representative color of the second cluster. The representative color of each cluster is the average color of the colors of a plurality of pixels belonging to the cluster, the emphasized average color, the index color, and the like. The false color image may be referred to as a divided image, a clustered image, or an index image.

図10は抽出タブ820を示す図である。なお、クラスタ化タブ810と抽出タブ820とは一つにタブに集約化されてもよいが、説明の便宜上、これらを二つのタブとして説明する。UI管理部514は、ポインタ706による抽出タブ820の選択を検知すると、UI800に抽出タブ820の内容を表示する。プルダウンメニュー1011は、色抽出手法の選択を補助するUIである。ここでは色抽出手法の一例として前景背景抽出が選択されている。前景背景抽出とは、前景領域の色(前景色)と背景領域の色(背景色)とを抽出することを示している。前景色や背景色などの抽出色は登録色とよばれてもよい。ラジオボタン1012は複数の前景色が存在するときにどの前景色を登録するかを指定するためのボタンである。この例では、前景色用のラジオボタン1012が二つ存在するため、最大で二つの前景色が登録可能となっている。なお、前景領域の数を一つに制限する場合、ラジオボタン1012は不要である。抽出色指定部517はポインタ706により指定された画素の色を前景色に決定し、前景色を前景色表示領域1013に表示する。ラジオボタン1014は複数の背景色が存在するときにどの背景色を登録するかを指定するためのボタンである。抽出色指定部517はポインタ706により指定された画素の色を背景色に決定し、背景色を背景色表示領域1015に表示する。

チェックボックス1016は近傍色(比較色)の自動選択を有効にするためのチェックボックスである。プロセッサ510(抽出色指定部517)は、チェックボックス1016にチェックが付与されると、色空間内で前景色に近い背景色を選択する。なお、プロセッサ510(抽出色指定部517)は、ユーザによって背景色が指定された場合には、色空間内でこの背景色に近い前景色を選択する。このように複数の背景色のうち一つの背景色がユーザによって指定されると、抽出色指定部517は複数の前景色から一つの前景色を指定(選択)する。また、複数の前景色のうち一つの前景色(指定色)がユーザによって指定されると、抽出色指定部517は複数の背景色のうち指定色に最も近い一つの背景色(近傍色)を指定(選択)する。このように近傍色が選択されるのは、色空間上で近傍にある注目色(前景色/背景色)と比較色(背景色/前景色)とを分離することが調整の目的だからである。
FIG. 10 is a diagram showing an extraction tab 820. The clustering tab 810 and the extraction tab 820 may be integrated into one tab, but for convenience of explanation, these will be described as two tabs. When the UI management unit 514 detects that the extraction tab 820 is selected by the pointer 706, the UI management unit 514 displays the contents of the extraction tab 820 on the UI 800. The pull-down menu 1011 is a UI that assists in selecting a color extraction method. Here, foreground background extraction is selected as an example of the color extraction method. Foreground background extraction indicates that the color of the foreground area (foreground color) and the color of the background area (background color) are extracted. Extracted colors such as foreground color and background color may be called registered colors. The radio button 1012 is a button for designating which foreground color is to be registered when a plurality of foreground colors exist. In this example, since there are two radio buttons 1012 for the foreground color, a maximum of two foreground color can be registered. When limiting the number of foreground regions to one, the radio button 1012 is unnecessary. The extraction color designation unit 517 determines the color of the pixel designated by the pointer 706 as the foreground color, and displays the foreground color in the foreground color display area 1013. The radio button 1014 is a button for designating which background color is to be registered when a plurality of background colors exist. The extraction color designation unit 517 determines the color of the pixel designated by the pointer 706 as the background color, and displays the background color in the background color display area 1015.

Check box 1016 is a check box for enabling automatic selection of neighboring colors (comparison colors). When the check box 1016 is checked, the processor 510 (extraction color designation unit 517) selects a background color close to the foreground color in the color space. When the background color is specified by the user, the processor 510 (extraction color designation unit 517) selects a foreground color close to this background color in the color space. When one of the plurality of background colors is designated by the user in this way, the extraction color designating unit 517 designates (selects) one foreground color from the plurality of foreground colors. Further, when one foreground color (designated color) of the plurality of foreground colors is specified by the user, the extraction color designating unit 517 sets one background color (neighboring color) closest to the designated color among the plurality of background colors. Specify (select). The neighborhood color is selected in this way because the purpose of adjustment is to separate the attention color (foreground color / background color) and the comparison color (background color / foreground color) that are nearby in the color space. ..

抽出色指定部517は指定色(前景色/背景色)に対する近傍色(背景色/前景色)の計算を実行する近傍色決定部を有していてもよい。これによりユーザによる近傍色の指定負担が軽減される。プロセッサ510(変換部564)は、抽出タブ820に設けられた確定ボタン816の押し下げを検知すると、抽出色に従って検査画像を作成する。検査部531は、ワーク2の特徴fについての画像検査を実行する。 The extraction color designation unit 517 may have a neighborhood color determination unit that executes a calculation of a neighborhood color (background color / foreground color) with respect to a designated color (foreground color / background color). This reduces the burden of specifying nearby colors by the user. When the processor 510 (conversion unit 564) detects that the confirmation button 816 provided on the extraction tab 820 is pressed down, the processor 510 (conversion unit 564) creates an inspection image according to the extraction color. The inspection unit 531 executes an image inspection for the feature f of the work 2.

図11、図12は調整タブ830を示す図である。UI管理部514は、ポインタ706により調整タブ830が選択されると、UI800において調整タブ830の内容を表示するとともに、画像表示領域801に二つの画像を表示する。左側の画像は色クラスタリングが施されたカラー画像(フォルスカラー画像)である。右側の画像は、カラー画像の色空間における注目色の分布と比較色の分布との間の分離の程度を示す分布画像である。 11 and 12 are diagrams showing the adjustment tab 830. When the adjustment tab 830 is selected by the pointer 706, the UI management unit 514 displays the contents of the adjustment tab 830 in the UI 800 and displays two images in the image display area 801. The image on the left is a color image (false color image) with color clustering. The image on the right is a distribution image showing the degree of separation between the distribution of the color of interest and the distribution of the comparative color in the color space of the color image.

注目色とは、前景色や背景色のうちラジオボタン1012、1014により選択された色である。抽出色指定部517は複数ある前景色や複数ある背景色のうちラジオボタン1012、1014により選択された色を注目色に決定する。比較色は、ユーザがポインタ706を操作することでフォルスカラー画像から選択した色である。近傍色(比較色)の自動選択が有効化されている場合、抽出色指定部517が比較色を自動的に選択する。 The attention color is a color selected by the radio buttons 1012 and 1014 from the foreground color and the background color. The extraction color designation unit 517 determines the color selected by the radio buttons 1012 and 1014 from among the plurality of foreground colors and the plurality of background colors as the color of interest. The comparison color is a color selected from the false color image by the user operating the pointer 706. When the automatic selection of the neighborhood color (comparison color) is enabled, the extraction color designation unit 517 automatically selects the comparison color.

このように抽出色指定部517は比較色の指定を受け付けてもよい。一般に、ユーザは注目色に対して分離したい色を比較色として選択する。たとえば、クラスタ化領域802が5個のクラスタに分割されるケースでは、注目色を含むクラスタに対して色空間内でのユークリッド距離が最も近いクラスタが選択される。なお、プロセッサ510(抽出色指定部517)は、注目色を含むクラスタの代表色と、複数の他のクラスタの代表色との間の距離を求め、求めた距離のうちで最小の距離となった他のクラスタの代表色を比較色(近傍色)に選択してもよい。距離は、たとえば、各クラスタの中心位置(重心位置)間の距離である。 In this way, the extraction color designation unit 517 may accept the designation of the comparison color. Generally, the user selects a color to be separated from the color of interest as a comparison color. For example, in the case where the clustered area 802 is divided into five clusters, the cluster having the closest Euclidean distance in the color space with respect to the cluster containing the color of interest is selected. The processor 510 (extracted color designation unit 517) obtains the distance between the representative color of the cluster including the color of interest and the representative color of a plurality of other clusters, and is the smallest distance among the obtained distances. Alternatively, the representative color of another cluster may be selected as the comparison color (neighborhood color). The distance is, for example, the distance between the center positions (center of gravity positions) of each cluster.

プロセッサ510(調整部519または検査画像生成部560)は、注目色の分布と比較色の分布とを二次元の色空間に投影することで分布画像を作成する。なお、プロセッサ510(調整部519または検査画像生成部560)は、注目色の分布と比較色の分布とを三次元の色空間に投影することで分布画像を作成してもよい。1111は注目色の分布を示している。調整部519は、注目色の分布1111を取り囲むように楕円形の枠1112を配置する。枠1112はポインタ706により長径と短径を変更可能な枠である。長径は長軸(明度軸)に相当し、短径は短軸(色度軸)に相当する。なお、一般には、複数ある軸のうち最長軸が主軸と呼ばれ、最長軸以外の軸が副軸と呼ばれる。 The processor 510 (adjustment unit 519 or inspection image generation unit 560) creates a distribution image by projecting the distribution of the color of interest and the distribution of the comparison color onto a two-dimensional color space. The processor 510 (adjustment unit 519 or inspection image generation unit 560) may create a distribution image by projecting the distribution of the color of interest and the distribution of the comparison color onto a three-dimensional color space. 1111 shows the distribution of the color of interest. The adjusting unit 519 arranges an elliptical frame 1112 so as to surround the distribution 1111 of the color of interest. The frame 1112 is a frame whose major axis and minor axis can be changed by the pointer 706. The major axis corresponds to the major axis (brightness axis), and the minor axis corresponds to the minor axis (chromaticity axis). In general, the longest axis among a plurality of axes is called a main axis, and the axis other than the longest axis is called a sub-axis.

調整部519は、ユーザによる枠1112のサイズの変更に応じて、注目色の分布を左右する明度のスケールと色度のスケールとを変更する。 The adjustment unit 519 changes the lightness scale and the chromaticity scale that influence the distribution of the color of interest according to the change in the size of the frame 1112 by the user.

1113は比較色の分布を示している。調整部519は、比較色の分布1113を取り囲むように楕円形の枠1114を配置する。楕円形の枠1114はポインタ706により長径と短径を変更可能な枠であってもよい。枠1114のサイズを変更することで比較色の分布を左右する明度のスケールと色度のスケールとが変更される。あるいは、比較色の分布1113は変更できずに固定であってもよい。 1113 shows the distribution of comparative colors. The adjusting unit 519 arranges an elliptical frame 1114 so as to surround the comparative color distribution 1113. The elliptical frame 1114 may be a frame whose major axis and minor axis can be changed by the pointer 706. By changing the size of the frame 1114, the lightness scale and the chromaticity scale, which influence the distribution of the comparative colors, are changed. Alternatively, the comparative color distribution 1113 may be immutable and fixed.

調整タブ830には、注目色を示す表示領域1121と比較色を示す表示領域1122とが設けられている。UI管理部514(比較色指定部)は、画像表示領域801に表示されているフォルスカラー画像の任意の位置で右クリックされたことを検知すると、その位置の色(登録色)を比較色として指定してもよい。あるいはUI管理部514(比較色指定部)はラジオボタンにより選択された登録色を比較色として選択してもよい。上述したように、UI管理部514(比較色指定部)は、色空間において注目色の近傍に位置する色を比較色に登録してもよい。 The adjustment tab 830 is provided with a display area 1121 indicating a color of interest and a display area 1122 indicating a comparison color. When the UI management unit 514 (comparison color specification unit) detects that the false color image displayed in the image display area 801 is right-clicked at an arbitrary position, the color (registered color) at that position is used as the comparison color. You may specify it. Alternatively, the UI management unit 514 (comparison color designation unit) may select the registered color selected by the radio button as the comparison color. As described above, the UI management unit 514 (comparative color designation unit) may register a color located in the vicinity of the color of interest in the color space as the comparison color.

テキストボックス1123は注目色の明度に乗算されるスケールを示している。調整部519は、楕円形の枠1112の調整に応じて注目色の明度のスケールを変更する。テキストボックス1124は注目色の色度に乗算されるスケールを示している。調整部519は、楕円形の枠1112の調整に応じて注目色の色度のスケールを変更する。これらのスケールは上述した分散共分散行列を分解することで得られる明度行列のスケールと色度行列のスケールと連動してもよい。テキストボックス1125は、注目色の色分布の中心座標を示す。ユーザは注目色の色分布の中心付近をポインタ706によりドラックすることで注目色の色分布の中心座標を調整してもよい。調整部519は、ポインタ706のドラック量に応じて注目色の色分布の中心座標を更新し、テキストボックス1125に反映する。 Text box 1123 shows the scale multiplied by the lightness of the color of interest. The adjusting unit 519 changes the scale of the brightness of the color of interest according to the adjustment of the elliptical frame 1112. Text box 1124 shows the scale multiplied by the chromaticity of the color of interest. The adjusting unit 519 changes the scale of the chromaticity of the color of interest according to the adjustment of the elliptical frame 1112. These scales may be linked to the scale of the lightness matrix and the scale of the chromaticity matrix obtained by decomposing the variance-covariance matrix described above. The text box 1125 indicates the center coordinates of the color distribution of the color of interest. The user may adjust the center coordinates of the color distribution of the attention color by dragging the vicinity of the center of the color distribution of the attention color with the pointer 706. The adjustment unit 519 updates the center coordinates of the color distribution of the color of interest according to the amount of drag of the pointer 706 and reflects it in the text box 1125.

図11に示した事例では注目色と比較色とが十分に分離されていることが分かる。注目色が前景色であり、比較色が背景色であれば、前景色と背景色との距離(分離の程度)を十分に確保することで、特徴fがその周囲から十分に分離された検査画像が作成される。一方で、図12が示す事例では注目色(前景色)と比較色(背景色)とが十分に分離されていない。したがって、図13の点線が示すように、注目色の分布に連動する枠1112のサイズを調整することにより明度が変更されると、注目色の色分布が変更され、注目色と比較色の分離の程度が拡大する。この例では注目色の明度が変更されている。 In the case shown in FIG. 11, it can be seen that the attention color and the comparison color are sufficiently separated. If the color of interest is the foreground color and the comparison color is the background color, an inspection in which the feature f is sufficiently separated from its surroundings by ensuring a sufficient distance (degree of separation) between the foreground color and the background color. The image is created. On the other hand, in the case shown in FIG. 12, the attention color (foreground color) and the comparison color (background color) are not sufficiently separated. Therefore, as shown by the dotted line in FIG. 13, when the brightness is changed by adjusting the size of the frame 1112 linked to the distribution of the attention color, the color distribution of the attention color is changed and the attention color and the comparison color are separated. The degree of is expanded. In this example, the brightness of the attention color is changed.

●フローチャート
図14は色抽出処理を含む画像検査を示すフローチャートである。S1401からS1407までの処理は設定モードにおいて実行され、S1408からS1410までの処理は運転モード(検査モード)において実行されうる。
● Flowchart FIG. 14 is a flowchart showing an image inspection including a color extraction process. The processes S1401 to S1407 can be executed in the setting mode, and the processes S1408 to S1410 can be executed in the operation mode (inspection mode).

S1401でプロセッサ510(取得部561)は設定対象物のカラー画像を取得する。取得部561は照明制御部512を通じて照明制御基板40に照明条件(点灯すべき発光素子や照明強度など)を設定し、光源群501を点灯させ、照明光を設定対象物に照射する。取得部561は撮像制御部513を通じてカメラ4に撮像条件(露光時間や絞りなど)を設定して撮像を指示する。カメラ4は設定対象物のカラー画像の画像データを記憶装置520に格納する。プロセッサ510は記憶装置520からカラー画像の画像データを読み出す。なお、取得部561は、ユーザにより指定されたカラー画像を記憶装置520から取得してもよい。 In S1401, the processor 510 (acquisition unit 561) acquires a color image of the object to be set. The acquisition unit 561 sets the illumination conditions (light emitting element to be lit, illumination intensity, etc.) on the illumination control board 40 through the illumination control unit 512, lights the light source group 501, and irradiates the set object with the illumination light. The acquisition unit 561 sets imaging conditions (exposure time, aperture, etc.) in the camera 4 through the imaging control unit 513, and instructs the camera to perform imaging. The camera 4 stores the image data of the color image of the set object in the storage device 520. The processor 510 reads the image data of the color image from the storage device 520. The acquisition unit 561 may acquire a color image designated by the user from the storage device 520.

S1402でプロセッサ510(領域指定部516)はユーザからクラスタ化領域802の指定を受け付ける。UI管理部514はUI800を表示部7に表示し、クラスタ化領域802の指定を受け付ける。画像表示領域801には記憶装置520から取得されたカラー画像が表示される。 In S1402, the processor 510 (area designation unit 516) receives the designation of the clustered area 802 from the user. The UI management unit 514 displays the UI 800 on the display unit 7 and accepts the designation of the clustered area 802. A color image acquired from the storage device 520 is displayed in the image display area 801.

S1403でプロセッサ510(クラスタ数指定部518)はユーザからクラスタ数Nの指定を受け付ける。クラスタ数Nはテキストボックス814に入力された数値である。テキストボックスはプルダウンメニューなどの他の形式のコントロールオブジェクトであってもよい。 In S1403, the processor 510 (cluster number designation unit 518) accepts the designation of the number of clusters N from the user. The number of clusters N is a numerical value entered in the text box 814. The text box may be another form of control object, such as a pull-down menu.

S1404でプロセッサ510(クラスタリング部562)はカラー画像に設定されたクラスタ化領域内の各画素をN個のクラスタに分類する。ここでは、K−meansやGMM(ガウシアン・ミクスチャ・モデル)などの既知の色クラスタリングアルゴリズムが採用可能である。 In S1404, the processor 510 (clustering unit 562) classifies each pixel in the clustered region set in the color image into N clusters. Here, known color clustering algorithms such as K-means and GMM (Gaussian mixture model) can be adopted.

S1405でプロセッサ510(クラスタリング部562またはフォルスカラー画像生成部563に設けられる代表色決定部)は各クラスタの代表色を決定する。代表色は、各クラスタ内に属している画素の色についての平均色、強調平均色またはインデックス色などである。 In S1405, the processor 510 (the representative color determination unit provided in the clustering unit 562 or the false color image generation unit 563) determines the representative color of each cluster. The representative color is an average color, an emphasized average color, an index color, or the like for the colors of the pixels belonging to each cluster.

S1406でプロセッサ510(フォルスカラー画像生成部563)は各クラスタの代表色に基づきカラー画像をフォルスカラー画像に変換することでフォルスカラー画像を作成する。たとえば、プロセッサ510はあるクラスタに属している各画素の色をそのクラスタの代表色に置換する。この置換処理はすべてのクラスタで実行される。 In S1406, the processor 510 (false color image generation unit 563) creates a false color image by converting a color image into a false color image based on the representative color of each cluster. For example, processor 510 replaces the color of each pixel belonging to a cluster with the representative color of that cluster. This replacement process is performed on all clusters.

S1407でプロセッサ510(抽出色指定部517)は登録色の指定を受け付ける。図10などに示しようにUI管理部514は画像表示領域801にフォルスカラー画像を表示し、ポインタ706により指定された画素の色(代表色)を登録色に設定する。登録色は一つ以上の前景色や一つ以上の背景色などである。なお、色クラスタリングにより抽出された色がユーザの意図とは異なることもあろう。この場合、ユーザは、図11ないし図13に示したような調整タブ830を開いて抽出色の色分布を微調整してもよい。 In S1407, the processor 510 (extracted color designation unit 517) accepts the designation of the registered color. As shown in FIG. 10 and the like, the UI management unit 514 displays a false color image in the image display area 801 and sets the pixel color (representative color) designated by the pointer 706 as the registered color. Registered colors include one or more foreground colors and one or more background colors. The colors extracted by color clustering may differ from the user's intention. In this case, the user may open the adjustment tab 830 as shown in FIGS. 11 to 13 to fine-tune the color distribution of the extracted colors.

S1408でプロセッサ510(取得部561)は検査対象物のカラー画像を取得する。プロセッサ510の照明制御部512は照明制御基板40に照明条件(点灯すべき発光素子や照明強度など)を設定し、光源群501を点灯させ、照明光を検査対象物に照射する。プロセッサ510の撮像制御部513はカメラ4に撮像条件(露光時間や絞りなど)を設定して撮像を指示する。カメラ4は検査対象物のカラー画像の画像データを記憶装置520に格納する。プロセッサ510は記憶装置520からカラー画像の画像データを読み出す。 In S1408, the processor 510 (acquisition unit 561) acquires a color image of the inspection object. The illumination control unit 512 of the processor 510 sets illumination conditions (light emitting element to be lit, illumination intensity, etc.) on the illumination control board 40, lights the light source group 501, and irradiates the inspection object with the illumination light. The image pickup control unit 513 of the processor 510 sets the image pickup conditions (exposure time, aperture, etc.) in the camera 4 and instructs the camera to take an image. The camera 4 stores the image data of the color image of the inspection object in the storage device 520. The processor 510 reads the image data of the color image from the storage device 520.

S1409でプロセッサ510(変換部564)は登録色と検査対象物のカラー画像とに基づき検査画像を作成する。検査画像は検査ツールごとに異なってもよい。たとえば、変換部564は色空間における前景領域の登録色(前景色)とカラー画像の各画素の色とのマハラノビス距離に応じてカラー画像をグレー画像(前景画像)に変換してもよい。また、変換部564は色空間における背景領域の登録色(背景色)とカラー画像の各画素の色とのマハラノビス距離に応じてカラー画像をグレー画像(背景画像)に変換してもよい。これらの画像はさらに二値化などのさらなる画像処理が施されてもよい。また、プロセッサ510(変換部564)は、前景画像と背景画像との差分画像を検査画像として作成してもよい。 In S1409, the processor 510 (conversion unit 564) creates an inspection image based on the registered color and the color image of the inspection object. The inspection image may be different for each inspection tool. For example, the conversion unit 564 may convert a color image into a gray image (foreground image) according to the Maharanobis distance between the registered color (foreground color) of the foreground region in the color space and the color of each pixel of the color image. Further, the conversion unit 564 may convert the color image into a gray image (background image) according to the Maharanobis distance between the registered color (background color) of the background region in the color space and the color of each pixel of the color image. These images may be further subjected to further image processing such as binarization. Further, the processor 510 (conversion unit 564) may create a difference image between the foreground image and the background image as an inspection image.

S1410でプロセッサ510(検査部531)は検査画像に対して検査ツールを適用して画像検査を実行する。一例として、検査対象物が樹脂板に設けられた金属端子であり、検査部531が備えるエリア検査ツールにより金属端子の面積と、その周囲の面積を求めることを考える。前景色は金属端子の代表色であり、背景色は樹脂板の代表色である。検査部531は、前景画像を二値化することで樹脂板の色を白に変換し、金属端子の色を黒に変換し、黒の画素の数をカウントすることで金属端子の面積を算出する。同様に、検査部531は、背景画像を二値化することで樹脂板の色を黒に変換し、金属端子の色を白に変換し、黒の画素の数をカウントすることで金属端子の周囲の樹脂板の面積を算出する。判定部540は金属端子の面積を公差などの閾値と比較して合否を判定する。また、判定部540は金属端子の周囲の面積を公差などの閾値と比較して合否を判定する。 In S1410, the processor 510 (inspection unit 531) applies an inspection tool to the inspection image and executes an image inspection. As an example, consider that the inspection target is a metal terminal provided on a resin plate, and the area of the metal terminal and the area around the metal terminal are obtained by the area inspection tool provided in the inspection unit 531. The foreground color is the representative color of the metal terminal, and the background color is the representative color of the resin plate. The inspection unit 531 converts the color of the resin plate to white by binarizing the foreground image, converts the color of the metal terminal to black, and calculates the area of the metal terminal by counting the number of black pixels. To do. Similarly, the inspection unit 531 converts the color of the resin plate to black by binarizing the background image, converts the color of the metal terminal to white, and counts the number of black pixels to count the number of black pixels of the metal terminal. Calculate the area of the surrounding resin plate. The determination unit 540 compares the area of the metal terminal with a threshold value such as a tolerance to determine pass / fail. Further, the determination unit 540 compares the area around the metal terminal with a threshold value such as a tolerance to determine pass / fail.

<まとめ>
以上で説明したように取得部561や画像選択部515は各画素が多次元の色情報を有するカラー画像を取得する取得部の一例である。また、に取得部561や画像選択部515は検査対象物についての分光画像を取得する取得部の一例である。カラー画像は、たとえば、検査対象物(ライン1を搬送されるワーク2)や設定対象物(ワーク2の良品やリファレンス品)の画像であり、複数の分光画像のうちの一つの分光画像(例:UV画像)や、複数の分光画像から合成されて生成されたトゥルーカラー画像やグレー画像であってもよい。UI管理部514や表示部7は取得部561などにより取得された分光画像などを表示する表示部の一例である。領域指定部516は表示部7に表示された分光画像において複数の画素を含む領域の指定を受け付ける。クラスタリング部562は領域指定部516により指定された各領域に含まれる複数の画素の色空間座標における位置に応じて、分光画像を構成する各画素を、複数のクラスタのうちのいずれかのクラスタに所属させる。図8ではクラスタ化領域802が一つだけ指定されているが、複数のクラスタ化領域802が指定されてもよい。この場合に、クラスタリング部562は複数のクラスタ化領域802のそれぞれについてクラスタリングを実行する。フォルスカラー画像生成部563は複数のクラスタのそれぞれについて代表色を決定し、分光画像を構成する各画素の色を、各画素が属するクラスタの代表色に変換することでフォルスカラー画像を生成する。代表色は、平均色など、そのクラスタを構成する複数の画素の色を代表する色であればよい。抽出色指定部517は表示部7に表示されたフォルスカラー画像において抽出対象となる抽出色の指定を受け付ける。元のカラー画像におけるクラスタ内の各画素の色は一様でないことが多い。そのため、ユーザがどの画素をスポイトで選択するかに依存して抽出色がばらつく。一方で、フォルスカラー画像においてクラスタに属する各画素の色はいずれも同じ色であるため、抽出力のばらつきが生じない。変換部564は検査対象物の分光画像の各画素の色と抽出色との、色空間内での距離に基づいて分光画像の各画素の色情報を一次元の色情報に変換することでグレー画像(検査画像)を生成する。たとえば、RGB色空間の色情報がグレー(濃淡)のみの色空間の色情報に変換される。検査ツールに依存してさらに二値化処理やエッジ抽出処理などの画像処理が追加で実行されてもよい。検査部531は変換部564により生成された検査画像を用いて画像検査を実行する。このような本実施形態によればフォルスカラー画像を用いることで、抽出色の指定に関するユーザの負担が軽減される。また、色抽出のばらつきが小さくなるため、画像検査の結果のばらつきも小さくなる。
<Summary>
As described above, the acquisition unit 561 and the image selection unit 515 are examples of acquisition units that acquire a color image in which each pixel has multidimensional color information. Further, the acquisition unit 561 and the image selection unit 515 are examples of acquisition units that acquire a spectroscopic image of the inspection object. The color image is, for example, an image of an inspection object (work 2 carried on the line 1) or a setting object (a non-defective product or a reference product of the work 2), and is one of a plurality of spectral images (eg, a spectral image). : UV image), or a true color image or a gray image generated by synthesizing a plurality of spectral images. The UI management unit 514 and the display unit 7 are examples of display units that display spectroscopic images acquired by the acquisition unit 561 and the like. The area designation unit 516 accepts the designation of a region including a plurality of pixels in the spectroscopic image displayed on the display unit 7. The clustering unit 562 converts each pixel constituting the spectroscopic image into one of the plurality of clusters according to the position in the color space coordinates of the plurality of pixels included in each area designated by the area designation unit 516. Make it belong. Although only one clustered area 802 is specified in FIG. 8, a plurality of clustered areas 802 may be specified. In this case, the clustering unit 562 executes clustering for each of the plurality of clustered areas 802. The false color image generation unit 563 determines a representative color for each of the plurality of clusters, and generates a false color image by converting the color of each pixel constituting the spectral image into the representative color of the cluster to which each pixel belongs. The representative color may be a color that represents the colors of a plurality of pixels constituting the cluster, such as an average color. The extraction color designation unit 517 accepts the designation of the extraction color to be extracted in the false color image displayed on the display unit 7. The color of each pixel in the cluster in the original color image is often not uniform. Therefore, the extraction color varies depending on which pixel is selected by the user with the dropper. On the other hand, in the false color image, the colors of the pixels belonging to the clusters are the same, so that the extraction power does not vary. The conversion unit 564 converts the color information of each pixel of the spectral image into one-dimensional color information based on the distance in the color space between the color of each pixel of the spectral image of the inspection object and the extracted color, thereby graying. Generate an image (inspection image). For example, the color information in the RGB color space is converted into the color information in the color space of only gray (shade). Image processing such as binarization processing and edge extraction processing may be additionally executed depending on the inspection tool. The inspection unit 531 executes an image inspection using the inspection image generated by the conversion unit 564. According to this embodiment, by using the false color image, the burden on the user regarding the designation of the extraction color is reduced. In addition, since the variation in color extraction is small, the variation in the result of the image inspection is also small.

画像検査装置8は複数のクラスタの数の指定を受け付けるクラスタ数指定部518をさらに有していてもよい。クラスタリング部562は、クラスタ数指定部518により指定された数のクラスタのうちのいずれかに、分光画像を構成する各画素を所属させる。これによりクラスタ数についてユーザの意思を反映させることが可能となる。 The image inspection device 8 may further include a cluster number designation unit 518 that accepts designation of the number of a plurality of clusters. The clustering unit 562 assigns each pixel constituting the spectroscopic image to any of the clusters of the number specified by the cluster number designating unit 518. This makes it possible to reflect the user's intention regarding the number of clusters.

図10などに関連して説明したように、抽出色指定部517は、フォルスカラー画像において前景領域の色である前景色と背景領域の色である背景色とのうち少なくとも一方の指定を受け付ける前景背景指定部を有していてもよい。変換部564は前景色に基づいて分光画像を、検査画像の一つである前景画像に変換してもよい。変換部564は背景色に基づいて分光画像を、検査画像の一つである背景画像に変換してもよい。検査部531は前景画像と背景画像とを用いて検査対象物の合否を判定するように構成されてもよい。検査ツールによってはワーク2の画像を前景画像と背景画像とに分割し、前景画像と背景画像との差分画像などを求めて画像検査を実行することがある。この場合に抽出色指定部517は前景領域の指定を受け付けて前景領域から前景色を抽出したり、または、表示されている画像に対して前景色の指定を受け付けたりしてもよい。背景色に関しても同様である。たとえば、図10に示したように、前景背景指定部は、前景色の指定と背景色の指定とを個別に受け付けてもよい。また、前景背景指定部は、複数のクラスタの代表色のうち色空間において前景色に近い代表色を背景色に設定してもよい。一般に、背景色は前景色から分離される色であることが多く、背景色は前景色の近傍色であることも多い。つまり、色空間において前景色のクラスタの近傍に位置するクラスタの代表色が背景色となることが多い。よって、前景背景指定部は、色空間内でのクラスタ間のユークリッド距離を求めて比較することで、前景色の近傍色を自動的に背景色に決定してもよい。なお、図10に示したように、前景背景指定部は、複数の前景色の指定を受け付けてもよい。たとえば、ワーク2に含まれている複数のエビの色は個体ごとに微妙に異なっていることがある。この場合に、複数のエビの色を複数の前景色として指定することで様々なエビの個体を画像検査により抽出することが可能となる。同様に複数の背景色が指定されてもよい。図10に示したように、前景背景指定部は、複数の背景色の指定を受け付けてもよい。 As described in connection with FIG. 10 and the like, the extraction color designation unit 517 accepts the designation of at least one of the foreground color, which is the color of the foreground area, and the background color, which is the color of the background area, in the false color image. It may have a background designation part. The conversion unit 564 may convert the spectroscopic image into a foreground image, which is one of the inspection images, based on the foreground color. The conversion unit 564 may convert the spectroscopic image into a background image which is one of the inspection images based on the background color. The inspection unit 531 may be configured to determine the pass / fail of the inspection target using the foreground image and the background image. Depending on the inspection tool, the image of the work 2 may be divided into a foreground image and a background image, and an image inspection may be performed by obtaining a difference image between the foreground image and the background image. In this case, the extraction color designation unit 517 may accept the designation of the foreground region and extract the foreground color from the foreground region, or may accept the designation of the foreground color for the displayed image. The same applies to the background color. For example, as shown in FIG. 10, the foreground background designation unit may individually accept the designation of the foreground color and the designation of the background color. Further, the foreground background designation unit may set a representative color close to the foreground color in the color space among the representative colors of a plurality of clusters as the background color. In general, the background color is often a color separated from the foreground color, and the background color is often a color near the foreground color. That is, the representative color of the cluster located in the vicinity of the cluster in the foreground color in the color space is often the background color. Therefore, the foreground / background designation unit may automatically determine the neighboring color of the foreground color as the background color by obtaining and comparing the Euclidean distance between the clusters in the color space. As shown in FIG. 10, the foreground background designation unit may accept a plurality of foreground color designations. For example, the colors of the plurality of shrimp contained in the work 2 may be slightly different for each individual. In this case, by designating the colors of a plurality of shrimp as a plurality of foreground colors, it is possible to extract various shrimp individuals by image inspection. Similarly, a plurality of background colors may be specified. As shown in FIG. 10, the foreground background designation unit may accept the designation of a plurality of background colors.

図11などに示したようにUI管理部514や表示部7は、フォルスカラー画像における前景色の分布と、背景色の分布とを二次元または三次元の色空間に投影することで、前景色と背景色との分離の程度を表示してもよい。これによりユーザは前景色と背景色とが十分に分離されているかどうかを確認できる。図13などに示したように調整部519は二次元の色空間における前景色の分布を囲む楕円の長軸と短軸とをユーザ操作に応じて調整してもよい。これにより、前景色と背景色との間の分離の程度を大きくすることが可能となる。たとえば、調整部519は、直軸と短軸の調整量に応じて登録色の色情報の一つである分散共分散行列Σにおける明度スケールと色度スケールを調整する。分散共分散行列Σは明度の行列YYと色度行列ZZとに分解できる。さらに、スケールを導入すると、Σ=sy・YY+sz・ZZと表現できる。したがって、明度スケールである係数syと色度スケールである係数szを個別に調整することで、分散共分散行列Σにおける明度と色度を個別に調整することが可能となる。 As shown in FIG. 11 and the like, the UI management unit 514 and the display unit 7 project the foreground color distribution in the false color image and the background color distribution onto a two-dimensional or three-dimensional color space to provide a foreground color. The degree of separation between and the background color may be displayed. This allows the user to check whether the foreground color and the background color are sufficiently separated. As shown in FIG. 13 and the like, the adjusting unit 519 may adjust the major axis and the minor axis of the ellipse surrounding the distribution of the foreground color in the two-dimensional color space according to the user operation. This makes it possible to increase the degree of separation between the foreground color and the background color. For example, the adjustment unit 519 adjusts the brightness scale and the chromaticity scale in the variance-covariance matrix Σ, which is one of the color information of the registered colors, according to the adjustment amount of the linear axis and the minor axis. The variance-covariance matrix Σ can be decomposed into a lightness matrix YY T and a chromaticity matrix ZZ T. Furthermore, when a scale is introduced, it can be expressed as Σ = sy · YY T + sz · ZZ T. Therefore, by individually adjusting the coefficient sy which is the lightness scale and the coefficient sz which is the chromaticity scale, it is possible to individually adjust the lightness and the chromaticity in the variance-covariance matrix Σ.

フォルスカラー画像生成部563は、調整部519により調整された楕円の長軸の調整量と短軸の調整量とに応じてグレー画像を再生成する。調整部519は、再生成(更新された)グレー画像を画像表示領域801に表示してもよい。これによりユーザはグレー画像を確認しながら調整量を決定できるようになる。 The false color image generation unit 563 regenerates a gray image according to the adjustment amount of the major axis and the adjustment amount of the minor axis of the ellipse adjusted by the adjustment unit 519. The adjusting unit 519 may display the regenerated (updated) gray image in the image display area 801. This allows the user to determine the adjustment amount while checking the gray image.

図10や図11などに関連して説明したように、ラジオボタン1012、1014やポインタ706などは表示部7に表示されたフォルスカラー画像において複数のクラスタのうちいずれかのクラスタの代表色を注目色として指定する注目色指定部の一例である。たとえば、ラジオボタン1012、1014やポインタ706などは、フォルスカラー画像における前景領域の色である前景色と背景領域の色である背景色を含む複数の登録色から注目色を指定する注目色指定部の一例である。これによりユーザは任意の登録色を注目色や比較色に指定することが可能となる。調整部519は、表示部7に表示された、二次元または三次元の色空間に投影された注目色の分布を囲む楕円の長軸、短軸および分布の中心座標のうち少なくとも一つを調整する。また、表示部7は、注目色の色分布とともに、注目色と比較される比較色の色分布も表示してもよい。注目色指定部は、注目色として前景色が指定されると、比較色として背景色の指定を受け付けるように構成されていてもよい。また、注目色指定部は、注目色として背景色が指定されると、比較色として前景色の指定を受け付けるように構成されていてもよい。上述したように、比較色は注目色に基づいて自動的に選択されてもよい。 As described in relation to FIGS. 10 and 11, the radio buttons 1012, 1014, the pointer 706, and the like pay attention to the representative color of any one of the plurality of clusters in the false color image displayed on the display unit 7. This is an example of the attention color designation part specified as a color. For example, the radio buttons 1012, 1014, pointer 706, and the like are attention color designation units that specify the attention color from a plurality of registered colors including the foreground color which is the color of the foreground area and the background color which is the color of the background area in the false color image. This is an example. This allows the user to specify any registered color as the attention color or the comparison color. The adjustment unit 519 adjusts at least one of the major axis, the minor axis, and the center coordinates of the ellipse that surrounds the distribution of the color of interest projected on the two-dimensional or three-dimensional color space displayed on the display unit 7. To do. Further, the display unit 7 may display the color distribution of the comparative color to be compared with the color of interest as well as the color distribution of the color of interest. The attention color designation unit may be configured to accept the designation of the background color as the comparison color when the foreground color is designated as the attention color. Further, the attention color designation unit may be configured to accept the designation of the foreground color as the comparison color when the background color is designated as the attention color. As mentioned above, the comparison color may be automatically selected based on the color of interest.

2...ワーク、3...照明装置、4...カメラ、5...画像処理装置、510...プロセッサ、511...MSI処理部、512...照明制御部、513...撮像制御部、531...検査部 2 ... work, 3 ... lighting device, 4 ... camera, 5 ... image processing device, 510 ... processor, 511 ... MSI processing unit, 512 ... lighting control unit, 513 ... Imaging control unit, 331 ... Inspection unit

Claims (13)

検査対象物についての分光画像を取得する取得部と、
前記取得部により取得された分光画像を表示する表示部と、
前記表示部に表示された分光画像において複数の画素を含む領域の指定を受け付ける領域指定部と、
前記領域指定部により指定された各領域に含まれる複数の画素の色空間座標における位置に応じて、前記分光画像を構成する各画素を、複数のクラスタのうちのいずれかのクラスタに所属させるクラスタリング部と、
前記複数のクラスタのそれぞれについて代表色を決定し、前記分光画像を構成する各画素の色を、各画素が属するクラスタの代表色に変換することでフォルスカラー画像を生成するフォルスカラー画像生成部と、
前記表示部に表示されたフォルスカラー画像において抽出対象となる抽出色の指定を受け付ける抽出色指定部と、
前記分光画像の各画素の色と前記抽出色との色空間内での距離に基づいて前記分光画像をグレー画像に変換する変換部と、
前記変換部により生成されたグレー画像を用いて画像検査を実行する検査部と
を有することを特徴とする画像検査装置。
An acquisition unit that acquires a spectroscopic image of the object to be inspected,
A display unit that displays the spectroscopic image acquired by the acquisition unit, and
An area designation unit that accepts designation of a region including a plurality of pixels in the spectroscopic image displayed on the display unit, and
Clustering in which each pixel constituting the spectroscopic image belongs to one of a plurality of clusters according to the position in the color space coordinates of a plurality of pixels included in each region designated by the region designation unit. Department and
A false color image generator that generates a false color image by determining a representative color for each of the plurality of clusters and converting the color of each pixel constituting the spectral image into a representative color of the cluster to which each pixel belongs. ,
An extraction color specification unit that accepts the specification of the extraction color to be extracted in the false color image displayed on the display unit, and the extraction color specification unit.
A conversion unit that converts the spectroscopic image into a gray image based on the distance between the color of each pixel of the spectroscopic image and the extracted color in the color space.
An image inspection apparatus including an inspection unit that executes an image inspection using a gray image generated by the conversion unit.
前記複数のクラスタの数の指定を受け付けるクラスタ数指定部をさらに有し、
前記クラスタリング部は、前記クラスタ数指定部により指定された数のクラスタのいずれかに前記分光画像を構成する各画素を所属させることを特徴とする請求項1に記載の画像検査装置。
It further has a cluster number designation unit that accepts the designation of the number of the plurality of clusters.
The image inspection apparatus according to claim 1, wherein the clustering unit assigns each pixel constituting the spectroscopic image to any of the number of clusters designated by the cluster number designation unit.
前記抽出色指定部は、前記フォルスカラー画像において前景領域の色である前景色と背景領域の色である背景色とのうち少なくとも一方の指定を受け付ける前景背景指定部を有し、
前記変換部は前記前景色に基づいて前記分光画像を前景画像に変換するとともに、前記背景色に基づいて前記分光画像を背景画像に変換するように構成されており、
前記検査部は前記前景画像と前記背景画像とを用いて前記検査対象物の合否を判定するように構成されていることを特徴とする請求項1または2に記載の画像検査装置。
The extracted color designation unit has a foreground background designation unit that accepts at least one designation of a foreground color that is the color of the foreground region and a background color that is the color of the background region in the false color image.
The conversion unit is configured to convert the spectroscopic image into a foreground image based on the foreground color and to convert the spectroscopic image into a background image based on the background color.
The image inspection apparatus according to claim 1 or 2, wherein the inspection unit is configured to determine the pass / fail of the inspection object by using the foreground image and the background image.
前記前景背景指定部は、前記前景色の指定と前記背景色の指定とを個別に受け付けることを特徴とする請求項3に記載の画像検査装置。 The image inspection apparatus according to claim 3, wherein the foreground background designation unit individually receives the designation of the foreground color and the designation of the background color. 前記前景背景指定部は、前記複数のクラスタの代表色のうち色空間において前記前景色に近い代表色を前記背景色に設定することを特徴とする請求項3に記載の画像検査装置。 The image inspection apparatus according to claim 3, wherein the foreground background designation unit sets a representative color close to the foreground color in the color space among the representative colors of the plurality of clusters as the background color. 前記前景背景指定部は、複数の前景色の指定を受け付けることを特徴とする請求項3ないし5のいずれか一項に記載の画像検査装置。 The image inspection apparatus according to any one of claims 3 to 5, wherein the foreground background designation unit accepts a plurality of foreground color designations. 前記前景背景指定部は、複数の背景色の指定を受け付けることを特徴とする請求項3または4に記載の画像検査装置。 The image inspection apparatus according to claim 3 or 4, wherein the foreground background designation unit receives designation of a plurality of background colors. 前記表示部は、前記フォルスカラー画像における前記前景色の分布と、前記背景色の分布とを二次元または三次元の色空間に投影することで、前記前景色と前記背景色との分離の程度を表示することを特徴とする請求項3ないし7のいずれか一項に記載の画像検査装置。 The display unit projects the distribution of the foreground color and the distribution of the background color in the false color image onto a two-dimensional or three-dimensional color space to determine the degree of separation between the foreground color and the background color. The image inspection apparatus according to any one of claims 3 to 7, wherein the image inspection apparatus is displayed. 前記二次元の色空間における前記前景色の分布を囲む楕円の長軸と短軸とを調整する調整部をさらに有することを特徴とする請求項8に記載の画像検査装置。 The image inspection apparatus according to claim 8, further comprising an adjusting unit for adjusting a long axis and a short axis of an ellipse surrounding the distribution of the foreground color in the two-dimensional color space. 前記変換部は、前記調整部により調整された前記楕円の長軸の調整量と短軸の調整量とに応じて前記グレー画像を再生成することを特徴とする請求項9に記載の画像検査装置。 The image inspection according to claim 9, wherein the conversion unit regenerates the gray image according to the adjustment amount of the major axis and the adjustment amount of the minor axis of the ellipse adjusted by the adjustment unit. apparatus. 前記フォルスカラー画像における前景領域の色である前景色と背景領域の色である背景色を含む複数の登録色から注目色を指定する注目色指定部と、
前記表示部は、二次元または三次元の色空間に投影された前記注目色の色分布とともに、前記注目色と比較される比較色の色分布を表示することを特徴とする請求項1に記載の画像検査装置。
An attention color designation unit that specifies an attention color from a plurality of registered colors including a foreground color that is the color of the foreground area and a background color that is the color of the background area in the false color image.
The first aspect of claim 1, wherein the display unit displays a color distribution of a comparative color to be compared with the color of interest together with a color distribution of the color of interest projected in a two-dimensional or three-dimensional color space. Image inspection equipment.
前記注目色指定部は、前記注目色として前記前景色が指定されると、前記比較色として前記背景色の指定を受け付けるように構成されていることを特徴とする請求項11に記載の画像検査装置。 The image inspection according to claim 11, wherein the attention color designation unit is configured to accept the designation of the background color as the comparison color when the foreground color is designated as the attention color. apparatus. 前記注目色指定部は、前記注目色として前記背景色が指定されると、前記比較色として前記前景色の指定を受け付けるように構成されていることを特徴とする請求項11に記載の画像検査装置。 The image inspection according to claim 11, wherein the attention color designation unit is configured to accept the designation of the foreground color as the comparison color when the background color is designated as the attention color. apparatus.
JP2017093360A 2017-05-09 2017-05-09 Image inspection equipment Active JP6893826B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2017093360A JP6893826B2 (en) 2017-05-09 2017-05-09 Image inspection equipment
JP2021091445A JP7117420B2 (en) 2017-05-09 2021-05-31 Image inspection device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2017093360A JP6893826B2 (en) 2017-05-09 2017-05-09 Image inspection equipment

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2021091445A Division JP7117420B2 (en) 2017-05-09 2021-05-31 Image inspection device

Publications (2)

Publication Number Publication Date
JP2018189562A JP2018189562A (en) 2018-11-29
JP6893826B2 true JP6893826B2 (en) 2021-06-23

Family

ID=64480097

Family Applications (2)

Application Number Title Priority Date Filing Date
JP2017093360A Active JP6893826B2 (en) 2017-05-09 2017-05-09 Image inspection equipment
JP2021091445A Active JP7117420B2 (en) 2017-05-09 2021-05-31 Image inspection device

Family Applications After (1)

Application Number Title Priority Date Filing Date
JP2021091445A Active JP7117420B2 (en) 2017-05-09 2021-05-31 Image inspection device

Country Status (1)

Country Link
JP (2) JP6893826B2 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6919982B2 (en) * 2017-05-09 2021-08-18 株式会社キーエンス Image inspection equipment
JP6931552B2 (en) * 2017-05-09 2021-09-08 株式会社キーエンス Image inspection equipment
JP7466862B2 (en) * 2020-06-30 2024-04-15 国立大学法人東北大学 Image processing device, image processing method, and program
WO2025023191A1 (en) * 2023-07-21 2025-01-30 富士フイルム株式会社 Control device, control method, and control program
JP7572762B1 (en) * 2024-08-19 2024-10-24 アキュイティー株式会社 Inspection device, inspection method, and program

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4139571B2 (en) * 2001-02-28 2008-08-27 大日本スクリーン製造株式会社 Color image segmentation
JP4386326B2 (en) * 2002-01-15 2009-12-16 株式会社ハイパーテック Printed circuit board inspection method and apparatus used therefor
JP2003315279A (en) * 2002-04-18 2003-11-06 Matsushita Electric Works Ltd Method of inspecting appearance of building board
CN100458423C (en) * 2003-03-21 2009-02-04 中国印钞造币总公司 Detecting method for color printing quality
JP5495017B2 (en) * 2009-10-01 2014-05-21 スズキ株式会社 Tooth contact surface detection device
CN104484659B (en) * 2014-12-30 2018-08-07 南京巨鲨显示科技有限公司 A method of to Color medical and gray scale image automatic identification and calibration

Also Published As

Publication number Publication date
JP2021128171A (en) 2021-09-02
JP2018189562A (en) 2018-11-29
JP7117420B2 (en) 2022-08-12

Similar Documents

Publication Publication Date Title
JP6919982B2 (en) Image inspection equipment
US10304176B2 (en) Image inspection device
JP7117420B2 (en) Image inspection device
JP6857079B2 (en) Image inspection equipment
JP6917762B2 (en) Image inspection equipment
US10489900B2 (en) Inspection apparatus, inspection method, and program
JP6981775B2 (en) Image inspection equipment and image inspection method
JP6917761B2 (en) Image inspection equipment
US10157456B2 (en) Information processing apparatus, information processing method, and storage medium utilizing technique for detecting an abnormal state such as a scratch on a target
US10863069B2 (en) Image processing system and setting method
CN110945561A (en) Hyperspectral imaging spectrophotometer and system
JP6931552B2 (en) Image inspection equipment
JP6780682B2 (en) Information acquisition system, control device and information acquisition method
JP6791631B2 (en) Image generation method and inspection equipment
US20230252637A1 (en) System and method for improving image segmentation
JP2019046134A (en) Image inspection device, and image inspection method
JP6825067B2 (en) Inspection equipment and its control method
US10708561B2 (en) POS terminal, information processing device, white balance adjustment method, and recording medium
JP2019045510A (en) Inspection device
US11812157B2 (en) Image processing device and image processing program
CN118403811A (en) Ink color sorting method, device and sorting system for printed circuit board
HK1228085A1 (en) Pos terminal, information processing device, white balance adjustment method, and recording medium
JP2016139974A (en) Projection apparatus, image projection system, image projection method, and program

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20190805

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A821

Effective date: 20190805

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20200326

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20210113

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20210317

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20210602

R150 Certificate of patent or registration of utility model

Ref document number: 6893826

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250