I applied the cloud masking on Sentinel 2 imagery in GEE. The original image collection without masking clouds is this:
First I tried the script exactly as written at the bottom of this page Sentinel-2 MSI: MultiSpectral Instrument, Level-2A and I got this result:
I saw other tutorials that other people use median
, so the second time I deleted 'mean' in the last line here:
Map.addLayer(dataset.mean(), visualization, 'RGB');
Instead I added 'median' in the image collection variable:
.map(maskS2clouds)
.median();
I realized median ()
produces much clearer image, however I am not sure about differences between median ()
and mean
and since mean
was used in the GEE website, I do not know if I am doing right by using median and having such a clear image!