前面 《串联匹配+opencv的stitching》虽然速度非常快,但容易漏图。应该是没有连成环。
这里加一个远距匹配:这个距离选19 至28之间,小了速度慢,大了容易漏过匹配。
//串联匹配+远距匹配
/*
1。选择图像来源(文件名)
1。默认文件名(list.txt)
或2。命令行选择列表名(以图标拖放的方式选择文件)
2。载入图像,检测特征,
3。串联匹配
4。远距匹配
*/
#include <opencv2/opencv.hpp>
#include <algorithm>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include<string.h>
#include<fstream>
#include<time.h>
#pragma warning (disable:4244) //数据类型转换,可能会丢失数据 警告
using namespace std;
using namespace cv;
Point2f getOffsetStitch(int &p,const int id1,const int id2);
int setListGetNu