⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wave2_nla.m

📁 脊波工具和相关实验以及有关实验数据
💻 M
字号:
function imrec = wave2_nla(im, wname, nlev, ncoefs, plotflag)% WAVE2_NLA  Non-linear approximation using 2-D wavelet transform%%	imrec = wave2_nla(im, wname, nlev, ncoefs, [plotflag])edge = 'per';st = dwtmode('status', 'nodisp');if ~strcmp(st, edge)    dwtmode(edge);end% Wavelet transform[c, s] = wavedec2(im, nlev, wname);% Sort the coefficients in descending order of the magnitudecsort = sort(abs(c(:)));csort = flipud(csort);lk = length(ncoefs);imrec = cell(1, lk);% Non-linear or N-best terms approximationfor k = 1:lk    cn = c .* (abs(c) >= csort(ncoefs(k)));            % Reconstruct with the most significant coefficients    imrec{k} = waverec2(cn, s, wname);endif exist('plotflag', 'var')        clf;        range = [-0.25, 1.25];    % range = [-.5, 1.25];      colormap('gray');        ssize = round(sqrt(lk));    for k = 1:lk	% subplot(ssize, ssize, k);	subplot(1, lk, k);	imagesc(imrec{k}, range);	axis image,	axis off,	set(gca, 'FontSize', 8);        	title(sprintf('%d coefficients\n(SNR =  %.2f dB)', ...		      ncoefs(k), SNR(im, imrec{k})), 'FontSize', 9);	% imr = im - imrec;	% subplot(2, lk, lk + k);	% imagesc(imr, range);	% axis image	% set(gca, 'FontSize', 8);    	% title('Residue', 'FontSize', 10);    endend

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -