1

I'm working with satellite imagery (from Sentinel-2), in particular with cloud detection and cloud cleaning.

I got a batch of images of the same area, but in different periods: enter image description here

enter image description here

enter image description here

From these images, you can see that the position of the clouds is always different.

I also have the mask for each image, where the black areas represent clouds:

enter image description here

enter image description here

enter image description here

These masks are not perfect, but this is not a problem.

What I want to do is to use the mask to cut all the white portions (so get the land and exclude the clouds), and then fill these cuts with a black portion of another image (fill the "hole" in the image with a part of another image without clouds).

Imagery is in TIFF format, while masks are in JPG format.

I'm using Python with libraries like Rasterio, numpy and scikit-image, so a Pythonic solution would be appreciated.

starball
  • 20,030
  • 7
  • 43
  • 238
  • Still not a code writing service. https://meta.stackoverflow.com/questions/284236/why-is-can-someone-help-me-not-an-actual-question – nick Dec 16 '22 at 12:19
  • 1
    Check https://stackoverflow.com/a/46269102/18667225 – Markus Dec 16 '22 at 13:48
  • @nick ["_We-are-not-a-code-writing-service comments. Are they the good, the bad, or the ugly?_"](https://meta.stackoverflow.com/q/372166/11107541), [Note: Implementation effort is not a hard requirement for asking a question on SO](https://meta.stackoverflow.com/q/260828/11107541). – starball Dec 19 '22 at 22:16
  • Surely just a little extension to this https://stackoverflow.com/a/74701747/2836621 – Mark Setchell Dec 23 '22 at 12:15
  • Does this answer your question? [Crop TIFF using JPG mask](https://stackoverflow.com/questions/74700266/crop-tiff-using-jpg-mask) – Markus Dec 23 '22 at 17:41

0 Answers0