GFZ / arosics

AROSICS - Automated and Robust Open-Source Image Co-Registration Software
https://git.gfz-potsdam.de/danschef/arosics
Apache License 2.0
147 stars 26 forks source link

CRL.correct_shifts() after COREG_LOCAL reports: ValueError: The length of the given lists must be equal to the number of bands. Received a list with 3 items for 'STATISTICS_APPROXIMATE'. #55

Open MarioTro opened 3 hours ago

MarioTro commented 3 hours ago

Description

I would like to register an RGB 1cm GSD geotif and a multispectral (4 band) 2cm GSD orthophoto. The images were produces by WebODM, raw data was collected with a DJI Mavic 3M.

I am able to run COREG_LOCAL with various settings. However, when I am running

CRL.correct_shifts()

I get this error: ValueError: The length of the given lists must be equal to the number of bands. Received a list with 3 items for 'STATISTICS_APPROXIMATE'.

(global coregistration via arosics.COREG works fine!)

What I Did

CRL = COREG_LOCAL(
    im_ref = im_reference,
    im_tgt = im_target,
    grid_res = 200,
    window_size = (64,64),
    path_out = output_file,
    projectDir = os.path.dirname(output_file),
    v = True, # verbose
    max_shift = 50,
    align_grids = True,
    match_gsd = True,
    r_b4match = 2,
    s_b4match = 2,
)

CRL.correct_shifts()

The full error message:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/mario/Documents/Python/Arosics_based_image_registration/arosics_env/lib/python3.12/site-packages/arosics/CoReg_local.py", line 788, in correct_shifts
    self.calculate_spatial_shifts()
  File "/home/mario/Documents/Python/Arosics_based_image_registration/arosics_env/lib/python3.12/site-packages/arosics/CoReg_local.py", line 459, in calculate_spatial_shifts
    self._tiepoint_grid.get_CoRegPoints_table()
  File "/home/mario/Documents/Python/Arosics_based_image_registration/arosics_env/lib/python3.12/site-packages/arosics/Tie_Point_Grid.py", line 351, in get_CoRegPoints_table
    for i, res in enumerate(
  File "/home/mario/Documents/Python/Arosics_based_image_registration/arosics_env/lib/python3.12/site-packages/joblib/parallel.py", line 1650, in _get_outputs
    yield from self._retrieve()
  File "/home/mario/Documents/Python/Arosics_based_image_registration/arosics_env/lib/python3.12/site-packages/joblib/parallel.py", line 1754, in _retrieve
    self._raise_error_fast()
  File "/home/mario/Documents/Python/Arosics_based_image_registration/arosics_env/lib/python3.12/site-packages/joblib/parallel.py", line 1789, in _raise_error_fast
    error_job.get_result(self.timeout)
  File "/home/mario/Documents/Python/Arosics_based_image_registration/arosics_env/lib/python3.12/site-packages/joblib/parallel.py", line 745, in get_result
    return self._return_or_raise()
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mario/Documents/Python/Arosics_based_image_registration/arosics_env/lib/python3.12/site-packages/joblib/parallel.py", line 763, in _return_or_raise
    raise self._result
ValueError: The length of the given lists must be equal to the number of bands. Received a list with 3 items for 'STATISTICS_APPROXIMATE'.
MarioTro commented 2 hours ago

UPDATE: It now works for some settings of grid_res (2000) and window_size (64,64). But the result is not great. How can I estimate good values for these parameters? (e.g. given a very high resolution (1cm GSD) orthophoto and local mismatches)