scanning gestures and using matchTemplate for recognition