Improving text visibility for tesseract

Discuss digital image processing techniques and algorithms. We encourage its application to ImageMagick but you can discuss any software solutions here.
Post Reply
Posts: 1
Joined: 2018-03-13T12:12:08-07:00
Authentication code: 1152

Improving text visibility for tesseract

Post by xenocontact »

I am working with imagemagick to pre-process some captcha images for tesseract-ocr. I am using a dataset of 100 pictures to test out the accuracy of tesseract and using the following commands I am at 87% accuracy (corret/wrong ratio) which is the max I've achieved so far.

Code: Select all

magick convert -units PixelsPerInch a.tif -density 800 a.tif
magick convert a.tif -fuzz -50% -colorspace gray -lat 25x25+10% 0.tif
magick convert 0.tif -fuzz 90% -monochrome 1.tif
magick convert 1.tif -morphology open square 2.tif
magick 2.tif -rotate -2 3.tif
magick 3.tif -gaussian-blur 1x1 3.tif
magick 3.tif -morphology erode square:1 4.tif
magick 4.tif -sharpen 0x10 4.tif
magick 4.tif -normalize -level 90% 4.tif
Here is a .rar file with an example.

I aim to reach at least a 95% accuracy and as I am not very experienced I would love if you could help me out.
Many thanks in advance !
Post Reply