JP6645140B2 - Image calibration apparatus and calibration method - Google Patents
Image calibration apparatus and calibration method Download PDFInfo
- Publication number
- JP6645140B2 JP6645140B2 JP2015231259A JP2015231259A JP6645140B2 JP 6645140 B2 JP6645140 B2 JP 6645140B2 JP 2015231259 A JP2015231259 A JP 2015231259A JP 2015231259 A JP2015231259 A JP 2015231259A JP 6645140 B2 JP6645140 B2 JP 6645140B2
- Authority
- JP
- Japan
- Prior art keywords
- transparent plate
- image
- marker
- camera
- area
- 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
Links
- 238000000034 method Methods 0.000 title claims description 46
- 239000003550 marker Substances 0.000 claims description 189
- 238000005259 measurement Methods 0.000 claims description 48
- 238000004364 calculation method Methods 0.000 claims description 28
- 238000006243 chemical reaction Methods 0.000 claims description 11
- 238000003384 imaging method Methods 0.000 claims description 11
- 230000003287 optical effect Effects 0.000 description 34
- 239000013598 vector Substances 0.000 description 22
- 239000011159 matrix material Substances 0.000 description 11
- 238000000354 decomposition reaction Methods 0.000 description 6
- 230000000694 effects Effects 0.000 description 4
- 238000005457 optimization Methods 0.000 description 4
- 230000005540 biological transmission Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 238000003708 edge detection Methods 0.000 description 2
- 238000009434 installation Methods 0.000 description 2
- 238000013178 mathematical model Methods 0.000 description 2
- 238000003672 processing method Methods 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 238000000691 measurement method Methods 0.000 description 1
Images
Description
本発明は、表面と裏面が平らで平行な透明板を透過してカメラによる撮影を行う際に発生する写りの変化に対し、透明板がない場合の写りと同等になるよう校正を行う画像のキャリブレーション装置及びキャリブレーション方法に関する。 The present invention is directed to an image that is calibrated so as to be equivalent to an image without a transparent plate with respect to a change in image that occurs when an image is taken by a camera through a transparent plate whose front and back surfaces are flat and parallel. The present invention relates to a calibration device and a calibration method.
下記非特許文献1には、エリアカメラにより平面マーカを様々な位置姿勢で撮影することで撮影ごとの外部パラメータ及びカメラの内部パラメータを求める手法が提案されている。
また、下記特許文献1には、透明板の表面と奥面の反射を用いることで対象物の像が二重に移ることを利用したステレオ計測手法が開示されている。
Non-Patent Literature 1 below proposes a method of obtaining external parameters for each shooting and internal parameters of the camera by shooting a plane marker at various positions and orientations using an area camera.
Further,
ここで、図8に示すように、カメラ11による撮影を行う際に、カメラ11のレンズを保護するためにカメラ11をケース1に入れ、透明板2を透過して撮像を行うといった事例が存在する。この際、透明板2を透過して撮像を行うため、透明板2の影響でカメラ11に入射する光線が変化し、透明板2がない場合と比較して映像が変化してしまうという問題があった。
Here, as shown in FIG. 8, there is a case where the
しかしながら、非特許文献1に記載されている方法は、カメラのレンズキャリブレーション手法であり透明板の影響については議論されていない。
また、特許文献1に記載されている方法は、ステレオ計測を行うために透明板の屈折率や厚さといったパラメータを算出しているが、あくまでもステレオ計測を目的とし、透明板の二重反射を利用してパラメータを求めるものであり、透明板の透過による写りの変化を、透明板なしの場合と同等の写りにキャリブレーションするといった用途を想定していない。
However, the method described in
In addition, the method described in
このようなことから本発明は、透明板を透過してカメラによる撮像を行う場合であっても、透明板がない場合と同等の映像を取得することを可能とする画像のキャリブレーション装置及びキャリブレーション方法を提供することを目的とする。 Accordingly, the present invention provides an image calibration apparatus and a calibration method that can obtain an image equivalent to a case where there is no transparent plate, even when an image is captured by a camera through a transparent plate. The purpose is to provide a method of application.
上記の課題を解決するための第1の発明に係る画像のキャリブレーション装置は、
透明板を透過して撮影を行うカメラにより取得した画像の校正を行うキャリブレーション装置であって、
大きさが既知である白色領域及び黒色領域が交互に配されたマーカと、
前記カメラによって撮影した画像を解析する画像処理装置と
を備え、
前記画像処理装置は、
前記カメラにより前記透明板を介さずに撮影した前記マーカの画像及び前記カメラにより前記透明板を介して撮影した前記マーカの画像を入力する画像入力部と、
前記透明板を介さずに撮影した前記マーカの画像及び前記透明板を介して撮影した前記マーカの画像から、それぞれ前記マーカの白色領域と黒色領域の境界の画像上の座標を算出する計測座標算出部と、
前記透明板を介さずに撮影した前記マーカの画像から算出した前記白色領域と前記黒色領域の境界の画像上の座標、予め既知である内部パラメータ、及び予め既知である前記白色領域と前記黒色領域の境界の実座標に基づいて前記カメラと前記マーカとの位置姿勢関係を表す外部パラメータを算出する外部パラメータ算出部と、
前記透明板を介さずに撮影した前記マーカの画像から算出した前記白色領域と前記黒色領域の境界の画像上の座標を、前記外部パラメータを用いてカメラ座標系の座標に変換するカメラ座標系変換部と、
前記透明板を介して撮影した前記マーカの画像から算出した前記白色領域と前記黒色領域の境界の画像上の座標が、前記透明板を介さずに撮影した前記マーカの画像から算出した前記白色領域と前記黒色領域の境界の画像上の座標に近似するように、前記内部パラメータ及び前記透明板を介さずに撮影した前記マーカの画像から得られた前記マーカの白色領域と黒色領域の境界のカメラ座標系の座標を用いて前記透明板の前記カメラに対する角度、厚さ及び屈折率を透明板のパラメータとして算出する透明板パラメータ算出部と、
前記透明板を介して撮影した前記マーカの画像から算出した前記白色領域と前記黒色領域の境界の画像上の座標を、前記透明板のパラメータに基づいて前記透明板を介さずに撮影した状態と同等となるように校正するキャリブレーション処理部と
を備えることを特徴とする。
An image calibration device according to a first invention for solving the above-mentioned problems,
A calibration device for calibrating an image acquired by a camera that shoots through a transparent plate,
A marker in which white areas and black areas whose sizes are known are alternately arranged,
An image processing apparatus for analyzing an image captured by the camera,
The image processing device,
An image input unit for inputting the image of the marker photographed without the transparent plate by the camera and the image of the marker photographed through the transparent plate by the camera,
From the image of the marker taken without the transparent plate and the image of the marker taken through the transparent plate, measurement coordinate calculation for calculating the coordinates on the image of the boundary between the white region and the black region of the marker, respectively Department and
Coordinates on the image of the boundary between the white area and the black area calculated from the image of the marker taken without passing through the transparent plate, internal parameters that are known in advance, and the white area and the black area that are known in advance An external parameter calculation unit that calculates an external parameter representing a position and orientation relationship between the camera and the marker based on the actual coordinates of the boundary of
Camera coordinate system conversion for converting the coordinates on the image of the boundary between the white area and the black area calculated from the image of the marker taken without passing through the transparent plate into the coordinates of the camera coordinate system using the external parameters Department and
The coordinates on the image of the boundary between the white area and the black area calculated from the image of the marker taken through the transparent plate are the white areas calculated from the image of the marker taken without passing through the transparent plate. And a camera at the boundary between the white region and the black region of the marker obtained from the internal parameter and the image of the marker taken without passing through the transparent plate so as to approximate the coordinates on the image of the boundary of the black region. A transparent plate parameter calculation unit that calculates the angle of the transparent plate with respect to the camera, thickness and refractive index as parameters of the transparent plate using the coordinates of a coordinate system,
A state where the coordinates on the image of the boundary between the white area and the black area calculated from the image of the marker taken through the transparent plate are taken without passing through the transparent plate based on the parameters of the transparent plate. And a calibration processing unit that performs calibration so as to be equivalent.
また、上記の課題を解決するための第2の発明に係る画像のキャリブレーション装置は、
前記マーカが、前記白色領域と前記黒色領域とが一直線上に交互に配されてなる直線マーカであり、
前記カメラが、一ラインの撮影を行うラインセンサカメラであり、
前記白色領域と前記黒色領域の境界が、前記白色領域と前記黒色領域の切り替え地点である
ことを特徴とする。
An image calibration device according to a second aspect of the present invention for solving the above-described problems,
The marker is a linear marker in which the white area and the black area are alternately arranged on a straight line,
The camera is a line sensor camera that captures one line,
A boundary between the white area and the black area is a switching point between the white area and the black area.
また、上記の課題を解決するための第3の発明に係る画像のキャリブレーション装置は、
前記マーカが、前記白色領域と前記黒色領域とがチェスボード型に配されてなる平面マーカであり、
前記カメラが、二次元の撮影を行うエリアカメラであり、
前記白色領域と前記黒色領域の境界が、前記白色領域と前記白色領域との交点または前記黒色領域と前記黒色領域との交点である
ことを特徴とする。
An image calibration device according to a third aspect of the present invention for solving the above-mentioned problems is
The marker is a planar marker in which the white area and the black area are arranged in a chessboard shape,
The camera is an area camera that performs two-dimensional imaging,
A boundary between the white area and the black area is an intersection of the white area and the white area or an intersection of the black area and the black area.
また、上記の課題を解決するための第4の発明に係る画像のキャリブレーション方法は、
透明板を透過して撮影を行うカメラにより取得した画像の校正を行うキャリブレーション方法であって、
前記透明板を介さずに前記カメラにより前記マーカを撮影する第一の工程と、
前記マーカと前記カメラとの間に前記透明板を配置した状態で、前記透明板を介して前記撮像手段により前記マーカを撮影する第二の工程と、
前記透明板を介さずに撮影した前記マーカの画像及び前記透明板を介して撮影した前記マーカの画像から、それぞれ前記マーカの白色領域と黒色領域との境界の画像上の座標を算出する第三の工程と、
前記透明板を介さずに撮影した前記マーカの画像から算出した前記白色領域と前記黒色領域の境界の画像上の座標、予め既知である内部パラメータ、及び予め既知である前記白色領域と前記黒色領域の境界の実座標に基づいて前記カメラと前記マーカとの位置姿勢関係を表す外部パラメータを算出する第四の工程と、
前記透明板を介さずに撮影した前記マーカの画像から算出した前記白色領域と前記黒色領域の境界の画像上の座標を、前記外部パラメータを用いてカメラ座標系の座標に変換する第五の工程と、
前記透明板を介して撮影した前記マーカの画像から算出した前記白色領域と前記黒色領域の境界の画像上の座標が、前記透明板を介さずに撮影した前記マーカの画像から算出した前記白色領域と前記黒色領域の境界の画像上の座標に近似するように、前記内部パラメータ及び前記透明板を介さずに撮影した前記マーカの画像から得られた前記マーカの白色領域と黒色領域の境界のカメラ座標系の座標を用いて前記透明板の前記カメラに対する角度、厚さ及び屈折率を透明板のパラメータとして算出する第六の工程と、
前記透明板を介して撮影した前記マーカの画像から算出した前記白色領域と前記黒色領域の境界の画像上の座標を、前記透明板のパラメータに基づいて前記透明板を介さずに撮影した状態と同等となるように校正する第七の工程と
を備えることを特徴とする。
Further, an image calibration method according to a fourth invention for solving the above-mentioned problem,
A calibration method for calibrating an image acquired by a camera that shoots through a transparent plate,
A first step of photographing the marker by the camera without passing through the transparent plate,
In a state where the transparent plate is arranged between the marker and the camera, a second step of photographing the marker by the imaging unit through the transparent plate,
Third calculating the coordinates on the image of the boundary between the white region and the black region of the marker from the image of the marker taken without passing through the transparent plate and the image of the marker taken through the transparent plate, respectively; Process and
Coordinates on the image of the boundary between the white area and the black area calculated from the image of the marker taken without passing through the transparent plate, internal parameters that are known in advance, and the white area and the black area that are known in advance A fourth step of calculating external parameters representing the position and orientation relationship between the camera and the marker based on the actual coordinates of the boundary of,
A fifth step of converting the coordinates on the image of the boundary between the white area and the black area calculated from the image of the marker taken without passing through the transparent plate into coordinates in a camera coordinate system using the external parameters When,
The coordinates on the image of the boundary between the white area and the black area calculated from the image of the marker taken through the transparent plate are the white areas calculated from the image of the marker taken without passing through the transparent plate. And a camera at the boundary between the white region and the black region of the marker obtained from the internal parameter and the image of the marker taken without passing through the transparent plate so as to approximate the coordinates on the image of the boundary of the black region. A sixth step of calculating the angle, thickness, and refractive index of the transparent plate with respect to the camera using the coordinates of a coordinate system as parameters of the transparent plate,
A state where the coordinates on the image of the boundary between the white area and the black area calculated from the image of the marker taken through the transparent plate are taken without passing through the transparent plate based on the parameters of the transparent plate. And a seventh step of performing calibration so as to be equivalent.
また、上記の課題を解決するための第5の発明に係る画像のキャリブレーション方法は、
前記マーカが、前記白色領域と前記黒色領域とが一直線上に交互に配されてなる直線マーカであり、
前記カメラが、一ラインの撮影を行うラインセンサカメラであり、
前記白色領域と前記黒色領域の境界が、前記白色領域と前記黒色領域の切り替え地点である
ことを特徴とする。
Further, an image calibration method according to a fifth aspect of the present invention for solving the above-mentioned problems,
The marker is a linear marker in which the white area and the black area are alternately arranged on a straight line,
The camera is a line sensor camera that captures one line,
A boundary between the white area and the black area is a switching point between the white area and the black area.
また、上記の課題を解決するための第6の発明に係る画像のキャリブレーション方法は、
前記マーカが、前記白色領域と前記黒色領域とがチェスボード型に配されてなる平面マーカであり、
前記カメラが、二次元の撮影を行うエリアカメラであり、
前記白色領域と前記黒色領域の境界が、前記白色領域と前記白色領域との交点または前記黒色領域と前記黒色領域との交点である
ことを特徴とする。
An image calibration method according to a sixth aspect of the present invention for solving the above-mentioned problems,
The marker is a planar marker in which the white area and the black area are arranged in a chessboard shape,
The camera is an area camera that performs two-dimensional imaging,
A boundary between the white area and the black area is an intersection of the white area and the white area or an intersection of the black area and the black area.
本発明に係る画像のキャリブレーション装置及びキャリブレーション方法によれば、透明板を透過してカメラによる撮像を行う場合であっても、透明板がない場合と同等の映像を取得することができる。 ADVANTAGE OF THE INVENTION According to the image calibration apparatus and the calibration method which concern on this invention, even if it image | transmits a transparent plate and performs imaging with a camera, the image equivalent to the case where there is no transparent plate can be acquired.
以下、図面を参照しつつ本発明に係るキャリブレーション装置及びキャリブレーション方法について説明する。なお、本発明では、透明板による映像の変化を透明板パラメータである透明板の厚さ、屈折率及びカメラに対する角度を用いて校正することを透明板キャリブレーションと呼ぶものとする。 Hereinafter, a calibration device and a calibration method according to the present invention will be described with reference to the drawings. In the present invention, calibrating the change of the image due to the transparent plate using the transparent plate thickness, the refractive index, and the angle with respect to the camera, which are the transparent plate parameters, is referred to as transparent plate calibration.
図1から図4を用いて本発明の実施例1に係る画像のキャリブレーション装置及びキャリブレーション方法の詳細を説明する。
図1に示すように、本実施例に係る画像のキャリブレーション装置は、一台のラインセンサカメラ11Aと、直線マーカ12Aと、ラインセンサカメラ11Aにより取得した画像データを解析する画像処理装置13とを用いて、表面と裏面が平らで平行な透明板2の影響を透明板2のカメラ11に対する角度θg、厚さd、屈折率nを利用して求め、透明板2がない状態で撮影した場合と同等の画像を得るための装置である。なお本実施例に係る画像のキャリブレーション装置は、ラインセンサカメラ11Aと直線マーカ12Aの位置姿勢関係も同時に求めることが可能である。
The details of an image calibration apparatus and a calibration method according to the first embodiment of the present invention will be described with reference to FIGS.
As shown in FIG. 1, the image calibration device according to the present embodiment includes a single
直線マーカ12Aは、棒状に形成されている。この直線マーカ12Aの表面には、図2に示すように、長手方向の長さが既知である白帯(白色領域)12Aaと黒帯(黒色領域)12Abとが長手方向に沿って交互に配されている(以下、白帯12Aa及び黒帯12Abを総称する場合は白黒帯12Aa,12Abと称する)。図2に示す例では、白帯12Aa及び黒帯12Abは、それぞれ四つずつ設けられている。
The
ラインセンサカメラ11Aは、1ラインの撮像を行う機器である。ラインセンサカメラ11Aは、直線マーカ12Aの白帯12Aaと黒帯12Abの境界(以下、切り替え地点と称する)12Acを少なくとも三箇所以上撮影するように設置される。
The
画像処理装置13は、ラインセンサカメラ11Aによって撮像した画像を解析して透明板キャリブレーションを実行するものである。
The
図3に示すように、画像処理装置13は、画像入力部13a、計測座標算出部13b、外部パラメータ算出部13c、カメラ座標系変換部13d、透明板パラメータ算出部13e、キャリブレーション処理部13f、及び記憶部13gを備えている。
As shown in FIG. 3, the
画像入力部13aは、ラインセンサカメラ11Aで取得した画像データ(透明板2ありの場合、及び、透明板2なしの場合)を入力し、記憶部13gに保管する。
計測座標算出部13bは、記憶部13gから読み出した画像データから直線マーカ12Aの白黒帯12Aa,12Abを検出し、切り替え地点12Acの画像上の座標(ピクセル位置)を算出し、計測座標データとして記憶部13gに保管する。
The
The measurement coordinate
外部パラメータ算出部13cは、記憶部13gから読み出した透明板2なしの場合の計測座標データと、予め記憶部13gに保管した既知であるラインセンサカメラ11Aの内部パラメータ、直線マーカ12Aの切り替え地点12Acのマーカ座標系(マーカ長手方向にX軸、それに垂直な方向にY軸をとる座標系。座標原点はマーカ上の任意の点(例えばマーカの中央など))の座標であるマーカ座標系座標データ(真値座標(Xi,0))に基づいて、ラインセンサカメラ11Aと直線マーカ12Aとの位置姿勢関係を表す外部パラメータを求め、これを記憶部13gに保管する。
The external
カメラ座標系変換部13dは、記憶部13gから読み出した透明板2なしの場合の計測座標データ及び外部パラメータに基づいて、直線マーカ12Aの切り替え地点12Acのカメラ座標系(画像素子面と平行な方向にX軸、カメラ光軸方向にY軸をとる座標系。座標原点はカメラのピンホールモデルの原点(光線の集まる点)と同一の位置)の座標を算出し、カメラ座標系座標データとして記憶部13gに保管する。
Based on the measured coordinate data without the
透明板パラメータ算出部13eは、記憶部13gから読み出した透明板2あり及び透明板2なしの場合の計測座標データ、ラインセンサカメラ11Aの内部パラメータ、及びカメラ座標系座標データに基づいて、透明板パラメータを算出し、これを記憶部13gに保管する。
The transparent plate
キャリブレーション処理部13fは、ラインセンサカメラ11Aを用いた計測を行う際に、記憶部13gから読み出した透明板2ありの場合の計測座標データ、予め求めた計測対象の高さ(ラインセンサカメラ11Aから直線マーカ12AまでのY1軸方向の距離)、透明板パラメータに基づいて、計測対象の校正済み計測座標を算出し、校正済み計測座標データとして記憶部13gに保管する。
When performing the measurement using the
記憶部13gは、画像データ、各撮影での直線マーカ12Aの白黒帯12Aa,12Abの計測座標データ、ラインセンサカメラ11Aの内部パラメータ、ラインセンサカメラ11Aと直線マーカ12Aとの位置姿勢関係を表す外部パラメータ、直線マーカ12Aの白黒帯12Aa,12Abのマーカ座標系座標、直線マーカ12Aの白黒帯12Aa,12Abのカメラ座標系座標、透明板パラメータ、計測対象の高さ、計測対象のキャリブレーション後の校正済み計測座標データ等を保管する。
The
なお、構成済み計測座標データは図示しない表示部等に出力され、表示部では校正された画像が表示される。 The configured measurement coordinate data is output to a display unit (not shown) or the like, and the display unit displays a calibrated image.
以下、図4を用いて本実施例に係る画像のキャリブレーション装置によるキャリブレーション処理の流れを説明する。 Hereinafter, the flow of the calibration process performed by the image calibration apparatus according to the present embodiment will be described with reference to FIG.
透明板キャリブレーションを行うためには、透明板2の厚さd[mm]、屈折率n、ラインセンサカメラ11Aに対する角度θg[rad]といったパラメータを求める必要がある。
そのためにまず、図4に示すように、透明板2なしで長手方向の白黒帯12Aa,12Abの長さが既知である直線マーカ12Aをラインセンサカメラ11Aにより撮影する(ステップS1)。
なお、直線マーカ12Aはラインセンサカメラ11Aからみてほぼ正対するように設置する。また、ラインセンサカメラ11Aのレンズキャリブレーションはすでに行われており、焦点距離f、主点座標c、歪み係数といったカメラの内部パラメータは既知であり、歪みを除去した画像が得られていると仮定する。ラインセンサカメラ11Aによって撮影した画像は、画像入力部13aにより記憶部13gに保管される。
In order to perform the transparent plate calibration, it is necessary to obtain parameters such as the thickness d [mm] of the
For this purpose, as shown in FIG. 4, first, a
Note that the
続いて、直線マーカ12A及びラインセンサカメラ11Aの位置を動かさずに、直線マーカ12Aとラインセンサカメラ11Aとの間に透明板2を設置して透明板2ありの状態で直線マーカ12Aをラインセンサカメラ11Aにより撮影する(ステップS2)。ラインセンサカメラ11Aによって撮影した画像は、画像入力部13aにより記憶部13gに保管される。
Subsequently, the
本実施例では、このようにして撮影した透明板2がない場合と透明板2がある場合の画像の写りの違いを利用して透明板2のパラメータを算出する。
In the present embodiment, the parameters of the
ステップS2に続いては、計測座標算出部13bにより、記憶部13gから読み出した画像データを用いて、透明板2なしで撮影した画像及び透明板2ありで撮影した画像から、それぞれ直線マーカ12Aの切り替え地点12Acのピクセル位置(計測座標)を検出する(ステップS3)。直線マーカ12Aの切り替え地点12Acのピクセル位置については、二値化処理やエッジ検出といった画像処理手法により検出する。
Subsequent to step S2, the measurement coordinate
続いて、外部パラメータ算出部13cにより、記憶部13gから読み出した、透明板2なしの画像から得た計測座標データ、ラインセンサカメラ11Aの内部パラメータ及びマーカ座標系座標データを用いて、ラインセンサカメラ11Aと直線マーカ12Aとの位置姿勢関係を表す外部パラメータとして後で説明する角度Θ、ベクトルt11,t12を求め(ステップS4)、カメラ座標系変換部13dにより、記憶部13gから読み出した透明板2なしの場合の計測座標データ及び外部パラメータから、カメラ座標系における直線マーカ12Aの切り替え地点12Acの座標(X1',Y1')を算出する(ステップS5)。
Subsequently, the external
カメラモデルにはピンホールモデルを用いる。ただし、ここではラインセンサカメラ11Aを使うため、通常のエリアカメラとは違い、三次元空間→二次元画像ではなく、二次元平面→一次元画像となる。この数式モデルを式(1)に示す。
A pinhole model is used as the camera model. However, here, since the
ラインセンサカメラ11Aは1ラインしか撮影されないが、この撮影範囲は三次元空間上では二次元平面となる。この二次元空間上のマーカ座標系のある座標をX1,Y1で、カメラ座標系の光軸方向の軸とその軸に直交する軸に平行な画像座標系(画像の左端を0原点とする画像素子面と平行な座標系であり、ラインセンサカメラ11Aにおける光線が、カメラ座標系原点より光軸方向に焦点距離f[pixel]離れた位置にある画像平面に投影されたピクセル座標を表す)のあるピクセル座標をu1で表現している。マーカ座標系とカメラ座標系間の回転行列をR(回転軸は1軸でその角度はΘ)、並進ベクトルをt1(二次元ベクトルでその要素はt11、t12)とする。
Although the
また、s1はスケーリング係数、u1は画像座標系における位置(ピクセル座標、単位はpixel)、fは焦点距離(単位はpixel)、cは主点座標(単位はpixel)、X1,Y1はマーカ座標系における直線マーカ12Aの切り替え地点12Acのマーカ座標系における位置(単位はとくに決まっていないがmmとするのが一般的である)である。なお、この式(1)はラインセンサカメラ11Aのレンズの歪みはすでに校正済みとする。また、外部パラメータの単位は回転量がラジアン、並進移動量が特に決まっていないがmmとするのが一般的である。
Further, s 1 is a scaling coefficient, u 1 is a position (pixel coordinate, unit is pixel) in the image coordinate system, f is focal length (unit is pixel), c is principal point coordinate (unit is pixel), X 1 , Y Reference numeral 1 denotes the position of the switching point 12Ac of the
そして、透明板2なしの画像から特異値分解を用いてラインセンサカメラ11Aと直線マーカ12Aとの位置姿勢関係を表す外部パラメータとして角度Θ、ベクトルt11,t12を求める。
Then, the angle Θ and the vectors t 11 and t 12 are obtained from the image without the
以下に、外部パラメータである角度Θ、ベクトルt11、t12を求める方法について詳しく説明する。まず、ラインセンサカメラ11Aにより直線マーカ12Aを撮影しているため、直線マーカ12AのY座標は全て0になる。そこで以下の式(2)が得られる。
Hereinafter, a method of obtaining the external parameters of the angle Θ and the vectors t 11 and t 12 will be described in detail. First, since the
この式を展開すると、以下の式(3)となる。 When this equation is expanded, the following equation (3) is obtained.
これを展開、整理すると、以下の式(4)となる。 When this is developed and arranged, the following equation (4) is obtained.
ここで、式(4)はスケールが次数を一つ減らせる性質を利用し、三本以上の同時方程式を立てることで解くことができる。本実施例では、ラインセンサカメラ11Aにより直線マーカ12Aの切り替え地点12Acを三箇所以上撮影するようにしたため、当該切り替え地点12Acの座標は三点以上(X11,X12,…,X1M,u11,u12,…,u1M)(Mは3以上の整数)あるが、この場合、以下の式(5)に示すように方程式と未知数の数が一致しない。
Here, equation (4) can be solved by establishing three or more simultaneous equations using the property that the scale can reduce the order by one. In this embodiment, since the switching point 12Ac
そこで最小二乗法を行う。この形から外部パラメータである角度Θ、ベクトルt11、t12を求める場合、例えば非特許文献1に記載されている特異値分解等を用いて算出することができる。
なお、実際の外部パラメータとするためには、スケール不定及び光軸の向きを固定するためベクトルt12で正規化を行い、回転行列の性質よりsin2Θ+cos2Θ=1を使用して、角度Θ及びベクトルt11、t12を求める。このように画像上の位置u1、真値座標(マーカ12Aの白黒帯12Aa,12Abの幅)、焦点距離f、主点座標cが分かっていれば線形解法で解を求めることができる。
Therefore, the least squares method is performed. When the external parameters, ie, the angle Θ and the vectors t 11 and t 12 are obtained from this form, they can be calculated using, for example, singular value decomposition or the like described in
In order to the actual external parameters, normalizes the vector t 12 for fixing the scale indefinite and orientation of the optical axis, using the sin 2 Θ + cos 2 Θ = 1 from the nature of the rotation matrix, the angle Θ and vectors t 11 and t 12 are obtained. As described above, if the position u 1 on the image, the true value coordinates (widths of the black and white bands 12Aa and 12Ab of the
次に、透明板2なしの場合の計測座標データから特異値分解を用いてカメラ座標系における直線マーカ12Aの切り替え地点12Acの座標(X1',Y1')を求める。座標(X1',Y1')は以下の式(6)で算出することができる。
Next, the coordinates (X 1 ′, Y 1 ′) of the switching point 12Ac of the
次に、透明板パラメータ算出部13eにより、記憶部13gから透明板2ありの場合の計測座標データ、透明板2なしの場合の計測座標データ、ラインセンサカメラ11Aの内部パラメータ、及びカメラ座標系座標データを読み出し、この直線マーカ12Aの切り替え地点12Acのカメラ座標系の座標と、透明板2ありの画像から求めた計測座標データを用いて透明板2のパラメータ(厚さd、屈折率n、カメラ光軸に対する角度θg)を算出する(ステップS6)。具体的には、透明板2ありの画像から求めた計測座標データを用いて、直線マーカ12Aの切り替え地点12Acのピクセル位置と透明板2なしの画像から求めた直線マーカ12Aの切り替え地点12Acのピクセル位置との差が小さくなるように、レーベンバーグマーカート法などの最適化手法を用いて透明板2のパラメータを求める。
Next, the transparent plate
図1に示すように、透明板2の有無によるある直線マーカ12Aの切り替え地点12Acからの光線の違いにより、透明板2がない場合は画像としてu1の位置に写るケースであっても、透明板2がある場合は光の屈折があるため画像ではu1'という異なる位置に写ることが分かる。透明板キャリブレーションとはu1'の座標が得られたときに本来写るであろうu1に座標を変換する処理である。
以下では、この変換のためのパラメータとして透明板2の厚さd、透明板2の屈折率n、透明板2のカメラ光軸に対する角度θgを算出する。
まず、透明板2の表面と裏面が平行であると仮定する。すると、スネルの法則より透明板2の表面への入射光と透明板2の裏面から出る出射光は平行になる。この性質を利用すると光線の変化は以下の式(7)〜(9)で表せる。
As shown in FIG. 1, the light difference in from the switching point 12Ac of a
Hereinafter, the thickness d of the
First, it is assumed that the front surface and the back surface of the
ここで、e1:透明板2を透過することによる出射光と光学軸とのズレ[mm]、(X1',Y1'):透明板2なしの場合のマーカのある1地点のカメラ座標系における座標[mm]、(X1'',Y1''):ピクセル位置u1'への光線とマーカのある1地点から伸ばした画像平面と平行な軸との交点の座標[mm]、c:主点座標[pixel]、f:焦点距離[pixel]、u1:透明板2なしの場合のマーカのある1地点のピクセル位置[pixel]、u1':透明板2ありの場合のマーカのある1地点のピクセル位置[pixel]、θ1:透明板2に垂直な軸と透明板2の出射光のなす角度[rad]、θ01:透明板2なしの場合のマーカのある1地点からカメラへの光線とカメラ光軸との角度(u1'からの光線とカメラ光軸との角度)[rad]、θ1':透明板2に垂直な軸と透明板内の光線とのなす角度[rad]である。
Here, e 1 : deviation [mm] between the emitted light and the optical axis due to transmission through the
ここで、(X1',Y1')、(X1'',Y1'')はどちらもカメラ座標系のため、Y1''=Y1'、u1':f=X1'':Y1''より、X1''は以下の式(10)で表される。 Here, (X 1 ′, Y 1 ′) and (X 1 ″, Y 1 ″) are both camera coordinate systems, so that Y 1 ″ = Y 1 ′ and u 1 ′: f = X 1 From '': Y 1 '', X 1 '' is represented by the following equation (10).
これにより、式(9)において未算出の変数は出射光と光学軸とのズレe1だけとなった。ズレe1の算出を図1及び図5を用いて説明する。まず、透明板2に垂直な軸と透明板2の出射光とがなす角度θ1[rad]、u1'からの光線とカメラ光軸との角度θ01[rad]、透明板2に垂直な軸と透明板2内の光線とがなす角度θ1'[rad]については以下の式(11)〜(13)で算出できる。
Thus, variable uncalculated in formula (9) was the only deviation e 1 between the outgoing light and the optical axis. The calculation of the deviation e 1 is described with reference to FIGS. 1 and 5. First, the angle θ 1 [rad] between the axis perpendicular to the
次に、透明板2内の光線の長さ(以下、光路長)b1を以下の式(14)により求める。 Then, the length of the light of the transparent plate 2 (hereinafter, the optical path length) obtained by the following equation b 1 (14).
この光路長b1を用いて、当該光路長b1のY1軸方向の成分b1'を求めると、以下の式(15)のようになる。 With this optical path length b 1, when obtaining the components b 1 'of Y 1 axis direction of the optical path length b 1, as shown in the following equation (15).
光路長b及び当該光路長bの鉛直方向の成分b1'から図5に示す成分e1,e2(e1+e2=e1)を算出する。 Calculating the component e1, e2 (e1 + e2 = e 1) shown in FIG. 5 from the vertical direction component b 1 'of the optical path length b and the optical path length b.
よって、出射光と光学軸とのズレe1は以下の式(18)で表される。 Therefore, the deviation e 1 between the emitted light and the optical axis is expressed by the following equation (18).
ここで、透明板2の厚さd、透明板2のカメラ光軸に対する角度θg、透明板2の屈折率nがまだ未算出のパラメータとなる。そこで次の式(19)の二乗誤差を最小化するd,θg,nを求める。
Here, the thickness d of the
ここで、N1は直線マーカ12Aの切り替え地点12Acの数である。この数式は、透明板2ありの場合のピクセル位置u1'からの変換結果と透明板2無しの場合のピクセル位置u1との誤差を最小化するパラメータを算出するという意味になる。これにはレーベンバーグマーカート法などの最適化手法を用いる。
これで、透明板2のパラメータである厚さd、角度θg、屈折率nが算出される。
Here, N1 is the number of switching points 12Ac of the
Thus, the thickness d, the angle θ g , and the refractive index n, which are parameters of the
次に、キャリブレーション処理部13fにより、計測される透明板2ありの場合のピクセル位置u1'に対して以下の式(20)(式(9)に式(10)と式(18)を代入したもの)を用いることで、透明板2がない場合と同等のピクセル位置u1を算出する(ステップS7)。すなわち、求めた透明板パラメータを用いて透明板2ありで撮影した画像から求めた計測座標(ピクセル位置)を、透明板2なしで撮影した状態と同等にするようにキャリブレーションを行う。
Next, the following equation (20) (equation (10) and equation (18) are applied to the pixel position u 1 ′ with the
なお、キャリブレーションにY1'という計測対象の高さ(ラインセンサカメラ11Aから直線マーカ12AまでのY1軸方向の距離)が必要になる。これには撮像するワーキングディスタンスを固定することで解決するか、別の手段で対象物までの距離を計測する必要がある。例えば、ラインセンサカメラを二台用いて三角測量を行うことで距離Y1'を求めることが可能である。この場合ピクセル位置u1'を初期値として三角測量を行い、求めた座標から角度θ01及び距離Y1'を算出する。そして求めたピクセル位置u1を用いて再度角度θ01及び距離Y1'を算出することを繰り返すことで最適なu座標を算出できる。
The height of the measurement object that Y 1 'calibration (Distance Y 1 axially from the
このように構成される本実施例に係る画像のキャリブレーション装置及び方法によれば、以下の作用効果が得られる。すなわち、
1)透明板2のパラメータを画像データとマーカ座標系座標データの真値のみで算出することが可能である。
2)透明板2や直線マーカ12Aの設置位置の制約が少ないキャリブレーション手法である。
3)透明板パラメータの算出と直線マーカ12Aのカメラ座標系座標の算出が可能である。
4)ラインセンサカメラ11Aでの透明板キャリブレーションが可能である。
According to the image calibration apparatus and method according to the present embodiment configured as described above, the following operational effects can be obtained. That is,
1) The parameters of the
2) This is a calibration method with less restrictions on the installation positions of the
3) It is possible to calculate the transparent plate parameters and the camera coordinate system coordinates of the
4) Transparent plate calibration with the
なお、本実施例では、直線マーカ12Aを、長手方向の長さが既知である白帯(白色領域)12Aaと黒帯(黒色領域)12Abとを長手方向に沿って交互に配したものとして説明したが、直線マーカ12Aの配色は上述した実施例に限定されるものではなく、淡色の領域と濃色の領域とを長手方向に沿って交互に配するなど、二つの領域の境界が明確に判断できる配色であればよい。
In the present embodiment, the
図3,4及び図6,7を用いて本発明の実施例2に係る画像のキャリブレーション装置及びキャリブレーション方法の詳細を説明する。 Second Embodiment An image calibration apparatus and a calibration method according to a second embodiment of the present invention will be described in detail with reference to FIGS.
図6に示すように、本実施例に係るキャリブレーション装置は、平面マーカ12Bと、一台のエリアカメラ11Bと、表面と裏面が平らで平行な透明板2とを用いて、透明板2の影響を透明板2のエリアカメラ11Bに対する角度θg、厚さd、屈折率nから求めるものである。なお本実施例に係る画像のキャリブレーション装置は、平面マーカ12Bとエリアカメラ11Bの位置姿勢関係も同時に求めることが可能である。
As shown in FIG. 6, the calibration device according to the present embodiment uses a
図7に示すように、平面マーカ12Bは、矩形状に形成された板体からなる。平面マーカ12Bには、大きさが既知である矩形状の白色領域12Baと黒色領域12Bbとがチェスボード型に配置されている。図7に示す例では、白色領域12Ba及び黒色領域12Bbは、それぞれ八つずつ設けられている。
As shown in FIG. 7, the
エリアカメラ11Bは、二次元画像の撮影が可能な機器である。エリアカメラ11Bは、平面マーカ12Bの白色領域12Baと黒色領域12Bbの境界(白色領域12Baと白色領域12Baとの交点、又は黒色領域12Bbと黒色領域12Bbとの交点。以下、単に交点という)12Bcを少なくとも八か所以上撮影するように設置される。
The
画像処理装置13の構成は実施例1で説明したものと概ね同様であり、図3に示すように、画像入力部13a、計測座標算出部13b、外部パラメータ算出部13c、カメラ座標系変換部13d、透明板パラメータ算出部13e、キャリブレーション処理部13f、及び記憶部13gを備えている。
The configuration of the
画像入力部13aは、エリアカメラ11Bで取得した画像データ(透明板2ありの場合、及び、透明板2なしの場合)を入力し、記憶部13gに保管する。
計測座標算出部13bは、記憶部13gから読み出した画像データから平面マーカ12Bの白色領域12Baと黒色領域12Bbとを検出し、平面マーカ12Bの交点12Bcの画像上の座標を求め、計測座標データとして記憶部13gに保管する。
The
The measurement coordinate
外部パラメータ算出部13cは、記憶部13gから読み出した透明板2なしの場合の計測座標データと、予め記憶部13gに保管した既知であるエリアカメラ11Bの内部パラメータ、平面マーカ12Bの交点12Bcのマーカ座標系の座標であるマーカ座標系座標データ(真値座標)に基づいて、エリアカメラ11Bと平面マーカ12Bの位置姿勢関係を表す外部パラメータを求め、これを記憶部13gに保管する。
The external
カメラ座標系変換部13dは、記憶部13gから読み出した透明板2なしの場合の計測座標データ及び外部パラメータに基づいて、平面マーカ12Bの交点12Bcのカメラ座標系の座標を算出し、これをカメラ座標系座標データとして記憶部13gに保管する。
The camera coordinate
透明板パラメータ算出部13eは、記憶部13gから読み出した透明板2あり及び透明板2なしの場合の計測座標データ、エリアカメラ11Bの内部パラメータ、及びカメラ座標系座標データに基づいて、透明板パラメータを算出し、これを記憶部13gに保管する。
The transparent plate
キャリブレーション処理部13fは、エリアカメラ11Bを用いた計測を行う際に、記憶部13gから読み出した透明板2ありの場合の計測座標データ、予め求めた計測対象の高さ(エリアカメラ11Bから平面マーカ12BまでのZ2軸方向の距離)、透明板パラメータに基づいて、計測対象の校正済み計測座標を算出し、校正済み計測座標データとして記憶部13gに保管する。
When performing the measurement using the
記憶部13gは、エリアカメラ撮像データ、各撮影での平面マーカ12Bの交点12Bcの計測座標データ、エリアカメラ11Bの内部パラメータ、エリアカメラ11Bと平面マーカ12Bとの位置姿勢関係を表す外部パラメータ、平面マーカ12Bの交点12Bcの座標であるマーカ座標系座標、平面マーカ12Bの交点12Bcの座標のカメラ座標系座標、透明板パラメータ、計測対象の高さ、計測対象のキャリブレーション後の校正済み座標計測座標データ等を保管する。
なお、構成済み計測座標データは図示しない表示部等に出力され、表示部では校正された画像が表示される。
The
The configured measurement coordinate data is output to a display unit (not shown) or the like, and the display unit displays a calibrated image.
以下、図4を用いて本実施例に係る画像のキャリブレーション装置によるキャリブレーション処理の流れを説明する。 Hereinafter, the flow of the calibration process performed by the image calibration apparatus according to the present embodiment will be described with reference to FIG.
透明板キャリブレーションを行うためには、透明板2の厚さd[mm]、屈折率n、角度θg[rad]といったパラメータを求める必要がある。そのために、まず透明板2なしで図7に示すような、白色領域12Baと黒色領域12Bbの交点12Bcの位置が既知である平面マーカ12Bを撮影する(ステップS1)。平面マーカ12Bはエリアカメラ11Bからみてほぼ正対するように設置する。
In order to perform transparent plate calibration, it is necessary to obtain parameters such as the thickness d [mm] of the
その後、平面マーカ12Bの位置とエリアカメラ11Bの位置を動かさずに平面マーカ12Bとエリアカメラ11Bとの間に透明板2を設置し、透明板2ありの状態で平面マーカ12Bを撮影する(ステップS2)。本実施例では、この際に得られる写りの違いを用いて透明板2のパラメータを算出する。ここでエリアカメラ11Bのレンズキャリブレーションはすでに行われており、焦点距離fu,fv、主点座標cu,cv、歪み係数といったエリアカメラ11Bの内部パラメータは既知であり、歪みを除去した画像が得られていると仮定する。
Thereafter, the
続いて、計測座標算出部13bにより、透明板2なしで撮影した画像から平面マーカ12Bの交点12Bcの画像上の座標を検出する(ステップS3)。平面マーカ12Bの交点12Bcのピクセル位置(計測座標)については二値化処理やエッジ検出といった画像処理手法により検出する。
Subsequently, the coordinates of the intersection 12Bc of the
続いて、外部パラメータ算出部13cにより、記憶部13gから読み出した透明板2なしの場合の計測座標データ、エリアカメラ11Bの内部パラメータ、及びマーカ座標系座標データを用いて、エリアカメラ11Bと平面マーカ11Bとの位置姿勢関係を表す外部パラメータとして回転行列R及び並進ベクトルt2を求め(ステップS4)、これらの値からカメラ座標系における平面マーカ12Bの交点12Bcの座標(X2',Y2',Z2')を算出する(ステップS5)。
Subsequently, the
カメラモデルにはピンホールモデルを用いる。この数式モデルを式(21)に示す。三次元空間上のマーカ座標系をX2,Y2,Z2軸で、カメラ座標系を光軸方向の軸に直交する二次元平面のu2,v2軸で表現している。マーカ座標系とカメラ座標系間の回転行列をR(r11〜r33)、並進ベクトルをt2(三次元ベクトルでその要素はt21,t22,t23)とする。 A pinhole model is used as the camera model. This mathematical model is shown in equation (21). The marker coordinate system in the three-dimensional space is represented by X 2 , Y 2 , and Z 2 axes, and the camera coordinate system is represented by u 2 and v 2 axes in a two-dimensional plane orthogonal to the axis in the optical axis direction. The rotation matrix between the marker coordinate system and the camera coordinate system R (r 11 ~r 33), a translation vector t 2 (that element in three-dimensional vector t 21, t 22, t 23 ) and.
透明板2なしの画像から求めた計測座標から特異値分解を用いてエリアカメラ11Bと平面マーカ12Bとの位置姿勢関係を表す外部パラメータとして回転行列R及び並進ベクトルt2を求める。
A rotation matrix R and a translation vector t 2 are obtained as external parameters representing the position and orientation relationship between the
また、s2はスケーリング係数、fu,fvはu2,v2それぞれの焦点距離、cu,cvはu2,v2それぞれの主点座標、u2,v2は画像座標系におけるピクセル位置、X2,Y2,Z2はマーカ座標系における平面マーカ12Bの交点12Bcのピクセル位置である。なお、この式(21)ではレンズの歪みはすでに校正済みとする。
Further, it s 2 is the scaling factor, f u, f v is u 2, v 2 represents a focal length thereof, c u, c v is u 2, v 2 each principal point coordinates, u 2, v 2 is the image coordinate system , X 2 , Y 2 , and Z 2 are the pixel positions of the intersection 12Bc of the
以下に、エリアカメラ11Bと平面マーカ12Bの位置姿勢関係を表す外部パラメータである回転行列R及び並進ベクトルt2を求める方法について述べる。まず、エリアカメラ11Bにより平面マーカ12Bを撮影しているため、平面マーカ12BのZ2座標は全て0になる。そこで以下の式(22)が得られる。
Hereinafter, we describe a method for determining the rotation matrix R and translation vector t 2 is the external parameter representing the position and orientation
この式を展開すると、以下の式(23),(24)となる。 When this equation is expanded, the following equations (23) and (24) are obtained.
これを展開、整理すると、以下の式(25)になる。 When this is expanded and arranged, the following equation (25) is obtained.
ここで、上記の式(25)は、スケールが次数を一つ減らせる性質を利用し、8本以上の同時方程式を立てることで解くことができる。実際には平面マーカ12Bの座標は8点以上((X21,Y21),(X22,Y22),…,(X2L,Y2L),(u21,v21),(u22,v22),…,(u2L,v2L))(Lは8以上の整数)あるが、この場合方程式と未知数の数が一致しない(式(26))。
Here, the above equation (25) can be solved by establishing eight or more simultaneous equations using the property that the scale can reduce the order by one. In fact the
そこで最小二乗法を行う。この形から外部パラメータである回転行列R及び並進ベクトルt2を求める場合、特異値分解を用いることが良く知られているため(非特許文献1)、ここでは特異値分解によって算出する。 Therefore, the least squares method is performed. It is well known that singular value decomposition is used to obtain a rotation matrix R and a translation vector t 2 which are external parameters from this form (Non-Patent Document 1).
実際の外部パラメータとするためには、スケール不定及び光軸の向きを固定するためベクトルt23で正規化を行い、回転行列の性質より回転行列Rが直交行列かつ行列式の値が1を使用して回転行列R及び並進ベクトルt2を求める。このように画像上の計測座標(ピクセル位置)、真値座標(平面マーカ12Bの白色領域12Baと黒色領域12Bbの大きさ)、焦点距離、主点座標が分かっていれば線形解法で解を求めることができる。
To the actual external parameters, normalizes the vector t 23 for fixing the scale indefinite and orientation of the optical axis, using the value of the rotation matrix R is orthogonal matrix and determinant than the nature of the
次に、透明板2なしの画像から求めた計測座標から、特異値分解を用いてカメラ座標系における平面マーカ12Bの交点12Bcの座標(X2',Y2',Z2')を求める。この座標(X2',Y2',Z2')は以下の式(27)で算出することができる。
Next, the coordinates (X 2 ′, Y 2 ′, Z 2 ′) of the intersection 12Bc of the
次に、透明板パラメータ算出部13eにより、この平面マーカ12Bの交点12Bcのカメラ座標系の座標と、透明板2を透過して撮像した画像を用いて透明板2のパラメータ(厚さd、屈折率n、カメラ光軸に対する角度θg)を算出する(ステップS6)。具体的には、透明板2ありの画像から取得した計測座標を用いて、平面マーカ12Bの交点12Bcのピクセル位置と透明板2なしの画像から取得した平面マーカ12Bの交点12Bcのピクセル位置との差が小さくなるように、レーベンバーグマーカート法などの最適化手法を用いて透明板2のパラメータを求める。
Next, the transparent plate
図6に、透明板2の有無によるある平面マーカ12Bの交点12Bcからの光線の違いを示すように、透明板2がない場合、画像として(u2,v2)の位置に写るケースであっても、透明板2がある場合は光の屈折があるため画像では(u2',v2')という異なる位置に写ることが分かる。透明板キャリブレーションとは(u2',v2')の座標が得られたときに本来写るであろう(u2,v2)に座標を変換する処理である。
FIG. 6 shows the difference in the light rays from the intersection 12Bc of a certain
以下では、この変換のためのパラメータとして透明板2の厚さd、透明板2の屈折率n、透明板2のカメラ光軸に対する角度θgを算出する。基本的な考え方は実施例1と同じになるが、ここでは対象となる画像が直線ではなく平面である。そこで、ある座標に対して放射状にある一面を区切ると、実施例1と同等の状態とみなせる。ここではこの傾向を利用して透明板2のパラメータを算出する。
Hereinafter, the thickness d of the
まず、透明板2の表面と裏面が平行であると仮定する。すると、スネルの法則より透明板2の表面への入射光と透明板2の裏面から出る出射光は平行になる。この性質を利用すると光線の変化は以下の式(28)〜(30)で表せる。
First, it is assumed that the front surface and the back surface of the
ここで、d:透明板2の厚さ[mm]、e2:透明板2を透過することによる出射光と光学軸とのズレ[mm]、n:透明板2の屈折率、(X2',Y2',Z2'):透明板2なしの場合の平面マーカ12Bのある1地点のカメラ座標系における座標[mm]、(X2'',Y2'',Z2''):ピクセル位置(u2',v2')への光線と平面マーカ12Bのある1地点から伸ばした画像平面と平行な軸との交点の座標[mm]、(cu,cv):主点座標[pixel]、(fu,fv):焦点距離[pixel]、(u2,v2):透明板2なしの場合の平面マーカ12Bのある1地点のピクセル位置[pixel]、(u2',v2'):透明板2ありの場合の平面マーカ12Bのある1地点のピクセル位置[pixel]、θ2:透明板2に垂直な軸と透明板2の出射光のなす角度[rad]、θ02:透明板2なしの場合の平面マーカ12Bのある1地点からエリアカメラ11Bへの光線とカメラ光軸との角度((u2',v2')からの光線とカメラ光軸とがなす角)[rad]、θg:カメラ光軸に対する透明板2に垂直な軸の角度[rad]、θ2':透明板2に垂直な軸と透明板内の光線とのなす角度[rad]である。
ここで、(X2',Y2',Z2')、(X2'',Y2'',Z2'')はどちらもカメラ座標系のため、Z2''=Z2'、u2':fu=X2'':Z2''、v2':fv=Y2'':Z2''より、以下の式(31)が成り立つ。
Here, d: thickness [mm] of the transparent plate 2, e 2 : deviation [mm] between the emitted light and the optical axis due to transmission through the transparent plate 2, n: refractive index of the transparent plate 2, (X 2 ', Y 2', Z 2 '): coordinates in 1 point the camera coordinate system with a flat marker 12B in the case of the transparent plate 2 without [mm], (X 2' ', Y 2'', Z 2'' ): Coordinates [mm] of the intersection of the ray to the pixel position (u 2 ′, v 2 ′) and the axis parallel to the image plane extended from one point of the plane marker 12B, ( cu , cv ): the main point coordinates [pixel], (f u, f v): focal length [pixel], (u 2, v 2): 1 point pixel location with the plane marker 12B in the case of the transparent plate 2 without [pixel], (U 2 ′, v 2 ′): Pixel position [pixel] at one point of the planar marker 12B when the transparent plate 2 is present, θ 2 : An axis perpendicular to the transparent plate 2 and light emitted from the transparent plate 2 Angle [rad], θ 02 : When there is no transparent plate 2 Angle between the light beam from one point of the combined planar marker 12B to the area camera 11B and the camera optical axis (the angle formed by the light beam from (u 2 ′, v 2 ′) and the camera optical axis) [rad], θ g : the angle [rad] of the axis perpendicular to the transparent plate 2 with respect to the camera optical axis, θ 2 ': the angle [rad] between the axis perpendicular to the transparent plate 2 and the light beam in the transparent plate.
Here, since (X 2 ′, Y 2 ′, Z 2 ′) and (X 2 ″, Y 2 ″, Z 2 ″) are both camera coordinate systems, Z 2 ″ = Z 2 ′ , U 2 ′: fu = X 2 ″: Z 2 ″ and v 2 ′: f v = Y 2 ″: Z 2 ″, the following equation (31) is established.
これにより、式(30)においてまだ未算出の変数は出射光と光学軸とのズレe2だけとなった。以下に、ズレe2を算出する手法について説明する。まず、透明板2に垂直な軸と透明板2の出射光のなす角θ2[rad]、(u2',v2')からの光線とカメラ光軸とがなす角θ02[rad]、透明板2に垂直な軸と透明板2内の光線とのなす角θ2'[rad]については以下の式(32)〜(34)で算出できる。
As a result, the only variable that has not been calculated in the equation (30) is the deviation e 2 between the emitted light and the optical axis. The following describes methods of calculating the deviation e 2. First, the angle θ 2 [rad] between the axis perpendicular to the
ここで、θ'gは光軸に対して透明板2の光軸中心から光線への直線がどの程度傾いているかを表す角度であり、θgから求めることができる。まず、光軸ベクトルを透明板2に射影したベクトルを求める。次にこのベクトルを透明板2の法線ベクトルに対して回転させ、(X2',Y2',Z2')を通る光線と交差するベクトルとする。最後にこのベクトルと光軸とのなす角がθ'gとなる。
これ以降については実施例1と同様になる。よって、出射光と光学軸とのズレe2は以下の式(35)で表される。
Here, θ ′ g is an angle indicating how much a straight line from the optical axis center of the
Subsequent steps are the same as in the first embodiment. Therefore, the deviation e 2 between the emitted light and the optical axis is expressed by the following equation (35).
ここで、透明板2の厚さd、透明板2のカメラ光軸に対する角度θg、透明板2の屈折率nがまだ未算出のパラメータとなる。そこで次の式(36)の二乗誤差を最小化するd,θg,nを求める。
Here, the thickness d of the
ここで、N2は平面マーカ12Bの交点12Bcの数である。この数式は、透明板2ありの場合のピクセル位置u2'からの変換結果と透明板2無しの場合のピクセル位置u2との誤差を最小化するパラメータを算出するという意味になる。これにはレーベンバーグマーカート法などの最適化手法を用いる。
これで、透明板2のパラメータである厚さd、角度θg、屈折率nが算出される。
Here, N2 is the number of intersections 12Bc of the
Thus, the thickness d, the angle θ g , and the refractive index n, which are parameters of the
その後、実施例1と同様にキャリブレーション処理部13fにより、計測されるu2'から透明板2がない場合と同等のピクセル位置u2を算出する(ステップS7)。算出にはZ2'という撮影対象の距離(エリアカメラ11Bから平面マーカ12BまでのZ軸方向の距離)が必要になるが、実施例1と同様に、これには撮像するワーキングディスタンスを固定することで解決するか、別の手段で対象物までの距離Z2'を計測する。
Thereafter, the
このように構成される本実施例に係る画像のキャリブレーション装置及びキャリブレーション方法によれば、以下の作用効果が得られる。すなわち、
1)透明板2のパラメータを画像データとマーカ座標系座標データの真値のみで算出することが可能である。
2)透明板2や平面マーカ12Bの設置位置の制約が少ないキャリブレーション手法である。
3)透明板パラメータの算出と平面マーカ12Bのカメラ座標系座標の算出が可能である。
4)エリアカメラ11Bでの透明板キャリブレーションが可能である。
According to the image calibration device and the calibration method according to the present embodiment configured as described above, the following operational effects can be obtained. That is,
1) The parameters of the
2) This is a calibration method with less restrictions on the installation positions of the
3) It is possible to calculate the transparent plate parameters and the coordinates of the
4) Transparent plate calibration with the
なお、本実施例では、平面マーカ12Bを、矩形状の白色領域12Baと黒色領域12Bbとをチェスボード型に配置したものとして説明したが、平面マーカ12Bの配色は上述した実施例に限定されるものではなく、淡色の領域と濃色の領域とをチェスボード型に配置するなど、二つの領域の境界が明確に判断できる配色であればよい。
In the present embodiment, the
本発明は、透明板を介してカメラで撮影した画像を、透明板がない状態と同等の画像に校正する画像のキャリブレーション装置及びキャリブレーション方法に適用することができる。 INDUSTRIAL APPLICABILITY The present invention can be applied to an image calibration apparatus and an image calibration method for calibrating an image captured by a camera via a transparent plate into an image equivalent to a state without the transparent plate.
1 ケース
2 透明板
11A ラインセンサカメラ
11B エリアカメラ
12A 直線マーカ
12Aa 白帯(白色領域)
12Ab 黒帯(黒色領域)
12Ac 切り替え地点
12B 平面マーカ
12Ba 白色領域
12Bb 黒色領域
12Bc 交点
13 画像処理装置
13a 画像入力部
13b 計測座標算出部
13c 外部パラメータ算出部
13d カメラ座標系変換部
13e 透明板パラメータ算出部
13f キャリブレーション処理部
13g 記憶部
1
12Ab black belt (black area)
Claims (6)
大きさが既知である白色領域及び黒色領域が交互に配されたマーカと、
前記カメラによって撮影した画像を解析する画像処理装置と
を備え、
前記画像処理装置は、
前記カメラにより前記透明板を介さずに撮影した前記マーカの画像及び前記カメラにより前記透明板を介して撮影した前記マーカの画像を入力する画像入力部と、
前記透明板を介さずに撮影した前記マーカの画像及び前記透明板を介して撮影した前記マーカの画像から、それぞれ前記マーカの白色領域と黒色領域の境界の画像上の座標を算出する計測座標算出部と、
前記透明板を介さずに撮影した前記マーカの画像から算出した前記白色領域と前記黒色領域の境界の画像上の座標、予め既知である内部パラメータ、及び予め既知である前記白色領域と前記黒色領域の境界の実座標に基づいて前記カメラと前記マーカとの位置姿勢関係を表す外部パラメータを算出する外部パラメータ算出部と、
前記透明板を介さずに撮影した前記マーカの画像から算出した前記白色領域と前記黒色領域の境界の画像上の座標を、前記外部パラメータを用いてカメラ座標系の座標に変換するカメラ座標系変換部と、
前記透明板を介して撮影した前記マーカの画像から算出した前記白色領域と前記黒色領域の境界の画像上の座標が、前記透明板を介さずに撮影した前記マーカの画像から算出した前記白色領域と前記黒色領域の境界の画像上の座標に近似するように、前記内部パラメータ及び前記透明板を介さずに撮影した前記マーカの画像から得られた前記マーカの白色領域と黒色領域の境界の前記カメラ座標系の座標を用いて前記透明板の前記カメラに対する角度、厚さ及び屈折率を透明板のパラメータとして算出する透明板パラメータ算出部と、
前記透明板を介して撮影した前記マーカの画像から算出した前記白色領域と前記黒色領域の境界の画像上の座標を、前記透明板のパラメータに基づいて前記透明板を介さずに撮影した状態と同等となるように校正するキャリブレーション処理部と
を備えることを特徴とするキャリブレーション装置。 A calibration device for calibrating an image acquired by a camera that shoots through a transparent plate,
A marker in which white areas and black areas whose sizes are known are alternately arranged,
An image processing apparatus for analyzing an image captured by the camera,
The image processing device,
An image input unit for inputting the image of the marker photographed without the transparent plate by the camera and the image of the marker photographed through the transparent plate by the camera,
From the image of the marker taken without the transparent plate and the image of the marker taken through the transparent plate, measurement coordinate calculation for calculating the coordinates on the image of the boundary between the white region and the black region of the marker, respectively Department and
Coordinates on the image of the boundary between the white area and the black area calculated from the image of the marker taken without passing through the transparent plate, internal parameters that are known in advance, and the white area and the black area that are known in advance An external parameter calculation unit that calculates an external parameter representing a position and orientation relationship between the camera and the marker based on the actual coordinates of the boundary of
Camera coordinate system conversion for converting the coordinates on the image of the boundary between the white area and the black area calculated from the image of the marker taken without passing through the transparent plate into the coordinates of the camera coordinate system using the external parameters Department and
The coordinates on the image of the boundary between the white area and the black area calculated from the image of the marker taken through the transparent plate are the white areas calculated from the image of the marker taken without passing through the transparent plate. said to approximate the coordinates on the boundary of the image of the black area, the boundary of the internal parameters and white areas and black areas of the marker obtained from an image of the marker taken without going through the transparent plate and A transparent plate parameter calculation unit that calculates the angle of the transparent plate with respect to the camera, the thickness and the refractive index as parameters of the transparent plate using the coordinates of a camera coordinate system,
A state where the coordinates on the image of the boundary between the white area and the black area calculated from the image of the marker taken through the transparent plate are taken without passing through the transparent plate based on the parameters of the transparent plate. A calibration apparatus comprising: a calibration processing unit that performs calibration so as to be equivalent.
前記カメラが、一ラインの撮影を行うラインセンサカメラであり、
前記白色領域と前記黒色領域の境界が、前記白色領域と前記黒色領域の切り替え地点である
ことを特徴とする請求項1記載のキャリブレーション装置。 The marker is a linear marker in which the white area and the black area are alternately arranged on a straight line,
The camera is a line sensor camera that captures one line,
The calibration apparatus according to claim 1, wherein a boundary between the white area and the black area is a switching point between the white area and the black area.
前記カメラが、二次元の撮影を行うエリアカメラであり、
前記白色領域と前記黒色領域の境界が、前記白色領域と前記白色領域との交点または前記黒色領域と前記黒色領域との交点である
ことを特徴とする請求項1記載のキャリブレーション装置。 The marker is a planar marker in which the white area and the black area are arranged in a chessboard shape,
The camera is an area camera that performs two-dimensional imaging,
The calibration device according to claim 1, wherein a boundary between the white region and the black region is an intersection between the white region and the white region or an intersection between the black region and the black region.
前記透明板を介さずに前記カメラによりマーカを撮影する第一の工程と、
前記マーカと前記カメラとの間に前記透明板を配置した状態で、前記透明板を介して撮像手段により前記マーカを撮影する第二の工程と、
前記透明板を介さずに撮影した前記マーカの画像及び前記透明板を介して撮影した前記マーカの画像から、それぞれ前記マーカの白色領域と黒色領域との境界の画像上の座標を算出する第三の工程と、
前記透明板を介さずに撮影した前記マーカの画像から算出した前記白色領域と前記黒色領域の境界の画像上の座標、予め既知である内部パラメータ、及び予め既知である前記白色領域と前記黒色領域の境界の実座標に基づいて前記カメラと前記マーカとの位置姿勢関係を表す外部パラメータを算出する第四の工程と、
前記透明板を介さずに撮影した前記マーカの画像から算出した前記白色領域と前記黒色領域の境界の画像上の座標を、前記外部パラメータを用いてカメラ座標系の座標に変換する第五の工程と、
前記透明板を介して撮影した前記マーカの画像から算出した前記白色領域と前記黒色領域の境界の画像上の座標が、前記透明板を介さずに撮影した前記マーカの画像から算出した前記白色領域と前記黒色領域の境界の画像上の座標に近似するように、前記内部パラメータ及び前記透明板を介さずに撮影した前記マーカの画像から得られた前記マーカの白色領域と黒色領域の境界の前記カメラ座標系の座標を用いて前記透明板の前記カメラに対する角度、厚さ及び屈折率を透明板のパラメータとして算出する第六の工程と、
前記透明板を介して撮影した前記マーカの画像から算出した前記白色領域と前記黒色領域の境界の画像上の座標を、前記透明板のパラメータに基づいて前記透明板を介さずに撮影した状態と同等となるように校正する第七の工程と
を備えることを特徴とするキャリブレーション方法。 A calibration method for calibrating an image acquired by a camera that shoots through a transparent plate,
A first step of photographing a marker by the camera without passing through the transparent plate,
In a state where the transparent plate is arranged between the marker and the camera, a second step of photographing the marker by imaging means via the transparent plate,
Third calculating the coordinates on the image of the boundary between the white region and the black region of the marker from the image of the marker taken without passing through the transparent plate and the image of the marker taken through the transparent plate, respectively; Process and
Coordinates on the image of the boundary between the white area and the black area calculated from the image of the marker taken without passing through the transparent plate, internal parameters that are known in advance, and the white area and the black area that are known in advance A fourth step of calculating external parameters representing the position and orientation relationship between the camera and the marker based on the actual coordinates of the boundary of,
A fifth step of converting the coordinates on the image of the boundary between the white area and the black area calculated from the image of the marker taken without passing through the transparent plate into coordinates in a camera coordinate system using the external parameters When,
The coordinates on the image of the boundary between the white area and the black area calculated from the image of the marker taken through the transparent plate are the white areas calculated from the image of the marker taken without passing through the transparent plate. said to approximate the coordinates on the boundary of the image of the black area, the boundary of the internal parameters and white areas and black areas of the marker obtained from an image of the marker taken without going through the transparent plate and A sixth step of calculating the angle of the transparent plate with respect to the camera, the thickness and the refractive index as parameters of the transparent plate using the coordinates of a camera coordinate system,
A state where the coordinates on the image of the boundary between the white area and the black area calculated from the image of the marker taken through the transparent plate are taken without passing through the transparent plate based on the parameters of the transparent plate. And a seventh step of performing calibration so as to be equivalent.
前記カメラが、一ラインの撮影を行うラインセンサカメラであり、
前記白色領域と前記黒色領域の境界が、前記白色領域と前記黒色領域の切り替え地点である
ことを特徴とする請求項4記載のキャリブレーション方法。 The marker is a linear marker in which the white area and the black area are alternately arranged on a straight line,
The camera is a line sensor camera that captures one line,
The calibration method according to claim 4, wherein a boundary between the white area and the black area is a switching point between the white area and the black area.
前記カメラが、二次元の撮影を行うエリアカメラであり、
前記白色領域と前記黒色領域の境界が、前記白色領域と前記白色領域との交点または前記黒色領域と前記黒色領域との交点である
ことを特徴とする請求項4記載のキャリブレーション方法。
The marker is a planar marker in which the white area and the black area are arranged in a chessboard shape,
The camera is an area camera that performs two-dimensional imaging,
5. The calibration method according to claim 4, wherein a boundary between the white region and the black region is an intersection between the white region and the white region or an intersection between the black region and the black region.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2015231259A JP6645140B2 (en) | 2015-11-27 | 2015-11-27 | Image calibration apparatus and calibration method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2015231259A JP6645140B2 (en) | 2015-11-27 | 2015-11-27 | Image calibration apparatus and calibration method |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2017098859A JP2017098859A (en) | 2017-06-01 |
JP6645140B2 true JP6645140B2 (en) | 2020-02-12 |
Family
ID=58804048
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2015231259A Active JP6645140B2 (en) | 2015-11-27 | 2015-11-27 | Image calibration apparatus and calibration method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6645140B2 (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP6462749B2 (en) * | 2017-03-23 | 2019-01-30 | 株式会社東芝 | Measuring apparatus, program, and measuring method |
JP7044016B2 (en) * | 2018-09-05 | 2022-03-30 | 株式会社明電舎 | Line sensor camera calibration device and method |
CN109682309B (en) * | 2018-12-21 | 2023-11-14 | 北京安视中电科技有限公司 | Intelligent measuring device and method for black crystal panel parameters based on machine vision |
CN111862082A (en) * | 2020-07-31 | 2020-10-30 | 成都盛锴科技有限公司 | Train brake pad thickness rechecking method and system thereof |
JP7335860B2 (en) * | 2020-11-25 | 2023-08-30 | 富士通フロンテック株式会社 | Measuring method, information processing device and program |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2003050107A (en) * | 2001-08-07 | 2003-02-21 | Matsushita Electric Ind Co Ltd | Camera calibration device |
JP4872890B2 (en) * | 2007-11-21 | 2012-02-08 | スズキ株式会社 | Image distortion correction method |
JP6427900B2 (en) * | 2014-03-07 | 2018-11-28 | 株式会社リコー | Calibration method, calibration system, program, and moving object |
-
2015
- 2015-11-27 JP JP2015231259A patent/JP6645140B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2017098859A (en) | 2017-06-01 |
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 | |
JP6645140B2 (en) | Image calibration apparatus and calibration method | |
CN101825431B (en) | Reference image techniques for three-dimensional sensing | |
Kimura et al. | Projector calibration using arbitrary planes and calibrated camera | |
JP6363863B2 (en) | Information processing apparatus and information processing method | |
EP2751521B1 (en) | Method and system for alignment of a pattern on a spatial coded slide image | |
JP3728900B2 (en) | Calibration method and apparatus, and calibration data generation method | |
JP6596433B2 (en) | Structured optical matching of a set of curves from two cameras | |
EP1580523A1 (en) | Three-dimensional shape measuring method and its device | |
JP5070435B1 (en) | Three-dimensional relative coordinate measuring apparatus and method | |
CN102788559A (en) | Optical vision measuring system with wide-field structure and measuring method thereof | |
JP2012058076A (en) | Three-dimensional measurement device and three-dimensional measurement method | |
US20080123939A1 (en) | Method of correcting a volume imaging equation for more accurate determination of a velocity field of particles in a volume | |
JP2011506914A (en) | System and method for multi-frame surface measurement of object shape | |
JP6696230B2 (en) | Stereo calibration device and stereo calibration method for line sensor camera | |
ES2894935T3 (en) | Three-dimensional distance measuring apparatus and method therefor | |
JP3696336B2 (en) | How to calibrate the camera | |
JP4837538B2 (en) | End position measuring method and dimension measuring method | |
Chen et al. | Finding optimal focusing distance and edge blur distribution for weakly calibrated 3-D vision | |
US20240087167A1 (en) | Compensation of three-dimensional measuring instrument having an autofocus camera | |
JP2008275366A (en) | Stereoscopic 3-d measurement system | |
JP5648159B2 (en) | Three-dimensional relative coordinate measuring apparatus and method | |
Yang et al. | Effect of field of view on the accuracy of camera calibration | |
JP2010243273A (en) | Measuring method and measuring apparatus for object having cylindrical shape | |
US20230070281A1 (en) | Methods and systems of generating camera models for camera calibration |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20181026 |
|
RD02 | Notification of acceptance of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7422 Effective date: 20190524 |
|
RD04 | Notification of resignation of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7424 Effective date: 20190605 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20190624 |
|
RD04 | Notification of resignation of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7424 Effective date: 20190529 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20190709 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20190822 |
|
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: 20191210 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20191223 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6645140 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |