简介
基本的拼接方式参见: 《opencv实现图像的拼接功能》
本博文基于取景模式讲解图像拼接。API全面基本的介绍介绍参见:
opencv官网:http://docs.opencv.org/modules/stitching/doc/stitching.html
在opencv源代码中stitching.cpp 是简单版图像拼接实例,参见《opencv实现图像的拼接功能》。
stitching_detailed.cpp 复杂全面版图像拼接实例。
简单实例(stitching.cpp)
首先看下,opencv实现图像拼接的最简单实例,这是将stitching.cpp裁剪到最简单的代码
#include <iostream>
#include <fstream>
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/stitching/stitcher.hpp"
using namespace std;
using namespace cv;
bool try_use_gpu = true; //false;
vector<Mat> imgs;
string result_name = "result.jpg";
int parseCmdArgs(int argc, char** argv)
{
for (int i = 1; i < argc; ++i){
Mat img = imread(argv[i])