GFZ / arosics

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

7000 tie-point limit GDAL bottleneck #28

Closed himal-ella closed 1 year ago

himal-ella commented 1 year ago

Hi, I was just wondering if there is a way to get around the 7000 tie-point limit (other than just changing the number of tie points through masking or changing the resolution)? I have been using arosics to look at ground displacement between images rather than for image co-registration and it works really well! My only issue is that it is limited to a maximum of 7000 tie points with a warning that the other matches can't be calculated because of a GDAL bottleneck. It doesn't take particularly long to run for 7000 points, my data generally has a maximum of 12000 points. I can run it in sections but would like to run it on quite a lot of images so I was just wondering if there is another way to get around this?

Many thanks!

danschef commented 1 year ago

Hi!

the 7000 tie-point limit is actually just a limitation during image warping, i.e., when correcting the displacements of the target image. Nevertheless, AROSICS should compute more than 7000 tie points without an issue. The problem might just be that calling something like arosics.Tie_Point_Grid.to_GCPList() already creates a subset of all the computed tie points, which is then also used to fill arosics.COREG_LOCAL.coreg_info['GCPList']. Here, it would be useful to have some more information about how you call AROSICS to derive the shift vectors.

However, it should in any case be possible to compute more than 7000 tie points and then get the shifts by filtering arosics.COREG_LOCAL.CoRegPoints_table (a Pandas DataFrame), e.g., as implemented here.

For the future, it is planned to replace the image warping part with some piece of code that does not have this 7000-tie-points limitation. And it also looks like it would also make sense to move the automatic sub-setting of the originally computed tie point list to the image warping instead of doing this directly when creating the GCP list. I created an issue for this here. I will see if I have some time left for this in the next weeks.

himal-ella commented 1 year ago

Hi, thanks for such a detailed and quick response!

I realised I was making it more complicated than it needed to be, as you point out it doesn't filter the tie points until the warping stage so it is not a problem if I just export the tie points.

FT = COREG_LOCAL(image_1,image_2,**kwargs) table = FT.CoRegPoints_table table.to_csv(export_path)

Many thanks again!

danschef commented 1 year ago

Yes, you might have to filter for false-positives and nodata as suggested above.