How to find a specific word after running the OCR function

1 次查看(过去 30 天)
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!

采纳的回答

tiwwexx
tiwwexx 2019-7-9
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"

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Characters and Strings 的更多信息

标签

产品


版本

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by