简体   繁体   中英

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.

2 - Gradient calculations are highly affected by noise.

3 - I don't know your method, but Corner detectors also use gradients, so they are also prone to noise.

4 - Furthermore, you use Sobel which is also a gradient operator.

So, it is quite normal that you get lots of false positives. As @nkjt said, your expectations are too high.

Take a look at the Wiki to get an idea about corner detection.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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