I have a screenshot of the bank cheque, I need all the text from this screenshot but tesseract is unable to read it properly. I also tried to pre-process the image but the output fails miserably.
I am using ImageMagick for pre-processing and Tesseract for recognizing text. The link to the image: https://i.sstatic.net/uNNhS.jpg
I am able to retrieve the account number, but not IFSC code and person name "SRINIVAS"
The steps I am following is as follows:
magick -density 300 check1.jpg -depth 8 -strip -background white -alpha off check1.png
magick convert check1.png -resize 250% res_check1.png
convert -brightness-contrast 10x30 res_check1.png b_res_check1.png
convert b_res_check1.png -threshold 45% bin_res_check1.png
tesseract bin_res_check1.png o_res_check1
Note: I tried to resize the image upto 400% but it did not work. Google Vision API is able to read and convert every single text properly.
In ImageMagick, you can use -lat (local area threshold) to process the image to clean the background. I also have a bash shell script, text cleaner, at http://www.fmwconcepts.com/imagemagick/index.php.
Input:
For ImageMagick 6, try
convert input.jpg -negate -lat 25x25+10% -negate result.png
Vary the -lat arguments to see if you can improve the results.
For ImageMagick 7, replace convert with magick.
Does that help? Small fonts are going to be hard to process. Enlarging a raster image, does not usually help much. But you can try with sharpening filters or sharper resize filters, such as -filter catrom. See http://www.imagemagick.org/Usage/filter/
You can also try doing a perspective transformation to rectify the original image before further processing. This might also help. See http://www.imagemagick.org/Usage/distorts/#perspective