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

📄 compare_compress.m

📁 为stanford大学donoho教授所编写的redgit变换源代码。是用c编写的
💻 M
字号:
function compare_compress(im, ratio)
% Compare compression performance using FRITO and WAVEDEC2
%	compare_compress(im, ratio)
% 
% IM is the input image of size 257 by 257.  RATIO is the compression
% ratio, between 0 and 1 (O for no compression, typically 0.99)

% Wavelet parameters
wname = 'coif2';
nlevels = 8;

% Compression using FRITO
[r, l, m] = frito(im, wname);
rc = compress(r, ratio);
rim = ifrito(rc, l, m, wname);

% Compression using WAVEDEC2
im1 = im(1:end-1,1:end-1);	% dyadic length
[w, wl] = wavedec2(im1, nlevels, wname);
wc = compress(w, ratio);
wim = waverec2(wc, wl, wname);

% Display
subplot(1,2,1), imagesc(rim, [0, 1]), axis square,
title(sprintf('Compressed image using FRIT\n(Ratio = %.1f %%; SNR = %.2f dB)', ...	      
              100*ratio, SNR(im, rim)), 'FontSize', 12);

subplot(1,2,2), imagesc(wim, [0, 1]), axis square,
title(sprintf('Compressed image using WAVEDEC2\n(Ratio = %.1f %%; SNR = %.2f dB)', ...
              100*ratio, SNR(im1, wim)), 'FontSize', 12);

colormap('default');

⌨️ 快捷键说明

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