How to extract eye from a facial image?
Mostrar comentarios más antiguos
Hi. I have a big problem. I wanna extract eyes from a facial image an I've written some codes for it. Unfortunately, the result is not reasonable. for the first step, I need to choose the eye's region. The result of this stage must be at the line 50, means subplot(4,4,10). But it's not acceptable and I don't have the eye region. Would any one please tell me what's the problem here?
if true
% i=imread('pic8.jpg');
subplot(4,4,1)
imshow(i)
title('original image');
iycbcr=rgb2ycbcr(i);
iycbcr = im2double(iycbcr);
subplot(4,4,2)
imshow(iycbcr)
title('YCBCR space');
y=iycbcr(:,:,1);
cb=iycbcr(:,:,2);
cr=iycbcr(:,:,3);
ccb=cb.^2;
subplot(4,4,3)
imshow(ccb)
title('CB^2');
ccr=(1-cr).^2;
subplot(4,4,4)
imshow(ccr)
title('(1-CR)^2');
cbcr=ccb./cr;
subplot(4,4,5)
imshow(cbcr)
title('CB/CR');
igray=rgb2gray(i);
subplot(4,4,6)
imshow(igray)
title('Gray space');
g=1./3;
l=g*ccb;
m=g*ccr;
n=g*cbcr;
eyemapchr=l+m+n;
subplot(4,4,7)
imshow(eyemapchr)
title('Chrom Eyemap');
J=histeq(eyemapchr);
subplot(4,4,8)
imshow(J)
title('Equalized image');
SE=strel('disk',15,8);
o=imdilate(igray,SE);
p=1+imerode(igray,SE);
eyemaplum=o./p;
subplot(4,4,9)
imshow(eyemaplum)
title('Lum Eyemap');
%the eye region
cc=and(J,eyemaplum);
subplot(4,4,10)
imshow(cc)
title('AND of Lum&Chrom');
end
3 comentarios
Zahra kamkar
el 17 de Mzo. de 2014
Zahra kamkar
el 17 de Mzo. de 2014
Zahra kamkar
el 17 de Mzo. de 2014
Respuesta aceptada
Más respuestas (4)
Zahra kamkar
el 15 de Mzo. de 2014
0 votos
2 comentarios
Image Analyst
el 16 de Mzo. de 2014
You still forgot. Please don't add "Answers" to your question. Add comments to our Answers.
Zahra kamkar
el 17 de Mzo. de 2014
Zahra kamkar
el 15 de Mzo. de 2014
0 votos
1 comentario
Image Analyst
el 16 de Mzo. de 2014
It's still not here.
Zahra kamkar
el 16 de Mzo. de 2014
0 votos
2 comentarios
Image Analyst
el 16 de Mzo. de 2014
Maybe people are waiting for you to attach the image so they can run your code. Use the image icon or the paperclip icon or both.
Zahra kamkar
el 18 de Mzo. de 2014
Mohsin Raza
el 24 de Sept. de 2020
0 votos
In this project you have to write a MATLAB code that takes the provided image “plain.jpg” as input. You have to implement Bug Eye Algorithm on the input image. Your output should be similar to the sample output image that is given below
1 comentario
Image Analyst
el 25 de Sept. de 2020
How is this an answer to Zahra's 6 year old question? He did not provide a "plain.jpg" image. So why do you think this Bug Eye Algorithm you heard of, and suggested he use, will work with his image?
Categorías
Más información sobre Matrix Indexing en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!