PLease download the attatchment here and save it as /tmp/target.jpg
.
You can see that there are 0244R
in the jpg,i extract string with below python code:
from PIL import Image
import pytesseract
import cv2
filename = "/tmp/target.jpg"
image = cv2.imread(filename)
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
ret, threshold = cv2.threshold(gray,55, 255, cv2.THRESH_BINARY)
print(pytesseract.image_to_string(threshold))
What I get is
0244K
The right string is 0244R
,how to make image more contrast, grayscale then get all characters exactly with with PIL and pytesseract?
Here is the webpage which generate the image :