Your code is great and so fast. I am having a problem .When i try to use the centroid coordinates to display a particular its showing the wrong results. I want to use this for a object following robot but when i use a if loop to decide which character to be sent its not sending correctly.
this is great . thank you
code works perfect . easily can change the red color to green or blue by changing 1 to 2(green) or 3 in :
i had a problem in objects were far from cam to recognize, which solved by reducing the number in :
diff_im = bwareaopen(diff_im,600);
still don't know how to extract the coordinates and save them ??