📄 fconvolute.asv
字号:
function Fconvolute(n)
global img img2 img3 xc yc graylevmax xc2 yc2 gabor1 gabor2 gabor3 gabor4 gabor5 gabor6 gabor7 gabor8 z1 z1x z1y ComponentPrint8 ComponentPrint8 ComponentPrint8 ComponentPrint4 ComponentPrint5 ComponentPrint6 ComponentPrint7 ComponentPrint8
global text1 text2 text3 push1 push2 push3 push4 push5 push6 push7 push8 push9 push10 push11 push12 push13
global push14 push15 push16 push17 push18 push19 push20 push21 push22 push23 push24 push25 push26 push27 push28 push29 push30 push31 push32
N=175;
num_disk=8;
[CroppedPrint]=cropping(xc2,yc2,img3);
[NormalizedPrint,vector]=sector_norm(CroppedPrint,0,1);
switch n
case 1,
z2=gabor1;
z1=NormalizedPrint;
z1x=size(z1,1);
z1y=size(z1,2);
z2x=size(z2,1);
z2y=size(z2,2);
ComponentPrint=real(ifft2(fft2(z1,z1x+z2x-1,z1y+z2y-1).*fft2(z2,z1x+z2x-1,z1y+z2y-1)));
px=((z2x-1)+mod((z2x-1),2))/2;
py=((z2y-1)+mod((z2y-1),2))/2;
ComponentPrint1=ComponentPrint(px+1:px+z1x,py+1:py+z1y);
[disk,vector]=sector_norm(ComponentPrint,1,0);
img4 = double(ComponentPrint)/graylevmax;
haxes14=axes('parent',gcf,'position',[0.145 0.1 0.19 0.23],'visible','off','tag','keyelement');
set(gcf,'currentaxes',haxes14);%gca是当前句柄???????
imshow(img4);
set(push15,'visible','on');
case 2,
z2=gabor2;
z2x=size(z2,1);
z2y=size(z2,2);
ComponentPrint=real(ifft2(fft2(z1,z1x+z2x-1,z1y+z2y-1).*fft2(z2,z1x+z2x-1,z1y+z2y-1)));
px=((z2x-1)+mod((z2x-1),2))/2;
py=((z2y-1)+mod((z2y-1),2))/2;
ComponentPrint2=ComponentPrint(px+1:px+z1x,py+1:py+z1y);
[disk,vector]=sector_norm(ComponentPrint,1,0);
img5= double(ComponentPrint)/graylevmax;
haxes15=axes('parent',gcf,'position',[0.15 0.1 0.19 0.23],'visible','off','tag','keyelement');
set(gcf,'currentaxes',haxes15);%gca是当前句柄???????
imshow(img5);
set(push16,'visible','on');
case 3,
z2=gabor3;
z2x=size(z2,1);
z2y=size(z2,2);
ComponentPrint=real(ifft2(fft2(z1,z1x+z2x-1,z1y+z2y-1).*fft2(z2,z1x+z2x-1,z1y+z2y-1)));
px=((z2x-1)+mod((z2x-1),2))/2;
py=((z2y-1)+mod((z2y-1),2))/2;
ComponentPrint3=ComponentPrint(px+1:px+z1x,py+1:py+z1y);
[disk,vector]=sector_norm(ComponentPrint,1,0);
img6= double(ComponentPrint)/graylevmax;
haxes16=axes('parent',gcf,'position',[0.15 0.1 0.19 0.23],'visible','off','tag','keyelement');
set(gcf,'currentaxes',haxes16);%gca是当前句柄???????
imshow(img6);
set(push17,'visible','on');
case 4,
z2=gabor4;
z2x=size(z2,1);
z2y=size(z2,2);
ComponentPrint=real(ifft2(fft2(z1,z1x+z2x-1,z1y+z2y-1).*fft2(z2,z1x+z2x-1,z1y+z2y-1)));
px=((z2x-1)+mod((z2x-1),2))/2;
py=((z2y-1)+mod((z2y-1),2))/2;
ComponentPrint4=ComponentPrint(px+1:px+z1x,py+1:py+z1y);
[disk,vector]=sector_norm(ComponentPrint,1,0);
img7= double(ComponentPrint)/graylevmax;
haxes17=axes('parent',gcf,'position',[0.15 0.1 0.19 0.23],'visible','off','tag','keyelement');
set(gcf,'currentaxes',haxes17);%gca是当前句柄???????
imshow(img7);
set(push18,'visible','on');
case 5,
z2=gabor5;
z2x=size(z2,1);
z2y=size(z2,2);
ComponentPrint=real(ifft2(fft2(z1,z1x+z2x-1,z1y+z2y-1).*fft2(z2,z1x+z2x-1,z1y+z2y-1)));
px=((z2x-1)+mod((z2x-1),2))/2;
py=((z2y-1)+mod((z2y-1),2))/2;
ComponentPrint5=ComponentPrint(px+1:px+z1x,py+1:py+z1y);
[disk,vector]=sector_norm(ComponentPrint,1,0);
img8= double(ComponentPrint)/graylevmax;
haxes18=axes('parent',gcf,'position',[0.15 0.1 0.19 0.23],'visible','off','tag','keyelement');
set(gcf,'currentaxes',haxes18);%gca是当前句柄???????
imshow(img8);
set(push19,'visible','on');
case 6,
z2=gabor6;
z2x=size(z2,1);
z2y=size(z2,2);
ComponentPrint=real(ifft2(fft2(z1,z1x+z2x-1,z1y+z2y-1).*fft2(z2,z1x+z2x-1,z1y+z2y-1)));
px=((z2x-1)+mod((z2x-1),2))/2;
py=((z2y-1)+mod((z2y-1),2))/2;
ComponentPrint6=ComponentPrint(px+1:px+z1x,py+1:py+z1y);
[disk,vector]=sector_norm(ComponentPrint,1,0);
img9= double(ComponentPrint)/graylevmax;
haxes19=axes('parent',gcf,'position',[0.15 0.1 0.19 0.23],'visible','off','tag','keyelement');
set(gcf,'currentaxes',haxes19);%gca是当前句柄???????
imshow(img9);
set(push20,'visible','on');
case 7,
z2=gabor7;
z2x=size(z2,1);
z2y=size(z2,2);
ComponentPrint=real(ifft2(fft2(z1,z1x+z2x-1,z1y+z2y-1).*fft2(z2,z1x+z2x-1,z1y+z2y-1)));
px=((z2x-1)+mod((z2x-1),2))/2;
py=((z2y-1)+mod((z2y-1),2))/2;
ComponentPrint7=ComponentPrint(px+1:px+z1x,py+1:py+z1y);
[disk,vector]=sector_norm(ComponentPrint,1,0);
img10= double(ComponentPrint)/graylevmax;
haxes20=axes('parent',gcf,'position',[0.15 0.1 0.19 0.23],'visible','off','tag','keyelement');
set(gcf,'currentaxes',haxes20);%gca是当前句柄???????
imshow(img10);
set(push21,'visible','on');
case 8,
z2=gabor8;
z2x=size(z2,1);
z2y=size(z2,2);
ComponentPrint=real(ifft2(fft2(z1,z1x+z2x-1,z1y+z2y-1).*fft2(z2,z1x+z2x-1,z1y+z2y-1)));
px=((z2x-1)+mod((z2x-1),2))/2;
py=((z2y-1)+mod((z2y-1),2))/2;
ComponentPrint8=ComponentPrint(px+1:px+z1x,py+1:py+z1y);
[disk,vector]=sector_norm(ComponentPrint,1,0);
img11= double(ComponentPrint)/graylevmax;
haxes21=axes('parent',gcf,'position',[0.15 0.1 0.19 0.23],'visible','off','tag','keyelement');
set(gcf,'currentaxes',haxes21);%gca是当前句柄???????
imshow(img11);
set(push22,'visible','on');
otherwise
error('Nothing !');
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -