sentinel-hub / sentinel2-cloud-detector

Sentinel Hub Cloud Detector for Sentinel-2 images in Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Without using Sentinel Hub for processing

jassantos opened this issue · comments

I actually have downloaded Sentinel 2 scenes. Is it possible not to use the sentinel hub to download the Sentinel 2 data and just use the ones I am keeping? As I have seen in your examples, it uses the Sentinel Hub.

Hi jassantos,

it is possible to use your own data for classification. Sentinel Hub services in the examples only provide the required data. You can also read your data, resize all band images to the same size and join them together into one numpy array where bands are in the order B01,B02,B04,B05,B08,B8A,B09,B10,B11,B12 (not all bands are used).

The cloud masks can then be calculated like this

cloud_detector = S2PixelCloudDetector(threshold=0.4, average_over=4, dilation_size=2)

cloud_probs = cloud_detector.get_cloud_probability_maps(my_band_images)
cloud_masks = cloud_detector.get_cloud_masks(my_band_images)

In addition, I believe you need to divide the band values by 10000. The classifier expects the reflectances to be between 0 and 1.

Thank you AleksMat and azupanc for your responses. I will look into it.