I have some pictures like this: enter image description here
After choosing the contour that I want by index
by the function cv2.findContours
: enter image description here
I want to remove the nearly white background outside this contour. I tried this method: Removing background color from image opencv python but I don't know how to modify the mask such that the inner area of the contour is white and the outer is back.
Could anyone tell me how? Thanks in advance