Google Earth Engine – Effective Image Segmentation Solutions

google-earth-engineimage segmentation

From the Google Engine scripts,

Is it available any Segmentation tool like the ArcMap "Segmentation Mean Shift" from ArcMap? I´m looking for crop-fields limit detection.
I tried the SNIC one explained by Gorelick at the 2018 Google Engine Summit (video, slides), but it needs the "Crop Data Layer" as an input, and I am located at Argentina. Maybe a SNIC workaround?

Best Answer

SNIC is just an algorithm, so it can be applied to the layer you want to segment. The "Crop Data Layer" is just an example layer.

I give you a simple example:

// site
var p = ee.Geometry.Point([-62.44, -38.40])
var site = p.buffer(10000)
// Sentinel 2 collection filtered
var s2 = ee.ImageCollection('COPERNICUS/S2')
           .filterBounds(p)
           .filterMetadata('CLOUD_COVERAGE_ASSESSMENT', 'less_than', 20)
// get the first image
var image = ee.Image(s2.first()).clip(site)    
// visualize the image
var vis = {bands:['B8', 'B11', 'B4'], min:0, max:5000}
Map.addLayer(image, vis, 'Image Sentinel 2')    
// segmentation with size 30
var snic = ee.Algorithms.Image.Segmentation.SNIC(image, 30)
// watch results of segmentation
Map.addLayer(snic.randomVisualizer(), null, 'SNIC')