Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloud Shadows #15

Open
TabakoUA opened this issue Mar 19, 2019 · 10 comments
Open

Cloud Shadows #15

TabakoUA opened this issue Mar 19, 2019 · 10 comments
Labels
question Further information is requested

Comments

@TabakoUA
Copy link

First of all, thank you all guys (and ladies). You've done a great job with this cloud detection approach.
Did You make any tries for cloud shadows detection? Or probably You can advise some ready2use methods?
Thanks in advance!

@0xmtn
Copy link

0xmtn commented Feb 23, 2021

+1

@azupanc
Copy link

azupanc commented Feb 23, 2021

This custom script in Sentinel Hub's custom script repository combines s2cloudless cloud mask with a model that was trained to identify clouds, cloud shadow, haze, snow and water. There's definitely room for improvement, but perhaps it is a good starting point.

@0xmtn
Copy link

0xmtn commented Feb 24, 2021

Thanks man, I am looking into it

@AleksMat AleksMat added the question Further information is requested label Mar 2, 2021
@karinakort
Copy link

karinakort commented Jan 14, 2023

Hello!
Could anyone please help me to understand, how to mask shadows.

I tried to use 10 bands like in comments here . tried to use all 13 bands, different thresholds..but I cant't get shadows mask =(( The advice about the custom script application did'tt help to solve my problem.
The shadows after masking are always the same color as open water..

@azupanc
Copy link

azupanc commented Jan 16, 2023

The linked custom script identifies open water as observation outliers. If your use case focuses to water, then this is obviously an issue. If not, then such false positives are not really an issue. We successfully use this model to filter out clouds, cloud shadows and haze in land monitoring applications.

@karinakort
Copy link

karinakort commented Jan 16, 2023 via email

@azupanc
Copy link

azupanc commented Jan 16, 2023

The model that was converted to linked custom script doesn't seem to generalise to area of your interest. This is not surprising since the datasets that was trained one is from mid latitudes and focused to agricultural areas.

Have you tried using sen2cor Scene Classification Layer? Example

@karinakort
Copy link

karinakort commented Jan 16, 2023 via email

@MateusVidotti
Copy link

Hello. Has anyone tested this Google Earth Engine(GEE) script for cloud and shodow cloud mask?.
I tested and got good result for classification of cloud shadows. I'm trying to reproduce this cloud mask without using GEE. For this I need to find a way to reproduce what the GEE function directionalDistanceTransform does.
"For each zero-valued pixel in the source, get the distance to the nearest non-zero pixels in the given direction".
Anyone have an idea?

@eoasker
Copy link

eoasker commented Dec 15, 2023

Hello. Has anyone tested this Google Earth Engine(GEE) script for cloud and shodow cloud mask?. I tested and got good result for classification of cloud shadows. I'm trying to reproduce this cloud mask without using GEE. For this I need to find a way to reproduce what the GEE function directionalDistanceTransform does. "For each zero-valued pixel in the source, get the distance to the nearest non-zero pixels in the given direction". Anyone have an idea?

Hi there. I'm also trying to reproduce the cloud mask without GEE. I was thinking of something like this but I'm pretty sure I have something wrong there since the cloud shadow I get is wrong. Any thoughts?

    # Convert azimuth to radians
    cos_angle = np.cos(np.radians(azimuth))

    # Calculate directional distance transform
    directional_distance = cv2.distanceTransform(binary_mask.astype(np.uint8), cv2.DIST_L2, 5)

    # Apply the direction angle to get directional distance
    directional_distance *= cos_angle
    
    result = (directional_distance <= DISTANCE).astype(np.uint8)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

7 participants