Lecture1
Lecture1
Xiaoming Liu
Thank many researchers who have made their slides and course materials available
1
Let’s Take a Picture!
Photosensitive Material
Idea 1: Just use film Result: Junk
Slide inspired by S. Seitz; image from Michigan Engineering 4
Let’s Take a Picture!
Photosensitive Material
Idea 2: add a barrier
Slide inspired by S. Seitz; image from Michigan Engineering 5
Let’s Take a Picture!
Photosensitive Material
Idea 2: add a barrier
Slide inspired by S. Seitz; image from Michigan Engineering 6
Let’s Take a Picture!
Photosensitive Material
Film captures all the rays going through a point (a
pencil of rays).
Result: good in theory!
Source: A. Efros 8
Camera Obscura
9
Camera Obscura
http://www.abelardomorell.net/project/camera-obscura/ 10
Source: D Fouhey
11
Abelardomorell.com
Camera Obscura
https://www.youtube.com/watch?time_continue=227&v=WfRiBSEfCFQ&feature=emb_logo
Source: A. Torralba, W. Freeman Accidental Pinhole and Pinspeck Cameras, CVPR 2012 12
Projection
P O
X
X’
P O
d
b θ
a θ c
𝑎 𝑑 𝑏𝑑
= 𝑎=
𝑏 𝑐 𝑐
15
Projection Equations
f y
X (x,y,z)
O z
P x
18
Some Facts About Projection
Illusion Credit: RN Shepard, Mind Sights: Original Visual Illusions, Ambiguities, and other Anomalies 21
What’s Lost?
Is she shorter or further
away?
Are the orange lines we
see parallel / perpendicular
/ neither to the red line?
24
Source: D Fouhey
Do You Always Get Perspective?
25
Source: D Fouhey
Do You Always Get Perspective?
Y location of 𝒇𝒚 𝒇𝒚 𝒇𝒚 𝒇𝒚
blue and red
𝒛𝟐 𝒛𝟏 𝒛 𝒛
dots in image: 26
Source: D Fouhey
Do You Always Get Perspective?
When plane is fronto-parallel
(parallel to camera plane),
everything is:
• scaled by f/z
• otherwise is preserved.
27
Source: D Fouhey
What’s This Useful For?
f y
X
P O z
x
(x,y,z) → (fx/z,fy/z)
I promised you linear algebra: is this linear?
Nope: division by z is non-linear
(and risks division by 0) 29
Adapted from S. Seitz slide
Homogeneous Coordinates (2D)
Trick: add a dimension!
This also clears up lots of nasty special cases
𝑎𝑥 + 𝑏𝑦 + 𝑐 = 0
Homogeneous Coordinates
𝑎 𝑥
!
𝒍 𝒑 = 0, 𝒍 = 𝑏 ,𝒑 = 𝑦
𝑐 1
33
Source: D Fouhey
Benefits of Homogeneous Coords
0x + 1y - 2 = 0
1x + 0y - 1 = 0
[0,1,-2] x [1,0,-1] = [-1,-2,-1]
Converting back (divide by -1)
(1,2)
34
Source: D Fouhey
Benefits of Homogeneous Coords
0x + 1y - 2 = 0
0x + 1y - 1 = 0
Xiaoming Liu
37
Recap: Homogeneous Coords
Line of y=2 in
ax+by+c=0:
0x + 1y - 2 = 0
𝑎, 𝑏, 𝑐 = 0,1, −2
𝑥, 𝑦 = (1,2)
Append 1
𝑢, 𝑣, 𝑤 = (1,2,1) Point-on-line test: lTp
Divide by w 𝑎, 𝑏, 𝑐 ! 𝑢, 𝑣, 𝑤 =
𝑥, 𝑦 = (1,2) 0,1, −2 ! 1,2,1 = 0
38
Source: D Fouhey
Recap: Homogeneous Coords
0x + 1y - 3 = 0
0x + 1y - 2 = 0
0x + 1y - 1 = 0
𝑢
𝑥 𝑢/𝑡
𝑣
𝑦 𝑣/𝑡
𝑤
𝑧 𝑤/𝑡
𝑡
42
Source: D Fouhey
Projection Matrix
f
O
𝑥
𝑓𝑥 𝑓 0 0 0
𝑦 𝑓𝑥/𝑧
𝑓𝑦 ≡ 0 𝑓 0 0 𝑧 → dis
𝑓𝑦/𝑧
𝑧 0 0 1 0 1
f
O
𝑥
𝑓𝑥 𝑓 0 0 0
𝑦 𝑓𝑥/𝑧
𝑓𝑦 ≡ 0 𝑓 0 0 𝑧 →
𝑓𝑦/𝑧
𝑧 0 0 1 0 1
X
X’
P O
P: 2D homogeneous X: 3d homogeneous
point (3D) point (4D)
𝑓 0 𝑢$
𝑷≡ 0 𝑓 𝑣$ 𝑹%&% 𝒕%&' 𝑿(&'
0 0 1
46
Source: D Fouhey
Typical Perspective Model
47
Source: D Fouhey
Typical Perspective Model
48
Source: D Fouhey
Typical Perspective Model
Intrinsic Extrinsic
Matrix K Matrix [R,t]
𝑓 0 𝑢$
𝑷 ≡ 0 𝑓 𝑣$ 𝑹%&% 𝒕%&' 𝑿(&'
0 0 1
𝑷 ≡ 𝑲 𝑹, 𝒕 𝑿 ≡ 𝑴!"# 𝑿#"$
49
Source: D Fouhey
Other Cameras – Orthographic
1 0 0
𝑷= 0 1 0 𝑿&$"
0 0 0
1 0 0 𝑥
𝑷= 0 1 0 𝑦
0 0 0 𝑧
51
Source: D Fouhey
The Big Issue
Photosensitive Material
Film captures all the rays going through a point (a
pencil of rays).
How big is a point?
• Other issues
• Light is limited
• Spooky stuff happens with infinitely small holes
58
Limitations of Pinhole Model
Ideal Pinhole
-1 point generates 1 image
-Low-light levels
Finite Pinhole
-1 point generates region
-Blurry.
Why is it blurry?
focal point
“circle of
confusion”
D D′
f
y
y′
D D′
f
1 1 1
+ =
𝐷 𝐷′ 𝑓
http://www.cambridgeincolour.com/tutorials/depth-of-field.htm
Diagram: Wikipedia 72
Varying the Aperture
74
Field of View (FOV)
Photo. Material
𝜙
𝑑
𝑑
𝜙 = tan)'
2𝑓
tan-1 is monotonic increasing.
How can I get the FOV bigger?
75
Source: D Fouhey
Field of View
• First a pinhole…
• Then a thin lens model….
Slide: L. Lazebnik 81
Lens Flaws: Radial Distortion
Lens imperfections cause distortions as a function
of distance from optical axis
Photo. Material
f
z r
y'
Ideal Distorted
𝑦 𝑦
𝑦′ = 𝑓 𝑦′ = (1 + 𝑘' 𝑟 * + ⋯ )
𝑧 𝑧 83
Source: D Fouhey
Vignetting
Photo. Material
What happens to the light between the
black and red lines?
Slide: L. Lazebnik 86
Lens Flaws: Chromatic Abberation
Lens refraction index is a function of the
wavelength. Colors “fringe” or bleed
90
Source: D Fouhey
Preview of What’s Next
Bayer grid
Demosaicing:
Estimation of missing components
from neighboring values
96
97