MATLAB: Error- Subscript indices must either be real positive integers or logicals.

image processing

I have a code for dual tree wavelet transform
x = rand(64,64,3);
J = 3;
[Faf, Fsf] = FSfarras;
[af, sf] = dualfilt1;
w = dualtree3D(x, J, Faf, af);
y = idualtree3D(w, J, Fsf, sf);
err = x - y;
max(max(max(abs(err))))
for this i get the answer ,
but if i replace x by my image
x=imread('st.tif'), i get error,
please help

Best Answer

A couple things:
1.) Is this an RGB image? The 3-D wavelet transform is not suitable for an RGB image. The 3-D wavelet transform is intended for actual 3-D data. An RGB image is 2-D data and you should use a 2-D wavelet transform that accepts RGB image inputs, like the routines in the MathWorks' Wavelet Toolbox.
2.) Even if your data is suitable for the 3-D wavelet transform, what is the size of the third dimension? Professor Selesnick routines are not set up to handle dimensions that are not divisible by 2. So for example:
x = randn(64,64,63);
J = 3;
[Faf, Fsf] = FSfarras;
[af, sf] = dualfilt1;
w = dualtree3D(x, J, Faf, af);
will produce the exact error you see, but
x = randn(64,64,10);
will not.
Related Question