📄 fdct_usfft_demo_recon.m
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -