How to get tracking confidence from KCF Tracker in opencv-contrib-python?

596 views Asked by At

When tracking an object using the KCF Tracker from opencv, is there a way to get the actual confidence value of the tracker outputted?

I have searched around and this page was the closest I could find: https://github.com/opencv/opencv_contrib/pull/1123. I believe maxVal on line 344 in trackerKCF.cpp is the variable I am looking to have outputted but cannot find any functions to actually obtain it.

I am using opencv-contrib-python version: 4.5.5.64.

Thanks!

1

There are 1 answers

0
Bryan Greenway On

For some reason, that value is not shared. As you pointed out, you can see in the OpenCV source that the value is calculated in a local max_val variable and not persisted or shared in any way. Of course, you could edit the code to save max_val in some public class variable, and then re-compile, if you want to go to that much trouble.