X-Git-Url: http://47.100.26.94:8080/?a=blobdiff_plain;f=include%2FTracker.h;h=88d041a3f94812753d450e1e9c69c547c0f0a942;hb=70532232dd98f31467eff7baaaff6e68f803bb45;hp=9eb3139c2b59132173f408424113dfbe43cdfe22;hpb=3aa517d206c44156fe86697aeadc5f75ea212329;p=trackerpp.git diff --git a/include/Tracker.h b/include/Tracker.h index 9eb3139..88d041a 100644 --- a/include/Tracker.h +++ b/include/Tracker.h @@ -7,6 +7,7 @@ #include "Metrics.h" #include "SharedPtr.h" #include "MultiTracker.h" +#include "Detector.h" namespace suanzi { @@ -23,22 +24,24 @@ namespace suanzi { class Tracker { public: - Tracker(const cv::Mat& image, int id = 0); + Tracker(const cv::Mat& image, const Detection& d, int id = 0); virtual ~Tracker(); void updateState(const cv::Mat& image); void addPatch(PatchPtr p); - TrackerStatus status; + void correct(const cv::Mat& image, const Detection& d); + void predict(); std::vector patches; + Detection detection; + TrackerStatus status = TrackerStatus::Fire; + static constexpr int MaxPatch = 5; private: - TrackerStatus preStatus; + TrackerStatus preStatus = TrackerStatus::Fire; int id; - int age; - int last_active; - cv::KalmanFilter kf = {4,2}; + int age = 1; + int last_active = 1; + cv::KalmanFilter KF = {4,2}; }; - - } #endif /* _TRACKER_H_ */