Raspberry Pi detects eye color in real time — built for a science fair in India

A student working with the Indian Space Research Organisation (ISRO) has built a system using a Raspberry Pi that detects iris color. Srikrishna Karthick created the project for National Science Day celebrations in India, where the Muscle Physiology Laboratory at IISER Tirupati displays fruit flies (Drosophila) with different eye-color phenotypes to explain genetic inheritance of eye color. To make the exhibit more engaging and relatable, the team proposed recording attendees' eye colors and displaying their distribution in real time.
The build relies on a Raspberry Pi 3 Model B+ paired with a Raspberry Pi Camera Module 3. OpenCV, an open-source computer vision library, handles image processing. When a person looks into the camera, the system analyzes the iris and determines the color. Instead of manual tallying and data analysis, the electronic method automates the entire process, making it faster and more interactive.
According to Srikrishna, the goal was to inspire younger students. With a short deadline and a need for a simple, cost-effective solution, the Raspberry Pi was the obvious choice. The project uses standard components and Python code with OpenCV. Results are displayed on a screen as a real-time distribution chart of eye colors, showing how many visitors have blue, brown, green, or other iris colors.
The system has potential clinical applications beyond the science fair, as accurate iris color detection can be used in medical research and diagnostics. However, the immediate purpose is educational: to demonstrate how computer vision can automate a task that humans find trivial — recognizing their own eye color in a mirror — but requires sophisticated algorithms for a machine to perform reliably.


