37
Stereo Matching Vision for Graphics CSE 590SS, Winter 2001 Richard Szeliski

Stereo Matching

Embed Size (px)

DESCRIPTION

Stereo Matching. Vision for Graphics CSE 590SS, Winter 2001 Richard Szeliski. Stereo Matching. Given two or more images of the same scene or object, compute a representation of its shape What are some possible applications?. Face modeling. - PowerPoint PPT Presentation

Citation preview

Page 1: Stereo Matching

Stereo Matching

Vision for GraphicsCSE 590SS, Winter 2001

Richard Szeliski

Page 2: Stereo Matching

1/31/2001 Vision for Graphics 2

Stereo Matching

Given two or more images of the same scene or object, compute a representation of its shape

What are some possible applications?

Page 3: Stereo Matching

1/31/2001 Vision for Graphics 3

Face modeling

From one stereo pair to a 3D head model

[Frederic Deverney, INRIA]

Page 4: Stereo Matching

1/31/2001 Vision for Graphics 4

Z-keying: mix live and synthetic

Takeo Kanade, CMU (Stereo Machine)

Page 6: Stereo Matching

1/31/2001 Vision for Graphics 6

Virtualized RealityTM

Takeo Kanade, CMU• generate new video

• steerable version used for SuperBowl XXV“eye vision” system

Page 7: Stereo Matching

1/31/2001 Vision for Graphics 7

View Interpolation

Given two images with correspondences, morph (warp and cross-dissolve) between them [Chen & Williams, SIGGRAPH’93]

input depth image novel view [Matthies,Szeliski,Kanade’88]

Page 8: Stereo Matching

1/31/2001 Vision for Graphics 8

More view interpolation

Spline-based depth map

input depth image novel view

[Szeliski & Kang ‘95]

Page 9: Stereo Matching

1/31/2001 Vision for Graphics 9

View Morphing

Morph between pair of images using epipolar geometry [Seitz & Dyer, SIGGRAPH’96]

Page 10: Stereo Matching

1/31/2001 Vision for Graphics 10

Additional applications

• Real-time people tracking (systems from Pt.

Gray Research and SRI)

• “Gaze” correction for video conferencing

[Ott,Lewis,Cox InterChi’93]

• Other ideas?

Page 11: Stereo Matching

1/31/2001 Vision for Graphics 11

Stereo Matching

Given two or more images of the same scene or object, compute a representation of its shape

What are some possible representations?• depth maps

• volumetric models

• 3D surface models

• planar (or offset) layers

Page 12: Stereo Matching

1/31/2001 Vision for Graphics 12

Stereo Matching

What are some possible algorithms?• match “features” and interpolate• match edges and interpolate• match all pixels with windows (coarse-fine)• use optimization:

– iterative updating– dynamic programming– energy minimization (regularization, stochastic)– graph algorithms

Page 13: Stereo Matching

1/31/2001 Vision for Graphics 13

Outline (remainder of talk)

Image rectification

Matching criteria

Local algorithms (aggregation)• iterative updating

Optimization algorithms:• energy (cost) formulation• Markov Random Fields

• mean-field, stochastic, and graph algorithms

Page 14: Stereo Matching

1/31/2001 Vision for Graphics 14

Stereo: epipolar geometry

Match features along epipolar lines

viewing rayviewing rayepipolar planeepipolar plane

epipolar lineepipolar line

Page 15: Stereo Matching

1/31/2001 Vision for Graphics 15

Stereo: epipolar geometry

for two images (or images with collinear camera centers), can find epipolar lines

epipolar lines are the projection of the pencil of planes passing through the centers

Rectification: warping the input images (perspective transformation) so that epipolar lines are horizontal

Page 16: Stereo Matching

1/31/2001 Vision for Graphics 16

Rectification

Project each image onto same plane, which is parallel to the epipole

Resample lines (and shear/stretch) to place lines in correspondence, and minimize distortion

[Zhang and Loop, MSR-TR-99-21]

Page 17: Stereo Matching

1/31/2001 Vision for Graphics 17

Rectification

Page 18: Stereo Matching

1/31/2001 Vision for Graphics 18

Rectification

Page 19: Stereo Matching

1/31/2001 Vision for Graphics 19

Matching criteria

Raw pixel values (correlation)

Band-pass filtered images [Jones & Malik 92]

“Corner” like features [Zhang, …]

Edges [many people…]

Gradients [Seitz 89; Scharstein 94]

Rank statistics [Zabih & Woodfill 94]

Page 20: Stereo Matching

1/31/2001 Vision for Graphics 20

Finding correspondencesapply feature matching criterion (e.g.,

correlation or Lucas-Kanade) at all pixels simultaneously

search only over epipolar lines (many fewer candidate positions)

Page 21: Stereo Matching

1/31/2001 Vision for Graphics 21

Image registration (revisited)

How do we determine correspondences?

• block matching or SSD (sum squared differences)

d is the disparity (horizontal motion)

How big should the neighborhood be?

Page 22: Stereo Matching

1/31/2001 Vision for Graphics 22

Neighborhood size

Smaller neighborhood: more details

Larger neighborhood: fewer isolated mistakes

w = 3 w = 20

Page 23: Stereo Matching

1/31/2001 Vision for Graphics 23

Stereo: certainty modeling

Compute certainty map from correlations

input depth map certainty map

Page 24: Stereo Matching

1/31/2001 Vision for Graphics 24

Plane Sweep Stereo

Sweep family of planes through volume

• each plane defines an image composite homography

virtual cameravirtual camera

compositecompositeinput imageinput image

projectiveprojective re-sampling of ( re-sampling of (X,Y,ZX,Y,Z))

Page 25: Stereo Matching

1/31/2001 Vision for Graphics 25

Plane Sweep Stereo

For each depth plane• compute composite (mosaic) image — mean

• compute error image — variance• convert to confidence and aggregate spatially

Select winning depth at each pixel

Page 26: Stereo Matching

1/31/2001 Vision for Graphics 26

Plane sweep stereo

Re-order (pixel / disparity) evaluation loops

for every pixel, for every disparity for every disparity for every pixel compute cost compute cost

Page 27: Stereo Matching

1/31/2001 Vision for Graphics 27

Stereo matching framework

1. For every disparity, compute raw matching costs

Why use a robust function?• occlusions, other outliers

Can also use alternative match criteria

Page 28: Stereo Matching

1/31/2001 Vision for Graphics 28

Stereo matching framework

2. Aggregate costs spatially

• Here, we are using a box filter(efficient moving averageimplementation)

• Can also use weighted average,[non-linear] diffusion…

Page 29: Stereo Matching

1/31/2001 Vision for Graphics 29

Stereo matching framework

3. Choose winning disparity at each pixel

• Can interpolate to sub-pixel accuracy

Page 30: Stereo Matching

1/31/2001 Vision for Graphics 30

Traditional Stereo Matching

Advantages:• gives detailed surface estimates• fast algorithms based on moving averages• sub-pixel disparity estimates and confidence

Limitations:• narrow baseline noisy estimates• fails in textureless areas• gets confused near occlusion boundaries

Page 31: Stereo Matching

1/31/2001 Vision for Graphics 31

Stereo with Non-Linear Diffusion

Problem with traditional approach:• gets confused near discontinuities

New approach:• use iterative (non-linear) aggregation to obtain

better estimate• provably equivalent to mean-field estimate of

Markov Random Field

Page 32: Stereo Matching

1/31/2001 Vision for Graphics 32

Linear diffusion

Average energy with neighbors

window diffusion

Page 33: Stereo Matching

1/31/2001 Vision for Graphics 33

Linear diffusion

Average energy with neighbors + starting value

window diffusion

Page 34: Stereo Matching

1/31/2001 Vision for Graphics 34

Non-linear diffusion

Stopping criterion:• only update (x,y) column is entropy goes

down (distribution is more peaked)

Page 35: Stereo Matching

1/31/2001 Vision for Graphics 35

Summary

ApplicationsImage rectificationMatching criteriaLocal algorithms (aggregation)

• area-based; iterative updating

Optimization algorithms:• energy (cost) formulation• Markov Random Fields

• mean-field; dynamic programming;• stochastic; graph algorithms

Page 36: Stereo Matching

1/31/2001 Vision for Graphics 36

More stereo…(next 2 lectures)

Multi-image stereo

Volumetric techniques

Graph cuts

Transparency

Surfaces and level sets

Page 37: Stereo Matching

1/31/2001 Vision for Graphics 37

Bibliography

See the references in the readings…

D. Scharstein and R. Szeliski. Stereo matching with nonlinear diffusion. International Journal of Computer Vision, 28(2):155-174, July 1998

R. Szeliski. Stereo algorithms and representations for image-based rendering. In British Machine Vision Conference (BMVC'99), volume 2, pages 314-328, Nottingham, England, September 1999.

R. Szeliski and R. Zabih. An experimental comparison of stereo algorithms. In International Workshop on Vision Algorithms, pages 1-19, Kerkyra, Greece, September 1999.