seededWatershed
public static <T extends ComplexType<T>,L extends Comparable<L>> void seededWatershed(Image<T> image,
Labeling<L> seeds,
int[][] structuringElement,
Labeling<L> output)
The seeded watershed uses a pre-existing labeling of the space where
the labels act as seeds for the output watershed. The analogy would
be to use dyed liquids emanating from the seeded pixels, flowing to the
local minima and then filling individual watersheds until the
liquids meet at the boundaries.
This implementation breaks ties by assigning the pixel to the
label that occupied an adjacent pixel first.
- Type Parameters:
T
- - the image type, typically real or integer. Technically
complex is supported but only the real part is used.
L
- - the labeling type, typically Integer for machine-coded
seeds or possibly String for human labeled seeds.
- Parameters:
image
- - the intensity image that defines the watershed
landscape. Lower values will be labeled first.
seeds
- - a labeling of the space, defining the first pixels
in the space to be labeled. The seeded pixels will be similarly labeled
in the output as will be their watershed neighbors.
structuringElement
- - an array of offsets where each element
of the array gives the offset of a connected pixel from a pixel of
interest. You can use AllConnectedComponents.getStructuringElement
to get an 8-connected (or N-dimensional equivalent) structuring
element (all adjacent pixels + diagonals).
output
- - a similarly-sized, but initially unlabeled labeling
space