问题
Trying to draw in contours from a list. Here's my code. It fails on the cv2.drawContours function. Is there a way to use the connectedComponentsWithStats function to somehow find all the contours and then draw black pixels over them the way I am trying to because when I use the connectedComponentsWithStats function, it selects the contours I want it to.
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
labelNum, labelImg, contours, GoCs = cv2.connectedComponentsWithStats(gray)
for c in contours:
x,y,w,h,size = c
if size <= 100:
cv2.drawContours(mask, [c], -1, 0, -1)
来源:https://stackoverflow.com/questions/44087581/opencv-3-with-python3-getting-this-error-215-npoints-0-in-function-drawcon