Felzenszwalb¶
Felzenszwalb’s algorithm treats the image as a graph — one node per pixel, edges weighted by intensity dissimilarity between neighbors — and greedily merges regions whenever the dissimilarity between two regions is smaller than the internal variation within either one. This adaptive, per-region threshold means the algorithm naturally produces large, uniform regions in flat areas and many small regions in detailed, high-variation areas, without needing a single global threshold to be tuned by hand.
It’s efficient (near-linear in the number of pixels) and doesn’t require specifying the number of output regions in advance — only a scale parameter that trades off region size against sensitivity to detail.
Accessible via spice.clustering.felzenszwalb_clustering().
See also
Watershed — another way to split touching, high-detail regions
SLIC Superpixels — a faster, more regularly-shaped superpixel alternative
Image Clustering — every other clustering algorithm