opencv3.0 想试试图像拼接 结果从网上下的例子编译时出现了问题请大家看看

qq_26513759 2016-03-08 01:14:21
#include <iostream>
#include <fstream>
#include <opencv2/core/core.hpp>
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/stitching/stitcher.hpp"
#include<Windows.h>

using namespace std;
using namespace cv;

bool try_use_gpu = false;
vector<Mat> imgs;
string result_name = "result.jpg";

int main()
{
Mat img1=imread("1.jpg");
Mat img2=imread("2.jpg");
imgs.push_back(img1);
imgs.push_back(img2);
Mat pano;
Stitcher stitcher = Stitcher::createDefault(try_use_gpu);
Stitcher::Status status = stitcher.stitch(imgs, pano);
if (status != Stitcher::OK)
{
cout << "Can't stitch images, error code = " << status << endl;
return -1;
}
namedWindow(result_name);
imshow(result_name,pano);
imwrite(result_name,pano);
waitKey();
return 0;
}


1>d:\作业\计算机\opencv\拼接例子1\third\third\test.cpp(5): fatal error C1083: 无法打开包括文件:“opencv2/stitching/stitcher.hpp”: No such file or directory
...全文
2690 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
cczlp 2017-09-14
  • 打赏
  • 举报
回复
自己写算法,为什么都喜欢用OPENCV。 OPENCV前期方便,后期就是限制。
csdn330 2017-09-11
  • 打赏
  • 举报
回复 3
把#include <opencv2/stitching/stitcher.hpp>改为#include <opencv2/stitching.hpp>
旺仔饼饼 2017-07-21
  • 打赏
  • 举报
回复
那什么样的图片大小和要求
qq_38564234 2017-05-08
  • 打赏
  • 举报
回复
引用 6 楼 u014265870 的回复:
请问一下,我为什么拼接不成功显示Can't stitch images, error code =1
因为图片大小不符合要求
ALExyin01 2017-03-17
  • 打赏
  • 举报
回复
#include "opencv2/stitching/stitcher.hpp"修改为#include "opencv2/stitcher.hpp"
倾世春雨 2016-04-24
  • 打赏
  • 举报
回复
请问一下,我为什么拼接不成功显示Can't stitch images, error code =1
ewb1986 2016-03-21
  • 打赏
  • 举报
回复
请问您是用BCB调用opencv3.0的吗
ooolinux 2016-03-15
  • 打赏
  • 举报
回复
电脑里面搜索一下stitcher.hpp这个文件存在否,它的路径正确否?
qq_26513759 2016-03-14
  • 打赏
  • 举报
回复
那我该怎么解决呢 ~~急
netying 2016-03-10
  • 打赏
  • 举报
回复
无法打开包括文件:“opencv2/stitching/stitcher.hpp”: No such file or directory 这不是提示你这个原因吗?

13,824

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧