【人脸识别】基于matlab二值膨胀差分和椒盐滤波教室内人数统计【含Matlab源码 251期】
一、获取代码方式
获取代码方式1:
完整代码已上传我的资源:【人脸识别】基于matlab二值膨胀差分和椒盐滤波教室内人数统计【含Matlab源码 251期】
获取代码方式2:
通过订阅紫极神光博客付费专栏,凭支付凭证,私信博主,可获得此代码。
备注:
订阅紫极神光博客付费专栏,可免费获得1份代码(有效期为订阅日起,三天内有效);
二、简介
1 课题介绍
我国人数基数大,各个公共场合的人数是一个十分重要的信息,也是人们一直关注的话题。教室作为其中一个十分特殊的公共场合,它的人数有着很重要的现实意义。比如在无人或者人数比较少的教室可以做到远程控制空调和风扇以及电灯数量,节约能源的目的;统计高校学生逃课比例,目前目前老师往往采取手工点名,效率低下,或者存在替代点名的情况,导致数据不可靠;高校或者社会中教室资源紧张,很多场所的教室面临一座难求,如果有一套行之有效的教室人数统计系统,可以合理地分配社会资源,让资源得到充分的利用;讲座时,参与人数可以充分反映讲座人的受欢迎程度,客观反映真实情况等等。
该课题为基于MATLAB的二值膨胀差分和椒盐滤波教室人数统计,实现教室人数的计数统计,进而统计出勤率,上课认真听讲的比例。原先预设总人数,未出勤或者书本遮住脸部、趴着玩手机等必然无法采集到人脸,从而对应数量缺失,得出出勤率或听讲率。该课题采用肤色原理进行人脸定位和人脸分割。
2 基本流程
读入图片(或调用笔记本自带摄像头),灰度处理,转YcbCr,二值膨胀差分、椒盐滤波,人脸区域定位,计数。
三、部分源代码
function varargout = Itelli_Classroom(varargin)
% ITELLI_CLASSROOM MATLAB code for Itelli_Classroom.fig
% ITELLI_CLASSROOM, by itself, creates a new ITELLI_CLASSROOM or raises the existing
% singleton*.
%
% H = ITELLI_CLASSROOM returns the handle to a new ITELLI_CLASSROOM or the handle to
% the existing singleton*.
%
% ITELLI_CLASSROOM('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in ITELLI_CLASSROOM.M with the given input arguments.
%
% ITELLI_CLASSROOM('Property','Value',...) creates a new ITELLI_CLASSROOM or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before Itelli_Classroom_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to Itelli_Classroom_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 Itelli_Classroom
% Last Modified by GUIDE v2.5 18-Oct-2013 17:01:17
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @Itelli_Classroom_OpeningFcn, ...
'gui_OutputFcn', @Itelli_Classroom_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 Itelli_Classroom is made visible.
function Itelli_Classroom_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 Itelli_Classroom (see VARARGIN)
% Choose default command line output for Itelli_Classroom
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes Itelli_Classroom wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = Itelli_Classroom_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;
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
四、运行结果
五、matlab版本及参考文献
1 matlab版本
2014a
2 参考文献
[1] 蔡利梅.MATLAB图像处理——理论、算法与实例分析[M].清华大学出版社,2020.
[2]杨丹,赵海滨,龙哲.MATLAB图像处理实例详解[M].清华大学出版社,2013.
[3]周品.MATLAB图像处理与图形用户界面设计[M].清华大学出版社,2013.
[4]刘成龙.精通MATLAB图像处理[M].清华大学出版社,2015.
文章来源: qq912100926.blog.csdn.net,作者:海神之光,版权归原作者所有,如需转载,请联系作者。
原文链接:qq912100926.blog.csdn.net/article/details/113751357
- 点赞
- 收藏
- 关注作者
评论(0)