1

enter image description here

$ tesseract pin3.png output
$ cat output.txt


bon 9 no Us

(oe


// expect 

391 
205
786
 4

I think the image is not complicated, but tesseract doesn't recognize the numbers of image. I thought perhaps number's colors are white, so I tried to change number color to black but result is same. How can I make tesseract recognize that kinds of image?

Thanks

-- As you can see, This is not single word

ton1
  • 7,238
  • 18
  • 71
  • 126
  • Possible duplicate of [Tesseract does not recognize single characters](https://stackoverflow.com/questions/9632044/tesseract-does-not-recognize-single-characters) – Tchoupi Mar 13 '19 at 01:57
  • While suggested link doesn't provide correct answer - it says right thing. Try different `psm` - page segmentation modes (see [tesseract wiki](\\nlbawfps1\BI_Prod_Support_TransferToDev) for more info about psm) – Dmitrii Z. Mar 13 '19 at 09:27
  • @DmitriiZ. I tried `psm 0 to 13` but all of them failed. – ton1 Mar 14 '19 at 05:56

1 Answers1

2

Preprocess image:

  1. invert
  2. binarize

enter image description here

tesseract numpad_.png - --psm 6
Warning: Invalid resolution 0 dpi. Using 70 instead.
3 9 1
2 0 5
7 8 6

4
user898678
  • 2,994
  • 2
  • 18
  • 17
  • That "Invert" really helped OCR, so it will have white background and black text. Went from totally clear numbers, and couldn't translate a thing, to translating everything easily. Thank you!! – WoodyDRN May 04 '22 at 10:09