无法拼接图像
我无法拼接图像,这是我的代码:
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])
两个图像:
- foo.png
- < a href="https://i.sstatic.net/XTpyu.png" rel="nofollow noreferrer">bar.png
我得到的结果: 结果
I'm unable to stitch images, this is my code:
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])
Both images:
The result i get: result
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
stitcher.stitch 接收要拼接在一起的图像列表。将代码更改为:
此外,OpenCV 无法拼接两个图像,因为它无法找到足够数量的关键点。尝试使用其他图像。
stitcher.stitch
takes in a list of images that are to be stitched together. Change the code to:Also, OpenCV is not able to stitch your two images as it is not able to find a sufficient number of keypoints. Try using other images.