Open swdmike opened 1 year ago
Sure, it is possible. For AROSICS, it does not matter how many bands the reference and target images have, the tie points used for co-registration are always computed from a single band of each image and then applied to the entire target image (including all bands).
The above error is caused by unplausible metadata in of your input images. In particular, the STATISTICS_APPROXIMATE
metadata value indicates a different number of bands than the image actually has. To solve that, either remove the pre-computed image statistics from your input image or recompute them (I think by running gdalinfo -stats
or gdalinfo -approx-stats
).
Thanks for your prompt response. I did gdalinfo -stats -mm
, but same error again. Then I removed the alpha band and it's working.
Also, do I have to set nodata? If I do not, there is an error:
File "/usr/local/lib/python3.10/site-packages/arosics/CoReg_local.py", line 820, in correct_shifts
self.calculate_spatial_shifts()
File "/usr/local/lib/python3.10/site-packages/arosics/CoReg_local.py", line 490, in calculate_spatial_shifts
self._tiepoint_grid.get_CoRegPoints_table()
File "/usr/local/lib/python3.10/site-packages/arosics/Tie_Point_Grid.py", line 405, in get_CoRegPoints_table
results = results.get()
File "/usr/local/lib/python3.10/multiprocessing/pool.py", line 774, in get
raise self._value
ValueError: The given no-data value (256.0) is out range for data type uint8.
Thanks again.
Ok, would be interesting to know why there was an alpha band which was not represented in the image metadata.
Regarding nodata value: Looks like one of the input datasets has unsigned integer 8bit as data type AND has a nodata value of 256 already set in the metadata, which makes no sense since uint8 only covers values between 0 and 255. By explicitly providing a nodata value, the nodata value set in the dataset is ignored. That´s why it works this way.
You can use gdal_edit.py -unsetstats img.tif
.
This fixed the the issue for me.
Description
To perform co-registration of two images with different band counts using AROSICS. ref image is 3 bands geotiff, while another is 4 bands geotiff.
What I Did
got error:
Is it possible to use AROSICS to perform co-registration of two images with different band counts? How may I do that?