def contours_draw(self, frame, **kwargs):
if 'start' not in kwargs:
kwargs['start'] = 0
if 'end' not in kwargs:
kwargs['end'] = len(self.contours) - 1
if 'color' not in kwargs:
kwargs['color'] = (0, 255, 0)
if 'width' not in kwargs:
kwargs['width'] = 2
contours = [cnt.ndarray for cnt in self.contours][kwargs['start']:kwargs['end'] + 1]
if len(contours) > 0:
cv2.drawContours(frame.ndarray, contours, -1, kwargs['color'], kwargs['width'])
return True
return False
# Dilate this mask's white region
评论列表
文章目录