User Tools

Site Tools


gestures:touch:simple:geometric:path-based:1-finger-stroke-letter

1-Finger-Stroke-Letter

(Touch → Geometric → Path-Based → One Point Stroke Letter “1-Finger-Stroke-Letter”)



This gesture object describes a single finger stroke or “uni-stroke” gesture. When a user places one touch point on a touch object and draws a path the gesture compares the captured path to the path described in the gesture object and returns a discrete gesture event if it is a match. The exact path and number of touch points are defined in the <match> tag.

The process of comparing the GML defined path to a captured path is defined by a series of functions in the “vectormetric” referenced in the <analysis> block. This process involves normalizing the number of points used to describe the sample vector path, scaling the sample path so that it is comparatively the same size as the reference path, then finding the cumulative difference between the reference path trajectory and the captured sample path. This returns a probability value which is defined as one of the standard gesture object dimensions. If the probability of the stroke match is below 0.7 a gesture event will not be dispatched.

This gesture has a total of three dimensions: “stroke_prob” returns the match probability of the reference and sample path, then “stroke_x” and “stroke_y” which define the x and y coordinates of the center of the stroke sample path.

<Gesture id="letter_O" type="stroke">
    <match>
        <action>
            <initial>
                <point path_pts="(x=0.6122448979591837, y=0.008746355685131196),(x=0.5393586005830904, y=0),(x=0.46647230320699706, y=0),(x=0.3935860058309038, y=0.008746355685131196),(x=0.3206997084548105, y=0.03206997084548105),(x=0.2536443148688047, y=0.0641399416909621),(x=0.18950437317784255, y=0.10204081632653061),(x=0.13702623906705538, y=0.15160349854227406),(x=0.09037900874635568, y=0.2099125364431487),(x=0.0553935860058309, y=0.27405247813411077),(x=0.029154518950437316, y=0.34402332361516036),(x=0.008746355685131196, y=0.4169096209912536),(x=0, y=0.4897959183673469),(x=0, y=0.5626822157434402),(x=0.0058309037900874635, y=0.6355685131195336),(x=0.026239067055393587, y=0.7084548104956269),(x=0.052478134110787174, y=0.7755102040816326),(x=0.09329446064139942, y=0.8367346938775511),(x=0.13994169096209913, y=0.892128279883382),(x=0.19533527696793002, y=0.9358600583090378),(x=0.2594752186588921, y=0.9708454810495627),(x=0.3294460641399417, y=0.9941690962099126),(x=0.40233236151603496, y=1),(x=0.4752186588921283, y=1),(x=0.5481049562682215, y=0.9854227405247813),(x=0.6180758017492711, y=0.9620991253644314),(x=0.685131195335277, y=0.9329446064139941),(x=0.749271137026239, y=0.8950437317784257),(x=0.8046647230320699, y=0.8483965014577259),(x=0.8542274052478134, y=0.793002915451895),(x=0.8979591836734694, y=0.7317784256559766),(x=0.9271137026239067, y=0.6647230320699709),(x=0.9504373177842566, y=0.5947521865889213),(x=0.9591836734693877, y=0.521865889212828),(x=0.9533527696793003, y=0.4489795918367347),(x=0.9416909620991254, y=0.3760932944606414),(x=0.9154518950437318, y=0.3032069970845481),(x=0.880466472303207, y=0.23615160349854228),(x=0.8425655976676385, y=0.16909620991253643),(x=0.7959183673469388, y=0.10787172011661808),(x=0.7405247813411079, y=0.0553935860058309),(x=0.6705539358600583, y=0.026239067055393587),(x=0.597667638483965, y=0.014577259475218658)"/>
                <cluster point_number="1"/>
                <event touchEvent="TouchEnd"/>
            </initial>
        </action>
    </match>
    <analysis>
        <algorithm class="vectormetric" type="continuous">
            <library module="stroke"/>
            <returns>
                <property id="stroke_x" result="x"/>
                <property id="stroke_y" result="y"/>
                <property id="stroke_prob" result="prob"/>
            </returns>
        </algorithm>
    </analysis>
    <mapping>
        <update dispatch_type="discrete" dispatch_mode="cluster_remove">
            <gesture_event type="stroke_letter">
                <property ref="stroke_x"/>
                <property ref="stroke_y"/>
                <property ref="stroke_prob"/>
            </gesture_event>
        </update>
    </mapping>
</Gesture>

There are other default properties that stroke type gestures can return. These include: stroke width, height, length, time, starting point and end point.

Within the STROKE type there are currently five sub-types:

  1. STROKE_LETTER
  2. STROKE_SYMBOL
  3. STROKE_SHAPE
  4. STROKE_NUMBER
  5. STROKE_GREEK

Each sub-type effectively describes a set of gesture strokes in the default gesture library. Which can be found in the root GML document my_gestures.gml

A new stroke can easily be added to the gesture library. This is done by simply creating a new stroke gesture object (with unique gesture_id) and defining the “path_pts” of the gesture. This defines a unique set of serialized points which describe a 2D vector path. The reference path should consist of around 100 points but can contain more as the path is re-sampled by the vectormetric before a the matching phase.

gestures/touch/simple/geometric/path-based/1-finger-stroke-letter.txt · Last modified: 2015/10/08 23:18 by paul