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{
16public:
18 {
19 init_kf(StateType());
21 m_hits = 0;
22 m_hit_streak = 0;
23 m_age = 0;
24 m_id = 0;
25 }
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;
55
56private:
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
#define StateType
Definition: KalmanTracker.h:11
This class represents the internel state of individual tracked objects observed as bounding box.
Definition: KalmanTracker.h:15
StateType predict()
KalmanTracker(StateType initRect, float confidence, int classId, int objectId)
Definition: KalmanTracker.h:26
StateType get_state()
void update(StateType stateMat)
int m_time_since_update
Definition: KalmanTracker.h:48
StateType predict2()
StateType get_rect_xysr(float cx, float cy, float s, float r)