For each pixel i:
How these values are generated depends on the application.
⇒ if $a_i > b_i$ then we make $i$ a foreground pixel.
Noted that foreground pixels tend to be near to one another, and background pixels tend to near one another.
We represent an image as a graph G(V,E):
E contains an edge between pixels $i$ and $j$ if $i$ and $j$ neighbor each other.
For every neighboring pair of pixels {i,j}, we have a parameter $p_{ij}$ = the penalty for puttinh one of $i,j$ in foreground and the other in the background.
Objective :
Partition the set of pixels into 2 sets $A$ and $B$ to maximize:
\[q(A,B) = \sum_{i\in A}a_i + \sum_{j\in B}b_j - \sum_{(i,j)\in E ; i≠j}p_{ij}\]Minimum cut : Partition of vertices of a directed graph into 2 sets A,B, with $s\in A,t\in B$ to minimize weight of edges crossing from $A$ to $B$.
Image segmentation: Partition the vertices of the image graph into 2 sets A and B to maximize $q(A,B)$
Differences:
??? HOW TO MAKE IT POSSIBLE ???
IMAGE SEGMENTATION INSTANCE -> MIN-CUT
Adding:
Small fact: s will represent the foreground, and t will represent the background
Convert the current undirected graph into a directed graph:
Last issue: How do we handle the parameters $a_i,b_j,p_{ij}$ and minimization vs maximization ?
Let $Q = \sum_i(a_i+b_i)$
Old objective function was to maximize:
\[q(A,B)=\sum_{i\in A}a_i + \sum_{j \in B}b_j - \sum_{(i,j)\in E;i≠j} p_{ij}\]We want to maximize:
\[q(A,B) = Q - \sum_{i\in A}b_i - \sum_{j\in B}a_j - \sum_{(i,j)\in E; i≠j}p_{ij}\]This is same as minimize:
\[q'(A,B) = \sum_{i\in A} b_i + \sum_{j\in B} a_j + \sum_{(i,j)\in E;i≠j}p_{ij}\]Voila! we did convert it into the problem of min-cut with modified graph G (adding source $s$ and sink $t$)
We use the parameters $a_i,b_i,p_{ij}$ as weights on the various edges:
⇒ The capacity of an $s-t$ cut $(A,B)$ will equal the quantity we’re trying to minimize
We’ve designed the graph so that the capacity of an s-t cut (A,B) equals the quality of the partition defined by taking: