Fix nan issue in features
[trackerpp.git] / include / MultiTracker.h
index 58ef922..2a9d0bc 100644 (file)
@@ -7,17 +7,19 @@
 #include "PredictorWrapper.h"
 #include <opencv2/opencv.hpp>
 #include <utility>
+#include "Engine.h"
 
 namespace suanzi {
 
     TK_DECLARE_PTR(Patch);
     TK_DECLARE_PTR(MultiTracker);
     TK_DECLARE_PTR(Tracker);
+    TK_DECLARE_PTR(Engine);
 
     class MultiTracker 
     {
     public:
-        MultiTracker();
+        MultiTracker(EngineWPtr e);
         virtual ~MultiTracker();
         void update(unsigned int total, const Detection* d, const cv::Mat& image);
 
@@ -26,8 +28,10 @@ namespace suanzi {
         int max_id = 0;
         PatchPtr createPatch(const cv::Mat& image, const Detection& d);
         double distance(TrackerPtr t, const cv::Mat& image, const Detection& d);
+        void addTracker(TrackerPtr t);
         PredictorWrapperPtr predictor;
         cv::HOGDescriptor descriptor;
+        EngineWPtr engine;
     };
 
     class Patch
@@ -35,7 +39,6 @@ namespace suanzi {
     public:
         ~Patch(){};
         cv::Mat image_crop;
-        //std::vector<double> features;
         // hog is a hog descriptor of the image (calculated by hog.compute. size is 3780 )
         // hue is a histogram of the image, (calcHist(), is a Mat with (width x height) 64 x 45)
         std::pair<std::vector<double>, cv::Mat> features;