我无法缝合图像,这是我的代码:
import cv2 stitcher = cv2.Stitcher_create(mode = 0) foo = cv2.imread("./foo.png") bar = cv2.imread("./bar.png") result = stitcher.stitch(foo,bar) cv2.imwrite("./result.jpg", result[1])
这两幅图像:
我得到的结果是:结果
发布于 2022-04-01 10:59:59
stitcher.stitch接收要拼接在一起的图像列表。将代码更改为:
stitcher.stitch
result = stitcher.stitch([foo,bar])
另外,OpenCV无法为您的两个图像缝制,因为它无法找到足够数量的关键点。尝试使用其他图像。
https://stackoverflow.com/questions/71705565
相似问题