Turn a MacBook into a Touchscreen in 16 Hours for Under $7 Using Only a Mirror
A team led by Anish Athalye built a $1‑$7 hardware add‑on that lets a MacBook’s built‑in webcam detect finger touches via a tiny mirror, using classic computer‑vision techniques to map those touches to screen coordinates and generate mouse events.
Hardware construction
A small mirror is mounted on a piece of cardboard with a hinge and attached in front of the MacBook’s built‑in webcam. The mirror reflects the screen into the camera so that the camera simultaneously sees the finger and its reflection. The entire hardware costs about $1 (≈ 6 CNY) and can be assembled in roughly 16 hours.
Computer‑vision pipeline
The system processes each webcam frame using classic computer‑vision techniques (no deep learning). First, a skin‑color filter and binary threshold isolate candidate finger regions. Contour detection then extracts two key outlines: the finger itself and its reflected image on the screen. The algorithm checks that the two contours overlap horizontally and that the finger contour lies above the reflection contour. If these conditions hold, the vertical gap between the finger’s bottom and the reflection’s top is measured. A small gap indicates contact (touch) while a larger gap indicates hover. The touch point is computed as the midpoint of the line segment joining the finger’s bottom and the reflection’s top.
Mapping to screen coordinates
To translate camera‑space points to screen coordinates, an interactive calibration is performed. A green dot moves on the screen; for each position the corresponding camera point is recorded. Using these point pairs, a homography matrix is estimated robustly with RANSAC. The resulting matrix maps any detected touch point from the camera view to accurate screen coordinates.
Output handling
The calibrated screen coordinates are emitted as standard mouse events, allowing existing applications to receive touch or hover input without modification.
Limitations
Webcam resolution is limited to 480 p, restricting precision.
The field of view of the webcam and mirror assembly does not cover the entire screen.
Performance depends on lighting conditions and skin tone, which affect the skin‑color filter.
Open‑source implementation
The prototype code is released under the MIT license at https://github.com/bijection/sistine.
Java Tech Enthusiast
Sharing computer programming language knowledge, focusing on Java fundamentals, data structures, related tools, Spring Cloud, IntelliJ IDEA... Book giveaways, red‑packet rewards and other perks await!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
