You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ImageAlignment-FeatureBased python3 align.py
Reading reference image : form.jpg
Reading image to align : scanned-form.jpg
Aligning images ...
Traceback (most recent call last):
File "align.py", line 69, in <module>
imReg, h = alignImages(im, imReference)
File "align.py", line 26, in alignImages
matches.sort(key=lambda x: x.distance, reverse=False)
AttributeError: 'tuple' object has no attribute 'sort'
It is not clear what the input matches is, and how it is being passed to the alignImages() function. However, the error message suggests that matches is a tuple, and tuples do not have a sort() method.
The error message suggests that you are trying to call the sort method on a tuple object, which is not possible because tuples are immutable and do not have a sort method.
It seems that in your code, the variable matches is a tuple, and you are trying to sort it using a lambda function. To fix this error, you can convert the matches tuple to a list using the list() function, like this:
matches = list(matches)
matches.sort(key=lambda x: x.distance, reverse=False)
Alternatively, you can modify the function that returns the matches tuple to return a list instead.
The text was updated successfully, but these errors were encountered:
It is not clear what the input matches is, and how it is being passed to the alignImages() function. However, the error message suggests that matches is a tuple, and tuples do not have a sort() method.
The error message suggests that you are trying to call the sort method on a tuple object, which is not possible because tuples are immutable and do not have a sort method.
It seems that in your code, the variable matches is a tuple, and you are trying to sort it using a lambda function. To fix this error, you can convert the matches tuple to a list using the list() function, like this:
The text was updated successfully, but these errors were encountered: