fdct_usfft_demo_recon.m

来自「This directory includes matlab interface」· M 代码 · 共 45 行

M
45 行
字号
disp(' ');disp('fdct_usfft_demo_recon.m -- Partial curvelet reconstruction.');disp(' ');disp('We apply the curvelet transform to an image, select a percentage');disp('of the largest coefficients (in modulus), and set the others');disp('to zero. We then take the inverse curvelet transform to obtain');disp('a partial reconstruction of the original image.');disp(' ');% fdct_usfft_demo_recon.m -- Partial curvelet reconstruction% Set the percentage of coefficients used in the partial reconstruction pctg = 0.1;% Load imageX = imread('Lena.jpg'); %load Lena; X = Lena; clear Lena;% Forward curvelet transformdisp('Take curvelet transform: fdct_usfft');tic; C = fdct_usfft(double(X),0); toc;% Get threshold valuecfs =[];for s=1:length(C)  for w=1:length(C{s})    cfs = [cfs; abs(C{s}{w}(:))];  endendcfs = sort(cfs); cfs = cfs(end:-1:1);nb = round(pctg*length(cfs));cutoff = cfs(nb);% Set small coefficients to zerofor s=1:length(C)  for w=1:length(C{s})    C{s}{w} = C{s}{w} .* (abs(C{s}{w})>cutoff);  endenddisp('Take inverse curvelet transform: ifdct_usfft');tic; Y = ifdct_usfft(C,0); toc;subplot(1,2,1); colormap gray; imagesc(real(X)); axis('image'); title('original image');subplot(1,2,2); colormap gray; imagesc(real(Y)); axis('image'); title('partial reconstruction');

⌨️ 快捷键说明

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