当前位置: 首页 > article >正文

基于Matlab 疲劳检测系统

Matlab 疲劳检测系统【源码 GUI】

疲劳检查可以根据眼睛和嘴巴的张合度来判断是否疲劳

一、源代码

function varargout = GUI(varargin)

% GUI MATLAB code for GUI.fig

%      GUI, by itself, creates a new GUI or raises the existing

%      singleton*.

%

%      H = GUI returns the handle to a new GUI or the handle to

%      the existing singleton*.

%

%      GUI('CALLBACK',hObject,eventData,handles,...) calls the local

%      function named CALLBACK in GUI.M with the given input arguments.

%

%      GUI('Property','Value',...) creates a new GUI or raises the

%      existing singleton*.  Starting from the left, property value pairs are

%      applied to the GUI before GUI_OpeningFcn gets called.  An

%      unrecognized property name or invalid value makes property application

%      stop.  All inputs are passed to GUI_OpeningFcn via varargin.

%

%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one

%      instance to run (singleton)".

%

gui_Singleton = 1;

gui_State = struct('gui_Name',       mfilename, ...

                   'gui_Singleton',  gui_Singleton, ...

                   'gui_OpeningFcn', @GUI_OpeningFcn, ...

                   'gui_OutputFcn',  @GUI_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 GUI is made visible.

function GUI_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 GUI (see VARARGIN)

% Choose default command line output for GUI

handles.output = hObject;

% Update handles structure

guidata(hObject, handles);

% UIWAIT makes GUI wait for user response (see UIRESUME)

% uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.

function varargout = GUI_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)

str1=sprintf('思路\n\n');

str2=sprintf('           1.视频分帧\n');

str3=sprintf('           2.人脸定位\n');   

str4=sprintf('           3.人脸定位\n');

str5=sprintf('           4.灰度积分投影,定位黑色眼球面积\n');

str6=sprintf('           3.判断睁眼,闭眼,利用perclos定理判定疲劳与否\n');

str7=sprintf('           3.时间仓促,未尽事宜,可联系Q1321-8148-23\n');

string=[str1 str2 str3 str4 str5 str6 str7];

msgbox(string,'温馨提示','none');

% 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 on selection change in listbox1.

function listbox1_Callback(hObject, eventdata, handles)

% hObject    handle to listbox1 (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 listbox1 contents as cell array

%        contents{get(hObject,'Value')} returns selected item from listbox1

% --- Executes during object creation, after setting all properties.

function listbox1_CreateFcn(hObject, eventdata, handles)

% hObject    handle to listbox1 (see GCBO)

% eventdata  reserved - to be defined in a future version of MATLAB

% handles    empty - handles not created until after all CreateFcns called

% Hint: listbox 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

% 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

% --- Executes on selection change in listbox2.

% hObject    handle to listbox2 (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 listbox2 contents as cell array

%        contents{get(hObject,'Value')} returns selected item from listbox2

% --- Executes during object creation, after setting all properties.

function listbox2_CreateFcn(hObject, eventdata, handles)

% hObject    handle to listbox2 (see GCBO)

% eventdata  reserved - to be defined in a future version of MATLAB

% handles    empty - handles not created until after all CreateFcns called

% Hint: listbox 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)

% 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

% eventdata  reserved - to be defined in a future version of MATLAB

% handles    empty - handles not created until after all CreateFcns called

% Hint: listbox 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 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)

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)

% 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

二、参考运行图


http://www.kler.cn/a/369111.html

相关文章:

  • IT从业人员必备的证书有哪些?含金量超高!
  • html和css实现页面
  • 通过conda install -c nvidia cuda=“11.3.0“ 安装低版本的cuda,但是却安装了高版本的12.4.0
  • Presto
  • 如何搭建直播美颜SDK平台的最佳实践?美颜API的实现与集成详解
  • 全网最简单的Java设计模式【九】原型模式深入解析
  • 一个临床数据收集/调查问卷APP模板(streamlit+MongoDB)
  • django celery 定时任务 Crontab 计划格式
  • 无线麦克风方案芯片DSH32F3024
  • OpenCV ORB角点检测匹配和偏移计算
  • QT 机器视觉 1.相机类型
  • springboot集成camunda学习与使用
  • 微信小程序 - 图像加载时渐隐淡入效果 image,实现渐入渐出动画效果,微信小程序实现图片加载淡入淡出效果,图像加载时的渐隐淡入效果!
  • 全网最简单的Java设计模式【九】原型模式深入解析
  • 深入分析梧桐数据库SQL查询之挖掘季度销售冠军
  • 安卓14上蓝牙调用SystemProperties.set(),解决找不到SystemProperties.set()的问题
  • Ubuntu 2张4090,显卡安装,无法双屏显示
  • [产品管理-51]:产品经理:塑造未来的多面手,道、法、术、器的全面掌控
  • 【完整版】opencv-python-headless、opencv-python和opencv-contrib-python区别和联系
  • AI Weekly3:过去一周重要的AI资讯汇总
  • 记录一个docker volume映射目录创建文件报错问题
  • 量子容错计算
  • ts:数组的常用方法(filter)
  • 开源模型应用落地-Qwen2.5-7B-Instruct与vllm实现离线推理-使用Lora权重(三)
  • python包的其他安装方法:whl、.tar.gz
  • 2024 年 MathorCup 数学应用挑战赛——大数据竞赛-赛道 A:台风的分类与预测