Search code examples
kinectkinect-interaction

Adjust speed of hand cursor in kinect region


I am using Kinect SDK 1.8, i am using default Kinect control. KinectRegion to display hand cursor of Microsoft.Kinect.Toolkit.Controls. But hand cursor is too fast and sensitive. i wanted it to be make it slow down, so that end user of my Kinect app can control that cursor easily on screen. i tried out with the AccelerometerGetCurrentReading() (Line No. 962) and also tried out with the KinectAdaptor.cs (Line No. 299) handPointer.X, Y, Z, but didn't get any success. can some one help on it. I already gone through the Human interface guide and also tried Kinect interaction demo, but it is work with the same speed of hand cursor, as is it working in my app. Is there any work around for this? Or any property to control the speed of hand cursor in PHIZ, come in future release.


Solution

  • I am not aware of any built-in solution for this. However, there are a couple tricks you could do if you're willing to produce some code in the middle.

    You say there are two problems

    1. The Kinect Cursor is too fast (i.e. for the amount your hand moves in the real world, the cursor moves too much on the screen.

    2. The Kinect Cursor is too sensitive. (i.e. the movements of the Kinect are hard to control)

    For #1, I am not sure if the cursor->screen mapping is absolute. If you put your hand at the edges of the Kinect's vision, does it match the edge of your computer screen? If so, it could be hard to adjust the speed of the cursor (also called gain). One hack-y solution can just be to move your body farther away from the screen, so that your movements in physical space are larger.

    For #2, you could implement a basic low-pass filter. This means that large motions "pass through" the filter, but small, jittery motions are ignored. The simplest way to do this is have something like a running average.

    Point CurrentKinectPoint; //this is the filtered position of the mouse cursor
    const double FILTER_FACTOR = 0.5;
    void UpdateKinectControlPoint(Point NewPoint) {
        CurrentKinectPoint.x = CurrentKinectPoint.x * FILTER_FACTOR + NewPoint.x * (1 - FILTER_FACTOR);
        CurrentKinectPoint.y = CurrentKinectPoint.y * FILTER_FACTOR + NewPoint.y * (1 - FILTER_FACTOR);
    }
    

    I hope this is helpful, at the high-level at least.