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

4 or 8 pixel blocks in downloaded Sentinel imagery #7

Open
MarcCoru opened this issue Oct 21, 2021 · 2 comments
Open

4 or 8 pixel blocks in downloaded Sentinel imagery #7

MarcCoru opened this issue Oct 21, 2021 · 2 comments

Comments

@MarcCoru
Copy link

hi Pau @prlz77 and Oscar @oscmansan,

Thanks for your work. We were downloading the data with seco_downloader.py but noticed a certain 4 or 8-pixel block structure in the images.
Looking over the source code, I can't find a concrete reason.
Could it be connected to the getInfo line https://github.com/ElementAI/seasonal-contrast/blob/5395c027922569f5c5b1785ad1ccddd839749c36/datasets/seco_downloader.py#L175
where (maybe) only an approximated representation of the images is returned?

Screenshot from 2021-10-21 11-46-25
image (1)
image

@josauder
Copy link

josauder commented Oct 21, 2021

I think I figured out the issue. The intensities of the bands are indivudally rescaled and reduced to 8-bits.

However, to capture the full depth of the S2-Sensors, the images must be saved to uint16 .tifs. I suspect the authors did not do this because rasterio doesn't seem to work with uint16 and compression='JPEG'. Changing the compression to 'None' seems to fix the problem.

The bands can then be concatenated to form the RGB image, and can be plotted in a way that they look as intended (after histogram normalization of all 3 bands at once):

image

@wangyi111
Copy link

hi @MarcCoru , may i ask how did you sample these connected tiles? It seems the original code would randomly sample tiles around all the 1000 cities.

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

3 participants