Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Eye Detection Help Needed
Date: Fri, 22 May 2009 02:53:02 +0000 (UTC)
Organization: COMSATS
Lines: 23
Message-ID: <gv542d$1gc$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1242960782 1548 172.30.248.35 (22 May 2009 02:53:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 22 May 2009 02:53:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1581576
Xref: news.mathworks.com comp.soft-sys.matlab:541686


I=imread('int.jpg');%original Image
I=rgb2gray(I);
p=80;
eye=rgb2gray(imread('eye1.jpg'));%eye Template
I=imresize(I,[p p]);
eye(p,p)=0; %make the padding of zeros to make it equal size.
fi=fftn(I);
fr=fftn(eye);
fc = fi .* conj(fr);
fcn = fc ./ abs(fc);
c = real(ifft2(fcn));
[v index] = max(c(:));
siz=80;
[y x] = ind2sub(siz,index);
% invert quadrants due to fft shift
mid = siz(1) / 2;
y = y - sign(y-mid-0.5) * mid
x = x - sign(x-mid-0.5) * mid

Now These X and y are the eye co-ordinates.
what i want to do is how i can merge it into some other module. like i am detecting face in live video stream. i want to merge it into that code. but i dont know what condition to be used to that purpose

like i have tried max(max(c))>0.2 then its have detected the eye but i have gives true as well as false results. the accuracy rate is only 50-60%. so please help how i can improve my code to achieve accuracy.