Camera Projection: Reading: T&V Section 2.4
Camera Projection: Reading: T&V Section 2.4
Lecture 12:
Camera Projection
Reading: T&V Section 2.4
Robert Collins
CSE486, Penn State
Imaging Geometry
W
Object of Interest
in World Coordinate
System (U,V,W)
V
U
Robert Collins
CSE486, Penn State
Imaging Geometry
Camera Coordinate
Y System (X,Y,Z).
X Z
• Z is optic axis
f • Image plane located f units
out along optic axis
• f is called focal length
Robert Collins
CSE486, Penn State
Imaging Geometry
W
Y y
X Z x
V
U
W
Y y
X Z x
V
u U
V
u U
v Pixel
Coordinates
Robert Collins
CSE486, Penn State
Forward Projection
3D-to-2D Projection
• perspective projection
O.Camps, PSU
Robert Collins
CSE486, Penn State
Basic Perspective Projection
Scene Point Perspective Projection Eqns
P = (X,Y,Z)
X
Image Point y x f
Y
p = (x,y,f) X Y
Z
x Y
Z
y
y f
x
X
f Z
Z derived via similar
O
triangles rule
x X
f
Z
O.Camps, PSU
Robert Collins
CSE486, Penn State
Basic Perspective Projection
Scene Point Perspective Projection Eqns
P = (X,Y,Z)
X
Image Point y x f
Y
p = (x,y,f) X Y
Z
x Y
Z
y
y f
x
X
f Z
Z derived via similar
O
triangles rule
X Y
y
x
f f
Z Z
O.Camps, PSU
Robert Collins
CSE486, Penn State
Basic Perspective Projection
Scene Point Perspective Projection Eqns
P = (X,Y,Z)
X
Image Point y x f
Y
p = (x,y,f) X Y
Z
x Y
Z
y
y f
x
X
f Z
Z
O
O.Camps, PSU
Robert Collins
CSE486, Penn State
Homogeneous Coordinates
Represent a 2D point (x,y) by a 3D point (x’,y’,z’) by
adding a “fictitious” third coordinate.
X X
x f x' f 0 0 0
y ' 0 Y
Z
f 0 0
Y Z
y f z ' 0 0 1 0
Z 1
Robert Collins
CSE486, Penn State
Forward Projection
PC PW
W
X
U
Z V
PC PW
W
X
U
R Z V
C
Rotate to Translate by - C
align axes (align origins)
P C = R ( PW - C )
Robert Collins
P C = R ( PW - C )
X
Left camera located at world origin (0,0,0)
and camera axes aligned with world coord axes.
Robert Collins
CSE486, Penn State
Simple Stereo, Left Camera
=
Robert Collins
Left camera
Robert Collins
CSE486, Penn State
Example: Simple Stereo System
Y Z
(X,Y,Z)
z
left y
camera
located at ( , )
z
(0,0,0) y ( , )
x right
camera
Tx located at
x (Tx,0,0)
X
Right camera located at world location (Tx,0,0)
and camera axes aligned with world coord axes.
Robert Collins
CSE486, Penn State
Simple Stereo, Right Camera
=
Robert Collins
Left camera
Right camera
Robert Collins
CSE486, Penn State
Bob’s sure-fire way(s) to
figure out the rotation
X r11 r12 r13 1 0 0 cx U
Y r21 r22 r23 1 about
0forget 0 thiscy V
while thinking
Z r31 r32 r33 0 rotations
0about 1 cz W
1 0 0 0 1 0 0 0 1 1
PC = R P W
This equation says how vectors in the world coordinate
system (including the coordinate axes) get transformed
into the camera coordinate system.
Robert Collins
CSE486, Penn State
Figuring out Rotations
X r11 r12 r13 U
Y r21 r22 r23 V PC = R P W
Z r31 r32 r33 W
1 0 0 0 1 1
what if world x axis (1,0,0) corresponds to camera axis (a,b,c)?
X
a r11 r12 r13 U
1 X
a ra11 r12 r13 U
1
Y
b r21 r22 r23 V
0 Y
b rb21 r22 r23 V
0
Z
c r31 r32 r33 0
W Z
c rc31 r32 r33 0
W
1 0 0 0 1 1 1 0 0 0 1 1
we can immediately write down the first column of R!
Robert Collins
CSE486, Penn State
Figuring out Rotations
and likewise with world Y axis and world Z axis...
PC = R P W R-1PC = PW RTPC = PW
y
z
x
0 0 1 0 -1 0
Rtrain 0 -1 0 Rfly 0 0 1
1 0 0 -1 0 0
Robert Collins
CSE486, Penn State Note: External Parameters
also often written as R,T
X r11 r12 r13 1 0 0 cx U
Y r21 r22 r23 0 1 0 cy V
Z r31 r32 r33 0 0 1 cz W
1 0 0 0 1 0 0 0 1 1