Denoising by Donoho algorithm

5 次查看(过去 30 天)
Hello I'm trying to apply Donoho formula on my noisy image to get the threshold value and apply it on details coefficients which i get it by using wavedec function please someone help me to get a results if some one have another idea for make my code useful please just tell me I'm waiting
clear all
I=imread('cameraman.tif');
n = prod( size(I) );
I=double(I);
Ib=I+25*randn(size(I));% add noise
[C,S] = wavedec2(Ib,2,'bior3.7');
DH = detcoef2('all',C,S,1);% extract details coefficient from level 1
delta = median( abs(DH) ) / 0.6745;
thr = delta * sqrt(2*log(n));
NC = wthcoef2('bior3.7',C,S,DH,thr,s) % i use the soft threshold
X = waverec2(C, S, 'bior3.7'); % how can i get my image after threshold
figure(2)
imagesc(X);axis off;colormap(gray)

采纳的回答

Wayne King
Wayne King 2013-6-15
编辑:Wayne King 2013-6-15
You want to use the thresholded coefficients in the reconstruction. You also made a couple other errors in your code.
I = imread('cameraman.tif');
n = prod( size(I) );
I = double(I);
Ib = I+25*randn(size(I));% add noise
[C,S] = wavedec2(Ib,2,'bior3.7');
DH = detcoef2('all',C,S,1);% extract details coefficient from level 1
DH = DH(:);
delta = median( abs(DH) ) / 0.6745;
thr = delta * sqrt(2*log(n));
NC = wthcoef2('t',C,S,1,thr,'s'); % i use the soft threshold
X = waverec2(NC, S, 'bior3.7');
figure;
imagesc(Ib); title('Noisy Image'); colormap gray;
figure;
imagesc(X); title('Denoised 1st level coeffs'); colormap gray;
  8 个评论
Walter Roberson
Walter Roberson 2013-6-22
NC = wthcoef2('t',C,S,N,T,SORH) returns the detail coefficients obtained from the wavelet decomposition structure [C,S] by soft (if SORH ='s') or hard (if SORH ='h') thresholding (see wthresh for more information) defined in vectors N and T. N contains the detail levels to be thresholded and T the corresponding thresholds which are applied in the three detail orientations. N and T must be of the same length.
Soum
Soum 2013-6-25
Thanks Mr.Walter Yes I've read this http://www.mathworks.com/help/wavelet/ref/wthcoef2.html but my Problem is why we put the t ???? t is a literal string but what does it mean ?

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Denoising and Compression 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by