JP5947168B2 - Appearance inspection apparatus, control method and program for appearance inspection apparatus - Google Patents

Appearance inspection apparatus, control method and program for appearance inspection apparatus Download PDF

Info

Publication number
JP5947168B2
JP5947168B2 JP2012202268A JP2012202268A JP5947168B2 JP 5947168 B2 JP5947168 B2 JP 5947168B2 JP 2012202268 A JP2012202268 A JP 2012202268A JP 2012202268 A JP2012202268 A JP 2012202268A JP 5947168 B2 JP5947168 B2 JP 5947168B2
Authority
JP
Japan
Prior art keywords
image
unit
illumination
inspection object
imaging
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2012202268A
Other languages
Japanese (ja)
Other versions
JP2014055913A (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 JP2012202268A priority Critical patent/JP5947168B2/en
Publication of JP2014055913A publication Critical patent/JP2014055913A/en
Application granted granted Critical
Publication of JP5947168B2 publication Critical patent/JP5947168B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

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

Description

本発明は、製品の画像を撮像して製品の外観を検査する外観検査装置、外観検査装置の制御方法およびプログラムに関する。   The present invention relates to an appearance inspection apparatus that takes an image of a product and inspects the appearance of the product, a control method for the appearance inspection apparatus, and a program.

コネクタや半導体素子などの製品の外観を撮像してパターンマッチング(画像認識)を行うことで、いわゆる製品の外観検査が実行される。製品のサイズによっては、カメラの撮像範囲に収まらないものがあり、そのような製品については複数の画像を連結することで、製品の全体を表す画像を作成し、外観検査を行っていた(特許文献1、2)。   The appearance of a product such as a connector or a semiconductor element is imaged and pattern matching (image recognition) is performed, whereby a so-called appearance inspection of the product is performed. Depending on the size of the product, there are things that do not fit in the imaging range of the camera, and for such products, an image representing the entire product was created by connecting multiple images, and appearance inspection was performed (patents) References 1, 2).

特開平06−167321号公報Japanese Patent Laid-Open No. 06-167321 特開平09−251536号公報JP 09-251536 A

外観検査の対象となっている製品(検査対象物)の良否を判定するためには、予め検査対象物の端子の端部やコーナー部を基準点として設定したり、複数の端子を結ぶ直線を基準線として設定したりする必要がある。これは、基準点からある部分までの距離が設計により規定された距離になっているかを検査したり、基準線から検査対象物の端部まで下した垂線の距離が設計により規定された距離になっているかを検査したりするためである。このような基準点や基準線を正確に画像から検出するためには、検査対象物に適切な照明を当てなければならない。たとえば、コネクタの外形輪郭を検出するためには、バックライトを使用して外形輪郭と他の部分とのコントラストを高める手法が使用される。しかし、外観検査には様々な検査が含まれており、ある検査に適した照明が他の検査に適していないこともある。たとえば、ある種類の検査にはバックライトのみを使用し、他の種類の検査にはフロントライトのみを使用し、さらに他の種類の検査にはバックライトとフロントライトとの両方を使用するなど、照明を切り替えることがある。   In order to determine the quality of a product (inspection object) that is subject to visual inspection, the end or corner of the terminal of the inspection object is set in advance as a reference point, or a straight line connecting a plurality of terminals is set. Or set as a reference line. This is to inspect whether the distance from the reference point to a certain part is the distance specified by the design, or the distance of the perpendicular line from the reference line to the end of the inspection object is the distance specified by the design. This is to inspect whether it is. In order to accurately detect such a reference point or reference line from an image, it is necessary to apply appropriate illumination to the inspection object. For example, in order to detect the outer contour of the connector, a method of increasing the contrast between the outer contour and other portions using a backlight is used. However, the appearance inspection includes various inspections, and lighting suitable for one inspection may not be suitable for another inspection. For example, one type of inspection uses only the backlight, another type of inspection uses only the front light, and other types of inspection use both the backlight and the front light. The lighting may be switched.

たとえば、コネクタはピン数が多いためにコネクタの全体を複数に分割して撮像することが多いが、それぞれの撮像箇所においても照明条件を変えて複数回撮像することがある。ピンはフロントライトで照らして撮像するとパターン認識がしやすくなり、ハウジングの外形の輪郭はバックライトで浮かび上がらせて撮像するとパターン認識がしやすくなる。ここで問題となるのは、ピンからハウジングの外形までの距離を一枚の画像からは算出できないということである。つまり、ピンとハウジングの角までの距離を算出しようとすると、フロントライトで得られた画像ではピンの位置を認識しやすいが、ハウジングの角の位置を認識しにくいため、正確に距離を算出できない。一方で、バックライトで得られた画像では、ハウジングの角の位置を認識しやすいが、ピンの位置を認識しにくいため、やはり正確に距離を算出できなかった。   For example, since the connector has a large number of pins, the entire connector is often divided into a plurality of images for imaging, but the imaging conditions may be changed a plurality of times at each imaging location. When the pin is illuminated and imaged with the front light, the pattern is easily recognized, and when the contour of the outer shape of the housing is raised with the backlight and imaged, the pattern is easily recognized. The problem here is that the distance from the pin to the outer shape of the housing cannot be calculated from a single image. In other words, when trying to calculate the distance between the pin and the corner of the housing, it is easy to recognize the position of the pin in the image obtained by the front light, but it is difficult to recognize the position of the corner of the housing, so the distance cannot be calculated accurately. On the other hand, in the image obtained with the backlight, it is easy to recognize the position of the corner of the housing, but it is difficult to recognize the position of the pin, so the distance cannot be calculated accurately.

このように照明条件を変えて検査対象物を撮像して得られた複数の画像において、ある画像の基準点から他の画像の基準点までの距離を測定するなど、複数の画像間での寸法測定を実施できなかった。したがって、照明条件の違いによって画像認識しにくいパーツ間の距離などの寸法を正確に求める方法が市場から求められているといえる。   Dimension between multiple images, such as measuring the distance from the reference point of one image to the reference point of another image in multiple images obtained by imaging the inspection object under different illumination conditions. The measurement could not be performed. Therefore, it can be said that there is a demand from the market for a method for accurately obtaining dimensions such as the distance between parts that are difficult to recognize images due to differences in illumination conditions.

そこで、本発明は、照明条件の違いによって画像認識しにくいパーツ間の距離などの寸法を正確に求められるようにすることを目的とする。   Accordingly, an object of the present invention is to accurately obtain dimensions such as the distance between parts that are difficult to recognize images due to differences in illumination conditions.

本発明は、たとえば、検査対象物に対して複数の異なる照明光を照射する照明部と、前記照明部が照射する照明光を切り替えるように当該照明部を制御する照明制御部と、前記照明部によって照明光を照射された前記検査対象物を撮像する撮像部と、外部接続される制御機器から前記撮像部の撮像タイミングを規定する撮像トリガ信号を受信する通信部と、を有し、
前記撮像部により取得された前記検査対象物の画像を用いて前記検査対象物の外観の良否を判定し、その判定結果を示す判定信号を出力する外観検査装置であって、
前記照明部により第1の照明光が照射された検査対象物の所定の領域を前記撮像部が撮像して取得した第1の画像を記憶する第1の画像記憶部と、
前記照明部により第2の照明光が照射された検査対象物の前記所定の領域を前記撮像部が撮像して取得した第2の画像を記憶する第2の画像記憶部と、
前記第1の画像と前記第2の画像とを表示する表示部と、
前記表示部に表示される前記第1の画像を用いて、前記第1の画像から前記検査対象物に関する寸法を計測するの起点となる第1の特徴部分を抽出するための第1の設定を実行するとともに、前記表示部に表示される前記第2の画像を用いて、前記第2の画像から前記検査対象物に関する寸法を計測する際の終点となる第2の特徴部分を抽出するための第2の設定を実行する設定部と、
前記通信部において前記撮像トリガ信号を受信したときに、前記照明部により前記第1の照明光が照射された新たな検査対象物を前記撮像部が撮像して取得した第1の画像から、前記設定部による前記第1の設定に基づき前記第1の特徴部分を抽出するとともに、前記照明部により前記第2の照明光が照射された当該新たな検査対象物を前記撮像部が撮像して取得した第2の画像から、前記設定部による前記第2の設定に基づき前記第2の特徴部分を抽出する画像認識部と、
前記画像認識部により抽出された前記第1の特徴部分から前記第2の特徴部分までの寸法を算出する寸法算出部と
前記寸法算出部により算出された寸法と予め定められた閾値とに基づいて、前記検査対象物の外観の良否を判定する良否判定部と、
前記良否判定部による判定結果を示す判定信号を出力する手段と、
を有することを特徴とする。
The present invention includes, for example, an illumination unit that irradiates a plurality of different illumination lights to an inspection target, an illumination control unit that controls the illumination unit so as to switch illumination light emitted by the illumination unit, and the illumination unit An imaging unit that images the inspection object irradiated with illumination light, and a communication unit that receives an imaging trigger signal that defines the imaging timing of the imaging unit from an externally connected control device ,
An appearance inspection apparatus that determines the quality of the appearance of the inspection object using the image of the inspection object acquired by the imaging unit, and outputs a determination signal indicating the determination result ,
A first image storage unit that stores a first image acquired by the imaging unit imaging a predetermined region of the inspection object irradiated with the first illumination light by the illumination unit;
A second image storage unit for storing a second image acquired by the imaging unit imaging the predetermined region of the inspection object irradiated with the second illumination light by the illumination unit;
A display unit for displaying the first image and the second image;
Using the first image displayed on the display unit, a first setting for extracting a first feature portion that is a starting point when measuring a dimension related to the inspection object from the first image. And the second image displayed on the display unit is used to extract a second feature portion that is an end point when measuring a dimension related to the inspection object from the second image. A setting unit for executing the second setting of
When the imaging unit receives the imaging trigger signal, the imaging unit captures and acquires a new inspection object irradiated with the first illumination light from the illumination unit. The first characteristic portion is extracted based on the first setting by the setting unit, and the imaging unit captures and acquires the new inspection object irradiated with the second illumination light by the illumination unit. An image recognition unit that extracts the second feature portion from the second image based on the second setting by the setting unit;
A dimension calculation unit for calculating a dimension from the first feature part to the second feature part extracted by the image recognition unit ;
A quality determination unit that determines the quality of the appearance of the inspection object based on the dimension calculated by the dimension calculation unit and a predetermined threshold;
Means for outputting a determination signal indicating a determination result by the pass / fail determination unit;
It is characterized by having.

本発明によれば、照明条件が異なる2つの画像に対してそれぞれ異なる特徴部分を設定し、一方の画像に設定された特徴部分と他方の画像に設定された特徴部分とから寸法測定を実施するため、照明条件の違いによって画像認識しにくいパーツ間の距離などの寸法を正確に求められるようになる。   According to the present invention, different characteristic parts are set for two images having different illumination conditions, and dimension measurement is performed from the characteristic part set in one image and the characteristic part set in the other image. Therefore, it is possible to accurately obtain dimensions such as the distance between parts that are difficult to recognize images due to differences in illumination conditions.

図1は、外観検査装置の概略を示す概略図である。FIG. 1 is a schematic view showing an outline of an appearance inspection apparatus. 図2は、外観検査装置のハードウェア構成の一例を示す図である。FIG. 2 is a diagram illustrating an example of a hardware configuration of the appearance inspection apparatus. 図3は、外観検査処理の基本フローを示すフローチャートである。FIG. 3 is a flowchart showing a basic flow of the appearance inspection process. 図4は、パラメータを設定する際の検査対象物とカメラと照明装置の位置関係を示す図である。FIG. 4 is a diagram illustrating a positional relationship among the inspection target, the camera, and the illumination device when setting the parameters. 図5は、検査対象物であるコネクタを3分割し、フロントライトで撮像した画像とバックライトで撮像した画像とを示す図である。FIG. 5 is a diagram illustrating an image captured by the front light and an image captured by the backlight by dividing the connector that is the inspection object into three parts. 図6は、寸法測定の一例を示す図である。FIG. 6 is a diagram illustrating an example of dimension measurement. 図7は、2列目のピンに関する寸法測定の一例を示す図である。FIG. 7 is a diagram illustrating an example of dimension measurement regarding the pins in the second row. 図8は、各ピンの高さを求める方法を示す図である。FIG. 8 is a diagram illustrating a method for obtaining the height of each pin. 図9は、2列目の各ピンについてピン高さを求める例を示す図である。FIG. 9 is a diagram illustrating an example of obtaining the pin height for each pin in the second row. 図10は、撮像回数を設定するためのダイアログを示す図である。FIG. 10 is a diagram showing a dialog for setting the number of times of imaging. 図11は、撮像回数を設定するためのダイアログを示す図である。FIG. 11 is a diagram illustrating a dialog for setting the number of times of imaging. 図12は、ユーザにより設定された撮像回数を視覚的に示すダイアログを示す図である。FIG. 12 is a diagram showing a dialog visually showing the number of times of imaging set by the user. 図13は、複数の画像処理ツールのカテゴリーを示したツールカタログからコネクタカテゴリーがマウスによって選択され、さらに、画像処理ツールとしてコネクタ位置ずれ補正が選択されたことを示す図である。FIG. 13 is a diagram showing that a connector category is selected by a mouse from a tool catalog showing a plurality of image processing tool categories, and further, connector position deviation correction is selected as an image processing tool. 図14は、コネクタ位置ずれ補正に必要となるパラメータを設定するためのUIを示す図である。FIG. 14 is a diagram showing a UI for setting parameters necessary for connector position deviation correction. 図15は、コネクタ位置ずれ補正に必要となるパラメータを設定するためのUIを示す図である。FIG. 15 is a diagram showing a UI for setting parameters necessary for correcting the connector position deviation. 図16は、コネクタ位置ずれ補正に必要となるパラメータを設定するためのUIを示す図である。FIG. 16 is a diagram showing a UI for setting parameters necessary for correcting the connector position deviation. 図17は、コネクタ位置ずれ補正のための設定が終了したことを示すUIの一例を示す図である。FIG. 17 is a diagram illustrating an example of a UI indicating that the setting for correcting the connector displacement has been completed. 図18は、複数の画像処理ツールのカテゴリーを示したツールカタログからコネクタカテゴリーがマウスによって選択され、さらに、画像処理ツールとしてコネクタ寸法検査ツールが選択されたことを示す図である。FIG. 18 is a diagram showing that a connector category is selected by a mouse from a tool catalog showing a plurality of image processing tool categories, and a connector dimension inspection tool is selected as an image processing tool. 図19は、画像の連結点を設定する設定画面を示す図である。FIG. 19 is a diagram showing a setting screen for setting the connection points of images. 図20は、ピン列検出パラメータの設定画面を示す図である。FIG. 20 is a diagram showing a pin row detection parameter setting screen. 図21は、ピンモデルの登録画面を示す図である。FIG. 21 is a diagram illustrating a pin model registration screen. 図22は、ピン検出の設定画面を示す図である。FIG. 22 shows a pin detection setting screen. 図23は、コネクタの中間部についてのサーチ領域、検査領域、基準点の設定画面を示す図である。FIG. 23 is a diagram showing a search area, inspection area, and reference point setting screen for the middle part of the connector. 図24は、コネクタの右端部についてのサーチ領域、検査領域、基準点の設定画面を示す図である。FIG. 24 is a diagram showing a search area, inspection area, and reference point setting screen for the right end of the connector. 図25は、一列目のピンモデルの登録(ピン列検出の設定)が完了したことを示す画面を示す図である。FIG. 25 is a diagram showing a screen indicating that registration of the pin model in the first row (setting for pin row detection) has been completed. 図26は、コネクタの端検出に関する設定を行う設定画面を示す図である。FIG. 26 is a diagram illustrating a setting screen for performing settings related to connector end detection. 図27は、端検出の対象となる端を選択する選択項目を示す図である。FIG. 27 is a diagram illustrating selection items for selecting an end that is an end detection target. 図28は、端検出用のサーチモデルの登録画面を示す図である。FIG. 28 is a diagram showing a registration screen for a search model for edge detection. 図29は、サーチ領域の設定画面を示す図である。FIG. 29 is a diagram showing a search area setting screen. 図30は、端検出用のサーチモデルの登録画面を示す図である。FIG. 30 is a diagram showing a registration screen for a search model for edge detection. 図31は、サーチ領域の設定画面を示す図である。FIG. 31 is a diagram showing a search area setting screen. 図32は、基準点の指定画面を示す図である。FIG. 32 is a diagram showing a reference point designation screen. 図33は、基準点の指定画面を示す図である。FIG. 33 is a diagram showing a reference point designation screen. 図34は、ワーク左端とワーク右端とが正常に設定されたことを示す画面を示す図である。FIG. 34 is a diagram showing a screen indicating that the work left end and the work right end are normally set. 図35は、基準線を設定する設定画面を示す図である。FIG. 35 is a diagram showing a setting screen for setting a reference line. 図36は、基準線の指定方法の選択項目を示す図である。FIG. 36 is a diagram showing selection items of the reference line designation method. 図37は、選択項目から「ハウジングの両端を結んだ線」が基準線として指定されたときの画面を示す図である。FIG. 37 is a diagram showing a screen when “line connecting both ends of the housing” is designated as the reference line from the selection items. 図38は、寸法測定パラメータを設定するメイン画面を示す図である。FIG. 38 is a diagram showing a main screen for setting dimension measurement parameters. 図39は、寸法測定パラメータを設定するための項目選択画面を示す図である。FIG. 39 is a diagram showing an item selection screen for setting dimension measurement parameters. 図40は、選択された測定項目について良否判定に使用されるパラメータを設定する画面を示す図である。FIG. 40 is a diagram showing a screen for setting parameters used for pass / fail judgment for the selected measurement item. 図41は、選択された測定項目について良否判定に使用されるパラメータを設定する画面を示す図である。FIG. 41 is a diagram showing a screen for setting parameters used for pass / fail judgment for the selected measurement item. 図42は、寸法測定パラメータを設定するための項目選択画面を示す図である。FIG. 42 is a diagram showing an item selection screen for setting dimension measurement parameters. 図43は、選択された測定項目について良否判定に使用されるパラメータを設定する画面を示す図である。FIG. 43 is a diagram showing a screen for setting parameters used for pass / fail judgment for the selected measurement item. 図44は、選択された測定項目について良否判定に使用されるパラメータを設定する画面を示す図である。FIG. 44 is a diagram showing a screen for setting parameters used for pass / fail judgment for the selected measurement item. 図45は、複数の画像を連結するための基準となるマークの一例を示す図である。FIG. 45 is a diagram illustrating an example of a mark serving as a reference for connecting a plurality of images. 図46は、画像連結の基準となるマークを設定する設定画面を示す図である。FIG. 46 is a diagram illustrating a setting screen for setting a mark serving as a reference for image connection. 図47は、画像連結の基準となるマークを設定する設定画面を示す図である。FIG. 47 is a diagram showing a setting screen for setting a mark as a reference for image connection. 図48は、画像連結の基準となるマークを設定する設定画面を示す図である。FIG. 48 is a diagram illustrating a setting screen for setting a mark serving as a reference for image connection. 図49は、マークを基準として連結されたフロントライト画像とバックライト画像とを示す図である。FIG. 49 is a diagram showing a front light image and a backlight image connected with a mark as a reference. 図50は、エッジ検出を利用したピンの検出方法を示す図である。FIG. 50 is a diagram illustrating a pin detection method using edge detection. 図51は、エッジ検出を利用したハウジングの検出方法を示す図である。FIG. 51 is a diagram illustrating a housing detection method using edge detection. 図52は、外観検査装置の機能ブロック図である。FIG. 52 is a functional block diagram of the appearance inspection apparatus. 図53は、外観検査に関するパラメータの設定処理から良品判定までを含む一連の工程を示したフローチャートである。FIG. 53 is a flowchart showing a series of steps including a parameter setting process related to appearance inspection and non-defective product determination.

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

図1は、外観検査装置1の概略を示す概略図である。外観検査装置1は、コントローラ2と、プログラマブルロジックコントローラ(PLC)3と、カメラ4と、照明装置5(フロントライト51、バックライト52)と、マウス9と、モニタ10と、プログラム作成支援装置11とを有している。PLC3によって制御されるベルトコンベヤなどの搬送装置7によって検査対象物8が搬送され、フロントライト51やバックライト52などの照明装置によって照明された検査対象物8がカメラ4によって撮像される。コントローラ2は、たとえば、PLC3からの命令にしたがって、検査対象物8を照明すべき照明装置を切り替えたり、カメラ4に撮像を実行させたりする。   FIG. 1 is a schematic diagram showing an outline of the appearance inspection apparatus 1. The appearance inspection apparatus 1 includes a controller 2, a programmable logic controller (PLC) 3, a camera 4, a lighting device 5 (front light 51 and backlight 52), a mouse 9, a monitor 10, and a program creation support device 11. And have. The inspection object 8 is conveyed by the conveying device 7 such as a belt conveyor controlled by the PLC 3, and the inspection object 8 illuminated by the illumination device such as the front light 51 and the backlight 52 is imaged by the camera 4. For example, the controller 2 switches the illumination device to illuminate the inspection object 8 or causes the camera 4 to perform imaging in accordance with a command from the PLC 3.

コントローラ2は検査対象物(ワーク)8の画像からエッジ検出や面積計算などの各種計測処理を実行する。カメラ4から得られた画像データを用いて画像処理を実行し、外部接続されたPLC3などの制御機器に対し、検査対象物8の良否などの判定結果を示す信号として判定信号を出力する。   The controller 2 executes various measurement processes such as edge detection and area calculation from the image of the inspection object (work) 8. Image processing is executed using image data obtained from the camera 4, and a determination signal is output as a signal indicating a determination result such as pass / fail of the inspection object 8 to an externally connected control device such as the PLC 3.

カメラ4は、検査対象物8を撮像する撮像素子を有するカメラモジュールを備えている。撮像素子としては、たとえばCMOS(相補型金属酸化膜半導体)やCCD(電荷結合素子)を用いることができる。PLC3から入力される制御信号、たとえばカメラ4から画像データを取り込むタイミングを規定する撮像トリガ信号に基づいて、検査対象物8の撮像を行う。   The camera 4 includes a camera module having an image sensor that images the inspection object 8. As the imaging device, for example, a CMOS (complementary metal oxide semiconductor) or a CCD (charge coupled device) can be used. The inspection object 8 is imaged on the basis of a control signal input from the PLC 3, for example, an imaging trigger signal that defines the timing for capturing image data from the camera 4.

モニタ10は、液晶パネルや自発光式パネル等の表示装置である。検査対象物8を撮像して得られた画像や、その画像データを用いた計測処理の結果を表示する。モニタ10は、パターンマッチング用の比較データ(モデル画像)を作成するために使用される基準画像など、良品から取得された画像を表示してもよい。   The monitor 10 is a display device such as a liquid crystal panel or a self-luminous panel. An image obtained by imaging the inspection object 8 and a result of measurement processing using the image data are displayed. The monitor 10 may display an image acquired from a non-defective product such as a reference image used for creating comparison data (model image) for pattern matching.

マウス9は、ユーザがモニタ10上で各種操作するため(モニタ10がタッチパネルなら省略可)の入力装置である。マウス9は、モニタ10上で各メニュー項目を選択したり、パラメータ値を設定したりする。マウス9は、ポインティングデバイスの一例である。ユーザは、モニタ10を視認することで、コントローラ2の運転中の動作状態を確認することができる。また、ユーザは、モニタ10を視認しつつ、マウス9を操作することによって、必要に応じて各種設定や各種編集を行うことができる。   The mouse 9 is an input device for the user to perform various operations on the monitor 10 (can be omitted if the monitor 10 is a touch panel). The mouse 9 selects each menu item on the monitor 10 and sets a parameter value. The mouse 9 is an example of a pointing device. The user can check the operating state of the controller 2 during operation by visually checking the monitor 10. Further, the user can perform various settings and various edits as necessary by operating the mouse 9 while viewing the monitor 10.

照明装置5は、検査対象物8を照明する装置であり、図1では、フロントライト51、バックライト52が示されている。照明装置5としては、これら以外にも、たとえば、光沢を際立たせる同軸落射照明、傷や刻印のエッジが際立つローアングル照明、ブラックライトを当てるブラックライト照明、バックライト52として用いられる面照明(フロントライト51とは反対側から照明を与え、検査対象物の透過光または影を観察するための透過照明)、四方八方から拡散光を照射するドーム照明など、各種の照明を行う照明装置が採用されてもよい。特に、同軸落射照明は、視野全体に略均一に照明を当てる照明手法であり、カメラ4と照明装置5をV字に配置して検査対象物8からの正反射光を受光する照明手法とほぼ同様の効果が得られる利点がある。また、ローアングル照明は、たとえばLED等の投光素子をリング状に配置し、検査対象物8の表面を浅い角度で全周方向から光を照らす照明手法である。検査対象物8の表面に当たった光はカメラ4の方向には反射せず、刻印や傷のエッジ部分で反射した光だけが受光される。すなわち、照射角度が非常に浅い角度であるため、光沢面では反射が弱く、検査対象物8上の僅かな傷やエッジでのみ強い反射が得られ、はっきりとしたコントラストが得られる。別の表現をすると、フロントライト51は、検査対象物8の表面の特徴(テクスチャ、エッジ等)を抽出するための照明であって、カメラの設置側から照明光を照射する。バックライト52は、検査対象物8の輪郭(または縁部)を抽出するための照明であって、カメラの設置側とは反対側から照明光を照射する。バックライト52について更に別の言い方をすると、検査対象物8を挟んでカメラと反対方向から光を照射するものである。   The illumination device 5 is a device that illuminates the inspection object 8, and in FIG. 1, a front light 51 and a backlight 52 are shown. In addition to these, the illumination device 5 includes, for example, coaxial epi-illumination that highlights gloss, low-angle illumination that highlights scratches and stamped edges, black-light illumination that shines black light, and surface illumination that is used as the backlight 52 (front Illumination devices that perform various types of illumination, such as dome illumination that illuminates from the opposite side of the light 51 and observes the transmitted light or shadow of the inspection object, and diffused light from all sides, are adopted. May be. In particular, the coaxial epi-illumination is an illumination method that illuminates the entire visual field substantially uniformly, and is almost the same as the illumination method in which the camera 4 and the illumination device 5 are arranged in a V shape to receive specularly reflected light from the inspection object 8. There is an advantage that the same effect can be obtained. The low-angle illumination is an illumination technique in which light projecting elements such as LEDs are arranged in a ring shape to illuminate the surface of the inspection object 8 at a shallow angle from the entire circumference. The light that hits the surface of the inspection object 8 is not reflected in the direction of the camera 4, and only the light reflected by the stamped or scratched edge portion is received. That is, since the irradiation angle is a very shallow angle, reflection on the glossy surface is weak, and strong reflection is obtained only with a few scratches or edges on the inspection object 8, and a clear contrast is obtained. In other words, the front light 51 is illumination for extracting features (texture, edges, etc.) of the surface of the inspection object 8, and irradiates illumination light from the camera installation side. The backlight 52 is illumination for extracting the outline (or edge) of the inspection object 8, and irradiates illumination light from the side opposite to the camera installation side. In other words, the backlight 52 irradiates light from the opposite direction to the camera with the inspection object 8 interposed therebetween.

プログラム作成支援装置11は、コントローラ2が実行する制御プログラムを作成するためのコンピュータ(PC)である。制御プログラムは、以下で説明するような外観検査に関するそれぞれ異なる計測を実行するための複数の計測処理モジュールを有している。コントローラ2は、設定された順番に沿って各種計測処理モジュールを呼び出して実行する。プログラム作成支援装置11とコントローラ2とは、通信ネットワークを介して接続されており、プログラム作成支援装置11上で生成された制御プログラムやパラメータ値等の設定情報は、コントローラ2に転送される。また逆に、コントローラ2から制御プログラムやパラメータ値等の設定情報などを取り込んで、プログラム作成支援装置11上で編集することもできる。   The program creation support device 11 is a computer (PC) for creating a control program executed by the controller 2. The control program has a plurality of measurement processing modules for executing different measurements relating to the appearance inspection described below. The controller 2 calls and executes various measurement processing modules in the set order. The program creation support apparatus 11 and the controller 2 are connected via a communication network, and control information and setting information such as parameter values generated on the program creation support apparatus 11 are transferred to the controller 2. Conversely, setting information such as a control program and parameter values can be taken from the controller 2 and edited on the program creation support apparatus 11.

工場において、複数の検査対象物8は、コンベアなどの搬送装置7のライン上を流れてくる。コントローラ2は、検査対象物8の上方(または側方、下方)に設置されているカメラ4により検査対象物8を撮像し、撮像した画像を基準画像(たとえば良品を撮像した画像)や基準画像から作成したモデル画像と比較して、検査対象物8に傷や欠陥等が存在するか否かの判断を行う。検査対象物8に傷や欠陥等が存在すると判断した場合には、NG判定となる。一方、検査対象物8に傷や欠陥等が存在しないと判断した場合には、OK判定となる。このように、外観検査装置1は、検査対象物8を撮像した画像を用いて、検査対象物8の外観の良否判定を行う。   In a factory, a plurality of inspection objects 8 flow on a line of a transfer device 7 such as a conveyor. The controller 2 images the inspection object 8 with the camera 4 installed above (or on the side and below) of the inspection object 8, and uses the captured image as a reference image (for example, an image of a non-defective product) or a reference image. In comparison with the model image created from the above, it is determined whether or not the inspection object 8 has scratches or defects. If it is determined that the inspection object 8 has scratches, defects, or the like, an NG determination is made. On the other hand, when it is determined that there is no scratch or defect on the inspection object 8, an OK determination is made. As described above, the appearance inspection apparatus 1 determines the quality of the appearance of the inspection object 8 using the image obtained by imaging the inspection object 8.

検査対象物8の外観検査を行う場合、検査に用いる各種パラメータの内容(パラメータ値等)を設定する必要がある。パラメータとしては、たとえば、シャッタースピードなどの撮像条件を規定する撮像パラメータ、照度などの照明条件を規定する照明パラメータ、どのような検査を行うかを示す検査条件を規定する計測処理パラメータ(いわゆる検査パラメータ)等がある。外観検査装置1では、良否判定を行う前に、これらの各種パラメータの内容を設定する。   When the appearance inspection of the inspection object 8 is performed, it is necessary to set the contents (parameter values, etc.) of various parameters used for the inspection. The parameters include, for example, imaging parameters that define imaging conditions such as shutter speed, illumination parameters that specify illumination conditions such as illuminance, and measurement processing parameters that specify inspection conditions indicating what kind of inspection to perform (so-called inspection parameters) ) Etc. In the appearance inspection apparatus 1, the contents of these various parameters are set before quality determination.

外観検査装置1は、実際に搬送装置7のライン上を次々と流れてくる検査対象物8の外観検査を行うモード、すなわち実際に検査対象物8の良否判定を行う運転モード(Runモード)と、検査に用いる各種パラメータの内容の設定を行う設定モード(非Runモード)とを有しており、これらのモードを切り替えるためのモード切替手段を有している。ユーザは、運転モードにおいて、搬送装置7のライン上を流れてくる複数の検査対象物8に対して良否判定が繰り返し行われる前に、設定モードにおいて、各種パラメータに対して最適なパラメータ値を設定(調整)する。基本的に、各種パラメータに対してはデフォルト値が設定されており、ユーザがパラメータ値としてデフォルト値が最適であると判断した場合には、特段、パラメータ値を調整する必要はない。しかし、実際のところ、周囲の照明環境、カメラ4の取り付け位置、カメラ4の姿勢ずれ、ピント調整等の相違に起因して、デフォルト値のままではユーザが望む判定結果を得ることができない場合がある。そこで、設定モードにおいて、コントローラ2のモニタ10上またはプログラム作成支援装置11上にて、運転モードから設定モードに切り換え、各種パラメータの内容を編集できるようになっている。   The appearance inspection apparatus 1 is a mode in which an appearance inspection of the inspection object 8 that actually flows one after another on the line of the transport device 7, that is, an operation mode (Run mode) in which the quality of the inspection object 8 is actually judged. And a setting mode (non-run mode) for setting the contents of various parameters used for inspection, and mode switching means for switching between these modes. In the operation mode, the user sets optimum parameter values for various parameters in the setting mode before the pass / fail determination is repeatedly performed on the plurality of inspection objects 8 flowing on the line of the transfer device 7. (adjust. Basically, default values are set for various parameters, and when the user determines that the default values are optimal as the parameter values, there is no need to adjust the parameter values. However, in reality, there may be a case where the determination result desired by the user cannot be obtained with the default values due to differences in the surrounding lighting environment, the mounting position of the camera 4, the posture deviation of the camera 4, focus adjustment, and the like. is there. Therefore, in the setting mode, the operation mode can be switched to the setting mode on the monitor 10 of the controller 2 or the program creation support apparatus 11, and the contents of various parameters can be edited.

<外観検査装置1のハードウェア構成>
図2は、外観検査装置1のハードウェア構成の一例を示す図である。
<Hardware Configuration of Appearance Inspection Apparatus 1>
FIG. 2 is a diagram illustrating an example of a hardware configuration of the appearance inspection apparatus 1.

主制御部21は、各種プログラムに基づき数値計算や情報処理を行うとともに、ハードウェア各部の制御を行う。たとえば、中間演算処理装置としてのCPU22と、主制御部21が各種プログラムを実行する際のワークエリアとして機能するRAMなどのワークメモリ23と、起動プログラムや初期化プログラムなどが格納されたROM、フラッシュROMまたはEEPROMなどのプログラムメモリ24とを有している。   The main control unit 21 performs numerical calculation and information processing based on various programs, and controls each part of the hardware. For example, a CPU 22 as an intermediate processing unit, a work memory 23 such as a RAM that functions as a work area when the main control unit 21 executes various programs, a ROM and a flash that store startup programs, initialization programs, and the like And a program memory 24 such as a ROM or an EEPROM.

照明制御部26は、主制御部21のCPU22やPLC3からの命令に基づいて、フロントライト51やバックライト52などに対して照明制御信号を送信する。   The illumination control unit 26 transmits an illumination control signal to the front light 51, the backlight 52, and the like based on instructions from the CPU 22 and the PLC 3 of the main control unit 21.

画像入力部25は、カメラ4での撮像により得られた画像データを取り込むASIC(Application Specific Integrated Circuit)などから構成される。画像入力部25には、画像データをバッファリングするためのフレームバッファが含まれていてもよい。具体的に、画像入力部25は、CPU22からカメラ4の撮像指令を受信すると、カメラ4に対して画像データ取り込み信号を送信する。そして、画像入力部25は、カメラ4で撮像が行われた後、撮像して得られた画像データを取り込む。取り込んだ画像データは、一旦バッファリング(キャッシュ)される。   The image input unit 25 includes an application specific integrated circuit (ASIC) that captures image data obtained by imaging with the camera 4. The image input unit 25 may include a frame buffer for buffering image data. Specifically, when receiving an imaging command for the camera 4 from the CPU 22, the image input unit 25 transmits an image data capture signal to the camera 4. Then, the image input unit 25 captures image data obtained by imaging after the camera 4 performs imaging. The captured image data is temporarily buffered (cached).

操作入力部27は、マウス9からの操作信号が入力される。操作入力部27は、ユーザの操作に基づきマウス9からの操作信号を受信するインターフェース(I/F)として機能する。   The operation input unit 27 receives an operation signal from the mouse 9. The operation input unit 27 functions as an interface (I / F) that receives an operation signal from the mouse 9 based on a user operation.

モニタ10には、マウス9を用いたユーザの操作内容が表示される。具体的に説明すると、マウス9を操作することによって、ユーザはモニタ10上で、画像処理の制御プログラムを編集したり、各計測処理モジュールのパラメータ値を編集したり、カメラ4の撮像条件を設定したり、基準画像の中で特徴的な部分をモデル画像として登録したり、サーチ領域内をサーチしてモデル画像に一致した領域を検査領域として設定したりと、様々なことを行うことができる。   On the monitor 10, the user's operation content using the mouse 9 is displayed. Specifically, by operating the mouse 9, the user edits the image processing control program, edits the parameter value of each measurement processing module, and sets the imaging condition of the camera 4 on the monitor 10. Or register a characteristic part of the reference image as a model image, or search the search area and set an area that matches the model image as an inspection area. .

表示制御部28は、モニタ10に対して画像を表示させる表示用DSPなどから構成される。表示制御部28には、画像を表示させる際に画像データを一時記憶するVRAMなどのビデオメモリが含まれていてもよい。CPUから送られてきた表示指令(表示コマンド)に基づいて、モニタ10に対して所定の画像(映像)を表示させるための制御信号を送信する。たとえば、計測処理前または計測処理後の画像データを表示するために、モニタ10に対して制御信号を送信する。また、表示制御部28は、マウス9を用いたユーザの操作内容をモニタ10に表示させるための制御信号も送信する。   The display control unit 28 includes a display DSP that displays an image on the monitor 10. The display control unit 28 may include a video memory such as a VRAM that temporarily stores image data when an image is displayed. Based on a display command (display command) sent from the CPU, a control signal for displaying a predetermined image (video) on the monitor 10 is transmitted. For example, a control signal is transmitted to the monitor 10 in order to display image data before or after the measurement process. The display control unit 28 also transmits a control signal for causing the monitor 10 to display the user's operation content using the mouse 9.

通信部29は、外部のPLC3やプログラム作成支援装置11などと通信可能に接続される。たとえば、通信部29は、検査対象物8の到着タイミングを認識するために製造ラインに設置され、PLC3に接続されたセンサ(光電センサ等、図示せず)からトリガ入力があったときに、PLC3から撮像トリガ信号を受信するインターフェース(I/F)として機能する。また、通信部29は、プログラム作成支援装置11から転送されてくるコントローラ2の制御プログラムなどを受信するインターフェース(I/F)としても機能する。   The communication unit 29 is communicably connected to the external PLC 3 and the program creation support device 11. For example, the communication unit 29 is installed in the production line in order to recognize the arrival timing of the inspection object 8, and when there is a trigger input from a sensor (photoelectric sensor or the like, not shown) connected to the PLC 3, the PLC 3 Functions as an interface (I / F) for receiving an imaging trigger signal from the camera. The communication unit 29 also functions as an interface (I / F) that receives the control program of the controller 2 transferred from the program creation support apparatus 11.

画像処理部30は、エッジ検出や面積計算などの計測処理を実行する演算用DSPなどから構成される。画像処理部30には、計測処理用に画像データを記憶するメモリが含まれていてもよい。画像処理部30は、画像データに対する計測処理を実行する。具体的に、画像処理部30は、まず画像入力部25のフレームバッファから画像データを読み出して、画像処理部30内のメモリへ内部転送を行う。そして、画像処理部30は、そのメモリに記憶された画像データを読み出して、計測処理を実行する。   The image processing unit 30 includes a calculation DSP that executes measurement processing such as edge detection and area calculation. The image processing unit 30 may include a memory that stores image data for measurement processing. The image processing unit 30 executes a measurement process on the image data. Specifically, the image processing unit 30 first reads image data from the frame buffer of the image input unit 25 and performs internal transfer to the memory in the image processing unit 30. Then, the image processing unit 30 reads the image data stored in the memory and executes measurement processing.

プログラムメモリ24は、照明制御部26、画像入力部25、操作入力部27、表示制御部28、通信部29、および画像処理部30の各部を、CPU22のコマンド等により制御するための制御プログラムを格納している。また、プログラム作成支援装置11から転送されてきた制御プログラムは、プログラムメモリ24に格納される。   The program memory 24 is a control program for controlling each part of the illumination control unit 26, the image input unit 25, the operation input unit 27, the display control unit 28, the communication unit 29, and the image processing unit 30 with commands of the CPU 22. Storing. Further, the control program transferred from the program creation support apparatus 11 is stored in the program memory 24.

CPU22は、通信部29を介してPLC3から撮像トリガ信号を受信すると、画像入力部25に対して撮像指令(コマンド)を送る。また、CPU22は、制御プログラムに基づいて、画像処理部30に対して、実行すべき画像処理を指示するコマンドを送信する。なお、撮像トリガ信号を生成する装置として、PLC3ではなく、光電センサなどのトリガ入力用のセンサを通信部29に直接接続してもよい。   When the CPU 22 receives an imaging trigger signal from the PLC 3 via the communication unit 29, the CPU 22 sends an imaging command (command) to the image input unit 25. Further, the CPU 22 transmits a command for instructing image processing to be executed to the image processing unit 30 based on the control program. In addition, as a device for generating the imaging trigger signal, a trigger input sensor such as a photoelectric sensor may be directly connected to the communication unit 29 instead of the PLC 3.

これらの各ハードウェアは、バスなどの電気的な通信路(配線)を介し、通信可能に接続されている。   These pieces of hardware are communicably connected via an electrical communication path (wiring) such as a bus.

<計測モジュール(画像処理ツール)>
ここでは、外観検査を実行する計測モジュールを画像処理ツールと呼ぶことにする。画像処理ツールには様々なものがあり、主要な画像処理ツールとしては、エッジ位置計測ツール、エッジ角度計測ツール、エッジ幅計測ツール、エッジピッチ計測ツール、エリア計測ツール、ブロブ計測ツール、パターンサーチ計測ツール、傷計測ツールなどがある。
●エッジ位置計測ツール:検査対象物8の画像が表示される画面上において、エッジ位置を検出したい検査領域に対してウインドウを設定することにより、設定された検査領域内で、任意の方向にスキャンして複数のエッジ(明から暗に切り替わる箇所または暗から明に切り替わる箇所)を検出する。検出した複数のエッジから、一のエッジの指定を受け付け、指定を受け付けたエッジの位置を計測する。
●エッジ角度計測ツール:設定を受け付けた検査領域内に2つのセグメントを設定し、それぞれのセグメントで検出したエッジからの検査対象物8の傾斜角度を計測する。傾斜角度は、たとえば時計回りを正とすることができる。
●エッジ幅計測ツール:設定を受け付けた検査領域内で、任意の方向にスキャンして複数のエッジを検出し、検出した複数のエッジ間の幅を計測する。
●エッジピッチ計測ツール:設定を受け付けた検査領域内で、任意の方向にスキャンして複数のエッジを検出する。検出した複数のエッジ間の距離(角度)の最大値/最小値や平均値を計測する。
●エリア計測ツール:カメラ4で撮像した検査対象物8の画像を二値化処理して、白色領域または黒色領域の面積を計測する。たとえば、計測する対象として白色領域または黒色領域の指定をパラメータとして受け付けることにより、白色領域または黒色領域の面積を計測する。
●ブロブ計測ツール:カメラ4で撮像した検査対象物8の画像を二値化処理して、同一の輝度値(255または0)の画素の集合(ブロブ)に対してパラメータとしての数、面積、重心位置等を計測する。
●パターンサーチ計測ツール:比較対象とする画像パターン(モデル画像)を事前に記憶装置に記憶しておき、撮像した検査対象物8の画像の中から記憶してある画像パターンに類似している部分を検出することで、画像パターンの位置、傾斜角度、相関値を計測する。
●傷計測ツール:設定を受け付けた検査領域内で、小領域(セグメント)を移動させて画素値の平均濃度値を算出し、閾値以上の濃度差となった位置を傷が存在すると判定する。
●その他にも、検査領域内の文字情報を切り出して辞書データ等と照合することで文字列を認識するOCR認識ツール、画像上に設定したウインドウ(領域)をシフトさせながら、各ウインドウの位置においてエッジの検出を繰り返す機能を有するトレンドエッジツール、設定したウインドウ内の濃淡の平均、偏差等を計測する機能を有する濃淡ツール、設定したウインドウ内の濃度の平均、偏差等を計測する機能を有する濃度ツールなどもあり、ユーザは検査内容に応じて必要な画像処理ツールを選択することができる。なお、これらの画像処理ツールは、典型的な機能およびその実現方法の代表例を示すものに過ぎない。あらゆる画像処理に対応する画像処理ツールが本願発明の対象になり得る。
<Measurement module (image processing tool)>
Here, the measurement module that performs the appearance inspection is referred to as an image processing tool. There are various image processing tools. The main image processing tools are edge position measurement tool, edge angle measurement tool, edge width measurement tool, edge pitch measurement tool, area measurement tool, blob measurement tool, and pattern search measurement. Tools, scratch measurement tools, etc.
● Edge position measurement tool: By setting a window for the inspection area where the edge position is to be detected on the screen on which the image of the inspection object 8 is displayed, scanning is performed in any direction within the set inspection area. Thus, a plurality of edges (locations switching from light to dark or locations switching from dark to light) are detected. The specification of one edge is received from the detected plurality of edges, and the position of the edge that has received the specification is measured.
Edge angle measurement tool: Two segments are set in the inspection region for which the setting has been received, and the inclination angle of the inspection object 8 from the edge detected in each segment is measured. The tilt angle can be positive, for example, clockwise.
Edge width measurement tool: Detects a plurality of edges by scanning in an arbitrary direction within the inspection region that has received the setting, and measures the width between the detected edges.
● Edge pitch measurement tool: Scans in any direction within the inspection area that accepts the settings to detect multiple edges. The maximum value / minimum value and average value of the distances (angles) between the detected edges are measured.
Area measurement tool: The image of the inspection object 8 imaged by the camera 4 is binarized to measure the area of the white area or black area. For example, the area of the white region or the black region is measured by accepting the specification of a white region or a black region as a parameter to be measured.
Blob measuring tool: the image of the inspection object 8 imaged by the camera 4 is binarized, and the number, area, and parameters as a set of pixels (blob) having the same luminance value (255 or 0) Measure the center of gravity.
Pattern search measurement tool: A part similar to an image pattern stored in advance in an image of the inspection object 8 that has been stored in advance in an image pattern (model image) to be compared. By detecting this, the position, inclination angle, and correlation value of the image pattern are measured.
Scratch measurement tool: A small area (segment) is moved within the inspection area where the setting is received to calculate an average density value of pixel values, and a position where a density difference equal to or greater than a threshold value is determined to be scratched.
● In addition, OCR recognition tool that recognizes character strings by cutting out character information in the inspection area and collating it with dictionary data, etc., while shifting the window (area) set on the image, at each window position Trend edge tool with a function to repeat edge detection, density tool with a function to measure the average and deviation of the density in the set window, density with a function to measure the average and deviation of the density in the set window There are tools and the like, and the user can select a necessary image processing tool in accordance with the inspection contents. Note that these image processing tools are merely representative examples of typical functions and their implementation methods. An image processing tool corresponding to any image processing can be a subject of the present invention.

<外観検査の基本フロー>
図3は、外観検査処理の基本フローを示すフローチャートである。外観検査処理は、検査対象物8の良否を判定するために必要となるモデル画像、検査領域、サーチ領域、検出点(以下、基準点と称す)、基準線、公差などの閾値を設定する設定モードと、実際に検査対象物8を撮像してパターンマッチングを実行して良否を判定する運転モードとに分かれている。なお、検査用のパラメータを適切に設定するために、設定モードと運転モードとを繰り返し実行することが一般的である。
<Basic flow of visual inspection>
FIG. 3 is a flowchart showing a basic flow of the appearance inspection process. The appearance inspection process is a setting for setting threshold values such as a model image, an inspection area, a search area, a detection point (hereinafter referred to as a reference point), a reference line, and a tolerance necessary for determining the quality of the inspection object 8. The operation mode is divided into a mode and an operation mode in which the inspection object 8 is actually imaged and pattern matching is executed to determine pass / fail. In order to appropriately set the inspection parameters, it is common to repeatedly execute the setting mode and the operation mode.

S301で、CPU22は、画像入力部25を通じてカメラ4に撮像命令を送信することで、カメラ4に撮像を実行させる。CPU22は、カメラ4により取得された画像データを、表示制御部28を通じてモニタ10に表示させる。ユーザは、モニタ10に表示された画像を視認することで、カメラ4の姿勢や照明装置5の照明状態を確認する。   In S <b> 301, the CPU 22 transmits an imaging command to the camera 4 through the image input unit 25 to cause the camera 4 to perform imaging. The CPU 22 displays the image data acquired by the camera 4 on the monitor 10 through the display control unit 28. The user visually confirms the image displayed on the monitor 10 to confirm the posture of the camera 4 and the illumination state of the illumination device 5.

S302で、CPU22は、マウス9によって入力された指示に基づいてカメラ4のシャッタースピードなどの露光条件を調整する。なお、ユーザは、カメラ4の姿勢を手動で調整してもよい。   In S <b> 302, the CPU 22 adjusts exposure conditions such as the shutter speed of the camera 4 based on the instruction input by the mouse 9. Note that the user may manually adjust the posture of the camera 4.

S303で、CPU22は、搬送装置7の撮像位置に配置された検査対象物8の画像をワーク画像として取り込むために、カメラ4に撮像命令を送信する。なお、ワーク画像は、不揮発性メモリに記憶されて繰り返し使用される基準画像であってもよいし、モデル画像を作成するためにその都度撮像される都度画像であってもよい。ここでは、ワーク画像はワークメモリ23に記憶される。なお、モデル画像は基準画像から作成してもよい。   In S <b> 303, the CPU 22 transmits an imaging command to the camera 4 in order to capture an image of the inspection object 8 arranged at the imaging position of the transport device 7 as a work image. Note that the work image may be a reference image that is stored in the nonvolatile memory and repeatedly used, or may be an image that is captured each time in order to create a model image. Here, the work image is stored in the work memory 23. The model image may be created from the reference image.

S304で、CPU22は、位置ずれ補正の設定処理を実行する。カメラ4によって取得された画像において、検査対象物8の画像の位置が理想位置からずれていることがある。そこで、CPU22は、検査対象物8の画像を回転したり、シフトしたりすることで、位置ずれを補正する。なお、位置ずれ補正は、画像処理部30が実行してもよい。   In S304, the CPU 22 executes a misalignment correction setting process. In the image acquired by the camera 4, the position of the image of the inspection object 8 may be shifted from the ideal position. Therefore, the CPU 22 corrects misalignment by rotating or shifting the image of the inspection object 8. Note that the image processing unit 30 may execute the positional deviation correction.

S305で、CPU22は、上述した各種の画像処理ツールを設定する。たとえば、外観検査においてどの計測を実行するかや、計測を実行するために必要となるサーチ領域、検査領域、基準点などが設定される。   In S305, the CPU 22 sets the various image processing tools described above. For example, which measurement is performed in the appearance inspection, and a search area, an inspection area, a reference point, and the like necessary for performing the measurement are set.

S306で、CPU22は、外観検査で必要となるパラメータ(例:公差などの検査閾値)を、マウス9によって入力された指示に基づいて設定する。S307で、CPU22は、設定モードから運転モードに切り替える。   In step S <b> 306, the CPU 22 sets parameters (e.g., inspection threshold such as tolerance) necessary for appearance inspection based on an instruction input by the mouse 9. In S307, the CPU 22 switches from the setting mode to the operation mode.

S308で、CPU22は、PLC3からの指示にしたがって検査対象物8をカメラ4で撮像し、画像処理部30にパターンマッチングを実行させ、実行結果に基づいて良否を判定し、判定結果をPLC3に出力したり、モニタ10に出力したりする。   In S308, the CPU 22 images the inspection object 8 with the camera 4 in accordance with an instruction from the PLC 3, causes the image processing unit 30 to perform pattern matching, determines pass / fail based on the execution result, and outputs the determination result to the PLC 3. Or output to the monitor 10.

S309で、CPU22は、マウス9からモードの切り替え指示が入力されると、運転モードから設定モードに切り替える。S310で、CPU22は、マウス9によって入力された指示に基づいてパラメータを再設定する。   In S309, when a mode switching instruction is input from the mouse 9, the CPU 22 switches from the operation mode to the setting mode. In S310, the CPU 22 resets the parameters based on the instruction input by the mouse 9.

<パラメータの設定>
図4は、パラメータを設定する際の検査対象物8と、カメラ4と、照明装置5の位置関係を示している。検査対象物8は、複数のピンを有したIC(集積回路)、複数の半田ボールを有したBGA(ボールグリッドアレイ)などであってもよいが、ここでは、説明の便宜上、樹脂製のハウジング40と複数のピン41とを有したコネクタと仮定する。
<Parameter settings>
FIG. 4 shows the positional relationship among the inspection object 8, the camera 4, and the illumination device 5 when setting parameters. The inspection object 8 may be an IC (integrated circuit) having a plurality of pins, a BGA (ball grid array) having a plurality of solder balls, etc., but here, for convenience of explanation, a resin housing Assume a connector having 40 and a plurality of pins 41.

照明装置5であるバックライト52は、搬送装置7を挟んでカメラ4に対向するように配置されており、検査対象物8の後ろ側から検査対象物8を照明する。フロントライト51は、リング照明装置であり、搬送装置7から見てカメラ4と同じ側に配置されており、検査対象物8の前側から照明する。   The backlight 52, which is the illumination device 5, is disposed so as to face the camera 4 with the transport device 7 interposed therebetween, and illuminates the inspection object 8 from the rear side of the inspection object 8. The front light 51 is a ring illumination device, is disposed on the same side as the camera 4 when viewed from the transport device 7, and illuminates from the front side of the inspection object 8.

運転モードにおいては、PLC3が搬送装置7を制御し、検査対象物8がカメラ4の撮像位置に到着すると、搬送装置7を停止させ、コントローラ2を介してカメラ4に撮像を命令する。この際に、PLC3は、コントローラ2を介して照明装置5に照明するよう命令する。また、(ハウジング40の表面の特徴を抽出するための)フロントライト51でコネクタのピン41やハウジング40を照らした状態でカメラ4が撮像する。(ハウジング40の輪郭を抽出するための)バックライト52でコネクタのハウジング40の輪郭を浮かび上がらせた状態でカメラ4が撮像する。   In the operation mode, the PLC 3 controls the conveyance device 7, and when the inspection object 8 arrives at the imaging position of the camera 4, the conveyance device 7 is stopped and the camera 4 is commanded to image via the controller 2. At this time, the PLC 3 instructs the illumination device 5 to illuminate via the controller 2. In addition, the camera 4 captures an image in a state in which the front light 51 (for extracting the characteristics of the surface of the housing 40) illuminates the connector pins 41 and the housing 40. The camera 4 captures an image in a state where the outline of the housing 40 of the connector is raised by the backlight 52 (for extracting the outline of the housing 40).

一方で、設定モードにおいては、基本的に搬送装置7を停止させておき、コントローラ2が直接的にカメラ4や照明装置5を制御し、検査対象物8のワーク画像を撮像する。設定モードにおいて撮像される検査対象物8は、ユーザにより良品と判定されたワーク(製品)である。一般に、ワーク画像は1枚である。しかし、検査対象物8が搬送装置7の搬送方向に長く、一回の撮像では検査対象物8の全体を撮像できないことがある。この場合は、検査対象物8を複数回に分けて撮像するように、コントローラ2がカメラ4を制御する。なお、設定モードにおいて複数枚のワーク画像を取得したときは、運転モードでも同数枚の画像が取得され、ワーク画像とモデル画像と比較される。   On the other hand, in the setting mode, the transport device 7 is basically stopped, and the controller 2 directly controls the camera 4 and the illumination device 5 to capture a work image of the inspection object 8. The inspection object 8 to be imaged in the setting mode is a work (product) determined as a non-defective product by the user. In general, there is one work image. However, the inspection object 8 is long in the conveyance direction of the conveying device 7, and the entire inspection object 8 may not be imaged by one imaging. In this case, the controller 2 controls the camera 4 so that the inspection object 8 is imaged in a plurality of times. When a plurality of workpiece images are acquired in the setting mode, the same number of images are acquired even in the operation mode and compared with the workpiece image and the model image.

設定モードにおいても運転モードにおいても、フロントライト51でコネクタのピン41やハウジング40を照らした状態でカメラ4が撮像する。また、バックライト52でコネクタのハウジング40の輪郭を浮かび上がらせた状態でカメラ4が撮像する。検査対象物8を複数回に分割して撮像する場合、PLC3は、検査対象物8またはカメラ4のいずれかを移動させることで、複数回の撮像を実行してもよい。検査対象物8またはカメラ4の移動は手動であってもよい。検査対象物8を3か所以上に分割して撮像する場合、搬送方向で最初の撮像箇所(図中の左端)と搬送方向で最後の撮像箇所(図中の右端)については、フロントライト51で検査対象物8を照明してカメラ4で撮像し、その後、バックライト52で検査対象物8を照明してカメラ4で撮像する。一方で、最初の撮像箇所と最後の撮像箇所との間に位置する1つ以上の中間の撮像箇所については、フロントライト51で検査対象物8を照明してカメラ4で撮像し、バックライト52を用いた撮像を省略する。これは、検査対象物8の中間部分の輪郭は、外観検査をするうえで重要ではないからである。中間部分については、バックライト52を用いた撮像を省略することで、外観検査の作業効率を向上できる。   In both the setting mode and the operation mode, the camera 4 captures an image with the front light 51 illuminating the connector pins 41 and the housing 40. Further, the camera 4 takes an image in a state where the outline of the connector housing 40 is raised by the backlight 52. When imaging the inspection object 8 by dividing it into a plurality of times, the PLC 3 may execute imaging a plurality of times by moving either the inspection object 8 or the camera 4. The movement of the inspection object 8 or the camera 4 may be manual. When the inspection object 8 is divided and imaged at three or more locations, the front light 51 is used for the first imaging location (left end in the drawing) in the transport direction and the last imaging location (right end in the drawing) in the transport direction. Then, the inspection object 8 is illuminated and imaged by the camera 4, and then the inspection object 8 is illuminated by the backlight 52 and imaged by the camera 4. On the other hand, for one or more intermediate imaging locations located between the first imaging location and the last imaging location, the inspection object 8 is illuminated by the front light 51 and imaged by the camera 4, and the backlight 52. The imaging using is omitted. This is because the contour of the intermediate portion of the inspection object 8 is not important for visual inspection. By omitting imaging using the backlight 52 for the intermediate portion, it is possible to improve the work efficiency of the appearance inspection.

図5は、検査対象物8であるコネクタを3分割し、フロントライト51で撮像した画像とバックライト52で撮像した画像とを示している。画像53は、フロントライト51で撮像したコネクタの左端の画像である。画像54は、フロントライト51で撮像したコネクタの中間の画像である。画像55は、フロントライト51で撮像したコネクタの右端の画像である。画像56は、バックライト52で撮像したコネクタの左端の画像である。画像57は、バックライト52で撮像したコネクタの右端の画像である。なお、画像53〜画像55の各画像においてコネクタの下に存在する黒ベタの部分は搬送装置7のベルトコンベヤの画像である。なお、検査対象物8が治具等に搭載されて搬送装置7によって搬送される場合は、治具が画像に映り込むことになる。上述したように、コネクタの中央(以下、中間と称す)についてはバックライト52による撮像が省略されている。   FIG. 5 shows an image captured by the front light 51 and an image captured by the backlight 52 by dividing the connector that is the inspection object 8 into three parts. The image 53 is an image at the left end of the connector imaged by the front light 51. The image 54 is an intermediate image of the connector imaged by the front light 51. The image 55 is an image at the right end of the connector imaged by the front light 51. The image 56 is an image at the left end of the connector imaged by the backlight 52. The image 57 is an image at the right end of the connector imaged by the backlight 52. In each of the images 53 to 55, the black solid portion existing under the connector is an image of the belt conveyor of the transport device 7. When the inspection object 8 is mounted on a jig or the like and conveyed by the conveying device 7, the jig is reflected in the image. As described above, imaging by the backlight 52 is omitted at the center of the connector (hereinafter referred to as the middle).

なお、カメラ4は、所定位置に配置されたコネクタをフロントライト51で撮像し、次に、コネクタの位置を維持したままバックライト52で撮像する。つまり、フロントライト51を用いて撮像された画像と、バックライト52を用いて撮像された画像とにおいて、検査対象物8の位置は一致している。   Note that the camera 4 captures an image of the connector arranged at a predetermined position with the front light 51, and then captures an image with the backlight 52 while maintaining the position of the connector. That is, the position of the inspection object 8 is the same in the image captured using the front light 51 and the image captured using the backlight 52.

なお、画像53の右端と画像54の左端とには、コネクタの同一部分が写っている。同様に、画像54の右端と画像55の左端とには、コネクタの同一部分が写っている。このように隣り合った部分画像に同一の部分が重複して写っている理由は、これらの3枚の部分画像を連結して1枚の全体画像を作成するためである。つまり、画像処理部30は、隣り合った2枚の部分画像において共通に写っている同一のピンが重なるように、隣り合った2枚の部分画像を連結する。これにより作成された全体画像には、コネクタの全体が含まれることになる。   The same portion of the connector is shown on the right end of the image 53 and the left end of the image 54. Similarly, the same portion of the connector is shown at the right end of the image 54 and the left end of the image 55. The reason that the same portion is duplicated in the adjacent partial images in this way is to create a whole image by connecting these three partial images. That is, the image processing unit 30 connects the two adjacent partial images so that the same pins appearing in common in the two adjacent partial images overlap. Thus, the entire image created includes the entire connector.

<寸法測定>
●ピンと角までの距離
図6は、寸法測定の一例を示す図である。モニタ10に表示されるユーザインタフェース(UI)60には、フロントライト51を用いて撮像された複数の部分画像を連結して構成された一枚の画像(フロントライト画像61)と、バックライト52を用いて撮像された複数の部分画像を連結して構成された画像(バックライト画像62)とが示されている。フロントライト画像61とバックライト画像62とは、フロントライト51と、バックライト52とを切り替えて撮像されたそれぞれ同一の被写体の部分画像を連結することで作成された全体画像である。よって、フロントライト画像61の座標系とバックライト画像62の座標系は一致している。ここでは、フロントライト画像61の座標系は、フロントライト画像61の左端を原点としており、バックライト画像62の座標系は、バックライト画像62の左端を原点としている。よって、フロントライト画像61における各ピンの中心位置と、バックライト画像62における各ピンの中心位置は同一の座標で表現できる。同様に、フロントライト画像61におけるハウジング40の角64の位置と、バックライト画像62におけるハウジング40の角64の位置は同一の座標で表現できる。
<Dimension measurement>
● Distance between Pin and Corner FIG. 6 is a diagram showing an example of dimension measurement. A user interface (UI) 60 displayed on the monitor 10 includes a single image (frontlight image 61) configured by connecting a plurality of partial images captured using the frontlight 51, and a backlight 52. An image (backlight image 62) configured by connecting a plurality of partial images picked up using is shown. The front light image 61 and the backlight image 62 are whole images created by connecting partial images of the same subject captured by switching the front light 51 and the backlight 52. Therefore, the coordinate system of the front light image 61 and the coordinate system of the backlight image 62 are the same. Here, the coordinate system of the frontlight image 61 has the left end of the frontlight image 61 as the origin, and the coordinate system of the backlight image 62 has the left end of the backlight image 62 as the origin. Therefore, the center position of each pin in the front light image 61 and the center position of each pin in the backlight image 62 can be expressed by the same coordinates. Similarly, the position of the corner 64 of the housing 40 in the front light image 61 and the position of the corner 64 of the housing 40 in the backlight image 62 can be expressed by the same coordinates.

UI60においては、フロントライト画像61の横方向における両方の端部とバックライト画像62の横方向における両方の端部とがそれぞれ一致するように、フロントライト画像61とバックライト画像62とが同時に表示される。つまり、フロントライト画像61の横方向の端部とバックライト画像62の横方向の端部とを揃えて、フロントライト画像61とバックライト画像62とが上下に並べられて表示される。これにより、ユーザは、フロントライト画像61とバックライト画像62とがともに同一の検査対象物8を撮像して取得された画像であることを理解しやすくなる。また、フロントライト画像61に設定したサーチ領域、検査領域および検出点はそのままバックライト画像62に設定されるようにしてもよい。つまり、フロントライト画像61とバックライト画像62とにおいて、サーチ領域、検査領域および検出点は連動して表示されるようにしてもよい。同様に、バックライト画像62に設定したサーチ領域、検査領域および検出点はそのままフロントライト画像61に設定され、両者は連動して表示されるようにしてもよい。これにより、一方の画像において設定しにくい特徴部分については他方の画像を用いて設定できるようなる。本発明では、このような特徴を生かして、検査対象物8についての寸法など様々な計測対象を設定できるようになる。   In the UI 60, the front light image 61 and the backlight image 62 are simultaneously displayed so that both ends in the horizontal direction of the front light image 61 coincide with both ends in the horizontal direction of the backlight image 62, respectively. Is done. That is, the front light image 61 and the backlight image 62 are displayed side by side with the horizontal edge of the front light image 61 aligned with the horizontal edge of the backlight image 62. Thus, the user can easily understand that both the front light image 61 and the backlight image 62 are images acquired by imaging the same inspection object 8. Further, the search area, inspection area, and detection point set in the front light image 61 may be set in the backlight image 62 as they are. That is, in the front light image 61 and the backlight image 62, the search area, the inspection area, and the detection point may be displayed in conjunction with each other. Similarly, the search area, inspection area, and detection point set in the backlight image 62 may be set in the front light image 61 as they are, and both may be displayed in conjunction with each other. As a result, a feature portion that is difficult to set in one image can be set using the other image. In the present invention, it is possible to set various measurement objects such as the dimensions of the inspection object 8 by utilizing such characteristics.

図6では、画像処理部30がハウジング40の角64から1番ピン63の中心までの距離を算出する。なお、この例のコネクタには1列あたり17本のピンが2列にわたって配置されている。ピンの番号は左端のピンを1番ピンとし、右端のピンを17番ピンとしている。   In FIG. 6, the image processing unit 30 calculates the distance from the corner 64 of the housing 40 to the center of the first pin 63. The connector of this example has 17 pins arranged in two rows per row. As for the pin numbers, the leftmost pin is the first pin and the rightmost pin is the 17th pin.

ところで、ハウジング40の色が白色に近い場合、フロントライト画像61から角64の位置を精度よく検出できない可能性がある。一方で、バックライト画像62では、角64を精度よく検出できる。これは、背景とハウジングとのコントラストが高いからである。画像処理部30は、フロントライト画像61から1番ピン63の位置(座標)を決定し、バックライト画像62から角64の位置を決定する。ここで、フロントライト画像61とバックライト画像62の座標系は完全に一致しているため、フロントライト画像61から求められた1番ピン63の位置と、バックライト画像62から求められた角64の位置とから、画像処理部30は、両者の距離を算出できる。なお、17番ピンとハウジング40の右上の角までの距離も、同様の手順でフロントライト画像61とバックライト画像62とから算出できる。   By the way, when the color of the housing 40 is close to white, the position of the corner 64 may not be accurately detected from the front light image 61. On the other hand, in the backlight image 62, the corner 64 can be detected with high accuracy. This is because the contrast between the background and the housing is high. The image processing unit 30 determines the position (coordinates) of the first pin 63 from the front light image 61 and determines the position of the corner 64 from the backlight image 62. Here, since the coordinate systems of the front light image 61 and the backlight image 62 completely coincide with each other, the position of the first pin 63 obtained from the front light image 61 and the angle 64 obtained from the backlight image 62 are obtained. From this position, the image processing unit 30 can calculate the distance between them. The distance from the 17th pin to the upper right corner of the housing 40 can be calculated from the front light image 61 and the backlight image 62 in the same procedure.

図7は、2列目のピンに関する寸法測定の一例を示す図である。2列目の1番ピン65から角64までの距離についても1列目の1番ピン63と同様の手順で距離を算出できる。   FIG. 7 is a diagram illustrating an example of dimension measurement regarding the pins in the second row. Regarding the distance from the first pin 65 in the second row to the corner 64, the distance can be calculated in the same procedure as the first pin 63 in the first row.

ここでは、1番ピンと17番ピンについて説明したが、2番ピンから16番ピンについても、フロントライト画像61から特徴点であるピンの位置を検出し、バックライト画像62から特徴点である角の位置を検出し、両者の距離を求めることができる。   Here, pin 1 and pin 17 have been described, but for pin 2 to pin 16, the position of the pin that is a feature point is detected from front light image 61, and the corner that is the feature point from backlight image 62 is detected. Can be detected and the distance between them can be determined.

●ピンからハウジング外縁までの距離(ピン高さ)
図8は、各ピンの高さを求める方法を示している。この例では、画像処理部30が、各ピンの中心(基準点82)からハウジング40の上側にある外縁までの距離をピン高さとして算出する。
● Distance from pin to housing outer edge (pin height)
FIG. 8 shows a method for obtaining the height of each pin. In this example, the image processing unit 30 calculates the distance from the center (reference point 82) of each pin to the outer edge on the upper side of the housing 40 as the pin height.

画像処理部30は、バックライト画像62からハウジング40の上側の外縁を確定するために、右上角の位置と左上角の位置とを検出し、両者を結ぶ直線(直線の方程式)を基準線81として決定する。バックライト画像62を利用するのは、フロントライト画像61と比較して、角を精度よく検出できるからである。画像処理部30は、フロントライト画像61から各ピンの中心位置を基準点82として検出する。画像処理部30は、各ピンの基準点82から基準線81までの距離を各ピンの高さとして算出する。   In order to determine the upper outer edge of the housing 40 from the backlight image 62, the image processing unit 30 detects the position of the upper right corner and the position of the upper left corner, and uses a straight line (straight line equation) connecting the two as a reference line 81. Determine as. The reason why the backlight image 62 is used is that corners can be detected more accurately than the front light image 61. The image processing unit 30 detects the center position of each pin as a reference point 82 from the front light image 61. The image processing unit 30 calculates the distance from the reference point 82 of each pin to the reference line 81 as the height of each pin.

ここでは、フロントライト画像61から基準点82を検出し、バックライト画像62から基準線81を検出した。しかし、検査対象物8の外形や配色、素材など、画像のコントラストに影響を与えるパラメータが異なる場合、画像処理部30は、フロントライト画像61から基準線81を検出し、バックライト画像62から基準点82を検出してもよい。   Here, the reference point 82 is detected from the front light image 61 and the reference line 81 is detected from the backlight image 62. However, when parameters affecting the contrast of the image such as the outer shape, color scheme, and material of the inspection object 8 are different, the image processing unit 30 detects the reference line 81 from the frontlight image 61 and the reference image 81 from the backlight image 62. A point 82 may be detected.

図9は、2列目の各ピンについてピン高さを求める例を示している。画像処理部30は、バックライト画像62からハウジング40の上側の外縁を確定するために、右上角の位置と左上角の位置とを画像認識により検出し、両者を結ぶ直線(直線の方程式)を基準線81として決定する。さらに、画像処理部30は、フロントライト画像61から2列目の各ピンの中心位置を基準点85として検出する。画像処理部30は、各ピンの基準点85から基準線81までの距離を各ピンの高さとして算出する。   FIG. 9 shows an example in which the pin height is obtained for each pin in the second row. In order to determine the upper outer edge of the housing 40 from the backlight image 62, the image processing unit 30 detects the position of the upper right corner and the position of the upper left corner by image recognition, and forms a straight line (straight line equation) connecting the two. The reference line 81 is determined. Further, the image processing unit 30 detects the center position of each pin in the second row from the front light image 61 as the reference point 85. The image processing unit 30 calculates the distance from the reference point 85 of each pin to the reference line 81 as the height of each pin.

<撮像回数の設定>
図10および図11は、撮像回数を設定するためのダイアログ101を示している。ダイアログ101には、画像の分割数の入力欄102と、カメラ数や撮像手法の選択欄103が示されている。分割数が1に設定されると、検査対象物8の全体を1枚の画像に収めることを意味する。分割数が3に設定されると、検査対象物8の全体を3枚の画像に分割して収めることを意味する。図11が示すように、選択欄103において、検査対象物8の両端のみ照明を変えて撮像する撮像手法などを選択できる。
<Setting the number of imaging>
10 and 11 show a dialog 101 for setting the number of times of imaging. The dialog 101 includes an input field 102 for the number of image divisions and a selection field 103 for the number of cameras and the imaging technique. When the number of divisions is set to 1, it means that the entire inspection object 8 is contained in one image. When the division number is set to 3, it means that the entire inspection object 8 is divided into three images. As shown in FIG. 11, in the selection column 103, an imaging method for imaging by changing illumination only at both ends of the inspection object 8 can be selected.

図12は、ユーザにより設定された撮像回数を視覚的に示すダイアログ104を示している。この例では、照明A(フロントライト51)により、3か所の撮像箇所で撮像が実行されること、照明B(バックライト52)により、中間を除く2か所の撮像箇所で撮像が実行されることが示されている。また、撮像順番をユーザに明示するために、撮像順番105も示されている。この例では、1番目に照明Aを用いて第1の撮像箇所で撮像を実行し、2番目に照明Bを用いて第1の撮像箇所で撮像を実行することが示されている。これによりユーザは1番目と2番目の撮像が終了したときに、検査対象物8を移動させればよいことを理解しやすくなる。   FIG. 12 shows a dialog 104 that visually indicates the number of times of imaging set by the user. In this example, imaging is executed at three imaging locations by the illumination A (front light 51), and imaging is executed at two imaging locations except for the middle by the illumination B (backlight 52). It has been shown that. An imaging order 105 is also shown in order to clearly indicate the imaging order to the user. In this example, it is shown that imaging is first performed at the first imaging location using the illumination A, and second imaging is performed at the first imaging location using the illumination B. This makes it easier for the user to understand that the inspection object 8 should be moved when the first and second imaging operations are completed.

<コネクタ位置ずれ補正>
検査対象物8を搬送装置7で搬送しながら良否判定のための画像を撮像する際に、検査対象物8の位置が理想位置からずれていることがある。ここで、理想位置とは、パターンマッチングのためのモデル画像をカメラ4により撮像したときの良品ワークの配置位置である。良品ワークは手動で正確に配置されるため、カメラ4に対して精度よく位置決めされる。よって、実際の製造ラインにおいて検査対象物8の画像を撮像したときにパターンマッチングおよび良否判定の精度を向上させるためには、撮像した画像を回転させたり、左右上下にシフトしたりといった位置ずれ補正が必要となる。
<Connector displacement correction>
When an image for pass / fail determination is taken while the inspection object 8 is conveyed by the conveying device 7, the position of the inspection object 8 may be shifted from the ideal position. Here, the ideal position is an arrangement position of a non-defective work when a model image for pattern matching is captured by the camera 4. Since the non-defective workpiece is manually and accurately arranged, it is accurately positioned with respect to the camera 4. Therefore, in order to improve the accuracy of pattern matching and pass / fail judgment when an image of the inspection object 8 is picked up in an actual production line, positional deviation correction such as rotating the picked-up image or shifting left and right and up and down. Is required.

ところで、上述したように検査対象物8の同一の個所を、照明手法を変えて複数回撮像することがある。たとえば、フロントライト画像61とバックライト画像62とでは検査対象物8を動かさずに同一の個所を撮像しているため、それぞれの位置ずれ量は一致しているはずである。そこで、各撮像箇所の画像でフロントライト画像61から求められた位置ずれ量またはその補正量を用いて、バックライト画像62についての補正量を設定する。コネクタの位置ずれが発生する場合に、後段の検査で正しく検査するためにコネクタの位置を検出し、ずれ量を補正する。   By the way, as described above, the same part of the inspection object 8 may be imaged a plurality of times by changing the illumination method. For example, in the front light image 61 and the backlight image 62, the same location is imaged without moving the inspection object 8, so that the respective positional deviation amounts should match. Therefore, the correction amount for the backlight image 62 is set using the positional deviation amount obtained from the front light image 61 or the correction amount for the image at each imaging location. When the connector is misaligned, the connector position is detected and the misalignment is corrected in order to correctly inspect in the subsequent inspection.

このように、本実施例では、画像処理部30が、検査対象物8の同一箇所を撮像した複数の画像について1つの画像から位置ずれの補正量を求め、求めた補正量で複数の画像のそれぞれの位置を補正し、補正した画像を用いて良否判定を実行する。   As described above, in this embodiment, the image processing unit 30 obtains the correction amount of the positional deviation from one image for a plurality of images obtained by imaging the same portion of the inspection object 8, and the plurality of images are obtained with the obtained correction amount. Each position is corrected, and pass / fail judgment is executed using the corrected image.

図13は、複数の画像処理ツールのカテゴリーを示したツールカタログ111からコネクタカテゴリー108がマウスによって選択され、さらに、画像処理ツールとしてコネクタ位置ずれ補正が選択されたことを示す図である。   FIG. 13 is a diagram showing that the connector category 108 is selected by the mouse from the tool catalog 111 showing the categories of the plurality of image processing tools, and further, connector position deviation correction is selected as the image processing tool.

図14、図15、図16は、コネクタ位置ずれ補正に必要となるパラメータを設定するためのUIを示している(図14〜図16は、それぞれ画像1A〜3Aに対応するUI)。ここでは、2つのサーチ領域112がマウス9によって設定される。図14の右方に示されるように、ユーザによって事前にモデル画像(サーチパターン)が登録されており、マウス9によってサーチ領域112が設定されると、サーチ領域112内にモデル画像とパターンマッチする部分があるか否かをリアルタイムでサーチする。そして、モデル画像が見つかった場合には、検査領域113として画面上に表示されている。すなわち、図14では、サーチ領域112内でモデル画像が見つかり、検査領域113が表示されている。ここで、サーチ領域112は、モデル画像を移動させることができる範囲を示す領域である。検査領域113は、パターンマッチングの対象となる部分(モデル画像)を含む領域である(上述したように、図14では、モデル画像が見つかった領域)。2つのサーチ領域112を設定する理由は、検査対象物の製造上の公差を考慮するため、或いは、検査対象物の搬送時の位置/傾きのずれを精度良く補正するためである。2つのサーチ領域112において、2つの検査領域113の位置が判明すれば、これらからコネクタ位置の位置ずれ量を算出できる。   FIGS. 14, 15, and 16 show UIs for setting parameters necessary for connector displacement correction (FIGS. 14 to 16 are UIs corresponding to images 1A to 3A, respectively). Here, two search areas 112 are set by the mouse 9. As shown in the right side of FIG. 14, a model image (search pattern) is registered in advance by the user, and when the search area 112 is set by the mouse 9, the pattern image matches the model image in the search area 112. Search in real time whether there is a part. When a model image is found, it is displayed on the screen as an inspection area 113. That is, in FIG. 14, a model image is found in the search area 112, and the inspection area 113 is displayed. Here, the search area 112 is an area indicating a range in which the model image can be moved. The inspection area 113 is an area including a portion (model image) to be subjected to pattern matching (as described above, an area where a model image is found in FIG. 14). The reason for setting the two search areas 112 is to take into account manufacturing tolerances of the inspection object or to accurately correct the position / tilt deviation during the conveyance of the inspection object. If the positions of the two inspection areas 113 are found in the two search areas 112, the displacement amount of the connector position can be calculated therefrom.

図14、図15、図16が示すように、位置ずれ補正のための2つのサーチ領域112と、2つの検査領域113とが、コネクタの左端部、中間部、右端部のそれぞれに設定される。コネクタの左端部、中間部、右端部での位置ずれ量は同じである場合があるため、左端部、中間部、右端部の一か所のみから位置ずれ量を求めてもよい。ただし、位置ずれ補正の精度を向上するために、左端部、中間部、右端部の3か所から位置ずれ補正量を求めてもよい。   As shown in FIGS. 14, 15, and 16, two search areas 112 for correcting misalignment and two inspection areas 113 are set at the left end, the middle, and the right end of the connector, respectively. . Since the positional deviation amounts at the left end portion, middle portion, and right end portion of the connector may be the same, the positional deviation amount may be obtained from only one of the left end portion, middle portion, and right end portion. However, in order to improve the accuracy of the misregistration correction, the misregistration correction amount may be obtained from three locations, the left end portion, the middle portion, and the right end portion.

図17は、コネクタ位置ずれ補正のための設定が終了したことを示すUIの一例である。画像処理部30は、マウス9によって設定されたパラメータを使用して、カメラ4が撮像した良品に対して位置ずれ補正を実行し、位置ずれ補正に成功すると、成功を示すOKマーク114をモニタ10に表示してもよい。   FIG. 17 is an example of a UI indicating that the setting for correcting the connector displacement has been completed. The image processing unit 30 uses the parameters set by the mouse 9 to execute the positional deviation correction for the non-defective product captured by the camera 4. When the positional deviation correction is successful, the OK mark 114 indicating success is displayed on the monitor 10. May be displayed.

<コネクタ寸法検査ツールの追加>
図18は、複数の画像処理ツールのカテゴリーを示したツールカタログ111からコネクタカテゴリー108がマウスによって選択され、さらに、画像処理ツールとしてコネクタ寸法検査ツール109が選択されたことを示す図である。コネクタ寸法検査ツール109を示すボタンがクリックされると、設定画面に遷移する。設定画面に遷移するために、さらに追加ボタンがクリックされてもよい。
<Addition of connector dimension inspection tool>
FIG. 18 is a diagram showing that the connector category 108 is selected by the mouse from the tool catalog 111 showing a plurality of image processing tool categories, and the connector dimension inspection tool 109 is selected as the image processing tool. When a button indicating the connector dimension inspection tool 109 is clicked, a transition is made to a setting screen. An additional button may be clicked to transition to the setting screen.

●画像連結パラメータの設定
コネクタ寸法検査ツールの設定項目の1つとして画像連結パラメータが存在する。なお、画像を連結しない場合は、このパラメータの設定は不要である。
● Image connection parameter setting The image connection parameter is one of the setting items of the connector dimension inspection tool. Note that this parameter setting is not necessary when images are not connected.

図19は、画像の連結点を設定する設定画面を示している。この画面では、画像の並び順116と、連結手法を指定する連結方法117とをマウス9によって選択できる。たとえば、画像の並び順116として「左→右」を選択すると、検査対象物8を左から右に画像が撮像されたことを示している。連結方法117として「ピン列で連結」を選択すると、画像処理部30は、各画像からピン列を検出し、ピン列が全体として一列になるように複数の画像を連結する。   FIG. 19 shows a setting screen for setting connection points of images. On this screen, the arrangement order 116 of images and a connection method 117 for specifying a connection method can be selected by the mouse 9. For example, when “left → right” is selected as the image arrangement order 116, it indicates that an image of the inspection object 8 is picked up from the left to the right. When “connect by pin array” is selected as the connection method 117, the image processing unit 30 detects the pin array from each image, and connects a plurality of images so that the pin array becomes one line as a whole.

●ピン列検出パラメータの設定
図20は、ピン列検出パラメータの設定画面を示している。この例では、ピンの配置118は、ピンが何列にわたって配置されているかを設定するための設定項目である。1番ピンの位置119は、一列に並んだ複数のピンのうちどのピンが1番ピンであるかを設定するための設定項目である。この例では、検査対象物8であるコネクタは2列であるため、ピンの配置118は、「2列」がマウス9によって選択される。
Setting of Pin Array Detection Parameters FIG. 20 shows a setting screen for pin array detection parameters. In this example, the pin arrangement 118 is a setting item for setting how many rows the pins are arranged. The position 119 of the 1st pin is a setting item for setting which pin is the 1st pin among a plurality of pins arranged in a row. In this example, since the connector that is the inspection object 8 has two rows, “2 rows” is selected by the mouse 9 as the pin arrangement 118.

●ピンモデルの登録
コネクタは多数のピンを備えており、すべてのピンについて検査を実行する必要がある。そこで、検査対象の各ピンのモデル画像とその位置を良品判定用に登録しておく必要がある。
● Pin model registration The connector has a large number of pins, and all the pins need to be inspected. Therefore, it is necessary to register the model image of each pin to be inspected and its position for non-defective product determination.

図21は、ピンモデルの登録画面を示している。CPU22は、登録画面内において、コネクタの左端の画像53を拡大表示する。これは、ピンモデルを登録しやすくするためである。ユーザは、1番ピン63を含むように検査領域113を設定する。CPU22は、検査領域113により囲まれた部分の画像をモデル画像としてメモリに格納する。検査領域113の位置と大きさはマウス9の操作に連動してCPU22によって変更される。   FIG. 21 shows a pin model registration screen. The CPU 22 enlarges and displays the image 53 at the left end of the connector in the registration screen. This is to facilitate registering the pin model. The user sets the inspection area 113 to include the first pin 63. The CPU 22 stores the image of the portion surrounded by the inspection area 113 as a model image in the memory. The position and size of the inspection area 113 are changed by the CPU 22 in conjunction with the operation of the mouse 9.

図22は、ピン検出の設定画面を示している。CPU22は、検査領域113の中心に基準点120を配置し、検査領域113を取り囲むようにサーチ領域112を配置する。検査領域113の位置、基準点120の位置およびサーチ領域112の位置はCPU22によってメモリに格納される。なお、上述したように、検査領域113は、サーチ領域112内において、図21で設定したモデル画像とパターンマッチした結果、検出された領域を示している。つまり、図22では、検査領域113は、モデル画像とパターンマッチした検出結果を示す。   FIG. 22 shows a pin detection setting screen. The CPU 22 arranges the reference point 120 at the center of the inspection area 113 and arranges the search area 112 so as to surround the inspection area 113. The position of the inspection area 113, the position of the reference point 120, and the position of the search area 112 are stored in the memory by the CPU 22. As described above, the inspection region 113 indicates a region detected as a result of pattern matching with the model image set in FIG. 21 in the search region 112. That is, in FIG. 22, the inspection area 113 shows a detection result that pattern matches with the model image.

上述したように、すべてのピンに対してサーチ領域112、検査領域113、基準点120などを設定しなければならない。しかし、この設定作業を手作業に任せると、ユーザは多大な負担を負うことになる。そこで、本実施例では、ユーザが設定項目の1つであるピン数121をマウス9で設定することにより、2番ピン以降の各ピンについてのサーチ領域112、検査領域113、基準点120の設定を半自動化できる。CPU22は、入力されたピン数121に応じて、サーチ領域112、検査領域113、基準点120を右方向にコピーすることで、6つあるピンのそれぞれに、サーチ領域112、検査領域113、基準点120を設定する。これは、各ピンが等間隔で配置されており、各ピンの大きさも一致していることを前提としている。各ピンにCPU22によって設定されたサーチ領域112、検査領域113、基準点120を、ユーザはマウス9によって微調整してもよい。CPU22は、マウス9からの入力にしたがってサーチ領域112、検査領域113、基準点120の座標(位置)を修正し、メモリに格納する。   As described above, the search area 112, the inspection area 113, the reference point 120, etc. must be set for all pins. However, if this setting operation is left to the manual operation, the user will be burdened with a great burden. Therefore, in this embodiment, the user sets the number of pins 121, which is one of the setting items, with the mouse 9, thereby setting the search area 112, the inspection area 113, and the reference point 120 for each pin after the second pin. Can be semi-automated. The CPU 22 copies the search area 112, the inspection area 113, and the reference point 120 in the right direction according to the input number of pins 121, so that the search area 112, the inspection area 113, and the reference area for each of the six pins. Point 120 is set. This is based on the premise that the pins are arranged at equal intervals, and the sizes of the pins also match. The user may finely adjust the search area 112, inspection area 113, and reference point 120 set for each pin by the CPU 22 with the mouse 9. The CPU 22 corrects the coordinates (positions) of the search area 112, the inspection area 113, and the reference point 120 according to the input from the mouse 9, and stores them in the memory.

図23、図24は、コネクタの中間部および右端部についてのサーチ領域112、検査領域113、基準点120の設定画面を示している。コネクタの中間部および右端部も左端部と同様の手順で、サーチ領域112、検査領域113、基準点120が設定される。つまり、CPU22は、一番ピンのサーチ領域112、検査領域113、基準点120のデータとピン数121を利用して、コネクタの中間部および右端部の各ピンにサーチ領域112、検査領域113、基準点120を設定する。   23 and 24 show setting screens for the search area 112, the inspection area 113, and the reference point 120 for the middle part and the right end part of the connector. The search region 112, the inspection region 113, and the reference point 120 are set in the middle and right end portions of the connector in the same procedure as the left end portion. That is, the CPU 22 uses the data of the search area 112 of the first pin, the inspection area 113, the reference point 120, and the number of pins 121, and the search area 112, the inspection area 113, A reference point 120 is set.

図25は、一列目のピンモデルの登録が完了したことを示す画面を示している。この画面では、コネクタの全体画像122がサーチ領域112、検査領域113、基準点120とともに表示される。なお、CPU22は、入力されたピン数を合計して総ピン数123をモニタ10に表示してもよい。   FIG. 25 shows a screen indicating that registration of the pin model in the first row has been completed. In this screen, the entire image 122 of the connector is displayed together with the search area 112, the inspection area 113, and the reference point 120. Note that the CPU 22 may display the total number of pins 123 on the monitor 10 by summing up the number of input pins.

なお、図21ないし図25では、一列目のピンについて説明したが、2列目のピンについても同様の手順でピン登録を実行できる。   21 to 25, the first row of pins has been described, but the pin registration can be executed for the second row of pins in the same procedure.

●端検出パラメータの設定
コネクタの外観検査を実行する際には、上述したように、コネクタの端(角)の位置を検出する必要がある。
● End detection parameter setting When the appearance inspection of the connector is executed, it is necessary to detect the end (corner) position of the connector as described above.

図26は、コネクタの端検出に関する設定を行う設定画面を示す図である。コネクタの種類によって検出すべき端の数は異なる。そこで、追加ボタン124をマウス9で押すことで、必要な数の端を設定する。   FIG. 26 is a diagram illustrating a setting screen for performing settings related to connector end detection. The number of ends to be detected varies depending on the type of connector. Therefore, a necessary number of ends are set by pressing the add button 124 with the mouse 9.

図27は、端検出の対象となる端を選択する選択項目125を示している。コネクタの種類によっては、コネクタに設けられた金属を端とすべき場合や、コネクタのハウジングを端とすべき場合や、コネクタを搬送するための治具を端とすべき場合などがある。そこで、ユーザは、検査対象物8となっているコネクタの種類に応じて、選択項目125からマウス9の操作によって端検出の対象を選択する。   FIG. 27 shows a selection item 125 for selecting an end to be detected. Depending on the type of connector, there may be a case where the metal provided in the connector should end, a case where the connector housing should end, and a case where a jig for conveying the connector should end. Therefore, the user selects an end detection target by operating the mouse 9 from the selection item 125 according to the type of the connector that is the inspection object 8.

図28は、端検出用のサーチモデルの登録画面を示す図である。ワーク左端を設定するために、画像選択部126からマウス9によってコネクタの左端のフロントライト画像(撮像1A)が選択される。CPU22は、左端の画像を拡大表示し、サーチモデルを登録しやすくする。マウス9の操作によって端を含む検査領域127が設定される。CPU22は、モデル登録ボタン228が押し下げされたことを検出すると、その時点で設定された検査領域127の位置と検査領域127によって囲まれたモデル画像をメモリに格納する。   FIG. 28 is a diagram showing a registration screen for a search model for edge detection. In order to set the left end of the workpiece, the front light image (imaging 1A) at the left end of the connector is selected from the image selection unit 126 by the mouse 9. The CPU 22 enlarges and displays the leftmost image to facilitate registration of the search model. An inspection area 127 including an end is set by operating the mouse 9. When the CPU 22 detects that the model registration button 228 has been pressed, the CPU 22 stores in the memory the position of the inspection area 127 set at that time and the model image surrounded by the inspection area 127.

図29は、サーチ領域128の設定画面を示している。CPU22は、マウス9の操作にしたがって設定された矩形の領域を端検出用のサーチ領域128に設定する。ここで、CPU22は、モデル登録された検査領域127のモデル画像を、サーチ領域128内でサーチを実行し、モデル画像が見つかったかどうかを判定する。図29に示すように、背景とハウジングとのコントラストが低い場合、端検出に失敗してしまう。   FIG. 29 shows a setting screen for the search area 128. The CPU 22 sets a rectangular area set in accordance with the operation of the mouse 9 as an end detection search area 128. Here, the CPU 22 performs a search in the search area 128 for the model image of the inspection area 127 registered as a model, and determines whether the model image is found. As shown in FIG. 29, when the contrast between the background and the housing is low, end detection fails.

そこで、本実施例では、バックライト画像を用いて端検出用のパラメータを設定する。   Therefore, in this embodiment, the edge detection parameters are set using the backlight image.

図30は、端検出用のサーチモデルの登録画面を示す図である。画像選択部126からマウス9によってコネクタの左端のバックライト画像(撮像1B)が選択される。CPU22は、左端のバックライト画像を拡大表示し、サーチモデルを登録しやすくする。マウス9の操作によって端を含む検査領域127が設定される。CPU22は、モデル登録ボタン228が押し下げされたことを検出すると、その時点で設定された検査領域127の位置と検査領域127によって囲まれたモデル画像をメモリに格納する。   FIG. 30 is a diagram showing a registration screen for a search model for edge detection. The backlight image (imaging 1B) at the left end of the connector is selected by the mouse 9 from the image selection unit 126. The CPU 22 enlarges and displays the leftmost backlight image to facilitate registration of the search model. An inspection area 127 including an end is set by operating the mouse 9. When the CPU 22 detects that the model registration button 228 has been pressed, the CPU 22 stores in the memory the position of the inspection area 127 set at that time and the model image surrounded by the inspection area 127.

図31は、サーチ領域128の設定画面を示している。CPU22は、マウス9の操作にしたがって設定された矩形の領域を端検出用のサーチ領域128に設定する。ここで、CPU22は、モデル登録された検査領域127のモデル画像を、サーチ領域128内でサーチを実行し、モデル画像が見つかったかどうかを判定する。図31に示すように、背景とハウジングとのコントラストが高い場合、端検出に成功する。基準点を指定するための基準点指定ボタン130がマウス9によってクリックされると、CPU22は、基準点の指定画面をモニタ10に表示させる。   FIG. 31 shows a setting screen for the search area 128. The CPU 22 sets a rectangular area set in accordance with the operation of the mouse 9 as an end detection search area 128. Here, the CPU 22 performs a search in the search area 128 for the model image of the inspection area 127 registered as a model, and determines whether the model image is found. As shown in FIG. 31, when the contrast between the background and the housing is high, the edge detection is successful. When a reference point designation button 130 for designating a reference point is clicked with the mouse 9, the CPU 22 causes the monitor 10 to display a reference point designation screen.

図32、図33は、基準点131の指定画面を示す図である。とりわけ、図32は、微調整前の基準点131を示し、図33は、微調整後の基準点131を示している。CPU22は、基準点131を検査領域127の中間に配置する。ユーザはマウス9を操作することで基準点131を微調整し、CPU22は、微調整後の基準点131の位置をメモリに格納する。   32 and 33 are diagrams showing a designation screen for the reference point 131. FIG. 32 shows the reference point 131 before fine adjustment, and FIG. 33 shows the reference point 131 after fine adjustment. The CPU 22 arranges the reference point 131 in the middle of the inspection area 127. The user finely adjusts the reference point 131 by operating the mouse 9, and the CPU 22 stores the position of the reference point 131 after the fine adjustment in the memory.

なお、コネクタの右側の端であるワーク右端についても、ワーク左端と同様の手順で検査領域127、サーチ領域128および基準点131が設定される。   Note that the inspection region 127, the search region 128, and the reference point 131 are set for the right end of the work, which is the right end of the connector, in the same procedure as that for the left end of the work.

図34は、ワーク左端とワーク右端とが正常に設定されたことを示す画面である。この例では、バックライト画像を利用して、ワーク左端とワーク右端とが設定されていることが示されている。   FIG. 34 is a screen showing that the work left end and the work right end are set normally. In this example, it is shown that the left end of the work and the right end of the work are set using the backlight image.

●基準線の設定
図35は、基準線81を設定する設定画面を示している。追加ボタン(編集ボタン)140をクリックすると、基準線81の各パラメータを設定する詳細設定画面に遷移する。
Setting Reference Line FIG. 35 shows a setting screen for setting the reference line 81. When the add button (edit button) 140 is clicked, a transition is made to a detailed setting screen for setting each parameter of the reference line 81.

図36は、基準線81の指定方法の選択項目141を示している。ここでは、検査対象物8であるコネクタに対してどのような線を基準線81とするかをマウス9によって指定する。   FIG. 36 shows selection items 141 for the method of specifying the reference line 81. Here, the mouse 9 designates which line is used as the reference line 81 for the connector which is the inspection object 8.

図37は、選択項目141から「ハウジングの両端を結んだ線」が基準線81として指定されたときの画面を示す図である。上述したように、バックライト画像を使用してハウジングの両端(ワーク左端とワーク右端)があらかじめ設定されている。そこで、CPU22は、「ハウジングの両端を結んだ線」が基準線81として指定されると、ワーク左端とワーク右端とを通るように基準線81を設定する。なお、ワーク左端は、基準点131に対応している。なお、図示は省略しているがワーク右端も基準点によって設定されている。   FIG. 37 is a diagram showing a screen when “line connecting both ends of the housing” is designated as the reference line 81 from the selection item 141. As described above, both ends (work left end and work right end) of the housing are set in advance using the backlight image. Therefore, when the “line connecting both ends of the housing” is designated as the reference line 81, the CPU 22 sets the reference line 81 so as to pass through the work left end and the work right end. Note that the left end of the work corresponds to the reference point 131. In addition, although illustration is abbreviate | omitted, the workpiece | work right end is also set with the reference point.

●寸法測定パラメータの設定
ここでは、コネクタの寸法のうち、どの部分の寸法を測定対象にするかを設定する。
● Dimension measurement parameter setting Here, set which part of the connector dimensions is the measurement target.

図38は、寸法測定パラメータを設定するメイン画面を示す図である。項目選択ボタン150をマウス9でクリックすることで、測定すべき寸法をユーザが選択できる。   FIG. 38 is a diagram showing a main screen for setting dimension measurement parameters. By clicking the item selection button 150 with the mouse 9, the user can select the dimension to be measured.

図39は、寸法測定パラメータを設定するための項目選択画面を示す図である。ここでは、コネクタのどの部分を測定するかをカテゴリー別に示した寸法測定カテゴリー151と、選択された寸法測定カテゴリーに対応した1つ以上の測定項目を示す測定項目一覧152とが表示される。CPU22は、マウス9によって選択されたカテゴリーに応じて測定項目一覧152を切り替える。図39に示した例では、ハウジングが寸法測定カテゴリー151から選択されると、ハウジングに関する種々の測定項目が示される。ハウジング高さは、基準線を起点としたハウジングの高さである。ハウジング距離は、ハウジングの左端から右端までの距離である。ハウジング・ピン(端)間距離は、ハウジングの端から端のピンまでの距離である。ハウジング金具距離は、ハウジングから金具までの距離であって、たとえば、ハウジングの端から金具の中心までの距離である。マウス9により測定項目一覧152から選択された測定項目が実際に実行される測定項目として追加される。   FIG. 39 is a diagram showing an item selection screen for setting dimension measurement parameters. Here, a dimension measurement category 151 that indicates which part of the connector is measured for each category, and a measurement item list 152 that indicates one or more measurement items corresponding to the selected dimension measurement category are displayed. The CPU 22 switches the measurement item list 152 according to the category selected by the mouse 9. In the example shown in FIG. 39, when the housing is selected from the dimension measurement category 151, various measurement items regarding the housing are shown. The housing height is the height of the housing starting from the reference line. The housing distance is a distance from the left end to the right end of the housing. The distance between the housing pins (ends) is the distance from the end of the housing to the end pins. The housing bracket distance is the distance from the housing to the bracket, for example, the distance from the end of the housing to the center of the bracket. A measurement item selected from the measurement item list 152 by the mouse 9 is added as a measurement item to be actually executed.

図40は、選択された測定項目について良否判定に使用されるパラメータを設定する画面を示している。パラメータ設定部160では、1列目のピンについてのハウジング・ピン(端)間距離についての設計上の標準値と正負の公差がマウス9を通じて入力される。CPU22は、標準値と公差とから寸法の上限値と下限値とを算出してパラメータ設定部160に表示してもよい。また、CPU22は、画像処理部30を用いて、ワーク画像から実際に寸法を測定し、1番ピンについての測定値と17番ピンについての測定値との平均値を求めて表示したり、最小値と最大値とを表示したりしてもよい。   FIG. 40 shows a screen for setting parameters used for pass / fail judgment for the selected measurement item. In the parameter setting unit 160, a design standard value and a positive / negative tolerance for the distance between the housing pins (ends) for the pins in the first row are input through the mouse 9. The CPU 22 may calculate an upper limit value and a lower limit value of the dimensions from the standard value and the tolerance and display them on the parameter setting unit 160. Further, the CPU 22 uses the image processing unit 30 to actually measure the dimensions from the work image, and obtains and displays an average value of the measured value for the first pin and the measured value for the 17th pin, The value and the maximum value may be displayed.

図41は、選択された測定項目について良否判定に使用されるパラメータを設定する画面を示している。パラメータ設定部161では、2列目のピンについてのハウジング・ピン(端)間距離についての設計上の標準値と正負の公差がマウス9を通じて入力される。CPU22は、標準値と公差とから寸法の上限値と下限値とを算出してパラメータ設定部161に表示してもよい。また、CPU22は、画像処理部30を用いて、ワーク画像から実際に寸法を測定し、1番ピンについての測定値と17番ピンについての測定値との平均値を求めて表示したり、最小値と最大値とを表示したりしてもよい。   FIG. 41 shows a screen for setting parameters used for pass / fail judgment for the selected measurement item. In the parameter setting unit 161, a design standard value and a positive / negative tolerance for the distance between the housing pins (ends) for the pins in the second row are input through the mouse 9. The CPU 22 may calculate the upper limit value and the lower limit value of the dimensions from the standard value and the tolerance and display them on the parameter setting unit 161. Further, the CPU 22 uses the image processing unit 30 to actually measure the dimensions from the work image, and obtains and displays an average value of the measured value for the first pin and the measured value for the 17th pin, The value and the maximum value may be displayed.

図42は、寸法測定パラメータを設定するための項目選択画面を示す図である。ここでは、寸法測定カテゴリー151からピン高さが選択されているため、測定項目一覧152には、ピン高さに関する測定項目が表示される。ユーザはマウス9により測定項目をクリックして選択する。ここでは、基準線からのピン高さが選択されたものとする。   FIG. 42 is a diagram showing an item selection screen for setting dimension measurement parameters. Here, since the pin height is selected from the dimension measurement category 151, the measurement item list 152 displays the measurement items related to the pin height. The user clicks and selects a measurement item with the mouse 9. Here, it is assumed that the pin height from the reference line is selected.

図43は、選択された測定項目について良否判定に使用されるパラメータを設定する画面を示している。測定項目をわかりやすくするために、画像表示部162には、ワーク画像とともに、基準線、基準点、ピン番号、どの部分が測定されるかを示すマークなどが表示される。ここでは、ワーク画像として、フロントライト画像とバックライト画像の両方が表示される。パラメータ設定部163では、1列目のピンについてのピン高さについての設計上の標準値と正負の公差がマウス9を通じて入力される。CPU22は、標準値と公差とから寸法の上限値と下限値とを算出してパラメータ設定部163に表示してもよい。また、CPU22は、画像処理部30を用いて、ワーク画像から実際に寸法を測定し、1番ピンから17番ピンまで各ピンについて測定値の平均値を求めて表示したり、最小値と最大値とを表示したりしてもよい。これらの数値からワーク画像を撮像するために用いたワーク(製品)が適切であったかどうかを確認しやすくなろう。   FIG. 43 shows a screen for setting parameters used for pass / fail judgment for the selected measurement item. In order to make the measurement items easy to understand, the image display unit 162 displays a reference line, a reference point, a pin number, a mark indicating which part is measured, and the like along with the work image. Here, both a front light image and a backlight image are displayed as work images. In the parameter setting unit 163, a design standard value and a positive / negative tolerance for the pin height for the pins in the first row are input through the mouse 9. The CPU 22 may calculate the upper limit value and the lower limit value of the dimensions from the standard value and the tolerance and display them on the parameter setting unit 163. Further, the CPU 22 uses the image processing unit 30 to actually measure the dimensions from the work image, and obtains and displays the average value of the measured values for each pin from the 1st pin to the 17th pin, or displays the minimum and maximum values. And a value may be displayed. From these numerical values, it will be easy to confirm whether or not the work (product) used for capturing the work image is appropriate.

図44は、選択された測定項目について良否判定に使用されるパラメータを設定する画面を示している。パラメータ設定部164では、2列目のピンについてのピン高さについてのパラメータが入力される。CPU22は、パラメータ設定部164に入力された標準値と公差とから寸法の上限値と下限値とを算出してパラメータ設定部164に表示してもよい。また、CPU22は、画像処理部30を用いて、ワーク画像から実際に寸法を測定し、2列目の1番ピンから17番ピンまで各ピンについて測定値の平均値を求めて表示したり、最小値と最大値とを表示したりしてもよい。   FIG. 44 shows a screen for setting parameters used for pass / fail judgment for the selected measurement item. In the parameter setting unit 164, parameters regarding the pin height for the pins in the second row are input. The CPU 22 may calculate an upper limit value and a lower limit value of the dimensions from the standard value and tolerance input to the parameter setting unit 164 and display them on the parameter setting unit 164. Further, the CPU 22 uses the image processing unit 30 to actually measure the dimensions from the work image, and obtain and display the average value of the measured values for each pin from the 1st pin to the 17th pin in the second row, The minimum value and the maximum value may be displayed.

<画像連結の変形例>
上述した実施例では、隣り合った画像間で共通のピンが1つ以上含まれるように撮像を実行し、共通のピンを重ね合わせるようにして隣り合った2枚の画像を連結することで、検査対象物8の全体画像をCPU22または画像処理部30が作成するものとして説明した。しかし、隣り合った画像間で共通に含まれるべき部分は検査対象物8の一部である必要はない。つまり、治具やベルトコンベヤなど検査対象物8とともに移動する部材に連結の基準となるマークが付与されていてもよい。
<Modification of image connection>
In the above-described embodiment, imaging is performed so that one or more common pins are included between adjacent images, and two adjacent images are connected by overlapping the common pins, The entire image of the inspection object 8 has been described as being created by the CPU 22 or the image processing unit 30. However, a portion that should be included in common between adjacent images does not have to be a part of the inspection object 8. That is, a mark serving as a reference for connection may be given to a member that moves together with the inspection object 8, such as a jig or a belt conveyor.

図45は、複数の画像を連結するための基準となるマークの一例を示す図である。この例では、連結用のマーク170が、検査対象物8を搬送する治具に設けられている。連結方法117として「任意の点で連結」が選択されると、CPU22は、マーク170を基準として連結を実行できるようになる。   FIG. 45 is a diagram illustrating an example of a mark serving as a reference for connecting a plurality of images. In this example, a connection mark 170 is provided on a jig that conveys the inspection object 8. When “connect at an arbitrary point” is selected as the connection method 117, the CPU 22 can execute connection using the mark 170 as a reference.

図46は、画像連結の基準となるマーク170を設定する設定画面を示す図である。CPU22は、コネクタの左端画像を拡大表示することで、基準点171、検査領域およびサーチ領域を設定しやすくしている。ユーザは、マウス9を操作することで、マーク170の中心に基準点171を設定する。さらに、CPU22は、基準点171を中心として検査領域およびサーチ領域を設定する。CPU22は、マウス9の操作にしたがって基準点171を微調整したり、検査領域およびサーチ領域の位置とサイズとを調整したりしてもよい。   FIG. 46 is a diagram showing a setting screen for setting a mark 170 that is a reference for image connection. The CPU 22 enlarges and displays the left end image of the connector, thereby making it easy to set the reference point 171, the inspection area, and the search area. The user operates the mouse 9 to set the reference point 171 at the center of the mark 170. Further, the CPU 22 sets an inspection area and a search area with the reference point 171 as the center. The CPU 22 may finely adjust the reference point 171 according to the operation of the mouse 9, or may adjust the position and size of the inspection area and the search area.

図47は、画像連結の基準となるマーク170を設定する設定画面を示す図である。CPU22は、コネクタの中間部の画像を拡大表示することで、左端画像と中間部の画像とを連結するための基準となる基準点172、検査領域およびサーチ領域と、中間部の画像と右端画像とを連結するための基準となる基準点173、検査領域およびサーチ領域とを設定しやすくしている。ユーザは、マウス9を操作することで、左側のマーク170の中心に基準点172を設定し、右側のマーク170の中心に基準点173を設定する。さらに、CPU22は、基準点172および基準点173を中心としてそれぞれ検査領域およびサーチ領域を設定する。CPU22は、マウス9の操作にしたがって基準点172、173を微調整したり、検査領域およびサーチ領域の位置とサイズとを調整したりしてもよい。   FIG. 47 is a diagram showing a setting screen for setting a mark 170 that serves as a reference for image connection. The CPU 22 enlarges and displays the image of the middle part of the connector so that the reference point 172, the inspection area and the search area, which serve as a reference for connecting the left end image and the intermediate part image, the intermediate part image and the right end image It is easy to set a reference point 173, an inspection area, and a search area as a reference for connecting the two. The user operates the mouse 9 to set a reference point 172 at the center of the left mark 170 and a reference point 173 at the center of the right mark 170. Further, the CPU 22 sets an inspection area and a search area around the reference point 172 and the reference point 173, respectively. The CPU 22 may finely adjust the reference points 172 and 173 according to the operation of the mouse 9, or may adjust the positions and sizes of the inspection area and the search area.

図48は、画像連結の基準となるマーク170を設定する設定画面を示す図である。CPU22は、コネクタの右端画像を拡大表示することで、中間画像と右端画像とを連結するための基準となる基準点174、検査領域およびサーチ領域を設定しやすくしている。ユーザは、マウス9を操作することで、マーク170の中心に基準点174を設定する。さらに、CPU22は、基準点174を中心として検査領域およびサーチ領域を設定する。CPU22は、マウス9の操作にしたがって基準点174を微調整したり、検査領域およびサーチ領域の位置とサイズとを調整したりしてもよい。   FIG. 48 is a diagram illustrating a setting screen for setting a mark 170 that serves as a reference for image connection. The CPU 22 enlarges and displays the right end image of the connector, thereby making it easy to set a reference point 174, an inspection area, and a search area as a reference for connecting the intermediate image and the right end image. The user operates the mouse 9 to set the reference point 174 at the center of the mark 170. Further, the CPU 22 sets an inspection area and a search area with the reference point 174 as the center. The CPU 22 may finely adjust the reference point 174 according to the operation of the mouse 9, or may adjust the position and size of the inspection area and the search area.

図49は、マーク170を基準として連結されたフロントライト画像とバックライト画像とを示している。コネクタの左端画像、中間部の画像および右端画像を連結する際に、画像処理部30は、基準点171と基準点172とが重なるように、左端画像と中間部の画像を連結する。さらに、画像処理部30は、基準点173と基準点174とが重なるように、中間部の画像と右端画像とを連結する。これにより、検査対象物8の全体が収まった連結画像(全体画像)が作成される。フロントライト画像とバックライト画像とでは座標系が一致しているため、フロントライト画像の連結位置を基準として、バックライト画像についても同様に連結できる。なお、図49に示したように、バックライト画像については左端画像と右端画像しか存在しない場合は、フロントライト画像の左端画像と、バックライト画像の左端画像との各原点(画像の左上の角)が一致させる。また、フロントライト画像の右端画像と、バックライト画像の右端画像との各原点(画像の左上の角)も一致させる。これにより、図49に示したように、コネクタの全体を示したフロントライト画像とバックライト画像とが作成される。   FIG. 49 shows a front light image and a backlight image connected with the mark 170 as a reference. When connecting the left end image, the intermediate portion image, and the right end image of the connector, the image processing unit 30 connects the left end image and the intermediate portion image so that the reference point 171 and the reference point 172 overlap each other. Further, the image processing unit 30 connects the intermediate portion image and the right end image so that the reference point 173 and the reference point 174 overlap each other. Thereby, a connected image (entire image) in which the entire inspection object 8 is accommodated is created. Since the coordinate systems of the front light image and the backlight image are the same, the backlight image can be similarly connected on the basis of the connection position of the front light image. As shown in FIG. 49, when only the leftmost image and the rightmost image exist for the backlight image, each origin (the upper left corner of the image) of the leftmost image of the frontlight image and the leftmost image of the backlight image. ) Match. In addition, the origins (upper left corner of the image) of the right end image of the front light image and the right end image of the backlight image are also matched. As a result, as shown in FIG. 49, a front light image and a backlight image showing the entire connector are created.

<ピンやハウジングの検出方法>
上述の実施例は、モデル画像を用いたパターンマッチングを用いて検査対象物8のハウジングやピンを検出する例であった。しかし、必ずしもモデル画像は必要ではない。
<Pin and housing detection method>
The above-described embodiment is an example in which the housing and the pins of the inspection object 8 are detected using pattern matching using a model image. However, a model image is not always necessary.

図50は、エッジ検出を利用したピンの検出方法を示す図である。画像処理部30は、エッジ検出を実行することで、複数の横方向のエッジや縦方向のエッジを検出する。そして、検出された所定方向のエッジの中間位置(中心位置)が基準点200として自動設定される。画像処理部30は、基準点200から各エッジまでの距離を算出し、その距離が所定距離(一定の公差範囲内であれば許容される)であるエッジの組み合わせをサーチする。この例では、ピン41の左端に相当するエッジ201と右端に相当するエッジ202とが、ピンの検出条件に合致するエッジとして認識される。同様に、画像処理部30は、ピン41の上端に相当するエッジ203とし下端に相当するエッジ204とを、ピンの検出条件に合致するエッジとして認識する。これらは、基準点200からの距離がピンの検出条件に合致しているからである。このように、画像処理部30は、画像の全体についてエッジ検出を実行することで、各ピンの位置を検出できる。   FIG. 50 is a diagram illustrating a pin detection method using edge detection. The image processing unit 30 detects a plurality of horizontal edges and vertical edges by executing edge detection. Then, the detected intermediate position (center position) of the edge in the predetermined direction is automatically set as the reference point 200. The image processing unit 30 calculates the distance from the reference point 200 to each edge, and searches for a combination of edges whose distance is a predetermined distance (allowed if within a certain tolerance range). In this example, an edge 201 corresponding to the left end of the pin 41 and an edge 202 corresponding to the right end are recognized as edges that match the pin detection condition. Similarly, the image processing unit 30 recognizes the edge 203 corresponding to the upper end of the pin 41 and the edge 204 corresponding to the lower end as edges that match the pin detection condition. This is because the distance from the reference point 200 matches the pin detection condition. In this way, the image processing unit 30 can detect the position of each pin by performing edge detection on the entire image.

図51は、エッジ検出を利用したハウジングの検出方法を示す図である。画像処理部30は、複数の横方向のエッジや縦方向のエッジを検出し、基準点210において直交するエッジ211とエッジ212を抽出する。ここで、エッジ211とエッジ212は最も外側に位置するエッジである。基準点(交点)210は、エッジ211とエッジ212が抽出された後、エッジ211とエッジ212が交差する点として自動設定される。このような検出条件を予め設定しておくことで、画像処理部30は、エッジ検出を利用してハウジングの端を検出してもよい。   FIG. 51 is a diagram illustrating a housing detection method using edge detection. The image processing unit 30 detects a plurality of horizontal edges and vertical edges, and extracts an edge 211 and an edge 212 that are orthogonal to each other at the reference point 210. Here, the edge 211 and the edge 212 are the outermost edges. The reference point (intersection point) 210 is automatically set as a point where the edge 211 and the edge 212 intersect after the edge 211 and the edge 212 are extracted. By setting such detection conditions in advance, the image processing unit 30 may detect the end of the housing using edge detection.

<内部処理について>
以下ではCPU22や画像処理部30で実現されている機能について説明する。なお、各機能は、CPU22だけで実現されてもよいし、画像処理部30だけで実現されてもよいし、CPU22と画像処理部30との連携動作によって実現されてもよい。
<About internal processing>
Hereinafter, functions realized by the CPU 22 and the image processing unit 30 will be described. Each function may be realized only by the CPU 22, may be realized only by the image processing unit 30, or may be realized by a cooperative operation between the CPU 22 and the image processing unit 30.

図52は、外観検査装置1の機能ブロック図である。図2を用いてすでに説明したように、照明装置5は、検査対象物8に対して複数の異なる照明光を照射する照明部として機能する。照明制御部26が、CPU22または画像処理部30からの指示にしたがって照明装置5が照射する照明光を切り替えるように照明装置5を制御する。カメラ4は。照明装置5によって照明光を照射された検査対象物8を撮像する撮像部として機能する。また、外観検査装置1は、カメラ4により取得された検査対象物8の画像に対して計測処理を実行する装置である。   FIG. 52 is a functional block diagram of the appearance inspection apparatus 1. As already described with reference to FIG. 2, the illumination device 5 functions as an illumination unit that irradiates the inspection target 8 with a plurality of different illumination lights. The illumination control unit 26 controls the illumination device 5 so as to switch the illumination light emitted by the illumination device 5 in accordance with an instruction from the CPU 22 or the image processing unit 30. Camera 4 It functions as an imaging unit that images the inspection object 8 irradiated with illumination light by the illumination device 5. The appearance inspection apparatus 1 is an apparatus that executes measurement processing on the image of the inspection object 8 acquired by the camera 4.

撮像制御部301は、フロントライトやバックライトなど照明光の切り替えを照明制御部26に命令したり、カメラ4に撮像を命令したりする制御部である。撮像制御部301は、検査対象物8を分割して撮影する際のカメラ4の制御や照明装置5の制御も担当する。   The imaging control unit 301 is a control unit that commands the illumination control unit 26 to switch illumination light such as a front light and a backlight, and commands the camera 4 to perform imaging. The imaging control unit 301 also takes charge of control of the camera 4 and control of the illumination device 5 when the inspection object 8 is divided and imaged.

第1の画像記憶部304は、照明装置5により第1の照明光(例:フロントライト)が照射された検査対象物8の所定の領域(例:コネクタの全体やコネクタの左端、中間、右端など)をカメラ4が撮像して取得した第1の画像(例:フロントライト画像やその部分画像など)を記憶する。第2の画像記憶部305は、照明装置5により第2の照明光(例:バックライト)が照射された検査対象物8の所定の領域をカメラ4が撮像して取得した第2の画像(例:バックライト画像やその部分画像など)を記憶する。なお、第1の画像記憶部304や第2の画像記憶部305は、たとえば、ワークメモリ23により実現される。表示制御部28やモニタ10は、第1の画像と第2の画像とを表示する表示部として機能する。   The first image storage unit 304 is a predetermined region of the inspection object 8 irradiated with the first illumination light (e.g., front light) by the illumination device 5 (e.g., the entire connector or the left end, middle, and right end of the connector). Etc.) is stored in the first image (e.g., a front light image or a partial image thereof) acquired by the camera 4. The second image storage unit 305 is a second image (the second image (captured by the camera 4) acquired by the camera 4 capturing a predetermined area of the inspection object 8 irradiated with the second illumination light (eg, backlight) by the illumination device 5. Example: Backlight image or its partial image) is stored. The first image storage unit 304 and the second image storage unit 305 are realized by the work memory 23, for example. The display control unit 28 and the monitor 10 function as a display unit that displays the first image and the second image.

UI制御部310は、上述したUI60などの表示系のユーザインタフェースやマウス9やキーボードなどの入力系のインタフェースを制御する。UI制御部310は、さらに種々の機能部に分かれている。図21ないし図25などを用いて説明したように、第1の計測対象設定部311は、モニタ10に表示されている第1の画像と第2の画像とのうちの一方の画像において、検査対象物8に関する寸法を計測するための起点となる特徴部分(例:ピンの検出点)を設定する。   The UI control unit 310 controls a display-type user interface such as the above-described UI 60 and an input-type interface such as a mouse 9 and a keyboard. The UI control unit 310 is further divided into various functional units. As described with reference to FIG. 21 to FIG. 25 and the like, the first measurement target setting unit 311 performs inspection on one of the first image and the second image displayed on the monitor 10. A feature portion (for example, a detection point of a pin) that is a starting point for measuring a dimension related to the object 8 is set.

図30ないし図37を用いて説明したように、第2の計測対象設定部312は、モニタ10に表示されている第1の画像と第2の画像とのうちの他方の画像において、検査対象物8に関する寸法を計測するための終点となる特徴部分(例:ハウジングの角を検出するための検出点や複数の検出点間を結ぶ基準線など)を設定する。第1の計測対象設定部311や第2の計測対象設定部312により設定されたモデル画像、基準点、基準線などのデータは、特徴データ記憶部306に格納される。特徴データ記憶部306もワークメモリ23によって実現される。   As described with reference to FIG. 30 to FIG. 37, the second measurement target setting unit 312 is the inspection target in the other of the first image and the second image displayed on the monitor 10. A feature portion (for example, a detection point for detecting a corner of the housing or a reference line connecting a plurality of detection points) is set as an end point for measuring a dimension related to the object 8. Data such as model images, reference points, and reference lines set by the first measurement target setting unit 311 and the second measurement target setting unit 312 are stored in the feature data storage unit 306. The feature data storage unit 306 is also realized by the work memory 23.

寸法算出部302は、第1の計測対象設定部311により設定された起点となる特徴部分から第2の計測対象設定部312により設定された終点となる特徴部分までの寸法を算出する。ここで、寸法とは、距離や面積などである。   The dimension calculation unit 302 calculates the dimension from the feature part serving as the starting point set by the first measurement target setting unit 311 to the feature part serving as the end point set by the second measurement target setting unit 312. Here, the dimensions are distance, area, and the like.

UI制御部310は、検査対象物8の外観の良否を判定するための閾値を設定する閾値設定部313を有していてもよい。良否判定部303は、寸法算出部302により算出された寸法と閾値とを比較して、検査対象物8の外観の良否を判定する。たとえば、寸法算出部302が複数のピンについて求めたピン高さが、閾値設定部313により公差や標準値から求められた上限値を超えている場合、良否判定部303は、不良と判定する。   The UI control unit 310 may include a threshold setting unit 313 that sets a threshold for determining whether the appearance of the inspection object 8 is good or bad. The quality determination unit 303 compares the size calculated by the size calculation unit 302 with a threshold value, and determines the quality of the appearance of the inspection object 8. For example, if the pin height obtained for the plurality of pins by the dimension calculating unit 302 exceeds the upper limit value obtained from the tolerance or the standard value by the threshold setting unit 313, the pass / fail judgment unit 303 determines that it is defective.

図6などを用いて説明したように、UI制御部310は、第1の画像の横方向の端部と第2の画像の横方向の端部とが一致するように第1の画像と第2の画像とを同時にモニタ10が表示するようユーザインタフェースの表示データを作成し、表示制御部28に渡す。つまり、UI制御部310は、モニタ10が、第1の画像の横方向の端部と第2の画像の横方向の端部とを揃えて第1の画像と第2の画像とを上下に並べて表示するように表示データを作成する。また、UI制御部310は、第1の画像と第2の画像とのうちの一方の画像に対して設定された起点となる特徴部分を示す指標(例:サーチ領域、検査領域、検出点を示す十字マークなど)を、第1の画像と第2の画像とのうちの他方の画像に対しても連動して表示するように表示データを作成するようにしてもよい(少なくとも、検出点を示す十字マークが連動して表示されるようにするのが好ましい)。なお、UI制御部310は、第1の画像と第2の画像とのうちの他方の画像に対して設定された終点となる特徴部分を示す指標を、第1の画像と第2の画像とのうちの一方の画像に対しても連動して表示するための表示データを作成してもよい。このように、UI60においては、サーチ領域、検査領域、検出点を示す十字マークなどは、フロントライト画像とバックライト画像との間で連動して表示されることになる。たとえば、UI制御部310は、バックライト画像を用いて設定したサーチ領域、検査領域、検出点をそのままフロントライト画像にも設定して表示する。バックライト画像の原点をバックライト画像の左上角とし、フロントライト画像の原点をフロントライト画像の左上角とすると、バックライト画像を用いて設定したサーチ領域、検査領域、検出点の座標と、フロントライト画像におけるサーチ領域、検査領域、検出点の座標とを一致させる。これにより、UI制御部310は、フロントライト画像の原点をフロントライト画像の左上角とすると、バックライト画像を用いて設定したサーチ領域、検査領域、検出点と、フロントライト画像におけるサーチ領域、検査領域、検出点とを連動して表示させることができる。   As described with reference to FIG. 6 and the like, the UI control unit 310 sets the first image and the first image so that the horizontal end of the first image matches the horizontal end of the second image. Display data of the user interface is created so that the monitor 10 displays the two images at the same time, and is passed to the display control unit 28. That is, the UI control unit 310 causes the monitor 10 to vertically align the first image and the second image by aligning the horizontal end of the first image and the horizontal end of the second image. Create display data to display side by side. In addition, the UI control unit 310 displays an index (for example, a search area, an inspection area, and a detection point) indicating a feature portion that is a starting point set for one of the first image and the second image. Display data may be generated so that the other image of the first image and the second image is displayed in conjunction with the other image (at least the detection point). It is preferable that the cross mark shown is displayed in conjunction with it). Note that the UI control unit 310 uses the first image, the second image, and the index indicating the characteristic portion that is the end point set for the other image of the first image and the second image. Display data for displaying in conjunction with one of the images may be created. As described above, in the UI 60, the search area, the inspection area, the cross mark indicating the detection point, and the like are displayed in conjunction with each other between the front light image and the backlight image. For example, the UI control unit 310 sets and displays the search area, inspection area, and detection points set using the backlight image as they are in the front light image. If the origin of the backlight image is the upper left corner of the backlight image and the origin of the front light image is the upper left corner of the front light image, the search area, inspection area, detection point coordinates set using the backlight image, and the front The search area, inspection area, and detection point coordinates in the light image are matched. Thereby, the UI control unit 310 sets the search area, the inspection area, and the detection point set by using the backlight image, the search area in the frontlight image, and the inspection, when the origin of the frontlight image is the upper left corner of the frontlight image. Areas and detection points can be displayed in conjunction with each other.

第1の計測対象設定部311および第2の計測対象設定部312は特徴部分として、画像上の一か所以上の座標である基準点82、85、120、131、171、172、173、174、200、210を設定する。   The first measurement target setting unit 311 and the second measurement target setting unit 312 have, as characteristic portions, reference points 82, 85, 120, 131, 171, 172, 173, and 174 that are one or more coordinates on the image. , 200, 210 are set.

図21などを用いて説明したように、UI制御部310は、モニタ10が一方の画像を拡大表示するための表示データを作成してもよい。第1の計測対象設定部311は、モニタ10に拡大表示された一方の画像に、マウス9の操作にしたがって特徴部分を設定する。   As described with reference to FIG. 21 and the like, the UI control unit 310 may create display data for the monitor 10 to enlarge and display one image. The first measurement target setting unit 311 sets a characteristic part in one image enlarged and displayed on the monitor 10 according to the operation of the mouse 9.

図30などを用いて説明したように、UI制御部310は、モニタ10が他方の画像を拡大表示するための表示データを作成してもよい。第2の計測対象設定部312は、モニタ10に拡大表示された他方の画像に、マウス9の操作にしたがって特徴部分を設定する。   As described with reference to FIG. 30 and the like, the UI control unit 310 may create display data for the monitor 10 to enlarge and display the other image. The second measurement target setting unit 312 sets a characteristic part in the other image enlarged and displayed on the monitor 10 in accordance with the operation of the mouse 9.

図35ないし図37を用いて説明したように、第2の計測対象設定部312は、他方の画像に対して指定された2つの基準点を結ぶ直線である基準線81を特徴部分として設定してもよい。とりわけ、ハウジング40の角を基準点として設定する場合、フロントライト画像では角の検出が難しくなってしまう。そこで、バックライト画像に対して、ハウジング40の角を基準点として設定することで、角の位置を正確に検出できるようになる。また、これにより、ピンの中心から角までの距離も精度よく算出できるようになる。さらに、製品の良否判定の精度も向上することになる。   As described with reference to FIGS. 35 to 37, the second measurement target setting unit 312 sets a reference line 81, which is a straight line connecting two reference points designated for the other image, as a feature portion. May be. In particular, when the corner of the housing 40 is set as a reference point, it becomes difficult to detect the corner in the front light image. Therefore, by setting the corner of the housing 40 as a reference point for the backlight image, the corner position can be accurately detected. This also makes it possible to accurately calculate the distance from the center of the pin to the corner. Furthermore, the accuracy of product quality determination is also improved.

図5などを用いて説明したように、画像連結部321は、カメラ4が検査対象物8を複数回に分割して撮像して得られた複数の部分画像を撮像された順番にしたがって左から右に並べて連結して第1の画像および第2の画像を作成する。ここで、画像連結部321は、第1の画像を構成する複数の部分画像の連結位置(例:共通に写っているピンの位置やマークの位置)の座標を用いて、第2の画像を構成する複数の部分画像を連結してもよい。なお、UI制御部310は、第1の画像において連結位置を設定する連結位置設定部314をさらに備えていてもよい。連結位置設定部314は、隣り合った部分画像に共通に写っている検査対象物のパーツ(例:ピンや金具など)の位置を連結位置に設定してもよい。図45ないし図49を用いて説明したように、連結位置設定部314は、隣り合った部分画像に共通に写っている検査対象物を固定する治具の一部(例:マーク170)の位置を連結位置に設定してもよい。   As described with reference to FIG. 5 and the like, the image linking unit 321 starts from the left in accordance with the order in which a plurality of partial images obtained by the camera 4 dividing and imaging the inspection object 8 a plurality of times are captured. A first image and a second image are created by connecting them side by side to the right. Here, the image connecting unit 321 uses the coordinates of the connecting positions of a plurality of partial images constituting the first image (for example, pin positions and mark positions shown in common) to generate the second image. You may connect the some partial image which comprises. Note that the UI control unit 310 may further include a connection position setting unit 314 that sets a connection position in the first image. The connection position setting unit 314 may set the position of a part (for example, a pin or a metal fitting) of the inspection object that is commonly shown in adjacent partial images as the connection position. As described with reference to FIGS. 45 to 49, the connection position setting unit 314 positions the part of the jig (for example, the mark 170) that fixes the inspection object that is commonly shown in the adjacent partial images. May be set as the connection position.

画像連結部321は、検査対象物8の左端の部分画像と右端の部分画像とを第2の画像の両端に配置し、検査対象物8の中間の画像を省略して、第2の画像を作成してもよい。   The image connecting unit 321 arranges the left end partial image and the right end partial image of the inspection object 8 at both ends of the second image, omits the intermediate image of the inspection object 8, and displays the second image. You may create it.

図52において、画像認識部322は、UI制御部を通じて設定された検査対象物8の良品の一部を示すモデル画像と、カメラ4により取得されたラインを流れる検査対象物8の画像とを比較し、モデル画像と一致する部分をパターン認識により特定する。画像認識部322は、予め設定されたサーチ領域の範囲内でモデル画像をサーチする。モデル画像と同サイズの画像領域が検査領域となる。なお、モデル画像と一致した検査領域の中心が基準点となる。なお、UI制御部を通じて基準点が微調整されていることもある。サーチ領域の座標データや基準点(検出点)の座標データは特徴データ記憶部306に記憶されており、画像認識部322や画像連結部321、座標計算部323によって使用される。座標計算部323は、マウス9のポインタの位置を示す座標データと、バックライト画像やフロントライト画像の座標データとからサーチ領域、検査領域および基準点の座標を算出する。   In FIG. 52, the image recognition unit 322 compares the model image showing a part of the non-defective product of the inspection object 8 set through the UI control unit with the image of the inspection object 8 flowing through the line acquired by the camera 4. Then, a portion that matches the model image is specified by pattern recognition. The image recognition unit 322 searches for a model image within a preset search area. An image area having the same size as the model image is an inspection area. The center of the inspection area that matches the model image is the reference point. Note that the reference point may be finely adjusted through the UI control unit. The coordinate data of the search area and the coordinate data of the reference point (detection point) are stored in the feature data storage unit 306 and are used by the image recognition unit 322, the image connection unit 321 and the coordinate calculation unit 323. The coordinate calculation unit 323 calculates the coordinates of the search area, the inspection area, and the reference point from the coordinate data indicating the position of the pointer of the mouse 9 and the coordinate data of the backlight image or the frontlight image.

図53は、外観検査に関するパラメータの設定処理から良品判定までを含む一連の工程を示したフローチャートである。   FIG. 53 is a flowchart showing a series of steps including a parameter setting process related to appearance inspection and non-defective product determination.

S531で、撮像制御部301は照明制御部26を通じてフロントライト51を点灯させ、検査対象物8(良品)を撮像してフロントライト画像61を取得する。フロントライト画像61は第1の画像記憶部304に記憶される。   In step S531, the imaging control unit 301 turns on the front light 51 through the illumination control unit 26, images the inspection object 8 (non-defective product), and acquires the front light image 61. The front light image 61 is stored in the first image storage unit 304.

S532で、撮像制御部301は照明制御部26を通じてフロントライト51を点灯させ、バックライト52を転送させる。   In step S532, the imaging control unit 301 turns on the front light 51 through the illumination control unit 26 and transfers the backlight 52.

S533で、撮像制御部301はバックライト52により照明光を当てられた検査対象物8(良品)を撮像してバックライト画像62を取得する。バックライト画像62は第2の画像記憶部305に記憶される。   In step S <b> 533, the imaging control unit 301 acquires the backlight image 62 by imaging the inspection object 8 (non-defective product) illuminated by the backlight 52. The backlight image 62 is stored in the second image storage unit 305.

なお、検査対象物8(良品)を複数回にわけて撮像し、画像連結を実行する場合、S531ないしS532が繰り返し実行される。上述したように、バックライト画像62において、検査対象物8(良品)の中間部の画像は省略されてもよい。   Note that when the inspection object 8 (non-defective product) is imaged in multiple times and image connection is executed, S531 to S532 are repeatedly executed. As described above, in the backlight image 62, the intermediate image of the inspection object 8 (non-defective product) may be omitted.

S534で、画像連結部321は、連結位置設定部314により設定された連結位置を基準として、隣り合った部分画像を連結してゆく。フロントライト画像については、検査対象物8(良品)のすべての部分画像が存在するため、撮影した順番にしたがって左から右へと隣り合った部分画像を連結する。バックライト画像について、中間の部分画像を存在しないときは、フロントライト画像の右端画像の座標を利用してバックライト画像の右端画像の座標を設定する。つまり、画像連結部321は、バックライト画像の左端と右端がそれぞれフロントライト画像の左端と右端に一致するように、バックライト画像の部分画像を配置する。   In step S534, the image connecting unit 321 connects adjacent partial images based on the connection position set by the connection position setting unit 314. As for the front light image, since there are all partial images of the inspection object 8 (non-defective product), the adjacent partial images are connected from left to right according to the order of photographing. When there is no intermediate partial image for the backlight image, the coordinates of the right edge image of the backlight image are set using the coordinates of the right edge image of the front light image. That is, the image connecting unit 321 arranges the partial images of the backlight image so that the left end and the right end of the backlight image coincide with the left end and the right end of the front light image, respectively.

S535で、第1の計測対象設定部311はフロントライト画像の特徴部分(例:ピンなど)を設定する。上述したように、第1の計測対象設定部311は、サーチ領域、検査領域および検出点の座標をマウス9の操作に応じて設定する。   In S535, the first measurement target setting unit 311 sets a characteristic part (eg, pin) of the front light image. As described above, the first measurement target setting unit 311 sets the coordinates of the search area, the inspection area, and the detection point according to the operation of the mouse 9.

S536で、第2の計測対象設定部312はバックライト画像の特徴部分(例:ハウジングの端など)を設定する。上述したように、第2の計測対象設定部312は、サーチ領域、検査領域および検出点の座標をマウス9の操作に応じて設定する。ここで、フロントライト画像に設定されたサーチ領域、検査領域および検出点はそのままバックライトのサーチ領域、検査領域および検出点として反映されるようにしてもよい。同様に、バックライト画像に設定されたサーチ領域、検査領域および検出点はそのままフロントライトのサーチ領域、検査領域および検出点として反映される。また、第2の計測対象設定部312は、寸法測定に使用される基準線の設定をフロントライト画像またはバックライト画像のいずれか一方を用いて設定してもよい。   In S536, the second measurement target setting unit 312 sets a characteristic portion (eg, an end of the housing) of the backlight image. As described above, the second measurement target setting unit 312 sets the coordinates of the search area, the inspection area, and the detection point according to the operation of the mouse 9. Here, the search area, inspection area, and detection point set in the front light image may be directly reflected as the search area, inspection area, and detection point of the backlight. Similarly, the search area, inspection area, and detection point set in the backlight image are directly reflected as the search area, inspection area, and detection point of the front light. Further, the second measurement target setting unit 312 may set the reference line used for the dimension measurement using either the front light image or the backlight image.

S537で、閾値設定部313は、良品判定に使用する閾値を設定する。上述したように、マウス9などを通じて設定された公差や標準値から上限値や下限値などの閾値を設定する。その後、運転モードに移行する。   In S537, the threshold setting unit 313 sets a threshold used for non-defective product determination. As described above, threshold values such as an upper limit value and a lower limit value are set from tolerances and standard values set through the mouse 9 or the like. Thereafter, the operation mode is entered.

S538で、撮像制御部301は、カメラ4や照明装置5を制御して、搬送装置7によってラインを搬送される製品を撮像させ、必要に応じて画像連結部321が画像連結を実行し、寸法算出部302が、フロントライト画像とバックライト画像に対して、予め設定されたサーチ領域、検査領域および検出点を使用して寸法を算出する。   In step S538, the imaging control unit 301 controls the camera 4 and the illumination device 5 to image the product conveyed through the line by the conveyance device 7, and the image coupling unit 321 executes image coupling as necessary, and the dimensions The calculation unit 302 calculates dimensions for the front light image and the backlight image using preset search areas, inspection areas, and detection points.

S539で、良否判定部303は、寸法算出部302が算出した距離などの寸法と閾値設定部313によって設定された閾値とを比較し、良品か不良品かを判定する。   In S <b> 539, the quality determination unit 303 compares the dimension such as the distance calculated by the dimension calculation unit 302 with the threshold set by the threshold setting unit 313, and determines whether the product is non-defective or defective.

このように本実施例によれば、外観検査装置1は、異なる照明条件で取得された第1の画像と第2の画像に対して寸法計測のための複数の異なる特徴部分を設定し、寸法を計測できるようにしている。上述したように、ピンとハウジングの角までの距離を算出しようとすると、フロントライトで得られた画像ではピンの位置を認識しやすいが、ハウジングの角の位置を認識しにくいため、正確に距離を算出できなかった。一方で、バックライトで得られた画像では、ハウジングの角の位置を認識しやすいが、ピンの位置を認識しにくいため、やはり正確に距離を算出できなかった。そこで、フロントライト画像からピンの位置を検出し、バックライト画像からハウジングの角の位置を検出することで、両者の距離を精度よく求められるようになり、良品判定の精度も向上する。   As described above, according to the present embodiment, the appearance inspection apparatus 1 sets a plurality of different characteristic portions for dimension measurement with respect to the first image and the second image acquired under different illumination conditions. Can be measured. As described above, when calculating the distance between the pin and the corner of the housing, it is easy to recognize the position of the pin in the image obtained by the front light, but it is difficult to recognize the position of the corner of the housing. It was not possible to calculate. On the other hand, in the image obtained with the backlight, it is easy to recognize the position of the corner of the housing, but it is difficult to recognize the position of the pin, so the distance cannot be calculated accurately. Therefore, by detecting the position of the pin from the front light image and detecting the position of the corner of the housing from the backlight image, the distance between the two can be obtained with high accuracy, and the accuracy of the non-defective product determination is improved.

また、照明条件を変えて検査対象物8の同一の部分を撮像して得られた2枚の画像をそれぞれの両端が一致するように同時に表示されるため、ユーザは、両者を比較しながら、基準点などを設定しやすくなろう。とりわけ、これらの画像を上下に並べて表示すれば、一方の画像における検査対象物8の横方向における端部と、他方の画像における検査対象物8の横方向における端部とが一致するため、距離の測定対象となる特徴部分を視覚的に把握しやすくなろう。   Moreover, since two images obtained by changing the illumination conditions and imaging the same part of the inspection object 8 are displayed at the same time so that both ends thereof coincide with each other, It will be easier to set a reference point. In particular, when these images are displayed side by side, the end in the horizontal direction of the inspection object 8 in one image matches the end in the horizontal direction of the inspection object 8 in the other image. It will be easier to visually grasp the characteristic part to be measured.

さらに、第1の画像と第2の画像とのうちの一方の画像に対して設定された特徴部分を示す指標を、他方の画像に対しても連動して表示することで、一方の画像における特徴部分が他の画像においてどの部分に相当するかを把握しながら、正確に特徴部分を設定できるようになろう。   Further, by displaying an index indicating the characteristic portion set for one of the first image and the second image in conjunction with the other image, It will be possible to accurately set the feature portion while grasping which portion the feature portion corresponds to in another image.

特徴部分としては、上述したように寸法の算出に使用される基準点や基準線などがある。たとえば、ハウジングの角に基準点(検出点)を設けたい場合には、バックライト画像を使用すると、正確に基準点を設定しやすくなろう。同様に、基準線をハウジングの外形に沿って設定したいときも、バックライト画像は有利であろう。ただし、ハウジングの色やピンの色、背景の色に依存して、フロントライト画像が有利なこともある。この場合、上述した実施例において、フロントライト画像とバックライト画像とは入れ替えて利用されることになる。   As described above, the characteristic portion includes a reference point and a reference line used for calculating the dimension. For example, if it is desired to provide a reference point (detection point) at the corner of the housing, it will be easier to set the reference point accurately if a backlight image is used. Similarly, a backlight image may be advantageous when it is desired to set a reference line along the housing outline. However, depending on the housing color, the pin color, and the background color, the front light image may be advantageous. In this case, in the embodiment described above, the front light image and the backlight image are used interchangeably.

また、第1の画像や第2の画像を拡大表示することで、さらに正確に基準点を設定しやすくなろう。すなわち、第1の計測対象設定部がモニタ10に拡大表示された一方の画像に特徴部分を設定し、第2の計測対象設定部がモニタ10に拡大表示された他方の画像に特徴部分を設定する際に、ユーザは、特徴部分を正確に把握して基準点を設定できるであろう。   In addition, by enlarging and displaying the first image and the second image, it becomes easier to set the reference point more accurately. That is, the first measurement target setting unit sets a feature portion in one image enlarged and displayed on the monitor 10, and the second measurement target setting unit sets a feature portion in the other image enlarged and displayed on the monitor 10. In doing so, the user will be able to accurately grasp the feature and set the reference point.

本実施例では、画像連結部321が、カメラ4が検査対象物8を複数回に分割して撮像して得られた複数の部分画像を、撮像された順番にしたがって左から右に並べて連結して第1の画像や第2の画像を作成する。この際に連結位置を指定する際にも、第1の画像や第2の画像とのうち、連結の精度が高くなるようほうの画像を使用することが望ましい。   In the present embodiment, the image connecting unit 321 connects a plurality of partial images obtained by the camera 4 dividing and imaging the inspection object 8 a plurality of times from the left to the right according to the order of image capturing. To create a first image and a second image. At this time, it is desirable to use an image having higher connection accuracy among the first image and the second image when the connection position is designated.

本実施例では、画像連結部321は、第1の画像を構成する複数の部分画像の連結位置の座標を用いて、第2の画像を構成する複数の部分画像を連結する。第1の画像の連結結果を利用できるため、第2の画像の連結に必要となる演算量を大幅に軽減できるであろう。とりわけ、第2の画像において中間の部分画像を省略する場合には、さらに、第2の画像の連結に必要となる演算量をさらに軽減できるであろう。   In the present embodiment, the image connecting unit 321 connects a plurality of partial images forming the second image using the coordinates of the connecting positions of the plurality of partial images forming the first image. Since the result of connecting the first images can be used, the amount of calculation required for connecting the second images can be greatly reduced. In particular, when an intermediate partial image is omitted from the second image, the amount of calculation required for connecting the second images can be further reduced.

本実施例では、フロントライト51とバックライト52とを切り替える照明装置5を例示した。しかし、本発明は、異なる照明条件で照明光を検査対象物8に照射する照明装置であれば適用可能である。たとえば、光沢を際立たせる同軸落射照明、傷や刻印のエッジが際立つローアングル照明、ブラックライトを当てるブラックライト照明、バックライトとして用いられる面照明、四方八方から拡散光を照射するドーム照明などを行う照明装置が採用されてもよい。   In the present embodiment, the illumination device 5 that switches between the front light 51 and the backlight 52 is illustrated. However, the present invention is applicable to any illumination device that irradiates the inspection object 8 with illumination light under different illumination conditions. For example, coaxial epi-illumination that highlights gloss, low-angle illumination that highlights the edges of scratches and marks, black-light illumination that shines black light, surface illumination that is used as a backlight, dome illumination that emits diffuse light from all directions An illumination device may be employed.

なお、単一の照明装置を使用しつつ、カメラ4のシャッタースピードだけを変える、また、照明の明るさを変更するなど、撮像条件を変えてもよい。これは、実質的に異なる照明光を検査対象物8に照射するのと、同様の効果が得られるからである。この場合の外観検査装置1は、検査対象物8に対して照明光を照射する照明装置5と、照明装置5によって照明光を照射された検査対象物8を、撮影条件を切り替えながら撮像するカメラ4とを有し、撮影条件の異なる複数の画像に対して計測処理を実行することになる。第1の画像記憶部304は、第1の撮像条件で検査対象物の所定の領域を撮像部が撮像して取得した第1の画像を記憶する。第2の画像記憶部305は、第2の撮像条件で検査対象物の所定の領域を撮像部が撮像して取得した第2の画像を記憶する。その他の動作は、照明条件を変えて取得された第1の画像、第2の画像に関する処理と同様となる。   Note that the imaging conditions may be changed, such as changing only the shutter speed of the camera 4 or changing the brightness of the illumination while using a single lighting device. This is because the same effect can be obtained as when the inspection object 8 is irradiated with substantially different illumination light. In this case, the appearance inspection apparatus 1 is a camera that images the illumination apparatus 5 that irradiates the inspection object 8 with illumination light and the inspection object 8 that is irradiated with the illumination light by the illumination apparatus 5 while switching the imaging conditions. 4 and the measurement process is executed on a plurality of images having different shooting conditions. The first image storage unit 304 stores a first image acquired by the imaging unit capturing an image of a predetermined area of the inspection object under the first imaging condition. The second image storage unit 305 stores a second image acquired by the imaging unit capturing an image of a predetermined area of the inspection object under the second imaging condition. Other operations are the same as the processing related to the first image and the second image acquired by changing the illumination condition.

Claims (20)

検査対象物に対して複数の異なる照明光を照射する照明部と、前記照明部が照射する照明光を切り替えるように当該照明部を制御する照明制御部と、前記照明部によって照明光を照射された前記検査対象物を撮像する撮像部と、外部接続される制御機器から前記撮像部の撮像タイミングを規定する撮像トリガ信号を受信する通信部と、を有し、
前記撮像部により取得された前記検査対象物の画像を用いて前記検査対象物の外観の良否を判定し、その判定結果を示す判定信号を出力する外観検査装置であって、
前記照明部により第1の照明光が照射された検査対象物の所定の領域を前記撮像部が撮像して取得した第1の画像を記憶する第1の画像記憶部と、
前記照明部により第2の照明光が照射された検査対象物の前記所定の領域を前記撮像部が撮像して取得した第2の画像を記憶する第2の画像記憶部と、
前記第1の画像と前記第2の画像とを表示する表示部と、
前記表示部に表示される前記第1の画像を用いて、前記第1の画像から前記検査対象物に関する寸法を計測するの起点となる第1の特徴部分を抽出するための第1の設定を実行するとともに、前記表示部に表示される前記第2の画像を用いて、前記第2の画像から前記検査対象物に関する寸法を計測する際の終点となる第2の特徴部分を抽出するための第2の設定を実行する設定部と、
前記通信部において前記撮像トリガ信号を受信したときに、前記照明部により前記第1の照明光が照射された新たな検査対象物を前記撮像部が撮像して取得した第1の画像から、前記設定部による前記第1の設定に基づき前記第1の特徴部分を抽出するとともに、前記照明部により前記第2の照明光が照射された当該新たな検査対象物を前記撮像部が撮像して取得した第2の画像から、前記設定部による前記第2の設定に基づき前記第2の特徴部分を抽出する画像認識部と、
前記画像認識部により抽出された前記第1の特徴部分から前記第2の特徴部分までの寸法を算出する寸法算出部と
前記寸法算出部により算出された寸法と予め定められた閾値とに基づいて、前記検査対象物の外観の良否を判定する良否判定部と、
前記良否判定部による判定結果を示す判定信号を出力する手段と、
を有することを特徴とする外観検査装置。
An illumination unit that irradiates the inspection target with a plurality of different illumination lights, an illumination control unit that controls the illumination unit so as to switch the illumination light emitted by the illumination unit, and the illumination unit irradiates the illumination light. An imaging unit that images the inspection object, and a communication unit that receives an imaging trigger signal that defines imaging timing of the imaging unit from an externally connected control device ,
An appearance inspection apparatus that determines the quality of the appearance of the inspection object using the image of the inspection object acquired by the imaging unit, and outputs a determination signal indicating the determination result ,
A first image storage unit that stores a first image acquired by the imaging unit imaging a predetermined region of the inspection object irradiated with the first illumination light by the illumination unit;
A second image storage unit for storing a second image acquired by the imaging unit imaging the predetermined region of the inspection object irradiated with the second illumination light by the illumination unit;
A display unit for displaying the first image and the second image;
Using the first image displayed on the display unit, a first setting for extracting a first feature portion that is a starting point when measuring a dimension related to the inspection object from the first image. And the second image displayed on the display unit is used to extract a second feature portion that is an end point when measuring a dimension related to the inspection object from the second image. A setting unit for executing the second setting of
When the imaging unit receives the imaging trigger signal, the imaging unit captures and acquires a new inspection object irradiated with the first illumination light from the illumination unit. The first characteristic portion is extracted based on the first setting by the setting unit, and the imaging unit captures and acquires the new inspection object irradiated with the second illumination light by the illumination unit. An image recognition unit that extracts the second feature portion from the second image based on the second setting by the setting unit;
A dimension calculation unit for calculating a dimension from the first feature part to the second feature part extracted by the image recognition unit ;
A quality determination unit that determines the quality of the appearance of the inspection object based on the dimension calculated by the dimension calculation unit and a predetermined threshold;
Means for outputting a determination signal indicating a determination result by the pass / fail determination unit;
An appearance inspection apparatus characterized by comprising:
前記設定部は、前記表示部に表示される前記第1の画像を用いて、前記第1の設定において前記第1の特徴部分を抽出するための第1のモデル画像を設定するとともに、前記表示部に表示される前記第2の画像を用いて、前記第2の設定において前記第2の特徴部分を抽出するための第2のモデル画像を設定し、The setting unit uses the first image displayed on the display unit to set a first model image for extracting the first feature portion in the first setting, and the display A second model image for extracting the second feature portion in the second setting is set using the second image displayed in the section;
前記画像認識部は、前記第1の画像をサーチして前記第1のモデル画像と一致する部分を前記第1の特徴部分として抽出するとともに、前記第2の画像をサーチして前記第2のモデル画像と一致する部分を前記第2の特徴部分として抽出することを特徴とする請求項1に記載の外観検査装置。The image recognition unit searches the first image to extract a portion that matches the first model image as the first feature portion, and searches the second image to search for the second image. The appearance inspection apparatus according to claim 1, wherein a portion that matches a model image is extracted as the second feature portion.
前記設定部は、前記第1の画像から前記第1のモデル画像と一致する部分をサーチする範囲を示すサーチ領域を設定し、The setting unit sets a search area indicating a range for searching for a portion matching the first model image from the first image;
前記画像認識部は、前記第1の画像のうち前記サーチ領域に対応する領域内で前記第1のモデル画像と一致する部分を抽出することを特徴とする請求項2に記載の外観検査装置。The appearance inspection apparatus according to claim 2, wherein the image recognition unit extracts a portion that matches the first model image in an area corresponding to the search area in the first image.
前記表示部は、前記第2の画像を拡大表示するように構成されており、
前記定部は、前記表示部に拡大表示された前記第2の画像に前記第2の特徴部分を設定するように構成されていることを特徴とする請求項2または3に記載の外観検査装置。
The display unit is configured to enlarge and display the second image;
The setting tough the visual inspection according to claim 2 or 3, characterized in that it is configured to set the second feature portion of the enlarged displayed the second image on the display unit apparatus.
前記定部は、前記第2の画像に対して指定された2つの基準点を結ぶ直線である基準線を前記第2の特徴部分として設定するように構成されていることを特徴とする請求項2ないし4のいずれか1項に記載の外観検査装置。 The setting tough are claims characterized in that it is configured to set the reference line is a straight line connecting the two reference points specified for the second image as the second characteristic portion of the Item 5. The appearance inspection apparatus according to any one of Items 2 to 4. 前記表示部は、前記第1の画像の横方向の端部と前記第2の画像の横方向の端部とが一致するように前記第1の画像と前記第2の画像とを同時に表示することを特徴とすることを特徴とする請求項2ないしのいずれか1項に記載の外観検査装置。 The display unit simultaneously displays the first image and the second image so that a lateral end of the first image matches a lateral end of the second image. it appearance inspection apparatus according to any one of claims 2 to 5, characterized in that said. 前記表示部は、前記第1の画像の横方向の端部と前記第2の画像の横方向の端部とを揃えて前記第1の画像と前記第2の画像とを上下に並べて表示するように構成されており、前記第1の画像対して設定された前記第1の特徴部分を示す指標を、記第2の画像対しても連動して表示することを特徴とする請求項6に記載の外観検査装置。 The display unit displays the first image and the second image side by side by aligning the horizontal end of the first image and the horizontal end of the second image. is configured to, according to said index indicating a first of said set for the image first characteristic portion of the front Symbol display means displays in conjunction also for the second image Item 7. The appearance inspection apparatus according to Item 6. 前記表示部は、記第2の画像対して設定された前記第2の特徴部分を示す指標を、前記第1の画像対しても連動して表示することを特徴とする請求項7に記載の外観検査装置。 7. the display unit, the index indicating the previous SL second the second feature portion which is set for the image, and displaying in conjunction also for the first image 2. An appearance inspection apparatus according to 1. 前記設定部は、前記表示部に表示される前記第2の画像を用いて、前記第2の設定において前記第2の特徴部分のエッジを検出する範囲を示す検査領域を設定し、The setting unit uses the second image displayed on the display unit to set an inspection region indicating a range for detecting an edge of the second feature portion in the second setting,
前記画像認識部は、前記第2の画像のうち前記検査領域に対応する領域内で検出したエッジを前記第2の特徴部分として抽出することを特徴とする請求項1ないし8のいずれか1項に記載の外観検査装置。The said image recognition part extracts the edge detected within the area | region corresponding to the said test | inspection area | region among said 2nd images as said 2nd characteristic part. 2. An appearance inspection apparatus according to 1.
前記表示部は、前記第1の画像を拡大表示するように構成されており、
前記定部は、前記表示部に拡大表示された前記第1の画像に前記第1の特徴部分を設定するように構成されていることを特徴とする請求項1ないし9のいずれか1項に記載の外観検査装置。
The display unit is configured to enlarge and display the first image;
The setting tough has any one of claims 1 to 9, characterized in that it is configured to set the first characteristic portion of the enlarged displayed the first image on the display unit 2. An appearance inspection apparatus according to 1.
前記撮像部が前記検査対象物を複数回に分割して撮像して得られた複数の部分画像を撮像された順番にしたがって左から右または右から左に並べて連結して前記第1の画像および前記第2の画像を作成する画像連結部をさらに備えることを特徴とする請求項1ないし10のいずれか一に記載の外観検査装置。 A plurality of partial images obtained by the imaging unit dividing and imaging the inspection object a plurality of times are connected side by side from left to right or from right to left according to the order of imaging, and the first image and appearance inspection apparatus according to any one of claims 1 to 10, further comprising an image connecting unit that creates the second image. 前記画像連結部は、前記第1の画像を構成する複数の部分画像の連結位置の座標を用いて、前記第2の画像を構成する複数の部分画像を連結するように構成されている請求項11に記載の外観検査装置。   The said image connection part is comprised so that the some partial image which comprises the said 2nd image may be connected using the coordinate of the connection position of the some partial image which comprises the said 1st image. 11. An appearance inspection apparatus according to 11. 前記第1の画像において前記連結位置を設定する連結位置設定部をさらに備えることを特徴とする請求項12に記載の外観検査装置。   The visual inspection apparatus according to claim 12, further comprising a connection position setting unit that sets the connection position in the first image. 前記連結位置設定部は、隣り合った部分画像に共通に写っている検査対象物のパーツの位置を前記連結位置に設定するように構成されていることを特徴とする請求項13に記載の外観検査装置。   The appearance according to claim 13, wherein the connection position setting unit is configured to set a position of a part of an inspection object that is commonly shown in adjacent partial images as the connection position. Inspection device. 前記連結位置設定部は、隣り合った部分画像に共通に写っている検査対象物を固定する治具の一部の位置を前記連結位置に設定するように構成されていることを特徴とする請求項13に記載の外観検査装置。   The connection position setting unit is configured to set, as the connection position, a position of a part of a jig that fixes an inspection object commonly shown in adjacent partial images. Item 14. An appearance inspection apparatus according to Item 13. 前記画像連結部は、検査対象物の左端の部分画像と右端の部分画像とを前記第2の画像の両端に配置し、当該検査対象物の中間の画像を省略して、前記第2の画像を作成するように構成されていることを特徴とする請求項12ないし15のいずれか1項に記載の外観検査装置。   The image connecting unit arranges a left end partial image and a right end partial image of the inspection object at both ends of the second image, omits an intermediate image of the inspection object, and performs the second image. The appearance inspection apparatus according to claim 12, wherein the visual inspection apparatus is configured to create 前記照明部は、検査対象物の表面の特徴を抽出するための第1の照明光を照射する第1の照明部と、検査対象物の輪郭を抽出するための第2の照明光を照射する第2の照明部と、を備える請求項1ないし16のいずれか1項に記載の外観検査装置。   The illumination unit irradiates a first illumination unit that irradiates a first illumination light for extracting a surface feature of the inspection object and a second illumination light for extracting an outline of the inspection object. The visual inspection apparatus according to claim 1, further comprising a second illumination unit. 前記第1の照明部は、同軸落射照明による照明光を検査対象物に照射し、第2の照明部は、透過照明による照明光を検査対象物に照射する請求項17に記載の外観検査装置。   The visual inspection apparatus according to claim 17, wherein the first illumination unit irradiates the inspection object with illumination light by coaxial epi-illumination, and the second illumination unit irradiates the inspection object with illumination light by transmitted illumination. . 検査対象物に対して複数の異なる照明光を照射する照明部と、前記照明部が照射する照明光を切り替えるように当該照明部を制御する照明制御部と、前記照明部によって照明光を照射された前記検査対象物を撮像する撮像部と、外部接続される制御機器から前記撮像部の撮像タイミングを規定する撮像トリガ信号を受信する通信部と、を有し、前記撮像部により取得された前記検査対象物の画像を用いて前記検査対象物の外観の良否を判定し、その判定結果を示す判定信号を出力する外観検査装置の制御方法であって、
前記照明部により第1の照明光が照射された検査対象物の所定の領域を前記撮像部が撮像して取得した第1の画像を記憶するステップと、
前記照明部により第2の照明光が照射された検査対象物の前記所定の領域を前記撮像部が撮像して取得した第2の画像を記憶するステップと、
前記第1の画像と前記第2の画像とを表示部に表示するステップと、
前記表示部に表示され前記第1の画像を用いて、前記第1の画像から前記検査対象物に関する寸法を計測するの起点となる第1の特徴部分を抽出するための第1の設定を実行するとともに、前記表示部に表示される前記第2の画像を用いて、前記第2の画像から前記検査対象物に関する寸法を計測する際の終点となる第2の特徴部分を抽出するための第2の設定を実行するステップと、
前記通信部において前記撮像トリガ信号を受信したときに、前記照明部により前記第1の照明光が照射された新たな検査対象物を前記撮像部が撮像して取得した第1の画像から、前記第1の設定に基づき前記第1の特徴部分を抽出するとともに、前記照明部により前記第2の照明光が照射された当該新たな検査対象物を前記撮像部が撮像して取得した第2の画像から、前記第2の設定に基づき前記第2の特徴部分を抽出するステップと、
前記抽出された前記第1の特徴部分から前記第2の特徴部分までの寸法を算出するステップと
前記算出された寸法と予め定められた閾値とに基づいて、前記検査対象物の外観の良否を判定するステップと、
前記良否の判定結果を示す判定信号を出力するステップと、
を有することを特徴とする外観検査装置の制御方法。
An illumination unit that irradiates the inspection target with a plurality of different illumination lights, an illumination control unit that controls the illumination unit so as to switch the illumination light emitted by the illumination unit, and the illumination unit irradiates the illumination light. An imaging unit that images the inspection object, and a communication unit that receives an imaging trigger signal that defines an imaging timing of the imaging unit from an externally connected control device, and acquired by the imaging unit A method for controlling an appearance inspection apparatus that determines the quality of the appearance of the inspection object using an image of the inspection object and outputs a determination signal indicating the determination result ,
Storing a first image obtained by the imaging unit capturing and acquiring a predetermined area of the inspection object irradiated with the first illumination light by the illumination unit;
Storing a second image acquired by the imaging unit imaging the predetermined region of the inspection object irradiated with the second illumination light by the illumination unit;
Displaying the first image and the second image on a display unit;
Using the first image that is displayed on the display unit, the first setting for extracting a first feature portion as a starting point when measuring the dimensions for the inspection object from the first image And the second image displayed on the display unit is used to extract a second feature portion that is an end point when measuring a dimension related to the inspection object from the second image. Performing a second setting of
When the imaging unit receives the imaging trigger signal, the imaging unit captures and acquires a new inspection object irradiated with the first illumination light from the illumination unit. The first characteristic portion is extracted based on the first setting, and the imaging unit captures and acquires the new inspection object irradiated with the second illumination light by the illumination unit. Extracting the second feature portion from the image based on the second setting;
Calculating a dimension from the extracted first feature portion to the second feature portion ;
Determining the quality of the appearance of the inspection object based on the calculated dimensions and a predetermined threshold;
Outputting a determination signal indicating the determination result of the quality;
A control method for an appearance inspection apparatus, comprising:
検査対象物に対して複数の異なる照明光を照射する照明部と、前記照明部が照射する照明光を切り替えるように当該照明部を制御する照明制御部と、前記照明部によって照明光を照射された前記検査対象物を撮像する撮像部と、外部接続される制御機器から前記撮像部の撮像タイミングを規定する撮像トリガ信号を受信する通信部と、を有し、前記撮像部により取得された前記検査対象物の画像を用いて前記検査対象物の外観の良否を判定し、その判定結果を示す判定信号を出力するコンピュータで実行されるプログラムであって、
前記コンピュータに、
前記照明部により第1の照明光が照射された検査対象物の所定の領域を前記撮像部が撮像して取得した第1の画像を記憶するステップと、
前記照明部により第2の照明光が照射された検査対象物の前記所定の領域を前記撮像部が撮像して取得した第2の画像を記憶するステップと、
前記第1の画像と前記第2の画像とを表示部に表示するステップと、
前記表示部に表示されている前記第1の画像を用いて、前記第1の画像から前記検査対象物に関する寸法を計測するための起点となる第1の特徴部分を抽出するための第1の設定を実行するとともに、前記表示部に表示される前記第2の画像を用いて、前記第2の画像から前記検査対象物に関する寸法を計測する際の終点となる第2の特徴部分を抽出するための第2の設定を実行するステップと、
前記通信部において前記撮像トリガ信号を受信したときに、前記照明部により前記第1の照明光が照射された新たな検査対象物を前記撮像部が撮像して取得した第1の画像から、前記第1の設定に基づき前記第1の特徴部分を抽出するとともに、前記照明部により前記第2の照明光が照射された当該新たな検査対象物を前記撮像部が撮像して取得した第2の画像から、前記第2の設定に基づき前記第2の特徴部分を抽出するステップと、
前記抽出された前記第1の特徴部分から前記第2の特徴部分までの寸法を算出するステップと
前記算出された寸法と予め定められた閾値とに基づいて、前記検査対象物の外観の良否を判定するステップと、
前記良否の判定結果を示す判定信号を出力するステップと、
を実行させることを特徴とするプログラム。
An illumination unit that irradiates the inspection target with a plurality of different illumination lights, an illumination control unit that controls the illumination unit so as to switch the illumination light emitted by the illumination unit, and the illumination unit irradiates the illumination light. An imaging unit that images the inspection object, and a communication unit that receives an imaging trigger signal that defines an imaging timing of the imaging unit from an externally connected control device, and acquired by the imaging unit A program executed on a computer that determines the quality of the appearance of the inspection object using an image of the inspection object and outputs a determination signal indicating the determination result ,
In the computer,
Storing a first image obtained by the imaging unit capturing and acquiring a predetermined area of the inspection object irradiated with the first illumination light by the illumination unit;
Storing a second image acquired by the imaging unit imaging the predetermined region of the inspection object irradiated with the second illumination light by the illumination unit;
Displaying the first image and the second image on a display unit;
Using the first image displayed on the display unit, a first feature portion for extracting a first feature portion serving as a starting point for measuring a dimension related to the inspection object from the first image . The setting is executed, and a second feature portion serving as an end point when measuring a dimension related to the inspection object is extracted from the second image using the second image displayed on the display unit. Performing a second setting for :
When the imaging unit receives the imaging trigger signal, the imaging unit captures and acquires a new inspection object irradiated with the first illumination light from the illumination unit. The first characteristic portion is extracted based on the first setting, and the imaging unit captures and acquires the new inspection object irradiated with the second illumination light by the illumination unit. Extracting the second feature portion from the image based on the second setting;
Calculating a dimension from the extracted first feature portion to the second feature portion ;
Determining the quality of the appearance of the inspection object based on the calculated dimensions and a predetermined threshold;
Outputting a determination signal indicating the determination result of the quality;
A program characterized by having executed.
JP2012202268A 2012-09-14 2012-09-14 Appearance inspection apparatus, control method and program for appearance inspection apparatus Expired - Fee Related JP5947168B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012202268A JP5947168B2 (en) 2012-09-14 2012-09-14 Appearance inspection apparatus, control method and program for appearance inspection apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012202268A JP5947168B2 (en) 2012-09-14 2012-09-14 Appearance inspection apparatus, control method and program for appearance inspection apparatus

Publications (2)

Publication Number Publication Date
JP2014055913A JP2014055913A (en) 2014-03-27
JP5947168B2 true JP5947168B2 (en) 2016-07-06

Family

ID=50613348

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012202268A Expired - Fee Related JP5947168B2 (en) 2012-09-14 2012-09-14 Appearance inspection apparatus, control method and program for appearance inspection apparatus

Country Status (1)

Country Link
JP (1) JP5947168B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116297464B (en) * 2023-05-18 2023-08-25 沈阳和研科技股份有限公司 Dicing saw cutting tool mark image acquisition device and dicing saw

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05249050A (en) * 1992-03-10 1993-09-28 Komatsu Ltd Apparatus for inspecting external appearance of component
JP4932202B2 (en) * 2005-09-09 2012-05-16 株式会社ミツトヨ Part program generating apparatus for image measuring apparatus, part program generating method for image measuring apparatus, and part program generating program for image measuring apparatus
JP4922823B2 (en) * 2007-05-11 2012-04-25 オリンパス株式会社 3D shape measuring device
JP5270971B2 (en) * 2008-06-10 2013-08-21 株式会社キーエンス Image measuring apparatus, image measuring method, and computer program
JP2011203132A (en) * 2010-03-25 2011-10-13 Seiko Epson Corp Visual inspection apparatus

Also Published As

Publication number Publication date
JP2014055913A (en) 2014-03-27

Similar Documents

Publication Publication Date Title
JP5947169B2 (en) Appearance inspection apparatus, appearance inspection method and program
JP6630545B2 (en) Positioning method, positioning device, program, and computer-readable recording medium
US10366485B2 (en) Positioning method, visual inspection apparatus, program, computer readable recording medium, and visual inspection method
US10156525B2 (en) Inspection apparatus, inspection method, and program
JP5564349B2 (en) Image processing apparatus and appearance inspection method
JP5861462B2 (en) Inspection standard registration method for solder inspection and board inspection apparatus using the method
JP2004071781A (en) Method for preparing inspection data, and board inspection device using the same
JP7151873B2 (en) inspection equipment
JP2014055915A (en) Appearance inspection device, appearance inspection method, and program
JP2011158363A (en) Soldering inspection device for pga mounting substrate
KR101522312B1 (en) Inspection device for pcb product and inspecting method using the same
JP6008667B2 (en) Appearance inspection apparatus, appearance inspection method and program
JP5947168B2 (en) Appearance inspection apparatus, control method and program for appearance inspection apparatus
JP2007033126A (en) Substrate inspection device, parameter adjusting method thereof and parameter adjusting device
JP5960433B2 (en) Image processing apparatus and image processing method
EP3104169B1 (en) Quality management system
US8351709B2 (en) Projection height measuring method, projection height measuring apparatus and program
JP2009080004A (en) Inspection device
JP6236203B2 (en) Inspection apparatus and inspection method
JP6236204B2 (en) Inspection apparatus and inspection method
JP4507785B2 (en) Substrate inspection device, parameter setting method and parameter setting device
JP2017181270A (en) Inspection method and inspection device
JP3216123B2 (en) Bump inspection apparatus and bump inspection method for integrated circuit
KR100249808B1 (en) Ic leadframe lead spacing automatic visual inspection system
JP2010071941A (en) Inspection apparatus

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20150311

RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20150319

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20151207

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20151209

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20160204

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20160602

R150 Certificate of patent or registration of utility model

Ref document number: 5947168

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees