#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
uj5u.com熱心網友回復:
無法打開包括檔案:“opencv2/stitching/stitcher.hpp”: No such file or directory這不是提示你這個原因嗎?
uj5u.com熱心網友回復:
那我該怎么解決呢 ~~急uj5u.com熱心網友回復:
電腦里面搜索一下stitcher.hpp這個檔案存在否,它的路徑正確否?uj5u.com熱心網友回復:
請問您是用BCB呼叫opencv3.0的嗎uj5u.com熱心網友回復:
請問一下,我為什么拼接不成功顯示Can't stitch images, error code =1uj5u.com熱心網友回復:
#include "opencv2/stitching/stitcher.hpp"修改為#include "opencv2/stitcher.hpp"uj5u.com熱心網友回復:
因為圖片大小不符合要求
uj5u.com熱心網友回復:
那什么樣的圖片大小和要求uj5u.com熱心網友回復:
把#include <opencv2/stitching/stitcher.hpp>改為#include <opencv2/stitching.hpp>
uj5u.com熱心網友回復:
自己寫演算法,為什么都喜歡用OPENCV。 OPENCV前期方便,后期就是限制。轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/54897.html
標籤:基礎類
上一篇:C++入門感想
