I am using ECC for camera motion compensation but it fails with the following error: OpenCV(4.11.0) /Users/xperience/GHA-Actions-OpenCV/_work/opencv-python/opencv-python/opencv/modules/video/src/ecc.cpp:589: error: (-7:Iterations do not converge) The algorithm stopped before its convergence. The correlation is going to be minimized. Images may be uncorrelated or non-overlapped in function 'findTransformECC' My guess is that I have two images that are too dissimilar and hence the algorithm does not converge, but in the context of tracking for low FPSs and heavy camera motion this is not too uncommon. This must be failing already in the c++ layer, not throwing a catchable exception: warp_matrix = np.eye(2, 3, dtype=np.float32) try: (ret_val, warp_matrix) = cv2.findTransformECC( prev_img, curr_img, warp_matrix, cv2.MOTION_EUCLIDEAN, (cv2.TERM_CRITERIA_EPS | cv2.TERM_CRITERIA_COUNT, 100, 1e-5), None, 1 ) except Exception as e: LOGGER.warning(f'Affine matrix could not be generated: {e}. Returning identity') return warp_matrix I also tried to redirect an error with a callback, catching cv2.error, but nothing. And GPT is giving me BS answers. Continue reading...