How to resolve the error "Index exceeds array bounds" in matlab?
1 次查看(过去 30 天)
显示 更早的评论
I need to extract the characters in the image.But,I get error.I have attached my code below.I need to extract all the characters in my image.Can anyone please help me in rectifying my error.
My error is:
Index exceeds array bounds.
Error in te (line 6)
word = results.Words{2};
% Load an image
I = imread('test3.png');
% Perform OCR
results = ocr(I);
% Display one of the recognized words
word = results.Words{2};
0 个评论
回答(1 个)
KSSV
2019-1-31
Please check the variable:
results.Words
It is empty in your case.....ocr didnot capture any words.......As the variable is empty..you are getting an error.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!