]> rtime.felk.cvut.cz Git - hercules2020/kcf.git/commitdiff
Move patch capture for visual debug after scale step
authorMichal Sojka <michal.sojka@cvut.cz>
Fri, 26 Oct 2018 09:35:12 +0000 (11:35 +0200)
committerMichal Sojka <michal.sojka@cvut.cz>
Fri, 26 Oct 2018 09:35:12 +0000 (11:35 +0200)
This way, visual debug better shows what the tracker actually sees.

src/kcf.cpp

index 5b85fd97e689141fea306bf1f821546451a2b447..399ef4ef2d572b8cbac5a464fe7d1a95f775a83d 100644 (file)
@@ -521,9 +521,6 @@ cv::Mat KCF_Tracker::get_features(cv::Mat &input_rgb, cv::Mat &input_gray, cv::M
     cv::Mat patch_gray = get_subwindow(input_gray, cx, cy, scaled.width, scaled.height, angle);
     cv::Mat patch_rgb = get_subwindow(input_rgb, cx, cy, scaled.width, scaled.height, angle);
 
-    if (dbg_patch)
-        patch_rgb.copyTo(*dbg_patch);
-
     // resize to default size
     if (scaled.area() > fit_size.area()) {
         // if we downsample use  INTER_AREA interpolation
@@ -548,6 +545,9 @@ cv::Mat KCF_Tracker::get_features(cv::Mat &input_rgb, cv::Mat &input_gray, cv::M
         }
     }
 
+    if (dbg_patch)
+        patch_rgb.copyTo(*dbg_patch);
+
     if (m_use_color && input_rgb.channels() == 3) {
         // use rgb color space
         cv::Mat patch_rgb_norm;