#ifndef DETECT_TURNSTILE_H #define DETECT_TURNSTILE_H #include "Hungarian.h" #include "KalmanTracker.h" namespace od{ const int COLOR_MAP[2][3]={{0, 0, 255},{255, 0, 0}}; const int max_age = 3; const int min_hits = 3; const double iouThreshold = 0.5; struct bbox_t { unsigned int x, y, w, h; // (x,y) - top-left corner, (w, h) - width & height of bounded box float prob; // confidence - probability that the object was found correctly unsigned int obj_id; // class of object - from range [0, classes-1] unsigned int track_id; // tracking id for video (0 - untracked, 1 - inf - tracked object) unsigned int frames_counter; // counter of frames on which the object was detected float x_3d, y_3d, z_3d; // center of object (in Meters) if ZED 3D Camera is used }; typedef struct TrackingBox { int frame; int id; int class_id; float prob; Rect_ box; vector class_history; }TrackingBox; //yolo data o DetectBox typedef struct DetectBox { int class_id; float prob; Rect_ box; }DetectBox; //Computes IOU between two bounding boxes double GetIOU(Rect_ bb_test, Rect_ bb_gt); //画出检测框和相关信息 void DrawBoxes(Mat &frame, vector classes, int classId, int turnstileId,float conf, int left, int top, int right, int bottom); //画出检测结果,image void Drawer(Mat &frame, vector outs, vector classes); //画出检测结果,video void Drawer(Mat &frame, vector &track_result, vector &classes); //tracking obstacle bool TrackObstacle(int frame_count,vector &trackers,vector &outs,vector &track_result); } #endif // DETECT_TURNSTILE_H