I am currently trying to calculate GLCM matrices for Sentinel-2 data. However, the results are not satisfactory.
Usually, the GLCM images look something like this.
Unfortunately, it didn’t result in the expected image using the enabled NoData value and the all angles option. Now I only see a white scene with one value…
I downloaded the data from the Sentinel Hub and applied some preprocessing (L2A processing, Resampling, Subsetting). Processing was complete accomplished in SNAP and a screenshot of the full GLCM was given above.
Are there any differences between data download from Amazon and S2 Hub?
yes the AWS allows the download of single tiles and bands (instead of full images), they are also in integer format instead of float. This could actually be a reason.
I just tried B9 from an original S2 image (after sen2cor) and this is what I got:
It seems that the GLCM can’t handle float values properly. They all seem too equal so that there is no pattern/texture recognized between the different pixels by the algorithm. I played around with the parameters a bit (quantification levels, size, quantizers…) but didn’t find a solution yet. I however remember using these textures with db SAR data which was also float format.
So, a kind of workaround would be to multiply your source bands with 100 and then perform the texture analysis:
Just a remark: there is no difference between AWS S2 data and SciHub data, except the packing/grouping of files. From an “original” S2 product, the SNAP S2 reader knows how to convert DN to reflectance (of type float), whilst if you open just a jp2 file (a single band), the SNAP JP2 reader doesn’t know how to do that and you only have DN.
@ABraun : Thanks for that workaround! It actually works but I think it would be good to implement a solution like yours into the GLCM tool in SNAP.
Thanks anyway!
btw: Since I am going to segment my data, I think it does make more sense to calculate textures after the segmentation right?
What Quantizer(problemistic/equal distance) and Quantization level(8/16/32/64/128) mean in the processing pararmeter of GLCM operator???
Thanks in advance