#pragma once #include #include "KalmanFilter.h" using namespace std; enum TrackState { New = 0, Tracked, Lost, Removed }; class STrack { public: STrack(vector tlwh_, float score, int label, NvMOTObjToTrack *associatedObjectIn); ~STrack(); vector static tlbr_to_tlwh(vector &tlbr); void static multi_predict(vector &stracks, byte_kalman::KalmanFilter &kalman_filter); void static_tlwh(); void static_tlbr(); vector tlwh_to_xyah(vector tlwh_tmp); vector to_xyah(); void mark_lost(); void mark_removed(); int next_id(); int end_frame(); void activate(byte_kalman::KalmanFilter &kalman_filter, int frame_id); void re_activate(STrack &new_track, int frame_id, bool new_id = false); void update(STrack &new_track, int frame_id); public: bool is_activated; int track_id; int state; vector original_tlwh; vector _tlwh; vector tlwh; vector tlbr; int frame_id; int tracklet_len; int start_frame; int label; KAL_MEAN mean; KAL_COVA covariance; float score; NvMOTObjToTrack *associatedObjectIn; private: byte_kalman::KalmanFilter kalman_filter; };