OCR image processing

I am trying to use OCR for MATLAB for character recognition. This is what I do -

I=imread('ocr.jpg');
imshow(I);title('Original Image');
results = ocr(I);
word = results.Text

      

This image ocr.jpg

enter image description here

But this is the result I am getting - word =

Basically it cannot recognize the character F

. This is the link I followed - http://in.mathworks.com/help/vision/examples/recognize-text-using-optical-character-recognition-ocr.html

+3


source to share


1 answer


Since the image contains only one character and the text is not formatted in a typical page format (double column, single column, etc.), you need to set the "TextLayout" parameter to "Word" and provide an input ROI:

>> r = ocr(img,[91 89 22 37],'TextLayout','Word')

r = 

  ocrText with properties:

                      Text: 'F…'
    CharacterBoundingBoxes: [3x4 double]
      CharacterConfidences: [3x1 single]
                     Words: {'F'}
         WordBoundingBoxes: [94 97 16 21]
           WordConfidences: 0.9428

      



I used IMRECT to manually render the ROI around the "F", but you can use REGIONPROPS or vision.BlobAnalysis to automatically get the ROI around the symbol if your images are all black and white like the one you placed.

+3


source







All Articles