$1 Unistroke Recognizer
Wobbrock, Wilson & Li — UIST 2007 · University of Washington Ace Lab
A geometric template matcher in ~100 lines: resample the stroke to N equidistant points, rotate the indicative angle (centroid → first point) to 0°, scale to a reference square, translate the centroid to the origin, then golden-section search ±45° for the best alignment. Score = 1 − d / (0.5·√(size²+size²)). Tested on 4,800 pen gestures from 10 adults on a Pocket PC — 16 UI gestures, not digits. Accuracy climbs with templates: 97.27% with 1 template, ~99% at 3+, 99.55% at 9. It has no rejection mechanism — it always returns a best match — but it shows the steepest N-best score falloff of the matchers tested, which makes the top-1/top-2 margin informative. Two digit-specific traps in the defaults: full rotation invariance confuses 6/9, and non-uniform scaling destroys the aspect ratio that separates 1 from 7 from 4. Official JavaScript implementation, New BSD License.
Paper: kevinli.net (PDF) · Project: depts.washington.edu/acelab