VAT  3.0
Video Analysis Tool
MOGSegmentationModule.h
1 #ifndef MOGSEGMENTATIONMODULE_H
2 #define MOGSEGMENTATIONMODULE_H
3 
4 #include <map>
5 #include <string>
6 #include <QImage>
7 #include "Datapool.h"
8 #include "ModuleInterface.h"
9 #include <QDir>
10 #include "src/json.h"
11 
12 #include <opencv2/opencv.hpp>
13 #include "src/ReliabilityMog2.h"
14 #include "ReliabilityBg.h"
15 
17 public:
20 
21  //Set module configuration parameters
22  bool setParameters(QDomNode& config);
23 
24  //Initialization after reading parameters
25  bool init();
26 
27  //Function executed at each frame
28  bool run();
29 
30  //update parameters at runtime.
31  bool updateParameters();
32 
33  bool readImageOnDisk(QString dir,QImage **o_rpOutputImage);
34 
35  void tuneParameters();
36 
37  void applyAperture(cv::Mat &);
38 
39  void applyMask(QImage *im);
40 
41  private:
42  cv::Ptr<cv::BackgroundSubtractorMOG2> mog;
43  ReliabilityMog2 mog2;
44 
45  int width;
46  int height;
47 
48  double alpha; //learning rate (set -1 to autoadjust it)
49  int m_history;
50  int m_nmixtures;
51  int m_noise;
52  double m_bgThreshold;
53  bool m_aperture;
54  bool m_tuningActivated;
55  int m_currentTuneValue;
56  int m_tuneStep;
57  int m_maxTuneValue;
58 
59  bool validate_once;
60  bool different_bg_current;
61 
62  QString bgImName;
63  bool first;
64  bool m_mask;
65  QString m_maskImName;
66  bool m_getContrastReliability;
67  cv::Mat element;
68  cv::Mat featureMap;
69 
70 };
71 
72 #endif // MOGSEGMENTATIONMODULE_H
Definition: ModuleInterface.h:43
Definition: ReliabilityMog2.h:37
An object of this class is instantiated at main code, and this object is used by every class to push ...
Definition: Datapool.h:39
Definition: MOGSegmentationModule.h:16