How to export the corrected image?
Hi, Thank you for opening this nice program. I would like to use this source code well. I am beginner of the AROSICS.
My goal is to co-register two orthorectified airplane images captured in 1968 and 2012.
from arosics import COREG
im_reference = '/mnt/c/Users/KIGAM/Desktop/Data/Co_reg/5187_2012_35905028s.tif'
im_target = '/mnt/c/Users/KIGAM/Desktop/Data/Co_reg/2024proj_m_ortho_dn_68_s_miho_24_26.tif'
CR = COREG(im_reference, im_target, wp=(216233, 342188), ws=(1024,1024))
CR.calculate_spatial_shifts()
CR.correct_shifts()
When I run this code, there is no error.
Automatically detected nodata value for GeoArray_CoReg '5187_2012_35905028s': 0.0
Calculating footprint polygon and actual data corner coordinates for reference image...
Polygonize progress |==================================================| 100.0% Complete => 0:00:00
Bounding box of calculated footprint for reference image:
(215730.464, 341900.1485, 218214.5029, 344873.5528)
Automatically detected nodata value for GeoArray_CoReg '2024proj_m_ortho_dn_68_s_miho_24_26': 0.0
Calculating footprint polygon and actual data corner coordinates for image to be shifted...
Polygonize progress |==================================================| 100.0% Complete => 0:00:00
Bounding box of calculated footprint for image to be shifted:
(214359.19437445034, 339587.9945982114, 219429.22920946215, 344672.1741306286)
Matching window position (X,Y): 216233/342188
No clear match found yet. Jumping to iteration 2...
input shifts: 0 8
Detected integer shifts (X/Y): 0/0
Detected subpixel shifts (X/Y): -0.3702214583601235/-0.2688265627047897
Calculated total shifts in fft pixel units (X/Y): -0.3702214583601235/-0.2688265627047897
Calculated total shifts in reference pixel units (X/Y): -0.3702214583601235/-0.2688265627047897
Calculated total shifts in target pixel units (X/Y): -0.6713187416340771/-0.487460434380167
Calculated map shifts (X,Y): -0.18872245110105723/0.13703584048198536
Calculated absolute shift vector length in map units: 0.23322732499901266
Calculated angle of shift vector in degrees from North: 125.98428978867912
Original map info: ['Transverse Mercator', 1.0, 1.0, 214359.19437445, 344672.174130629, 0.281121975880888, 0.281121975880888]
Updated map info: ['Transverse Mercator', 1.0, 1.0, '214359.0056519989', '344672.3111664695', 0.281121975880888, 0.281121975880888]
Image similarity within the matching window (SSIM before/after correction): 0.2523 => 0.2495
Estimated reliability of the calculated shifts: 28.8 %
Correcting geometric shifts...
Warping progress |==================================================| 100.0% Complete => 0:00:03
But, the problem is to export the corrected image.
I read this https://danschef.git-pages.gfz-potsdam.de/arosics/doc/usage/global_coreg.html
To write the coregistered image to disk, the arosics.COREG class needs to be instanced with a filepath given to keyword ‘path_out’. The output raster format can be any format supported by GDAL. Find a list of supported formats here: https://gdal.org/drivers/raster/index.html
But, I don't know exactly.
Can you give me some example codes to export the corrected image?
Edited by Daniel Scheffler