VAT  3.0
Video Analysis Tool
gaussianMixtureSegmentation.h
1 #ifndef GAUSSIANMIXTURESEGMENTATION_H
2 #define GAUSSIANMIXTURESEGMENTATION_H
3 
4 #include <QImage>
5 #include "Datapool.h"
6 #include "ModuleInterface.h"
7 #include <QDir>
8 #include "SegmentationTool.h"
9 #include <opencv2/video/background_segm.hpp>
10 #include "opencv2/opencv.hpp"
11 
13 {
14 public:
17 
18  //Set module configuration parameters
19  bool setParameters(QDomNode& config);
20 
21  //Initialization after reading parameters
22  bool init();
23 
24  //Function executed at each frame
25  bool run();
26 
27  //update parameters at runtime.
28  bool updateParameters();
29 
30  //Apply Mask
31  void applyMask(QImage *current);
32 
33 private:
34 
35  int currentframe; //Current Frame
36  bool MOG2;//Set MOG2 Method
37  bool defaultMOG2; //Set MOG2 default parameters
38  bool m_mask;//Set mask Image
39  QString m_maskImName;//Mask Image Name
41 
42  //Constructor Parameters
43  int historyMOG; //Length of the history
44  int nmixtures; //Number of Gaussians Mixtures (MOG and MOG2)
45  double backgroundRatio; //Threshold of data that should be accounted for by the background (ParĂ¡metro T)
46  double noiseSigma; //Noise Strength
47  float varThreshold; //MOG2 Threshold on the squared Mahalanobis distance to decide whether it is well described by the background model
48  bool bShadowDetection; // MOG2 Parameter defining whether shadow detection should be enabled (true or false).
49  float varThresholdGen; //MOG2
50  float fVarInit; //MOG2
51  float fVarMin; //MOG2
52  float fVarMax; //MOG2
53  float fCT; //MOG2
54  float nShadowDetection;
55  float fTau;
56 
57  double learningRate; //Learning Rate
58 
59  cv::Mat frame; //current frame
60  cv::Mat resizeF;
61  cv::Mat fgMaskMOG;//fg mask generated by MOG method
62  cv::Mat bgMOG; //Background Image
63 
64  cv::Ptr<cv::BackgroundSubtractorMOG2> mog;
65 
66 };
67 
68 #endif // GAUSSIANMIXTURESEGMENTATION_H
Definition: ModuleInterface.h:43
The SegmentationTool class is used to generate Chromatic Segmentation.
Definition: SegmentationTool.h:21
Definition: gaussianMixtureSegmentation.h:12
An object of this class is instantiated at main code, and this object is used by every class to push ...
Definition: Datapool.h:39