I made using OpenCv a program, which first checks the most occurring color, and based on that color creates a mask, which then is used to create a binary image based on the mask.
The problem is though this solution doesn't seems so robust for certain color combination.
ex.
But for some reason does it work perfectly on these pictures..
The code is here.. http://pastebin.com/KujpZs6r
Any suggestion for improvements ?