Академический Документы
Профессиональный Документы
Культура Документы
Introduction
Multiple 3D scene points can project onto to the same 2D image point.
P
P1
P2
Π Π’
p p’
p’1
p’2
C C’
ρ x̃ = K(RX + T) (1)
X = R⊤ X′ − R⊤ T. (4)
Related Problems
Homography: (CS4243, CS5240, Appendix C)
Recover projective transformation between two image frames from
corresponding image points xki .
Absolute Orientation:
Recover rigid transformation R, T between two coordinate
systems from corresponding coordinates Xi and X′i of 3D points.
Camera Orientation:
Recover camera’s orientation R⊤ and position C from
corresponding scene points Xi and image points xi .
Camera Calibration: (CS4243, Appendix D)
Recover camera’s intrinsic parameters K from corresponding scene
points Xi and image points xki in different views k.
Recovering 3D Structure:
Recover 3D scene points Xi from corresponding image points xki .
Absolute Orientation
Π Q Q’ Π’
C C’
X′ = RX + T. (6)
X’
P P
X X
P’ Z’
Z Z
P P
T
P’ X’
X −T X
Z’
Z Z
Similarity Transformation
X′ = sRX + T. (7)
where
n n
1X ′ 1X ′
X= Xi , X = Xi . (9)
n n
i=1 i=1
Eigen Decomposition
Av = λv (16)
A is a matrix.
v is a column vector called eigenvector.
λ is a scalar called eigenvalue of A corresponding to v.
If A is n×n matrix, then there are n eigenvectors and eigenvalues.
Solving for the n vi and λi is called eigen decomposition.
There are standard algorithms for eigen decomposition.
Useful Properties
Trace of A is
n
X
tr(A) = λi . (18)
i=1
Determinant of A is
n
Y
det(A) = λi . (19)
i=1
Camera Orientation
P1
Q2
l2 Q1
l1
Π
p2
p1
Initialize R = I and C = 0.
Repeat until convergence:
(1) Compute 3D points in camera coordinate frame:
X′i = R (Xi − C). (21)
(2) Compute projection lines:
li = K−1 x̃i . (22)
(3) Compute ideal position Qi of X′i :
Ideal position Qi = ρi li lies on li , i.e., Qi = ρi li for some ρi .
ρi can be obtained by substituting Eq. 21 and 22 into Eq. 20:
l⊤
i Xi
′
ρi li = X′i , ρi = ⊤
. (23)
li li
ρi li is the projection of X′i on li . Eq. 23 is the best-fit solution.
(CS6240) Multiple-View Methods 20 / 64
Camera Orientation Camera Orientation Algorithm
C = X̄ − R⊤ Q̄ (25)
Triangulation
d1 d2
Π1 Π2
p1 p2
C1 C2
R−1 −1
k Kk x̃k is the projection line.
Let
R−1 −1
k Kk x̃k
vk = . (28)
kR−1 −1
k Kk x̃k k
Then, vk is a unit vector along the projection line.
Let dk denote the distance of point P from camera center Ck along the
projection line. Then,
dk v k = X − C k (29)
That is,
dk = vk · (X − Ck ). (30)
(CS6240) Multiple-View Methods 23 / 64
Triangulation
d1 Q1 d2
Π1 Π2
p1 p2
C1 C2
Qk = Ck + dk v k
= Ck + vk (vk · (X − Ck )) (31)
= Ck + (vk vk⊤ )(X − Ck ).
Then, the optimal X is the one that minimizes the sum-squared error
X X
E= e2k = k(I − vk vk⊤ )(X − Ck )k2 . (33)
k k
∂E X
=2 (I − vk vk⊤ )⊤ (I − vk vk⊤ )(X − Ck ) = 0. (34)
∂X
k
That is, X X
M⊤
k Mk X = M⊤
k Mk C k (35)
k k
where
Mk = I − vk vk⊤ . (36)
Then,
" #−1
X X
X= M⊤
k Mk M⊤
k Mk C k . (37)
k k
Epipolar Geometry
P’
P’’
Π1 Π2
p1 p2
l1 e1 e2 l2
C1 C2
Calibrated Cameras
x̄k = K−1
k x̃k . (38)
where
0 −TZ TY
[T]× = TZ 0 −TX . (42)
−TY TX 0
Taking dot product with x̄2 yields
ρ1 x̄⊤ ⊤
2 [T]× R x̄1 = ρ2 x̄2 [T]× x̄2 = 0. (43)
x̄⊤
2 E x̄1 = 0. (44)
Uncalibrated Cameras
x̄⊤
2 E x̄1 = 0
−⊤ −1
(46)
x̃⊤
2 K2 E K1 x̃1 = 0
Denoting K−⊤ −1
2 E K1 by F yields the constraint:
x̃⊤
2 F x̃1 = 0. (47)
Let E be
e11 e12 e13
e21 e22 e23 .
E= (48)
A e = 0. (50)
∂C
= 2A⊤Ae − 2λe = 0. (52)
∂e
That is
A⊤Ae = λe. (53)
Other Properties of E
E is singular, i.e., E has no inverse, it’s determinant is 0.
Of the 3 singular values of E, the smallest is 0.
E = U diag(s1 , s2 , s3 ) V⊤ (55)
with s1 ≥ s2 ≥ s3 .
E′ = U diag(s1 , s2 , 0) V⊤ . (56)
M = UΣV⊤ (57)
return
(CS6240) Multiple-View Methods 40 / 64
Two-frame Structure From Motion
P2
Π1 Π2
p 11 p 21
p 12 p 22
e1 e2
C1 C2
0 0 0 v3⊤
So,
R90◦ U⊤ R = V⊤ (61)
and
R = UR⊤ ⊤
90◦ V . (62)
The correct signs of E, t, U and V are not known.
R = ±UR⊤
±90◦ V
⊤
(63)
Summary
Exercise
Further Reading
A.1 2D Lines
ax + by + c = 0. (64)
x̃ · l̃ = 0. (65)
Similarly, the joining of two points x̃1 and x̃2 forms a line l̃ given by
the cross product (Exercise):
A.2 3D Planes
ax + by + cz + d = 0. (68)
x̃ · m̃ = 0. (69)
a · x + d = 0. (70)
a · x1 + d = 0
(71)
a · x2 + d = 0.
That is,
a · (x1 − x2 ) = 0. (72)
Since the vector x1 − x2 is on the plane, a must be normal to the plane.
Then, the plane can also be represented by the unit normal vector
u = a/kak of the plane.
A.3 3D Lines
p + λu (74)
where p is a point on the line, u is the unit direction vector of the line,
and λ is a parameter.
D u
B Normalized Image
ρ x̃ = KX. (77)
ρ x̄ = K′ X = I X = X. (78)
ρ x̃ = KX = K I X = ρKx̄, (79)
−1
x̄ = K x̃. (80)
Image plane containing x̄ is normalized image plane.
Can think of X as projecting first to the normalized image plane,
then to the real image plane.
Can derive normalized image from real image if K is known.
(CS6240) Multiple-View Methods 56 / 64
Appendix C Homography
C Homography
Π Π’
C C’
Let x̃i = [xi , yi , 1]⊤ and x̃′i = [wi x′i , wi yi′ , wi ]⊤ = [ui , vi , wi ]⊤ , for any
wi 6= 0, denote their homogeneous coordinates.
Then,
ui h11 h12 h13 xi
vi = x̃′i = Hx̃i = h21 h22 h23 yi .
(81)
wi h31 h32 h33 1
h11
D Camera Calibration
Software is available:
Zhang’s method [Zha00]:
Use a single plane checkerboard pattern.
Website: research.microsoft.com/en-us/um/people/zhang/calib/
Bouguet’s toolbox [Bou]:
Based on Zhang’s method.
Website: www.vision.caltech.edu/bouguetj/calib doc/
C version is available in OpenCV library.
Reference I
J.-Y. Bouguet.
Camera calibration toolbox for Matlab.
R. I. Hartley.
In defense of the eight-point algorithm.
IEEE Trans PAMI, 19(6):580–593, 1997.
B. K. P. Horn, H. M. Hilden, and S. Negahdaripour.
Closed-form solution of absolute orientation using orthonormal
matrices.
J. Optical Society of America A, 5(7):1127–1135, 1988.
R. Jain, R. Kasturi, and B. G. Schunck.
Machine Vision.
McGraw-Hill, 1995.
Reference II