简体   繁体   English

如何使用MATLAB检测眼睛图像中的眼角?

[英]how can I detect eye corner in eye image using MATLAB?

I'm trying to estimate gaze direction. 我正在尝试估计凝视方向。 at the first step I've extracted the iris location. 第一步,我提取了虹膜位置。 at the second step I have to detect eye corners. 第二步,我必须检测眼角。 I've tried this code: 我已经试过这段代码:

I=one_eye;;
h=fspecial('gaussian',[5 10],100);
I=imfilter(I,h);
h = fspecial('sobel');
I=imfilter(I,h);
% h=fspecial('gaussian',[1000 500],10);
% I=imfilter(I,h);

cornerDetector = vision.CornerDetector( ... 
             'Method', 'Local intensity comparison (Rosten & Drummond)');
pts = step(cornerDetector, I);
color = [1 0 0];
J = insertMarker(one_eye, pts, 'Color', 'red');
figure, imshow(J); title ('Corners detected in a grayscale image');

imwrite(J,'corners.jpg');

but many points are detected as corner. 但是许多点被检测为角点。 I don't know what's wrong with it?! 我不知道这是怎么回事?

Corner detection methods try to find the points on edges which satisfy some criteria. 角点检测方法试图找到满足某些条件的边缘点。 So, if your images consist of just squares or rectangles, your corner detector would work perfectly. 因此,如果您的图像仅由正方形或矩形组成,则拐角检测器将完美工作。

However, there are of course some problems: 但是,当然有一些问题:

1 - Your image is noisy. 1-您的图像嘈杂。

2 - Gradient calculations are highly affected by noise. 2-梯度计算受噪声影响很大。

3 - I don't know your method, but Corner detectors also use gradients, so they are also prone to noise. 3-我不知道您的方法,但是角落探测器也使用渐变,因此它们也容易产生噪音。

4 - Furthermore, you use Sobel which is also a gradient operator. 4-此外,您还使用了梯度运算符Sobel。

So, it is quite normal that you get lots of false positives. 因此,您会得到很多误报是很正常的。 As @nkjt said, your expectations are too high. 正如@nkjt所说,您的期望太高了。

Take a look at the Wiki to get an idea about corner detection. 看一下Wiki ,了解有关角点检测的知识。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM