Wolfram Language & System 11.0 (2016)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)


computes the watershed transform of image, returning the result as an array in which positive integers label the catchment basins.

uses a binary image marker to indicate regions where basins may be created.

Details and OptionsDetails and Options

  • WatershedComponents[image] finds basins at each regional minimum in image.
  • WatershedComponents works with 2D as well as 3D images.
  • WatershedComponents works with binary, grayscale, and multichannel images, operating on the intensity averaged over all channels.
  • In the returned label array, zeros represent positions that do not belong to any foreground component.
  • WatershedComponents[image,marker] finds basins only at the positions corresponding to foreground regions in a binary image marker.
  • The target region marker can be any of the following:
  • markerimagea marker image
    {pos1,pos2,}a list of positions
  • Positions posi are assumed to be in the standard image coordinate system.
  • Typically, nonzero elements of marker are treated as seeds for the segmentation.
  • The following options can be specified:
  • CornerNeighborsAutomaticwhether to include corner neighbors
    MethodAutomaticthe method to use
  • Possible Method settings include:
  • "Watershed"morphological watershed method (Meyer) (default)
    "Basins"modified watershed algorithm (Beucher, Meyer)
    "Rainfall"gradient descent or rainfall algorithm (Osma-Ruiz)
    "Immersion"watershed immersion algorithm (VincentSoille)
    {"MinimumSaliency",t}gradient descent algorithm that merges adjacent basins if their minimum boundary height is less than t
  • The "Watershed" and "Immersion" methods return the watershed lines, represented as 0s in the label array.
  • With the "MinimumSaliency" method, CornerNeighbors->False is always used. All other methods by default use CornerNeighbors->True.
Introduced in 2010
| Updated in 2014