Reputation: 638
I'm still a beginner in OpenCV, and I'm trying to detect circles using HoughCircles with the following parameters:
HoughCircles(gray, circles, CV_HOUGH_GRADIENT,2, gray.rows/8, 200, 90, 0, 130 );
However, HoughCircles
is not detecting shapes that are closely similar to a circle, as in the image below.
Do you have an idea on how to fix such issue?
Thank you in advance.
Upvotes: 4
Views: 2474
Reputation: 20019
Hough is used to find near perfect circles. it is robust to holes and noise, but not to deformations.
You might want to try to find a measure of 'circle-likeness'. You could analyze the contours, by comparing the length vs the surface. If it is close to pi, you know you have a circular shape.
Upvotes: 1