function varargout = guiTest(varargin)
% GUITEST MATLAB code for guiTest.fig
% GUITEST, by itself, creates a new GUITEST or raises the existing
% singleton*.
%
% H = GUITEST returns the handle to a new GUITEST or the handle to
% the existing singleton*.
%
% GUITEST('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in GUITEST.M with the given input arguments.
%
% GUITEST('Property','Value',...) creates a new GUITEST or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before guiTest_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to guiTest_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 guiTest
% Last Modified by GUIDE v2.5 23-Nov-2020 22:59:21
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @guiTest_OpeningFcn, ...
'gui_OutputFcn', @guiTest_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 guiTest is made visible.
function guiTest_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 guiTest (see VARARGIN)
% Choose default command line output for guiTest
handles.output = hObject;
set(handles.axes1,'visible','off');
set(handles.axes2,'visible','off');
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes guiTest wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = guiTest_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 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)
axes(handles.axes1);
[filename,pathname]=uigetfile({'*.bmp;*.jpg;*.png;*.jpeg;*.tif'},'选择一个图片','F:\test');
str=[pathname filename];
% 判断文件是否为空,也可以不用这个操作!直接读入图片也可以的
% im = imread(str);
% imshow(im)
if isequal(filename,0)||isequal(pathname,0)
warndlg('please select a picture first!','warning');
return;
else
im = imread(str);
imshow(im);
end
% --- 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)
% --- 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 MATLABs
% handles structure with handles and user data (see GUIDATA)
imgTest=getimage(handles.axes1);
axes(handles.axes2);
imshow(imgTest);
model = evalin('base', 'model');
%model = model.model;
if (get(handles.radiobutton1,'value') == 0)
[face_num , masked] = dection(imgTest,model);
else
axes(handles.axes2);
cla reset
end
set(handles.text7,'string',strcat('总人数:',num2str(face_num)));
set(handles.text9,'string',strcat('带口罩人数:',num2str(masked)));
set(handles.text10,'string',strcat('未带口罩人数:',num2str(face_num - masked)));
% --- Executes on button press in pushbutton5.
function pushbutton5_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
axes(handles.axes1);
cla reset
set(handles.axes1,'visible','off');
axes(handles.axes2);
cla reset
set(handles.axes2,'visible','off');
set(handles.text7,'string',strcat('总人数:',num2str(0)));
set(handles.text9,'string',strcat('带口罩人数:',num2str(0)));
set(handles.text10,'string',strcat('未带口罩人数:',num2str(0)));
% --- Executes on button press in radiobutton1.
function radiobutton1_Callback(hObject, eventdata, handles)
% hObject handle to radiobutton1 (see GCBO)
% 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 radiobutton1
set(handles.radiobutton1,'value',1);
set(handles.radiobutton2,'value',0);
% --- Executes on button press in radiobutton2.
function radiobutton2_Callback(hObject, eventdata, handles)
% hObject handle to radiobutton2 (see GCBO)
% 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 radiobutton2
set(handles.radiobutton1,'value',0);
set(handles.radiobutton2,'value',1);
博士僧小星
- 粉丝: 2439
- 资源: 5998
最新资源
- ssm学院党员管理系统+jsp.zip
- ssm学生信息管理系统+jsp.zip
- ssm学校运动会信息管理系统+jsp.zip
- ssm学生宿舍管理+jsp.zip
- ssm学生公寓管理中心系统的设计与实现+jsp.zip
- ssm学生请假系统+jsp.zip
- ssm学生公寓管理系统的设计与实现+jsp.zip
- ssm学生成绩管理系统+vue.zip
- 西门子s7 200smart与3台力士乐变频器通讯程序 原创可直接用于生产的程序,程序带注释,并附送触摸屏程序,有接线方式和设置,通讯地址说明等 程序采用轮询,可以后续根据要求适当修改后扩展 器件
- ssm削面快餐店点餐服务系统的设计与实现+jsp.zip
- ssm新生报到系统+jsp.zip
- ssm选课排课系统的设计与开发+vue.zip
- ssm星空游戏购买下载平台的设计与实现+jsp.zip
- ssm校园一卡通系统软件的设计与实现+jsp.zip
- ssm校园自助洗衣系统的分析与设计+jsp.zip
- ssm校园资讯推荐系统+jsp.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈