Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am developing an application where I am taking dynamic gestures as input and then mapping them to keyboard controls. By dynamic gesture, I mean for example hand moving from left to right or hand moving right to left.

I have four gestures: hand moving bottom to top, top to bottom, left to right and right to left.

I am able to recognize gestures but the problem is how to decide the start and ending of the gesture on a continuous video input.

What is the most efficient and effective algorithm for detecting this on a video input?

share|improve this question
Hi Manuj, as is currently worded it may be downvoted or closed because it doesn't demonstrate any prior research or failed attempts. I edited your question a bit, however your question will be better if you can demonstrate some prior effort, and you may get better answers and feedback. – maple_shaft Feb 20 '13 at 12:09
Hope i have explained it better now. – Manuj Feb 20 '13 at 12:13
up vote 2 down vote accepted

One way of dealing with this problem is to have a finite state machine with at least three states:

  • not detecting anything
  • detection phase
  • gesture dectected

Then you need to carefully design conditions for each state modification (ie going from detection phase back to "not detecting anything" in case of failure) an run them at each frame of your video stream.

You may need one state machine for each gesture you want to detect, and more than one "detection phase" ("hand at the top", then "hand middle" ...).

When you reach the "gesture detected" phase, you can fire events associated to this gesture.

The robustness of your gesture detection feature depends a lot on how you define your states (do you measure the position or the movement?) and how do you tune the state change parameters.

share|improve this answer
Thanks ,working on it. – Manuj Feb 20 '13 at 18:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.