Clouds detect and remove

how to get cloudless images on the sentinel dashboard? Is there any treatment that can remove the clouds? any overlap?

Hi @eduardoxargolo,

There are several ways to obtain cloudless images and access them through a layer created in the Dashboard. As a reminder, you can read about setting up your dashboard here.

  • If you just want to filter images so that you only get the ones that are cloud-free (for Sentinel-2 images), you can set the Cloud coverage parameter in your layer as shown in the image below:

  • If you want to retrieve cloudless mosaics, you can take a look at the cloudless mosaic script in the custom repository. There will be a blog post on how to create cloudless mosaics coming out soon: I will update the post with the link when it is published.

Maxim

thank you very much, I’m waiting for your post. Please inform me. Best Regards

Hello,

I am happy to announce that the blog post has been published: you can read it here.

Maxim

Wow fantastic bog post Maxim! very comprehensive and helpful and great tools!

I have a rather specific application of cloudless mosaics in mind that is incredibly sensitive to any missed classification of cloud pixels (Before and After differencing of two cloudless mosaic’s…) I have had success creating these cloudless mosaics over different time slices, however what tends to happen when differencing the images is that any pixels that have cloud that was not picked up get amplified in the resulting difference image.

I know there are limits to cloud classification, they are tricky things being sometimes partially seetthrough and patchy. So rather than strive for 100% correct classification I was thinking I might be able to use overally liberal cloud masks. For instance I find that its typically the edges of cloud where issues occur as they are obviously tricky transitions zones.

See below image of cloud peaking out beyond cloud masks, circled in blue

To counteract this is there anyway the cloud masks can be applied more liberally, or multiply there existing extent by some fraction?
The loss of some good quality data would be more than made up for with reduced cloud noise

Can you also confirm if the cloud masks we see through EO Browser/Sentinel Hub are calculated the same as those in your blog post, request builder ect.?

Alex

Clouds… the nemesis of all optical Remote Sensing experts!

As you have noticed, it is indeed very difficult to identify 100% of the clouds in a scene with automated approaches (even more so over bright surfaces). I still think that the cloudless algorithm does a pretty good job!

To counteract this is there anyway the cloud masks can be applied more liberally, or multiply there existing extent by some fraction?
The loss of some good quality data would be more than made up for with reduced cloud noise

Sentinel Hub services are designed on a “per-pixel” approach, so you cannot extend the cloud mask directly in EO Browser. If you have a workflow (for example in Python) that retrieves images using Sentinel Hub services, you could fetch the CLM (see here) band as a raster and buffer it using geospatial libraries. That would essentially allow you to multiply the cloud extent.

Can you also confirm if the cloud masks we see through EO Browser/Sentinel Hub are calculated the same as those in your blog post, request builder etc.?

Not quite. In the example that you are showing in your post, you are using the CLM band on its own. After some empirical tests, we found that it was more efficient to make the most of the SCL band offered with Sentinel-2 L2A images and combine the CLM and SCL bands. As a reminder, SCL is Scene classification data, based on Sen2Cor processor.

In the blog post, the cloud detection code is found in the validate function:

function validate (samples) {
  var scl = samples.SCL;
  var clm = samples.CLM;

  if (clm === 1 || clm === 255) {
        return false;
  } else if (scl === 1) { // SC_SATURATED_DEFECTIVE
        return false;
  } else if (scl === 3) { // SC_CLOUD_SHADOW
        return false;
  } else if (scl === 8) { // SC_CLOUD_MEDIUM_PROBA
        return false;
  } else if (scl === 9) { // SC_CLOUD_HIGH_PROBA
        return false;
  } else if (scl === 10) { // SC_THIN_CIRRUS
        return false;
  } else if (scl === 11) { // SC_SNOW_ICE
    return false;
  }  else {
  return true;
  }
}

Here is an example in EO Browser (where CLM is in blue and SCL in red). I would suggest that you play around with the different flags to see if you get results that satisfy you. In the example I quickly pulled up, the SCL band returns a lot of false positives. In the example used in the blog post, it worked well, so testing is needed :slight_smile: .

Maxim