DIPlib Documentation - ©1995-2008 Quantitative Imaging Group, Delft University of Technology.

SeededWatershed

Morphological segmentation

SYNOPSIS

#include "dip_morphology.h"

dip_Error dip_SeededWatershed ( seeds, in, mask, out, connectivity, order, max_depth, max_size, binaryOutput )

DATA TYPES

integer, float

FUNCTION

Watershed segmentation with built-in region merging. max_depth and max_size control the merging procedure. Any region with max_size or less pixels and with max_depth grey-value difference or less will be merged to neighbouring regions when they touch (as opposed to build a watershed). max_size equal to 0 means that the size of the region is not tested when merging. To avoid merging of seeds with no grey-value difference between them, set max_size to a negative value. The regions are grown according to the connectivity parameter. See The connectivity parameter for more information. The output is either a labelled image where the pixels belonging to a catchment basin are labelled, or a binary image where the watershed pixels are 1 and the rest is 0. This is controlled by binaryOutput.

As opposed to Watershed, this function takes a seeds input image, and grows the catchment basins from there. The output image, when binaryOutput is DIP_TRUE, will have label values as given by the seed image.

If mask is not 0, only the pixels within mask will be considered. All the other pixels will be untouched.

ARGUMENTS

Data typeNameDescription
dip_ImageseedsBinary or labelled input image
dip_ImageinGrey-value input image
dip_ImagemaskMask image
dip_ImageoutOutput
dip_intconnectivityConnectivity
dipf_GreyValueSortOrderorderWhether to grow from low to high or high to low
dip_floatmax_depthMaximum depth of a region that can be merged
dip_intmax_sizeMaximum size of a region that can be merged
dip_BooleanbinaryOutputDIP_FALSE if the output should be a labelled image

The dipf_GreyValueSortOrder enumeration consists of the following values:

NameDescription
DIP_GVSO_HIGH_FIRSTProcess the pixels from high grey-value to low grey-value.
DIP_GVSO_LOW_FIRSTProcess the pixels from low grey-value to high grey-value.

SEE ALSO

Watershed, LocalMinima, Minima, Maxima, GrowRegions

DIPlib on-line documentation | Function reference | Global function index