资源简介
源码有日本人数据集train和test2个数据集,主要m文件包括两个一个是detectface函数,负责检测人脸的相应特征;另一个是eigenface负责应用算法来分析人脸的相应表情
代码片段和文件信息
% Tolga Birdal‘s original code is heavily modified by Md. Iftekhar Tanveer
% (go2chayan@gmail.com)
% Modifications by Md. Iftekhar Tanveer:
% code optimized for the following assumptions:
% 1. Only one face in scene and it is the primary object
% 2. Faster noise reducion and face detection
% Originaly by Tolga Birdal
% Implementation of the paper:
% “A simple and accurate face detection algorithm in complex background“
% by Yu-Tang Pai Shanq-Jang Ruan Mon-Chau Shie Yi-Chi Liu
% Additions by Tolga Birdal:
% Minimum face size constraint
% Adaptive theta thresholding (Theta is thresholded by mean2(theata)/4
% Parameters are modified by to detect better. Please check the paper for
% parameters they propose.
% Check the paper for more details.
% usage:
% I=double(imread(‘c:\Data\girl1.jpg‘));
% detect_face(I);
% The function will display the bounding box if a face is found.
function [aaSN_fillFaceDat]=detect_face(I)
close all;
% No faces at the beginning
Faces=[];
numFaceFound=0;
I=double(I);
H=size(I1);
W=size(I2);
%%%%%%%%%%%%%%%%%% LIGHTING COMPENSATION %%%%%%%%%%%%%%%
C=255*imadjust(I/255[0.3;1][0;1]);
% figureimshow(C/255);
% title(‘Lighting compensation‘);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%% EXTRACT SKIN %%%%%%%%%%%%%%%%%%%%%%
YCbCr=rgb2ycbcr(C);
Cr=YCbCr(::3);
S=zeros(HW);
[SkinIndexRowSkinIndexCol] =find(10 for i=1:length(SkinIndexRow)
S(SkinIndexRow(i)SkinIndexCol(i))=1;
end
m_S = size(S);
S(m_S(1)-7:m_S(1):) = 0;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%% REMOVE NOISE %%%%
% figure;imshow(S);
SN=zeros(HW);
for i=1:H-5
for j=1:W-5
localSum=sum(sum(S(i:i+4 j:j+4)));
SN(i:i+5 j:j+5)=(localSum>20);
end
end
% figure;imshow(SN);
Iedge=edge(uint8(SN));
% figure;imshow(Iedge);
SE = strel(‘square‘9);
SN_edge = (imdilate(IedgeSE));
%
% SN_edge = SN_edge1.*SN;
% figure;imshow(SN_edge);
SN_fill = imfill(SN_edge‘holes‘);
% figure;imshow(SN_fill);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%% FIND SKIN COLOR BLOCKS %%%%
[LlenRegions] = bwlabel(SN_fill4);
AllDat = regionprops(L‘BoundingBox‘‘FilledArea‘);
AreaDat = cat(1 AllDat.FilledArea);
[maxArea maxAreaInd] = max(AreaDat);
FaceDat = AllDat(maxAreaInd);
FaceBB = [FaceDat.BoundingBox(1)FaceDat.BoundingBox(2)...
FaceDat.BoundingBox(3)-1FaceDat.BoundingBox(4)-1];
aa=imcrop(rgb2gray(uint8(I)).*uint8(SN_fill)FaceBB);
% figureimshow(aa);
% title(‘Identified Face‘);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2753 2009-04-22 23:01 人脸表情识别的源代码\detect_face.m
文件 1033707 2009-04-20 15:11 人脸表情识别的源代码\EigenFace.ctf
文件 5763 2009-04-20 14:43 人脸表情识别的源代码\EigenFace.m
文件 11524 2009-04-20 15:11 人脸表情识别的源代码\EigenFace.xex
文件 33261 2009-04-22 23:08 人脸表情识别的源代码\ex
文件 1018 2009-04-20 13:49 人脸表情识别的源代码\LabelFile.txt
文件 1364 2009-05-20 11:30 人脸表情识别的源代码\license.txt
文件 1818 2009-04-20 16:25 人脸表情识别的源代码\README- How to Run.txt
文件 56944 2009-04-18 10:17 人脸表情识别的源代码\Test\Image001.jpg
文件 57198 2009-04-18 10:17 人脸表情识别的源代码\Test\Image002.jpg
文件 57554 2009-04-18 10:17 人脸表情识别的源代码\Test\Image003.jpg
文件 56881 2009-04-18 10:17 人脸表情识别的源代码\Test\Image004.jpg
文件 56004 2009-04-18 10:17 人脸表情识别的源代码\Test\Image005.jpg
文件 48005 2009-04-18 10:17 人脸表情识别的源代码\Test\Image006.jpg
文件 56704 2009-04-18 10:17 人脸表情识别的源代码\Test\Image007.jpg
文件 57739 2009-04-18 10:17 人脸表情识别的源代码\Test\Image008.jpg
文件 56293 2009-04-18 10:17 人脸表情识别的源代码\Test\Image009.jpg
文件 57995 2009-04-18 10:17 人脸表情识别的源代码\Test\Image010.jpg
文件 57025 2009-04-18 10:17 人脸表情识别的源代码\Test\Image011.jpg
文件 58108 2009-04-18 10:17 人脸表情识别的源代码\Test\Image012.jpg
文件 56482 2009-04-18 10:17 人脸表情识别的源代码\Test\Image013.jpg
文件 54871 2009-04-18 10:17 人脸表情识别的源代码\Test\Image014.jpg
文件 56865 2009-04-18 10:17 人脸表情识别的源代码\Test\Image015.jpg
文件 57803 2009-04-18 10:17 人脸表情识别的源代码\Test\Image016.jpg
文件 56164 2009-04-18 10:17 人脸表情识别的源代码\Test\Image017.jpg
文件 55699 2009-04-18 10:17 人脸表情识别的源代码\Test\Image018.jpg
文件 57196 2009-04-18 10:17 人脸表情识别的源代码\Test\Image019.jpg
文件 57335 2009-04-18 10:17 人脸表情识别的源代码\Test\Image020.jpg
文件 58031 2009-04-18 10:17 人脸表情识别的源代码\Test\Image021.jpg
文件 57715 2009-04-18 10:17 人脸表情识别的源代码\Test\Image022.jpg
............此处省略67个文件信息
评论
共有 条评论