import cv2

img = cv2.imread('04_crop_1.jpg', cv2.IMREAD_GRAYSCALE)

thresh_img = cv2.adaptiveThreshold(img, 255, cv2.ADAPTIVE_THRESH_MEAN_C, cv2.THRESH_BINARY, 11, 5)

cv2.imshow('thresh_img', thresh_img)
cv2.imwrite('result.jpg', thresh_img)
cv2.waitKey()
