SLIC Superpixels¶
SLIC (Simple Linear Iterative Clustering) runs a local k-means in a combined 5-D space: each pixel’s position (x, y) and color/intensity values together, rather than intensity alone. Cluster centers start on a regular grid, then each pixel is assigned to its nearest center within a limited spatial neighborhood — which keeps the algorithm fast (linear in the number of pixels) and produces superpixels: compact, roughly uniform-sized, edge-respecting regions rather than the irregular blobs a plain color-only k-means would give.
SLIC’s superpixels are commonly used as a pre-processing step before a heavier algorithm (e.g. a graph cut or a classifier), reducing an image with millions of pixels to a few hundred or thousand coherent regions without losing structural detail.
Accessible via spice.clustering.slic_clustering().
See also
K-means — the clustering idea SLIC’s local search is based on
Felzenszwalb — another region-based, edge-respecting alternative
Image Clustering — every other clustering algorithm