.. _example_cluster_plot_face_ward_segmentation.py: ========================================================================= A demo of structured Ward hierarchical clustering on a raccoon face image ========================================================================= Compute the segmentation of a 2D image with Ward hierarchical clustering. The clustering is spatially constrained in order for each segmented region to be in one piece. .. image:: images/plot_face_ward_segmentation_001.png :align: center **Script output**:: Compute structured hierarchical clustering... Elapsed time: 0.7552413940429688 Number of pixels: 7752 Number of clusters: 15 **Python source code:** :download:`plot_face_ward_segmentation.py ` .. literalinclude:: plot_face_ward_segmentation.py :lines: 10- **Total running time of the example:** 1.28 seconds ( 0 minutes 1.28 seconds)