0

I try to apply histogram matching based on OpenCV and Scikit image on Sentinel 2 data, similar to https://www.geeksforgeeks.org/histogram-matching-with-opencv-scikit-image-and-python.

Sentinel 2 bands have a value range between 0 and 10000, also they have coordinates encoded. It looks like OpenCV and Scikit image only support a value range up to 255, as my resulting images are all black.

Is there any library that supports the value ranges of sentinel 2 images, without losing the geo information of the image?

MikeHuber
  • 575
  • 2
  • 7
  • 13

1 Answers1

0

Not sure if this helps, but are you working with the L2-A BOA imagery? In the documentation I understand that the meaningful reflectance values go from “1” to “65535” (UINT) and "0" is reserved for NO_DATA. As of Baseline 04.00 since 22-01-25 you also have to use the BOA_ADD_OFFSET for L2 or the RADIO _ADD_OFFSET for L1 to adjust values if you wish to compare them with pre v04.00 images. Currently all bands offset appear to be set to 1000, so you just subtract this value to get pre v04.00 values.

There is also QUANTIFICATION_VALUE which is used to scale down the values for each band - unsure of the size of that value though. But that might bring the pixel value to between 0-1 or perhaps 1-255?

See the"Sentinel-2 Products Specification Document" at https://sentinel.esa.int/documents/247904/685211/S2-PDGS-TAS-DI-PSD-V14.9.pdf/3d3b6c9c-4334-dcc4-3aa7-f7c0deffbaf7?t=1643013091529

for more details