-
Notifications
You must be signed in to change notification settings - Fork 183
/
Consensus.h
33 lines (24 loc) · 877 Bytes
/
Consensus.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
#ifndef CONSENSUS_H
#define CONSENSUS_H
#include "common.h"
namespace cmt {
class Consensus
{
public:
Consensus() : estimate_scale(true), estimate_rotation(false), thr_cutoff(20) {};
void initialize(const vector<Point2f> & points_normalized);
void estimateScaleRotation(const vector<Point2f> & points, const vector<int> & classes,
float & scale, float & rotation);
void findConsensus(const vector<Point2f> & points, const vector<int> & classes,
const float scale, const float rotation,
Point2f & center, vector<Point2f> & points_inlier, vector<int> & classes_inlier);
bool estimate_scale;
bool estimate_rotation;
private:
float thr_cutoff;
vector<Point2f> points_normalized;
Mat distances_pairwise;
Mat angles_pairwise;
};
} /* namespace cmt */
#endif /* end of include guard: CONSENSUS_H */