Pupil Dilation Measurement using Near Infrared
👁️🔬📏 Pupil Dilation Measurement without Machine Learning
You can see the code running with more examples at the colab link below
Prerequisites
pip3 install opencv-contrib-python numpy
Algorithm:
- Load Color and Infrared Images
- Threshold Infrared Image to help locate eyes
- Get infrared co-ordinates for an eye
- Convert co-ordinates to lie on Color Plane
- Convert image to YIQ for skin detection
- Use this to verify that co-ordinates point to an eye
- Create a sub-image containing only the eye
- Detect Pupil and Iris using Circle Hough
- Deduce ratio and dilation from measurements
- Display Stats, Graphs and Images
Steps as Images
How Images Were Captured
I wrote a C# application to capture from both the Front Camera and Backlit Near-Infrared Camera simultaneously.
An early version of my code can be found here.
Output of the Code
Along with the actually measurement we display key stats and visualisations.
Contributors
This was created as team project.
Authors: Bryan, Cian and Val