I am working with OpenCV for android and trying to create a shape mask from the found contours. I have found contours of an object using findContours of only external contours, such as:
I want to create a mask in order to seperate the object from the background. For the example of the fork, it should be something like this:
I tried to use fillPoly to accomplish it, but the problem is that the contours are not connected.
I also tried to connect them into one contour but the connections are not right. Is there a way to get the general shape of the contours and create this mask?
Thanks.