We efficiently find the labeling that minimizes Eqn. (2) using
Graphcut [Boykov and Kolmogorov 2004]. More specifically, we
define a graph G = (V; E) where V is the set of m n + 2 vertices corresponding to the pixels in S plus two additional terminal
nodes, the source S and the sink T .