from
BlockShrink denoising
by Dengwen Zhou
BlockShrink code package
|
| SubbandThresholding(subb)
|
function t_subb = SubbandThresholding(subb)
% Threshold the noisy subband according to BlockShrink rule
%
% subb: inputted noisy subband
% t_subb: outputted thresholded subband
%
% Author: Zhou Dengwen
% zdw@ncepu.edu.cn
% Department of Computer Science & Technology
% North China Electric Power University(Beijing)(NCEPU)
%
% Reference(s):
% Zhou Dengwen and Shen Xiaoliu, "Image denoising using block
% thresholding," in Proc. 2008 congress on image and signal
% processing,Sanya, Hainan, ChinaMay 2008, pp. 335C338.
%
% Last time modified: Jun. 10, 2009
%
% Read the size of the coef. matrix
[nRow,nCol] = size(subb);
% Estimate the block size and threshold of the subband
[LB,thres] = Parameters(subb);
LB = round(LB);
% Threshold the coef. matrix
t_subb = zeros(nRow,nCol);
for i = 1:nRow/LB
for j = 1:nCol/LB
b1 = (i-1)*LB; b2 = (j-1)*LB;
bm = subb(b1+1:b1+LB,b2+1:b2+LB);
Sb = sum(bm(:).^2);
factor = max(1-thres/Sb,0);
t_subb(b1+1:b1+LB,b2+1:b2+LB) = factor*bm;
end
end
|
|
Contact us at files@mathworks.com