Segmentation is performed independently in each frame using the method of graph cuts. The mathematical treatment of graph cuts for image segmentation is complex and can be found in previous reports.
12,13 Briefly, an undirected graph
G = <
V,
E > is established by a set of vertices
V and edges
E. Consider the set of data elements IP representing image pixels and an 8-connected neighborhood system
N. For every element
p ∈ IP, there exists an edge with nonnegative weight
we that connects
q ∈
N. In addition, there are two vertices named the source
S and sink
T, each with edges that connect to every IP. A graph cut
C is a cut through the edges such that the induced graph
G = <
V,
E\
C > bipartitions the graph and separates the source and sink vertices. To use graph cuts to optimally segment a boundary, image intensity is encoded by edge weight to the sink and source vertices, while gradient is encoded by edge weight to neighboring nodes. A graph cut in the network computes the minimization of the energy function
where
R(
A) specifies the intensity cost,
B(
A) specifies the boundary cost, and
λ is the intensity to boundary cost ratio. In our implementation, we define
where
I is pixel intensity,
CF and
CB are finite foreground and background costs,
σ is a noise attenuation factor, and
γ is a nonlinear intensity scaling factor. Foreground seed pixels are established by thresholding image intensity in a truncated foveal region (
Fig. 2C). The resulting seed markers are morphologically eroded to 25% of original area. For subsequent frames, the segmentation result from the adjacent frame is eroded to 25% of original area. Background seed pixels are established by selecting pixels a fixed distance from the centroid of foreground pixels.