How do I import a table containing numbers in a picture with OCR?

조회 수: 10 (최근 30일)
Mattia Tosi
Mattia Tosi 2020년 1월 29일
댓글: Mattia Tosi 2020년 2월 4일
I have a picture of a table with numeric data in it. Like this:
example.JPG
How do I import the values with ocr? Is there a better method?
I tried to use ocr, but it's not working properly.
Thank you
  댓글 수: 3
Mattia Tosi
Mattia Tosi 2020년 1월 30일
I will try, but sometimes it's a mix of characters and numbers. How can I capture both? It looks like ocr is not really effective...
Mohammad Sami
Mohammad Sami 2020년 1월 30일
Another option, that might improve the ocr accuracy sometimes is to imresize the input image.

댓글을 달려면 로그인하십시오.

채택된 답변

Mohammad Sami
Mohammad Sami 2020년 1월 30일
Try resizing the image. It would hopefully improve the accuracy.
a = imread('image.jpeg');
a = imresize(a,2);
txt = ocr(a,'CharacterSet','0123456789.');
Iocr = insertObjectAnnotation(a, 'rectangle', ...
txt.WordBoundingBoxes, ...
txt.WordConfidences);
for i = 1:length(txt.Words)
Iocr = insertText(Iocr,txt.WordBoundingBoxes(i,1:2),txt.Words{i},'AnchorPoint','Center');
end
figure; imshow(Iocr);
  댓글 수: 4
Mattia Tosi
Mattia Tosi 2020년 2월 4일
It doesn't work direcly with the table I have, but playing with all the parameters you mentioned the result is improving.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by