Re-initializing (correcting) the trackers when using MultiTracker
I'm writing an application in Python and used this article as an example of how to use the various OpenCV trackers and the MultiTracker in particular. I have an object detector running in the background, which detects the desired objects in every frame, and then does a sort of "Hungarian algorithm" on the bounding boxes.
I wanted to speed up the tracking a bit using KCF or maybe Mosse, and wanted to use the MultiTracker wrapper.
What strikes me as odd, is that though the MuiltiTracker does return a boolean for the tracking result, it only returns one of those. And there is no way of knowing, which of the trackers in the list failed.
This is pretty easy to solve if don't use the MultiTracker, but just a list of individual trackers. Though it looks like a list of trackers unfortunately works slower than one MultiTracker.
There also seems to be no way of "correcting" the trackers apart from completely re-initializing them, which is an even bigger problem if you're using the MultiTracker. It would be nice to be able to occasionally correct the trackers. And knowing WHICH of the trackers failed would also be useful.
can't be. proof ? (after all, it is just a list of trackers, look at src)
@berak: tested with
%timeit
in a Jupyter Notebook. Going with a for loop through a list of trackers and running.update()
on each seems to run about twice as long as running.update()
once on a MultiTracker. Though I do only have two trackers in my example.@berak: yeah, I saw the sources and that it also uses a list... but that's what I found strange. Here's a screenshot.