资源简介
基于Matlab的代码,有兴趣的朋友可以下着看看,反正也才1分,亏也亏不了
![](http://www.nz998.com/pic/59396.jpg)
代码片段和文件信息
%% detectAndTrackFaces
% Automatically detects and tracks multiple faces in a webcam-acquired
% video stream.
%
% Copyright 2013-2014 The MathWorks Inc
clear classes;
%% Instantiate video device face detector and KLT object tracker
vidObj = webcam;
faceDetector = vision.CascadeobjectDetector(); % Finds faces by default
tracker = MultiobjectTrackerKLT;
%% Get a frame for frame-size information
frame = snapshot(vidObj);
frameSize = size(frame);
%% Create a video player instance
videoPlayer = vision.VideoPlayer(‘Position‘[200 100 fliplr(frameSize(1:2)+30)]);
%% Iterate until we have successfully detected a face
bboxes = [];
while isempty(bboxes)
framergb = snapshot(vidObj);
frame = rgb2gray(framergb);
bboxes = faceDetector.step(frame);
end
tracker.addDetections(frame bboxes);
%% And loop until the player is closed
frameNumber = 0;
keepRunning = true;
disp(‘Press Ctrl-C to exit...‘);
while keepRunning
framergb = snapshot(vidObj);
frame = rgb2gray(framergb);
if mod(frameNumber 10) == 0
% (Re)detect faces.
%
% NOTE: face detection is more expensive than imresize; we can
% speed up the implementation by reacquiring faces using a
% downsampled frame:
% bboxes = faceDetector.step(frame);
bboxes = 2 * faceDetector.step(imresize(frame 0.5));
if ~isempty(bboxes)
tracker.addDetections(frame bboxes);
end
else
% Track faces
tracker.track(frame);
end
% Display bounding boxes and tracked points.
displayframe = insertobjectAnnotation(framergb ‘rectangle‘...
tracker.Bboxes tracker.BoxIds);
displayframe = insertMarker(displayframe tracker.Points);
videoPlayer.step(displayframe);
frameNumber = frameNumber + 1;
end
%% Clean up
release(videoPlayer);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1921 2016-09-01 11:27 detectAndTrackFaces.m
文件 7988 2016-09-01 11:27 Multiob
文件 1526 2016-09-01 11:27 license.txt
- 上一篇:指纹识别代码
- 下一篇:PCA Matlab源码
相关资源
- MATLAB 人脸检测定位算法
- 基于肤色模型的人脸检测MATLAB代码
- 人脸检测matlab编写
- 车牌识别与人脸定位matlab
- 基于AdaBoost算法的人脸检测,matlab实现
- 基于模板匹配的人脸检测实现-MATLAB
- 人脸检测三个不同小程序,matlab,其
- 基于SVM+HOG的人脸检测matlab程序
- 基于haar特征+AdaBoost,CascadeBoost算法的
- 人脸人眼定位算法matlab实现代码
- 基于模板匹配的人脸检测-教程-matla
- MATLAB的人脸检测程序程序源码,代码
- 人脸检测,五官检测 matlab
- 基于HaarLike的人脸检测
- adaboost人脸检测算法
- 基于神经网络的人脸识别/检测MATLAB模
- 人脸检测源码 face detection source code
- 人脸检测与MATLAB实现
- matlab人眼检测代码
- 基于肤色的人脸检测matlab代码
- 基于肤色的人脸检测
- 基于肤色的简易人脸检测
- matlab 人脸检测
- MATLAB基于肤色模型和模板匹配的人脸
- matlab基于笔记本电脑的摄像头的人脸
- matlab实现人脸检测并提取摄像头检测
- 基于卡尔曼滤波的视频人脸跟踪MATL
- 快速人脸定位matlab程序
- matlab人脸归一化)_人眼定位,缩放。
- matlab实现RGB、HSI、YCbCr之间的转换以及
评论
共有 条评论