Ask Your Question

Hough Circle

asked 2016-09-27 07:22:26 -0500

greenworld gravatar image

updated 2016-09-27 07:54:09 -0500

berak gravatar image

Hi everyone, I have a problem that I do not understand as below: I write a program to detect the circle, my goal is detect it in binary (only black and white) image. I read some example and I can use Houghcircle to detect the circle but only on gray image, in binay image I can not. Can you help to explain and solve my problem. Thank you!

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2016-09-27 12:30:38 -0500

matman gravatar image

You can try to smooth your binary image a bit with cv::GaussianBlur or cv::blur before calling HoughCircles.

edit flag offensive delete link more


Yes, you are right, thank you!

greenworld gravatar imagegreenworld ( 2016-09-27 17:44:56 -0500 )edit

answered 2016-09-27 07:46:35 -0500

berak gravatar image

updated 2016-09-27 07:50:54 -0500

hough works on gradients, and a binary image does not have those.

please have a look at the tutorial

you either need a different image format, or a different method (findContours -> ellipse approx.)

edit flag offensive delete link more


my problem is I gonna detect a circle real time, but in the gray image, the speed quite slow, (use houghcircles)

greenworld gravatar imagegreenworld ( 2016-09-27 12:01:18 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2016-09-27 07:22:26 -0500

Seen: 136 times

Last updated: Sep 27 '16