Im using opencv 2.0 with cvblob.h in VS2010 and I made a program that detects yellow blobs. Now what I want to do is to number those blobs, no matter if they move. I know that the label property is useful for number them, but I’ve tried it and when one blob is moved, the labels change. How can I hold the “initial” label numbers?
Share
What you want is to track blobs. Tracking blobs means that you keep track of blobs from frame to frame. This way, you will have a number that identified moving objects (blobs over time).
To do that you must code your own tracking algorithm (based on your specific problem) or use the tracking functions that comes with cvBlob, which are far from perfect but useful for testing purpose.
You have code samples in cvBlob package. In particular:
http://cvblob.googlecode.com/svn/trunk/samples/red_object_tracking.cpp
http://cvblob.googlecode.com/svn/trunk/test/test_tracking.cpp