An old project from student days that is not being developed further. With this it is possible to track moving objects, even if they cross each other or disappear for a short time. It uses among others the Kalman filter and the munkres algorithm.
Originally needs python 2.7 but works with 3 also.
In python 2.7 you may change the line 144 in detection.py from contours, hierarchy = cv2.findContours(dist_8u, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
to img, contours, hierarchy = cv2.findContours(dist_8u, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
If you use python 2.7 you want to change the setup.sh or install the requierments manually.
In startTracking.py (around line 370) you can change, if you want to use the embedded simulation or a video. You could also grab a camera stream.
Uncomment the following for simulation / comment for video:
simulation.rederLoop()
img = simulation.im
Uncomment the following for video / comment for simulation:
#ret, img = cap.read()
in line 351 you can choose your video:
cap = cv2.VideoCapture("Tomaten2.mp4")