forked from firepick1/FireFuse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FireSight.hpp
47 lines (37 loc) · 1.06 KB
/
FireSight.hpp
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
42
43
44
45
46
47
#ifndef FIRESIGHT_HPP
#define FIRESIGHT_HPP
#include "opencv2/features2d/features2d.hpp"
using namespace cv;
namespace FireSight {
typedef struct MatchedRegion {
Range xRange;
Range yRange;
Point2f average;
int pointCount;
float ellipse; // area of ellipse that covers {xRange, yRange}
float covar;
MatchedRegion(Range xRange, Range yRange, Point2f average, int pointCount, float covar);
string asJson();
} MatchedRegion;
typedef class HoleRecognizer {
public:
HoleRecognizer(float minDiameter, float maxDiameter);
void scan(Mat &matRGB, vector<MatchedRegion> &matches, float maxEllipse = 1.05, float maxCovar = 2.0);
private:
MSER mser;
float minDiam;
float maxDiam;
int delta;
int minArea;
int maxArea;
double maxVariation;
double minDiversity;
int max_evolution;
double area_threshold;
double min_margin;
int edge_blur_size;
void scanRegion(vector<Point> &pts, int i,
Mat &matRGB, vector<MatchedRegion> &matches, float maxEllipse, float maxCovar);
} MSER_holes;
} // namespace FireSight
#endif