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

답변 (2개)

Wayne King
Wayne King 2013년 5월 19일
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

seri
seri 2013년 5월 19일
편집: seri 2013년 5월 19일
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

댓글을 달려면 로그인하십시오.

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.

카테고리

질문:

2013년 5월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by