Ask Your Question
0

filled circle detection

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

jm gravatar image

Hello, I'm trying to identify filled circles from non-filled circles (example pic - http://bit.ly/17bvGcS )

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
3

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

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
0

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

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 : http://docs.opencv.org/doc/tutorials/imgproc/shapedescriptors/find_contours/find_contours.html

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

Stats

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

Seen: 5,677 times

Last updated: Oct 21 '13