Top Banner
Lecture 11: Stereo and optical flow CS6670: Computer Vision Noah Snavely
17

Lecture 11: Stereo and optical flow CS6670: Computer Vision Noah Snavely.

Dec 21, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Lecture 11: Stereo and optical flow CS6670: Computer Vision Noah Snavely.

Lecture 11: Stereo and optical flow

CS6670: Computer VisionNoah Snavely

Page 2: Lecture 11: Stereo and optical flow CS6670: Computer Vision Noah Snavely.

Readings

• Szeliski, Chapter 11.2 – 11.5

Page 3: Lecture 11: Stereo and optical flow CS6670: Computer Vision Noah Snavely.

Your basic stereo algorithm

For each epipolar line

For each pixel in the left image• compare window with every window on same epipolar line in right image• pick pixel with minimum match cost

Page 4: Lecture 11: Stereo and optical flow CS6670: Computer Vision Noah Snavely.

Stereo as energy minimization

• Find disparity map d that minimizes an energy function

• Simple pixel / window matching

SSD distance between windows I(x, y) and J(x + d(x,y), y)=

Page 5: Lecture 11: Stereo and optical flow CS6670: Computer Vision Noah Snavely.

Stereo as energy minimization

I(x, y) J(x, y)

y = 141

C(x, y, d); the disparity space image (DSI)x

d

Page 6: Lecture 11: Stereo and optical flow CS6670: Computer Vision Noah Snavely.

Stereo as energy minimization

y = 141

x

d

Simple pixel / window matching: choose the minimum of each column in the DSI independently:

Page 7: Lecture 11: Stereo and optical flow CS6670: Computer Vision Noah Snavely.

Stereo as energy minimization

• Better objective function

{ {

match cost smoothness cost

Want each pixel to find a good match in the other image

Adjacent pixels should (usually) move about the same amount

Page 8: Lecture 11: Stereo and optical flow CS6670: Computer Vision Noah Snavely.

Stereo as energy minimization

match cost:

smoothness cost:

4-connected neighborhood

8-connected neighborhood

: set of neighboring pixels

Page 9: Lecture 11: Stereo and optical flow CS6670: Computer Vision Noah Snavely.

Smoothness cost

“Potts model”

L1 distance

How do we choose V?

Page 10: Lecture 11: Stereo and optical flow CS6670: Computer Vision Noah Snavely.

Dynamic programming

• Can minimize this independently per scanline using dynamic programming (DP)

: minimum cost of solution such that d(x,y) = d

Page 11: Lecture 11: Stereo and optical flow CS6670: Computer Vision Noah Snavely.

Dynamic programming

• Finds “smooth” path through DPI from left to right

y = 141

x

d

Page 12: Lecture 11: Stereo and optical flow CS6670: Computer Vision Noah Snavely.

Dynamic Programming

Page 13: Lecture 11: Stereo and optical flow CS6670: Computer Vision Noah Snavely.

Dynamic programming

• Can we apply this trick in 2D as well?

• No: dx,y-1 and dx-1,y may depend on different values of dx-1,y-1

Slide credit: D. Huttenlocher

Page 14: Lecture 11: Stereo and optical flow CS6670: Computer Vision Noah Snavely.

Stereo as a minimization problem

• The 2D problem has many local minima– Gradient descent doesn’t work well

• And a large search space– n x m image w/ k disparities has knm possible solutions– Finding the global minimum is NP-hard in general

• Good approximations exist… we’ll see this soon

Page 15: Lecture 11: Stereo and optical flow CS6670: Computer Vision Noah Snavely.

Questions?

Page 16: Lecture 11: Stereo and optical flow CS6670: Computer Vision Noah Snavely.

What if the scene is moving?

• And the camera is fixed (or moving)

Page 17: Lecture 11: Stereo and optical flow CS6670: Computer Vision Noah Snavely.

Optical flow

• Why would we want to do this?