Guidelines for the "ocr" function (optical character recognition) of the Computer Vision System Toolbox.

6 views (last 30 days)
Depending on the size of font in the image that I am analyzing I get different results even when the actual text or font type does not change.  Are there any suggestions for how to use the "ocr" function?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 7 Aug 2014
1) OCR works best when the font size is at least 20 pixels tall.  If the font in the image is smaller than this, increasing the image size is a good first step to improving OCR accuracy.  This can be done using "imresize".
 
2) The default TextLayout, 'Auto', works best when the image text has formatting like that found in a book or magazine article. Usually, if you have one or two words using 'Auto' is fine, but if the formatting of the image text starts to deviate much from what one would expect to see from a scanned book page then unexpected results may occur.  If this happens, it's best to specify an ROI around each text region.
 
3) If you have an ROI with just a single line of text or a single word, switch the TextLayout to Line or Word, respectively. This can sometimes help improve accuracy over the 'Auto' TextLayout setting.
 
4) Try to clean up the image as much as possible before using OCR.  There are several useful techniques shown in the built-in OCRExample.m script.

More Answers (0)

Tags

No tags entered yet.

Products


Release

R2014a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!