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.
To extract text from the image we can use the PIL and pytesseract libraries. We currently perform this step for a single image, but this can be easily modified to loop over a set of images. We can enhance the accuracy of the output by fine tuning the parameters but the objective is to show text extraction.
1. Open your image in Lightroom. 2. Choose Photo > Enhance. 3. Select Super Resolution. 4. Click Enhance. Lightroom will increase your image resolution and save it as a new DNG file. Any previous edits you’ve made to your new high-resolution photo will be included. Adjusting resolution in Photoshop.
You can increase the resolution of a digital image file, but you will lose image quality by doing so. However, there are some measures you can take in Adobe Photoshop to help you increase resolution while upholding visual quality.
The more pixels an image starts with, the higher the resolution. Decreasing the number of pixels is called downsampling, which removes data from your image. Increasing the number of pixels is called upsampling, which adds data to the image.
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!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With