Find blob first then find circle

My use case is to have a mini rover chase after red ball (circle). I was using find blob to detect the red initially, and obviously it wasn’t good enough as it pick up so many other reds.
So I decided to use two level detection: 1st check the red blob then windowing the blob ROI, 2nd check the circle within the ROI.
This approach works when the background has no other red objects. I ran into several problems:

  • When the red ball overlap with a red chair, it can’t recognize the red ball as circle.


  • Worst still, it recognize different part of red chair as circle.




  • I attempted to convert the red blob ROI using image.to_greyscale (use red channel), find_circle pick up noises as circle. Same thing happened when I attempted in binary image too.




  • Attempted to use canny edge hoping to find the circle but that doesn’t work.

I must admit the filtering part of my image is not good and that’s the reason I come to forum seek for advise.
I’m wondering how the find_circle works, does it have “roundness” parameter? I have seen some of the image end up recognize noises as circle like below.
Or, will find_keypoints be able to detect a circle?


Find circle works off of edge strength. So, you should look at the strength returned by the circle. True circles should have a higher edge strength.

Also, find_blobs() returns a ton of parameters about blobs. You could filter based on this too.

For find_circles()… I’d recommend printing the circle objects detected out. Then upping the threshold until only the best match remains.

I apologize that the find_circle() method strength is not normalized to the circle size. You may wish to do that to get size independent results.