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

10 vues (au cours des 30 derniers jours)
Mattia Tosi
Mattia Tosi le 29 Jan 2020
Commenté : Mattia Tosi le 4 Fév 2020
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 commentaires
Mattia Tosi
Mattia Tosi le 30 Jan 2020
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 le 30 Jan 2020
Another option, that might improve the ocr accuracy sometimes is to imresize the input image.

Connectez-vous pour commenter.

Réponse acceptée

Mohammad Sami
Mohammad Sami le 30 Jan 2020
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 commentaires
Mohammad Sami
Mohammad Sami le 31 Jan 2020
If you know the font that was used to produce your images. you can follow this tutorial
Mattia Tosi
Mattia Tosi le 4 Fév 2020
It doesn't work direcly with the table I have, but playing with all the parameters you mentioned the result is improving.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Convert Image Type dans Help Center et File Exchange

Produits


Version

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by