VAT  3.0
Video Analysis Tool
mhttrackingmodule.h
1 #ifndef MHTTRACKINGMODULE_H
2 #define MHTTRACKINGMODULE_H
3 
4 #include <map>
5 #include <string>
6 #include <QImage>
7 #include "Datapool.h"
8 #include <math.h>
9 #include "ModuleInterface.h"
10 #include "src/LAP/lap.h"
11 
12 
19 public:
20  mhtTrackingModule(Datapool *i_data);
22 
23  //Set module configuration parameters
24  bool setParameters(QDomNode& config);
25 
26  //Initialization after reading parameters
27  bool init();
28 
29  //Function executed at each frame
30  bool run();
31 
32  //update parameters at runtime.
33  bool updateParameters();
34 
35 private:
36 
40  class objState
41  {
42  public:
43  double cx, cy, dx, dy, vx, vy;
44  objState(){}
45  ~objState(){}
46  void set(double cx_, double cy_, double dx_, double dy_, double vx_, double vy_);
47  };
48 
52  class measure
53  {
54  public:
55  double cx, cy, dx, dy;
56  measure(double cx_, double cy_, double dx_, double dy_);
57  ~measure(){}
58  };
59 
65  class hypothesis
66  {
67  public:
68  std::vector<objState> stimation_t; // Stimation (t|t)
69  std::vector<objState> stimation_t_1; // Stimation (t|t-1)
70  std::vector<std::vector<double> > covariance_t; // Covariance (t|t)
71  std::vector<std::vector<double> > covariance_t_1; // Covariance (t|t-1)
72  std::vector<std::vector<double> > A; // Transition matrix
73  double vx;
74  double vy;
75  double dt;
76  int** costs;
77  int* solution;
78  int totalCost;
79 
80  hypothesis();
81  ~hypothesis(){}
82 
83  void stimate();
84 
85  };
86 
87  int CN;
88  int CD;
89  int k;
90  std::vector<measure> measures_t; // Measure in t
91  std::vector<measure> measures_t_1; // Measure in t-1
92 
93  std::vector<hypothesis > hyp;
94  std::vector<hypothesis > kHyp;
95 
96  void calculateCosts(hypothesis &hyp);
97  void getKhypothesis();
98  QPointF fixMeasure(objState o, measure m);
99  hypothesis takeBestHyp(std::vector<hypothesis > hyps, bool ok);
100  std::vector<QPoint> takeEdges(hypothesis h);
101 
102 };
103 
104 #endif // MHTTRACKINGMODULE_H
Definition: ModuleInterface.h:43
mhtTrackingModule(Datapool *i_data)
mhtTrackingModule::mhtTrackingModule Constructor, contains the default parameters.
Definition: mhttrackingmodule.cpp:79
Linear assignment problem solver.
An object of this class is instantiated at main code, and this object is used by every class to push ...
Definition: Datapool.h:39
The mhtTrackingModule class is based in Joo 2007, A Multiple-Hypothesis Approach for Multiobject Visu...
Definition: mhttrackingmodule.h:18