© Fu Xianjun. All Rights Reserved.
这是一张信用卡,然而猜猜今天要干啥
先来卖波关子
然后再来一波回顾以前学过的知识
好了以上就是回顾的知识接下来开始的今天的代码环节了
import cv2
import numpy as np
def sort_contours(cnts, method = "left-to-right"):
reverse = False
i=0
if method == "right-to-left" or method == "bottom-to-top":
reverse = True
if method == "top-to-bottom" or method == "bottom-to-top":
i=1
boundingBoxes = [cv2.boundingRect(cnt) for cnt in cnts]
(cnts,