Geometry of a single camera
Slides from Derek Hoiem, Svetlana Lazebnik
Geometry of a single camera Slides from Derek Hoiem, Svetlana - - PowerPoint PPT Presentation
Geometry of a single camera Slides from Derek Hoiem, Svetlana Lazebnik Our goal: Recovery of 3D structure J. Vermeer, Music Lesson , 1662 A. Criminisi, M. Kemp, and A. Zisserman,Bringing Pictorial Space to Life: computer techniques for the
Slides from Derek Hoiem, Svetlana Lazebnik
analysis of paintings, Proc. Computers and the History of Art, 2002
http://en.wikipedia.org/wiki/Ames_room
x X? X? X?
Rashad Alakbarov shadow sculptures
Image source
https://en.wikipedia.org/wiki/Anamorphosis
hold, we can recover structure from a single view
multi-view geometry
Image source
single camera…
center is at the origin, the principal axis is the z-axis, x and y axes of the image plane are parallel to x and y axes of the world
world coordinate system to image coordinate system
world coordinate system
) / , / ( ) , , ( Z Y f Z X f Z Y X !
÷ ÷ ÷ ÷ ÷ ø ö ç ç ç ç ç è æ ú ú ú û ù ê ê ê ë é = ÷ ÷ ÷ ø ö ç ç ç è æ ÷ ÷ ÷ ÷ ÷ ø ö ç ç ç ç ç è æ 1 1 1 Z Y X f f Z Y f X f Z Y X !
image plane
principal point
) / , / ( ) , , (
y x
p Z Y f p Z X f Z Y X + + !
÷ ÷ ÷ ø ö ç ç ç è æ + + ÷ ÷ ÷ ÷ ÷ ø ö ç ç ç ç ç è æ Z p Z Y f p Z X f Z Y X
y x
! 1
We want the principal point to map to (px, py) instead of (0,0)
px py
÷ ÷ ÷ ÷ ÷ ø ö ç ç ç ç ç è æ ú ú ú û ù ê ê ê ë é = 1 1 Z Y X p f p f
y x
principal point:
) , (
y x p
p
px py
÷ ÷ ÷ ÷ ÷ ø ö ç ç ç ç ç è æ ú ú ú û ù ê ê ê ë é = 1 1 Z Y X p f p f
y x
÷ ÷ ÷ ÷ ÷ ø ö ç ç ç ç ç è æ ú ú ú û ù ê ê ê ë é ú ú ú û ù ê ê ê ë é = ÷ ÷ ÷ ø ö 1 1 1 1 1 Z Y X p f p f Zp Zp
y x y x
calibration matrix
K
principal point:
) , (
y x p
p
px py
÷ ÷ ÷ ÷ ÷ ø ö ç ç ç ç ç è æ ú ú ú û ù ê ê ê ë é = 1 1 Z Y X p f p f
y x
projection matrix
[I | 0]
ú ú ú û ù ê ê ê ë é = ú ú ú û ù ê ê ê ë é ú ú ú û ù ê ê ê ë é = 1 1 1
y y x x y x y x
p f p f m m K b a b a
mx pixels per meter in horizontal direction, my pixels per meter in vertical direction
Pixel size:
y x
m m 1 1 ´
pixels/m m pixels
C ~ X ~ R X ~
cam
coordinate frame will be related to the world coordinate frame by a rotation and a translation
in camera frame
in world frame
in world frame
(in non-homogeneous coordinates):
camera coordinate system world coordinate system
C ~ X ~ R X ~
cam
3D transformation matrix (4 x 4)
C ~ X ~ R X ~
cam
3D transformation matrix (4 x 4)
3D transformation matrix (4 x 4) perspective projection matrix (3 x 4) 2D transformation matrix (3 x 3)
C ~ R t
ú ú ú û ù ê ê ê ë é = ú ú ú û ù ê ê ê ë é ú ú ú û ù ê ê ê ë é = 1 1 1
y y x x y x y x
p f p f m m b a b a K
to world coordinate system
camera center?
camera center in world frame
1 ~ ~ = ú û ù ê ë é
C C R R K PC
The camera center is the null space of the projection matrix!
Source: D. Hoiem
and known image projections xi, estimate the camera parameters
Xi xi
i i
PX x = l
= ´
i i
PX x
1
3 2 1
= ú ú ú û ù ê ê ê ë é ´ ú ú ú û ù ê ê ê ë é
i T i T i T i i
y x X P X P X P
3 2 1
= ÷ ÷ ÷ ø ö ç ç ç è æ ú ú ú û ù ê ê ê ë é
P P X X X X X X
T i i T i i T i i T i T i i T i
x y x y
Two linearly independent equations
independent equations
3 2 1 1 1 1 1 1 1
= ÷ ÷ ÷ ø ö ç ç ç è æ ú ú ú ú ú ú û ù ê ê ê ê ê ê ë é
P P X X X X X X X X
T n n T T n T n n T n T T T T T T T
x y x y ! ! !
we will get degenerate solutions (Π,0,0), (0,Π,0), or (0,0,Π)
3 2 1 1 1 1 1 1 1
= ÷ ÷ ÷ ø ö ç ç ç è æ ú ú ú ú ú ú û ù ê ê ê ê ê ê ë é
P P X X X X X X X X
T n n T T n T n n T n T T T T T T T
x y x y ! ! !
but it doesn’t directly tell us the camera parameters
parameters
points and estimated projections of 3D points
focal length and orthogonality ú ú ú ú û ù ê ê ê ê ë é ú ú ú û ù ê ê ê ë é = ú ú ú û ù ê ê ê ë é 1 * * * * * * * * * * * * Z Y X y x l l l
vs.
Camera Center
Slide from A. Efros, S. Seitz, D. Hoiem
images (with known camera matrices), find the coordinates of the point
images (with known camera matrices), find the coordinates of the point
O1 O2 x1 x2 X?
corresponding to x1 and x2, but because of noise and numerical errors, they don’t meet exactly
O1 O2 x1 x2 X?
viewing rays and let X be the midpoint of that segment
O1 O2 x1 x2 X
Find X that minimizes
O1 O2 x1 x2 X? P1X
2 2
2 2 1 1
P2X
b a b a ] [
´
= ú ú ú û ù ê ê ê ë é ú ú ú û ù ê ê ê ë é
´
z y x x y x z y z
b b b a a a a a a
X P x X P x
2 2 1 1
= =
2 1
l l
X P x X P x
2 2 1 1
= ´ = ´
X ]P [x X ]P [x
2 2 1 1
= =
´ ´
Cross product as matrix multiplication:
X P x X P x
2 2 1 1
= =
2 1
l l
X P x X P x
2 2 1 1
= ´ = ´
X ]P [x X ]P [x
2 2 1 1
= =
´ ´
Two independent equations each in terms of three unknown entries of X
points are not known?
points
Slide from Efros, Photo from Criminisi
points are not known?
points
Vanishing point Vanishing line Vanishing point Vertical vanishing point (at infinity)
Slide from Efros, Photo from Criminisi
Points Lines Lines passing through 2 points Intersection of 2 lines Points at infinity Intersection of 2 parallel lines?
Points Lines Lines passing through 2 points Intersection of 2 lines Points at infinity Intersection of 2 parallel lines?
b a b a ] [
´
= ú ú ú û ù ê ê ê ë é ú ú ú û ù ê ê ê ë é
´
z y x x y x z y z
b b b a a a a a a
image plane line in the scene vanishing point v
vanishing point
camera center
v X0
ú ú ú ú û ù ê ê ê ê ë é + + + = 1
3 2 1
td z td y td x
t
X ú ú ú ú û ù ê ê ê ê ë é + + + = t d t z d t y d t x / 1 / / /
3 2 1
ú ú ú ú û ù ê ê ê ê ë é =
¥ 3 2 1
d d d X
Xt
directions:
infinite vanishing point
v2 v1
v3
directions:
these directions
v2 v1
v3
and z directions
coordinate system
independent scale factors, additional constraints needed to solve for them
4 3 2 1
ú ú ú û ù ê ê ê ë é = ú ú ú û ù ê ê ê ë é = ú ú ú û ù ê ê ê ë é = 1 , 1 , 1
3 2 1
e e e
ú ú ú û ù ê ê ê ë é = ú ú ú û ù ê ê ê ë é = ú ú ú û ù ê ê ê ë é = 1 , 1 , 1
3 2 1
e e e ,
1
=
i i T i i
e e v K R e l
gives constraint on focal length and principal point
ú ú ú û ù ê ê ê ë é = ú ú ú û ù ê ê ê ë é = ú ú ú û ù ê ê ê ë é = 1 , 1 , 1
3 2 1
e e e ,
1
=
i i T i i
e e v K R e l
Can solve for focal length, principal point
Cannot recover focal length, principal point is the third vanishing point
calibration matrix is known
consistent with one another?
Piero della Francesca, Flagellation, ca. 1455
analysis of paintings,
1 2 3 4 1 2 3 4
Approach: unwarp then measure What kind of warp is this?
To unwarp (rectify) an image
– how many points are necessary to solve for H?
p p′
Piero della Francesca, Flagellation, ca. 1455
analysis of paintings,
analysis of paintings,
http://dhoiem.cs.illinois.edu/projects/popup/popup_movie_450_250.mp4
sky vertical ground
Inserting synthetic objects into images: http://vimeo.com/28962540
Legacy Photographs, SIGGRAPH Asia 2011
Camera 3
R3,t3
Figure credit: Noah Snavely
Camera 1 Camera 2
R1,t1 R2,t2
the camera parameters and the 3D points
Camera 3
R3,t3
Camera 1 Camera 2
R1,t1 R2,t2
point in two or more images, compute the 3D coordinates of that point
Camera 3
R3,t3
Camera 1 Camera 2
R1,t1 R2,t2
the camera parameters