unify the interface with detector
[trackerpp.git] / src / Tracker.h
index 57fe765..490201a 100644 (file)
@@ -1,14 +1,52 @@
 #ifndef _TRACKER_H_
 #define _TRACKER_H_
 
+#include <opencv2/opencv.hpp>
+#include <string>
+#include <vector>
+#include "Metrics.h"
+#include "SharedPtr.h"
+
 namespace suanzi {
 
-class Tracker
-{
-public:
-    Tracker();
-    virtual ~Tracker();
-};
+    typedef enum 
+    {
+        Fire = -1,
+        Active = 2,
+        Lost,
+        Delete
+    } TrackerStatus;
+
+    TK_DECLARE_PTR(Tracker);
+//    TK_DECLARE_PTR(KalmanFilter);
+    class Tracker
+    {
+    public:
+        Tracker(int id);
+        virtual ~Tracker();
+        void updateState(const cv::Mat& image);
+        void addPatch(Patch* p);
+        TrackerStatus status;
+
+    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
+//
+//    };
+
 
 }