【发布时间】:2015-03-09 16:24:28
【问题描述】:
我正在尝试将三个图像拼接在一起。为此,我选择了 OpenCV 2.4.10 和 Microsoft Visual C++ 2010 Express。
图像为 1500x1500 像素,读取时为 CV_8UC3。
我正在为 32 位构建,并且已经使用 OpenCV 进行了一些其他工作,所以我猜该项目的路径设置正确。
奇怪的是,我只有有时会收到此错误,并且只有在我尝试拼接两个以上的图像时才会出现此错误。
这里是错误信息:
Stitching Test.exe 中 0x5841dcaa 处未处理的异常:0xC0000005:访问冲突读取位置 0x00000004。之后我自动进入“Chores.cpp”的第 99 行或“TaskCollection.cpp”的第 189 行,所以我认为这就是错误的根源。 (路径 C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\crt\src)
这里是代码:
#include <iostream>
//OPENCV
#include <opencv2\core\core.hpp>
#include <opencv2\highgui\highgui.hpp>
#include <opencv2\imgproc\imgproc.hpp>
//OPENCV STITCHING
#include <opencv2\stitching\stitcher.hpp>
using namespace std;
using namespace cv;
int main(){
Mat panoramaImage;
vector<Mat> inputImages;
inputImages.push_back(imread("../../V1.bmp"));
inputImages.push_back(imread("../../V2.bmp"));
inputImages.push_back(imread("../../V3.bmp"));
Stitcher stitcher = Stitcher::createDefault();
Stitcher::Status stitcherStatus = stitcher.stitch(inputImages, panoramaImage);
imshow("Stitching Result", panoramaImage);
waitKey(0);
return 0;
}
有人有建议吗?
【问题讨论】:
-
由于似乎没有人回答,我提交了bug report
标签: c++ visual-studio-2010 opencv opencv-stitching