OpenShot Library | libopenshot  0.2.7
KalmanTracker.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 // KalmanTracker.h: KalmanTracker Class Declaration
3 
4 #ifndef KALMAN_H
5 #define KALMAN_H 2
6 
7 #include "opencv2/video/tracking.hpp"
8 #include "opencv2/highgui/highgui.hpp"
9 
10 
11 #define StateType cv::Rect_<float>
12 
13 /// This class represents the internel state of individual tracked objects observed as bounding box.
15 {
16 public:
18  {
19  init_kf(StateType());
21  m_hits = 0;
22  m_hit_streak = 0;
23  m_age = 0;
24  m_id = 0;
25  }
26  KalmanTracker(StateType initRect, float confidence, int classId, int objectId) : confidence(confidence), classId(classId)
27  {
28  init_kf(initRect);
30  m_hits = 0;
31  m_hit_streak = 0;
32  m_age = 0;
33  m_id = objectId;
34  }
35 
37  {
38  m_history.clear();
39  }
40 
43  void update(StateType stateMat);
44 
46  StateType get_rect_xysr(float cx, float cy, float s, float r);
47 
49  int m_hits;
51  int m_age;
52  int m_id;
53  float confidence;
54  int classId;
55 
56 private:
57  void init_kf(StateType stateMat);
58 
59  cv::KalmanFilter kf;
60  cv::Mat measurement;
61 
62  std::vector<StateType> m_history;
63 };
64 
65 #endif
StateType get_rect_xysr(float cx, float cy, float s, float r)
StateType predict2()
void update(StateType stateMat)
StateType predict()
#define StateType
Definition: KalmanTracker.h:11
StateType get_state()
KalmanTracker(StateType initRect, float confidence, int classId, int objectId)
Definition: KalmanTracker.h:26
int m_time_since_update
Definition: KalmanTracker.h:48
This class represents the internel state of individual tracked objects observed as bounding box...
Definition: KalmanTracker.h:14