classdef matFinDIPtest < matlab.apps.AppBase
% Properties that correspond to app components
properties (Access = public)
UIFigure matlab.ui.Figure
But_CamShot matlab.ui.control.Button
But_CamOpen matlab.ui.control.Button
But_PicSave matlab.ui.control.Button
But_PicOpen matlab.ui.control.Button
TabGroup matlab.ui.container.TabGroup
Tab matlab.ui.container.Tab
But_DeNoise_midfilt matlab.ui.control.Button
Button_12 matlab.ui.control.Button
Button_11 matlab.ui.control.Button
Drop_Mirr matlab.ui.control.DropDown
Label_10 matlab.ui.control.Label
But_EnNoise_uniform matlab.ui.control.Button
But_EnNoise_saltpepper matlab.ui.control.Button
But_EnNoise_gaussian matlab.ui.control.Button
Label_9 matlab.ui.control.Label
Button_5 matlab.ui.control.Button
Tab_2 matlab.ui.container.Tab
Palette matlab.ui.container.Panel
BSlider matlab.ui.control.Slider
BSliderLabel matlab.ui.control.Label
GSlider matlab.ui.control.Slider
GSliderLabel matlab.ui.control.Label
RSlider matlab.ui.control.Slider
RSliderLabel matlab.ui.control.Label
Slider_saturation matlab.ui.control.Slider
Label_5 matlab.ui.control.Label
Slider_contrast matlab.ui.control.Slider
Label_4 matlab.ui.control.Label
Slider_brightness matlab.ui.control.Slider
Label_3 matlab.ui.control.Label
Tab_3 matlab.ui.container.Tab
But_RegionGrow matlab.ui.control.Button
ButtonGroup matlab.ui.container.ButtonGroup
logButton matlab.ui.control.RadioButton
robertsButton matlab.ui.control.RadioButton
sobelButton matlab.ui.control.RadioButton
But_Threshold matlab.ui.control.Button
But_EdgeSharp matlab.ui.control.Button
Tab_4 matlab.ui.container.Tab
But_AddFrame matlab.ui.control.Button
But_Atomization matlab.ui.control.Button
Tab_5 matlab.ui.container.Tab
Edit_CircularRatio matlab.ui.control.NumericEditField
Label_14 matlab.ui.control.Label
Edit_SquareRatio matlab.ui.control.NumericEditField
Label_13 matlab.ui.control.Label
Edit_C matlab.ui.control.NumericEditField
Label_12 matlab.ui.control.Label
But_EnsureChoice matlab.ui.control.Button
Edit_fliedchoice matlab.ui.control.NumericEditField
Label_11 matlab.ui.control.Label
But_measure matlab.ui.control.Button
Label_8 matlab.ui.control.Label
ImageAxes matlab.ui.control.UIAxes
end
properties (Access = private)
mainPic;
Cam;
prebr=50;
presat=0;
preR=0; preG=0; preB=0;
end
methods (Access = private)
function ShowPic(app)
imshow(app.mainPic,"Parent",app.ImageAxes);
end
end
% Callbacks that handle component events
methods (Access = private)
% Button pushed function: But_PicOpen
function But_PicOpenPushed(app, event)
filterspec = {'*.jpg;*.bmp;*.png'};
[filename, pathname] = uigetfile(filterspec);
if (ischar(pathname))
fullname = [pathname filename];
app.mainPic=imread(fullname);
imshow(fullname,"Parent",app.ImageAxes);
end
end
% Button pushed function: But_CamOpen
function But_CamOpenPushed(app, event)
set(app.But_CamShot,"enable","on"); %激活【截图】键
app.Cam = videoinput('winvideo',1); %打开摄像头
preview(app.Cam);
end
% Button pushed function: But_CamShot
function But_CamShotPushed(app, event)
app.mainPic=getsnapshot(app.Cam); app.ShowPic;
delete(app.Cam);
set(app.But_CamShot,"enable","off");
end
% Button pushed function: But_EnNoise_gaussian
function But_EnNoise_gaussianButtonPushed(app, event)
app.mainPic=imnoise(app.mainPic,'gaussian',0,0.03);
app.ShowPic;
end
% Button pushed function: But_EnNoise_saltpepper
function But_EnNoise_saltpepperButtonPushed(app, event)
app.mainPic=imnoise(app.mainPic,'salt & pepper',0.2);
app.ShowPic;
end
% Button pushed function: But_EnNoise_uniform
function But_EnNoise_uniformButtonPushed(app, event)
app.mainPic=imnoise(app.mainPic,"speckle",0.04);
app.ShowPic;
end
% Button pushed function: But_DeNoise_midfilt
function But_DeNoise_midfiltPushed(app, event)
function d=midfilt(x, n)
[M,N]=size(x);
x1=x;
x2=x1;
for i=1:M-n+1
for j=1:N-n+1
c=x1(i:i+n-1,j:j+n-1);
e=c(1,:);
for k=2:n
e=[e,c(k,:)];
end
x2(i+(n-1)/2,j+(n-1)/2)=median(e);
end
end
d=x2;
end
app.mainPic=midfilt(app.mainPic,3);
app.ShowPic;
end
% Value changed function: Drop_Mirr
function Drop_MirrValueChanged(app, event)
value = app.Drop_Mirr.Value;
tform = affine2d([1 0 0; 0 1 0; 0 0 1]);
switch value
case "原点对称"
tform = affine2d([-1 0 0; 0 -1 0; 0 0 1]);
case "x轴对称"
tform = affine2d([1 0 0; 0 -1 0; 0 0 1]);
case "y轴对称"
tform = affine2d([-1 0 0; 0 1 0; 0 0 1]);
case "y=x对称"
%不知道,有时间再想
case "y=-x对称"
%不知道,有时间再想
end
app.mainPic = imwarp(app.mainPic,tform);
app.ShowPic;
end
% Button pushed function: Button_5
function Button_5Pushed(app, event)
rect=[0 0 100 100];
app.mainPic = imcrop(app.mainPic,rect);
app.ShowPic;
end
% Button pushed function: Button_11
function Button_11Pushed(app, event)
app.mainPic = imrotate(app.mainPic,-90);
app.ShowPic;
end
% Button pushed function: Button_12
function Button_12Pushed(app, event)
app.mainPic = imtranslate(app.mainPic,[100 0]);
app.ShowPic;
end
% Value changing function: Slider_brightness
function Slider_brightnessValueChanging(app, event)
change=event.Value-app.prebr;
app.mainPic=imadd(app.mainPic,change);
app.ShowPic;
app.prebr=event.Value;
end
% Value changing function: Slider_contrast
function Slider_contrastValueChanging(app, event)
curcont=event.Value;
if curcont==0.5
curcont=0.49;
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
基于matlab制作的图像美化系统,包括:摄像头获取头像、读取文件、几何变换、噪声等功能.zip (8个子文件)
Digital-image-processing-with-matlab-main
lena.jpg 90KB
lena.png 699KB
lena_gray.bmp 65KB
lena.bmp 768KB
matFinDIPtest.mlapp 101KB
matFinDIPtest.m 32KB
3.jpg 22KB
边框.png 7KB
共 8 条
- 1
资源评论
博士僧小星
- 粉丝: 1947
- 资源: 5905
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- ROS导航机器人搭建教程
- 操作系统资源浅显易懂哈哈哈
- 小程序版python语言pytorch框架的图像分类墙体颜色识别-不含数据集图片-含逐行注释和说明文档.zip
- 小程序版深度学习CNN训练识别蔬菜-不含数据集图片-含逐行注释和说明文档.zip
- 小程序版通过CNN训练识别蔬菜-不含数据集图片-含逐行注释和说明文档.zip
- 小程序版基于深度学习识别花卉-不含数据集图片-含逐行注释和说明文档.zip
- 小程序版python语言pytorch框架训练识别非机动车辆-不含数据集图片-含逐行注释和说明文档.zip
- 驱动多路舵机51单片机源程序代码
- 小程序版python语言pytorch框架训练识别猴子种类-不含数据集图片-含逐行注释和说明文档.zip
- c++语言调用matlab画图源程序
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功