STrack.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #pragma once
  2. #include <nvdstracker.h>
  3. #include "KalmanFilter.h"
  4. using namespace std;
  5. enum TrackState {
  6. New = 0, Tracked, Lost, Removed
  7. };
  8. class STrack {
  9. public:
  10. STrack(vector<float> tlwh_, float score, int label, NvMOTObjToTrack *associatedObjectIn);
  11. ~STrack();
  12. vector<float> static tlbr_to_tlwh(vector<float> &tlbr);
  13. void static multi_predict(vector<STrack *> &stracks, byte_kalman::KalmanFilter &kalman_filter);
  14. void static_tlwh();
  15. void static_tlbr();
  16. vector<float> tlwh_to_xyah(vector<float> tlwh_tmp);
  17. vector<float> to_xyah();
  18. void mark_lost();
  19. void mark_removed();
  20. int next_id();
  21. int end_frame();
  22. void activate(byte_kalman::KalmanFilter &kalman_filter, int frame_id);
  23. void re_activate(STrack &new_track, int frame_id, bool new_id = false);
  24. void update(STrack &new_track, int frame_id);
  25. public:
  26. bool is_activated;
  27. int track_id;
  28. int state;
  29. vector<float> original_tlwh;
  30. vector<float> _tlwh;
  31. vector<float> tlwh;
  32. vector<float> tlbr;
  33. int frame_id;
  34. int tracklet_len;
  35. int start_frame;
  36. int label;
  37. KAL_MEAN mean;
  38. KAL_COVA covariance;
  39. float score;
  40. NvMOTObjToTrack *associatedObjectIn;
  41. private:
  42. byte_kalman::KalmanFilter kalman_filter;
  43. };