"Do you know your real age?" — Blink the instant the on-screen ball turns green, and your reaction time is mapped to an "age". A campus-festival installation that detects blinks in real time with MediaPipe's face mesh.
Overview
A reaction-time game played through a webcam. A ball is drawn above the player's face; the moment it switches from red to green, the player blinks as fast as they can.
The measured reaction time is converted into an "age" — blink faster and you score younger, slower and you score older.
It was built as a light, playful, hands-on exhibit that festival visitors could enjoy in seconds.
Exhibition poster — blink the moment the ball turns green; the game measures time and age and displays the day's TOP 10 ranking.
How to play
1. Press Enter to start; a red ball appears above your face.
2. After a random 3–6 second wait, the ball turns green (randomised to prevent anticipating / jumping the gun).
3. Blink the instant it turns green, and your reaction time (in seconds) is recorded.
4. Each player gets 3 tries; the best (fastest) time becomes their score and lands on the day's TOP 10 ranking.
Key techniques
Blink detection: MediaPipe face mesh (cvzone FaceMeshDetector) provides eye landmarks, from which an Eye Aspect Ratio (EAR) is computed. A drop below a threshold marks a blink.
Debouncing: the ratio is smoothed over the last 3 frames, with a short cooldown after each detected blink to avoid chattering / double-counting.
Reaction timing: the elapsed time from "ball turns green" to "blink detected" is measured and turned into a score.
Age mapping: the reaction time (in milliseconds) is binned into an "age" table. Times under 0.1 s are rejected as physically impossible (with humorous "Not a person!!"-style messages).
UI / video: OpenCV renders the mirrored, full-screen webcam feed while cvzone overlays the score, ranking, and on-screen prompts in real time.
Feedback: sound effects and BGM via pygame / playsound.
Ranking: a bubble sort with de-duplication aggregates and displays the day's top times.
Exhibited as a participatory, interactive installation at the university campus festival (Kitayama Festival, 2023). Planned and developed as a two-person team.