Multiple View Geometry in Computer Vision

advertisement
Projective 2D geometry
course 2
Multiple View Geometry
Comp 290-089
Marc Pollefeys
Content
• Background: Projective geometry (2D, 3D),
Parameter estimation, Algorithm evaluation.
• Single View: Camera model, Calibration, Single
View Geometry.
• Two Views: Epipolar Geometry, 3D
reconstruction, Computing F, Computing
structure, Plane and homographies.
• Three Views: Trifocal Tensor, Computing T.
• More Views: N-Linearities, Multiple view
reconstruction, Bundle adjustment, autocalibration, Dynamic SfM, Cheirality, Duality
Multiple View Geometry course schedule
(tentative)
Jan. 7, 9
Intro & motivation
Projective 2D Geometry
Jan. 14, 16
(no course)
Projective 2D Geometry
Jan. 21, 23
Projective 3D Geometry
Parameter Estimation
Jan. 28, 30
Parameter Estimation
Algorithm Evaluation
Camera Models
Camera Calibration
Feb. 11, 13
Single View Geometry
Epipolar Geometry
Feb. 18, 20
3D reconstruction
Fund. Matrix Comp.
Feb. 25, 27
Structure Comp.
Planes & Homographies
Trifocal Tensor
Three View Reconstruction
Mar. 18, 20
Multiple View Geometry
MultipleView Reconstruction
Mar. 25, 27
Bundle adjustment
Papers
Apr. 1, 3
Auto-Calibration
Papers
Apr. 8, 10
Dynamic SfM
Papers
Apr. 15, 17
Cheirality
Papers
Apr. 22, 24
Duality
Project Demos
Feb. 4, 6
Mar. 4, 6
Projective 2D Geometry
• Points, lines & conics
• Transformations & invariants
• 1D projective geometry and
the Cross-ratio
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 line l if and only if xTl=lTx=0
Homogeneous coordinates x1 , x2 , x3 
T
Inhomogeneous coordinates  x, y 
T
but only 2DOF
Points from lines and vice-versa
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
Ideal points and the line at infinity
Intersections of parallel lines
l  a, b, c  and l'  a, b, c'
T
T
Example
l l'  b,a,0
T
b,a tangent vector
a, b normal direction
x 1 x  2
Ideal points
Line at infinity
x1 , x2 ,0T
T
l   0,0,1
P 2  R 2  l
Note that in P2 there is no distinction
between ideal points and others
A model for the projective plane
exactly one line through two points
exaclty one point at intersection of two lines
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
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
b / 2 d / 2
 a
e / 2 
x T C x  0 with C   b / 2 c
d / 2 e / 2
f 
5DOF:
a : b : c : d : e : f 
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
stacking constraints yields
 x12
 2
 x2
 x32
 2
 x4
x2
 5
x1 y1
x2 y 2
x3 y3
x4 y 4
x5 y5
y12
y22
y32
y42
y52
x1
x2
x3
x4
x5
y1
y2
y3
y4
y5
1

1
1c  0

1
1
c  a, b, c, d , e, f 
T
Tangent lines to conics
The line l tangent to C at point x on C is given by l=Cx
x
l
C
Dual conics
A line tangent to the conic C satisfies
In general (C full rank):
l T C* l  0
C *  C 1
Dual conics = line conics = conic envelopes
Degenerate conics
A conic is degenerate if matrix C is not of full rank
m
l
e.g. two lines (rank 2)
C  lm T  ml T
e.g. repeated line (rank 1)
C  ll T
l
Degenerate line conics: 2 points (rank 2), double point (rank1)
Note that for degenerate conics
C 
* *
C
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
  
 x'2   h21 h22
 x'   h
 3   31 h32
h13  x1 
 

h23  x2 
h33  x3 
or
x'  H x
8DOF
projectivity=collineation=projective transformation=homography
Mapping between planes
central projection may be expressed by x’=Hx
(application of theorem)
Removing projective distortion
select four points in a plane with know coordinates
h x  h12 y  h13
h x  h22 y  h23
x'
x'
x'  1  11
y '  2  21
x'3 h31 x  h32 y  h33
x'3 h31x  h32 y  h33
x' h31x  h32 y  h33   h11x  h12 y  h13
y' h31x  h32 y  h33   h21x  h22 y  h23
(linear in hij)
(2 constraints/point, 8DOF  4 points needed)
Remark: no calibration at all necessary,
better ways to compute (see later)
More examples
Transformation of lines and conics
For a point transformation
x'  H x
Transformation for lines
l'  H -T l
Transformation for conics
C'  H -T CH -1
Transformation for dual conics
C'*  HC*H T
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
Class I: Isometries
(iso=same, metric=measure)
 x'   cos 
  
 y '     sin 
1  0
  
 sin 
cos 
0
orientation preserving:
orientation reversing:
t x  x 
 

t y  y 
1  1 
  1
 1
  1
 R t
x'  H E x   T  x
0 1
RTR  I
3DOF (1 rotation, 2 translation)
special cases: pure rotation, pure translation
Invariants: length, angle, area
Class II: Similarities
(isometry + scale)
 x'   s cos 
  
 y '    s sin 
1  0
  
 s sin 
s cos 
0
t x  x 
 

t y  y 
1  1 
 sR t 
x'  H S x   T
x

 0 1
RTR  I
4DOF (1 scale, 1 rotation, 2 translation)
also know as equi-form (shape preserving)
metric structure = structure up to similarity (in literature)
Invariants: ratios of length, angle, ratios of areas,
parallel lines
Class III: Affine transformations
 x'   a11 a12 t x  x 
  
 

 y'   a21 a22 t y  y 
1  0
1

0
1
  
 
 A t
x'  H A x   T  x
0 1
A  R R  DR 
1 0 
D

0

2

6DOF (2 scale, 2 rotation, 2 translation)
non-isotropic scaling! (2DOF: scale ratio and orientation)
Invariants: parallel lines, ratios of parallel lengths,
ratios of areas
Class VI: Projective transformations
A
x'  H P x   T
v
t
x

v
v  v1 , v2 
T
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)
Action of affinities and projectivities
on line at infinity
A
0 T

 x1    x1  
t     A  
 x2     x2  

v   

0  0 
Line at infinity stays at infinity,
but points move along line
A
vT

 x1  
x  
t     A 1  
x  
 x2   

 2
v   

 0   v1 x1  v2 x2 
Line at infinity becomes finite,
allows to observe vanishing points, horizon,
Decomposition of projective
transformations
 sR t   K
H  H S H AH P   T
 T
 0 1 0
0  I
1  v T
0  A
 T

v  v
t
v 
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

H   2 sin 45
 0

 2 sin 45
2 cos 45
0
1.0  0.5 1 0 1 0 0

2.0  0 2 0 0 1 0
1   0 0 1 1 2 1
Overview transformations
Projective
8dof
Affine
6dof
Similarity
4dof
Euclidean
3dof
 h11
h
 21
h31
 a11
a
 21
 0
h12
h22
 sr11
 sr
 21
 0
 r11
r
 21
 0
sr12 t x 
sr22 t y 
0 1 
r12 t x 
r22 t y 
0 1 
h32
a12
a22
0
h13 
h23 
h33 
Concurrency, collinearity,
order of contact (intersection,
tangency, inflection, etc.),
cross ratio
tx 
t y 
1 
Parallellism, ratio of areas,
ratio of lengths on parallel
lines (e.g midpoints), linear
combinations of vectors
(centroids).
The line at infinity l∞
Ratios of lengths, angles.
The circular points I,J
lengths, areas.
Number of invariants?
The number of functional invariants is equal to, or greater than,
the number of degrees of freedom of the configuration less the
number of degrees of freedom of the transformation
e.g. configuration of 4 points in general position has 8 dof (2/pt)
and so 4 similarity, 2 affinity and zero projective invariants
Download