function imden=den2d_TI(Image,qmf,scale,type,Sigma,thd) % Term-by-term image denoising in the TI-wavelet domain. % % Input % Image Input image. % qmf QMF filter. % scale Coarsest decomposition scale. % type Hard or soft thresholding ('H' (default) 'S'). % Sigma Noise std (default, estimated by MAD). % thd Threshold (default, 4 at finest scale and 3 at all other scales). % % Output % imden Denoised image. % if (exist('Image','var')~=1), error('Provide input image'); end; [M,N]=size(Image); if (exist('scale','var')~=1), scale=floor(log2(min(M,N)))-3; end; if (exist('qmf','var')~=1), qmf=MakeONFilter('Symmlet',6); end; if (exist('type','var')~=1), type='H'; end; if (~strcmp(type,'S') & ~strcmp(type,'H')), error('Only hard or soft thresholding handled.'); end; J=nextpow2(min(M,N)); [ll,wc,L] = mrdwt(Image,qmf,J-scale); if (exist('Sigma','var')~=1), % To estimate the WGN standard deviation using the MAD. HH = wc(:,2*N+1:3*N); HH_reshp = reshape(HH, M*N, 1); Sigma = std(HH_reshp); end if ~exist('thd','var') thd=3*ones(J-scale,1)*Sigma; thd(1)=4*Sigma; elseif isscalar(thd) thd=thd*ones(J-scale,1); end for i = 1:J-scale HH = wc(:,(i-1)*3*N+2*N+1:(i-1)*3*N+3*N); if(strcmp(type,'S')) Thr_wc_Noisy = SoftThresh(HH,thd(i)); else Thr_wc_Noisy = HardThresh(HH,thd(i)); end; wc(:,(i-1)*3*N+2*N+1:(i-1)*3*N+3*N) = Thr_wc_Noisy; HL = wc(:,(i-1)*3*N+N+1:(i-1)*3*N+2*N); if(strcmp(type,'S')) Thr_wc_Noisy = SoftThresh(HL,thd(i)); else Thr_wc_Noisy = HardThresh(HL,thd(i)); end; wc(:,(i-1)*3*N+N+1:(i-1)*3*N+2*N) = Thr_wc_Noisy; LH = wc(:,(i-1)*3*N+1:(i-1)*3*N+N); if(strcmp(type,'S')) Thr_wc_Noisy = SoftThresh(LH,thd(i)); else Thr_wc_Noisy = HardThresh(LH,thd(i)); end; wc(:,(i-1)*3*N+1:(i-1)*3*N+N) = Thr_wc_Noisy; end imden = mirdwt(ll,wc,qmf,J-scale); % % Part of DBlockToolbox Version:100 % Written by: Jalal Fadili, GREYC CNRS ENSICAEN % Christophe Chesneau, LMNO University of Caen % Jean-Luc Starck, CEA-CNRS % Created June 2008 % This material is distributed under CeCiLL licence. % E-mail: Jalal.Fadili@greyc.ensicaen.fr %