How do I solve this error "Index exceeds matrix dimensions."
정보
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
이전 댓글 표시
Hello,
I am having issues with a code I got via this link https://www.mathworks.com/matlabcentral/fileexchange/38200-fast-non-local-mean-image-denoising-implementation.
Corrections where made on the codes via the comments but I still have errors when I made the suggested corrections and applied the code in my proposed algorithm. The error reads below:
Index exceeds matrix dimensions.
Error in FAST_NLM_II (line 54)
SqDist =
Sd(PatchSizeHalf+WindowSizeHalf+1:Height+WindowSizeHalf+PatchSizeHalf,PatchSizeHalf+WindowSizeHalf+1:Width+WindowSizeHalf+PatchSizeHalf)...
% lower right corner
I will appreciate contributions.
Thank you
댓글 수: 0
답변 (1개)
Image Analyst
2018년 10월 20일
0 개 추천
Break it down into smaller parts
whos Sd [rows, columns] = size(Sd) index1 = PatchSizeHalf+WindowSizeHalf+1 index2 = Height+WindowSizeHalf+PatchSizeHalf index3 = PatchSizeHalf+WindowSizeHalf+1 index4 = Width+WindowSizeHalf+PatchSizeHalf
Now, is index2 bigger than rows, or index4 bigger than columns?
댓글 수: 2
Chidiebere Ike
2018년 10월 20일
편집: Image Analyst
2018년 10월 20일
Image Analyst
2018년 10월 20일
Then I have no idea why it says an index is out of bounds. You'll have to dig further.
What arguments did you pass in to the function?
It's saying SqDist is an unknown function because line 54 did not execute and define it. I'm not sure how it made it down to line 64 unless line 54 was in an if block that didn't execute. This link should help with that http://blogs.mathworks.com/videos/2012/07/03/debugging-in-matlab/
이 질문은 마감되었습니다.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!