How to improve tesseract results for number recognition

I am working on an iPhone application that recognizes ISBNs (ISBN: 978-83-7380-900-0) I use tesseract for this, but it does not work very well. I can see other applications using the same engine to work better.

to restrict characters, I use this configuration line: tess-> SetVariable ("tessedit_char_whitelist", "SN: 0123456789X-"); therefore, all "I" are converted to "1" and "B" to 8. Using this, he is not mistaken with these letters, it does not matter to me. After that, I use regular expression to find the right part of the recognized text.

I also crop the image, so tesseract only recognizes the part of the image where isbn is visible (I placed a rectangle on the camera overlet so that the user can place the code in the right place) I also resize the image to a width of 1000 pixels (also tried other sizes)

It works great when the light is excellent, but it is very difficult to correctly recognize when the lighting is not perfect.

The last digit of the isbn number is a checksum.

What can I do to make it work better? Is there a way to tell tesserect to recognize text only in a given regular expression? Maybe I should first do something with the image?

Samples of images that are not recognized correctly:
http://img412.imageshack.us/i/img0367si.jpg/
http://img264.imageshack.us/i/img0361d.jpg/

+4
source share
1 answer

I used some preprocessing and the results are good at the moment. (normalization and automatic threshold) I do this with simple image processing for iphone. I also make images with 2x magnification. The only problem is that it is very easy to make a fuzzy image, and then understand that it does not mean anything. The ocr recognition process takes approximately 4 seconds. and it works on an image of 300 x 109: 19KB I'm just wondering what I can do to make it work faster, so I can make several images and process them all.

+3
source

Source: https://habr.com/ru/post/1333659/


All Articles