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:

Slides:



Advertisements
Similar presentations
Cutting Images: Graphs and Boundary Finding Computational Photography Derek Hoiem, University of Illinois 09/15/11 “The Double Secret”, Magritte.
Advertisements

Fitting a transformation: feature-based alignment Wed, Feb 23 Prof. Kristen Grauman UT-Austin.
Graph cut Chien-chi Chen.
Presenter : Kuang-Jui Hsu Date : 2011/5/12(Tues.).
Introduction to Markov Random Fields and Graph Cuts Simon Prince
Lecture 24: Segmentation CS6670: Computer Vision Noah Snavely From Sandlot ScienceSandlot Science.
Online Social Networks and Media. Graph partitioning The general problem – Input: a graph G=(V,E) edge (u,v) denotes similarity between u and v weighted.
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.
CS 691 Computational Photography Instructor: Gianfranco Doretto Cutting Images.
Markov Random Fields (MRF)
Lecture 6 Image Segmentation
Image segmentation. The goals of segmentation Group together similar-looking pixels for efficiency of further processing “Bottom-up” process Unsupervised.
Region Segmentation. Find sets of pixels, such that All pixels in region i satisfy some constraint of similarity.
Segmentation CSE P 576 Larry Zitnick Many slides courtesy of Steve Seitz.
Announcements Project 2 more signup slots questions Picture taking at end of class.
Today: Image Segmentation Image Segmentation Techniques Snakes Scissors Graph Cuts Mean Shift Wednesday (2/28) Texture analysis and synthesis Multiple.
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-
What Energy Functions Can be Minimized Using Graph Cuts? Shai Bagon Advanced Topics in Computer Vision June 2010.
Image Segmentation Today’s Readings Forsyth & Ponce, Chapter 14
Measuring Uncertainty in Graph Cut Solutions Pushmeet Kohli Philip H.S. Torr Department of Computing Oxford Brookes University.
Computer vision: models, learning and inference
Perceptual Organization: Segmentation and Optical Flow.
Segmentation and Clustering Today’s Readings Forsyth & Ponce, Chapter 7 (plus lots of optional references in the slides) From Sandlot ScienceSandlot Science.
Announcements vote for Project 3 artifacts Project 4 (due next Wed night) Questions? Late day policy: everything must be turned in by next Friday.
Announcements Project 3 questions Photos after class.
Graph-based Segmentation
Image Segmentation Rob Atlas Nick Bridle Evan Radkoff.
MRFs and Segmentation with Graph Cuts Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 03/31/15.
Cutting Images: Graphs and Boundary Finding Computational Photography Derek Hoiem, University of Illinois 09/14/10 “The Double Secret”, Magritte.
MRFs and Segmentation with Graph Cuts Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/24/10.
Segmentation: MRFs and Graph Cuts Computer Vision CS 143, Brown James Hays 10/07/11 Many slides from Kristin Grauman and Derek Hoiem.
CS774. Markov Random Field : Theory and Application Lecture 13 Kyomin Jung KAIST Oct
Chapter 14: SEGMENTATION BY CLUSTERING 1. 2 Outline Introduction Human Vision & Gestalt Properties Applications – Background Subtraction – Shot Boundary.
Object Stereo- Joint Stereo Matching and Object Segmentation Computer Vision and Pattern Recognition (CVPR), 2011 IEEE Conference on Michael Bleyer Vienna.
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.
CS654: Digital Image Analysis Lecture 28: Advanced topics in Image Segmentation Image courtesy: IEEE, IJCV.
Computational Photography lecture 8 – segmentation CS (future 572) Spring 2016 Prof. Alex Berg (Credits to many other folks on individual slides)
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.
Image segmentation.
MRFs and Segmentation with Graph Cuts Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 03/27/12.
Course Introduction to Medical Imaging Segmentation 1 – Mean Shift and Graph-Cuts Guy Gilboa.
Image Segmentation Today’s Readings Szesliski Chapter 5
Cutting Images: Graphs and Boundary Finding
Segmentation by clustering: normalized cut
GrabCut Interactive Foreground Extraction using Iterated Graph Cuts Carsten Rother Vladimir Kolmogorov Andrew Blake Microsoft Research Cambridge-UK.
Fitting a transformation: Feature-based alignment May 2nd, 2017
Markov Random Fields with Efficient Approximations
Grouping.
Markov Random Fields and Segmentation with Graph Cuts
Lecture 31: Graph-Based Image Segmentation
Announcements Photos right now Project 3 questions
Digital Image Processing
“grabcut”- Interactive Foreground Extraction using Iterated Graph Cuts
Seam Carving Project 1a due at midnight tonight.
Segmentation (continued)
Announcements Project 4 questions Evaluations.
Announcements Project 4 out today (due Wed March 10)
Announcements Project 1 is out today help session at the end of class.
“Traditional” image segmentation
Presentation transcript:

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: Seitz

Segmentation by Graph Cuts Break Graph into Segments – Delete links that cross between segments – Easiest to break links that have low cost (low similarity) similar pixels should be in the same segments dissimilar pixels should be in different segments w ABC Source: Seitz

Cuts in a graph Link Cut – set of links whose removal makes a graph disconnected – cost of a cut: A B One idea: Find minimum cut gives you a segmentation fast algorithms exist for doing this Source: Seitz

But min cut is not always the best cut...

Cuts in a graph A B Normalized Cut a cut penalizes large segments fix by normalizing for size of segments volume(A) = sum of costs of all edges that touch A Source: Seitz

7 Finding Minimum Normalized-Cut Finding the Minimum Normalized-Cut is NP- Hard. Polynomial Approximations are generally used for segmentation * Slide from Khurram Hassan-Shafique CAP5415 Computer Vision 2003

8 Finding Minimum Normalized-Cut * From Khurram Hassan-Shafique CAP5415 Computer Vision 2003

9 It can be shown that such that If y is allowed to take real values then the minimization can be done by solving the generalized eigenvalue system Finding Minimum Normalized-Cut * Slide from Khurram Hassan-Shafique CAP5415 Computer Vision 2003

10 Algorithm Compute matrices W & D Solve for eigen vectors with the smallest eigen values Use the eigen vector with second smallest eigen value to bipartition the graph Recursively partition the segmented parts if necessary. * Slide from Khurram Hassan-Shafique CAP5415 Computer Vision 2003

Recursive normalized cuts 1.Given an image or image sequence, set up a weighted graph: G=(V, E) – Vertex for each pixel – Edge weight for nearby pairs of pixels 2.Solve for eigenvectors with the smallest eigenvalues: (D − W)y = λDy – Use the eigenvector with the second smallest eigenvalue to bipartition the graph – Note: this is an approximation 4. Recursively repartition the segmented parts if necessary Details:

Normalized cuts results

Graph cuts segmentation

Markov Random Fields Node y i : pixel label Edge: constrained pairs Cost to assign a label to each pixel Cost to assign a pair of labels to connected pixels

Markov Random Fields Example: “label smoothing” grid Unary potential K 1 K 0 Pairwise Potential 0: -logP(y i = 0 ; data) 1: -logP(y i = 1 ; data)

Solving MRFs with graph cuts Source (Label 0) Sink (Label 1) Cost to assign to 0 Cost to assign to 1 Cost to split nodes

Solving MRFs with graph cuts Source (Label 0) Sink (Label 1) Cost to assign to 0 Cost to assign to 1 Cost to split nodes

Graph cuts Boykov and Jolly (2001) Image Min Cut Min Cut Cut: separating source and sink; Energy: collection of edges Min Cut: Global minimal enegry in polynomial time Foreground (source) Background (sink) Source: Rother

Optimization Formulation - Boykov & Jolly ‘01  A – Proposed Segmentation  E(A) – Overall Energy  R(A) – Degree to which pixels fits model  B(A) – Degree to which the cuts breaks up similar pixels  - Balance A() and B() Goal: Find Segmentation, A, which minimizes E(A) 30

Link Weights Pixel links based on color/intensity similarities Source/Target links based on histogram models of fore/background 31

Grab cuts and graph cuts Grab cuts and graph cuts User Input Result Magic Wand (198?) Intelligent Scissors Mortensen and Barrett (1995) GrabCut Regions Boundary Regions & Boundary Source: Rother

Colour Model Colour Model Gaussian Mixture Model (typically 5-8 components) Foreground & Background Background Foreground Background G R G R Iterated graph cut Source: Rother

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

Difficult Examples Difficult Examples Camouflage & Low Contrast Harder Case Fine structure Initial Rectangle Initial Result GrabCut – Interactive Foreground Extraction 11

Border Matting Border Matting Hard Segmentation Automatic Trimap Soft Segmentation GrabCut – Interactive Foreground Extraction 23 to

Input Bayes Matting Chuang et. al. (2001) Knockout 2 Photoshop Plug-In Comparison Comparison GrabCut – Interactive Foreground Extraction 24 With no regularisation over alpha Shum et. al. (2004): Coherence matting in “Pop-up light fields”

Solve Mean Colour Foreground Mean Colour Background GrabCut – Interactive Foreground Extraction 25 Natural Image Matting Ruzon and Tomasi (2000): Alpha estimation in natural images

Noisy alpha-profile Border Matting GrabCut – Interactive Foreground Extraction Foreground Mix Back- ground Foreground Mix Background Fit a smooth alpha-profile with parameters

Result using DP Border Matting DP t Dynamic Programming Dynamic Programming GrabCut – Interactive Foreground Extraction 27 Noisy alpha-profile Regularisation t+1

GrabCut Border Matting - Colour Compute MAP of p(F|C,alpha) (marginalize over B) Compute MAP of p(F|C,alpha) (marginalize over B) To avoid colour bleeding use colour stealing (“exemplar based inpainting” – Patches do not work) To avoid colour bleeding use colour stealing (“exemplar based inpainting” – Patches do not work) [Chuang et al. ‘01] Grabcut Border Matting GrabCut – Interactive Foreground Extraction 28

Results GrabCut – Interactive Foreground Extraction 29

Using graph cuts for recognition TextonBoost (Shotton et al IJCV)

Using graph cuts for recognition TextonBoost (Shotton et al IJCV) Unary Potentials Alpha Expansion Graph Cuts

Limits of graph cuts Associative: edge potentials penalize different labels If not associative, can sometimes clip potentials Approximate for multilabel – Alpha-expansion or alpha-beta swaps Must satisfy

Graph cuts: Pros and Cons Pros – Very fast inference – Can incorporate recognition or high-level priors – Applies to a wide range of problems (stereo, image labeling, recognition) Cons – Not always applicable (associative only) – Need unary terms (not used for generic segmentation) Use whenever applicable