Pupil Detection
Purposes :
The purpose of this study is to realise a software detector that leads
to the detection of a human pupil. A picture of an eye, approximately centered
on the pupil is needed. The result are the parameters of an ellipse that
fits the pupil.
Basics :
The human eye picture is divided in 4 regions :
-
1 - The pupil. This is the approximately - circular black area, in the
center of the eye. On 1 word precision, its values are splited from 0 (best)
to about 10.
-
2 - The iris. This is the colored region of the eye. A very dense meshwork
at a very high resolution.
-
3 - The cornea. A very white part. Still not used.
-
4 - The eyelids and eyelatches. High disturbances : Any color can be found
there (from the pure black : color of the eyelids to high white of the
little reflects on eyelids).
Image from Neurotechnologija
The use of the colors :
Any camera that takes a photograph of the eye, will take from the very
white of the cornea to the very black of the pupil. Then, a kind of auto
- adjustement of brightness is realised. If this is not done by the camera,
some little software can archieve this task (spawn colors from 0 to 127=max).
In fact, this doesn't work always very well : under heavy or low light
conditions, the colors profile seems to be modified.
It seems to be better to use shape - controlled color detection.
The problem of the shape :
The pupil is not a real ellipse, it could just be described with an
ellipse.
The problem of a such description is solved with a light ellipse-like
search, Hough search (light or full) or the least square method :
-
Light ellipse-like search (most used). The whole picture can be fully parsed
with an ellipse detector, based on ellipse-like variations of the picture.
The detector is not based on the colors of the picture, but its variations
(more accurate). This leads to detection of arcs with an estimated ray.
An iterative algorithm fits the ellipse on the best place. This is best
described by Daugman on his web site. The problem of such method is the
possiblity that it might hang on some reflects, instead of the pupil border.
-
complete or adapted Hough transform. The most general method to search
ellipses is to realise a Hough transform. This is based on a complete search
of ellipses, the best score gives the best ellipse. This is therefore a
computationnal intensive search. The complete Hough search is nearly impossible
to realise within acceptable delay (few 1/10s) and cost (pentium class
max). Any adapted search (oriented, random, ...) gives acceptable results
... for test ! The results are quite accurate with reflects and bad contrast
but far too costly in time and Mips.
-
Least square method : Very quick and simple, but it needs the extraction
of the points located on the pupil border. Another problem is the high
sensitivity to inliers and outliers. Even small reflects can cause a lot
of damage.
A good start point is to join ellipse - like search, with the use of colors.
The reflection problem :
Another problem is that some strong reflects brings high disturbances
: they mark the picture with white dots (which is not a real problem) and
their smooth border may look like the border of the pupil !
Then, if a reflect lies from the pupil to the iris, it is possible
to miss a part of the pupil border and get the border of a reflect instead
of the border of the pupil. In that case, the reflect must be very large.
But this is still quite unpredictable.
The work done :
With more than 8 methods tested, the last version uses the good principles,
to search the information. It is :
-
Very quick, because of the use of small loops (not more than the size of
the initial picture) and step - by - step algorithm.
-
Insensitive to strong reflects because of reflects's border smart suppression.
-
Insensitive to contrast changes because of adaptative algorithm.
The Source :
Image of the eye with only half-word precision. Insensitive to image
size. Tests on 200x200 to 400x400.
The Steps :
-
Color computation in order to adapt the next steps to the global conditions.
Speed : Equivalent to 1 or 2 scans of the picture.
-
Special loop : Quick loop with up to 10^4 iterations.
-
Derivatives computation in order to extract the border of the pupil. Speed
: 2x 1D filters applied or 1x 2D filter.
-
Suppression of bad elements / last step on the picture. Not more than 2
scans of the picture.
-
The last step is an iterative fit of ellipse parameters with about 10^3
points. Speed : 1 to 3 iteration on 10^3 down to about 300 points with
eigenvalues search on each iteration.
The results :
<With Picts >