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

2 views (last 30 days)
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
  1 Comment
Walter Roberson
Walter Roberson on 28 Apr 2012
Please show the error traceback.
Also please show class(x) after the imread. Not double precision, right, whereas your x = rand() is initializing to double precision. Consider whether you should use im2double(x)

Sign in to comment.

Accepted Answer

Wayne King
Wayne King on 28 Apr 2012
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.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!