云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > MATLAB课程设计--GUI图像处理

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

  • 62 次阅读
  • 3 次下载
  • 2025/5/6 20:12:15

实现程序如下:

function uipanel7_SelectionChangeFcn(hObject, eventdata, handles) %图像翻转

% hObject handle to uipanel7 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) str=get(hObject,'string'); axes(handles.axes2); global T switch str

case '左右翻转' T=handles.img; f=fliplr(handles.img); imshow(f); handles.img=f;

guidata(hObject,handles); case '上下翻转' T=handles.img;

f=flipud(handles.img); imshow(f); handles.img=f;

guidata(hObject,handles);

29 / 52

end

程序关键部分:通过f=fliplr(handles.img); f=flipud(handles.img);分别实现左右镜像翻转与上下镜像翻转。

(2)图像旋转。

实现图像的逆时针旋转任意角度。

实现程序段如下:

function pushbutton3_Callback(hObject, eventdata, handles) %图像爱那个旋转

% hObject handle to pushbutton3 (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;

prompt={'旋转角度:'};

30 / 52

defans={'0'};

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

f=imrotate(handles.img,p1,'bilinear','crop'); imshow(f); handles.img=f;

guidata(hObject,handles);

关键部分:通过p=inputdlg(prompt,'input',1,defans);p1=str2num(p{1}); 来输入旋转参数。

通过函数f=imrotate(handles.img,p1,'bilinear','crop');实现翻转。

4.12特殊处理

(1)底片效果。将图像变为底片,并显示。

实现程序如下:

% --- 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); %图像取反′

31 / 52

imshow(f); handles.img=f;

guidata(hObject,handles);

程序段关键部分:通过f=imcomplement(handles.img);实现图像取反,形成底片效果。

(2)边缘信息。采取图像的边缘信息。

实现程序段如下:

% --- 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);

程序关键部分:通过f=edge(handles.img,'canny');是实现边缘信息的获取。

32 / 52

搜索更多关于: MATLAB课程设计--GUI图像处理 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

实现程序如下: function uipanel7_SelectionChangeFcn(hObject, eventdata, handles) %图像翻转 % hObject handle to uipanel7 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) str=get(hObject,'string'); axes(handles.axes2); global T switch str case '左右翻转' T=handles.img

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com