Lecture12 - Graph-Based Segmentation
Lecture12 - Graph-Based Segmentation
Graph-based Segmentation
Computer Vision
CS 543 / ECE 549
University of Illinois
Derek Hoiem
Last class
Gestalt cues and principles of
organization
Mean-shift segmentation
Good general-purpose segmentation
method
Generally useful clustering, tracking
technique
Watershed segmentation
Good for hierarchical segmentation
Use in combination with boundary prediction
Todays class
Treating the image as a graph
Normalized cuts segmentation
MRFs Graph cuts segmentation
Recap
Go over HW2 instructions
Images as graphs
i
w ij
j
Fully-connected graph
node for every pixel
link between every pair of pixels, p,q
similarity wij for each link
Source: Seitz
Similarity matrix
Increasing sigma
Source: Seitz
Cuts in a graph
Link Cut
set of links whose removal makes a graph disconnected
cost of a cut:
Cuts in a graph
Normalized Cut
Source: Seitz
http://www.cs.berkeley.edu/~malik/papers/SM-ncut.pdf
Pros
Cons
Usage
i , jedges
( yi , y j ; , data )
1: -logP(yi = 1 ; data)
Pairwise Potential
0
0 0
1 K
i , jedges
1
K
0
( yi , y j ; , data )
Cost to assign to 0
Cost to assign to 1
Sink (Label 1)
i , jedges
( yi , y j ; , data )
Cost to assign to 0
Cost to assign to 1
Sink (Label 1)
i , jedges
( yi , y j ; , data )
Intelligent Scissors
Mortensen and Barrett (1995)
GrabCut
User
Input
Result
Regions
Boundary
Colour Model
Iterated
graph cut
Foreground &
Background
Background
R
Foreground
Background
Source: Rother
Graph cuts
Boykov and Jolly (2001)
Image
Foreground
(source)
Min Cut
Background
(sink)
Cut: separating source and sink; Energy: collection of edges
Min Cut: Global minimal enegry in polynomial time
Source: Rother
P(c( x);
)
background
c( x) c( y ) 2
edge _ potential ( x, y ) k1 k 2 exp
2
2
4.
5. Return to 2, using current labels to
compute foreground, background
models
Moderately straightforward
examples
10
Difficult Examples
Camouflage &
Low Contrast
Fine structure
Harder Case
Initial
Rectangle
Initial
Result
11
Unary Potentials
Alpha Expansion
Graph Cuts
Cons
Not always applicable (associative only)
Need unary terms (not used for generic
segmentation)
N-cut implementation
http://www.seas.upenn.edu/~timothee/software/ncut/ncut.html
Graph cuts
http://www.cs.cornell.edu/~rdz/graphcuts.html
Classic paper: What Energy Functions can be Minimized
via Graph Cuts? (Kolmogorov and Zabih, ECCV '02/PAMI
'04)
Clustering
Key algorithm
Kmeans
Segmentation
Mean-shift segmentation
Flexible clustering method, good
segmentation
Watershed segmentation
Hierarchical segmentation from soft
boundaries
Normalized cuts
Produces regular regions
Slow but good for oversegmentation