You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to orthorectify a SPOT 2 scene using a Sentinel-2 reference. I have a set of 50 good tie points computed via image matching with the Ames Stereo Pipeline.
While doing RSM refinement (cGCPOptimization), in some cases some of the GCP patches computed for the raw image include spurious values equal or close to 65535, which squish everything else to black (see attachments - the white specks) and disrupt the correlation, so that model refinement fails (large coregistration error of several pixels, not improving with any iteration).
The SPOT scene is a bit special compared to others, in that it has an inaccurate initial geotransform (off by ~60 km) and its original data type is Float32 instead of UInt8.
I have already tested the following, with no success:
converting the SPOT scene to UInt8, with various rescaling/combinations for the NA flag value
enlarging the extent of the reference orthoimage and DEM to provide a large margin on all sides
changing the extent of the SPOT scene (correcting the GCPs in the GeoTiff image and also the GCPs and location model in the METADATA.DIM file - but not the XYZ satellite location)
different versions of geoCosiCorr3D (the old dd4b7a6 and the current c531c22).
Update: pixel values of around 65535 appear in the GCP patches at locations where the original raw scene has the lowest values (mostly around and below 1, but sometimes as high as 10). The problem could then be an overflow (due to resampling?) somewhere in the production of the GCP patch. For the moment a workaround is to rescale the input raw scene (still saved as Float32 data type) so that no value is dangerously close to 0 - I have found that rescaling from [0,255] to [30,254] appears to provide a safe margin.
I am trying to orthorectify a SPOT 2 scene using a Sentinel-2 reference. I have a set of 50 good tie points computed via image matching with the Ames Stereo Pipeline.
While doing RSM refinement (cGCPOptimization), in some cases some of the GCP patches computed for the raw image include spurious values equal or close to 65535, which squish everything else to black (see attachments - the white specks) and disrupt the correlation, so that model refinement fails (large coregistration error of several pixels, not improving with any iteration).
The SPOT scene is a bit special compared to others, in that it has an inaccurate initial geotransform (off by ~60 km) and its original data type is Float32 instead of UInt8.
I have already tested the following, with no success:
Code and data to reproduce are here: https://drive.switch.ch/index.php/s/LsrfwhvJe0YZHfg
Run with
$ python cosicorr_refinement.py Spot2 10 1993-09-20_06-34-29 007-009_S2_187-270-0_1993-09-20-06-34-29_HRV-2_P_DT_RR 1993-09-20_06-34-29/ref_ortho.tif 1993-09-20_06-34-29/ref_dem.tif 1993-09-20_06-34-29/tps_final.txt
I am on Kubuntu 22.04, gdal 3.6.4, pyproj 3.6.1, geopandas 0.14.3, rasterio 1.3.9.
The text was updated successfully, but these errors were encountered: