Improve text extraction

Skip to first unread message

Atef Chatty

Jul 20, 2022, 4:33:16 PMJul 20
to tesseract-ocr
i want to extract information from unclear images. I tried many filters but it doesn’t help. This is some example :
This is the input pictures:   Example.png
So why i want to extract this informations ? :
I am working on a project to extract information from driver’s licenses.
The extraction is good with some images and bad with others.
I tried different image processing to improve the quality of the extraction. It helps but not with all the images because the images don’t have the same degree of blur, luminosity… (I tried all kinds of filters but I didn’t find a good filter for all the images).
So I calculated the blur and brightness of all the images to find a filter criterion or condition, but the result was not clear to me.
Any suggestion to understand which filter I should use?

Lorenzo Bolzani

Jul 22, 2022, 4:15:42 AMJul 22
Hi Atef,
I think your best option is to generate a lot of images as bad as this one and use them for training.

So you take the good images (with the corresponding text), thousands, and ruin/blur them in many different ways. In this way, for example, from good 1000 images you get 5000/10000 bad images.

Then you fine tune the model using these.

With pre-processing it is a lot of work and you are not going to get good reliable results anyway. If you still want to try you can use the white border of the image as a reference for the average image brightness and fix the brightness according to this. Or try CLAHE.

Process manually with Gimp this image first to see IF this helps and what brightness/contrast is the best. It's faster to do this manually. Once you have reliable a "pre-processing" try to replicate it with code.



You received this message because you are subscribed to the Google Groups "tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
Reply all
Reply to author
0 new messages