#pragma once #include "STrack.h" #include "BYTETracker.h" #include "nvdstracker.h" #include #include "DataType.h" #include class NvObject { public: float rect[4]; int label; float prob; NvMOTObjToTrack *associatedObjectIn; }; class BYTETracker { public: BYTETracker(int frame_rate = 30, int track_buffer = 30); ~BYTETracker(); vector update(const vector &nvObjects); private: vector joint_stracks(vector &tlista, vector &tlistb); vector joint_stracks(vector &tlista, vector &tlistb); vector sub_stracks(vector &tlista, vector &tlistb); void remove_duplicate_stracks(vector &resa, vector &resb, vector &stracksa, vector &stracksb); void linear_assignment(vector > &cost_matrix, int cost_matrix_size, int cost_matrix_size_size, float thresh, vector > &matches, vector &unmatched_a, vector &unmatched_b); vector>iou_distance(vector &atracks, vector &btracks, int &dist_size, int &dist_size_size); vector> iou_distance(vector &atracks, vector &btracks); vector> ious(vector > &atlbrs, vector > &btlbrs); double lapjv(const vector > &cost, vector &rowsol, vector &colsol, bool extend_cost = false, float cost_limit = LONG_MAX, bool return_cost = true); private: float track_thresh; float high_thresh; float match_thresh; int frame_id; int max_time_lost; vector tracked_stracks; vector lost_stracks; vector removed_stracks; byte_kalman::KalmanFilter kalman_filter; };