-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathlightglue.h
More file actions
35 lines (32 loc) · 1.21 KB
/
Copy pathlightglue.h
File metadata and controls
35 lines (32 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#pragma once
#include <vector>
#include <string>
#include <memory>
#include<iostream>
#include "opencv2/stitching.hpp"
#include "opencv2/calib3d.hpp"
#include "common.h"
using namespace cv::detail;
using namespace cv;
using namespace std;
class FEATURE_MATCHER_EXPORTS LightGlue :public FeaturesMatcher
{
protected:
Stitcher::Mode m_mode;//Affine or Perspective。仿射变换还是透视变换
std::wstring m_modelPath;
std::vector<detail::ImageFeatures> features_;
std::vector<detail::MatchesInfo> pairwise_matches_;
float m_matchThresh = 0.0;//匹配阈值
CV_WRAP_AS(apply) void operator ()(const ImageFeatures& features1, const ImageFeatures& features2,
CV_OUT MatchesInfo& matches_info) {
match(features1, features2, matches_info);
}
void AddFeature(detail::ImageFeatures features);
void AddMatcheinfo(const MatchesInfo& matches_info);
public:
LightGlue(std::wstring modelPath, Stitcher::Mode mode, float matchThresh);
void match(const ImageFeatures& features1, const ImageFeatures& features2,
MatchesInfo& matches_info);
std::vector<detail::ImageFeatures> features() { return features_; };
std::vector<detail::MatchesInfo> matchinfo() { return pairwise_matches_; };
};