📅  最后修改于: 2022-03-11 14:46:46.141000             🧑  作者: Mango
if cv2.getVersionMajor() in [2, 4]:
# OpenCV 2, OpenCV 4 case
contour, hier = cv2.findContours(
thresh.copy(), cv2.RETR_CCOMP, cv2.CHAIN_APPROX_NONE)
else:
# OpenCV 3 case
image, contour, hier = cv2.findContours(
thresh.copy(), cv2.RETR_CCOMP, cv2.CHAIN_APPROX_NONE)