Professional Documents
Culture Documents
Lecture 02 - Projective Geometry and Camera Models - Vision - Spring2011 PDF
Lecture 02 - Projective Geometry and Camera Models - Vision - Spring2011 PDF
Derek Hoiem
Administrative Stuff
Office hours
Derek: Wed 4-5pm + drop by
Ian: Mon 3-4pm, Thurs 3:30-4:30pm
HW 1: out Monday
Prob1: Geometry, today and Tues
Prob2: Lighting, next Thurs
Prob3: Filters, following week
Logistics
Next two classes: Single-view Geometry
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
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
Center
. P = Y
(u0, v0)
Z
. f
. Z Y
v
Camera
.u
Center
(tx, ty, tz)
u
p=
v
Homogeneous coordinates
Conversion
Converting to homogeneous coordinates
Invariant to scaling
x kx
kx
w
x
k y = ky ky = y
kw
w kw kw w
Homogeneous Cartesian
Coordinates Coordinates
R,T
jw
kw
Ow
iw
x = K[R 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: when have I used this stuff?
When have I used this stuff?
Object Recognition (CVPR 2006)
When have I used this stuff?
Single-view reconstruction (SIGGRAPH 2005)
When have I used this stuff?
Getting spatial layout in indoor scenes (ICCV
2009)
When have I used this stuff?
Inserting photographed objects into images
(SIGGRAPH 2007)
Original Created
When have I used this stuff?
Inserting synthetic objects into images
Projection matrix
x
u f 0 0 0
x = K [I 0] X wv = 0 y
f 0 0
z
1 0 0 1 0
1
Slide Credit: Saverese
Remove assumption: known optical center
x
u f 0 u0 0
x = K [I 0] X wv = 0 y
f v0 0
z
1 0 0 1 0
1
Remove assumption: square pixels
x
u 0 u0 0
x = K [I 0] X wv = 0 v0
0
y
z
1 0 0 1 0
1
Remove assumption: non-skewed pixels
x
u s u0 0
x = K [I 0] X wv = 0 y
v0 0
z
1 0 0 1 0
1
R
jw
t kw
Ow
iw
Allow camera translation
x
u 0 u0 1 0 0 t x
x = K [I t ] X wv = 0 y
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
wv = 0 v0 r21 y
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
wv = 0 v0 r21 y
r22 r23 ty
z
1 0 0 1 r31 r32 r33 t z
1
Vanishing Point = Projection from Infinity
x
y x xR
p = K[R t ]
p = KR y p = K y R
z
z z R
0
fxR
u f 0 u0 xR u= + u0
zR
wv = 0 f v0 y R
1 0 0 1 z R v=
fyR
+ v0
zR
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
Whats the projection matrix? z
1 0 0 0 s
1
Slide by Steve Seitz
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
Vanishing
point point
Homogeneous
coordinates
Next class
circle of
confusion
focal point
optical center
(Center Of Projection)
Depth of field
f / 5.6
f / 32
fov = tan d
1
2f Focal length
Dolly Zoom or Vertigo Effect
http://www.youtube.com/watch?v=Y48R6-iIYHs
Zoom in while
moving away
http://en.wikipedia.org/wiki/Focal_length