Pattern Recognition, Vol. 22, No. 3, pp. 225 ~ 230, 1989. Printed in Great Britain. 0031 3203/89 $3.00 + .00 Pergamon Press pie Pattern Recognition Society DETERMINING CAMERA PARAMETERS FROM THE PERSPECTIVE PROJECTION OF A RECTANGLE ROBERT M. HARALICK Intelligent Systems Laboratory, Department of Electrical Engineering, FT-10, University of Washington, Seattle, WA 98195, U.S.A. (Received 11 February 1988; receivedfor publication 14 June 1988) Abstract--In this note we show how to use the 2D perspective projection of a rectangle of unknown size and position in 3D space to determine the camera look angle parameters relative to the plans of the rectangle. All equations are simple. In addition, if the size of the rectangle is known, it is possible to compute the exact 3D coordinates of the rectangle. Perspective projection camera calibration Machine vision Computer vision Scene analysis l. INTRODUCTION Determination of surface orientation is one of the important tasks of a computer vision system. In this note we show that there is sufficient information in the 2D perspective projection of a rectangle of unknown size in 3D space to determine the camera look angle parameters. This in essence gives the relationship of surface normal of rectangle to camera viewing direction. We also show that if the size of the rectangle is given, then its exact 3D coordinates can easily be computed. In photogrammetry it is widely known that given the coordinates of three 3D points and the corres- ponding positions of their perspective projection, then it is possible to compute the position of the camera as well as its look direction. A complete set of such relationships for a triangle of 3D points is given in Fischler and Bolles.12) Certainly, the corresponding computation is possible for four points. However, if it is only known that the four points are in a rectangular configuration in a plane with unknown size for length and width of rectangle, then it is not immediately clear that the look angle is computable. The existence of the relationships derived in this note undoubtedly play a strong role in why people are able to accurately perceive the surface orientation of rectangular planar surfaces from man made objects. The algebra used in the derivation is not particu- larly noteworthy. However, the resulting formulas are simple, of general use, and interesting since they seem not to appear in any known or convenient place in the literature. 2. THE PERSPECTIVE PROJECTION We assume that the camera lens is the origin and that the lens views down the y axis. The image plane is a known distance f in front of the lens and is orthogonal to the optical lens axis. The abscissa axis of the image plane is parallel to the x axis and the ordinate axis of the image plane is parallel to the z axis. To permit the camera to be viewing into the 3D world in an arbitrary direction, we rotate the coordinate system so that in the rotated coordinate system the optic axis of the lens is the rotated y axis, the abscissa axis of the image plane is the rotated x axis and the ordinate axis of the image is the rotated z axis. Thus, we first counter clockwise rotate around the z axis by the pan angle 0, then counter clockwise rotate around the x axis by the tilt angle qb, and finally counter clockwise rotate about the y axis by the swing angle ~. This convention as well as some of the other relationships we use here can be found in Haralick ~1) and for reference purposes is shown in Fig. 1. 0 y J II Fig. 1. Illustration of the convention for positive or counter- clockwise rotation of axes. 225