Lecture 13
Lecture 13
Lecture 13
• Revisiting triangulation.
• Disparity.
• Stereo rectification.
• Stereo matching.
• Structured light.
Slide credits
3D point
More formally…
3D point
image plane
(baseline)
(baseline)
How is X related to x’?
(baseline)
(baseline)
(baseline)
Disparity
(wrt to camera origin of image plane)
(baseline)
Disparity
inversely proportional
to depth
Real-time stereo sensing
Pre-collision
braking
What other vision system uses
disparity for depth sensing?
This is how 3D movies work
Is disparity the only depth cue
the human visual system uses?
So can I compute depth from any two
images of the same object?
So can I compute depth from any two
images of the same object?
image plane
R=I t = (T, 0, 0)
x’
t
Proof in take-home quiz 5
It’s hard to make the image planes exactly parallel
How can you make the epipolar lines horizontal?
Use stereo rectification?
What is stereo rectification?
What is stereo rectification?
Reproject image
planes onto a
common plane
parallel to the line
between camera
centers
Reproject image
planes onto a
common plane
parallel to the line
between camera
centers
Need two
homographies (3x3
transform), one for
each input image
reprojection
C. Loop and Z. Zhang. Computing Rectifying Homographies for Stereo Vision.Computer Vision and Pattern Recognition, 1999.
Stereo Rectification
1. Rotate the right camera by R
(aligns camera coordinate system orientation only)
1. Compute E to get R
2. Rotate right image by R
3. Rotate both images by Rrect
4. Scale both images by H
Stereo Rectification:
rotate by R
1. Compute E to get R
2. Rotate right image by R
3. Rotate both images by Rrect
4. Scale both images by H
Stereo Rectification:
1. Compute E to get R
2. Rotate right image by R
3. Rotate both images by Rrect
4. Scale both images by H
Stereo Rectification:
rotate by Rrect
rotate by Rrect
1. Compute E to get R
2. Rotate right image by R
3. Rotate both images by Rrect
4. Scale both images by H
Stereo Rectification:
1. Compute E to get R
2. Rotate right image by R
3. Rotate both images by Rrect
4. Scale both images by H
Stereo Rectification:
scale by H
scale by H
1. Compute E to get R
2. Rotate right image by R
3. Rotate both images by Rrect
4. Scale both images by H
Stereo Rectification:
1. Compute E to get R
2. Rotate right image by R
3. Rotate both images by Rrect
4. Scale both images by H
Stereo Rectification:
1. Compute E to get R
2. Rotate right image by R
3. Rotate both images by Rrect
4. Scale both images by H
Step 1: Compute E to get R
SVD: Let
image plane
optical axis
Camera Icon
camera center
1. Compute E to get R
2. Rotate right image by R
3. Rotate both images by Rrect
4. Scale both images by H
When do epipolar
lines become
horizontal?
Parallel cameras
epipole at infinity
Setting the epipole to infinity
(Building Rrect from e)
epipole e
Let Given: (using SVD on E)
(translation from E)
orthogonal vector
If and orthogonal
then
If and orthogonal
then
then
* 1 0 -1
filter
image
filter
output
image
Solution 1: Filter the image using the template as filter kernel. What went wrong?
Find this template
How do we detect the template in he following image?
filter
output
image
image
output
thresholding
image False
detections
Solution 2: Filter the image using a zero-mean template. What went wrong?
Find this template
How do we detect the template in he following image?
output
output
filter
image
1-output
filter
thresholding
image
1-output
filter
output
Observations so far:
What will
the output
filter template mean
look like?
output
1-output
True detections
thresholding
1-output
True detections
thresholding
scanline
Matching cost
disparity
Zero-mean SAD
W=3 W = 20
Effect of window size
W=3 W = 20
specularities
Improving stereo matching
Block matching Ground truth
Energy Minimization
{
{
data term smoothness term
Want each pixel to find a good match Adjacent pixels should (usually)
in the other image move about the same amount
(block matching result) (smoothness function)
data term
SSD distance between windows
centered at I(x, y) and J(x+ d(x,y), y)
SSD distance between windows
centered at I(x, y) and J(x+ d(x,y), y)
smoothness term
L1 distance
“Potts model”
One possible solution…
Dynamic Programming
Ground Truth
Y. Boykov, O. Veksler, and R. Zabih, Fast Approximate Energy Minimization via Graph Cuts, PAMI 2001
All of these cases remain difficult, what can we do?
specularities
Structured light
Use controlled (“structured”) light to make correspondences easier
laser
I J
Structured light and one camera
I J
Example: Laser scanner
cameras that take video at the speed of light cameras that measure depth in real time