I'm trying to do ndvi reclassify in google earth engine. I know exactly how to do it in Arcgis but I'm very new with GEE and I got stuck with javascript. What I want to do is to use mean + standard deviation of ndvi as a threshold. Pixel value between -1 to mean +SD reclassify to 0 and pixel between mean +SD to 1 reclassify to 1. The two classes can be displayed into different colour as a same layer, but ideally I would like to have the "0" area with no colour so I can check how well the "1" area overlaps with vegetation. Here's the code I have worked out so far:
var Blueskin =ee.Image('COPERNICUS/S2/20160721T223713_20160722T000334_T59GMK');
Map.centerObject(Blueskin, 10);
var Color = {bands:['B8','B4','B3'], max: 3000}
var Mask = ee.FeatureCollection(table);
Mask = Mask.geometry();
Map.centerObject(Mask);
var Blueskin = Blueskin.clip(Mask);
var ndvi = Blueskin.normalizedDifference(['B8', 'B4']);
var palette = ['blue', 'white', 'green'];
var ndviParams = {min: -1, max: 1, palette: palette};
Map.addLayer(ndvi, ndviParams, 'NDVI image');
var reducers = ee.Reducer.mean().combine({
reducer2: ee.Reducer.stdDev(),
sharedInputs: true
});
// Use the combined reducer to get the mean and SD of the image.
var stats = ndvi.reduceRegion({
reducer: reducers,
bestEffort: true,
});
// Display the dictionary of band means and SDs.
print(stats);
The aoi is the estuary in the image. I can get the value of mean and SD so I can actually manually set the threshold. But I don't know the code to set the threshold, reclassify pixels with the value lie between the same interval to a same integer (0 or 1) and give each area a colour.