Problems in recognising text with OCR from clear logical array
3 ビュー (過去 30 日間)
古いコメントを表示
Hello, I have a clean image containing only some lines of text. It is the result of exporting a logical array of pixels.
Using OCR command, TEXT property results to be empty. I tried with jpg and png format, as in the attached figures.
The code I am using is just
xxx=imread(name_file);
ocr(xxx)
ans =
ocrText with properties:
Text: ''
CharacterBoundingBoxes: [0×4 double]
CharacterConfidences: [0×1 single]
Words: {0×1 cell}
WordBoundingBoxes: [0×4 double]
WordConfidences: [0×1 single]
TextLines: {0×1 cell}
TextLineBoundingBoxes: [0×4 double]
TextLineConfidences: [0×1 single]
Thank you very much
0 件のコメント
採用された回答
Jonas
2024 年 1 月 30 日
i guess it is just a mishandling of the automatic mode recognition:
I=imread('testOCR.png');
I=rgb2gray(I);
imshow(I);
c=ocr(I,"LayoutAnalysis","block");
c.Words
since this contains errors, you could try to blur out the edges, maybe this helps :D
J=imgaussfilt(I,4);
J=imsharpen(J,'Radius',4,'Amount',4);
imshow(J);
c=ocr(J,"LayoutAnalysis","block");
c.Words
this is better, but still not without errors (3 instead of 9 in the first line). maybe this can help you do change your image in such a way, that it can work
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Text Analytics Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!