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

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

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

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) [sfilename ,sfilepath]=uiputfile({'*.jpg';'*.bmp';'*.tif';'*.*'},'保存图像文件','untitled.jpg');

if ~isequal([sfilename,sfilepath],[0,0]) sfilefullname=[sfilepath ,sfilename]; imwrite(handles.img,sfilefullname); else

msgbox('你按了取消键','保存失败'); end

程序关键部分:

通[sfilename ,sfilepath]=uiputfile({'*.jpg';'*.bmp';'*.tif';'*.*'},'保存图像文件','untitled.jpg')选择图像文件保存的路径与格式;然后,通过sfilefullname=[sfilepath ,sfilename];

imwrite(handles.img,sfilefullname); 实现对图像的保存。

(3)程序的退出。

function exit_Callback(hObject, eventdata, handles) % hObject handle to exit (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) clc; close all; close(gcf); clear;

4.3对图像进行任意的亮度和对比度变化调整,显示和对比变换前后的图像。 运行程序后,通过“编辑”菜单中的“常用处理”选中“亮度调节”

9 / 52

在显示出相应的功能键后,通过载入读取图像,比并进行处理,效果如下: 亮度处理前:

亮度处理后:

实现程序段如下:

% --- Executes on button press in radiobutton12.

function radiobutton12_Callback(hObject, eventdata, handles) % hObject handle to radiobutton12 (see GCBO)

10 / 52

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

% Hint: get(hObject,'Value') returns toggle state of radiobutton12 global T

axes(handles.axes2); T=getimage;

prompt={'调整倍数'}; defans={'1'};

p=inputdlg(prompt,'input',1,defans); p1=str2num(p{1});

y=imadjust(handles.img,[ ], [ ],p1); %亮度调节 imshow(y); handles.img=y;

guidata(hObject,handles);

对比度处理前:

对比度处理后(增强3倍):

11 / 52

对比度减弱1.5倍后:

实现程序段如下:

function uipanel10_SelectionChangeFcn(hObject, eventdata, handles) % hObject handle to uipanel10 (see GCBO)

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

str=get(hObject,'string'); axes(handles.axes2);

switch str case'增强' T=getimage;

prompt={'输入参数:'}; defans={'1'};

p=inputdlg(prompt,'input',1,defans); p1=str2num(p{1});

f=immultiply(handles.img,p1); imshow(f);

12 / 52

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