frit_nla.m

来自「脊波工具和相关实验以及有关实验数据」· M 代码 · 共 56 行

M
56
字号
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 + =
减小字号Ctrl + -
显示快捷键?