Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I think you should start with findContours. Here are a lot of tutorials for similar tasks, especially this two 1, 2.

When you know (at least approximate) contour of a button, you can cut slightly larger area and then remove background pixels (set transparency). As you mentioned, you can easily detect background color, so it can be masked later. To generate such mask, convert your image to HSV and use inRange function.