opencv stitch 图像拼接
2016-08-23
0 0 0
暂无评分
其他
如何获取积分?
vs2010 opencv 2.4.4以上可用 利用opencv stitcher类 stitch函数实现至少两幅图像的拼接。可直接运行,注意将opencv配置好,在release版本下运行,debug有时会出现内存错误
#include <iostream> #include <fstream> #include "opencv2/highgui/highgui.hpp" #include "opencv2/stitching/stitcher.hpp" 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"); Mat img3 = imread("3.jpg"); if (img1.empty() || img2.empty() || img2.empty()) { cout << "Can't read image"<< endl; return -1; } imgs.push_back(img1); imgs.push_back(img2); imgs.push_back(img3); // 调用createDefault函数生成默认的参数 Stitcher stitcher = Stitcher::createDefault(try_use_gpu); // 使用stitch函数进行拼接 Mat pano; Stitcher::Status status = stitcher.stitch(imgs, pano); // 保存结果图像 imwrite(result_name, pano); // 显示源图像,和结果图像 //imshow("源图像1", img1);
图像
拼接
opencvstitch
相关源码推荐
对图像进行DCT变换处理
0
0
暂无评分
图像超分辨率实现
0
0
暂无评分
图像拼接技术
0
0
暂无评分
图像灰度化的三种方法
0
0
暂无评分
MTF计算
0
0
暂无评分
暂无评论