def findIDcnt(countours):
#????????
widths = []
for idx, cnt in enumerate(countours):
x, y, width, height = cv2.boundingRect(cnt)
widths.insert(idx, width)
#???????????
IDList = heapq.nlargest(3, widths)
#???????????????????
IDcnts = []
for idx, item in enumerate(IDList):
index = widths.index(item)
IDcnts.insert(idx, countours[index])
# print IDcnts
return IDcnts
# ????
评论列表
文章目录