#pragma once #include #include #include #include "vp_track_node.h" #include "sort/Hungarian.h" #include "sort/KalmanTracker.h" namespace vp_nodes { // track node using sort class vp_sort_track_node: public vp_track_node { private: /* config data for sort algo */ /* data */ typedef struct TrackingBox { //int frame; int id; Rect_ box; }TrackingBox; int max_age = 1; int min_hits = 3; double iouThreshold = 0.5; // vector trackers; std::map> all_trackers; std::vector> predictedBoxes; std::vector> iouMatrix; std::vector assignment; std::set unmatchedDetections; std::set unmatchedTrajectories; std::set allItems; std::set matchedItems; std::vector matchedPairs; std::vector frameTrackingResult; private: double GetIOU(cv::Rect_ bb_test, cv::Rect_ bb_gt); protected: // fill track_ids using sort algo virtual void track(int channel_index, const std::vector& target_rects, const std::vector>& target_embeddings, std::vector& track_ids) override; public: vp_sort_track_node(std::string node_name, vp_track_for track_for = vp_track_for::NORMAL); virtual ~vp_sort_track_node(); }; }