How to extract eye from a facial image?
2 次查看(过去 30 天)
显示 更早的评论
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
采纳的回答
Image Analyst
2014-3-15
You're making us work blind (pun intended). You forgot to attach pic8.jpg.
Also, it's not so obvious where the boundaries of the eye are. Different people may have different definitions of "eye" and draw outlines in different locations. Do you mean just the "wet" part or are you including the eyelid, eye socket, or eyebrow? Speaking of which, can you just have your user draw the eye region with imfreehand()? See attached demos of imfreehand().
1 个评论
Image Analyst
2014-3-18
Regarding your comment elsewhere. Correct, because your algorithm is not very robust and you fine tuned it to work on just one particular image. You need to make a more robust algorithm that works for more images, like the people who have published papers on the subject have successfully done. Go here to see their papers http://iris.usc.edu/Vision-Notes/bibliography/people898.html#Finding%20Facial%20Features,%20Eye%20Detection Pick one and code it up and see if it does better than yours. Also read the FAQ on that.
更多回答(4 个)
Zahra kamkar
2014-3-15
2 个评论
Image Analyst
2014-3-16
You still forgot. Please don't add "Answers" to your question. Add comments to our Answers.
Zahra kamkar
2014-3-16
2 个评论
Image Analyst
2014-3-16
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.
Mohsin Raza
2020-9-24
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 个评论
Image Analyst
2020-9-25
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?
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Convert Image Type 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!