An Introduction to Projective Geometry for Computer Vision 1
Total Page:16
File Type:pdf, Size:1020Kb
An Intro duction to Pro jective Geometry for computer vision Stan Birch eld 1 Intro duction We are all familiar with Euclidean geometry and with the fact that it describ es our three- dimensional world so well. In Euclidean geometry, the sides of ob jects have lengths, inter- secting lines determine angles b etween them, and two lines are said to b e parallel if they lie in the same plane and never meet. Moreover, these prop erties do not change when the Euclidean transformations translation and rotation are applied. Since Euclidean geome- try describ es our world so well, it is at rst tempting to think that it is the only typ e of geometry. Indeed, the word geometry means \measurement of the earth." However, when we consider the imaging pro cess of a camera, it b ecomes clear that Euclidean geometry is insucient: Lengths and angles are no longer preserved, and parallel lines mayintersect. Euclidean geometry is actually a subset of what is known as projective geometry.In fact, there are two geometries b etween them: similarity and ane.To see the relationships between these di erent geometries, consult Figure 1. Pro jective geometry mo dels well the imaging pro cess of a camera b ecause it allowsamuch larger class of transformations than just translations and rotations, a class which includes p ersp ective pro jections. Of course, the drawback is that fewer measures are preserved | certainly not lengths, angles, or parallelism. Pro jective transformations preservetyp e that is, p oints remain p oints and lines remain lines, incidence that is, whether a p oint lies on a line, and a measure known as the cross ratio, which will b e describ ed in section 2.4. Pro jective geometry exists in anynumb er of dimensions, just like Euclidean geometry. 1 For example the pro jective line, whichwe denote by P , is analogous to a one-dimensional 2 Euclidean world; the pro jective plane, P , corresp onds to the Euclidean plane; and pro- 3 jective space, P , is related to three-dimensional Euclidean space. The imaging pro cess is 3 2 a pro jection from P to P , from three-dimensional space to the two-dimensional image plane. Because it is easier to grasp the ma jor concepts in a lower-dimensional space, we 2 will sp end the bulk of our e ort, indeed all of section 2, studying P , the pro jective plane. That section presents many concepts which are useful in understanding the image plane and 3 whichhave analogous concepts in P . The nal section then brie y discusses the relevance of pro jective geometry to computer vision, including discussions of the image formation equations and the Essential and Fundamental matrices. 1 March 12, A.D. 1998 Euclidean similarity ane pro jective Transformations rotation X X X X translation X X X X X X X uniform scaling nonuniform scaling X X X X shear p ersp ective pro jection X X comp osition of pro jections Invariants length X angle X X ratio of lengths X X X X X parallelism incidence X X X X cross ratio X X X X Figure 1: The four di erent geometries, the transformations allowed in each, and the mea- sures that remain invariant under those transformations. The purp ose of this monograph will b e to provide a readable intro duction to the eld of pro jective geometry and a handy reference for some of the more imp ortant equations. The rst-time reader may nd some of the examples and derivations excessively detailed, but this thoroughness should prove helpful for reading the more advanced texts, where the details are often omitted. For further reading, I suggest the excellent book byFaugeras [2] and app endix by Mundy and Zisserman [5]. 2 The Pro jective Plane 2.1 Four mo dels There are four ways of thinking ab out the pro jective plane [3]. The most imp ortant of these for our purp oses is homogeneous co ordinates, a concept which should b e familiar to anyone who has taken an intro ductory course in rob otics or graphics. Starting with homogeneous co ordinates, and pro ceeding to each of the other three mo dels, we will attempt to gain intuition on the nature of the pro jective plane, whose concise de nition will then emerge from the fourth mo del. 2 2.1.1 Homogeneous co ordinates Supp ose wehaveapointx; y in the Euclidean plane. To represent this same p ointin 1 the pro jective plane, we simply add a third co ordinate of 1 at the end: x; y ; 1. Overall scaling is unimp ortant, so the p ointx; y ; 1 is the same as the p oint x; y ; , for any nonzero . In other words, X; Y ; W = X ; Y ; W for any 6= 0 Thus the p oint0; 0; 0 is disallowed. Because scaling is unimp ortant, the co ordinates X; Y ; W are called the homogeneous coordinates of the p oint. In our discussion, we will use capital letters to denote homogeneous co ordinates of p oints, and we will use the co ordinate notation X; Y ; W interchangeably with the vector notation T [X; Y ; W ] . To represent a line in the pro jective plane, we b egin with a standard Euclidean formula for a line ax + by + c =0; and use the fact that the equation is una ected by scaling to arrive at the following: aX + bY + cW = 0 T T u p = p u = 0; 1 T T where u =[a; b; c] is the line and p =[X; Y ; W ] is a p oint on the line. Thus we see that p oints and lines have the same representation in the pro jective plane. The parameters of a line are easily interpreted: a=b is the slop e, c=a is the x-intercept, and c=b is the y -intercept. To transform a p oint in the pro jective plane backinto Euclidean co ordinates, we sim- ply divide by the third co ordinate: x; y = X=W;Y=W. Immediately we see that the pro jective plane contains more p oints than the Euclidean plane, that is, p oints whose third co ordinate is zero. These p oints are called ideal points,orpoints at in nity. There is a sep- arate ideal p oint asso ciated with each direction in the plane; for example, the p oints 1; 0; 0 and 0; 1; 0 are asso ciated with the horizontal and vertical directions, resp ectively. Ideal 2 p oints are considered just likeany other p ointinP and are given no sp ecial treatment. All the ideal p oints lie on a line, called the ideal line, or the line at in nity, which, once again, is treated just the same as any other line. The ideal line is represented as 0; 0; 1. Supp ose wewant to nd the intersection of two lines. By elementary algebra, the two lines u =a ;b ;c and u =a ;b ;c are found to intersect at the p oint p = 1 1 1 1 2 2 2 2 b c b c ;a c a c ;a b a b . This formula is more easily rememb ered as the cross 1 2 2 1 2 1 1 2 1 2 2 1 pro duct: p = u u . If the two lines are parallel, i.e., a =b = a =b , the p ointof 1 2 1 1 2 2 intersection is simply b c b c ;a c a c ; 0, which is the ideal p oint asso ciated with 1 2 2 1 2 1 1 2 the direction whose slop e is a =b . Similarly, given two p oints p and p , the equation of 1 1 1 2 the line passing through them is given by u = p p . 1 2 1 In general, a p ointinann-dimensional Euclidean space is represented as a p ointinann + 1-dimensional pro jective space. 3 p oint p =X; Y ; W line u =a; b; c T T incidence p u =0 incidence p u =0 collinearity j p p p j =0 concurrence j u u u j =0 1 2 3 1 2 3 join of 2 u = p p intersection p = u u 1 2 1 2 p oints of 2 lines ideal p oints X; Y ; 0 ideal line 0; 0;c a b Figure 2: Summary of homogeneous co ordinates: a p oints, and b lines. Now supp ose wewant to determine whether three p oints p , p , and p lie on the same 1 2 3 line. The line joining the rst two p oints is p p . The third p oint then lies on the line 1 2 T if p p p = 0, or, more succinctly, if the determinant of the 3 3 matrix containing 1 2 3 the p oints is zero: det [ p p p ]= 0: 1 2 3 Similarly, three lines u , u , and u intersect at the same p oint i.e., they are concurrent, 1 2 3 if the following equation holds: det [ u u u ]= 0: 1 2 3 The concepts of homogeneous co ordinates are summarized in Figure 2. For further reading, consult the notes by Guibas [3]. Example 1. Given two lines u =4; 2; 2 and u =6; 5; 1, the p ointofintersection is 1 2 given by: i j k 4 2 2 =2 10i + 12 4j + 20 12k =8; 8; 8 = 1; 1; 1: 6 5 1 Example 2.