필터 지우기
필터 지우기

How can i fix the error of index out of bounds for an image

조회 수: 2 (최근 30일)
sakshi ahuja
sakshi ahuja 2016년 2월 8일
편집: sakshi ahuja 2016년 2월 15일
When i tried to decompose my 2D image of size 255*255 with the 1D wavelet having 1*111 coefficients then while running the code in my script following error displayed "Attempted to access img(:,143); index out of bounds because size(img)=[173,142]. Error in ==> decomposition at 15, s=[0;0;img(:,k);0;0];". What is wrong with this code. My code is attached with this.

채택된 답변

Guillaume
Guillaume 2016년 2월 8일
Assuming that you're running the exact code that you've attached, the error certainly shouldn't occur. I can also see two possibilities for it to happen:
  1. you've shadowed the imresize function with one of your own that does not work properly
  2. your pn.mat that is loaded after the image also contain a variable called img. As a rule, it's safer to load mat files into a structure. Try:
s = load('pn');
g0 = s.pn;
  댓글 수: 1
sakshi ahuja
sakshi ahuja 2016년 2월 15일
편집: sakshi ahuja 2016년 2월 15일
thanks for the help my initial problem is resolved but i am facing a problem with the wavelet pn which i am trying to upload. The decomposed results obtained are not the desired one.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Signal Analysis에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by