Bug in GroundSpacingImageFunction at image middle
Description
When calling the GroundSpacingImageFunction
at the image middle index, the results are nan.
I think the reason is here: https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/blob/develop/Modules/Filtering/Projection/include/otbGroundSpacingImageFunction.hxx#L70
I don't get the logic : we want to estimate the spacing at a given index, but the measurements are made at index
and largest_size - index
. Of course, when index = largest_size/2
, the measurements are on the same index => crash.
The delta X and delta Y applied on index should not be too large. This can give quite imprecise results especially for SAR images. I understand that using a delta_X = 1 pixel
may be unstable (because of DEM), but maybe we should do all transforms from sensor to ground at a constant elevation.
Steps to reproduce
I could reproduce the bug with a S1 image that has an even number of pixels.
Configuration information
OTB 7.2 Custom Debian build with native dependencies.