A Simple and Fast Technique for Camera Calibration ... - CiteSeerX

0 downloads 0 Views 109KB Size Report
ellipse image whose major axis passes through the optical center of the camera. For the sake of conciseness, in this paper we accept this result as the ground ...
A Simple and Fast Technique for Camera Calibration using Spheres as Test Objects Guruprasad Shivaram and Guna Seetharaman The Center for Advanced Computer Studies. Lafayette, LA 70504-4330, USA EMail: gps,[email protected]

Abstract We present a new technique for calibrating video cameras for intrinsic and extrinsic parameters. We use spheres as calibration objects. Our approach uses a new key result that the major axis of the ellipse image resulting from the perspective projection of sphere would pass through the optical center of the image [1][2]. In this paper we do not prove this result but simply use it to build the presented technique. The technique has been applied on large number of images and was found to give very good results. We propose to present the results in the nal paper.

1 Introduction This paper presents a new technique for calibrating a camera for intrinsic and extrinsic parameters using spheres. In [2] we showed that the perspective projection of a sphere results in an ellipse image whose major axis passes through the optical center of the camera. For the sake of conciseness, in this paper we accept this result as the ground truth and present a technique for estimating the extrinsic and intrinsic parameters. The presented technique can be used to extract the extrinsic parameters T~ ; R~ which represent the translation and rotation of the camera with respect to the world coordinate system, and the intrinsic parameters s; (x ; y ); f which represent the aspect ratio, location of the optical center and focal length of the camera, respectively. We propose to present the results and a comprehensive set of references in the nal paper.

2 Calibration For Intrinsic and Extrinsic Parameters We brie y introduce the key equations of our formulation in this section. We use two coordinate systems for our analysis. We call the coordinate system represented by the optical axes, x0 = (x0 ; y0 ; z 0 ), with the focal point at the origin, as the optical reference frame. The axes x = (x; y; z ) constitute the camera reference frame, where the (x; y) axes are the horizontal and vertical lines bisecting the image plane. The relation between the two coordinate systems is expressed as (x0 ; y0 ; z 0 ) = (s x ? x ; y ? y ; z ), where s = ssxy is the aspect ratio and (x ; y ) is the location of the optical center of the camera. Consider a sphere being imaged by perspective projection. Let the equation of the extracted ellipse image, found by least square t, be Ax2 +2Bxy + Cy2 +2Dx +2Ey + F = 0. Now, the equation of the ellipse in the optical reference frame is given by A0 x0 2 +2B 0 x0 y0 + C 0 y0 2 +2D0 x0 + 2E 0 y0 + F 0 = 0, where,

A0i Bi0 Ci0 Di0 Ei0 Fi0

= = = = = =

A i s2 Bi s Ci ?sxAi ? sy Bi + sDi ?xBi ? y Ci + Ei x2 Ai + 2xy Bi + y2 Ci ? 2x Di ? 2y Ei + Fi

The major axis of the ellipse passes through the optical center, which is point (0; 0) in the optical coordinate system [1][2]. Since the center of the ellipse, (x0c ; yc0 ), lies on the major axis of the ellipse, the slope of the major axis in the optical

coordinate system can be expressed as: 0 ?2sB q m = xyc0 = c s2 A ? C ? (s2 A ? C )2 + 4s2 B 2 The above equation can be manipulated and the q B ? Cm aspect ratio expressed as s = Bm2 ?Am . The location of the center of the ellipse in optical coordinate system is given by

x0c = xc ?s x ; yc0 = yc ? y

where xc ; yc are the centers of the ellipse, in the camera reference frame, whose value can be obtained from the best- t equation of the ellipse. Now, let us consider a set of ve spheres, arranged such that their centers are collinear and equally spaced in the 3D space. The images of the centers lie on a straight line on the image plane (Since the image of a straight line in 3D space, under perspective projection, is a straight line). Now, the cross-ratio of the centers of any four of the spheres is the same as the cross-ratio of the images of these centers, since cross-ratio is invariant under perspective projection. Let the slopes of the major axes of the ellipses in the optical coordinate system be mi . Then, it can be shown that the cross-ratio for the four spheres 1,2,3,4 in the optical coordinate system [2] can be expressed as:

Figure 1: The image of ve spheres under perspective projection. The arrangement has been used to nd the intrinsic parameters of the camera. The scene has been generated using OpenGL

xc

yc

s

f

Actual -96.0 64.0 0.8 256.0 Estimated -95.655 65.177 0.792 260.555

Table 1: The table makes a comparison of the actual values and the estimated values of the intrinsic paramters for the scene shown in Figure 1. ( m ? m )( m ? m ) 1 2 3 4 (1)(xc ; yc ); s; f are the position of the optical center,

(1; 2; 3; 4) = (m ? m )(m ? m ) aspect ratio and the focal length of the camera  c 1 ? 3 c ?2  c4 ? cy4 ?y  y y y y3 y2 y1 ? ? respectively. All values except the aspect ratio =  ccxy11??xy ccxy23 ??xy  ccxy23 ??yx ccxy44 ??xy  are in pixel units. ? ? cx1?x

cx3 ?x

cx2 ?x

cx4 ?x

Simpli cation of the above equation results in the second order equation in x and y , of the form

obtain four values of aspect-ratio using 2 and 2, one corresponding to each value of x and y . But experiments on a large number of images have (cy1 cx2 ? cx1 cy2 ? x (cy1 ? cy2 ) ? y (cx2 ? cx1 )) shown that given a single value of x and y , the (cy3 cx4 ? cx3 cy4 ? x (cy3 ? cy4 ) ? x (cy3 ? cy4 )) aspect ratio, computed from 2, for all the spheres in the scene, converges only for one of the four

((cy1 cx3 ? cx1 cy3 ? x (cy1 ? cy3 ) ?x(cy1 ? cy3 ))(cy2 cx4 ? cx2 cy4 ? x(cy2 ? cy4 ) values of x; y . This value of aspect ratio and ?x(cy2 ? cy4 ))) = 0 (2) (x ; y ) is the true value. Thus the above technique can be used to obtain a unique value of Another instance of the above equation can be intrinsic parameters. We emphasize that the valobtained by considering the spheres 2,3,4,5. Thus ues of (cxi ; cyi ) can be computed from the best- t we obtain two second order equations in (x ; y ) equation of the extracted ellipse and the value of which can be solved to produce four sets of val- can be found out from the spatial arrangement ues for x; y . One would expect that one would of the spheres. Consequently the only unknowns

Actual Estimated

Figure 2: The arrangement for nding the extrinsic parameters. The scene has been generated using OpenGL in 2 are x and y . s

2 02 2 f = 21 4xKc 2K(11 (1? +K 2K) 2 ) ? L2MnA 2 1 MjA , where L In the above equation, K1 = LLMnA MjA and LMnA denote the lengths of the major and minor axis of the ellipse respectively. The values of xc ; K1 ; LMnA can be found from the best- t equation of the ellipse image and K2 = cc21 = xycc . 0

0

3 Estimation of Extrinsic Parameters Once the intrinsic parameters have been found the extrinsic parameter can be estimated. We use the above property of spheres along with the vanishing points properties of a square to nd the extrinsic parameters of the camera. The technique uses four identical spheres, S1 ; S2 ; S3 ; S4 , arranged such that their centers constitute the four corners of an imaginary square. It is assumed that the length of the sides of the square is known. Given any sphere S of a known radius r with center C [2], its direction cosines (c1 ; c2 ; c3 ) can be

Extrinsic Parameters 0:612 0:591 0:524 ?2:415 0:612 ?0:774 ?0:158 0:306 0:5 0:224 ?0:837 3:365 0 0 0 1 0:618 0:588 0:505 ?2:437 0:625 ?0:778 ?0:145 0:326 0:475 0:217 ?0:850 3:339 0 0 0 1

Table 2: The table shows a comparison of the actual and the estimated values of the extrisic parameters for the scene shown in gure 2. The rst three columns of each matrix constitutes the rotation of the camera with respect to the world reference frame. The last column is the position of origin of the camera with respect to the world reference frame. found using the equations K22 ( 2f )2 ? ( 2f )2 2 1+ c21 = K2 K1 LMnA 2f 2LMnA 1 + ( K1 LMnA ) 2f 2 2f 2 1 1+K22 ( K1 LMnA ) ? ( LMnA ) 2 c2 = 1 + ( K1 L2fMnA )2

(3)

The image of C is given by ( cc31 f; cc23 f; f ). Thus one would be able to nd the image of the corners of the imaginary square from the ellipse images of the four spheres. Kanatani [4] has shown that given the image of a square, one could obtain the rotation and the translation matrices. Thus using the image of the four spheres, one can obtain the extrinsic parameters.

4 Applications and Results The above techniques have been tested on a large number of simulated scenes generated using the graphics package OpenGL, and on several real world images with di erent camera settings with very good results. It has to be pointed that the sphere, being very simple object, is very easy to manufacture. Also, the technique, being very simple, is very easy to fully automate and hence is easy to use for calibrating the cameras on robots. Tables 1 and 2 shows the results obtained by applying the techniques on a scene generated using

OpenGL.

The results can be compared with the presented, actual values and can be seen to be very accurate.

References [1] Guruprasad Shivaram and Guna Seetharaman, \Finding the Optical Center of Cameras Using Spheres", Submitted to IMDSP98, 1998, [2] Guruprasad Shivaram and Guna Seetharaman, \Calibration of Cameras using Spheres", CACS Technical Report, TR 98-1-1, January, 1998 [3] Guna Seetharaman and Hong Bao and Guruprasad Shivaram, \Calibrartion of Camera Parameters Using Vanishing Points", Journal of The Franklin Institute, 340B March, 1995 [4] Kanatani, \Computational Projective Geometry", CVGIP, November, 1991,Vol 54, No 3, pp. 333-348 [5] Haralick and Shapiro, \Computer and Robot Vision, Vol I" Addison-Wesley Publishing Company, 1992. [6] Michael A. Penna, "Camera Calibration: A Quick and Easy Way to Determine the Scale Factor", IEEE Transactions on Pattern Analysis and Machine Intelligence Vol. 13, No. 12, pp. 1240-1245, Dec, 1991