Ask Your Question

filled circle detection

asked 2013-10-21 07:01:24 -0500

jm gravatar image

Hello, I'm trying to identify filled circles from non-filled circles (example pic - )

circle-filled.jpg circle-empty.jpg

How do I go about doing this?0

I tried searching, and found this page on Image Moments, however, the code as shown in the example doesn't work for me.

I'm using OpenCV 2.6.4 in a Visual Studio 2012 C++ Environment.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2013-10-21 09:13:51 -0500

You can use hough-transform for detecting the circle and if it's a binary images then countNonZero to check if the circle is filled. Otherwise, you can use a histogram of gray values to measure the amount of black/white pixels.

edit flag offensive delete link more

answered 2013-10-21 13:22:53 -0500

leRoss gravatar image

I recommend to stick with your previous link to find contours of OpenCV. the moment helps you to find the center only.

simpler tutorial for contours :

Use the FindContours method with CV_RETR_TREE option that option with give you a tree of contours inside a contours. if there's a contour within a contour. it seems to be a non-filled circle.

edit flag offensive delete link more

Question Tools


Asked: 2013-10-21 07:01:24 -0500

Seen: 4,446 times

Last updated: Oct 21 '13