Meta Byte Track
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

STrack.h 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #pragma once
  2. #include <opencv2/opencv.hpp>
  3. #include "kalmanFilter.h"
  4. using namespace cv;
  5. using namespace std;
  6. enum TrackState { New = 0, Tracked, Lost, Removed };
  7. class STrack
  8. {
  9. public:
  10. STrack(vector<float> tlwh_, float score);
  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> _tlwh;
  30. vector<float> tlwh;
  31. vector<float> tlbr;
  32. int frame_id;
  33. int tracklet_len;
  34. int start_frame;
  35. KAL_MEAN mean;
  36. KAL_COVA covariance;
  37. float score;
  38. private:
  39. byte_kalman::KalmanFilter kalman_filter;
  40. };