You are on page 1of 55

Projective Geometry

簡韶逸 Shao-Yi Chien


Department of Electrical Engineering
National Taiwan University

1
Outline
• Projective 2D geometry
• Projective 3D geometry

[Slides credit: Marc Pollefeys]


2
Projective 2D Geometry
• Points, lines & conics
• Transformations & invariants

• 1D projective geometry and


the cross-ratio

3
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
⚫ Homogeneous representation of points
x = (x, y ) on l = (a,b,c ) if and only if ax + by + c = 0
T T

(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 line l if and only if xTl=lTx=0

Homogeneous coordinates (x1 , x2 , x3 ) but only 2DOF


T

Inhomogeneous coordinates ( x, y )
T

The point x=(𝑥 , 𝑥 , 𝑥 )T represent the point (𝑥 /𝑥 , 𝑥 /𝑥 )T in ℝ2


1 2 3 1 3 2 3

4
Points and Lines
⚫ Intersections of lines

The intersection of two lines l and l' is x = l l'

⚫ Line joining two points


The line through two points x and x' is l = x x'

Example

y =1

x =1

5
Ideal Points and the Line at Infinity
⚫ Intersections of parallel lines

l = (a, b, c ) and l' = (a, b, c') l l' = (b,−a,0)


T T T

Example

(b,−a ) tangent vector (line’s direction)


(a, b ) normal direction

x =1 x = 2

Ideal points (x1 , x2 ,0)T


l = (0,0,1)
T
Line at infinity

P 2 = R 2  l Note that in P2 there is no distinction


between ideal points and others
6
A Model for the Projective Plane

x3=1

exactly one line through two points


exaclty one point at intersection of two lines
7
Duality
x l
x Tl = 0 lT x = 0
x = l l' 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

8
Conics
Curve described by 2nd-degree equation in the plane

ax 2 + bxy + cy 2 + dx + ey + f = 0
or homogenized x  x1 x , y  x2 x
3 3

ax1 + bx1 x2 + cx2 + dx1 x3 + ex2 x3 + fx32 = 0


2 2

or in matrix form
 a b / 2 d / 2
x T C x = 0 with C =  b / 2 c e / 2 
d / 2 e / 2 f 
symmetric
5DOF: a : b : c : d : e : f 
9
Five Points Define a Conic
For each point the conic passes through

axi2 + bxi yi + cyi2 + dxi + eyi + f = 0

or
(x , x y , y , x , y , f )c = 0
2
i i i
2
i i i c = (a, b, c, d , e, f )
T

stacking constraints yields

 x12 x1 y1 y12 x1 y1 1
 2 
 x2 x2 y 2 y22 x2 y2 1
 x32 x3 y3 y32 x3 y3 1c = 0
 2 
 x4 x4 y 4 y42 x4 y4 1
x2 y52 y5 1
 5 x5 y5 x5
10
Tangent Lines to Conics
The line l tangent to C at point x on C is given by l=Cx

l
x
C

11
Dual Conics
A line tangent to the conic C satisfies lT C* l = 0
In general (C full rank): C* = C−1

Dual conics = line conics = conic envelopes

12
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:P2→P2 is a projectivity if and only if there exist a


non-singular 3x3 matrix H such that for any point in P2
reprented by a vector x it is true that h(x)=Hx

Definition: Projective transformation


 x '1   h11 h12 h13  x1 
     
 x '2  = h21 h22 h23  x2  or x' = H x
 x'  h  
 3   31 h32 h33  x3  8DOF
projectivity=collineation=projective transformation=homography 14
Mapping between Planes

central projection may be expressed by x’=Hx


(application of theorem)

15
Removing Projective Distortion

select four points in a plane with know coordinates


x' h x + h12 y + h13 x' h x + h22 y + h23
x' = 1 = 11 y ' = 2 = 21
x'3 h31 x + h32 y + h33 x'3 h31 x + h32 y + h33

x' (h31 x + h32 y + h33 ) = h11 x + h12 y + h13


(linear in hij)
y ' (h31 x + h32 y + h33 ) = h21 x + h22 y + h23
(2 constraints/point, 8DOF  4 points needed)

Remark: no calibration at all necessary


16
More Application Examples

17
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*H T

18
A Hierarchy of Transformations
⚫ Projective linear group
⚫ Affine group (last row (0,0,1))
⚫ Euclidean group (upper left 2x2 orthogonal)
⚫ Oriented Euclidean group (upper left 2x2 det 1)

Alternative, characterize transformation in terms of elements


or quantities that are preserved or invariant
e.g. Euclidean transformations leave distances unchanged

Similarity Affine Projective


19
Class I: Isometries
 x'   cos  − sin  t x  x 
     
 y '  =   sin  cos  t y  y   = 1
1  0 1  1 
   0

orientation preserving:  = 1 (Euclidean transform)


orientation reversing:  = −1
 R t
x' = H E x =  T  x RTR = I
0 1
3DOF (1 rotation, 2 translation), can be computed from 2 point correspondences
special cases: pure rotation, pure translation

Invariants: length, angle, area

20
Class II: Similarities
 x'   s cos  − s sin  t x  x 
     
 y '  =  s sin  s cos  t y  y 
1  0 1  1 
   0

 sR t 
x' = H S x =  T  x RTR = I
 0 1

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


can be computed from 2 point correspondences

also know as equi-form (shape preserving)

Invariants: ratios of length, angle, ratios of areas, parallel lines

21
Class III: Affine Transformations
 x'   a11 a12 t x  x 
     
 y '  = a21 a22 t y  y 
1  0 1  1 
   0
 A t
x' = H A x =  T  x
0 1
1 0 
A = R ( )R (−  )DR ( ) D= 
 0 2

6DOF (2 scale, 2 rotation, 2 translation),


can be computed from 3 point correspondences
non-isotropic scaling! (2DOF: scale ratio and orientation)

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


22
Class VI: Projective Transformations

A t
x' = H P x =  T v = (v1 , v2 )
T
 x
v v

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


can be computed from 4 point correspondences
Action non-homogeneous over the plane

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

23
Action of Affinities and Projectivities
on Line at Infinity
 x1    x1  
A t     A  
0 T   x2  =   x2  
 v    
 
0  0 
Line at infinity stays at infinity, but points move along line

 x1   x  
A t     A 1  
 x2  =  x  
vT   2
 v   
+ 
 
0  v1 x1 v 2 x 2 

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

24
Decomposition of Projective
Transformations
 sR t   K 0  I 0  A t
H = H S H AH P =  T  0T = T
 0 1  1  v T 
v  v v 
S: similarity
A: Affine
P: Projective
A = sRK + tv T
decomposition unique (if chosen s>0)
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 

2 cos 45 − 2 sin 45 1.0  0.5 1 0 1 0 0


 
H =  2 sin 45 2 cos 45 2.0  0 2 0 0 1 0
 0 0 1   0 0 1 1 2 1

25
Summary of Transformations
Invariant Properties
 h11 h12 h13  Concurrency, collinearity,
Projective h h h  order of contact (intersection,
8dof  21 22 23  tangency, inflection, etc.),
 h31 h32 h33  cross ratio

Parallellism, ratio of areas,


 a11 a12 t x  ratio of lengths on parallel
Affine a a t  lines (e.g midpoints), linear
6dof  21 22 y combinations of vectors
 0 0 1  (centroids).
The line at infinity l∞
 sr11 sr12 t x 
 sr 
Ratios of lengths, angles.
Similarity
4dof  21 sr 22 t y
The circular points I,J

 0 0 1 
 r11 r12 tx 
Euclidean r r22 t y  lengths, areas.
3dof  21
 0 0 1  26
Cross Ratio
x1 , x 2 x 3 , x 4
Cross (x1 , x 2 , x 3 , x 4 ) =  xi1
x i , x j = det 
x j1 
x1 , x 3 x 2 , x 4  xi 2 x j 2 

Invariant under projective transformations


The Line at Infinity

The line at infinity l is a fixed line under a projective


transformation H if and only if H is an affinity

Note: not fixed pointwise


Affine Properties from Images
projection rectification

l = l1 l2 l3  , l3  0
T
1 0 0
𝐻’𝑃 = 0 1 0
𝑙1 𝑙2 𝑙3 𝐻’𝑃−T (𝑙1 , 𝑙2 ,𝑙3 )T = (0,0,1)T = 𝑙∞
Affine Rectification
v1 l∞ v2

l1 l3
v 2 = l3  l 4
l2 l4 v1 = l1  l 2

l  = v1  v 2
Distance Ratios

d (a , b) : d (b, c) = a : b

(0,1)T , (a,1)T , (a + b,1)T


H
a, b, c

v' = H(1,0)
T
The Circular Points
1 1
   
I=i J = −i
0 0
   

 s cos  − s sin  t x  1  1


   
I = H S I =  s sin  s cos   i
t y  i  = se  i  = I
 0 0 1  0  0
 

The circular points I, J are fixed points under the


projective transformation H iff H is a similarity
The Circular Points
“circular points” l∞

x12 + x22 + dx1 x3 + ex2 x3 + fx32 = 0 x12 + x22 = 0


x3 = 0
I = (1, i,0)
T

J = (1,−i,0)
T

Algebraically, encodes orthogonal directions


I = (1,0,0) + i(0,1,0)
T T
Conic Dual to the Circular Points

1 0 0
C* = IJ T + JI T C* = 0 1 0
0 0 0
C* = H S C* H TS
*
The dual conic C is fixed conic under the
projective transformation H iff H is a similarity
Angles

Euclidean: l = (l1 , l2 , l3 ) m = (m1 , m2 , m3 )


T T

l1m1 + l2 m2
cos  =
(l
1
2
)(
+ l22 m12 + m22 )

l T C* m
Projective: cos  =
(l T
)(
C* l m T C* m )
(This equation is Invariant to projective transform)

l T C* m = 0 If orthogonal
Length Ratios
d (b, c) sin 
=
d (a, c) sin 

cos𝛼 and cos𝛽 can be derived with the equations in the previous page
Metric Properties from Images
C* ' = (H P H A H S )C* (H P H A H S )
T

= (H P H A )H S C* H TS (H P H A )
T

= (H P H A )C* (H P H A )
T

KK T K T v
= T T 
v K v v
Rectifying transformation from SVD
1 0 0
C* ' = U 0 1 0 U T H=U
0 0 0
Metric from Affine
Suppose an image has been affinely rectified (v=0)
 m1 
KK T
0  
(l1 l2 l3 )  m2  = 0
 0 0  
 m3 
2 2 2
𝑙 ′1 𝑚′1 , 𝑙 ′1 𝑚′ 2 + 𝑙 ′ 2 𝑚′1 , 𝑙 ′ 2 𝑚′ 2 𝑘11 + 𝑘12 , 𝑘22 𝑘12 , 𝑘22 T =0
Metric from Projective
 m1 
KK T
K v  
T

l C m=0
T *

(l1 l2 l3 ) T m = 0
T  2 
v K v v  
 m3 
(l1m1,0.5(l1m2 + l2 m1 ), l2 m2 ,0.5(l1m3 + l3m1 ),0.5(l2 m3 + l3m2 ), l3m3 )c = 0
𝐜 = (𝑎, 𝑏, 𝑐, 𝑑, 𝑒, 𝑓)T
Projective 3D Geometry
• Points, lines, planes and quadrics

• Transformations

• П∞, ω∞ and Ω ∞
3D Points
3D point
( X , Y , Z )T in R3
X = (X1, X 2 , X 3 , X 4 )
T
in P3
T
X X X 
X =  1 , 2 , 3 ,1 = ( X , Y , Z , 1)
T
( X 4  0)
 X4 X4 X4 
projective transformation

X' = H X (4x4-1=15 dof)


Dual: points ↔ planes, lines ↔ lines
Planes
3D plane Transformation
π1 X + π 2Y + π 3 Z + π 4 = 0 X' = H X
π' = H -T π
π1 X 1 + π 2 X 2 + π 3 X 3 + π 4 X 4 = 0
πT X = 0
Euclidean representation
n . X + d = 0 n = (π1 , π 2 , π 3 ) X = (X ,Y , Z )
~ T ~ T

π4 = d X4 =1

d/ n
Planes from Points
Solve π from X1T π = 0, X T2 π = 0 and X 3T π = 0
X1T  X1T 
 T (solve π as right nullspace of X T  )
X 2  π = 0  2
X 3T  X 3T 
   
Or implicitly from coplanarity condition
 X 1 ( X 1 )1 ( X 2 )1 ( X 3 )1 
 X (X ) (X ) ( X 3 )2 
det X X1X 2 X 32 = 0 2 =0
2 1 2

 X 3 ( X 1 )3 ( X 2 )3 ( X 3 )3 

 X 4 ( X 1 )4 ( X 2 )4 ( X 3 )4 
X 1 D234 − X 2 D134 + X 3 D124 − X 4 D123 = 0
π = (D234 ,− D134 , D124 ,− D123 )
T
Points from Planes

Solve X from π1T X = 0, π T2 X = 0 and π 3T X = 0


 π1T   π1T 
 T  T )
π 2  X = 0 π 2 
(solve X as right nullspace of

 π 3T   π 3T 
   
Points and Planes
• Projective transformation
Under the point transformation 𝑿′ = 𝐻𝑿, a plane transforms
as 𝝅′ = 𝐻 −𝑇 𝝅

• Parametrized points on a plane


Representing a plane π = (a, b, c, d )
T
by its span
X =Mx x is a 3-vector parameter (a point on the projective plane)
πT M = 0
 p  p =  − b ,− c ,− d 
M is not unique M= 
I 3x3   a a a
50
Lines
Defined as the join of two points A, B
A T 
(4dof) W = T λA+ μB
B 
(Dual) Defined as the intersection of two planes P, Q
 P T

W =  T
*
λP+ μQ
Q 
*T
W W = WW
* T
= 022

Example: X-axis
0 0 0 1  0 0 1 0 
W=  W =
*

1 0 0 0   0 1 0 0 
Points, Lines and Planes

W
W
M =  T Mπ =0
X  X

W*
W* 
M= T MX = 0 π
π 
Plücker Matrices
Plücker matrix (4x4 skew-symmetric homogeneous matrix)

lij = Ai B j − Bi Aj
L = ABT − BA T
*T
1. L has rank 2 LW = 042
2. 4dof
3. generalization of l = x  y
4. L independent of choice A and B
5. Transformation L'= HLHT
Example: x-axis 0 0 − 1
0  1 0
0  0  0 0 0 0 
L =  1 0 0 0 −  0 0 0 1 = 
T

0  0  0 0 0 0
     
1 0  1 0 0 0
Plücker Matrices
Dual Plücker matrix L*

L* = PQ T − QP T
*'
L = H -T LH -1
Correspondence
l12 : l13 : l14 : l23 : l42 : l34 = l34
* *
: l42 *
: l23 : l14* : l13* : l12*
Join and incidence
π = L*X (plane through point and line)

L*X = 0 (point on line)

X = Lπ (intersection point of plane and line)

Lπ = 0 (line in plane)

L1 , L 2 ,π = 0 (coplanar lines)


Quadrics and Dual Quadrics
X T QX = 0 (Q : 4x4 symmetric matrix)
• • • •
 • • •
1. 9 d.o.f. Q=
  • •
 
2. in general 9 points define quadric    •

3. det Q=0 ↔ degenerate quadric


4. Polar plane π = QX
5. (plane ∩ quadric)=conic C = M T QM π : X = Mx
6. transformation Q' = H -T QH -1

Q*: dual quadric, equations on planes


π T Q* π = 0
1. relation to quadric Q = Q
* -1
(non-degenerate)
2. transformation Q' = HQ H
* * T
Quadric Classification

Rank Sign. Diagonal Equation Realization


4 4 (1,1,1,1) X2+ Y2+ Z2+1=0 No real points
2 (1,1,1,-1) X2+ Y2+ Z2=1 Sphere
0 (1,1,-1,-1) X2+ Y2= Z2+1 Hyperboloid (1S)
3 3 (1,1,1,0) X2+ Y2+ Z2=0 Single point
1 (1,1,-1,0) X 2 + Y 2 = Z2 Cone
2 2 (1,1,0,0) X 2 + Y2 = 0 Single line
0 (1,-1,0,0) X2= Y2 Two planes
1 1 (1,0,0,0) X2=0 Single plane
Quadric Classification
Projectively equivalent to sphere:

sphere ellipsoid
hyperboloid of paraboloid
Ruled quadrics: (contain straight line) two sheets

hyperboloids
of one sheet

Degenerate ruled quadrics:

cone two planes


Hierarchy of Transformations
Invariant Properties

Projective A t Intersection and tangency


15dof vT v 

Parallellism of planes,
Affine  A t Volume ratios, centroids,
5 for affine scaling 0T 1 The plane at infinity π∞
12dof  

3 for rotation
3 for translation
Similarity s R t  The absolute conic Ω∞
1 for isotropic scaling 7dof  0T 1
 
Euclidean  R t Volume
6dof 0T 1
 
Screw Decomposition
Any particular translation and rotation is equivalent to
a rotation about a screw axis and a translation along
the screw axis.
Screw Decomposition
Any particular translation and rotation is equivalent to
a rotation about a screw axis and a translation along
the screw axis.

screw axis // rotation axis


t = t // + t ⊥
The Plane at Infinity
 0
 
A −T
0  0 
 −T
π = H A π =    = π 
− A t 1 0 
1
 

The plane at infinity π is a fixed plane under a


projective transformation H iff H is an affinity

canonical position π  = (0,0,0,1)


T
1.
2. contains directions D = ( X 1 , X 2 , X 3 ,0)T
3. two planes are parallel  line of intersection in π∞
4. line // line (or plane)  point of intersection in π∞

You might also like