|
Parameterization
We add functionality to a recognized gesture by associating certain parameters to the gesture. Parameters values are derived directly or calculated from the stream of features provided by the input device (in the tested case, this is CommunityCoreVision). On classifying a gesture, if the gesture is associated with parameters, a parameter_update messages is sent on the output port for every frame. The parameterization stage ends only when all fingers are raised off the surface. Multiple parameters can be associated with a gesture. Gestures can be parameterized by providing a parameterize message (see Communication). A parameter can be defined by using one of the types provided. Each parameter type can be declared by a string. The following list shows the list of currently supported parameter types, along with their required information. fing_x fing-index : the x coordinate of the finger identified by the index is used as the parameter value. fing_y fing-index : the y coordinate of the finger identified by the index is used as the parameter value. fing_dist fing-index-1 fing-index-2 : A parameter is derived by calculating the distance between two fingers, identified by their respective indeces. all_mean : The mean of all fingers on screen. This list will be updated as more parameter types are added to the system. During parameterization, if a finger is raised, the parameterization is paused. Updates of the parameters are not sent while paused. Once the finger is placed back on the surface, the parameterization resumes. ExampleConsider the parameterization of a three finger gesture (let's call it GestureA), that uses the thumb, index and middle fingers. The following messages add 3 parameters to this gesture. In this case the indeces of the thumb, index and middle fingers are 0, 1 and 2 respectively. /gestr/action "parameterize" "GestureA" "Param1" "fing_dist 0 2" This adds a parameter whose value is the distance between the thumb and middle finger. Moving the thumb into the palm would yeild smaller values, and extending the thumb away from the palm would yeild higher parameter values. /gestr/action "parameterize" "GestureA" "Param2" "fing_y 1" The y coordinate of the index finger is used as the second parameter. |