JP2020051806A - Optical arrangement generation device, optical arrangement generation program, method for generating optical arrangement, and surface inspection system - Google Patents

Optical arrangement generation device, optical arrangement generation program, method for generating optical arrangement, and surface inspection system Download PDF

Info

Publication number
JP2020051806A
JP2020051806A JP2018179198A JP2018179198A JP2020051806A JP 2020051806 A JP2020051806 A JP 2020051806A JP 2018179198 A JP2018179198 A JP 2018179198A JP 2018179198 A JP2018179198 A JP 2018179198A JP 2020051806 A JP2020051806 A JP 2020051806A
Authority
JP
Japan
Prior art keywords
imaging
point
arrangement
optical arrangement
inspected
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2018179198A
Other languages
Japanese (ja)
Inventor
知弘 廣瀬
Tomohiro Hirose
知弘 廣瀬
康元 佐藤
Yasumoto Sato
康元 佐藤
鈴木 哲也
Tetsuya Suzuki
哲也 鈴木
武彦 加藤
Takehiko Kato
武彦 加藤
克洋 須原
Katsuhiro Suhara
克洋 須原
祐人 猪口志
Yuto Chokushi
祐人 猪口志
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.)
Toyoda Gosei Co Ltd
Toyota Central R&D Labs Inc
Original Assignee
Toyoda Gosei Co Ltd
Toyota Central R&D Labs Inc
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 Toyoda Gosei Co Ltd, Toyota Central R&D Labs Inc filed Critical Toyoda Gosei Co Ltd
Priority to JP2018179198A priority Critical patent/JP2020051806A/en
Publication of JP2020051806A publication Critical patent/JP2020051806A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

To reduce the number of steps of teaching a robot arm holding an imaging device and an illumination source how to arrange the imaging device and the illumination source.SOLUTION: The optical arrangement generation device includes: an acquisition unit for acquiring shape data including the positional coordinates of a point group forming the shape of an inspection target body with a mirror surface and a normal vector for the surface of the shape; and a generation unit for generating and outputting optical arrangement data showing the arrangement pattern, to the inspection target body, of an imaging point for imaging an inspection target body and an illumination point for illuminating the inspection target body arranged so that there is the imaging point on an optical path for a reflected light regular-reflected on the surface.SELECTED DRAWING: Figure 3

Description

本発明は、表面が鏡面であり立体形状の被検査体の表面状態を検査する技術に関する。   The present invention relates to a technique for inspecting a surface state of a three-dimensional object to be inspected having a mirror surface.

複数のセンサによる観測対象の観測に関し、観測範囲に対して適切なセンサ配置の決定が行われている。このセンサ配置の決定について、例えば、特許文献1には、大気汚染を観測する際のセンサ配置を決定する技術が開示されている。また、特許文献2,3には、カメラなど視覚センサを有する移動体を用いた監視システムにおいて、死角を無くすことを目的としたセンサ配置の決定技術が開示されている。   Regarding the observation of an observation target by a plurality of sensors, an appropriate sensor arrangement is determined for an observation range. Regarding the determination of the sensor arrangement, for example, Patent Literature 1 discloses a technique of determining the sensor arrangement when observing air pollution. Further, Patent Literatures 2 and 3 disclose a technique of determining a sensor arrangement for eliminating a blind spot in a monitoring system using a moving object having a visual sensor such as a camera.

一方、鏡面を有する検査対象の外観検査システムに関しては、以下のような技術が知られている。例えば、特許文献4には、被検査体表面が鏡面光沢を有していても、被検査体表面の凹凸の検出精度をより高めることができる表面検査技術が開示されている。特許文献5には、光の強度による縞パターンを写り込ませた対象物を、時間相関カメラにより撮像した時間相関画像を解析して被検査体の異常を検出する技術が開示されている。特許文献6には、鏡面を有する検査対象の外観検査システムにおいて、照明源と検査対象の配置が予め決められた状況でカメラ配置を決定することが開示されている。   On the other hand, the following techniques are known for a visual inspection system for an inspection object having a mirror surface. For example, Patent Literature 4 discloses a surface inspection technique that can increase the accuracy of detecting irregularities on the surface of an object to be inspected even if the surface of the object to be inspected has a specular gloss. Patent Literature 5 discloses a technique for detecting an abnormality of a test object by analyzing a time-correlation image obtained by capturing a target on which a stripe pattern due to light intensity is captured by a time-correlation camera. Patent Document 6 discloses that in a visual inspection system for an inspection object having a mirror surface, a camera arrangement is determined in a situation where the arrangement of an illumination source and an inspection object is predetermined.

一般に、目視検査の自働化を目的とした外観検査システムは、照明源とカメラからなる検査装置を用いて、被検査体に生じたきずが写った画像を生成する第1段階、その画像に処理を施してきずを検出する第2段階、検出したきずのサイズや種類を認識する第3段階に分けて考えることができる。上述の特許文献6には、上記の第1段階において、スリット状に発光する発光面を被検査体に写り込ませるように照明源を移動する間に被検査体に写り込んだスリットパターンをカメラで連続的に撮像する方法、および撮像した複数枚の画像からきずの検査用画像を生成する方法が開示されている。このような外観検査システムでは、例えば、ロボットアームにカメラと照明源を把持させて、被検査体の形状に応じたカメラの配置と照明源の経路走査を行うことができる。   In general, a visual inspection system for the purpose of automating visual inspection is a first step of generating an image in which a defect generated on an object to be inspected using an inspection apparatus including an illumination source and a camera, and processing the image. And a third step of recognizing the size and type of the detected flaw. Patent Document 6 mentioned above discloses that, in the above-mentioned first stage, a camera is provided with a slit pattern reflected on an object to be inspected while moving an illumination source so that a light emitting surface emitting light in a slit shape is reflected on the object to be inspected. And a method of generating a defect inspection image from a plurality of captured images. In such an appearance inspection system, for example, the robot arm can hold the camera and the illumination source, and the camera can be arranged according to the shape of the object to be inspected and the illumination source can be scanned.

特開2017−207420号公報JP 2017-207420 A 特開2016−118996号公報JP-A-2006-118996 特許第5031043号Patent No. 5031043 特許第5182833号Patent No. 5182833 特許第6316068号Patent No.6316068 特開2018−59883号公報JP 2018-59883 A

O.Lobachev, M. Schmidt and M. Guthe, “Optimizing Multiple Camera Positions forthe Deflectometric Measurement of Multiple Varying Targets”, Journal of WSCG,Vol. 21, 145-152 (2013)O. Lobachev, M. Schmidt and M. Guthe, “Optimizing Multiple Camera Positions for the Deflectometric Measurement of Multiple Varying Targets”, Journal of WSCG, Vol. 21, 145-152 (2013) Yi.Maet.al. “An Invitation to 3-D Vision From Image to Geometric Models”, Springer(2004)Yi.Maet.al. “An Invitation to 3-D Vision From Image to Geometric Models”, Springer (2004) 石井健一郎,上田修功著 「続・わかりやすいパターン認識」 オーム社,pp.191-201 (2014)Kenichiro Ishii, Osamu Ueda "Continued and Easy Pattern Recognition" Ohmsha, pp.191-201 (2014) 藤代一成 編著 「コンピュータグラフィクス, 4-2-6. レイトレーシング法」 CG-ARTS協会 (2011)Compiled by Kazunari Fujishiro "Computer Graphics, 4-2-6. Ray Tracing Method" CG-ARTS Association (2011)

上述したロボットアームによる経路走査では、まず、ロボットアームに対して、被検査体の形状に応じたカメラの配置と照明源の走査経路を教示することが必要である。この点、カメラの配置と照明源の走査経路の教示を手動で行う場合、膨大な教示工数が必要とされる。この教示工数を縮小するために、従来から、被検査体の形状データからカメラの配置と照明源の走査経路を事前に生成し、生成されたカメラの配置と照明源の走査経路に基づいてロボットアームに連携させて教示する、という自働教示技術が求められていた。   In the above-described path scanning by the robot arm, first, it is necessary to teach the robot arm the arrangement of the camera according to the shape of the object to be inspected and the scanning path of the illumination source. In this regard, when manually teaching the arrangement of the camera and the scanning path of the illumination source, an enormous number of teaching steps are required. Conventionally, in order to reduce the number of teaching steps, a camera arrangement and a scanning path of an illumination source are generated in advance from shape data of an inspection object, and a robot is generated based on the generated camera arrangement and a scanning path of an illumination source. There has been a demand for an automatic teaching technique of teaching in cooperation with an arm.

しかし、特許文献1〜3に記載の技術では、鏡面を有する検査対象(検査対象の鏡面性)について、カメラの配置と照明源の走査経路を生成することについては何ら考慮されていない。また、特許文献4〜6には、カメラと照明源の配置を自動的に決定する技術は開示されていない。   However, the techniques described in Patent Documents 1 to 3 do not consider the arrangement of cameras and the generation of a scan path of an illumination source for an inspection target having a mirror surface (specularity of the inspection target). Further, Patent Documents 4 to 6 do not disclose a technique for automatically determining the arrangement of a camera and an illumination source.

本発明は、上述した課題の少なくとも一部を解決するためになされたものであり、撮像装置及び照明源を把持したロボットアームに対する撮像装置及び照明源の配置の教示工数を低減させることを目的とする。   The present invention has been made to solve at least a part of the problems described above, and an object of the present invention is to reduce the number of teaching steps for arranging an imaging device and an illumination source with respect to a robot arm holding an imaging device and an illumination source. I do.

本発明は、上述の課題の少なくとも一部を解決するためになされたものであり、以下の形態として実現することが可能である。
(1)本発明の一形態によれば、光学配置生成装置が提供される。この光学配置生成装置は、鏡面を有する被検査体の形状を形成する点群の位置座標と、前記点群に対する法線ベクトルと、を含む形状データを取得する取得部と、前記形状データを用いて、前記被検査体を撮像するための撮像点と、前記被検査体の前記鏡面で正反射した反射光の光路上に前記撮像点が存在するような照明点との、前記被検査体に対するそれぞれの配置パターンを示す光学配置データを生成し、出力する生成部と、を備える。
SUMMARY An advantage of some aspects of the invention is to solve at least a part of the problems described above, and the invention can be implemented as the following embodiments.
(1) According to one aspect of the present invention, there is provided an optical arrangement generating apparatus. The optical arrangement generation apparatus uses an acquisition unit that acquires shape data including position coordinates of a point group forming a shape of the inspected object having a mirror surface, and a normal vector to the point group, and using the shape data. An imaging point for imaging the object to be inspected, and an illumination point such that the imaging point exists on an optical path of light reflected specularly by the mirror surface of the object to be inspected. A generation unit that generates and outputs optical arrangement data indicating each arrangement pattern.

この構成によれば、鏡面を有する検査対象の形状に応じたカメラの配置と照明源の配置パターンを容易に生成することができる。これにより、撮像装置及び照明源を把持したロボットアームに対する撮像装置及び照明源の配置の教示工数を低減させることができる。   According to this configuration, it is possible to easily generate the arrangement pattern of the cameras and the arrangement pattern of the illumination sources according to the shape of the inspection target having the mirror surface. Thus, the number of teaching steps for arranging the imaging device and the illumination source with respect to the robot arm holding the imaging device and the illumination source can be reduced.

(2)上記形態の光学配置生成装置において、前記生成部は、前記形状データを用いて、前記被検査体に対して、前記撮像点に配置される撮像装置の視野幅に応じて複数の撮像エリアを設定し、前記撮像エリアのそれぞれに対して前記複数の撮像点のそれぞれを配置し、前記被検査体の全表面の範囲に対する前記複数の撮像点により撮像可能な前記被検査体上の撮像範囲の比率を用いて、前記複数の撮像点それぞれの配置を調整し、調整された前記複数の撮像点それぞれの配置位置から前記照明点の配置位置を決定してもよい。この構成によれば、複数の撮像エリアを設定し、各撮像エリアに撮像点を初期配置し、撮像範囲の比率を用いて撮像点の配置を調整し、撮像点の配置位置から前記照明点の配置位置を決定することにより、鏡面を有する検査対象の形状に応じたカメラの配置と照明源の配置パターンを容易に生成することができる。これにより、撮像装置及び照明源を把持したロボットアームに対する撮像装置及び照明源の配置の教示工数を低減させることができる。 (2) In the optical arrangement generation device according to the above aspect, the generation unit uses the shape data to image a plurality of images of the object to be inspected in accordance with a field width of an imaging device arranged at the imaging point. Setting an area, arranging each of the plurality of imaging points with respect to each of the imaging areas, and imaging the object to be inspected by the plurality of imaging points with respect to a range of the entire surface of the object to be inspected. The arrangement of each of the plurality of imaging points may be adjusted using the ratio of the range, and the arrangement position of the illumination point may be determined from the adjusted arrangement positions of the plurality of imaging points. According to this configuration, a plurality of imaging areas are set, the imaging points are initially arranged in each imaging area, the arrangement of the imaging points is adjusted using the ratio of the imaging range, and the arrangement of the illumination points is determined from the arrangement position of the imaging points. By determining the arrangement position, it is possible to easily generate an arrangement pattern of the cameras and an arrangement pattern of the illumination sources according to the shape of the inspection object having the mirror surface. Thus, the number of teaching steps for arranging the imaging device and the illumination source with respect to the robot arm holding the imaging device and the illumination source can be reduced.

(3)上記形態の光学配置生成装置において、前記生成部は、前記撮像エリアの設定において、前記形状データを用いて前記被検査体の骨格を表す代表線を生成し、前記代表線に対して前記視野幅に応じて複数の点をプロットし、前記代表線に対して前記被検査体の形状の変化の度合いに応じて設定した重みを用いて前記複数の点の位置を調整し、調整した前記複数の点のそれぞれを中心とした前記撮像エリアを設定してもよい。この構成によれば、代表点に対して被検査体の形状の変化の度合いに応じた重みを設定し、その重みを用いて複数の撮像エリアを設定することができる。これにより、例えば曲率が高い部分は2方向から光を写り込ませないと適切な画像を撮像できないから、それを抑制するためにプロト点の配置を調整することができる。 (3) In the optical arrangement generation device according to the aspect, the generation unit generates a representative line representing a skeleton of the object to be inspected using the shape data in setting the imaging area. Plotting a plurality of points according to the visual field width, adjusting the positions of the plurality of points using a weight set according to the degree of change in the shape of the test object with respect to the representative line, was adjusted The imaging area may be set around each of the plurality of points. According to this configuration, it is possible to set a weight for the representative point according to the degree of change in the shape of the object to be inspected, and to set a plurality of imaging areas using the weight. Accordingly, for example, a portion having a high curvature cannot capture an appropriate image unless light is reflected from two directions. Therefore, the arrangement of the proto points can be adjusted to suppress the image.

(4)上記形態の光学配置生成装置において、前記生成部は、前記撮像点の配置において、前記形状データに含まれる前記点群の位置座標と前記法線ベクトルに対する主成分分析により、前記撮像エリアのそれぞれにおける前記形状データの幾何学的特徴を算出し、前記幾何学的特徴を用いて、前記撮像エリアのそれぞれにおける複数の撮像点の配置位置候補から、1つの撮像点の配置位置を決定してもよい。この構成によれば、形状データの幾何学的特徴を用いて、複数の撮像点の配置位置の候補から1つの撮像点の配置位置を決定することができる。これにより、照明源の走査範囲を低減させると共に、被検査体の表面に写り込む範囲を低減させることができる。 (4) In the optical arrangement generation device according to the above aspect, in the arrangement of the imaging points, the imaging area is obtained by performing principal component analysis on the position coordinates of the point group and the normal vector included in the shape data. Calculating the geometric feature of the shape data in each of the above, and using the geometric feature, determines the arrangement position of one imaging point from the arrangement position candidates of the plurality of imaging points in each of the imaging areas. You may. According to this configuration, the arrangement position of one imaging point can be determined from the arrangement position candidates of a plurality of imaging points using the geometric feature of the shape data. Thereby, the scanning range of the illumination source can be reduced, and the range reflected on the surface of the inspection object can be reduced.

(5)上記形態の光学配置生成装置において、前記生成部は、前記撮像点の配置の調整において、前記被検査体の全表面の範囲に対する前記複数の撮像点により撮像可能な前記被検査体上の撮像範囲の比率が最大または所定値以上になるまで、前記撮像エリアの設定と前記撮像点の配置とを繰り返してもよい。この構成によれば、被検査体上の撮像範囲の比率を向上させることができる。これにより、非撮像範囲を低減させることができる。 (5) In the optical arrangement generation device according to the aspect, the generation unit may adjust the arrangement of the imaging points on the object to be imaged by the plurality of imaging points with respect to a range of the entire surface of the object to be inspected. The setting of the imaging area and the arrangement of the imaging points may be repeated until the ratio of the imaging range becomes the maximum or a predetermined value or more. According to this configuration, it is possible to improve the ratio of the imaging range on the inspection object. Thereby, the non-imaging range can be reduced.

(6)上記形態の光学配置生成装置において、前記生成部は、前記撮像点の配置の調整において、前記撮像点に配置する撮像装置により撮像することができない前記被検査体上の範囲に応じて、前記代表線に対して前記重みを更新して、前記撮像エリアの設定と前記撮像点の配置とを繰り返してもよい。この構成によれば、被検査体上の撮像範囲の比率を向上させることができる。これにより、非撮像範囲を低減させることができる。 (6) In the optical arrangement generation device according to the above aspect, the adjustment unit adjusts the arrangement of the imaging points in accordance with a range on the inspection object that cannot be imaged by an imaging device arranged at the imaging points. The weight may be updated for the representative line, and the setting of the imaging area and the arrangement of the imaging points may be repeated. According to this configuration, it is possible to improve the ratio of the imaging range on the inspection object. Thereby, the non-imaging range can be reduced.

(7)上記形態の光学配置生成装置において、前記生成部は、前記撮像点の配置の調整において、前記撮像エリアの設定を行う場合、前記被検査体の表面形状に応じて前記複数の撮像エリアをグループ化し、グループ化した撮像エリア毎に前記代表線を生成し、前記代表線のそれぞれに対して異なる前記重みを設定してもよい。この構成によれば、例えば、被検査体の外側、内側に応じて前記代表線のそれぞれに対して異なる前記重みを設定することができる。これにより、非撮像範囲を低減させることができる。 (7) In the optical arrangement generation device according to the above aspect, when the imaging area is set in the adjustment of the arrangement of the imaging points, the plurality of imaging areas are set according to a surface shape of the inspection object. May be grouped, the representative line may be generated for each grouped imaging area, and the different weight may be set for each of the representative lines. According to this configuration, for example, different weights can be set for each of the representative lines depending on the outside and inside of the subject. Thereby, the non-imaging range can be reduced.

(8)上記形態の光学配置生成装置において、前記生成部は、前記照明点の配置位置の決定において、前記撮像点からの撮像方向を示す撮像線と前記被検査体との交点を示す反射点と前記撮像点との間の距離と、前記反射点と前記照明点との間の距離との和が一定になるように、前記照明点を配置してもよい。この構成によれば、カメラ原点と反射点との距離と、反射点と照明源の中心との距離の和を一定とすることができる。これにより、カメラ原点と反射点との距離と、反射点と照明源の中心との距離の和が一定となる条件を満たすように照明源の配置を設定することができる。 (8) In the optical arrangement generation device according to the aspect, the generation unit may determine the arrangement position of the illumination point by using a reflection point indicating an intersection between an imaging line indicating an imaging direction from the imaging point and the object. The illumination points may be arranged such that the sum of the distance between the reflection point and the illumination point and the distance between the reflection point and the illumination point is constant. According to this configuration, the sum of the distance between the camera origin and the reflection point and the distance between the reflection point and the center of the illumination source can be made constant. Thereby, the arrangement of the illumination source can be set so as to satisfy the condition that the sum of the distance between the camera origin and the reflection point and the distance between the reflection point and the center of the illumination source is constant.

(9)本発明の一形態によれば、光学配置生成プログラムが提供される。この光学配置生成プログラムでは、情報処理装置に、鏡面を有する被検査体の形状を形成する点群の位置座標と、前記点群に対する法線ベクトルと、を含む形状データを取得するステップと、前記形状データを用いて、前記被検査体を撮像するための撮像点と、前記被検査体の前記鏡面で正反射した反射光の光路上に前記撮像点が存在するような照明点との、前記被検査体に対するそれぞれの配置パターンを示す光学配置データを生成し、出力するステップと、を実行させる。 (9) According to one aspect of the invention, there is provided an optical arrangement generation program. In the optical arrangement generating program, the information processing apparatus acquires shape data including position coordinates of a point group forming a shape of the inspected object having a mirror surface and a normal vector to the point group, Using shape data, an imaging point for imaging the object to be inspected, and an illumination point such that the imaging point exists on the optical path of light reflected regularly by the mirror surface of the object to be inspected, Generating and outputting optical arrangement data indicating each arrangement pattern for the object to be inspected.

(10)本発明の一形態によれば、光学配置生成方法が提供される。この光学配置生成方法では、情報処理装置を用いて、鏡面を有する被検査体の形状を形成する点群の位置座標と、前記点群に対する法線ベクトルと、を含む形状データを取得する工程と、前記形状データを用いて、前記被検査体を撮像するための撮像点と、前記被検査体の前記鏡面で正反射した反射光の光路上に前記撮像点が存在するような照明点との、前記被検査体に対するそれぞれの配置パターンを示す光学配置データを生成し、出力する工程と、を実行する。 (10) According to one aspect of the invention, there is provided an optical arrangement generation method. In this optical arrangement generation method, a step of using an information processing apparatus to obtain shape data including position coordinates of a point group forming the shape of the inspected object having a mirror surface, and a normal vector to the point group, Using the shape data, an imaging point for imaging the object to be inspected, and an illumination point such that the imaging point exists on an optical path of light reflected regularly by the mirror surface of the object to be inspected. Generating and outputting optical arrangement data indicating each arrangement pattern for the object to be inspected.

(11)本発明の一形態によれば、表面検査システムが提供される。この表面検査システムは、鏡面を有する被検査体の形状を形成する点群の位置座標と前記点群に対する法線ベクトルとを含む形状データを取得し、前記形状データを用いて、前記被検査体を撮像するための撮像点と、前記被検査体の前記鏡面で正反射した反射光の光路上に前記撮像点が存在するような照明点との、前記被検査体に対するそれぞれの配置パターンを示す光学配置データを生成する光学配置生成部と、前記被検査体を写り込ませる照明源と、前記被検査体を撮像する撮像部と、前記照明源及び前記撮像部それぞれを3次元方向に移動可能に駆動する駆動部と、前記光学配置データを用いて、前記駆動部の駆動を制御する駆動制御部と、を備える。 (11) According to one aspect of the present invention, a surface inspection system is provided. The surface inspection system obtains shape data including position coordinates of a point group forming a shape of an object having a mirror surface and a normal vector to the point group, and uses the shape data to obtain the object data. FIG. 4 shows respective arrangement patterns of the imaging point for imaging the object and the illumination point such that the imaging point exists on the optical path of the reflected light specularly reflected by the mirror surface of the object to be inspected, with respect to the object to be inspected. An optical arrangement generation unit for generating optical arrangement data, an illumination source for reflecting the object to be inspected, an imaging unit for imaging the object to be inspected, and each of the illumination source and the imaging unit movable in a three-dimensional direction And a drive control unit that controls the drive of the drive unit using the optical arrangement data.

なお、本発明は、種々の態様で実現することが可能であり、例えば、光学配置生成装置及び光学配置生成方法、光学配置生成装置を含むシステム、これら装置、方法、システムにおいて実行されるコンピュータプログラム、そのコンピュータプログラムを配布するためのサーバ装置、そのコンピュータプログラムを記憶した一時的でない記憶媒体等の形態で実現することができる。   Note that the present invention can be realized in various aspects. For example, an optical arrangement generating apparatus, an optical arrangement generating method, a system including the optical arrangement generating apparatus, a computer program executed in the apparatus, the method, and the system And a server device for distributing the computer program, a non-transitory storage medium storing the computer program, and the like.

本発明の実施形態における外観検査システムの概要を説明する図である。It is a figure explaining the outline of the visual inspection system in the embodiment of the present invention. 本実施形態における外観検査システムの概略構成を示す図である。It is a figure showing the schematic structure of the visual inspection system in this embodiment. 本実施形態における光学配置生成装置によるカメラと照明源の配置パターンの生成の処理の全体の流れを示すフローチャートである。5 is a flowchart illustrating an overall flow of processing of generating an arrangement pattern of a camera and an illumination source by the optical arrangement generation device according to the present embodiment. 本実施形態における鏡面を有する被検査体の形状データの一例を示す図である。FIG. 4 is a diagram illustrating an example of shape data of a test object having a mirror surface according to the present embodiment. 被検査体の形状データに対する撮像エリアの生成処理(ステップS2)を示すフローチャートである。It is a flowchart which shows the production | generation process (step S2) of the imaging area with respect to the shape data of a test object. 被検査体の形状データから算出した代表線の一例を示す図である。FIG. 6 is a diagram illustrating an example of a representative line calculated from shape data of a test object. 図6の代表線上に配置した初期プロト点の一例を示す図である。FIG. 7 is a diagram illustrating an example of initial protopoints arranged on the representative line in FIG. 6. 図6の代表線上に付与した重みと初期プロト点の一例を示す図である。FIG. 7 is a diagram illustrating an example of weights and initial proto points assigned to the representative line in FIG. 6. 代表線の初期プロト点に対して重み付きK−means法を実行した結果を示す図である。It is a figure showing the result of having performed weighted K-means method to the initial proto point of a representative line. 重み付きK−means法実行後の代表線に配置したプロト点の一例を示す図である。FIG. 10 is a diagram illustrating an example of proto points arranged on a representative line after execution of a weighted K-means method. 図10の代表線に配置したプロト点を中心とする撮像エリアの一例を示す図である。FIG. 11 is a diagram illustrating an example of an imaging area centered on a proto point arranged on the representative line in FIG. 10. 屋根型の被検査体の断面の一例と、撮像エリアの分割の一例を示す図である。It is a figure showing an example of a section of a roof type test object, and an example of division of an imaging area. 被検査体の形状データに対して設定される撮像エリアの例を示す図である。FIG. 4 is a diagram illustrating an example of an imaging area set for shape data of a test object. 形状データの基準とする点pに対する、カメラの傾き角θとカメラまでの距離Dを説明する図である。FIG. 7 is a diagram illustrating a camera inclination angle θ and a distance D to a camera with respect to a point p serving as a reference of shape data. 点pに対するカメラの配置方法の一例を示す図である。FIG. 9 is a diagram illustrating an example of a method of arranging cameras at a point p. カメラ配置の設定処理(ステップS3)を示すフローチャートである。It is a flowchart which shows the setting process (step S3) of a camera arrangement. 各撮像エリアにおける被検査体の形状データの幾何学的特徴の一例を説明する図である。FIG. 3 is a diagram illustrating an example of a geometric feature of shape data of a test object in each imaging area. 図17の幾何学的特徴に基づくカメラの配置方法を説明する図である。FIG. 18 is a diagram illustrating a camera arrangement method based on the geometric features in FIG. 17. カメラ配置の設定処理(ステップS3)に基づいて被検査体の形状データに対して生成したカメラの配置例を示す図である。FIG. 9 is a diagram showing an example of camera arrangement generated for shape data of an inspection object based on a camera arrangement setting process (step S3). カメラ配置の設定処理(ステップS3)に基づいて各撮像エリアに配置された各カメラにより撮像される画像例を示す図である。It is a figure showing an example of an image picturized by each camera arranged in each imaging area based on camera arrangement setting processing (Step S3). 撮像エリアに対する重みの加算分を示す図である。FIG. 6 is a diagram illustrating an addition of a weight to an imaging area. 本実施形態における重み更新回数と撮像範囲網羅率の関係を示す図である。FIG. 6 is a diagram illustrating a relationship between the number of weight updates and an imaging range coverage in the present embodiment. 照明源の配置の設定処理(ステップS6)のフローチャートである。It is a flowchart of the setting process (step S6) of arrangement | positioning of an illumination source. 本実施形態における照明源の配置方法について説明する図である。It is a figure explaining the arrangement method of the illumination source in this embodiment. 本実施形態における照明源の方向を決める際の演算方法について説明する図である。FIG. 7 is a diagram illustrating a calculation method when determining the direction of an illumination source according to the embodiment. 図3のステップS7で出力される光学配置データに基づいて作成された被検査体に対するカメラと照明源の配置パターンを示す図である。FIG. 4 is a diagram illustrating an arrangement pattern of a camera and an illumination source with respect to an inspection object created based on optical arrangement data output in step S7 of FIG. 3. 本実施形態の一実施例における全体の実行処理例を示すフローチャートである。5 is a flowchart illustrating an example of an entire execution process according to an example of the embodiment.

図1は、本発明の実施形態における外観検査システムの概要を説明する図である。外観検査システム1は、鏡面を有する被検査体5を検査対象とし、被検査体5の外観を検査するシステムである。図1に示す外観検査システム1では、被検査体5に写り込んだ照明源3の発光面3aをカメラ2で撮像する。カメラ2と照明源3とは、ロボットアームに把持され(又は設けられ)、それぞれx方向、y方向、z方向の3次元方向に移動可能なように構成されている。ここで、z方向は鉛直方向を表し、x方向及びy方向はz方向に対して垂直な方向であってかつx方向とy方向が垂直の関係になる方向を表す。また、各照明源3の前面には、発光面3aとして所定パターンの開口を有するスリットが設けられていてもよい。   FIG. 1 is a diagram illustrating an outline of a visual inspection system according to an embodiment of the present invention. The appearance inspection system 1 is a system for inspecting the appearance of the inspection object 5 with the inspection object 5 having a mirror surface as an inspection target. In the appearance inspection system 1 illustrated in FIG. 1, the camera 2 captures an image of the light emitting surface 3 a of the illumination source 3 reflected on the inspection object 5. The camera 2 and the illumination source 3 are gripped (or provided) by a robot arm, and are configured to be movable in three-dimensional directions of an x-direction, a y-direction, and a z-direction, respectively. Here, the z direction represents a vertical direction, and the x direction and the y direction are directions perpendicular to the z direction, and represent directions in which the x direction and the y direction are in a perpendicular relationship. In addition, a slit having a predetermined pattern of openings may be provided as a light emitting surface 3a on the front surface of each illumination source 3.

カメラ2により撮像される画像平面2bは、カメラ2のイメージセンサに対応し、画像を形成するピクセル2cから構成される。撮像線6は、カメラ原点oとピクセル2cを通る直線であり、ピクセルの数だけ存在する。この撮像線6はピクセル2cで受光する光の経路を表している。カメラ2で撮像される画像を構成するピクセル2cの輝度は、撮像線6に沿ってカメラ原点oに向かって伝播する光の強度に比例する。ここで、符号7は、光の伝播方向を示す。   The image plane 2b captured by the camera 2 corresponds to the image sensor of the camera 2, and is composed of pixels 2c that form an image. The imaging line 6 is a straight line passing through the camera origin o and the pixel 2c, and exists as many as the number of pixels. The imaging line 6 represents a path of light received by the pixel 2c. The luminance of the pixels 2 c constituting the image captured by the camera 2 is proportional to the intensity of light propagating along the imaging line 6 toward the camera origin o. Here, reference numeral 7 indicates a light propagation direction.

被検査体5は、その表面が鏡面を有する立体形状の物体である。被検査体5は、例えばL字形状やS字形状等の様々な形状に屈曲または湾曲した形状を有していてもよく、このため表面が凹凸状に湾曲して、さらに、表面がめっき処理されて鏡面である部品であってもよい。   The test object 5 is a three-dimensional object whose surface has a mirror surface. The test object 5 may have a shape that is bent or curved into various shapes such as an L-shape or an S-shape, for example. The component may be a mirror surface.

鏡面を有する被検査体5をカメラ2で撮像する場合、画像平面2bに到達する光の強度分布は、被検査体5で反射した撮像線6と交差する発光面3aの光強度の分布で決まる。つまり、その反射した撮像線6と発光面3aの交差における光強度が高い場合、撮像線6に対応するピクセル2cの輝度が高くなる。反対に、撮像線6と発光面3aの交差における光強度がゼロに近い場合、対応するピクセル2cの輝度は、被検査体5が存在しない場合と同程度の輝度となる。   When the object 2 having a mirror surface is imaged by the camera 2, the intensity distribution of the light reaching the image plane 2 b is determined by the light intensity distribution of the light emitting surface 3 a intersecting the imaging line 6 reflected by the object 5. . That is, when the light intensity at the intersection of the reflected imaging line 6 and the light emitting surface 3a is high, the luminance of the pixel 2c corresponding to the imaging line 6 increases. Conversely, when the light intensity at the intersection of the imaging line 6 and the light emitting surface 3a is close to zero, the brightness of the corresponding pixel 2c is substantially the same as the case where the test object 5 does not exist.

図2は、本実施形態における外観検査システム1の概略構成を示す図である。外観検査システム(表面検査システム)1は、表面が鏡面である立体形状の被検査体5の外観表面を検査する表面検査装置である。表面検査システム1は、カメラ2、照明源3、ロボットアーム4、アーム駆動部10、駆動制御部11、演算部12、検査部13、光学配置生成装置14を含む。照明源3は、被検査体5に光を写り込ませるものであり、例えば照明装置である。カメラ2は、照明源3からの光が写り込んだ被検査体5の鏡面を撮像する撮像装置である。ロボットアーム4には、カメラ2及び照明源3が把持され(又は設けられ)ている。アーム駆動部10は、駆動制御部11からの指示に基づいてロボットアーム4を、x方向、y方向、z方向の3次元方向に移動させる。なお、ロボットアームは、1つでもよいし、または複数でもよい。また、カメラ2及び照明源3は、1つのロボットアームに設けられていてもよいし、異なるロボットアームにそれぞれ設けられていてもよい。   FIG. 2 is a diagram illustrating a schematic configuration of the visual inspection system 1 according to the present embodiment. The appearance inspection system (surface inspection system) 1 is a surface inspection device that inspects the external surface of a three-dimensional object 5 whose surface is a mirror surface. The surface inspection system 1 includes a camera 2, an illumination source 3, a robot arm 4, an arm drive unit 10, a drive control unit 11, a calculation unit 12, an inspection unit 13, and an optical arrangement generation device 14. The illumination source 3 reflects light onto the inspection object 5 and is, for example, an illumination device. The camera 2 is an imaging device that captures an image of a mirror surface of the inspection object 5 on which light from the illumination source 3 is reflected. The camera 2 and the illumination source 3 are gripped (or provided) by the robot arm 4. The arm drive unit 10 moves the robot arm 4 in a three-dimensional direction of the x, y, and z directions based on an instruction from the drive control unit 11. The number of robot arms may be one or more. The camera 2 and the illumination source 3 may be provided on one robot arm, or may be provided on different robot arms.

光学配置生成装置14は、検査用画像取得のためのカメラ2及び照明源3の配置パターンの生成において、鏡面を有する被検査体を対象としたカメラ2及び照明源3の配置パターンに関する光学配置データを生成する。光学配置生成装置14は、例えばコンピュータ等の情報処理装置であって、制御部15、記憶部16、通信部17、入力部18、出力部19、バス20を含む。バス20は、制御部15、記憶部16、通信インターフェース(以下、インターフェースを「I/F」と称する。)17、入力I/F18、出力I/F19を電気的に接続する信号線である。   The optical arrangement generation device 14 generates the arrangement pattern of the camera 2 and the illumination source 3 for acquiring the inspection image by using the optical arrangement data regarding the arrangement pattern of the camera 2 and the illumination source 3 for the inspection object having a mirror surface. Generate The optical layout generation device 14 is, for example, an information processing device such as a computer, and includes a control unit 15, a storage unit 16, a communication unit 17, an input unit 18, an output unit 19, and a bus 20. The bus 20 is a signal line that electrically connects the control unit 15, the storage unit 16, a communication interface (hereinafter, the interface is referred to as "I / F") 17, an input I / F 18, and an output I / F 19.

制御部15は、光学配置生成装置全体の動作を制御する電子装置であり、例えば中央演算装置(CPU)であってもよい。制御部15は、後述する光学配置プログラムを実行することにより、取得部15a、生成部15bとして機能する。取得部15aは、鏡面を有する被検査体の形状を形成する点群の位置座標と、点群(形状の表面)に対する法線ベクトルと、を含む形状データを取得する。より具体的には、取得部15aは、通信I/F17、入力I/F18を介して入力された、または予め記憶部16に記憶された形状データを取得する。生成部15bは、形状データを用いて、被検査体を撮像するための撮像点と、被検査体の鏡面で反射した反射光の光路上に撮像点が存在するような照明点との、被検査体に対するそれぞれの配置パターンを示す光学配置データを生成し、出力する。光学配置データの出力先は、記憶部16であってもよいし、通信I/F17を介して駆動制御部11や他の装置であってもよいし、ユニバーサルシリアルバス(USB)メモリ装置等の記録媒体等であってもよいし、プリンタやディスプレイ等の出力装置であってもよい。   The control unit 15 is an electronic device that controls the operation of the entire optical configuration generation device, and may be, for example, a central processing unit (CPU). The control unit 15 functions as an acquisition unit 15a and a generation unit 15b by executing an optical arrangement program described below. The acquisition unit 15a acquires shape data including position coordinates of a point group forming the shape of the inspected object having a mirror surface and a normal vector to the point group (the surface of the shape). More specifically, the acquisition unit 15a acquires shape data input via the communication I / F 17 and the input I / F 18 or stored in the storage unit 16 in advance. The generation unit 15b uses the shape data to generate an image of the object to be inspected and an illumination point where the image point exists on the optical path of the light reflected by the mirror surface of the object to be inspected. Optical arrangement data indicating each arrangement pattern with respect to the inspection object is generated and output. The output destination of the optical arrangement data may be the storage unit 16, the drive control unit 11 or another device via the communication I / F 17, or a universal serial bus (USB) memory device or the like. It may be a recording medium or the like, or may be an output device such as a printer or a display.

記憶部16は、情報を記憶するメモリ装置の総称であり、リードオンリーメモリ(ROM)、ランダムアクセスメモリ(RAM)、ソリッドステートドライブ(SSD)、ハードディスク、フラッシュメモリカードなど様々な形式の記憶装置を使用することができる。記憶部16には、オペレーティングシステム(OS)や本実施形態に係るプログラムが格納されている。   The storage unit 16 is a general term for a memory device that stores information, and includes various types of storage devices such as a read only memory (ROM), a random access memory (RAM), a solid state drive (SSD), a hard disk, and a flash memory card. Can be used. The storage unit 16 stores an operating system (OS) and a program according to the present embodiment.

通信I/F17は、無線または有線により駆動制御部11やその他の装置と通信を可能にする通信インターフェースである。入力I/F18は、キーボード等の入力装置(不図示)や、USBメモリ装置やフラッシュメモリ等の記録装置等から入力された指令やデータを、制御部15や記憶部16へ伝達するインターフェースである。出力I/F19は、表示装置やプリンタ等の出力装置(不図示)や、USBメモリ装置及びフラッシュメモリ等の記録装置等に文字や画像等を出力するインターフェースである。   The communication I / F 17 is a communication interface that enables wireless or wired communication with the drive control unit 11 and other devices. The input I / F 18 is an interface for transmitting commands and data input from an input device (not shown) such as a keyboard or a recording device such as a USB memory device or a flash memory to the control unit 15 or the storage unit 16. . The output I / F 19 is an interface that outputs characters and images to an output device (not shown) such as a display device or a printer, or a recording device such as a USB memory device or a flash memory.

本実施形態で説明する処理を実現するプログラムは、プログラム提供者側から通信ネットワーク及び通信I/F17を介して、例えば記憶部16に格納されてもよい。また、上記実施形態で説明した処理を実現するプログラムは、市販され、流通している可搬型記憶媒体に格納されていてもよい。この場合、この可搬型記憶媒体は外付け又は内蔵の読取装置にセットされて、制御部15によってそのプログラムが読み出されて、実行されてもよい。可搬型記憶媒体としてはCD−ROM、DVD−ROM、フレキシブルディスク、光ディスク、光磁気ディスク、ICカード、USBメモリ装置など様々な形式の記憶媒体を使用することができる。このような記憶媒体に格納されたプログラムが読取装置によって読み取られる。   A program that implements the processing described in the present embodiment may be stored in, for example, the storage unit 16 from the program provider via the communication network and the communication I / F 17. Further, a program for realizing the processing described in the above embodiment may be stored in a commercially available and distributed portable storage medium. In this case, the portable storage medium may be set in an external or internal reading device, and the program may be read and executed by the control unit 15. Various types of storage media such as a CD-ROM, a DVD-ROM, a flexible disk, an optical disk, a magneto-optical disk, an IC card, and a USB memory device can be used as the portable storage medium. The program stored in such a storage medium is read by the reading device.

駆動制御部11は、光学配置生成装置14によって生成された光学配置データを用いて、カメラ2、照明源、及びアーム駆動部10の動作を制御する。演算部12は、カメラ2により撮像された複数の画像をそれぞれ微分処理して、これら微分処理後の複数の画像を加算する。検査部13は、演算部12による加算後の画像に基づいて、被検査体5の鏡面表面のきずを検査する。なお、駆動制御部11、演算部12、検査部13及び光学配置生成装置14は、1つの情報処理装置に含まれていてもよいし、異なる情報処理装置に含まれていてもよい。   The drive control unit 11 controls the operations of the camera 2, the illumination source, and the arm drive unit 10 using the optical arrangement data generated by the optical arrangement generation device 14. The calculation unit 12 performs a differentiation process on each of the plurality of images captured by the camera 2 and adds the plurality of images after the differentiation process. The inspection unit 13 inspects the mirror surface of the inspection object 5 for flaws based on the image after the addition by the calculation unit 12. Note that the drive control unit 11, the calculation unit 12, the inspection unit 13, and the optical arrangement generation device 14 may be included in one information processing device or may be included in different information processing devices.

図3は、本実施形態における光学配置生成装置14によるカメラと照明源の配置パターンの生成の処理の全体の流れを示すフローチャートである。本実施形態の全体の流れとしては、鏡面を有する被検査体5の形状データに対して撮像エリアを生成する段階(ステップS2)、各撮像エリアに対してカメラ2を配置する段階(ステップS3〜S5)、撮像線6が反射する方向に応じて照明源3を配置する段階(ステップS6)に分けられる。また、カメラ2を配置する段階では、被検査体の表面の範囲に対する各カメラ2の撮像範囲に応じて撮像エリアを調整することにより、各カメラ2による撮像範囲が最大となるように、カメラ2の配置を調整することができる。以下では、図3を用いて、光学配置生成装置14の制御部15により実行される本実施形態の全体の処理について説明する。   FIG. 3 is a flowchart illustrating an entire flow of processing of generating an arrangement pattern of a camera and an illumination source by the optical arrangement generation device 14 according to the present embodiment. As an overall flow of the present embodiment, a step of generating an imaging area for the shape data of the inspection object 5 having a mirror surface (step S2), and a step of arranging the camera 2 for each imaging area (steps S3 to S3) S5), and arranging the illumination source 3 according to the direction in which the imaging line 6 reflects (step S6). In the stage of arranging the cameras 2, by adjusting the imaging area according to the imaging range of each camera 2 with respect to the range of the surface of the inspection object, the camera 2 is adjusted so that the imaging range of each camera 2 is maximized. Can be adjusted. Hereinafter, the overall processing of the present embodiment executed by the control unit 15 of the optical layout generation device 14 will be described with reference to FIG.

図3において、まず、制御部15は、鏡面を有する被検査体5の形状データを読み込む(ステップS1)。制御部15は、読み込んだ被検査体5の形状データから、被検査体5を撮像するための複数の撮像エリアを生成し(ステップS2)、カメラ2の配置(位置及び向き)を設定し(ステップS3)、カメラ2による撮像範囲を算出し(ステップS4)、カメラ2の配置(位置及び向き)の調整を行う(ステップS5)。その後、制御部15は、照明源3の配置(位置及び向き)を設定し(ステップS6)、カメラ2の配置と照明源3の配置に関する光学配置データを出力する(ステップS7)。以下では、ステップS1〜S7の各処理を順次説明する。   In FIG. 3, first, the control unit 15 reads the shape data of the inspection object 5 having a mirror surface (step S1). The control unit 15 generates a plurality of imaging areas for imaging the subject 5 from the read shape data of the subject 5 (Step S2), and sets the arrangement (position and orientation) of the camera 2 (Step S2). Step S3), the imaging range of the camera 2 is calculated (Step S4), and the arrangement (position and orientation) of the camera 2 is adjusted (Step S5). Thereafter, the control unit 15 sets the arrangement (position and orientation) of the illumination source 3 (step S6), and outputs optical arrangement data relating to the arrangement of the camera 2 and the arrangement of the illumination source 3 (step S7). Hereinafter, each processing of steps S1 to S7 will be sequentially described.

図4は、本実施形態における鏡面を有する被検査体の形状データの一例を示す図である。被検査体5は、その表面が鏡面状になっている物体である。鏡面状は、例えばステンレスやめっき加工、研磨等により光が反射して物が写る鏡状になっていることを意味する。被検査体5の形状データは、立体的形状の表面を表す点群の座標値、表面に対する法線ベクトルn、及び各点の繋がりを表すメッシュデータを含む。本実施形態では、一例として、図4に表す形状データを用いる。なお、このような被検査体5の形状データが、図3のステップS1の処理にて、制御部15に読み込まれる。   FIG. 4 is a diagram illustrating an example of shape data of a test object having a mirror surface according to the present embodiment. The test object 5 is an object having a mirror-like surface. The mirror-like shape means a mirror-like shape in which an object is reflected and reflected by, for example, stainless steel, plating, polishing or the like. The shape data of the inspection object 5 includes coordinate values of a group of points representing the surface of the three-dimensional shape, a normal vector n to the surface, and mesh data representing a connection between the points. In the present embodiment, the shape data shown in FIG. 4 is used as an example. Note that the shape data of the inspection object 5 is read into the control unit 15 in the process of step S1 in FIG.

ステップS2の処理の詳細なフローについて説明する。   The detailed flow of the process in step S2 will be described.

図5は、被検査体5の形状データに対する撮像エリアの生成処理(ステップS2)を示すフローチャートである。図6は、被検査体5の形状データから算出した代表線の一例を示す図である。図7は、図6の代表線上に配置した初期プロト点の一例を示す図である。図8は、図6の代表線上に付与した重みと初期プロト点の一例を示す図である。図9は、代表線の初期プロト点に対して重み付きK−means法を実行した結果を示す図である。図10は、重み付きK−means法実行後の代表線に配置したプロト点の一例を示す図である。図11は、図10の代表線に配置したプロト点を中心とする撮像エリアの一例を示す図である。図12は、屋根型の被検査体の断面の一例と、撮像エリアの分割の一例を示す図である。図13は、被検査体の形状データに対して設定される撮像エリアの例を示す図である。以下、図6〜図13を参照しながら、図5について説明する。例えば、被検査体5の形状データに対する撮像エリアは、次の手順で生成される。   FIG. 5 is a flowchart showing a process (step S2) of generating an imaging area for the shape data of the inspection object 5. FIG. 6 is a diagram illustrating an example of a representative line calculated from the shape data of the test object 5. FIG. 7 is a diagram showing an example of the initial proto points arranged on the representative line in FIG. FIG. 8 is a diagram illustrating an example of weights and initial proto points assigned to the representative line in FIG. FIG. 9 is a diagram illustrating a result of executing the weighted K-means method on the initial proto point of the representative line. FIG. 10 is a diagram illustrating an example of the proto points arranged on the representative line after the execution of the weighted K-means method. FIG. 11 is a diagram showing an example of an imaging area centered on a proto point arranged on the representative line in FIG. FIG. 12 is a diagram illustrating an example of a cross section of a roof-type inspection object and an example of division of an imaging area. FIG. 13 is a diagram illustrating an example of an imaging area set for shape data of an inspection object. Hereinafter, FIG. 5 will be described with reference to FIGS. 6 to 13. For example, the imaging area for the shape data of the inspection object 5 is generated in the following procedure.

制御部15は、例えば、図4に表す被検査体5の形状データに対して、図6に示すように、被検査体5の背骨に相当するような、被検査体5の形状の代表線を生成する(ステップS11)。なお、今回の代表線の生成方法は、一例として被検査体5の形状データに対して、一辺が50mmのボックスを並べて生成し、被検査体5の形状データが含まれるボックスにおいて、形状データの点群の位置座標の平均を求めて代表点とし、ボックス毎に生成した代表点を接続することにより代表線とする。ボックスの大きさは任意に決定できる。なお、代表線は、この生成方法に限定されず、例えば、位置座標の分散や標準偏差を求めて代表点としてもよい。また、形状データにより示される被検査体の外形(輪郭)を求めて代表点とし、それらを繋げて代表点を接続することにより代表線としてもよい。   For example, as shown in FIG. 6, the control unit 15 generates a representative line of the shape of the inspected object 5 corresponding to the spine of the inspected object 5 illustrated in FIG. Is generated (step S11). The representative line generation method in this case is, for example, a method in which boxes each having a side of 50 mm are arranged side by side with respect to the shape data of the inspection object 5, and the box including the shape data of the inspection object 5 An average of the position coordinates of the point group is determined to be a representative point, and a representative line is formed by connecting the representative points generated for each box. The size of the box can be determined arbitrarily. Note that the representative line is not limited to this generation method. For example, a variance or a standard deviation of position coordinates may be obtained and used as a representative point. Alternatively, the outer shape (outline) of the object to be inspected indicated by the shape data may be determined as a representative point, and the representative point may be connected by connecting them to form a representative line.

次に、制御部15は、使用するカメラ2における、イメージセンサのピクセルサイズ、カメラレンズの焦点距離、検査用画像の撮像分解能から、カメラの視野の幅wを決定する(ステップS12)。なお、本実施形態では、一例として、カメラの視野の幅w=100mmとする。   Next, the control unit 15 determines the width w of the field of view of the camera 2 from the pixel size of the image sensor, the focal length of the camera lens, and the imaging resolution of the inspection image in the camera 2 to be used (step S12). In the present embodiment, as an example, the width w of the field of view of the camera is set to 100 mm.

次に、制御部15は、例えば、図7に示すように、代表線に対して、初期プロト点を視野の幅wごとに配置する(ステップS13)。初期プロト点を配置する幅wとは、初期プロト点とこれに隣接する初期プロト点との間の代表線の実際の距離を示す。なお、代表線を形成する線が点の集まりで構成されている場合、1つの点のサイズは予め判明しているから、隣接する初期プロト点間においてこの点の数の個数を計測することにより、隣接する初期プロト点間の幅の距離を計測して初期プロト点を配置してもよい。   Next, for example, as shown in FIG. 7, the control unit 15 arranges the initial proto points for each width w of the visual field with respect to the representative line (Step S13). The width w for arranging the initial proto point indicates the actual distance of the representative line between the initial proto point and the adjacent initial proto point. When the line forming the representative line is composed of a group of points, since the size of one point is known in advance, by measuring the number of points between adjacent initial proto points, Alternatively, the initial proto points may be arranged by measuring the distance between adjacent initial proto points.

次に、制御部15は、図8に示すように、代表線に対して、その曲率に応じた重みを設定する(ステップS14)。例えば、曲率が小さい場合は1.0に近づき、大きい場合には0.0に近づくような重みとできる。本実施形態では、一例として、代表線に対する主成分分析により得られる分散値を重みとして付与する。主成分分析とは、たくさんの量的な説明変数を、より少ない指標や合成変数(複数の変数が合体したもの)に要約する手法を示す。なお、本実施形態では、その曲率に応じた重みを設定するがこれに限定されず、様々な表面形状の変化の度合いに応じて重みを設定してもよい。   Next, as shown in FIG. 8, the control unit 15 sets a weight corresponding to the curvature of the representative line (step S14). For example, when the curvature is small, the weight approaches 1.0, and when the curvature is large, the weight approaches 0.0. In the present embodiment, as an example, a variance value obtained by performing principal component analysis on a representative line is assigned as a weight. Principal component analysis refers to a method of summarizing many quantitative explanatory variables into fewer indices and composite variables (combining multiple variables). In the present embodiment, the weight is set according to the curvature, but is not limited to this, and the weight may be set according to the degree of change of various surface shapes.

次に、制御部15は、代表線を分類対象集合としてクラスタリングを行って分割することにより、プロト点の位置を調整する(ステップS15)。制御部15は、例えば、図9に示すように、代表線に対する重み付きK−means法により、プロト点の位置を調整することができる(例えば、非特許文献3)。なお、本実施形態では、一例として重み付きK−means法を用いるが、これに限定されず、その他のクラスタリング方法を用いてもよい。   Next, the control unit 15 adjusts the position of the proto point by performing clustering and dividing the representative line as a classification target set (step S15). For example, as shown in FIG. 9, the control unit 15 can adjust the position of the proto point by the weighted K-means method for the representative line (for example, Non-Patent Document 3). In the present embodiment, the weighted K-means method is used as an example. However, the present invention is not limited to this, and another clustering method may be used.

次に、制御部15は、ステップS15の計算結果に基づいて、図10に示すように、代表線のプロト点を再配置する(ステップS16)。図5の撮像エリア5,15に着目して、図5と図10を比べてみると、曲率が高い部分に配置されていたプロト点がその曲率が高い部分の前後(左右)にずらされて配置されているが、このような曲率が高い部分は2方向から光を当てないと適切な画像を撮像できないから、プロト点の配置を調整している。   Next, the control unit 15 rearranges the proto points of the representative line based on the calculation result of step S15, as shown in FIG. 10 (step S16). Focusing on the imaging areas 5 and 15 in FIG. 5 and comparing FIG. 5 with FIG. 10, the proto points arranged in the high curvature portion are shifted to the front and rear (left and right) of the high curvature portion. Although the parts are arranged, such a part having a high curvature cannot capture an appropriate image unless light is irradiated from two directions. Therefore, the arrangement of the proto points is adjusted.

次に、制御部15は、図11に示すように、再配置されたプロト点を中心とした撮像エリアを生成する(ステップS17)。本実施形態では、上述の通り、撮像エリアは、一例として、一辺がw=100mmの矩形のエリアが生成される。   Next, as shown in FIG. 11, the control unit 15 generates an imaging area centering on the rearranged proto points (step S17). In the present embodiment, as described above, as the imaging area, a rectangular area having one side of w = 100 mm is generated as an example.

そして、制御部15は、各撮像エリア内の被検査体5の断面形状の曲率に応じて撮像エリアを分割(グループ化)する(ステップS18)。なお、ステップS17で生成した全ての撮像エリア内の被検査体5の断面形状が屋根型であったため、制御部15は、一例として、図12に示すように、屋根の稜線に沿って撮像エリアを撮像エリアA1と撮像エリアA2に2分割する。これを図11の形状データに対して行ったものが図13である。なお、本実施形態では、断面形状の曲率に応じて撮像エリアを分割するがこれに限定されず、様々な表面形状の変化の度合いに応じて撮像エリアを2つ以上に分割してもよい。例えば、被検査体5の断面形状がコの字形状の場合にはその稜線に沿って撮像エリアを3つの撮像エリアに分割してもよい。表面形状に応じて撮像エリアをグループ化すれば、後述の非撮像範囲を低減することができる。   Then, the control unit 15 divides (groups) the imaging areas according to the curvature of the cross-sectional shape of the test object 5 in each imaging area (step S18). In addition, since the cross-sectional shape of the test object 5 in all the imaging areas generated in step S17 is a roof shape, the control unit 15 may, as an example, as shown in FIG. Is divided into an imaging area A1 and an imaging area A2. FIG. 13 shows the result of performing this for the shape data of FIG. In the present embodiment, the imaging area is divided according to the curvature of the cross-sectional shape. However, the present invention is not limited to this. The imaging area may be divided into two or more according to the degree of change in various surface shapes. For example, when the cross-sectional shape of the test object 5 is a U-shape, the imaging area may be divided into three imaging areas along the ridgeline. If the imaging areas are grouped according to the surface shape, a non-imaging range described later can be reduced.

図13は、図5の手順で被検査体5の形状データに生成された撮像エリアの一例を示す図である。撮像エリア1〜19は、稜線に基づいて分割して得られた被検査体5の外側の撮像エリアである。撮像エリア20〜38は、稜線に基づいて分割して得られた被検査体5の内側の撮像エリアである。   FIG. 13 is a diagram illustrating an example of the imaging area generated in the shape data of the inspection object 5 in the procedure of FIG. The imaging areas 1 to 19 are imaging areas outside the object 5 obtained by dividing based on the ridge lines. The imaging areas 20 to 38 are imaging areas inside the object 5 obtained by dividing based on the ridge lines.

次に、図3のステップS3の処理について説明する。   Next, the process of step S3 in FIG. 3 will be described.

図14は、形状データの基準とする点pに対する、カメラの傾き角θとカメラまでの距離Dを説明する図である。図15は、点pに対するカメラの配置方法の一例を示す図である。図1で述べたように、被検査体5に写り込む発光面をカメラ2で撮像するためには、カメラ2と照明源3は、反射の法則を満足するように配置する必要がある。このため、カメラ2のz軸方向は被検査体5の法線ベクトルnに対して傾いている必要がある。そこで、図14に示すように、形状データの基準とする点pからカメラ原点oまでの距離D、点pにおける法線ベクトルnに対する傾き角θを初期設定として与えることとする。   FIG. 14 is a diagram illustrating a camera tilt angle θ and a distance D to the camera with respect to a point p serving as a reference of the shape data. FIG. 15 is a diagram illustrating an example of a method of arranging the camera with respect to the point p. As described with reference to FIG. 1, in order for the camera 2 to capture an image of the light-emitting surface reflected on the inspection object 5, the camera 2 and the illumination source 3 need to be arranged so as to satisfy the law of reflection. For this reason, the z-axis direction of the camera 2 needs to be inclined with respect to the normal vector n of the test object 5. Therefore, as shown in FIG. 14, the distance D from the point p, which is the reference of the shape data, to the camera origin o, and the inclination angle θ with respect to the normal vector n at the point p are given as initial settings.

しかしながら、距離Dと傾き角θを与えただけでは、図15に示すように、点pを頂点とする円錐21の底面の外周線22上に、カメラ2を任意に配置できることとなり、カメラ2の配置を一意に決定することができない。   However, only by giving the distance D and the inclination angle θ, the camera 2 can be arbitrarily arranged on the outer peripheral line 22 on the bottom surface of the cone 21 having the vertex at the point p, as shown in FIG. The placement cannot be determined uniquely.

そこで本実施形態では、ステップS2で生成した各撮像エリアにおける点群の座標値と法線ベクトルから幾何学的な特徴を算出し、それらの特徴に基づいて各撮像エリア内に1台のカメラ2を配置する方法を用いる。   Therefore, in the present embodiment, a geometric feature is calculated from the coordinate values of the point group and the normal vector in each imaging area generated in step S2, and one camera 2 is included in each imaging area based on those features. Is used.

図16は、カメラ配置の設定処理(ステップS3)を示すフローチャートである。図17は、各撮像エリアにおける被検査体の形状データの幾何学的特徴の一例を説明する図である。図18は、図17の幾何学的特徴に基づくカメラの配置方法を説明する図である。図17及び図18を参照しながら、ステップS2で生成された各撮像エリアに対して、カメラ2を配置する図16のアルゴリズムについて述べる。各撮像エリアに対するカメラ2の配置は次の手順で設定する。   FIG. 16 is a flowchart showing a camera arrangement setting process (step S3). FIG. 17 is a diagram illustrating an example of the geometric feature of the shape data of the inspection object in each imaging area. FIG. 18 is a diagram illustrating a camera arrangement method based on the geometric features in FIG. The algorithm of FIG. 16 for arranging the camera 2 in each imaging area generated in step S2 will be described with reference to FIGS. The arrangement of the camera 2 for each imaging area is set in the following procedure.

制御部15は、各撮像エリア内の被検査体5の形状データの幾何学的な特徴を算出する(ステップS21)。ここでは、制御部15は、各撮像エリアの形状データを構成する点群の座標値と法線ベクトルnに対する主成分分析により、図17に示す幾何学的な特徴を算出する。
avg:撮像エリア内の点群の位置座標の重心に最も近い点の位置座標(図17(a))
avg:撮像エリア内の点群の法線ベクトルの平均(図17(b))
max:撮像エリア内の点群の位置座標の分散が最大となる方向ベクトル(図17(c))
max:撮像エリア内の点群の法線ベクトルの分散が最大となる方向ベクトル(図17(d))
The control unit 15 calculates a geometric feature of the shape data of the inspection object 5 in each imaging area (Step S21). Here, the control unit 15 calculates the geometric features shown in FIG. 17 by the principal component analysis on the coordinate values of the point group constituting the shape data of each imaging area and the normal vector n.
p avg : the position coordinates of the point closest to the barycenter of the position coordinates of the point group in the imaging area (FIG. 17A)
navg : average of the normal vectors of the point group in the imaging area (FIG. 17B)
v max : a direction vector that maximizes the variance of the position coordinates of the point group in the imaging area (FIG. 17C)
n max : the direction vector in which the variance of the normal vector of the point group in the imaging area is maximized (FIG. 17D)

次に、制御部15は、pavgから距離Dだけ離れた位置にカメラ原点oを配置する(ステップS22)。このとき、図18(a)に示すように、カメラ2のz軸は方向ベクトル−navgと平行とし、x軸方向は方向ベクトルvmaxと方向ベクトルnmaxからなる平面31内に沿うものとする。 Next, the control unit 15 arranges the camera origin o at a position separated by a distance D from pavg (step S22). At this time, as shown in FIG. 18A, the z-axis of the camera 2 is parallel to the direction vector −n avg , and the x-axis direction is along a plane 31 including the direction vector v max and the direction vector n max. I do.

制御部15は、図18(b)に示すように、カメラ2を方向ベクトルnmaxを中心軸として、方向ベクトルnmaxと直交する平面内で、±θだけ傾け2台配置する(ステップS23)。 Control unit 15, as shown in FIG. 18 (b), the camera 2 around axis direction vector n max, in a plane perpendicular to the direction vector n max, arranged two inclined by ± theta (step S23) .

制御部15は、図18(c)に示すように、撮像エリア内の頂点の法線ベクトルと、2台のカメラ2それぞれのz軸を向く単位方向ベクトルとの内積の分散を算出し、分散の小さい内積の方に配置したカメラ配置Cを、最終的なカメラ配置(カメラの位置座標及び向き)とする(ステップS24)。ここで、分散の小さい内積の方に配置したカメラ配置を選択するのは、内積の分散が大きくなると、照明源3の走査範囲が広がるので好ましくないからであり、被検査体の表面に写り込む範囲が小さい方がより有効であるからである。   The control unit 15 calculates the variance of the inner product of the normal vector of the vertex in the imaging area and the unit direction vector of each of the two cameras 2 facing the z-axis, as shown in FIG. The camera arrangement C arranged on the inner product having a smaller size is defined as the final camera arrangement (the position coordinates and the direction of the camera) (step S24). Here, the reason why the camera arrangement arranged on the inner product having a smaller variance is selected is that if the variance of the inner product is large, the scanning range of the illumination source 3 is undesirably widened, and the image is reflected on the surface of the inspection object. This is because a smaller range is more effective.

図19は、カメラ配置の設定処理(ステップS3)に基づいて被検査体5の形状データに対して生成したカメラの配置例を示す図である。図19中の数字1〜38はそれぞれ、図13の撮像エリア1〜38に対応するカメラ配置位置1〜38である。   FIG. 19 is a diagram illustrating an example of camera arrangement generated for the shape data of the inspection object 5 based on the camera arrangement setting process (step S3). Numerals 1 to 38 in FIG. 19 are camera arrangement positions 1 to 38 corresponding to the imaging areas 1 to 38 in FIG. 13, respectively.

図20は、カメラ配置の設定処理(ステップS3)に基づいて各撮像エリアに配置された各カメラ2により撮像される画像例を示す図である。図20(a)は、カメラ配置の設定処理(ステップS3)に基づいて撮像エリア1に配置されたカメラ2により撮像された画像例である。図20(b)は、カメラ配置の設定処理(ステップS3)に基づいて撮像エリア1に配置されたカメラ2により撮像された画像例である。図20(a),(b)では、カメラ2の視野Vを破線で表す。   FIG. 20 is a diagram illustrating an example of an image captured by each camera 2 arranged in each imaging area based on the camera arrangement setting process (step S3). FIG. 20A is an example of an image captured by the camera 2 arranged in the imaging area 1 based on the camera arrangement setting process (step S3). FIG. 20B is an example of an image captured by the camera 2 arranged in the imaging area 1 based on the camera arrangement setting process (step S3). 20A and 20B, the visual field V of the camera 2 is represented by a broken line.

次に、ステップS4のカメラによる撮像範囲の算出処理について説明する。各カメラ2による被検査体5の撮像範囲は、例えばレイトレーシング法などを用いて、各カメラ2の撮像線6から算出することができる(例えば、非特許文献4)。具体的には、制御部15は、例えば、ピンホールカメラモデル2aにおける、カメラ原点oから各ピクセル2cを向く方向ベクトルを有する撮像線6と、被検査体5の形状データの交点を算出することにより、撮像範囲を算出する。   Next, the calculation process of the imaging range by the camera in step S4 will be described. The imaging range of the inspection object 5 by each camera 2 can be calculated from the imaging line 6 of each camera 2 using, for example, a ray tracing method (for example, Non-Patent Document 4). Specifically, the control unit 15 calculates, for example, the intersection of the imaging line 6 having a direction vector from the camera origin o to each pixel 2c in the pinhole camera model 2a and the shape data of the inspection object 5. To calculate the imaging range.

上記の計算を各カメラ2に対して実行することにより、各カメラ2により撮像できる被検査体5の範囲(以降、「撮像範囲」と称す)、および各カメラ2では撮像できない被検査体5の範囲(以降、「非撮像範囲」と称す)、また、被検査体5の検査範囲の全面積(すなわち、被検査体5全体の表面積)と、撮像範囲の面積との比率(以下、「撮像範囲網羅率」と称す)を算出することができる。なお、被検査体5の表面が点の集まりで構成されている場合、1つの点のサイズは予め判明しているから、この点の数の個数を計測してその計測した点の個数を面積と同等に扱ってもよい。   By executing the above calculation for each camera 2, the range of the subject 5 that can be imaged by each camera 2 (hereinafter referred to as “imaging range”) and the range of the subject 5 that cannot be imaged by each camera 2 The area (hereinafter referred to as a “non-imaging range”), and the ratio of the entire area of the inspection area of the inspection object 5 (that is, the surface area of the entire inspection object 5) to the area of the imaging area (hereinafter, “imaging area”) (Referred to as "range coverage ratio"). When the surface of the inspection object 5 is composed of a group of points, since the size of one point is known in advance, the number of the points is measured, and the number of the measured points is calculated as the area. May be treated the same as

次に、ステップS5のカメラ配置の調整処理について説明する。カメラ配置の設定処理(ステップS3)で生成した各カメラの配置による撮像範囲網羅率は、例えば86%程度となる。この撮像範囲網羅率を100%に近づけるためには、各カメラ2の配置を調整する必要がある。そこで、制御部15は、カメラによる撮像範囲の算出処理(ステップS4)で算出された被検査体5の非撮像範囲に基づいて、図5のステップS14の処理で算出した代表線の重みを更新し、ステップS2〜S4の計算を再度行う。被検査体5の非撮像範囲に基づいて重みを更新するとは、非撮像範囲に近い点や近いエリアに対してある定数を掛け、その定数の値を徐々に増やしていく。これによりカメラ2が非撮像範囲に寄っていくことができる。ここでの例では、重みの更新方法は、被検査体の外側に相当する撮像エリア1〜19、内側に相当する撮像エリア20〜38で、代表線を別々に想定して、それぞれ異なる重みを付与する。代表線の重みに付与する加算分の例を図21に示す。   Next, the camera arrangement adjustment processing in step S5 will be described. The coverage of the imaging range by the arrangement of the cameras generated in the camera arrangement setting process (step S3) is, for example, about 86%. In order to make the coverage of the imaging range close to 100%, it is necessary to adjust the arrangement of the cameras 2. Therefore, the control unit 15 updates the weight of the representative line calculated in the process of step S14 in FIG. 5 based on the non-imaging range of the subject 5 calculated in the calculation process of the imaging range by the camera (step S4). Then, the calculations in steps S2 to S4 are performed again. To update the weight based on the non-imaging range of the object 5 is to multiply a point or an area close to the non-imaging range by a certain constant and gradually increase the value of the constant. This allows the camera 2 to move closer to the non-imaging range. In this example, the method of updating the weights is such that the representative lines are separately assumed in the imaging areas 1 to 19 corresponding to the outside of the test object and the imaging areas 20 to 38 corresponding to the inside, and different weights are respectively used. Give. FIG. 21 shows an example of the addition given to the weight of the representative line.

図21は、撮像エリアに対する重みの加算分を示す図である。図21(a)は、撮像エリア1〜19に対する重みの加算分を示す。図21(b)は、撮像エリア20〜38に対する重みの加算分を示す。   FIG. 21 is a diagram illustrating the addition of the weight to the imaging area. FIG. 21A shows the addition of weights for the imaging areas 1 to 19. FIG. 21B shows the amount of weight added to the imaging areas 20 to 38.

制御部15は、上記の重みの更新と再計算を繰返し行い、カメラ2の配置を調整する。すると、重み更新回数と撮像範囲網羅率について、図22の関係が得られる。   The control unit 15 repeatedly updates and recalculates the weights described above to adjust the arrangement of the cameras 2. Then, the relationship of FIG. 22 is obtained for the weight update count and the imaging range coverage.

図22は、本実施形態における重み更新回数と撮像範囲網羅率の関係を示す図である。初回の撮像範囲網羅率は約86%であるが、非撮像範囲に基づいて、図5のステップS14の処理で算出した代表線の重みを更新し、ステップS2〜S4の計算を再度行うことで、撮像範囲網羅率が上昇し、最大で約96%まで上昇している。このように、重みの更新回数の増加に伴い、撮像範囲網羅率を上昇させることができる。このことから、制御部15は、撮像範囲網羅率が最大または所定値以上になるまで、非撮像範囲に基づいて図5のステップS14の処理で算出した代表線の重みを更新し、ステップS2〜S4の処理を繰り返す。   FIG. 22 is a diagram illustrating the relationship between the number of weight updates and the coverage of the imaging range according to the present embodiment. The initial coverage of the imaging range is about 86%, but based on the non-imaging range, the weight of the representative line calculated in the process of step S14 of FIG. 5 is updated, and the calculations of steps S2 to S4 are performed again. , The coverage of the imaging range is increased, and is increased up to about 96%. As described above, the coverage of the imaging range can be increased with an increase in the number of times the weight is updated. From this, the control unit 15 updates the weight of the representative line calculated in the process of step S14 of FIG. 5 based on the non-imaging range until the coverage of the imaging range becomes the maximum or a predetermined value or more, and The processing of S4 is repeated.

次に、図3のステップS6の処理について説明する。   Next, the process of step S6 in FIG. 3 will be described.

図23は、照明源の配置の設定処理(ステップS6)のフローチャートである。図24は、本実施形態における照明源の配置方法について説明する図である。図25は、本実施形態における照明源の方向を決める際の演算方法について説明する図である。図24及び図25を参照しながら、図23で示すように、カメラ配置の調整処理(ステップS5)で調整した被検査体5の形状に対するカメラ2の配置に基づいて、照明源3の配置を設定する方法を述べる。   FIG. 23 is a flowchart of the setting process of the arrangement of the illumination sources (step S6). FIG. 24 is a diagram illustrating a method of arranging the illumination sources according to the present embodiment. FIG. 25 is a diagram illustrating a calculation method when determining the direction of the illumination source according to the present embodiment. Referring to FIGS. 24 and 25, as shown in FIG. 23, the arrangement of the illumination source 3 is determined based on the arrangement of the camera 2 with respect to the shape of the inspection object 5 adjusted in the camera arrangement adjustment processing (step S5). Describe how to set.

制御部15は、カメラ2の原点oと画像平面の中心pを通る撮像線に沿った単位ベクトルiと、被検査体5の反射点pの位置座標、反射点pにおける法線ベクトルnから、反射ベクトルrを式(1)に示す反射の法則から算出する(ステップS31)。
r=2(i・n)n−i ・・・(1)
The control unit 15 calculates the unit vector i along the imaging line passing through the origin o of the camera 2 and the center p C of the image plane, the position coordinates of the reflection point p of the inspection object 5, and the normal vector n at the reflection point p. , And the reflection vector r is calculated from the law of reflection shown in equation (1) (step S31).
r = 2 (in) n-i (1)

次に、制御部15は、撮像範囲の被検査体5の点群の位置座標に対して主成分分析を実施し、分散が最大となるベクトルvmaxを算出する(ステップS32)。 Next, the control unit 15 performs a principal component analysis on the position coordinates of the point group of the inspection object 5 in the imaging range, and calculates a vector v max that maximizes the variance (step S32).

そして、制御部15は、式(2)に示すように、カメラ原点oと反射点pとの間の距離、反射点pと照明源の中心点pとの間の距離の和が一定の距離Dとなるように、照明源3の中心点pの座標を決定する(ステップS33)。例えば、D=300[mm]とする。
|o−p|+|p−p|=D ・・・(2)
Then, the control unit 15, as shown in equation (2), between the camera origin o and the reflection point p the distance, the sum of the distance between the reflection point p and the center point p l of the illumination source is constant as a distance D t, to determine the coordinates of the center point p l of the illumination source 3 (step S33). For example, D t = 300 [mm].
| O-p | + | p -p l | = D t ··· (2)

そして、制御部15は、ステップS31〜S33の結果に基づいて、照明源3の配置を決定する(ステップS34)。具体的には、照明源3のz軸方向を、反射ベクトル−rとする。また、図25に示すように、ベクトルvmaxとベクトル−rは直交しているとは限らないため、反射ベクトルrとベクトルvmaxの外積から得られるベクトルsを照明源3のy軸方向、ベクトルsと反射ベクトルrの外積から得られるベクトルmを照明源3のx軸方向とする。 And the control part 15 determines arrangement | positioning of the illumination source 3 based on the result of step S31-S33 (step S34). More specifically, the z-axis direction of the illumination source 3 is defined as a reflection vector -r. Also, as shown in FIG. 25, since the vector v max and the vector −r are not always orthogonal, the vector s obtained from the cross product of the reflection vector r and the vector v max is represented by the y-axis direction of the illumination source 3, The vector m obtained from the cross product of the vector s and the reflection vector r is defined as the x-axis direction of the illumination source 3.

図26は、図3のステップS7で出力される光学配置データに基づいて作成された被検査体5に対するカメラ2と照明源3の配置パターンを示す図である。被検査体5のモデルの周囲において、曲面状に曲がっている帯が照明源3の発光面3aの配置を示す。また、四角錐形状のものがカメラ2の配置を示す。   FIG. 26 is a diagram showing an arrangement pattern of the camera 2 and the illumination source 3 with respect to the inspection object 5 created based on the optical arrangement data output in step S7 of FIG. A band bent in a curved shape around the model of the test object 5 indicates the arrangement of the light emitting surface 3a of the illumination source 3. A quadrangular pyramid shows the arrangement of the camera 2.

このようにして、光学配置生成装置14は、被検査体5の形状データから、被検査体5に対するカメラ2と照明源3の配置パターンを示す光学配置データを生成することができる。光学配置生成装置14によって生成された光学配置データは、駆動制御部11によって読み込まれる。駆動制御部11は、光学配置データが示す、被検査体5に対するカメラ2と照明源3の配置パターンに基づいて、アーム駆動部10を制御してロボットアーム4を動作させ、カメラ2と照明源3を配置する。   In this way, the optical arrangement generation device 14 can generate optical arrangement data indicating the arrangement pattern of the camera 2 and the illumination source 3 with respect to the inspection object 5 from the shape data of the inspection object 5. The optical arrangement data generated by the optical arrangement generation device 14 is read by the drive control unit 11. The drive control unit 11 controls the arm drive unit 10 to operate the robot arm 4 based on the arrangement pattern of the camera 2 and the illumination source 3 with respect to the inspection object 5 indicated by the optical arrangement data, and operates the camera 2 and the illumination source. Place 3.

図27は、本実施形態の一実施例における全体の実行処理例を示すフローチャートである。制御部15は、本実施形態に係るプログラム、すなわち記憶部16に格納されている光学配置プログラムを読み出し、実行する。   FIG. 27 is a flowchart illustrating an example of the entire execution process in an example of the present embodiment. The control unit 15 reads and executes the program according to the present embodiment, that is, the optical arrangement program stored in the storage unit 16.

制御部15は、被検査体5の形状データを読み込む(ステップS41)。制御部15は、その被検査体5の形状データの背骨(骨格)に相当する代表線を生成する(ステップS42)。制御部15は、代表線に対する初期プロト点を配置する(ステップS43)。制御部15は、代表線に対する重みを付与する(ステップS44)。制御部15は、クラスタリングの一例として重み付きK−means法による代表線に対するプロト点を再配置する(ステップS45)。制御部15は、撮像エリア内の形状に応じて撮像エリアを分割する(ステップS46)。制御部15は、形状データの内側に相当する撮像エリアの代表線と、外側に相当する撮像エリアの代表線の重みをそれぞれ設定する(ステップS47)。制御部15は、各撮像エリアの形状データに対する特徴を算出する(ステップS48)。制御部15は、各撮像エリアのカメラ配置を算出する(ステップS49)。制御部15は、カメラ配置から撮像範囲、非撮像範囲、及び撮像範囲網羅率を算出する(ステップS50)。   The control unit 15 reads the shape data of the inspection object 5 (Step S41). The control unit 15 generates a representative line corresponding to the spine (skeleton) of the shape data of the subject 5 (step S42). The control unit 15 arranges an initial proto point for the representative line (Step S43). The control unit 15 assigns a weight to the representative line (Step S44). The control unit 15 rearranges the proto points for the representative line by the weighted K-means method as an example of clustering (Step S45). The control unit 15 divides the imaging area according to the shape in the imaging area (Step S46). The control unit 15 sets the weight of the representative line of the imaging area corresponding to the inside of the shape data and the weight of the representative line of the imaging area corresponding to the outside (step S47). The control unit 15 calculates a feature for the shape data of each imaging area (Step S48). The control unit 15 calculates the camera arrangement of each imaging area (Step S49). The control unit 15 calculates an imaging range, a non-imaging range, and an imaging range coverage from the camera arrangement (Step S50).

制御部15は、撮像範囲網羅率が所定値以上か否かを判定する(ステップS51)。所定値未満であると判定した場合(ステップS51でNO)、制御部15は、非撮像範囲から形状データの内側及び外側の代表線に対する重みの加算分を算出し(ステップS52)、ステップS47の処理を行う。制御部15は、撮像範囲網羅率が所定値以上になるまでステップS47〜S52の処理を繰り返す。この例では、図22を参考に所定値は95%で設定されているとする。   The control unit 15 determines whether the imaging range coverage is equal to or greater than a predetermined value (Step S51). If it is determined that the value is less than the predetermined value (NO in step S51), the control unit 15 calculates the added weight of the representative lines inside and outside the shape data from the non-imaging range (step S52), and proceeds to step S47. Perform processing. The control unit 15 repeats the processing of steps S47 to S52 until the coverage of the imaging range becomes equal to or more than the predetermined value. In this example, it is assumed that the predetermined value is set to 95% with reference to FIG.

撮像範囲網羅率が所定値以上になった場合(ステップS51でYES)、制御部15は、各撮像エリアに対するカメラ配置を決定する(ステップS53)。制御部15は、各カメラの画像平面の中心を通る撮像線に対する反射の法則から照明源の位置を決定する(ステップS54)。制御部15は、各カメラの撮像範囲に含まれる点群に対する主成分分析と、主成分分析により得られる、点群の位置座標の分散が最大となる主軸ベクトルと反射ベクトルとを用いて、グラムシュミット直交化法を利用することにより、照明源の向きを決定する(ステップS55)。制御部15は、形状データに対するカメラの配置と、照明源の配置に関するデータを出力する(ステップS56)。   When the coverage of the imaging range is equal to or more than the predetermined value (YES in step S51), the control unit 15 determines the camera arrangement for each imaging area (step S53). The control unit 15 determines the position of the illumination source from the law of reflection on the imaging line passing through the center of the image plane of each camera (step S54). The control unit 15 uses the principal component analysis for the point group included in the imaging range of each camera, and the principal axis vector and the reflection vector obtained by the principal component analysis that maximize the variance of the position coordinates of the point group. The direction of the illumination source is determined by using the Schmidt orthogonalization method (step S55). The control unit 15 outputs data on the arrangement of the camera with respect to the shape data and the arrangement of the illumination source (step S56).

以上のように、本発明の実施形態における外観検査システム1によれば、鏡面を有する被検査体5(検査対象)の形状に応じたカメラ2の配置と照明源3の配置パターンを容易に生成することができる。具体的には、制御部15(生成部15b)は、複数の撮像エリアを設定し(図3:ステップS2)、各撮像エリアに撮像点を初期配置し(図3:ステップS3)、撮像範囲の比率を用いて撮像点の配置を調整し(図3:ステップS4,S5)、撮像点の配置位置から照明点の配置位置を決定する(図3:ステップS6)ことにより、鏡面を有する被検査体5(検査対象)の形状に応じたカメラ2の配置と照明源3の配置パターンを容易に生成することができる。これにより、カメラ2(撮像装置)及び照明源3を把持したロボットアーム4に対する、カメラ2(撮像装置)及び照明源3の配置の教示工数を低減させることができる。   As described above, according to the appearance inspection system 1 in the embodiment of the present invention, the arrangement pattern of the camera 2 and the arrangement pattern of the illumination source 3 according to the shape of the inspection object 5 (inspection object) having a mirror surface can be easily generated. can do. Specifically, the control unit 15 (the generation unit 15b) sets a plurality of imaging areas (FIG. 3: Step S2), initially arranges imaging points in each imaging area (FIG. 3: Step S3), and sets an imaging range. The arrangement of the imaging points is adjusted using the ratio (FIG. 3: Steps S4 and S5), and the arrangement position of the illumination point is determined from the arrangement positions of the imaging points (FIG. 3: Step S6). The arrangement pattern of the camera 2 and the arrangement pattern of the illumination source 3 according to the shape of the inspection object 5 (inspection object) can be easily generated. Accordingly, the number of man-hours for teaching the arrangement of the camera 2 (imaging device) and the illumination source 3 to the robot arm 4 holding the camera 2 (imaging device) and the illumination source 3 can be reduced.

以上、実施形態、変形例に基づき本態様について説明してきたが、上記した態様の実施の形態は、本態様の理解を容易にするためのものであり、本態様を限定するものではない。本態様は、その趣旨並びに特許請求の範囲を逸脱することなく、変更、改良され得ると共に、本態様にはその等価物が含まれる。また、その技術的特徴が本明細書中に必須なものとして説明されていなければ、適宜、削除することができる。   Although the present embodiment has been described based on the embodiment and the modified examples, the embodiment of the above-described embodiment is for facilitating understanding of the present embodiment, and does not limit the present embodiment. This embodiment can be changed and improved without departing from the spirit and scope of the claims, and its equivalents are included in this embodiment. If the technical features are not described as essential in this specification, they can be deleted as appropriate.

1…外観検査システム(表面検査システム)
2…カメラ
3…照明源
4…ロボットアーム
5…被検査体
10…アーム駆動部
11…駆動制御部
12…演算部
13…検査部
14…光学配置生成装置
15…制御部
15a…取得部
15b…生成部
16…記憶部
17…通信I/F
18…入力I/F
19…出力I/F
20…バス
1. Appearance inspection system (surface inspection system)
DESCRIPTION OF SYMBOLS 2 ... Camera 3 ... Illumination source 4 ... Robot arm 5 ... Inspection object 10 ... Arm drive part 11 ... Drive control part 12 ... Calculation part 13 ... Inspection part 14 ... Optical arrangement generation device 15 ... Control part 15a ... Acquisition part 15b ... Generation unit 16: Storage unit 17: Communication I / F
18 Input I / F
19 ... Output I / F
20 ... Bus

Claims (11)

光学配置生成装置であって、
鏡面を有する被検査体の形状を形成する点群の位置座標と、前記点群に対する法線ベクトルと、を含む形状データを取得する取得部と、
前記形状データを用いて、前記被検査体を撮像するための撮像点と、前記被検査体の前記鏡面で正反射した反射光の光路上に前記撮像点が存在するような照明点との、前記被検査体に対するそれぞれの配置パターンを示す光学配置データを生成し、出力する生成部と、
を備える、光学配置生成装置。
An optical arrangement generation device,
An acquisition unit that acquires shape data including position coordinates of a point cloud forming the shape of the object to be inspected having a mirror surface, and a normal vector to the point cloud,
Using the shape data, an imaging point for imaging the object to be inspected, and an illumination point such that the imaging point exists on an optical path of light reflected regularly by the mirror surface of the object to be inspected, A generation unit that generates and outputs optical arrangement data indicating each arrangement pattern for the inspection object,
An optical arrangement generation device comprising:
請求項1に記載の光学配置生成装置であって、
前記生成部は、前記形状データを用いて、
前記被検査体に対して、前記撮像点に配置される撮像装置の視野幅に応じて複数の撮像エリアを設定し、
前記撮像エリアのそれぞれに対して前記複数の撮像点のそれぞれを配置し、
前記被検査体の全表面の範囲に対する前記複数の撮像点により撮像可能な前記被検査体上の撮像範囲の比率を用いて、前記複数の撮像点それぞれの配置を調整し、
調整された前記複数の撮像点それぞれの配置位置から前記照明点の配置位置を決定する、光学配置生成装置。
The optical configuration generating device according to claim 1,
The generation unit uses the shape data,
For the object to be inspected, a plurality of imaging areas are set according to a field width of an imaging device arranged at the imaging point,
Arranging each of the plurality of imaging points for each of the imaging areas,
Using the ratio of the imaging range on the test object that can be imaged by the plurality of imaging points to the range of the entire surface of the inspection object, adjust the arrangement of each of the plurality of imaging points,
An optical arrangement generation device that determines an arrangement position of the illumination point from the adjusted arrangement positions of the plurality of imaging points.
請求項2に記載の光学配置生成装置であって、
前記生成部は、前記撮像エリアの設定において、
前記形状データを用いて前記被検査体の骨格を表す代表線を生成し、
前記代表線に対して前記視野幅に応じて複数の点をプロットし、
前記代表線に対して前記被検査体の形状の変化の度合いに応じて設定した重みを用いて前記複数の点の位置を調整し、
調整した前記複数の点のそれぞれを中心した前記撮像エリアを設定する、光学配置生成装置。
The optical arrangement generation device according to claim 2, wherein
The generation unit is configured to set the imaging area,
Using the shape data to generate a representative line representing the skeleton of the test object,
Plot a plurality of points according to the field width for the representative line,
Adjusting the positions of the plurality of points using a weight set according to the degree of change in the shape of the test object with respect to the representative line,
An optical arrangement generation device configured to set the imaging area around each of the adjusted points.
請求項2または請求項3に記載の光学配置生成装置であって、
前記生成部は、前記撮像点の配置において、
前記形状データに含まれる前記点群の位置座標と前記法線ベクトルに対する主成分分析により、前記撮像エリアのそれぞれにおける前記形状データの幾何学的特徴を算出し、
前記幾何学的特徴を用いて、前記撮像エリアのそれぞれにおける複数の撮像点の配置位置候補から、1つの撮像点の配置位置を決定する、光学配置生成装置。
The optical arrangement generation device according to claim 2 or 3, wherein:
The generation unit, in the arrangement of the imaging point,
By a principal component analysis on the position coordinates of the point group and the normal vector included in the shape data, a geometric feature of the shape data in each of the imaging areas is calculated,
An optical arrangement generation device that determines an arrangement position of one imaging point from arrangement position candidates of a plurality of imaging points in each of the imaging areas using the geometric feature.
請求項2から請求項4のいずれか一項に記載の光学配置生成装置であって、
前記生成部は、前記撮像点の配置の調整において、
前記被検査体の全表面の範囲に対する前記複数の撮像点により撮像可能な前記被検査体上の撮像範囲の比率が最大または所定値以上になるまで、前記撮像エリアの設定と前記撮像点の配置とを繰り返す、光学配置生成装置。
The optical arrangement generation device according to any one of claims 2 to 4, wherein
In the adjustment of the arrangement of the imaging point, the generation unit,
The setting of the imaging area and the arrangement of the imaging points until the ratio of the imaging range on the inspection object that can be imaged by the plurality of imaging points to the range of the entire surface of the inspection object becomes a maximum or a predetermined value or more. And an optical arrangement generating apparatus.
請求項2から請求項5のいずれか一項に記載の光学配置生成装置であって、
前記生成部は、前記撮像点の配置の調整において、
前記撮像点に配置する撮像装置により撮像することができない前記被検査体上の範囲に応じて、前記代表線に対して前記重みを更新して、前記撮像エリアの設定と前記撮像点の配置とを繰り返す、光学配置生成装置。
The optical arrangement generation device according to any one of claims 2 to 5, wherein
In the adjustment of the arrangement of the imaging point, the generation unit,
According to the range on the object to be imaged that cannot be imaged by the imaging device arranged at the imaging point, the weight is updated for the representative line, the setting of the imaging area and the arrangement of the imaging point. Repeat the above, optical arrangement generation device.
請求項3から請求項6のいずれか一項に記載の光学配置生成装置であって、
前記生成部は、前記撮像点の配置の調整において、
前記撮像エリアの設定を行う場合、前記被検査体の表面形状に応じて前記複数の撮像エリアをグループ化し、
グループ化した撮像エリア毎に前記代表線を生成し、前記代表線のそれぞれに対して異なる前記重みを設定する、光学配置生成装置。
An optical arrangement generation device according to any one of claims 3 to 6, wherein
In the adjustment of the arrangement of the imaging point, the generation unit,
When performing the setting of the imaging area, grouping the plurality of imaging areas according to the surface shape of the inspection object,
An optical arrangement generation device that generates the representative line for each grouped imaging area and sets different weights for each of the representative lines.
請求項2から請求項7のいずれか一項に記載の光学配置生成装置であって、
前記生成部は、前記照明点の配置位置の決定において、
前記撮像点からの撮像方向を示す撮像線と前記被検査体との交点を示す反射点と前記撮像点との間の距離と、前記反射点と前記照明点との間の距離との和が一定になるように、前記照明点を配置する、光学配置生成装置。
The optical arrangement generation device according to any one of claims 2 to 7, wherein:
In the determination of the arrangement position of the illumination point, the generation unit,
The sum of the distance between the imaging point and the reflection point indicating the intersection of the imaging line indicating the imaging direction from the imaging point and the object to be inspected and the distance between the reflection point and the illumination point is An optical arrangement generation device that arranges the illumination points so as to be constant.
光学配置生成プログラムであって、情報処理装置に、
鏡面を有する被検査体の形状を形成する点群の位置座標と、前記点群に対する法線ベクトルと、を含む形状データを取得するステップと、
前記形状データを用いて、前記被検査体を撮像するための撮像点と、前記被検査体の前記鏡面で正反射した反射光の光路上に前記撮像点が存在するような照明点との、前記被検査体に対するそれぞれの配置パターンを示す光学配置データを生成し、出力するステップと、
を実行させる、光学配置生成プログラム。
An optical arrangement generation program, wherein the information processing apparatus includes:
Obtaining shape data including position coordinates of a point group forming the shape of the inspected object having a mirror surface, and a normal vector to the point group,
Using the shape data, an imaging point for imaging the object to be inspected, and an illumination point such that the imaging point exists on an optical path of light reflected regularly by the mirror surface of the object to be inspected, Generating and outputting optical arrangement data indicating each arrangement pattern for the object to be inspected,
, An optical configuration generation program.
光学配置生成方法であって、情報処理装置を用いて、
鏡面を有する被検査体の形状を形成する点群の位置座標と、前記点群に対する法線ベクトルと、を含む形状データを取得する工程と、
前記形状データを用いて、前記被検査体を撮像するための撮像点と、前記被検査体の前記鏡面で正反射した反射光の光路上に前記撮像点が存在するような照明点との、前記被検査体に対するそれぞれの配置パターンを示す光学配置データを生成し、出力する工程と、
を実行する、光学配置生成方法。
An optical arrangement generation method, using an information processing device,
A step of acquiring shape data including position coordinates of a point group forming a shape of the object to be inspected having a mirror surface, and a normal vector to the point group,
Using the shape data, an imaging point for imaging the object to be inspected, and an illumination point such that the imaging point exists on an optical path of light reflected regularly by the mirror surface of the object to be inspected, A step of generating and outputting optical arrangement data indicating each arrangement pattern for the object to be inspected,
An optical arrangement generating method.
表面検査システムであって、
鏡面を有する被検査体の形状を形成する点群の位置座標と前記点群に対する法線ベクトルとを含む形状データを取得し、前記形状データを用いて、前記被検査体を撮像するための撮像点と、前記被検査体の前記鏡面で正反射した反射光の光路上に前記撮像点が存在するような照明点との、前記被検査体に対するそれぞれの配置パターンを示す光学配置データを生成する光学配置生成部と、
前記被検査体を写り込ませる照明源と、
前記被検査体を撮像する撮像部と、
前記照明源及び前記撮像部それぞれを3次元方向に移動可能に駆動する駆動部と、
前記光学配置データを用いて、前記駆動部の駆動を制御する駆動制御部と、
を備える、表面検査システム。
A surface inspection system,
Acquisition of shape data including position coordinates of a point group forming a shape of an inspected object having a mirror surface and a normal vector to the point group, and imaging using the shape data to image the inspected object Generating optical arrangement data indicating respective arrangement patterns of the point and the illumination point such that the imaging point exists on the optical path of the reflected light regularly reflected by the mirror surface of the inspection object with respect to the inspection object. An optical arrangement generation unit;
An illumination source for reflecting the object to be inspected,
An imaging unit for imaging the object to be inspected,
A driving unit that drives each of the illumination source and the imaging unit so as to be movable in a three-dimensional direction;
Using the optical arrangement data, a drive control unit that controls the drive of the drive unit,
A surface inspection system comprising:
JP2018179198A 2018-09-25 2018-09-25 Optical arrangement generation device, optical arrangement generation program, method for generating optical arrangement, and surface inspection system Pending JP2020051806A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2018179198A JP2020051806A (en) 2018-09-25 2018-09-25 Optical arrangement generation device, optical arrangement generation program, method for generating optical arrangement, and surface inspection system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018179198A JP2020051806A (en) 2018-09-25 2018-09-25 Optical arrangement generation device, optical arrangement generation program, method for generating optical arrangement, and surface inspection system

Publications (1)

Publication Number Publication Date
JP2020051806A true JP2020051806A (en) 2020-04-02

Family

ID=69996671

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018179198A Pending JP2020051806A (en) 2018-09-25 2018-09-25 Optical arrangement generation device, optical arrangement generation program, method for generating optical arrangement, and surface inspection system

Country Status (1)

Country Link
JP (1) JP2020051806A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117857769A (en) * 2024-03-07 2024-04-09 长江龙新媒体有限公司 Self-adaptive multi-camera capturing and real-time free view video rendering method and system
JP7494652B2 (en) 2020-08-25 2024-06-04 株式会社プロテリアル Apparatus and method for preparing for visual inspection

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7494652B2 (en) 2020-08-25 2024-06-04 株式会社プロテリアル Apparatus and method for preparing for visual inspection
CN117857769A (en) * 2024-03-07 2024-04-09 长江龙新媒体有限公司 Self-adaptive multi-camera capturing and real-time free view video rendering method and system

Similar Documents

Publication Publication Date Title
US10482621B2 (en) System and method for improved scoring of 3D poses and spurious point removal in 3D image data
US9773304B2 (en) Inspection apparatus, inspection method, and program
JP6736257B2 (en) Information processing device, information processing method, and program
JP6594129B2 (en) Information processing apparatus, information processing method, and program
CN108562250B (en) Keyboard keycap flatness rapid measurement method and device based on structured light imaging
WO2012053521A1 (en) Optical information processing device, optical information processing method, optical information processing system, and optical information processing program
JP6519265B2 (en) Image processing method
CN104956209A (en) System for accurate 3D modeling of gemstones
JP2012042396A (en) Position attitude measurement device, position attitude measurement method, and program
WO2016018260A1 (en) Distortion quantifier
JP2014013147A (en) Three-dimensional measuring instrument and robot device
JP6821326B2 (en) Information processing equipment, measurement systems, information processing methods and programs
JP2014169947A (en) Shape inspection method and device thereof
JP6151489B2 (en) Vibration measuring apparatus and vibration measuring method
JP2014035196A (en) Shape measurement apparatus
JP2020051806A (en) Optical arrangement generation device, optical arrangement generation program, method for generating optical arrangement, and surface inspection system
KR20230115891A (en) Defect observation method, apparatus, and program
JP2013088414A (en) Shape inspection method and device of the same
CN115699282A (en) Semiconductor overlay measurement using machine learning
JP5136108B2 (en) 3D shape measuring method and 3D shape measuring apparatus
CN116109701A (en) Object grabbing method based on passive dual-purpose high light reflection
JP6884077B2 (en) Surface inspection equipment and surface inspection method
JP2020190509A (en) Optical arrangement generation device, optical arrangement generation program, optical arrangement generation method, and appearance inspection system
TWI822126B (en) Sample observation device, sample observation method and computer system
JP5945188B2 (en) Shape measuring device