我正在尝试对这张图片进行 OCR-
这就是我正在做的使用ocr
of MATLAB
-
I=imread('N.jpg');
r = ocr(I,'TextLayout','Word')
但不是得到N
as Text
这就是我得到的-
r =
ocrText with properties:
Text: 'I\/
'
CharacterBoundingBoxes: [5x4 double]
CharacterConfidences: [5x1 single]
Words: {'I\/'}
WordBoundingBoxes: [276 120 13 7]
WordConfidences: 0.7718
所以,基本上我得到I\/
作为文本。我该如何解决这个问题?
您可以使用垂直线结构元素放大图像,以垂直拉长符号并使其看起来更像 N。
Eg:
clear
clc
I=imread('N.jpg');
%// Line oriented at 90 degrees.
SE = strel('line',4,90);
I = imdilate(I,SE);
imshow(I)
r = ocr(I,'TextLayout','Word')
Image:
啊现在看起来像N...
并输出:
r =
ocrText with properties:
Text: 'N
'
CharacterBoundingBoxes: [3x4 double]
CharacterConfidences: [3x1 single]
Words: {'N'}
WordBoundingBoxes: [276 118 13 11]
WordConfidences: 0.8150
Yay!
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)