I am in progress of building a table (actually, I am building the projector right now), but I have thought of a way to do this.
Gestures are stored as a set of directions relative to the direction of the last gesture segment in 45 degree increments (use -3 to 4, -3 being -135, 0 being 0, and 4 being 180). All Gestures start with a “straight” entry (0 in my case) and all subsequent entries are relative to the last segment. For example, a ‘h’ gesture would be 0,0,4,1,1,1,1 and an ‘o’ would be 0,1,1,1,1,1,1,1. All gestures are loaded into a tree with the trunk being the first straight segment with a branch for each direction in which a gesture is available. eg: for ‘h’ and ‘o’ (With another gesture (0,1,1,1,4) for demonstration purpose)
(Trunk)
0
/ \
0 1
| |
4 1
| |
1 1
| / \
1 1 4
| |
1 1
| |
1 1
After the first stroke (Which is always considered straight), a circle appears around the blob. When the blob moves to the edge of the circle, it registers it as a new stroke, classifies it against 45 degree increments and checks it against the possible strokes in the tree. If it doesn’t match, cancel the gesture, otherwise move the tree so the new trunk is the new stroke. Repeat until a no more strokes are available in the tree, and the result is the gesture. In the case of a smaller gesture being the same as the beginning of a larger gesture (like the gestures for ‘l’ and ‘L’) the user will be given feedback that they are currently on a valid gesture, in which case they may release their finger and choose the current gesture, or continue with the larger gesture. A hinting system can also be implemented by drawing lines from the center of the circle to the outside in the directions that valid gestures exist.
This solves the ‘p-d’ problem:
p: 0,0,4,0,1,1,1,1,1
d: 0,1,1,1,1,1,0,0,4,0
Feel free to use it if you want, it is my contribution to the community.
[Edit]
fixed ‘p-d’ example.