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

1 visualizzazione (ultimi 30 giorni)
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

Risposte (2)

Image Analyst
Image Analyst il 8 Dic 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 Commenti

Accedi per commentare.


Walter Roberson
Walter Roberson il 17 Mag 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.

Categorie

Scopri di più su Denoising and Compression in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by