[go: up one dir, main page]

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

Image processing apparatus and image processing method Download PDF

Info

Publication number
JP6091092B2
JP6091092B2 JP2012134934A JP2012134934A JP6091092B2 JP 6091092 B2 JP6091092 B2 JP 6091092B2 JP 2012134934 A JP2012134934 A JP 2012134934A JP 2012134934 A JP2012134934 A JP 2012134934A JP 6091092 B2 JP6091092 B2 JP 6091092B2
Authority
JP
Japan
Prior art keywords
image
camera
distance
epipolar line
image processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2012134934A
Other languages
Japanese (ja)
Other versions
JP2013257289A (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.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP2012134934A priority Critical patent/JP6091092B2/en
Publication of JP2013257289A publication Critical patent/JP2013257289A/en
Application granted granted Critical
Publication of JP6091092B2 publication Critical patent/JP6091092B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Description

本発明は、第1及び第2カメラにより対象物を撮像した第1及び第2画像からステレオ法により第1カメラから対象物までの距離を算出する画像処理装置、及び画像処理方法に関する。   The present invention relates to an image processing apparatus and an image processing method for calculating a distance from a first camera to an object by a stereo method from first and second images obtained by imaging the object with first and second cameras.

従来、例えば2つのカメラを用いて2つの画像を撮像することで、三角測量の原理を用い、例えば1つのカメラから対象物までの距離を測量するものが提案されている(特許文献1参照)。このものは、主カメラで対象物が中心上になるように設置すると共に、従カメラの角度を調整して画像中心に対象物が映し出されるように調整し、主カメラと従カメラとの距離、及び従カメラの角度に基づき主カメラから対象物までの距離を算出している。   Conventionally, for example, by using two cameras to capture two images, the principle of triangulation is used to measure the distance from one camera to an object, for example (see Patent Document 1). . This is installed so that the object is centered on the main camera, and the angle of the slave camera is adjusted so that the object is projected at the center of the image, the distance between the master camera and the slave camera, The distance from the main camera to the object is calculated based on the angle of the slave camera.

また、特許文献1では、予め記憶した基準対象物の水平方向の画素数に基づき、主カメラで撮像した対象物の有効画素数から、その対象物の大きさを測定することも提案されている。   Patent Document 1 also proposes measuring the size of an object based on the number of effective pixels of the object imaged by the main camera based on the number of pixels in the horizontal direction of the reference object stored in advance. .

特開平9−318351号公報Japanese Patent Laid-Open No. 9-318351

ところで、上記特許文献1のような距離の測量手法では、主カメラと従カメラとの距離設定や、特に従カメラの角度調整など、機構的な調整を作業者が行う必要があり、調整に手間がかかるという問題がある。そればかりか、機構的な誤差や作業における誤差なども発生するため、測量精度が良好でないという問題もある。   By the way, in the distance surveying method as described in Patent Document 1, it is necessary for the operator to perform mechanical adjustment such as setting the distance between the main camera and the slave camera, and particularly adjusting the angle of the slave camera. There is a problem that it takes. In addition, there is a problem that the measurement accuracy is not good because mechanical errors and work errors occur.

そこで近年、画像処理の分野で複数のカメラを用いて対象までの距離を測定する方法として、エピポーララインを用いたステレオ法が用いられている。詳細には、まず、主カメラの画像内における対象物の特徴点に対応する点を特定する。次に、主カメラと主カメラの画像内の特徴点と従カメラとを通るエピポーラ平面を設定し、従カメラの画像平面内にエピポーララインを設定する。続いて、主カメラの画像内における対象物の特徴点に対応する点を、従カメラの画像平面におけるエピポーラライン上を探索することで対応付けを行う。そして、主カメラ、従カメラ、特徴点、及びそれに対応するエピポーラライン上の点、の三次元仮想空間上の位置関係から三角測量の原理により、主カメラと対象物との距離を算出することができる。   Therefore, in recent years, a stereo method using an epipolar line has been used as a method for measuring the distance to an object using a plurality of cameras in the field of image processing. Specifically, first, a point corresponding to the feature point of the object in the image of the main camera is specified. Next, an epipolar plane passing through the master camera and the feature points in the image of the master camera and the slave camera is set, and an epipolar line is set in the image plane of the slave camera. Subsequently, the points corresponding to the feature points of the object in the image of the main camera are associated by searching on the epipolar line on the image plane of the slave camera. Then, the distance between the main camera and the object can be calculated from the positional relationship in the three-dimensional virtual space of the main camera, the sub camera, the feature point, and the corresponding point on the epipolar line by the principle of triangulation. it can.

しかしながら、例えば画像に複数の同じ形状の対象物が撮像されている場合は、従カメラの画像のエピポーラライン上において対象物の特徴点に対応する点を探索する際、エピポーラライン上に類似した物体が複数存在することがある。その際、他の対象物を、測定すべき対象物の特徴点に対応する点として誤検出すると、上述した主カメラと対象物との距離の算出も誤算出するという問題があった。   However, for example, when a plurality of objects having the same shape are captured in the image, when searching for a point corresponding to the feature point of the object on the epipolar line of the image of the slave camera, an object similar to the epipolar line There may be more than one. At this time, if another object is erroneously detected as a point corresponding to the feature point of the object to be measured, there is a problem that the calculation of the distance between the main camera and the object is also erroneously calculated.

そこで本発明は、第2画像のエピポーララインの上で対象物の特徴点を探索する際の誤検出の防止を図り、第1カメラから対象物までの距離を精度良く算出することが可能な画像処理装置、及び画像処理方法を提供することを目的とするものである。   Therefore, the present invention prevents erroneous detection when searching for feature points of an object on the epipolar line of the second image, and can accurately calculate the distance from the first camera to the object. It is an object of the present invention to provide a processing device and an image processing method.

本発明に係る画像処理装置は、第1カメラにより対象物を撮像した第1画像と、前記第1カメラと異なる視線を有する第2カメラで対象物を撮像した第2画像とを取得し、少なくとも前記第2画像の上にエピポーララインを生成し、前記エピポーララインの上を探索することで前記第2画像の上における対象物の特徴点を特定し、ステレオ法により前記第1カメラから対象物までの距離を算出する画像処理装置において、予め記憶部に記憶された、基準となる対象物と前記第1カメラとの間の基準となる距離において、前記基準となる対象物を前記第1カメラにより実質的に画角いっぱいとなるように撮影した時の画素数、前記対象物の長さ、及び前記基準となる距離に基づき、前記第1画像における対象物の画素数から前記第1カメラと前記対象物との距離の概略値を算出し、前記距離の概略値に応じて、前記第2画像の前記エピポーララインの上で対象物の特徴点を探索する際の探索範囲を狭めるように設定する制御部を備えたことを特徴とする。 An image processing apparatus according to the present invention acquires a first image obtained by imaging an object with a first camera and a second image obtained by imaging the object with a second camera having a line of sight different from that of the first camera, An epipolar line is generated on the second image, a feature point of the object on the second image is specified by searching on the epipolar line, and from the first camera to the object by a stereo method. In the image processing apparatus that calculates the distance , the reference object is stored in the storage unit in advance by the first camera at the reference distance between the reference object and the first camera. the number of pixels at the time of photographing to be substantially angle full length of said object, and based on the distance at which the reference, prior to the first camera from the image primes of the object in the first image The approximate value of the distance to the object is calculated, and the search range when searching for the feature point of the object on the epipolar line of the second image is set to be narrowed according to the approximate value of the distance. A control unit is provided.

また、本発明に係る画像処理方法は、制御部が、第1カメラにより対象物を撮像して第1画像を取得する第1画像取得工程と、前記制御部が、前記第1カメラと異なる視線を有する第2カメラで対象物を撮像して第2画像を取得する第2画像取得工程と、前記制御部が、少なくとも前記第2画像の上にエピポーララインを生成するエピポーラライン生成工程と、前記制御部が、予め記憶部に記憶された、基準となる対象物と前記第1カメラとの間の基準となる距離において、前記基準となる対象物を前記第1カメラにより実質的に画角いっぱいとなるように撮影した時の画素数、前記対象物の長さ、及び前記基準となる距離に基づき、前記第1画像における対象物の画素数から前記第1カメラと前記対象物との距離の概略値を算出する概算距離算出工程と、前記制御部が、前記算出された距離の概略値に応じて、前記第2画像の前記エピポーララインの上で対象物の特徴点を探索する際の探索範囲を狭めるように設定する探索範囲設定工程と、前記制御部が、前記設定された探索範囲で前記エピポーララインの上を探索することで前記第2画像の上における対象物の特徴点を特定し、ステレオ法により前記第1カメラから対象物までの距離を算出する距離算出工程と、を備えたことを特徴とする。 In the image processing method according to the present invention, the control unit captures a first image by capturing an object with the first camera, and the control unit has a line of sight different from that of the first camera. A second image acquisition step of acquiring a second image by imaging a target object with a second camera, and an epipolar line generation step of generating an epipolar line on at least the second image, The control unit stores the reference object at the reference camera between the reference camera and the reference camera between the reference camera and the first camera. the number of pixels at the time of photographing so that the length of the object, and based on the distance at which the reference, the image prime of the object in the first image distance between the object and the first camera Approximate distance for calculating approximate values The calculation step and the control unit are set to narrow a search range when searching for a feature point of the object on the epipolar line of the second image according to the approximate value of the calculated distance. A search range setting step, and the control unit specifies a feature point of an object on the second image by searching on the epipolar line in the set search range, and the first method is performed by a stereo method. A distance calculating step of calculating a distance from the camera to the object.

本発明によると、予め記憶部に記憶された、基準となる対象物と前記第1カメラとの間の基準となる距離において、前記基準となる対象物を前記第1カメラにより実質的に画角いっぱいとなるように撮影した時の画素数、前記対象物の長さ、及び前記基準となる距離に基づき、第1画像における対象物の画素数から第1カメラと対象物との距離の概略値を算出し、距離の概略値に応じて、第2画像のエピポーララインの上で対象物の特徴点を探索する際の探索範囲を狭めるように設定することができる。これにより、第2画像のエピポーララインの上で、例えば類似した対象物が複数存在していたとしても、対象物の特徴点を探索する際の誤検出の防止が図られ、第1カメラから対象物までの距離を精度良く算出することができる。 According to the present invention, at the reference distance between the reference target object and the first camera stored in the storage unit in advance, the reference target object is substantially viewed by the first camera. full and the number of pixels when photographed so, the length of the object, and based on the distance to be the reference, approximate value of the distance between the first camera and the object from the image prime object in the first image And the search range when searching for the feature point of the object on the epipolar line of the second image can be set to be narrowed according to the approximate value of the distance. Thereby, even if there are a plurality of similar objects on the epipolar line of the second image, for example, it is possible to prevent erroneous detection when searching for feature points of the object. The distance to the object can be calculated with high accuracy.

本発明の実施の形態に係るロボット装置を示す模式図。The schematic diagram which shows the robot apparatus which concerns on embodiment of this invention. 図1のロボットコントローラの構成を示す模式図。The schematic diagram which shows the structure of the robot controller of FIG. 主カメラ画像と従カメラ画像とエピポーラ平面との関係を示す図。The figure which shows the relationship between a main camera image, a subcamera image, and an epipolar plane. 主カメラ画像におけるワークの有効画素数と距離との関係を示す図。The figure which shows the relationship between the effective pixel number of a workpiece | work in a main camera image, and distance. 従カメラ画像のエピポーラライン上の探索範囲を示す図。The figure which shows the search range on the epipolar line of a subcamera image. 本実施の形態に係る距離算出制御を示すフローチャート。The flowchart which shows the distance calculation control which concerns on this Embodiment.

以下、本発明に係る実施の形態を図1乃至図6に沿って説明する。まず、本発明に係る画像処理装置(ロボットコントローラ10)を備えたロボット装置1について、図1に沿って説明する。   Hereinafter, embodiments according to the present invention will be described with reference to FIGS. 1 to 6. First, a robot apparatus 1 including an image processing apparatus (robot controller 10) according to the present invention will be described with reference to FIG.

図1に示すように、本実施の形態に係るロボット装置1は、複数のロボット装置と組み合わされて一連の生産ラインを構築する、いわゆるロボットセルと呼ばれる組立ロボットである。このロボット装置1は、フレーム状のブース7の内部にワーク(対象物)Wに対して組立などの作業を行うロボットアーム2が配設されて構成されている。このブース7の上部にはロボットアーム2の上方からワークWを撮像するためのカメラ3及び照明5が取り付けられている。   As shown in FIG. 1, a robot apparatus 1 according to the present embodiment is an assembly robot called a so-called robot cell that is combined with a plurality of robot apparatuses to construct a series of production lines. The robot apparatus 1 is configured such that a robot arm 2 that performs an assembly operation on a work (object) W is disposed inside a frame-shaped booth 7. A camera 3 and an illumination 5 for imaging the workpiece W from above the robot arm 2 are attached to the top of the booth 7.

また、上記ロボットアーム2を支持する架台6の内側には、上記ロボットアーム2に対して駆動指令を与えるロボットコントローラ(画像処理装置、コンピュータ)10が設けられている。ロボットコントローラ10は、カメラ3によって撮像された画像からワークWとカメラ3との距離を算出し、その距離やカメラ3の視線等から3次元位置を認識し、ロボットアーム2に対して駆動指令を生成する。ロボット装置1は、これらロボットアーム2、カメラ3及びロボットコントローラ10を基本構成としており、カメラ3により撮像された画像を基にワークWを認識し、ロボットアーム2によってワークWを把持して組立などの作業を行うようになっている。   A robot controller (image processing apparatus, computer) 10 that provides a drive command to the robot arm 2 is provided inside the gantry 6 that supports the robot arm 2. The robot controller 10 calculates the distance between the workpiece W and the camera 3 from the image captured by the camera 3, recognizes the three-dimensional position from the distance, the line of sight of the camera 3, etc., and issues a drive command to the robot arm 2. Generate. The robot apparatus 1 has the basic configuration of the robot arm 2, the camera 3, and the robot controller 10. The robot apparatus 1 recognizes the work W based on the image captured by the camera 3, and grips the work W by the robot arm 2 for assembly. Work to do.

なお、上記カメラ3は、図2に示すように、カメラパラメータが校正された主カメラ(第1カメラ)3a及び従カメラ(第2カメラ)3bからなるステレオカメラによって構成されており、いわゆるステレオ法を用いてワークWの位置(距離)を認識する。   As shown in FIG. 2, the camera 3 is composed of a stereo camera including a main camera (first camera) 3a and a slave camera (second camera) 3b whose camera parameters are calibrated. Is used to recognize the position (distance) of the workpiece W.

上記ロボットコントローラ10は、演算装置(制御部)102、記憶装置(記憶部)103、インターフェイス装置106、記録ディスク読取装置115、通信装置112等を有しており、それらがバス111を介して相互に通信可能に接続されている。また、バス111には、上述したロボットアーム2、ティーチングペンダント116などが接続されている。なお、ティーチングペンダント116とは、ロボットアーム2に動作指令を与えるための操作端末である。   The robot controller 10 includes an arithmetic device (control unit) 102, a storage device (storage unit) 103, an interface device 106, a recording disk reading device 115, a communication device 112, and the like. Is communicably connected. The bus 111 is connected to the robot arm 2 and the teaching pendant 116 described above. The teaching pendant 116 is an operation terminal for giving an operation command to the robot arm 2.

演算装置102は、CPU102aを有しており、CPU102aは、詳しくは後述するように主カメラ3a及び従カメラ3bによってワークWが撮像されたステレオ画像からワークWの位置(距離)を算出し、ロボットアーム2に対して駆動指令を与える。また、演算装置102は、画像処理装置102bや音声処理装置102cを有しており、ディスプレイ107やスピーカ109に所望の画像や音声を出力可能に構成されている。   The arithmetic unit 102 includes a CPU 102a, and the CPU 102a calculates the position (distance) of the work W from a stereo image obtained by capturing the work W by the master camera 3a and the slave camera 3b as will be described in detail later. A drive command is given to the arm 2. The arithmetic device 102 includes an image processing device 102b and a sound processing device 102c, and is configured to output a desired image and sound to the display 107 and the speaker 109.

上記記憶装置103は、RAM103bやROM103aを有しており、例えばROM103aには、詳しくは後述する画像処理(距離の算出)を実行するための画像処理プログラムIPPが格納されている。また、詳しくは後述するように、予め基準となるワークWBASEを撮像した画像は、RAM103b等に一時的に格納される。なお、画像処理プログラムIPPは、例えば記録ディスクDiskなどに記録された情報から読み込んでROM103aに格納しても良く、又は通信装置112を介して外部ネットワークからダウンロードする形でROM103aに格納しても良い。 The storage device 103 includes a RAM 103b and a ROM 103a. For example, the ROM 103a stores an image processing program IPP for performing image processing (calculation of distance) described in detail later. Further, as will be described in detail later, an image obtained by capturing a reference workpiece W BASE in advance is temporarily stored in the RAM 103b or the like. Note that the image processing program IPP may be read from information recorded on, for example, a recording disk Disk and stored in the ROM 103a, or may be stored in the ROM 103a in a form downloaded from an external network via the communication device 112. .

上記インターフェイス装置106には、インターフェイス106cを介して上述した主カメラ3a及び従カメラ3bからなるステレオカメラ3が接続されている。これにより、主カメラ3aにより撮像した画像G1や従カメラ3bにより撮像した画像G2を受信し、上記記憶装置103のRAM103b等に一時的に格納し得る。また反対に、主カメラ3aや従カメラ3bにCPU102a等から指令を送信し、露出やシャッター速度、ズーム等の撮像条件を変更することも可能である。なお、インターフェイス106cには、例えば作業者が情報入力を行うためのキーボード106aやマウス106bを接続してもよい。   The interface device 106 is connected to the stereo camera 3 including the main camera 3a and the slave camera 3b described above via an interface 106c. Thereby, the image G1 imaged by the main camera 3a and the image G2 imaged by the slave camera 3b can be received and temporarily stored in the RAM 103b of the storage device 103 or the like. On the other hand, it is also possible to change the imaging conditions such as exposure, shutter speed, and zoom by transmitting a command from the CPU 102a or the like to the main camera 3a or the slave camera 3b. For example, a keyboard 106a or a mouse 106b for an operator to input information may be connected to the interface 106c.

ついで、エピポーララインを用いたステレオ法による距離算出の原理を図3に沿って説明する。まず、主カメラ3aにより撮像した第1画像G1と従カメラ3bにより撮像した第2画像G2とを取得する。すると、主カメラ3a、従カメラ3b、ワークW(カメラとワークとを結ぶ視線)を通るエピポーラ平面を三次元仮想空間上に設定することができる。このエピポーラ平面を通る線を、第2画像G2に投影し、エピポーララインEPとして設定できる。この第2画像G2のエピポーララインEPは、主カメラ3aからワークWの特徴点までの視線とも言える。なお、エピポーラ平面が求まるので、第1画像G1にもエピポーララインEPを設定することができる。   Next, the principle of distance calculation by the stereo method using epipolar lines will be described with reference to FIG. First, a first image G1 captured by the main camera 3a and a second image G2 captured by the slave camera 3b are acquired. Then, an epipolar plane passing through the main camera 3a, the slave camera 3b, and the work W (line of sight connecting the camera and the work) can be set on the three-dimensional virtual space. A line passing through the epipolar plane can be projected onto the second image G2 and set as an epipolar line EP. It can be said that the epipolar line EP of the second image G2 is a line of sight from the main camera 3a to the feature point of the workpiece W. Since the epipolar plane is obtained, the epipolar line EP can be set also in the first image G1.

第1画像G1におけるエピポーララインEP上にはワークWの特徴点Pbが存在し、第2画像G2におけるエピポーララインEP上にはワークWの特徴点Prが存在するので、その特徴点Pb,Prを探索して求める。特徴点Prが求まると、従カメラ3bから、主カメラ3aとワークWの特徴点Prとの視野角が求まるので、その視野角と、既知の主カメラ3aと従カメラ3bとの距離とから三角測量の原理で、主カメラ3aとワークWとの距離Lを算出することができる。なお、同じ原理で、従カメラ3bとワークWとの距離も算出できるので、これらの距離や視野角の関係から、ワークWの三次元位置(三次元座標)を求めることが可能である。従って、カメラ3とワークWとの距離が算出できれば、ワークWの三次元位置も算出できることになる。   Since the feature point Pb of the workpiece W exists on the epipolar line EP in the first image G1, and the feature point Pr of the workpiece W exists on the epipolar line EP in the second image G2, the feature points Pb, Pr are Search and seek. When the feature point Pr is obtained, the viewing angle between the master camera 3a and the feature point Pr of the work W is obtained from the slave camera 3b. Therefore, the triangle is obtained from the view angle and the known distance between the master camera 3a and the slave camera 3b. Based on the principle of surveying, the distance L between the main camera 3a and the workpiece W can be calculated. Since the distance between the slave camera 3b and the workpiece W can also be calculated based on the same principle, the three-dimensional position (three-dimensional coordinates) of the workpiece W can be obtained from the relationship between these distances and viewing angles. Therefore, if the distance between the camera 3 and the workpiece W can be calculated, the three-dimensional position of the workpiece W can also be calculated.

つづいて、本実施の形態に係る距離算出制御を図4乃至図6に沿って説明する。図6に示すように、本距離算出制御を開始(スタート)すると、まず、演算装置(制御部)102は、主カメラ3aよりワークWが撮影された第1画像G1を取得する(S1)(第1画像取得工程)。同様に、演算装置102は、従カメラ3bよりワークWが撮影された第2画像G2を取得する(S2)(第2画像取得工程)。   Next, distance calculation control according to the present embodiment will be described with reference to FIGS. As shown in FIG. 6, when the distance calculation control is started (started), first, the computing device (control unit) 102 acquires the first image G1 obtained by photographing the workpiece W from the main camera 3a (S1) ( First image acquisition step). Similarly, the arithmetic unit 102 acquires the second image G2 in which the workpiece W is photographed from the slave camera 3b (S2) (second image acquisition step).

続いて、演算装置102は、上述したようにエピポーララインEPを算出し(S3)(図3参照)(エピポーラライン生成工程)、第1画像G1及び第2画像G2に投影する。第1画像G1にエピポーララインEPが投影されると、演算装置102は、第1画像G1(主カメラ画像)における特徴点Pbを算出する(S4)。   Subsequently, the arithmetic unit 102 calculates the epipolar line EP as described above (S3) (see FIG. 3) (epipolar line generation step), and projects it on the first image G1 and the second image G2. When the epipolar line EP is projected onto the first image G1, the computing device 102 calculates a feature point Pb in the first image G1 (main camera image) (S4).

次に、ステップS5に進むと、主カメラ3aとワークWとの距離L(図3参照)の概略値の算出を行う。詳細には、まず、図4(c)に示すように、予め基準となるワークWBASEの水平方向の両端が主カメラ3aの画角いっぱいに丁度写るように、ワークWBASEと主カメラ3aの距離を調整して主カメラ3aで撮影する。その際に主カメラ3aからワークWBASEまでの距離Dを測定しておき、更に、ワークWBASEの画素数Pを測定しておく。そして、ワークWBASEの水平方向の既知の長さXと、画像上の水平方向の長さWID1と、画素数Pと、距離Dとの各値を、記憶装置103に記憶させておく。 Next, in step S5, an approximate value of the distance L (see FIG. 3) between the main camera 3a and the workpiece W is calculated. In detail, first, as shown in FIG. 4C, the workpiece W BASE and the main camera 3a are arranged so that both ends in the horizontal direction of the reference workpiece W BASE are captured in full within the angle of view of the main camera 3a. Adjust the distance and take a picture with the main camera 3a. At that time, the distance D from the main camera 3a to the work W BASE is measured, and further, the number of pixels P W of the work W BASE is measured. Then, the storage device 103 stores the values of the known length X of the workpiece W BASE in the horizontal direction, the horizontal length WID1 on the image, the number of pixels PW, and the distance D.

この基準となるワークWBASEの水平方向の画像上の長さWID1と画素数Pとの対応関係は、ワークと主カメラ3aとの位置関係に変更がない限り、一度計測すれば足り、実際にワークWまでの距離Lを求める演算を行う際は、定数として扱うことができる。 As long as there is no change in the positional relationship between the workpiece and the main camera 3a, the correspondence between the length WID1 on the horizontal image of the workpiece W BASE serving as the reference and the number of pixels P W is sufficient as long as the positional relationship between the workpiece and the main camera 3a is not changed. When calculating the distance L to the workpiece W, it can be handled as a constant.

上記で求めた各定数を用いて、第1画像G1上における水平方向の既知の長さXのワークWまでの距離Lを求めるためには、図4(a)に示すような相乗比を用いて、下記の数式(1)で求めることができる。なお、主カメラ3aから距離Lだけ離れた位置における、主カメラ3aの水平方向の第1画像G1上の長さを、「WID2」とする。   In order to obtain the distance L to the workpiece W having a known length X in the horizontal direction on the first image G1 using each constant obtained above, a synergistic ratio as shown in FIG. Thus, it can be obtained by the following formula (1). Note that the length of the main camera 3a on the first image G1 in the horizontal direction at a position away from the main camera 3a by a distance L is “WID2”.

Figure 0006091092
Figure 0006091092

また、長さWID2は、前述の水平方向の既知の長さXのワークWの画素数Pを計測すると、ワークWと基準となるワークWBASEのそれぞれの水平方向の長さと画素数の相乗比を用いて、下記の数式(2)で求められる。 The length WID2, when measuring the number of pixels P X of the work W of known length X in the horizontal direction described above, each of the horizontal length and synergistic number of pixels of the workpiece W BASE as the workpiece W and the reference It is calculated | required by following Numerical formula (2) using ratio.

Figure 0006091092
Figure 0006091092

要するに、数式(1)及び数式(2)より、主カメラ3aからワークWまでの距離Lは、下記の数式(3)で求められる。   In short, the distance L from the main camera 3a to the workpiece W can be obtained from the following equation (3) from the equations (1) and (2).

Figure 0006091092
Figure 0006091092

なお、上記算出例では、ワークWの特徴量としてワークWの水平方向の長さを用いて算出したが、これに限らず、ワークWの垂直方向の長さや面積を特徴量として算出に用いてもよい。特徴量をワークWの垂直方向の長さとする場合は、上記数式(3)のPxをワークWの垂直方向の画素数、XをワークWの垂直方向の既知の長さ、WID1をワークWBASEの垂直方向の長さ、PwをワークWBASEの垂直方向の画素数とすることになる。また、特徴量をワークWの面積とする場合は、上記数式(3)のPxをワークWの面積の画素数、XをワークWの面積、WID1をワークWBASEの面積、PwをワークWBASEの面積の画素数とすることになる。 In the above calculation example, the horizontal length of the workpiece W is calculated as the feature amount of the workpiece W. However, the present invention is not limited to this, and the vertical length or area of the workpiece W is used as the feature amount for calculation. Also good. When the feature amount is the length in the vertical direction of the workpiece W, Px in Equation (3) is the number of pixels in the vertical direction of the workpiece W, X is a known length in the vertical direction of the workpiece W, and WID1 is the workpiece W BASE. , Pw is the number of pixels in the vertical direction of the work W BASE . When the feature amount is the area of the work W, Px in the above formula (3) is the number of pixels of the area of the work W, X is the area of the work W, WID1 is the area of the work W BASE , and Pw is the work W BASE. This is the number of pixels of the area.

このように、演算装置102が、主カメラ3aの第1画像G1よりワークWの画素数Pxを測定し、記憶装置103に記憶された各定数を用いて、上記数式(3)より、主カメラ3aからワークWまでの距離Lの概略値を算出する(S5)(概算距離算出工程)。   As described above, the arithmetic device 102 measures the pixel number Px of the work W from the first image G1 of the main camera 3a, and uses the constants stored in the storage device 103 to calculate the main camera from the above equation (3). An approximate value of the distance L from 3a to the workpiece W is calculated (S5) (approximate distance calculating step).

次に、演算装置102は、算出された距離Lの概略値に応じて、第2画像G2のエピポーララインEPの上で対象物の特徴点Prを探索する際の探索範囲を狭めるように設定する(S6)(探索範囲設定工程)。詳細には、図5に示すように、主カメラ3aから算出した距離Lの概略値だけ離れた位置より、主カメラ3aの手前側に−d移動した位置A’と、奥側に+d移動した位置B’との間を探索範囲に設定(限定)する。なお、±dは、画像処理演算における画像認識誤差とワークWの寸法誤差を合わせたものの最大値に設定する。 Next, the computing device 102 sets the search range when searching for the feature point Pr of the object on the epipolar line EP of the second image G2 in accordance with the approximate value of the calculated distance L. (S6) (search range setting step). Specifically, as shown in FIG. 5, the position A ′ moved −d Z to the near side of the main camera 3 a from the position separated by the approximate value of the distance L calculated from the main camera 3 a, and + d Z on the far side. The search range is set (limited) to the moved position B ′. Incidentally, ± d Z is set to the maximum value but the combined size error of the image recognition error and the workpiece W in the image processing operations.

続いて、演算装置102は、従カメラ3bの第2画像G2において、エピポーララインEP上の位置A’B’の間でワークWの特徴点の探索を行い、その探索範囲にある画像上の特徴から特徴点Prを特定するように算出する(S7)。   Subsequently, the computing device 102 searches for a feature point of the work W between positions A′B ′ on the epipolar line EP in the second image G2 of the slave camera 3b, and features on the image within the search range. To calculate the feature point Pr (S7).

そして、上記ステップS4で求めた第1画像G1の特徴点Pbと、ステップS7で特定した特徴点Prとにより、上述したステレオ法を用いて、主カメラ3aからワークWまでの距離Lを算出する(S8)(距離算出工程)。以上により、本距離算出制御を終了する。   Then, the distance L from the main camera 3a to the workpiece W is calculated by using the stereo method described above from the feature point Pb of the first image G1 obtained in step S4 and the feature point Pr specified in step S7. (S8) (Distance calculation step). This is the end of the distance calculation control.

即ち、図5に示すように、例えば従カメラ3bの第2画像G2内における画角いっぱいであるエピポーララインEP上の位置ABで探索すると、例えば隣接するワークW+1やワークW−1における画像上の特徴を特徴点として誤検出してしまう虞があった。しかし、ワークWまでの距離Lの概略値を算出し、探索範囲をその近傍±dの範囲に限定することで、例えば隣接するワークW+1やワークW−1は探索範囲から除外できるため、特徴点の対応付けによる誤検出が防がれる。 That is, as shown in FIG. 5, for example, when searching at the position AB on the epipolar line EP that is full of the angle of view in the second image G2 of the slave camera 3b, on the image at the adjacent workpiece W + 1 or workpiece W− 1, for example. There is a risk of misdetecting these features as feature points. However, to calculate the approximate value of the distance L to the workpiece W, since the search range is limited to a range from the vicinity of ± d Z, for example, adjacent work W +1 and work W -1 is that can be excluded from the search range, False detection due to feature point association is prevented.

以上のように、第1画像G1におけるワークWの特徴量の画素数Pから主カメラ3aとワークWとの距離Lの概略値を算出する。そして、距離Lの概略値に応じて、第2画像G2のエピポーララインEPの上でワークWの特徴点を探索する際の探索範囲を狭めるように設定することができる。これにより、第2画像G2のエピポーララインEPの上で、例えば類似したワークが複数存在していたとしても、ワークWの特徴点を探索する際の誤検出の防止が図られ、主カメラ3aからワークWまでの距離を精度良く算出することができる。 As described above, to calculate the approximate value of the distance L between the main camera 3a and the workpiece W from the number of pixels P X feature amount of the work W in the first image G1. Then, according to the approximate value of the distance L, the search range when searching for the feature points of the workpiece W on the epipolar line EP of the second image G2 can be set to be narrowed. Thereby, even if there are a plurality of similar works, for example, on the epipolar line EP of the second image G2, it is possible to prevent erroneous detection when searching for a feature point of the work W. From the main camera 3a, The distance to the workpiece W can be calculated with high accuracy.

このようにワークまでの距離、即ちワークの三次元位置を精度良く算出できることで、ロボットアーム2でワークWに対して作業を行う際にも、精度の高い、正確な作業を施すことができる。   Since the distance to the workpiece, that is, the three-dimensional position of the workpiece can be calculated with high accuracy, even when the robot arm 2 performs an operation on the workpiece W, a highly accurate and accurate operation can be performed.

なお、本実施の形態においては、画像処理装置をロボットコントローラ10に搭載したものを一例に説明したが、これに限らず、対象物までの距離を正確に測量することが求められるものには、どのようなものでも用いることができる。即ち、例えば三次元形状計測器や、自動車の衝突防止装置など、画像を用いて対象物までの距離を検出することが求められるものに用いることができる。   In the present embodiment, an example in which the image processing apparatus is mounted on the robot controller 10 has been described as an example. However, the present invention is not limited to this, and what is required to accurately measure the distance to an object includes: Anything can be used. That is, for example, it can be used for a device that is required to detect a distance to an object using an image, such as a three-dimensional shape measuring instrument or an automobile collision prevention device.

3a…第1カメラ(主カメラ):3b…第2カメラ(従カメラ):10…画像処理装置、コンピュータ(ロボットコントローラ):102…制御部(演算装置):103…記憶部(記憶装置):D…距離:EP…エピポーラライン:G1…第1画像:G2…第2画像:L…距離:Pr…特徴点:P…画素数:P…画素数:W…対象物(ワーク) 3a ... 1st camera (main camera): 3b ... 2nd camera (secondary camera): 10 ... Image processing device, computer (robot controller): 102 ... Control unit (arithmetic unit): 103 ... Storage unit (storage device): D ... distance: EP ... epipolar lines: G1 ... first image: G2 ... second image: L ... distance: Pr ... minutiae: P W ... number of pixels: P X ... number of pixels: W ... object (workpiece)

Claims (4)

第1カメラにより対象物を撮像した第1画像と、前記第1カメラと異なる視線を有する第2カメラで対象物を撮像した第2画像とを取得し、少なくとも前記第2画像の上にエピポーララインを生成し、前記エピポーララインの上を探索することで前記第2画像の上における対象物の特徴点を特定し、ステレオ法により前記第1カメラから対象物までの距離を算出する画像処理装置において、
予め記憶部に記憶された、基準となる対象物と前記第1カメラとの間の基準となる距離において、前記基準となる対象物を前記第1カメラにより実質的に画角いっぱいとなるように撮影した時の画素数、前記対象物の長さ、及び前記基準となる距離に基づき、前記第1画像における対象物の画素数から前記第1カメラと前記対象物との距離の概略値を算出し、前記距離の概略値に応じて、前記第2画像の前記エピポーララインの上で対象物の特徴点を探索する際の探索範囲を狭めるように設定する制御部を備えた、
ことを特徴とする画像処理装置。
A first image obtained by imaging the object with the first camera and a second image obtained by imaging the object with a second camera having a line of sight different from that of the first camera are acquired, and an epipolar line is formed on at least the second image. In the image processing apparatus, the feature point of the object on the second image is specified by searching on the epipolar line, and the distance from the first camera to the object is calculated by a stereo method. ,
At the reference distance between the reference target object and the first camera stored in the storage unit in advance , the reference target object is substantially filled with the angle of view by the first camera. the number of pixels at the time of shooting, calculates the length of the object, and based on the distance at which the reference, the approximate value of the distance from the image prime object and said first camera and said object in said first image And, according to the approximate value of the distance, provided with a control unit that is set to narrow the search range when searching for the feature points of the object on the epipolar line of the second image,
An image processing apparatus.
前記第1及び第2カメラと、
前記第1カメラから対象物までの距離を算出する請求項1記載の画像処理装置と、
前記算出した距離に基づき前記対象物に対して作業を行うロボットアームと、を備えた、
ことを特徴とするロボット装置。
The first and second cameras;
The image processing apparatus according to claim 1, wherein a distance from the first camera to an object is calculated;
A robot arm that performs work on the object based on the calculated distance,
A robot apparatus characterized by that.
制御部が、第1カメラにより対象物を撮像して第1画像を取得する第1画像取得工程と、
前記制御部が、前記第1カメラと異なる視線を有する第2カメラで対象物を撮像して第2画像を取得する第2画像取得工程と、
前記制御部が、少なくとも前記第2画像の上にエピポーララインを生成するエピポーラライン生成工程と、
前記制御部が、予め記憶部に記憶された、基準となる対象物と前記第1カメラとの間の基準となる距離において、前記基準となる対象物を前記第1カメラにより実質的に画角いっぱいとなるように撮影した時の画素数、前記対象物の長さ、及び前記基準となる距離に基づき、前記第1画像における対象物の画素数から前記第1カメラと前記対象物との距離の概略値を算出する概算距離算出工程と、
前記制御部が、前記算出された距離の概略値に応じて、前記第2画像の前記エピポーララインの上で対象物の特徴点を探索する際の探索範囲を狭めるように設定する探索範囲設定工程と、
前記制御部が、前記設定された探索範囲で前記エピポーララインの上を探索することで前記第2画像の上における対象物の特徴点を特定し、ステレオ法により前記第1カメラから対象物までの距離を算出する距離算出工程と、を備えた、
ことを特徴とする画像処理方法。
A first image acquisition step in which the control unit acquires a first image by capturing an image of an object with the first camera;
A second image acquisition step in which the control unit acquires a second image by capturing an object with a second camera having a line of sight different from that of the first camera;
The controller generates an epipolar line on at least the second image; and
At the reference distance between the reference object and the first camera stored in the storage unit in advance by the control unit , the reference object is substantially viewed by the first camera. full become as the number of pixels at the time of shooting, the length of the object, and based on the distance at which the reference distance from the image prime object to the first camera the object in the first image An approximate distance calculating step for calculating an approximate value of
A search range setting step in which the control unit sets so as to narrow a search range when searching for a feature point of the object on the epipolar line of the second image according to the approximate value of the calculated distance. When,
The control unit specifies a feature point of the object on the second image by searching on the epipolar line in the set search range, and from the first camera to the object by a stereo method. A distance calculating step for calculating a distance,
An image processing method.
請求項3記載の各工程をコンピュータに実行させるための画像処理プログラム。   An image processing program for causing a computer to execute each step according to claim 3.
JP2012134934A 2012-06-14 2012-06-14 Image processing apparatus and image processing method Expired - Fee Related JP6091092B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012134934A JP6091092B2 (en) 2012-06-14 2012-06-14 Image processing apparatus and image processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012134934A JP6091092B2 (en) 2012-06-14 2012-06-14 Image processing apparatus and image processing method

Publications (2)

Publication Number Publication Date
JP2013257289A JP2013257289A (en) 2013-12-26
JP6091092B2 true JP6091092B2 (en) 2017-03-08

Family

ID=49953832

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012134934A Expired - Fee Related JP6091092B2 (en) 2012-06-14 2012-06-14 Image processing apparatus and image processing method

Country Status (1)

Country Link
JP (1) JP6091092B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7024401B2 (en) 2017-12-27 2022-02-24 富士通株式会社 Information processing equipment, programs, and information processing methods
CN114663360A (en) * 2022-03-02 2022-06-24 安迅捷智能机器人(宁夏)有限责任公司 Welding deformation measuring method based on vision measurement

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2979619B2 (en) * 1990-09-28 1999-11-15 日本電気株式会社 Stereoscopic device
JP3395344B2 (en) * 1994-04-20 2003-04-14 日産自動車株式会社 Image processing device and doze alarm device using the same
JP2000121334A (en) * 1998-10-09 2000-04-28 Nidec Tosok Corp Lead inspecting device
JP2008209306A (en) * 2007-02-27 2008-09-11 Nikon Corp Camera
JP2008292278A (en) * 2007-05-24 2008-12-04 Konica Minolta Holdings Inc Optical deviation detection method of distance detection device, and distance detection device
JP4677536B1 (en) * 2009-11-20 2011-04-27 株式会社三次元メディア 3D object recognition apparatus and 3D object recognition method
JP5471355B2 (en) * 2009-11-24 2014-04-16 オムロン株式会社 3D visual sensor

Also Published As

Publication number Publication date
JP2013257289A (en) 2013-12-26

Similar Documents

Publication Publication Date Title
US10825198B2 (en) 3 dimensional coordinates calculating apparatus, 3 dimensional coordinates calculating method, 3 dimensional distance measuring apparatus and 3 dimensional distance measuring method using images
JP5745178B2 (en) Three-dimensional measurement method, apparatus and system, and image processing apparatus
JP5715735B2 (en) Three-dimensional measurement method, apparatus and system, and image processing apparatus
TWI521471B (en) 3 - dimensional distance measuring device and method thereof
JP7173285B2 (en) Camera calibration device, camera calibration method, and program
JP6209833B2 (en) Inspection tool, inspection method, stereo camera production method and system
WO2017199696A1 (en) Image processing device and image processing method
JP2016060610A (en) Elevator hoistway internal dimension measuring device, elevator hoistway internal dimension measuring controller, and elevator hoistway internal dimension measuring method
JP6413595B2 (en) Image processing apparatus, system, image processing method, and program
JP6875836B2 (en) Wire rope measuring device and method
JPWO2011125937A1 (en) Calibration data selection device, selection method, selection program, and three-dimensional position measurement device
US8941732B2 (en) Three-dimensional measuring method
KR102129206B1 (en) 3 Dimensional Coordinates Calculating Apparatus and 3 Dimensional Coordinates Calculating Method Using Photo Images
US20210183092A1 (en) Measuring apparatus, measuring method and microscope system
US11295478B2 (en) Stereo camera calibration method and image processing device for stereo camera
JP2002099902A (en) Image processing apparatus for measuring three-dimensional information of an object by binocular stereopsis, and a recording medium storing the method or the measurement program
JP6091092B2 (en) Image processing apparatus and image processing method
WO2015159835A1 (en) Image processing device, image processing method, and program
JP2008224323A (en) Stereoscopic photograph measuring instrument, stereoscopic photograph measuring method, and stereoscopic photograph measuring program
JP5996233B2 (en) Imaging device
JP2000205821A (en) Instrument and method for three-dimensional shape measurement
JP2012181063A (en) Calculation device, calculation method and calculation program
JP5358137B2 (en) Image generating apparatus, method and program
JP2013053948A (en) Device and method for measuring camera state
JP7399632B2 (en) Photography processing device and photography processing method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20150610

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20160526

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20160531

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20160801

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20170207

R151 Written notification of patent or utility model registration

Ref document number: 6091092

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

LAPS Cancellation because of no payment of annual fees