1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
| figure;
y=imread ('lena.gif'); % image originale
imshow(y);
title('Image originale');
[m,n]=size(y);
clf
ii=sqrt(-1);
%n=length(y)-1;
pi=3.14;
p=fix(log(n)/log(2));
dx=1/n;
t=0:dx:1;
x=-1:dx:1;
%x=-4:dx:4;
%
% calcul de l'ondelette
a0=0.5;
%a0=1/2;
a0=a0^(1/2);
p=2*p;
W=zeros(p,n+1);
%for i=p-1:-1:0
for e=1:m
for i=0:p-1
% disp('echelle')
a=a0^i;
xx=x/a;
%g=2*pi*((1-2*pi*xx.^2).*exp(-pi*xx.^2))./sqrt(a);
%plot(x,g),title('ondelette chapeau mexicain')
g=exp(-xx.^2/2).*exp(ii*5*xx)./sqrt(a);
plot(x,real(g)),title('ondelette de Morlet-partie reelle ')
% disp('appuyer sur une touche pour continuer')
% pause
%
% calcul des coefficients d'ondelettes a l'echelle a
%
wa=conv(y(e,:),g);
W(i+1,1:n)=abs(wa(n+1:2*n));
end
end |
Partager