资源简介
使用matlab打开笔记本自带的摄像头进行实时人脸识别。修改了matlab示例程序,具有较好的实时性和鲁棒性,能够在光线充足的环境下稳定识别并跟踪。注:若未在matlab中使用过摄像头,需要在matlab中首先手动联网下载安装笔记本自带摄像头的支持包,否则可能无法识别自带的摄像头
代码片段和文件信息
% 2017-05-22 by LSS
% Live Face Detection
% Need to manually install support package (OS Generic Video Interface)
vidDevice = imaq.VideoDevice(‘winvideo‘ 1 ‘MJPG_320x240‘ ...
‘ROI‘ [1 1 320 240] ...
‘ReturnedColorSpace‘ ‘rgb‘ ...
‘DeviceProperties.Brightness‘ 8 ...
‘DeviceProperties.Sharpness‘ 8);
hVideoIn = vision.VideoPlayer;
hVideoIn.Name = ‘Input Video‘;
hVideoOut = vision.VideoPlayer;
hVideoOut.Name = ‘Output Video‘;
faceDetector = vision.CascadeobjectDetector();
pointTracker = vision.PointTracker(‘MaxBidirectionalError‘ 2);
numPts = 0;
while 1
videoframe = step(vidDevice);
videoframeOutput = videoframe;
videoframeGray = rgb2gray(videoframe);
if numPts < 10
% Detection mode.
bbox = faceDetector.step(videoframeGray);
if ~isempty(bbox)
% Find corner points inside the detected region.
points = detectMinEigenFeatures(videoframeGray ‘ROI‘ bbox(1 :));
% Re-initialize the point tracker.
xyPoints = points.Location;
numPts = size(xyPoints1);
release(pointTracker);
initialize(pointTracker xyPoints videoframeGray);
% Save a copy of the points.
oldPoints = xyPoints;
% Convert the rectangle represented as [x y w h] into an
% M-by-2 matrix of [xy] coordinates of the four corners. This
% is needed to be able to transform the bounding box to display
% the orientation of the face.
bboxPoints = bbox2points(bbox(1 :));
% Convert the box corners into the [x1 y1 x2 y2 x3 y3 x4 y4]
% format required by insertShape.
bboxPolygon = reshape(bboxPoints‘
相关资源
- 粒子群Matlab
- 已知函数及区间,求区间内极值 mat
- 人工智能八数码问题过程表示求解m
- 用matlab实现三步搜索法
- 使用matlab批量删除txt文件中的连续的
- 根据面积或者边长求最小包围盒
- kernel function_matlab
- MATLAB在数学建模中的应用上下PDF 源程
- vicsek模型仿真-matlab代码
- matlab实现从txt中读取16进制数据并转换
- 三维粒子群算法的matlab实现 源代码带
- 二进制引力搜索算法BGSAmatlab程序
- 万有引力算法GSA-matlab程序
- poblano_toolbox_1.1.zip
- MATLAB环境下的船用柴油机故障诊断的
- 机械臂阻抗控制Matlab仿真
- Jacobi迭代算法
- MATLAB图片批量归一化
- 选择性搜索的matlab源代码
- matlab各个版本安装包以及破解文件
- CW HFM LFM宽带模糊函数仿真代码.m
- 模式识别matlab:最小错误率、最小风
- 基于MATLAB实现的说话人识别程序,分
- 一个声纹识别的全代码matlab
- 直流电机双闭环调试
-
单相逆变器驱动simuli
nk仿真 - ntripclient-MATLAB
- gui_mainfcn.m
- MATLAB图局部放大函数
- MATLAB 对离散点进行圆拟合
评论
共有 条评论