Watershed
Separates and identifies distinct regions or objects within an image through gradient information and marker-based segmentation.
🖼️ Image options and parameters of waterShed
function
Watershed filter is a way of identifying objects by finding image's extreme points (minima or maxima) in terms of intensity and filling these spaces with color (label). The process reminds geological watershed, which is the origin of algorithm's name. In order for the "water" not to go overboard and stay within the limits of the region, these limits must be set.
There are two ways to do so. One way is to limit the intensity by threshold value. Another way is to apply a mask which can set the area where watershed will be implemented.
The watershed algorithm is particularly useful for segmenting objects in images, especially when objects are close to each other.
If you look for bright-colored ROIs, then either look for maximum points or invert image before applying watershed.
Input image with given minima | What watershed finds |
---|---|
![]() | ![]() |
Parameters and default values
image
options
Options
Property | Required | Default value |
---|---|---|
mask | no | - |
points | no | minimum points from getExtrema() function |
threshold | no | 1 |