lecture9-2
lecture9-2
Source: S. Lazebnik
34 Computer Vision: Algorithms and Applicati
(a) (b)
2
Amount of horizontal movement is
534
…
Computer Vision: Algorithms and Applications (September 3, 2010 draft)
…inversely proportional to the distance from the camera
3
Depth from Stereo
• Goal: recover depth by finding image coordinate x’
that corresponds to x
X
X
x z
x x’
f f
x'
C Baseline C’
B
4
Optic axes of 2 cameras are parallel
image planes z
camera L f
O Z
xl
baseline b
f
camera R xr
x-b
P=(x,z)
X
Y-axis is
perpendicular
z x z x-b z = y = y to the page.
= =
f xl f xr f yl yr
(from similar triangles)
3D from Stereo Images
For stereo cameras with parallel optical axes,
focal length f, baseline b, corresponding image
points (xl,yl) and (xr,yr), the location of the 3D
point can be derived from previous slide’s
equations:
Depth z = f*b / (xl - xr) = f*b/d
x = xl*z/f or b + xr*z/f
y = yl*z/f or yr*z/f
x'
7
Correspondence Problem
x ?
8
Key idea: Epipolar constraint
X
x x’
x’
x’
9
Epipolar geometry: notation X
x x’
10
Epipolar geometry: notation X
x x’
x x’
12
Epipolar constraint
X
x x’
x’
x’
16
Example
Unrectified
Rectified
17
Left Right
scanline
Matching cost
disparity
scanline
SSD 19
Correspondence search
Left Right
scanline
NCC 20
Effect of window size
W=3 W = 20
• Smaller window
+ More detail
– More noise
• Larger window
+ Smoother disparity maps
– Less detail
– Fails near boundaries 21
Results with window search
Data
22
How can we improve window-based matching?
23
Stereo constraints/priors
• Uniqueness
– For any point in one image, there should be at
most one matching point in the other image
24
Stereo constraints/priors
• Uniqueness
– For any point in one image, there should be at most
one matching point in the other image
• Ordering
– Corresponding points should be in the same order in
both views
25
Stereo constraints/priors
• Uniqueness
– For any point in one image, there should be at most
one matching point in the other image
• Ordering
– Corresponding points should be in the same order in
both views
27
Stereo as energy minimization
Zero-mean SAD
30
Multi-view stereo ?
31
Using more than two images