2016-08-31 5 views
0

Je souhaite afficher une ondelette de décomposition au niveau 3. alors peut-il m'aider à donner une fonction Matlab pour l'afficher?Comment afficher une ondelette de décomposition au niveau 3?

[cA cH cV cD]=dwt2(a,waveletname); 
out=[cA cH;cV cD]; 
figure;imshow(out,[]); 

Cela ne fonctionne que pour le premier niveau. effectivement, je veux la représentation du mode carré tels wavemenu dans Matlab. example of the view decomposition Je suis assez nouveau pour cela. merci.

Répondre

0

Vous devez utiliser la fonction wavedec2 (Image, numberOfLevels, 'wname') avec la quantité de niveaux dont vous avez besoin. Pour plus d'informations regarder http://www.mathworks.com/help/wavelet/ref/wavedec2.html

code par exemple avec DB1

clear all 
im = imread('cameraman.tif'); 
[c,s] = wavedec2(im,3,'db1'); 
A1 = appcoef2(c,s,'db1',1); 
[H1,V1,D1] = detcoef2('all',c,s,1); 
A2 = appcoef2(c,s,'db1',2); 
[H2,V2,D2] = detcoef2('all',c,s,2); 
A3 = appcoef2(c,s,'db1',3); 
[H3,V3,D3] = detcoef2('all',c,s,3); 

V1img = wcodemat(V1,255,'mat',1); 
H1img = wcodemat(H1,255,'mat',1); 
D1img = wcodemat(D1,255,'mat',1); 
A1img = wcodemat(A1,255,'mat',1); 

V2img = wcodemat(V2,255,'mat',1); 
H2img = wcodemat(H2,255,'mat',1); 
D2img = wcodemat(D2,255,'mat',1); 
A2img = wcodemat(A2,255,'mat',1); 

V3img = wcodemat(V3,255,'mat',1); 
H3img = wcodemat(H3,255,'mat',1); 
D3img = wcodemat(D3,255,'mat',1); 
A3img = wcodemat(A3,255,'mat',1); 

mat3 = [A3img,V3img;H3img,D3img]; 
mat2 = [mat3,V2img;H2img,D2img]; 
mat1 = [mat2,V1img;H1img,D1img]; 

imshow(uint8(mat1)) 

Le résultat final

enter image description here