I have been dabbling with tesseract for abit and testing it on a simple image with white blackground and simple strings created using PHP. However, almost all the results im getting are wrong. From the image below, the results i get are "Q Oo 86 E" Is there something i am not aware of when doing the read? Or should i choose a better font?
Asked
Active
Viewed 451 times
0

dirkaka
- 118
- 1
- 11
1 Answers
0
Upscaling image and sharpening it helps.
image = cv2.imread('image.png', cv2.IMREAD_GRAYSCALE)
image = cv2.resize(image, (800, 200)) #upscale
image = cv2.filter2D(image, -1, np.array([-1,4,-1])) #sharpen
print(pytesseract.image_to_string(image, config='--psm 7')) #use psm 7 since it is a single line
result:
I Q Q 8 E W

Dmitrii Z.
- 2,287
- 3
- 19
- 29