Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to improve tesseract OCR with small fonts?

I'm trying to use tesseract-OCR via python-tesseract to read a low resolution font that looks like this:

enter image description here

Unfortunately that image returns

ZIJZHZI

I think the resolution is too low and that is causing problems. I've tried magnifying the image, and cropping it down to individual characters, but neither of these provide much improvement. Is there anything else I should consider doing, preferably something that could be done using the Python Imaging Library? Or should I just give up/train tesseract.

For what it's worth, the PIL has the following built in filters:

BLUR, CONTOUR, DETAIL, EDGE_ENHANCE,
EDGE_ENHANCE_MORE, EMBOSS, FIND_EDGES,
SMOOTH, SMOOTH_MORE, and SHARPEN

like image 907
Riazm Avatar asked Feb 05 '11 20:02

Riazm


1 Answers

I've tried to magnify the image with:

  convert -resize 400% in.bmp out.bmp

And then read it:

  tesseract out.bmp res

The result is correct:

  100
like image 80
Hristo Hristov Avatar answered Oct 14 '22 23:10

Hristo Hristov