]> rtime.felk.cvut.cz Git - hercules2020/kcf.git/blobdiff - src/kcf.h
Make visual debug mode to work properly
[hercules2020/kcf.git] / src / kcf.h
index 76068c165401bf02d736d169eddc65475c0ad29b..cc735d768cd6733ad6e8fb2abf2095187f03f1ec 100644 (file)
--- a/src/kcf.h
+++ b/src/kcf.h
@@ -36,18 +36,6 @@ struct BBox_c
         h  *= factor;
     }
 
-    inline void scale_x(double factor)
-    {
-        cx *= factor;
-        w  *= factor;
-    }
-
-    inline void scale_y(double factor)
-    {
-        cy *= factor;
-        h  *= factor;
-    }
-
     inline cv::Rect get_rect()
     {
         return cv::Rect(int(cx-w/2.), int(cy-h/2.), int(w), int(h));
@@ -59,7 +47,8 @@ class KCF_Tracker
 {
     friend ThreadCtx;
 public:
-    bool m_debug     {false};
+    bool m_debug {false};
+    bool m_visual_debug {false};
     const bool m_use_scale {true};
     const bool m_use_color {true};
     const bool m_use_subpixel_localization {true};
@@ -104,11 +93,8 @@ private:
     double max_response = -1.;
 
     bool p_resize_image = false;
-    bool p_fit_to_pw2 = false;
 
     const double p_downscale_factor = 0.5;
-    double p_fit_factor_x = 1;
-    double p_fit_factor_y = 1;
     const double p_floating_error = 0.0001;
 
     const double p_padding = 1.5;
@@ -117,7 +103,8 @@ private:
     const double p_kernel_sigma = 0.5;    //def = 0.5
     const double p_lambda = 1e-4;         //regularization in learning step
     const double p_interp_factor = 0.02;  //def = 0.02, linear interpolation factor for adaptation
-    cv::Size p_windows_size;
+    cv::Size p_windows_size;              // size of the patch to find the tracked object in
+    cv::Size fit_size;                    // size to which rescale the patch for better FFT performance
 
     const uint p_num_scales = m_use_scale ? 7 : 1;
     const double p_scale_step = 1.02;
@@ -129,7 +116,7 @@ private:
     std::vector<double> p_angles = {0};
 
     const int p_num_of_feats = 31 + (m_use_color ? 3 : 0) + (m_use_cnfeat ? 10 : 0);
-    cv::Size p_roi;
+    cv::Size feature_size;
 
     Kcf_Tracker_Private &d;
 
@@ -164,7 +151,7 @@ private:
     cv::Mat get_subwindow(const cv::Mat &input, int cx, int cy, int size_x, int size_y) const;
     cv::Mat gaussian_shaped_labels(double sigma, int dim1, int dim2);
     std::unique_ptr<GaussianCorrelation> gaussian_correlation;
-    cv::Mat circshift(const cv::Mat &patch, int x_rot, int y_rot);
+    cv::Mat circshift(const cv::Mat &patch, int x_rot, int y_rot) const;
     cv::Mat cosine_window_function(int dim1, int dim2);
     cv::Mat get_features(cv::Mat &input_rgb, cv::Mat &input_gray, int cx, int cy, int size_x, int size_y, double scale) const;
     cv::Point2f sub_pixel_peak(cv::Point &max_loc, cv::Mat &response) const;