第一范文网 - 专业文章范例文档资料分享平台

MATLAB课程设计--GUI图像处理

来源:用户分享 时间:2025/5/25 4:09:48 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

% --- 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 structure with handles and user data (see GUIDATA)

axes(handles.axes2); x=(handles.img);

f=double(x); % êy?Yà-Dí?a?? k=fft2(f); % ?μá¢ò?a??? g=fftshift(k); % ?a??êy?Y???ó [M,N]=size(g); nn=2;

d0=25; %???1?μ?ê?a25 m=fix(M/2); n=fix(N/2); for i=1:M

for j=1:N

d=sqrt((i-m)^2+(j-n)^2); % ??????í¨??2¨??′?μYoˉêy if d<=d0 h=0; else h=1; end

result(i,j)=h*g(i,j); end end

result=ifftshift(result); y2=ifft2(result); y3=uint8(real(y2));

imshow(y3); % ??ê???2¨′|àíoóμ?í???

% --- Executes on button press in pushbutton16.

function pushbutton16_Callback(hObject, eventdata, handles) % hObject handle to pushbutton16 (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=edge(handles.img,'canny'); imshow(f); handles.img=f;

guidata(hObject,handles);

46 / 52

% -------------------------------------------------------------------- function edit_Callback(hObject, eventdata, handles) % hObject handle to edit (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

% -------------------------------------------------------------------- function tuxiangbianxing_Callback(hObject, eventdata, handles) % hObject handle to tuxiangbianxing (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

% -------------------------------------------------------------------- function tianjiazaosheng_Callback(hObject, eventdata, handles) % hObject handle to tianjiazaosheng (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) set(handles.uipanel4,'Visible','on'); if strcmp(get(gcbo, 'Checked'),'on')

set(handles.uipanel4,'Visible','on'); set(gcbo, 'Checked', 'off');

set(handles.uipanel4,'Visible','off'); else

set(gcbo, 'Checked', 'on'); end

% -------------------------------------------------------------------- function lvbochuli_Callback(hObject, eventdata, handles) % hObject handle to lvbochuli (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

% -------------------------------------------------------------------- function changyongchuli_Callback(hObject, eventdata, handles) % hObject handle to changyongchuli (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

47 / 52

% -------------------------------------------------------------------- function teshuchuli_Callback(hObject, eventdata, handles) % hObject handle to teshuchuli (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

% -------------------------------------------------------------------- function tuxiangfanzhuan_Callback(hObject, eventdata, handles) % hObject handle to tuxiangfanzhuan (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) set(handles.uipanel7,'Visible','on'); if strcmp(get(gcbo, 'Checked'),'on')

set(handles.uipanel7,'Visible','on'); set(gcbo, 'Checked', 'off');

set(handles.uipanel7,'Visible','off'); else

set(gcbo, 'Checked', 'on'); end

% -------------------------------------------------------------------- function tuxiangxuanzhuan_Callback(hObject, eventdata, handles) % hObject handle to tuxiangxuanzhuan (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) set(handles.pushbutton3,'Visible','on'); if strcmp(get(gcbo, 'Checked'),'on')

set(handles.pushbutton3,'Visible','on'); set(gcbo, 'Checked', 'off');

set(handles.pushbutton3,'Visible','off'); else

set(gcbo, 'Checked', 'on'); end

% -------------------------------------------------------------------- function ditonglvbochuli_Callback(hObject, eventdata, handles) % hObject handle to ditonglvbochuli (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) set(handles.pushbutton14,'Visible','on'); if strcmp(get(gcbo, 'Checked'),'on')

set(handles.pushbutton14,'Visible','on'); set(gcbo, 'Checked', 'off');

48 / 52

搜索更多关于: MATLAB课程设计--GUI图像处理 的文档
MATLAB课程设计--GUI图像处理.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c7v7ze3eja67px008u2ll_12.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top