At what level to threshold when using multilevel wavelet transform ?

1 visualizzazione (ultimi 30 giorni)
  1. I = imread('cameraman.tif');
  2. n = prod( size(I) );
  3. I = double(I);
  4. Ib = I+25*randn(size(I));% add noise
  5. [C,S] = wavedec2(Ib,2,'bior3.7');
  6. DH = detcoef2('all',C,S,1);% extract details coefficient from level 1
  7. DH = DH(:);
  8. delta = median( abs(DH) ) / 0.6745;
  9. thr = delta * sqrt(2*log(n));
  10. NC = wthcoef2('t',C,S,1,thr,'s'); % i use the soft threshold
  11. X = waverec2(NC, S, 'bior3.7');
  12. figure;
  13. imagesc(Ib); title('Noisy Image'); colormap gray;
  14. figure;
  15. imagesc(X); title('Denoised 1st level coeffs'); colormap gray;
At line 10 when thresholding they use level 1,
but in line 5 while decomposing they use level 2.
Can anyone please explain why it is not thresholded at level 2?
Would that matter if we decompose at higher levels and still threshold at level 1?
I tried to run the example with level 1,2 in wavedec2 and used wthcoef2 at level 1 and level 2.
After reconstruction, results were better when thresholded at level 1. But decomposing at level 2 does not cause any effect if we thresold at level 1 as used in the above code.
Please help me understand better.

Risposte (0)

Categorie

Scopri di più su Wavelet Toolbox in Help Center e File Exchange

Tag

Prodotti


Release

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by