def find_likely_rectangles(contours, sigma):
contours = sorted(contours, key=cv2.contourArea, reverse=True)[:10]
possible = []
for c in contours:
# approximate the contour
peri = cv2.arcLength(c, True)
approx = cv2.approxPolyDP(c, sigma * peri, True)
box = make_box(approx)
possible.append(box)
return possible
评论列表
文章目录