-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinput-example.h
More file actions
65 lines (48 loc) · 1.3 KB
/
input-example.h
File metadata and controls
65 lines (48 loc) · 1.3 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#ifndef B3F6FA37_57D3_45BF_A789_EB0E7FF55DCB
#define B3F6FA37_57D3_45BF_A789_EB0E7FF55DCB
#include <opencv2/opencv.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/videoio.hpp>
#include <opencv2/video.hpp>
#include <string>
namespace BP {
static const std::string RECT = "RECT";
static const std::string CROSS = "CROSS";
static const std::string ELLIPSE = "ELLIPSE";
static const std::string KNN = "KNN";
static const std::string MOG2 = "MOG2";
struct Parameters {
std::string bgSubtractor;
bool bgSubVerbose;
int blur;
bool blurVerbose;
std::string erosion;
bool erosionVerbose;
int erosionSize;
std::string dilation;
int dilationSize;
bool dilationVerbose;
int threshold;
bool thresholdVerbose;
};
using namespace cv;
class BasicProcessing{
public:
static BasicProcessing& getInstance();
virtual ~BasicProcessing();
void initialize(Parameters& m_params);
void process(Mat& frame);
const Mat& getResult();
private:
void blur(Mat& frame);
void dilation(Mat& frame);
void erosion(Mat& frame);
void binarize(Mat& frame);
BasicProcessing();
Parameters m_params;
Ptr<BackgroundSubtractor> m_bgSubtractor;
Mat m_result;
};
}
#endif /* B3F6FA37_57D3_45BF_A789_EB0E7FF55DCB */