From d3f8fe626d177f4274a1bcb1958750d706d0ddfc Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Tue, 16 Oct 2018 01:11:38 +0200 Subject: [PATCH] Initialize angles vector dynamically --- src/kcf.cpp | 4 ++++ src/kcf.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/kcf.cpp b/src/kcf.cpp index 2a77822..b6ead00 100644 --- a/src/kcf.cpp +++ b/src/kcf.cpp @@ -180,6 +180,10 @@ void KCF_Tracker::init(cv::Mat &img, const cv::Rect &bbox, int fit_size_x, int f for (int i = -int(p_num_scales) / 2; i <= int(p_num_scales) / 2; ++i) p_scales.push_back(std::pow(p_scale_step, i)); + p_angles.clear(); + for (int i = -int(p_num_angles) / 2; i <= int(p_num_angles) / 2; ++i) + p_angles.push_back(i * p_angle_step); + #ifdef CUFFT if (m_use_linearkernel) { std::cerr << "cuFFT supports only Gaussian kernel." << std::endl; diff --git a/src/kcf.h b/src/kcf.h index d052012..70662d7 100644 --- a/src/kcf.h +++ b/src/kcf.h @@ -110,7 +110,7 @@ private: const uint p_num_angles = 1; const int p_angle_step = 10; - std::vector p_angles = {0}; + std::vector p_angles; const int p_num_of_feats = 31 + (m_use_color ? 3 : 0) + (m_use_cnfeat ? 10 : 0); cv::Size feature_size; -- 2.39.2