opencv - HoughCircles Parameters to recognise balls -


after processing image converting grey scale , blurring it, i'm trying apply hough circle transformation these parameters:

  • cv_hough_gradient
  • dp = 1
  • min_dist = 1
  • param_1 = 70
  • param_2 = 100
  • min_radius = 0
  • max_radius = 0

here 1 of many images i've tried: http://i.stack.imgur.com/jgrim.jpg

but algorithm fails recognise ball relaxed parameters.

(when try image of circle created in gimp works fine)

i agree krzych. had working effortlessly :

cv::mat img,img2; std::vector<cv::vec3f> circles; img = cv::imread("jgrim.jpg",1); cv::bilateralfilter(img, img2, 15, 1000, 1000); cv::cvtcolor(img2, img2,cv_bgr2gray); cv::houghcircles(img2, circles, cv_hough_gradient, 1,300,50, 10); cv::circle(img2,cv::point(circles[0][0],circles[0][1]),circles[0][2],cv::scalar(126),2); cv::imshow("test",img2);  cv::waitkey(0); cv::imwrite("test.jpg",img2); return 0; 

enter image description here

good luck :)


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c++ - Using OpenSSL in a multi-threaded application -

All overlapping substrings matching a java regex -