drpdrawfig08.m

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

M
98
字号

function dRPDrawFig08(OpenNewWindow,HaveTitle,LoadData)

%DrawFig 8:  basis functions derivd from tiles of different widths


if nargin<3
    LoadData=0;
end

if nargin<2
    HaveTitle=1;
end

if nargin<1
    OpenNewWindow=1;
end

if OpenNewWindow
    figure
end


LoadData=0;


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% basis functions derivd from tiles of different widths
%

% create a btree that has a tile with "height" 1/4-1/2
% and varying width....

% for the different btrees, plot representative basis functions by
% sampling te dc coefficient of the tile in the DCT domain (coef domain) for
% an image that has energy only in the tile located at rows 34-49 and starting at col 65
% (fill the whole tile with 1 in the RPFT domain)

D = [5,5];

for d2 = 5:-1:2
   btree = BuildRPBasisTree2(D,'Congruent',[2,d2]);
   RPFT = zeros(128,128);
   RPFT(34:49,65:(65+128/(2^d2)-1))=1;
   im = ifft2_rp(RPFT);
   
   %show the tile
   subplot(2,4,6-d2);
   RPFTGlobal = RPFT;
   RPFTGlobalShow = RPFTGlobal([2:size(RPFTGlobal,1)/2+1,size(RPFTGlobal,1)/2+1:size(RPFTGlobal,1)],:);
   AutoImageInv(abs(RPFTGlobalShow));
   Polrax = axis; hold on;
   PlotRPPartition(btree,'r',Polrax,D); 
   axis square
   set (gca,'XTick',[]);
   set (gca,'YTick',[]);
   if HaveTitle
       title(['D2=' int2str(d2)]);
   end
   
   % show the basis function
   subplot(2,4,4+6-d2);
   coef = FPT2_RPkt(btree,im,D);
   % leave only coef(33,33) == the DC of the tile
   dcc = coef(33,33);
   coef = zeros(size(coef));
   coef(33,33) = dcc;
   im  = IPT2_RPkt(btree,coef,D);
   im_sc = scale_im(im);
   imagesc(abs(1-im_sc))
   if HaveTitle
       title(['D2=' int2str(d2)]);
   end
   axis square
   set(gca,'XTick',[]);
   set(gca,'YTick',[]);
   p = get(gca,'Position');
   set(gca,'Position',p+[0 0.2 0 0])
end;




%% 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 + -
显示快捷键?