Reputation: 119
I use tesseract-OCR to extract text from scanned images, For few images text is not properly recognized due to low resolution and output produced is some irrelevant characters.
Techniques applied:
Increase the dpi to 300.
Image pre- processing techniques in opencv.
Upscaling of images using dnn_superres in opencv
Noise removal techniques.
Refereed git repos where super-resolution algorithm model is developed using Deep learning.
Improve tesseract-ocr quality by training tessdata.
Reference Links:
Sample Image:
Is there any simple way in python to improve the text without using any Deep learning model.
Upvotes: 9
Views: 9166
Reputation: 67
Another really great tool for upscaling images is the super-image PyPI package https://pypi.org/project/super-image/. The downside, is this uses stable diffusion, which does not handle text as well. You may have amazing results, but you also might have mixed results.
This package also works best with GPU processing with PyTorch.
Upvotes: 0
Reputation: 508
I am aware you would prefer to upscale these input images with using deep learning, but I would highly recommend experimenting with https://github.com/alexjc/neural-enhance, assuming you have the appropriate hardware to run the neural networks and deep learning.
The results for your OCR input images could be promising. The documentation for the code is quite substantial.
Hope this helps you!
Upvotes: 7