Filter löschen
Filter löschen

help with matlab code

3 Ansichten (letzte 30 Tage)
Alma o.a
Alma o.a am 7 Feb. 2012
Bearbeitet: sixwwwwww am 13 Okt. 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?

Akzeptierte Antwort

Wayne King
Wayne King am 7 Feb. 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 Kommentar
Alma o.a
Alma o.a am 15 Feb. 2012
Thanks a lot wayne..That helped!!!!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Wayne King
Wayne King am 7 Feb. 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 Kommentar
Alma o.a
Alma o.a am 7 Feb. 2012
hi wayne
i need to find the standard deviation of horizontal and vertical coefficients.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Discrete Multiresolution Analysis finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by