Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
Hello all,
I'm working on a project to move the mouse cursor using the fingertip which is tracked by kinect using Depth Image. I'm albe to do the tracking but the problem is in moving the mouse in a smooth way. In my program, when I move the mouse it doesn't move in a smooth way , but instead it just jumps from pixel to pixel. My question is , Is there a way to use something like the smooth parameters of the skeletal tracking inorder to smooth my cursor's movement ?
Posted
Updated 5-Jun-12 21:35pm
v3

1 solution

You could use the skeletal smoothing, and that should help a bit. The best way I've found is with a moving average of your desired target (in your case, the mouse location). So instead of simply moving the cursor every time you have a movement in your fingertip point, use a queue to store the last N number of points (anywhere from 5 to 12 seems to work well). You then average the values in the queue, and apply that to your cursor. The next cycle, you will remove the oldest point, and add the new point to the queue, then average again. You just keep repeating this. You can get higher or lower smoothing by adjusting the number of points you keep in your queue.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900