binocular stereocis580/lectures/2013/580stereo-mordohai.pdf · •symmetric treatment of images...

54
Binocular Stereo Philippos Mordohai University of North Carolina at Chapel Hill September 21, 2006

Upload: others

Post on 18-Apr-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

Binocular Stereo

Philippos MordohaiUniversity of North Carolina at Chapel Hill

September 21, 2006

Page 2: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

2

Outline

• Introduction• Cost functions• Challenges• Cost aggregation• Optimization• Binocular stereo algorithms

Page 3: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

3

Stereo Vision

• Match something– Feature-based algorithms– Area-based algorithms

• Apply constraints to help convergence– Smoothness/Regularization– Ordering– Uniqueness– Visibility

• Optimize something (typically)– Need energy/objective function that can be optimized

Page 4: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

4

Binocular Datasets

Middlebury data (www.middlebury.edu/stereo)

Page 5: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

5

Challenges

• Ill-posed inverse problem– Recover 3-D structure from 2-D information

• Difficulties– Uniform regions– Half-occluded pixels

Page 6: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

6

Pixel Dissimilarity• Absolute difference of intensities• c=|I1(x,y)- I2(x-d,y)|

• Interval matching [Birchfield 98]– Considers sensor integration– Represents pixels as intervals

Page 7: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

7

Alternative Dissimilarity Measures

• Rank and Census transforms [Zabih ECCV94]• Rank transform:

– Define window containing R pixels around each pixel– Count the number of pixels with lower intensities than center

pixel in the window– Replace intensity with rank (0..R-1)– Compute SAD on rank-transformed images

• Census transform:– Use bit string, defined by neighbors, instead of scalar rank

• Robust against illumination changes

Page 8: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

8

Rank and Census Transform Results

• Noise free, random dot stereograms• Different gain and bias

Page 9: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

9

Outline

• Introduction• Cost functions• Challenges• Cost aggregation• Optimization• Binocular stereo algorithms

Page 10: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

10

Systematic Errors of Area-based Stereo

• Ambiguous matches in textureless regions• Surface over-extension [Okutomi IJCV02]

Page 11: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

11

Surface Over-extension• Expected value of E[(x-y)2]

for x in left and y in rightimage is:

• Case A: σF2+ σB

2+(μF- μB)2

for w/2-λ pixels in each row• Case B: 2 σB

2 for w/2+λpixels in each row

Right image

Left image

Disparity of back surface

Page 12: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

12

Surface Over-extension• Discontinuity perpendicular

to epipolar lines

• Discontinuity parallel toepipolar lines

Right image

Left image

Disparity of back surface

Page 13: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

13

Over-extension and shrinkage

• Turns out that:

for discontinuities perpendicular to epipolarlines

• And:

for discontinuities parallel to epipolar lines

26

ww!!" #

22

ww!!" #

Page 14: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

14

Random Dot StereogramExperiments

Page 15: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

15

Random Dot StereogramExperiments

Page 16: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

16

Offset Windows

Equivalent to using minnearby costResult: loss of depth accuracy

Page 17: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

17

Discontinuity Detection

• Use offset windows only where appropriate– Bi-modal distribution of SSD– Pixel of interest different than mode within

window

Page 18: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

18

Outline

• Introduction• Cost functions• Challenges• Cost aggregation• Optimization• Binocular stereo algorithms

Page 19: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

19

Compact Windows

• [Veksler CVPR03]: Adapt windows size basedon:– Average matching error per pixel– Variance of matching error– Window size (to bias towards larger windows)

• Pick window that minimizes cost

Page 20: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

20

Integral Image

Sum of shaded part

Compute an integral image for pixel dissimilarity at each possible disparity

A C

DB

Shaded area = A+D-B-CIndependent of size

Page 21: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

21

Results using Compact Windows

Page 22: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

22

Rod-shaped filters

• Instead of square windows aggregate cost inrod-shaped shiftable windows [Kim CVPR05]

• Search for one that minimizes the cost(assume that it is an iso-disparity curve)

• Typically use 36 orientations

Page 23: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

23

Locally Adaptive Support

Apply weights to contributions of neighboringpixels according to similarity and proximity[Yoon CVPR05]

Page 24: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

24

Locally Adaptive Support

• Similarity in CIE Lab color space:

• Proximity: Euclidean distance

• Weights:

Page 25: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

25

Locally Adaptive Support: Results

Page 26: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

26

Locally Adaptive Support: Results

Page 27: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

27

Outline

• Introduction• Cost functions• Challenges• Cost aggregation• Optimization• Binocular stereo algorithms

Page 28: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

28

Constraints• Results of un-sophisticated local operators

still noisy• Optimization required• Need constraints

– Smoothness– Ordering– Uniqueness– Visibility

• Energy function

Page 29: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

29

Ordering Constraint

• If A is on the left of B in reference image =>the match for A has to be on the left of thematch of B in target image

• Violated by thin objects• But, useful for dynamic programming

Image from Sun et al. CVPR05

Page 30: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

30

Dynamic Programming

Left image Right image

p p+ dp

correspondence

p

q

Left

occl

usio

n

t

Rightocclusion

s

Page 31: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

31

Results using Dynamic Programming

Page 32: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

32

Dynamic Programming without theOrdering Constraint

• Two Pass Dynamic Programming [Kim CVPR05]– Use reliable matches found with rod-shaped filters

as “ground control points”– No ordering– Second pass along columns to enforce inter-

scanline consistency

Page 33: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

33

Dynamic Programming without theOrdering Constraint

• Use GPU [Gong CVPR05]– Calculate 3-D matrix (x,y,d) of matching costs– Aggregate using shiftable 3x3 window– Find reliable matches along horizontal lines– Find reliable matches along vertical lines– Fill in holes

• Match reliability =cost of scanline passing through match – costof scanline not passing through match

Page 34: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

34

Near Real-time Results

10-25 frames per second depending on image size and disparity range

Page 35: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

35

Semi-global optimization

• Optimize: E=Edata+E(|Dp-Dq|=1)+E(|Dp-Dq|>1)[Hirshmüller CVPR05]– Use mutual information as cost

• NP-hard using graph cuts or beliefpropagation (2-D optimization)

• Instead do dynamic programming along manydirections– Don’t use visibility or ordering constraints– Enforce uniqueness– Add costs

Page 36: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

36

Results of Semi-global optimization

Page 37: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

37

Results of Semi-global optimization

No. 1 overall in Middlebury evaluation(at 0.5 error threshold as of Sep. 2006)

Page 38: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

38

2-D Optimization

• Energy: Data Term + Regularization• Find minimum cost cut that separates source and

target

s

t cut

L(p)

p

“cut”

x

y

labe

ls

x

y

Dis

parit

y la

bels

Page 39: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

39

Scanline vs.Multi-scanline optimization

L(p)

p

“cut”

x

y

labe

ls

labe

ls

x

L(p)

p

Dynamic Programming(single scan line optimization)

s-t Graph Cuts(multi-scan-line optimization)

Page 40: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

40

Graph-cuts• MRF Formulation

– In general suffers from multiple local minima

• Combinatorial optimization: minimize cost∑i∈S Di(fi) + ∑(i,j)∈N V(fi,fj) over discrete spaceof possible labelings f– Exponential search space O(kn)– NP hard in most cases for grid graph– Approximate practical solution [Boykov PAMI01]

DD

DD

V

V

VV

Page 41: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

41

Alpha Expansion Technique

• Use min-cut to efficiently solve a special twolabel problem– Labels “stay the same” or “replace with α”

• Iterate over possible values of α– Each rules out exponentially many labelings

Redexpansion

move from f

Input labeling f

Page 42: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

42

Results using Graph-Cuts

• Include occlusion term in energy [KolmogorovICCV01]

Page 43: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

43

Belief Propagation

• Local message passing scheme in graph– Every site (pixel) in parallel

computes a belief• pdf of local estimates

of label costs– Observation: data term (fixed)– Messages: pdf’s from node to neighbors

• Exact solution for trees, good approximationfor graphs with cycles

DD

D

D

V

V

V

V

D

Page 44: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

44

Belief Propagation for Stereo

• Minimize energy that considers matchingcost, depth discontinuities and occlusion [SunECCV02, PAMI03]

Page 45: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

45

Belief Propagation andSegmentation

Page 46: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

46

Uniqueness Constraint

• Each pixel can have exactly one or no match inthe other image– Used in most of the above methods

• Unfortunately, surfaces do not project to thesame number of pixels in both images [OgaleCVPR04]

Page 47: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

47

Continuous Approach

• Treat intervals on scanlines as continuous entities andnot as discrete sets of pixels

• Assign disparity to beginning and end of each interval• Optimize each scanline

– Would rank 8,7 and 2 for images without horizontal slant– Ranks 22 for Venus !!!

Page 48: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

48

Visibility Constraint

• Each pixel is either occluded or can have onedisparity value (possibly subpixel) associated with it[Sun CVPR05]– Allows for many-to-one correspondence

• Symmetric treatment of images– Compute both disparity and occlusion maps– Left occlusion derived from right disparity and right

occlusion from left disparity• Optimize using Belief Propagation

– Iterate between disparity and occlusion maps• Segmentation as a soft constraint

Page 49: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

49

Results using Symmetric BeliefPropagation

No. 3 in Middlebury evaluation(No. 1 in New Middlebury evaluation) (June 2005)

No. 1 in Middlebury evaluation (June 2005)

Page 50: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

50

Results using Symmetric BeliefPropagation

No. 1 in Middlebury evaluation(June 2005)

No. 1 in Middlebury evaluation(June 2005)

Page 51: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

51

Results using Symmetric BeliefPropagation

Page 52: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

52

Bibliography

D. Scharstein, Middlebury Stereo Evaluation Webpage,www.middlebury.edu/stereo

D. Scharstein and R. Szeliski, A Taxonomy and Evaluation ofDense Two-Frame Stereo Correspondence Algorithms,IJCV 2002

S. Birchfield and C. Tomasi, A pixel dissimilarity measurethat is insensitive to image sampling, PAMI 1998

Ramin Zabih and John Woodfill, Non-parametric LocalTransforms for Computing Visual Correspondence, ECCV1994

M. Okutomi, Y. Katayama and S. Oka, A Simple StereoAlgorithm to Recover Precise Object Boundaries andSmooth Surfaces, IJCV 2002

O. Veksler, Fast variable window for stereo correspondenceusing integral images, CVPR 2003

Page 53: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

53

Bibliography

J.C. Kim, K.M. Lee, B.T. Choi and S.U. Lee, A Dense StereoMatching Using Two-Pass Dynamic Programming withGeneralized Ground Control Points, CVPR 2005

K.J. Yoon and I.S. Kweon, Locally Adaptive Support-WeightApproach for Visual Correspondence Search, CVPR 2005

J. Sun, Y. Li, S.B. Kang and H.Y. Shum, Symmetric StereoMatching for Occlusion Handling, CVPR 2005

M. Gong and Y.H. Yang, Near Real-time Reliable StereoMatching Using Programmable Graphics Hardware, CVPR2005

H. Hirschmüller, Accurate and Efficient Stereo Processingby Semi-Global Matching and Mutual Information, CVPR2005

Page 54: Binocular Stereocis580/lectures/2013/580stereo-mordohai.pdf · •Symmetric treatment of images –Compute both disparity and occlusion maps –Left occlusion derived from right disparity

54

Bibliography

Y. Boykov, O. Veksler and R. Zabih, Fast approximateenergy minimization via graph cuts, PAMI 2001

V. Kolmogorov and R. Zabih, Computing visualcorrespondence with occlusions via graph cuts, ICC 2001

J. Sun, H.Y. Shum, and N.N. Zheng, Stereo matching usingbelief propagation, ECCV 2002

J. Sun, H.Y. Shum, and N.N. Zheng, Stereo matching usingbelief propagation, PAMI 2003

A. Ogale and Y. Aloimonos, Stereo correspondence withslanted surfaces: Critical implications of horizontal slant,CVPR 2004