📄 frit_nla.m
字号:
function imrec = frit_nla(im, wname, ncoefs, plotflag)% FRIT_NLA FRIT non-linear approximation%% imrec = frit_nla(im, wname, ncoefs, [plotflag])%% Input% im: Input image% wname: wavelet name used in the FRIT% ncoefs: vector contains the numbers of most significant coefs%% Output% imrec: cell vector contain the images reconstructed by NLA% maximum radius of directions that used by wavelet in the FRITmaxR = 3;% Take the FRIT[r, s, m] = fritm(im, wname, maxR);% [r, s, m] = frito(im, wname);% Sort rsort = sort(abs(r(:)));rsort = flipud(rsort);lk = length(ncoefs);imrec = cell(1, lk);% Non-linear or N-best terms approximationfor k = 1:lk rn = r .* (abs(r) > rsort(ncoefs(k))); imrec{k} = ifritm(rn, s, m, wname, maxR); % imrec = ifrito(rn, s, m, wname); endif exist('plotflag', 'var') clf; % range = [-.25, 1.25]; range = [0, 1]; colormap('gray'); for k = 1:lk % subplot(floor(sqrt(lk)), floor(sqrt(lk)), k); subplot(1, lk, k); imagesc(imrec{k}, range); axis image, axis off, title(sprintf('%d coefficients\n(SNR = %0.2f dB)', ... ncoefs(k), SNR(im, imrec{k})), 'FontSize', 9); % title(sprintf('First %d coefficients', ncoefs(k)), 'FontSize', 10); endend
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -