JP4788475B2 - Image processing apparatus and image processing method - Google Patents

Image processing apparatus and image processing method Download PDF

Info

Publication number
JP4788475B2
JP4788475B2 JP2006140058A JP2006140058A JP4788475B2 JP 4788475 B2 JP4788475 B2 JP 4788475B2 JP 2006140058 A JP2006140058 A JP 2006140058A JP 2006140058 A JP2006140058 A JP 2006140058A JP 4788475 B2 JP4788475 B2 JP 4788475B2
Authority
JP
Japan
Prior art keywords
image
camera
processing
edge
sequence
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.)
Active
Application number
JP2006140058A
Other languages
Japanese (ja)
Other versions
JP2007026423A (en
Inventor
紫朗 藤枝
泰之 池田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Omron Corp
Original Assignee
Omron Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Omron Corp filed Critical Omron Corp
Priority to JP2006140058A priority Critical patent/JP4788475B2/en
Publication of JP2007026423A publication Critical patent/JP2007026423A/en
Application granted granted Critical
Publication of JP4788475B2 publication Critical patent/JP4788475B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Analysis (AREA)
  • Length Measuring Devices By Optical Means (AREA)
  • Image Processing (AREA)

Description

この発明は、対象物を互いに異なる方向から撮影するように配置された複数のカメラによりそれぞれ撮影された画像に基づいて3次元計測を行う装置に関する。   The present invention relates to an apparatus that performs three-dimensional measurement based on images photographed by a plurality of cameras arranged to photograph an object from different directions.

従来より、対象物の形状や表面パターンについて、2次元画像処理による計測を行う装置が、種々の製品の製造現場において広く用いられている。これら2次元の画像処理装置では、対象物を代表する面(例えば対象物の底面)または対象物の計測対象面(検査対象面を含む。)を、その面に垂直な方向、すなわちその面を正面視する方向から撮像した画像に基づき、計測(検査を目的とする計測を含む。以下、この明細書では、検査の過程で何らかの計測が行われることを踏まえ、単に「計測」という場合には「検査を目的とする計測」を行う場合を含むものとする。)を行うようにしている。   2. Description of the Related Art Conventionally, an apparatus for measuring the shape and surface pattern of an object by two-dimensional image processing has been widely used at various product manufacturing sites. In these two-dimensional image processing apparatuses, a surface representing the object (for example, the bottom surface of the object) or a measurement target surface of the object (including the inspection object surface) is set in a direction perpendicular to the surface, that is, the surface. Measurement (including measurement for the purpose of inspection based on the image taken from the front view direction. In the following, in this specification, in the case of simply “measurement”, taking into account that some measurement is performed in the process of inspection. "Including the case of performing measurement for the purpose of inspection").

このような2次元画像処理装置は、同じ装置がさまざまな計測目的に適用できるように、多様な処理項目のメニューを備え、使用する処理項目とその実行順序をユーザが指定して処理項目のシーケンスを組み立てることができるようになっている場合が多い。例えば特許文献1の図9には、ユーザに利用可能な処理項目を提示して、処理項目の実行手順を指定させる画像処理装置が記載されている。   Such a two-dimensional image processing apparatus is provided with a menu of various processing items so that the same apparatus can be applied to various measurement purposes, and the user specifies the processing items to be used and their execution order, and the processing item sequence. In many cases, it can be assembled. For example, FIG. 9 of Patent Document 1 describes an image processing apparatus that presents processing items that can be used to a user and specifies the execution procedure of the processing items.

一方、複数のカメラを用いた立体視の原理に基づく三次元計測の手法が知られており、そのような手法は例えば特許文献2に記載されている。しかし、3次元計測を行う装置は、対象物の種類や性質を限定し、与えられたその対象物の特徴を利用して計測するための計測アルゴリズムを備えた上で、その対象物に専用化された装置として実用化されているのが実状である。例えば、特許文献2には、回転対称な形状を有する対象物を3次元計測するための画像処理装置が記載されている。   On the other hand, a method of three-dimensional measurement based on the principle of stereoscopic vision using a plurality of cameras is known, and such a method is described in Patent Document 2, for example. However, a device that performs three-dimensional measurement is limited to the type and nature of the object, and is equipped with a measurement algorithm for measuring using the characteristics of the given object, and is dedicated to that object. The actual situation is that it has been put to practical use as an apparatus. For example, Patent Document 2 describes an image processing apparatus for three-dimensionally measuring an object having a rotationally symmetric shape.

特開2005−167678号公報JP 2005-167678 A 特開2002−99902号公報JP 2002-99902 A

種々の製品の製造現場においても、対象物の3次元計測が可能であれば、従来の2次元画像処理装置ではできなかった計測が可能になったり、従来よりも計測精度や使い勝手が向上したりすると考えられる状況は存在する。しかし、種々の製品の製造現場において汎用的に使用できる3次元計測装置は知られていなかった。   Even in the production site of various products, if 3D measurement of an object is possible, measurement that was not possible with conventional 2D image processing devices will be possible, and measurement accuracy and usability will be improved compared to conventional products. There are situations that can be considered. However, a three-dimensional measuring device that can be used for general purposes at various product manufacturing sites has not been known.

このような状況において、発明者らは、従来一般的であった3次元計測に特化した画像処理装置を開発するのではなく、従来の2次元画像処理装置としての機能を継承しつつ、これに3次元計測機能を付加する方向で装置を開発することにより、3次元計測が可能でしかも汎用性の高い、新たなタイプの画像処理装置を創出することにした。このような方針のもと、発明者らが設定した課題の一つは、従来の2次元画像処理装置と同様に、利用可能な処理項目を提示して処理項目のシーケンスを作成させるようなユーザインタフェースによって3次元計測のシーケンスを指定できるようにすることである。   In such a situation, the inventors do not develop a conventional image processing apparatus specialized for three-dimensional measurement, but inherit the function as a conventional two-dimensional image processing apparatus. By developing a device in the direction of adding a three-dimensional measurement function to the above, it was decided to create a new type of image processing device that can perform three-dimensional measurement and has high versatility. Under such a policy, one of the issues set by the inventors is a user who presents available processing items and creates a sequence of processing items as in the case of a conventional two-dimensional image processing apparatus. It is to be able to specify a 3D measurement sequence through an interface.

発明者らが設定した他の課題は、従来の2次元画像処理装置においても用いられていた処理の一部を3次元計測にも活用することである。   Another problem set by the inventors is to utilize a part of the processing used in the conventional two-dimensional image processing apparatus also for three-dimensional measurement.

(1)従来の2次元画像処理装置と同様に、利用可能な処理項目を提示して処理項目のシーケンスを作成させるようなユーザインタフェースによって3次元計測のシーケンスを指定させるのに好適な処理項目を提供する画像処理装置は、対象物を互いに異なる方向から撮影するように配置された第1のカメラおよび第2のカメラによりそれぞれ撮影された画像に基づく第1の画像および第2の画像を用いた処理を行うもので、処理項目のシーケンスを設定するシーケンス設定手段と、設定されたシーケンスを実行するシーケンス実行手段とを備える。シーケンス設定手段は、ユーザの選択によりシーケンスの要素とすることができる処理項目として、2次元画像処理の複数の項目、および3次元計測処理の少なくとも1つの項目を提供する。提供される2次元画像処理の項目の中には、第1の画像に第1の検出領域を設定して、この第1の検出領域において当該検出領域に定められているエッジ検出方向におけるエッジの位置を特定する第1画像上位置特定処理の項目が、少なくとも1つ含まれる。 (1) Similar to the conventional two-dimensional image processing apparatus, processing items suitable for designating a three-dimensional measurement sequence by a user interface that presents available processing items and creates a sequence of processing items. The provided image processing apparatus uses the first image and the second image based on the images photographed by the first camera and the second camera arranged to photograph the object from different directions, respectively. processing and performs comprises a sequence setting means for setting a sequence of processing items, and a sequence executing means for executing a sequence that has been set. The sequence setting means provides a plurality of items of two-dimensional image processing and at least one item of three-dimensional measurement processing as processing items that can be used as elements of the sequence by user selection. Among the provided two-dimensional image processing items, a first detection area is set in the first image, and the edge detection direction in the edge detection direction defined in the detection area is set in the first detection area. At least one item of the first image position specifying process for specifying the position is included.

さらにこの画像処理装置では、3次元計測に提供される処理項目の少なくとも1つが、第1画像上位置特定処理の項目と同じシーケンスに組み込まれて、当該シーケンス中の第1画像上位置特定処理において特定された第1の画像におけるエッジの位置および第1のカメラと第2のカメラとの位置関係に基づく特定の一方向をエッジ検出方向とする第2の検出領域を設定して、この第2の検出領域内でエッジ検出方向におけるエッジの位置を特定する第2画像上位置特定処理と、第1画像上位置特定処理により特定された第1の画像上のエッジの位置と第2画像上位置特定処理により特定された第2の画像上のエッジの位置とを用いた3次元計測用の演算処理とを実行するように設計される。
この画像処理装置によれば、3次元計測が可能であるにもかかわらず、従来の2次元画像処理装置との統一性が高く、ユーザにとって装置を使用するための学習量が少なくて済む。したがって、ユーザによる装置の使いこなしが容易である。
Furthermore, in this image processing apparatus, at least one of the processing items provided for the three-dimensional measurement is incorporated in the same sequence as the item for the first image position specifying process, and in the first image position specifying process in the sequence, By setting a second detection region having a specific one direction based on the position of the edge in the specified first image and the positional relationship between the first camera and the second camera as the edge detection direction, The position on the second image specifying the position of the edge in the edge detection direction within the detection area of the image, the position of the edge on the first image specified by the position specifying process on the first image, and the position on the second image It is designed to execute a calculation process for three-dimensional measurement using the edge position on the second image specified by the specifying process.
According to this image processing apparatus, although the three-dimensional measurement is possible, the uniformity with the conventional two-dimensional image processing apparatus is high, and the learning amount for using the apparatus for the user is small. Therefore, the user can easily use the device.

ここで、使用するカメラの数は3以上としてもよい。その場合は、そのうちの2台が第1のカメラ、第2のカメラとなる。
第1の画像、第2の画像は、それぞれ第1のカメラ、第2のカメラで撮影された画像そのものでもよいし、さらに何らかの処理が施された画像でもよい。例えば、第2のカメラで撮影された斜視画像を正面視の画像に変換した画像を第2の画像として用いてもよい。
第1画像上位置特定処理は、その処理自体の仕様としては、設定によって第2の画像を対象とすることも可能な汎用的な処理(プログラム)であることを妨げない。
Here, the number of cameras used may be three or more. In that case, two of them are the first camera and the second camera.
The first image and the second image may be images captured by the first camera and the second camera, respectively, or may be images that have undergone some processing. For example, an image obtained by converting a perspective image captured by the second camera into a front-view image may be used as the second image.
The first image position specifying process does not prevent the process itself from being a general-purpose process (program) that can also target the second image by setting.

(2)上記の画像処理装置では、第2の画像上のエッジの位置を特定する処理と3次元計測用の演算処理とを1つの処理項目としているので、ユーザは少ない指示で3次元計測全体のシーケンスを完成させることができ、ユーザによる装置の使いこなしがいっそう容易である。 (2) In the image processing apparatus described above, the processing for specifying the position of the edge on the second image and the calculation processing for three-dimensional measurement are set as one processing item , so the user can perform the entire three-dimensional measurement with few instructions. This makes it possible to complete the sequence and makes it easier for the user to use the device.

(3)この画像処理装置は、第1画像上位置特定処理として、他の観点により第1の画像における対象物上の位置を特定する処理を含む複数種の第1画像上位置特定処理を提供してもよい。3次元計測処理の項目についても、複数種類を提供してもよい。
この構成により3次元計測の処理内容を選択することができるようになる。さらに、選択により1つの第1画像上位置特定処理の項目と対にすることが可能な3次元計測処理の項目が複数ある場合、および、選択により1つの3次元計測処理の項目と対にすることが可能な第1画像上位置特定処理の項目が複数ある場合には、項目の組み合わせにより項目自体の選択肢の数よりも多くの種類の3次元計測のシーケンスを、作成することが可能になる。
(3) The image processing apparatus as a first image on a position determination process, providing a first image on a position determination processing of a plurality kinds including a process for specifying a location on the object in the first image by another aspect May be. A plurality of types of items of the three-dimensional measurement process may be provided.
With this configuration, it is possible to select the processing content of the three-dimensional measurement. Furthermore, when there are a plurality of three-dimensional measurement process items that can be paired with one first image position specifying process item by selection, and when selected, a pair with one three-dimensional measurement process item is selected. In the case where there are a plurality of items on the first image position specifying process that can be performed, it is possible to create more types of three-dimensional measurement sequences than the number of options of the item itself by combining the items. .

(4)この画像処理装置は、少なくとも1つの第1画像上位置特定処理の項目と少なくとも1つの3次元計測処理の項目とを含む、3次元計測の基本シーケンスを、ユーザの選択により利用可能に提供するものとしてもよい。この構成によれば、3次元計測のシーケンスに不慣れなユーザであっても、装置の3次元計測機能をよりいっそう容易に利用することができる。 (4) The image processing apparatus can use a three-dimensional measurement basic sequence including at least one first image position specifying process item and at least one three-dimensional measurement process item by user selection. It may be provided. According to this configuration, even a user unfamiliar with the 3D measurement sequence can more easily use the 3D measurement function of the apparatus.

(5)ここで、第2の検出領域は、そのエッジ検出方向に沿う範囲が、3次元計測の対象範囲としてユーザに指定された第1のカメラの光軸に沿う範囲に基づいて設定されるものであってもよい。このようにすれば、計測対象のエッジが存在するとユーザが想定する範囲に対応する限定された範囲に第2の検出領域を設定できるため、第2画像上位置特定処理の演算量を少なくできるとともに、計測対象ではないエッジが第2の検出領域に含まれてしまうことによる誤動作を少なくすることができる。 (5) Here, the second detection region is set based on a range along the optical axis of the first camera designated by the user as a three-dimensional measurement target range in the range along the edge detection direction. It may be a thing. In this way, since the second detection area can be set in a limited range corresponding to the range that the user assumes that there is an edge to be measured, the amount of calculation of the second image position specifying process can be reduced. In addition, it is possible to reduce malfunctions due to an edge that is not a measurement target being included in the second detection region.

(6)また、第1のカメラは、矩形状の視野の範囲を有し、対象物を正面視する方向から撮影するように配置されるものとし、第2のカメラは、第1のカメラに対して第1のカメラの視野における縦または横の方向に離れた位置にあって、対象物を正面視する方向に対して斜めになる方向から対象物を撮影するように配置されるものとし、第1画像上位置特定処理では、第1の検出領域を第1の画像に対してユーザの指示に基づく位置に設定すると共に、第1のカメラ第2のカメラとの並びの方向を第1の検出領域のエッジ検出方向としてもよい。 (6) In addition, the first camera has a rectangular field of view, and is arranged so as to take an image of the object from the front view direction. The second camera is connected to the first camera. On the other hand, it is located at a position separated in the vertical or horizontal direction in the field of view of the first camera, and is arranged so as to photograph the object from a direction oblique to the direction in which the object is viewed from the front, in the first image on the locating process, and sets a position based on a user's instruction to the first detection area the first image, the direction of arrangement of the first camera and the second camera first it may be an edge detection direction of the detection region of.

この構成においては、第1の画像を対象とするエッジの位置を特定する処理におけるエッジ検出方向はカメラの並びの方向であり、かつ、第1のカメラの視野の縦または横の方向に第2のカメラが配置されているから、カメラの視野の縦方向または横方向がエッジ検出方向となる。さらに、第1の画像は対象物を正面視の方向から撮影したものである。第1の画像における検出領域はユーザの指示に基づく位置に設定するものであるから、設定対象の画像が正面視画像であること、およびカメラの視野の縦方向または横方向がエッジ検出方向であることにより、3次元計測のための設定であるにもかかわらず、従来の2次元画像処理装置と同様のわかりやすさでエッジの検出領域を設定できる。したがって、ユーザによる装置の使いこなしが容易である。   In this configuration, the edge detection direction in the process of specifying the position of the edge targeted for the first image is the direction in which the cameras are arranged, and the second direction in the vertical or horizontal direction of the field of view of the first camera. Therefore, the vertical or horizontal direction of the camera field of view is the edge detection direction. Further, the first image is an image of the object taken from the front view. Since the detection area in the first image is set at a position based on a user instruction, the setting target image is a front view image, and the vertical or horizontal direction of the camera field of view is the edge detection direction. As a result, the edge detection region can be set with the same ease of understanding as the conventional two-dimensional image processing apparatus, despite the setting for three-dimensional measurement. Therefore, the user can easily use the device.

(7)この画像処理装置に具現された解決手段は、画像処理方法としても把握することができる。すなわち、この画像処理方法は、対象物を互いに異なる方向から撮影するように配置された第1のカメラおよび第2のカメラによりそれぞれ撮影された画像に基づく第1の画像および第2の画像を用いる画像処理方法であって、処理項目のシーケンスを設定するシーケンス設定ステップと、設定されたシーケンスを実行するシーケンス実行ステップとを備え、シーケンス設定ステップは、ユーザの選択によりシーケンスの要素とすることができる処理項目として、2次元画像処理の複数の項目および3次元計測処理の少なくとも1つの項目を提供する。提供される2次元画像処理の項目の中には、第1の画像に第2の検出領域を設定して、この第1の検出領域において当該検出領域に定められているエッジ検出方向におけるエッジの位置を特定する第1画像上位置特定処理の項目が、少なくとも1つ含まれる。 (7) The solving means embodied in this image processing apparatus can also be grasped as an image processing method. That is, this image processing method uses the first image and the second image based on the images photographed by the first camera and the second camera arranged so as to photograph the object from different directions. An image processing method, comprising: a sequence setting step for setting a sequence of processing items; and a sequence execution step for executing a set sequence. The sequence setting step can be made an element of a sequence by user selection. As processing items, a plurality of items of two-dimensional image processing and at least one item of three-dimensional measurement processing are provided . Among the provided two-dimensional image processing items, a second detection area is set in the first image, and the edge detection direction in the edge detection direction defined in the detection area is set in the first detection area. At least one item of the first image position specifying process for specifying the position is included.

さらに3次元計測処理に提供される処理項目の少なくとも1つは、第1画像上位置特定処理の項目と同じシーケンスに組み込まれて、当該シーケンス中の第1画像上位置特定処理において特定された第1の画像におけるエッジの位置および第1のカメラと第2のカメラとの位置関係に基づく特定の一方向をエッジ検出方向とする第2の検出領域を設定して、この第2の検出領域内でエッジ検出方向におけるエッジの位置を特定する第2画像上位置特定処理と、第1画像上位置特定処理により特定された第1の画像上のエッジの位置と第2画像上位置特定処理において特定された第2の画像上のエッジの位置とを用いた3次元計測用の演算処理とを実行するように設計される Furthermore , at least one of the process items provided for the three-dimensional measurement process is incorporated into the same sequence as the item for the first image position specifying process, and is specified in the first image position specifying process in the sequence. A second detection region is set in which a specific direction based on the position of the edge in one image and the positional relationship between the first camera and the second camera is set as the edge detection direction. In the second image position specifying process for specifying the edge position in the edge detection direction, and in the second image position specifying process, the edge position on the first image specified by the first image position specifying process is specified. The calculation processing for three-dimensional measurement using the edge position on the second image is performed .

(8)従来の2次元画像処理装置においても用いられていた処理を3次元計測に活用できる画像処理装置の好適な例は、矩形状の視野の範囲を有し、対象物を正面視する方向から撮影するように配置された第1のカメラと、第1のカメラに対して第1のカメラの視野における縦または横の方向に離れた位置にあって、対象物を正面視する方向に対して斜めになる方向から対象物を撮影するように配置された第2のカメラとによりそれぞれ撮影された画像に基づく第1の画像および第2の画像を用いた処理を行う画像処理装置である。この装置は、第1の画像における対象物上の位置を特定する第1画像上位置特定手段と、第1画像上位置特定処理手段において特定された第1の画像における対象物上の位置に対応する、第2の画像における対象物上の位置を特定する第2画像上位置特定手段と、第1画像上位置特定手段において特定された位置と第2画像上位置特定手段において特定された位置とを用いて3次元計測用の演算を実行する演算手段とを備える。
第1画像上位置特定手段は、第1の検出領域を第1の画像に対してユーザの指示に基づく位置に設定し、第1のカメラと第2のカメラとの並びの方向をエッジ検出方向として第1の検出領域内でエッジ検出方向におけるエッジの位置を特定する。第2画像上位置特定手段は、第2の画像に対し、第1のカメラ第2のカメラとの位置関係および第1画像上位置特定手段において特定されたエッジの位置に基づいて設定される特定の一方向をエッジ検出方向とする第2の検出領域を設定し、第2の検出領域内エッジ検出方向におけるエッジの位置を特定する。
(8) A preferred example of an image processing apparatus that can utilize the processing used in the conventional two-dimensional image processing apparatus for three-dimensional measurement has a rectangular field of view and a direction in which the object is viewed from the front A first camera arranged so as to shoot from the first camera, and a position away from the first camera in the vertical or horizontal direction in the field of view of the first camera, with respect to the direction in which the object is viewed from the front An image processing apparatus that performs processing using a first image and a second image based on images respectively captured by a second camera arranged to photograph an object from an oblique direction. The apparatus corresponds to a position on the object in the first image specified by a first image position specifying means for specifying a position on the object in the first image and a position specifying processing means on the first image. A second image position specifying means for specifying a position on the object in the second image, a position specified by the first image position specifying means, and a position specified by the second image position specifying means And calculating means for executing calculation for three-dimensional measurement .
The first image position specifying means sets the first detection region to a position based on a user instruction with respect to the first image, and sets the direction of arrangement of the first camera and the second camera as an edge detection direction. As described above, the position of the edge in the edge detection direction is specified in the first detection region . Second image on the position specifying means, for the second image is set on the basis of the position of a particular edge in the first camera and the positional relationship and the first image on the position specifying means and the second camera A second detection area whose edge detection direction is a specific direction is set, and the position of the edge in the edge detection direction is specified in the second detection area.

このような画像処理装置によれば、従来の2次元画像処理装置においても用いられていた検出領域内でエッジの位置を特定する処理を、第1の画像および第2の画像に対するエッジ検出方向を上記のように特定することにより、3次元計測のために利用することができる。特に、第1の画像を対象とするエッジの位置を特定する処理におけるエッジ検出方向はカメラの並びの方向であり、かつ、第1のカメラの視野の縦方向または横方向に第2のカメラが配置されているから、カメラの視野の縦方向または横方向がエッジ検出方向となる。さらに、第1の画像は対象物を正面視の方向から撮影したものである。第1の画像における検出領域はユーザの指示に基づく位置に設定するものであるから、設定対象の画像が正面視画像であること、およびカメラの視野の縦方向または横方向がエッジ検出方向であることにより、3次元計測のための設定であるにもかかわらず、従来の2次元画像処理装置と同様のわかりやすさでエッジの検出領域を設定できる。したがって、ユーザによる装置の使いこなしが容易である。   According to such an image processing device, the processing for specifying the position of the edge in the detection region used also in the conventional two-dimensional image processing device is performed with the edge detection direction for the first image and the second image being changed. By specifying as described above, it can be used for three-dimensional measurement. In particular, the edge detection direction in the process of specifying the position of the edge for the first image is the direction in which the cameras are arranged, and the second camera is in the vertical or horizontal direction of the field of view of the first camera. Since they are arranged, the vertical direction or the horizontal direction of the field of view of the camera is the edge detection direction. Further, the first image is an image of the object taken from the front view. Since the detection area in the first image is set at a position based on a user instruction, the setting target image is a front view image, and the vertical or horizontal direction of the camera field of view is the edge detection direction. As a result, the edge detection region can be set with the same ease of understanding as the conventional two-dimensional image processing apparatus, despite the setting for three-dimensional measurement. Therefore, the user can easily use the device.

このような画像処理装置に具現された解決手段は、各処理の手段で実行される内容を処理のステップとした画像処理方法としても把握することができる。 The solving means embodied in such an image processing apparatus can also be grasped as an image processing method in which the contents executed by each processing means are processing steps.

上記によれば、従来の2次元画像処理との統一性が高い装置または方法により3次元計測を行うことができるので、ユーザが3次元計測機能を使いこなすことが容易である。   According to the above, since the 3D measurement can be performed by the apparatus or method having high uniformity with the conventional 2D image processing, the user can easily use the 3D measurement function.

図1は、この発明が適用された検査装置(画像処理装置)の撮像部の構成を、その設置例とともに示す。
この実施例の検査装置は、3次元および2次元の双方の計測処理機能を有するもので、工場の検査ラインLを搬送される検査対象物W(以下、「ワークW」という。)を、撮像部1により順に撮像して、種々の検査目的に応じた計測処理や判別処理を実行する。
撮像部1は、筐体15内に2台のカメラC0,C1を組み込んだ構成のもので、検査ラインLの上方に設置される。一方のカメラC0は、その光軸を鉛直方向に向けた状態(ワークWに対して正面視の状態)で設置される。他方のカメラC1は、カメラC0と視野が重なるようにして、光軸を傾斜させた状態で設置される。カメラC0およびカメラC1の視野の範囲を規定する撮像面は矩形であり、カメラC1はカメラC0に対して、カメラC0の視野の範囲の横方向(図2の画像A0のx軸方向に対応する。)に沿って並ぶように配置されている。
FIG. 1 shows a configuration of an imaging unit of an inspection apparatus (image processing apparatus) to which the present invention is applied, along with an installation example thereof.
The inspection apparatus of this embodiment has both three-dimensional and two-dimensional measurement processing functions, and images an inspection object W (hereinafter referred to as “work W”) conveyed on an inspection line L in a factory. Images are sequentially picked up by the unit 1, and measurement processing and discrimination processing according to various inspection purposes are executed.
The imaging unit 1 has a configuration in which two cameras C0 and C1 are incorporated in a housing 15, and is installed above the inspection line L. One camera C0 is installed with its optical axis oriented in the vertical direction (front view with respect to the workpiece W). The other camera C1 is installed with the optical axis tilted so that the field of view overlaps the camera C0. The imaging plane that defines the field of view of the camera C0 and the camera C1 is rectangular, and the camera C1 corresponds to the camera C0 in the lateral direction of the field of view of the camera C0 (the x-axis direction of the image A0 in FIG. 2). .) Are arranged in line.

図2は、各カメラC0,C1により生成されたワークWの画像の例を示す。図中のA0(第1の画像に相当)がカメラC0からの画像であり、A1(第2の画像に相当)がカメラC1からの画像である。
この図2および後記する図13等のワークWの画像を例示する図では、各画像A0,A1中のワークについても、図1と同様にWを用いて示す。また、画像A0の横方向(水平方向)をx軸方向、縦方向(垂直方向)をy軸方向とする。
FIG. 2 shows an example of an image of the workpiece W generated by each camera C0, C1. In the figure, A0 (corresponding to the first image) is an image from the camera C0, and A1 (corresponding to the second image) is an image from the camera C1.
In the figure illustrating the image of the workpiece W in FIG. 2 and FIG. 13 to be described later, the workpieces in the images A0 and A1 are also shown by using W as in FIG. The horizontal direction (horizontal direction) of the image A0 is the x-axis direction, and the vertical direction (vertical direction) is the y-axis direction.

カメラC0は光軸を鉛直方向に向けて設置されているので、画像A0は、ワークWの上面を正面から見た状態を示すものとなる。これに対し、カメラC1は光軸を斜めに向けて設置されているので、画像A1には、斜めから見た状態のワークWが現れる。このような画像の特徴に着目して、この検査装置では、まず画像の歪みが小さい(ワークWの平面図に近い)カメラC0側の画像A0を用いて計測対象位置を特定し、つぎにカメラC1側の画像A1上で、画像A0上の計測対象位置に対応する位置を特定するようにしている。   Since the camera C0 is installed with the optical axis oriented in the vertical direction, the image A0 shows a state where the upper surface of the workpiece W is viewed from the front. On the other hand, since the camera C1 is installed with the optical axis directed obliquely, the work W in a state seen from the oblique appears in the image A1. Focusing on such image characteristics, this inspection apparatus first identifies the measurement target position using the image A0 on the camera C0 side where the image distortion is small (close to the plan view of the workpiece W), and then the camera. A position corresponding to the measurement target position on the image A0 is specified on the image A1 on the C1 side.

図3は、検査装置の全体構成を示すブロック図である。この検査装置は、撮像部1のほか、本体部2、モニタ3、コンソール4などにより構成される。本体部2には、各カメラC0,C1に対する画像入力部20,21、カメラ駆動部22、画像メモリ23、処理部24、メモリ25、表示制御部26、出力部27などが設けられる。   FIG. 3 is a block diagram showing the overall configuration of the inspection apparatus. In addition to the imaging unit 1, the inspection apparatus includes a main body unit 2, a monitor 3, a console 4, and the like. The main body 2 is provided with image input units 20 and 21, a camera driving unit 22, an image memory 23, a processing unit 24, a memory 25, a display control unit 26, an output unit 27, and the like for the cameras C0 and C1.

カメラ駆動部22は、図示しないワーク検出用のセンサからの検知信号を受けて各カメラC0,C1を同時に駆動する。画像入力部20,21は、A/D変換回路や画像バッファなどを含むもので、各カメラC0,C1により生成された画像信号は、それぞれの画像入力部20,21でディジタル変換され、カメラ毎に計測処理用のディジタル画像(画像A0,A1)が生成される。これらの画像A0,A1は、画像入力部20,21の画像バッファに保存された後、処理部24からの指令に応じて読み出され、画像メモリ23に格納される。   The camera drive unit 22 receives detection signals from a workpiece detection sensor (not shown) and drives the cameras C0 and C1 simultaneously. The image input units 20 and 21 include an A / D conversion circuit, an image buffer, and the like. Image signals generated by the cameras C0 and C1 are digitally converted by the respective image input units 20 and 21, and each camera is Then, digital images for measurement processing (images A0 and A1) are generated. These images A 0 and A 1 are stored in the image buffers of the image input units 20 and 21, read out in response to a command from the processing unit 24, and stored in the image memory 23.

処理部24は、CPUやその周辺回路を含むものである。メモリ25は、EEPROMなどの不揮発性メモリであって、プログラム(装置の動作を統括するプログラム、各画像処理項目を実行するプログラム、画像処理のシーケンスなど)、3次元計測のためのパラメータ(3次元座標算出の演算式の係数にあたるもの)、その他、計測に必要な種々のデータファイルが保存される。処理部24は、画像メモリ23に格納された画像A0,A1に対し、後記するシーケンスに従った処理を実行して、ワークWの計測や判別処理を実行する。   The processing unit 24 includes a CPU and its peripheral circuits. The memory 25 is a non-volatile memory such as an EEPROM, and includes a program (a program that controls the operation of the apparatus, a program that executes each image processing item, an image processing sequence, etc.), and a parameter (three-dimensional) for three-dimensional measurement. Various other data files necessary for measurement are stored. The processing unit 24 performs processing according to a sequence described later on the images A0 and A1 stored in the image memory 23, and performs workpiece W measurement and discrimination processing.

表示制御部26は、画像入力部20,21から画像A0,A1の供給を受けて、これらの画像を含む表示用画面を生成し、これをモニタ3に表示させる。処理部24は、適宜、表示制御部26を制御して、画像A0,A1とともに計測結果や検査結果を表示させ、また、後記する設定用の画面を表示させる。   The display control unit 26 receives the images A0 and A1 from the image input units 20 and 21, generates a display screen including these images, and causes the monitor 3 to display the display screen. The processing unit 24 appropriately controls the display control unit 26 to display the measurement result and the inspection result together with the images A0 and A1, and displays a setting screen described later.

出力部27は、計測処理や判定処理の結果を、PLCなどの外部機器に出力するための出力用インターフェースである。   The output unit 27 is an output interface for outputting the results of measurement processing and determination processing to an external device such as a PLC.

この実施例の検査装置では、計測や検査のために実行される各種の処理について、複数種の処理項目を用意し、これらの処理項目およびその実行順序をユーザーに選択させることによって、画像入力から処理結果を出力する処理までの一連のシーケンスを組み立てられるようにしている。   In the inspection apparatus of this embodiment, a plurality of types of processing items are prepared for various types of processing executed for measurement and inspection, and the user can select these processing items and the execution order thereof from image input. A series of sequences up to the process of outputting the processing result can be assembled.

図4は、シーケンスの設定に関するシステム構成を示す。
このシステムは、処理項目テーブル201、シーケンス保存部202、プログラム記憶部203、指定操作受付部204、シーケンス組立部205、シーケンス実行部206、処理結果出力部207などにより構成される。ここで、処理項目テーブル201、シーケンス保存部202、プログラム記憶部203は、メモリ25にファイルとして保存されるものであり、その他の構成は、メモリ25に記憶されている装置の動作を統括するプログラムにより処理部24に設定される機能である。
FIG. 4 shows a system configuration relating to sequence setting.
This system includes a processing item table 201, a sequence storage unit 202, a program storage unit 203, a designation operation reception unit 204, a sequence assembly unit 205, a sequence execution unit 206, a processing result output unit 207, and the like. Here, the processing item table 201, the sequence storage unit 202, and the program storage unit 203 are stored as files in the memory 25, and other configurations are programs that control the operation of the device stored in the memory 25. This is a function set in the processing unit 24.

処理項目テーブル201には、処理の目的毎に複数の処理項目が登録される。図5は、この処理項目テーブルの一例を示すもので、『画像入力関連』、『位置修正関連』、『一般計測関連』などの処理の種類毎に、それぞれ具体的な処理項目が設定されている。   A plurality of processing items are registered in the processing item table 201 for each purpose of processing. FIG. 5 shows an example of this processing item table, in which specific processing items are set for each type of processing such as “image input related”, “position correction related”, and “general measurement related”. Yes.

このテーブルにおいて、『画像入力関連』に属する各処理項目は、処理対象の画像を取得するという目的に対応する。『位置修正関連』に属する各処理項目は、画像中のワーク上の計測対象部位の位置ずれを修正することにより、計測対象部位が画像中の一定の位置にあるようにするという目的に対応する。   In this table, each processing item belonging to “related to image input” corresponds to the purpose of acquiring an image to be processed. Each processing item belonging to “position correction related” corresponds to the purpose of correcting the positional deviation of the measurement target part on the workpiece in the image so that the measurement target part is at a certain position in the image. .

また『一般計測関連』に属する各処理項目は、計測対象部位について計測を行うという目的に対応するもので、さらに『位置決め』と『計測』という2種類の処理に区別される。このうち、『位置決め』は、画像A0上で計測対象位置を特定することを目的にした処理である。
『位置決め』に属する処理項目を実行することにより特定される位置は、3次元計測のために用いることができるが、画像A0上での2次元的な位置計測自体を目的として、『位置決め』に属する処理項目が実行される場合もある。計測された2次元的な位置は、画像A0上の2点間の寸法の算出などに用いることもできる。
Further, each processing item belonging to “general measurement related” corresponds to the purpose of performing measurement on the measurement target part, and is further classified into two types of processing, “positioning” and “measurement”. Among these, “positioning” is a process aimed at specifying a measurement target position on the image A0.
The position specified by executing the processing item belonging to “positioning” can be used for three-dimensional measurement. However, for the purpose of two-dimensional position measurement on the image A0, “positioning” is used. The process item to which it belongs may be executed. The measured two-dimensional position can also be used for calculating a dimension between two points on the image A0.

『計測』は、3次元計測を行う場合には、画像A1上で、画像A0側で特定された計測対象位置に対応する位置を見つけ、その計測対象位置の3次元座標を算出することを目的とする処理である。また、画像A0を対象として、計測対象部位の面積を求める処理や平均濃度を求める処理のような2次元計測を目的とする処理も、『計測』に属する処理項目に設定される。   The purpose of “measurement” is to find a position corresponding to the measurement target position specified on the image A0 side and calculate the three-dimensional coordinates of the measurement target position when performing three-dimensional measurement. It is processing to. In addition, processing for the purpose of two-dimensional measurement, such as processing for obtaining the area of the measurement target region and processing for obtaining the average density for the image A0, is also set as a processing item belonging to “measurement”.

図4に戻って、プログラム記憶部203には、処理項目テーブル201に登録された処理項目毎に、それぞれその項目の処理を実行するためのプログラムが格納される。
指定操作受付部204は、処理項目テーブル201から各種処理項目を読み出してモニタ3に表示し、コンソール4による指定操作を受け付ける。この指定操作は、使用する処理項目を選択するとともに、その実行順序を指定するものである。
Returning to FIG. 4, for each processing item registered in the processing item table 201, a program for executing processing of the item is stored in the program storage unit 203.
The designation operation accepting unit 204 reads out various process items from the process item table 201 and displays them on the monitor 3 and accepts a designation operation by the console 4. This designation operation selects a processing item to be used and designates its execution order.

シーケンス組立部205は、指定操作受付部204から受け付けた指定内容を渡されて、その指定に応じたシーケンスを組み立てる。組み立てられたシーケンスは、シーケンス保存部202に登録される。シーケンスは、具体的には、指定された処理項目に対応するコード情報を指定された順番に配列したデータ構成となる。
処理項目テーブル201、シーケンス保存部202、指定操作受付部204、シーケンス組立部205は、シーケンス設定手段に相当し、シーケンス実行部206は、シーケンス実行手段に相当する。
The sequence assembling unit 205 receives the designation content received from the designation operation accepting unit 204 and assembles a sequence according to the designation. The assembled sequence is registered in the sequence storage unit 202. Specifically, the sequence has a data configuration in which code information corresponding to a specified processing item is arranged in a specified order.
The processing item table 201, the sequence storage unit 202, the designation operation reception unit 204, and the sequence assembly unit 205 correspond to a sequence setting unit, and the sequence execution unit 206 corresponds to a sequence execution unit.

シーケンス実行部206は、シーケンス組立部205に保存されたシーケンスを読み出した後、プログラム記憶部203からそのシーケンスを構成する処理項目に対応するプログラムを順次読み出して実行する。処理結果出力部207は、このシーケンスの実行により最終的に得られた処理結果を出力する。   The sequence execution unit 206 reads out the sequence stored in the sequence assembly unit 205, and then sequentially reads out and executes programs corresponding to the processing items constituting the sequence from the program storage unit 203. The processing result output unit 207 outputs the processing result finally obtained by executing this sequence.

また、シーケンス保存部202には、よく利用される複数の計測目的について、それぞれ画像入力から2次元計測や3次元計測までの流れを示す処理項目のシーケンスがあらかじめ登録されている。以下では、これらを「基本シーケンス」という。   In the sequence storage unit 202, a sequence of processing items indicating the flow from image input to two-dimensional measurement or three-dimensional measurement is registered in advance for a plurality of frequently used measurement purposes. Hereinafter, these are referred to as “basic sequences”.

指定操作受付部204は、シーケンス保存部202に登録されている各種のシーケンス(基本シーケンスを含む。)を呼び出して表示し、選択操作を受け付けることもできる。ここでひとつのシーケンスが選択され、これを実行するように指定された場合には、指定操作受付部204からシーケンス実行部206に処理が移り、選択されたシーケンスが実行される。   The designation operation accepting unit 204 can call and display various sequences (including a basic sequence) registered in the sequence storage unit 202 and accept a selection operation. Here, when one sequence is selected and designated to be executed, the process proceeds from the designation operation accepting unit 204 to the sequence executing unit 206, and the selected sequence is executed.

指定操作受付部204では、シーケンスの選択後に、処理項目を追加する操作や、一部の処理項目を差し替える操作などを受け付けることもできる。この場合には、シーケンスの選択結果やその後の操作内容はシーケンス組立部205に渡され、選択されたシーケンスの編集処理が行われる。基本シーケンスについても、処理項目の追加、変更、削除などを自由に行うことができる。
編集されたシーケンスは、前のシーケンスに置き換えて登録されるが、新たなシーケンスとして登録することもできる。
The designation operation accepting unit 204 can accept an operation for adding a processing item, an operation for replacing some processing items, and the like after a sequence is selected. In this case, the sequence selection result and subsequent operation contents are transferred to the sequence assembling unit 205, and editing processing of the selected sequence is performed. With respect to the basic sequence, processing items can be freely added, changed, and deleted.
The edited sequence is registered in place of the previous sequence, but can be registered as a new sequence.

図6は、シーケンス保存部202に登録されたシーケンスのメニュー表示例を示す。ここでは、メニュー中の各シーケンスはシーンと呼ばれ、それぞれ個別の「シーン名」(『エッジ位置』など)が付与されている。図6の表示例では、0〜3の各欄に3次元計測の基本シーケンスが登録されているが、4〜7の欄は未登録であり、「シーン4」等の初期名称が表示されている。基本シーケンス以外のシーケンスが登録されると、この画面の4欄以降に、新たなシーン名が表示される。   FIG. 6 shows a menu display example of a sequence registered in the sequence storage unit 202. Here, each sequence in the menu is called a scene, and an individual “scene name” (such as “edge position”) is assigned to each sequence. In the display example of FIG. 6, the basic sequence of 3D measurement is registered in each of the columns 0 to 3, but the columns 4 to 7 are not registered, and an initial name such as “scene 4” is displayed. Yes. When a sequence other than the basic sequence is registered, a new scene name is displayed in the fourth and subsequent columns of this screen.

ここで図6に示されている3次元計測の基本シーケンスについて、簡単に説明する。
『エッジ位置』は、計測対象部位のエッジ点の3次元座標を計測する場合に適用されるもので、各画像A0,A1上で計測対象とするエッジ点の位置を特定し、このエッジ点の3次元座標を算出する。
『パターン』は、文字、図柄など一定のパターンが含まれる部位を計測する場合に適用されるもので、画像A0,A1からあらかじめ登録されたモデルのパターン(以下、単に「モデル」という。)に対応する領域の代表位置を特定し、この代表位置の3次元座標を算出する。
Here, the basic sequence of the three-dimensional measurement shown in FIG. 6 will be briefly described.
The “edge position” is applied when measuring the three-dimensional coordinates of the edge point of the measurement target part. The position of the edge point to be measured is specified on each of the images A0 and A1, and the edge point is determined. Three-dimensional coordinates are calculated.
The “pattern” is applied when measuring a part including a certain pattern such as a character or a design, and is a model pattern (hereinafter simply referred to as “model”) registered in advance from the images A0 and A1. The representative position of the corresponding area is specified, and the three-dimensional coordinates of this representative position are calculated.

『高さ計測』は、計測対象部位のパターンが一定でない(ワークごとに異なる)ような場合に適用されるもので、あらかじめ指定された位置情報に基づき画像A0中の計測対象領域とその代表位置を特定し、その領域内のパターンを取得した後、画像A1上で、画像A0から取得したパターンに対応する領域を探索してその代表位置を特定し、両画像における代表位置からその代表位置の3次元座標を算出する。この処理項目は、カメラC0を正面視(垂直視)の配置にして高さ情報(Z座標)を取得することを目的にすることが多いことから、高さ計測とよばれている。
『多点高さ計測』は、基本的には『高さ計測』と同様のものであるが、指定された領域内の複数点の高さを計測する目的で使用される。
“Height measurement” is applied when the pattern of the measurement target part is not constant (different for each workpiece), and the measurement target region and its representative position in the image A0 based on the position information specified in advance. After the pattern in the area is acquired, the area corresponding to the pattern acquired from the image A0 is searched on the image A1, the representative position is specified, and the representative position of the representative position in both images is determined. Three-dimensional coordinates are calculated. This processing item is often referred to as height measurement because it is often intended to acquire height information (Z coordinate) with the camera C0 placed in a front view (vertical view).
“Multi-point height measurement” is basically the same as “height measurement”, but is used for the purpose of measuring the height of a plurality of points in a specified area.

上記の表示メニューからいずれかのシーケンスが選択されると、モニタの画面は、その選択されたシーケンスの内容を示す表示に切り替えられる。   When any sequence is selected from the display menu, the monitor screen is switched to a display showing the contents of the selected sequence.

図7(1)は、図6の『エッジ位置』が選択された場合の表示画面を示すもので、実行すべき処理項目が実行順序を示す数字(0,1,2,3)とともに表示されている。図7(2)は、この表示されているシーケンスをフローチャートに置き換えて表したもので、ステップ0〜3は、それぞれ実行順序を表す数字に対応する。以下、このフローチャートを用いて、『エッジ位置』の処理の流れを説明する。   FIG. 7 (1) shows a display screen when “edge position” in FIG. 6 is selected, and processing items to be executed are displayed together with numbers (0, 1, 2, 3) indicating the execution order. ing. FIG. 7B shows the displayed sequence replaced with a flowchart. Steps 0 to 3 correspond to numbers representing the execution order. Hereinafter, the flow of processing of “edge position” will be described using this flowchart.

まず、最初のステップ0(ステレオカメラ画像入力)では、各カメラC0,C1を駆動して画像A0,A1を生成し、そのうちの画像A0を画像メモリ23に格納する。画像A1も画像入力部11の画像バッファ内に保持される。   First, in the first step 0 (stereo camera image input), the cameras C0 and C1 are driven to generate images A0 and A1, and the image A0 is stored in the image memory 23. The image A1 is also held in the image buffer of the image input unit 11.

つぎのステップ1(濃淡エッジ位置)では、画像A0における計測対象領域内について2値化および投影処理を実行することにより、エッジの位置のx,y座標を特定する。
つぎのステップ2(カメラ切替)では、カメラC1に対応する画像入力部11の画像バッファから画像A1を読み出して、この画像により画像メモリ23を書き替える。
In the next step 1 (light / dark edge position), the x and y coordinates of the edge position are specified by executing binarization and projection processing within the measurement target region in the image A0.
In the next step 2 (camera switching), the image A1 is read from the image buffer of the image input unit 11 corresponding to the camera C1, and the image memory 23 is rewritten with this image.

つぎのステップ3(ステレオエッジ位置)では、画像A1を処理対象として、カメラC0,C1間のカメラ座標系の関係に基づき、ステップ1で特定したエッジ位置に対応する位置を特定する。そして、画像A0上で特定した位置と画像A1上で特定した位置とを用いて3次元座標を算出する。   In the next step 3 (stereo edge position), a position corresponding to the edge position specified in step 1 is specified based on the relationship of the camera coordinate system between the cameras C0 and C1 with the image A1 as a processing target. Then, the three-dimensional coordinates are calculated using the position specified on the image A0 and the position specified on the image A1.

図8(1)は、図6のメニュー表示中の『パターン』が選択された場合のモニタ3の表示例を示し、図8(2)は、この表示画面に表される処理内容をフローチャートに置き換えて示す。以下、このフローチャートに沿って、『パターン』の処理の流れを説明する。   FIG. 8A shows a display example of the monitor 3 when “Pattern” in the menu display of FIG. 6 is selected, and FIG. 8B is a flowchart showing the processing contents displayed on this display screen. Replaced and shown. Hereinafter, the flow of the “pattern” process will be described with reference to this flowchart.

最初のステップ0(ステレオカメラ画像入力)では、『エッジ位置』のステップ0と同様に、各カメラC0,C1を駆動して画像A0,A1を生成し、そのうちの画像A0を画像メモリ23に格納する。   In the first step 0 (stereo camera image input), as in step 0 of “edge position”, the cameras C0 and C1 are driven to generate images A0 and A1, and the image A0 is stored in the image memory 23. To do.

つぎのステップ1(高精度ECM(Edge Code Model )サーチ)では、画像A0を対象として、あらかじめ登録したモデル画像との一致の程度が高い(モデル画像とマッチングする)領域の代表位置(例えば領域の中心位置)を特定する。この処理は、画像A0を微分処理して濃度の微分値が一定値以上の点を抽出し、さらにそれらの点における濃度勾配の方向(角度データEC(Edge Code )として表される。)を算出した後、角度データECの分布パターンをモデル画像における角度データECの分布パターンと照合する方法により行われる。詳しい処理方法については、下記の特許文献3を参照されたい。   In the next step 1 (high-precision ECM (Edge Code Model) search), the representative position (for example, the region of the region) of the image A0 having a high degree of matching with the model image registered in advance (matching the model image) is targeted. Specify the center position. In this process, the image A0 is differentiated to extract points where the differential value of density is a certain value or more, and the direction of the density gradient at those points (expressed as angle data EC (Edge Code)) is calculated. Then, the method is performed by a method of collating the distribution pattern of the angle data EC with the distribution pattern of the angle data EC in the model image. Refer to the following Patent Document 3 for the detailed processing method.

特開2002−230549号公報JP 2002-230549 A

つぎのステップ2(カメラ切替)では、『エッジ位置』のステップ2と同様に、カメラC1側の画像A1により画像メモリ23を書き替える。
つぎのステップ3(ステレオ高精度ECMサーチ)では、画像A1を処理対象として、画像A0に対して実行したのと同様の方法でモデル画像との一致の程度が高い領域の代表位置(例えば領域の中心位置)を特定する。そして、画像A0上で特定した位置と画像A1上で特定した位置とを用いて3次元座標を算出する。
In the next step 2 (camera switching), the image memory 23 is rewritten with the image A1 on the camera C1 side in the same manner as in step 2 of “edge position”.
In the next step 3 (stereo high-precision ECM search), the representative position (for example, the region of the region) having a high degree of coincidence with the model image in the same manner as that performed on the image A0 with the image A1 as a processing target. Specify the center position. Then, the three-dimensional coordinates are calculated using the position specified on the image A0 and the position specified on the image A1.

その他の3次元計測の基本シーケンスも同様に、まずカメラC0側の画像A0を処理対象として、3次元計測の対象となる点の位置または領域の代表位置を特定する処理を実行した後、画像A1に処理対象を切り替えて、画像A0側で特定した位置に対応する点の位置または領域の代表位置を求め、3次元座標またはZ座標の算出処理を実行するように設定されている。   Similarly, in other basic three-dimensional measurement sequences, first, the image A1 on the camera C0 side is set as a processing target, and the processing for specifying the position of the point or the representative position of the region that is the target of the three-dimensional measurement is performed. The processing target is switched to obtain the position of the point or the representative position of the region corresponding to the position specified on the image A0 side, and the calculation processing of the three-dimensional coordinate or the Z coordinate is executed.

図5に示した処理項目テーブル201によれば、図7,8のステップ0およびステップ2は、画像入力関連の処理項目に相当する。また、ステップ1は、位置決め関連の処理項目に相当し、ステップ3は計測関連の処理項目に相当する。この実施例の検査装置の構成で3次元計測を実施するには、このステップ0〜3に対応する処理項目を選択することを要する(ただし、画像メモリに双方の画像A0,A1を格納できるならば、ステップ2は不要となる。)。   According to the processing item table 201 shown in FIG. 5, Steps 0 and 2 in FIGS. 7 and 8 correspond to processing items related to image input. Step 1 corresponds to a processing item related to positioning, and Step 3 corresponds to a processing item related to measurement. In order to perform three-dimensional measurement with the configuration of the inspection apparatus of this embodiment, it is necessary to select processing items corresponding to steps 0 to 3 (provided that both images A0 and A1 can be stored in the image memory). Step 2 is not necessary.

3次元計測の基本シーケンスでは、上記ステップ0〜3の各処理に対応する処理項目が既に選択されているので、ユーザーは、ワークWの被検査部位の位置を特定するための条件や計測目的に適した基本シーケンスを選択することにより、その目的に応じた計測処理を行うことができる。   In the basic sequence of the three-dimensional measurement, since the processing items corresponding to the processes in steps 0 to 3 are already selected, the user can use the conditions and measurement purposes for specifying the position of the part to be inspected of the workpiece W. By selecting a suitable basic sequence, measurement processing according to the purpose can be performed.

1つのシーケンスの中で、位置決め関連の処理項目および計測関連の処理項目をそれぞれ複数選択することも可能である。たとえば、位置決め関連として、『エッジ位置』と『高精度ECMサーチ』とを選択し、計測関連として『ステレオエッジ位置』と『ステレオ高精度ECMサーチ』とを選択することができる。この場合には、『エッジ位置』の処理で特定された位置が『ステレオエッジ位置』の処理に与えられて『ステレオエッジ位置』の処理で対応位置の特定と3次元座標算出が行われ、また、『高精度ECMサーチ』の処理で特定された位置が『ステレオ高精度ECMサーチ』の処理に与えられて『ステレオ高精度ECMサーチ』の処理で対応位置の特定と3次元座標算出が行われる。   It is also possible to select a plurality of positioning-related processing items and measurement-related processing items in one sequence. For example, “edge position” and “high-precision ECM search” can be selected as positioning relation, and “stereo edge position” and “stereo high-precision ECM search” can be selected as measurement relation. In this case, the position specified in the “edge position” process is given to the “stereo edge position” process, and the corresponding position is specified and the three-dimensional coordinates are calculated in the “stereo edge position” process. The position specified in the “high-precision ECM search” process is given to the “stereo high-precision ECM search” process, and the corresponding position is specified and the three-dimensional coordinates are calculated in the “stereo high-precision ECM search” process. .

さらに、1つのシーケンスの中で、同種の処理を複数設定することも可能である。たとえば、同じ『高精度ECMサーチ』の処理を複数設定し、それと同数の『ステレオ高精度ECMサーチ』の処理を設定することもできる。この場合、対となる『高精度ECMサーチ』(位置決め)の処理と『ステレオ高精度ECMサーチ』(計測)の処理ごとに、3次元座標が算出される。   Furthermore, it is possible to set a plurality of processes of the same type in one sequence. For example, a plurality of the same “high-precision ECM search” processes can be set, and the same number of “stereo high-precision ECM search” processes can be set. In this case, three-dimensional coordinates are calculated for each of the paired “high-precision ECM search” (positioning) processing and “stereo high-precision ECM search” (measurement) processing.

どの位置決め処理(第1画像上位置特定処理)とどの計測処理(第2画像上位置特定処理)とを対にして3次元計測を行うのかは、特定される必要がある。具体的には、各計測処理についての設定事項の中に、それぞれその処理に対応する位置決め処理がシーケンス中の何番目の処理であるかを示す数値が含められる。   It is necessary to specify which positioning process (first image position specifying process) and which measurement process (second image position specifying process) are to be used for the three-dimensional measurement. Specifically, the setting items for each measurement process include a numerical value indicating the number of the process in the sequence corresponding to the positioning process.

また、他の実施形態として、画像メモリ23に画像A0と画像A1とを同時に格納できるようにした場合には、「カメラ切替」のステップを設ける必要がないので、シーケンスの中で位置決め処理と3次元計測処理とがこの順序で連続して設定されたときに、これらの処理を対として扱うようにしてもよい。   As another embodiment, when the images A0 and A1 can be stored in the image memory 23 at the same time, there is no need to provide a “camera switching” step. When the dimension measurement process is continuously set in this order, these processes may be handled as a pair.

図7、図8の基本シーケンスには、3次元計測に必須の処理項目しか設定されていないが、必要に応じてその他の処理項目を追加することもできる。
図9は、図7の『エッジ位置』の基本シーケンスに位置修正関連の処理項目を追加する例を示す。以下、この図9の流れに沿って、処理項目を追加する場合のユーザーの操作の手順を説明する。
Only basic processing items essential for three-dimensional measurement are set in the basic sequences of FIGS. 7 and 8, but other processing items can be added as necessary.
FIG. 9 shows an example in which processing items related to position correction are added to the basic sequence of “edge position” in FIG. In the following, a user operation procedure for adding a processing item will be described along the flow of FIG.

まず、ユーザーは、新たに加える処理の直後に実行される処理項目にカーソル31を合わせ(図9の(A))、編集操作を行う(この例では、シフトキーとエンターキーとを同時に操作する)。この編集操作が行われると、表示画面には、図9(B)に示すように、選択ボックス32が設定され、その内部に編集方法を示すワード(変更、挿入など)が表示される。   First, the user moves the cursor 31 to a process item to be executed immediately after the newly added process ((A) of FIG. 9) and performs an editing operation (in this example, the shift key and the enter key are operated simultaneously). . When this editing operation is performed, as shown in FIG. 9B, a selection box 32 is set on the display screen, and a word (change, insertion, etc.) indicating the editing method is displayed therein.

ここでユーザーが選択ボックス32中の『挿入』を選択すると、図9(C)に示すように、選択ボックス32の表示が切り替えられ、処理項目テーブル201の種別欄に設定された項目が表示される。この表示に対し、ユーザーが所定の項目(図示例では『位置修正関連』)を選択すると、図9(D)に示すように、新たな選択ボックス33が設定されて、その内部に選択された種別に含まれる処理項目が表示される。この中からユーザーが所望の項目(図示例では『モデル位置修正』)を選択すると、図9(E)に示すように、基本シーケンス中のカーソル31で指定された位置に、選択された処理項目が挿入される。   Here, when the user selects “Insert” in the selection box 32, the display of the selection box 32 is switched as shown in FIG. 9C, and the items set in the type column of the processing item table 201 are displayed. The In response to this display, when the user selects a predetermined item (in the illustrated example, “position correction related”), as shown in FIG. 9D, a new selection box 33 is set and selected inside the box. The processing items included in the type are displayed. When the user selects a desired item (“model position correction” in the illustrated example) from among these, as shown in FIG. 9E, the selected processing item is located at the position designated by the cursor 31 in the basic sequence. Is inserted.

図9(B)の選択ボックス32において、『変更』を選択すると、現在選択中の処理項目(濃淡エッジ位置)を他の処理項目に置き換えることができる。また『削除』を選択することにより、選択中の処理項目を削除することができる。また『コピー』を選択することにより、選択中の処理項目を記憶して、他のステップに同じ項目を設定することが可能になる。このコピー機能は、図1,2に示したワークWのように、複数の計測対象部位(ICのリード)が存在し、これらの計測対象部位毎に計測位置を特定しなければならないような場合に利用することができる。   When “Change” is selected in the selection box 32 in FIG. 9B, the currently selected process item (light / dark edge position) can be replaced with another process item. Also, by selecting “Delete”, the selected processing item can be deleted. Also, by selecting “Copy”, it becomes possible to store the processing item being selected and set the same item in other steps. This copy function is used when there are a plurality of measurement target parts (IC leads) and the measurement position must be specified for each measurement target part as in the workpiece W shown in FIGS. Can be used.

さらに、上記では、基本シーケンスを編集する例について説明したが、基本シーケンスに頼らずに、処理項目テーブル201から直接必要な処理項目を読み出してシーケンスの完全マニュアル設定を行う場合にも、図9と同様の選択ボックス32,33が表示されるので、ユーザーは、必要な処理項目を迷わずに選択することができる。   Furthermore, in the above description, an example of editing a basic sequence has been described. However, when a necessary process item is read directly from the process item table 201 and the sequence is completely set manually without depending on the basic sequence, FIG. Since similar selection boxes 32 and 33 are displayed, the user can select a necessary processing item without hesitation.

さらに、処理項目テーブル201には、3次元計測のための処理に限らず、2次元計測用の処理項目も登録されている。たとえば、ワークWに記された文字の印字状態を検査するための処理項目として、パターンマッチング処理が登録されていたり、キズや欠けなどの不良を検出するための処理項目として、濃度平均値や濃度偏差の算出処理が登録されていたりする。これらの処理項目についても、3次元計測の処理項目とともにシーケンス内に組み込むことにより、2次元および3次元の計測処理を効率良く実行することができる。   Furthermore, in the process item table 201, not only a process for three-dimensional measurement but also a process item for two-dimensional measurement is registered. For example, a pattern matching process is registered as a processing item for inspecting the printing state of characters written on the workpiece W, and a density average value or a density is a processing item for detecting defects such as scratches or chipping. Deviation calculation processing is registered. By incorporating these processing items in the sequence together with the three-dimensional measurement processing items, the two-dimensional and three-dimensional measurement processing can be efficiently executed.

図10は、図7の『エッジ位置』の基本シーケンスに2次元計測のための処理を加えた例を示す。この例では、ステップ0の『ステレオカメラ画像入力』の後に2次元計測に関する処理項目として『濃度平均/偏差』が設定され、以下、基本シーケンスと同様の処理項目が設定されている。   FIG. 10 shows an example in which processing for two-dimensional measurement is added to the basic sequence of “edge position” in FIG. In this example, after “stereo camera image input” in step 0, “density average / deviation” is set as a processing item related to two-dimensional measurement, and processing items similar to those in the basic sequence are set.

編集されたこのシーケンスによれば、先に画像メモリ23に格納された画像A0を処理対象として、濃度平均および偏差を算出する処理が実行された後、同じ画像A0を用いて3次元計測の対象位置が特定され、その後に画像A1に対する処理に移行するから、2次元計測にも3次元計測と同じ画像を使用することができる。また、画像メモリ23に対する書き替え回数を、基本シーケンスと同様に1回にできるから、処理の遅延を防止することができる。   According to this edited sequence, the processing for calculating the average density and the deviation is executed with the image A0 stored in the image memory 23 as the processing target, and then the three-dimensional measurement target using the same image A0. Since the position is specified and then the process proceeds to the process for the image A1, the same image as the three-dimensional measurement can be used for the two-dimensional measurement. In addition, since the number of rewrites to the image memory 23 can be reduced to one as in the basic sequence, processing delay can be prevented.

ここからは、今まで述べてきた実施例についてさらに詳細に説明する。以下では、カメラC0からの画像A0を「正面視画像A0」といい、カメラC1からの画像A1を「斜視画像A1」という。   From here, the embodiments described so far will be described in more detail. Hereinafter, the image A0 from the camera C0 is referred to as “front-view image A0”, and the image A1 from the camera C1 is referred to as “perspective image A1”.

図11は、検査装置の全体構成を示すブロック図であり、図3の内容をさらに詳細に示すものである。図3と重複する部分については説明を省略する。この検査装置には、装置内コンピュータ200が設けられている。   FIG. 11 is a block diagram showing the overall configuration of the inspection apparatus, and shows the details of FIG. 3 in more detail. A description of the same parts as those in FIG. 3 is omitted. This inspection apparatus is provided with an in-device computer 200.

装置内コンピュータ200は、カメラC0,C1毎の画像を用いた計測処理を実行した後、その処理結果からワークWの適否を判定する。装置内コンピュータ200には、画像A0,A1を格納するための画像メモリ23のほか、画像処理部41、計測処理部42、判定部43、表示制御部26、パラメータ算出部44、パラメータ記憶部45などが設けられる。画像メモリ23およびパラメータ記憶部45以外の各部は、専用のプログラムにより装置内コンピュータ200に設定された機能である。画像メモリ23やパラメータ記憶部45は、装置内コンピュータ200のメモリ(RAM、EEPROMなど)に設定される。   The in-apparatus computer 200 executes the measurement process using the images for the cameras C0 and C1, and then determines whether the work W is appropriate based on the processing result. In addition to the image memory 23 for storing the images A0 and A1, the in-device computer 200 includes an image processing unit 41, a measurement processing unit 42, a determination unit 43, a display control unit 26, a parameter calculation unit 44, and a parameter storage unit 45. Etc. are provided. Each unit other than the image memory 23 and the parameter storage unit 45 is a function set in the in-device computer 200 by a dedicated program. The image memory 23 and the parameter storage unit 45 are set in the memory (RAM, EEPROM, etc.) of the in-device computer 200.

上記構成のうち、画像処理部41,計測処理部42,判定部43,パラメータ算出部44,パラメータ記憶部45は、図3の処理部24に対応する。また図11には示していないが、装置内コンピュータ200には、検査に必要な情報(検査領域の設定条件やモデルの画像など)を登録するためのメモリ(図3のメモリ25に対応する。)も設けられる。この登録用メモリへの登録処理や、装置内コンピュータ200の各部が実行する処理の設定または変更は、適宜、コンソール4の操作に応じて行うことができる。   Of the above configuration, the image processing unit 41, the measurement processing unit 42, the determination unit 43, the parameter calculation unit 44, and the parameter storage unit 45 correspond to the processing unit 24 in FIG. Although not shown in FIG. 11, the in-device computer 200 corresponds to a memory (memory 25 in FIG. 3) for registering information (inspection area setting conditions, model images, etc.) necessary for the inspection. ) Is also provided. Setting or changing the registration processing in the registration memory and the processing executed by each unit of the in-device computer 200 can be appropriately performed according to the operation of the console 4.

画像処理部41は、2値化、エッジ抽出、パターンマッチングなどにより、ワークWの検査対象部位の構成点を抽出する。計測処理部42は、画像処理部41により抽出された検査対象部位につき、位置や大きさなどを計測する処理を実行する。画像処理部41および計測処理部42は、2次元および3次元の処理を選択して実行できるように設定されている。   The image processing unit 41 extracts constituent points of the inspection target part of the workpiece W by binarization, edge extraction, pattern matching, and the like. The measurement processing unit 42 executes processing for measuring the position, size, and the like of the inspection target part extracted by the image processing unit 41. The image processing unit 41 and the measurement processing unit 42 are set so that two-dimensional and three-dimensional processing can be selected and executed.

判定部43は、計測処理部42の計測結果を所定のしきい値と比較するなどして、ワークWの良否を判定する。この計測結果や判定結果は出力部27および表示制御部26に出力される。
表示制御部26は、モニタ3の表示動作を制御するためのもので、画像入力部20,21で生成された正面視画像A0,斜視画像A1を一画面内に並列表示させることができる。さらに、適宜、画像処理部41、計測処理部42、判定部43の処理結果を受け取って、画像とともに表示させることができる。
The determination unit 43 determines the quality of the workpiece W by comparing the measurement result of the measurement processing unit 42 with a predetermined threshold value. The measurement results and determination results are output to the output unit 27 and the display control unit 26.
The display control unit 26 controls the display operation of the monitor 3 and can display the front view image A0 and the perspective image A1 generated by the image input units 20 and 21 in parallel on one screen. Furthermore, the processing results of the image processing unit 41, the measurement processing unit 42, and the determination unit 43 can be appropriately received and displayed together with the image.

パラメータ記憶部45には、3次元計測のための演算式に含まれる各種係数が保存される。これらの係数の値は、各カメラC0,C1により構成されるステレオ座標系と実際の空間における位置を表す空間座標系との関係(各座標間の原点間の距離、空間座標系に対するステレオ座標系の回転ずれ量など)に応じて変動する(以下、これらの係数を「パラメータ」という。)。これらのパラメータは、検査に先立ち、画像処理部41およびパラメータ算出部44により算出され、パラメータ記憶部45に格納される。このパラメータを算出する処理では、複数の特徴点を有するキャリブレーション用ワークが使用される。
さらに、パラメータ記憶部45には、後記する演算式(1)のホモグラフィ行列を構成するパラメータも登録される。
The parameter storage unit 45 stores various coefficients included in the arithmetic expression for three-dimensional measurement. The values of these coefficients are the relationship between the stereo coordinate system constituted by the cameras C0 and C1 and the spatial coordinate system representing the position in the actual space (the distance between the origins between the coordinates, the stereo coordinate system for the spatial coordinate system). (Hereinafter, these coefficients are referred to as “parameters”). These parameters are calculated by the image processing unit 41 and the parameter calculation unit 44 and stored in the parameter storage unit 45 prior to the inspection. In the process of calculating this parameter, a calibration work having a plurality of feature points is used.
Further, the parameter storage unit 45 also registers parameters constituting a homography matrix of the arithmetic expression (1) described later.

この実施例の検査装置は、ユーザーに複数種の検査メニュー(処理項目や登録済みの処理項目のシーケンス)を提示して選択操作を受け付けることにより、検査のアルゴリズム(シーケンス)を組み立てることが可能である。また、検査対象の部位に応じて、2次元の計測処理による検査と3次元の計測処理による検査とを、選択して実行することができる。2次元の計測処理による検査では、カメラC0からの正面視画像A0を対象として、パターンマッチング処理、2値化処理、エッジ抽出処理などを実行し、ワーク全体またはワーク中の検査対象部位を抽出する。   The inspection apparatus of this embodiment can assemble an inspection algorithm (sequence) by presenting a plurality of types of inspection menus (sequences of processing items and registered processing items) to the user and accepting a selection operation. is there. In addition, an inspection by a two-dimensional measurement process and an inspection by a three-dimensional measurement process can be selected and executed according to the region to be inspected. In the inspection by the two-dimensional measurement processing, pattern matching processing, binarization processing, edge extraction processing, etc. are executed on the front view image A0 from the camera C0, and the entire workpiece or the inspection target portion in the workpiece is extracted. .

さらに、この実施例では、3次元の計測処理による検査にも、カメラC0からの正面視画像A0を有効活用することにより、3次元計測処理を高速化できるようにしている。この点については、後で詳細に説明する。   Further, in this embodiment, the three-dimensional measurement process can be speeded up by effectively using the front-view image A0 from the camera C0 for the inspection by the three-dimensional measurement process. This point will be described in detail later.

以下、上記の検査装置によりICの検査を行う場合を例にして、検査にかかる処理を詳細に説明する。
図12は、ワークWがICである場合に実施される検査の手順を示すものである。この手順は、ワーク検出用のセンサからの検知信号を受けて開始される。最初のST1(STは「ステップ」の略である。以下も同じ。)では、カメラ駆動部12により、カメラC0,C1を同時に駆動して、正面視画像A0,斜視画像A1を生成する。
Hereinafter, an example of a case where an IC is inspected by the above-described inspection apparatus will be described in detail as to the processing related to the inspection.
FIG. 12 shows an inspection procedure performed when the workpiece W is an IC. This procedure is started upon receiving a detection signal from a workpiece detection sensor. In the first ST1 (ST is an abbreviation of “step”. The same applies to the following), the cameras C0 and C1 are simultaneously driven by the camera driving unit 12 to generate the front view image A0 and the perspective image A1.

つぎのST2では、ICのパッケージ部分に印刷された文字を対象とした検査を実行する。この検査では、正面視画像A0のみを用いた2次元の画像処理を実行する。たとえば、パターンマッチング処理により文字の印刷領域を抽出し、そのマッチング時の相関度やマッチング位置から文字の印刷状態の適否を判別する。   In the next ST2, an inspection for characters printed on the package portion of the IC is executed. In this inspection, two-dimensional image processing using only the front-view image A0 is executed. For example, a character print region is extracted by pattern matching processing, and the suitability of the character print state is determined from the degree of correlation at the time of matching and the matching position.

つぎのST3では、ICの両側のリードを検査対象とする。この検査では、正面視画像A0および斜視画像A1の双方を用いた3次元計測処理により各リードの先端部の3次元座標を求め、その算出値から各リードの先端部に浮きや曲がりなどの異常がないかどうかを判別する。   In the next ST3, the leads on both sides of the IC are to be inspected. In this inspection, the three-dimensional coordinates of the tip of each lead are obtained by three-dimensional measurement processing using both the front-view image A0 and the perspective image A1, and abnormalities such as floating and bending at the tip of each lead are calculated from the calculated values. Determine if there is any.

ST2,3の検査が終了すると、ST4では、各検査の結果を外部機器やモニタ3に出力する。さらに、ワーク検出用のセンサによりつぎのICが検出されると、ST1に戻り、上記と同様の手順を実行する。   When the inspections of ST2 and 3 are completed, the result of each inspection is output to an external device or the monitor 3 in ST4. Further, when the next IC is detected by the workpiece detection sensor, the process returns to ST1 and the same procedure as described above is executed.

このように、2台のカメラC0,C1によりそれぞれワークWを1回撮像することにより、2次元計測による検査と3次元計測による検査とを連続で実行することができる。2次元の計測処理では正面視画像A0を使用するから、文字の歪みのない画像を用いて精度の良い計測処理を行うことが可能になる。   In this way, by picking up an image of the workpiece W once by the two cameras C0 and C1, the inspection by the two-dimensional measurement and the inspection by the three-dimensional measurement can be executed continuously. Since the front-view image A0 is used in the two-dimensional measurement process, it is possible to perform a highly accurate measurement process using an image with no character distortion.

3次元計測処理を行う際には、正面視画像A0と斜視画像A1との間で対応する計測対象の点を特定し、その3次元座標を三角測量の原理に基づく演算式にあてはめることにより算出する。   When performing the three-dimensional measurement process, the corresponding measurement target point is identified between the front-view image A0 and the perspective image A1, and the three-dimensional coordinates are calculated by applying the calculation formula based on the principle of triangulation. To do.

図13は、正面視画像A0における検出領域および斜視画像A1における検出領域の設定例を示す。この例でも、図2と同様に、画像の縦方向(正面視画像A0ではリードの配列に沿う方向となる。)をy方向とし、横方向(正面視画像A0ではリードの長さに沿う方向となる。)をx方向とする。正面視画像A0には、リード6毎に個別の検出領域7が設定され、検出領域7毎に、リードの先端に該当するエッジ点が1点特定される。   FIG. 13 shows an example of setting the detection area in the front view image A0 and the detection area in the perspective image A1. In this example as well, as in FIG. 2, the vertical direction of the image (the direction along the lead arrangement in the front view image A0) is the y direction, and the horizontal direction (the direction along the length of the lead in the front view image A0). Is the x direction. In the front-view image A0, an individual detection area 7 is set for each lead 6, and one edge point corresponding to the tip of the lead is specified for each detection area 7.

すなわち、ここではカメラC0、C1がx方向に並んでいるので、視差は主にx方向に発生する。そこで、検出領域7内の画像を2値化し、得られた2値画像をy方向に沿って投影することによって、x方向を横軸、投影された「明」画素数または「暗」画素数を縦軸とするヒストグラムを作る。そして、ヒストグラムの値が急変する箇所のx座標をリード6の先端のx座標とする。一方、リード6の先端のy座標については、検出領域7のy方向の中点のy座標をあてる。ここでは検出領域7内の画像を2値化したが、これに限らず、検出領域7内の画像を濃淡画像のまま各画素の濃度をy方向に積分し、そのようにして得られた積分濃度分布の値がx方向に沿って急変する箇所(たとえばしきい値を横切る箇所)のx座標を求めるようにしてもよい。
このように、検出領域7においては、特定の一方向がエッジの検出対象となる。図13の例では、x方向がエッジの検出方向である。ここでは、正面視画像A0に検出領域7を設定した後に、その検出領域7に対してエッジの検出方向を指定するようにしている。しかし、これに限らず、もともと固有のエッジの検出方向を備える検出領域7を設定するようにしてもよいし、先に検出領域7のエッジ検出方向を指定し、その後、正面視画像A0に検出領域7を設定するようにしてもよい。
That is, here, since the cameras C0 and C1 are arranged in the x direction, parallax mainly occurs in the x direction. Therefore, by binarizing the image in the detection area 7 and projecting the obtained binary image along the y direction, the number of projected “bright” pixels or “dark” pixels is plotted with the x direction as the horizontal axis. Make a histogram with the vertical axis. Then, the x coordinate of the portion where the value of the histogram changes suddenly is set as the x coordinate of the tip of the lead 6. On the other hand, the y coordinate of the midpoint of the detection region 7 in the y direction is assigned to the y coordinate of the tip of the lead 6. Here, the image in the detection area 7 is binarized. However, the present invention is not limited to this. The density of each pixel is integrated in the y direction while the image in the detection area 7 is a grayscale image, and the integration thus obtained is integrated. You may make it obtain | require x coordinate of the location (for example, location which crosses a threshold value) where the value of density distribution changes suddenly along a x direction.
As described above, in the detection region 7, one specific direction is an edge detection target. In the example of FIG. 13, the x direction is the edge detection direction. Here, after the detection area 7 is set in the front-view image A0, the edge detection direction is designated for the detection area 7. However, the present invention is not limited to this, and the detection area 7 having the inherent edge detection direction may be set. Alternatively, the edge detection direction of the detection area 7 may be specified first, and then detected in the front-view image A0. The area 7 may be set.

斜視画像A1でも、リード6毎に検出領域8が設定される。これらの検出領域8は一方の画像上の一点を他方の画像上の一点に変換するための演算式(後記する(1)式)に基づき、正面視画像A0の各検出領域7で特定されたエッジ点の座標やユーザーにより指定された高さ範囲(検査対象部位の高さの取り得る範囲)などを用いて設定される。高さ範囲は、カメラC0の光軸に沿った3次元計測の対象範囲である。   Even in the perspective image A1, a detection region 8 is set for each lead 6. These detection areas 8 are specified in each detection area 7 of the front-view image A0 based on an arithmetic expression (formula (1) described later) for converting one point on one image into one point on the other image. The coordinates are set using the coordinates of the edge point, the height range specified by the user (the range that the height of the inspection target part can take), and the like. The height range is a target range for three-dimensional measurement along the optical axis of the camera C0.

図13では、ワークWの右側のリードに対する領域設定のみを示しているが、左側のリードに対しても同様の設定が行われる(以下の図でも同様である。)。   In FIG. 13, only the area setting for the right lead of the workpiece W is shown, but the same setting is performed for the left lead (the same applies to the following drawings).

図14は、ICのリード検査のためのティーチング処理の手順を示す。この手順は、図4のIC検査を始める前に実行される。
この手順の最初のステップであるST11では、検査対象のワークW(この例ではIC)について、リード6の長さやリード6間のピッチなどを入力する。ここで入力されたデータは、作業用のメモリに登録され、後記するST15で使用される。
FIG. 14 shows a teaching processing procedure for IC lead inspection. This procedure is performed before starting the IC inspection of FIG.
In ST11, which is the first step in this procedure, the length of the lead 6, the pitch between the leads 6, and the like are input for the workpiece W to be inspected (IC in this example). The data input here is registered in the working memory and used in ST15 described later.

つぎのST12では、撮像対象位置に良品のワークを設置して、これをカメラC0,C1により撮像する。ティーチング処理では、カメラC0からの正面視画像A0が生成されれば足りるが、この実施例では、ティーチング処理時にも各カメラC0,C1を同時駆動し、生成された2枚の画像をモニタ3に並べて表示するようにしている。   In the next ST12, a non-defective workpiece is placed at the position to be imaged, and this is imaged by the cameras C0 and C1. In the teaching process, it is sufficient if the front-view image A0 from the camera C0 is generated. However, in this embodiment, the cameras C0 and C1 are simultaneously driven during the teaching process, and the generated two images are displayed on the monitor 3. They are displayed side by side.

つぎのST13では、正面視画像A1で位置決め領域の指定操作を受け付ける。図15はこの指定操作時の正面視画像A1の表示例を示すもので、図中の9が位置決め領域である。
この位置決め領域9は、一列に並んだリード6のうちの一番端のリード(図示例では最上端のリード6aである。以下、これを「先頭リード6a」という。)を抽出するのに用いられる。図7の例では、先頭リード6aのみが含まれるような正方形状の領域9を設定している。位置決め領域9は、ワークWが想定される程度に位置ずれしても、位置決め領域9の中に先頭リード6aを撮像することができるように、その大きさが調整される。また、位置決め領域9は、その下半分の範囲に先頭リード6aが撮像されるように設定される。これにより、位置決め領域9の上半分の範囲にはリードが撮像されていないことをもって、位置決め領域9の下半分の範囲に撮像されているのが先頭リード6aであると確認できる。
In the next ST13, a positioning region designation operation is accepted in the front view image A1. FIG. 15 shows a display example of the front-view image A1 at the time of this designation operation, and 9 in the figure is a positioning area.
This positioning region 9 is used to extract the end lead (in the illustrated example, the top end lead 6a, hereinafter referred to as the “lead lead 6a”) among the leads 6 arranged in a line. It is done. In the example of FIG. 7, a square-shaped region 9 that includes only the top lead 6a is set. The size of the positioning area 9 is adjusted so that the leading lead 6a can be imaged in the positioning area 9 even if the position of the workpiece W is shifted as much as expected. The positioning area 9 is set so that the top lead 6a is imaged in the lower half of the positioning area 9. As a result, it can be confirmed that the top lead 6 a is imaged in the lower half of the positioning area 9 because the lead is not imaged in the upper half of the positioning area 9.

図14に戻って、位置決め領域9が指定されると、つぎのST14では、この位置決め領域9から先頭リード6aを抽出する。この抽出処理では、たとえば、位置決め領域9内の画像を2値化し、2値化後の画像をx軸方向に沿って投影する方法により、先頭リード6aのy座標を求める。または、位置決め領域9内のエッジやその濃度勾配方向を抽出することにより、リードの輪郭線を抽出し、さらにリードの中心線のy座標を求めるようにしてもよい。   Returning to FIG. 14, when the positioning area 9 is designated, the head lead 6a is extracted from the positioning area 9 in the next ST14. In this extraction process, for example, the y coordinate of the head lead 6a is obtained by binarizing the image in the positioning area 9 and projecting the binarized image along the x-axis direction. Alternatively, by extracting the edge in the positioning region 9 and its concentration gradient direction, the lead outline may be extracted, and the y coordinate of the lead center line may be obtained.

ST15では、先頭リード6aのy座標およびST11で入力されたデータに基づき、各リード6に検出領域7を設定する。この実施例では、ST11で入力されたデータ、カメラC0のピクセル数、倍率などを用いて、画像上におけるリード6の長さやリード6間のピッチを算出し、その算出値に基づき、各検出領域7の大きさや領域間の間隔を決定する。さらに、先頭リード6aの位置を基準に、このリード6aを含む各リード6に対し、決定した間隔毎に決定した大きさの検出領域7を設定する。
このような方法をとることができるのは、ワークWの検査対象部位の特性(各リードの長さが等しい、リード間のピッチが等しいなど)がそのまま反映された正面視画像A0を使用するからである。したがって、先端リード6aが抽出できれば、他のリード6を抽出しなくとも、全てのリード6に検出領域を設定することが可能になり、処理効率を大幅に向上することができる。
In ST15, a detection area 7 is set for each lead 6 based on the y coordinate of the lead 6a and the data input in ST11. In this embodiment, the length of the lead 6 and the pitch between the leads 6 on the image are calculated using the data input in ST11, the number of pixels of the camera C0, the magnification, and the like, and each detection region is based on the calculated value. The size of 7 and the interval between regions are determined. Further, the detection area 7 having a size determined for each determined interval is set for each lead 6 including the lead 6a on the basis of the position of the head lead 6a.
The reason why such a method can be taken is that the front-view image A0 that directly reflects the characteristics of the inspection target part of the workpiece W (the length of each lead is equal, the pitch between leads is equal, etc.) is used as it is. It is. Therefore, if the tip lead 6a can be extracted, it is possible to set detection areas for all the leads 6 without extracting other leads 6, and the processing efficiency can be greatly improved.

ST16では、ST13で指定された位置決め領域9の設定条件(領域の位置および大きさ)と、ST15で設定された検出領域7の設定条件を登録用メモリに登録する。さらに、ST17では、位置決め領域9内の画像をモデルとして登録用メモリに登録する。これにより一連のティーチング処理は終了となる。
ST16を実行する前には、検出領域7の設定結果を示す画像をモニタ3に表示し、ユーザーの確認操作に応じて登録を行うのが望ましい。また、この際に、検出領域7の位置や大きさを微調整できるようにしてもよい。
In ST16, the setting conditions (position and size of the positioning area) specified in ST13 and the setting conditions of the detection area 7 set in ST15 are registered in the registration memory. In ST17, the image in the positioning area 9 is registered as a model in the registration memory. As a result, a series of teaching processes is completed.
Before executing ST16, it is desirable to display an image indicating the setting result of the detection area 7 on the monitor 3 and perform registration in accordance with the user's confirmation operation. At this time, the position and size of the detection region 7 may be finely adjusted.

図16は、ICのリード検査(図12のST3)にかかる詳細な手順を示す。
この手順のST21からST24までの処理は、正面視画像A0に対して行われるものである。まず、ST21では、ティーチングで登録された設定条件に基づき、正面視画像A1に位置決め領域9を設定する。つぎのST22では、この位置決め領域9内の画像とティーチング処理のST17において登録したモデルとを照合して、モデルに対するずれ量を抽出する(この処理には、たとえばパターンマッチングの手法を応用することができる。)。
ST21とST22は、処理項目テーブル201中の『モデル位置修正』の処理項目に相当する。
FIG. 16 shows a detailed procedure for IC lead inspection (ST3 in FIG. 12).
The processing from ST21 to ST24 of this procedure is performed on the front view image A0. First, in ST21, the positioning area 9 is set in the front view image A1 based on the setting conditions registered by teaching. In the next ST22, the image in the positioning area 9 is compared with the model registered in ST17 of the teaching process, and a deviation amount with respect to the model is extracted (for example, a pattern matching technique can be applied to this process). it can.).
ST 21 and ST 22 correspond to the “model position correction” processing item in the processing item table 201.

ST23では、ティーチング時に登録した検出領域の設定条件をST22で抽出されたずれ量に基づき調整し、その調整後の設定条件により各リードの検出領域7を設定する。正面視画像A0によれば、画像上のワークWの歪みを考慮しなくてよいから、位置決め領域9のずれ量をそのまま各検出領域7に適用することができ、各リード6に対し、ティーチング処理時と同様の位置関係をもって検出領域7を設定することが可能になる。   In ST23, the setting condition of the detection area registered at the time of teaching is adjusted based on the deviation amount extracted in ST22, and the detection area 7 of each lead is set according to the setting condition after the adjustment. According to the front-view image A0, since it is not necessary to consider the distortion of the workpiece W on the image, the shift amount of the positioning region 9 can be applied to each detection region 7 as it is, and the teaching process is performed on each lead 6. The detection area 7 can be set with the same positional relationship as the time.

図17は、検査時の正面視画像A0の一例を示す。この例でのワークWは、図7に示したティーチング時の画像A0より右側にずれているため、リード6の先端が位置決め領域9からはみ出した状態になっている。しかし、検出領域7については、上記した調整処理が行われるため、いずれのリード6にも図4に示したのと同様の条件で検出領域7が設定されている。   FIG. 17 shows an example of a front-view image A0 at the time of inspection. Since the workpiece W in this example is shifted to the right side from the image A0 at the time of teaching shown in FIG. 7, the tip of the lead 6 is in a state of protruding from the positioning region 9. However, since the adjustment process described above is performed for the detection area 7, the detection area 7 is set to any lead 6 under the same conditions as shown in FIG. 4.

このようにしてリード毎に検出領域7が設定されると、つぎのST24では、各検出領域7毎に、リードの先端のx,y座標を算出する。ST23とST24は、処理項目テーブル201中の『濃淡エッジ位置』の処理項目に相当する。この処理項目はリードの数だけ繰り返し設定されている。また、図示を省略するが、この処理項目の後には、『カメラ切替』の処理項目が実行される。   When the detection area 7 is set for each lead in this way, in the next ST24, the x and y coordinates of the tip of the lead are calculated for each detection area 7. ST23 and ST24 correspond to the “dark edge position” processing item in the processing item table 201. This processing item is set repeatedly for the number of leads. Although not shown in the figure, after this processing item, the “camera switching” processing item is executed.

つぎのST25では、斜視画像A1上に、各リードの先端部に対する検出領域8を設定する。さらにST26では、設定された検出領域8においてST24と同様の処理を実行し、リードの先端のx,y座標を算出する。   In the next ST25, the detection area 8 for the tip of each lead is set on the perspective image A1. In ST26, the same processing as ST24 is executed in the set detection area 8, and the x and y coordinates of the tip of the lead are calculated.

この後、ST27では、各先端につき、それぞれST24,26で算出された座標を用いて3次元座標を算出する。さらに、ST28では、算出された3次元座標をあらかじめ登録された基準値と比較するなどして、各リード先端部の良否を判別する。たとえば、所定の先端部に浮きがあれば、高さを表すZ座標が基準値を超える値となり、その先端部は不良であると判定されることになる。ST25からST27までは、『ステレオエッジ位置』の処理項目に相当する。この処理項目も、リードの数だけ繰り返し設定されている。   Thereafter, in ST27, three-dimensional coordinates are calculated for each tip using the coordinates calculated in ST24 and 26, respectively. In ST28, the quality of each lead tip is determined by comparing the calculated three-dimensional coordinates with a reference value registered in advance. For example, if there is a float at a predetermined tip, the Z coordinate representing the height exceeds the reference value, and it is determined that the tip is defective. ST25 to ST27 correspond to the processing item of “stereo edge position”. This processing item is also set repeatedly for the number of leads.

つぎに、ST25での検出領域8の設定について、詳細に説明する。
図18は、空間内の任意の高さ位置にある平面D上の一点PがカメラC0,C1の撮像面F0,F1上の点p,pにそれぞれ結像した状態を示している。図18において、X,Y,Zは3次元空間を表す座標軸であり、平面Dは、XY平面に平行である。また撮像面F0には、x,yの軸による2次元座標系が、撮像面F1には、x,yの軸による2次元座標系が、それぞれ設定されている。図10では、たまたま、両撮像面の原点に結像される平面D上の点がPとされているが、これに限らず、点Pの位置は平面D上で任意である。
Next, the setting of the detection area 8 in ST25 will be described in detail.
FIG. 18 shows a state in which one point P on the plane D at an arbitrary height position in the space is imaged at points p 0 and p 1 on the imaging surfaces F0 and F1 of the cameras C0 and C1, respectively. In FIG. 18, X, Y, and Z are coordinate axes representing a three-dimensional space, and the plane D is parallel to the XY plane. In addition, a two-dimensional coordinate system based on the x 0 and y 0 axes is set on the imaging surface F0, and a two-dimensional coordinate system based on the x 1 and y 1 axes is set on the imaging surface F1, respectively. In FIG. 10, the point on the plane D that is imaged at the origin of both imaging surfaces is assumed to be P, but this is not limiting, and the position of the point P is arbitrary on the plane D.

撮像面F0における点Pの結像位置(点p)の座標を(xcam0,ycam0)、撮像面F1における点Pの結像位置(点p)の座標を(xcam1,ycam1)とすると、点p,p間の関係は、つぎの(1)式のようになる。 Coordinates of the imaging position of the point P on the imaging plane F0 (point p 0) (x cam0, y cam0), the imaging position of the point P on the imaging plane F1 coordinates (point p 1) (x cam1, y cam1 ), The relationship between the points p 0 and p 1 is expressed by the following equation (1).

Figure 0004788475
Figure 0004788475

(1)式において、Hは、高さZの平面D上の点について、撮像面F0上の結像位置と撮像面F1上の結像位置との関係を表す3×3のホモグラフィ行列であり、λは定数である。行列Hは、あらかじめ平面D上の既知の座標を用いたキャリブレーションにより求めることができる(キャリブレーションの詳細については、下記の非特許文献1を参照されたい。)。
見市 伸裕,和田 俊和,松山 隆司 「プロジェクタ・カメラシステムのキャリブレーションに関する研究」、[平成17年6月1日検索]、インターネット<URL:http://vision.kuee.kyoto-u.ac.jp/Research/Thesis/Thesis_PDF/Miichi_2002_P_147.pdf>
In Equation (1), H Z is a 3 × 3 homography matrix that represents the relationship between the imaging position on the imaging surface F0 and the imaging position on the imaging surface F1 for a point on the plane D having a height Z. And λ is a constant. The matrix H Z can be obtained in advance by calibration using known coordinates on the plane D (refer to Non-Patent Document 1 below for details of calibration).
Nobuhiro Miichi, Toshikazu Wada, Takashi Matsuyama “Research on Calibration of Projector / Camera System” [Search June 1, 2005], Internet <URL: http://vision.kuee.kyoto-u.ac. jp / Research / Thesis / Thesis_PDF / Miichi_2002_P_147.pdf>

よって、正面視画像A0の各検出領域7で抽出されたリードの先端を点pと考えて、その座標を(1)式の(xcam0,ycam0)に代入した場合、算出された(xcam1,ycam1)は、斜視画像A1におけるリード先端の位置に相当すると考えることができる。しかし、リード先端の高さが変動すると、平面Dの高さZもそれに応じて変動し、それに応じてホモグラフィ行列Hが変化し、(xcam1,ycam1)の値も変化することになる。 Therefore, given the tip of the extracted lead with each detection region 7 of the front view image A0 and the point p 0, when substituted into the coordinates (1) of the (x cam0, y cam0), it was calculated ( x cam1 , y cam1 ) can be considered to correspond to the position of the lead tip in the perspective image A1. However, when the height of the lead tip changes, the height Z of the plane D also changes accordingly, the homography matrix H Z changes accordingly, and the value of (x cam1 , y cam1 ) also changes. Become.

ST25では、この原理に基づき、想定される高さ範囲(カメラC0の光軸に沿った3次元計測の対象範囲)の上限値を平面Dの高さZとしたときと、下限値を高さZとしたときとについて、それぞれその高さZに応じたホモグラフィ行列Hを用いて(1)式を実行することにより、(xcam1,ycam1)として図19に示す2点e,fの座標を得る。そして、斜視画像A1において、図19に示すように、線分efを正面視画像A0側の検出領域7の半値幅kだけ線分efと垂直方向の各側に平行移動させた線分ghおよび線分g’h’を設定し、これら4点を結ぶ矩形領域ghh’g’を検出領域8とする。 In ST25, based on this principle, when the upper limit value of the assumed height range (target range of three-dimensional measurement along the optical axis of the camera C0) is the height Z of the plane D, the lower limit value is the height. By executing the equation (1) using the homography matrix H Z corresponding to the height Z for each of the Z and Z, two points e and f shown in FIG. 19 as (x cam1 , y cam1 ) Get the coordinates. Then, in the perspective image A1, as shown in FIG. 19, the line segment gh obtained by translating the line segment ef to each side in the direction perpendicular to the line segment ef by the half-value width k of the detection region 7 on the front view image A0 side. A line segment g′h ′ is set, and a rectangular area ghh′g ′ connecting these four points is set as a detection area 8.

図20は、図13と同様の斜視画像A1について、リード6の取り得る高さ範囲を0〜5mmとした場合と、高さ範囲を−15〜15mmとした場合とでの検出領域8の大きさを対比させて示したものである。この例から明らかなように、検出領域8は、高さ範囲の変動幅が小さいほど小さくなる。図20では簡略化して各検出領域8を互いに平行に描いているが、実際には、斜視画像A1には遠近法の効果によって矩形の対象物が台形に撮像されるような歪が生じるため、各検出領域8は、それらの中心線(線分ef)同士の間隔が図の右方ほど大きくなるような非平行の配置となる。各検出領域8において、エッジ先端位置を求めるための2値化画像の投影は、検出領域8の中心線と垂直な方向に行う。   FIG. 20 shows the size of the detection area 8 when the height range that the lead 6 can take is 0 to 5 mm and when the height range is −15 to 15 mm for the perspective image A1 similar to FIG. 13. This is shown in contrast. As is clear from this example, the detection region 8 becomes smaller as the fluctuation range of the height range is smaller. In FIG. 20, the detection areas 8 are simplified and drawn in parallel with each other. However, in reality, the perspective image A1 is distorted so that a rectangular object is imaged in a trapezoid shape due to the effect of perspective. Each detection region 8 has a non-parallel arrangement such that the distance between the center lines (line segments ef) increases toward the right in the drawing. In each detection area 8, the binarized image for obtaining the edge tip position is projected in a direction perpendicular to the center line of the detection area 8.

上記の実施例では、基準画像A0において、リードの先端位置を特定するために各リード6に対応する検出領域7を設定したので、リードの数だけ処理項目の設定が必要であったが、これに代えて、各リードの先端を含むようにy軸方向に長い1つの検出領域を設定し、この領域内で各リードの先端位置を個別に求めることができるような処理項目を設けてもよい。   In the above embodiment, since the detection area 7 corresponding to each lead 6 is set in the reference image A0 in order to specify the tip position of the lead, it is necessary to set processing items as many as the number of leads. Instead of this, one detection area that is long in the y-axis direction may be set so as to include the tip of each lead, and a processing item may be provided so that the tip position of each lead can be obtained individually in this area. .

つぎに、押釦式の文字キーが配設されたワーク(リモコン、電話機など)を検査対象として、各キーの高さを検査する場合について、説明する。この場合、検査に先立ち、図21に示すように、良品のワークWを撮像して得られた正面視画像A0を用いて、各キー60毎に、そのキー60に描かれた文字を含む領域70を指定し、その領域70内の画像をモデルとして登録しておく。   Next, a case will be described in which the height of each key is inspected for a work (remote control, telephone, etc.) provided with push button type character keys. In this case, as shown in FIG. 21, prior to the inspection, an area including characters drawn on the key 60 is displayed for each key 60 using a front-view image A0 obtained by imaging a non-defective work W. 70 is designated, and the image in the area 70 is registered as a model.

図22は、検査の手順を示す。まずST31において、各カメラC0,C1を同時駆動して画像を生成する。このST31は、処理項目テーブル201中の『ステレオカメラ画像入力』の処理項目に相当する。つぎのST32では、正面視画像A0について、検査前に登録されたモデルを用いたパターンマッチング処理を実行し、モデルと最もよく一致する領域を特定して計測対象領域とする。この処理は各キー60に対応するモデル毎に行われるが、ここでは説明を簡単にするため、一つのモデルに限定して説明する。   FIG. 22 shows an inspection procedure. First, in ST31, the cameras C0 and C1 are simultaneously driven to generate an image. This ST 31 corresponds to the “stereo camera image input” processing item in the processing item table 201. In the next ST32, pattern matching processing using a model registered before the inspection is executed for the front-view image A0, and an area that most closely matches the model is specified as a measurement target area. This process is performed for each model corresponding to each key 60, but here, for the sake of simplicity of explanation, the description is limited to one model.

計測対象領域が特定されると、つぎのST33では、この領域の代表点(たとえば領域の中心点)の座標を特定する。代表点は複数特定することもできる(たとえば、あらかじめ定めたモデル上の複数の特徴点に対応する点)。
ST32とST33は、処理項目テーブル201中の『高精度ECMサーチ』の処理項目に相当する。この処理項目の実行後には、図示しない『カメラ切替』の処理項目が実行され、ST34に進む。
When the measurement target region is specified, in the next ST33, the coordinates of the representative point of this region (for example, the center point of the region) are specified. A plurality of representative points can be specified (for example, points corresponding to a plurality of feature points on a predetermined model).
ST32 and ST33 correspond to “high-precision ECM search” processing items in the processing item table 201. After execution of this processing item, the “camera switching” processing item (not shown) is executed, and the process proceeds to ST34.

ST34では、代表点の座標に基づき、斜視画像A1上にサーチ領域を設定する。この場合にも、前述のリード検査で検出領域8を設定した場合と同様に、あらかじめ指定された高さ範囲の上限値および下限値を高さZとしてホモグラフィ行列Hを設定し、代表点の座標と高さ範囲の上限値および下限値を用いて2回の演算を実行することにより、画像A1上で代表点の存在し得る範囲を求め、その範囲にモデルの大きさを加味した領域をサーチ領域としている。 In ST34, a search area is set on the perspective image A1 based on the coordinates of the representative point. Also in this case, as in the case where the detection region 8 is set by the lead inspection described above, the homography matrix H Z is set with the upper limit value and the lower limit value of the height range specified in advance as the height Z , and the representative points A region in which a representative point can exist on the image A1 is obtained by executing the calculation twice using the upper limit value and the lower limit value of the coordinates and the height range, and the size of the model is added to the range. Is the search area.

ST35では、サーチ領域において、モデルとの間のパターンマッチング処理を実行して、計測対象領域とその領域内の代表点の位置とを特定する。さらにST36では、正面視、斜視の各画像A0,A1における計測対象領域の代表点の座標を用いて、3次元座標を算出する。ついで、ST37では、算出された3次元座標のうちのZ座標を所定のしきい値と比較することにより、キーの高さの適否を判別する。そして、ST38において、判別結果を出力し、処理を終了する。ST35からST38までは、『ステレオ高精度ECMサーチ』の処理項目に相当する。   In ST35, pattern matching processing with the model is executed in the search area, and the measurement target area and the position of the representative point in the area are specified. Furthermore, in ST36, a three-dimensional coordinate is calculated using the coordinates of the representative point of the measurement target region in each of the front view and perspective images A0 and A1. In ST37, the Z coordinate of the calculated three-dimensional coordinates is compared with a predetermined threshold value to determine whether the key height is appropriate. In ST38, the determination result is output and the process is terminated. ST35 to ST38 correspond to the processing items of “stereo high-precision ECM search”.

基準画像A0上で、モデルに定めた特徴点に対応する点を代表点として特定した場合には、ST36においても、同様に、モデル上の対応点を特定することができる。また、ST35では、指定された高さ範囲内の所定高さ(たとえばワークが正常であるときの標準となる高さ)に対応するホモグラフィ行列を用いてモデルを斜視カメラC1に撮像されるはずの形状に変換し、その変換後のモデルを用いて計測対象領域を特定するようにしてもよい。   When the point corresponding to the feature point determined in the model is specified as the representative point on the reference image A0, the corresponding point on the model can be specified in ST36 as well. In ST35, the model should be imaged by the perspective camera C1 using a homography matrix corresponding to a predetermined height within a specified height range (for example, a standard height when the workpiece is normal). The measurement target region may be specified using the converted model.

図23は、上記の検査において、正面視画像A0上でキー60に関して特定された計測対象領域71、この領域71の位置と大きさに基づいて設定された斜視画像A1側のサーチ領域80、およびサーチ領域80において特定された計測対象領域81を示す。   FIG. 23 shows the measurement target area 71 specified for the key 60 on the front-view image A0 in the above inspection, the search area 80 on the perspective image A1 side set based on the position and size of the area 71, and A measurement target area 81 specified in the search area 80 is shown.

図22に示した手順では、3次元計測処理による検査のみを行っているが、この検査でも、正面視画像A0を用いた2次元計測処理により、各キーの文字の印刷状態などの検査を行うことができる。   In the procedure shown in FIG. 22, only the inspection by the three-dimensional measurement process is performed, but also in this inspection, the print state of the character of each key is inspected by the two-dimensional measurement process using the front-view image A0. be able to.

つぎの実施例は、中央部に円形状の表示領域を有するワークについて、その表示領域内の高さの適否を検査するものである。
図24は、各カメラC0,C1により生成されたワークWの画像A0,A1を示す。図中、Sが検査対象の表示領域である。正面視画像A0では、先の実施例と同様に、ワークWの正面像が現れているため、表示領域Sの輪郭線72も円形状になっている。これに対し、斜視画像A1では、ワークWに歪みが生じているため、表示領域Sの大きさや輪郭線72の形状も正面視画像A0とは異なるものになり、表示領域S内の文字の配置状態にも歪みが生じている。
In the next embodiment, a work having a circular display area at the center is inspected for appropriateness of the height in the display area.
FIG. 24 shows images A0 and A1 of the workpiece W generated by the cameras C0 and C1. In the figure, S is a display area to be inspected. In the front view image A0, as in the previous embodiment, the front image of the workpiece W appears, so that the outline 72 of the display area S is also circular. On the other hand, in the perspective image A1, since the work W is distorted, the size of the display area S and the shape of the outline 72 are also different from those in the front-view image A0, and the arrangement of characters in the display area S The state is also distorted.

この実施例では、検査に先立ち、ワークWの良品モデルを撮像し、得られた正面視画像A0上で、ユーザーに表示領域Sの半径や計測対象領域を指定させる。このとき、画像処理部22では、正面視画像A0から表示領域Sの中心点の位置を求める処理を実行し、この中心点に対する計測対象領域の相対位置を登録用メモリに登録する。   In this embodiment, prior to the inspection, a non-defective product model of the workpiece W is imaged, and the user designates the radius of the display area S and the measurement target area on the obtained front-view image A0. At this time, the image processing unit 22 executes processing for obtaining the position of the center point of the display area S from the front-view image A0, and registers the relative position of the measurement target area with respect to the center point in the registration memory.

図25は、正面視画像A0中の表示領域Sを拡大して示す。図中、73がユーザーにより指定された計測対象領域であり、74が表示領域Sの中心点である。この中心点74の位置は、正面視画像A0から円形パターンを抽出する処理を実行し、その抽出結果の中からユーザーにより指定された大きさの円(位置修正用モデル)に最もよく合致する輪郭線72を特定して、求めたものである。   FIG. 25 shows an enlarged display region S in the front view image A0. In the figure, reference numeral 73 denotes a measurement target area designated by the user, and 74 denotes a center point of the display area S. The position of the center point 74 executes a process of extracting a circular pattern from the front-view image A0, and a contour that best matches a circle (position correction model) having a size designated by the user from the extraction result. The line 72 is specified and obtained.

図26は、図24のワークWに対する高さ検査の手順を示す。
ST41では、先の実施例と同様に、各カメラC0,C1を同時駆動して、正面視画像A0および斜視画像A1を生成する。このST41は、処理項目テーブル201中の『ステレオカメラ画像入力』の処理項目に相当する。ST42では、正面視画像A0から上記の処理により、表示領域Sの中心点74の位置を求める。ST42は、『モデル位置修正』の処理項目に相当する。
FIG. 26 shows a height inspection procedure for the workpiece W of FIG.
In ST41, as in the previous embodiment, the cameras C0 and C1 are simultaneously driven to generate the front view image A0 and the perspective image A1. This ST 41 corresponds to the “stereo camera image input” processing item in the processing item table 201. In ST42, the position of the center point 74 of the display area S is obtained from the front view image A0 by the above processing. ST42 corresponds to a processing item of “model position correction”.

つぎのST43では、ST42で求められた中心点74の座標を基準に、あらかじめ登録された相対位置に基づき計測対象領域73を設定する。そして、続くST44において、計測対象領域73の画像をサーチ用のモデル画像として登録し、さらに計測対象領域73の代表点位置(たとえば、領域内の中心点位置)も登録する。
ST44は、『ステレオ領域設定』の処理項目に相当する。図26では図示を省略しているが、この処理項目の実行後には『カメラ切替』の処理項目が実行される。
In the next ST43, the measurement target region 73 is set based on the previously registered relative position with reference to the coordinates of the center point 74 obtained in ST42. In ST44, the image of the measurement target area 73 is registered as a model image for search, and the representative point position of the measurement target area 73 (for example, the center point position in the area) is also registered.
ST44 corresponds to the “stereo area setting” process item. Although not shown in FIG. 26, the “camera switching” processing item is executed after the processing item is executed.

ST45では、斜視画像A1上にサーチ領域82(図27に示す。)を設定する。この実施例でも、ST44で登録された代表点の座標を(1)式に代入し、あらかじめ指定された高さ範囲の上限値および下限値に応じたホモグラフィ行列Hを用いて(1)式を実行することにより、サーチ領域82の位置や大きさを決定している。 In ST45, a search area 82 (shown in FIG. 27) is set on the perspective image A1. Also in this embodiment, the coordinates of the representative point registered in ST44 are substituted into the equation (1), and the homography matrix H Z corresponding to the upper limit value and the lower limit value of the height range specified in advance is used (1). By executing the equation, the position and size of the search area 82 are determined.

ST46では、正面視画像A0の計測対象領域73についてST44で登録した画像を用いて、サーチ領域82において相関マッチング処理を実行する。そして、登録した画像に最も類似する領域を特定し、これを斜視画像A1側の計測対象領域とする。ST47では、斜視画像A1側の計測対象領域について、代表点の座標を求め、この座標と正面視画像A0側の代表点の座標とを用いて3次元座標を算出する。続くST48では、求められたZ座標の適否を判定する。そして、ST49において、判定結果を出力し、しかる後に処理を終了する。
ST45からST49までの処理は、処理項目テーブル201中の「ステレオ高さ計測」の処理項目に相当する。
In ST46, the correlation matching process is executed in the search area 82 using the image registered in ST44 for the measurement target area 73 of the front-view image A0. Then, an area most similar to the registered image is specified, and this is set as a measurement target area on the perspective image A1 side. In ST47, the coordinates of the representative point are obtained for the measurement target region on the perspective image A1 side, and the three-dimensional coordinates are calculated using the coordinates and the coordinates of the representative point on the front view image A0 side. In subsequent ST48, the suitability of the obtained Z coordinate is determined. In ST49, the determination result is output, and then the process ends.
The processes from ST45 to ST49 correspond to the “stereo height measurement” process item in the process item table 201.

図27(1)(2)は、それぞれ1組の正面視画像A0と斜視画像A1について、正面視画像A0における計測対象領域73、斜視画像A1におけるサーチ領域82および計測対象領域83を示す。また、正面視画像A0においては、表示領域Sの輪郭線72を太線にして示すとともに、表示領域Sの中心点74の求められた位置を示してある。図27の(1)の画像と(2)の画像とでは、ワークWの位置が異なるが、どちらの場合も計測対象領域73は、その中に目標とする文字が収まるように正しく設定されている。   FIGS. 27A and 27B show the measurement target area 73 in the front view image A0, the search area 82 in the perspective image A1, and the measurement target area 83, respectively, for one set of the front view image A0 and the perspective image A1. Further, in the front view image A0, the outline 72 of the display area S is shown with a bold line, and the position where the center point 74 of the display area S is obtained is shown. The position of the workpiece W is different between the image of (1) and the image of (2) in FIG. 27, but in both cases, the measurement target area 73 is set correctly so that the target character is contained therein. Yes.

図26に示した検査の手順によれば、検査対象のワークWごとにそのワークWからサーチ用のモデル画像を取得するので、3次元計測の対象とする文字などの表面パターンがワークWごとに異なる場合でも、同一のシーケンスを適用して3次元計測を行うことができる。ここでは、表面パターンはワークWごとに異なるかもしれないが、ワークWの形状とワークWの形状を基準とした計測対象領域の位置はどのワークWにおいても共通であることを利用して、計測対象領域を設定している。   According to the inspection procedure shown in FIG. 26, a model image for search is acquired from each work W to be inspected, so that a surface pattern such as characters to be subjected to three-dimensional measurement is provided for each work W. Even in different cases, the same sequence can be applied to perform three-dimensional measurement. Here, although the surface pattern may be different for each workpiece W, the shape of the workpiece W and the position of the measurement target area based on the shape of the workpiece W are common to all the workpieces W. The target area is set.

図26の手順においても、登録したサーチ用のモデル画像をホモグラフィ行列Hzを用いて斜視カメラC1に撮像されるはずの形状に変換し、変換後の画像を用いて計測対象領域83を特定するようにしてもよい。
さらに、図26の手順にも、正面視画像A0を用いて表示領域S内の文字の印刷状態を検査する処理を組み込むことができる。
Also in the procedure of FIG. 26, the registered model image for search is converted into a shape that should be imaged by the perspective camera C1 using the homography matrix Hz, and the measurement target region 83 is specified using the converted image. You may do it.
Furthermore, the process of inspecting the print state of the characters in the display area S using the front-view image A0 can also be incorporated into the procedure of FIG.

この発明が適用された検査装置の撮像部の構成を設置例とともに示す斜視図である。It is a perspective view which shows the structure of the imaging part of the test | inspection apparatus with which this invention was applied with the example of installation. 各カメラで生成された画像の例を示す説明図である。It is explanatory drawing which shows the example of the image produced | generated with each camera. 検査装置のブロック図である。It is a block diagram of an inspection device. シーケンス設定のためのシステム構成を示す機能ブロック図である。It is a functional block diagram which shows the system configuration for sequence setting. 処理項目テーブルのデータ構成例を示す説明図である。It is explanatory drawing which shows the data structural example of a process item table. シーケンスのメニュー表示例を示す説明図である。It is explanatory drawing which shows the example of a menu display of a sequence. 『エッジ位置』のシーケンスとその流れを示すフローチャートとを対応づけて示す説明図である。FIG. 5 is an explanatory diagram showing a sequence of “edge positions” and a flowchart showing the flow thereof in association with each other. 『パターン』のシーケンスとその流れを示すフローチャートとを対応づけて示す説明図である。FIG. 5 is an explanatory diagram showing a “pattern” sequence in association with a flowchart showing the flow of the sequence. 基本シーケンスに他の処理項目を追加する場合の操作手順を示す説明図である。It is explanatory drawing which shows the operation procedure in the case of adding another process item to a basic sequence. 基本シーケンスに2次元計測に関する処理項目を加えた例を示す説明図である。It is explanatory drawing which shows the example which added the process item regarding 2D measurement to the basic sequence. 検査装置のブロック図である。It is a block diagram of an inspection device. ICの検査にかかる手順を示すフローチャートである。It is a flowchart which shows the procedure concerning a test | inspection of IC. 検出領域の設定例を示す説明図である。It is explanatory drawing which shows the example of a setting of a detection area. ティーチング処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of a teaching process. 位置決め領域の設定例を示す説明図である。It is explanatory drawing which shows the example of a setting of a positioning area | region. リード検査の詳細な手順を示すフローチャートである。It is a flowchart which shows the detailed procedure of a lead test | inspection. 検査時の正面視画像中のワークに対する位置決め領域および検出領域の関係を示す説明図である。It is explanatory drawing which shows the relationship between the positioning area | region with respect to the workpiece | work in the front view image at the time of a test | inspection, and a detection area. 各画像間の対応点の関係を示す説明図である。It is explanatory drawing which shows the relationship of the corresponding point between each image. 検出領域の設定方法を示す説明図である。It is explanatory drawing which shows the setting method of a detection area. 高さの範囲と検出領域との関係を示す説明図である。It is explanatory drawing which shows the relationship between the range of height and a detection area. 良品であるワーク上の検査対象部位をモデル登録する例を示す説明図である。It is explanatory drawing which shows the example which carries out the model registration of the test | inspection site | part on the workpiece | work which is a quality item. 文字キーの検査にかかる手順を示すフローチャートである、It is a flowchart which shows the procedure concerning inspection of a character key. 検査対象の画像に対し、計測対象領域およびサーチ領域を設定した例を示す説明図である。It is explanatory drawing which shows the example which set the measurement object area | region and the search area | region with respect to the image of a test object. 円形の表示領域を有するワークにかかる正面視画像および斜視画像を示す説明図である。It is explanatory drawing which shows the front view image and perspective view concerning a workpiece | work which have a circular display area. ワークに対する計測対象領域の指定結果を示す説明図である。It is explanatory drawing which shows the designation | designated result of the measurement object area | region with respect to a workpiece | work. 図16のワークの高さ検査を行う場合の手順を示すフローチャートである。It is a flowchart which shows the procedure in the case of performing the workpiece | work height inspection of FIG. 計測対象領域およびサーチ領域がワークの位置変化に追随する例を示す説明図である。It is explanatory drawing which shows the example in which a measurement object area | region and a search area follow the position change of a workpiece | work.

符号の説明Explanation of symbols

1 撮像部
2 本体部
3 モニタ
4 コンソール
7,8 検出領域
24 処理部
25 メモリ
41 画像処理部
42 計測処理部
80,82 サーチ領域
200 装置内コンピュータ
201 処理項目テーブル
202 シーケンス保存部
203 プログラム記憶部
204 指定操作受付部
205 シーケンス組立部
206 シーケンス実行部
A0 正面視画像
A1 斜視画像
C0,C1 カメラ
W ワーク
DESCRIPTION OF SYMBOLS 1 Image pick-up part 2 Main body part 3 Monitor 4 Console 7, 8 Detection area 24 Processing part 25 Memory 41 Image processing part 42 Measurement processing part 80, 82 Search area 200 In-machine computer 201 Process item table 202 Sequence storage part 203 Program storage part 204 Designated operation accepting unit 205 Sequence assembly unit 206 Sequence execution unit A0 Front view image A1 Perspective image C0, C1 Camera W Workpiece

Claims (6)

対象物を互いに異なる方向から撮影するように配置された第1のカメラおよび第2のカメラによりそれぞれ撮影された画像に基づく第1の画像および第2の画像を用いた処理を行う画像処理装置であって、
処理項目のシーケンスを設定するシーケンス設定手段と、
設定されたシーケンスを実行するシーケンス実行手段とを備え、
シーケンス設定手段は、ユーザの選択によりシーケンスの要素とすることができる処理項目として、2次元画像処理の複数の項目、および3次元計測処理の少なくとも1つの項目を提供し、
提供される2次元画像処理の処理項目の中には、前記第1の画像に第1の検出領域を設定して、この第1の検出領域において当該検出領域に定められているエッジ検出方向におけるエッジの位置を特定する第1画像上位置特定処理の項目が、少なくとも1つ含まれており、
3次元計測処理に提供される処理項目の少なくとも1つは、前記第1画像上位置特定処理の項目と同じシーケンスに組み込まれて、当該シーケンス中の第1画像上位置特定処理において特定された第1の画像におけるエッジの位置および第1のカメラと第2のカメラとの位置関係に基づく特定の一方向をエッジ検出方向とする第2の検出領域を設定して、この第2の検出領域内でエッジ検出方向におけるエッジの位置を特定する第2画像上位置特定処理と、前記第1画像上位置特定処理により特定された第1の画像上のエッジの位置と前記第2画像上位置特定処理により特定された第2の画像上のエッジの位置とを用いた3次元計測用の演算処理とを実行するように設計されている、画像処理装置。
An image processing apparatus that performs processing using a first image and a second image based on images captured by a first camera and a second camera that are arranged so as to photograph an object from different directions. There,
Sequence setting means for setting a sequence of processing items;
A sequence execution means for executing the set sequence,
The sequence setting means provides a plurality of items of two-dimensional image processing and at least one item of three-dimensional measurement processing as processing items that can be used as elements of the sequence by user selection,
Among the processing items of the provided two-dimensional image processing, a first detection area is set in the first image, and the first detection area has an edge detection direction defined in the detection area. At least one item of position specifying processing on the first image for specifying the position of the edge is included,
At least one of the processing items provided for the three-dimensional measurement process is incorporated into the same sequence as the item for the first image position specifying process, and is specified in the first image position specifying process in the sequence . A second detection region is set in which a specific direction based on the position of the edge in one image and the positional relationship between the first camera and the second camera is set as the edge detection direction. The second image position specifying process for specifying the position of the edge in the edge detection direction, the edge position on the first image specified by the first image position specifying process, and the second image position specifying process An image processing apparatus that is designed to execute a calculation process for three-dimensional measurement using an edge position on a second image specified by the above .
第2の検出領域は、そのエッジ検出方向に沿う範囲が、3次元計測の対象範囲としてユーザに指定された第1のカメラの光軸に沿う範囲に基づいて設定される、請求項1に記載の画像処理装置。 Second detection area, the range along the edge detection direction is set based on a range along the first camera of the optical axis specified by the user as a target range for three-dimensional measurement, according to claim 1 Image processing apparatus. 第1のカメラは、矩形状の視野の範囲を有し、対象物を正面視する方向から撮影するように配置され、
第2のカメラは、第1のカメラに対して第1のカメラの視野における縦または横の方向に離れた位置にあって、対象物を正面視する方向に対して斜めになる方向から対象物を撮影するように配置され、
第1画像上位置特定処理では、第1の検出領域を第1の画像に対してユーザの指示に基づく位置に設定すると共に、第1のカメラ第2のカメラとの並びの方向を第1の検出領域のエッジ検出方向とする、請求項1に記載の画像処理装置。
The first camera has a rectangular field of view, and is arranged to shoot from the direction in which the object is viewed from the front,
The second camera is located at a position away from the first camera in the vertical or horizontal direction in the field of view of the first camera, and is inclined from the direction in which the object is viewed from the front. Are arranged to shoot
In the first image on the locating process, and sets a position based on a user's instruction to the first detection area the first image, the direction of arrangement of the first camera and the second camera first The image processing apparatus according to claim 1 , wherein an edge detection direction of the detection area is set .
対象物を互いに異なる方向から撮影するように配置された第1のカメラおよび第2のカメラによりそれぞれ撮影された画像に基づく第1の画像および第2の画像を用いる画像処理方法であって、
処理項目のシーケンスを設定するシーケンス設定ステップと、
設定されたシーケンスを実行するシーケンス実行ステップとを備え、
シーケンス設定ステップは、ユーザの選択によりシーケンスの要素とすることができる処理項目として、2次元画像処理の複数の項目および3次元計測処理の少なくとも1つの項目を提供し、
提供される2次元画像処理の項目の中には、前記第1の画像に第1の検出領域を設定して、この第1の検出領域内において当該検出領域に定められているエッジ検出方向におけるエッジの位置を特定する第1画像上位置特定処理の項目が、少なくとも1つ含まれており、
3次元計測処理に提供される処理項目の少なくとも1つは、前記第1画像上位置特定処理の項目と同じシーケンスに組み込まれて、当該シーケンス中の第1画像上位置特定処理において特定された第1の画像におけるエッジの位置および第1のカメラと第2のカメラとの位置関係に基づく特定の一方向をエッジ検出方向とする第2の検出領域を設定して、この第2の検出領域内でエッジ検出方向におけるエッジの位置を特定する第2画像上位置特定処理と、前記第1画像上位置特定処理により特定された第1の画像上のエッジの位置と前記第2画像上位置特定処理により特定された第2の画像上のエッジの位置とを用いた3次元計測用の演算処理とを実行するように設計される、画像処理方法。
An image processing method using a first image and a second image based on images respectively captured by a first camera and a second camera arranged to photograph an object from different directions,
A sequence setting step for setting a sequence of processing items;
A sequence execution step for executing a set sequence;
The sequence setting step provides a plurality of items of two-dimensional image processing and at least one item of three-dimensional measurement processing as processing items that can be elements of the sequence by user selection,
Among the provided two-dimensional image processing items, a first detection area is set in the first image, and an edge detection direction defined in the detection area is set in the first detection area. At least one item of position specifying processing on the first image for specifying the position of the edge is included,
At least one of the processing items provided for the three-dimensional measurement process is incorporated into the same sequence as the item for the first image position specifying process, and is specified in the first image position specifying process in the sequence. A second detection region is set in which a specific direction based on the position of the edge in one image and the positional relationship between the first camera and the second camera is set as the edge detection direction. The second image position specifying process for specifying the position of the edge in the edge detection direction, the edge position on the first image specified by the first image position specifying process, and the second image position specifying process An image processing method designed to execute a calculation process for three-dimensional measurement using the edge position on the second image specified by the above .
矩形状の視野の範囲を有し、対象物を正面視する方向から撮影するように配置された第1のカメラと、第1のカメラに対して第1のカメラの視野における縦または横の方向に離れた位置にあって、対象物を正面視する方向に対して斜めになる方向から対象物を撮影するように配置された第2のカメラとによりそれぞれ撮影された画像に基づく第1の画像および第2の画像を用いた処理を行う画像処理装置であって、
第1の画像における対象物上の位置を特定する第1画像上位置特定手段と、
第1画像上位置特定処理手段において特定された第1の画像における対象物上の位置に対応する、第2の画像における対象物上の位置を特定する第2画像上位置特定手段と、
第1画像上位置特定手段において特定された位置と第2画像上位置特定手段において特定された位置とを用いて3次元計測用の演算を実行する演算手段とを備え、
第1画像上位置特定手段は、第1の検出領域を第1の画像に対してユーザの指示に基づく位置に設定し、第1のカメラと第2のカメラとの並びの方向をエッジ検出方向として第1の検出領域内でエッジ検出方向におけるエッジの位置を特定し、
第2画像上位置特定手段は、第2の画像に対し、第1のカメラ第2のカメラとの位置関係および第1画像上位置特定手段において特定されたエッジの位置に基づいて設定される特定の一方向をエッジ検出方向とする第2の検出領域を設定し、第2の検出領域内エッジ検出方向におけるエッジの位置を特定する、画像処理装置。
A first camera having a rectangular field of view and arranged to take an image of the object from a front view; and a vertical or horizontal direction in the field of view of the first camera relative to the first camera First images based on images respectively taken by a second camera located at a position apart from each other and arranged so as to photograph the object from a direction oblique to the direction in which the object is viewed from the front And an image processing apparatus that performs processing using the second image,
First on-image position specifying means for specifying a position on the object in the first image;
Second on-image position specifying means for specifying a position on the object in the second image corresponding to a position on the object in the first image specified by the on-image position specifying processing means;
A calculation means for performing a calculation for three-dimensional measurement using the position specified by the first image position specifying means and the position specified by the second image position specifying means;
The first image position specifying means sets the first detection region to a position based on a user instruction with respect to the first image, and sets the direction of arrangement of the first camera and the second camera as an edge detection direction. As the position of the edge in the edge detection direction within the first detection area ,
Second image on the position specifying means, for the second image is set on the basis of the position of a particular edge in the first camera and the positional relationship and the first image on the position specifying means and the second camera An image processing apparatus that sets a second detection area in which one specific direction is an edge detection direction and specifies the position of an edge in the edge detection direction within the second detection area.
矩形状の視野の範囲を有し、対象物を正面視する方向から撮影するように配置された第1のカメラと、第1のカメラに対して第1のカメラの視野における縦または横の方向に離れた位置にあって、対象物を正面視する方向に対して斜めになる方向から対象物を撮影するように配置された第2のカメラとによりそれぞれ撮影された画像に基づく第1の画像および第2の画像を用いた処理を行う画像処理方法であって、
第1の画像における対象物上の位置を特定する第1画像上位置特定ステップと、
第1画像上位置特定処理手段において特定された第1の画像における対象物上の位置に対応する、第2の画像における対象物上の位置を特定する第2画像上位置特定ステップと、
第1画像上位置特定ステップにおいて特定された位置と第2画像上位置特定ステップにおいて特定された位置とを用いて3次元計測用の演算を実行する演算ステップとを備え、
第1画像上位置特定ステップは、第1の検出領域を第1の画像に対してユーザの指示に基づく位置に設定し、第1のカメラと第2のカメラとの並びの方向をエッジ検出方向として第1の検出領域内でエッジ検出方向におけるエッジの位置を特定するものであり、
第2画像上位置特定ステップは、第2の画像に対し、第1のカメラ第2のカメラとの位置関係および第1画像上位置特定手段において特定されたエッジの位置に基づいて設定される特定の一方向をエッジ検出方向とする第2の検出領域を設定し、第2の検出領域内のエッジ検出方向におけるエッジの位置を特定するものである、画像処理方法。
A first camera having a rectangular field of view and arranged to take an image of the object from a front view; and a vertical or horizontal direction in the field of view of the first camera relative to the first camera First images based on images respectively taken by a second camera located at a position apart from each other and arranged so as to photograph the object from a direction oblique to the direction in which the object is viewed from the front And an image processing method for performing processing using the second image,
A first image position specifying step for specifying a position on the object in the first image;
A second on-image position specifying step for specifying a position on the object in the second image corresponding to a position on the object in the first image specified by the on-image position specifying processing means;
A calculation step for performing a calculation for three-dimensional measurement using the position specified in the position specifying step on the first image and the position specified in the position specifying step on the second image;
In the first image position specifying step, the first detection area is set to a position based on a user instruction with respect to the first image, and the direction of the arrangement of the first camera and the second camera is set as the edge detection direction. The position of the edge in the edge detection direction is specified in the first detection area as
Second image on the position specifying step, for the second image is set on the basis of the position of a particular edge in the first camera and the positional relationship and the first image on the position specifying means and the second camera An image processing method for setting a second detection area in which one specific direction is an edge detection direction, and specifying the position of an edge in the edge detection direction in the second detection area.
JP2006140058A 2005-06-17 2006-05-19 Image processing apparatus and image processing method Active JP4788475B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006140058A JP4788475B2 (en) 2005-06-17 2006-05-19 Image processing apparatus and image processing method

Applications Claiming Priority (5)

Application Number Priority Date Filing Date Title
JP2005178540 2005-06-17
JP2005178546 2005-06-17
JP2005178540 2005-06-17
JP2005178546 2005-06-17
JP2006140058A JP4788475B2 (en) 2005-06-17 2006-05-19 Image processing apparatus and image processing method

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2011105609A Division JP5273196B2 (en) 2005-06-17 2011-05-10 Image processing device

Publications (2)

Publication Number Publication Date
JP2007026423A JP2007026423A (en) 2007-02-01
JP4788475B2 true JP4788475B2 (en) 2011-10-05

Family

ID=37787049

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006140058A Active JP4788475B2 (en) 2005-06-17 2006-05-19 Image processing apparatus and image processing method

Country Status (1)

Country Link
JP (1) JP4788475B2 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4985241B2 (en) * 2007-08-31 2012-07-25 オムロン株式会社 Image processing device
JP5189570B2 (en) * 2009-08-19 2013-04-24 株式会社キーエンス Image processing apparatus and image processing method
JP5469491B2 (en) 2010-03-15 2014-04-16 オムロン株式会社 Image processing apparatus and image processing method
JP6375841B2 (en) * 2014-10-02 2018-08-22 株式会社デンソー Gas sensor manufacturing method and assembly apparatus
CN110809786B (en) 2017-06-20 2023-10-27 索尼互动娱乐股份有限公司 Calibration device, calibration chart, chart pattern generation device, and calibration method

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08263663A (en) * 1995-03-27 1996-10-11 Mitsubishi Electric Corp Image processor
JP3842988B2 (en) * 2000-07-19 2006-11-08 ペンタックス株式会社 Image processing apparatus for measuring three-dimensional information of an object by binocular stereoscopic vision, and a method for recording the same, or a recording medium recording the measurement program
JP4442042B2 (en) * 2001-02-23 2010-03-31 パナソニック電工株式会社 Image processing program creation method and system

Also Published As

Publication number Publication date
JP2007026423A (en) 2007-02-01

Similar Documents

Publication Publication Date Title
JP5273196B2 (en) Image processing device
JP4811272B2 (en) Image processing apparatus and image processing method for performing three-dimensional measurement
KR100817656B1 (en) Image processing method, 3-dimension position measuring method, and image processing device
EP2549435B1 (en) Segmentation of a depth map of printed circuit boards
JP4774824B2 (en) Method for confirming measurement target range in three-dimensional measurement processing, method for setting measurement target range, and apparatus for performing each method
EP3496035B1 (en) Using 3d vision for automated industrial inspection
WO2012053521A1 (en) Optical information processing device, optical information processing method, optical information processing system, and optical information processing program
JPWO2008026722A1 (en) 3D model data generation method and 3D model data generation apparatus
JP5096620B2 (en) Join feature boundaries
JP2005072888A (en) Image projection method and image projection device
US7409152B2 (en) Three-dimensional image processing apparatus, optical axis adjusting method, and optical axis adjustment supporting method
US8315457B2 (en) System and method for performing multi-image training for pattern recognition and registration
JP4788475B2 (en) Image processing apparatus and image processing method
JP7214432B2 (en) Image processing method, image processing program, recording medium, image processing apparatus, production system, article manufacturing method
JP4275149B2 (en) Boundary position determination apparatus, method for determining boundary position, program for causing computer to function as the apparatus, and recording medium
KR101792701B1 (en) Apparatus and method for inspecting drawing
JP5445064B2 (en) Image processing apparatus and image processing program
JP4985241B2 (en) Image processing device
CN117529651A (en) Appearance inspection device, appearance inspection method, image generation device, and image generation method
CN116736272A (en) Method, device, equipment and medium for determining joint calibration parameters

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20090114

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110315

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110510

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

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20110704

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140729

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Ref document number: 4788475

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250