erzhih.py 258 B

123456789
  1. import cv2
  2. img = cv2.imread('04_crop_1.jpg', cv2.IMREAD_GRAYSCALE)
  3. thresh_img = cv2.adaptiveThreshold(img, 255, cv2.ADAPTIVE_THRESH_MEAN_C, cv2.THRESH_BINARY, 11, 5)
  4. cv2.imshow('thresh_img', thresh_img)
  5. cv2.imwrite('result.jpg', thresh_img)
  6. cv2.waitKey()