]> rtime.felk.cvut.cz Git - hercules2020/kcf.git/commitdiff
Simplify creation of complexmat variables
authorMichal Sojka <michal.sojka@cvut.cz>
Sat, 29 Sep 2018 20:55:05 +0000 (22:55 +0200)
committerMichal Sojka <michal.sojka@cvut.cz>
Sun, 30 Sep 2018 19:22:45 +0000 (21:22 +0200)
src/kcf.cpp

index 2136387fc10dc84c58627a3e377fde0dfc67c802..5499c0be92d79567bc7595592e91e7f3858ac1d6 100644 (file)
@@ -202,14 +202,10 @@ void KCF_Tracker::init(cv::Mat &img, const cv::Rect &bbox, int fit_size_x, int f
     }
 #endif
 
-#if defined(CUFFT) || defined(FFTW)
-    uint width = feature_size.width / 2 + 1;
-#else
-    uint width = feature_size.width;
-#endif
-    p_model_xf.create(feature_size.height, width, p_num_of_feats);
-    p_yf.create(feature_size.height, width, 1);
-    p_xf.create(feature_size.height, width, p_num_of_feats);
+    cv::Size csz = Fft::freq_size(feature_size);
+    p_model_xf.create(csz.height, csz.width, p_num_of_feats);
+    p_yf.create(csz.height, csz.width, 1);
+    p_xf.create(csz.height, csz.width, p_num_of_feats);
 
 #ifndef BIG_BATCH
     for (auto scale: p_scales)