Lecture 10: Stereo and Graph Cuts

Slides:



Advertisements
Similar presentations
Stereo Vision Reading: Chapter 11
Advertisements

Public Library, Stereoscopic Looking Room, Chicago, by Phillips, 1923.
Gratuitous Picture US Naval Artillery Rangefinder from World War I (1918)!!
Stereo Many slides adapted from Steve Seitz. Binocular stereo Given a calibrated binocular stereo pair, fuse it to produce a depth image Where does the.
Graph-Based Image Segmentation
1 s-t Graph Cuts for Binary Energy Minimization  Now that we have an energy function, the big question is how do we minimize it? n Exhaustive search is.
Recap from Previous Lecture Tone Mapping – Preserve local contrast or detail at the expense of large scale contrast. – Changing the brightness within.
Stereo.
776 Computer Vision Jan-Michael Frahm, Enrique Dunn Spring 2012.
Last Time Pinhole camera model, projection
CS6670: Computer Vision Noah Snavely Lecture 17: Stereo
Multiple View Geometry : Computational Photography Alexei Efros, CMU, Fall 2005 © Martin Quinn …with a lot of slides stolen from Steve Seitz and.
2010/5/171 Overview of graph cuts. 2010/5/172 Outline Introduction S-t Graph cuts Extension to multi-label problems Compare simulated annealing and alpha-
Stereo & Iterative Graph-Cuts Alex Rav-Acha Vision Course Hebrew University.
Stereo Binocular Stereo Calibration (finish up) Next Time Motivation
Stereopsis Mark Twain at Pool Table", no date, UCR Museum of Photography.
The plan for today Camera matrix
3D from multiple views : Rendering and Image Processing Alexei Efros …with a lot of slides stolen from Steve Seitz and Jianbo Shi.
Stereo CSE P 576 Larry Zitnick Many slides courtesy of Steve Seitz.
Stereo Computation using Iterative Graph-Cuts
Lecture 11: Stereo and optical flow CS6670: Computer Vision Noah Snavely.
Lecture 8: Image Alignment and RANSAC
Perceptual Organization: Segmentation and Optical Flow.
Announcements PS3 Due Thursday PS4 Available today, due 4/17. Quiz 2 4/24.
Stereo Guest Lecture by Li Zhang
Project 1 artifact winners Project 2 questions Project 2 extra signup slots –Can take a second slot if you’d like Announcements.
Midterm went out on Tuesday (due next Tuesday) Project 3 out today Announcements.
Multiple View Geometry : Computational Photography Alexei Efros, CMU, Fall 2006 © Martin Quinn …with a lot of slides stolen from Steve Seitz and.
VZvZ r t b image cross ratio Measuring height B (bottom of object) T (top of object) R (reference point) ground plane H C scene cross ratio  scene points.
What have we leaned so far? Camera structure Eye structure Project 1: High Dynamic Range Imaging.
Computer Vision Spring ,-685 Instructor: S. Narasimhan WH 5409 T-R 10:30am – 11:50am Lecture #15.
Stereo Readings Trucco & Verri, Chapter 7 –Read through 7.1, 7.2.1, 7.2.2, 7.3.1, 7.3.2, and 7.4, –The rest is optional. Single image stereogram,
Camera Calibration & Stereo Reconstruction Jinxiang Chai.
What have we leaned so far? Camera structure Eye structure Project 1: High Dynamic Range Imaging.
Announcements Project 1 artifact winners Project 2 questions
Structure from images. Calibration Review: Pinhole Camera.
Fast Approximate Energy Minimization via Graph Cuts
Recap from Monday Image Warping – Coordinate transforms – Linear transforms expressed in matrix form – Inverse transforms useful when synthesizing images.
Stereo Vision Reading: Chapter 11 Stereo matching computes depth from two or more images Subproblems: –Calibrating camera positions. –Finding all corresponding.
Stereo Readings Szeliski, Chapter 11 (through 11.5) Single image stereogram, by Niklas EenNiklas Een.
Stereo Many slides adapted from Steve Seitz.
CS 4487/6587 Algorithms for Image Analysis
Project 2 code & artifact due Friday Midterm out tomorrow (check your ), due next Fri Announcements TexPoint fonts used in EMF. Read the TexPoint.
Stereo Many slides adapted from Steve Seitz. Binocular stereo Given a calibrated binocular stereo pair, fuse it to produce a depth image image 1image.
Computer Vision, Robert Pless
Lec 22: Stereo CS4670 / 5670: Computer Vision Kavita Bala.
1 Markov Random Fields with Efficient Approximations Yuri Boykov, Olga Veksler, Ramin Zabih Computer Science Department CORNELL UNIVERSITY.
Bahadir K. Gunturk1 Phase Correlation Bahadir K. Gunturk2 Phase Correlation Take cross correlation Take inverse Fourier transform  Location of the impulse.
Lecture 19: Solving the Correspondence Problem with Graph Cuts CAP 5415 Fall 2006.
Lecture 16: Stereo CS4670 / 5670: Computer Vision Noah Snavely Single image stereogram, by Niklas EenNiklas Een.
Digital Image Processing
776 Computer Vision Jan-Michael Frahm Spring 2012.
Solving for Stereo Correspondence Many slides drawn from Lana Lazebnik, UIUC.
Paper presentation topics 2. More on feature detection and descriptors 3. Shape and Matching 4. Indexing and Retrieval 5. More on 3D reconstruction 1.
A global approach Finding correspondence between a pair of epipolar lines for all pixels simultaneously Local method: no guarantee we will have one to.
Project 2 due today Project 3 out today Announcements TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAA.
Project 2 artifacts—vote now!! Project 3 questions? Start thinking about final project ideas, partners Announcements.
Project 3 code & artifact due Tuesday Final project proposals due noon Wed (by ) –One-page writeup (from project web page), specifying: »Your team.
Energy minimization Another global approach to improve quality of correspondences Assumption: disparities vary (mostly) smoothly Minimize energy function:
CSE 185 Introduction to Computer Vision Stereo 2.
Stereo CS4670 / 5670: Computer Vision Noah Snavely Single image stereogram, by Niklas EenNiklas Een.
Noah Snavely, Zhengqi Li
제 5 장 스테레오.
Digital Visual Effects, Spring 2009 Yung-Yu Chuang 2009/5/21
CS4670 / 5670: Computer Vision Kavita Bala Lec 27: Stereo.
Markov Random Fields with Efficient Approximations
Announcements Midterms graded (handed back at end of lecture)
Lecture 31: Graph-Based Image Segmentation
Digital Image Processing
Stereo vision Many slides adapted from Steve Seitz.
Presentation transcript:

Lecture 10: Stereo and Graph Cuts CS6670: Computer Vision Noah Snavely Lecture 10: Stereo and Graph Cuts

Announcements Project 2 out, due Wednesday, October 14 Questions? Artifact due Friday, October 16 Questions?

Readings Szeliski, Chapter 11.2 – 11.5

What we’ve learned so far = * Image filtering Cameras Edge detection Image transformations

Feature detection and matching

Panoramas

Magic: ghost removal M. Uyttendaele, A. Eden, and R. Szeliski. Eliminating ghosting and exposure artifacts in image mosaics. In Proceedings of the Interational Conference on Computer Vision and Pattern Recognition, volume 2, pages 509--516, Kauai, Hawaii, December 2001.

Magic: ghost removal How to handle motion? M. Uyttendaele, A. Eden, and R. Szeliski. Eliminating ghosting and exposure artifacts in image mosaics. In Proceedings of the Interational Conference on Computer Vision and Pattern Recognition, volume 2, pages 509--516, Kauai, Hawaii, December 2001.

Optical flow

Your basic stereo algorithm Improvement: match windows For each pixel in the left image For each epipolar line compare with every pixel on same epipolar line in right image pick pixel with minimum match cost

Stereo results Scene Ground truth

Results with window search problems in areas of uniform texture Window-based matching (best window size) Ground truth

Can we do better? What defines a good stereo correspondence? Match quality Want each pixel to find a good match in the other image Smoothness two adjacent pixels should (usually) move about the same amount

Stereo as energy minimization Find disparities d that minimize an energy function Simple pixel / window matching SSD distance between windows I(x, y) and J(x, y + d(x,y)) =

Stereo as energy minimization I(x, y) J(x, y) y = 141 C(x, y, d); the disparity space image (DSI) x d

Stereo as energy minimization d x Simple pixel / window matching: choose the minimum of each column in the DSI independently:

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

Stereo as energy minimization match cost: smoothness cost: : set of neighboring pixels 4-connected neighborhood 8-connected neighborhood

Smoothness cost L1 distance “Potts model” last time: looked at quadratic and truncated quadratic models for V L1 distance “Potts model”

Dynamic programming Can minimize this independently per scanline using dynamic programming (DP) : minimum cost of solution such that d(x,y) = d

Dynamic programming Finds “smooth” path through DPI from left to right x Finds “smooth” path through DPI from left to right

Dynamic Programming

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

Stereo as a minimization problem The 2D problem has many local minima Gradient descent doesn’t work well Simulated annealing works a little better And a large search space n x m image w/ k disparities has knm possible solutions Finding the global minimum is NP-hard Good approximations exist…

Interlude: binary segmentation Suppose we want to segment an image into foreground and background

Interlude: binary segmentation Suppose we want to segment an image into foreground and background User sketches out a few strokes on foreground and background… How do we classify the rest of the pixels?

Binary segmentation as energy minimization Define a labeling L as an assignment of each pixel with a 0-1 label (background or foreground) Problem statement: find the labeling L that minimizes { { match cost smoothness cost (“how similar is each labeled pixel to the foreground / background?”)

Neighboring pixels should generally have the same labels Unless the pixels have very different intensities = 10.0 = 0.1 : similarity in intensity of p and q (can use the same trick for stereo)

Binary segmentation as energy minimization For this problem, we can easily find the global minimum! Use max flow / min cut algorithm

Graph min cut problem Given a weighted graph G with source and sink nodes (s and t), partition the nodes into two sets, S and T such that the sum of edge weights spanning the partition is minimized and s S and t T

Segmentation by min cut s (“foreground”) (“background”) Graph node for each pixel, link between adjacent pixels specify a few pixels as foreground and background create an infinite cost link from each bg pixel to the t node create an infinite cost link from each fg pixel to the s node create finite cost links from s and t to each other node compute min cut that separates s from t The min-cut max-flow theorem [Ford and Fulkerson 1956]

Segmentation by min cut The partitions S and T formed by the min cut give the optimal foreground and background segmentation I.e., the resulting labels minimize

GrabCut Grabcut [Rother et al., SIGGRAPH 2004]

Back to stereo Can formulate as a (no longer binary) labeling problem with one label per disparity Can create similar setup as with segmentation, but with k source/sink nodes k = number of disparities Using the Potts model, the setup is straightforward

Energy minimization via graph cuts edge weight d1 d2 d3 edge weight Labels (disparities)

Energy minimization via graph cuts d1 d2 d3 Graph Cut Delete enough edges so that each pixel is connected to exactly one label node Cost of a cut: sum of deleted edge weights Finding min cost cut equivalent to finding global minimum of energy function

Computing a multiway cut With 2 labels: classical min-cut problem Solvable by standard flow algorithms polynomial time in theory, nearly linear in practice More than 2 terminals: NP-hard [Dahlhaus et al., STOC ‘92] Efficient approximation algorithms exist Boykov, Veksler and Zabih, Fast Approximate Energy Minimization via Graph Cuts, ICCV 1999. Within a factor of 2 of optimal Computes local minimum in a strong sense even very large moves will not improve the energy First talk about ICM then strong local min

Move examples Red-blue swap move Starting point Green expansion move Idea: convert multi-way cut into a sequence of binary cut problems Red-blue swap move Starting point Green expansion move E(d1,d2,d3,d4,….)

The swap move algorithm 1. Start with an arbitrary labeling 2. Cycle through every label pair (A,B) in some order 2.1 Find the lowest E labeling within a single AB-swap 2.2 Go there if it’s lower E than the current labeling 3. If E did not decrease in the cycle, we’re done Otherwise, go to step 2 AB subgraph (run min-cut on this graph) B A B A Original graph

Results with window correlation normalized correlation (best window size) ground truth

Results with graph cuts (Potts model, expansion move algorithm) ground truth

Other energy functions Can optimize other functions (exactly or approximately) with graph cuts

Questions?

Real-time stereo Used for robot navigation (and other tasks) Nomad robot searches for meteorites in Antartica http://www.frc.ri.cmu.edu/projects/meteorobot/index.html Used for robot navigation (and other tasks) Several software-based real-time stereo techniques exist (most based on simple search)

Stereo reconstruction pipeline Steps Calibrate cameras Rectify images Compute disparity Estimate depth What will cause errors? Camera calibration errors Poor image resolution Occlusions Violations of brightness constancy (specular reflections) Large motions Low-contrast image regions

Active stereo with structured light Li Zhang’s one-shot stereo camera 2 camera 1 projector camera 1 projector Project “structured” light patterns onto the object simplifies the correspondence problem

Digital Michelangelo Project Laser scanning Digital Michelangelo Project http://graphics.stanford.edu/projects/mich/ Optical triangulation Project a single stripe of laser light Scan it across the surface of the object This is a very precise version of structured light scanning

The Digital Michelangelo Project, Levoy et al. Laser scanned models The Digital Michelangelo Project, Levoy et al.

The Digital Michelangelo Project, Levoy et al. Laser scanned models The Digital Michelangelo Project, Levoy et al.

The Digital Michelangelo Project, Levoy et al. Laser scanned models The Digital Michelangelo Project, Levoy et al.

The Digital Michelangelo Project, Levoy et al. Laser scanned models The Digital Michelangelo Project, Levoy et al.

Spacetime Stereo http://grail.cs.washington.edu/projects/stfaces/ Li Zhang, Noah Snavely, Brian Curless, Steve Seitz