Pupil-Tracking-Project

This project aims to track the pupil boundary in real-time.

A quick demo is found here.

https://youtu.be/3MKtuQSaXd4

Setups

  • Software: Windows 8, OpenCV 3.10 and Pyhton 2.7
  • Hardware: IR camera, resolution 640x480.

Pipeline

Pre-process to crop eye region

  • 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.

Apply algorithms to fit pupil boundary with ellipse (Demo for one pupil only)

  • 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

Reference