Debugging save mask. Contour can be painted correctly while drawing mask is still troublesome.
Save Contour added. Save mask still troublesome.
Using opencv drawContour() to save, cannot fill the right contour without overlapping holes.
By resorting the contour points, drawContours works. Save mask done.