JP2015031601A - Three-dimensional measurement instrument, method, and program - Google Patents
Three-dimensional measurement instrument, method, and program Download PDFInfo
- Publication number
- JP2015031601A JP2015031601A JP2013161278A JP2013161278A JP2015031601A JP 2015031601 A JP2015031601 A JP 2015031601A JP 2013161278 A JP2013161278 A JP 2013161278A JP 2013161278 A JP2013161278 A JP 2013161278A JP 2015031601 A JP2015031601 A JP 2015031601A
- Authority
- JP
- Japan
- Prior art keywords
- mirror
- camera
- measurement object
- calculating
- feature pattern
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Abstract
Description
本発明は、画像解析により物体等の3次元位置を計測する技術に関するものである。 The present invention relates to a technique for measuring a three-dimensional position of an object or the like by image analysis.
従来より3次元計測の方法として、ステレオ視を用いた方法が知られている。既存の技術として、特許文献1では、移動式ステレオカメラを用いて対象物の実像を撮影するだけでなく、対象物を映す鏡に映る虚像も撮影し、実像と虚像を利用して対象物の3次元形状の測定を行う手法が開示されている。また、特許文献2では、電子カメラ、可動ミラー、2つのマーカーを用意し、電子カメラの撮像面に対するマーカーの投影点の位置を検出し、カメラの位置、マーカーの位置、可動ミラーの姿勢、投影点の位置に基づいて、カメラの姿勢を算出しステレオ視のためのステレオカメラの転生を行う手法が開示されている。 Conventionally, a method using stereo vision is known as a three-dimensional measurement method. As an existing technology, Patent Document 1 not only captures a real image of an object using a movable stereo camera, but also captures a virtual image reflected in a mirror that reflects the object, and uses the real image and the virtual image to capture the object. A technique for measuring a three-dimensional shape is disclosed. In Patent Document 2, an electronic camera, a movable mirror, and two markers are prepared, the position of the projection point of the marker on the imaging surface of the electronic camera is detected, the position of the camera, the position of the marker, the attitude of the movable mirror, and the projection A method is disclosed in which the orientation of a camera is calculated based on the position of a point and the stereo camera is reinstated for stereo viewing.
従来技術のステレオ視による3次元計測手法では、カメラ間の関係を求めるために特徴パターンを用いた位置姿勢計測がキャリブレーションとして行われてきた。このカメラ間の姿勢値は、計測物体の3次元計測結果に大きく影響する。特に特徴パターンをカメラで正面付近から観測した時の姿勢誤差は大きくなり、計測結果に誤差を大きく生じさせるという問題がある。 In a conventional three-dimensional measurement method using stereo vision, position and orientation measurement using a feature pattern has been performed as calibration in order to obtain a relationship between cameras. The posture value between the cameras greatly affects the three-dimensional measurement result of the measurement object. In particular, there is a problem that the posture error when the feature pattern is observed from the front of the camera with a camera becomes large, resulting in a large error in the measurement result.
また、カメラを複数台設置する場合、計測環境を作るごとに、各カメラ間の位置姿勢関係を特徴パターンから計算する。このような事前の準備に手間が発生するという問題がある。 When a plurality of cameras are installed, the position and orientation relationship between the cameras is calculated from the feature pattern every time a measurement environment is created. There is a problem that such preparation is troublesome.
従来の鏡を用いた物体3次元計測手法は、まず、鏡に特徴パターンを取り付け、カメラから鏡平面の特徴パターンを観測することにより鏡の平面位置を求める。この時、計測物体を鏡越しにカメラで撮影しながら、鏡の向きを変える。そして複数の鏡平面の位置と、その鏡に映る計測物体の位置からステレオ視により計測物体の位置を求める。 In the conventional three-dimensional object measurement method using a mirror, first, a feature pattern is attached to the mirror, and the mirror plane position is obtained by observing the feature pattern on the mirror plane from the camera. At this time, the direction of the mirror is changed while photographing the measurement object with the camera through the mirror. Then, the position of the measurement object is obtained by stereo vision from the positions of the plurality of mirror planes and the position of the measurement object reflected on the mirror.
この時、一般的なステレオ視の手法と同じく、鏡に貼られた特徴パターンによる鏡平面の姿勢計測は計測物体の計測結果に大きく影響する。特に特徴パターンをカメラで正面付近から観測した時の姿勢誤差は大きくなり、計測結果に誤差を大きく生じさせるという問題がある。 At this time, as in the general stereo vision method, the posture measurement of the mirror plane by the feature pattern pasted on the mirror greatly affects the measurement result of the measurement object. In particular, there is a problem that the posture error when the feature pattern is observed from the front of the camera with a camera becomes large, resulting in a large error in the measurement result.
また、鏡には反射が起きる鏡面部分の上に、ガラスやアクリルの保護層が存在する。保護層に貼られた特徴パターン平面は、実際の鏡面部分から保護層の厚み分の距離だけ離れている。そのため、鏡の平面位置計測にその厚み分の誤差が生じるという問題がある。 Further, the mirror has a protective layer made of glass or acrylic on the mirror surface portion where reflection occurs. The feature pattern plane affixed to the protective layer is separated from the actual mirror surface portion by a distance corresponding to the thickness of the protective layer. Therefore, there is a problem that an error corresponding to the thickness occurs in the measurement of the planar position of the mirror.
本発明は、上記の事情に鑑みてなされたものであり、複数のカメラを用いることなく、物体の3次元位置を計測することを可能にし、従来のステレオ視の手法より計測精度を向上させ、計測環境の設置作業を簡易化することを可能にする装置及び方法並びにプログラムを提供することを目的とする。 The present invention has been made in view of the above circumstances, enables measurement of a three-dimensional position of an object without using a plurality of cameras, improves measurement accuracy over conventional stereo vision techniques, An object of the present invention is to provide an apparatus, a method, and a program that make it possible to simplify installation work of a measurement environment.
本発明の3次元計測装置は、入力画像から計測物体の位置を計測する装置であって、前記入力画像はカメラで鏡越しに撮像された画像であり、計測物体と、カメラからの位置姿勢関係が所定の関係である所定の特徴パターンが映っており、また、カメラと計測物体の相対位置関係を固定し、鏡とカメラの位置関係を可変可能として撮像された複数の画像が前記入力画像として入力され、前記入力画像中に映る特徴パターンの位置とカメラの焦点距離に基づいて計算された鏡空間中の特徴パターンの中心位置と、カメラから既知である実空間の特徴パターンの中心位置について、鏡映変換によって、実空間の特徴パターンと鏡空間の特徴パターンの中心点を結ぶ線分の中点を鏡平面座標の原点とし、前記線分と平行なベクトルを鏡平面座標の一つの座標軸とし、前記鏡平面座標原点を通り前記座標軸に垂直な平面を鏡平面として計算し、前記座標軸と前記鏡平面に任意に設定した2つの座標軸によって表される鏡平面座標を計算する鏡平面座標計算手段と、前記鏡平面を中心にカメラ座標を鏡映変換した鏡空間のカメラ座標系を計算する仮想カメラ座標計算手段と、入力画像中の計測物体の位置を用いてカメラ座標から計測物体の方向を示す光線を計算する光線計算手段と、前記仮想カメラ座標原点を始点とし、前記鏡平面を中心に前記光線を鏡映変換したベクトルを仮想光線として計算する仮想光線計算手段を備え、複数の入力画像各々に基づいて計算された複数の仮想光線の交点を計測物体の位置として計算する仮想光線交点計算手段と、を設けたことを特徴とする。 The three-dimensional measuring device of the present invention is a device that measures the position of a measurement object from an input image, and the input image is an image captured by a camera through a mirror, and the position and orientation relationship from the measurement object to the camera A plurality of images captured with a predetermined feature pattern having a predetermined relationship, a fixed relative positional relationship between the camera and the measurement object, and a variable positional relationship between the mirror and the camera as the input image. The center position of the feature pattern in the mirror space calculated based on the position of the feature pattern input and reflected in the input image and the focal length of the camera, and the center position of the feature pattern in the real space known from the camera. By mirror transformation, the midpoint of the line segment connecting the center point of the real space feature pattern and the mirror space feature pattern is the origin of the mirror plane coordinates, and a vector parallel to the line segment is one of the mirror plane coordinates. A mirror plane that calculates a plane that passes through the mirror plane coordinate origin and is perpendicular to the coordinate axis as a mirror plane, and calculates a mirror plane coordinate represented by two coordinate axes arbitrarily set on the coordinate axis and the mirror plane A coordinate calculation means, a virtual camera coordinate calculation means for calculating a camera coordinate system in a mirror space obtained by mirror-transforming the camera coordinates around the mirror plane, and a measurement object from the camera coordinates using the position of the measurement object in the input image A light ray calculating means for calculating a light ray indicating the direction of the light source, and a virtual light ray calculating means for calculating, as a virtual light ray, a vector obtained by mirror-transforming the light ray with the virtual camera coordinate origin as a starting point and the mirror plane as a center. Virtual ray intersection calculation means for calculating an intersection of a plurality of virtual rays calculated based on each of the input images as a position of the measurement object.
本発明の3次元計測方法は、入力画像から計測物体の位置を計測する方法であって、前記入力画像はカメラで鏡越しに撮像された画像であり、計測物体と、カメラからの位置姿勢関係が所定の関係である所定の特徴パターンが映っており、また、カメラと計測物体の相対位置関係を固定し、鏡とカメラの位置関係を可変可能として撮像された複数の画像が前記入力画像として入力され、前記入力画像中に映る特徴パターンの位置とカメラの焦点距離に基づいて計算された鏡空間中の特徴パターンの中心位置と、カメラから既知である実空間の特徴パターンの中心位置について、鏡映変換によって、実空間の特徴パターンと鏡空間の特徴パターンの中心点を結ぶ線分の中点を鏡平面座標の原点とし、前記線分と平行なベクトルを鏡平面座標の一つの座標軸とし、前記鏡平面座標原点を通り前記座標軸に垂直な平面を鏡平面として計算し、前記座標軸と前記鏡平面に任意に設定した2つの座標軸によって表される鏡平面座標を計算するステップと、前記鏡平面を中心にカメラ座標を鏡映変換した鏡空間のカメラ座標系を計算するステップと、入力画像中の計測物体の位置を用いてカメラ座標から計測物体の方向を示す光線を計算するステップと、前記仮想カメラ座標原点を始点とし、前記鏡平面を中心に前記光線を鏡映変換したベクトルを仮想光線として計算するステップを備え、複数の入力画像各々に基づいて計算された複数の仮想光線の交点を計測物体の位置として計算するステップと、を含むことを特徴とする。 The three-dimensional measurement method of the present invention is a method of measuring the position of a measurement object from an input image, wherein the input image is an image captured through a mirror by a camera, and the position and orientation relationship from the camera A plurality of images captured with a predetermined feature pattern having a predetermined relationship, a fixed relative positional relationship between the camera and the measurement object, and a variable positional relationship between the mirror and the camera as the input image. The center position of the feature pattern in the mirror space calculated based on the position of the feature pattern input and reflected in the input image and the focal length of the camera, and the center position of the feature pattern in the real space known from the camera. By mirror transformation, the midpoint of the line segment connecting the center point of the real space feature pattern and the mirror space feature pattern is the origin of the mirror plane coordinates, and a vector parallel to the line segment is one of the mirror plane coordinates. A plane that passes through the mirror plane coordinate origin and is perpendicular to the coordinate axis as a mirror plane, and calculates a mirror plane coordinate represented by two coordinate axes arbitrarily set on the coordinate axis and the mirror plane; Calculating a camera coordinate system in a mirror space obtained by mirror-transforming camera coordinates around the mirror plane, and calculating a ray indicating the direction of the measurement object from the camera coordinates using the position of the measurement object in the input image. And a step of calculating, as a virtual ray, a vector obtained by mirror-transforming the ray with the virtual camera coordinate origin as a starting point, and a plurality of virtual images calculated based on each of a plurality of input images Calculating the intersection of the rays as the position of the measurement object.
本発明の3次元計測プログラムは、コンピュータに、入力画像から計測物体の位置を計測させるプログラムであって、前記入力画像はカメラで鏡越しに撮像された画像であり、計測物体と、カメラからの位置姿勢関係が所定の関係である所定の特徴パターンが映っており、また、カメラと計測物体の相対位置関係を固定し、鏡とカメラの位置関係を可変可能として撮像された複数の画像が前記入力画像として入力され、前記入力画像中に映る特徴パターンの位置とカメラの焦点距離に基づいて計算された鏡空間中の特徴パターンの中心位置と、カメラから既知である実空間の特徴パターンの中心位置について、鏡映変換によって、実空間の特徴パターンと鏡空間の特徴パターンの中心点を結ぶ線分の中点を鏡平面座標の原点とし、前記線分と平行なベクトルを鏡平面座標の一つの座標軸とし、前記鏡平面座標原点を通り前記座標軸に垂直な平面を鏡平面として計算し、前記座標軸と前記鏡平面に任意に設定した2つの座標軸によって表される鏡平面座標を計算するステップと、前記鏡平面を中心にカメラ座標を鏡映変換した鏡空間のカメラ座標系を計算するステップと、入力画像中の計測物体の位置を用いてカメラ座標から計測物体の方向を示す光線を計算するステップと、前記仮想カメラ座標原点を始点とし、前記鏡平面を中心に前記光線を鏡映変換したベクトルを仮想光線として計算するステップを備え、複数の入力画像各々に基づいて計算された複数の仮想光線の交点を計測物体の位置として計算するステップと、を前記コンピュータに実行させるものであることを特徴とする。 The three-dimensional measurement program of the present invention is a program that causes a computer to measure the position of a measurement object from an input image, and the input image is an image captured by a camera through a mirror. A predetermined feature pattern in which the position and orientation relationship is a predetermined relationship is shown, and a plurality of images captured with the relative positional relationship between the camera and the measurement object fixed and the positional relationship between the mirror and the camera being variable are described above. The center position of the feature pattern in the mirror space that is input as an input image and calculated based on the position of the feature pattern reflected in the input image and the focal length of the camera, and the center of the feature pattern in the real space that is known from the camera With respect to the position, by mirror conversion, the midpoint of the line segment connecting the center point of the real space feature pattern and the mirror space feature pattern is the origin of the mirror plane coordinates, and the line segment A line vector is defined as one coordinate axis of mirror plane coordinates, a plane passing through the mirror plane coordinate origin and perpendicular to the coordinate axis is calculated as a mirror plane, and is expressed by two coordinate axes arbitrarily set in the coordinate axis and the mirror plane. A step of calculating a mirror plane coordinate to be calculated, a step of calculating a camera coordinate system of a mirror space obtained by mirror-transforming the camera coordinate around the mirror plane, and a measurement from the camera coordinate using the position of the measurement object in the input image A step of calculating a ray indicating the direction of the object, and a step of calculating, as a virtual ray, a vector obtained by mirror-transforming the ray with the virtual camera coordinate origin as a starting point and the mirror plane as a center. Calculating the intersection of a plurality of virtual rays calculated based on the position of the measurement object, and causing the computer to execute the step. .
ここで、前記仮想光線の交点は、光線同士が交わらない場合、2光線の方向ベクトルからなる法線を計算し、前記法線と平行な2光線を結ぶ線分を計算し、前記線分の中点を交点としてもよい。
さらに、前記仮想光線が2本線以上ある場合は、各2光線の組み合わせの複数交点の重心位置を計測物体の位置として計算してもよい。
Here, the intersection of the virtual rays is calculated by calculating a normal line composed of direction vectors of two rays when the rays do not intersect with each other, calculating a line segment connecting two rays parallel to the normal line, and The midpoint may be the intersection.
Further, when there are two or more virtual rays, the positions of the centers of gravity of a plurality of intersections of combinations of the two rays may be calculated as the positions of the measurement objects.
本発明によれば、入力画像から計測物体の位置を計測する装置であって、入力画像はカメラで鏡越しに撮像された画像であり、計測物体と、カメラからの位置姿勢関係が所定の関係である所定の特徴パターンが映っており、入力画像中に映る特徴パターンの位置とカメラの焦点距離に基づいて計算された鏡空間中の特徴パターンの中心位置と、カメラから既知である実空間の特徴パターンの中心位置について、鏡映変換によって、実空間の特徴パターンと鏡空間の特徴パターンの中心点を結ぶ線分の中点を鏡平面座標の原点とし、線分と平行なベクトルを鏡平面座標の一つの座標軸とし、鏡平面座標原点を通り座標軸に垂直な平面を鏡平面として計算し、座標軸と鏡平面に任意に設定した2つの座標軸によって表される鏡平面座標を計算する鏡平面座標計算手段と、鏡平面を中心にカメラ座標を鏡映変換した鏡空間のカメラ座標系を計算する仮想カメラ座標計算手段と、入力画像中の計測物体の位置を用いてカメラ座標から計測物体の方向を示す光線を計算する光線計算手段と、仮想カメラ座標原点を始点とし、鏡平面を中心に光線を鏡映変換したベクトルを仮想光線として 計算する仮想光線計算手段を備え、複数の入力画像各々に基づいて計算された複数の仮想光線の交点を計測物体の位置として計算する仮想光線交点計算手段を備えることで、計測精度を向上させることが可能になる。 According to the present invention, an apparatus for measuring the position of a measurement object from an input image, the input image is an image captured by a camera through a mirror, and the position and orientation relationship from the camera is a predetermined relationship A predetermined feature pattern is shown, and the center position of the feature pattern in the mirror space calculated based on the position of the feature pattern shown in the input image and the focal length of the camera, and the real space known from the camera With respect to the center position of the feature pattern, by mirror conversion, the midpoint of the line connecting the feature pattern in the real space and the center point of the feature pattern in the mirror space is the origin of the mirror plane coordinates, and a vector parallel to the line segment is the mirror plane Calculate as a single coordinate axis of coordinates, a plane passing through the mirror plane coordinate origin and perpendicular to the coordinate axis as a mirror plane, and calculate a mirror plane coordinate represented by two coordinate axes arbitrarily set in the coordinate axis and the mirror plane A plane coordinate calculation means, a virtual camera coordinate calculation means for calculating a camera coordinate system in a mirror space obtained by mirror-transforming camera coordinates around a mirror plane, and a measurement object from the camera coordinates using the position of the measurement object in the input image A plurality of input images, comprising: a ray calculation means for calculating a ray indicating the direction of the light; and a virtual ray calculation means for calculating as a virtual ray a vector obtained by mirror-converting the ray centered on a mirror plane with a virtual camera coordinate origin as a starting point. By providing virtual ray intersection calculation means for calculating the intersection of a plurality of virtual rays calculated based on each as the position of the measurement object, it is possible to improve measurement accuracy.
また、カメラと計測物体の相対位置関係を変えず、鏡とカメラの位置関係を変え撮像された複数の画像が前記入力画像なので、複数のカメラを用いることなく、物体の3次元位置を計測することができ、且つ入力画像の撮像環境の設置作業を簡易化することができる。 In addition, since the input images are a plurality of images captured by changing the positional relationship between the mirror and the camera without changing the relative positional relationship between the camera and the measurement object, the three-dimensional position of the object is measured without using a plurality of cameras. In addition, it is possible to simplify the installation work of the input image capturing environment.
以下、図面に基づいて本発明の実施の形態に係る3次元計測装置について説明する。具体的には、3次元位置計 測の一例としてマーカー(測定物体)の位置を計測する場合について説明する。図1は、本発明の実施の形態を示す3次元計測装置の模式図であり、図2は本発明の実施の形態を示す3次元計測装置の構成を示すブロック図である。 Hereinafter, a three-dimensional measuring apparatus according to an embodiment of the present invention will be described with reference to the drawings. Specifically, a case where the position of a marker (measurement object) is measured as an example of three-dimensional position measurement will be described. FIG. 1 is a schematic diagram of a three-dimensional measuring apparatus showing an embodiment of the present invention, and FIG. 2 is a block diagram showing a configuration of the three-dimensional measuring apparatus showing an embodiment of the present invention.
図1に示すように本発明の実施の形態では、カメラ1と、特徴パターン2としてチェスボードパターンが3次元計測装置3に搭載されている。ここでカメラ1の座標系と特徴パターン2の座標系の位置姿勢関係は既知であるとする。また3次元計測装置3は、図2に示すようにカメラ1により撮像された画像を取得する画像入力部11、鏡平面座標計算部12、仮想カメラ座標計算部13、光線計算部14、仮想光線計算部15、仮想光線交点計算部16を備えている。画像入力部11を介してカメラ1から取得された画像は記憶部(図示せず)に一時的に記憶させることができる。また、前述の各計算部で行われる処理プログラムも記憶部に記憶されおり、演算部(図示せず)によりこのプログラムが実行される。 As shown in FIG. 1, in the embodiment of the present invention, a chess board pattern is mounted on a three-dimensional measuring device 3 as a camera 1 and a feature pattern 2. Here, it is assumed that the position and orientation relationship between the coordinate system of the camera 1 and the coordinate system of the feature pattern 2 is known. In addition, the three-dimensional measurement apparatus 3 includes an image input unit 11 that acquires an image captured by the camera 1, a mirror plane coordinate calculation unit 12, a virtual camera coordinate calculation unit 13, a light ray calculation unit 14, and a virtual ray as illustrated in FIG. 2. A calculation unit 15 and a virtual ray intersection calculation unit 16 are provided. An image acquired from the camera 1 via the image input unit 11 can be temporarily stored in a storage unit (not shown). Further, the processing program executed in each calculation unit described above is also stored in the storage unit, and this program is executed by a calculation unit (not shown).
本実施の形態では、A1、A2という2つの座標系があったとき、A1からA2に座標系を変換する同次変換行列を式1のように表す。
図3は鏡映変換を示すものであり、A1とA2を鏡映変換した座標系をA1’、A2’と表す。A1’とA2’は左手座標系で表されているが、式2に示すようにA1’からA2’への同次変換行列はA1からA2への同次変換行列と等しい。
次に、図4のフローチャートを用いて本実施の形態に係る3次元計測装置によるマーカー位置計測を行う処理手順について説明する。図5は、カメラ1で撮像された画像である。3次元計測装置3のカメラ1が鏡の前で、鏡面反射を用いて、特徴パターンと計測物体が映るように撮像したものである。カメラ1によって撮像された画像を読み込む(ステップS1)。 Next, a processing procedure for performing marker position measurement by the three-dimensional measurement apparatus according to the present embodiment will be described using the flowchart of FIG. FIG. 5 is an image captured by the camera 1. The camera 1 of the three-dimensional measuring apparatus 3 is captured in front of the mirror so that the feature pattern and the measurement object are reflected using specular reflection. An image captured by the camera 1 is read (step S1).
図6のように、本実施の形態ではカメラ座標系をC、特徴パターン座標系をBと定義し、CとBを鏡鏡変換したものをC’、B’と表す。また、カメラの外部パラメータから計算された特徴パターン座標系をDと表す。外部パラメータとは、実空間のカメラ座標から特徴パターン座標への姿勢関係と並進位置関係を表すパラメータである。 As shown in FIG. 6, in this embodiment, the camera coordinate system is defined as C, the feature pattern coordinate system is defined as B, and the mirror-transformed C and B are represented as C ′ and B ′. A feature pattern coordinate system calculated from external parameters of the camera is represented by D. The external parameter is a parameter representing the posture relationship and the translational position relationship from the camera coordinates in the real space to the feature pattern coordinates.
座標系Bは特徴パターンの中心位置であり、x、y座標軸は特徴パターン面上に沿った軸となっている。カメラ座標系と特徴パターン座標系の相対位置は固定されており、同次変換行列CTBは既知である。 The coordinate system B is the center position of the feature pattern, and the x and y coordinate axes are axes along the feature pattern surface. The relative positions of the camera coordinate system and the feature pattern coordinate system are fixed, and the homogeneous transformation matrix CTB is known.
入力画像中の特徴パターンの位置より、カメラ座標Cから鏡映の特徴パターンの座標系Dを計算し、CTDを求める。仮想特徴パターンの中心位置B’としてCTB’を計算する。 Based on the position of the feature pattern in the input image, a coordinate system D of the mirrored feature pattern is calculated from the camera coordinates C to obtain CTD. CTB 'is calculated as the center position B' of the virtual feature pattern.
ここで具体的に説明すると、チェスボードパターンの格子点の数と1辺の長さは予め記憶されており、カメラの内部パラメータと呼ばれる焦点距離や画素サイズ、レンズの歪みなどの情報も予め記憶されている。これらの情報と、実際に撮像された画像中の格子点の位置から座標位置関係(外部パラメータ)を求める。 More specifically, the number of grid points and the length of one side of the chessboard pattern are stored in advance, and information such as focal length, pixel size, and lens distortion, which is called an internal parameter of the camera, is also stored in advance. Has been. A coordinate position relationship (external parameter) is obtained from these pieces of information and the positions of lattice points in the actually captured image.
ここで例えば、座標位置関係を設定し、その時の座標位置関係だと、チェスボードパターンの格子点が画像中のどこに映るかを内部パラメータを使って再投影計算をする。画像中に投影された格子点の位置と、実際に撮像された格子点の位置関係を比較して外部パラメータを修正する。実際の画像中の格子点の位置と、パラメータで推定される格子点の位置が同じになるまで、外部パラメータの計算を繰り返す。そして、この反復計算によって座標位置関係を求める。
本実施の形態では、Zhangの手法を用いている。
(Zhang Z., “A flexible new technique for camera calibration”, Transactions on Pattern Analysis and Machine Intelligence, 22(11), pp. 1330-1334, 2000. 参照のこと)
Here, for example, a coordinate position relationship is set, and if it is the coordinate position relationship at that time, the reprojection calculation is performed using the internal parameters where the lattice points of the chessboard pattern appear in the image. The external parameter is corrected by comparing the position of the lattice point projected in the image with the positional relationship of the actually captured lattice point. The calculation of the external parameter is repeated until the position of the lattice point in the actual image is the same as the position of the lattice point estimated by the parameter. Then, the coordinate position relationship is obtained by this iterative calculation.
In the present embodiment, the Zhang method is used.
(See Zhang Z., “A flexible new technique for camera calibration”, Transactions on Pattern Analysis and Machine Intelligence, 22 (11), pp. 1330-1334, 2000.)
続いて、座標系B、B’の座標原点をb、b’とした場合、これらは式3のように表せる。Cbは座標系Cで表された座標原点であり、b’はbの鏡映点である。
b、b’鏡平面の位置関係について、鏡映変換の関係よりb、b’間の中点は鏡平面を通る。また、鏡平面の法線ベクトルと線分b’−bは平行である。この関係により鏡平面が計算される。
式4に示すように鏡平面座標系M の座標原点はb、b’間の中点より計算できる。
As shown in Equation 4, the coordinate origin of the mirror plane coordinate system M 1 can be calculated from the midpoint between b and b ′.
式5aに示すように鏡平面座標系のz軸は線分b’−bの平行線として計算できる。本実施の形態では、式5bに示すように鏡平面座標系のx軸はカメラ座標系Cのx軸を鏡平面に射影した線分と平行な線として計算する。式5cに示すように鏡平面座標系のy軸は鏡平面座標系のxとz軸の外積より計算する。この式5a〜cより鏡平面座標系は式5として表すことができる。 As shown in Equation 5a, the z-axis of the mirror plane coordinate system can be calculated as a parallel line of the line segment b'-b. In the present embodiment, the x-axis of the mirror plane coordinate system is calculated as a line parallel to the line segment obtained by projecting the x-axis of the camera coordinate system C onto the mirror plane, as shown in Expression 5b. As shown in Equation 5c, the y-axis of the mirror plane coordinate system is calculated from the outer product of the x and z axes of the mirror plane coordinate system. From these equations 5a-c, the mirror plane coordinate system can be expressed as equation 5.
図7のように、鏡平面座標系をMと定義し、特徴パターンの中心位置B’と実際のチェスボードの中心位置Bから鏡平面の位置姿勢Mを計算する(ステップS2)。
鏡平面座標系Mでカメラ座標系Cと仮想カメラ座標系C’の座標原点を表したとき、これらの座標原点はz軸の値が正負反転した関係になっているので、同次変換行列MTCとMTC’は式6のように示すことができる。
図8は光線rを示したものであり、予めわかっているマーカーの色情報を用いて、画像中からその色情報を有する画素を特定し、ラベリング処理により、その色情報を有する領域を特定し、その領域の重心点を入力画像中のマーカー位置として計算し、カメラの内部パラメータを用いて、カメラ座標系原点からマーカーを指す光線rを計算する。
図9のように、ステップS3の鏡平面を隔ててステップS4の光線と対称となる仮想光線r’を計算する。鏡映変換の関係から、鏡空間の仮想カメラ座標系から伸びる光線は実空間のマーカーを通る。そのため、仮想光線r’は光線rと一致する。また座標系Cと座標系C’は対称な関係であるため、C’r’=Crと表すことができ、式8のように表すことができる。
カメラ座標系Cで表した仮想光線r’は式7、8から式9として表すことができる(ステップS5)。
図10(a)、(b)に示すように、カメラ1と計測物体Pの相対位置関係を変えず、鏡とカメラ1の位置関係を変え撮像された画像から、ステップS5の仮想光線r’を計算する。
図11のようにステップ4で計算された複数の仮想光線r’の交点から計測物体Pの位置を計算する(ステップS6)。
As shown in FIGS. 10A and 10B, the virtual ray r ′ in step S5 is obtained from the captured image by changing the positional relationship between the mirror and the camera 1 without changing the relative positional relationship between the camera 1 and the measurement object P. Calculate
As shown in FIG. 11, the position of the measurement object P is calculated from the intersection of the plurality of virtual rays r ′ calculated in step 4 (step S6).
ステップS5の時、図12のように仮想光線同士が交わらない場合は、仮想光線同士の最短点を交点として計算する。図13のように仮想光線が2本線以上ある場合は、各2光線の組み合わせの複数交点の重心位置を計測物体の位置として計算する。
このようにして、ステップS2〜S5処理を、複数の入力画像で繰り返し行い、ステップS6で仮想光線の交点を計算し、マーカーの位置を計算する。
At the time of step S5, when the virtual rays do not intersect as shown in FIG. 12, the shortest point between the virtual rays is calculated as the intersection. When there are two or more virtual rays as shown in FIG. 13, the positions of the centers of gravity of the intersections of the combinations of the two rays are calculated as the positions of the measurement objects.
In this way, the processes in steps S2 to S5 are repeated for a plurality of input images, the intersection of virtual rays is calculated in step S6, and the marker position is calculated.
なお、本実施の形態では特徴パターン2としてチェスパターンを用いているが、ステップS3で鏡座標を求めるためには、ステップS2で特徴パターンの位置情報が得られれば良い。図14は既知サイズの円パターン20の中心位置とカメラ座標の関係が既知の3次元計測装置である。既知サイズの円パターンの中心位置を計測することにより、図15に示すように鏡座標を計算することができる。この円パターンを用いた特徴パターンとカメラの配置により、3次元計測装置を小型化することができる。これによりデジタルカメラ等に本3次元計測装置を搭載し、物体計測を行うことができる。 In this embodiment, a chess pattern is used as the feature pattern 2. However, in order to obtain mirror coordinates in step S3, it is only necessary to obtain the position information of the feature pattern in step S2. FIG. 14 shows a three-dimensional measuring apparatus in which the relationship between the center position of the circle pattern 20 of a known size and the camera coordinates is known. By measuring the center position of a circle pattern of a known size, mirror coordinates can be calculated as shown in FIG. The three-dimensional measuring apparatus can be reduced in size by the feature pattern using the circular pattern and the arrangement of the cameras. As a result, the three-dimensional measuring apparatus can be mounted on a digital camera or the like to perform object measurement.
また図16に示すように携帯電話の画面に特徴パターンを表示することで、携帯電話を3次元計測装置として使用することもできる。これにより3DプリンタやCGモデルの3Dデータを簡易に計測することができる。 Further, by displaying the feature pattern on the screen of the mobile phone as shown in FIG. 16, the mobile phone can be used as a three-dimensional measuring device. Thereby, 3D data of a 3D printer or a CG model can be easily measured.
更にカメラに取り付けられたカメラ視野外の物体とのキャリブレーション手法として、アーム、ヒューマノイドロボットの姿勢キャリブレーション(図17)や移動ロボットのセンサキャリブレーションに用いることができる。 Furthermore, as a calibration method for an object outside the camera field of view attached to the camera, it can be used for posture calibration (FIG. 17) of an arm or a humanoid robot or sensor calibration of a mobile robot.
以上のことから本実施の形態によれば、従来のステレオ視を用いた手法よりも精度の高い測定が可能となり、且つ計測環境の設置作業を簡易化して計測物体の3次元計測を行うことができる。 From the above, according to the present embodiment, it is possible to perform measurement with higher accuracy than the conventional method using stereo vision, and to simplify the installation work of the measurement environment and perform three-dimensional measurement of the measurement object. it can.
1 カメラ
2 特徴パターン(チェスボード)
3 3次元計測装置
11 画像取得部
12 鏡平面座標計算部
13 仮想カメラ座標計算部
14 光線計算部
15 仮想光線計算部
16 仮想光線交点計算部
20 円特徴パターン
1 Camera 2 Feature pattern (chess board)
3 Three-dimensional measuring device 11 Image acquisition unit 12 Mirror plane coordinate calculation unit 13 Virtual camera coordinate calculation unit 14 Ray calculation unit 15 Virtual ray calculation unit 16 Virtual ray intersection calculation unit 20 Circle feature pattern
Claims (9)
前記入力画像はカメラで鏡越しに撮像された画像であり、前記計測物体と、前記カメラからの位置姿勢関係が所定の関係である所定の特徴パターンが映っており、
前記カメラと前記計測物体の相対位置関係を固定し、鏡とカメラの位置関係を可変可能として撮像された複数の画像が前記入力画像として入力され、
前記入力画像中に映る特徴パターンの位置とカメラの焦点距離に基づいて算出された鏡空間中の特徴パターンの中心位置と、カメラから既知である実空間の特徴パターンの中心位置について、
鏡映変換によって、実空間の特徴パターンと鏡空間の特徴パターンの中心点を結ぶ線分の中点を鏡平面座標の原点とし、前記線分と平行なベクトルを鏡平面座標の一つの座標軸とし、前記鏡平面座標原点を通り前記座標軸に垂直な平面を鏡平面として計算し、前記座標軸と前記鏡平面に任意に設定した2つの座標軸によって表される鏡平面座標を算出する鏡平面座標計算手段と、
前記鏡平面を中心にカメラ座標を鏡映変換した鏡空間のカメラ座標系を算出する仮想カメラ座標計算手段と、
入力画像中の計測物体の位置を用いてカメラ座標から計測物体の方向を示す光線を算出する光線計算手段と、
前記仮想カメラ座標原点を始点とし、前記鏡平面を中心に前記光線を鏡映変換したベクトルを仮想光線として算出する仮想光線計算手段を備え、
複数の入力画像各々に基づいて算出された複数の仮想光線の交点を計測物体の位置として算出する仮想光線交点計算手段と
を備えたことを特徴とする3次元計測装置。 An apparatus for measuring the position of a measurement object from an input image,
The input image is an image captured by a camera through a mirror, and the measurement object and a predetermined feature pattern in which a position and orientation relationship from the camera is a predetermined relationship are reflected,
The relative positional relationship between the camera and the measurement object is fixed, and a plurality of images captured as variable positional relationship between the mirror and the camera are input as the input image,
About the center position of the feature pattern in the mirror space calculated based on the position of the feature pattern reflected in the input image and the focal length of the camera, and the center position of the feature pattern in the real space known from the camera,
By mirror conversion, the midpoint of the line segment connecting the center point of the real space feature pattern and the mirror space feature pattern is the origin of the mirror plane coordinates, and the vector parallel to the line segment is one coordinate axis of the mirror plane coordinates. Mirror plane coordinate calculating means for calculating a plane passing through the mirror plane coordinate origin and perpendicular to the coordinate axis as a mirror plane, and calculating a mirror plane coordinate represented by two coordinate axes arbitrarily set on the coordinate axis and the mirror plane When,
Virtual camera coordinate calculation means for calculating a camera coordinate system of a mirror space obtained by mirror-converting camera coordinates around the mirror plane;
Ray calculation means for calculating a ray indicating the direction of the measurement object from the camera coordinates using the position of the measurement object in the input image;
Virtual ray calculation means for calculating as a virtual ray a vector obtained by mirror-transforming the ray around the mirror plane with the virtual camera coordinate origin as a starting point;
A three-dimensional measurement apparatus comprising: a virtual ray intersection calculation unit that calculates an intersection of a plurality of virtual rays calculated based on each of a plurality of input images as a position of a measurement object.
前記入力画像はカメラで鏡越しに撮像された画像であり、前記計測物体と、前記カメラからの位置姿勢関係が所定の関係である所定の特徴パターンが映っており、
前記カメラと前記計測物体の相対位置関係を固定し、鏡とカメラの位置関係を可変可能として撮像された複数の画像が前記入力画像として入力され、
前記入力画像中に映る特徴パターンの位置とカメラの焦点距離に基づいて算出された鏡空間中の特徴パターンの中心位置と、カメラから既知である実空間の特徴パターンの中心位置について、
鏡映変換により、実空間の特徴パターンと鏡空間の特徴パターンの中心点を結ぶ線分の中点を鏡平面座標の原点とし、前記線分と平行なベクトルを鏡平面座標の一つの座標軸とし、前記鏡平面座標原点を通り前記座標軸に垂直な平面を鏡平面として算出し、前記座標軸と前記鏡平面に任意に設定した2つの座標軸によって表される鏡平面座標を算出するステップと、
前記鏡平面を中心にカメラ座標を鏡映変換した鏡空間のカメラ座標系を算出するステップと、
入力画像中の計測物体の位置を用いてカメラ座標から計測物体の方向を示す光線を算出するステップと、
前記仮想カメラ座標原点を始点とし、前記鏡平面を中心に前記光線を鏡映変換したベクトルを仮想光線として算出するステップを備え、
複数の入力画像各々に基づいて計算された複数の仮想光線の交点を計測物体の位置として算出するステップと、を含むことを特徴とする3次元計測方法。 A method for measuring the position of a measurement object from an input image,
The input image is an image captured by a camera through a mirror, and the measurement object and a predetermined feature pattern in which a position and orientation relationship from the camera is a predetermined relationship are reflected,
The relative positional relationship between the camera and the measurement object is fixed, and a plurality of images captured as variable positional relationship between the mirror and the camera are input as the input image,
About the center position of the feature pattern in the mirror space calculated based on the position of the feature pattern reflected in the input image and the focal length of the camera, and the center position of the feature pattern in the real space known from the camera,
By mirror conversion, the midpoint of the line segment connecting the center point of the real space feature pattern and the mirror space feature pattern is the origin of the mirror plane coordinates, and the vector parallel to the line segment is one coordinate axis of the mirror plane coordinates. Calculating a plane passing through the mirror plane coordinate origin and perpendicular to the coordinate axis as a mirror plane, and calculating a mirror plane coordinate represented by two coordinate axes arbitrarily set on the coordinate axis and the mirror plane;
Calculating a camera coordinate system of a mirror space obtained by mirror-transforming camera coordinates around the mirror plane;
Calculating a ray indicating the direction of the measurement object from the camera coordinates using the position of the measurement object in the input image;
The virtual camera coordinate origin as a starting point, comprising a step of calculating as a virtual ray a vector obtained by mirror-transforming the ray around the mirror plane,
Calculating a point of intersection of a plurality of virtual rays calculated based on each of a plurality of input images as a position of a measurement object.
前記入力画像はカメラで鏡越しに撮像された画像であり、計測物体と、カメラからの位置姿勢関係が所定の関係である所定の特徴パターンが映っており、
前記カメラと前記計測物体の相対位置関係を固定し、鏡とカメラの位置関係を可変可能として撮像された複数の画像が前記入力画像として入力され、
前記入力画像中に映る特徴パターンの位置とカメラの焦点距離に基づいて計算された鏡空間中の特徴パターンの中心位置と、カメラから既知である実空間の特徴パターンの中心位置について、
鏡映変換により、実空間の特徴パターンと鏡空間の特徴パターンの中心点を結ぶ線分の中点を鏡平面座標の原点とし、前記線分と平行なベクトルを鏡平面座標の一つの座標軸とし、前記鏡平面座標原点を通り前記座標軸に垂直な平面を鏡平面として算出し、前記座標軸と前記鏡平面に任意に設定した2つの座標軸により表される鏡平面座標を算出するステップと、
前記鏡平面を中心にカメラ座標を鏡映変換した鏡空間のカメラ座標系を算出するステップと、
入力画像中の計測物体の位置を用いてカメラ座標から計測物体の方向を示す光線を算出するステップと、
前記仮想カメラ座標原点を始点とし、前記鏡平面を中心に前記光線を鏡映変換したベクトルを仮想光線として算出するステップを備え、
複数の入力画像各々に基づいて算出された複数の仮想光線の交点を計測物体の位置として算出するステップと、
を前記コンピュータに実行させるものであることを特徴とする3次元計測プログラム。 A program for causing a computer to measure the position of a measurement object from an input image,
The input image is an image captured by a camera through a mirror, and a measurement object and a predetermined feature pattern in which a position and orientation relationship from the camera is a predetermined relationship are reflected,
The relative positional relationship between the camera and the measurement object is fixed, and a plurality of images captured as variable positional relationship between the mirror and the camera are input as the input image,
About the center position of the feature pattern in the mirror space calculated based on the position of the feature pattern reflected in the input image and the focal length of the camera, and the center position of the feature pattern in real space known from the camera,
By mirror conversion, the midpoint of the line segment connecting the center point of the real space feature pattern and the mirror space feature pattern is the origin of the mirror plane coordinates, and the vector parallel to the line segment is one coordinate axis of the mirror plane coordinates. Calculating a plane passing through the mirror plane coordinate origin and perpendicular to the coordinate axis as a mirror plane, and calculating a mirror plane coordinate represented by two coordinate axes arbitrarily set on the coordinate axis and the mirror plane;
Calculating a camera coordinate system of a mirror space obtained by mirror-transforming camera coordinates around the mirror plane;
Calculating a ray indicating the direction of the measurement object from the camera coordinates using the position of the measurement object in the input image;
The virtual camera coordinate origin as a starting point, comprising a step of calculating as a virtual ray a vector obtained by mirror-transforming the ray around the mirror plane,
Calculating the intersection of a plurality of virtual rays calculated based on each of the plurality of input images as the position of the measurement object;
A three-dimensional measurement program for causing the computer to execute.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013161278A JP2015031601A (en) | 2013-08-02 | 2013-08-02 | Three-dimensional measurement instrument, method, and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013161278A JP2015031601A (en) | 2013-08-02 | 2013-08-02 | Three-dimensional measurement instrument, method, and program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2015031601A true JP2015031601A (en) | 2015-02-16 |
Family
ID=52517031
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2013161278A Pending JP2015031601A (en) | 2013-08-02 | 2013-08-02 | Three-dimensional measurement instrument, method, and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2015031601A (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2016129154A1 (en) * | 2015-02-13 | 2016-08-18 | ソニー株式会社 | Information processing device, information processing method, and program |
CN106949836A (en) * | 2017-05-25 | 2017-07-14 | 中国科学技术大学 | A kind of stereoscopic vision camera homonymy target location caliberating device and method |
CN111649690A (en) * | 2019-12-12 | 2020-09-11 | 天目爱视(北京)科技有限公司 | Handheld 3D information acquisition equipment and method |
CN111912387A (en) * | 2020-06-17 | 2020-11-10 | 成都飞机工业(集团)有限责任公司 | Airplane whole-airplane horizontal measuring point centralized measuring point method based on optical reflection principle |
CN113739718A (en) * | 2021-08-26 | 2021-12-03 | 江南大学 | Object three-dimensional modeling method based on multi-circle fitting |
WO2022044294A1 (en) * | 2020-08-28 | 2022-03-03 | 株式会社デンソーテン | In-vehicle device and method for calibrating in-vehicle camera |
WO2022070407A1 (en) * | 2020-10-02 | 2022-04-07 | 日本電気株式会社 | Position estimation system, position estimation method, and computer program |
-
2013
- 2013-08-02 JP JP2013161278A patent/JP2015031601A/en active Pending
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2016129154A1 (en) * | 2015-02-13 | 2016-08-18 | ソニー株式会社 | Information processing device, information processing method, and program |
CN106949836A (en) * | 2017-05-25 | 2017-07-14 | 中国科学技术大学 | A kind of stereoscopic vision camera homonymy target location caliberating device and method |
CN106949836B (en) * | 2017-05-25 | 2024-02-23 | 中国科学技术大学 | Device and method for calibrating same-side target position of stereoscopic camera |
CN111649690A (en) * | 2019-12-12 | 2020-09-11 | 天目爱视(北京)科技有限公司 | Handheld 3D information acquisition equipment and method |
CN111912387A (en) * | 2020-06-17 | 2020-11-10 | 成都飞机工业(集团)有限责任公司 | Airplane whole-airplane horizontal measuring point centralized measuring point method based on optical reflection principle |
WO2022044294A1 (en) * | 2020-08-28 | 2022-03-03 | 株式会社デンソーテン | In-vehicle device and method for calibrating in-vehicle camera |
WO2022070407A1 (en) * | 2020-10-02 | 2022-04-07 | 日本電気株式会社 | Position estimation system, position estimation method, and computer program |
CN113739718A (en) * | 2021-08-26 | 2021-12-03 | 江南大学 | Object three-dimensional modeling method based on multi-circle fitting |
CN113739718B (en) * | 2021-08-26 | 2022-06-10 | 江南大学 | Object three-dimensional modeling method based on multi-circle fitting |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6967715B2 (en) | Camera calibration method, camera calibration program and camera calibration device | |
JP6821714B2 (en) | Improved camera calibration system, target, and process | |
JP6975929B2 (en) | Camera calibration method, camera calibration program and camera calibration device | |
JP6465789B2 (en) | Program, apparatus and method for calculating internal parameters of depth camera | |
JP2015031601A (en) | Three-dimensional measurement instrument, method, and program | |
JP5746477B2 (en) | Model generation device, three-dimensional measurement device, control method thereof, and program | |
JP6324025B2 (en) | Information processing apparatus and information processing method | |
JP6363863B2 (en) | Information processing apparatus and information processing method | |
JP5999615B2 (en) | Camera calibration information generating apparatus, camera calibration information generating method, and camera calibration information generating program | |
JP6079333B2 (en) | Calibration apparatus, method and program | |
TWI420066B (en) | Object measuring method and system | |
JP6594129B2 (en) | Information processing apparatus, information processing method, and program | |
JP6370038B2 (en) | Position and orientation measurement apparatus and method | |
JP6067175B2 (en) | Position measuring apparatus and position measuring method | |
JP2009042162A (en) | Calibration device and method therefor | |
TW201717613A (en) | An image calibrating, composing and depth rebuilding method of a panoramic fish-eye camera and a system thereof | |
JP2014013147A (en) | Three-dimensional measuring instrument and robot device | |
JP2014002033A (en) | Image process device and image process method | |
JPWO2013005244A1 (en) | Three-dimensional relative coordinate measuring apparatus and method | |
JP2019032218A (en) | Location information recording method and device | |
JP2018179577A (en) | Position measuring device | |
JP5487946B2 (en) | Camera image correction method, camera apparatus, and coordinate transformation parameter determination apparatus | |
CN113052974B (en) | Method and device for reconstructing three-dimensional surface of object | |
Ricolfe-Viala et al. | Optimal conditions for camera calibration using a planar template | |
JP2013015519A (en) | Three-dimensional relative coordinate measurement instrument and method thereof |