function varargout = meiyan(varargin)
% MEIYAN MATLAB code for meiyan.fig
% MEIYAN, by itself, creates a new MEIYAN or raises the existing
% singleton*.
%
% H = MEIYAN returns the handle to a new MEIYAN or the handle to
% the existing singleton*.
%
% MEIYAN('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in MEIYAN.M with the given input arguments.
%
% MEIYAN('Property','Value',...) creates a new MEIYAN or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before meiyan_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to meiyan_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help meiyan
% Last Modified by GUIDE v2.5 09-Jul-2019 21:40:33
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @meiyan_OpeningFcn, ...
'gui_OutputFcn', @meiyan_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before meiyan is made visible.
function meiyan_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to meiyan (see VARARGIN)
% Choose default command line output for meiyan
handles.output = hObject;
handles.imgfilename=[];
handles.imgyuantu=[];
handles.imgmeiyantu=[];
handles.imgHSI=[];
handles.imgH=[];
handles.imgS=[];
handles.imgI=[];
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes meiyan wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = meiyan_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[imgfilename,imgpathname]=uigetfile(('*.jpg;*.png;*.jpeg'),'Select a color image');
if imgfilename
imgyuantu=imread([imgpathname '\' imgfilename]);
axes(handles.axes1);
imshow(imgyuantu);
handles.imgfilename=imgfilename;
handles.imgyuantu=imgyuantu;
end
guidata(hObject,handles)
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
if ~isempty(handles.imgfilename)
[HSI,H,S,I]=rgbtohsi(handles.imgyuantu);
axes(handles.axes3);
imshow(HSI);
axes(handles.axes4);
imshow(H);
axes(handles.axes5);
imshow(S);
axes(handles.axes6);
imshow(I);
axes(handles.axes7);
imhist(H);
axes(handles.axes8);
imhist(S);
axes(handles.axes9);
imhist(I);
handles.imgHSI=HSI;
handles.imgH=H;
handles.imgS=S;
handles.imgI=I;
end
guidata(hObject,handles)
% --- Executes on button press in pushbutton3.
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)
if ~isempty(handles.imgfilename)
H=handles.imgH;
S=handles.imgS;
I=handles.imgI;
I=imadjust(I);
HSI=cat(3,H,S,I);
[RGB,~,~,~]=hsitorgb(HSI);
axes(handles.axes2);
imshow(RGB);
axes(handles.axes3);
imshow(HSI);
axes(handles.axes4);
imshow(H);
axes(handles.axes5);
imshow(S);
axes(handles.axes6);
imshow(I);
axes(handles.axes7);
imhist(H);
axes(handles.axes8);
imhist(S);
axes(handles.axes9);
imhist(I);
handles.imgHSI=HSI;
handles.imgH=H;
handles.imgS=S;
handles.imgI=I;
end
guidata(hObject,handles)
% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
if ~isempty(handles.imgfilename)
H=handles.imgH;
S=handles.imgS;
I=handles.imgI;
S=imadjust(S);
HSI=cat(3,H,S,I);
[RGB,~,~,~]=hsitorgb(HSI);
axes(handles.axes2);
imshow(RGB);
axes(handles.axes3);
imshow(HSI);
axes(handles.axes4);
imshow(H);
axes(handles.axes5);
imshow(S);
axes(handles.axes6);
imshow(I);
axes(handles.axes7);
imhist(H);
axes(handles.axes8);
imhist(S);
axes(handles.axes9);
imhist(I);
handles.imgHSI=HSI;
handles.imgH=H;
handles.imgS=S;
handles.imgI=I;
end
guidata(hObject,handles)
% --- Executes on button press in pushbutton9.
function pushbutton9_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton9 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
if ~isempty(handles.imgfilename)
H=handles.imgH;
S=handles.imgS;
I=handles.imgI;
HSI=cat(3,H,S,I);
[~,R,G,B]=hsitorgb(HSI);
a=get(handles.popupmenu1,'Value');
while a~=0
switch a
case 1,
a=1;
break;
case 2,
a=3;
break;
case 3,
a=5;
break;
case 4,
a=7;
break;
case 5,
a=9;
break;
case 6,
a=11;
break;
case 7,
a=13;
break;
case 8,
a=15;
break;
end;
a=1;
end
R=medfilt2(R,[a a]);
G=medfilt2(G,[a a]);
B=medfilt2(B,[a a]);
RGB=cat(3,R,G,B);
axes(handles.axes2);
imshow(RGB);
[HSI,H,S,I]=rgbtohsi(RGB);
axes(handles.axes3);
imshow(HSI);
axes(handles.axes4);
imshow(H);
axes(handles.axes5);
imshow(S);
axes(handles.axes6);
imshow(I);
axes(handles.axes7);
imhist(H);
axes(handles.axes8);
imhist(S);
axes(handles.axes9);
imhist(I);
handles.imgHSI=HSI;
handles.imgH=H;
handles.imgS=S;
handles.imgI=I;
end
guidata(hObject,handles)
% --- Executes on selection change in popupmenu1.
function popupmenu1_Callback(hObject, eventdata, handles)
% hObject handle to popupmenu1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,'String')) returns popupmenu
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
用matlab的guide实现对人像的美颜功能,数字图像处理技术。 设计内容及要求: 人脸皮肤的光滑程度很大程度影响人的容貌,很多时候,我们希望拍出 来的照片能更漂亮一些。请设计一美颜软件,实现如下功能: 1、 拍摄一幅彩色人像,对该彩色图像设计一可变模板大小的平滑滤波 器,对人像图像进行滤波处理; 2、 针对面部斑点设计滤波器进行消除 3、 设计亮度调整函数,调整该图像亮度; 4、 调整该图像饱和度,使图像色彩鲜艳程度改变 5、 设计 GUI 界面
资源推荐
资源详情
资源评论
收起资源包目录
美颜软件matlab.zip (19个子文件)
雀斑2.jpg 23KB
雀斑1.jpg 20KB
痣1.jpg 20KB
标准测试图.jpg 133KB
hsitorgb.m 718B
meiyan.m 19KB
pinghua.m 647B
皱纹1.jpeg 241KB
痣2.png 214KB
qiuhe.m 727B
rgbtohsi.m 363B
粗糙1.jpeg 89KB
皱纹2.jpg 49KB
meiyan1.m 879B
标准测试图2.jpg 42KB
gray2rgb.m 2KB
皱纹3.jpg 212KB
粗糙2.jpg 10KB
meiyan.fig 24KB
共 19 条
- 1
资源评论
SpaceTT
- 粉丝: 3
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功