Add callback from multitracker to engine
[trackerpp.git] / include / Tracker.h
index 490201a..d528670 100644 (file)
@@ -6,9 +6,13 @@
 #include <vector>
 #include "Metrics.h"
 #include "SharedPtr.h"
+#include "MultiTracker.h"
+#include "Detector.h"
 
 namespace suanzi {
 
+    TK_DECLARE_PTR(Tracker);
+    TK_DECLARE_PTR(Patch);
     typedef enum 
     {
         Fire = -1,
@@ -17,36 +21,26 @@ namespace suanzi {
         Delete
     } TrackerStatus;
 
-    TK_DECLARE_PTR(Tracker);
-//    TK_DECLARE_PTR(KalmanFilter);
     class Tracker
     {
     public:
-        Tracker(int id);
+        Tracker(const cv::Mat& image, const Detection& d, int id = 0);
         virtual ~Tracker();
         void updateState(const cv::Mat& image);
-        void addPatch(Patch* p);
+        void addPatch(PatchPtr p);
+        void correct(const cv::Mat& image, const Detection& d);
         TrackerStatus status;
+        std::vector<PatchPtr> patches;
+        Detection detection;
 
     private:
         TrackerStatus preStatus;
         int id;
         int age;
         int last_active;
-        std::vector<Patch *> patches;
         cv::KalmanFilter kf = {4,2};
     };
 
-//    class KalmanFilter
-//    {
-//    public:
-//        KalmanFilter();
-//        ~KalmanFilter();
-//    private:
-//        cv::KalmanFilter
-//
-//    };
-
 
 }