Filter löschen
Filter löschen

How to find a specific word after running the OCR function

4 Ansichten (letzte 30 Tage)
tiwwexx
tiwwexx am 31 Mai 2019
Beantwortet: tiwwexx am 9 Jul. 2019
I'm working on a project where I use the OCR function to analize a picture. I want to find a specific word in the picture, for instance find only the word "and" in the picture. I tried to do this using
results = ocr(myimage, 'CharacterSet', '"and"');
confidence_mark = results.CharacterConfidences > 0.80;
But this didn't work. Instead the 'CharacterSet' made the program find the individual characters "a", "n", and "d" but i wanted to only find a string of these three characters "and". Thank you guys so much for helping!

Akzeptierte Antwort

tiwwexx
tiwwexx am 9 Jul. 2019
In case anyone sees this string I thought of a way around this. Use the code
results = ocr(myimage, 'CharacterSet', '"and"');
Then just look throught the results.Words sting for the word "and" so you get out a string that only has what the ocr program recognized as the word "and". Then do
results.WordConfidence('newWordList') > significance_value & strcmp(results.Words,'and');
and this should give you all the instances of the word "and"

Weitere Antworten (0)

Tags

Produkte


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by