📄 drpdrawfig14.m
字号:
function dRPDrawFig14(OpenNewWindow,HaveTitle,LoadData)
%DrawFig 14: %build a best basis for this image
if nargin<3
LoadData=0;
end
if nargin<2
HaveTitle=1;
end
if nargin<1
OpenNewWindow=1;
end
if OpenNewWindow
figure
end
LoadData=0;
% build several types of Bases
D = [3,3];
btree1 = BuildRPBasisTree2(D,'Diadic1',[3]);
btree2 = BuildRPBasisTree2(D,'Vertical',3);
btree3 = BuildRPBasisTree2(D,'FIO',[1]);
btree4 = BuildRPBasisTree2(D,'Congruent',D);
noBases = 4;
plotDim = [2 2];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% IMAGE 1: concentrated in angular (oriented texture)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%im1 = readImage
im1 = imread('linesTexture.tif');
im=double(im1(1:64,190:190+63));
im = im ./max(im(:));
img0 = im - mean(mean(im));
RPFTGlobal= fft2_rp(img0);
RPFTGlobalShow = RPFTGlobal([2:size(RPFTGlobal,1)/2+1,size(RPFTGlobal,1)/2+1:size(RPFTGlobal,1)],:);
FFTGlobal = fftshift(fft2(im));
FFTGlobalShow = FFTGlobal([2:size(FFTGlobal,1)/2+1,size(FFTGlobal,1)/2+1:size(FFTGlobal,1)],:);
Entropy = 'N(eps)';
par = 1.5;
% build a best basis for this image
RPPkt = CalcRPPktTable(RPFTGlobal,D,'Sine');
RPtree = CalcRPStatTree(RPPkt,D,Entropy,par);
bb = BestRPBasis(RPtree,D);
%s1 = figure;
subplot(1,2,1)
AutoImageInv(abs(RPFTGlobalShow));
Polrax = axis; hold on;
PlotRPPartition(bb,'r',Polrax,D);
% calculate statistics
coef = FPT2_RPkt(bb,img0,D);
e = CalcEntropy(coef,Entropy,par)
%title(['N(' num2str(par) ') = ' num2str(e)]);
if HaveTitle
title(['Entropy = ' num2str(e)]);
end
set(gca,'XTick',[]);
set(gca,'YTick',[]);
% show the fft domain with the best bases
%figure;
subplot(1,2,2)
AutoImageInv(log(1+abs(FFTGlobalShow)));
Polrax = axis; hold on;
PlotRectoPolarRPPartition(bb,'r',Polrax,D);
if HaveTitle
title(['Entropy = ' num2str(e)]);
end
set(gca,'XTick',[]);
set(gca,'YTick',[]);
colormap(hot)%% 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 + -