1

I am trying to detect circles in some pictures but the circles aren't always perfect. This makes houghCircles very impractical to use because it seems to only support almost perfect circles. So now i am searching for a way to kind of "fix" my circles.

for reproduction purposes:

First i threshold the picture to get a binary picutre:

cv::threshold(input, output, threshvalue, 1, cv::THRESH_BINARY_INV);

After thresholding i detect the Hough Circles with :

std::vector<cv::Vec3f> circles;
HoughCircles(binarypicture,circles,cv::HOUGH_GRADIENT,1,100,30,26,45);

An example of an imperfect circle

  • 1
    I think you should show a [mcve] so everyone can see what type of filtering you've used etc. Showing the original picture and the result after applying different filters may also help someone used to OpenCV to spot what needs to be done. – Ted Lyngmo Sep 23 '20 at 17:07
  • 1
    have a look at RANSAC circle detection: https://stackoverflow.com/questions/26222525/opencv-detect-partial-circle-with-noise/26234137#26234137 – Micka Sep 23 '20 at 19:16
  • Before applying (Hough circle or circle fitting ) filter those blobs or edges and keep just ARCS ... by the way there is a new hough algorithm (HOUGH_GRADIENT_ALT) if you use the latest OpenCV version. – Ziri Sep 24 '20 at 00:29

0 Answers0