gesture
gesture library will detect your gesture by using webcam, you can call a function when a gesture (left, right, up or down) is detected.
Functions
gesture.start(): Start webcam and detecting gesturegesture.stop(): Stop webcamgesture.on(dir, func): Set callback function for dir, when dir is detected, this function will be called. dir 's value could beleft,right,upanddown. If you didn't use thisonfunction to set callback function, by default, ifleftis detected, functiongestureOnLeftwill be called (if defined); ifrightis detected, functiongestureOnRightwill be called (if defined); ifupis detected, functiongestureOnUpwill be called (if defined); ifdownis detected, functiongestureOnDownwill be called (if defined).
Example
import gesture
def on_left():
print "moving left"
def on_right():
print "moving right"
def gestureOnUp():
# this is the default callback function when `up` is detected
# you can use gesture.on('up', other_func) to set this callback
# function to be other_func
print "moving up"
def gestureOnDown():
print "moving down"
# set callback function for left and right gesture
gesture.on("left", on_left)
gesture.on("right", on_right)
# start webcam and detecting
gesture.start()