I have the image shown below. My aim is to detect the circle which shown in the second image. I used [centers,radii] = imfindcircles(IM,[100 300]);
but it found nothing.
Is there any other way to detect the circle? How can I do that?
Original image:
The circle:I drew it with paint.
Here is another approach to solve this problem. It´s not based on Hough Transform, as imfindcircles and previous answer are.
Basically:
HT sometimes is slow, depending on input data size and resolution. It may be useful to compare the execution time of both approaches (HT, non HT).
The proposed method may also be able to detect objects of another shape (non circular).
Here is an alternative solution to imfindcircles. Basically threshold the image, dilate it with a disk structuring element and then, after finding the edges, apply a Hough transform to detect the circle using the
circle_hough
algorithm available form the file exchange here.Here is the code:
Which gives the following:
You can play around with the parameters passed to threshold or to dilate as well to see how it affects the outcome.
Hope that helps!