|
|
@ -227,7 +227,8 @@ for c in cnts:
|
|
|
|
hull2 = cv2.convexHull(c)
|
|
|
|
hull2 = cv2.convexHull(c)
|
|
|
|
defects = cv2.convexityDefects(c,hull)
|
|
|
|
defects = cv2.convexityDefects(c,hull)
|
|
|
|
#print(str(defects.size) + " match")
|
|
|
|
#print(str(defects.size) + " match")
|
|
|
|
cv2.drawContours(orig, (approx.astype("int")), -1, (255, 0, 0), 8)
|
|
|
|
cv2.drawContours(orig, (hull2), -1, (0, 0, 255), 8)
|
|
|
|
|
|
|
|
cv2.drawContours(orig, (approx), -1, (255, 0, 0), 6)
|
|
|
|
convexness = area_contour / cv2.contourArea(hull2)
|
|
|
|
convexness = area_contour / cv2.contourArea(hull2)
|
|
|
|
#print(str(convexness) + " % fill")
|
|
|
|
#print(str(convexness) + " % fill")
|
|
|
|
#if not cv2.isContourConvex(approx):
|
|
|
|
#if not cv2.isContourConvex(approx):
|
|
|
|