我正在使用Matlab进行人脸检测项目。我已经快到了,但我无法正确表示最后的结果。我给了代码。我是matlab的新手。请帮忙... [英] I am doing a project in face detection using Matlab. I have reached almost the end but I am not able to represent the last result properly. I have given the code . I am new to matlab. Please help...
本文介绍了我正在使用Matlab进行人脸检测项目。我已经快到了,但我无法正确表示最后的结果。我给了代码。我是matlab的新手。请帮忙...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
load('sample','image1');
for i=1:3
temp=cell2mat(image1(1,i));
imshow(temp);
s=~temp;
figure(7),imshow(s);
t1=imfill(s,'holes');
figure(8),imshow(t1);
bound=bwboundaries(t1);
figure(9),imshow(t1);
bound=bwboundaries(t1);
[row1,col1]=size(bound);
for j=1:row1
bound3=cell2mat(bound(j,1));
[row(1,j),col(1,j)]=size(bound3);
end
temp1=row(1,1);
num=1;
for j=2:row1
if(row(1,j)>temp1)
temp1=row(1,j);
num=j;
end
end
bound1=bound(num);
bound2=cell2mat(bound1);
n1=size(bound2);
n=n1(1,1);
for k=1:102
z(k)=0;
end
for k=1:102
for m=1:n
p=bound2(m,1);
q=bound2(m,2);
t=complex(p,q);
z(k)=z(k)+t*exp(-(i*2*pi*k*m)/n);
end
end
d=abs(z(2));
c=c/d;
for k=3:102
p1(k-2)=c(k);
end
dict1(1,i)={p1};
end
save('DD','dict1');
load DD;
M=cell2mat(dict1);
[X,map]=gray2ind(M);
save('AA','X');
load AA;
image(X);
colormap(map);
%image(X);colormap(map);
%figure(10),image(M);
%colormap(map);
%figure(10),imagesc(I);colormap(gray);
%I=ind2gray(X,map);
%figure(10),imshow(X,map),figure(11),imshow(I);
推荐答案
这篇关于我正在使用Matlab进行人脸检测项目。我已经快到了,但我无法正确表示最后的结果。我给了代码。我是matlab的新手。请帮忙...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文