Error using ISWT2 " Index exceeds matrix dimensions. Error in iswt2 (line 127) , tmp{j} = reconsLOC(a(:,:,j ),h(:,:,j,​:),v(:,:,j​,:),d(:,: ,j,:));"

1 次查看(过去 30 天)
Hi I am trying to perform a simple inverse stationary wavelet transform using the code below but i get the following error
Index exceeds matrix dimensions.
Error in iswt2 (line 127), tmp{j} = reconsLOC(a(:,:,j),h(:,:,j,:),v(:,:,j,:),d(:,:,j,:));
Code
[A,H,V,D] = swt2(i,2,'sym4');
y = iswt2(A,H,V,D,'sym4'); % this function gives the error%
All the size of the coefficient is same as the input so how can index exceed the matrix dimension.
the size of i(input image) is 512x512 unit 16
size 0f A = 512x512x2 single
size of H = 512x512x2 single
size of D = 512x512x2 single
size of V = 512x512x2 single

回答(2 个)

Image Analyst
Image Analyst 2016-12-8
a,h,d,v are different from A,H,D,V since MATLAB is case sensitive. A,H,D,V are all 3D matrices according to you.
a(:,:,j),h(:,:,j,:),v(:,:,j,:),d(:,:,j,:) are a 3-D, 4-D, 4-D, and 4-D matrix. Plus if you specify an index other than that last one, you will not extract a 3-D matrix. For example h(:,:,j,:) is a 512x512x1xN 4-D matrix, NOT a 3-D matrix. You might need to use squeeze() on the 4-D matrices.
  6 个评论

请先登录,再进行评论。


Walter Roberson
Walter Roberson 2017-5-17
iswt2() is broken for reconstructing data that was originally grayscale and not of data type double. RGB non-double is okay, and grayscale double is okay, but not (for example) grayscale uint8, or grayscale single.

类别

Help CenterFile Exchange 中查找有关 Denoising and Compression 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by