The $1 Unistroke Recognizer

Gestures without Libraries, Toolkits or Training: A $1 Recognizer for User Interface Prototypes
1. Draw Stroke
Top Match Optimal $1
triangle (96.3%)
Score: 0.963 | d*: 6.6 | Raw: 39
3 templates

2. Candidate Normalization Pipeline — Drag Canvases or Sliders to Perturb

● Candidate C  |  ● Template Ti  |  Drag inside Steps 2–4 to see why deviating from $1 hurts recognition
Step 1: Resample N = 64
Raw: 39 → N=64 | I=6.7

Interpolates path into N=64 equidistant points.

Math & Logic
I=PathLength(C)N−1

Eliminates speed variation by spacing points every distance I.

Step 2: Rotate 0°
Nudge: 0° (Opt)
ω: -93.6° → 0.0°

Rotates indicative angle ω to 0°.

Math & Logic
ω=atan2(p0y−y¯,p0x−x¯)

Fast O(N) angular alignment around centroid (x¯,y¯).

Step 3: Scale
Scale X/Y: 100%/100%
129×136 → 250×250

Non-uniformly scales to size2 & centers at (0,0).

Math & Logic
qx=pxsizeBw, qy=pysizeBh

Ensures Step 4 rotation only changes angle, not aspect ratio.

Step 4: GSS Angle
GSS Offset: 0° (Opt)
θ: -0.6° | d: 6.6

GSS finds min d* in ±45° in 10 steps.

Math & 10-Step Proof
di=1N ∑k=1N ∥Ck−Ti,k∥
score=1− di* 122size

Why 10 iterations? Range 90° shrinks by φ≈0.618 until ≤2°. Since 90°φ8=1.92°, it takes 2 initial + 8 loop evaluations = 10.

3. Live Reaction Across All Loaded Templates (Sorted by Current Score)

Overlays Template Ti, Candidate C, & point-to-point error lines.

4. Author Interview: Understanding the Paper & Empirical Findings

Expand any question for mathematical proofs and Pocket PC evaluation details.
Interview Q1: Motivation
Why create the "$1 Recognizer"?

UI prototypers rarely have pattern-matching toolkits. $1 uses pure geometry in ~100 lines of code, needs no training sets, and hits 97%+ accuracy with 1 template.

Comparison vs. Rubine & DTW
  • Rubine's Classifier: Needs many training examples, matrix inversions, and Mahalanobis distances (92.83% accuracy in study).
  • Dynamic Time Warping (DTW): Accurate (99.15%), but O(N2) matching took 128.26 mins per test set vs. 1.59 mins for $1 (99.02% accuracy).
Interview Q2: Rotation Invariance & GSS
Why does GSS guarantee 10 iterations?

Rotating indicative angle ω to 0° gets within ~4.2° of optimal. Bounded GSS then searches [−45°,+45°] down to a 2° threshold in 10 fixed evaluations.

Mathematical Proof of 10 Evaluations

Hill-Climbing takes 53.5 rotations on dissimilar gestures. GSS narrows the 90° bracket by φ=12(5−1)≈0.618 each step:

90°×φ7=3.10°>2°⟹ 90°×φ8=1.92°≤2°

2 initial interior evaluations + 8 loop reductions (1 new evaluation per step) = 10 iterations, saving 80.2% work.

Interview Q3: Limitations & Human Factors
What are the trade-offs & speed findings?

Because $1 rotates to 0° and scales non-uniformly to a square, it cannot distinguish squares from rectangles, circles from ovals, or orientation-specific arrows.

Articulation Speed & 1D Lines
  • Medium Speed Wins: Across 4,800 gestures, medium speed (~1.15s) had fewer errors (2.46%) than slow/tentative (2.84%) or fast/sloppy (3.22%) strokes.
  • 1D Lines: Non-uniform scaling distorts thin straight lines; check bounding-box aspect ratio to scale 1D gestures uniformly.