danping lecture04-projective geometry svd
TRANSCRIPT
Lecture 04- Projective Geometry
EE382-Visual localization & PerceptionDanping Zou @Shanghai Jiao Tong
University
1
Projective geometry
2
• Key concept - Homogenous coordinates– Represent an -dimensional vector by a
dimensional coordinate
– Can represent infinite points or lines
Danping Zou @Shanghai Jiao Tong University
Homogenous coordinate Cartesian coordinate
August Ferdinand Möbius 1790-1868
2D projective geometry• Point representation:
– A point can be represented by a homogenous coordinate:
Danping Zou @Shanghai Jiao Tong University 3
Homogeneous coordinates:
Inhomogeneous coordinates:
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 .
Danping Zou @Shanghai Jiao Tong University 5
A point or a line has only two degree of freedom (DoF, 自由度).
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:
Danping Zou @Shanghai Jiao Tong University 6
Intersection of lines
Here, ‘ ‘ represents cross production
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 bewhere . Their intersection is computed as
Danping Zou @Shanghai Jiao Tong University 9
Its inhomogeneous coordinates are meaningless:
The point with the last coordinate x3 =0 is called idea points
2D projective geometry• Line at infinity : all idea points lies on
Danping Zou @Shanghai Jiao Tong University 10
A geometric interpolation
• Points and lines in the 2D plane are represented by 3D rays and planes respectively.
• The idea points lies in -plane and - plane represents
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
Danping Zou @Shanghai Jiao Tong University 14
Isometries
Similarity transformation
Affine transformation
Projective transformation
2D projective geometry• Isometrics : Euclidean transformation [+ Reflection]
Danping Zou @Shanghai Jiao Tong University 15
Euclidean transformation
Reflection + Euclidean transformation
Rotation
Translation
A isometric transformation has 3 degree of freedom, whose invariants include length, angle and area.
3DoF
2D projective geometry• Similarity transformation
Danping Zou @Shanghai Jiao Tong University 16
A isometric transformation has 4 degree of freedom, with one more degree of freedom on the scaling.
It preserves the ‘shape’, angle.
2D projective geometry• An Affine transformation is a non-singular linear
transformation which has the following form:
Danping Zou @Shanghai Jiao Tong University 17
6DoF
2D projective geometry• Projective transformation
• Can be decomposed into a chain of essential transformations:
Danping Zou @Shanghai Jiao Tong University 18
Similarity Pure Affine Pure projective
8DoF
Scale
Summary
Danping Zou @Shanghai Jiao Tong University 19
* Page 44 Multiple-view Geometry for Computer Vision
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
• Let the point on the plane be ,we have :
Danping Zou @Shanghai Jiao Tong University 22
Plane normal
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 dimension 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 (超椭球)
Danping Zou @Shanghai Jiao Tong University 28
Orthogonal bases of the original space
Orthogonal bases of the target space
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
Danping Zou @Shanghai Jiao Tong University 30
Left singular vectors Singular values Right singular vectors
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 ?
Danping Zou @Shanghai Jiao Tong University 34
• We have :is the null space of A
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
• 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:
3D projective geometry
Danping Zou @Shanghai Jiao Tong University 40
3D projective geometry• Homogenous form vs. inhomogenous form
• About the rotation matrix
Danping Zou @Shanghai Jiao Tong University 41
Homogenous:
Inhomogenous:
3D projective geometry• 3D Rotation matrix transforms three
orthogonal axes into r1, r2, r3 in the new coordinate system.
Danping Zou @Shanghai Jiao Tong University 42
r1
r2
r3
More about 3D rotation will be discussed in the later lectures.
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.
Danping Zou @Shanghai Jiao Tong University 43
Deadline : Oct 27th
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
• Let and be two different point on the same line, we have
Danping Zou @Shanghai Jiao Tong University 48
Equivalent up to scale
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
Danping Zou @Shanghai Jiao Tong University 54
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
Summary• Plücker matrix• Dual Plücker matrix• Plücker lines
Danping Zou @Shanghai Jiao Tong University 55