def check_blank_image(file):
img = cv2.imread(file)
if img is None:
return False
# grary
img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
# threshold to two value image
ret,thresh = cv2.threshold(img, 150, 255,cv2.THRESH_BINARY)[......]
用opencv检查是否为白纸
Leave a reply