% --- Executes on button press in pushbutton12.
function pushbutton12_Callback(hObject, eventdata, handles) % hObject handle to pushbutton12 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) global T
axes (handles.axes2); T=getimage;
f=imcomplement(handles.img); %tí???è??′ imshow(f); handles.img=f;
guidata(hObject,handles);
% --- Executes on button press in pushbutton14.
function pushbutton14_Callback(hObject, eventdata, handles) % hObject handle to pushbutton14 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)
axes(handles.axes2); y1=handles.img;
f=double(y1); % êy?Yà-Dí?a??£?MATLAB2??§3?í???μ??T??o???Díμ????? g=fft2(f); % ?μá¢ò?a??? g=fftshift(g); % ?a??êy?Y???ó [M,N]=size(g);
nn=2; % ?t???íì????1(Butterworth)μíí¨??2¨?? d0=50; %???1?μ?ê?a50 m=fix(M/2); n=fix(N/2); for i=1:M
for j=1:N
d=sqrt((i-m)^2+(j-n)^2);
h=1/(1+0.414*(d/d0)^(2*nn)); % ????μíí¨??2¨??′?μYoˉêy result(i,j)=h*g(i,j); end end
result=ifftshift(result); y2=ifft2(result); y3=uint8(real(y2));
imshow(y3); % ??ê???2¨′|àíoóμ?í???
45 / 52
% --- Executes on button press in pushbutton15.
function pushbutton15_Callback(hObject, eventdata, handles) % hObject handle to pushbutton15 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB % handles