From 600e2cf0af3ef3ea92251ff5a4b0fe471fcba46f Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Sat, 29 Sep 2018 22:55:05 +0200 Subject: [PATCH] Simplify creation of complexmat variables --- src/kcf.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/kcf.cpp b/src/kcf.cpp index 2136387..5499c0b 100644 --- a/src/kcf.cpp +++ b/src/kcf.cpp @@ -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) -- 2.39.2