smoothing mouse movement

眉间皱痕 提交于 2019-12-04 03:31:59

问题


I'm developing a software to move the mouse based on certain coordinates which i get from a depth image from kinect. but I have 30 frames/second(images/second) and those coordinates changes with every frame so the mouse keeps moving. My question is,Is there a way to smooth the movement of the mouse ?


回答1:


Yes you can start tracking with some parameters that allows you to make move smoother.
Below is an example code:

        var parameters = new TransformSmoothParameters
        {
            Smoothing = 0.2f,
            Correction = 0.0f,
            Prediction = 0.0f,
            JitterRadius = 1.0f,
            MaxDeviationRadius = 0.5f
        };

        this._sensor.SkeletonStream.Enable(parameters);

You can change Smoothing, Correction, Prediction, JitterRadius, and MaxDeviationRadius to whatever numbers you want.




回答2:


Since you wanted to know about "mapping depth coordinates to skeleton points", you can use the DepthImageFrame's MapToSkeletonPoint() which takes the X and Y values of the depth data and then create a SkeletonPoint. Example:

 SkeletonPoint point = depthFrame.MapToSkeletonPoint(x, y);

Hope this helps!



来源:https://stackoverflow.com/questions/10756772/smoothing-mouse-movement

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!