.. _example_segmentation_plot_marked_watershed.py:


===============================
Markers for watershed transform
===============================

The watershed is a classical algorithm used for **segmentation**, that
is, for separating different objects in an image.

Here a marker image is built from the region of low gradient inside the image.
In a gradient image, the areas of high values provide barriers that help to
segment the image.
Using markers on the lower values will ensure that the segmented objects are
found.

See Wikipedia_ for more details on the algorithm.

.. _Wikipedia: http://en.wikipedia.org/wiki/Watershed_(image_processing)


.. image:: images/plot_marked_watershed_1.png
    :align: center


.. literalinclude:: plot_marked_watershed.py
    :lines: 20-



**Python source code:** :download:`download <plot_marked_watershed.py>`
(generated using ``skimage`` |version|)



**IPython Notebook:** :download:`download <./notebook/plot_marked_watershed.ipynb>`
(generated using ``skimage`` |version|)

