Pseudo-Steps of a Blob Detection Algorithm

Detect blobs: From the segmented image, connect all 4/8-connected image pixels. For every pixel, check the value of its pixel at its North, East, West and South. If it is also segmented include it in your blob. In this way, all disjointed patches can be detected as blobs.

Filter blobs: Use some filter like area/roundness/compact or the blob detected to get the blob you are looking for.

Track blobs: If you are detecting blobs in video, try to track blobs from one frame to the next. This will ensure robustness. A simple approach is to detect mean of the current blob and in the next image search for the mean near the current mean.

For your robots, you can fix upto 2/3 round colorful circles on your robot and try to track them. Pick colors that you can easily filter. You can also use OpenCv's circle detection algorithm for the Filter blobs stage.

Example Code

Library headers for the cvBlobLib in Windows and Linux are different. For example, CBlobResult takes different number of arguments. Below is a Linux implementation. Sample codes has sample code for the Windows version.

Tips

Design an interface, a GUI to train your filter. For example, if you want to filter all orange pixels use a range of pixels near orange to compare rather than the exact orange colored pixel. Your GUI can make your task easier to select pixels near orange from an image by using Mouse in cvWindows.

Use tracking to track your blob and robust detection. Use a filter like Kalman filter.

Subscription expired — please renew

Pro account upgrade has expired for this site and the site is now locked. If you are the master administrator for this site, please renew your subscription or delete your outstanding sites or stored files, so that your account fits in the free plan.