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

extrapolate cloud shadows beyond tile boundary? #8

Open
j08lue opened this issue Apr 30, 2019 · 2 comments
Open

extrapolate cloud shadows beyond tile boundary? #8

j08lue opened this issue Apr 30, 2019 · 2 comments

Comments

@j08lue
Copy link

j08lue commented Apr 30, 2019

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
Copy link
Contributor

qsly09 commented May 16, 2019

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

@j08lue
Copy link
Author

j08lue commented May 16, 2019

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:

Fmask/MatchCloudShadow.m

Lines 416 to 421 in db9f01f

% exclude the pixels out of the entire image.
tmp_ii_obs=tmp_i_obs(out_id==0);
tmp_jj_obs=tmp_j_obs(out_id==0);
clear out_id tmp_i_obs tmp_j_obs;
tmp_id=sub2ind(dim,tmp_ii_obs,tmp_jj_obs); % matched shadow locations
clear tmp_ii_obs tmp_jj_obs;

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

No branches or pull requests

2 participants