OpenCV图像拼接不能正常工作 [英] OpenCV image stitching does not work properly

查看:830
本文介绍了OpenCV图像拼接不能正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个初学者程序员,刚刚开始使用OpenCV。
我想使用 OpenCV的拼接将两个图片拼接在一起。 cpp示例程序当我试图拼接图像时,我会得到一个无法拼接图像,错误代码= 1或图像出来,有很多黑色的空白。我试图创建尽可能多的重叠,我可以在拍照时,仍然是这样。
我拍照的方式有问题吗?
这里是我拍摄的照片和他们的输出的例子:



输入图像:






输出图片:





这是一个错误的输出。注意黑色空间和图像看起来有很大的不同。有一点更多的输出图像,我不能显示,因为imwrite没有保存文件。我不得不使用imshow,然后做一个屏幕截图,但图像太宽,无法捕获在一个屏幕截图。无论如何,仍然不是一个好的输出。



这里是我在线另一个拼接程序的示例图像。这些图片完美拼接在一起:






输出: p>

解决方案

找出问题。
有降低我的图像的分辨率。我猜,当分辨率太高时,拼接器与过多的信息混淆。
也是照片给程序的顺序问题。我有时必须翻转顺序。


I'm a beginner programmer and just started using OpenCV. I want to stitch together 2 images using OpenCV's stitching.cpp Sample program When I attempt to stitch the images, I either get a "Can't stitch images, error code = 1" or the images come out with a lot of black blank space. I've tried to create as much overlap as I can when taking the photos, and still that's the case. Is there something wrong with the way I'm taking photos? Here are examples of pictures that I took myself and their output:

Input images:

Output image:

This is a bad output. Notice the black space and how the image looks much different. There is a bit more to the output image that I was not able to show because imwrite did not save the file. I had to use imshow, then do a screen shot, but the image was too wide to capture in one screenshot. Regardless, still not a good output.

Here are example images I got online for another stitching program. These images stitched together perfectly:

Output:

解决方案

Figured out the problem. Had to reduce the resolution of my image. I guess the stitcher got confused with the excess of information when the resolution was too high. Also the order in which the photos are given to the program matters. I have to sometimes have to flip the order.

这篇关于OpenCV图像拼接不能正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆