VAT  3.0
Video Analysis Tool
BackgroundInitialization.h
1 #ifndef __BACKGROUND_INITIALIZATION_MODULE_H__
2 #define __BACKGROUND_INITIALIZATION_MODULE_H__
3 
4 #include <map>
5 #include <string>
6 #include <QImage>
7 #include "Datapool.h"
8 #include "ModuleInterface.h"
9 #include <QDir>
10 
11 //First Blocks class
12 #define UNDEFINED 0
13 #define STATIC 1
14 #define MOVING 255
15 
16 //Second Blocks class
17 #define BACKGROUND 0
18 #define STILL_OBJ 49
19 #define ILLUM_CHANGE 250
20 #define MOVING_OBJ 253
21 
22 //patter position after template matching
23 #define INF 0.0
24 #define MID 0.5
25 #define SUP 1.0
26 
27 
29 {
30  public:
33 
34  //Set module configuration parameters
35  bool setParameters(QDomNode& config);
36 
37  //Initialization after reading parameters
38  bool init();
39 
40  //Function executed at each frame
41  bool run();
42 
43  //update parameters at runtime.
44  bool updateParameters();
45 
46  private:
47  int sizeBlock;
48  int numBlockUndef;
49  int thresholdStill; //number of frame necesary to agregate still block to background
50  bool initializationStage;
51  bool firstTime;
52  double aggregationRate;
53  double thresholdMov;
54  double thresholdCorrelation;
55  cv::Mat currRepresentation, prevRepresentation, currentFrameC1, previousFrameC1, currentFrameC3, background;
56 
57  bool isMovingBlock(float SADcenter, float SADblock);
58  bool isStillObj(uchar value);
59  bool isMovingObj(uchar value);
60  double corrCoeff(uchar *ptr_img, uchar *ptr_bg);
61  double sideMatch(cv::Mat ROI, cv::Mat block, bool isBlockImg);
62  void blockMatching(int imgWidth, int imgHeight);
63  void blockClassification(int imgWidth, int imgHeight);
64  void blockUpdate(int imgWidth, int imgHeight);
65 };
66 #endif
Definition: ModuleInterface.h:43
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: BackgroundInitialization.h:28