Attention! This forum will be made read-only by Dec-20. Please migrate to https://forum.opencv.org. Most of existing active users should've received invitation by e-mail.
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Your parameters should be narrowed, imo. I have an app for Apple devices that uses Hough Circles. Use these parameters instead to narrow your results. It takes huge processing power and is slow, use the GPU to speed things up considerably. You should run the edge detector as well.

cv::Canny(gray, edges, t1, t2, aS, l2);  //25, 35, 3, true
cv::HoughCircles(gray, circles, CV_HOUGH_GRADIENT, aIr, minCentDist, t2, dFilt, minDist, maxDist);  //2, 160, 35, 47, 70, 89

Understanding what each parameter is will help you considerably. The last two are the smallest circe and largest circle you want to find. Using 0,0 as parameters makes HoughCircles look for every size circle possible. Use actual numbers that represent the size of your circles (pepperoni) and you will get better results. This is from my Xcode project which is Obj C++. Hope this helps.

Your parameters should be narrowed, imo. I have an app for Apple devices that uses Hough Circles. Use these parameters instead to narrow your results. It takes huge processing power and is slow, use the GPU to speed things up considerably. You should run the edge detector as well.

cv::Canny(gray, edges, t1, t2, aS, l2);  //25, 35, 3, true
cv::HoughCircles(gray, circles, CV_HOUGH_GRADIENT, aIr, minCentDist, t2, dFilt, minDist, maxDist);  //2, 160, 50, 35, 47, 70, 89
40, 30, 50

Understanding what each parameter is will help you considerably. The last two are the smallest circe and largest circle you want to find. Using 0,0 as parameters makes HoughCircles look for every size circle possible. Use actual numbers that represent the size of your circles (pepperoni) and you will get better results. This is from my Xcode project which is Obj C++. Hope this helps.

Your parameters should be narrowed, imo. I have an app for Apple devices that uses Hough Circles. Use these parameters instead to narrow your results. It takes huge processing power and is slow, use the GPU to speed things up considerably. You should run the edge detector as well.

cv::Canny(gray, edges, t1, t2, aS, l2);  //25, 35, 3, true
cv::HoughCircles(gray, circles, CV_HOUGH_GRADIENT, aIr, minCentDist, t2, dFilt, minDist, maxDist);  //2, 50, 35, 40, 30, 50

Understanding what each parameter is will help you considerably. The last two are the smallest circe circle and largest circle you want to find. Using 0,0 as parameters makes HoughCircles look for every size circle possible. Use actual numbers that represent the size of your circles (pepperoni) and you will get better results. results. The dFilt in my parameters is the detection filter, the higher the number the more accurate it is...the lower the number the more false circles you will detect. This is from my Xcode project which is Obj C++. Hope this helps.

Your parameters should be narrowed, imo. I have an app for Apple devices that uses Hough Circles. Use these parameters instead to narrow your results. It takes huge processing power and is slow, use the GPU to speed things up considerably. You should run the edge detector Canny Edge Detector as well.

cv::Canny(gray, edges, t1, t2, aS, l2);  //25, 35, 3, true
cv::HoughCircles(gray, circles, CV_HOUGH_GRADIENT, aIr, minCentDist, t2, dFilt, minDist, maxDist);  //2, 50, 35, 40, 30, 50

Understanding what each parameter is will help you considerably. The last two are the smallest circle and largest circle you want to find. Using 0,0 as parameters makes HoughCircles look for every size circle possible. Use actual numbers that represent the size of your circles (pepperoni) and you will get better results. The dFilt in my parameters is the detection filter, the higher the number the more accurate it is...the lower the number the more false circles you will detect. This is from my Xcode project which is Obj C++. Hope this helps.

Your parameters should be narrowed, imo. I have an app for Apple devices that uses Hough Circles. Use these parameters instead to narrow your results. It takes huge processing power and is slow, use the GPU to speed things up considerably. You should run the Canny Edge Detector as well.

cv::Canny(gray, edges, t1, t2, aS, l2);  //25, 35, 3, true
cv::HoughCircles(gray, circles, CV_HOUGH_GRADIENT, aIr, minCentDist, t2, dFilt, minDist, maxDist);  //2, 50, 35, 40, 30, 50

Understanding what each parameter is will help you considerably. The last two are the smallest circle and largest circle you want to find. Using 0,0 as parameters makes HoughCircles look for every size circle possible. possible and slows things down quite a bit. Use actual numbers that represent the size of your circles (pepperoni) and you will get better results. The dFilt in my parameters is the detection filter, the higher the number the more accurate it is...the lower the number the more false circles you will detect. This is from my Xcode project which is Obj C++. Hope this helps.

Your parameters should be narrowed, imo. I have an app for Apple devices that uses Hough Circles. Use these parameters instead to narrow your results. It takes huge processing power and is slow, use the GPU to speed things up considerably. You should run the Canny Edge Detector as well.

cv::Canny(gray, edges, t1, t2, aS, l2);  //25, 35, 3, true
cv::HoughCircles(gray, circles, CV_HOUGH_GRADIENT, aIr, minCentDist, t2, dFilt, minDist, maxDist);  //2, 50, 35, 40, 30, 50

Understanding what each parameter is will help you considerably. The last two are the smallest circle and largest circle you want to find. Using 0,0 as parameters makes HoughCircles look for every size circle possible and slows things down quite a bit. Use actual numbers that represent the size of your circles (pepperoni) and you will get better results. The dFilt in my parameters is the detection filter, the higher the number the more accurate it is...the lower the number the more false circles you will detect. This is from my Xcode project which is Obj C++. Hope this helps.helps. I did run across FCD which is Fast Circle Detection, it is impervious to background noise. From some professors in Iran long ago...and I could not find anything else on it. Having the picture at an angle, as you do, does help eliminate background noise false readings. If you look at my parameters aIr is Inverse Ratio, minCentDist is the Minimum Distance Between Circe Centers, t2 is Threshold 2 parameter from Canny Edge Detector, dFilt is the Detection Filter, minDist is the smallest circle and maxDist is the largest circle. Only adjust one parameter at a time when fine tuning, or you will chase ghosts forever. :o)