Professional Documents
Culture Documents
James Hays
f = focal length
c = center of the camera
3D world 2D image
Point of observation
Who is taller?
Which is closer?
Length is not preserved
A’
C’
B’
Parallel?
Perpendicular?
Projective Geometry
What is preserved?
• Straight lines are still straight
Vanishing points and lines
Parallel lines in the world intersect in the image at a
“vanishing point”
Vanishing points and lines
Vertical vanishing
point
(at infinity)
Vanishing
line
Vanishing
Vanishing
point
point
.
X
Optical P Y
Center
Z
. .
(u0, v0)
f Z Y
.
Camera
Center (tx,
u ty , t z )
u
p
v
Homogeneous coordinates
Conversion
Converting to homogeneous coordinates
Invariant to scaling
x kx
kx
kw w
x
k y ky ky y
w kw kw w
Homogeneous Cartesian
Coordinates Coordinates
Projection matrix
R,T
jw
kw
Ow
iw
x KR t X
x: Image Coordinates: (u,v,1)
K: Intrinsic Matrix (3x3)
R: Rotation (3x3)
t: Translation (3x1)
X: World Coordinates: (X,Y,Z,1)
Interlude: why does this matter?
Object Recognition (CVPR 2006)
Inserting photographed objects into images
(SIGGRAPH 2007)
Original Created
Projection matrix
x
u f 0 0 0
y
x K I 0 X wv 0
f
0 0
z
1 0 0 1 0
1
Slide Credit: Saverese
Remove assumption: known optical center
x
u f 0 u0 0
y
x K I 0 X wv 0
f v0
0
z
1 0 0 1 0
1
Remove assumption: square pixels
x
u 0 u0 0
y
x K I 0 X wv 0 v0
0
z
1 0 0 1 0
1
Remove assumption: non-skewed pixels
x
u s u0 0
y
x K I 0 X wv 0
v0
0
z
1 0 0 1 0
1
t kw
Ow
iw
Allow camera translation
x
u 0 u0 1 0 0 t x
y
x K I t X wv 0
v0 0 1 0 t y
z
1 0 0 1 0 0 1 t z
1
Slide Credit: Saverese
3D Rotation of Points
1 0 0
Rx ( ) 0 cos sin
p’
0 sin cos
cos 0 sin
R y ( ) 0 1 0
p
y sin 0 cos
cos sin 0
Rz ( ) sin cos 0
z
0 0 1
Allow camera rotation
x K R t X
x
u s u0 r11 r12 r13 tx
y
wv 0 v0 r21 r22 r23
ty
z
1 0 0 1 r31 r32 r33 t z
1
Degrees of freedom
x K R t X
5 6
x
u s u0 r11 r12 r13 tx
y
wv 0 v0 r21 r22 r23
ty
z
1 0 0 1 r31 r32 r33 t z
1
Orthographic Projection
• Special case of perspective projection
– Distance from the COP to the image plane is infinite
Image World
x
u f 0 0 0
– Also called “weak perspective” y
w v 0 f 0 0
– What’s the projection matrix? z
1 0 0 0 s
1
Slide by Steve Seitz
Field of View (Zoom)
Suppose we have two 3D cubes on the ground
facing the viewer, one near, one far.
1. What would they look like in perspective?
2. What would they look like in weak perspective?
vanishing lines
point point
• Homogeneous
coordinates