img_gray = cv2.imread(r"./example.png", 0)# the threshold you want is thrthr = 127bw = ((img_gray / (thr * 2)) > 0.5).astype(np.uint8) * 255 # INV: ">" -> "<"
本文共 215 字,大约阅读时间需要 1 分钟。
img_gray = cv2.imread(r"./example.png", 0)# the threshold you want is thrthr = 127bw = ((img_gray / (thr * 2)) > 0.5).astype(np.uint8) * 255 # INV: ">" -> "<"
转载于:https://www.cnblogs.com/ZhengPeng7/p/7859870.html