November 2018
Beginner
472 pages
13h 5m
English
In OpenCV 2.4.9 this function has the signature (arrangement of parameters and return values) of:
contours, hierarchy = cv.findContours(image, mode, method[, contours[, hierarchy[, offset]]] ).
We copy the image because this function will modify the image with outlines as it finds the contours in it.
In OpenCV 3, findContours now has a different return value:
image, contours, hierarchy = cv.findContours(image, mode, method[, contours[, hierarchy[, offset]]]).
The original image is not altered. An additional image (which can be ignored if you don't want it: Python will dispose of it) is returned, which has the same changes the old OpenCV version would have made.
With this changed, the code should now function well with OpenCV ...