Last active
January 4, 2020 12:22
-
-
Save henrique/3d1abf15e7b9636ae0615215e69c4483 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// GMeans Segmentation | |
var seg = ee.Algorithms.Image.Segmentation.GMeans(smooth.gt(demand_threshold), 3, 50, 10); | |
Map.addLayer(seg.randomVisualizer(), {opacity:0.5}, 'GMeans Segmentation'); | |
// SNIC Segmentation | |
var snic = ee.Algorithms.Image.Segmentation.SNIC(smooth.gt(demand_threshold), 30, 0, 8, 300); | |
Map.addLayer(snic.randomVisualizer(), {opacity:0.5}, 'SNIC Segmentation'); | |
// Uniquely label the patches and visualize. | |
var patchid = smooth.gt(demand_threshold) | |
.connectedComponents(ee.Kernel.plus(1), 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