JP5967470B2 - Inspection device - Google Patents

Inspection device Download PDF

Info

Publication number
JP5967470B2
JP5967470B2 JP2012078608A JP2012078608A JP5967470B2 JP 5967470 B2 JP5967470 B2 JP 5967470B2 JP 2012078608 A JP2012078608 A JP 2012078608A JP 2012078608 A JP2012078608 A JP 2012078608A JP 5967470 B2 JP5967470 B2 JP 5967470B2
Authority
JP
Japan
Prior art keywords
image data
distance
unit
camera
test object
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
JP2012078608A
Other languages
Japanese (ja)
Other versions
JP2013210410A (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.)
Ricoh Co Ltd
Original Assignee
Ricoh Co Ltd
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 Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP2012078608A priority Critical patent/JP5967470B2/en
Publication of JP2013210410A publication Critical patent/JP2013210410A/en
Application granted granted Critical
Publication of JP5967470B2 publication Critical patent/JP5967470B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Measurement Of Optical Distance (AREA)
  • Focusing (AREA)
  • Automatic Focus Adjustment (AREA)
  • Length Measuring Devices By Optical Means (AREA)

Description

本発明は、複数のカメラで被検物を撮影し画像処理して、被検物の合否判定を行う検査装置に関する。   The present invention relates to an inspection apparatus that photographs a test object with a plurality of cameras, performs image processing, and performs pass / fail determination of the test object.

従来から、工場などでは製品検査の自動化にカメラが広く使用されている。この場合、一般に次のようにして被検物の合否判定を行っている。まず、良品を予めカメラで撮影し良品の特徴量を登録する。次に、被検物を撮影し、良品の特徴量と比較して、良品の特徴量と一致あるいは類似していれば合格、そうでなければ不合格と判定する。   Conventionally, cameras have been widely used for automating product inspections in factories and the like. In this case, generally the pass / fail determination of the test object is performed as follows. First, a non-defective product is photographed with a camera in advance, and the feature quantity of the non-defective product is registered. Next, the test object is photographed, and compared with the feature quantity of the non-defective product. If the feature quantity matches or is similar to the feature quantity of the non-defective product, it is determined that the test is successful.

このような検査装置としては、一つのカメラで被検物を撮影し特徴を抽出する単眼カメラタイプが主流であったが、近年、2つのカメラで被検物を撮影し特徴を抽出するステレオカメラタイプが使用されるようになってきた。ステレオカメラタイプでは、単眼カメラタイプでは出来ない三次元形状を計測できるため、三次元的に特定の2点間の距離を計測し、三次元の寸法計測を実施することができる(例えば、特許文献1)。さらに、この三次元の寸法計測機能を用いての寸法判定も行われており、単眼カメラタイプで苦手としていた、検査時のカメラと被検物の位置関係がばらついた場合にも安定した判定を行うことができる。なお、寸法判定は、被検物と良品の寸法の比較を行い、等しいかどうかを判定することを意味する。この寸法判定には、寸法の絶対値は不要で、相対値のみでよい。   As such an inspection apparatus, a monocular camera type in which an object is photographed by one camera and features are extracted has been mainstream, but in recent years, a stereo camera that photographs an object by two cameras and extracts features. Type has come to be used. Since the stereo camera type can measure a three-dimensional shape that cannot be obtained with a monocular camera type, the distance between two specific points can be measured three-dimensionally, and three-dimensional dimension measurement can be performed (for example, Patent Documents). 1). In addition, dimension determination using this three-dimensional dimension measurement function is also performed, and stable determination is possible even when the positional relationship between the camera and the test object varies, which was not good with monocular camera type It can be carried out. Note that the dimension determination means that the dimensions of the test object and the non-defective product are compared to determine whether they are equal. For this dimension determination, the absolute value of the dimension is not necessary, and only the relative value may be used.

単眼カメラタイプの検査装置は、ステレオカメラタイプよりも小型で安価であるが、被検物の3次元形状計測ができないため、安定した寸法判定が行えない。一方、ステレオカメラタイプの検査装置は、3次元形状計測ができるので、安定した寸法判定が行えるが、装置が大型化し、小型化したいというニーズには向かない。ステレオカメラタイプの検査装置を小型化するためには、2つのカメラ間の距離を短くする必要がある。しかし、3次元形状の計測精度は、カメラ間の距離に比例して低下することが知られており、2つのカメラ間の距離を短くした場合、安定した寸法判定が行えなくなってしまう問題がある。また、高精度のステレオカメラを製造するには、カメラの位置合わせ、キャリブレーションなどに手間がかかり、コストアップにつながる。   A monocular camera type inspection apparatus is smaller and less expensive than a stereo camera type, but cannot measure a three-dimensional shape of an object to be measured, so that stable dimension determination cannot be performed. On the other hand, since a stereo camera type inspection apparatus can measure a three-dimensional shape, it can perform stable dimension determination, but it is not suitable for the need for a larger and smaller apparatus. In order to reduce the size of a stereo camera type inspection apparatus, it is necessary to shorten the distance between two cameras. However, it is known that the measurement accuracy of the three-dimensional shape decreases in proportion to the distance between the cameras, and there is a problem that when the distance between the two cameras is shortened, stable dimension determination cannot be performed. . In addition, in order to manufacture a high-precision stereo camera, it takes time and effort to align and calibrate the camera, leading to an increase in cost.

本発明は、複数のカメラを使用して被検物の寸法判定を行う検査装置において、測距精度の低い、小型ステレオカメラタイプでも、安定した寸法判定を行うことができるようにすることにある。   SUMMARY OF THE INVENTION An object of the present invention is to enable stable dimension determination even in a small stereo camera type with low ranging accuracy in an inspection apparatus that performs dimension determination of a test object using a plurality of cameras. .

本発明の検査装置は、被検物を複数方向から撮影して、視差の異なる複数の画像データを取得する撮影手段と、前記複数の画像データから距離画像データを生成する距離画像生成手段と、前記複数の画像データ中の任意の画像データから被検物と非被検物の境界領域の2つの特徴点を検出する特徴点検出手段と、前記2つの特徴点と前記距離画像データから、前記2つの特徴点の三次元座標を取得し、該2つの三次元座標から、前記2つの特徴点間の距離を算出する距離算出手段と、前記算出された距離が所定の閾値内であるか否かで被検物の合否を判定する距離判定手段と、を有し、前記距離算出手段は、前記特徴点検出手段により検出される前記特徴点の座標から、前記三次元座標のxy座標を取得するとともに、前記距離画像データから、前記特徴点を中心とし、かつ、前記被検物と前記非被検物との両方の距離データが含まれるn×nの距離データを抽出して、そのうちの中央値を前記三次元座標のz座標として取得することを主要な特徴とする。 The inspection apparatus according to the present invention, an imaging unit that images a test object from a plurality of directions and acquires a plurality of image data having different parallaxes, a distance image generation unit that generates distance image data from the plurality of image data, Feature point detection means for detecting two feature points of the boundary region between the test object and the non-test object from arbitrary image data in the plurality of image data, and from the two feature points and the distance image data, A distance calculation unit that acquires three-dimensional coordinates of two feature points, calculates a distance between the two feature points from the two three-dimensional coordinates, and whether or not the calculated distance is within a predetermined threshold or at possess the distance determination means for acceptance of the test object, wherein the distance calculation means, from the feature point coordinates detected by the feature point detecting unit, acquires the xy coordinates of the three-dimensional coordinate And the distance image data , N × n distance data centered on the feature point and including distance data of both the test object and the non-test object is extracted, and the median value of the data is determined as the three-dimensional coordinate The main feature is to obtain the z coordinate .

本発明によれば、測距精度の低い、小型ステレオカメラタイプでも、被検物の安定した寸法判定を行うことが可能になる。   According to the present invention, it is possible to perform stable dimension determination of a test object even in a small stereo camera type with low ranging accuracy.

本発明の実施形態に係る検査装置の被検物とカメラの設置状態を示した図である。It is the figure which showed the installation state of the to-be-tested object and camera of the inspection apparatus which concerns on embodiment of this invention. 本実施形態に係る検査装置のシステム構成図である。It is a system configuration figure of the inspection device concerning this embodiment. 図2における処理ユニットの構成例を示す詳細ブロック図である。FIG. 3 is a detailed block diagram illustrating a configuration example of a processing unit in FIG. 2. 図3のエッジ検出部でのエッジ検出処理の説明図である。It is explanatory drawing of the edge detection process in the edge detection part of FIG. 図3の寸法計測部での寸法計測処理の説明図である。It is explanatory drawing of the dimension measurement process in the dimension measurement part of FIG. 図3の制御部の状態遷移図である。It is a state transition diagram of the control part of FIG. 図6の各状態での動作フローを示す図である。It is a figure which shows the operation | movement flow in each state of FIG. 本実施形態に係る検査装置の全体的動作の流れを示す図である。It is a figure which shows the flow of the whole operation | movement of the test | inspection apparatus which concerns on this embodiment. パソコンの表示画面の初期状態を示す図である。It is a figure which shows the initial state of the display screen of a personal computer. パソコンの表示画面に輝度画像が表示された状態を示す図である。It is a figure which shows the state in which the luminance image was displayed on the display screen of a personal computer. パソコンの表示画面に更にエッジ検出領域が表示された状態を示す図である。It is a figure which shows the state in which the edge detection area | region was further displayed on the display screen of the personal computer. パソコンの表示画面に更に寸法計測結果が表示された状態を示す図である。It is a figure which shows the state by which the dimension measurement result was further displayed on the display screen of the personal computer. パソコンの表示画面に更に寸法判定閾値が表示された状態を示す図である。It is a figure which shows the state by which the dimension determination threshold value was further displayed on the display screen of the personal computer. パソコンの表示画面に更に判定結果が表示された状態を示す図である。It is a figure which shows the state by which the determination result was further displayed on the display screen of the personal computer. 一体型ステレオカメラの一実施例を示す図である。It is a figure which shows one Example of an integrated stereo camera. 一体型ステレオカメラの他の実施例を示す図である。It is a figure which shows the other Example of an integrated stereo camera.

以下、本発明の実施形態について図面を参照して説明する。なお、実施形態では、撮影手段としてのカメラは2つとするが、カメラは2個に限らず、一般に2個以上であればよい。   Embodiments of the present invention will be described below with reference to the drawings. In the embodiment, two cameras are used as photographing means. However, the number of cameras is not limited to two, and generally two or more cameras may be used.

図1は、本実施形態に係る検査装置の被検物とカメラの設置状態の一例を示した図である。図1において、撮影手段としてのカメラA101とカメラB102は、両者の光軸が平行になるようにカメラ固定治具100に固定されている。このカメラA101、カメラB102がステレオカメラの左目、右目に相当するカメラである。カメラ固定治具100は支持台110に固定されている。該支持台110に取り付けられたカメラ固定治具100と該支持台110の設置面112とは平行になるよう構成されている。その結果、カメラA101、カメラB102は鉛直下向きに設置される。支持台110の設置面112上の、カメラA101、カメラB102と対向する位置に、被検物10が載置される。ここで、被検物の形状は直方体とする。   FIG. 1 is a diagram illustrating an example of an installation state of a test object and a camera of the inspection apparatus according to the present embodiment. In FIG. 1, a camera A 101 and a camera B 102 as photographing means are fixed to a camera fixing jig 100 so that both optical axes are parallel to each other. These cameras A101 and B102 are cameras corresponding to the left eye and right eye of the stereo camera. The camera fixing jig 100 is fixed to the support base 110. The camera fixing jig 100 attached to the support base 110 and the installation surface 112 of the support base 110 are configured to be parallel. As a result, the camera A101 and the camera B102 are installed vertically downward. The test object 10 is placed on the installation surface 112 of the support base 110 at a position facing the camera A101 and the camera B102. Here, the shape of the test object is a rectangular parallelepiped.

図2は、本実施形態に係る検査装置のシステム構成図である。カメラ固定治具100に固定されたカメラA101、カメラB102は、それぞれ被検物10を撮影し、その光学像をアナログ電気信号に変換し、さらにデジタル信号に変換して画像データを出力する。ここでは、画像データは8ビット/画素からなり、0〜255階調(輝度値)をとるとする。処理ユニット200は、カメラA101及びカメラB102の撮影を制御すると共に、カメラA101及びカメラB102から出力される画像データを取り込んで、被検物10の寸法判定(距離判定)を行うための種々の処理、主に画像処理を行う処理基板である。パソコン300は処理ユニット200と接続されて、処理ユニット200に対して、該処理ユニット200での処理のためのパラメータの指定やその他の指示を行うと共に、処理ユニット200から画像データや、寸法計測結果(距離)、判定結果などを受信して表示する。このパソコン300がユーザインタフェース手段として機能する。なお、パソコン300の代わりに、タッチパネル式等の操作部を使用し、処理ユニット200と一体的に構成することでもよい。外部通信部400は、一般にPLC(Programmable Logic Controller)と接続される。該外部通信部400は、例えば、撮影トリガーを処理ユニット200に与える、処理ユニット200の動作状態を監視する、処理ユニット200から判定結果を受け取る、などが可能である。   FIG. 2 is a system configuration diagram of the inspection apparatus according to the present embodiment. Cameras A101 and B102 fixed to the camera fixing jig 100 respectively photograph the test object 10, convert the optical image into an analog electric signal, further convert it into a digital signal, and output image data. Here, it is assumed that the image data is composed of 8 bits / pixel and takes 0 to 255 gradations (luminance values). The processing unit 200 controls the photographing of the camera A 101 and the camera B 102 and takes in the image data output from the camera A 101 and the camera B 102 to perform various processes for determining the size (distance determination) of the test object 10. A processing substrate that mainly performs image processing. The personal computer 300 is connected to the processing unit 200, specifies parameters for processing in the processing unit 200 and other instructions to the processing unit 200, and outputs image data and dimension measurement results from the processing unit 200. (Distance), judgment results, etc. are received and displayed. This personal computer 300 functions as user interface means. Instead of the personal computer 300, an operation unit such as a touch panel type may be used, and the processing unit 200 may be configured integrally. The external communication unit 400 is generally connected to a PLC (Programmable Logic Controller). For example, the external communication unit 400 can give a shooting trigger to the processing unit 200, monitor the operation state of the processing unit 200, and receive a determination result from the processing unit 200.

図3は、本実施形態に係る処理ユニット200の構成例を示す詳細ブロック図である。本処理ユニット200は、カメラAインターフェース(I/F)201、カメラBI/F202、PCI/F203、外部I/F204、メモリ205、画像変換部(画像変換手段)206、距離画像生成部(距離画像生成手段)207、エッジ検出部(特徴点検出手段)208、寸法計測部(距離算出手段)209、寸法判定部(距離判定手段)210、及び制御部211等のモジュールからなり、これら各モジュールはバス212で接続されている。   FIG. 3 is a detailed block diagram illustrating a configuration example of the processing unit 200 according to the present embodiment. The processing unit 200 includes a camera A interface (I / F) 201, a camera BI / F 202, a PCI / F 203, an external I / F 204, a memory 205, an image conversion unit (image conversion unit) 206, and a distance image generation unit (distance image). Generation unit) 207, edge detection unit (feature point detection unit) 208, dimension measurement unit (distance calculation unit) 209, dimension determination unit (distance determination unit) 210, control unit 211, and the like. They are connected by a bus 212.

制御部211は、各モジュールの動作制御を行う。また、制御部211は、各モジュールとの画像データ、その他データ等のやり取り、メモリ205への画像データ、その他データ等の保存/取り出しを行う。メモリ205は、各モジュールで使用する画像データ、パラメータ、ユーザ調整値などを記憶する。   The control unit 211 controls the operation of each module. The control unit 211 also exchanges image data and other data with each module, and stores / retrieves image data and other data to and from the memory 205. The memory 205 stores image data, parameters, user adjustment values, and the like used in each module.

カメラAI/F201は、カメラA101とのインターフェースであり、制御部211からの撮影指示や設定データ等をカメラA101に送信すると共に、カメラA101から出力された画像データを介してメモリ205に記憶する。カメラBI/F202は、カメラB102とのインターフェースであり、同じく制御部211からの撮影指示や設定データ等をカメラB102に送信すると共に、カメラB102から出力された画像データをメモリ205に記憶する。ここで、設定データには、自動露出、ホワイトバランス、画像信号モード(グレースケール/YUVカラー/Raw画像等)などが含まれる。なお、画像信号モードはグレースケールとする。したがって、カメラA101,カメラB102からはモノクロの輝度画像データが出力される。   The camera AI / F 201 is an interface with the camera A 101, and transmits a shooting instruction, setting data, and the like from the control unit 211 to the camera A 101 and stores them in the memory 205 via the image data output from the camera A 101. The camera BI / F 202 is an interface with the camera B102, and similarly transmits a shooting instruction, setting data, and the like from the control unit 211 to the camera B102, and stores the image data output from the camera B102 in the memory 205. Here, the setting data includes automatic exposure, white balance, image signal mode (grayscale / YUV color / raw image, etc.) and the like. The image signal mode is gray scale. Therefore, monochrome luminance image data is output from the camera A101 and the camera B102.

PCI/F203は、パソコン(PC)300とのインターフェースであり、パソコン300で設定されたユーザ設定値(エッジ検出領域座標、判定閾値等)を受け取り、メモリ205に記憶する。また、PCI/F203は、画像データ、寸法計測結果、判定結果等をパソコン300に送信する。   The PCI / F 203 is an interface with the personal computer (PC) 300, receives user setting values (edge detection area coordinates, determination threshold values, etc.) set by the personal computer 300, and stores them in the memory 205. The PCI / F 203 transmits image data, a dimension measurement result, a determination result, and the like to the personal computer 300.

外部I/F204は、外部通信部400とのインターフェースであり、撮影トリガーを外部通信部400から受け取り、また、処理ユニット200の動作状態や判定結果などを外部通信部400に出力する。   The external I / F 204 is an interface with the external communication unit 400, receives a shooting trigger from the external communication unit 400, and outputs an operation state of the processing unit 200 and a determination result to the external communication unit 400.

画像変換手段としての画像変換部206は、メモリ205から、カメラA101で撮影された画像データ(以下、輝度画像データA)、カメラB102で撮影された画像データ(以下、輝度画像データB)を取り込んで、それぞれ画像歪みを補正する。さらに、画像変換部206は、歪み補正された輝度画像データBに対して歪み補正された輝度画像データAを平行化(ステレオ画像の平行化)し、平行化された輝度画像データA’と輝度画像データB’をメモリ205に記憶する。歪み補正の手法としてはA flexible new technique for camera calibration”.IEEE Transactions on Pattern Analysis and Machine Intelligence,22(11):1330-1334,2000、平行化の手法としてはFusiello A,Trucco E and VerriA:A compact algorithm for rectification of stereo pairs. Machine Vision and Applications:16-22,2000を用いるとよい。   An image conversion unit 206 serving as an image conversion unit takes in image data captured by the camera A 101 (hereinafter, luminance image data A) and image data captured by the camera B 102 (hereinafter, luminance image data B) from the memory 205. Then, the image distortion is corrected. Further, the image conversion unit 206 parallelizes the distortion-corrected luminance image data A with the distortion-corrected luminance image data B (parallelization of the stereo image), and the parallelized luminance image data A ′ and the luminance Image data B ′ is stored in the memory 205. A flexible new technique for camera calibration ". IEEE Transactions on Pattern Analysis and Machine Intelligence, 22 (11): 1330-1334, 2000, and parallelization techniques Fusiello A, Trucco E and Verri A: A Compact algorithm for rectification of stereo pairs. Machine Vision and Applications: 16-22, 2000 should be used.

なお、カメラA101とカメラB102を予め平行化した状態でカメラ固定治具100に固定することで平行化の処理は省略できる。   Note that the parallelization process can be omitted by fixing the camera A101 and the camera B102 to the camera fixing jig 100 in a state in which the camera A101 and the camera B102 are parallelized in advance.

距離画像生成手段としての距離画像生成部207は、メモリ205から、平行された輝度画像データA’と輝度画像データB’を取り込み、この2つの輝度画像データA’,B’を用いて、ブロックマッチングを行い、視差画像データCを生成する。そして、視差画像データCから距離画像データDを作成する。距離画像データDは、視差画像データCの各視差値p(単位:pix)に対して、輝度画像データB’の焦点距離Fl(単位:cm)、輝度画像データA’と輝度画像データB’の基線長Bl(単位:cm)を用いて、各ピクセル(pix)毎に、d=Fl*Bl/pの式を利用して、距離値d(単位:cm)を計算することによって得られる。距離画像生成部207は、生成した距離画像データDをメモリ205に記憶する。   A distance image generation unit 207 as a distance image generation unit takes in parallel luminance image data A ′ and luminance image data B ′ from the memory 205, and uses the two luminance image data A ′ and B ′ to block Matching is performed to generate parallax image data C. Then, distance image data D is created from the parallax image data C. The distance image data D includes the focal length Fl (unit: cm) of the luminance image data B ′, the luminance image data A ′, and the luminance image data B ′ for each parallax value p (unit: pix) of the parallax image data C. Is obtained by calculating the distance value d (unit: cm) for each pixel (pix) using the formula d = Fl * B1 / p for each pixel (pix). . The distance image generation unit 207 stores the generated distance image data D in the memory 205.

なお、カメラが3つ以上の場合には複数の距離画像データが得られるため、各距離画像データをマージングして一つの距離画像データにする必要がある。これには従来から知られている手法を用いてればよい(例えば、非特許文献1〜3)。   Note that when there are three or more cameras, a plurality of distance image data can be obtained. Therefore, it is necessary to merge each distance image data into one distance image data. For this purpose, a conventionally known method may be used (for example, Non-Patent Documents 1 to 3).

特徴点検出手段としてのエッジ検出部208は、メモリ205から輝度画像データB’を取り込み、輝度画像データB’を用いて被検物の特徴点としてのエッジを検出する。ここで、エッジは被検物と非被検物の境界点を意味する。なお、輝度画像データA’を用いてエッジを検出することでもよい。   An edge detection unit 208 serving as a feature point detection unit fetches luminance image data B ′ from the memory 205 and detects an edge as a feature point of the test object using the luminance image data B ′. Here, the edge means a boundary point between the test object and the non-test object. Note that the edge may be detected using the luminance image data A ′.

図4は、エッジ検出部208でのエッジ検出処理を説明する図である。   FIG. 4 is a diagram for explaining edge detection processing in the edge detection unit 208.

図4(a)は、輝度画像データB’に対して予め設定されているエッジ検出領域(B’の座標系で、左上頂点を輝度画像(sx,sy)(単位:pix)、右下頂点を(ex,ey)(単位:pix)とする領域)を重畳して表示した画像である。輝度画像データB’には、直方体の被検物10が撮像されている。なお、エッジ検出領域の設定については後述する。以下、エッジ検出部208の動作を説明する。   FIG. 4A shows an edge detection region (B ′ coordinate system preset for the luminance image data B ′, the luminance image (sx, sy) (unit: pix) as the upper left vertex, and the lower right vertex. Is an image displayed by superimposing (ex, ey) (area: pix). A rectangular parallelepiped test object 10 is imaged in the luminance image data B ′. The setting of the edge detection area will be described later. Hereinafter, the operation of the edge detection unit 208 will be described.

1.エッジ検出領域に対して投影処理を施す。投影処理とはエッジ検出方向(本例ではX方向に固定)と垂直な方向に対して濃度の平均値を算出することである。
2.投影処理を行った画像に対して隣接画素との差分を算出する。図4(b)は、エッジ検出領域の画素値の例と投影処理を施した結果、および差分を算出した結果を示した図である。
3.差分値の中から、絶対値が最も大きい2点のX画像座標xl,xr(単位:pix)を抽出する。
4.xl,xrを用いて、エッジ画像位置Pl(xl,(sy+ey)/2)、エッジ画像位置Pr(xr,(sy+ey)/2)を求める。また、py=(sy+ey)/2(単位:pix)とする。
5.エッジ画像位置Pl(xi,py),Pr(xr,py)をメモリ205に記憶する。
1. Projection processing is performed on the edge detection area. The projection processing is to calculate an average density value in a direction perpendicular to the edge detection direction (fixed in the X direction in this example).
2. The difference between adjacent pixels is calculated for the image subjected to the projection process. FIG. 4B is a diagram illustrating an example of pixel values in the edge detection region, a result of performing a projection process, and a result of calculating a difference.
3. Two X image coordinates xl and xr (unit: pix) having the largest absolute value are extracted from the difference values.
4). Using xl and xr, an edge image position Pl (xl, (sy + ey) / 2) and an edge image position Pr (xr, (sy + ey) / 2) are obtained. Further, py = (sy + ey) / 2 (unit: pix).
5. The edge image positions Pl (xi, py) and Pr (xr, py) are stored in the memory 205.

距離算出手段としての寸法計測部209は、メモリ205から特徴点としてのエッジ画像位置Pl,Pr、距離画像データDを取り込み、これらをもとにPl,Pr間の3次元距離(寸法)を計測する。   A dimension measuring unit 209 as a distance calculating unit takes in the edge image positions Pl and Pr and distance image data D as feature points from the memory 205, and measures a three-dimensional distance (dimension) between Pl and Pr based on these. To do.

図5は、寸法計測部209での寸法計測処理を説明する図である。ここで、図5(a)は、距離画像データDとエッジ画像位置Pl,Prを示した図で、距離画像データDは濃淡で高さ方向を表現している。図5(b),(c)は距離画像データのうち、Pr,Plの周辺5x5画素を拡大表示したもので、カメラ中心を原点として、光軸方向をZ軸としたときの、Z軸の値を距離d(cm)として表している。以下、寸法計測部209の動作を説明する。   FIG. 5 is a diagram for explaining dimension measurement processing in the dimension measurement unit 209. Here, FIG. 5A shows the distance image data D and the edge image positions Pl and Pr, and the distance image data D expresses the height direction with shading. FIGS. 5B and 5C are enlarged images of 5 × 5 pixels around Pr and Pl in the distance image data. The Z axis is obtained with the camera center as the origin and the optical axis direction as the Z axis. The value is expressed as a distance d (cm). Hereinafter, the operation of the dimension measuring unit 209 will be described.

1.Plに関する三次元座標Pl3d=(plx,ply,plz)(単位:cm)を求める。
距離画像データDからPlを中心とした5×5の画像(距離データ)を抽出する(図5(b))。その25の距離データのうち、中央値を取得し、それをカメラからPlまでの距離とする。中央値は、最大値あるいは最小値から数えて真ん中の値のことである。図5(b)の例では、24が中央値となる。よって、plz=24(単位:cm)となる。また、plx,plyは距離画像生成部207で用いた焦点距離Fl(単位:cm)を用いて、
plx=plz*(cx−xl)/Fl,ply=plz*(cy−py)/Flで算出できる。なお、距離画像データDの画像中心の座標を(cx,cy)(単位:pix)としている。
2.Prに関する三次元座標Pr3d=(prx,pry,prz)(単位:cm)を求める。
距離画像データDからPrを中心とした5×5の画像(距離データ)を抽出する(図5(c))。その25の距離データのうち、中央値を取得し、それをカメラからPrまでの距離とする。図5(c)の例では、21が中央値となる。よって、prz=21(単位:cm)となる。また、prx,pryは焦点距離Fl(単位:cm)を用いて、
Prx=prz*(cx−xr)/Fl,pry=prz*(cy−py)/Flで算出できる。
3.Pl3d,Pr3d間の距離wid(単位:cm)を求める。
Pl3d,Pr3dをユークリッド距離を用いて算出する。具体的には、
wid=((prx−plx)^2+(pry−ply)^2+(prz−plz)^2)^(1/2))である。ここで、「^」はべき乗を意味する。
4.距離(寸法計測結果)widをメモリ205に記憶する。
1. A three-dimensional coordinate Pl3d = (plx, ply, plz) (unit: cm) for Pl is obtained.
A 5 × 5 image (distance data) centered on Pl is extracted from the distance image data D (FIG. 5B). Among the 25 distance data, a median value is acquired and set as a distance from the camera to Pl. The median is the middle value from the maximum or minimum value. In the example of FIG. 5B, 24 is the median value. Therefore, plz = 24 (unit: cm). In addition, plx and ply use the focal length Fl (unit: cm) used in the distance image generation unit 207,
plx = plz * (cx−xl) / Fl, ply = plz * (cy−py) / Fl. Note that the coordinates of the center of the image of the distance image data D are (cx, cy) (unit: pix).
2. The three-dimensional coordinate Pr3d = (prx, pri, prz) (unit: cm) for Pr is obtained.
A 5 × 5 image (distance data) centering on Pr is extracted from the distance image data D (FIG. 5C). Among the 25 distance data, a median value is acquired and set as a distance from the camera to Pr. In the example of FIG. 5C, 21 is the median value. Therefore, prz = 21 (unit: cm). In addition, prx and py use the focal length Fl (unit: cm),
It can be calculated by Prx = prz * (cx−xr) / Fl, pry = prz * (cy−py) / Fl
3. A distance wid (unit: cm) between Pl3d and Pr3d is obtained.
Pl3d and Pr3d are calculated using the Euclidean distance. In particular,
wid = ((prx-plx) ^ 2 + (try-ply) ^ 2 + (prz-plz) ^ 2) ^ (1/2)). Here, “^” means a power.
4). The distance (size measurement result) wid is stored in the memory 205.

なお、図5では、距離画像データDからPl,Prを中心として5×5の距離データを抽出するとしたが、特に5×5である必要はない(一般にはn×n)。   In FIG. 5, it is assumed that 5 × 5 distance data is extracted from the distance image data D with Pl and Pr as the center, but it is not particularly necessary to be 5 × 5 (generally n × n).

距離判定手段としての寸法判定部210は、メモリ205から距離(寸法計測結果)widを取り込み、該距離(wid)をユーザ閾値(minDist,maxDist)と比較することで、被検物10の合否の判定結果を出力する。ユーザ閾値については後述する。   The dimension determination unit 210 as the distance determination unit takes in a distance (dimension measurement result) wid from the memory 205 and compares the distance (wid) with a user threshold (minDist, maxDist), thereby determining whether the test object 10 is acceptable or not. Output the judgment result. The user threshold will be described later.

具体的には、wid>=minDist かつ wid<=maxDistの場合、判定結果は1(OK)、それ以外は0(NG)となる。   Specifically, if wid> = minDist and wid <= maxDist, the determination result is 1 (OK), otherwise 0 (NG).

寸法判定部210での判定結果は、制御部211を介して、PCI/F203からパソコン300あるいは外部I/F204から外部通信部400に繋がるPLCに出力される。   The determination result in the dimension determination unit 210 is output to the PLC connected from the PCI / F 203 to the personal computer 300 or from the external I / F 204 to the external communication unit 400 via the control unit 211.

以上が処理ユニット200の各モジュールの動作であるが、本実施形態の主要構成はエッジ検出部208、寸法計測部209及び寸法判定部210にある。これらにより距離精度が高くない距離画像データでも安定した寸法判定を行うことができる。ここでは、図5(b)に示したエッジ画像位置Plを中心とした5×5の距離画像データを使って説明する。   The above is the operation of each module of the processing unit 200. The main configuration of the present embodiment is the edge detection unit 208, the dimension measurement unit 209, and the dimension determination unit 210. Accordingly, it is possible to perform stable dimension determination even with distance image data that does not have high distance accuracy. Here, description will be made using 5 × 5 distance image data centered on the edge image position Pl shown in FIG.

エッジ画像位置Plに対応する距離画像データD上の座標は、カメラからの距離を表しているので、5×5の中心の25を取得すれば、カメラからの距離が得られることに成る。しかし、先の説明では、5×5の中央値を取得している。高精度で計測された距離画像が利用できる場合には、中心の25をそのまま利用することができるが、本発明では測距精度が十分でない距離画像データを利用する場合を狙いとしている。   Since the coordinates on the distance image data D corresponding to the edge image position Pl represent the distance from the camera, the distance from the camera can be obtained by obtaining 25 of the 5 × 5 center. However, in the above description, a median value of 5 × 5 is acquired. When a distance image measured with high accuracy can be used, the center 25 can be used as it is, but the present invention aims at using distance image data with insufficient distance measurement accuracy.

測距精度が十分でない距離画像では、エッジ部(背景と被写体の境目)では、値の急激な変化を距離画像上に再現しにくい。例えば以下のような問題が発生する。   In a distance image with insufficient distance measurement accuracy, it is difficult to reproduce an abrupt change in value on the distance image at the edge portion (between the background and the subject). For example, the following problems occur.

Prの周辺画像の距離データ(17,15,20,29,34)(図5(c))のように、エッジ部で急激に距離が変化するべき箇所で、なだらかに値が変化したり、オクルージョンの影響でスパイクノイズが発生したりする。   As shown in the distance data (17, 15, 20, 29, 34) of the peripheral image of Pr (FIG. 5 (c)), the value changes gently at a position where the distance should change abruptly at the edge portion, Spike noise may occur due to occlusion.

そのため、距離画像だけで寸法計測をするためには、上記の影響を画像処理により除去する必要がある。   Therefore, in order to measure the dimensions only with the distance image, it is necessary to remove the above-described influence by image processing.

図3の構成では、エッジ検出部208にて輝度画像データを用いてエッジ位置を特定することで、エッジ部でなだらかに距離画像データが変化する課題を解決し、寸法計測部209にて距離画像データのエッジ部の中央値を取ることでスパイクノイズの影響を軽減している。また、寸法判定部210では寸法計測ではなく寸法判定としている。本手法では前提として測距精度が不十分な距離画像を用いることを前提としているので寸法計測は考慮していない。寸法計測の安定性では、測距精度不十分な距離画像のみで寸法判定した場合と、本手法で寸法判定した場合では、本手法の方が、距離画像のみを用いた手法よりも安定した結果が得られる。   In the configuration of FIG. 3, the edge position is specified by the edge detection unit 208 using the luminance image data, thereby solving the problem that the distance image data changes gently at the edge portion. The influence of spike noise is reduced by taking the median value of the edge of the data. Further, the dimension determination unit 210 performs dimension determination instead of dimension measurement. In this method, since it is assumed that a distance image with insufficient distance measurement accuracy is used as a premise, dimension measurement is not considered. With respect to the stability of dimension measurement, the result of this method is more stable than the method using only the distance image when the size is determined only with a distance image with insufficient distance measurement accuracy and when the size is determined with this method. Is obtained.

次に、本実施形態に係る検査装置の全体を通した動作について説明する。
本検査装置の動作としては、エッジ領域設定動作、寸法判定の閾値設定動作、及び被検物の寸法判定の運用動作が存在する。
Next, the operation of the entire inspection apparatus according to this embodiment will be described.
As operations of the present inspection apparatus, there are an edge region setting operation, a dimension determination threshold setting operation, and an operation operation for determining the dimension of a test object.

制御部211は、状態により動作が異なる。図6に制御部211の遷移状態を示す。初期状態では、撮影状態301にある。エッジ検出領域の設定が完了すると閾値調整状態302に遷移する。そして、判定閾値設定が完了すると、運用状態303に遷移する。なお、初期化(エッジ検出領域および判定閾値の初期化)が行われると、状態は撮影状態301に移る。   The controller 211 operates differently depending on the state. FIG. 6 shows the transition state of the control unit 211. In the initial state, it is in the shooting state 301. When the setting of the edge detection area is completed, the state transitions to the threshold adjustment state 302. When the determination threshold setting is completed, the state transits to the operation state 303. When initialization (initialization of the edge detection region and the determination threshold) is performed, the state moves to the shooting state 301.

図7は、制御ユニット200の各状態における動作フローを示した図である。   FIG. 7 is a diagram illustrating an operation flow in each state of the control unit 200.

図7(a)は、制御部211が撮影状態301のときにトリガーが入力された場合の動作フローである。制御部211はカメラA101,カメラB102に同期して撮影指示を行う(ステップ401)。すると、カメラA101で撮影された画像データ(輝度画像データA)は画像変換部206に転送され、同じくカメラB102で撮影された画像データ(輝度画像データB)は画像変換部206に転送される。そして、画像変換部206で、画素歪み補正及びで平行化された輝度画像データA’、輝度画像データB’が生成される(ステップ402)。制御部211は、このうちの輝度画像データB’をパソコン300へ転送する(ステップ403)。   FIG. 7A is an operation flow when a trigger is input when the control unit 211 is in the shooting state 301. The control unit 211 issues a shooting instruction in synchronization with the cameras A101 and B102 (step 401). Then, image data (luminance image data A) captured by the camera A 101 is transferred to the image conversion unit 206, and image data (luminance image data B) also captured by the camera B 102 is transferred to the image conversion unit 206. Then, the image conversion unit 206 generates luminance image data A ′ and luminance image data B ′ that have been collimated and corrected by pixel distortion (step 402). The control unit 211 transfers the luminance image data B ′ among them to the personal computer 300 (step 403).

パソコン300では、転送された輝度画像データB’を表示部に表示し、これをもとにユーザはエッジ検出領域を設定することになる。   In the personal computer 300, the transferred luminance image data B 'is displayed on the display unit, and based on this, the user sets an edge detection area.

図7(b)は、制御部211が閾値調整状態302のときにトリガーが入力された場合の動作フローである。制御部21はカメラA101,カメラB102に同期して撮影指示を行う(ステップ401)。すると、カメラA101で撮影された画像データ(輝度画像データA)は画像変換部206に転送され、同じくカメラB102で撮影された画像データ(輝度画像データB)も画像変換部206に転送される。そして、画像変換部206で、画像歪み補正及び平行化された輝度画像データA’、輝度画像データB’が生成される(ステップ402)。この輝度画像データA’及び輝度画像データB’が距離画像生成部207に転送され、また、輝度画像データB’はエッジ検出部208にも転送される。距離画像生成部207では、輝度画像データA’と輝度画像データB’を用いて視差画像データCを生成し、視差画像データCから距離画像データDを生成する(ステップ404)。エッジ検出部208では、輝度画像データB’からエッジ画像位置Pl,Prを算出する(ステップ405)。距離画像データD及びエッジ画像位置Pl,Prは寸法計測部209に転送される。寸法計測部209では、エッジ画像位置Pl,Prと距離画像DからPl,Prの三次元座標を求めて2点間の距離(寸法計測結果)widを算出する(ステップ406)。制御部211は、輝度画像データB’と距離(寸法計測結果)widをパソコンに転送する(ステップ407)。   FIG. 7B is an operation flow when a trigger is input when the control unit 211 is in the threshold adjustment state 302. The control unit 21 issues a shooting instruction in synchronization with the cameras A101 and B102 (step 401). Then, image data (luminance image data A) captured by the camera A 101 is transferred to the image conversion unit 206, and image data (luminance image data B) also captured by the camera B 102 is also transferred to the image conversion unit 206. Then, the image conversion unit 206 generates luminance image data A ′ and luminance image data B ′ that have been subjected to image distortion correction and parallelization (step 402). The luminance image data A ′ and the luminance image data B ′ are transferred to the distance image generation unit 207, and the luminance image data B ′ is also transferred to the edge detection unit 208. The distance image generation unit 207 generates the parallax image data C using the luminance image data A ′ and the luminance image data B ′, and generates the distance image data D from the parallax image data C (step 404). The edge detection unit 208 calculates edge image positions Pl and Pr from the luminance image data B ′ (step 405). The distance image data D and the edge image positions Pl and Pr are transferred to the dimension measuring unit 209. The dimension measuring unit 209 calculates the three-dimensional coordinates of Pl and Pr from the edge image positions Pl and Pr and the distance image D, and calculates the distance (dimension measurement result) wid between the two points (step 406). The control unit 211 transfers the luminance image data B ′ and the distance (size measurement result) wid to the personal computer (step 407).

パソコン300では、転送された輝度画像データB’と距離(寸法計測結果)widを表示部に表示し、これをもとにユーザは距離判定(寸法判定)の閾値を設定することになる。   In the personal computer 300, the transferred luminance image data B 'and the distance (dimension measurement result) wid are displayed on the display unit, and based on this, the user sets a threshold value for the distance determination (dimension determination).

図7(c)は、制御部211が運用状態303のときにトリガーが入力された場合の動作フローである。制御部21はカメラA101,カメラB102に同期して撮影指示を行う(ステップ401)。すると、カメラA101で撮影された画像データ(輝度画像データA)は画像変換部206に転送され、同じくカメラB102で撮影された画像データ(輝度画像データB)も画像変換部206に転送される。そして、画像変換部206で、画像歪み補正及び平行化された輝度画像データA’、輝度画像データB’が生成される(ステップ402)。この輝度画像データA’及び輝度画像データB’が距離画像生成部207に転送され、また、輝度画像データB’はエッジ検出部208にも転送される。距離画像生成部207では、輝度画像データA’と輝度画像データB’を用いて視差画像データCを生成し、視差画像データCから距離画像データDを生成する(ステップ404)。エッジ検出部208では、距離画像データB’からエッジ画像位置Pl,Prを算出する(ステップ405)。距離画像データD及びエッジ画像位置Pl,Prは寸法計測部209に転送される。寸法計測部209では、エッジ画像位置Pl,Prと距離画像DからPl,Prの三次元座標を求めて2点間の距離widを算出する(ステップ406)。寸法判定部210では、距離(寸法計測結果)widとユーザ設定値(minDist,maxDist)を入力として判定を行い、判定結果OK/NGを出力する(ステップ408)。そして、制御部211は、良品の登録時には、輝度画像データB’、距離(寸法計測結果)wid、判定結果をパソコン300に転送し、実際の運用時には被検物の判定結果を外部通信部400に送信する(ステップ409)。   FIG. 7C is an operation flow when a trigger is input when the control unit 211 is in the operation state 303. The control unit 21 issues a shooting instruction in synchronization with the cameras A101 and B102 (step 401). Then, image data (luminance image data A) captured by the camera A 101 is transferred to the image conversion unit 206, and image data (luminance image data B) also captured by the camera B 102 is also transferred to the image conversion unit 206. Then, the image conversion unit 206 generates luminance image data A ′ and luminance image data B ′ that have been subjected to image distortion correction and parallelization (step 402). The luminance image data A ′ and the luminance image data B ′ are transferred to the distance image generation unit 207, and the luminance image data B ′ is also transferred to the edge detection unit 208. The distance image generation unit 207 generates the parallax image data C using the luminance image data A ′ and the luminance image data B ′, and generates the distance image data D from the parallax image data C (step 404). The edge detection unit 208 calculates edge image positions Pl and Pr from the distance image data B '(step 405). The distance image data D and the edge image positions Pl and Pr are transferred to the dimension measuring unit 209. The dimension measuring unit 209 calculates the three-dimensional coordinates of Pl and Pr from the edge image positions Pl and Pr and the distance image D, and calculates the distance wid between the two points (step 406). The dimension determination unit 210 performs determination using the distance (dimension measurement result) wid and the user set values (minDist, maxDist) as inputs, and outputs a determination result OK / NG (step 408). The control unit 211 transfers the luminance image data B ′, the distance (dimension measurement result) wid, and the determination result to the personal computer 300 when registering the non-defective product, and transmits the determination result of the test object to the external communication unit 400 during actual operation. (Step 409).

以下に、本実施形態に係る検査装置の具体的動作について説明する。   The specific operation of the inspection apparatus according to the present embodiment will be described below.

図8は、良品を登録する際の全体の動作の流れを示した図であり、網掛けの個所はユーザ操作を示している。図9はパソコン300の表示画面の遷移を示した図である。   FIG. 8 is a diagram showing an overall operation flow when registering a non-defective product, and shaded portions indicate user operations. FIG. 9 is a diagram showing transition of the display screen of the personal computer 300.

まず、ユーザはカメラA101,カメラB102の直下に寸法判定したい被検物10として良品を設置する(ステップ501)。その際、被検物(良品)10がカメラA101およびカメラB102の両方の視野に含まれる位置に設置する(図1)。   First, the user installs a non-defective product as the test object 10 whose dimensions are to be determined immediately below the camera A101 and the camera B102 (step 501). At that time, the test object (non-defective product) 10 is installed at a position included in the field of view of both the camera A101 and the camera B102 (FIG. 1).

良品の設置が終わったら、パソコン300で寸法判定用アプリケーションを起動する。この時、パソコン300の表示画面は図9−Aのようになる。処理ユニット200の制御部211は初期状態の撮影状態301にある。   When the installation of the non-defective product is finished, the dimension determination application is activated on the personal computer 300. At this time, the display screen of the personal computer 300 is as shown in FIG. The control unit 211 of the processing unit 200 is in the initial shooting state 301.

ユーザは撮影開始ボタン602を押下する(ステップ501)。すると、PCI/F203を通して制御部211にトリガーが入力される。その結果、処理ユニット200は図7(a)で示した動作を行い、輝度画像データB’をパソコン300へ出力する(ステップ503)。この時、パソコン300の表示画面は図9−Bのようになる。すなわち、撮影画像表示領域601に輝度画像B’が表示される。ユーザは、エッジ検出領域指定ボタン603を押下した後、マウスなどを用いて、図9−Cに示すように、エッジ検出領域606を設定する(ステップ504)。このエッジ検出領域606の左上頂点、右下頂点の座標が図3(a)の(sx,sy),(ex,ey)に対応する。エッジ検出領域の設定が終了すると、ユーザはエッジ検出領域指定ボタン603を再び押下する(ステップ505)。すると、制御部211は閾値調整状態302に移行する。   The user presses the shooting start button 602 (step 501). Then, a trigger is input to the control unit 211 through the PCI / F 203. As a result, the processing unit 200 performs the operation shown in FIG. 7A and outputs the luminance image data B 'to the personal computer 300 (step 503). At this time, the display screen of the personal computer 300 is as shown in FIG. That is, the luminance image B ′ is displayed in the captured image display area 601. After the user presses the edge detection region designation button 603, the user sets the edge detection region 606 as shown in FIG. 9-C using a mouse or the like (step 504). The coordinates of the upper left vertex and the lower right vertex of the edge detection area 606 correspond to (sx, sy), (ex, ey) in FIG. When the setting of the edge detection area is completed, the user presses the edge detection area designation button 603 again (step 505). Then, the control unit 211 shifts to the threshold adjustment state 302.

次に、ユーザが撮影開始ボタン602を押下すると(ステップ506)、制御部211にトリガーが入力される。その結果、処理ユニット200は図7(b)で示した動作を行い、輝度画像データB’、寸法計測結果(wid)をパソコン300へ出力する(ステップ507)。この時、パソコン300の表示画面は図9−Dのようになる。すなわち、新たに寸法表示バー領域605に寸法計測結果607がバー表示される。ユーザは、閾値調整ボタン604を押下した後、マウスなどを用いて、図9−Eに示すように、寸法判定のユーザ閾値608,609(minDist,maxDist)を設定する。寸法判定の閾値の設定が終了すると、ユーザは閾値調整ボタン604を再び押下する(ステップ509)。すると、制御部211は運用状態303に移行する。   Next, when the user presses the shooting start button 602 (step 506), a trigger is input to the control unit 211. As a result, the processing unit 200 performs the operation shown in FIG. 7B, and outputs the luminance image data B ′ and the dimension measurement result (wid) to the personal computer 300 (step 507). At this time, the display screen of the personal computer 300 is as shown in FIG. That is, the dimension measurement result 607 is newly displayed in a bar in the dimension display bar area 605. After the user presses the threshold adjustment button 604, the user sets dimensional determination user thresholds 608 and 609 (minDist, maxDist) using a mouse or the like as shown in FIG. 9-E. When the setting of the threshold value for dimension determination is completed, the user presses the threshold value adjustment button 604 again (step 509). Then, the control unit 211 shifts to the operation state 303.

ここで、ユーザが撮影開始ボタン602を押下すると(ステップ510)、制御部211にトリガーが入力される。その結果、処理ユニット200は図7(c)で示した動作を行い、輝度画像データB’、寸法計測結果(wid)、判定結果をパソコン300へ出力する(ステップ511)。この時、パソコン300の表示画面は図9−Fのようになる。ここでは、良品が対象のため、「OK」が表示される。   When the user presses the shooting start button 602 (step 510), a trigger is input to the control unit 211. As a result, the processing unit 200 performs the operation shown in FIG. 7C, and outputs the luminance image data B ′, the dimension measurement result (wid), and the determination result to the personal computer 300 (step 511). At this time, the display screen of the personal computer 300 is as shown in FIG. Here, “OK” is displayed because the non-defective product is the target.

以上で良品の登録が完成したことになる。ユーザが設定したエッジ検出領域の座標(sx,sy),(ex,ey)及び寸法判定閾値(minDist,maxDist)はメモリ205に保持される。   This completes the registration of non-defective products. The coordinates (sx, sy), (ex, ey) and dimension determination threshold values (minDist, maxDist) of the edge detection area set by the user are held in the memory 205.

以後、ユーザが被検物10を検査対象の製品に交換し、撮影開始ボタン602を押下することで、制御部211にトリガーが入力される。その結果、処理ユニット200は図7(c)で示した動作を行い、判定結果をパソコン300や外部通信部400に出力する。また、外部通信部400に接続されるPLCから撮影トリガーを入力することで、同様に処理ユニット200は図7(c)で示した動作を行い、外部I/F204、外部通信部400を通して、PLCで判定結果を得ることができる。   Thereafter, when the user replaces the test object 10 with a product to be inspected and presses the imaging start button 602, a trigger is input to the control unit 211. As a result, the processing unit 200 performs the operation shown in FIG. 7C and outputs the determination result to the personal computer 300 and the external communication unit 400. Further, by inputting a shooting trigger from the PLC connected to the external communication unit 400, the processing unit 200 similarly performs the operation shown in FIG. 7C, and the PLC is transmitted through the external I / F 204 and the external communication unit 400. The determination result can be obtained.

次に、ステレオカメラの他の実施例について説明する。図1では、カメラ固定治具100にカメラA101,カメラB102を一定の間隔を持たせてステレオカメラとしたが、このような構成に限る必要はない。   Next, another embodiment of the stereo camera will be described. In FIG. 1, the camera fixing jig 100 is a stereo camera with the camera A101 and the camera B102 spaced apart from each other. However, the present invention is not limited to such a configuration.

図10は、カメラA101とカメラB102の代わりとして使用可能な、2つのカメラが一体となった一体型ステレオカメラの構成例を示した図である。これは、矢印方向に被写体があるものとし、一体型ステレオカメラにより被写体を撮像する構成の断面模式図を示したものである。1001はレンズアレイを表す.レンズアレイは被写体側の面と像面側の面の二面からなり、面内に複数のレンズがアレイ状に配列されている。図10では、被写体側、像側の両方の面にレンズ面が設けられた両面レンズアレイが示されている。1001aは被写体側の面に設けられたレンズ、1001bは像側の面に設けられたレンズであり、1001aと1001bがセットになって被写体の像を像面上で結像させる。1002は、レンズアレイにおける隣接するレンズセット間での光線のクロストーク(混線)を防止するための遮光用の隔壁(遮光壁と呼ぶ)であり、金属や樹脂等の撮像光線に対して不透明な材料からなる。レンズアレイ1001の像側の面と遮光壁とが接着されている。1003は、板状部材に、各レンズセットに対応して円形の孔を設けた開口アレイであり、レンズの絞りとして作用する。レンズアレイ1001の被写体側の面の平面部に設けられた突起部1001cを介して開口アレイ1003とレンズアレイ1001は接着されている。1004は、レンズアレイにおける各レンズセットにより撮像される被写体の像を撮像するCMOSセンサ(撮像素子)であり、基板1005の上に実装されている。1006は筐体であり、レンズアレイ1001の被写体側の面と接着してレンズアレイ1001、遮光壁1002、開口アレイ1003を保持し、基板1005に接着されている。   FIG. 10 is a diagram illustrating a configuration example of an integrated stereo camera in which two cameras that can be used in place of the camera A 101 and the camera B 102 are integrated. This is a cross-sectional schematic diagram of a configuration in which a subject is present in the direction of the arrow and the subject is imaged by an integrated stereo camera. Reference numeral 1001 denotes a lens array. The lens array is composed of two surfaces, a surface on the object side and a surface on the image surface side, and a plurality of lenses are arrayed in the surface. FIG. 10 shows a double-sided lens array in which lens surfaces are provided on both the object side and the image side. Reference numeral 1001a denotes a lens provided on the object-side surface, and reference numeral 1001b denotes a lens provided on the image-side surface, and 1001a and 1001b are set to form an image of the object on the image surface. Reference numeral 1002 denotes a light-shielding partition wall (referred to as a light-shielding wall) for preventing light crosstalk (crosstalk) between adjacent lens sets in the lens array, and is opaque to imaging light such as metal or resin. Made of material. The image side surface of the lens array 1001 and the light shielding wall are bonded. Reference numeral 1003 denotes an aperture array in which a circular hole is provided in a plate-like member corresponding to each lens set, and acts as a lens diaphragm. The aperture array 1003 and the lens array 1001 are bonded to each other through a protrusion 1001c provided on the plane portion of the object-side surface of the lens array 1001. Reference numeral 1004 denotes a CMOS sensor (imaging device) that captures an image of a subject captured by each lens set in the lens array, and is mounted on a substrate 1005. Reference numeral 1006 denotes a housing which holds the lens array 1001, the light shielding wall 1002, and the aperture array 1003 by being bonded to the object side surface of the lens array 1001 and is bonded to the substrate 1005.

図10の構成の一体型ステレオカメラを用いると、レンズアレイ1001と対応した視差を持った画像がCMOSセンサ1004に撮像される。図10の構成によれば、測距精度は低いものの、ステレオカメラを小型化することができる。   When the integrated stereo camera having the configuration shown in FIG. 10 is used, an image having parallax corresponding to the lens array 1001 is captured by the CMOS sensor 1004. According to the configuration of FIG. 10, the stereo camera can be downsized although the distance measurement accuracy is low.

図11は、2つのカメラが一体となった一体型ステレオカメラの他の構成例を示した図である。基本的構成は図10と同じであり、相違点は、CMOSセンサ(撮像素子)が1004a,1004bの2枚からなる構成となっていることである。図11の構成によれば、センサの枚数が増えるので、コストは増加するが、測距精度が向上する利点がある。   FIG. 11 is a diagram showing another configuration example of an integrated stereo camera in which two cameras are integrated. The basic configuration is the same as that in FIG. 10, and the difference is that the CMOS sensor (imaging device) is composed of two pieces 1004a and 1004b. According to the configuration of FIG. 11, the number of sensors increases, which increases the cost, but has the advantage of improving the ranging accuracy.

10 被検物
101A,101B カメラ
200 処理ユニット
201,202 カメラI/F
203 PCI/F
204 外部I/F
205 メモリ
206 画像変換部
207 距離画像生成部
208 エッジ検出部
209 寸法計測部
210 寸法判定部
211 制御部
300 パソコン
400 外部通信部
10 Test object 101A, 101B Camera 200 Processing unit 201, 202 Camera I / F
203 PCI / F
204 External I / F
205 Memory 206 Image Conversion Unit 207 Distance Image Generation Unit 208 Edge Detection Unit 209 Dimension Measurement Unit 210 Dimension Determination Unit 211 Control Unit 300 Personal Computer 400 External Communication Unit

特許第4811272号公報Japanese Patent No. 4811272

Greg Turk and Marc Levoy.Zippered polygonmeshes from range images.In Proc.SIGGRAPH ’94,pp.311-318.ACM,1994.Greg Turk and Marc Levoy. Zippered polygonmeshes from range images. In Proc. SIGGRAPH '94, pp. 311-318. ACM, 1994. Curless,B.,Levoy,M.,A Volumetric Method for Building Complex Models from Range Images,In Proc.SIGGRAPH’96,ACM,1996,pp.303-312.Curless, B., Levoy, M., A Volumetric Method for Building Complex Models from Range Images, In Proc. SIGGRAPH'96, ACM, 1996, pp. 303-312. M.Wheeler,Y.Sato,and K.Ikeuchi,Consensussurfaces for modeling 3D objects from multiplerange images,In Proc.IEEE International Conference on Computer Vision,pp.917-923,Jan,1997.M. Wheeler, Y. Sato, and K. Ikeuchi, Consensussurfaces for modeling 3D objects from multiplerange images, In Proc. IEEE International Conference on Computer Vision, pp. 917-923, Jan, 1997.

Claims (3)

被検物を複数方向から撮影して、視差の異なる複数の画像データを取得する撮影手段と、
前記複数の画像データから距離画像データを生成する距離画像生成手段と、
前記複数の画像データ中の任意の画像データから被検物と非被検物の境界領域の2つの特徴点を検出する特徴点検出手段と、
前記2つの特徴点と前記距離画像データから、前記2つの特徴点の三次元座標を取得し、該2つの三次元座標から、前記2つの特徴点間の距離を算出する距離算出手段と、
前記算出された距離が所定の閾値内であるか否かで被検物の合否を判定する距離判定手段と、を有し、
前記距離算出手段は、前記特徴点検出手段により検出される前記特徴点の座標から、前記三次元座標のxy座標を取得するとともに、前記距離画像データから、前記特徴点を中心とし、かつ、前記被検物と前記非被検物との両方の距離データが含まれるn×nの距離データを抽出して、そのうちの中央値を前記三次元座標のz座標として取得することを特徴とする検査装置。
Imaging means for imaging a test object from a plurality of directions and acquiring a plurality of image data having different parallaxes;
Distance image generation means for generating distance image data from the plurality of image data;
Feature point detection means for detecting two feature points of a boundary region between the test object and the non-test object from any image data in the plurality of image data;
Distance calculating means for obtaining three-dimensional coordinates of the two feature points from the two feature points and the distance image data, and calculating a distance between the two feature points from the two three-dimensional coordinates;
The calculated distance is closed and a distance determination means for acceptance of the test object with whether it is within a predetermined threshold,
The distance calculation means acquires the xy coordinates of the three-dimensional coordinates from the coordinates of the feature points detected by the feature point detection means, and from the distance image data, the feature points as a center, and An inspection characterized in that n × n distance data including distance data of both the test object and the non-test object is extracted, and a median value thereof is obtained as the z coordinate of the three-dimensional coordinates. apparatus.
前記撮影手段で取得された複数の画像データについて画像歪みを補正する画像変換手段を更に有する、ことを特徴とする請求項1に記載の検査装置。 The inspection apparatus according to claim 1, further comprising image conversion means for correcting image distortion for a plurality of image data acquired by the photographing means. 前記撮影手段は、被検物に対向する位置に設けられた、複数のレンズがアレイ配列されてなるレンズアレイと、前記レンズアレイの像面側に設けられた、前記複数のレンズのそれぞれにより略結像される前記被検物の縮小像を撮像する撮像素子とを有する、ことを特徴とする請求項1もしくは2に記載の検査装置。 The imaging means is approximately each of a lens array provided with a plurality of lenses arranged in an array, and a plurality of lenses provided on the image plane side of the lens array. the imaged and an imaging device for imaging a reduced image of the test object, inspection apparatus according to claim 1 or 2, characterized in that.
JP2012078608A 2012-03-30 2012-03-30 Inspection device Expired - Fee Related JP5967470B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012078608A JP5967470B2 (en) 2012-03-30 2012-03-30 Inspection device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012078608A JP5967470B2 (en) 2012-03-30 2012-03-30 Inspection device

Publications (2)

Publication Number Publication Date
JP2013210410A JP2013210410A (en) 2013-10-10
JP5967470B2 true JP5967470B2 (en) 2016-08-10

Family

ID=49528331

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012078608A Expired - Fee Related JP5967470B2 (en) 2012-03-30 2012-03-30 Inspection device

Country Status (1)

Country Link
JP (1) JP5967470B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020179355A (en) * 2019-04-25 2020-11-05 東急建設株式会社 Object sorting system and edge region extraction program

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AT516417B1 (en) * 2014-10-29 2018-10-15 Zkw Group Gmbh Limitation for placing electronic components on a surface

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005283267A (en) * 2004-03-29 2005-10-13 Suzuki Motor Corp Through hole measuring device, method, and program for through hole measurement
JP2009300268A (en) * 2008-06-13 2009-12-24 Nippon Hoso Kyokai <Nhk> Three-dimensional information detection device
JP5214811B2 (en) * 2009-11-13 2013-06-19 富士フイルム株式会社 Ranging device, ranging method, ranging program, ranging system and imaging device
JP5624998B2 (en) * 2009-12-25 2014-11-12 本田技研工業株式会社 Image processing apparatus, image processing method, computer program, and moving body
JP5018980B2 (en) * 2010-04-08 2012-09-05 カシオ計算機株式会社 Imaging apparatus, length measurement method, and program

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020179355A (en) * 2019-04-25 2020-11-05 東急建設株式会社 Object sorting system and edge region extraction program
JP7178954B2 (en) 2019-04-25 2022-11-28 東急建設株式会社 Object sorting system

Also Published As

Publication number Publication date
JP2013210410A (en) 2013-10-10

Similar Documents

Publication Publication Date Title
Luhmann et al. Sensor modelling and camera calibration for close-range photogrammetry
JP6635690B2 (en) Information processing apparatus, information processing method and program
JP6465789B2 (en) Program, apparatus and method for calculating internal parameters of depth camera
JP6176114B2 (en) Projected image automatic correction system, projected image automatic correction method and program
JP6363863B2 (en) Information processing apparatus and information processing method
EP2751521B1 (en) Method and system for alignment of a pattern on a spatial coded slide image
JP2011253376A (en) Image processing device, image processing method and program
JP2013042411A (en) Image processing apparatus, projector and projector system comprising the image processing apparatus, image processing method, program thereof, and recording medium having the program recorded thereon
Zhongdong et al. 3D laser scanner system using high dynamic range imaging
JP2014115109A (en) Device and method for measuring distance
JP2016186421A (en) Image processing method
US10252417B2 (en) Information processing apparatus, method of controlling information processing apparatus, and storage medium
JP2016217833A (en) Image processing system and image processing method
JP2015106287A (en) Calibration device and method
JP2010133751A (en) Shape measuring device and program
JP7489670B2 (en) Correction parameter calculation method, displacement amount calculation method, correction parameter calculation device, and displacement amount calculation device
JP2013041167A (en) Image processing device, projector, projector system, image processing method, program thereof, and recording medium with the program stored therein
CN110349257A (en) A kind of binocular measurement missing point cloud interpolating method based on the mapping of phase puppet
JP2013130566A (en) Lens testing device and method
JPH1079029A (en) Stereoscopic information detecting method and device therefor
JP5967470B2 (en) Inspection device
JP6486083B2 (en) Information processing apparatus, information processing method, and program
JP5336325B2 (en) Image processing method
JP2014041074A (en) Image processing apparatus and inspection apparatus
JP2018044942A (en) Camera parameter calculation device, camera parameter calculation method, program and recording medium

Legal Events

Date Code Title Description
RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20130725

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A821

Effective date: 20130801

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20130801

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20150223

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20151130

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20151204

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20160128

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20160623

R151 Written notification of patent or utility model registration

Ref document number: 5967470

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

LAPS Cancellation because of no payment of annual fees