I'm trying to use the OpenCV Stitcher class for putting two images together. I ran the simple example provided in the answer to this question with the same koala images, but it returns (1, None) every time. I've tried this on opencv-python version 3.4, 4.2, and 4.4, and all have the same result.
I've tried replacing the stitcher initializer with something else, (cv2.Stitcher.create, cv2.Stitcher_create, cv2.createStitcher), but nothing seems to work. If it helps, I'm on Mac Catalina, using Python 3.7. Thanks!
Try changing the default pano confidence threshold using
setPanoConfidenceThresh(). By default it's 1.0, and apparently it results in the stitcher thinking that it has failed.Here is the full example that works for me. I used that pair of koala images as well, and I am on opencv 4.2.0:
I think in this particular case
cv2.Stitcher_SCANSis a better mode (transformation between images is just a translation), but eitherSCANSorPANORAMAworks.