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};
![test3.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/202186/test3.png)
댓글 수: 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!