Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
// GMeans Segmentation
var seg = ee.Algorithms.Image.Segmentation.GMeans(, 3, 50, 10);
Map.addLayer(seg.randomVisualizer(), {opacity:0.5}, 'GMeans Segmentation');
// SNIC Segmentation
var snic = ee.Algorithms.Image.Segmentation.SNIC(, 30, 0, 8, 300);
Map.addLayer(snic.randomVisualizer(), {opacity:0.5}, 'SNIC Segmentation');
// Uniquely label the patches and visualize.
var patchid =
.connectedComponents(, 256);
Map.addLayer(patchid.randomVisualizer(), {opacity:0.5}, 'Connected Patches');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment