操作过程:
Matlab人脸检测方法(Face Parts Detection)详解
链接上的代码我一直没反应,然后改了一个函数,终于成功了,耶!
stImageFilePath = 'E:\shujuku\input\006\006_1_2\'; %图片识别地址
stImageSavePath = 'E:\Face_Detection\'; %图片存放地址
dirImagePathList = dir(fullfile(stImageFilePath,'*.jpg')); %读取该文件夹下所有图片的路径(字符串格式)
iImageNum = length(dirImagePathList); %获取图片的总数量
if iImageNum > 0 %批量读入图片,进行五官检测,再批量检测
for i = 1 : iImageNum
iSaveNum = int2str(i);
stImagePath = dirImagePathList(i).name;
mImageCurrent = imread(strcat(stImageFilePath,stImagePath));
%%%%%%%%%%%%%%%%%%%%将灰度图变为三通道图%%