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/
source share