I'm trying to build a python program to count the number of people crossing the road in 2 directions. The video file is something like this
Now for the detection phase I'm using BackgroundSubtractorMOG() to detect the peoples , now the problem is I want to identify each object separately and track their movements in each consecutive frames .
I'm thinking of using MeanShift for that purpose, now the problem is I'm not getting how to transfer to tracking phase for an object, or initialize the tracking window. In my case I'm ending up detecting the objects as separate in each frame.
I want to know how to detect that an if an object is already detected previously.