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.

Slides:



Advertisements
Similar presentations
Maximum flow Main goals of the lecture:
Advertisements

Graph Partitioning Problems Lecture 18: March 14 s1 s3 s4 s2 T1 T4 T2 T3 s1 s4 s2 s3 t3 t1 t2 t4 A region R1 R2 C1 C2.
Graph Cut Algorithms for Computer Vision & Medical Imaging Ramin Zabih Computer Science & Radiology Cornell University Joint work with Y. Boykov, V. Kolmogorov,
Introduction to Markov Random Fields and Graph Cuts Simon Prince
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
Global Flow Optimization (GFO) in Automatic Logic Design “ TCAD91 ” by C. Leonard Berman & Louise H. Trevillyan CAD Group Meeting Prepared by Ray Cheung.
I Images as graphs Fully-connected graph – node for every pixel – link between every pair of pixels, p,q – similarity w ij for each link j w ij c Source:
GrabCut Interactive Foreground Extraction using Iterated Graph Cuts Carsten Rother Vladimir Kolmogorov Andrew Blake Microsoft Research Cambridge-UK.
GrabCut Interactive Foreground Extraction using Iterated Graph Cuts Carsten Rother Vladimir Kolmogorov Andrew Blake Microsoft Research Cambridge-UK.
A Gimp Plugin that uses “GrabCut” to perform image segmentation
Graph-Based Image Segmentation
Graph-based image segmentation Václav Hlaváč Czech Technical University in Prague Faculty of Electrical Engineering Department of Cybernetics Prague, Czech.
GrabCut Interactive Image (and Stereo) Segmentation Joon Jae Lee Keimyung University Welcome. I will present Grabcut – an Interactive tool for foreground.
Learning with Inference for Discrete Graphical Models Nikos Komodakis Pawan Kumar Nikos Paragios Ramin Zabih (presenter)
1 Chapter 7 Network Flow Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
Optimal solution of binary problems Much material taken from :  Olga Veksler, University of Western Ontario
1 Can this be generalized?  NP-hard for Potts model [K/BVZ 01]  Two main approaches 1. Exact solution [Ishikawa 03] Large graph, convex V (arbitrary.
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.
The max flow problem
Semi-automatic Foreground Extraction Martin & Andreas.
MRF Labeling With Graph Cut CMPUT 615 Nilanjan Ray.
Lecture 10: Stereo and Graph Cuts
Stereo Computation using Iterative Graph-Cuts
Comp 775: Graph Cuts and Continuous Maximal Flows Marc Niethammer, Stephen Pizer Department of Computer Science University of North Carolina, Chapel Hill.
Measuring Uncertainty in Graph Cut Solutions Pushmeet Kohli Philip H.S. Torr Department of Computing Oxford Brookes University.
Graph-Cut Algorithm with Application to Computer Vision Presented by Yongsub Lim Applied Algorithm Laboratory.
Image Segmentation Rob Atlas Nick Bridle Evan Radkoff.
Fast Approximate Energy Minimization via Graph Cuts
A Selective Overview of Graph Cut Energy Minimization Algorithms Ramin Zabih Computer Science Department Cornell University Joint work with Yuri Boykov,
Graph Cut & Energy Minimization
CS774. Markov Random Field : Theory and Application Lecture 13 Kyomin Jung KAIST Oct
Interactive Graph Cuts for Optimal Boundary & Region Segmentation of Objects in N-D Images (Fri) Young Ki Baik, Computer Vision Lab.
Theory of Computing Lecture 13 MAS 714 Hartmut Klauck.
Graph Cuts Marc Niethammer. Segmentation by Graph-Cuts A way to compute solutions to the optimization problems we looked at before. Example: Binary Segmentation.
CS 4487/6587 Algorithms for Image Analysis
1 Markov Random Fields with Efficient Approximations Yuri Boykov, Olga Veksler, Ramin Zabih Computer Science Department CORNELL UNIVERSITY.
1 WEEK 11 Graphs III Network Flow Problems A Simple Maximum-Flow Algorithm Izmir University of Economics.
Presenter : Kuang-Jui Hsu Date : 2011/3/24(Thur.).
Gaussian Mixture Models and Expectation-Maximization Algorithm.
Chapter 7 April 28 Network Flow.
Chapter 7 May 3 Ford-Fulkerson algorithm Step-by-step walk through of an example Worst-case number of augmentations Edmunds-Karp modification Time complexity.
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
Exercise 6.1 Find the number of different shortest paths from point A to point B in a city with perfectly horizontal streets and vertical avenues as shown.
A global approach Finding correspondence between a pair of epipolar lines for all pixels simultaneously Local method: no guarantee we will have one to.
Outline Standard 2-way minimum graph cut problem. Applications to problems in computer vision Classical algorithms from the theory literature A new algorithm.
Theory of Computing Lecture 12 MAS 714 Hartmut Klauck.
Markov Random Fields in Vision
Cutting Images: Graphs and Boundary Finding Computational Photography Derek Hoiem, University of Illinois 09/20/12 “The Double Secret”, Magritte.
Energy functions f(p)  {0,1} : Ising model Can solve fast with graph cuts V( ,  ) = T[  ] : Potts model NP-hard Closely related to Multiway Cut Problem.
Hebrew University Image Processing Exercise Class 8 Panoramas – Stitching and Blending Min-Cut Stitching Many slides from Alexei Efros.
Energy minimization Another global approach to improve quality of correspondences Assumption: disparities vary (mostly) smoothly Minimize energy function:
Cutting Images: Graphs and Boundary Finding
GrabCut Interactive Foreground Extraction using Iterated Graph Cuts Carsten Rother Vladimir Kolmogorov Andrew Blake Microsoft Research Cambridge-UK.
Markov Random Fields with Efficient Approximations
Lectures on Network Flows
Graph Cut Weizhen Jing
Discrete Inference and Learning
Haim Kaplan and Uri Zwick
Lecture 31: Graph-Based Image Segmentation
Richard Anderson Lecture 21 Network Flow
Problem Solving 4.
Discrete Optimization Methods Basic overview of graph cuts
Flow Networks and Bipartite Matching
Algorithms (2IL15) – Lecture 7
Network Flow CSE 373 Data Structures.
EE5900 Advanced Embedded System For Smart Infrastructure
Lecture 21 Network Flow, Part 1
Maximum Flow Problems in 2005.
Presentation transcript:

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 exponential: if n is the number of pixels, there are 2 n possible labelings L data term prior term

2 Maximum flow problem  Max flow problem: –Each edge is a “pipe” –Find the largest flow F of “water” that can be sent from the “source” to the “sink” along the pipes –Source output = sink input = flow value –Edge weights give the pipe’s capacity “source” A graph with two terminals S T “sink” a flow F

3 Minimum cut problem  Min cut problem: –Find the cheapest way to cut the edges so that the “source” is separated from the “sink” –Cut edges going from source side to sink side –Edge weights now represent cutting “costs” a cut C “source” A graph with two terminals S T “sink”

4 Max flow/Min cut theorem  Max Flow = Min Cut: –Proof sketch: value of a flow is value over any cut –Maximum flow saturates the edges along the minimum cut Ford and Fulkerson, 1962 Problem reduction!  Ford and Fulkerson gave first polynomial time algorithm for globally optimal solution “source” A graph with two terminals S T “sink”

5 Fast algorithms for min cut  Max flow problem can be solved fast –Many algorithms, we’ll sketch one  This is not at all obvious –Variants of min cut are NP-hard  Multiway cut problem –More than 2 terminals –Find lowest cost edges separating them all

6 “Augmenting Path” algorithms  Find a path from S to T along non- saturated edges “source” A graph with two terminals S T “sink” n Increase flow along this path until some edge saturates

7 “Augmenting Path” algorithms  Find a path from S to T along non- saturated edges “source” A graph with two terminals S T “sink” n Increase flow along this path until some edge saturates n Find next path… n Increase flow…

8 “Augmenting Path” algorithms  Find a path from S to T along non- saturated edges “source” A graph with two terminals S T “sink” n Increase flow along this path until some edge saturates Iterate until … all paths from S to T have at least one saturated edge

9 Implementation notes  There are many fast flow algorithms  Augmenting paths depends on ordering –Breadth first = Edmonds-Karp –Vision problems have many short paths –Subtleties needed due to directed edges  [BK ’04] gives an algorithm especially for vision problems –Software is freely available

10 Basic construction  One non-terminal vertex per pixel  Each pixel connects directly to s,t –Severing these edges corresponds to giving labels 0,1 to the pixel  Cost of cut is the cost of the entire labeling a cut s t Dp(0)Dp(0) Dp(1)Dp(1)

11 Example n For clarity, let’s look at 1 dimensional example but everything works in 2 or higher dimensions. Suppose our image has 4 pixels: p r q s pr q s n We build a graph: n The cut in red corresponds to labeling n The cut in green corresponds to labeling 0 black 1 white

12 Beyond binary faxes  All we really need is a cost function –Suppose that label 1 means “foreground” and label 0 means “background”  How do we figure out if a pixel prefers to be in the foreground or background? –Predefined intensities: for instance, the foreground object tends to have intensities in the range So if we observed an intensity in this range at p, D p (1) is small –This is not image thresholding!

13 Better intensity models  We can compute the range of intensities dynamically rather than statically –Both for foreground and for background  User marks some pixels as being foreground, and some as background –Compute a D p based on this –For instance, D p (1) is small if p looks like pixels marked as being foreground  Based on the resulting segmentation, mark additional pixels

14 A serious implementation  This basic segmentation algorithm is now in a Microsoft product –SIGGRAPH paper on “GrabCut”  Same basic idea, but simpler UI –Assume the background is outside and the foreground is inside a user-supplied box –D p (1) is small if p looks like the pixels inside the box, large if like the pixels outside –Create a new segmentation and use it to re- estimate foreground and background

GrabCut GrabCut GrabCut – Interactive Foreground Extraction

Iterated Graph Cuts Iterated Graph Cuts GrabCut – Interactive Foreground Extraction Result Guaranteed to converge See:

Moderately straightforward examples Moderately straightforward examples … GrabCut completes automatically GrabCut – Interactive Foreground Extraction

18 Important properties  Very efficient in practice –Lots of short paths, so roughly linear  Construction is symmetric (0 vs 1)  Specific to 2 labels –Min cut with >2 labels is NP-hard

19 Can this be generalized?  NP-hard for Potts model [K/BVZ 01]  Two main approaches 1. Exact solution [Ishikawa 03] Large graph, convex V (arbitrary D ) Not the considered the right prior for vision 2. Approximate solutions [BVZ 01] Solve a binary labeling problem, repeatedly Expansion move algorithm