How to make a loop to generate wavelet coefficients of multiple images and save them?

Antworten (2)

Wayne King
Wayne King am 19 Mai 2013
The wavelet coefficients are the output of wavedec2(). You can can simply save them in a matrix if the images are all the same size, or in a cell array if the images are not the same size

1 Kommentar

seri
seri am 19 Mai 2013
Bearbeitet: seri am 19 Mai 2013
i am not clear how to enter this info in loop
srcfiles=dir('C:\Users\Seri\Desktop\*.jpg');
for i=1: length (srcfiles)
filename=strcat('C:\Users\Seri\Desktop\',srcfiles(i).name);
I = imread(filename);
[c,s]=wavedec2(srcfiles,2,'db1');
sizesrcfiles = size (srcfiles)
size c=size(c)
val_s=s
ca2=appcoef2(c,s,'db1',2);
sizeca2=size(ca2)
ca1=appcoef(c,s,'db1',1);
sizeca1 = size(ca1)
end ??? Error using ==> double Conversion to double from struct is not possible.
Error in ==> dwt2 at 88 x = double(x);
Error in ==> wavedec2 at 66 [x,h,v,d] = dwt2(x,Lo_D,Hi_D); % decomposition this is showing this error

Melden Sie sich an, um zu kommentieren.

Why are you attempting to perform the wavelet transform on scrfiles?
I = imread(filename);
[c,s]=wavedec2(srcfiles,2,'db1');
You should be doing the wavelet transform on the image, I.

Gefragt:

am 19 Mai 2013

Community Treasure Hunt

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

Start Hunting!

Translated by