Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

OpenCV + Python | Multiple object tracking

I'm working on a project and I really can't reach a solution. My goal is to track some circular objects of the same color (red) in a video. My current pipeline is:

  1. Convert each frame from BGR to HSV
  2. Threshold the image using inRange() function
  3. Some morph operations like erode(), dilate(), blur()
  4. Find contours and then some infos like area, centroid etc...
  5. Draw contours on the original frame
  6. Save the new centroid position in every frame (in a python dictionary)

The problems are:

  1. The result is a little noisy
  2. I can't give an identity to each object (there are problems when two object come in contact, or when an object disappears and then reappears etc...)

I would be grateful if someone has some suggestions on what's the best way to procees and how can I change pipeline (e.g. using Kalman Filter, Camshift or other algorithms). I'm not a CV expert, so please be patient. Thanks a lot