Professional Documents
Culture Documents
12-StereoGeometry L12
12-StereoGeometry L12
Jayanta Mukhopadhyay
Dept. of Computer Science and Engg.
Stereo Set-up
Corresponding
X
point of x in
Epipolar plane the right image
All points lies on l’.
on
epipolar x’ l,l’: Epipolar
plane
x
l lines
project on l’
l and l’ e e’
C’
C e, e’: epipoles
Camera centers
Epipolar geometry
Epipoles e,e’
= intersection of baseline with image plane
= projection of projection center in other image
= vanishing point of camera motion direction
An epipolar plane: plane containing baseline (1-D
family)
An epipolar line: intersection of epipolar plane with
image (always come in corresponding pairs)
From Hartley and Zisserman, “Multiple view geometry in computer
vision”, Cambridge Univ. Press (2000)
Epipolar geometry
x x’
l l’
C e’ C’
e
P=K[ I | 0] P’=K’[ R | t]
P= K[I | 0]
Fundamental and P’= K’ [R | t]
Essential Matrices
𝐹 = 𝑒′ × 𝐾 ′ 𝑅𝐾 −1
= 𝐾 ′ 𝑡 × 𝐾 ′ 𝑅𝐾 −1
Say, P=[I | 0], i.e. K=I
P’=K’ [R | t]=[K’ R | K’ t]=[M | m]
Ans. 2(b)
X
x
y l
e’ C’
C
Fundamental Matrix:
X
Properties
x x’
l l’
C e’ C’
e
P P’
Transpose:
If F is fundamental matrix of (P,P’), FT for (P’,P).
Epipolar lines: For x, epipolar line l’=Fx. F is a
correlation.
For x’, epipolar line l=FTx’. → Rank
deficient.
→ Inverse
does not
exit.
Rank deficient:
det(F)=0 and F is a projective element → 7 d.o.f.
Ex. 3
◼ Consider the following fundamental matrix.
Essential Matrix
x x’
l l’
C e’ C’
e
Coordinates in calibrated
x’TFx=0
image planes.
→(K’xc’)TF(Kxc)=0
E=K’TFK E=[t]xR →x’cTK’TFKxc=0
F=K’-TEK-1 →x’cT(K’TFK)xc=0
=K’-T [t]xR K-1 6 parameters
Eec=e’cE=0
E
d.o.f.=5 Rank: 2
det(E)=0
X
P=K[I | 0] P’=K’ [I | t]
Pure translation
x x’
l l’
C e’ C’
e
X (X,Y,Z)
x x’
l l’
(0,0,0) C e’ C’ (-tx,0,0)
e
For K=K’ P=K[I | 0] P’=K’ [I | t]
C’ =-K’-1K’ t
=-t
Pure Translation:
Computing Depth
X (X,Y,Z)
x x’
l l’
(0,0,0) C e’ C’ (-tx,0,0)
e
P=K[I | 0] P’=K’ [I | t]
General Motion x(2) =K’[R|0]X
=K’R[I|0]X
of Camera =K’RK-1K[I|0]X
=K’RK-1x
e(2)
P=K[I | 0] P(2)=K’[R|0] P’=K’ [R | t]
◼ x’=x+(Kt)/Z
◼ Z=(6x10/6)/(x’-x)
=10/(9.33-6)=3
Estimation of
Fundamental Matrix
x' T Fx = 0
x' xf11 + x' yf12 + x' f13 + y' xf21 + y' yf 22 + y' f 23 + xf31 + yf 32 + f 33 = 0
x' x, x' y, x' , y' x, y' y, y' , x, y,1 f11, f12 , f13, f 21, f 22 , f 23 , f31, f32 , f33 T = 0
x'1 x1 x'1 y1 x'1 y '1 x1 y '1 y1 y '1 x1 y1 1
f = 0
x ' n xn x 'n yn x 'n y ' n xn y 'n y n y 'n xn yn 1
o Solution up to scale.
o Minimum 8 point correspondences.
Af = 0
o Use of DLT (for 7 point correspondences from linear
combination of smallest and second smallest eigen vectors.
Estimation of
Fundamental Matrix
f11
f
12
f13
x1 x1´ y1 x1´ x1´ x1 y1´ y1 y1´ y1´ x1 y1 1
x x ´ y 2 x2 ´ x2 ´ x2 y 2 ´ y2 y2 ´ y2´ x2
y 2 1 f 21
2 2 f 22 = 0
f 23
xn xn ´ y n xn ´ xn ´ xn y n ´ yn yn ´ yn ´ xn y n 1
f 31
~10000 ~10000 ~100 ~10000 ~10000 ~100 ~100 ~100 1 f 32
33
f
Orders of magnitude difference
!
Between column of data matrix
→ least-squares yield poor results
The normalized 8-
point algorithm
Transform image to
~[-1,1] x [-1,1] 2
0
− 1
700
(-1,1) (1,1)
(700,500) 2
(0,500) − 1
500
1
(0,0)
(-1,-1) (1,-1)
(0,0) (700,0)
min F - F' F
Compute closest rank-2 approximation
σ1
F' = U σ 2 V T = U1σ1V1T + U 2σ 2 V2T
0
The singularity
constraint
Singular
Nonsingular F
F
representation of F
x x’
l l’
C e’ C’
e
P P’
Over parameterization: F=[t]xM ➔ {t,M} → 12 params.
Epipolar parameterization:
Left epipole
Epipoles
Retrieving the camera
X
matrices from F
x x’
l l’
C e’ C’
e
P P’
matrices from F
x x’
l l’
C e’ C’
e
P =[I | 0] P’=[M | m]
F=?
o P=[I | 0] & P’=[M | m] → F=[m]xM.
o d.o.f. of H = 15
o d.o.f. of F=22-15=7
Retrieving the camera
X
matrices from F
x x’
l l’
C e’ C’
e
P P’
o F corresponds to (P,P’), iff P’TFP is skew
symmetric.
Proof: For a skew symmetric matrix S, XTSX=0, for all X.
Now, XTP’ TFPX=(P’X)TF(PX)=x’TFx=0 (for any X in
P3, as F is the fundamental matrix). …
o F corresponds to P=[I | 0] & P’=[SF | e’ ], where e’
is the right epipole of F s.t. e’ TF=0.
o A good choice of S =[e’]x.
o F → ([I | 0], [[e’]x F | e’ ])
→ ([I | 0], [[e’]x F + e’ vT| ke’ ])
X
C e’ C’
e
P=[I | 0]
P’=[R | t ]
Decomposition of E
(Essential matrix)
x x’
l l’
C e’ C’
e
P=[I | 0]
P’=[R | t ]
C e’ C’
e
P=[I | 0]
P’=[R | t ]
o SVD of E=U diag(1,1,0) VT
o Two possible decomposition of E=SR
o S=UZUT and R=UWVT or UWTVT
P’=[UWVT | +u3] or [UWVT | -u3]
[UWTVT |+u3] or [UWT VT | -u3]
Last column of U.
Out of the four only one is valid for viewing a point
from both the cameras. It is sufficient to test a single
point for the above.
Ex. 5
◼ Check whether the following fundamental
matrix and the camera matrices P and P’ (for
left and right cameras) are compatible.
Ans. 5
◼ P’TFP=
points (structure)
x x’
l l’
C e’ C’
e
P P’
Given xi →xi’, compute X. Perp. segm.
1. Compute F. xi xi’
2. Compute P and P’. C C’
3. For each (xi,xi’) compute X by triangulation.
Reprojection Error
x x’
l l’
C e’ C’
e
P P’
Given xi →xi’, compute X.
Projective invariant.
Linear triangulation
X
methods
x x’
l l’
C e’ C’
e
P P’
Given xi →xi’, compute X.
x x’
-M’-1x’
dx’
-M-1m C’
C d -M’-1m’
x
-M x
-1 P=[M|m] P’=[M’|m’]
4 Ans.
◼ P=[M|m] P’=[M’|m’]
◼ C=-M-1m= [0.35 1 1.62]T
◼ C’=-M’-1m’=[13 35 38]T
◼ x=[0 3.5 1]T x’=[2/3 -1/3 1]T
◼ dx= M-1 x=[0.32 0.47 0.69]
◼ dx’= M’-1 x’=[1.36 3.67 3.91]
◼ dx X dx’= [0.7 0.33 -0.55]
◼ (C+s dx)- (C’+t dx’)=[-12.85 -33.93 -36.58]+s[0.32
0.47 0.69]-t[1.36 3.67 3.91]
◼ 0.32(-12.85+0.3s-1.36t)+0.47(-33.93+0.47s-
3.67t)+0.69(-36.58+0.69s-3.91t)=0 –(1)
◼ 1.36(-12.85+0.3s-1.36t)+3.67(-33.93+0.47s-
3.67t)+3.91(-36.58+0.69s-3.91t)=0 – (2)
l l’
C e’ C’ P’=[R | t ]
P=[I | 0] e
A convenient way of
representing 3D line.
Plane Induced Homography
x x’
C’
C P=[I | 0]
H P’=[A | a]
Plane induced
homography
x x’
A transformation H between
C’
two stereo images is plane C P=[I | 0] P’=[A | a]
induced homography if F is
decomposed into [e’]xH.
Hence, P=[I|0] & P’=[H|e’].
Given P=[I|0], P’=[A|a], & a plane induced
homography H, the plane can be recovered by solving
kH=A-avT, (linear equations for unknowns k and v).
Camera matrices from Plane
induced homography
if F= [e’]xH,
H is a plane induced homography
A possible pair of camera
x x’
matrices:
P=[I|0] & P’=[H|e’]. C P=[I | 0] C’
P’=[A | a]
x x’
C P=[I | 0] C’
P’=[A | a]
Computing F from 6 points out
of which 4 are coplanar
X5
x5’
x5
l1
e’ C’
C
Given F and 3 point
correspondences, compute H.
First Method
1. Obtain (P=[I|0],P’=[A|a]) from F and
construct 3 scene points, X1, X2, & X3.
2. Obtain plane (vT,1)T.
3. Compute H=A-avT
Second Method
1.Obtain (e,e’) from F.
2.Use 3 correspondences + (e,e’), to obtain H.
Any 3 points can bipartition the image
space, w.r.t. the plane formed by them.
H⍺ and Vanishing points
o H⍺ maps vanishing points between two images.
o H⍺ can be computed by identifying three non-
collinear vanishing points given F or from 4
vanishing points.
o Let P=[M |m], P’=[M’ | m’], X=[x⍺T 0]T (a point at
infinity).
x=PX=M x⍺
x’=P’X=M’ x⍺
x’=M’M-1x ➔ H⍺=M’M-1
Affine epipolar geometry
o Projection rays are Epipolar
plane
||l projection
parallel. rays
o Epipolar lines and planes
are parallel. Epipolar line
Form of F:
x
x’
a,b,c,d,e all
As epipolar lines are parallel, epipoles are in
non-zero.
the form [e1 e2 0]T
Affine
stereo
Epipole:
Point of
intersection
y x’
x HA y’
l’
FA: d.o.f.: 4
Left epipole:[-d e 0]T
right epipole:[-b a 0]T
Estimating FA
Epipolar lines: