Matlab程序和运行界面
运用matlab仿真进行人脸检测定位实例
学生姓名:郭明明 学号:20085101062
计算机与信息技术学院 计算机科学与技术
指导教师:刘道华 职称:副教授
人脸检测定位程序:
%%%%% Reading of a RGB image
i=imread('face1.jpg');
I=rgb2gray(i);
BW=im2bw(I);
figure,imshow(BW)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% minimisation of background portion
[n1 n2]=size(BW);
r=floor(n1/10);
c=floor(n2/10);
x1=1;x2=r;
s=r*c;
for i=1:10
y1=1;y2=c;
for j=1:10
if (y2<=c | y2>=9*c) | (x1==1 | x2==r*10)
loc=find(BW(x1:x2, y1:y2)==0);
[o p]=size(loc);


