Cloud Masking and Cloud Removal (Fill Nulls) of Sentinel 2 Imagery in Google Earth Engine

Поділитися
Вставка
  • Опубліковано 23 січ 2025

КОМЕНТАРІ •

  • @MuddasirShah
    @MuddasirShah  Рік тому

    Here I have updated the script a bit. Lots of queries regarding replacement.
    code.earthengine.google.com/ea87531615f4612cd36359c295140194
    First I masked the cloudy image as well as the replacement image and merged them together as mean. You can even apply add at the end of the script if you don't prefer the image collection method.
    It is necessary to mention that both images that you are merging must have the same number of bands.
    Dr. Ujaval Gandhi @SpatialThoughts have interesting script on time-series interpolation (gap-filling). Here is the link
    spatialthoughts.com/2021/11/08/temporal-interpolation-gee/
    Dr. Ujaval's methodology is the correct way to achieve it. I presented the concept of replacing masks for this video only. 🙂

  • @qZoneful
    @qZoneful 2 роки тому +1

    This chanel is a gem!

  • @tesfamariamengida4905
    @tesfamariamengida4905 Рік тому +2

    After blend, there is no pixel value why? it say no unmasked pixel. it is not possible to use for LULC

    • @MuddasirShah
      @MuddasirShah  Рік тому

      PFA code.earthengine.google.com/ea87531615f4612cd36359c295140194

  • @hindlamrani7078
    @hindlamrani7078 Рік тому +1

    Please, how can i do Cloud Masking and Cloud Removal (Fill Nulls) of Landsat 8 and Landsat 7 in Google Earth Engine ?

    • @MuddasirShah
      @MuddasirShah  Рік тому

      Hi use can use the quality bands from Landsat and generate cloud mask from the cloudy bits.

    • @MuddasirShah
      @MuddasirShah  Рік тому

      Watch this tutorial. It’s for Sentinel-2 but the idea the same
      ua-cam.com/video/989DoViDORo/v-deo.htmlsi=4HqgVniZpXhsCD7N

    • @hindlamrani7078
      @hindlamrani7078 Рік тому +1

      @@MuddasirShah Thank you for your reply. I did already remove cloud but the problem is the pixels that contains clouds has been delete.

    • @MuddasirShah
      @MuddasirShah  Рік тому

      @@hindlamrani7078 so you want gap filling?

    • @MuddasirShah
      @MuddasirShah  Рік тому

      @@hindlamrani7078 spatialthoughts.com/2021/11/08/temporal-interpolation-gee/

  • @bobayato2274
    @bobayato2274 Рік тому +1

    Hello sir, I'm wondering why we use first() image on "maskedCollection" and "filled"?

    • @MuddasirShah
      @MuddasirShah  Рік тому +1

      That is just for the tutorial 🙂 you can use any image

    • @bobayato2274
      @bobayato2274 Рік тому +1

      @@MuddasirShah i use filtering image by id but it doesn't work. Where is the mistake?

    • @MuddasirShah
      @MuddasirShah  Рік тому +1

      @@bobayato2274 ua-cam.com/video/DFlmm7jr1pw/v-deo.html

    • @bobayato2274
      @bobayato2274 Рік тому +1

      @@MuddasirShah Thank you, sir.

    • @MuddasirShah
      @MuddasirShah  Рік тому

      @@bobayato2274 most welcome 🤗

  • @thatscorpio11.
    @thatscorpio11. Рік тому +1

    Hi, I'm a newbie to GEE. I am working on one project where I have to calculate NDVI value for a month. And I wanted to ask you, then I fill empty places with other image's pixels, can I still calculate NDVI on it? Can I make calculations? Or is it only for visualization?

    • @MuddasirShah
      @MuddasirShah  Рік тому

      Yes you will be able to calculate NDVI but suppose your point lies at location where pixel value of previous date image is present. That will give you same value for the two dates.
      Since it is your project I suggest you do time-series interpolation rather than doing this. I also understand that you’re a newbie to Earth Engine so I’ll share the link with you. Look at the code and try to implement it. Where you face an error or issue we will discuss. Write an email to me muddasirshah@outlook.com, I will try my best to solve this problem of yours.

    • @MuddasirShah
      @MuddasirShah  Рік тому

      spatialthoughts.com/2021/11/08/temporal-interpolation-gee/

  • @thebelltools9673
    @thebelltools9673 2 роки тому +1

    how to see metadata selected image,

    • @MuddasirShah
      @MuddasirShah  2 роки тому

      Print the image variable

    • @MuddasirShah
      @MuddasirShah  2 роки тому

      ua-cam.com/video/UrmOKofhCmA/v-deo.html

    • @thebelltools9673
      @thebelltools9673 2 роки тому +1

      @@MuddasirShah i've some trouble when print metadata, would you check my script
      Where i get contact for you

    • @MuddasirShah
      @MuddasirShah  2 роки тому

      @@thebelltools9673 please send script link on muddasirshah@outlook.com

    • @MuddasirShah
      @MuddasirShah  2 роки тому

      @@thebelltools9673 please make sure assets are open to read.

  • @fahadbaqa1190
    @fahadbaqa1190 9 місяців тому +1

    plz make video for Landsat 5, 7, 8 cloud masking too. Thanks

  • @martinaperez3767
    @martinaperez3767 Рік тому +1

    Thank you a lot for this very interesting tutorial!
    I have two questions:
    1.
    How can I apply the correction on an entire collection without merging the images ?
    Should I just delete the word 'mean' from this script ? "var filled = ee.ImageCollection([orignal_cm,replacement_fill]).mean()"
    2. why the var 'replacementImage' has different filter date from cloudy image?
    thanks !

    • @MuddasirShah
      @MuddasirShah  Рік тому

      Hi thank you for the complements.
      1. Basically it is a naive kind of approach of mine to fill the masked portion. What I did was that I filtered another cloud free image and wanted to replace the cloudy portion with portion of that image. So basically I had two images the cloudy masked image and the replacement image that is cloud free. I applied a mean reducer. If you remove the mean it will give you error.
      This overall process is known as image timeseries cloud interpolation. Read the pinned comment and you’ll get an idea like how it’s actually dealt with. Dr. Ujaval Gandhi has explained the process well.

    • @MuddasirShah
      @MuddasirShah  Рік тому

      I received your email too. I’ll write to you tomorrow if I get time :)

  • @ingni123456
    @ingni123456 2 роки тому +1

    Hi, you haven't pasted a link to the code, it still says "coming soon"

    • @MuddasirShah
      @MuddasirShah  2 роки тому

      Hi, I am very busy these days. If you have any queries I reply through emails quickly

    • @MuddasirShah
      @MuddasirShah  2 роки тому

      muddasirshah@outlook.com

  • @sofypuspita7715
    @sofypuspita7715 2 роки тому +1

    but it's still a cloud that is visible and not covered

    • @MuddasirShah
      @MuddasirShah  2 роки тому

      Hi Sofy!
      Thank you for the comment. Actually it’s not the cloud of the original image. If you see that one the cloud is more dense and shadow is dark.
      This I believe is the cloud in second image (mean image with less than 10% CC). The whole Idea is that I replaced it with pixels of other image. You can apply a mean filter on the cloud masked image and blend that or interpolate the same image that will also fill the nulls. 🙂

    • @sofypuspita7715
      @sofypuspita7715 2 роки тому +1

      @@MuddasirShah Thankyou for the response....

    • @sofypuspita7715
      @sofypuspita7715 2 роки тому +1

      @@MuddasirShah muddasir why do you use mean ?

    • @MuddasirShah
      @MuddasirShah  2 роки тому

      @@sofypuspita7715 because I like mean. Just needed an image

    • @sofypuspita7715
      @sofypuspita7715 2 роки тому

      @@MuddasirShah okey, thank youu...

  • @sofypuspita7715
    @sofypuspita7715 Рік тому +1

    muddasir how are you? I lost contact with you

    • @MuddasirShah
      @MuddasirShah  Рік тому

      Hi Sofy, How are you? Pls email me at muddasirshah@outlook.com, I will share my WhatsApp there

  • @omerreshi
    @omerreshi Рік тому

    Jinab tuhi hakwa eh provide aase kareth

  • @sofypuspita7715
    @sofypuspita7715 Рік тому +1

    Mudarris, where are you from? from Palestine, right?

  • @MuddasirShah
    @MuddasirShah  Рік тому

    Second version:
    var cld = require('users/fitoprincipe/geetools:cloud_masks')
    var test_image = s2SR.first()
    var masked = cld.sclMask(['cloud_low', 'cloud_medium', 'cloud_high', 'shadow'])(test_image)
    Map.addLayer(masked, {bands:['B8', 'B11', 'B4'], min:0, max:5000}, 'masked')