This project aims to track the pupil boundary in real-time.
- Software: Windows 8, OpenCV 3.10 and Pyhton 2.7
- Hardware: IR camera, resolution 640x480.
- Read video streaming from camera frame by frame
- Grayscale
- Smooth image with median blur filter. For this application, median blur works better than gaussian blur.
- Apply Haar Cascades frontal face detector[1]
- Crop eye region with geometry assumption that eye location is relatively fixed to face.
- Compute sobel directions of gradient
- Canny edge
- Find contours on the canny edges. Discard contours with large arc perimeter.
- Compute gradient entropy (refer to Cihan Topal's publication[2]). Select maximum entropy among all contour candidates.
- Fit ellipse for the contour
- [1] Apply Haar Cascades frontal face detector Download xml file from https://github.com/opencv/opencv/blob/master/data/haarcascades/haarcascade_frontalface_default.xml Note the license using the Cascades.
- [2] C.Topal and C. Akinlar, An Adaptive Algorithm for Precise Pupil Boundary Detection Using the Entropy of Contour Gradients.2013. Elsevier preprint.