From: Michal Sojka Date: Sun, 30 Sep 2018 19:32:17 +0000 (+0200) Subject: Do not use local ComplexMat variables X-Git-Url: https://rtime.felk.cvut.cz/gitweb/hercules2020/kcf.git/commitdiff_plain/1c0345f519a389feac59d0dd9ad5dbfc6eeaa07d Do not use local ComplexMat variables After we convert ComplexMat to DynMem storage, we won't want to allocate memory in every step. --- diff --git a/src/kcf.cpp b/src/kcf.cpp index 5499c0b..2afa209 100644 --- a/src/kcf.cpp +++ b/src/kcf.cpp @@ -81,12 +81,10 @@ void KCF_Tracker::train(cv::Mat input_rgb, cv::Mat input_gray, double interp_fac p_model_xf = p_model_xf * (1. - interp_factor) + p_xf * interp_factor; DEBUG_PRINTM(p_model_xf); - ComplexMat alphaf_num, alphaf_den; - if (m_use_linearkernel) { ComplexMat xfconj = p_xf.conj(); - alphaf_num = xfconj.mul(p_yf); - alphaf_den = (p_xf * xfconj); + p_model_alphaf_num = xfconj.mul(p_yf); + p_model_alphaf_den = (p_xf * xfconj); } else { // Kernel Ridge Regression, calculate alphas (in Fourier domain) cv::Size sz(Fft::freq_size(feature_size));