I am now working on an eye tracking project. In this project I am tracking eyes in a webcam video (resolution if 640X480).
I can locate and track the eye in every frame, but I need to locate the pupil. I read a lot of papers and most of them refer to Alan Yuille's deformable template method to extract and track the eye features. Can anyone help me with the code of this method in any languages (matlab/OpenCV)?
I have tried with different thresholds, but due to the low resolution in the eye regions, it does not work very well. I will really appreciate any kind of help regarding finding pupil or even iris in the video.
The round opening in the center of the iris (the colored tissue that makes the "eye color" at the front of the eye). The pupil changes size to let light into the eye. It gets smaller in bright light and larger as the amount of light decreases.
Method: Use a bright handheld light in a dim room. Shine the light in one of the patient's eyes and observe for a reaction. After ~3 seconds, rapidly swing the light to the opposite pupil and observe the reaction. After ~3 seconds, swing back to the first eye and observe again.
The normal pupil size in adults varies from 2 to 4 mm in diameter in bright light to 4 to 8 mm in the dark. The pupils are generally equal in size. They constrict to direct illumination (direct response) and to illumination of the opposite eye (consensual response). The pupil dilates in the dark.
What you need to do is to convert your webcam to a Near-Infrared Cam. There are plenty of tutorials online for that. Try this.
A Image taken from an NIR cam will look something like this -
You can use OpenCV then to threshold.
Then use the Erode function.
After this fill the image with some color takeing a corner as the seed point.
Eliminate the holes and invert the image.
Use the distance transform to the nearest non-zero value.
Find the max-value's coordinate and draw a circle.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With