<<

Projective - 2D

Acknowledgements Marc Pollefeys: for allowing the use of his excellent slides on this topic http://www.cs.unc.edu/~marc/mvg/ Richard Hartley and Andrew Zisserman, "Multiple View Geometry in Computer Vision"

Homogeneous coordinates

Homogeneous representation of lines ax + by + c = 0 ()a,b,c T (ka)x + (kb)y + kc = 0,k  0 ()()a,b,c T ~ k a,b,c T equivalence class of vectors, any vector is representative Set of all equivalence classes in R3(0,0,0)T forms P2 Homogeneous representation of points T T x = ()x, y on l = ()a,b,c if and only if ax + by + c = 0 ()()()x,y,1 a,b,c T = x,y,1 l = 0 ()()x, y,1 T ~ k x, y,1 T ,k  0 The point x lies on the l if and only if xTl=lTx=0 T ()x1, x2 , x3 but only 2DOF T Inhomogeneous coordinates ()x, y

Spring 2006 2D 2

1 Points from lines and vice-versa

Intersections of lines

The intersection of two lines l and l' is x = ll' Line joining two points The line through two points x and x' is l = x x'

Example

y =1

x =1 Spring 2006 Projective Geometry 2D 3

Ideal points and the line at

Intersections of lines

T T T l = ()a,b,c and l'= ()a,b,c' ll'= ()b,a,0

Example

x =1 x = 2

T Ideal points ()x1, x2 ,0 Note that this set lies on a single line, T l = ()0,0,1

2 2 Note that in P2 there is no distinction P = R  l between ideal points and others

Spring 2006 Projective Geometry 2D 4

2 Summary

The set of ideal points lies on the line at infinity,

intersects the line at infinity in the ideal point

A line parallel to l also intersects in the same ideal point, irrespective of the value of c’.

In inhomogeneous notation, is a vector to the line. It is orthogonal to (a, b) -- the line normal. Thus it represents the line direction. As the line’s direction varies, the ideal point varies over . --> line at infinity can be thought of as the set of directions of lines in the .

Spring 2006 Projective Geometry 2D 5

A model for the

Points represented by rays through origin Lines represented by planes through origin

x1x2 plane represents line at infinity

exactly one line through two points exaclty one point at intersection of two lines Spring 2006 Projective Geometry 2D 6

3

x l xTl = 0 lT x = 0 x = ll' l = x x'

Duality principle: To any theorem of 2-dimensional projective geometry there corresponds a dual theorem, which may be derived by interchanging the role of points and lines in the original theorem

Spring 2006 Projective Geometry 2D 7

Conics

Curve described by 2nd-degree equation in the plane

ax2 + bxy + cy 2 + dx + ey + f = 0

x x or homogenized x  1 , y  2 x3 x3 2 2 2 ax1 + bx1x2 + cx2 + dx1x3 + ex2 x3 + fx3 = 0

or in form  a b / 2 d / 2 xT C x 0 with C b / 2 c e / 2 = =   d / 2 e / 2 f 

5DOF: {a :b : c : d : e : f }

Spring 2006 Projective Geometry 2D 8

4 Conics …

http://ccins.camosun.bc.ca/~jbritton/jbconics.htm

Spring 2006 Projective Geometry 2D 9

Five points define a conic

For each point the conic passes through

2 2 axi + bxi yi + cyi + dxi + eyi + f = 0 or 2 2 T ()xi , xi yi , yi , xi , yi , f c = 0 c = ()a,b,c,d,e, f

stacking constraints yields

2 2 x1 x1 y1 y1 x1 y1 1  2 2  x x y y x y 1  2 2 2 2 2 2  2 2 x3 x3 y3 y3 x3 y3 1c = 0  2 2  x4 x4 y4 y4 x4 y4 1  2 2  x5 x5 y5 y5 x5 y5 1

Spring 2006 Projective Geometry 2D 10

5 Tangent lines to conics

The line l tangent to C at point x on C is given by l=Cx

l x C

Spring 2006 Projective Geometry 2D 11

Dual conics

A line tangent to the conic C satisfies lT C* l = 0

In general (C full ): C* = C1 C* : Adjoint matrix of C. Dual conics = line conics = conic envelopes

Spring 2006 Projective Geometry 2D 12

6 Degenerate conics

A conic is degenerate if matrix C is not of full rank m e.g. two lines (rank 2) l C = lmT + mlT

e.g. repeated line (rank 1)

T C = ll l

Degenerate line conics: 2 points (rank 2), double point (rank1)

* Note that for degenerate conics ()C*  C

Spring 2006 Projective Geometry 2D 13

Projective transformations

Definition: A projectivity is an invertible mapping h from P2 to itself

such that three points x1,x2,x3 lie on the same line if and only if h(x1),h(x2),h(x3) do. Theorem:

A mapping h:P2P2 is a projectivity if and only if there exist a non-singular 3x3 matrix H such that for any point in P2 represented by a vector x it is true that h(x)=Hx

Definition: Projective transformation  x'  h h h  x   1  11 12 13  1  x' h h h x  2  =  21 22 23  2  or x'= H x      x'3 h31 h32 h33  x3 8DOF projectivity==projective transformation=

Spring 2006 Projective Geometry 2D 14

7 Mapping between planes

central may be expressed by x’=Hx (application of theorem)

Spring 2006 Projective Geometry 2D 15

Removing projective distortion

select four points in a plane with know coordinates x' h x + h y + h x' h x + h y + h x'= 1 = 11 12 13 y'= 2 = 21 22 23 x'3 h31x + h32 y + h33 x'3 h31x + h32 y + h33

x'()h31x + h32 y + h33 = h11x + h12 y + h13 (linear in hij) y'()h31x + h32 y + h33 = h21x + h22 y + h23

(2 constraints/point, 8DOF  4 points needed) Remark: no calibration at all necessary, better ways to compute (see later) Spring 2006 Projective Geometry 2D 16

8 Transformation of lines and conics

For a point transformation x'= H x Transformation for lines l'= H-T l

Transformation for conics C'= H-TCH-1

Transformation for dual conics C'* = HC*HT

Spring 2006 Projective Geometry 2D 17

Distortions under center projection

Similarity: squares imaged as squares. Affine: parallel lines remain parallel; become . Projective: Parallel lines converge.

Spring 2006 Projective Geometry 2D 18

9 Class I:

(iso=same, metric=measure)

 x'  cos  sin t  x  x  y'  sin cos t  y  =    y   = ±1    1  0 0 1  1

preserving:  =1 orientation reversing:  = 1  R t x' H x x T = E =  T  R R = I 0 1 3DOF (1 , 2 ) special cases: pure rotation, pure translation

Invariants: length, , area Spring 2006 Projective Geometry 2D 19

Class II: Similarities

 x' s cos  ssin t  x ( + scale)  x  y' ssin s cos t y  =    y     1  0 0 1   1

sR t x' H x x T = S =  T  R R = I 0 1

4DOF (1 scale, 1 rotation, 2 translation)

also know as equi-form ( preserving) metric structure = structure up to (in literature) Invariants: ratios of length, angle, ratios of areas, parallel lines

Spring 2006 Projective Geometry 2D 20

10 Class III: Affine transformations

 x' a a t  x    11 12 x   y' a a t y   =  21 22 y        1  0 0 1  1

 A t x' H x x = A =  T  0 1

1 0  A = R()( R  )DR () D =    0 2  6DOF (2 scale, 2 rotation, 2 translation) non-isotropic ! (2DOF: scale ratio and orientation)

Invariants: parallel lines, ratios of parallel lengths, ratios of areas

Spring 2006 Projective Geometry 2D 21

Class VI: Projective transformations

 A t T x' H x x v = v ,v = P =  T  ()1 2 v v

8DOF (2 scale, 2 rotation, 2 translation, 2 line at infinity)

Action non-homogeneous over the plane

Invariants: cross-ratio of four points on a line (ratio of ratio)

Spring 2006 Projective Geometry 2D 22

11 Action of affinities and projectivities on line at infinity

 x1    x   A t    A 1  x =    T  2    x2  0 v      0  0 Line at infinity stays at infinity, but points move along line

 x1    x    A t    A 1   x =    T  2    x2  v v      0 v1x1 + v2 x2

Line at infinity becomes finite, allows to observe vanishing points, horizon.

Spring 2006 Projective Geometry 2D 23

Decomposition of projective transformations

sR tK 0 I 0  A t H H H H = S A P =  T  T  T  =  T  0 10 1v v v v

decomposition unique (if chosen s>0) A = sRK + tvT

K upper-triangular, det K =1 Example: 1.707 0.586 1.0 H 2.707 8.242 2.0 =    1.0 2.0 1.0

2cos 45  2sin 45 1.00.5 1 01 0 0   H 2sin 45 2cos 45 2.0  0 2 00 1 0 =        0 0 1  0 0 11 2 1

Spring 2006 Projective Geometry 2D 24

12 Overview transformations

h11 h12 h13  Projective   Concurrency, , h21 h22 h23 order of contact (intersection, 8dof   tangency, inflection, etc.), h31 h32 h33  cross ratio

a11 a12 tx  Parallellism, ratio of areas, a a t  ratio of lengths on parallel Affine  21 22 y  lines (e.g ), linear 6dof  0 0 1  combinations of vectors   ().

The line at infinity l sr11 sr12 tx  Similarity sr sr t   21 22 y  4dof Ratios of lengths, .  0 0 1  The circular points I,J

r11 r12 tx  r r t  Euclidean  21 22 y  lengths, areas. 3dof  0 0 1  Spring 2006 Projective Geometry 2D 25

13