Question

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.

enter image description here

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top