]> rtime.felk.cvut.cz Git - hercules2020/kcf.git/commitdiff
Fix scale initialization
authorMichal Sojka <michal.sojka@cvut.cz>
Wed, 12 Sep 2018 18:56:09 +0000 (20:56 +0200)
committerMichal Sojka <michal.sojka@cvut.cz>
Wed, 12 Sep 2018 18:56:09 +0000 (20:56 +0200)
Without this, estimation of tracked object scale doesn't work
correctly.

This should have been done in commit 495214a ("Move scale and
async_res variables to ThreadCtx", 2018-09-12).

src/kcf.cpp
src/threadctx.hpp

index d06322d6af5ec8f061ff6acf091f4cecce428d11..0caf99ccc3c66d8842e9e47209ad63430f547d28 100644 (file)
@@ -178,9 +178,9 @@ void KCF_Tracker::init(cv::Mat &img, const cv::Rect &bbox, int fit_size_x, int f
     int max = m_use_big_batch ? 2 : p_num_scales;
     for (int i = 0; i < max; ++i) {
         if (m_use_big_batch && i == 1)
-            p_threadctxs.emplace_back(p_windows_size, p_cell_size, p_num_of_feats * p_num_scales, p_num_scales);
+            p_threadctxs.emplace_back(p_windows_size, p_cell_size, p_num_of_feats * p_num_scales, 1, p_num_scales);
         else
-            p_threadctxs.emplace_back(p_windows_size, p_cell_size, p_num_of_feats, 1);
+            p_threadctxs.emplace_back(p_windows_size, p_cell_size, p_num_of_feats, p_scales[i], 1);
     }
 
     p_current_scale = 1.;
index c4bb5356484925b34a5871ba6e134bd69812ff86..9ad333429c497da944210f292825021ea1dfe270 100644 (file)
@@ -16,7 +16,7 @@ typedef int *cudaStream_t;
 
 struct ThreadCtx {
   public:
-    ThreadCtx(cv::Size windows_size, uint cell_size, uint num_of_feats, double scale, uint num_of_scales = 1)
+    ThreadCtx(cv::Size windows_size, uint cell_size, uint num_of_feats, double scale, uint num_of_scales)
         : scale(scale)
     {
         this->xf_sqr_norm = DynMem(num_of_scales * sizeof(float));