image_stacking
image_stacking copied to clipboard
Missing required argument in cv2.findTransformECC()
Traceback (most recent call last):
File "auto_stack.py", line 121, in <module>
stacked_image = stackImagesECC(file_list)
File "auto_stack.py", line 25, in stackImagesECC
s, M = cv2.findTransformECC(cv2.cvtColor(image,cv2.COLOR_BGR2GRAY), first_image, M, cv2.MOTION_HOMOGRAPHY)
TypeError: findTransformECC() missing required argument 'criteria' (pos 5)
I had the same Problem!
It seems that OpenCV made a pretty big change to their API. Here's a fix that worked for me.
ITER = 10000
eps = 1e-10
criteria = (cv2.TERM_CRITERIA_EPS | cv2.TERM_CRITERIA_COUNT, ITER, EPS)
try:
cc, warp_matrix = cv2.findTransformECC(cv2.cvtColor(image,cv2.COLOR_BGR2GRAY), first_image, M, cv2.MOTION_HOMOGRAPHY,
criteria, inputMask=None, gaussFiltSize=1)
except TypeError:
cc, warp_matrix = cv2.findTransformECC(cv2.cvtColor(image,cv2.COLOR_BGR2GRAY), first_image, M, cv2.MOTION_HOMOGRAPHY, criteria)