How to give moving contours an unique id? Ideas needed :-) [closed]
Hello, I have a video of moving persons and I get the contours of them by background substraction.
At the moment with every new frame a contour gets, depending on the new position, another position in the contours vector.
How can I achieve that eyery contour can be identified with an unique id while mowing?
My idea is to use moments to calculate the size and center of every contour and then to identify the contours in the new frame fitting best togehter with size and center position.
Is there any better approach? Thank you very much :-)
What you are looking for is the principle of tracking in between frames. At first frame you initiate a tracker with the first detection. The tracker then predicts where that object will be in the next frame. You can then correct the tracker with the actual found blobs that are closest to the predicted position. Take a look at Kalman filter or Optical Flow.
true, KF will help. still you need 1 KF per object, and you still need to find out, which object belongs to which KF ;)
http://en.wikipedia.org/wiki/Hungaria...
the trackig algorithm for cvBlob(https://code.google.com/p/cvblob/) was originally based on the paper "Appearance Models for Occlusion Handling". (http://citeseerx.ist.psu.edu/viewdoc/...)
(https://code.google.com/p/cvblob/wiki...)
But this process can be improved:
I think that one idea is to take some measurements about the direction of the optical flow. This direction can be taken into account in order to update the positions of the blobs.
Thank you very much for all these suggestions :-) I have a look at it. Yet I think I will try the approach using Kalman filter.