资源简介
基于训练卷积神经网络alexnet的人脸识别设计,并采用级联目标检测技术对裁剪人脸进行识别。使用函数capturefacesfromvideo.m从视频获取训练数据,并存储人脸图像。使用函数cropface.m从训练数据的图像中裁剪人脸。通过改变各层的数量来训练卷积神经网络alexnet。使用训练后的newnet实现人脸识别。
代码片段和文件信息
% Create the face detector object.
faceDetector = vision.CascadeobjectDetector(‘FrontalFaceCART‘‘MinSize‘[150150]);
% Here the loop runs for 300 times you can change the threshold (n) based on the number of training data you need
n = 300;
% change str to s01s02s03.... for saving upto how many subjects you want to save for saving in respective folders for
% imwrite in line 88
str = ‘s01‘;
% Create the point tracker object.
pointTracker = vision.PointTracker(‘MaxBidirectionalError‘ 2);
% Create the webcam object.
cam = webcam();
% Capture one frame to get its size.
videoframe = snapshot(cam);
frameSize = size(videoframe);
% Create the video player object.
videoPlayer = vision.VideoPlayer(‘Position‘ [100 100 [frameSize(2) frameSize(1)]+30]);
runLoop = true;
numPts = 0;
frameCount = 0;
i=1;
while runLoop && frameCount < n
% Get the next frame.
videoframe = snapshot(cam);
videoframeGray = rgb2gray(videoframe);
frameCount = frameCount + 1;
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‘ 1 []);
% Display a bounding box around the detected face.
videoframe = insertShape(videoframe ‘Polygon‘ bboxPolygon ‘LineWidth‘ 3);
% Display detected corners.
videoframe = insertMarker(videoframe xyPoints ‘+‘ ‘Color‘ ‘white‘);
end
else
% Tracking mode.
[xyPoints isFound] = step(pointTracker videoframeGray);
visiblePoints = xyPoints(isFound :);
oldInliers = oldPoints(isFound :);
numPts = size(visiblePoints 1);
if numPts >= 10
% Estimate the geometric transformation between the old points
% and the new points.
[xform oldInliers visiblePoints] = estimateGeometricTransform(...
oldInliers visiblePoints ‘similarity‘ ‘MaxDistance‘ 4);
% Apply the transformation to the bounding box.
bboxPoints = transformPointsForward(xform bboxPoints);
%
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-07-09 08:20 Yash0330-Face-Recognition-by-CNN-464efe8\
文件 538 2019-07-09 08:20 Yash0330-Face-Recognition-by-CNN-464efe8\README.md
文件 1696 2019-07-09 08:20 Yash0330-Face-Recognition-by-CNN-464efe8\SimpleFaceRecognition.m
目录 0 2019-07-09 08:20 Yash0330-Face-Recognition-by-CNN-464efe8\Training Progress Report\
文件 136452 2019-07-09 08:20 Yash0330-Face-Recognition-by-CNN-464efe8\Training Progress Report\Training Progress Plot.JPG
文件 212 2019-07-09 08:20 Yash0330-Face-Recognition-by-CNN-464efe8\Training Progress Report\Training Progress Report.txt
文件 3993 2019-07-09 08:20 Yash0330-Face-Recognition-by-CNN-464efe8\capturefacesfromvideo.m
文件 276 2019-07-09 08:20 Yash0330-Face-Recognition-by-CNN-464efe8\cropandsave.m
文件 276 2019-07-09 08:20 Yash0330-Face-Recognition-by-CNN-464efe8\cropface.m
目录 0 2019-07-09 08:20 Yash0330-Face-Recognition-by-CNN-464efe8\croppedfaces\
文件 181 2019-07-09 08:20 Yash0330-Face-Recognition-by-CNN-464efe8\croppedfaces\readme.txt
目录 0 2019-07-09 08:20 Yash0330-Face-Recognition-by-CNN-464efe8\croppedfaces\s01\
文件 181 2019-07-09 08:20 Yash0330-Face-Recognition-by-CNN-464efe8\croppedfaces\s01\readme.txt
目录 0 2019-07-09 08:20 Yash0330-Face-Recognition-by-CNN-464efe8\croppedfaces\s02\
文件 181 2019-07-09 08:20 Yash0330-Face-Recognition-by-CNN-464efe8\croppedfaces\s02\readme.txt
目录 0 2019-07-09 08:20 Yash0330-Face-Recognition-by-CNN-464efe8\croppedfaces\s03\
文件 181 2019-07-09 08:20 Yash0330-Face-Recognition-by-CNN-464efe8\croppedfaces\s03\readme.txt
目录 0 2019-07-09 08:20 Yash0330-Face-Recognition-by-CNN-464efe8\photos\
文件 165 2019-07-09 08:20 Yash0330-Face-Recognition-by-CNN-464efe8\photos\readme.txt
目录 0 2019-07-09 08:20 Yash0330-Face-Recognition-by-CNN-464efe8\photos\s01\
文件 165 2019-07-09 08:20 Yash0330-Face-Recognition-by-CNN-464efe8\photos\s01\readme.txt
目录 0 2019-07-09 08:20 Yash0330-Face-Recognition-by-CNN-464efe8\photos\s02\
文件 165 2019-07-09 08:20 Yash0330-Face-Recognition-by-CNN-464efe8\photos\s02\readme.txt
目录 0 2019-07-09 08:20 Yash0330-Face-Recognition-by-CNN-464efe8\photos\s03\
文件 165 2019-07-09 08:20 Yash0330-Face-Recognition-by-CNN-464efe8\photos\s03\readme.txt
- 上一篇:蓝桥杯单片机
- 下一篇:IEEE 1471 软件架构标准
相关资源
-
haarcascade_frontalface_default.xm
l - 人脸识别在arm板上的实现
- 基于 springboot2.0 实现的人脸识别登陆
- 人脸识别毕业设计
- 活体检测H5文档及--人脸识别
- OpenCV人脸识别包含数据集的txt文件
- AdaBoost人脸识别完整实现(含特征提取
- 带GUI的人脸识别软件系统
- 人脸识别完整代码包括PCA_LDA算法
- 人脸检测英文文献 人脸识别最新英文
- 人脸识别技术综述和应用
- OpenCV人脸识别训练集
- opencv3.4.1人脸识别小程序
- OpenCVForUnity2.2.4
- TensorFlow实现人脸识别(5)-------利用
- TensorFlow实现人脸识别(1)------Linux下
- 关于人脸识别的相关论文
- 人脸识别文献综述
- ARM上利用opencv实现人脸识别
- 基于SSM框架的百度人脸识别
- 基于KCCA的特种融合方法
- CASIA-WebFace.txt
- 利用百度人脸识别API和pyqt5实现基于人
- shibie.zip
- 人脸识别需要的haarcascade_frontalface_d
- FER2013数据集
- AR开发实战项目之人脸识别实现换脸、
- 人脸识别(Web人脸检测数据采集部分
- 基于深度学习的人脸识别
- opencv人脸识别源码
评论
共有 条评论