This method uses the value of the Threshold property to binarize the luminance of the source image, and then creates a new image 8-bit binary image suitable as a mask for separating the binarized blobs (see Example).
The PrefloodLevel property value is used to dermine how much preflooding of the distance map is done to eliminate the effect of small boundary irregularities in determining local maxima in the distance map. The PrefloodLevel value essentially determines how large a boundary bubble needs to be before it is considered a separate object. The default value of 1 is suitable for most images; values of zero or greater than 3 are rarely useful.
The Reduce method will create an image showing the preflooded local maxima that are used as the seed points for the watershed separation flooding step when the Erosions argument is negative (the default, unlimited distance map).
The algorithm proceeds as follows:
1) pixels within the bounds of the AOI of the source image are binarized by taking as foreground pixels at Threshold percent above McImage.RangeMin to McImage.RangeMax.
2) The inverse of a distance map is taken of these foreground pixels, creating valleys of foreground pixels (if the Erosions argument is positive, then the depth of these valleys is limited to the given value).
3) A watershed segmentation is performed on this inverted distance map. Pre-flooding of these valleys to the PrefloodLevel is done to eliminate small puddles and moats. Then flooding of the remaining valleys is done until all pre-flooded watersheds rejoin. The pixels at the boundaries of the joined watersheds are set to black.
4) The result is an 8-bit image with 255 for every foreground pixel in the original binarized image, except for those between separated blobs. All background and separating pixels are zero in the result image.
The distance map used for the separation is based on reflected pixel values at AOI boundaries. This often results in peak distances being detected at the AOI boundary for foreground blobs that intersect those boundaries.