sentinel2-cloud-detector icon indicating copy to clipboard operation
sentinel2-cloud-detector copied to clipboard

[BUG] s2cloudless detects clouds even if there is no cloud

Open JinIgarashi opened this issue 5 months ago • 0 comments

Describe the bug

Firstly, thank you for developing this library to detect cloud from sentinel 2. I implemented cloud masking by using sentinel 2 data from Earth Search. The algorithm works well for most scenes from sentinel L1C.

But I encountered an issue that this detects cloud where there is no cloud actually in true color image.

The below is true color image from sentinel 2.

The source is from https://earth-search.aws.element84.com/v1/collections/sentinel-2-l1c/items/S2A_35MRT_20240819_0_L1C

Image

After running cloud detector, it shows cloud mask as following image. As you can see, there is no cloud in true color image, but it detects cloud. Particularly this image detects cloud where there is lake.

Image

I confirmed this behaviour is also there if I use s2cloudless with sentinel hub API as your example notebook shows.

To Reproduce

Steps to reproduce the behavior:

  1. Search data for BBox((( 861058.1784629119,9781268.28041011), (885945.102276759,9798858.261513488)), crs=CRS("32735")) and date of 20240819
  2. run get_cloud_masks as example's ipynb shows.

I uploaded the jupyter notebook to reproduce this bug for specific scene.

sentinel2-cloud-detector-example.ipynb.zip

Image

Image

Expected behavior

It should not detect most of area as cloud

Environment

Jupyter Notebook

Stack trace or screenshots

If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context

My implementation of s2cloudless with Earth Search Sentinel 2 is at https://github.com/UNDP-Data/rapida/pull/407 for your reference.

JinIgarashi avatar Jun 03 '25 11:06 JinIgarashi