📄 drdrawfig31.m
字号:
function dRDrawFig31(OpenNewWindow,HaveTitle,LoadData)
%Test ORT on BandPassed classical Half Dome with n=256; layout of coeff.,plot of rearrenged coeff. and errors, recons. from 100, 50 and 16 coeff.
% if you don't want to process it, set LoadData=1
if nargin<3
LoadData=0;
end
if nargin<2
HaveTitle=1;
end
if nargin<1
OpenNewWindow=1;
end
if OpenNewWindow
figure
end
%Test ORT on BandPassed classical Half Dome with n=256; layout of coeff.,plot of rearrenged coeff. and errors, recons. from 100, 50 and 16 coeff.
%n=256; Original, takes a lot of time!!
n=128;
if LoadData
load 'dRDrawFig24.mat' ansel
image = ansel;
else
image = MakeHalfDomeImage(n,pi/8,1.3,3);
end
% 1. Make an image
%image = MakeHalfDomeImage(n,pi/8,1.3,3);
%1.2Bandpass it
domain = (-(n/2)):(n/2-1);
[x,y] = meshgrid(domain,domain);
%
r = sqrt(x.^2 + y.^2);
j=5;
sr = r ./ (2^j);
%
Window=BandWindow(sr,3,'bandpass');
Fimage = fftshift(fft2(image));
NewFimage = Fimage .* Window;
NewImg= abs(ifft2(fftshift(NewFimage)));
% 2. Take FRT
theta = FastOrthoRidgeletTransform(NewImg);
rearr = reverse(sort(abs(theta(:))))./n;
% Show Partial Reconstruction
ntheta16 = theta .* (abs(theta)./n >= rearr(16));
ntheta50 = theta .* (abs(theta)./n >= rearr(50));
ntheta100 = theta .* (abs(theta)./n >= rearr(100));
if LoadData
load 'dRDrawFig31.mat'
else
imagek16 = abs(Inv_FastOrthoRidgeletTrans(ntheta16));
imagek50 = abs(Inv_FastOrthoRidgeletTrans(ntheta50));
imagek100 = abs(Inv_FastOrthoRidgeletTrans(ntheta100));
end
subplot(2,2,1); imagesc(NewImg); axis('square');set (gca,'XTick',[]);
set (gca,'YTick',[]);
if HaveTitle
title('BandPassed Half Dome')
end
subplot(2,2,2);
imagesc(imagek16); axis('square'); set (gca,'XTick',[]);
set (gca,'YTick',[]);
if HaveTitle
title('Reconstructed from 16 Coefficients');
end
subplot(2,2,3)
imagesc(imagek50); axis('square'); colormap(1-hot);
if HaveTitle
title('Reconstructed from 50 Coefficients');
end
set (gca,'XTick',[]);
set (gca,'YTick',[]);
subplot(2,2,4);
imagesc(imagek100); axis('square');
if HaveTitle
title('Reconstructed from 100 Coefficients');
end
set (gca,'XTick',[]);
set (gca,'YTick',[]);
% Copyright (c) 2002 Ana Georgina Flesia%% Part of BeamLab Version:200% Built:Friday,23-Aug-2002 00:00:00% This is Copyrighted Material% For Copying permissions see COPYING.m% Comments? e-mail beamlab@stat.stanford.edu%%% Part of BeamLab Version:200% Built:Saturday,14-Sep-2002 00:00:00% This is Copyrighted Material% For Copying permissions see COPYING.m% Comments? e-mail beamlab@stat.stanford.edu%
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -