I'm trying to track multiple objects in a video using openCV (4.5.5.64) in python. I have the bounding boxes for every frame already.
Mainly, I need to keep track of which box belongs to which ID for each frame.
The cv2.MultiTracker_create()
function is no longer in use and I'm having trouble reinstalling an older version of openCV that supports it. The function also takes in the bounding box only when you add a new tracker (once per object), and I'd like to utilize my bounding boxes for every frame if possible.
What recommendation do you have for the best way to go about this?
Current ideas:
- I can try to use the legacy version of multitracker, but there's still the issue where I want to use my bounding boxes.
- I can also try something with the centroid of each bounding box (ex: https://pyimagesearch.com/2018/07/23/simple-object-tracking-with-opencv/), but it requires more work on my end since I have to implement that (if there is a library that does this automatically, please let me know)
Sidenote: there are upwards of 50 objects for ~1200 frames, but the program doesn't necessarily need to be extremely fast (probably no more than 15 minutes to run).