资源简介
人脸表情识别的matlab程序,内附运行说明与测试数据库。
代码片段和文件信息
% 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
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2014-03-26 20:03 EigenFace\
文件 760151 2014-03-06 15:47 EigenFace\EigenFace.ctf
文件 10488 2014-03-06 15:47 EigenFace\EigenFace.exe
文件 5763 2009-04-21 02:43 EigenFace\EigenFace.m
文件 11524 2009-04-21 03:11 EigenFace\EigenFace.xex
文件 33261 2009-04-23 11:08 EigenFace\ex
文件 1018 2009-04-21 01:49 EigenFace\LabelFile.txt
文件 1573 2014-03-10 19:32 EigenFace\README- How to Run.txt
目录 0 2014-03-26 20:02 EigenFace\Test\
文件 56944 2009-04-18 22:17 EigenFace\Test\Image001.jpg
文件 57198 2009-04-18 22:17 EigenFace\Test\Image002.jpg
文件 57554 2009-04-18 22:17 EigenFace\Test\Image003.jpg
文件 56881 2009-04-18 22:17 EigenFace\Test\Image004.jpg
文件 56004 2009-04-18 22:17 EigenFace\Test\Image005.jpg
文件 48005 2009-04-18 22:17 EigenFace\Test\Image006.jpg
文件 56704 2009-04-18 22:17 EigenFace\Test\Image007.jpg
文件 57739 2009-04-18 22:17 EigenFace\Test\Image008.jpg
文件 56293 2009-04-18 22:17 EigenFace\Test\Image009.jpg
文件 57995 2009-04-18 22:17 EigenFace\Test\Image010.jpg
文件 57025 2009-04-18 22:17 EigenFace\Test\Image011.jpg
文件 58108 2009-04-18 22:17 EigenFace\Test\Image012.jpg
文件 56482 2009-04-18 22:17 EigenFace\Test\Image013.jpg
文件 54871 2009-04-18 22:17 EigenFace\Test\Image014.jpg
文件 56865 2009-04-18 22:17 EigenFace\Test\Image015.jpg
文件 57803 2009-04-18 22:17 EigenFace\Test\Image016.jpg
文件 56164 2009-04-18 22:17 EigenFace\Test\Image017.jpg
文件 55699 2009-04-18 22:17 EigenFace\Test\Image018.jpg
文件 57196 2009-04-18 22:17 EigenFace\Test\Image019.jpg
文件 57335 2009-04-18 22:17 EigenFace\Test\Image020.jpg
文件 58031 2009-04-18 22:17 EigenFace\Test\Image021.jpg
文件 57715 2009-04-18 22:17 EigenFace\Test\Image022.jpg
............此处省略67个文件信息
- 上一篇:matlab及有限元书及源程序
- 下一篇:先进PID控制Matlab仿真第三版
相关资源
- 先进PID控制Matlab仿真第三版
- matlab及有限元书及源程序
- MIMO和OFDM及matlab实现
- Matlab调用REFPROP完全说明
- matlab深度学习资源
- matlab语音识别含界面
- 经典SVM算法多类分类matlab程序
- Matlab Deep Learning ebook Phil Kim
- 随机森林用于分类matlab代码
- matlab R2014b 解决mcc不可用的补丁
- matlab2014a完全破解用
- 车道保持.zip
- 语音识别matlab GUI
- matlab图论以及图论软件
- Matlab车牌识别系统含GUI界面
- 分数阶工具箱.rar
- MATLAB数学建模算法及分析.zip
- 时钟同步MATLAB实现
- 基于Matlab的人脸识别算法设计
- 相位法雷达测角研究以及matlab仿真
- MATLAB在电气工程中的应用ppt
- 图像处理-边缘检测和特征提取MATLAB源
- RSIHE的MATLAB源代码
- MATLAB人脸识别和人眼跟踪程序包
- 基于PCA的人脸识别matlab)
- 点云数据栅格化matlab代码
- 现代数字图像处理技术提高及应用案
- 支持向量机SVM和核函数的matlab程序代
- GA算法解决TSP问题(超完整版)(ma
- 自适应局部迭代滤波(Adaptive local i
评论
共有 条评论