function [] = makeGUI
global h_fig
global Button_addarea Button_addpassfilter Button_addnopassfilter Button_importfilter
global Button_exit Button_showIm Button_showImF
global Button_save Button_lighter Text_outfilename
global Type_circle Type_square Type_addpass Type_addnotpass
global Text_theta Text_matname
global appearance % 1 for circle, 2 for square
global pass % 1 for pass, 0 for not pass
global theta
global needshowIm needshowImF scrsz needlighter
global Imsize ImF ImFFilt ImOut Im Filt
global filename
appearance = 1;
pass = 0;
theta = 0;
%% 设置UI控件
% 创建一个图形界面,起名字
scrsz = get(0,'screensize');
scrsz(1,1:2)=0.1*scrsz(1,3:4);
scrsz(3)=0.8*scrsz(3);
scrsz(4)=0.9*scrsz(4);
h_fig=figure('toolbar','none',...
'position',0.9*scrsz,...
'name','光学空间频率域滤波演示');
% 创建一个按钮,从全通新建滤波器
Button_addpassfilter=uicontrol('parent',h_fig,...
'style','pushbutton',...
'backgroundcolor','w',...
'fontsize',10,...
'fontweight','demi',...
'string','从全通新建滤波器',...
'position',[50,scrsz(4)*4/5,200,40],...
'callback','addPassFilter;');
% 创建一个按钮,从全阻新建滤波器
Button_addnopassfilter=uicontrol('parent',h_fig,...
'style','pushbutton',...
'backgroundcolor','w',...
'fontsize',10,...
'fontweight','demi',...
'string','从全阻新建滤波器',...
'position',[50,scrsz(4)*4/5-50,200,40],...
'callback','addNoPassFilter;');
% 创建一个按钮,从矩阵导入滤波器
Button_importfilter=uicontrol('parent',h_fig,...
'style','pushbutton',...
'backgroundcolor','w',...
'fontsize',10,...
'fontweight','demi',...
'string','从矩阵导入滤波器,矩阵名:',...
'position',[50,scrsz(4)*4/5-100,200,40],...
'callback','importFilter;');
% 创建一个text,导入矩阵的名字
Text_matname=uicontrol('parent',h_fig,...
'style','edit',...
'fontsize',10,...
'Enable','On',...
'fontweight','demi',...
'position',[255,scrsz(4)*4/5-100,60,40]);
% 创建一个按钮,添加区域
Button_addarea=uicontrol('parent',h_fig,...
'style','pushbutton',...
'backgroundcolor','w',...
'fontsize',10,...
'fontweight','demi',...
'string','添加区域',...
'Enable','Off',...
'position',[50,scrsz(4)*4/5-300,150,40],...
'callback','addArea;');
% 创建一个radiobutton,选则圆形
Type_circle=uicontrol('parent',h_fig,...
'style','radiobutton',...
'fontsize',10,...
'value',1,...
'fontweight','demi',...
'string','圆形',...
'Enable','Off',...
'position',[50,scrsz(4)*4/5-150,150,30],...
'callback','set(Type_circle,''value'',1);set(Type_square,''value'',0);set(Text_theta,''Enable'',''Off'');appearance=1;');
% 创建一个radiobutton,选则方形
Type_square=uicontrol('parent',h_fig,...
'style','radiobutton',...
'fontsize',10,...
'value',0,...
'fontweight','demi',...
'string','方形:顺时针旋转角度(°)',...
'Enable','Off',...
'position',[50,scrsz(4)*4/5-180,200,30],...
'callback','set(Type_circle,''value'',0);set(Type_square,''value'',1);set(Text_theta,''Enable'',''On'');appearance=2;');
% 创建一个radiobutton,选则添加能通过的区域
Type_addpass=uicontrol('parent',h_fig,...
'style','radiobutton',...
'fontsize',10,...
'value',0,...
'fontweight','demi',...
'string','添加能通过的区域',...
'Enable','Off',...
'position',[50,scrsz(4)*4/5-220,150,30],...
'callback','set(Type_addpass,''value'',1);set(Type_addnotpass,''value'',0);pass=1;');
% 创建一个radiobutton,选则添加要阻挡的区域
Type_addnotpass=uicontrol('parent',h_fig,...
'style','radiobutton',...
'fontsize',10,...
'value',1,...
'fontweight','demi',...
'string','添加想阻挡的区域',...
'Enable','Off',...
'position',[50,scrsz(4)*4/5-250,150,30],...
'callback','set(Type_addpass,''value'',0);set(Type_addnotpass,''value'',1);pass=0;');
% 创建一个text,长方形顺时针旋转的角度
Text_theta=uicontrol('parent',h_fig,...
'style','edit',...
'fontsize',10,...
'Enable','Off',...
'fontweight','demi',...
'string','0',...
'position',[250,scrsz(4)*4/5-180,50,30]);
% 创建一个按钮,退出
Button_exit=uicontrol('parent',h_fig,...
'style','pushbutton',...
'backgroundcolor','y',...
'fontsize',10,...
'fontweight','demi',...
'string','退出',...
'position',[50,20,200,40],...
'callback','close all;');
% 创建一个按钮,显示/关闭原图像
Button_showIm=uicontrol('parent',h_fig,...
'style','pushbutton',...
'backgroundcolor','w',...
'fontsize',10,...
'fontweight','demi',...
'string','显示原图片',...
'position',[50,70,95,40],...
'callback','showIm;');
% 创建一个按钮,显示/关闭原频谱
Button_showImF=uicontrol('parent',h_fig,...
'style','pushbutton',...
'backgroundcolor','w',...
'fontsize',10,...
'fontweight','demi',...
'string','显示原频谱',...
'position',[155,70,95,40],...
'callback','showImF;');
% 创建一个按钮,保存图像
Button_save=uicontrol('parent',h_fig,...
'style','pushbutton',...
'backgroundcolor','w',...
'fontsize',10,...
'fontweight','demi',...
'string','保存图像到:文件名:',...
'position',[50,scrsz(4)*4/5-345,150,40],...
'callback','saveIm');
% 创建一个text,保存的文件名
Text_outfilename=uicontrol('parent',h_fig,...
'style','edit',...
'fontsize',10,...
'Enable','On',...
'fontweight','demi',...
'string',filename(11:length(filename)-4),...
'position',[210,scrsz(4)*4/5-345,100,40]);
% 创建一个按钮,增加图像亮度
Button_lighter=uicontrol('parent',h_fig,...
'style','pushbutton',...
'backgroundcolor','w',...
'fontsize',10,...
'fontweight','demi',...
'string','增加图像亮度',...
'position',[50,scrsz(4)*4/5-390,150,40],...
'callback','lighter;');
needshowIm=1;needshowImF=1;needlighter=1;
没有合适的资源?快使用搜索试试~ 我知道了~
光学基于Matlab模拟光学空间滤波含GUI.zip
共64个文件
jpg:46个
m:17个
png:1个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 177 浏览量
2022-10-11
23:40:23
上传
评论
收藏 1.62MB ZIP 举报
温馨提示
1.版本:matlab2019a,不会运行可私信 2.领域:基础教程 3.内容:【光学】基于Matlab模拟光学空间滤波含GUI 4.适合人群:本科,硕士等教研学习使用
资源推荐
资源详情
资源评论
收起资源包目录
【光学】基于Matlab模拟光学空间滤波含GUI 上传.zip (64个子文件)
showImF.m 495B
addPassFilter.m 427B
importFilter.m 395B
draw.m 523B
RunGUI.m 2KB
FiltGen_Circle.m 270B
FiltGen_Square.m 520B
saveIm.m 472B
lighter.m 366B
addArea.m 222B
INFILES
圆孔密排-圆形边界.jpg 31KB
一维光栅90.jpg 58KB
圆孔密排.jpg 68KB
单方屏.jpg 34KB
单缝.jpg 27KB
一维光栅70.jpg 72KB
光.jpg 44KB
一维光栅50.jpg 72KB
单圆屏.jpg 34KB
圆内网格.jpg 182KB
一维光栅10.jpg 64KB
网格.jpg 411KB
光+网格.jpg 100KB
一维光栅30.jpg 69KB
calcFFT.m 165B
OUTFILES
一维光栅90F.jpg 28KB
单方屏F.jpg 12KB
单缝留中心F.jpg 11KB
单缝留中心Out.jpg 18KB
一维光栅30Out.jpg 29KB
光+网格左Out.jpg 19KB
光+网格左上Out.jpg 20KB
光+网格左左Out.jpg 21KB
圆孔密排Out.jpg 26KB
光+网格左左F.jpg 63KB
单圆屏Out.jpg 9KB
圆孔密排F.jpg 90KB
光Out.jpg 5KB
光F.jpg 34KB
圆内网格挡住零级F.jpg 29KB
一维光栅10F.jpg 72KB
圆孔密排-圆形边界Out.jpg 8KB
圆内网格挡住零级Out.jpg 67KB
一维光栅70F.jpg 30KB
一维光栅10Out.jpg 25KB
光+网格中心F.jpg 63KB
单圆屏F.jpg 12KB
光+网格左F.jpg 63KB
一维光栅90Out.jpg 30KB
一维光栅70Out.jpg 34KB
单方屏Out.jpg 9KB
一维光栅50Out.jpg 20KB
一维光栅50F.jpg 38KB
光+网格左上F.jpg 63KB
一维光栅30F.jpg 49KB
圆孔密排-圆形边界F.jpg 101KB
光+网格中心Out.jpg 19KB
addCircle.m 273B
addNoPassFilter.m 430B
2.png 362KB
addSquare.m 320B
calcImF.m 205B
makeGUI.m 6KB
showIm.m 308B
共 64 条
- 1
资源评论
天天Matlab科研工作室
- 粉丝: 3w+
- 资源: 7261
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功