0

I got this image of a simple math expression Tesseract fails to read:

8 - 3 = 5

I've tested a screenshot of the same expression written on an Android phone and it was read pretty well. So I thought it's a font problem. I considered:

Dlean Jeans
  • 966
  • 1
  • 8
  • 23

1 Answers1

1

But as I was typing the question, I looked around for more.

And this answer prompted me to double check my sanity with this VietOCR software which outputs 8-3, close enough!

Then I messed around the software and found that I could pass --psm 7 (Page Segmentation Mode 7: Treat the image as a single text line) to my script, which works well for my math expressions:

pytesseract.image_to_string(img, config='--psm 7')

List of PSMs

Dlean Jeans
  • 966
  • 1
  • 8
  • 23