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):
You might have commited mistake while finding the contours. Contour is the second value returned by findContours()
function as the docs say
im2, contours, hierarchy = cv.findContours(thresh, cv.RETR_TREE, cv.CHAIN_APPROX_SIMPLE)
So the following code will not work
cnt = cv2.findContours(thresh, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
This might solve your problem.