matching.pl - sample use of gestures engine
STDOUT(the strokes are named with numbers in order of recording)
This program is used to try out various normalization / segmentation / matching algorithms.
Look at the following for details on the algorithms themselves:
First of all, it creates a Tk window with a canvas and three buttons: "Match", "Record" and "Clear", with the following bindings:
ButtonPress-1 on the canvas
B1-Motion on the canvas
ButtonRelease-1 on the canvas
Then it sets up the various parameters for the normalizer, the segmenter and the matcher, and finally calls
@stroke to the point of ButtonPress, and starts a line (
$curline) in the canvas
Adds the point to
@stroke and to the
Adds the last point to
After having normalized and segmented the current stroke, calls sub Similarity1::similarity
@known_strokes, printing scores, and keeping track of the "nearest" (i.e. the one with the lowest score).
At the end, prints the index of the best match.
Normalizes and segment the current stroke, and pushes it into
@known_strokes (adding the first point, since the segments are relative).
Just cleans up the canvas.
This code is copyright (C) 2002 Gianni Ceccarelli Released under the GNU LGPL, version 2.1