基于Matlab 疲劳检测系统

server/2024/10/24 5:34:51/

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.ppmy.cn/server/134358.html

相关文章

安全见闻(3)——开阔眼界,不做井底之蛙

内容预览 ≧∀≦ゞ 安全见闻三:脚本程序与病毒声明导语脚本语言BAT/PowerShell脚本木马与宏病毒脚本病毒BIOS病毒 结语 安全见闻三:脚本程序与病毒 声明 学习视频来自B站UP主 泷羽sec,如涉及侵权马上删除文章 笔记的只是方便各位师傅学习知识,以下网站只…

faiss向量数据库实现rag

1)环境准备 !pip install sentence-transformers transformers faiss-gpu 2)代码实现 import faiss import numpy as np from sentence_transformers import SentenceTransformer from transformers import GPT2LMHeadModel, GPT2Tokenizer# 1. 加载 …

ubuntu clash 配合smartdns

下载安装clash 下载安装smartdns github 下载地址 配置 配置smartdns 设置smartdns配置端口,修改为没有占用的端口号,其他的都不用修改,官方推荐默认参数最佳! 编辑vim /etc/smartdns/smartdns.conf server-name smartdns b…

Mac book英特尔系列?M系列?两者有什么区别呢

众所周知,Mac book有M系列,搭载的是苹果自研的M芯片,也有着英特尔系列,搭载的是英特尔的处理器,虽然从 2020 年开始,苹果公司逐步推出了自家研发的 M 系列芯片,并逐渐将 MacBook 产品线过渡到 M…

探索云计算:AWS、Azure、GCP云服务提供商详解

随着信息技术的飞速发展,云计算已成为企业数字化转型的重要支撑。AWS、Azure和GCP是当前市场上三大主要云服务提供商。本文将详细介绍这三大云服务提供商的特点、服务和使用案例,帮助企业和开发者更好地选择适合自己的云服务。 一、AWS(Amazon Web Services) AWS 是亚马逊…

【Golang】Golang的GC垃圾回收机制

文章目录 前言一、介绍二、代码解释三、GC优化方式四、总结 前言 在现代编程语言中,垃圾回收(Garbage Collection, GC)机制是一个至关重要的特性。它帮助开发者自动管理内存,避免内存泄漏和悬挂指针等问题。Go 语言(G…

石油、电力喷火清障无人机技术详解

石油、电力喷火清障无人机技术是一种利用无人机搭载火焰喷射装置进行高空作业的技术,主要用于清除石油、电力等领域中的障碍物。以下是对该技术的详细解析: 一、技术概述 喷火清障无人机通过在无人机上安装火焰喷射装置,利用加压火来瞄准并…

多IP访问多网段实验

文章目录 多IP访问多网段实验 多IP访问多网段实验 在当前主机配置多个IP地址,实现多IP访问多网段,记录所有命令及含义 1,环境搭建: [rootlocalhost ~]# mount /dev/sr1 /mnt # 设置ISO虚拟镜像文件文件挂载点,将…