.. _example_plot_label.py:


===================
Label image regions
===================

This example shows how to segment an image with image labelling. The following
steps are applied:

1. Thresholding with automatic Otsu method
2. Close small holes with binary closing
3. Remove artifacts touching image border
4. Measure image regions to filter small objects


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


.. literalinclude:: plot_label.py
    :lines: 15-



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



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

