def get_defects(self, cnt, drawing):
defects = None
hull = cv2.convexHull(cnt)
cv2.drawContours(drawing, [cnt], 0, (0, 255, 0), 0)
cv2.drawContours(drawing, [hull], 0, (0, 0, 255), 0)
hull = cv2.convexHull(cnt, returnPoints=False) # For finding defects
if hull.size > 2:
defects = cv2.convexityDefects(cnt, hull)
return defects
# Gesture Recognition
评论列表
文章目录