Error using ISWT2 " Index exceeds matrix dimensions. Error in iswt2 (line 127) , tmp{j} = reconsLOC(a(:,:,j ),h(:,:,j,:),v(:,:,j,:),d(:,: ,j,:));"
1 view (last 30 days)
Show older comments
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
0 Comments
Answers (2)
Image Analyst
on 8 Dec 2016
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 Comments
Walter Roberson
on 17 May 2017
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.
0 Comments
See Also
Categories
Find more on Denoising and Compression in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!