JP5432835B2 - How to calibrate the camera - Google Patents
How to calibrate the camera Download PDFInfo
- Publication number
- JP5432835B2 JP5432835B2 JP2010143490A JP2010143490A JP5432835B2 JP 5432835 B2 JP5432835 B2 JP 5432835B2 JP 2010143490 A JP2010143490 A JP 2010143490A JP 2010143490 A JP2010143490 A JP 2010143490A JP 5432835 B2 JP5432835 B2 JP 5432835B2
- Authority
- JP
- Japan
- Prior art keywords
- intersection
- pattern
- calibration
- matrix
- calibration 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.)
- Expired - Fee Related
Links
Images
Landscapes
- Length Measuring Devices By Optical Means (AREA)
Description
この発明は、カメラの位置や向き、カメラが持つ画像中心やスケールなどのカメラの校正パラメータを算出するカメラのキャリブレーション方法に関するものである。 The present invention relates to a camera calibration method for calculating camera calibration parameters such as the camera position and orientation, the image center and scale of the camera.
従来より、撮像された2枚の画像に基づいて測定対象物の3次元形状の計測を行うためのカメラとして、ステレオカメラが用いられている。このステレオカメラでは、その取り付け位置のずれが直接、撮像データ間のずれに影響するため、生産時や現場への取り付け時に高精度の位置調整が要求される。 Conventionally, a stereo camera has been used as a camera for measuring a three-dimensional shape of a measurement object based on two captured images. In this stereo camera, the displacement of the attachment position directly affects the displacement between the imaged data, and therefore high-precision position adjustment is required at the time of production or attachment to the site.
そこで、ステレオカメラを用いた3次元計測においては、カメラの位置や向き、カメラが持つ画像中心やスケールなどのカメラの校正パラメータを求めることが必須となる。このカメラの校正パラメータを求めることをキャリブレーションと呼んでいる。また、このキャリブレーションによって求める校正パラメータをキャリブレーションパラメータと呼んでいる。 Thus, in three-dimensional measurement using a stereo camera, it is essential to obtain camera calibration parameters such as the position and orientation of the camera, the image center and scale of the camera. Obtaining this camera calibration parameter is called calibration. A calibration parameter obtained by this calibration is called a calibration parameter.
〔キャリブレーションパラメータ〕
図19にステレオカメラを用いた3次元計測の概要を示す。この図において、G1は左カメラの画像、G2は右カメラの画像である。今、空間上の点を
[Calibration parameters]
FIG. 19 shows an outline of three-dimensional measurement using a stereo camera. In this figure, G1 is an image of the left camera, and G2 is an image of the right camera. Now, the point in space
、左カメラの画像G1上の点を , The point on the left camera image G1
とし、空間上の点Mが左カメラの画像G1上の点mの位置に映ったとする。
この場合、Mとmには以下の関係がある。
sm=A〔Rt〕M=PM ・・・・(1)
Suppose that the point M in the space is reflected at the position of the point m on the image G1 of the left camera.
In this case, M and m have the following relationship.
sm = A [Rt] M = PM (1)
ここで、sはスケールパラメータを表す。Rはカメラの姿勢を表す3×3の回転行列、tはカメラの位置を表す3×1の並進ベクトルである。2つを合わせた3×4の行列〔Rt〕を外部パラメータと呼ぶ。Aは下記(2)式で表される3×3の行列である。 Here, s represents a scale parameter. R is a 3 × 3 rotation matrix representing the camera posture, and t is a 3 × 1 translation vector representing the camera position. The combined 3 × 4 matrix [Rt] is called an external parameter. A is a 3 × 3 matrix expressed by the following equation (2).
ここで、〔u0,v0〕は画像中心、αuとαvはそれぞれ、u軸、v軸のスケール因子を表し、bは2つの軸のねじれを表す。u軸は画像の横方向、v軸は画像の縦方向を表しており、画像の左上が原点である。行列Aはカメラの内部変数のみによって構成されており、カメラの内部パラメータと呼ばれる。 Here, [u 0 , v 0 ] represents the image center, α u and α v represent the u-axis and v-axis scale factors, respectively, and b represents the twist of the two axes. The u axis represents the horizontal direction of the image, the v axis represents the vertical direction of the image, and the upper left of the image is the origin. The matrix A is composed only of camera internal variables and is called camera internal parameters.
また、行列P=A〔Rt〕は3次元中の点(3次元データ)を画像上の点(2次元データ)に投影する3×4の行列であり、P行列と呼ばれる。キャリブレーションではこのP行列を、すなわち内部パラメータと外部パラメータとから構成されるP行列を、キャリブレーションパターンとして求める。 The matrix P = A [Rt] is a 3 × 4 matrix that projects points in three dimensions (three-dimensional data) onto points on the image (two-dimensional data), and is called a P matrix. In the calibration, this P matrix, that is, a P matrix composed of internal parameters and external parameters is obtained as a calibration pattern.
なお、上記(1)式の関係はピンホールカメラモデルを仮定したものである(詳細は非特許文献1を参照)。
In addition, the relationship of said Formula (1) assumes a pinhole camera model (refer the
〔3次元計測の原理〕
次に、2つのカメラで3次元物体を撮像し得られた画像から、もとの3次元物体の形状を計測する方法を述べる。3次元点M=〔X,Y,Z,1〕Tを2つのカメラで撮像し、左カメラに投影された点をm=〔u,v,1〕T 、右カメラに投影された点をm’= 〔u’,v’,1〕T とすると、sm=PM、sm’=PM’というような関係がある。但し、
[Principle of three-dimensional measurement]
Next, a method for measuring the shape of the original three-dimensional object from images obtained by imaging the three-dimensional object with two cameras will be described. The three-dimensional point M = [X, Y, Z, 1] T is imaged by two cameras, the point projected on the left camera is m = [u, v, 1] T , and the point projected on the right camera is When m ′ = [u ′, v ′, 1] T , there are relationships such as sm = PM and sm ′ = PM ′. However,
であり、それぞれのカメラのP行列を表している。上記の関係は下記の(3)式に変形できる。 And represents the P matrix of each camera. The above relationship can be transformed into the following equation (3).
この連立方程式は未知数の数が3に対して、方程式の数は4なので、空間上の点Mを計算することができる。 In this simultaneous equation, the number of unknowns is 3 and the number of equations is 4, so the point M in space can be calculated.
以上から、ステレオカメラそれぞれのP行列が分かっていれば、2つのカメラで観測した点m=〔u,v,1〕T およびm’= 〔u’,v’,1〕T から3次元点M=〔X,Y,Z,1〕Tを求めることができる。なお、ここでは、2枚の画像上の点mとm’との対応は分かっていることを前提としている。 From the above, if the P matrix of each stereo camera is known, the three-dimensional points from the points m = [u, v, 1] T and m ′ = [u ′, v ′, 1] T observed by the two cameras M = [X, Y, Z, 1] T can be obtained. Here, it is assumed that the correspondence between the points m and m ′ on the two images is known.
〔内部パラメータの計算〕
3次元空間の座標を、3次元平面がZ=0となるように置くと、上記(1)式は下記(4)式のように変形できる。
sm=A〔Rt〕〔X,Y,0,1〕T=A〔r1r2t〕〔X,Y,1〕T ・・・・(4)
[Calculation of internal parameters]
When the coordinates of the three-dimensional space are set so that the three-dimensional plane is Z = 0, the above equation (1) can be transformed into the following equation (4).
sm = A [Rt] [X, Y, 0, 1] T = A [r 1 r 2 t] [X, Y, 1] T (4)
ここで、回転行列RをR=〔r1r2r3〕としている。また、3次元平面がZ=0ととなるように置くという意味は、後述するキャリブレーションパターンと垂直な方向をZ軸と考え、キャリブレーションパターンの位置がZ軸の原点、つまりZ=0となるように座標系を取ることである。 Here, the rotation matrix R is R = [r 1 r 2 r 3 ]. Also, the meaning that the three-dimensional plane is set to be Z = 0 means that a direction perpendicular to a calibration pattern to be described later is considered as the Z axis, and the position of the calibration pattern is the origin of the Z axis, that is, Z = 0. Is to take the coordinate system.
ここで、射影変換行列としてH=A〔r1r2t〕を定義すると、上記(4)式は下記(5)式となる。
s〔u,v,1〕T=H〔X,Y,1〕T ・・・・(5)
Here, if H = A [r 1 r 2 t] is defined as the projective transformation matrix, the above equation (4) becomes the following equation (5).
s [u, v, 1] T = H [X, Y, 1] T (5)
射影変換行列はHomography行列とも呼ばれ、平面座標から平面座標への変換を表す。以下、射影変換行列をH行列と呼ぶ。このH行列は3次元平面上と画像上の対応点が4つ以上あれば、計算することができる。ここで、〔h1h2h3〕=λA〔r1r2t〕とおき、r1とr2が直交する単位ベクトルであることを利用すると以下の式が得られる。 The projective transformation matrix is also called a “Homography matrix” and represents a transformation from planar coordinates to planar coordinates. Hereinafter, the projective transformation matrix is referred to as an H matrix. This H matrix can be calculated if there are four or more corresponding points on the three-dimensional plane and on the image. Here, [h 1 h 2 h 3 ] = λA [r 1 r 2 t] is set, and by utilizing the fact that r 1 and r 2 are orthogonal unit vectors, the following equation is obtained.
1枚の画像からは上記の2つのカメラ内部変数に関する拘束式が得られる。5つのカメラ内部変数を解く場合は、少なくとも3枚の画像が必要となる。このために、後述するように、異なる視点からキャリブレーションパラメータを3回以上撮像する必要がある。行列B=A-TA-1を定義し、その要素を並べたベクトルをb=〔B11,B12,B22,B13,B23,B33〕Tと定義すると、
hi TBhj=vij Tb ・・・・(7)
となる。
ここで、
From one image, the constraint equations regarding the two internal camera variables are obtained. When solving five camera internal variables, at least three images are required. For this reason, as described later, it is necessary to image the calibration parameter three times or more from different viewpoints. If a matrix B = A −T A −1 is defined and a vector in which its elements are arranged is defined as b = [B 11 , B 12 , B 22 , B 13 , B 23 , B 33 ] T ,
h i T Bh j = v ij T b (7)
It becomes.
here,
である。さらに、上記(6)式と(7)式は、下記(8)式となる。 It is. Furthermore, the above formulas (6) and (7) become the following formula (8).
上記(8)式は1つのH行列から得られる式である。もし3つ以上のH行列が得られば、それらを積み重ねることによりbを計算できる。bが求まれば、内部パラメータは次式から算出できる。 The above equation (8) is an equation obtained from one H matrix. If more than two H matrices are obtained, b can be calculated by stacking them. If b is obtained, the internal parameter can be calculated from the following equation.
〔外部パラメータの計算〕
外部パラメータR=〔r1r2r3〕およびtについては、内部パラメータAが求まれば、以下の式により計算できる。
[Calculation of external parameters]
The external parameter R = [r 1 r 2 r 3 ] and t can be calculated by the following formula once the internal parameter A is obtained.
このようにして、内部パラメータと外部パラメータとを計算することができ、この内部パラメータと外部パラメータとによってキャリブレーションパラメータであるP行列を求めることができる。このP行列を求めるにあたっては、上述の説明から分かるように、撮像画像と撮像する平面物体との対応であるH行列を求めることが重要となる。 In this way, internal parameters and external parameters can be calculated, and a P matrix that is a calibration parameter can be obtained from the internal parameters and external parameters. In obtaining this P matrix, as can be seen from the above description, it is important to obtain an H matrix that is a correspondence between the captured image and the planar object to be imaged.
〔キャリブレーションパターン〕
図20にステレオカメラのキャリブレーションに用いられている従来のキャリブレーションパターンの一例を示す。このキャリブレーションパターン1は、交互にそのマス目内の色が反転するように配色された格子状の平面パターンとされ、この例では白と黒とのマス目を交互に格子状に並べた市松模様のパターンとされている。
[Calibration pattern]
FIG. 20 shows an example of a conventional calibration pattern used for calibration of a stereo camera. The
図21にこのキャリブレーションパターン1を用いたキャリブレーションの流れ図を示す。図22にこの流れ図に従ってキャリブレーションを実施するシステムの概略を示す。このシステムでは、キャリブレーションパターン1をステレオカメラ2で撮影(撮像)し、このステレオカメラ2で撮像された画像を画像処理装置3へ送る。画像処理装置3は半自動でステレオカメラ2のキャリブレーションを実施する。
FIG. 21 shows a flow chart of calibration using this
なお、ここでは、説明を簡単とするため、ステレオカメラ2の左カメラのキャリブレーションが行われる様子を説明する。右カメラのキャリブレーションも同様にして行われる。
Here, in order to simplify the description, the manner in which the left camera of the
先ず、操作者は、キャリブレーションパターン1をステレオカメラ2で任意の方向から撮影(撮像)する(ステップS101)。図23にステレオカメラ2で撮像されたキャリブレーションパターン1の画像例(左カメラの画像)を示す。この画像は画像処理装置3へ送られる。
First, the operator captures (captures) the
操作者は、この撮像されたキャリブレーションパターン1において、そのパターン内のマス目の交点を4点手動で指定する(ステップS102)。ここでは、図23に示すように、4隅のマス目の交点X1,X2,X3,X4を指定する。 The operator manually designates four intersections of the squares in the captured calibration pattern 1 (step S102). Here, as shown in FIG. 23, intersections X1, X2, X3, and X4 of squares at the four corners are designated.
画像処理装置3は、交点X1,X2,X3,X4が指定されると、その指定された4つの交点の内部にある交点の座標を全て検出(自動検出)する(ステップS103)。
When the intersection points X1, X2, X3, and X4 are designated, the
次に、操作者は、カメラの方向を変えて(ステップS105)、キャリブレーションパターン1を撮影(撮像)し(ステップS101)、上述と同様にして、その撮像されたキャリブレーションパターン1において、そのパターン内のマス目の交点を4点手動で指定する(ステップS102)。 Next, the operator changes the direction of the camera (step S105), shoots (captures) the calibration pattern 1 (step S101), and, in the same manner as described above, Four intersection points in the pattern are manually designated (step S102).
すると、画像処理装置3は、上述と同様にして、指定された4つの交点の内部にある交点の座標を全て検出(自動検出)する(ステップS103)。
Then, in the same manner as described above, the
操作者は、このようにして、少なくとも3方向からキャリブレーションパターン1を撮像し、その撮像されたキャリブレーションパターン1における任意のマス目の交点の手動指定を繰り返す。
In this way, the operator images the
画像処理装置3は、N枚以上(この例では、1眼につき3枚以上)の撮像されたキャリブレーションパターン1について、その交点座標の自動検出が終了すると(ステップS104のYES)、その検出された交点座標に基づいてキャリブレーションパラメータの計算を行う(ステップS106)。
When the automatic detection of the intersection coordinates of the
この場合、画像処理装置3は、N方向から撮像されたキャリブレーションパターン1の各々について、実際のキャリブレーションパターン1との間の交点座標を対応付けてH行列を各個に算出し(図24参照)、これら算出されたH行列から左カメラのキャリブレーションパラメータを算出する。
In this case, the
しかしながら、上述したキャリブレーション方法(以下、従来方式と呼ぶ)によると、撮像されたキャリブレーションパターンに対して手動で任意のマス目の交点を指定しなければならず、キャリブレーションの処理時間が増大するという問題があった。また、交点の指定を手作業で行うために、人手によるミスが発生する虞もあった。また、キャリブレーションパターンの4隅が映るように撮影を行う必要があり、撮影時の調整に手間を要する。また、キャリブレーションパターンを画面全体に映すことができないため(画面に背景が入る)、キャリブレーションの精度の低下を招くという問題もあった。 However, according to the calibration method described above (hereinafter referred to as the conventional method), it is necessary to manually specify the intersection of arbitrary squares with respect to the captured calibration pattern, and the calibration processing time increases. There was a problem to do. Further, since the intersection point is manually specified, there is a risk that a manual error may occur. In addition, it is necessary to perform shooting so that the four corners of the calibration pattern are reflected, and adjustment is required during shooting. In addition, since the calibration pattern cannot be displayed on the entire screen (background appears on the screen), there is a problem in that the accuracy of calibration is reduced.
なお、特許文献1では、キャリブレーションパターンとして2種類のマークを使用し、一方のパターンの位置を人手で指定し、その結果に基づいてもう一方のパターンを自動で認識し、精密な対応づけを行うようにしている。しかし、この特許文献1に示された方法では、精度の高いパターンの認識が可能であること、カメラのレンズ歪みへ対応できるなどの特徴があるが、上述した従来方式と同様に、人手による作業が含まれるため、処理の自動化が難しく、人手によるミスが発生する虞もある。
In
また、非特許文献2では、キャリブレーションパターンの認識を自動化するようにしているが、この非特許文献2に示された方法では、対象となるパターンに映っている市松模様の数が分かっていること、またそのパターン全てが映っていることが前提とされる。このため、上述した従来方式と同様、撮影時の調整に手間を要し、また、キャリブレーションパターンを画面全体に映すことができず(画面に背景が入る)、キャリブレーションの精度の低下を招くなどの問題がある。
In
本発明は、このような課題を解決するためになされたもので、その目的とするところは、人手によるミスの排除、処理時間の短縮、精度の向上を図ることが可能なカメラのキャリブレーション方法を提供することにある。 SUMMARY OF THE INVENTION The present invention has been made to solve such problems, and the object of the present invention is to provide a camera calibration method capable of eliminating manual mistakes, reducing processing time, and improving accuracy. Is to provide.
このような目的を達成するために本発明は、交互にそのマス目内の色が反転するように配色された格子状の平面パターンと、この平面パターン内の所定の位置に設けられた基準マークとを有するキャリブレーションパターンを少なくとも3方向からカメラで撮像し、この撮像された各キャリブレーションパターンと実際のキャリブレーションパターンとの間の射影変換行列(H行列)の本行列を各個に算出し、これら算出されたH行列の本行列からカメラの校正パラメータを算出するカメラのキャリブレーション方法であって、基準マークが入るようにカメラによってキャリブレーションパターンを撮像するパターン撮像ステップと、このパターン撮像ステップによって撮像されたキャリブレーションパターンより任意の四角形を形成するようにそのキャリブレーションパターン中の任意のマス目の交点座標を検出する交点座標検出ステップと、この交点座標検出ステップによって検出された交点座標に基づいて、パターン撮像ステップによって撮像されたキャリブレーションパターンと実際のキャリブレーションパターンとの間のH行列を仮のH行列として算出する仮行列算出ステップと、この仮行列算出ステップによって算出された仮のH行列に基づいて、パターン撮像ステップによって撮像されたキャリブレーションパターン中の各マス目の交点候補位置を算出し、この各マス目の交点候補位置のそれぞれについて実際に交点になっているか否かを確認し、この確認結果に基づいて各マス目の交点座標を推定する交点座標推定ステップと、パターン撮像ステップによって撮像されたキャリブレーションパターン中の基準マークを検出する基準マーク検出ステップと、この基準マーク検出ステップによって検出された基準マークの位置を座標基準とし、交点座標推定ステップによって推定された各マス目の交点座標に基づいて、パターン撮像ステップによって撮像されたキャリブレーションパターンと実際のキャリブレーションパターンとの間のH行列の本行列を算出する本行列算出ステップとを設けたことを特徴とする。 In order to achieve such an object, the present invention provides a grid-like plane pattern in which colors in the grids are alternately inverted, and a reference mark provided at a predetermined position in the plane pattern. A calibration pattern having the following is captured by a camera from at least three directions, and a main matrix of a projective transformation matrix (H matrix) between each captured calibration pattern and an actual calibration pattern is calculated for each. A camera calibration method for calculating camera calibration parameters from the main matrix of the calculated H matrix, wherein a pattern imaging step of imaging a calibration pattern with a camera so that a reference mark is inserted, and the pattern imaging step An arbitrary square is formed from the captured calibration pattern. The intersection coordinate detection step for detecting the intersection coordinates of any square in the calibration pattern, and the calibration pattern imaged by the pattern imaging step based on the intersection coordinates detected by the intersection coordinate detection step and the actual coordinates A temporary matrix calculation step of calculating an H matrix between the calibration pattern and a temporary H matrix, and a calibration imaged by the pattern imaging step based on the temporary H matrix calculated by the temporary matrix calculation step Calculate the intersection candidate position of each square in the pattern, check whether each of the intersection candidate positions of each square is actually an intersection, and based on this confirmation result, the intersection coordinates of each square Is captured by the intersection coordinate estimation step and the pattern imaging step. The reference mark detection step for detecting the reference mark in the calibration pattern, and the position of the reference mark detected by the reference mark detection step as the coordinate reference, and the intersection coordinates of each square estimated by the intersection coordinate estimation step And a main matrix calculating step for calculating the main matrix of the H matrix between the calibration pattern imaged in the pattern imaging step and the actual calibration pattern.
本発明において、キャリブレーションパターンは、交互にそのマス目内の色が反転するように配色された格子状の平面パターン(以下、この平面パターンをチェックパターンと呼ぶ)と、このチェックパターン内の所定の位置に設けられた基準マークとから構成されている。このキャリブレーションパターンにおいて、基準マークはチェックパターンと区別することができればよく、ドットマークとしたり、三角形としたり、×印としたりしてもよい。また、例えば、チェックパターンのマス目の1つを色を変えて、その色を変えたマス目を基準マークとするなどとしてもよい。 In the present invention, the calibration pattern includes a grid-like plane pattern (hereinafter, this plane pattern is referred to as a check pattern) arranged so that the colors in the grids are alternately inverted, and a predetermined pattern in the check pattern. And a reference mark provided at the position. In this calibration pattern, the reference mark only needs to be distinguished from the check pattern, and may be a dot mark, a triangle, or a cross. Further, for example, one of the check pattern squares may be changed in color, and the changed square may be used as a reference mark.
本発明では、この基準マークが入るように、少なくとも3方向からキャリブレーションパターンをカメラで撮像する。そして、撮像された各キャリブレーションパターンについて、実際のキャリブレーションパターンとの間のH行列の本行列を各個に算出する。このH行列の本行列の算出は次のようにして行う。 In the present invention, the calibration pattern is imaged by the camera from at least three directions so that the reference mark is inserted. Then, the main matrix of the H matrix between each captured calibration pattern and the actual calibration pattern is calculated for each. The calculation of the main matrix of the H matrix is performed as follows.
先ず、撮像されたキャリブレーションパターンより、任意の四角形を形成するようにそのキャリブレーションパターン中の任意のマス目の交点座標を検出する。例えば、撮像されたキャリブレーションパターンの中心付近でマス目の交点を1つ見つけ、見つけた交点付近で3つ以上の交点を見つけるというようにして、任意の四角形を形成するようにキャリブレーションパターン中の任意のマス目の交点座標を検出する。そして、この検出した交点座標に基づいて、撮像されたキャリブレーションパターンと実際のキャリブレーションパターンとの間のH行列を仮のH行列として算出し、この算出した仮のH行列に基づいて撮像されたキャリブレーションパターン中の各マス目の交点候補位置を算出する。 First, the intersection coordinates of arbitrary squares in the calibration pattern are detected from the captured calibration pattern so as to form an arbitrary quadrangle. For example, in the calibration pattern so as to form an arbitrary square, one intersection point is found near the center of the captured calibration pattern, and three or more intersection points are found near the found intersection point. The coordinates of the intersection of any square of are detected. Then, based on the detected intersection coordinates, an H matrix between the captured calibration pattern and the actual calibration pattern is calculated as a temporary H matrix, and an image is captured based on the calculated temporary H matrix. The intersection candidate position of each square in the calibration pattern is calculated.
この場合、各マス目の交点候補位置は、実際に各マス目の交点になっているとは限らない。そこで、各マス目の交点候補位置のそれぞれについて、実際に交点になっているか否かを確認し、この確認結果に基づいて各マス目の交点座標を推定する。例えば、各マス目の交点候補位置のそれぞれについて、その交点候補位置を中心とした小領域を抽出し、その小領域の画像データを2値化し、この2値化した小領域の画像データに基づいて実際に交点になっているか否かを判定し、実際に交点になっていると判定された交点候補位置についてのみその交点座標の推定を行う。そして、撮像されたキャリブレーションパターン中の基準マークを検出し、この検出した基準マークの位置を座標基準とし、各マス目の推定された交点座標に基づいて、実際のキャリブレーションパターンとの間のH行列の本行列を算出する。 In this case, the intersection candidate position of each square is not always the intersection of each square. Therefore, it is confirmed whether or not each intersection candidate position of each square is actually an intersection, and the intersection coordinates of each square are estimated based on the confirmation result. For example, for each intersection candidate position of each square, a small area centered on the intersection candidate position is extracted, the image data of the small area is binarized, and based on the binarized image data of the small area It is determined whether or not it is actually an intersection, and the intersection coordinates are estimated only for the intersection candidate positions determined to be actually intersections. Then, a reference mark in the imaged calibration pattern is detected, and the position of the detected reference mark is used as a coordinate reference, and based on the estimated intersection coordinates of each square, an actual calibration pattern is detected. The main matrix of the H matrix is calculated.
このようにして、本発明では、撮像された各キャリブレーションパターンと実際のキャリブレーションパターンとの間のH行列の本行列を各個に算出し、これら算出されたH行列の本行列からカメラの校正パラメータ(キャリブレーションパラメータ)を算出する。 In this way, in the present invention, the main matrix of the H matrix between each captured calibration pattern and the actual calibration pattern is calculated for each, and the camera calibration is performed from the calculated main matrix of the H matrix. A parameter (calibration parameter) is calculated.
本発明によれば、基準マークが入るように撮像されたキャリブレーションパターンより、任意の四角形を形成するようにそのキャリブレーションパターン中の任意のマス目の交点座標が検出され、この検出された交点座標に基づいて各マス目の交点候補位置が算出され、この算出された交点候補位置から各マス目の交点座標が推定され、この推定された各マス目の交点座標に基づいて、基準マークの位置を座標基準とし、撮像されたキャリブレーションパターンと実際のキャリブレーションパターンとの間のH行列の本行列が算出されるものとなり、手動で交点座標の指定を行うことなく、全自動でカメラの校正パラメータを求めることができるようになり、人手によるミスを排除し、処理時間の短縮を図ることが可能となる。 According to the present invention, from the calibration pattern imaged so that the reference mark is inserted, the intersection coordinates of an arbitrary square in the calibration pattern are detected so as to form an arbitrary square, and the detected intersection point is detected. The intersection candidate position of each square is calculated based on the coordinates, the intersection coordinates of each square are estimated from the calculated intersection candidate positions, and the reference mark of the reference mark is calculated based on the estimated intersection coordinates of each square. The main matrix of the H matrix between the captured calibration pattern and the actual calibration pattern is calculated with the position as the coordinate reference, and the camera coordinates are automatically set without manually specifying the intersection coordinates. Calibration parameters can be obtained, so that manual errors can be eliminated and processing time can be shortened.
また、本発明によれば、基準マークが入るようにキャリブレーションパターンを撮像すればよく、キャリブレーションパターン全体の撮像は不要であるので(チェックパターンは画面からはみ出てもよい)、撮像時の調整の手間を大幅に削減することができるようになる。また、画面全体にキャリブレーションパターンを映すことができ(画面に背景が含まれない)、キャリブレーションの精度を向上させることが可能となる。 Further, according to the present invention, it is only necessary to image the calibration pattern so that the reference mark is inserted, and it is not necessary to image the entire calibration pattern (the check pattern may protrude from the screen). Can be greatly reduced. Further, the calibration pattern can be projected on the entire screen (the background is not included in the screen), and the calibration accuracy can be improved.
以下、本発明の実施の形態を図面に基づいて詳細に説明する。 Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
〔キャリブレーションパターン〕
図1は本発明に係るカメラのキャリブレーション方法で用いるキャリブレーションパターンの一例を示す図である。このキャリブレーションパターン4は、交互にそのマス目内の色が反転するように配色された格子状の平面パターン(チェックパターン)4Aと、このチェックパターン4A内の所定の位置に設けられた基準マーク4Bとから構成されている。
[Calibration pattern]
FIG. 1 is a diagram showing an example of a calibration pattern used in the camera calibration method according to the present invention. The
この実施の形態において、チェックパターン4Aは、白と黒とのマス目を交互に格子状に並べた市松模様のパターンとされている。また、基準マーク4Bは、チェックパターン4Aの中心部のマス目の中にドットマークとして記されている。
In this embodiment, the
なお、基準マーク4Bは、チェックパターン4Aと区別することができればよく、三角形としたり、×印としたりしてもよい。また、チェックパターン4Aのマス目の色を変え(灰色、赤など)、その色を変えたマス目を基準マークとして用いるようにしてもよい。
The
図2にこのキャリブレーションパターン4を用いて実施されるキャリブレーションの流れ図を示す。図3にこの流れ図に従ってキャリブレーションを実施するシステムの概略を示す。このシステムでは、キャリブレーションパターン4をステレオカメラ2で撮影(撮像)し、このステレオカメラ2で撮像された画像を画像処理装置5へ送る。画像処理装置5は全自動でステレオカメラ2のキャリブレーションを実施する。
FIG. 2 shows a flow chart of calibration performed using this
画像処理装置5は、プロセッサや記憶装置からなるハードウェアと、これらのハードウェアと協働して各種機能を実現させるプログラムとによって実現され、本実施の形態特有の機能として自動キャリブレーション機能を有している。 The image processing device 5 is realized by hardware including a processor and a storage device, and a program that realizes various functions in cooperation with these hardware, and has an automatic calibration function as a function unique to the present embodiment. doing.
なお、ここでは、説明を簡単とするため、ステレオカメラ2の右カメラのキャリブレーションが行われる様子を説明する。左カメラのキャリブレーションも同様にして行われる。
Here, in order to simplify the description, a state in which the right camera of the
先ず、操作者は、少なくとも3方向から基準マーク4Bが入るようにステレオカメラ2でキャリブレーションパターン4を撮影(撮像)する(ステップS201)。図4にステレオカメラ2によって撮像されたキャリブレーションパターン4の画像例(右カメラで撮像された画像)を示す。この画像は画像処理装置5へ送られる。
First, the operator captures (captures) the
すると、画像処理装置5は、撮像された各キャリブレーションパターン4と実際のキャリブレーションパターン4との間のH行列の本行列を各個に算出し(ステップS202)、これら算出されたH行列の本行列から右カメラのキャリブレーションパラメータを算出する(ステップS203)。
Then, the image processing apparatus 5 calculates the main matrix of the H matrix between each captured
〔H行列の本行列の算出〕
図5にステップS202でのH行列の本行列の算出処理の流れ図を示す。画像処理装置5は、この流れ図に従い、先ずH行列の仮行列を算出し、この算出したH行列の仮行列から撮像されたキャリブレーションパターン中の交点候補位置を算出し、この交点候補位置から交点座標を推定し、この推定した交点座標に基づいて基準マークの位置を座標基準としてH行列の本行列を求める以下、その詳細について述べる。
[Calculation of the main matrix of the H matrix]
FIG. 5 shows a flowchart of the main matrix calculation process in step S202. According to this flowchart, the image processing apparatus 5 first calculates a temporary matrix of the H matrix, calculates an intersection candidate position in the calibration pattern imaged from the calculated temporary matrix of the H matrix, and calculates the intersection point from the intersection candidate position. The coordinates are estimated, and the main matrix of the H matrix is obtained using the position of the reference mark as the coordinate reference based on the estimated intersection coordinates.
〔交点の検出〕
画像処理装置5は、撮像されたキャリブレーションパターン4の画像の中心付近で、その画像に含まれているキャリブレーションパターン4のマス目の交点を1つ見つける(ステップS301)。図6に示すP1が検出された交点である。なお、図6中、×印は交点でないと判断されたものである。また、探索範囲は画像中心付近で、探索のための刻み幅は切り出しブロックサイズの1/3程度である。
[Intersection detection]
The image processing apparatus 5 finds one intersection of the squares of the
次に、画像処理装置5は、ステップS301で見つけた交点付近で3つ以上の交点を見つける(ステップS302)。このとき、得られた点の少なくとも4点で4角形をなすように交点を見つける。 Next, the image processing apparatus 5 finds three or more intersections in the vicinity of the intersection found in step S301 (step S302). At this time, intersections are found so that at least four of the obtained points form a quadrangle.
この場合、例えば、交点が1直線に並ぶように点を取ってはいけない。また、見つかった交点の相対的な位置関係が分かっている必要がある。これらの制約はH行列の計算に必須の条件である。 In this case, for example, the points should not be placed so that the intersections are arranged in a straight line. Moreover, it is necessary to know the relative positional relationship of the found intersection. These restrictions are indispensable conditions for calculating the H matrix.
図7に四角形をなすように交点を見つけた例を示す。この例では、最初に見つけた交点P1付近で、任意の四角形を形成するように交点P2,P3,P4,P5を見つけている。なお、図8(a)に示すように、1つのマス目の4つの角を交点P1,P2,P3,P4として見つけるようにしてもよいし、図8(b)に示すように、4つのマス目で構成される四角形を形成するように、交点P2〜P9を見つけるようにしてもよい。 FIG. 7 shows an example in which intersection points are found so as to form a square. In this example, intersections P2, P3, P4, and P5 are found so as to form an arbitrary quadrangle near the intersection P1 that is found first. As shown in FIG. 8A, the four corners of one square may be found as intersections P1, P2, P3, and P4. As shown in FIG. The intersection points P2 to P9 may be found so as to form a quadrangle composed of squares.
〔仮のH行列の算出〕
画像処理装置5は、ステップS301,S302で検出した交点P1,P2,P3,P4,P5の交点の座標(交点座標)に基づいて、撮像されたキャリブレーションパターン4と実際のキャリブレーションパターン4との間のH行列を仮のH行列として算出する(ステップS303:図9参照)。
[Calculation of temporary H matrix]
Based on the coordinates (intersection coordinates) of the intersections of the intersection points P1, P2, P3, P4, and P5 detected in steps S301 and S302, the image processing apparatus 5 captures the captured
この場合、H行列は、前述した式(5)から算出できる。ここで、H行列を仮としている理由は、実際のキャリブレーションパターン4と撮像されたキャリブレーションパターン4とで対応する交点の位置がずれているからである。最終的には、撮像されたキャリブレーションパターン4の中にある基準マーク4Bの位置を座標基準として、双方の交点座標を対応づける。この処理は、後述するステップS307,S308で実施する。
In this case, the H matrix can be calculated from Equation (5) described above. Here, the reason why the H matrix is assumed is that the positions of the corresponding intersections of the
〔交点候補位置の算出〕
次に、画像処理装置5は、ステップS303で算出した仮のH行列に基づいて、撮像されたキャリブレーションパターン4中の各マス目の交点候補位置を算出する(ステップS304)。図10に算出された交点候補位置(図中の×印)を示す。
[Calculation of intersection candidate position]
Next, the image processing apparatus 5 calculates the intersection candidate position of each square in the captured
H行列が分かると前述した式(5)と実際のキャリブレーションパターン4の交点座標から撮像されたキャリブレーションパターン4上の交点座標を推定できる。実際のキャリブレーションパターン4の交点座標については、あらかじめ決められたマス目のサイズをそのまま用いればよい。
If the H matrix is known, the intersection coordinates on the
図10に示されている結果から分かるように、交点候補と思われる位置には、全て×印がつけられている。ここでは、画像内に含まれる交点候補位置をすべて表示しているため、画像端などパターンが途切れている部分がある。また、図からは視認し難いが、交点候補位置と実際の交点の位置には微妙なずれがある。この問題点は続くステップS305,S306の処理で解消する。 As can be seen from the results shown in FIG. 10, all the positions that are considered to be intersection candidates are marked with x. Here, since all the intersection candidate positions included in the image are displayed, there are portions where the pattern is interrupted, such as an image end. Further, although it is difficult to see from the figure, there is a slight deviation between the intersection candidate position and the actual intersection position. This problem is solved by the subsequent steps S305 and S306.
〔交点の判定〕
画像処理装置5は、ステップS304で算出した各マス目の交点候補位置のそれぞれについて、実際に交点になっているか否かを判定する(ステップS305)。図11にこの場合の交点判定処理の流れ図を示す。
[Judgment of intersection]
The image processing apparatus 5 determines whether or not each intersection candidate position of each square calculated in step S304 is actually an intersection (step S305). FIG. 11 shows a flowchart of the intersection determination process in this case.
画像処理装置5は、撮像されたキャリブレーションパターン4の画像から、各マス目の交点候補位置のそれぞれについて、その交点候補位置を中心とした小領域の画像ブロックBLを切り出す(ステップS401:図12参照)。 The image processing apparatus 5 cuts out an image block BL of a small area centered on the intersection candidate position for each intersection candidate position of each square from the captured image of the calibration pattern 4 (step S401: FIG. 12). reference).
この例では、画像ブロックBLのサイズを11×11ピクセル以上としている。ブロックサイズが小さい方が画像上のマス目のサイズが小さくても検出できるようになるが、11×11ピクセルより小さくなると検出精度が悪くなるためこの値とした。また、キャリブレーションパターン4は、画像上でのマス目のサイズが20×20以上にするのが望ましい。なお、キャリブレーションパターン4のマス目のサイズは自由に決めることができる。
In this example, the size of the image block BL is 11 × 11 pixels or more. The smaller block size allows detection even if the grid size on the image is smaller. However, since the detection accuracy deteriorates when the block size is smaller than 11 × 11 pixels, this value is used. The
次に、画像処理装置5は、ステップS401で切り出した小領域の画像ブロックBLのそれぞれに対して、輝度値に連動した2値化処理を行う(ステップS402、図13参照)。具体的には、画像ブロックBL内の平均輝度値を使って2値化する。対象となるパターンは常に一定の明るさで撮影されるとは限らないので、この処理により、正しく白のパターンと黒のパターンに分けることができる。 Next, the image processing apparatus 5 performs binarization processing in conjunction with the luminance value on each of the small area image blocks BL cut out in step S401 (see step S402, FIG. 13). Specifically, binarization is performed using the average luminance value in the image block BL. Since the target pattern is not always photographed at a constant brightness, this processing can correctly divide the pattern into a white pattern and a black pattern.
そして、画像処理装置5は、2値化された画像の4隅の領域を時計回りに見て、黒→白→黒→白、もしくは白→黒→白→黒と並ぶかによって、抽出した画像ブロックBLに交点が含まれるか否かを判定する(ステップS403、図14参照)。すなわち、黒→白→黒→白、もしくは白→黒→白→黒と並んでいれば、その小領域の画像ブロックBLの抽出元の交点候補位置が実際に交点になっていると判定する。 Then, the image processing apparatus 5 looks at the four corner areas of the binarized image clockwise, and extracts the extracted image depending on whether black → white → black → white or white → black → white → black. It is determined whether or not an intersection is included in the block BL (see step S403, FIG. 14). That is, if black → white → black → white, or white → black → white → black, the intersection candidate position from which the image block BL of the small area is extracted is determined to be an actual intersection.
ここで、処理を安定させるために、4隅の4点の値だけではなく、4隅から2×2の小ブロックをそれぞれ切り出し、その結果を投票して判定する。全体としては、2×2の小ブロックが4つの合計16点のデータが得られ、その中で14点以上が黒白の判定条件に一致していれば交点と判断する。この処理は、4隅のデータがたまたま条件に合致して誤判定するのを防ぐ効果がある。 Here, in order to stabilize the process, not only the values at the four corners but also 2 × 2 small blocks are cut out from the four corners, and the result is voted for determination. As a whole, a total of 16 points of data of 4 2 × 2 small blocks are obtained, and if 14 or more of them match the black and white judgment condition, it is judged as an intersection. This process has an effect of preventing the data at the four corners from being erroneously determined in accordance with the conditions.
なお、対象となるマス目のパターンがカメラの視線方向の軸(Z軸)を基準にして45度など大きく回転していると、交点判定ができない。しかしながら、対象パターンを大きく回転させてキャリブレーションすることがないため、考慮しないこととする。 It should be noted that the intersection determination cannot be made if the target grid pattern is rotated by a large angle such as 45 degrees with respect to the axis (Z-axis) in the line of sight of the camera. However, since the target pattern is not rotated and calibrated, it is not considered.
〔交点座標の推定〕
次に、画像処理装置5は、ステップS305において実際に交点になっていると判定された交点候補位置についてのみ、その画像ブロックBL中の交点位置を高精度で推定し(図15参照)、推定した交点座標を交点位置として更新する(ステップS306)。
[Estimation of intersection coordinates]
Next, the image processing apparatus 5 estimates the intersection position in the image block BL with high accuracy only for the intersection candidate positions determined to be actually intersections in step S305 (see FIG. 15). The intersection coordinates thus updated are updated as intersection positions (step S306).
なお、このステップS306での交点位置の高精度推定は、ハリスコーナ検出器(非特許文献3参照)によって行う。ハリスコーナ検出器の基本的な考え方は、縦方向と横方向の輝度値の勾配を見て、一番変化が激しい部分を検出するものである。もし画像中に交点があれば、その点が縦方向にも横方向にも輝度変化が大きくなるため検出されるという仕組みである。 Note that the high-precision estimation of the intersection position in step S306 is performed by a Harris corner detector (see Non-Patent Document 3). The basic idea of the Harris corner detector is to detect the most rapidly changing portion by looking at the gradient of the luminance values in the vertical and horizontal directions. If there is an intersection in the image, the point is detected because the luminance change is large both in the vertical and horizontal directions.
図16にステップS306で推定された交点座標(図中の●印)を示す。ステップS305での交点判定によって、図10では交点候補位置(図中の×印)となっていた画像の端の点がはじかれて、無くなっているのが分かる。 FIG. 16 shows the intersection coordinates (marked with ● in the figure) estimated in step S306. As a result of the intersection determination in step S305, it can be seen that the end point of the image that has been the intersection candidate position in FIG.
〔基準マークの検出〕
次に、画像処理装置5は、撮像されたキャリブレーションパターン4中の基準マーク4Bを検出する(ステップS307)。この処理では、1つ1つのマス目の位置が分かっているため、白色のマス目の中にドットマークがあるかどうかによって基準マーク4Bを見つけている。この処理で基準マーク4Bが見つかるため、実際のキャリブレーションパターン4と撮像されたキャリブレーションパターン4との間の交点の正しい対応が分かる。
[Detection of fiducial mark]
Next, the image processing apparatus 5 detects the
〔H行列の本行列の計算〕
次に、画像処理装置5は、基準マーク4Bの位置を座標基準とし、ステップS306によって推定された各マス目の交点座標に基づいて、撮像されたキャリブレーションパターン4と実際のキャリブレーションパターン4との間のH行列の本行列を算出する(ステップS308)。
[Calculation of this matrix of H matrix]
Next, the image processing apparatus 5 uses the position of the
これにより、基準マーク4Bが設けられているマス目の交点座標を基準点として、撮像されたキャリブレーションパターン4と実際のキャリブレーションパターン4との間のH行列の本行列が算出される(図17参照)
As a result, the main matrix of the H matrix between the captured
以上の説明から分かるように、本実施の形態では、基準マーク4Bが入るように撮像されたキャリブレーションパターン4より、自動的に、任意の四角形を形成するようにそのキャリブレーションパターン4中の任意のマス目の交点座標が検出され、この検出された交点座標に基づいて各マス目の交点候補位置が算出され、この算出された交点候補位置から各マス目の交点座標が推定され、この推定された各マス目の交点座標に基づいて、基準マーク4Bの位置を座標基準として、撮像されたキャリブレーションパターン4と実際のキャリブレーションパターン4との間のH行列の本行列が算出されるものとなる。これにより、手動で交点座標の指定を行うことなく、全自動でキャリブレーションパラメータが求められるものとなり、人手によるミスを排除し、処理時間の短縮を図ることができるようになる。
As can be seen from the above description, in the present embodiment, an arbitrary quadrangle in the
また、本実施の形態によれば、基準マーク4Bが入るようにキャリブレーションパターン4を撮影すればよく、キャリブレーションパターン4全体の撮影は不要であるので(チェックパターン4Aは画面からはみ出てもよい)、撮影時の調整の手間を大幅に削減することができる。すなわち、従来方式では、画面全体にキャリブレーションパターンを映そうとすると、手動で指定する4点が画像端ぎりぎりになるように調整する作業が必要となるが、本実施の形態によれば、基準マーク4Bさえ映っていればよく、キャリブレーションパターン4を映す調整の手間を大幅に削減できる。また、画面全体にキャリブレーションパターン4を映すことができるので(画面に背景が含まれない)、キャリブレーションの精度を向上させることができる。
Further, according to the present embodiment, it is only necessary to photograph the
図18に画像処理装置5の要部の機能ブロック図を示す。画像処理装置5は、実際のキャリブレーションパターン4の各マス目の交点座標や基準マーク4Bの位置などのデータを実パターンのデータとして記憶する実パターン記憶部51と、ステレオカメラ2によって撮像されたキャリブレーションパターン4の画像を取り込む画像取込部52と、この画像取込部52によって取り込まれた画像より任意の四角形を形成するように撮像されたキャリブレーションパターン4の任意のマス目の交点座標を検出する交点座標検出部53とを備えている。なお、ステレオカメラ2でキャリブレーションパターン4を撮影する際には、基準マーク4Bが入るようにキャリブレーションパターン4を撮影するようにし、撮像されたキャリブレーションパターン4に必ず基準マーク4Bが含まれるものとする。
FIG. 18 shows a functional block diagram of the main part of the image processing apparatus 5. The image processing apparatus 5 is imaged by the
また、画像処理装置5は、交点座標検出部53によって検出された交点座標に基づいて、撮像されたキャリブレーションパターン4と実際のキャリブレーションパターン4との間のH行列を仮のH行列として算出する仮行列算出部54と、仮行列算出部54によって算出された仮のH行列に基づいて、撮像されたキャリブレーションパターン4中の各マス目の交点候補位置を算出し、この各マス目の交点候補位置のそれぞれについて実際に交点になっているか否かを確認し、この確認結果に基づいて各マス目の交点座標を推定する交点座標推定部55と、撮像されたキャリブレーションパターン4中の基準マーク4Bを検出する基準マーク検出部56とを備えている。
Further, the image processing device 5 calculates the H matrix between the captured
また、画像処理装置5は、基準マーク検出部56によって検出された基準マーク4Bの位置を座標基準とし、交点座標推定部55によって推定された各マス目の交点座標に基づいて、撮像されたキャリブレーションパターン4と実際のキャリブレーションパターン4との間のH行列の本行列を算出する本行列算出部57と、本行列算出部57によって算出された少なくとも3つのH行列の本行列からステレオカメラ2のキャリブレーションパラメータを算出するキャリブレーションパラメータ算出部58とを備えている。
Further, the image processing device 5 uses the position of the
また、画像処理装置5において、交点座標推定部55は、各マス目の交点候補位置のそれぞれについて実際に交点になっているか否かを判定する交点判定部55Aと、交点判定部55Aによって実際に交点になっていると判定された交点候補位置についてのみその交点座標の推定を行う交点推定部55Bとを備えている。交点判定部55Aは、各マス目の交点候補位置のそれぞれについて、その交点候補位置を中心とした小領域を抽出する小領域抽出部55A1と、小領域抽出部55A1によって抽出された小領域のそれぞれについて、当該小領域の画像データを2値化する2値化処理部55A2と、2値化処理部55A2によって2値化された小領域の画像データに基づいて、その小領域の抽出元の交点候補位置が実際に交点になっているか否かを判定する判定部55A3とを備えている。
In the image processing device 5, the intersection coordinate
本発明のカメラのキャリブレーション方法は、カメラの位置や向き、カメラが持つ画像中心やスケールなどのカメラの校正パラメータを算出するカメラのキャリブレーション方法として、ステレオカメラなど各種のカメラに適用することができ、処理の高速化、人手によるミスの排除、性能向上など様々な利点を期待できるる。また、ステレオカメラの量産化への対応、現場での簡便なキャリブレーションの実現が可能になる。 The camera calibration method of the present invention can be applied to various cameras such as a stereo camera as a camera calibration method for calculating camera calibration parameters such as the position and orientation of the camera, the image center and scale of the camera. It is possible to expect various advantages such as high-speed processing, elimination of manual mistakes, and performance improvement. In addition, it is possible to cope with mass production of stereo cameras and to realize simple calibration on site.
2…ステレオカメラ、4…キャリブレーションパターン、4A…平面パターン(チェックパターン)、4B…基準マーク、5…画像処理装置、51…実パターン記憶部、52…画像取込部、53…交点座標検出部、54…仮行列算出部、55…交点座標推定部、55A…交点判定部、55A1…小領域抽出部、55A2…2値化処理部、55A3…判定部、55B…交点推定部、56…基準マーク検出部、57…本行列算出部、58…キャリブレーションパラメータ算出部、BL(BL1,BL2)…画像ブロック、G1…左カメラの画像、G2…右カメラの画像、P1〜P9…交点。
2 ... Stereo camera, 4 ... Calibration pattern, 4A ... Planar pattern (check pattern), 4B ... Reference mark, 5 ... Image processing device, 51 ... Actual pattern storage unit, 52 ... Image capture unit, 53 ... Intersection coordinate detection 54: provisional
Claims (3)
前記基準マークが入るように前記カメラによって前記キャリブレーションパターンを撮像するパターン撮像ステップと、
このパターン撮像ステップによって撮像されたキャリブレーションパターンより任意の四角形を形成するようにそのキャリブレーションパターン中の任意のマス目の交点座標を検出する交点座標検出ステップと、
この交点座標検出ステップによって検出された交点座標に基づいて、前記パターン撮像ステップによって撮像されたキャリブレーションパターンと前記実際のキャリブレーションパターンとの間の射影変換行列を仮の射影変換行列として算出する仮行列算出ステップと、
この仮行列算出ステップによって算出された仮の射影変換行列に基づいて、前記パターン撮像ステップによって撮像されたキャリブレーションパターン中の各マス目の交点候補位置を算出し、この各マス目の交点候補位置のそれぞれについて実際に交点になっているか否かを確認し、この確認結果に基づいて各マス目の交点座標を推定する交点座標推定ステップと、
前記パターン撮像ステップによって撮像されたキャリブレーションパターン中の前記基準マークを検出する基準マーク検出ステップと、
この基準マーク検出ステップによって検出された基準マークの位置を座標基準とし、前記交点座標推定ステップによって推定された各マス目の交点座標に基づいて、前記パターン撮像ステップによって撮像されたキャリブレーションパターンと前記実際のキャリブレーションパターンとの間の射影変換行列の本行列を算出する本行列算出ステップと
を備えることを特徴とするカメラのキャリブレーション方法。 A calibration pattern having a grid-like plane pattern arranged so that the colors in the grids are alternately reversed and a reference mark provided at a predetermined position in the plane pattern is displayed by a camera from at least three directions. The main matrix of the projection transformation matrix between each captured calibration pattern and the actual calibration pattern is calculated for each individual, and the calibration parameters of the camera are calculated from the main matrix of the calculated projection transformation matrix. A camera calibration method to calculate,
A pattern imaging step of imaging the calibration pattern by the camera so that the reference mark enters;
An intersection coordinate detection step for detecting an intersection coordinate of an arbitrary square in the calibration pattern so as to form an arbitrary quadrilateral from the calibration pattern imaged by the pattern imaging step;
Based on the intersection coordinates detected by the intersection coordinate detection step, a temporary transformation matrix between the calibration pattern imaged by the pattern imaging step and the actual calibration pattern is calculated as a temporary projection transformation matrix. Matrix calculation step;
Based on the temporary projective transformation matrix calculated by the temporary matrix calculation step, the intersection candidate position of each square in the calibration pattern imaged by the pattern imaging step is calculated, and the intersection candidate position of each square An intersection coordinate estimation step for confirming whether or not each is actually an intersection, and estimating the intersection coordinates of each square based on the confirmation result;
A reference mark detection step of detecting the reference mark in the calibration pattern imaged by the pattern imaging step;
The position of the reference mark detected by the reference mark detection step is used as a coordinate reference, and the calibration pattern imaged by the pattern imaging step and the calibration pattern imaged by the pattern imaging step based on the intersection coordinates of each square estimated by the intersection coordinate estimation step And a matrix calculation step of calculating a matrix of a projection transformation matrix between the actual calibration pattern and a calibration pattern.
前記交点座標推定ステップは、
前記各マス目の交点候補位置のそれぞれについて実際に交点になっているか否かを判定する交点判定ステップと、
この交点判定ステップによって実際に交点になっていると判定された交点候補位置についてのみその交点座標の推定を行う交点推定ステップと
を備えることを特徴とするカメラのキャリブレーション方法。 The camera calibration method according to claim 1,
The intersection coordinate estimation step includes:
An intersection determination step for determining whether or not each intersection candidate position of each square is actually an intersection; and
A camera calibration method comprising: an intersection estimation step for estimating an intersection coordinate only for an intersection candidate position determined to be an actual intersection by the intersection determination step.
前記交点判定ステップは、
前記各マス目の交点候補位置のそれぞれについて、その交点候補位置を中心とした小領域を抽出する小領域抽出ステップと、
この小領域抽出ステップによって抽出された小領域のそれぞれについて、当該小領域の画像データを2値化する2値化処理ステップと、
この2値化処理ステップによって2値化された前記小領域の画像データに基づいて、その小領域の抽出元の交点候補位置が実際に交点になっているか否かを判定する判定ステップと
を備えることを特徴とするカメラのキャリブレーション方法。 The camera calibration method according to claim 2,
The intersection determination step includes
A small region extraction step for extracting a small region centered on the intersection candidate position for each intersection candidate position of each square;
For each of the small areas extracted by the small area extraction step, a binarization processing step for binarizing the image data of the small area;
A determination step of determining whether the intersection candidate position from which the small area is extracted is actually an intersection based on the image data of the small area binarized by the binarization processing step. A camera calibration method characterized by the above.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2010143490A JP5432835B2 (en) | 2010-06-24 | 2010-06-24 | How to calibrate the camera |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2010143490A JP5432835B2 (en) | 2010-06-24 | 2010-06-24 | How to calibrate the camera |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2012007980A JP2012007980A (en) | 2012-01-12 |
JP5432835B2 true JP5432835B2 (en) | 2014-03-05 |
Family
ID=45538700
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2010143490A Expired - Fee Related JP5432835B2 (en) | 2010-06-24 | 2010-06-24 | How to calibrate the camera |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5432835B2 (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111256591A (en) * | 2020-03-13 | 2020-06-09 | 易思维(杭州)科技有限公司 | External parameter calibration device and method for structured light sensor |
US10872432B2 (en) | 2018-01-05 | 2020-12-22 | Panasonic Intellectual Property Management Co., Ltd. | Disparity estimation device, disparity estimation method, and program |
Families Citing this family (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103217126B (en) * | 2013-04-24 | 2016-09-14 | 中国科学院电工研究所 | A kind of solar groove type condenser surface testing system and method |
KR102203687B1 (en) * | 2013-12-30 | 2021-01-15 | 엘지이노텍 주식회사 | Stereo camera apparatus and rectification method of the same |
CN106152947B (en) * | 2015-03-31 | 2019-11-29 | 北京京东尚科信息技术有限公司 | Measure equipment, the method and apparatus of dimension of object |
CN108074267B (en) | 2016-11-18 | 2023-08-11 | 松下知识产权经营株式会社 | Intersection point detection device and method, camera correction system and method, and recording medium |
CN106940893A (en) * | 2017-03-09 | 2017-07-11 | 昆山鹰之眼软件技术有限公司 | Automate scaling board and automation scaling method |
JP6852525B2 (en) * | 2017-04-05 | 2021-03-31 | 富士通株式会社 | Calibration equipment, calibration method, calibration program |
CN113375555A (en) * | 2018-07-02 | 2021-09-10 | 广西电网有限责任公司北海供电局 | Power line clamp measuring method and system based on mobile phone image |
KR102260121B1 (en) * | 2019-06-17 | 2021-06-02 | 남서울대학교 산학협력단 | A checkerboard for camera calibration, method and apparatus for automatic target recognition using the same |
CN112446895B (en) * | 2019-08-28 | 2024-07-09 | 深圳市光鉴科技有限公司 | Automatic extraction method, system, equipment and medium for checkerboard corner points |
CN114037761A (en) * | 2021-11-21 | 2022-02-11 | 国家电网有限公司 | Fast positioning method of intelligent robot feature identification |
-
2010
- 2010-06-24 JP JP2010143490A patent/JP5432835B2/en not_active Expired - Fee Related
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10872432B2 (en) | 2018-01-05 | 2020-12-22 | Panasonic Intellectual Property Management Co., Ltd. | Disparity estimation device, disparity estimation method, and program |
CN111256591A (en) * | 2020-03-13 | 2020-06-09 | 易思维(杭州)科技有限公司 | External parameter calibration device and method for structured light sensor |
Also Published As
Publication number | Publication date |
---|---|
JP2012007980A (en) | 2012-01-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5432835B2 (en) | How to calibrate the camera | |
JP5864950B2 (en) | Three-dimensional measuring apparatus, three-dimensional measuring method and program | |
JP6363863B2 (en) | Information processing apparatus and information processing method | |
WO2015019526A1 (en) | Image processing device and markers | |
KR20140089392A (en) | Method for calibrating camera measurement system | |
JP2008014940A (en) | Camera calibration method for camera measurement of planar subject and measuring device applying same | |
CN112686877A (en) | Binocular camera-based three-dimensional house damage model construction and measurement method and system | |
JP2014013147A5 (en) | ||
CN108429908B (en) | Camera module testing method, device, equipment and medium | |
KR20180105875A (en) | Camera calibration method using single image and apparatus therefor | |
WO2011118476A1 (en) | Three dimensional distance measuring device and method | |
CN113465573A (en) | Monocular distance measuring method and device and intelligent device | |
CA3233222A1 (en) | Method, apparatus and device for photogrammetry, and storage medium | |
JP5987549B2 (en) | System and method for measuring installation accuracy of construction members | |
JP2007212187A (en) | Stereo photogrammetry system, stereo photogrammetry method, and stereo photogrammetry program | |
JP5051493B2 (en) | 3D measurement marker and 3D measurement method using the same | |
JP2010133751A (en) | Shape measuring device and program | |
CN111131801B (en) | Projector correction system and method and projector | |
JP3696336B2 (en) | How to calibrate the camera | |
JP2013024773A (en) | Three-dimensional measuring method | |
CN112102387B (en) | Test method and test system based on depth estimation performance of depth camera | |
JP2005322128A (en) | Calibration method for stereo three-dimensional measurement and three-dimensional position calculating method | |
JP3696335B2 (en) | Method for associating each measurement point of multiple images | |
JP2004302756A (en) | Cad working drawing checking method and its device | |
TWI504859B (en) | Method for photographing and piecing together the images of an object |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20130321 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20131119 |
|
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: 20131203 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20131206 |
|
R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 Ref document number: 5432835 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
LAPS | Cancellation because of no payment of annual fees |