JP5967470B2 - Inspection device - Google Patents
Inspection device Download PDFInfo
- 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
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.
以下、本発明の実施形態について図面を参照して説明する。なお、実施形態では、撮影手段としてのカメラは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
図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
図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
制御部211は、各モジュールの動作制御を行う。また、制御部211は、各モジュールとの画像データ、その他データ等のやり取り、メモリ205への画像データ、その他データ等の保存/取り出しを行う。メモリ205は、各モジュールで使用する画像データ、パラメータ、ユーザ調整値などを記憶する。
The
カメラAI/F201は、カメラA101とのインターフェースであり、制御部211からの撮影指示や設定データ等をカメラA101に送信すると共に、カメラA101から出力された画像データを介してメモリ205に記憶する。カメラBI/F202は、カメラB102とのインターフェースであり、同じく制御部211からの撮影指示や設定データ等をカメラB102に送信すると共に、カメラB102から出力された画像データをメモリ205に記憶する。ここで、設定データには、自動露出、ホワイトバランス、画像信号モード(グレースケール/YUVカラー/Raw画像等)などが含まれる。なお、画像信号モードはグレースケールとする。したがって、カメラA101,カメラB102からはモノクロの輝度画像データが出力される。
The camera AI /
PCI/F203は、パソコン(PC)300とのインターフェースであり、パソコン300で設定されたユーザ設定値(エッジ検出領域座標、判定閾値等)を受け取り、メモリ205に記憶する。また、PCI/F203は、画像データ、寸法計測結果、判定結果等をパソコン300に送信する。
The PCI /
外部I/F204は、外部通信部400とのインターフェースであり、撮影トリガーを外部通信部400から受け取り、また、処理ユニット200の動作状態や判定結果などを外部通信部400に出力する。
The external I /
画像変換手段としての画像変換部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
なお、カメラA101とカメラB102を予め平行化した状態でカメラ固定治具100に固定することで平行化の処理は省略できる。
Note that the parallelization process can be omitted by fixing the camera A101 and the camera B102 to the
距離画像生成手段としての距離画像生成部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
なお、カメラが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,
特徴点検出手段としてのエッジ検出部208は、メモリ205から輝度画像データB’を取り込み、輝度画像データB’を用いて被検物の特徴点としてのエッジを検出する。ここで、エッジは被検物と非被検物の境界点を意味する。なお、輝度画像データA’を用いてエッジを検出することでもよい。
An
図4は、エッジ検出部208でのエッジ検出処理を説明する図である。
FIG. 4 is a diagram for explaining edge detection processing in the
図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
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
距離算出手段としての寸法計測部209は、メモリ205から特徴点としてのエッジ画像位置Pl,Pr、距離画像データDを取り込み、これらをもとにPl,Pr間の3次元距離(寸法)を計測する。
A
図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
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
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
なお、図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
具体的には、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
以上が処理ユニット200の各モジュールの動作であるが、本実施形態の主要構成はエッジ検出部208、寸法計測部209及び寸法判定部210にある。これらにより距離精度が高くない距離画像データでも安定した寸法判定を行うことができる。ここでは、図5(b)に示したエッジ画像位置Plを中心とした5×5の距離画像データを使って説明する。
The above is the operation of each module of the
エッジ画像位置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
測距精度が十分でない距離画像では、エッジ部(背景と被写体の境目)では、値の急激な変化を距離画像上に再現しにくい。例えば以下のような問題が発生する。 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
次に、本実施形態に係る検査装置の全体を通した動作について説明する。
本検査装置の動作としては、エッジ領域設定動作、寸法判定の閾値設定動作、及び被検物の寸法判定の運用動作が存在する。
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
図7は、制御ユニット200の各状態における動作フローを示した図である。
FIG. 7 is a diagram illustrating an operation flow in each state of the
図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
パソコン300では、転送された輝度画像データB’を表示部に表示し、これをもとにユーザはエッジ検出領域を設定することになる。
In the
図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
パソコン300では、転送された輝度画像データB’と距離(寸法計測結果)widを表示部に表示し、これをもとにユーザは距離判定(寸法判定)の閾値を設定することになる。
In the
図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
以下に、本実施形態に係る検査装置の具体的動作について説明する。 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
まず、ユーザはカメラ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
ユーザは撮影開始ボタン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
次に、ユーザが撮影開始ボタン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
ここで、ユーザが撮影開始ボタン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
以上で良品の登録が完成したことになる。ユーザが設定したエッジ検出領域の座標(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
以後、ユーザが被検物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
次に、ステレオカメラの他の実施例について説明する。図1では、カメラ固定治具100にカメラA101,カメラB102を一定の間隔を持たせてステレオカメラとしたが、このような構成に限る必要はない。
Next, another embodiment of the stereo camera will be described. In FIG. 1, the
図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
図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
図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
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,
203 PCI / F
204 External I / F
205
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.
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)
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)
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)
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 |
-
2012
- 2012-03-30 JP JP2012078608A patent/JP5967470B2/en not_active Expired - Fee Related
Cited By (2)
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 |