C++ OpenCV缝合器抛出调整大小错误

C++ OpenCV缝合器抛出调整大小错误,c++,opencv,image-stitching,opencv-stitching,C++,Opencv,Image Stitching,Opencv Stitching,我正在尝试使用OpenCV缝合器编写代码,将一组图像缝合在一起,并不断出现此错误 OpenCV错误:断言失败(dsize.area()>0 | |(inv_scale_x>0 &&cv::调整大小,文件中的库存比例(y>0) C:\Users\car4p\Downloads\opencv master\opencv master\modules\imgproc\src\imgwarp.cpp, 第3230行 我四处搜索,发现这不是阅读图像的问题,图像显示都很好,并且颜色超过0。我相信输出有错误,

我正在尝试使用OpenCV缝合器编写代码,将一组图像缝合在一起,并不断出现此错误

OpenCV错误:断言失败(dsize.area()>0 | |(inv_scale_x>0 &&cv::调整大小,文件中的库存比例(y>0) C:\Users\car4p\Downloads\opencv master\opencv master\modules\imgproc\src\imgwarp.cpp, 第3230行

我四处搜索,发现这不是阅读图像的问题,图像显示都很好,并且颜色超过0。我相信输出有错误,但不知道如何修复它。如果有人以前处理过这个问题或知道解决方案,我们将不胜感激

我用C++编写,使用OpenCV 3.1和Visual Studio 2015。 读取图像的代码

imgs.push_back(imread("testerer1.jpg"));
imgs.push_back(imread("testerer2.jpg"));
imgs.push_back(imread("testerer3.jpg"));    
imgs.push_back(imread("testerer4.jpg"));
Mat stitchImages(vector<Mat> imgs) {
    Stitcher stitchs;
    vector<Mat> stitchedImg;

    stitchs.createDefault(false);

    Stitcher::Status status = stitchs.stitch(imgs, stitchedImg);

    return stitchedImg[0];
}
用于缝合图像的代码

imgs.push_back(imread("testerer1.jpg"));
imgs.push_back(imread("testerer2.jpg"));
imgs.push_back(imread("testerer3.jpg"));    
imgs.push_back(imread("testerer4.jpg"));
Mat stitchImages(vector<Mat> imgs) {
    Stitcher stitchs;
    vector<Mat> stitchedImg;

    stitchs.createDefault(false);

    Stitcher::Status status = stitchs.stitch(imgs, stitchedImg);

    return stitchedImg[0];
}
Mat拼接图像(矢量图像){
针迹;
向量机;
stitchs.createDefault(false);
缝合器::状态状态=缝合。缝合(imgs,缝合DIMG);
返回dimg[0];
}

sticher类中的第二个参数是Mat(ouputarray)而不是向量


请参见sticher类中的第二个参数是Mat(ouputarray)而不是向量


参见

请花点时间键入或复制/粘贴代码(按我的计数正好是8行)。请勿将文本和/或代码作为图像发布。非常感谢。这是我的第一篇帖子,我真的很感谢你的帮助。我已经正确地添加了代码,很抱歉给您带来不便。谢谢,看起来不错。你看到了吗:-如果你看到了,但它没有帮助,请在你的问题中提到它。也可以看到这个答案:请花时间键入或复制/粘贴代码(我的计数正好是8行)。请勿将文本和/或代码作为图像发布。非常感谢。这是我的第一篇帖子,我真的很感谢你的帮助。我已经正确地添加了代码,很抱歉给您带来不便。谢谢,看起来不错。你看到了吗:-如果你看到了,但没有帮助,请在你的问题中提及。也可以看到这个答案: