www.gusucode.com > Matlab精彩编程100例源码程序 > Matlab精彩编程100例源码/实例71/实例71.m
h0=figure('toolbar','none',... 'position',[198 56 350 468],... 'name','实例71'); h1=axes('parent',h0,... 'position',[0.3 0.45 0.5 0.5],... 'visible','off'); P=phantom(256); imshow(P) b1=uicontrol('parent',h0,... 'units','points',... 'tag','b1',... 'style','pushbutton',... 'string','变换一',... 'backgroundcolor',[0.75 0.75 0.75],... 'position',[30 100 50 20],... 'callback',[... 'cla,',... 'k=1;,',... 'theta1=0:10:170;,',... 'R1=radon(P,theta1);,',... 'imagesc(R1),',... 'colormap(hot),',... 'colorbar']); b2=uicontrol('parent',h0,... 'units','points',... 'tag','b2',... 'style','pushbutton',... 'string','变换二',... 'backgroundcolor',[0.75 0.75 0.75],... 'position',[100 100 50 20],... 'callback',[... 'cla,',... 'k=2;,',... 'theta2=0:5:175;,',... 'R2=radon(P,theta2);,',... 'imagesc(R2),',... 'colormap(hot),',... 'colorbar']); b3=uicontrol('parent',h0,... 'units','points',... 'tag','b3',... 'style','pushbutton',... 'string','变换三',... 'backgroundcolor',[0.75 0.75 0.75],... 'position',[170 100 50 20],... 'callback',[... 'cla,',... 'k=3;,',... 'theta3=0:2:178;,',... 'R3=radon(P,theta3);,',... 'imagesc(R3),',... 'colormap(hot),',... 'colorbar']); b4=uicontrol('parent',h0,... 'units','points',... 'tag','b4',... 'style','pushbutton',... 'string','原始图像',... 'backgroundcolor',[0.75 0.75 0.75],... 'position',[50 50 70 30],... 'callback',[... 'cla,',... 'if k==1,',... 'I1=iradon(R1,10);,',... 'imshow(I1),',... 'end,',... 'if k==2,',... 'I2=iradon(R2,5);,',... 'imshow(I2),',... 'end,',... 'if k==3,',... 'I3=iradon(R3,2);,',... 'imshow(I3),',... 'end']); b5=uicontrol('parent',h0,... 'units','points',... 'tag','b5',... 'style','pushbutton',... 'string','关闭',... 'backgroundcolor',[0.75 0.75 0.75],... 'position',[150 50 70 30],... 'callback','close');