I want to calculate histograms for every image in an ImageCollection with reduce.histogram. It works with a single image but I have problems mapping the function over the ImageCollection. I think the issues are ".first()" and the return commands. But I have no clue how to fix it.
Here is the code snippet:
var histo_ic_func = function (histo_ic_map) {
var map_func = histo_ic_map.map(function(ic_for_calc){
var histogram_image_ic = ee.Image(ic_for_calc.first());
var histogram_threshold_ic = histogram_image_ic.select('VV').reduceRegion({
reducer: ee.Reducer.histogram()
.combine('mean', null, true)
.combine('variance', null, true),
scale: 10,
bestEffort: true
});
return histogram_threshold_ic.get('VV_mean');
});
return imagecollection_threshold.get('VV_mean');
};
Here is the complete GEE script: https://code.earthengine.google.com/3d413950a4a2f389686283aa3c0bec9f. The relevant part starts in line 76.
As final output, I would like to have a FeatureCollection with the results of all image histogram calculations. I'm thankful for any help!