Yolo-Detection/yolo+SORT/yoloSORT/sort.h

55 lines
865 B
C
Raw Permalink Normal View History

2024-10-11 20:43:44 +08:00
#pragma once
#include <iostream>
#include <opencv2/opencv.hpp>
#include "utils.h"
#include "kalmanboxtracker.h"
/**
* @brief Sort Sort<EFBFBD>
*/
class Sort
{
public:
/**
* @brief Sort <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @param max_age δ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @param min_hits δ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @param iou_threshold iou<EFBFBD><EFBFBD>ֵ
*/
Sort(int max_age, int min_hits, float iou_threshold);
/**
* @brief update <EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @param dets <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*/
std::vector<std::vector<float>> update(std::vector<cv::Rect> dets);
private:
/**
* @param m_max_age δ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*/
int m_max_age;
/**
* @param m_min_hits δ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*/
int m_min_hits;
/**
* @param m_iou_threshold iou<EFBFBD><EFBFBD>ֵ
*/
float m_iou_threshold;
/**
* @param m_trackers <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>
*/
std::vector<KalmanBoxTracker> m_trackers;
/**
* @param m_frame_count ֡<EFBFBD><EFBFBD>
*/
int m_frame_count;
};