opencv自带之图像拼接
2017-09-07 13:55
253 查看
看效果:
vs2013+opencv3.0
vs2013+opencv3.0
#include <iostream> #include <fstream> #include<opencv2/opencv.hpp> #include "opencv2/stitching.hpp" #include "time.h" using namespace std; using namespace cv; bool try_use_gpu = false; vector<Mat> imgs; string result_name = "resultss.jpg"; int main(int argc, char* argv[]) { Mat img = imread("1.jpg"); resize(img,img, Size(500, 250), 0, 0, CV_INTER_LINEAR); imgs.push_back(img); img = imread("2.jpg"); resize(img, img, Size(500, 250), 0, 0, CV_INTER_LINEAR); imgs.push_back(img); img = imread("3.jpg"); resize(img, img, Size(500, 250), 0, 0, CV_INTER_LINEAR); imgs.push_back(img); double start = static_cast<double>(getTickCount()); Mat pano; Stitcher stitcher = Stitcher::createDefault(try_use_gpu); Stitcher::Status status = stitcher.stitch(imgs, pano); double time = ((double)getTickCount() - start) / getTickFrequency(); cout << "用时" << time << "秒" << endl; if (status != Stitcher::OK) { cout << "Can't stitch images, error code = " << int(status) << endl; return -1; } resize(pano, pano, Size(750,250), 0, 0, CV_INTER_LINEAR); imshow("拼接图", pano); imwrite(result_name, pano); waitKey(0); return 0; }
相关文章推荐
- Opencv Sift和Surf特征实现图像无缝拼接生成全景图像
- opencv多幅图像的拼接算法
- 利用opencv的stitcher类进行图像拼接
- Opencv图像拼接
- 示例程序047--用opencv的stitcher类实现图像拼接
- 基于opencv的图像拼接(四): 基于stitch类的离线图像拼接
- opencv图像拼接与融合
- opencv2.4.10+vs2008实现图像的拼接
- OpenCV学习笔记 imge stitching图像拼接stitching
- opencv图像拼接,即把两个矩阵合并为一个(vconcat和hconcat)、Mat成员函数size()
- opencv cvCopy 拼接图像
- Opencv使用Stitcher类图像拼接生成全景图像
- 图像拼接(十三):OpenCV拼接多幅图像(以中间图像为参考)
- [转]opencv实现几幅图像拼接成一整幅大图
- 【OpenCV】模板匹配和图像拼接
- 图像拼接实现镜面效果 opencv完整代码 实现(附实验结果)
- OpenCV18(图像拼接stitcher_detail)
- OpenCV18(图像拼接stitcher_detail)
- OpenCV学习笔记(五十一)——imge stitching图像拼接stitching OpenCV学习笔记(五十二)——号外:OpenCV 2.4.1 又出来了。。。。。 OpenCV学习笔记(五
- 【opencv】stitching图像拼接