Graph Cut & Energy Minimization

Slides:



Advertisements
Similar presentations
Algorithms for MAP estimation in Markov Random Fields Vladimir Kolmogorov University College London Tutorial at GDR (Optimisation Discrète, Graph Cuts.
Advertisements

SOFT SCISSORS: AN INTERACTIVE TOOL FOR REALTIME HIGH QUALITY MATTING International Conference on Computer Graphics and Interactive Techniques ACM SIGGRAPH.
Graph cut Chien-chi Chen.
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
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:
The University of Ontario CS 4487/9687 Algorithms for Image Analysis Multi-Label Image Analysis Problems.
GrabCut Interactive Image (and Stereo) Segmentation Carsten Rother Vladimir Kolmogorov Andrew Blake Antonio Criminisi Geoffrey Cross [based on Siggraph.
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.
Graph-Based Image Segmentation
Stephen J. Guy 1. Photomontage Photomontage GrabCut – Interactive Foreground Extraction 1.
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.
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)
Markov Random Fields (MRF)
Optimal solution of binary problems Much material taken from :  Olga Veksler, University of Western Ontario
Learning to Detect A Salient Object Reporter: 鄭綱 (3/2)
CS448f: Image Processing For Photography and Vision Graph Cuts.
P 3 & Beyond Solving Energies with Higher Order Cliques Pushmeet Kohli Pawan Kumar Philip H. S. Torr Oxford Brookes University CVPR 2007.
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.
Advanced Topics in Computer Vision Spring 2006 Video Segmentation Tal Kramer, Shai Bagon Video Segmentation April 30 th, 2006.
Multiview stereo. Volumetric stereo Scene Volume V Input Images (Calibrated) Goal: Determine occupancy, “color” of points in V.
MRF Labeling With Graph Cut CMPUT 615 Nilanjan Ray.
Announcements Readings for today:
Lecture 10: Stereo and Graph Cuts
Stereo Computation using Iterative Graph-Cuts
What Energy Functions Can be Minimized Using Graph Cuts? Shai Bagon Advanced Topics in Computer Vision June 2010.
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.
Computer vision: models, learning and inference
Perceptual Organization: Segmentation and Optical Flow.
Graph-based Segmentation
MRFs and Segmentation with Graph Cuts Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 03/31/15.
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,
Michael Bleyer LVA Stereo Vision
MRFs and Segmentation with Graph Cuts Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/24/10.
Graph Cut Algorithms for Binocular Stereo with Occlusions
Graph Cut 韋弘 2010/2/22. Outline Background Graph cut Ford–Fulkerson algorithm Application Extended reading.
City University of Hong Kong 18 th Intl. Conf. Pattern Recognition Self-Validated and Spatially Coherent Clustering with NS-MRF and Graph Cuts Wei Feng.
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.
Object Stereo- Joint Stereo Matching and Object Segmentation Computer Vision and Pattern Recognition (CVPR), 2011 IEEE Conference on Michael Bleyer Vienna.
Algorithms for MAP estimation in Markov Random Fields Vladimir Kolmogorov University College London.
IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. 26, NO. 9, SEPTEMBER 2004 Yuri Boykov, Member, IEEE Vladimir Kolmogorov, Member, IEEE.
1 Markov Random Fields with Efficient Approximations Yuri Boykov, Olga Veksler, Ramin Zabih Computer Science Department CORNELL UNIVERSITY.
Lecture 19: Solving the Correspondence Problem with Graph Cuts CAP 5415 Fall 2006.
Presenter : Kuang-Jui Hsu Date : 2011/3/24(Thur.).
Gaussian Mixture Models and Expectation-Maximization Algorithm.
Machine Learning – Lecture 15
CS654: Digital Image Analysis Lecture 28: Advanced topics in Image Segmentation Image courtesy: IEEE, IJCV.
A global approach Finding correspondence between a pair of epipolar lines for all pixels simultaneously Local method: no guarantee we will have one to.
Graph Algorithms for Vision Amy Gale November 5, 2002.
Outline Standard 2-way minimum graph cut problem. Applications to problems in computer vision Classical algorithms from the theory literature A new algorithm.
Lecture 05 29/11/2011 Shai Avidan Roy Josef Jevnisek הבהרה : החומר המחייב הוא החומר הנלמד בכיתה ולא זה המופיע / לא מופיע במצגת.
Photoconsistency constraint C2 q C1 p l = 2 l = 3 Depth labels If this 3D point is visible in both cameras, pixels p and q should have similar intensities.
Markov Random Fields in Vision
Energy minimization Another global approach to improve quality of correspondences Assumption: disparities vary (mostly) smoothly Minimize energy function:
MRFs and Segmentation with Graph Cuts Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 03/27/12.
Digital Visual Effects, Spring 2009 Yung-Yu Chuang 2009/5/21
GrabCut Interactive Foreground Extraction using Iterated Graph Cuts Carsten Rother Vladimir Kolmogorov Andrew Blake Microsoft Research Cambridge-UK.
Markov Random Fields with Efficient Approximations
Counting in High-Density Crowd Videos
Graph Cut Weizhen Jing
Haim Kaplan and Uri Zwick
Lecture 31: Graph-Based Image Segmentation
Discrete Optimization Methods Basic overview of graph cuts
Presentation transcript:

Graph Cut & Energy Minimization Yevgeny Doctor IP Seminar 2008, IDC

Yevgeny Doctor, March 2008, IDC Outline Motivation Graph Cuts Energy Minimization in Computer Vision Solving Energy Minimization with Graph Cuts Results Yevgeny Doctor, March 2008, IDC

Yevgeny Doctor, March 2008, IDC Graph Cut G(V,E) is a finite directed graph and every edge (u,v) has a capacity c(u,v) (a non-negative real number). Assume two vertices, the source s and the sink t, have been distinguished. A cut is a split of the nodes into two sets S and T, such that s is in S and t is in T. t s Yevgeny Doctor, March 2008, IDC

Yevgeny Doctor, March 2008, IDC Min-Cut The capacity of a cut (S,T ) is defined as Min-Cut – finding the cut with the minimal capacity Yevgeny Doctor, March 2008, IDC

Yevgeny Doctor, March 2008, IDC Max Flow Find the maximum flow from s to t Yevgeny Doctor, March 2008, IDC

Yevgeny Doctor, March 2008, IDC Min-Cut Max-Flow Min-Cut and Max-Flow are equivalent problems Fast polynomial algorithms for max flow exist For example: Ford-Fulkerson algorithm – O(E*maxflow) Edmonds-Karp algorithm – O(VE2) Yevgeny Doctor, March 2008, IDC

Energy Minimization Problems In general terms, given some problem, we: Formulate the known constraints Build an “energy function” (aka “cost function”) Look for a solution that minimizes it If we have no further knowledge: The problem can be NP-Hard (requires exponential solution time) Use slow, generic approximation algorithms for optimization problems (such as simulated annealing) Yevgeny Doctor, March 2008, IDC

Yevgeny Doctor, March 2008, IDC EM in Computer Vision Consider a broad class of problems called Pixel Labeling Given some images we want to “say something about the pixels” For each pixel p, give it a label fp from a finite set of labels L, such that we minimize some energy function. Many applications Image Segmentation Image Restoration Stereo and Motion Medical Imaging Multicamera Scene Reconstruction Yevgeny Doctor, March 2008, IDC

Pixel Labeling Example "Graph Cut Matching In Computer Vision", Toby Collins, February 2004 http://homepages.inf.ed.ac.uk/rbf/CVonline/ Yevgeny Doctor, March 2008, IDC

Yevgeny Doctor, March 2008, IDC EM in Computer Vision Consider a specific family of Energy Functions Powerful enough to formulate many useful problems Can be reduced to solving a graph min-cut problem Problems defined with these functions: Can be solved quickly (using max-flow algorithms) In many cases – optimal solution or within a known factor of the optimum Yevgeny Doctor, March 2008, IDC

Energy Function Definition Edata(f) Esmooth(f) Input: set of pixels P, set of labels L, is a neighbourhood system on pixels. Goal: find a labeling that minimizes . . is a function derived from the observed data that measures the cost of assigning label to pixel p. . measures the cost of assigning the labels to adjacent pixels p, q. Used to impose spatial smoothness. Yevgeny Doctor, March 2008, IDC

Energy Function - Edata Component The Edata(f) component: Look at each pixel independently Given it’s current value, what would it cost to label it with each of the labels? Examples: Cost based on a-priori known pixel intensity or color distribution is the observed intensity of pixel p What if we used only this component in E(f)? Label each pixel independently with the most likely (cheap) label Yevgeny Doctor, March 2008, IDC

Optimizing Edata Only – Illustration What would be the problem? For example (object segmentation): Images from “Nearest Neighbor” lecture – here for illustration purposes only We need to add a “smoothness” cost Yevgeny Doctor, March 2008, IDC

Energy Function - Esmooth Component Look at all pairs of neighbor pixels Penalize adjacent pixels with different labels What smoothness cost function to use? Noised diamond image Fast Approximate Energy Minimization via Graph Cuts Yuri Boykov, Olga Veksler, Ramin Zabih Yevgeny Doctor, March 2008, IDC

Smoothness Cost Functions Potts Interaction Penalty: T – indicator function, K – constant The solution will be piecewise constant, with discontinuities at the boundaries Yevgeny Doctor, March 2008, IDC Fast Approximate Energy Minimization via Graph Cuts Yuri Boykov, Olga Veksler, Ramin Zabih

Smoothness Cost Functions L2 distance: What is the problem? High penalties at object boundaries We want smooth objects, but allow different labels at object boundary – a discontinuity-preserving function. Yevgeny Doctor, March 2008, IDC

Smoothness Cost Functions Truncated L2 distance: K – constant The solution will be piecewise smooth, with discontinuities at the boundaries Yevgeny Doctor, March 2008, IDC Fast Approximate Energy Minimization via Graph Cuts Yuri Boykov, Olga Veksler, Ramin Zabih

Smoothness Cost Functions Normalize for neighbor distance, image contrast: This function penalizes a lot for discontinuities between pixels of similar intensities when |Ip − Iq| < s. However, if pixels are very different, |Ip − Iq| > s, then the penalty is small. Yevgeny Doctor, March 2008, IDC

Solving Energy Minimization with Graph Cuts Many classes of Energy Minimization problems in Computer Vision can be reduced to Graph Cuts Solve multiple-labels problems with binary decisions Yevgeny Doctor, March 2008, IDC

Approximate Energy Minimization “Fast Approximate Energy Minimization via Graph Cuts.” Yuri Boykov, Olga Veksler, Ramin Zabih, 1999 For two classes of interaction potentials V (Esmooth): V is semi-metric on a label space L if for every : V is metric on L if in addition, triangle inequality holds: For example, truncated L2 distance and Potts Interaction Penalty are both metric. Yevgeny Doctor, March 2008, IDC

Solution for Semi-metric Class Swap-Move algorithm: 1. Start with an arbitrary labeling f 2. Set success := 0 3. For each pair of labels 3.1. Find f* = argmin E(f') among f' within one a-b swap of f 3.2. If E(f*) < E(f), set f := f* and success := 1 4. If success = 1 goto 2 5. Return f a-b swap: In the new labeling f’, some pixels that were labeled a in f are now labeled b, and vice versa. Yevgeny Doctor, March 2008, IDC

Solve a-b swap step with Graph Cut Yevgeny Doctor, March 2008, IDC Fast Approximate Energy Minimization via Graph Cuts Yuri Boykov, Olga Veksler, Ramin Zabih, 1999

Solve a-b swap step with Graph Cut Cut and Labeling: Weights: Yevgeny Doctor, March 2008, IDC Fast Approximate Energy Minimization via Graph Cuts Yuri Boykov, Olga Veksler, Ramin Zabih, 1999

Solution for Metric Class Expansion Move algorithm: 1. Start with an arbitrary labeling f 2. Set success := 0 3. For each label 3.1. Find f* = argmin E(f') among f' within one a expansion of f 3.2. If E(f*) < E(f), set f := f* and success := 1 4. If success = 1 goto 2 5. Return f a expansion: In the new labeling some pixels change their label to a. Yevgeny Doctor, March 2008, IDC

Expansion Move Algorithm Example: Guaranteed approximation ratio by the algorithm: Produces a labeling f such that , where f* is the global minimum and . "What Energy Functions Can Be Minimized via Graph Cuts?", Vladimir Kolmogorov and Ramin Zabih, February 2004 IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. 26, NO. 2. Yevgeny Doctor, March 2008, IDC

Solve a expansion step with Graph Cut Yevgeny Doctor, March 2008, IDC Fast Approximate Energy Minimization via Graph Cuts Yuri Boykov, Olga Veksler, Ramin Zabih, 1999

Solve a expansion step with Graph Cut Cut and Labeling: Weights: Yevgeny Doctor, March 2008, IDC Fast Approximate Energy Minimization via Graph Cuts Yuri Boykov, Olga Veksler, Ramin Zabih, 1999

Yevgeny Doctor, March 2008, IDC Experimental Results Three energy functions: Truncated quadratic – semi-metric (swap-move): Potts model – metric (a-expansion): Truncated L2 distance – metric (a-expansion): Compared with: Best simulated annealing algorithm Yevgeny Doctor, March 2008, IDC

Yevgeny Doctor, March 2008, IDC Convergence Rate Yevgeny Doctor, March 2008, IDC Fast Approximate Energy Minimization via Graph Cuts Yuri Boykov, Olga Veksler, Ramin Zabih, 1999

Yevgeny Doctor, March 2008, IDC Image Restoration Yevgeny Doctor, March 2008, IDC Fast Approximate Energy Minimization via Graph Cuts Yuri Boykov, Olga Veksler, Ramin Zabih, 1999

Yevgeny Doctor, March 2008, IDC Motion and Stereo Yevgeny Doctor, March 2008, IDC Fast Approximate Energy Minimization via Graph Cuts Yuri Boykov, Olga Veksler, Ramin Zabih, 1999

What Energy Functions Can Be Minimized via Graph Cuts? A precise characterization of the class of functions in F3 that can be minimized using graph cuts A general purpose graph construction for minimizing any function in this class A necessary condition for any function of binary variables to be minimized via graph cuts. "What Energy Functions Can Be Minimized via Graph Cuts?", Vladimir Kolmogorov and Ramin Zabih, February 2004 IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. 26, NO. 2. Yevgeny Doctor, March 2008, IDC

What Energy Functions Can Be Minimized via Graph Cuts? Define general Energy Function classes: Given F2: F3: F2 is contained in F3 "What Energy Functions Can Be Minimized via Graph Cuts?", Vladimir Kolmogorov and Ramin Zabih, February 2004 IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. 26, NO. 2. Yevgeny Doctor, March 2008, IDC

What Energy Functions Can Be Minimized via Graph Cuts? Regular F2 functions: "What Energy Functions Can Be Minimized via Graph Cuts?", Vladimir Kolmogorov and Ramin Zabih, February 2004 IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. 26, NO. 2. Yevgeny Doctor, March 2008, IDC

What Energy Functions Can Be Minimized via Graph Cuts? Graph construction for F2: "What Energy Functions Can Be Minimized via Graph Cuts?", Vladimir Kolmogorov and Ramin Zabih, February 2004 IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. 26, NO. 2. Yevgeny Doctor, March 2008, IDC

What Energy Functions Can Be Minimized via Graph Cuts? Regular F3 functions: A function E of more than two variables is called regular if all projections of E of two variables are regular And Generally: Let E be a function of binary variables. If E is not regular, then E is not graph-representable. Yevgeny Doctor, March 2008, IDC

GrabCut "Interactive Foreground Extraction using Iterated Graph Cuts" Carsten Rother, Vladimir Kolmogorov, Andrew Blake, 2004 Microsoft Research Cambridge, UK Yevgeny Doctor, March 2008, IDC

Yevgeny Doctor, March 2008, IDC GrabCut Yevgeny Doctor, March 2008, IDC

Yevgeny Doctor, March 2008, IDC GrabCut Transparency: Yevgeny Doctor, March 2008, IDC

Yevgeny Doctor, March 2008, IDC GrabCut Yevgeny Doctor, March 2008, IDC

"Video Object Cut and Paste" Video Cutout "Video Object Cut and Paste" Yin Li, Jian Sun, Heung-Yeung Shum, 2005 Microsoft Research Asia Figure 1: Given a video (a) containing an opaque video object on a complicated background, our system can generate clear alpha mattes and foreground colors (b) for the video object, which can be pasted onto another background. Yevgeny Doctor, March 2008, IDC

Yevgeny Doctor, March 2008, IDC Video Cutout 3D segmentation of spatio-temporal video volume Partition into foreground and background, while preserving temporal coherence Local refinement of initial segmentation Provide brush tools for the user to control the object boundary precisely wherever needed Apply coherent matting to extract the alpha mattes and foreground colors of the object based on the accurate binary segmentation result Yevgeny Doctor, March 2008, IDC

Yevgeny Doctor, March 2008, IDC Video Cutout Yevgeny Doctor, March 2008, IDC

Yevgeny Doctor, March 2008, IDC Video Cutout Yevgeny Doctor, March 2008, IDC

Yevgeny Doctor, March 2008, IDC Video Cutout Yevgeny Doctor, March 2008, IDC

Yevgeny Doctor, March 2008, IDC Video Cutout Figure 7: Clip #2, frame 27. (a) 3D graph cut result is shown by the overlaid dashed line. The flag is a rapidly deforming object, but 3D graph cut can apture the shape very well. (b) Dashed lines indicate the boundaries after both the local refinement and overriding operations. The white pixels record the actions of foreground brushing and the black pixels for background brushing. (c) coherence matting result pasted on a blue screen. Yevgeny Doctor, March 2008, IDC