Stay organized with collections Save and categorize content based on your preferences.
Superpixel clustering based on SNIC (Simple Non-Iterative Clustering). Outputs a band of cluster IDs and the per-cluster averages for each of the input bands. If the 'seeds' image isn't provided as input, the output will include a 'seeds' band containing the generated seed locations. See: Achanta, Radhakrishna and Susstrunk, Sabine, 'Superpixels and Polygons using Simple Non-Iterative Clustering', CVPR, 2017.

ee.Algorithms.Image.Segmentation.SNIC(image, size, compactness, connectivity, neighborhoodSize, seeds)Image
imageImageThe input image for clustering.
sizeInteger, default: 5The superpixel seed location spacing, in pixels. If 'seeds' image is provided, no grid is produced.
compactnessFloat, default: 1Compactness factor. Larger values cause clusters to be more compact (square). Setting this to 0 disables spatial distance weighting.
connectivityInteger, default: 8Connectivity. Either 4 or 8.
neighborhoodSizeInteger, default: nullTile neighborhood size (to avoid tile boundary artifacts). Defaults to 2 * size.
seedsImage, default: nullIf provided, any non-zero valued pixels are used as seed locations. Pixels that touch (as specified by 'connectivity') are considered to belong to the same cluster.