拼接stitcher出的结果为空???
#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/stitching/stitcher.hpp>
using namespace std;
using namespace cv;
bool try_use_gpu =false;
vector<Mat> imgs;
string result_name = "dst1.jpg";
int main(int argc, char * argv[])
{
cout << CV_VERSION<<endl;
double t = (double)getTickCount();
Mat img1 = imread("11.bmp");
Mat img2 = imread("22.bmp");
imshow("p1", img1);
imshow("p2", img2);
imgs.push_back(img1);
imgs.push_back(img2);
Stitcher stitcher = Stitcher::createDefault(try_use_gpu);
// 使用stitch函数进行拼接
Mat pano;
Stitcher::Status status = stitcher.stitch(imgs, pano);
if (pano.empty())
cout << "kong" << endl;
Mat pano2 = pano.clone();
//显示源图像,和结果图像
if (!pano2.empty()) {
imshow("game", pano2);
}
t = ((double)getTickCount() - t) / getTickFrequency();
cout << "time:" << t << endl;
waitKey(0);
return 0;
}
每次都进入
if (pano.empty())
cout << "kong" << endl;
这里面,为什么呢??