1 | initial version |
You are trying to draw the hierarchy instead of the contours. The return of findContours
is contours, hierarchy
. Therefore, your line _, contours = cv2.findContours(edged,cv2.RETR_EXTERNAL,cv2.CHAIN_APPROX_NONE)
should actually be contours, _ = cv2.findContours(edged,cv2.RETR_EXTERNAL,cv2.CHAIN_APPROX_NONE)
.
Hope it helps.