在屏幕kinect上稳定鼠标指针? [英] Stabilize mouse-pointer on screen kinect?

查看:112
本文介绍了在屏幕kinect上稳定鼠标指针?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


当我使用kinect时,我想要稳定鼠标指针。我使用平滑和灵敏度来完成光标集,但光标主要在屏幕边缘跳跃。有人可以帮帮我吗?



我设置光标的代码是:



 //设置光标位置
MouseControl.SetCursorPos(
// X坐标
(int)(curPos.X +(x * mouseSensitivity * screenWidth - curPos.X)*平滑) ,
// Y坐标
(int)(curPos.Y +((y + 0.25f)* mouseSensitivity * screenHeight - curPos.Y)*平滑)
);





我尝试了什么:



添加线程。 sleep()但是没有用。

解决方案

为什么要让线程让鼠标指针平滑出来?所有这一切都是让你的应用程序完全没有响应。



你正在平滑,如果那是你想要调用的代码,鼠标指针的位置是这是正确的方法。



你应该做的是数字信号处理。你应该平滑你的输入信号,用户手的位置(我猜你正在使用的是什么)并且随着时间的推移这样做,比如你捕获的最后5到10个位置帧。



网上有很多例子。所有你要做的就是谷歌 Kinect用手作为鼠标光标 [ ^ ]。

谢谢戴夫。

我已经搜索了,但没有找到任何帮助我。你能帮帮我吗?


Hi I want stabilize mouse-pointer when I use kinect. I did the set of cursor, using smooth and sensitivity, but the cursor jumps mainly in margins of screen. Somebody can help me?

The code that I have for set cursor is:

// set cursor position
MouseControl.SetCursorPos(
// X coordinate
(int)(curPos.X + (x * mouseSensitivity * screenWidth - curPos.X) * smoothing),
// Y coordinate
(int)(curPos.Y + ((y + 0.25f) * mouseSensitivity * screenHeight - curPos.Y) * smoothing)
);



What I have tried:

add thread.sleep() but didn't work.

解决方案

Why would putting the thread to sleep "smooth" out the mouse pointer? All that does is make your app completely unresponsive.

You're "smoothing", if that's what you want to call that code, the position of the mouse pointer isn't the correct way to go about this.

What you should be doing is called "digital signal processing". You should be "smoothing" your input signal, the position of the users hand (I'm guessing at what you're using) and doing it over time, say the last 5 to 10 position frames you captured.

There are plenty of examples on the web. All you have to do is Google for "Kinect use hand as mouse cursor[^]".


Thanks Dave.
I already searched, but didn't found nothing, to help me. Can you help me?


这篇关于在屏幕kinect上稳定鼠标指针?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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