3-D Scene
u
u’
Study the mathematical relations between corresponding image points.
“Corresponding” means originated from the same 3D point.
Objective
Two-views geometryOutline
Background: Camera, Projection models Necessary tools: A taste of projective geometry Two view geometry:
Planar scene (homography ). Non-planar scene (epipolar geometry).
3D reconstruction (stereo).
A few words about Cameras
Camera obscura dates from 15th century First photograph on record shown in the book – 1826 The human eye functions very much like a camera
History Camera Obscura
"Reinerus Gemma-Frisius, observed an eclipse of the sun at Louvain on January 24, 1544, and later he used this illustration of the event in his book De Radio Astronomica et Geometrica, 1545. It is thought to be the first published illustration of a camera obscura..." Hammond, John H., The Camera Obscura, A Chronicle
6
The first “photograph”www.hrc.utexas.edu/exhibitions/permanent/wfp/
Joseph Nicéphore Niépce.View from the Window at Le Gras.
A few words about Cameras
Current cameras contain a lens and a recording device (film, CCD, CMOS)
Basic abstraction is the pinhole camera
A few words about LensesIdeal Lenses
Lens acts as a pinhole (for 3D points at the focal depth).
Regular LensesE.g., the cameras in our lab.
To learn more on lens-distortion see Hartley & Zisserman Sec. 7.4 p.189.Not part of this class.
Modeling a Pinhole Camera (or projection)
Single View Geometry
f
X
P Y
Z
x
p y
f
∏
Modeling a Pinhole Camera (or projection)
Perspective Projection
f Xx
Zf Y
yZ
Origin (0,0,0) is the Focal center X,Y (x,y) axis are along the image axis (height / width). Z is depth = distance along the Optical axis f – Focal length
Projection
x y f
X Y Z
f
y
Z
X
Y
f Xx
Zf Y
yZ
P=(X,Y,Z)
f
Projection
x y f
X Y Z
f
y
Z
X
Y
f Xx
Zf Y
yZ
P=(X,Y,Z)
f
Orthographic Projection
•Projection rays are parallel•Image plane is fronto-parallel(orthogonal to rays)
•Focal center at infinity
x X
y Y
Scaled Orthographic ProjectionAlso called “weak perspective”
x sX
y sY
0
fsZ
Pros and Cons of Projection Models Weak perspective has simpler math.
Accurate when object is small and distant. Useful for object recognition.
When accuracy really matters (SFM), we must model the real camera (Pinhole / perspective ): Perspective projection, calibration parameters (later), and
all other issues (radial distortion).
Two-views geometryOutline
Background: Camera, Projection Necessary tools: A taste of projective geometry Two view geometry:
Planar scene (homography ). Non-planar scene (epipolar geometry).
3D reconstruction from two views (Stereo algorithms)
Hartley & Zisserman: Sec. 2 Proj. Geom. of 2D.Sec. 3 Proj. Geom. of 3D.
Reading
Hartley & Zisserman:
Sec. 2 Proj. Geo. of 2D:• 2.1- 2.2.3 point lines in 2D• 2.3 -2.4 transformations • 2.7 line at infinity
Sec. 3 Proj. Geo. of 3D. • 3.1 – 3.2 point planes & lines. • 3.4 transformations
Euclidean Geometry is good for
questions like:
what objects have the same shape (= congruent)
Same shapes are related by rotation and translation
Why not Euclidian Geometry(Motivation)
Where do parallel lines meet?
Parallel lines meet at the horizon (“vanishing line”)
Why Projective Geometry (Motivation)
Coordinates in Euclidean Line R1
0 1 2 3 ∞
Not in space
Coordinates in Projective Line P1
-1 0 1 2 ∞
k(0,1)
k(1,0)
k(2,1)k(1,1)k(-1,1)
Realization: Points on a line P1
“Ideal point”
Take R2 –{0,0} and look at scale equivalence class (rays/lines trough the origin).
Coordinates in Projective Plane P2
k(0,0,1)
k(x,y,0)
k(1,1,1)
k(1,0,1)
k(0,1,1)
“Ideal point”
Take R3 –{0,0,0} and look at scale equivalence class (rays/lines trough the origin).
z
y
x
z
y
x
Projective Line vs. the Real Line
-1 0 1 2 ∞
k(0,1)
k(1,0)
k(2,1)k(1,1)k(-1,1)
“Ideal point”
SymbolRP1
SpaceThe real lineR^2 – {0,0}
Objects (points)pointsEquivalence classes (2D “rays”)
RealizationIntersection with line y=1
Projective Plane vs Euclidian plane
k(0,0,1)
k(x,y,0)
k(1,1,1)
k(1,0,1)
k(0,1,1)“Ideal line”
SymbolR2P2
SpaceThe real planeR3 – {0,0,0}
Objects (points)pointEquivalence classes (3D rays)
RealizationIntersection with plane z=1
2D Projective Geometry: Basics A point:
A line:
we denote a line with a 3-vector
Line coordinates are homogenous
Points and lines are dual: p is on l if
Intersection of two lines/points
2 2( , , ) ( , )T Tx yx y z P
z z
0 ( ) ( ) 0x y
ax by cz a b cz z
0Tl p
1 2 ,l l 1 2p p
( , , )Ta b c
ll
Cross Product
1 2 1 2 1 2
1 2 1 2 1 2
1 2 1 2 1 2
x x y z z y
y y z x x z
z z x y y x
0T Tw u v w u w v
Every entry is a determinant of the two other entries
w Area of parallelogram bounded by u and v
Hartley & Zisserman p. 581
Cross Product in matrix notation [ ]x
0
0
0
xy
xz
yz
x
tt
tt
tt
t1 2 1 2 1 2
1 2 1 2 1 2
1 2 1 2 1 2
x x y z z y
y y z x x z
z z x y y x
0
0
0
x y z z y
y z x z x
z x y y x
t x t z t y t t x
t y t x t z t t y
t z t y t x t t z
Hartley & Zisserman p. 581
ptpt x
Example: Intersection of parallel lines
00
)(
0
)(
)(
2122
21
21 a
b
a
b
cccca
ccb
ll
1 2 1 2 1 2
1 2 1 2 1 2
1 2 1 2 1 2
x x y z z y
y y z x x z
z z x y y x
Q: How many ideal points are there in P2?A: 1 degree of freedom family – the line at infinity
),,( ),,( 2211 cbalcbal
Projective Transformations
u
u’
Transformations of the projective line
1P
Pencil of raysPerspective mapping
A perspective mapping is a projective transformation T:P1 P1
Perceptivity is a special projective mapping. Hartley & Zisserman p. 632Lines connecting corresponding points are “concurrent”
40
Perspectivities Projectivities Perspectivities are not a group
ityperspectiv a is 1 Ll ityperspectiv a is 2lL
ityperspectiv anot is 21 ll
L
l1 l2
Projective transformations of the projective line
dycx
byax
y
xG dc
ba
:
1/
//
dc
dbda
dc
ba
11'
''
1 xc
bxax G
Given a 2D linear transformation G:R2 R2 Study the induced transformation on the Equivalents classes.
1'
''
xc
bxax GOn the realization y=1 we get:
Properties:1'
''
xc
bxax T
dc
baT
1. Invertible (T-1 exists) 2. Composable (To G is a projective transformation)3. Closed under composition
• Has 4 parameters • 3 degrees of freedom • Defined by 3 points
TT Every point defines 1 constraint
Ideal points and projective transformations
Projective transformation can map ∞ to a real point
Plane Perspective
2P
cos sin, , det 1
sin cosTR R R I R
Rotation:
Translation:x
y
tt
t
2 2, 1, (2)a b
R a b R SOb a
Euclidean Transformations (Isometries)
q Rp t
Rotation:Translation:
Hierarchy of 2D Transformations
Rigid (Isometry)
Similarity
Affine
Projective
Scale
Hartley & Zisserman p. Sec. 2.4