更新时间:2023-01-28 18:41:08
您正在为蒙版设置颜色(0,255,0),但是该蒙版是单通道的,因此您可以使用颜色0绘制轮廓.
you are setting color (0,255,0) to the mask, but the mask is single channel so you draw the contour in color 0.
尝试
cv.drawContours(mask, contours, -1, (255),1)
或
cv.drawContours(mask, contours, -1, (255,255,255),1)