I\'m trying to create a mask from a contour, but am getting a C++ error.
Using OS X Yosemite, Python 2.7.10, OpenCV 3.1.0.
def create_mask(img, cnt):
For me this worked. But I'm not sure why.
cv2.drawContours(mask, [cnt.astype(int)], 0, (0, 255, 0), -1)
When you get an array of rounded floats from findContours, drawContours doesn't complain. But when I construct a similar (4,2) array of floats myself, it complains.