Closed dubai03nsr closed 2 years ago
Thanks for catching this bug! I did some testing and the problem is not really that test_idxs
is not of integer type, but that test_idxs
is actually the empty array.
It has to do with the algorithm having a single triangle match and no other triangles to test against (that's why test_idxs
is empty).
I tested your solution for the given example, but it still doesn't work for me (it gets stuck a few steps after for the same reason).
I'm looking into this, will try a solution and add a unit testing for this case.
A fix to this bug is merged to master now.
Calling
find_transform
sometimes yields an unexpectedIndexError: arrays used as indices must be of integer (or boolean) type
on line 556test_points = data[test_idxs, :]
. To resolve the IndexError, I casttest_idxs
using.astype(int)
on line 554.Among the cases I have tested, the cases that would have yielded IndexError now yield MaxIterError (List of matching triangles exhausted before an acceptable transformation was found) after my fix. Regardless, resolving the unexpected IndexError would make debugging much more user-friendly.
Below is a program that would have yielded IndexError.