image_rgb=imread('hqy.jpg');
image_ycbcr=rgb2ycbcr(image_rgb);
y=image_ycbcr(:,:,1);
cr=image_ycbcr(:,:,2);
cb=image_ycbcr(:,:,3);
[W,H]=size(y);
image_face=zeros(W,H);
for x1=1:W; %%%%%%%%(cb=( 100,140),cr=(70,160)
for y1=1:H;
if (cb(x1,y1)>=70)&&(cb(x1,y1)<=140)&&(cr(x1,y1)>=80)&&(cr(x1,y1)<=170)
image_face(x1,y1)=0;
else
image_face(x1,y1)=255;
end
end
end
figure(1),imshow(image_face)
se1=strel('square',35); %%%%%%%%% 找到人脸区域并设为白色%%%% (r=35)
fo=imclose(image_face,se1);
figure(2),imshow(fo)
log=logical(fo);
r=image_rgb(:,:,1);
g=image_rgb(:,:,2);
b=image_rgb(:,:,3);
r(log==0)=255;
g(log==0)=255;
b(log==0)=255;
face_rgb=cat(3,r,g,b);
figure(3),imshow(face_rgb),title('face_rgb');
afm = rgb2gray(face_rgb); %%%%%人眼定位
figure(4), imshow(afm), title('surface image');
这是一个 从图像中提取人脸 和定位出人眼的程序 运行后一共有4幅图像 我想问这4图像是什么图像
谢谢啊 很全面 大概能看懂 我还有几个问题要请教下你 加下QQ 562174452
追答能不能麻烦你把整个检测眼睛的程序给我 我想学习一下。
如果还是半成品就算了 我的邮箱是这个 [email protected] 谢谢 哈哈!