Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... ·...

113
Multi-View Geometry: Find Corresponding Points (New book: Ch7.4, 7.5, 7.6 Old book: 11.3-11.5) Credit for materials: Trevor Darrell, Berkeley, C280, Marc Pollefeys, UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015

Transcript of Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... ·...

Page 1: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Multi-View Geometry:Find Corresponding Points

(New book: Ch7.4, 7.5, 7.6Old book: 11.3-11.5)

Credit for materials: Trevor Darrell, Berkeley, C280, Marc Pollefeys, UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book

Guido GerigCS 6320 Spring 2015

Page 2: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Excellent Website: http://vision.middlebury.edu/stereo/ 

Page 3: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Stereo reconstruction: main steps

– Calibrate cameras– Rectify images– Compute disparity– Estimate depth

Grauman

Page 4: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Stereo reconstruction: main steps

– Calibrate cameras– Rectify images– Compute disparity– Estimate depth

Grauman

Page 5: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Correspondence problem

Multiple match hypotheses satisfy epipolar constraint, but which is correct? 

Figure from Gee & Cipolla 1999 Grauman

Page 6: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Correspondence problem• Beyond the hard constraint of epipolar geometry, there are “soft” constraints to help identify corresponding points– Similarity– Uniqueness– Ordering– Disparity gradient

Grauman

Page 7: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Correspondence problem• Beyond the hard constraint of epipolar geometry, there are “soft” constraints to help identify corresponding points– Similarity– Uniqueness– Ordering– Disparity gradient

• To find matches in the image pair, we will assume– Most scene points visible from both views– Image regions for the matches are similar in appearance

Grauman

Page 8: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Your basic stereo algorithm

Adapted from Li Zhang Grauman

Page 9: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Your basic stereo algorithm

For each epipolar line:

Adapted from Li Zhang Grauman

Page 10: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Your basic stereo algorithm

For each epipolar line:For each pixel in the left image

Adapted from Li Zhang Grauman

Page 11: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Your basic stereo algorithm

For each epipolar line:For each pixel in the left image

• compare with every pixel on same epipolar line in right image

Adapted from Li Zhang Grauman

Page 12: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Your basic stereo algorithm

For each epipolar line:For each pixel in the left image

• compare with every pixel on same epipolar line in right image

• pick pixel with minimum match cost

Adapted from Li Zhang Grauman

Page 13: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Your basic stereo algorithm

For each epipolar line:For each pixel in the left image

• compare with every pixel on same epipolar line in right image

• pick pixel with minimum match cost

Adapted from Li Zhang Grauman

Page 14: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Your basic stereo algorithm

For each epipolar line:For each pixel in the left image

• compare with every pixel on same epipolar line in right image

• pick pixel with minimum match cost

Improvement: match windows• This should look familiar...• E.g. SSD, correlation etc.

Adapted from Li Zhang Grauman

Page 15: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Stereo matching

• Search is limited to epipolar line (1D)• Look for “most similar pixel”

?

Page 16: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Stereo matching algorithms• Match Pixels in Conjugate Epipolar Lines

– Assume brightness constancy– This is a tough problem– Numerous approaches

• dynamic programming [Baker 81,Ohta 85]• smoothness functionals• more images (trinocular, N‐ocular) [Okutomi 93]

• graph cuts [Boykov 00]

– A good survey and evaluation:  – http://vision.middlebury.edu/stereo/

Page 17: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Correspondence using Discrete Search

Page 18: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Compare intensities pixel‐by‐pixel

Comparing image regions

I(x,y) I´(x,y)

Census

Similarity measures

125 126 125

127 128 130

129 132 135

0 0 0

0 1

1 1 1

(Real-time chip from TYZX based on Census)

only compare bit signature

Page 19: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Sum of Squared Differences (SSD)

Page 20: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Example

Page 21: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Example ctd

Page 22: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Example image pair – parallel cameras

Page 23: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

First image

Page 24: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Second image

Page 25: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Intensity profiles

• Clear correspondence between intensities, but also noise and ambiguity

Page 26: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Dense correspondence algorithmParallel camera example – epipolar lines are corresponding rasters

Page 27: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Dense correspondence algorithmParallel camera example – epipolar lines are corresponding rasters

Page 28: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Dense correspondence algorithmParallel camera example – epipolar lines are corresponding rasters

epipolar line

Page 29: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Dense correspondence algorithm

Search problem (geometric constraint): for each point in the left image, the corresponding point in the right image lies on the epipolar line (1D ambiguity)

Disambiguating assumption (photometric constraint): the intensity neighbourhood of corresponding points are similar across images

Measure similarity of neighbourhood intensity by cross-correlation

Parallel camera example – epipolar lines are corresponding rasters

epipolar line

Page 30: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Correspondence problem

Source: Andrew Zisserman

Neighborhood of corresponding points are  similar in intensity patterns.

Page 31: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Correlation Methods (1970--) F&P book new: 7.4, old 11.3

Slide the window along the epipolar line until w.w’ is maximized.

Page 32: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Correlation Methods (1970--) F&P book new: 7.4, old 11.3

Slide the window along the epipolar line until w.w’ is maximized.

Page 33: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Correlation Methods (1970--) F&P book new: 7.4, old 11.3

Slide the window along the epipolar line until w.w’ is maximized.

Page 34: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Correlation Methods (1970--) F&P book new: 7.4, old 11.3

Slide the window along the epipolar line until w.w’ is maximized.

Page 35: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Correlation Methods (1970--) F&P book new: 7.4, old 11.3

Slide the window along the epipolar line until w.w’ is maximized.

Page 36: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Correlation Methods (1970--) F&P book new: 7.4, old 11.3

Slide the window along the epipolar line until w.w’ is maximized.

Page 37: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Correlation Methods (1970--) F&P book new: 7.4, old 11.3

Slide the window along the epipolar line until w.w’ is maximized.

Page 38: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Correlation Methods (1970--) F&P book new: 7.4, old 11.3

Slide the window along the epipolar line until w.w’ is maximized.

Page 39: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Correlation Methods (1970--) F&P book new: 7.4, old 11.3

Slide the window along the epipolar line until w.w’ is maximized.

Page 40: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Correlation Methods (1970--) F&P book new: 7.4, old 11.3

Normalized Correlation: minimize instead.

Slide the window along the epipolar line until w.w’ is maximized.

Page 41: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Correlation Methods (1970--) F&P book new: 7.4, old 11.3

Normalized Correlation: minimize instead.

Slide the window along the epipolar line until w.w’ is maximized.2Minimize |w-w’|.

Page 42: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Cross‐correlation of neighbourhood regions

• left and right windows encoded as vectors w and w’• zero‐mean vectors ( ) and ( ′ ’) • Normalized cross‐correlation: 

• Advantage: Invariant to intensity differences: Invariant to affine intensity transformation 

Page 43: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Cross‐correlation of neighbourhood regions

epipolar line

• left and right windows encoded as vectors w and w’• zero‐mean vectors ( ) and ( ′ ’) • Normalized cross‐correlation: 

• Advantage: Invariant to intensity differences: Invariant to affine intensity transformation 

Page 44: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Cross‐correlation of neighbourhood regions

epipolar line

• left and right windows encoded as vectors w and w’• zero‐mean vectors ( ) and ( ′ ’) • Normalized cross‐correlation: 

• Advantage: Invariant to intensity differences: Invariant to affine intensity transformation 

Page 45: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Cross‐correlation of neighbourhood regions

epipolar line

• left and right windows encoded as vectors w and w’• zero‐mean vectors ( ) and ( ′ ’) • Normalized cross‐correlation: 

• Advantage: Invariant to intensity differences: Invariant to affine intensity transformation 

Page 46: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Cross‐correlation of neighbourhood regions

epipolar line

• left and right windows encoded as vectors w and w’• zero‐mean vectors ( ) and ( ′ ’) • Normalized cross‐correlation: 

• Advantage: Invariant to intensity differences: Invariant to affine intensity transformation 

Page 47: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Correlation‐based window matching

Source: Andrew Zisserman

Page 48: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Correlation‐based window matching

Source: Andrew Zisserman

Page 49: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Correlation‐based window matching

Source: Andrew Zisserman

Page 50: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Correlation‐based window matching

Source: Andrew Zisserman

Page 51: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Correlation‐based window matching

Source: Andrew Zisserman

Page 52: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Textureless regions

Source: Andrew Zisserman Grauman

Page 53: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Textureless regions

Source: Andrew Zisserman

Textureless regions are non‐distinct; high ambiguity for matches.

Grauman

Page 54: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Textureless regions

Source: Andrew Zisserman

Textureless regions are non‐distinct; high ambiguity for matches.

Grauman

Page 55: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Textureless regions

Source: Andrew Zisserman Grauman

Page 56: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Textureless regions

Source: Andrew Zisserman

Textureless regions are non‐distinct; high ambiguity for matches,→ wrong matches

Grauman

Page 57: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Effect of window size

Source: Andrew Zisserman Grauman

Page 58: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Effect of window size

Source: Andrew Zisserman Grauman

Page 59: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Effect of window size

Source: Andrew Zisserman Grauman

Page 60: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Problems with window matching

Page 61: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Effect of window size

Figures from Li Zhang

Want window large enough to have sufficient intensity variation, yet small enough to contain only pixels with about the same disparity.

Grauman

Page 62: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Effect of window size

W = 3 W = 20

Figures from Li Zhang

Want window large enough to have sufficient intensity variation, yet small enough to contain only pixels with about the same disparity.

Grauman

Page 63: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Problems?

• Ordering• Occlusion• Foreshortening

Solutions:• Formulate Constraints• Use more than two views• Smart solutions vs. “brute force” searches with statistics

Page 64: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Exploiting scene constraints

Page 65: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Additional geometric constraints for correspondence

[Faugeras, pp. 321]

• Ordering of points: Continuous surface: same order in both images.

• Is that always true?

A B C A B C

A B C

A B C

Page 66: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

The Ordering Constraint

In general the pointsare in the same orderon both epipolar lines.

Page 67: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

The Ordering Constraint

But it is not always the case..

Page 68: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Ordering constraint

1 2 3 4,5 6 1 2,3 4 5 6

21 3 4,5 61

2,3

4

5

6

surface slice surface as a path

occlusion right

occlusion left

Page 69: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Stereo matching

Similarity measure(SSD or NCC)

Constraints• epipolar• ordering• uniqueness• disparity limit

Trade-off• Matching cost (data)• Discontinuities (prior)

Consider all paths that satisfy the constraints

pick best using dynamic programming

Page 70: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Stereo matching

Optimal path(dynamic programming )

Similarity measure(SSD or NCC)

Constraints• epipolar• ordering• uniqueness• disparity limit

Trade-off• Matching cost (data)• Discontinuities (prior)

Consider all paths that satisfy the constraints

pick best using dynamic programming

Page 71: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Dynamic Programming (Baker and Binford, 1981)

Find the minimum-cost path going monotonicallydown and right from the top-left corner of thegraph to its bottom-right corner.

• Nodes = matched feature points (e.g., edge points).• Arcs = matched intervals along the epipolar lines.• Arc cost = discrepancy between intervals.

Page 72: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Dynamic Programming (Baker and Binford, 1981)

Find the minimum-cost path going monotonicallydown and right from the top-left corner of thegraph to its bottom-right corner.

• Nodes = matched feature points (e.g., edge points).• Arcs = matched intervals along the epipolar lines.• Arc cost = discrepancy between intervals.

Page 73: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Dynamic Programming (Baker and Binford, 1981)

Find the minimum-cost path going monotonicallydown and right from the top-left corner of thegraph to its bottom-right corner.

• Nodes = matched feature points (e.g., edge points).• Arcs = matched intervals along the epipolar lines.• Arc cost = discrepancy between intervals.

Page 74: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Dynamic Programming (Baker and Binford, 1981)

Find the minimum-cost path going monotonicallydown and right from the top-left corner of thegraph to its bottom-right corner.

• Nodes = matched feature points (e.g., edge points).• Arcs = matched intervals along the epipolar lines.• Arc cost = discrepancy between intervals.

Page 75: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Dynamic Programming (Baker and Binford, 1981)

Find the minimum-cost path going monotonicallydown and right from the top-left corner of thegraph to its bottom-right corner.

• Nodes = matched feature points (e.g., edge points).• Arcs = matched intervals along the epipolar lines.• Arc cost = discrepancy between intervals.

Page 76: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Dynamic Programming (Baker and Binford, 1981)

Find the minimum-cost path going monotonicallydown and right from the top-left corner of thegraph to its bottom-right corner.

• Nodes = matched feature points (e.g., edge points).• Arcs = matched intervals along the epipolar lines.• Arc cost = discrepancy between intervals.

Page 77: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

The Ordering Constraint

In general the pointsare in the same orderon both epipolar lines.

Page 78: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

The Ordering Constraint

But it is not always the case..

Page 79: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Forbidden Zone

m1 m2

M

Page 80: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Forbidden Zone

m1 m2

M

N

n1 n2

Page 81: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Forbidden Zone of M:

Violation of ordering constraints

Forbidden Zone

m1 m2

M

N

n1 n2

Page 82: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Forbidden Zone of M:

Violation of ordering constraints

Forbidden Zone

m1 m2

M

N

n1 n2

Practical applications: – Object bulges out: ok– In general: ordering across 

whole image is not reliable feature

– Use ordering constraints for neighbors of M within small neighborhood only

Page 83: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Disparity map

image I(x,y) image I´(x´,y´)Disparity map D(x,y)

(x´,y´)=(x+D(x,y),y)

Page 84: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Hierarchical stereo matchingD

owns

ampl

ing

(Gau

ssia

n py

ram

id)

Dis

pari

ty p

ropa

gati

on

Allows faster computation

Deals with large disparity ranges

Page 85: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Dynamic Programming (Ohta and Kanade, 1985)

Reprinted from “Stereo by Intra- and Intet-Scanline Search,” by Y. Ohta and T. Kanade, IEEE Trans. on Pattern Analysis and MachineIntelligence, 7(2):139-154 (1985). 1985 IEEE.

Page 86: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Real‐time stereo on graphics hardware

• Computes Sum‐of‐Square‐Differences• Hardware mip‐map generation used to aggregate results over 

support region• Trade‐off between small and large support window

Ruigang Yang and Marc Pollefeys, UNC

140M disparity hypothesis/sec on Radeon 9700proe.g. 512x512x20disparities at 30Hz

Shape of a kernel for summing up 6 levels

Page 87: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Stereo results

Ground truthScene

– Data from University of Tsukuba– Similar results on other images without ground truth

Page 88: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.
Page 89: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Results with window correlation

Window-based matching(best window size)

Ground truth

Page 90: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Results with better method

State of the art methodBoykov et al., Fast Approximate Energy Minimization via Graph Cuts,

International Conference on Computer Vision, September 1999.Ground truth

Page 91: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Material I

• http://vision.middlebury.edu/stereo/

• (online stereo pairs and truth (depth maps)• Stereo correspondence software: e.g. http://vision.middlebury.edu/stereo/data/scenes2001/data/imagehtml/tsukuba.html

• CVonline compendium: http://homepages.inf.ed.ac.uk/rbf/CVonline/

Page 92: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Material II

• Epipolar Geometry, Rectification: • http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/FUSIELLO2/re

ctif_cvol.html• and: 

http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/OWENS/LECT11/node11.html

• Stereo:• http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/OWENS/LECT

11/lect11.html• 3D Reconstruction:• http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/OWENS/LECT

11/node8.html

Page 93: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Additional Materials

Page 94: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Problem: Foreshortening

Page 95: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Why is cross-correlation such a poor measure in the second case?

1. The neighbourhood region does not have a “distinctive” spatial intensity distribution

2. Foreshortening effects

Page 96: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Why is cross-correlation such a poor measure in the second case?

1. The neighbourhood region does not have a “distinctive” spatial intensity distribution

2. Foreshortening effects

Page 97: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Why is cross-correlation such a poor measure in the second case?

1. The neighbourhood region does not have a “distinctive” spatial intensity distribution

2. Foreshortening effects

Page 98: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Why is cross-correlation such a poor measure in the second case?

1. The neighbourhood region does not have a “distinctive” spatial intensity distribution

2. Foreshortening effects

fronto-parallel surfaceimaged length the same

Page 99: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Why is cross-correlation such a poor measure in the second case?

1. The neighbourhood region does not have a “distinctive” spatial intensity distribution

2. Foreshortening effects

fronto-parallel surfaceimaged length the same

Page 100: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Why is cross-correlation such a poor measure in the second case?

1. The neighbourhood region does not have a “distinctive” spatial intensity distribution

2. Foreshortening effects

fronto-parallel surfaceimaged length the same

Page 101: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Why is cross-correlation such a poor measure in the second case?

1. The neighbourhood region does not have a “distinctive” spatial intensity distribution

2. Foreshortening effects

fronto-parallel surfaceimaged length the same

slanting surfaceimaged lengths differ

Page 102: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Occlusions

(Slide from Pascal Fua)

Page 103: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Uniqueness constraint

• In an image pair each pixel has at most one corresponding pixel– In general one corresponding pixel– In case of occlusion there is none

Page 104: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Disparity constraint

surface slice surface as a path

bounding box

use reconstructed features to determine bounding box

constantdisparitysurfaces

Page 105: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Three Views

The third eye can be used for verification..

Demo epipolar geometry

Page 106: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Three Views

The third eye can be used for verification..

Demo epipolar geometry

Page 107: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Three Views

The third eye can be used for verification..

Demo epipolar geometry

Page 108: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

More Views (Okutami and Kanade, 1993)

New book: Ch7.6 p. 215: Pick a reference image, and slide the corresponding window along the corresponding epipolarlines 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: SSD used as global evaluation function: Find that minimizes SSD.

Reprinted from “A Multiple-Baseline Stereo System,” by M. Okutami and T. Kanade, IEEE Trans. on PatternAnalysis and Machine Intelligence, 15(4):353-363 (1993). \copyright 1993 IEEE.

Page 109: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Multi‐camera configurations

Okutami and Kanade

(illustration from Pascal Fua)

Page 110: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

I1 I2 I10

Reprinted from “A Multiple-Baseline Stereo System,” by M. Okutami and T. Kanade, IEEE Trans. on PatternAnalysis and Machine Intelligence, 15(4):353-363 (1993). \copyright 1993 IEEE.

Page 111: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.
Page 112: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Normalized cross correlation

Source: Andrew Zisserman

Page 113: Multi-View Geometry: Find Corresponding Points (New book ...gerig/CS6320-S2015/Materials... · UNC/ETH-Z, CS6320 S012, Andrew Zisserman, MVG Book Guido Gerig CS 6320 Spring 2015.

Aggregation window sizesSmall windows • disparities similar• more ambiguities• accurate when correct

Large windows • larger disp. variation• more discriminant• often more robust• use shiftable windows to deal 

with discontinuities

(Illustration from Pascal Fua)