drdrawfig13.m

来自「beamlet变化的工具箱」· M 代码 · 共 117 行

M
117
字号

function dRDrawFig13(OpenNewWindow,HaveTitle,LoadData)

% 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
if LoadData
   load HalfDome2 
end

% Illustrate HalfDome FT in graymap


if LoadData
    img = HalfDome2;
    else
    img = MakeHalfDomeImage(128,30,pi/3,3);
end
	MaxDeep = 7;
%
	xgrid = linspace(-1,1,128);
	ygrid = linspace(-1,1,128);
%
	%figure
    subplot(1,2,1)
	Ghat = fft2(img);
	imagesc( xgrid,ygrid,sqrt(fftshift(abs(Ghat))));
	axis('square'); colormap(1-hot);
    if HaveTitle
       title(' 2-d FFT of HalfDome on sqrt scale')
    end

	%
	axcart = axis;
    set (gca,'XTick',[]);
    set (gca,'YTick',[]);
%	drawnow;
	%print -depsc RawFig13a.eps
%
	%figure
    subplot(1,2,2)
	imagesc(sqrt( fftshift(abs(Ghat))))
	axis('square'); colormap(1-hot)
	%
    if HaveTitle
       title('2-d FFT of HalfDome (sqrt scale) and Ridgelet Tiling')
    end

	axcart = axis;
%	drawnow;
    hold on;

    
% Modified Code for Plotting Ridgelet Tiling

%
xmin = axcart(1); xmax = axcart(2);
ymin = axcart(3); ymax = axcart(4);
xcen = (xmax + xmin)/2;
ycen = (ymax + ymin)/2;
xscl = (xmax - xmin)/2;
yscl = (ymax - ymin)/2;

%
J=6;
for j=0:J,
	rj = 2^(-j);
	ij = (J-j);
	nij = 2^(ij)*2;
	for l=0:(nij-1),
		thetal = 2*pi*l ./ nij;
		poutx = rj * cos(thetal); pouty = rj * sin(thetal);
		pinx  = poutx/2; piny = pouty/2;
		ptx = [poutx pinx];  pty = [pouty piny];
 		pptx = xcen + (ptx) .* xscl;
 		ppty = ycen + (pty) .* yscl;		
		plot(pptx,ppty,'-k')
	end
    plotcircle_black(rj,axcart);
end
axis('square')

    set (gca,'XTick',[]);
    set (gca,'YTick',[]);%
%print -depsc RawFig13b.eps


% 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 + =
减小字号Ctrl + -
显示快捷键?