Disclosed is a method of segmenting one or more objects from one or more
backgrounds in an image, the method comprising defining a plurality of image nodes,
each said image node corresponding to one or more pixels of said image, connecting
pairs of adjacent nodes with n-links, each said n-link weighted with an n-link
cost, defining a source node, defining a sink node, defining one or more object
seeds, said object seeds corresponding to image nodes within said objects, defining
one or more background seeds, said background seeds corresponding to image nodes
within said backgrounds, connecting said source node with each said object seed
with a plurality of t-links, connecting said sink node with each said background
seed with a plurality of t-links, wherein each said t-links is weighted with a
t-link cost, and calculating a segmentation cut having the smallest total cost
of all cuts separating said source from said sink, wherein said total cost of each
said cut is defined as the sum of the costs of all said n-links and t-links that
each said cut severs.