Graph Cut Weizhen Jing 2015.12.8.

Slides:



Advertisements
Similar presentations
Graph cut Chien-chi Chen.
Advertisements

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:
Graph-Based Image Segmentation
Foreground/Background Image Segmentation. What is our goal? To label each pixel in an image as belonging to either the foreground of the scene or the.
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.
1 Augmenting Path Algorithm s t G: Flow value = 0 0 flow capacity.
Optimal solution of binary problems Much material taken from :  Olga Veksler, University of Western Ontario
Segmentation Using Max Flow/Min Cut Graph Cuts Based on "An Experimental Comparison of Min-Cut/Max-Flow Algorithms for Energy Minimization in Vision.“
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
1 Augmenting Path Algorithm s t G: Flow value = 0 0 flow capacity.
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.
Semi-automatic Foreground Extraction Martin & Andreas.
MRF Labeling With Graph Cut CMPUT 615 Nilanjan Ray.
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.
Graph-Cut Algorithm with Application to Computer Vision Presented by Yongsub Lim Applied Algorithm Laboratory.
Perceptual Organization: Segmentation and Optical Flow.
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.
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.
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
Outline Standard 2-way minimum graph cut problem. Applications to problems in computer vision Classical algorithms from the theory literature A new algorithm.
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
Cutting Images: Graphs and Boundary Finding Computational Photography Derek Hoiem, University of Illinois 09/20/12 “The Double Secret”, Magritte.
Hebrew University Image Processing Exercise Class 8 Panoramas – Stitching and Blending Min-Cut Stitching Many slides from Alexei Efros.
Graph-based Segmentation
Network Flow.
Max-flow, Min-cut Network flow.
Markov Random Fields with Efficient Approximations
CSCI 3160 Design and Analysis of Algorithms Tutorial 8
Network Flow.
Max Flow min Cut.
Max-flow, Min-cut Network flow.
Discrete Inference and Learning
Edmonds-Karp Algorithm
7. Ford-Fulkerson Demo.
7. Ford-Fulkerson Demo.
Lecture 31: Graph-Based Image Segmentation
Digital Image Processing
Richard Anderson Lecture 21 Network Flow
Augmenting Path Algorithm
Flow Networks and Bipartite Matching
Algorithms (2IL15) – Lecture 7
Text Book: Introduction to algorithms By C L R S
Lecture 21 Network Flow, Part 1
7. Ford-Fulkerson Demo.
7. Ford-Fulkerson Algorithm with multiple optimal solutions
Augmenting Path Algorithm
Introduction to Maximum Flows
Maximum Flow Neil Tang 4/8/2008
7. Ford-Fulkerson Demo.
7. Ford-Fulkerson Demo.
7. Ford-Fulkerson Demo.
7. Ford-Fulkerson Demo.
Lecture 22 Network Flow, Part 2
Introduction to Maximum Flows
7. Ford-Fulkerson Demo.
“Traditional” image segmentation
Richard Anderson Lecture 22 Network Flow
7. Ford-Fulkerson Demo.
Maximum Flow Problems in 2005.
7. Ford-Fulkerson Demo 02/25/19 Copyright 2000, Kevin Wayne.
Presentation transcript:

Graph Cut Weizhen Jing 2015.12.8

Image Segmentation methods Threshold based method Edge detecting based method Energy functionals based method Snake model 、Level Set region based method region growing 、split-and-merge Graph based method GraphCut 、GrabCut、Random Walk ......

Introduction Application stereo vision Image matting Image segmentation Minimum cut of Graph

Introduction ► goal:Divide an image into two segments:"background" and "object" . ► pixel label problem Boykov Y, Funka-Lea G. Graph cuts and efficient ND image segmentation[J]. International journal of computer vision, 2006, 70(2): 109-131.

Construct S-T Graph G=<V,E> V=P {S ,T} P : pixel nodes in image s : terminal node, object t : terminal node,background E=n-Links t-Links n-Links : edges between two pixel nodes t-Links: edges between s or t and a pixel node t Wp(t) WP(s) s Wp(t): penalty for assigning pixel p to t(background). Wp(s): penalty for assigning pixel p to s(object). weights on n-links: penalty for a discontinuity between two adjacent nodes

Graph Cut cut a cut C={S,T} s S,t T,S T= , Cost of cut sum of the costs of the edges from S to T Min Cut a cut t s

steps of Graph Cut ► Initialize a binary vector A=(A1,A2,...,AP) (a cut) ► Generate a energy function E(A) ► Minimize E(A),find the min cut

Initialize a binary vector A A=(A1,A2,...,AP) a binary vector which represents certain segmentation each AP can be either 1(obj)or 0(bkg) 1

Initialize a binary vector A ► Automatic Segmentation ● reflect on how the intensity of pixel P fits into a known intensity model(e.g. histogram)of the object and background ► Interactive Segmentation ● Accurately positioned at the desired boundary (easily generalized to 3D data) ● Indicate segmentation regions rather than boundary , some pixel are marked as internal and some as external for the given object of interest. Automatic Segmentation Interactive Segmentation Automatic Segmentation

Energy Founction Boykov Y Y, Jolly M P. Interactive graph cuts for optimal boundary & region segmentation of objects in ND images[C]//Computer Vision, 2001. ICCV 2001. etc. Times Cited: 3118.

(1) E(A) — Energy function global cost of cut A R(A) — regional term B(A) — boundary term — the coefficient specifies a relative important of R(A) versus B(A) A=(A1,A2,...,AP) a binary vector which represents certain segmentation each AP can be either 1(obj)or 0(bkg)

Reginal term (2) RP(AP) : penalty for assigning pixel P to "object"or "background" Rp(obj) = -ln Pr(Ip|obj) Rp(bkg) = -ln Pr(Ip|bkg) RP(.) may reflect on how the intensity of pixel P fits into a known intensity model(e.g. histogram)of the object and background. (2)

Boundary term B{p,q} : penalty for a discontinuity between p and q (AP,Aq) :only consider pixel pairs on the boundary

Weights of edges

Max flow/Min Cut s 16 13 10 a b b 4 12 14 9 c 7 d d 4 20 t ● flow : f(u,v) is a flow from u to v ● max flow : the max flow from s to t ● cut : C={S,T} s S,t T,S T= , ● min cut : sum of the costs of the edges from S to T is minimum ● |f|max=C{S,T} s 16 13 10 a b b 4 12 14 9 c 7 d d 4 20 t

Ford & Fulkerson algorithm Find the path from source to sink While (path exists) flow += maximum capacity in the path Build the residual graph (“subtract” the flow) Find the augmenting path in the residual graph End s 16 13 10 a b 4 12 14 9 c 7 d 4 20 t FLOW=0

Ford & Fulkerson algorithm Find the path from source to sink While (path exists) flow += maximum capacity in the path Build the residual graph (“subtract” the flow) Find the augmenting path in the residual graph End s 16 13 10 a b 4 12 14 9 c 7 d 4 20 t FLOW=4

Ford & Fulkerson algorithm Find the path from source to sink While (path exists) flow += maximum capacity in the path Build the residual graph (“subtract” the flow) Find the augmenting path in the residual graph End s 16-4 13 +4 10 a b 4 12-4 +4 9-4 14-4 +4 +4 c 7 d 4-4 20 +4 t FLOW=4

Ford & Fulkerson algorithm Find the path from source to sink While (path exists) flow += maximum capacity in the path Build the residual graph (“subtract” the flow) Find the augmenting path in the residual graph End s 12 13 4 10 a b 4 8 4 5 10 4 4 c 7 d 20 4 t FLOW=4

Ford & Fulkerson algorithm Find the path from source to sink While (path exists) flow += maximum capacity in the path Build the residual graph (“subtract” the flow) Find the augmenting path in the residual graph End s 12 13 4 10 a b 4 8 4 5 10 4 4 c 7 d 20 4 t FLOW=4

Ford & Fulkerson algorithm Find the path from source to sink While (path exists) flow += maximum capacity in the path Build the residual graph (“subtract” the flow) Find the augmenting path in the residual graph End s 12 13 4 10 a b 4 8 4 5 10 4 4 c 7 d 20 4 t FLOW=11

Ford & Fulkerson algorithm Find the path from source to sink While (path exists) flow += maximum capacity in the path Build the residual graph (“subtract” the flow) Find the augmenting path in the residual graph End s 12-7 13 4+7 10-7 a b 4+7 8 4 5 10-7 4+7 4 7-7 c d +7 20-7 4 +7 t FLOW=11

Ford & Fulkerson algorithm Find the path from source to sink While (path exists) flow += maximum capacity in the path Build the residual graph (“subtract” the flow) Find the augmenting path in the residual graph End s 5 13 11 3 a b 11 8 4 5 3 11 4 c d 7 13 4 7 t FLOW=11

Ford & Fulkerson algorithm Find the path from source to sink While (path exists) flow += maximum capacity in the path Build the residual graph (“subtract” the flow) Find the augmenting path in the residual graph End s 5 13 11 3 a b 11 8 4 5 3 11 4 c d 7 13 4 7 t FLOW=11

Ford & Fulkerson algorithm Find the path from source to sink While (path exists) flow += maximum capacity in the path Build the residual graph (“subtract” the flow) Find the augmenting path in the residual graph End s 5 13 11 3 a b 11 8 4 5 3 4 c d 7 13 4 7 t FLOW=19

Ford & Fulkerson algorithm Find the path from source to sink While (path exists) flow += maximum capacity in the path Build the residual graph (“subtract” the flow) Find the augmenting path in the residual graph End s +8 5 13-8 11 3+8 a b 11-8 8-8 4+8 5 3 11 4 c d 7 13-8 4 7+8 t FLOW=19

Ford & Fulkerson algorithm Find the path from source to sink While (path exists) flow += maximum capacity in the path Build the residual graph (“subtract” the flow) Find the augmenting path in the residual graph End s 8 5 5 11 11 a b 3 12 5 3 11 4 c 7 d 5 4 15 t FLOW=19

Ford & Fulkerson algorithm Find the path from source to sink While (path exists) flow += maximum capacity in the path Build the residual graph (“subtract” the flow) Find the augmenting path in the residual graph End s 8 5 5 11 11 a b 3 12 5 3 11 4 c 7 d 5 4 15 t FLOW=19

Ford & Fulkerson algorithm Find the path from source to sink While (path exists) flow += maximum capacity in the path Build the residual graph (“subtract” the flow) Find the augmenting path in the residual graph End s 8 5 5 11 11 a b 3 12 5 3 11 4 c 7 d 5 4 15 t FLOW=23

Ford & Fulkerson algorithm Find the path from source to sink While (path exists) flow += maximum capacity in the path Build the residual graph (“subtract” the flow) Find the augmenting path in the residual graph End s 8+4 5 5-4 11 11 a b 3 12 5+4 3 11 4-4 c 7 d 5-4 4 15+4 t FLOW=23

Ford & Fulkerson algorithm Find the path from source to sink While (path exists) flow += maximum capacity in the path Build the residual graph (“subtract” the flow) Find the augmenting path in the residual graph End s 12 5 1 11 11 a b 3 12 9 3 11 c 7 d 1 4 19 t FLOW=23

Ford & Fulkerson algorithm Find the path from source to sink While (path exists) flow += maximum capacity in the path Build the residual graph (“subtract” the flow) Find the augmenting path in the residual graph End s 12 5 1 11 11 a b 3 12 9 3 11 c 7 d 1 4 19 t FLOW=23

Ford & Fulkerson algorithm Find the path from source to sink While (path exists) flow += maximum capacity in the path Build the residual graph (“subtract” the flow) Find the augmenting path in the residual graph End s 12 5 1 11 11 a b 3 12 9 3 11 c 7 d 1 4 19 t FLOW=23

Max flow/Min Cut DFS Gf from S The min cut : S={a,b,d},T={c} s b a 12 5 1 11 DFS Gf from S The min cut : S={a,b,d},T={c} 11 a b 3 12 9 3 11 c 7 d 1 4 19 t FLOW = 23

Image Segmentation

Conclusion Advantage Disadvantage ●Robust and Efficient Optimization in N-D images ●global optimal ,better Segmentation ●reginal term and boundary term,better Segmentation ●Suitable for color image segmentation ●Simple and effective user interaction Disadvantage ●gray value of background and object are similar ●background and object model are grey level histogram

Thank you!