Closed tildigg closed 1 year ago
RuntimeError: One of the input images does not have sufficient gray value information (non-no-data values) for placing a matching window at the position (683775, 9424525). Matching failed.
Generally, the error message says, that there are too many no-data pixels within the matching window centered at (683775, 9424525).
CR = COREG(im_reference, im_target, wp=(683775, 9424525), ws=(1,-1))
However, you set the size of the matching window to 1 pixel (default is 256), which does not make sense, because a single pixel cannot be used to compute any co-registration. Use the default value or enlarge the matching window size depending on the expected shift length. For example, if you expect a shift of 500 pixels, then a window with 256x256 pixels is too small to cover the shift length. You need to enlarge it to, lets say, at least 1000x1000 pixels and adjust the max_shift
parameter.
That's great, thank you for your help. I thought this wanted the image pixel size.
May I also ask how to export the shifted file after completing the shift calculation?
I have added the out_path section to export the shifted GeoTIFF but it doesn't seem to be exporting to the directory. I have tried typing in the directory with the file name also. Here is what I used:
from arosics import COREG as cor im_reference = '/dir/to/file/chm_plot_buffer_1.tif' im_target = '/dir/to/file/drc_site14_plot1_rgbclip.tif' CR = COREG(im_reference, im_target, wp=(683775, 9424525), ws=(256,256), path_out = 'auto', fmt_out = 'GTiff') CR.calculate_spatial_shifts()
The output gives the shift values and a 'success' message but no file is exported.
Thanks
Thank you so much!
Description
I am trying to use AROSICS package (https://danschef.git-pages.gfz-potsdam.de/arosics/doc/usage/input_data_requirements.html) to align an RBG image taken from a drone and a canopy height model extracted from lidar collect from the same drone.
When I run the code in Jupyter to align the two images an error occurs saying one of the images does not have sufficient 'gray value information' but I can't work out what the 'gray value information' is.
What I Did
The code being run is found here: (https://danschef.git-pages.gfz-potsdam.de/arosics/doc/usage/global_coreg.html(
When i run this i get this error
Both files are .tif files - could this be the issue? The documentation states the file types are supported (https://gdal.org/drivers/raster/index.html) and includes GeoTIFF so maybe this isn't the issue.
I have tried:
Maybe a different file type will work but not sure what to convert the image and CHM to.
Hope this makes some sense
Many thanks MD