Effacer les filtres
Effacer les filtres

help with matlab code

3 vues (au cours des 30 derniers jours)
Alma o.a
Alma o.a le 7 Fév 2012
Modifié(e) : sixwwwwww le 13 Oct 2013
hi everyone i'm very much new to matlab and need help. I have a 512*512 grayscale image. I need to find the second level dwt coefficients first and then need to find the standard deviation of the second level mid frequency coefficients.
i=imread('file.extension');
[c s]=wavedec2(i,2,'haar');
k=std(c);
is this code correct?

Réponse acceptée

Wayne King
Wayne King le 7 Fév 2012
Then from the line I gave you:
[H,V,D] = detcoef2('all',C,S,2);
std(reshape(V,size(V,1)*size(V,2),1))
std(reshape(H,size(H,1)*size(H,2),1))
  1 commentaire
Alma o.a
Alma o.a le 15 Fév 2012
Thanks a lot wayne..That helped!!!!

Connectez-vous pour commenter.

Plus de réponses (1)

Wayne King
Wayne King le 7 Fév 2012
Hi Alma, You don't want std(c) because that gives you the standard deviation of all the wavelet and approximation coefficients.
You want:
x = randn(16,16);
[C,S] = wavedec2(x,2,'haar');
[H,V,D] = detcoef2('all',C,S,2);
Now you have to be clear on which wavelet coefficients you want the standard deviation of. I'm not clear on what you mean by "second level mid frequency" Do you mean highpass filtering followed by lowpass, or lowpass followed by highpass?
The diagonal details are obtained by highpass filtering the rows (followed by downsampling) and then highpass filtering the columns followed by downsampling.
The vertical details are obtained by highpass filtering the rows followed by lowpass filtering the columns. (with downsampling)
The horizontal details are obtained by lowpass filtering the rows and highpass filtering the columns (with downsampling)
  1 commentaire
Alma o.a
Alma o.a le 7 Fév 2012
hi wayne
i need to find the standard deviation of horizontal and vertical coefficients.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Discrete Multiresolution Analysis dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by