<<

Lecture 04- Projective

EE382-Visual localization & Perception

Danping Zou @Shanghai Jiao Tong University

1 Projective geometry

• Key concept - Homogenous coordinates – Represent an -dimensional vector by a dimensional coordinate

Homogenous coordinate Cartesian coordinate

– Can represent infinite points or lines

August Ferdinand Möbius Danping Zou @Shanghai Jiao Tong University 1790-1868 2 2D projective geometry

representation: – A point can be represented by a homogenous coordinate:

Homogeneous coordinates:

Inhomogeneous coordinates:

Danping Zou @Shanghai Jiao Tong University 3 2D projective geometry

• Line representation: – A line is represented by a line equation:

Hence a line can be naturally represented by a homogeneous coordinate:

It has the same scale equivalence relationship:

Danping Zou @Shanghai Jiao Tong University 4 2D projective geometry

• A point lie on a line is simply described as:

where and .

A point or a line has only two degree of freedom (DoF, 自由度).

Danping Zou @Shanghai Jiao Tong University 5 2D projective geometry

• Intersection of lines: – The intersection of two lines is computed by the cross production of the two homogenous coordinates of the two lines:

Intersection of lines

Here, ‘ ‘ represents cross production

Danping Zou @Shanghai Jiao Tong University 6 2D projective geometry

• Example of intersection of two lines: Let the two lines be

• The intersection point is computed as :

• The inhomogeneous coordinate is

Danping Zou @Shanghai Jiao Tong University 7 2D projective geometry

• Line across two points: • The line across the two points is obtained by the cross production of the two homogenous coordinates of the two points:

Danping Zou @Shanghai Jiao Tong University 8 2D projective geometry

• Idea point (point at infinity): – Intersection of parallel lines – Let two parallel lines be where . Their intersection is computed as

Its inhomogeneous coordinates are meaningless:

The point with the last coordinate x3 =0 is called idea points

Danping Zou @Shanghai Jiao Tong University 9 2D projective geometry

• Line at infinity : all idea points lies on

• Points and lines in the 2D plane are represented by 3D rays and planes respectively.

• The idea points lies in - plane and - plane represents

A geometric interpolation

Danping Zou @Shanghai Jiao Tong University 10 2D projective geometry

• Projective transformation: – A projective transformation is an invertible mapping such that three points lie on the same line if and only if do. – A projective transformation is also called as • A collineation • A homography – A homography is a linear transformation on homogeneous 3-vectors represented by a non- singular 3 × 3 matrix:

Danping Zou @Shanghai Jiao Tong University 11 2D projective geometry

• Given a transformation of points , the transformation of lines is given by .

Danping Zou @Shanghai Jiao Tong University 12 2D projective geometry

• An example of projective transformation

Danping Zou @Shanghai Jiao Tong University 13 2D projective geometry

• A hierarchy of transformations

Isometries

Similarity transformation

Affine transformation

Projective transformation

Danping Zou @Shanghai Jiao Tong University 14 2D projective geometry

• Isometrics : Euclidean transformation [+ Reflection] Rotation Translation 3DoF

Euclidean transformation

Reflection + Euclidean transformation

A isometric transformation has 3 degree of freedom, whose invariants include length, angle and area.

Danping Zou @Shanghai Jiao Tong University 15 2D projective geometry

• Similarity transformation

A isometric transformation has 4 degree of freedom, with one more degree of freedom on the scaling.

It preserves the ‘shape’, angle.

Danping Zou @Shanghai Jiao Tong University 16 2D projective geometry

• An Affine transformation is a non-singular linear transformation which has the following form:

6DoF

Danping Zou @Shanghai Jiao Tong University 17 2D projective geometry

• Projective transformation

8DoF

• Can be decomposed into a chain of essential transformations:

Scale Similarity Pure Affine Pure projective

Danping Zou @Shanghai Jiao Tong University 18 Summary

* Page 44 Multiple-view Geometry for Computer Vision

Danping Zou @Shanghai Jiao Tong University 19 Summary

• Homogenous/inhomogenous coordinates • 2D points vs.. 2D lines • Points / lines at infinity • Projective transformation, Homography • Hierarchy of transformations: – Isometrics (Euclidean) ->similarity->affine->projective

Danping Zou @Shanghai Jiao Tong University 20 3D projective geometry

• The homogeneous a 3D point is represented by

• Its inhomogeneous coordinates is

• The projective transformation in 3D space is a linear transformation on homogeneous 4-vectors, represented by a non-singular matrix:

Danping Zou @Shanghai Jiao Tong University 21 3D projective geometry

• A plane in 3D space is written as

Plane normal

• Let the point on the plane be , we have :

Danping Zou @Shanghai Jiao Tong University 22 3D projective geometry

• Transformation of planes :

Danping Zou @Shanghai Jiao Tong University 23 3D projective geometry

• Joint and incidence relations – A plane is defined uniquely by three distinct points – Three planes intersect in a unique point – Two distinct planes intersect in a unique line

Danping Zou @Shanghai Jiao Tong University 24 3D projective geometry

• Three points define a plane :

• The rank of is 3, how to solve this equation? – Method #1. Compute the basis of the null space of

– Method #2. Let , solve the following equation:

Danping Zou @Shanghai Jiao Tong University 25 About the null space & SVD

• Fundamentals – Range (column space) : range(A) is the space spanned by the columns of the matrix A.

– Null space : null(A) is a space where all the vectors satisfy

– Rank : The rank is the of the column space

Danping Zou @Shanghai Jiao Tong University 26 About the null space & SVD

• Use SVD to compute the null space of a matrix. • The Singular Value Decomposition (SVD) is a basic tool to analysis a matrix. • Many problems of linear algebra can be better understood if we first ask the question:what if we take the SVD ?

Danping Zou @Shanghai Jiao Tong University 27 SVD

• The SVD is motivated by the following geometric fact: – The image of the unit sphere under any matrix is a hyper-ellipse (超椭球)

Orthogonal bases of the Orthogonal bases of the original space target space

Danping Zou @Shanghai Jiao Tong University 28 SVD

• From the geometric interpretation, we have the following equations: . • By collecting all those equations together, we have

or compactly, . Since has orthogonal columns, we get

Danping Zou @Shanghai Jiao Tong University 29 SVD

• Back to the 2D case, we have

Left singular vectors Singular values Right singular vectors

Danping Zou @Shanghai Jiao Tong University 30 SVD

• Step by step interpretation – Step 1. map (rotation + with/without reflection) the bases to the canonical frame.

Danping Zou @Shanghai Jiao Tong University 31 SVD

• Step by step interpretation – Step 2. Stretch the axes

Danping Zou @Shanghai Jiao Tong University 32 SVD

• Step by step interpretation – Step 3. rotate the canonical axes

Danping Zou @Shanghai Jiao Tong University 33 SVD

• In the step 2, what if we set ?

• We have : is the null space of A Danping Zou @Shanghai Jiao Tong University 34 Null space from SVD

• So the null space of a matrix can be obtained by SVD decomposition. • The bases of the null space are the right singular vectors that corresponds to the zero singular values.

Danping Zou @Shanghai Jiao Tong University 35 3D projective geometry

• Back to the plane problem: Three points define a plane :

• Its null space can be solved by SVD

Danping Zou @Shanghai Jiao Tong University 36 3D projective geometry

• Three planes define a point:

• Its null space can be solved by SVD

Danping Zou @Shanghai Jiao Tong University 37 Summary

• 3D points vs. 3D Planes • Transformations of 3D points and 3D lines • Three planes define a point / Three points define a plane • How to solve a homogenous equation • Null space of a matrix • Geometric interpretation of SVD

Danping Zou @Shanghai Jiao Tong University 38 3D projective geometry

• Hierarchy of 3D transformation

Danping Zou @Shanghai Jiao Tong University 39 3D projective geometry

• Euclidean transformation (Rigid body transformation)

• A mapping is a rigid body transformation if it satisfies 1) Length is preserved :

2) The cross product is preserved:

Danping Zou @Shanghai Jiao Tong University 40 3D projective geometry

• Homogenous form vs. inhomogenous form

Homogenous:

Inhomogenous:

• About the rotation matrix

Danping Zou @Shanghai Jiao Tong University 41 3D projective geometry

• 3D Rotation matrix transforms three orthogonal axes into

r1, r2, r3 in the new coordinate system.

r3

r2

r1

More about 3D rotation will be discussed in the later lectures.

Danping Zou @Shanghai Jiao Tong University 42 3D projective geometry

• Exercise: 1. Write a small program to compute the harries corner detector. Show all the intermediate results as shown in the slides. Requirements: 1) source codes + executable (any language, but with details how to run it) 2) result analysis (world <= 2 pages)

2. Write a small program to rectify a distorted planar image to a normal one as shown (Page 13) Requirements - The same as the previous one.

Deadline : Oct 27th

Danping Zou @Shanghai Jiao Tong University 43 3D Lines

• A line is defined by join of two points or intersection of two planes.

• Lines have 4 degrees of freedom in 3D-space

Danping Zou @Shanghai Jiao Tong University 44 3D Lines

• Plücker matrix: A line can be defined from two points and

• Plücker matrix is a skew-symmetric matrix

Danping Zou @Shanghai Jiao Tong University 45 3D Lines

• The rank of a Plücker matrix is 2. Its null space is the pencil of planes with the line as the axis.

• Under the point transformation , the matrix transforms as :

Danping Zou @Shanghai Jiao Tong University 46 3D Lines

• Determinant of a Plücker matrix

Danping Zou @Shanghai Jiao Tong University 47 3D Lines • Independent of the two selected points

Equivalent up to scale

• Let and be two different point on the same line, we have

Danping Zou @Shanghai Jiao Tong University 48 3D Lines

• Dual Plücker matrix : – Let two planes be

• has similar properties to Plücker matrix

Danping Zou @Shanghai Jiao Tong University 49 3D Lines

• Join and incidence properties (1) Plane from the join of a point and a line

if and only if , is on

Danping Zou @Shanghai Jiao Tong University 50 3D Lines

• Join and incidence properties (2) Point from the intersection of a line and a plane

if and only if , is on

Danping Zou @Shanghai Jiao Tong University 51 3D Lines

• Plücker line : A compact and meaningful representation from the Plücker matrix

• Correspond to the Plücker matrix as :

Danping Zou @Shanghai Jiao Tong University 52 3D Lines

• Plücker constrain is satisfied:

Danping Zou @Shanghai Jiao Tong University 53 3D Lines

• Plücker line representation

1. n is a vector normal to the plane containing the line and the origin 2. v is a direction vector of line, oriented from a to b 3. is the orthogonal distance from the line to the origin

Danping Zou @Shanghai Jiao Tong University 54 Summary

• Plücker matrix • Dual Plücker matrix • Plücker lines

Danping Zou @Shanghai Jiao Tong University 55