GERSL / Fmask

The software called Fmask (Function of mask) is used for automated clouds, cloud shadows, and snow masking for Landsats 4-8 and Sentinel 2 images.
MIT License
170 stars 57 forks source link

extrapolate cloud shadows beyond tile boundary? #8

Open j08lue opened 5 years ago

j08lue commented 5 years ago

We use Fmask to process multiple adjacent Sentinel 2 tiles. When there are shadows that would go outside of the tile boundary, we get edges at the tile boundary, like you can see below (white=clouds, grey=shadows, low Sun angle from south-south-east).

An ideal solution would be that Fmask had an option to extend the bounds of the output mask, such that all shadows are included. So the southern tile in the scene below would extend north and overlap with the northern tile. Then, when merging the tiles, we could take care of the shadows nicely.

image

If I had access to the code, I'd be happy to help implementing this.

qsly09 commented 5 years ago

Now you can download the code. Thank you so much for sharing your idea.

j08lue commented 5 years ago

Thanks @qsly09, that was quick! I guess now I have to keep my promise and help... 😄 I won't be able to do this on my own, though. If anyone can lead the way who knows the code, that would be very much appreciated!

This part looks relevant:

https://github.com/GERSL/Fmask/blob/db9f01f262e69b5b4efc9fdbc65182a3bec72587/MatchCloudShadow.m#L416-L421