Thresholds for wavelet 2-D using Birgé-Massart strategy
[THR,NKEEP] = wdcbm2(C,S,ALPHA,M)
[THR,NKEEP] = wdcbm2(C,S,ALPHA,M) returns
THR and numbers of coefficients
to be kept
NKEEP, for de-noising or compression.
obtained using a wavelet coefficients selection rule based on the
[C,S] is the wavelet decomposition structure
of the image to be de-noised or compressed, at level
M must be real
numbers greater than 1.
THR is a matrix 3 by
the level dependent thresholds in the three orientations: horizontal,
diagonal, and vertical, for level i.
NKEEP is a vector of length
the number of coefficients to be kept at level i.
j+1 (and coarser levels),
everything is kept.
For level i from 1 to
j, the ni largest
coefficients are kept with ni =
ALPHA = 1.5 for compression and
3 for de-noising.
A default value for
the length of the coarsest approximation coefficients, since the previous
formula leads for i = j+1, to nj+1 =
Recommended values for
M are from
wdcbm2(C,S,ALPHA) is equivalent to
% Load original image. load detfingr; nbc = size(map,1); % Perform a wavelet decomposition of the image % at level 3 using sym4. wname = 'sym4'; lev = 3; [c,s] = wavedec2(X,lev,wname); % Use wdcbm2 for selecting level dependent thresholds % for image compression using the adviced parameters. alpha = 1.5; m = 2.7*prod(s(1,:)); [thr,nkeep] = wdcbm2(c,s,alpha,m) thr = 21.4814 46.8354 40.7907 21.4814 46.8354 40.7907 21.4814 46.8354 40.7907 nkeep = 624 961 1765 % Use wdencmp for compressing the image using the above % thresholds with hard thresholding. [xd,cxd,sxd,perf0,perfl2] = ... wdencmp('lvd',c,s,wname,lev,thr,'h'); % Plot original and compressed images. colormap(pink(nbc)); subplot(221), image(wcodemat(X,nbc)), title('Original image') subplot(222), image(wcodemat(xd,nbc)), title('Compressed image') xlab1 = ['2-norm rec.: ',num2str(perfl2)]; xlab2 = [' % -- zero cfs: ',num2str(perf0), ' %']; xlabel([xlab1 xlab2]);
Birgé, L.; P. Massart (1997). “From model selection to adaptive estimation,” in D. Pollard (ed), Festchrift for L. Le Cam, Springer, pp. 55–88.