The Projective Equation of a Circle and Its Application in Camera Calibration Yinqiang Zheng and Yuncai Liu Image Processing and Pattern Recognition Institute, Shanghai Jiao Tong University, P.R.China Email:
[email protected] Abstract In this article, we present the projective equation of a circle in a perspective view, which naturally encodes such important geometric entities as the projected circle center, the vanishing point of the normal direction of the circle’s supporting plane and the degenerate conic envelope spanned by the image of circular points (ICPs). Based on this projective equation, we propose an easy technique to calibrate the focal length and the extrinsic parameters of a camera merely by using one perspective view of two arbitrary coplanar circles. Unlike existing optimization algorithm, our method offers a closed form solution through simple matrix manipulation. Experimental results verify the correctness and efficiency of our proposed technique.
1. Introduction A variety of circle based calibration patterns, including one circle with a bundle of lines passing through the circle center, two concentric circles, two parallel circles and N ≥ 3 coplanar circles, have been successfully used in camera calibration [1,2]. In spite of the widespread application of circles, we do not yet have a unified equation to represent the projection of a circle in a perspective view. Inspired by the projective equation of a sphere [3], which has dramatically contributed to the application of spherical features in camera calibration [4], we present the projective equation of a circle in this work. We find that such important geometric entities as the projected circle center and the vanishing point of the normal direction of the circle’s supporting plane are encoded in this projective equation. We have already known that the ICPs are quite essential in camera calibration [2,5]. It is exciting to see that the degenerate conic envelope spanned by the ICPs is included in this projective equation as well. Existing circle based calibration algorithms can benefit from this equation by either simplifying their procedures or improving their intelligibility. In this paper, we use this projective equation to determine the focal length and the extrinsic parameters of a camera merely by using one perspective view of two arbitrary coplanar circles. In many real scenarios, the pose
978-1-4244-2175-6/08/$25.00 ©2008 IEEE
of a camera is often changed and its focal length is usually adjusted accordingly, while the remaining intrinsic parameters, including the aspect ratio, the skew factor and the principle point, keep almost unchanged [6]. Therefore, it is valuable to develop an easy technique to fully determine the extrinsic parameters in addition to the focal length of a camera, eliminating the inefficiency to calibrate all the intrinsic parameters repeatedly by using at least three images. Although Chen et al. [1] tackled this problem, they merely proposed a method on the basis of iterative optimization, whose convergence tightly depends on proper initialization. Unfortunately, they did not show how to initialize their algorithm. In contrast, our method offers a closed form solution for this problem, whose results can be directly used in real vision applications with moderate noise levels or used to initialize Chen’s algorithm for higher accuracy and speed. Extensive experiments demonstrate the correctness and efficiency of our proposed method.
2. The projective equation of a circle in one perspective view As shown in Fig.1, we assume the circle
Q lies on the
plane of z = 0 in the world coordinate system and the circle center coincides with the origin. The rigid motion between the camera and the world coordinate system is denoted by R t . Therefore, the planar homography
[
]
matrix H between the image plane and the circle’s supporting plane satisfies: H = K [ r1 r2 t ] , where
K is the intrinsic camera parameter matrix, and rn , n = 1,2 , is the n-th column of R . Obviously, the dual of the circle can be expressed in matrix form *
−1
as: Q = Q circle radius.
= diag{1,1,−1 / r 2 } , where r denotes the *
According to [5], the dual circle image C satisfies:
kC * = HQ * H T = K [r1
r2
t ]diag {1 1 − 1 / r 2 }[r1
= KK T − ( Kr3 )( Kr3 ) T −
r2
t] K T
1 ( Kt )( Kt ) T , 2 r
(1)
T
where k is an unknown scale factor and
r3 is the third
Zw
column of R .
Q1 Q2 O X t1 w(1) t O 2 2 l C1 C2
Zw
π
Q
Y
L
Z
Ow
Xw Yw
Y
Z
O
X
C
Fig.2 The projection of two coplanar circles
Y X
O
3. Camera calibration
Fig.1. Basic projective model of a planar circle Equation (1) is referred to as ‘the projective equation of a circle’. Obviously, it naturally encodes the intrinsic camera parameter matrix K and the circle pose parameters (i.e. r3 and t ), promising its usefulness in both intrinsic and extrinsic camera calibration. Furthermore, according to [5], Kr3 denotes the vanishing point of the normal
direction
of
the
supporting
plane
and
( Kt ) / r denotes the homogeneous coordinates of the projected circle center, both of which are encoded in the projective equation.
2.1. The degenerate conic envelope spanned by the ICPs The ICPs are very important in computer vision. In the following, we shall show that the ICPs are implicitly encoded in the projective equation. Let
C *∞ denote the degenerate conic envelope spanned *
by the two circular points, thus C ∞
= diag{1,1,0} . Then,
the degenerate conic envelop spanned by the ICPs,
C ∞'* here, can be computed by [5]: C ∞'* ≡ HC ∞* H T
denoted by
= K [r1
= KK
T
r2 t ]diag{1,1,0}[r1 r2 T 3 3
t] K T
T
(2)
'* ∞ is
incorporated in the projective
− Kr r K .
We can see that
C
T
equation as well. In addition, if the ICPs ( i, j ) are denoted by the normalized homogeneous coordinate, i.e. the third element equals to one, the degenerate conic
C∞'* can also be calculated by C∞'* = (1 − r332 )(ij T + ji T ) / 2 , where r33 is the third element of r3 .
envelope
(3)
Now we utilize this projective equation to readily determine the focal length and extrinsic parameters of a zoom length camera merely using one image of two arbitrary coplanar circles (see Fig.2). We assume the aspect ratio, principle point and skew factor have already been calibrated by using three or more images. Specifically, the intrinsic camera parameter matrix K = Adiag{ f , f ,1} , where A is known and
f is the unknown camera focal length [5].
3.1. Simultaneously identifying the ICPs and estimating the focal length f . Generally, the two circle images C1 and C 2 have two pairs of points in common, one pair of which is the ICPs [2]. Since the ICPs lie on the image of absolute conic (IAC), whose equation is ω = K K = A diag{1 / following equations hold −T
−1
−T
f 2 ,1 / f 2 ,1} A−1 , the
iT ωi = 0 , and j T ωj = 0 ,
(4)
2
f . Since the focal length f is positive, i.e. f > 0 , we
both of which are linear on
can identify the ICPs among the two point-pairs and determine the focal length f simultaneously by solving eq.(4).
3.2. Determining the rotation matrix R As shown in Fig.2, we define a specific world coordinate system ow − xw yw z w , whose origin o w coincides with the circle center O1 of the left circle Q1 . Its z - axis coincides with the normal direction of the supporting plane and its x - axis is consistent with the symmetric axis of the two circles O1O2 , denoted by L in
Fig.2. The extrinsic parameter is denoted by where R
= [r1
r2
[R t ] ,
r3 ]. To eliminate uncertainty about
the direction of the world coordinate system, we assume (1 0 0) ⋅ r1 ≥ 0 , and (0 0 1) ⋅ r3 ≥ 0 . (5) In such coordinate configuration,
'*
where R1 and R2 denote the circle radii, and C∞ , representing the degenerate conic envelope spanned by the ICPs, can be calculated from eq. (3).
p2
l
Kr3 represents the
homogeneous vanishing point of the normal direction of the supporting plane, and Kr1 denotes the homogeneous
i
vanishing point of the symmetric axis L . After the ICPs ( i, j ) are uniquely identified, we can determine the vanishing line
l∞ by l∞ = i × j . Then, the
vanishing point Kr3 can be estimated by the pole-polar constraints [5], i.e.
C1
Kr3 ∝ ω *l∞ , where ω * = KK T is
the dual image of the absolute conic (DIAC). Thus, r3 can be estimated by
r3 = ± K −1ω *l ∞ / K −1ω *l∞ , Since the vanishing point
(6)
Kr1 is the intersection
l∞ and the image of the symmetric axis l (see Fig.3), we should first identify l . Let p1 and p2 be the projected circle centers of C1 and C 2 , respectively. According to the pole-polar between the vanishing line
constraint between the projected circle center and the vanishing line with respect to the dual circle image [5], we get:
p1 = Kt1 ∝ C1*l∞ , and p2 = Kt 2 ∝ C 2*l∞ , (7) where t1 and t2 are the coordinates of the two circle centers O1 and O2 in the camera coordinate system, respectively. Thus, the image of the symmetric axis l satisfies: l = p1 × p2 . Then, we get Kr1 ∝ l × l∞ , which gives
r1 = ± K −1 (l × l∞ ) / K −1 (l × l∞ ) ,
(8)
By imposing the constraints from eq. (5) on eq. (6) and (8), respectively, the sign of r3 and r1 can be uniquely determined. Finally, the rotation matrix can be calculated by R = [ r1 r3 × r1 r3 ] .
3.3. Determining the translation vector t According to eq. (1), we get two similar equations:
⎧⎪k1C1* = C ∞'* − ( Kt1 / R1 )( Kt1 / R1 ) T , ⎨ ⎪⎩k 2 C 2* = C ∞'* − ( Kt 2 / R2 )( Kt 2 / R2 ) T
(9)
p1 j l q C2
Fig.3 Two perspective ellipses on the image plane
k1 is the generalized eigen-value '* * '* * of (C∞ , C1 ) so that the rank of C∞ − k1C1 equals to one. Likewise, the parameter k2 can be determined. Obviously,
Subsequently, eq. (9) can be rewritten as
⎧⎪(t1 / R 1 )(t1 / R 1 ) T = K −1 (C∞'* − k1C1* ) K −T , (10) ⎨ ⎪⎩(t 2 / R 2 )(t 2 / R 2 ) T = K −1 (C ∞'* − k 2 C 2* ) K −T from which t1 / R1 and t 2 / R2 can be readily estimated by matrix decomposition or a least square method. Note that we can not fully determine the translation t unless metric information about the two circles is known.
4. Experimental results 4.1. Synthetic data The simulated camera has the following properties: the image resolution is 1280*960, and the focal length equals to 10 mm. We generate two separate circles by computer. The world coordinate system, as defined in section 3.2, relates to the camera coordinate system by a rigid body motion, where the rotation axis is ψ 1
= 3 / 3(1,1,1)T ,
the rotation angle θ1 = π / 10 and the translation vector t1=(20,10,1800)T (unit in millimeters). The two circles, both with a radius of 200 mm, are 420 mm far away. In this experiment, we test the performance of our algorithm under varying noise levels. Gaussian noise with 0 mean and σ standard deviation is added to the projected circles. The estimated parameters are then compared with the ground truth. We measure the relative error of f , t1 and t 2 , and the absolute error of r1 , r2 and r3 , which is defined by their respective deviation angle (in degrees) from their corresponding ground truth. We vary the noise level from 0.2 pixels to 2 pixels. For each noise
level, we perform 100 independent trails and show the average results. Fig.4 illustrates the results. 5
application of our proposed method to eliminate perspective distortion.
4.5 t1 t2 f
4.5
r1 r2 r3
4
4
Absolute errors (degrees)
3.5
Relative errors (%)
3.5 3 2.5 2 1.5
3 2.5 2 1.5
1 1
0.5 0 0.2
0.4
0.6
0.8
1 1.2 1.4 Noise levels δ (pixels)
1.6
1.8
2
0.5 0.2
0.4
(a)
0.6
0.8
1 1.2 1.4 Noise levels δ (pixels)
1.6
1.8
2
(b)
Fig.4. Performance vs. the noise levels. (a) Relative errors of f , t1 and t 2 . (b) Absolute errors of r1 , r2
Fig. 6. Real application. (left) Original image. (right) Image without perspective distortion.
and r3 .
5. Conclusions
Fig.5. Calibration pattern. (a) Two separate circles on the checker pattern. (b) The extracted corner points (red) and perspective ellipses (green).
In this article, we originally present the projective equation of a circle and the closed form representation of the degenerate conic envelope spanned by the ICPs. Based on this projective equation, we propose a closed form solution for camera calibration using one perspective view of two arbitrary coplanar circles. Compared with the iterative optimization technique, our method is computationally efficient. In the future, we shall extend the application of this projective equation.
4.2. Real images
6. References
The images are captured using a SCOR-14SOM camera with 1280*960 image resolution. Two separate circles, both with a radius of 45 mm, are attached on a checker pattern and used as calibration pattern (see Fig.5(a)). The distance between the two circle centers is 115mm. We first calibrate the camera by Zhang’s method [7] and estimate the extrinsic parameters by computing the homography matrix from the projected corner points (see Fig.5 (b)), which are used as reference. Then, we estimate the focal length and the extrinsic parameters from our proposed method and those from Chen’s method [1] when it is randomly initialized (Chen). We also initialize Chen’s method by our estimated results to show the improvement when it is properly initialized (Chen and Ours). Table 1 shows the comparative results. We can see that our results are acceptable in terms of accuracy. When Chen’s method is initialized by our estimated results, its performance can be further improved. Fig. 6 illustrates an
[1] Q. Chen, H. Wu and T. Wada, Camera Calibration with Two Arbitrary Coplanar Circles, Proc. ECCV, pp. 521-532, 2004. [2] P. Gurdjos, P. Sturm and Y.H. Wu, Euclidean Structure from N ≥ 2 Parallel Circles: Theory and Algorithms, Proc. ECCV, part I, pp. 238-252, 2006. [3] M. Agrawal and L.S. Davis, Camera Calibration Using Spheres: A Semi-Definite Programming Approach, Proc. CVPR, pp. 782-789, 2003. [4] X. Ying and H. Zha, “Geometric Interpretations of the Relation between the Image of the Absolute Conic and Sphere Images”, Trans. on PAMI, 28(12):2031-2036, 2006. [5] R.Hartley and A. Zisserman, Multiple View Geometry in Computer Vision, Cambridge Univ. Press, 2003. [6] M.X. Li and J.M. Lavest, Some Aspects of Zoom Lens Camera Calibration, Trans. on PAMI, 18(11):1105-1110, 1996. [7] Z. Zhang, A Flexible New Technique for Camera Calibration, Trans. on PAMI, 22(11): 1330-1334, 2000.
(a)
(b)
Table 1 Comparison of the estimated results from different methods 24.691
Err. (%) -
-27.801
-29.484
Our method
23.945
3.001
-27.617
-29.329
Chen
23.456
5.027
-25.314
-30.129
1637.247
4.608
-0.204
0.471
0.858
4.315
Chen and Ours
24.245
1.806
-27.931
-29.804
1706.421
0.577
-0.156
0.477
0.865
3.460
Approach
f
Zhang(ground truth)
1716.319
Err. (%) -
-0.157
0.423
0.892
Err. (degree) -
1661.124
3.215
-0.142
0.339
0.930
5.354
t1
r3