#include < stdio.h > #include < opencv2\opencv.hpp > #include < opencv2\stitching.hpp > int main() { std::vector< cv::Mat > vImg; cv::Mat rImg; vImg.push_back(cv::imread("F:/dongdong/0tool/3D/63.jpg")); vImg.push_back(cv::imread("F:/dongdong/0tool/3D/63.jpg")); vImg.push_back(cv::imread("F:/dongdong/0tool/3D/63.jpg")); vImg.push_back(cv::imread("F:/dongdong/0tool/3D/63.jpg")); vImg.push_back(cv::imread("F:/dongdong/0tool/3D/63.jpg")); vImg.push_back(cv::imread("F:/dongdong/0tool/3D/63.jpg")); vImg.push_back(cv::imread("F:/dongdong/0tool/3D/63.jpg")); vImg.push_back(cv::imread("F:/dongdong/0tool/3D/63.jpg")); cv::Stitcher stitcher = cv::Stitcher::createDefault(); unsigned long AAtime = 0, BBtime = 0; //check processing time AAtime = cv::getTickCount(); //check processing time cv::Stitcher::Status status = stitcher.stitch(vImg, rImg); BBtime = cv::getTickCount(); //check processing time printf("Time consuming: %.2lf sec \n", (BBtime - AAtime) / cv::getTickFrequency()); //check processing time if (cv::Stitcher::OK == status) { cvNamedWindow("Stitching Result", 0); cv::imshow("Stitching Result", rImg); imwrite("testbak2.jpg", rImg); } else printf("Stitching fail."); cv::waitKey(0); }