]> rtime.felk.cvut.cz Git - hercules2020/kcf.git/commitdiff
grayscale features removed; they in all tests reduces performance
authorTomas Vojir <vojirtom@cmp.felk.cvut.cz>
Mon, 5 Sep 2016 16:42:39 +0000 (18:42 +0200)
committerTomas Vojir <vojirtom@cmp.felk.cvut.cz>
Mon, 5 Sep 2016 16:42:39 +0000 (18:42 +0200)
src/kcf.cpp
src/kcf.h

index 06f74d29c8f878a94ae56501e313a6081738100e..f08d333355aa8e98e8f43bafe898dce943d2bd1d 100644 (file)
@@ -266,26 +266,15 @@ std::vector<cv::Mat> KCF_Tracker::get_features(cv::Mat & input_rgb, cv::Mat & in
     cv::Mat patch_rgb = get_subwindow(input_rgb, cx, cy, size_x_scaled, size_y_scaled);
 
     //resize to default size
-    cv::Mat patch_gray_scaled;
     if (scale > 1.){
         //if we downsample use  INTER_AREA interpolation
-        cv::resize(patch_gray, patch_gray_scaled, cv::Size(size_x, size_y), 0., 0., cv::INTER_AREA);
+        cv::resize(patch_gray, patch_gray, cv::Size(size_x, size_y), 0., 0., cv::INTER_AREA);
     }else {
-        cv::resize(patch_gray, patch_gray_scaled, cv::Size(size_x, size_y), 0., 0., cv::INTER_LINEAR);
+        cv::resize(patch_gray, patch_gray, cv::Size(size_x, size_y), 0., 0., cv::INTER_LINEAR);
     }
 
     // get hog features
-    std::vector<cv::Mat> hog_feat = FHoG::extract(patch_gray_scaled, 2, p_cell_size, 9);
-
-    if (m_use_grayscale){
-        if (scale > 1.){
-            //if we downsample use  INTER_AREA interpolation
-            cv::resize(patch_gray, patch_gray_scaled, cv::Size(size_x/p_cell_size, size_y/p_cell_size), 0., 0., cv::INTER_AREA);
-        }else {
-            cv::resize(patch_gray, patch_gray_scaled, cv::Size(size_x/p_cell_size, size_y/p_cell_size), 0., 0., cv::INTER_LINEAR);
-        }
-        hog_feat.push_back(patch_gray_scaled);
-    }
+    std::vector<cv::Mat> hog_feat = FHoG::extract(patch_gray, 2, p_cell_size, 9);
 
     //get color rgb features (simple r,g,b channels)
     std::vector<cv::Mat> color_feat;
index 6466dad1df9eb41dcabf706a7a18a3c19ff7a152..efdd265449efdff9afd36f3e0e5a4cf82f981091 100644 (file)
--- a/src/kcf.h
+++ b/src/kcf.h
@@ -31,7 +31,6 @@ class KCF_Tracker
 public:
     bool m_use_scale {true};
     bool m_use_color {true};
-    bool m_use_grayscale {false};
     bool m_use_subpixel_localization {true};
     bool m_use_subgrid_scale {true};
     bool m_use_multithreading {true};