光滑的鼠标移动 [英] smooth mouse movement

查看:116
本文介绍了光滑的鼠标移动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在研究一个项目,使用右手移动鼠标光标,使用深度图像通过kinect跟踪。我正在控制右手掌关节的鼠标移动。我能够进行跟踪但是当我保持手不动时,鼠标会从一个地方跳到另一个地方。因为关节是可见的,所以它在离散时是可见的,所以鼠标是跳跃的,有没有办法使用类似骨骼跟踪的平滑参数之类的东西来平滑我的光标的稳定性?





i这篇解决方案在一些文章中但不知道如何做到这一点。



您可以使用骨架平滑,这应该有所帮助。我发现的最好方法是使用所需目标的移动平均值(在您的情况下,鼠标位置)。因此,每次在指尖点移动时,不是简单地移动光标,而是使用队列来存储最后N个点(5到12之间的任何点似乎都能正常工作)。然后,您可以对队列中的值进行平均,并将其应用于光标。在下一个循环中,您将删除最旧的点,并将新点添加到队列中,然后再次平均。你只是不断重复这个。您可以通过调整队列中的点数来获得更高或更低的平滑度。



我该怎么做。



谢谢!!

Hello all,
I'm working on a project to move the mouse cursor using righthand which is tracked by kinect using Depth Image. I am controlling mouse movement from right hand palm joint. I'm able to do the tracking but when i am keeping the hand stationary the mouse jumps from one place to another. as joints is visible continus it is visible in discreate, so mouse is jumping, Is there a way to use something like the smooth parameters of the skeletal tracking inorder to smooth my cursor's stability ?


i this solution in some article but don't know how to do this.

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.

how should i do this.

thanks!!

推荐答案

你的鼠标跳跃的原因是你在事件发生时更新了位置...所以在你的鼠标出现前一刻在位置X1:Y1,现在你将它更新为X2:Y2 - 用眼睛轻弹......

你可以做的是在X1:Y1和X2:Y2之间看一看并移动鼠标在每次迭代中占总运动的一小部分...
The reason your mouse jumps is that you update the position upon event...So a moment before you mouse was at position X1:Y1 and now you update it to X2:Y2 - in flick of the eye...
What you can do is run a look between X1:Y1 and X2:Y2 and move the mouse with a fraction of the total movement in every iteration...


对不起,我没有得到你。我怎么能在X1:Y1和X2:Y2之间看一下,并在每次迭代中用一小部分总移动移动鼠标。



是否有任何示例代码可用。



谢谢
sorry i didnt get you. how can i run a look between X1:Y1 and X2:Y2 and move the mouse with a fraction of the total movement in every iteration.

is there any sample code available.

thanks


这篇关于光滑的鼠标移动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆