Ask Your Question

Revision history [back]

What have you tried so far?

A couple methods you could look into are:

  1. Hough Circles

  2. Find the contours then try filtering them out by area or something along those lines. I'd then find the convexHulls (This is an optional step and should be performed depending on the results of the contours). Thereafter I would check the resulting contours/convexHulls for circularity using the equation shown here

You'll need to tweak around with the resulting circularity to see which one makes sense. A perfect circle returns 1. So you might want to filter out the contours based off of a criteria along these lines 0.6 <= circularity <= 1.

This should get you started on contours and here's a resource to find methods for calculating contour areas and perimeter.

NOTE

Before applying any of these methods, you might want to perform some morphological operations to your image to remove noise. Try them out and see which one is suitable for your application.

Canny Edges might be of interest as well.

Happy coding,

Cheers mate :)