我正在找到阈值图像的轮廓并像这样绘制它:
self.disc_contour = cv2.findContours(self.thresh.copy(), cv2.RETR_LIST,cv2.CHAIN_APPROX_NONE)[1]
cv2.drawContours(self.original_image, self.disc_contour, -1, (0,255,0), 2)
Run Code Online (Sandbox Code Playgroud)
我得到了所需的轮廓:
(忽略内圆。外部是上下文中的轮廓)
但是如果我将self.disc_contourdrawContour函数更改为self.disc_contour[0]我会得到以下结果:
可能是什么原因?