JP2014041074A - Image processing apparatus and inspection apparatus - Google Patents

Image processing apparatus and inspection apparatus Download PDF

Info

Publication number
JP2014041074A
JP2014041074A JP2012183859A JP2012183859A JP2014041074A JP 2014041074 A JP2014041074 A JP 2014041074A JP 2012183859 A JP2012183859 A JP 2012183859A JP 2012183859 A JP2012183859 A JP 2012183859A JP 2014041074 A JP2014041074 A JP 2014041074A
Authority
JP
Japan
Prior art keywords
image data
test object
distance image
background
camera
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2012183859A
Other languages
Japanese (ja)
Inventor
Takeshi Maruyama
剛 丸山
Mototsugu Muroi
基継 室井
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 JP2012183859A priority Critical patent/JP2014041074A/en
Publication of JP2014041074A publication Critical patent/JP2014041074A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To provide an image processing apparatus that detects a position of a subject and the amount of rotation at a high speed through simple processing, from image data obtained by imaging the subject, and an inspection apparatus including the image processing apparatus.SOLUTION: An image processing apparatus includes: a distance image generation part 207 that generates distance image data from image data obtained by imaging a subject; a background/subject region separation part 208 that separates the distance image data into a background region and a subject region; and a rotation amount calculation part 209 that calculates a position of the subject and the amount of rotation from the subject region in the distance image data.

Description

本発明は、被検物を撮影して得られた画像データを処理して該被検物の位置及び回転量を検出する画像処理装置、及び、該画像処理装置の処理機能を備えた検査装置に関する。   The present invention relates to an image processing apparatus that processes image data obtained by imaging a test object to detect the position and rotation amount of the test object, and an inspection apparatus having a processing function of the image processing apparatus About.

従来から、被検物を撮影して得られた画像データについて、ハフ変換やテンプレート・マッチングなどを用いて被検物の位置(位置ずれ)や回転量(回転ずれ)を検出する方法が知られている。また、距離画像データを用いて、同様に被検物の位置(位置ずれ)や回転量(回転ずれ)を検出する方法(ICP法)も知られている(例えば、非特許文献1)。しかし、従来の方法は、画像データや距離データの全画面を処理対象領域とするため、演算処理量、演算時間、使用ハードウエア等が増大する問題があった。また、ICP法はアルゴリズムも非常に複雑である。   Conventionally, there is a known method for detecting the position (positional deviation) and rotation amount (rotational deviation) of an object using Hough transform, template matching, or the like for image data obtained by imaging the object. ing. In addition, a method (ICP method) for detecting the position (positional deviation) and rotation amount (rotational deviation) of a test object in the same manner using distance image data is also known (for example, Non-Patent Document 1). However, since the conventional method uses the entire screen of image data and distance data as the processing target area, there is a problem that the calculation processing amount, calculation time, hardware used, and the like increase. Also, the ICP method has a very complicated algorithm.

なお、特許文献1には、テンプレート・マッチングを用いた位置検出法において、画像データ中の特徴点の密度に応じて、テンプレート・マッチングの計算対象領域を限定することで、高速に被検体の位置ずれや回転ずれを検出する技術が記載されているが、特徴点抽出には画像データの全画面を対象とする必要があり、処理の高速化には限界がある。   In Patent Document 1, in the position detection method using template matching, the calculation target region of template matching is limited according to the density of feature points in the image data, so that the position of the subject can be detected at high speed. Although techniques for detecting misalignment and rotational misalignment are described, feature point extraction needs to cover the entire screen of image data, and there is a limit to speeding up the processing.

本発明は、従来技術に比べて、被検物を撮影して得られた画像データから、簡単な処理で、高速に被検物の位置及び回転量を検出する画像処理装置、及び、該画像処理装置の処理機能を備えた検査装置を提供することにある。   The present invention relates to an image processing apparatus that detects the position and rotation amount of a test object at high speed by simple processing from image data obtained by imaging the test object as compared with the prior art, and the image An object of the present invention is to provide an inspection apparatus having a processing function of a processing apparatus.

本発明の画像処理装置は、被検物を撮影して得られた画像データから距離画像データを生成する距離画像生成手段と、前記距離画像データを背景領域と被検物領域とに分離する背景・被検物領域分離手段と、前記距離画像データの被検物領域から、前記被検物の位置・回転量を算出する位置・回転量算出手段とを有することを特徴とする。   The image processing apparatus of the present invention includes distance image generation means for generating distance image data from image data obtained by photographing a test object, and a background for separating the distance image data into a background area and a test object area. A test object region separating unit and a position / rotation amount calculating unit for calculating the position / rotation amount of the test object from the test object region of the distance image data.

また、本発明の検査装置は、被検物を複数方向から撮影して、視差の異なる複数の画像データを取得する撮影手段と、前記複数の画像データから距離画像データを生成する距離画像生成手段と、前記距離画像データを背景領域と被検物領域とに分離する背景及び被検物領域分離手段と、前記距離画像データの被検物領域から、前記被検物の位置及び回転量を算出する位置及び回転量算出手段と、前記算出された被検物の位置及び回転量をあらかじめ定められた閾値と比較して、前記被検物の位置ずれ及び回転ずれを判定する位置ずれ・回転ずれ判定手段とを有することを特徴とする。   In addition, the inspection apparatus of the present invention includes a photographing unit that photographs a test object from a plurality of directions and acquires a plurality of image data having different parallaxes, and a distance image generation unit that generates distance image data from the plurality of image data. A background and test object region separating means for separating the distance image data into a background region and a test object region, and calculating the position and rotation amount of the test object from the test object region of the distance image data Position and rotation amount calculating means, and comparing the calculated position and rotation amount of the test object with a predetermined threshold value to determine the position shift and rotation shift of the test object. And determining means.

本発明によれば、距離画像データを用いて、簡単な処理で、高速に被検物の位置及び回転量を検出することが可能になる。   According to the present invention, it is possible to detect the position and rotation amount of a test object at high speed by simple processing using distance image data.

本発明の一実施形態に係る画像処理装置を含む検査装置の被検物とカメラの設置状態を示した図である。It is the figure which showed the installation state of the to-be-tested object and camera of the inspection apparatus containing the image processing apparatus which concerns on one Embodiment of this invention. 本実施形態に係る検査装置のシステム構成図である。It is a system configuration figure of the inspection device concerning this embodiment. パタン投影部によるランダムパタン例を示す図である。It is a figure which shows the example of the random pattern by a pattern projection part. 図2における処理ユニットの構成例を示す詳細ブロック図である。FIG. 3 is a detailed block diagram illustrating a configuration example of a processing unit in FIG. 2. 背景距離画像データの具体例を示す図である。It is a figure which shows the specific example of background distance image data. 距離画像データと背景・被検物領域分離の具体例を示す図である。It is a figure which shows the specific example of distance image data and background / test object area | region separation. 距離画像データと背景・被検物領域分離の別の具体例を示す図である。It is a figure which shows another specific example of distance image data and a background and test object area | region separation. 図6の場合の距離画像データの座標を表わした図である。It is a figure showing the coordinate of the distance image data in the case of FIG. 図7の場合の距離画像データの座標を表わした図である。It is a figure showing the coordinate of the distance image data in the case of FIG. 図4の制御部の状態遷移を表わした図である。It is a figure showing the state transition of the control part of FIG. 図10の各状態での処理ユニットの動作フローを示す図である。It is a figure which shows the operation | movement flow of the processing unit 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 display screen of the personal computer in a background photography state. 閾値調整状態でのパソコンの表示画面を示す図である。It is a figure which shows the display screen of the personal computer in a threshold value adjustment state. 閾値調整設定時のパソコンの表示画面を示す図である。It is a figure which shows the display screen of the personal computer at the time of threshold value adjustment setting. 運用状態でのパソコンの表示画面を示す図である。It is a figure which shows the display screen of the personal computer in an operation state. 一体型ステレオカメラの一実施例を示す図である。It is a figure which shows one Example of an integrated stereo camera. 一体型ステレオカメラの別の実施例を示す図である。It is a figure which shows another 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, the object to be imaged is captured by a stereo camera including two cameras as imaging means, two image data having different viewpoints are acquired for the object, and distance image data is obtained from the two image data. Is generated, and the distance image data is separated into a background area and a test object area, and the position and rotation amount of the test object are calculated by calculating the center of gravity and moment of the test object area.

図1は、本実施形態に係る検査装置(画像処理装置を含む)の被検物とカメラの設置状態の一例を示した図である。図1において、撮像手段であるカメラA101とカメラB102は、一定の間隔で、且つ、両者の光軸が平行になるように、カメラ固定治具100に固定されている。このカメラA101、カメラB102がステレオカメラを構成し、カメラA101がステレオカメラの左目、カメラB102が右目に相当する。さらに、カメラ固定治具100には、パタン投影部103が固定されている。カメラ固定治具100は支持台110に固定されている。該支持台110に取り付けられたカメラ固定治具100と該支持台110の設置面112とは平行になるよう構成されている。その結果、カメラA101、カメラB102及びパタン投影部103は鉛直下向きに設置される。支持台110の設置面112上の、カメラA101、カメラB102、パタン投影部103と対向する位置に、被検物10が載置される。ここで、被検物の形状は直方体とする。   FIG. 1 is a diagram illustrating an example of an installation state of a test object and a camera of an inspection apparatus (including an image processing apparatus) according to the present embodiment. In FIG. 1, a camera A101 and a camera B102, which are image pickup means, are fixed to a camera fixing jig 100 at a constant interval and so that their optical axes are parallel to each other. The camera A101 and camera B102 constitute a stereo camera, the camera A101 corresponds to the left eye of the stereo camera, and the camera B102 corresponds to the right eye. Further, the pattern projection unit 103 is fixed to the camera fixing jig 100. 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, the camera B102, and the pattern projection unit 103 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 A 101, the camera B 102, and the pattern projection unit 103. Here, the shape of the test object is a rectangular parallelepiped.

図2は、本実施形態に係る検査装置の全体的システム構成図である。カメラ固定治具100に固定されたカメラA101、カメラB102は、それぞれ設置面112の背景及び被検物10を撮影し、その光学像をアナログ電気信号に変換し、さらにデジタル信号に変換して画像データを出力する。例えば、画像データは8ビット/画素からなり、0〜255階調(輝度値)をとる。   FIG. 2 is an overall system configuration diagram of the inspection apparatus according to the present embodiment. Cameras A101 and B102 fixed to the camera fixing jig 100 take images of the background of the installation surface 112 and the test object 10, respectively, convert the optical image into an analog electric signal, and further convert it into a digital signal. Output data. For example, the image data consists of 8 bits / pixel and takes 0 to 255 gradations (luminance values).

パタン投影部103は、被検物10及びその周辺をランダムパタンで照射して、後述のカメラA101、カメラB102によるステレオ画像を利用した測距演算が安定に行えるようにする。このパタン投影部103は、図3のように、カメラA101、カメラB102のステレオカメラ測距領域より広い領域にランダムパタンを照射するようにする。なお、模様などの付いた被写体を撮影して測距演算を行うなど、測距演算が安定に行える場合には、パタン投影部103は使用しなくてもよい。   The pattern projection unit 103 irradiates the test object 10 and its surroundings with a random pattern so that distance calculation using a stereo image by a camera A101 and a camera B102 described later can be stably performed. As shown in FIG. 3, the pattern projection unit 103 irradiates a random pattern to a region wider than the stereo camera ranging region of the camera A 101 and the camera B 102. Note that the pattern projection unit 103 does not have to be used when ranging calculation can be performed stably, such as by shooting a subject with a pattern or the like to perform ranging calculation.

処理ユニット200は、カメラA101及びカメラB102の撮影を制御すると共に、カメラA101及びカメラB102から出力される画像データを取り込んで、該画像データから被検物10の位置及び回転量を算出し、位置ずれ及び回転ずれを判定するための種々の処理、主に画像処理を行う処理基板である。   The processing unit 200 controls the photographing of the camera A101 and the camera B102, takes in the image data output from the camera A101 and the camera B102, calculates the position and rotation amount of the test object 10 from the image data, It is a processing substrate that performs various processes for determining misalignment and rotational misalignment, mainly image processing.

この処理ユニット200には、パソコン(PC)300及び外部通信部400が接続されている。   A personal computer (PC) 300 and an external communication unit 400 are connected to the processing unit 200.

パソコン300は、処理ユニット200に対して、該処理ユニット200での処理のためのパラメータの指定やその他の指示を行うと共に、処理ユニット200から画像データや、計算結果、判定結果などを受信して表示する。すなわち、パソコン300はユーザインタフェース手段として機能する。なお、パソコン300の代わりに、タッチパネル等の操作部を使用し、処理ユニット200と一体的に構成することでもよい。   The personal computer 300 designates parameters for processing in the processing unit 200 and other instructions to the processing unit 200 and receives image data, calculation results, determination results, and the like from the processing unit 200. indicate. That is, the personal computer 300 functions as user interface means. Note that an operation unit such as a touch panel may be used instead of the personal computer 300, and the processing unit 200 may be configured integrally.

外部通信部400は、一般にPLC(Programmable Logic Controller)と接続される。該外部通信部400は、例えば、撮影トリガーを処理ユニット200に与える、処理ユニット200の動作状態を監視する、処理ユニット200から判定結果を受け取る、などが可能である。   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.

図4は、本実施形態に係る処理ユニット200の詳細構成を示すブロック図である。本処理ユニット200は、カメラAインターフェース(I/F)201、カメラBI/F202、PCI/F203、外部I/F204、メモリ205、画像変換部206、距離画像生成部207、背景・被検物分離部208、位置・回転量算出部209、位置ずれ・回転ずれ判定部210、及び制御部211等のモジュールからなり、これら各モジュールはバス212で接続されている。ここで、画像変換部206、距離画像生成部207、背景・被検物分離部208及び位置・回転量検出部209が本発明に係る画像処理装置として機能する。   FIG. 4 is a block diagram illustrating a detailed configuration 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 206, a distance image generation unit 207, a background / test object separation. Module 208, position / rotation amount calculation unit 209, position shift / rotation shift determination unit 210, and control unit 211. These modules are connected by a bus 212. Here, the image conversion unit 206, the distance image generation unit 207, the background / test object separation unit 208, and the position / rotation amount detection unit 209 function as an image processing apparatus according to the present invention.

制御部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 setting 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, transmits a shooting instruction, setting data, and the like from the control unit 211 to the camera A 101, and captures image data output from the camera A 101 and stores it in the memory 205. The camera BI / F 202 is an interface with the camera B102. Similarly, the camera BI / F 202 transmits shooting instructions, setting data, and the like from the control unit 211 to the camera B102, and captures 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 a user setting value (positional deviation / rotational deviation determination threshold) set in the personal computer 300, and stores it in the memory 205. The PCI / F 203 transmits image data, position / rotation calculation results, determination results, 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に記載の手法を用いるとよい。   The image conversion unit 206 takes in the image data captured by the camera A 101 (hereinafter referred to as luminance image data A) and the image data captured by the camera B 102 (hereinafter referred to as luminance image data B) from the memory 205, and performs image distortion. Correct. 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. For example, as a distortion correction method, “A flexible new technique for camera calibration”. IEEE Transactions on Pattern Analysis and Machine Intelligence, 22 (11): 1330-1334, 2000, a parallelization method is Fusiello A, Trucco E and Verri A: A compact algorithm for rectification of stereo pairs. The method described in Machine Vision and Applications: 16-22, 2000 may 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 where the camera A101 and the camera B102 are parallelized in advance.

距離画像生成部207は、メモリ205から、平行化された輝度画像データA’と輝度画像データB’を取り込み、この2つの輝度画像データA’,B’を用いて、ブロックマッチングを行い、視差画像データCを生成する。視差画像データCは各画素毎に生成する。そして、視差画像データCから距離画像データDを作成する。距離画像データDは、視差画像データCの各視差値pについて、カメラA101、カメラB102の焦点距離をF1、基線長(カメラA101、カメラB102の光軸間の距離)をB1として、各画素毎に、d=Fl*Bl/pの式を利用して、距離値dを計算することによって得られる。距離画像生成部207は、生成した距離画像データDをメモリ205に記憶する。   The distance image generation unit 207 takes in the parallel luminance image data A ′ and luminance image data B ′ from the memory 205, performs block matching using the two luminance image data A ′ and B ′, and performs parallax. Image data C is generated. The parallax image data C is generated for each pixel. Then, distance image data D is created from the parallax image data C. For each parallax value p of the parallax image data C, the distance image data D is for each pixel, with the focal lengths of the cameras A101 and B102 being F1, and the base length (distance between the optical axes of the cameras A101 and B102) being B1. Further, the distance value d is obtained by using the formula d = Fl * Bl / p. The distance image generation unit 207 stores the generated distance image data D in the memory 205.

なお、カメラが3つ以上の場合には複数の距離画像データが得られるため、各距離画像データをマージングして一つの距離画像データにする必要がある。これには従来から知られている手法を用いてればよい(例えば、非特許文献2〜4)。さらに、距離画像データを生成できればステレオカメラ方式でなくてもよく、例えば、光切断法やパタン投影法を使用して距離画像データを生成してもよい。   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 2 to 4). Furthermore, if the distance image data can be generated, the stereo camera method may not be used. For example, the distance image data may be generated using a light cutting method or a pattern projection method.

本実施形態では、まず、被検物10が設置面112に設置されない状態での、カメラA101、カメラB102が該設置面112(背景)を撮影して得られた輝度画像データA’と輝度画像データB’から距離画像データ(以下、背景距離画像データD1と称す)を生成してメモリ205に記憶しておく。次に、被検物10が設置面112に設置された場合の、カメラA101、カメラB102が該被検物10及び設置面112を撮影して得られた輝度画像データA’と輝度画像データB’から距離画像データ(以下、距離画像データD2と称す)を生成してメモリ205に記憶する。   In the present embodiment, first, luminance image data A ′ and luminance image obtained by the camera A 101 and the camera B 102 photographing the installation surface 112 (background) in a state where the test object 10 is not installed on the installation surface 112. Distance image data (hereinafter referred to as background distance image data D1) is generated from the data B ′ and stored in the memory 205. Next, when the test object 10 is installed on the installation surface 112, the luminance image data A ′ and the luminance image data B obtained by the camera A101 and the camera B102 photographing the test object 10 and the installation surface 112 are displayed. The distance image data (hereinafter referred to as distance image data D2) is generated from 'and stored in the memory 205.

背景・被検物分離部208は、メモリ205から背景距離画像データD1及び距離画像データD2を取り込み、両者の距離値を比較して、距離画像データD2を背景領域と被検物領域とに分離する。具体的には、背景・被検物分離部208では、各画素毎に、背景距離画像データD1の距離値と距離画像データD2の距離値を比較して、距離値の差の絶対値が所定値の閾値以上の画素を被検物領域、それ以外の画素を背景領域と分離する。   The background / test object separation unit 208 takes the background distance image data D1 and the distance image data D2 from the memory 205, compares the distance values of the two, and separates the distance image data D2 into a background area and a test object area. To do. Specifically, the background / test object separation unit 208 compares the distance value of the background distance image data D1 and the distance value of the distance image data D2 for each pixel, and the absolute value of the difference between the distance values is predetermined. Pixels that are equal to or greater than the threshold value are separated from the test object region, and other pixels are separated from the background region.

図5乃至図7は、背景・被検物分離部208での背景・被検物領域分離処理を説明する図である。ここでは、カメラA101、カメラB102から設置面112までの距離は100mmであるとする。また、被検物10は、高さが20mmの直方体とする。   FIG. 5 to FIG. 7 are diagrams for explaining the background / test object region separation processing in the background / test object separation unit 208. Here, it is assumed that the distances from the camera A101 and the camera B102 to the installation surface 112 are 100 mm. Further, the test object 10 is a rectangular parallelepiped having a height of 20 mm.

図5(a)は、被検物10が設置面112に設置されない場合の、カメラB102による輝度画像データB’である。すなわち、輝度画像データB’は白紙である。カメラA101の輝度画像データA’も同様である(不図)。実際には、輝度画像データにはパタン投影部103によるランダムパタンが反映されるが、図面の簡単化のために省略する。これは、図6(a)及び図7(a)についても同様とする。   FIG. 5A shows luminance image data B ′ obtained by the camera B102 when the test object 10 is not installed on the installation surface 112. FIG. That is, the luminance image data B ′ is a blank sheet. The same applies to the luminance image data A ′ of the camera A101 (not shown). Actually, the luminance image data reflects a random pattern by the pattern projection unit 103, which is omitted for simplification of the drawing. The same applies to FIGS. 6A and 7A.

図5(b)は、図5(a)の被検物10が設置面112に設置されない場合について、カメラA101とカメラB102による輝度画像データA’及び輝度画像データB’から生成された背景距離画像データD1を示したものである。ここで、各升は画素を表わし、升内の数値は距離値(mm)を表わしている。   FIG. 5B shows a background distance generated from the luminance image data A ′ and the luminance image data B ′ by the cameras A 101 and B 102 when the test object 10 of FIG. 5A is not installed on the installation surface 112. The image data D1 is shown. Here, each 升 represents a pixel, and the numerical value in 升 represents a distance value (mm).

図6(a)は、被検物10が設置面112に設置された場合の、カメラB102による輝度画像データB’の一例である。カメラA101の輝度画像データA’も同様である(不図)。図6(b)は、図6(a)の場合について、カメラA101とカメラB102による輝度画像データA’及び輝度画像データB’から生成された距離画像データD1である。   FIG. 6A is an example of luminance image data B ′ obtained by the camera B102 when the test object 10 is installed on the installation surface 112. FIG. The same applies to the luminance image data A ′ of the camera A101 (not shown). FIG. 6B shows distance image data D1 generated from the luminance image data A ′ and the luminance image data B ′ by the camera A 101 and the camera B 102 in the case of FIG. 6A.

同様に、図7(a)は、被検物10が設置面112に設置された場合の、カメラB102による輝度画像データB’の別の例である。カメラA101の輝度画像データA’も同様である(不図)。図7(b)は、図7(a)の場合について、カメラA101とカメラB102による輝度画像データA’及び輝度画像データB’から生成された距離画像データD1である。   Similarly, FIG. 7A is another example of the luminance image data B ′ obtained by the camera B102 when the test object 10 is installed on the installation surface 112. FIG. The same applies to the luminance image data A ′ of the camera A101 (not shown). FIG. 7B shows the distance image data D1 generated from the luminance image data A ′ and the luminance image data B ′ by the camera A 101 and the camera B 102 in the case of FIG. 7A.

背景・被検物分離部20は、各画素毎に、背景距離画像データD1(図5(b))の距離値と距離画像データD2(図6(b)、図7(b))の距離値を比較して、距離画像データD2中の、距離値の差の絶対値が所定の閾値以上の画素を被検物領域、それ以外の画素を背景領域とする。ここでは、閾値を10とする。この結果、図6(b)の距離画像データD2は、図6(c)に示すように、被検物領域と背景領域に分離される。同様に、図7(b)の距離画像データD2は、図7(c)に示すように、被検物領域と背景領域に分離される。図6(c)及び図7(c)において、網掛けした部分が被検物領域を表わしている。   For each pixel, the background / test object separation unit 20 determines the distance between the distance value of the background distance image data D1 (FIG. 5 (b)) and the distance image data D2 (FIG. 6 (b), FIG. 7 (b)). By comparing the values, pixels in the distance image data D2 whose absolute value of the difference between the distance values is equal to or larger than a predetermined threshold are set as the test object region, and other pixels are set as the background region. Here, the threshold value is 10. As a result, the distance image data D2 in FIG. 6B is separated into the test object region and the background region as shown in FIG. 6C. Similarly, the distance image data D2 in FIG. 7B is separated into a test object region and a background region as shown in FIG. 7C. In FIG. 6 (c) and FIG. 7 (c), the shaded portion represents the specimen region.

なお、本実施形態では、背景距離画像データと距離画像データを使用して、距離画像データを背景領域と被検物領域に分離したが、距離画像データの各画素について、当該距離値が所定の閾値以下の画素を被検物領域、それ以外の画素を背景領域と分離することでもよい。例えば、図6(b)及び図7(b)の場合、閾値を85とすることで、図6(c)及び図7(c)に示したように分離することができる。   In the present embodiment, the distance image data is separated into the background area and the test object area using the background distance image data and the distance image data. However, for each pixel of the distance image data, the distance value is a predetermined value. The pixels below the threshold may be separated from the test object region, and the other pixels may be separated from the background region. For example, in the case of FIG. 6B and FIG. 7B, by setting the threshold value to 85, separation can be performed as shown in FIG. 6C and FIG. 7C.

位置・回転量算出部209は、背景・被検物分離部208で分離された距離画像データD2の被検物領域についてモーメントM00,M10,M01,M11,M20,M02を計算し、該モーメントを利用して被検物10の位置X,Y、及び、回転量Θを算出する。 The position / rotation amount calculation unit 209 calculates moments M 00 , M 10 , M 01 , M 11 , M 20 , M 02 for the test object region of the distance image data D 2 separated by the background / test object separation unit 208. The position X and Y of the test object 10 and the rotation amount Θ are calculated using the moment.

ここで、モーメントM00,M10,M01,M11,M20,M02の計算には、次式(1)を用いる。 Here, the following formula (1) is used to calculate the moments M 00 , M 10 , M 01 , M 11 , M 20 , M 02 .

x,yは距離画像データD2の座標である。src(x,y)は、座標(x,y)が被検物領域である場合には1、背景領域である場合は0を表わす画像配列である。 x and y are the coordinates of the distance image data D2. src (x, y) is an image array that represents 1 when the coordinate (x, y) is the test object region, and 0 when the coordinate (x, y) is the background region.

モーメントM00,M10,M01,M11,M20,M02から、被検物10の位置(重心位置)X,Y、回転量Θは次のようにして算出する。 From the moments M 00 , M 10 , M 01 , M 11 , M 20 , M 02 , the position (center of gravity position) X, Y and the rotation amount Θ of the test object 10 are calculated as follows.

なお、μ20=μ02の時は、回転量Θは0とする。 When μ 20 = μ 02 , the rotation amount Θ is 0.

図8は、図6の場合(被検物が水平に配置されている場合)について距離画像データD2の座標を表わしたものである。図8において、網掛けした部分が被検物領域、網掛けしない部分が背景領域である。式(1)より、図8では、M00=30,M10=105,M01=120,M11=420,M20=455,M02=540となる。これにより、被検物10の位置X,Yは、X≒3.5,Y≒4.0、回転量ΘはΘ=0と算出される。 FIG. 8 shows the coordinates of the distance image data D2 in the case of FIG. 6 (when the test object is arranged horizontally). In FIG. 8, the shaded portion is the test object region, and the non-shaded portion is the background region. From equation (1), in FIG. 8, M 00 = 30, M 10 = 105, M 01 = 120, M 11 = 420, M 20 = 455, M 02 = 540. Thereby, the positions X and Y of the test object 10 are calculated as X≈3.5, Y≈4.0, and the rotation amount Θ is calculated as Θ = 0.

図9は、図7の場合(被検物が傾いて配置されている場合)について距離画像データD2の座標を表わしたものである。図9において、網掛けした部分が被検物領域、網掛けしない部分が背景領域である。式(1)より、図9では、M00=28,M10=129,M01=118,M11=556,M20=706,M02=562となる。これにより、被検物10の位置X,Yは、X≒4.6,Y≒4.2、回転量ΘはΘ≒27.6と算出される。 FIG. 9 shows the coordinates of the distance image data D2 in the case of FIG. 7 (when the test object is tilted). In FIG. 9, the shaded portion is the test object region, and the non-shaded portion is the background region. From equation (1), in FIG. 9, M 00 = 28, M 10 = 129, M 01 = 118, M 11 = 556, M 20 = 706, M 02 = 562. Thus, the positions X and Y of the test object 10 are calculated as X≈4.6, Y≈4.2, and the rotation amount Θ is calculated as Θ≈27.6.

なお、式(1)において、距離画像データの背景領域ではsrc(x,y)=0である。したがって、モーメントM00,M10,M01,M11,M20,M02の計算では、距離画像データの被検物領域の座標について(図8、図9の網掛け部分)、式(1)を計算すればよい。これにより、演算処理量、演算時間が短縮される。 In equation (1), src (x, y) = 0 in the background area of the distance image data. Therefore, in the calculation of the moments M 00 , M 10 , M 01 , M 11 , M 20 , M 02 , the coordinates of the test object region of the distance image data (shaded portions in FIGS. 8 and 9) are expressed as ). Thereby, the calculation processing amount and the calculation time are shortened.

位置ずれ・回転ずれ判定部210は、位置・回転量算出部209で算出された被検物10の位置X,Y、回転量Θについて、あらかじめ定めた閾値(minX,maxX,minY,maxY,minΘ,maxΘ)と比較することで、被検物10の位置・回転ずれを判定する。すなわち、被検物が正常に置かれているか否か判定する。具体的には、minX≦X≦maxXかつminY≦Y≦maxYかつminΘ≦Θ≦maxΘの場合は、判定結果は1(OK)、それ以外は0(NG)となる。   The position deviation / rotation deviation determination unit 210 determines a predetermined threshold (minX, maxX, minY, maxY, minΘ) for the position X, Y and the rotation amount Θ of the test object 10 calculated by the position / rotation amount calculation unit 209. , MaxΘ), the position / rotational deviation of the test object 10 is determined. That is, it is determined whether or not the test object is placed normally. Specifically, if minX ≦ X ≦ maxX, minY ≦ Y ≦ maxY, and minΘ ≦ Θ ≦ maxΘ, the determination result is 1 (OK), otherwise 0 (NG).

位置ずれ・回転ずれ部210での判定結果は、制御部211を介して、PCI/F203からパソコン300あるいは外部I/F204から外部通信部400に繋がるPLCに出力される。   The determination result in the positional deviation / rotation deviation unit 210 is output via the control unit 211 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.

制御部211は、状態により動作が異なる。図10に制御部211の遷移状態を示す。初期状態では、背景撮影状態1001にある。背景撮影登録が完了すると閾値調整状態1002に遷移する。そして判定閾値設定が完了すると、運用状態1003に遷移する。なお、初期化(距離画像や判定閾値の初期化)が行われると、状態は撮影状態1001に移る。   The controller 211 operates differently depending on the state. FIG. 10 shows the transition state of the control unit 211. In the initial state, it is in the background photographing state 1001. When the background shooting registration is completed, the state transitions to the threshold adjustment state 1002. When the determination threshold setting is completed, the operation state 1003 is transitioned to. Note that when initialization (initialization of a distance image and a determination threshold) is performed, the state moves to a shooting state 1001.

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

図11(a)は、制御部211が背景撮影状態1001のときにトリガーが入力された場合の動作フローである。背景撮影状態1001では、まだ、被検物10は設置面112に設置されない。   FIG. 11A is an operation flow when a trigger is input when the control unit 211 is in the background shooting state 1001. In the background photographing state 1001, the test object 10 is not yet installed on the installation surface 112.

制御部211はカメラA101,カメラB102に同期して撮影指示を行う(ステップ1101)。すると、カメラA101で撮影された背景画像の画像データ(輝度画像データA)が画像変換部206に転送され、同じくカメラB102で撮影された背景画像の画像データ(輝度画像データB)が画像変換部206に転送される。そして、画像変換部206にて、画素歪み補正及びで平行化された輝度画像データA’、輝度画像データB’が生成される(ステップ1102)。この輝度画像データA’および輝度画像データB’は距離画像生成部207に転送される。距離画像生成部207では、輝度画像データA’と輝度画像データB’を用いて視差画像データCを生成し、視差画像データCから距離画像データDを生成する(ステップ1103)。ここでは、背景距離画像データD1が生成される。制御部211は、背景距離画像データD1をメモリ205に保存すると共に、輝度画像データB’(背景輝度画像)をパソコン300へ転送する(ステップ1104)。なお、制御部211は、輝度画像データA’をパソコン300へ転送することでもよい。要は、ユーザにとって背景画像であることかわかればよい。   The control unit 211 issues a shooting instruction in synchronization with the cameras A101 and B102 (step 1101). Then, the image data (luminance image data A) of the background image captured by the camera A101 is transferred to the image conversion unit 206, and the image data (luminance image data B) of the background image captured by the camera B102 is also converted into the image conversion unit. 206. Then, the image conversion unit 206 generates luminance image data A ′ and luminance image data B ′ that have been made parallel by pixel distortion correction (step 1102). The luminance image data A ′ and the luminance image data B ′ are transferred to the distance image generation unit 207. 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 1103). Here, background distance image data D1 is generated. The control unit 211 stores the background distance image data D1 in the memory 205 and transfers the luminance image data B ′ (background luminance image) to the personal computer 300 (step 1104). Note that the control unit 211 may transfer the luminance image data A ′ to the personal computer 300. In short, it is only necessary to know that it is a background image for the user.

図7(b)は、制御部211が閾値調整状態1002のときにトリガーが入力された場合の動作フローである。閾値調整状態1002では、位置ずれ・回転ずれ判定対象の被検物(モデル製品)10が設置面112に正しく設置される。   FIG. 7B is an operation flow when a trigger is input when the control unit 211 is in the threshold adjustment state 1002. In the threshold adjustment state 1002, the test object (model product) 10 to be subjected to the positional deviation / rotational deviation determination is correctly installed on the installation surface 112.

制御部211はカメラA101,カメラB102に同期して撮影指示を行う(ステップ1101)。すると、カメラA101で撮影された被検物画像の画像データ(輝度画像データA)が画像変換部206に転送され、同じくカメラB102で撮影された被検物画像の画像データ(輝度画像データB)が画像変換部206に転送される。そして、画像変換部206にて、画素歪み補正及びで平行化された輝度画像データA’、輝度画像データB’が生成される(ステップ1102)。この輝度画像データA’および輝度画像データB’は距離画像生成部207に転送される。距離画像生成部207では、輝度画像データA’と輝度画像データB’を用いて視差画像データCを生成し、視差画像データCから距離画像データDを生成する(ステップ1103)。ここでは、距離画像データD2が生成される。この距離画像データD2は背景・被検物分離部208に転送される。また、メモリ205に保存されている背景距離画像データD1も背景・被検物分離部208に転送される。背景・被検物分離部208では、背景距離画像データD1と距離画像データD2を比較して、距離画像データD2を背景領域と被検物領域に分離する(ステップ1105)。この分離結果は、位置・回転量算出部209に転送される。位置・回転量算出部209では、距離画像データD2の被検物領域のモーメントを計算し、このモーメントから被検物(モデル製品)10の位置X,Y、及び回転量Θを算出する(ステップ1106)。制御部211は、輝度画像データB’、及び位置X,Y、回転量Θの情報をパソコン300へ転送する(ステップ1107)。この場合も、輝度画像データ(被検物輝度画像)としては輝度画像データA’をパソコン300へ転送することでもよい。要は、ユーザにとって被検物画像の位置・回転状況がわかればよい。   The control unit 211 issues a shooting instruction in synchronization with the cameras A101 and B102 (step 1101). Then, image data (luminance image data A) of the test object image captured by the camera A101 is transferred to the image conversion unit 206, and image data (luminance image data B) of the test object image also captured by the camera B102. 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 made parallel by pixel distortion correction (step 1102). The luminance image data A ′ and the luminance image data B ′ are transferred to the distance image generation unit 207. 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 1103). Here, distance image data D2 is generated. The distance image data D2 is transferred to the background / test object separation unit 208. Further, the background distance image data D1 stored in the memory 205 is also transferred to the background / test object separation unit 208. The background / test object separation unit 208 compares the background distance image data D1 and the distance image data D2, and separates the distance image data D2 into a background area and a test object area (step 1105). This separation result is transferred to the position / rotation amount calculation unit 209. The position / rotation amount calculation unit 209 calculates the moment of the object area of the distance image data D2, and calculates the position X, Y of the object (model product) 10 and the rotation amount Θ from this moment (step) 1106). The control unit 211 transfers the luminance image data B ′, information about the positions X and Y, and the rotation amount Θ to the personal computer 300 (step 1107). Also in this case, the luminance image data A ′ may be transferred to the personal computer 300 as the luminance image data (test object luminance image). In short, it is only necessary for the user to know the position / rotation state of the test object image.

パソコン300では、転送された輝度画像データB’、位置X,Y、回転量Θの情報を表示部に表示する。これをもとに、ユーザは判定閾値(minX,maxX,minY,maxY,minΘ,maxΘ)を設定入力する。パソコン300は、この設定入力された判定閾値を処理ユニット200に転送し、処理ユニット200の制御部211は、転送された判定閾値をメモリ205に保持する。   The personal computer 300 displays the transferred luminance image data B ′, position X, Y, and rotation amount Θ information on the display unit. Based on this, the user sets and inputs determination threshold values (minX, maxX, minY, maxY, minΘ, maxΘ). The personal computer 300 transfers the setting threshold value input to the processing unit 200, and the control unit 211 of the processing unit 200 holds the transferred determination threshold value in the memory 205.

図11(c)は、制御部211が運用状態1003の時にトリガーが入力された場合の動作フローである。運用状態1003では、実際の検査対象の被検物10が設置面112に任意の態様で設置される。   FIG. 11C is an operation flow when a trigger is input when the control unit 211 is in the operation state 1003. In the operation state 1003, the actual test object 10 to be inspected is installed on the installation surface 112 in an arbitrary manner.

制御部211はカメラA101,カメラB102に同期して撮影指示を行う(ステップ1101)。すると、カメラA101で撮影された被検物画像の画像データ(輝度画像データA)が画像変換部206に転送され、同じくカメラB102で撮影された被検物画像の画像データ(輝度画像データB)が画像変換部206に転送される。そして、画像変換部206にて、画素歪み補正及びで平行化された輝度画像データA’、輝度画像データB’が生成される(ステップ1102)。この輝度画像データA’および輝度画像データB’は距離画像生成部207に転送される。距離画像生成部207では、輝度画像データA’と輝度画像データB’を用いて視差画像データCを生成し、視差画像データCから距離画像データDを生成する(ステップ1103)。ここでは、距離画像データD2が生成される。この距離画像データD2は背景・被検物分離部208に転送される。また、メモリ205に保存されている背景距離画像データD1も背景・被検物分離部208に転送される。背景・被検物分離部208では、背景距離画像データD1と距離画像データD2を比較して、距離画像データD2を背景領域と被検物領域に分離する(ステップ1105)。この分離結果は、位置・回転量算出部209に転送される。位置・回転量算出部209では、距離画像データD2の被検物領域のモーメントを計算し、このモーメントから被検物10の位置X,Y、及び回転量Θを算出する(ステップ1106)。この算出された位置X,Y、回転量Θのデータは位置ずれ・回転ずれ判定部210に転送される。また、メモリ205に保存されている判定閾値(minX,maxX,minY,maxY,minΘ,maxΘ)も位置ずれ・回転ずれ判定部210に転送される。位置ずれ・回転ずれ判定部210では、算出された算出された位置X,Y及び回転量Θを判定閾値と比較して、被検物10の位置ずれ・回転ずれを判定する(ステップ1108)。そして、判定結果(OK/NG)を制御部211へ通知する。制御部211は、判定結果、輝度画像データB’をPC300や外部通信部400へ転送する(ステップ1109)。   The control unit 211 issues a shooting instruction in synchronization with the cameras A101 and B102 (step 1101). Then, image data (luminance image data A) of the test object image captured by the camera A101 is transferred to the image conversion unit 206, and image data (luminance image data B) of the test object image also captured by the camera B102. 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 made parallel by pixel distortion correction (step 1102). The luminance image data A ′ and the luminance image data B ′ are transferred to the distance image generation unit 207. 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 1103). Here, distance image data D2 is generated. The distance image data D2 is transferred to the background / test object separation unit 208. Further, the background distance image data D1 stored in the memory 205 is also transferred to the background / test object separation unit 208. The background / test object separation unit 208 compares the background distance image data D1 and the distance image data D2, and separates the distance image data D2 into a background area and a test object area (step 1105). This separation result is transferred to the position / rotation amount calculation unit 209. The position / rotation amount calculation unit 209 calculates the moment of the test object region of the distance image data D2, and calculates the position X, Y and the rotation amount Θ of the test object 10 from this moment (step 1106). The calculated data of the positions X and Y and the rotation amount Θ are transferred to the positional deviation / rotational deviation determination unit 210. The determination threshold values (minX, maxX, minY, maxY, minΘ, maxΘ) stored in the memory 205 are also transferred to the positional deviation / rotational deviation determination unit 210. The positional deviation / rotational deviation determination unit 210 compares the calculated positions X and Y and the rotation amount Θ with the determination threshold value to determine the positional deviation / rotational deviation of the test object 10 (step 1108). Then, the determination result (OK / NG) is notified to the control unit 211. The control unit 211 transfers the luminance image data B ′ as a result of the determination to the PC 300 or the external communication unit 400 (step 1109).

以下に、本実施形態に係る画像処理装置を含む検査装置の具体的動作について説明する。   The specific operation of the inspection apparatus including the image processing apparatus according to this embodiment will be described below.

図12は、ユーザ操作と共に本検査装置の全体の動作の流れ示した図である。図12中、網掛けの個所がユーザ操作を示している。図13はパソコン300の表示画面の遷移を示した図である。   FIG. 12 is a diagram showing a flow of the overall operation of the present inspection apparatus together with user operations. In FIG. 12, shaded parts indicate user operations. FIG. 13 is a diagram showing the transition of the display screen of the personal computer 300.

カメラA101,カメラB102、及び、パタン投影部103は、図1のように設置されているとする。なお、先に述べたように、パタン投影部103は省略することでもよい。最初、被検物10は設置されていない。   Assume that the camera A101, the camera B102, and the pattern projection unit 103 are installed as shown in FIG. As described above, the pattern projection unit 103 may be omitted. Initially, the test object 10 is not installed.

ユーザは、パソコン300上で被検物の位置ずれ・回転ずれ判定のための専用アプリケーションを起動する(ステップ2001)。この時、パソコン300の表示画面は図13−Aのようになる。また、処理ユニット200の制御部211は初期状態の背景撮影状態1001にある(図10)。   The user activates a dedicated application for determining the displacement / rotation deviation of the test object on the personal computer 300 (step 2001). At this time, the display screen of the personal computer 300 is as shown in FIG. Further, the control unit 211 of the processing unit 200 is in the background photographing state 1001 in the initial state (FIG. 10).

次に、ユーザは背景撮影ボタン502を押下する(ステップ2002)。すると、PC300からPCI/F203を通して制御部211にトリガーが入力される。その結果、処理ユニット200は図11(a)で示した処理動作を実行し(ステップ2003)、輝度画像データ(背景輝度画像)B’をパソコン300へ出力する。この時、パソコン300の表示画面の撮影画像表示領域501に輝度画像データB’が表示されるが、被検物が設置されていないので、何も表示されていない。すなわち、表示画面は図13−Aと同様である。実際には、パタン投影部103によるパタン(図3)が表示されるが、ここでは説明の簡単化のため省略する。輝度画像データB’の転送後、制御部211は閾値調整状態1002へ遷移する(図10)。   Next, the user presses the background shooting button 502 (step 2002). Then, a trigger is input from the PC 300 to the control unit 211 through the PCI / F 203. As a result, the processing unit 200 executes the processing operation shown in FIG. 11A (step 2003) and outputs luminance image data (background luminance image) B ′ to the personal computer 300. At this time, the luminance image data B 'is displayed in the captured image display area 501 of the display screen of the personal computer 300, but nothing is displayed because the test object is not installed. That is, the display screen is the same as in FIG. In practice, the pattern (FIG. 3) by the pattern projection unit 103 is displayed, but is omitted here for the sake of simplicity. After transferring the luminance image data B ′, the control unit 211 transitions to the threshold adjustment state 1002 (FIG. 10).

次に、ユーザは、カメラA101,カメラB102の直下に、位置ずれ・回転ずれを判定したい被検物(モデル製品)10を設置する(ステップ2004)。その際、被検物10がカメラA101及びカメラB102の両方の視野に含まれる位置に設置する。また、被検物10は、位置ずれ・回転ずれがないように設置する。   Next, the user installs the test object (model product) 10 for which the positional deviation / rotational deviation is to be determined immediately below the camera A101 and the camera B102 (step 2004). At that time, the test object 10 is installed at a position included in the field of view of both the camera A101 and the camera B102. Moreover, the test object 10 is installed so that there is no position shift and rotation shift.

ユーザは撮影ボタン503を押下する(ステップ2005)。すると、PC300からPCI/F203を通して制御部211にトリガーが入力される。その結果、処理ユニット200は図11(b)で示した処理動作を実行し(ステップ2006)、輝度画像データ(被検物画像)B’及び位置・回転量の情報をパソコン300へ出力する。この時、パソコン300の表示画面は図13−Bのようになる。すなわち、投影画像表示領域501に被検物10の画像が表示される。また、算出された位置X,Y、回転量Θが位置バー(X)505、位置バー(Y)506、回転バー507上に表示される。ここでは、位置X=0,位置Y=0,回転量Θ=0である。   The user presses the shooting button 503 (step 2005). Then, a trigger is input from the PC 300 to the control unit 211 through the PCI / F 203. As a result, the processing unit 200 executes the processing operation shown in FIG. 11B (step 2006), and outputs luminance image data (test object image) B ′ and position / rotation amount information to the personal computer 300. At this time, the display screen of the personal computer 300 is as shown in FIG. That is, the image of the test object 10 is displayed in the projection image display area 501. The calculated positions X and Y and the rotation amount Θ are displayed on a position bar (X) 505, a position bar (Y) 506, and a rotation bar 507. Here, position X = 0, position Y = 0, and rotation amount Θ = 0.

ユーザは、マウスなどを用いて、位置バー(X)505、位置バー(Y)506、回転バー507を操作し、判定閾値として、X位置ずれ許容量(minX,maxX)、Y位置ずれ許容量(minY,maxY)、回転ずれ許容量(minΘ,maxΘ)を設定する(ステップ2007)。この時、パソコン300の表示画面は図13−Cのようになる。   The user operates the position bar (X) 505, the position bar (Y) 506, and the rotation bar 507 using a mouse or the like, and uses the X positional deviation allowable amount (minX, maxX) and the Y positional deviation allowable amount as determination thresholds. (MinY, maxY) and allowable rotational deviation (minΘ, maxΘ) are set (step 2007). At this time, the display screen of the personal computer 300 is as shown in FIG.

判定閾値の設定が終了したなら、ユーザは調整完了ボタン504ほ押下する(ステップ2008)。すると、ユーザが設定した判定閾値(minX,maxX,minY,maxY,minΘ,maxΘ)が、パソコン300からPCI/F203を通して処理ユニット200へ通知される。制御部211は、この判定閾値をメモリ205に保持すると共に、運用状態1003へ遷移する(図10)。   When the setting of the determination threshold is completed, the user presses the adjustment completion button 504 (step 2008). Then, determination threshold values (minX, maxX, minY, maxY, minΘ, maxΘ) set by the user are notified from the personal computer 300 to the processing unit 200 through the PCI / F 203. The control unit 211 holds the determination threshold value in the memory 205 and transitions to the operation state 1003 (FIG. 10).

以後、実際の検査対象の被検物10が設置され、ユーザが撮影ボタン503を押下することで、PC300からPCI/F203を通して制御部211にトリガーが入力される。その結果、処理ユニット200は図11(c)で示した処理動作を実行し(ステップ2009)、輝度画像データ(被検物画像)B’及び判定結果をパソコン300へ出力する。図13−Dは、この時のパソコン300の表示画面の一例を示したものである。これは、被検物10の位置X,Yは許容範囲内であるが、回転量Θが許容範囲を超えているため、判定結果は「NG」となったことを示している。   Thereafter, the test object 10 to be actually inspected is installed, and when the user presses the photographing button 503, a trigger is input from the PC 300 to the control unit 211 through the PCI / F 203. As a result, the processing unit 200 executes the processing operation shown in FIG. 11C (step 2009), and outputs the luminance image data (test object image) B ′ and the determination result to the personal computer 300. FIG. 13-D shows an example of the display screen of the personal computer 300 at this time. This indicates that the positions X and Y of the test object 10 are within the allowable range, but the determination result is “NG” because the rotation amount Θ exceeds the allowable range.

なお、外部通信部400に接続されるPLCから撮影トリガーを入力することで、同様に処理ユニット200は図11(c)で示した処理動作を実行し、外部I/F204、外部通信部400を通して、PLCで判定結果を得ることができる。   In addition, by inputting a shooting trigger from the PLC connected to the external communication unit 400, the processing unit 200 similarly executes the processing operation shown in FIG. 11C, and passes through the external I / F 204 and the external communication unit 400. The determination result can be obtained by PLC.

次に、ステレオカメラの他の実施例について説明する。図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.

図14は、カメラA101とカメラB102の代わりとして使用可能な、2つのカメラが一体となった一体型ステレオカメラの構成例を示した図である。これは、矢印方向に被写体があるものとし、一体型ステレオカメラにより被写体を撮像する構成の断面模式図を示したものである。601はレンズアレイを表す。レンズアレイは被写体側の面と像面側の面の二面からなり、面内に複数のレンズがアレイ状に配列されている。図14では、被写体側、像側の両方の面にレンズ面が設けられた両面レンズアレイが示されている。6001aは被写体側の面に設けられたレンズ、601bは像側の面に設けられたレンズであり、601aと601bがセットになって被写体の像を像面上で結像させる。602は、レンズアレイにおける隣接するレンズセット間での光線のクロストーク(混線)を防止するための遮光用の隔壁(遮光壁と呼ぶ)であり、金属や樹脂等の撮像光線に対して不透明な材料からなる。レンズアレイ601の像側の面と遮光壁とが接着されている。603は、板状部材に、各レンズセットに対応して円形の孔を設けた開口アレイであり、レンズの絞りとして作用する。レンズアレイ601の被写体側の面の平面部に設けられた突起部607を介して開口アレイ603とレンズアレイ601は接着されている。604は、レンズアレイにおける各レンズセットにより撮像される被写体の像を撮像するCMOSセンサ(撮像素子)であり、基板605の上に実装されている。606は筐体であり、レンズアレイ601の被写体側の面と接着してレンズアレイ601、遮光壁602、開口アレイ603を保持し、基板605に接着されている。   FIG. 14 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 601 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. 14 shows a double-sided lens array in which lens surfaces are provided on both the object side and the image side. Reference numeral 6001a denotes a lens provided on the object-side surface, and reference numeral 601b denotes a lens provided on the image-side surface. 601a and 601b are combined to form an image of the object on the image surface. Reference numeral 602 denotes a light-shielding partition wall (referred to as a light-shielding wall) for preventing crosstalk (crosstalk) of light rays 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 601 and the light shielding wall are bonded. Reference numeral 603 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 603 and the lens array 601 are bonded to each other through a protrusion 607 provided on a plane portion of the surface on the subject side of the lens array 601. Reference numeral 604 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 605. Reference numeral 606 denotes a housing, which is bonded to the subject-side surface of the lens array 601 to hold the lens array 601, the light shielding wall 602, and the aperture array 603, and is bonded to the substrate 605.

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

図15は、2つのカメラが一体となった一体型ステレオカメラの他の構成例を示した図である。基本的構成は図14と同じであり、相違点は、CMOSセンサ(撮像素子)が604a,604bの2枚からなる構成となっていることである。図15の構成によれば、センサの枚数が増えるので、コストは増加するが、測距精度が向上する利点がある。   FIG. 15 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 shown in FIG. 14, and the difference is that the CMOS sensor (imaging device) is composed of two pieces 604a and 604b. According to the configuration of FIG. 15, the number of sensors increases, so that the cost increases, but there is an advantage that the ranging accuracy is improved.

10 被検物
101,102 カメラ
103 パタン投影部
200 処理ユニット
201,202 カメラI/F
203 PCI/F
204 外部I/F
205 メモリ
206 画像変換部
207 距離画像生成部
208 背景・被検物分離部
209 位置・回転量算出部
210 位置ずれ・回転ずれ判定部
211 制御部
300 パソコン
400 外部通信部
DESCRIPTION OF SYMBOLS 10 Test object 101,102 Camera 103 Pattern projection part 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 background / test object separation unit 209 position / rotation amount calculation unit 210 position deviation / rotation deviation determination unit 211 control unit 300 personal computer 400 external communication unit

特開2011-107878号公報JP 2011-107878 A

P.J.Besl and N.D.McKay,A method for registration of 3-D shapes,IEEE Transactions on Pattern Analysis and Machine Intelligence,14(2) 1992,pp.239-256.P. J. Besl and N. D. McKay, A method for registration of 3-D shapes, IEEE Transactions on Pattern Analysis and Machine Intelligence, 14 (2) 1992, pp. 239-256. 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 (6)

被検物を撮影して得られた画像データから距離画像データを生成する距離画像生成手段と、
前記距離画像データを背景領域と被検物領域とに分離する背景・被検物領域分離手段と、
前記距離画像データの被検物領域から、前記被検物の位置及び回転量を算出する位置・回転量算出手段と、
を有することを特徴とする画像処理装置。
Distance image generating means for generating distance image data from image data obtained by imaging the test object;
A background / test object region separating means for separating the distance image data into a background region and a test object region;
Position / rotation amount calculating means for calculating the position and rotation amount of the test object from the test object region of the distance image data;
An image processing apparatus comprising:
前記距離画像手段は、被検物が存在しない状態で撮影して得られた背景画像データから背景距離画像データおよび被検物を撮影して得られた画像データから距離画像データを生成し、
前記背景・被検物領域分離手段は、前記背景距離画像データと前記距離画像データとを比較して、前記距離画像データを背景領域と被検物領域とに分離する、
ことを特徴とする請求項1に記載の画像処理装置。
The distance image means generates distance image data from background distance image data and image data obtained by photographing the subject from the background image data obtained by photographing in the absence of the subject,
The background / test object region separating means compares the background distance image data and the distance image data, and separates the distance image data into a background region and a test object region,
The image processing apparatus according to claim 1.
前記位置・回転量算出手段は、前記距離画像データの被検物領域のモーメントを計算し、前記モーメントから被検物の位置・回転量を算出する、
ことを特徴とする請求項1又は2に記載の画像処理装置。
The position / rotation amount calculating means calculates a moment of the test object region of the distance image data, and calculates a position / rotation amount of the test object from the moment.
The image processing apparatus according to claim 1, wherein the image processing apparatus is an image processing apparatus.
被検物を複数方向から撮影して、視差の異なる複数の画像データを取得する撮影手段と、
前記複数の画像データから距離画像データを生成する距離画像生成手段と、
前記距離画像データを背景領域と被検物領域とに分離する背景・被検物領域分離手段と、
前記距離画像データの被検物領域から、前記被検物の位置及び回転量を算出する位置・回転量算出手段と、
前記算出された被検物の位置及び回転量をあらかじめ定められた閾値と比較して、前記被検物の位置ずれ及び回転ずれを判定する位置ずれ・回転ずれ判定手段と、
を有することを特徴とする検査装置。
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;
A background / test object region separating means for separating the distance image data into a background region and a test object region;
Position / rotation amount calculating means for calculating the position and rotation amount of the test object from the test object region of the distance image data;
A positional deviation / rotational deviation determining means for comparing the calculated position and rotation amount of the test object with a predetermined threshold value to determine a position error and a rotation error of the test object,
An inspection apparatus comprising:
前記撮像手段は、被検物に対向する位置に設けられた、複数のレンズがアレイ配列されてなるレンズアレイと、前記レンズアレイの像面側に設けられた、前記複数のレンズのそれぞれにより略結像される前記被検物の縮小像を撮像する撮像素子とを有する、
ことを特徴とする請求項4に記載の検査装置。
The imaging means is approximately provided by 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. An image pickup device for picking up a reduced image of the object to be imaged,
The inspection apparatus according to claim 4.
前記撮像手段は、被検物の撮影領域よりも広領域にランダムパタンを照射するパタン投影手段を更に有することを特徴とする請求項4又は5に記載の検査装置。   The inspection apparatus according to claim 4, wherein the imaging unit further includes a pattern projection unit that irradiates a random pattern over a wider area than the imaging region of the test object.
JP2012183859A 2012-08-23 2012-08-23 Image processing apparatus and inspection apparatus Pending JP2014041074A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012183859A JP2014041074A (en) 2012-08-23 2012-08-23 Image processing apparatus and inspection apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012183859A JP2014041074A (en) 2012-08-23 2012-08-23 Image processing apparatus and inspection apparatus

Publications (1)

Publication Number Publication Date
JP2014041074A true JP2014041074A (en) 2014-03-06

Family

ID=50393436

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012183859A Pending JP2014041074A (en) 2012-08-23 2012-08-23 Image processing apparatus and inspection apparatus

Country Status (1)

Country Link
JP (1) JP2014041074A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018115981A (en) * 2017-01-19 2018-07-26 株式会社日立エルジーデータストレージ Object position detection device
CN110998241A (en) * 2018-01-23 2020-04-10 深圳市大疆创新科技有限公司 System and method for calibrating an optical system of a movable object
CN111223796A (en) * 2018-11-23 2020-06-02 细美事有限公司 Substrate processing apparatus, and apparatus and method for eccentricity inspection
JP2022134364A (en) * 2021-03-03 2022-09-15 日本電気株式会社 Measuring device, measurement method, and computer program

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1031742A (en) * 1996-07-15 1998-02-03 Mitsubishi Electric Corp Image processor and object transfer device
JP2006074460A (en) * 2004-09-02 2006-03-16 Matsushita Electric Ind Co Ltd Object detecting device and method
JP2007192625A (en) * 2006-01-18 2007-08-02 Seiko Epson Corp Flaw discrimination method and device
JP2011133273A (en) * 2009-12-22 2011-07-07 Canon Inc Estimation apparatus and control method thereof, and program

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1031742A (en) * 1996-07-15 1998-02-03 Mitsubishi Electric Corp Image processor and object transfer device
JP2006074460A (en) * 2004-09-02 2006-03-16 Matsushita Electric Ind Co Ltd Object detecting device and method
JP2007192625A (en) * 2006-01-18 2007-08-02 Seiko Epson Corp Flaw discrimination method and device
JP2011133273A (en) * 2009-12-22 2011-07-07 Canon Inc Estimation apparatus and control method thereof, and program

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018115981A (en) * 2017-01-19 2018-07-26 株式会社日立エルジーデータストレージ Object position detection device
CN110998241A (en) * 2018-01-23 2020-04-10 深圳市大疆创新科技有限公司 System and method for calibrating an optical system of a movable object
CN111223796A (en) * 2018-11-23 2020-06-02 细美事有限公司 Substrate processing apparatus, and apparatus and method for eccentricity inspection
CN111223796B (en) * 2018-11-23 2023-10-27 细美事有限公司 Substrate processing apparatus, and apparatus and method for eccentric inspection
JP2022134364A (en) * 2021-03-03 2022-09-15 日本電気株式会社 Measuring device, measurement method, and computer program

Similar Documents

Publication Publication Date Title
EP3248374B1 (en) Method and apparatus for multiple technology depth map acquisition and fusion
JP6465789B2 (en) Program, apparatus and method for calculating internal parameters of depth camera
TWI547828B (en) Calibration of sensors and projector
CN101755190B (en) Calibration method, calibration device, and calibration system having the device
JP6363863B2 (en) Information processing apparatus and information processing method
US20110249117A1 (en) Imaging device, distance measuring method, and non-transitory computer-readable recording medium storing a program
JP2007129709A (en) Method for calibrating imaging device, method for calibrating imaging system including arrangement of imaging devices, and imaging system
JP2011253376A (en) Image processing device, image processing method and program
JP2019510311A (en) Method and computer program product for calibrating a stereo imaging system using a planar mirror
CN112005548B (en) Method of generating depth information and electronic device supporting the same
CN111492201B (en) Distance measuring camera
JP6304244B2 (en) 3D shape measuring apparatus, 3D shape measuring method, and 3D shape measuring program
TWI672937B (en) Apparatus and method for processing three dimensional images
JP5624370B2 (en) Moving body detection apparatus and moving body detection method
TWI521471B (en) 3 - dimensional distance measuring device and method thereof
JP2014041074A (en) Image processing apparatus and inspection apparatus
KR20120108256A (en) Robot fish localization system using artificial markers and method of the same
US8908012B2 (en) Electronic device and method for creating three-dimensional image
JP5336325B2 (en) Image processing method
WO2014171438A1 (en) Three-dimensional shape measurement device, three-dimensional shape measurement method, and three-dimensional shape measurement program
JP2013044597A (en) Image processing device and method, and program
JP2021027584A (en) Image processing device, image processing method, and program
CN114450552A (en) Correction parameter calculation method, displacement amount calculation method, correction parameter calculation device, and displacement amount calculation device
JP4871315B2 (en) Compound eye photographing apparatus, control method therefor, and program
JP5967470B2 (en) Inspection device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20150714

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20160408

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20160413

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20161014