Introduction to computer vision 9
Jean Ponce
Zuhaib Akhtar za2023@nyu.edu
Ayush Jain aj3152@nyu.edu
Slides will be available after classes
Stereopsis
ordering, smoothness
Basic stereo matching algorithm
Rectification
All epipolar lines are parallel in the rectified image plane.
Rectification example
Epipolar constraint example
Reconstruction from Rectified Images
Disparity: d=u’-u.
Depth: z = -B/d.
Binocular fusion: a problem of correspondence
A Cooperative Model (Marr and Poggio, 1976)
Excitory connections: continuity
Inhibitory connections: uniqueness
Iterate: C = Σ C - wΣ C + C .
e
i
0
A Cooperative Model (Marr and Poggio, 1976)
Excitory connections: continuity
Inhibitory connections: uniqueness
Iterate: C = Σ C - wΣ C + C .
e
i
0
Reprinted from Vision: A Computational Investigation into the Human Representation and Processing of Visual Information by David Marr.
© 1982 by David Marr. Reprinted by permission of Henry Holt and Company, LLC.
Correlation Methods (1970--)
Normalized Correlation: minimize θ instead.
Slide the window along the epipolar line until w.w’ is maximized.
Left
Right
scanline
Correlation-based methods
Norm. corr
Failures of correlation-based methods
Textureless surfaces
Occlusions, repetition
Non-Lambertian surfaces, specularities
Effect of window size
W = 3
W = 20
Results
Correlation-based matching
Ground truth
Data
Correlation Methods: Foreshortening Problems
Solution: add a second pass using disparity estimates to warp
the correlation windows, e.g. Devernay and Faugeras (1994).
Reprinted from “Computing Differential Properties of 3D Shapes from Stereopsis without 3D Models,” by F. Devernay and O. Faugeras,
Proc. IEEE Conf. on Computer Vision and Pattern Recognition (1994). © 1994 IEEE.
How can we improve window-based matching?
Non-local constraints
Non-local constraints
Non-local constraints
Ordering constraint does not (always) hold
Non-local constraints
Scanline stereo
Left image
Right image
“Shortest paths” for scan-line stereo
Left image
Right image
Can be implemented with dynamic programming
(Baker & Binford’81, Ohta & Kanade ’85)
correspondence
q
p
Left occlusion
t
Right
occlusion
s
Slide credit: Y. Boykov
Shortest path stereo in real life
Stereo matching as energy minimization
I1
I2
D
Y. Boykov, O. Veksler, and R. Zabih, Fast Approximate Energy Minimization via Graph Cuts, PAMI 2001
W1(i )
W2(i+D(i ))
D(i )
Combinatorial optimization with unary and binary terms
Quadratic pseudo-Boolean
function optimization
Binary variables
Generalization to integer variables
k
Quadratic integer function optimization
Submodular case
Min-cut max-flow problems
(Boros & Hammer, 2002)
Otherwise
NP hard
Efficient exact algorithms
(Ford & Fulkerson ‘56)
(Goldberg & Tarjan ‘88)
(Boykov & Kolgomorov ’04)
Quadratic integer function optimization
For example:
with g convex (Ishikawa ‘03)
Min-cut max-flow problems
(Boros & Hammer, 2002)
Otherwise
NP hard
Efficient exact algorithms
(Ford & Fulkerson ‘56)
(Goldberg & Tarjan ‘88)
(Boykov & Kolgomorov ’04)
Quadratic pseudo-Boolean function optimization
For example:
with g convex (Ishikawa ‘03)
Min-cut max-flow problems
(Boros & Hammer, 2002)
Otherwise
NP hard
Efficient
approximate
algorithms
(Boykov et al.’01)
Combinatorial optimization:
certain stereo settings (use non-convex g for example)
such as alpha expansion (Boykov et al.
2001)
Graph cuts
Ground truth
For the latest and greatest: http://www.middlebury.edu/stereo
Y. Boykov, O. Veksler and R. Zabih, “Fast Approximate Energy
Minimization via Graph Cuts, PAMI 2001.
Results
More Views (Okutami and Kanade, 1993)
Pick a reference image, and slide the corresponding
window along the corresponding epipolar lines of all
other images, using inverse depth relative to the first
image as the search parameter.
Use the sum of correlation scores to rank matches.
Reprinted from “A Multiple-Baseline Stereo System,” by M. Okutami and T. Kanade, IEEE Trans. on Pattern
Analysis and Machine Intelligence, 15(4):353-363 (1993). \copyright 1993 IEEE.
I1
I2
I10
Reprinted from “A Multiple-Baseline Stereo System,” by M. Okutami and T. Kanade, IEEE Trans. on Pattern
Analysis and Machine Intelligence, 15(4):353-363 (1993). \copyright 1993 IEEE.
Structure from motion
The Euclidean (perspective) Structure-from-Motion Problem
Given m (internally) calibrated perspective images of n fixed
points Pj we can write
Problem: estimate the m 3x4 matrices Mi = [Ri ti] and
the n positions Pj from the mn correspondences pij .
2mn equations in 11m (or rather 5m)+3n unknowns
Overconstrained problem, that can be solved
using (non-linear) least squares!
(Normalized coordinates)
The Euclidean Ambiguity of Euclidean SFM
If Ri, ti, and Pj are solutions,
So are Ri’, ti’, and Pj’, where
In fact, the absolute scale cannot be recovered since:
When the intrinsic parameters are known (normalized coordinates)
Euclidean ambiguity up to a similarity transformation.
Euclidean motion from E (Longuet-Higgins, 1981)
Singular Value Decomposition
square roots of
Euclidean motion from E (Longuet-Higgins, 1981)
SVD F= UWVT, compute E=U diag(1,1,0) VT.
Euclidean motion from E (Longuet-Higgins, 1981)
Euclidean motion from E (Longuet-Higgins, 1981)
Euclidean motion from E (Longuet-Higgins, 1981)
Euclidean reconstruction. Mean relative error: 3.1%