Overview
What it is
EnabledScience is designed for blind students. A teacher marks regions on a printed page in a web editor. A macOS app, still in development, tracks that page with a webcam and the student's finger over it, reads the region they rest on aloud, and answers spoken questions about it in Turkish.
Numbers
- 1,200+
- Automated tests
- 4
- Markers per page
- 550 ms
- Dwell to speak
- 14
- Voice states
macOS app
Tracking the page and the finger
The camera looks for four ArUco markers (OpenCV, DICT_4X4_50) printed around the page. Any three of them identify the page, so a hand covering one corner doesn't lose it. A RANSAC homography maps camera pixels onto the page, and an alpha-beta filter on the four page corners smooths it: while the paper is still the filter leans on its previous estimate (alpha 0.30), and once the corners move by more than 1 % of the page diagonal it follows the camera (alpha 0.85). If markers disappear, the app extrapolates for 0.2 s and shows an orange hold, then suspends tracking after 0.5 s. Touch only works while the page is live, and it locks again when the markers return.
Touch
Dwell with hysteresis
Apple Vision finds the index fingertip, and a small filter smooths it (alpha 0.45, or 0.8 above 900 px/s). If two fingertips are candidates, the app picks neither rather than guess. The point is mapped onto the page through the inverse homography, and a pure state machine decides what it touches. Each area, rotated or not, is hit-tested with two outlines: the finger has to get within 1 % of the page width (7.1 px) to start a dwell, but only leaving 3 % (21.3 px) cancels it, so jitter at the border can't flicker. After 550 ms the area is spoken once and won't repeat until the finger has been away for 0.5 s. Moving to another area interrupts the current speech.
Web editor
Authoring narrated regions
A React and Fabric.js editor for narrated regions and marker-based printouts. A teacher draws on an A4-landscape stage, drops an area over the part that should be touchable, rotates it and types the sentence to be spoken (up to 500 characters, up to 10 areas per page, no overlaps). "Download" exports a JPEG with the four real markers painted into the frame, ready to print. "Save" publishes only the areas to Firestore through a transactional Cloud Functions pipeline, limited to 20 saves an hour per teacher.
Contract
One page-space, two codebases
An area drawn in a browser has to land on the same spot of the physical paper in a camera pipeline written in another language. An earlier version of the contract failed at exactly this: widths were read as half, rotation was applied in the wrong space, and the marker boxes differed. Now both sides share one layout (a stage of 800 × 566, the inner page at 710 × 476, 30 px markers) and one rule: areas are stored normalized, but rotated in pixel space, because 710 : 476 isn't square. A golden fixture holds the expected corners, and both repos pin its SHA-256, so editing one copy breaks the other side's tests. The Mac side negates the angle, because its geometry helper rotates clockwise in y-up space.
Marker identity
No shared triplets
The Mac recognizes a page from any three of its four markers, and only 50 marker IDs exist, so no two pages may share a triplet. A page ID is an 8-digit random number, and its four marker IDs follow from it deterministically (an FNV-1a hash seeds a mulberry32 shuffle of 0 to 49), so the printout can always be regenerated. On publish, a Cloud Function writes the page, its owner, one reservation for the marker set, four for its triplets, the revision and the hourly quota in a single transaction, or nothing. If a triplet is already taken, the save bounces with MARKER_SIGNATURE_COLLISION. The Mac applies the same rule and rejects both pages if two share three markers.
Voice Q&A
Ask the page a question
A streaming Turkish voice pipeline: the question is transcribed with Whisper large-v3 (hosted on Groq), an OpenAI model writes the answer, and the Mac speaks it sentence by sentence with the system's Turkish voice. The model is grounded in the current page: it gets the page title, every area's text and the area the student touched last, so a question like "what is this?" has an answer.
The model never does the arithmetic for math questions. It returns a typed request, a sympy helper computes the result and a narrator turns it into spoken Turkish. An on-device hybrid retrieval engine (embeddings plus SQLite full-text search, fused with RRF) can add curriculum passages as extra context, but answers don't depend on it.
The whole conversation is a pure function from (state, event) to (state, effects), with 14 states. Listening gives up after 10 s of silence ("İhtiyacın olursa buradayım.", I'm here if you need me), a question has a 15 s deadline, and every request carries an ID, so a late answer to a cancelled question is ignored.