130 likes | 378 Views
MRF Labeling With Graph Cut. CMPUT 615 Nilanjan Ray. The MRF Labeling Problem. A cost function of the following form provides an MRF model:. The variables p i are binary, i.e ., takes values 0 or 1 only. f i are image specific terms called “likelihood” data term
E N D
MRF Labeling With Graph Cut CMPUT 615 Nilanjan Ray
The MRF Labeling Problem A cost function of the following form provides an MRF model: The variables pi are binary, i.e., takes values 0 or 1 only fi are image specific terms called “likelihood” data term g(i,j) typically enforce “spatial coherence” or “smoothness” in the solution We want to minimize E to obtain a binary labeling (p1,…, pN) for an image
An Example Likelihood An Image Probability densities for foreground and background image intensity: The “likelihood” data term:
Spatial Smoothness One can efficiently obtain a global minimization of E provided: An example smoothness term (Ising model): Source-sink graph cut (a.k.a. S-T graph cut) provides is an efficient algorithm solving the binary labeling problem
S-T Graph Cut A source-sink graph: every pixel must be connected to at least s or t A cut of source-sink graph: dashed edges are removed Source set of pixels in the cut: Sink set of pixels in the cut: A cut is the set of removed edges between the source and the sink sets; in S-T cut graph a pixel must belong either to s or to t, but not both.
S-T Cut and MRF Labeling The idea is to construct a S-T graph so that a cut of the graph can represent the cost function E. Next get the minimum cut of the S-T graph to minimize E. Every edge in the S-T graph should carry a cost The likelihood data term and the spatial smoothness term must be represented by the sum of the cost of the removed edges
Representing The Likelihood Term Consider the following algebraic manipulation: The basis of the identity: Construct a S-T graph as: N+2 vertices; N vertices represent N pixels, one vertex for s and another vertex for t Add an edge from s to i with weight fi(1)- fi (0) if fi(1)- fi (0)>0; else add an edge from i to t with weight fi(0)- fi (1) if fi(0)- fi (1)>0. Can you see why such a construction represents likelihood data terms?
Representing Smoothness Algebraic manipulations to the smoothness summation term: Need to represent the first three summation terms in the graph edges
Representing Smoothness… For the first summation: add an edge between every neighboring pixel pair (i, j) with weight For the second summation, if add an edge from s to i with weight else if add an edge from i to t with weight The third summation: similar to the second summation case What if an edge already exits? Just update the its weight.
Example Segmentation A cell image Segmentation by graph cut
Summary • S-T graph cut can solve a restricted Binary MRF labeling problem; The restriction is due to the allowed smoothness terms. • This is the state-of-the-art computation for Binary MRF labeling • More than binary labeling is an NP-hard problem: some heuristics exists for graph-cut • Also there are heuristics to relax the restrictions on the smoothness function