基于matlab的人脸检测,人眼检测

静悠

关注

阅读 64

2022-06-09

素材

基于matlab的人脸检测,人眼检测_指定位置

人脸检测

clear all
clc
img=imread('2.png');

detector = vision.CascadeObjectDetector;

release(detector);
detector.ClassificationModel='FrontalFaceCART'; %检测双眼
bboxes=detector(img);
EyePairBig=insertObjectAnnotation(img,'rectangle',bboxes,'face');%在指定位置上返回用矩形形状和标签注释的真彩色图像。
figure
imshow(EyePairBig);
saveas(gca, '1.jpg');

效果:
基于matlab的人脸检测,人眼检测_matlab_02
有注释,就不说别的了。

人眼检测

clear all
clc
img=imread('2.png');

detector = vision.CascadeObjectDetector;

release(detector);
detector.ClassificationModel='EyePairBig'; %检测双眼
bboxes=detector(img);
EyePairBig=insertObjectAnnotation(img,'rectangle',bboxes,'Eyes');%在指定位置上返回用矩形形状和标签注释的真彩色图像。
figure
imshow(EyePairBig);
saveas(gca, '2.jpg');

效果:
基于matlab的人脸检测,人眼检测_计算机视觉_03

参考文献

​​https://www.mathworks.com/help/vision/ref/vision.cascadeobjectdetector-system-object.html​​


精彩评论(0)

0 0 举报