views:

55

answers:

1

I'm using Tesseract in one of my applications, and I'm having trouble obtaining perfect results. When I use the library on a perfect screenshot, it gets most of the text and that's fine. But when I use it on a photo for example, it has trouble working it out, and sometimes it won't even return anything.

I know you can train Tesseract, is there a good training tutorial or something for iPhone photo recognition? Or are there any modifications I should make to my source image before processing it?

Thanks!

+1  A: 

Post a sample pic. Here are some things to look at:

How are you getting the image to 1-bit? Ultimately OCR is done in B/W images -- perhaps you can do a better job than the library.

What is the DPI of the image? Scans usually are around 200-300 DPI, but photos can be 72 or 96. OCR engines look at DPI to get a sense of the size of the letters. You might need to change the DPI and resample (resize) the image so that the DPI matches expectations. OCR engines are expecting scanned documents, not photographs.

Lou Franco
So if I understand correctly, I should convert the image to around 200 dpi and black and white to expect better results? Is there a good library to do this on iPhone?
Elton
Do it manually first to see if it makes a difference. You can use GIMP. If it's better, CoreImage is part of the IOs library. The B/W conversion must be done in a good way -- there are several thresholding algorithms -- you might need to play with it. Look at this: http://sudokugrab.blogspot.com/2009/07/how-does-it-all-work.html
Lou Franco
Thanks you very much!
Elton
Just a last question: would using Image Magick to do this be a good idea?
Elton
If there's an iPhone port, then yes, go ahead. You have to link as a static library, not a dylib, to comply with AppStore rules.
Lou Franco