Jennifer
Jennifer

Reputation: 119

how to increase resolution of text in scanned images in python?

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:

  1. Increase the dpi to 300.

  2. Image pre- processing techniques in opencv.

  3. Upscaling of images using dnn_superres in opencv

  4. Noise removal techniques.

  5. Refereed git repos where super-resolution algorithm model is developed using Deep learning.

  6. Improve tesseract-ocr quality by training tessdata.

Reference Links:

  1. Improve OCR accuracy from scanned documents
  2. image processing to improve tesseract OCR accuracy

Sample Image:

enter image description here

Is there any simple way in python to improve the text without using any Deep learning model.

Upvotes: 9

Views: 9166

Answers (2)

Jeff Hansen
Jeff Hansen

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

Matthew Smith
Matthew Smith

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

Related Questions