Segmenting the picture of greek coins in regions
This example uses Spectral clustering on a graph created from voxel-to-voxel difference on an image to break this image into multiple partly-homogeneous regions.
This procedure (spectral clustering on an image) is an efficient approximate solution for finding normalized graph cuts.
There are three options to assign labels:
‘kmeans’ spectral clustering clusters samples in the embedding space using a kmeans algorithm
‘discrete’ iteratively searches for the closest partition space to the embedding space of spectral clustering.
‘cluster_qr’ assigns labels using the QR factorization with pivoting that directly determines the partition in the embedding space.
# Authors: The scikit-learn developers
# SPDX-License-Identifier: BSD-3-Clause
import time
import matplotlib.pyplot


