diff --git a/src/kcf.cpp b/src/kcf.cpp index 0e358a9c..58fc6f5c 100644 --- a/src/kcf.cpp +++ b/src/kcf.cpp @@ -57,8 +57,8 @@ void KCF_Tracker::init(cv::Mat &img, const cv::Rect & bbox) } //compute win size + fit to fhog cell size - p_windows_size[0] = round(p_pose.w * (1. + p_padding) / p_cell_size) * p_cell_size; - p_windows_size[1] = round(p_pose.h * (1. + p_padding) / p_cell_size) * p_cell_size; + p_windows_size[0] = ceil(p_pose.w * (1. + p_padding) / (float)(p_cell_size*2)) * p_cell_size * 2; + p_windows_size[1] = ceil(p_pose.h * (1. + p_padding) / (float)(p_cell_size*2)) * p_cell_size * 2; p_scales.clear(); if (m_use_scale) @@ -659,4 +659,4 @@ double KCF_Tracker::sub_grid_scale(std::vector & responses, int index) if (a > 0 || a < 0) scale = -b / (2 * a); return scale; -} \ No newline at end of file +}