forked from gnebehay/CppMT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Matcher.h
41 lines (32 loc) · 1.11 KB
/
Matcher.h
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
36
37
38
39
40
41
#ifndef MATCHER_H
#define MATCHER_H
#include "common.h"
#include "opencv2/features2d/features2d.hpp"
using cv::KeyPoint;
using cv::Ptr;
using cv::DescriptorMatcher;
namespace cmt {
class Matcher
{
public:
Matcher() : thr_dist(0.25), thr_ratio(0.8), thr_cutoff(20) {};
void initialize(const vector<Point2f> & pts_fg_norm, const Mat desc_fg, const vector<int> & classes_fg,
const Mat desc_bg, const Point2f center);
void matchGlobal(const vector<KeyPoint> & keypoints, const Mat descriptors,
vector<Point2f> & points_matched, vector<int> & classes_matched);
void matchLocal(const vector<KeyPoint> & keypoints, const Mat descriptors,
const Point2f center, const float scale, const float rotation,
vector<Point2f> & points_matched, vector<int> & classes_matched);
private:
vector<Point2f> pts_fg_norm;
Mat database;
vector<int> classes;
int desc_length;
int num_bg_points;
Ptr<DescriptorMatcher> bfmatcher;
float thr_dist;
float thr_ratio;
float thr_cutoff;
};
} /* namespace CMT */
#endif /* end of include guard: MATCHER_H */