Open wolfatfb opened 6 years ago
just for clarification (and to reproduce it): this is the NON split_coeff
version, and you had to explicitly set TrackerParams::split_coeff=false
, right ?
Oops. I'm sorry, I pointed you to the wrong line in the code. I did mean the split_coef
version, but of another loop: the issue is inside calcResponse
. The correct line for that is 880.
[EDIT] Please note that the proposed fix can work, if implemented correctly: the divisor on line 458 (as well as 880) is a sum of two squares, i.e. cannot be negative. Adding a constant to the divisor will make it positive.
The
split_coeff
version ofcalcResponse
can return allNaN
s (caused by a division by zero).In that case the subsequent call to
minMaxLoc
inupdateImpl
returnsmaxVal = NaN
andmaxLoc = { -1, -1 }
, causing theroi
center to be erroneously moved byroi.size()/2
. This results in jarring tacking errors (object quickly jumps far to the left and up).Potential solution: in
calcResponse
, add a small regularization constant to the denominator prior to the division.https://github.com/opencv/opencv_contrib/blob/fbc4d82fd36009e02af4f6391312e3a9325051e0/modules/tracking/src/trackerKCF.cpp#L458