I have no background in computer vision, but I was curious to know how I could use OpenCV library to achieve the following:
I have a jar of spare buttons, assorted in colour, style and diameter. For the most part they are circular. I evenly scatter them on a piece of white paper, and under good lighting, take a fairly high resolution picture with your average digital camera. How would I got about slicing this image to grab each button individually as a separate object/image?
Thanks in advance.
Two possible ways:
1) Using the circle hough transform You run some edge detector (canny/sobel) and then the circle hough transform. You'll get the circles.
2) Using contours Seperate the button and background using thresholding. Detect contours in this thresholded image and you have the buttons!
Articles that might help:
Disclaimer: Those are links to my website.
I think the simplest thing you could try is: run the Canny edge detector and apply a Hough transform to detect circles and generate a separate image from each of the circles.
I've been doing some dish recognition and it worked pretty good. do this:
Do some thresholding (buttons should be shiner than background) to leave only the buttons,
then cvFindContours
for each contour:
Hough transform is also possible but it is quite more expensive.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With