CTU-IIG / kcf

Kernelized Correlation Filter tracker
13 stars 6 forks source link

FHOG is unstable on the TX2 (different results for same image) #51

Open FlavioK opened 5 years ago

FlavioK commented 5 years ago

Sometimes if FHoG::extract is called on the TX2, different features are returned for the same image patch. This might be related to the already closed issue: #28

It seems that the errors come from the wrong calculation of the X-gradients Gx in this part of the code: https://github.com/CTU-IIG/kcf/blob/bf9febfb912a43640accbc1349464208c0da6c74/src/piotr_fhog/gradientMex.cpp#L69-L89

Which leads to the problem that we have out-of-bound accesses in the acost table: https://github.com/CTU-IIG/kcf/blob/bf9febfb912a43640accbc1349464208c0da6c74/src/piotr_fhog/gradientMex.cpp#L92

The call to grad1 seems to be ok: https://github.com/CTU-IIG/kcf/blob/bf9febfb912a43640accbc1349464208c0da6c74/src/piotr_fhog/gradientMex.cpp#L19-L26

Maybe we could run it once without neon instructions to see if the problem is related to the sse2neon layer. It seems to be since the problem did not yet appear on my host computer.

wentasah commented 5 years ago

Yes. As we've already discussed off-line, an approach to solve this could to to use OpenCV HoG implementation rather than piotr_fhog.

FlavioK commented 5 years ago

I have seen this was already implemented once in commit f995b646198eeaf2838228ef4500cfa50146004e. https://github.com/CTU-IIG/kcf/blob/f995b646198eeaf2838228ef4500cfa50146004e/src/kcf.cpp#L519-L529 I cherrypicked this one shortly on my branch, but it was kind of buggy. I will try to investigate this a bit deeper in the future when there is time.