Reputation: 469
I have a problem with the pupil center detection. I trained a CNN to give me the pupil center location but it is not always at the center.
How can I make good processing and have the ellipse fitting algorithm detect the center?
The process is this. I cut the face on a picture with dlib then I make the prediction and after I get the results I want to predict the center.
Here are two examples of the cnn prediction. Any guidance will be appreciated .
Upvotes: 2
Views: 731
Reputation: 1671
From those pictures, it appears that the variable occlusion of the iris is what is throwing off your center find. What may help is being more specific about just the edge between iris and eye white (and not with eyelid). To do this I would (but there may be better ways). Drop a point inside the iris blob and project a grid of radially spaced vectors outward looking for the first dark to light transition above a minimum contrast. For each ray measure the contrast of the edge. The contrast should be almost exactly the same for all iris to eyewhite transitions and will have variance with the eyelid. Perform whatever type of data clustering you prefer to isolate the chunk of only pupil to eyewhite edges and then only feed those edge points into the ellipse center find.
Upvotes: 1
Reputation: 10852
Direct radial rays from the center you found. Compute intensity gradient along each ray. Maximal gradients will your points on edge of iris. Then use fit ellipse.
Upvotes: 3