Digital Visual Effects, Spring 2009 Yung-Yu Chuang 2009/5/21

Slides:



Advertisements
Similar presentations
SOFT SCISSORS: AN INTERACTIVE TOOL FOR REALTIME HIGH QUALITY MATTING International Conference on Computer Graphics and Interactive Techniques ACM SIGGRAPH.
Advertisements

Cutting Images: Graphs and Boundary Finding Computational Photography Derek Hoiem, University of Illinois 09/15/11 “The Double Secret”, Magritte.
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:
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.
A Gimp Plugin that uses “GrabCut” to perform image segmentation
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)
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.
CS448f: Image Processing For Photography and Vision Graph Cuts.
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.
Stereo Binocular Stereo Calibration (finish up) Next Time Motivation
High-Quality Video View Interpolation
MRF Labeling With Graph Cut CMPUT 615 Nilanjan Ray.
Lecture 10: Stereo and Graph Cuts
Stereo Computation using Iterative Graph-Cuts
An Iterative Optimization Approach for Unified Image Segmentation and Matting Hello everyone, my name is Jue Wang, I’m glad to be here to present our paper.
Measuring Uncertainty in Graph Cut Solutions Pushmeet Kohli Philip H.S. Torr Department of Computing Oxford Brookes University.
Perceptual Organization: Segmentation and Optical Flow.
What have we leaned so far? Camera structure Eye structure Project 1: High Dynamic Range Imaging.
Graph-based Segmentation
Image Renaissance Using Discrete Optimization Cédric AllèneNikos Paragios ENPC – CERTIS ESIEE – A²SI ECP - MAS France.
What have we leaned so far? Camera structure Eye structure Project 1: High Dynamic Range Imaging.
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
Graph-based Segmentation. Main Ideas Convert image into a graph Vertices for the pixels Vertices for the pixels Edges between the pixels Edges between.
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
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.
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.
GrabCut Interactive Foreground Extraction Carsten Rother – Vladimir Kolmogorov – Andrew Blake – Michel Gangnet.
Gaussian Mixture Models and Expectation-Maximization Algorithm.
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.
Lecture 05 29/11/2011 Shai Avidan Roy Josef Jevnisek הבהרה : החומר המחייב הוא החומר הנלמד בכיתה ולא זה המופיע / לא מופיע במצגת.
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.
Energy minimization Another global approach to improve quality of correspondences Assumption: disparities vary (mostly) smoothly Minimize energy function:
Graph-based Segmentation
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
Image Processing and Reconstructions Tools
Counting in High-Density Crowd Videos
Graph Cut Weizhen Jing
Visualizing Prim’s MST Algorithm Used to Trace the Algorithm in Class
Haim Kaplan and Uri Zwick
Lecture 31: Graph-Based Image Segmentation
Digital Image Processing
“grabcut”- Interactive Foreground Extraction using Iterated Graph Cuts
Seam Carving Project 1a due at midnight tonight.
Segmentation (continued)
Announcements Project 1 is out today help session at the end of class.
“Traditional” image segmentation
Presentation transcript:

Digital Visual Effects, Spring 2009 Yung-Yu Chuang 2009/5/21 Graph Cut Digital Visual Effects, Spring 2009 Yung-Yu Chuang 2009/5/21 with slides by Fredo Durand, Ramesh Raskar

Graph cut

Graph cut Interactive image segmentation using graph cut Binary label: foreground vs. background User labels some pixels similar to trimap, usually sparser Exploit Statistics of known Fg & Bg Smoothness of label Turn into discrete graph optimization Graph cut (min cut / max flow) F F B F F B F B B

Energy function Labeling: one value per pixel, F or B Energy(labeling) = data + smoothness Very general situation Will be minimized Data: for each pixel Probability that this color belongs to F (resp. B) Similar in spirit to Bayesian matting Smoothness (aka regularization): per neighboring pixel pair Penalty for having different label Penalty is downweighted if the two pixel colors are very different Similar in spirit to bilateral filter One labeling (ok, not best) Data Smoothness

Data term A.k.a regional term (because integrated over full region) D(L)=i -log h[Li](Ci) Where i is a pixel Li is the label at i (F or B), Ci is the pixel value h[Li] is the histogram of the observed Fg (resp Bg) Note the minus sign

Hard constraints The user has provided some labels The quick and dirty way to include constraints into optimization is to replace the data term by a huge penalty if not respected. D(L_i)=0 if respected D(L_i)=K if not respected e.g. K=- #pixels

Smoothness term a.k.a boundary term, a.k.a. regularization S(L)={j, i} in N B(Ci,Cj) (Li-Lj) Where i,j are neighbors e.g. 8-neighborhood (but I show 4 for simplicity) (Li-Lj) is 0 if Li=Lj, 1 otherwise B(Ci,Cj) is high when Ci and Cj are similar, low if there is a discontinuity between those two pixels e.g. exp(-||Ci-Cj||2/22) where  can be a constant or the local variance Note positive sign

Optimization E(L)=D(L)+ S(L)  is a black-magic constant Find the labeling that minimizes E In this case, how many possibilities? 29 (512) We can try them all! What about megapixel images?

Labeling as a graph problem Each pixel = node Add two nodes F & B Labeling: link each pixel to either F or B Desired result

Data term Put one edge between each pixel and F & G Weight of edge = minus data term Don’t forget huge weight for hard constraints Careful with sign

Smoothness term Add an edge between each neighbor pair Weight = smoothness term

Min cut Energy optimization equivalent to min cut Cut: remove edges to disconnect F from B Minimum: minimize sum of cut edge weight cut

Min cut <=> labeling In order to be a cut: For each pixel, either the F or G edge has to be cut In order to be minimal Only one edge label per pixel can be cut (otherwise could be added) cut

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

Energy minimization via graph cuts d1 d2 d3 Graph Cost Matching cost between images Neighborhood matching term Goal: figure out which labels are connected to which pixels

Energy minimization via graph cuts d1 d2 d3 Graph Cut Delete enough edges so that each pixel is (transitively) 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 Within a factor of 2 of optimal Computes local minimum in a strong sense even very large moves will not improve the energy Yuri Boykov, Olga Veksler and Ramin Zabih, Fast Approximate Energy Minimization via Graph Cuts, International Conference on Computer Vision, September 1999.

Move examples Red-blue swap move Starting point Green expansion move

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 E is lower 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

The expansion move algorithm 1. Start with an arbitrary labeling 2. Cycle through every label A in some order 2.1 Find the lowest E labeling within a single A-expansion 2.2 Go there if it E is lower than the current labeling 3. If E did not decrease in the cycle, we’re done Otherwise, go to step 2

Move examples Red-blue swap move Starting point Green expansion move

GrabCut Interactive Foreground Extraction using Iterated Graph Cuts Carsten Rother Vladimir Kolmogorov Andrew Blake Microsoft Research Cambridge-UK Welcome. I will present Grabcut – an Interactive tool for foreground extraction.

Demo video

Interactive Digital Photomontage Combining multiple photos Find seams using graph cuts Combine gradients and integrate Aseem Agarwala, Mira Dontcheva, Maneesh Agrawala, Steven Drucker, Alex Colburn, Brian Curless, David Salesin, Michael Cohen, “Interactive Digital Photomontage”, SIGGRAPH 2004

set of originals actual photomontage perceived When we take a photograph of a group of people, such as this image on the left, what we get is a frozen moment of time that is often less natural, and less attractive than the scene we remember. This is because the cognitive processes that form our visual memories integrate over a range of time to form a subjective impression. This memory will likely look a lot more like the image on the right, where everyone is smiling naturally. The goal of our photomontage system is to help us create photographs that better match the image we see in our mind’s eye. To do so, we begin with a stack of images, and combine the best parts of each to form an image that is better than any of the originals. set of originals actual photomontage perceived

Source images Brush strokes Computed labeling Composite

Brush strokes Computed labeling

Interactive Digital Photomontage Extended depth of field Use which objective

Interactive Digital Photomontage Relighting

Interactive Digital Photomontage

Interactive Digital Photomontage Gradient-domain fusion Poisson image editing

Demo video