function varargout = Guide(varargin)
% GUIDE MATLAB code for Guide.fig
% GUIDE, by itself, creates a new GUIDE or raises the existing
% singleton*.
%
% H = GUIDE returns the handle to a new GUIDE or the handle to
% the existing singleton*.
%
% GUIDE('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in GUIDE.M with the given input arguments.
%
% GUIDE('Property','Value',...) creates a new GUIDE or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before Guide_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to Guide_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
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @Guide_OpeningFcn, ...
'gui_OutputFcn', @Guide_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 Guide is made visible.
function Guide_OpeningFcn(hObject, eventdata, handles, varargin) %初始界面
% global IP I
% 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 Guide (see VARARGIN)
% Choose default command line output for Guide
handles.output = hObject;
set(handles.axes1,'visible','off');
axes(handles.axes1);
image = imread('Start.png');
imshow(image,[]);
set(gcf,'Name','智能口罩佩戴检测报警系统')
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes Guide wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = Guide_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;
function edit1_Callback(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit1 as text
% str2double(get(hObject,'String')) returns contents of edit1 as a double
% --- Executes during object creation, after setting all properties.
function edit1_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit2_Callback(hObject, eventdata, handles)
global IP
IP =get(handles.edit2, 'String');
IP = strcat('http://',IP,'/mjpegfeed?340x220i');
% hObject handle to edit2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit2 as text
% str2double(get(hObject,'String')) returns contents of edit2 as a double
% --- Executes during object creation, after setting all properties.
function edit2_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit3_Callback(hObject, eventdata, handles)
% hObject handle to edit3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global time
time =get(handles.edit3, 'String');
time = str2double(time);
% Hints: get(hObject,'String') returns contents of edit3 as text
% str2double(get(hObject,'String')) returns contents of edit3 as a double
% --- Executes during object creation, after setting all properties.
function edit3_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
global IP I flag cam time detector
[filename,filepath] = uigetfile();
if (filename==0 & filepath==0)
% warndlg('您没有选择文件,请重新选择!','打开文件出错','error');
h=warndlg('您没有选择文件,请重新选择! 否则将加载上次数据','error');
uiwait(h);
else
load([filepath,filename]);
fopen([filepath,filename]);
m=msgbox('打开及读取数据完毕!','确认','warn');
uiwait(m);
end
axes(handles.axes1);
cam = ipcam(IP);
preview(cam);
while true
I=snapshot(cam);
pause(time);
[bbox,score,label]=detect(detector,I);
y = length(label');
for i = 1:y
if label(i,1) == 'Mask'
Mask = ['Mask', num2str(score(i,1))];
I=insertObjectAnnotation(I,'Rectangle',bbox(i,:),Mask);
else
NoMask = ['NoMask', num2str(score(i,1))];
I=insertObjectAnnotation(I,'Rectangle',bbox(i,:),NoMask);
[y, Fs] = audioread('Alarm.mp3'); %% y是音频数据m*n的矩阵,Fs是采样率。n是通道数。
p = audioplayer(y,Fs);
play(p);
end
detectedImg=insertShape(I,'Rectangle',bbox);
imshow(detectedImg);
end
end
% 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)
% --- Executes during object creation, after setting all properties.
% hObject handle to uipanel2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
close all;
% 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 Enable == 'on', executes on mouse press in 5 pixel border.
% --- Otherwise, executes on mouse press in 5 pixel border or over pushbutton4.
function pushbutton4_ButtonDownFcn(hObject, eventdata, handles)
% hObject handle to pushbutton4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
%
没有合适的资源?快使用搜索试试~ 我知道了~
基于Matlab和YOLOv2模型实现口罩检测(源码+图片).rar
共5个文件
m:2个
png:1个
mp3:1个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 3 下载量 123 浏览量
2023-03-26
20:35:40
上传
评论 3
收藏 663KB RAR 举报
温馨提示
1、资源内容:基于Matlab和YOLOv2模型实现口罩检测(源码+图片).rar 2、适用人群:计算机,电子信息工程、数学等专业的学习者,作为“参考资料”参考学习使用。 3、解压说明:本资源需要电脑端使用WinRAR、7zip等解压工具进行解压,没有解压工具的自行百度下载即可。 4、免责声明:本资源作为“参考资料”而不是“定制需求”,代码只能作为参考,不能完全复制照搬。不一定能够满足所有人的需求,需要有一定的基础能够看懂代码,能够自行调试代码并解决报错,能够自行添加功能修改代码。由于作者大厂工作较忙,不提供答疑服务,如不存在资源缺失问题概不负责,谢谢理解。
资源推荐
资源详情
资源评论
收起资源包目录
基于Matlab和YOLOv2模型实现口罩检测(源码+图片).rar (5个子文件)
基于Matlab和YOLOv2模型实现口罩检测(源码+图片)
Guide.fig 30KB
Alarm.mp3 52KB
Start.png 584KB
Guide.m 8KB
Yolo_V2Mask.m 3KB
共 5 条
- 1
资源评论
- weixin_512978262023-04-21这个资源总结的也太全面了吧,内容详实,对我帮助很大。
- weixin_412413482023-04-16资源很受用,资源主总结的很全面,内容与描述一致,解决了我当下的问题。
- lyqh20192023-05-03资源不错,内容挺好的,有一定的使用价值,值得借鉴,感谢分享。
Matlab仿真实验室
- 粉丝: 2w+
- 资源: 2180
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- python开心麻花影视作品分析程序+源码.zip
- pythonExcel数据分析师程序+源码.zip
- PlatformUI.jar 支持RCP控件环境插件
- 基于BP神经网络的回归分析,基于优化动量因子的BP神经网络,基于优化学习率的BP神经网络,基于优化隐藏层神经元的bp神经网络
- python读取excel数据Python-file-reading-master.zip
- STC15单片机串口2使用程序例子
- 读取日志的excel生成周报 用python3开发weekplan-master.zip
- python 读取excel数据导入dbimport-data-master.zip
- K折交叉验证BP神经网络,多输入多输出BP神经网络(代码完整,数据齐全)
- B07训练原图.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功