From 7fa9986e30d913d2b3532185eddd7758214be151 Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Fri, 28 Sep 2018 21:30:58 +0200 Subject: [PATCH] Add assertion about found maximum response --- src/kcf.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/kcf.cpp b/src/kcf.cpp index 069e66d..2136387 100644 --- a/src/kcf.cpp +++ b/src/kcf.cpp @@ -4,6 +4,7 @@ #include #include "threadctx.hpp" #include "debug.h" +#include #ifdef FFTW #include "fft_fftw.h" @@ -297,6 +298,8 @@ void KCF_Tracker::resizeImgs(cv::Mat &input_rgb, cv::Mat &input_gray) double KCF_Tracker::findMaxReponse(uint &max_idx, cv::Point2d &new_location) const { double max = -1.; + max_idx = std::numeric_limits::max(); + #ifndef BIG_BATCH for (uint j = 0; j < d.threadctxs.size(); ++j) { if (d.threadctxs[j].max.response > max) { @@ -312,6 +315,7 @@ double KCF_Tracker::findMaxReponse(uint &max_idx, cv::Point2d &new_location) con } } #endif + assert(max_idx < IF_BIG_BATCH(p_scales.size(), d.threadctxs.size())); if (m_visual_debug) { int w = 100; //feature_size.width; -- 2.39.2