| #pragma once
|
|
|
| #include "STrack.h"
|
| #include "GlobalMotionCompensation.h"
|
|
|
| struct Object {
|
| cv::Rect_<float> rect;
|
| int label;
|
| float prob;
|
| };
|
|
|
| class BYTETracker {
|
| public:
|
| BYTETracker(int frate = 30, int tbuffer = 30, float tthresh = 0.5, float mthresh = 0.8, bool use_gmc = false);
|
|
|
| ~BYTETracker();
|
|
|
| vector <vector<float>> update(const vector <vector<float>> &objects, string img_path);
|
|
|
| Scalar get_color(int idx);
|
|
|
| private:
|
| vector<STrack *> joint_stracks(vector<STrack *> &tlista, vector <STrack> &tlistb);
|
|
|
| vector <STrack> joint_stracks(vector <STrack> &tlista, vector <STrack> &tlistb);
|
|
|
| vector <STrack> sub_stracks(vector <STrack> &tlista, vector <STrack> &tlistb);
|
|
|
| void remove_duplicate_stracks(vector <STrack> &resa, vector <STrack> &resb, vector <STrack> &stracksa,
|
| vector <STrack> &stracksb);
|
|
|
| void linear_assignment(vector <vector<float>> &cost_matrix, int cost_matrix_size, int cost_matrix_size_size,
|
| float thresh,
|
| vector <vector<int>> &matches, vector<int> &unmatched_a, vector<int> &unmatched_b);
|
|
|
| vector <vector<float>>
|
| iou_distance(vector<STrack *> &atracks, vector <STrack> &btracks, int &dist_size, int &dist_size_size, bool giou= false);
|
|
|
| vector <vector<float>> iou_distance(vector <STrack> &atracks, vector <STrack> &btracks);
|
|
|
| vector <vector<float>> ious(vector <vector<float>> &atlbrs, vector <vector<float>> &btlbrs);
|
|
|
| vector <vector<float>> gious(vector <vector<float>> &atlbrs, vector <vector<float>> &btlbrs);
|
|
|
| double lapjv(const vector <vector<float>> &cost, vector<int> &rowsol, vector<int> &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;
|
| GlobalMotionCompensation _gmc_algo;
|
| bool _gmc_enabled = false;
|
|
|
| vector <STrack> tracked_stracks;
|
| vector <STrack> lost_stracks;
|
| vector <STrack> removed_stracks;
|
| byte_kalman::KalmanFilter kalman_filter;
|
| }; |