0
votes

I am trying to make some simple app which allows you to paint on canvas with your right hand. Fortunately I know how to make painting function but I have a little problem with other thing. As you know SDK provides you to use a control named KinectRegion which has KinectCursor which is the representation of user's hand.

The problem is that I don't know why when I am trying to paint something my painting path starts in different position than my KinectCursor is ?

I don't have this problem when I use my own right hand mapping function but in that case I can't use other things like KinectCircleButton because I don't have KinectRegion.

Anyone know how to get or to map KinectCursor position(x,y) from KinectRegion ?

visualisation of my problem: [IMG]http://i58.tinypic.com/iqgemt.png[/IMG]

2

2 Answers

0
votes

I'm working on the similar project on painting with Kinect. Actually the position you need is in the HandPointer. You can get the position of your hand relative to UIElement by a method called GetPosition(UIElement element) which obviously takes that element as parameter.

An example of using the method looks like this:

public partial class MainWindow
{
    public Point position;

    public MainWindow
    {
        KinectRegion.AddHandPointerMoveHandler(this, OnHandPointerMove);
    }

    private void OnHandPointerMove(object sender, HandPointerEventArgs e)
    {
        position = e.HandPointer.GetPosition(myCanvas);
    }
}
0
votes

Now the thing is your hand position and kinect hand position has a gap in both X and Y. Try to make these gaps zero. Then your hand will exactly map the painting point. For example output x,y coordinates at once for both hand point and painting brush point. and get the individual gap for both x coordinates and y coordinates. now these difference should be deducted form x and y respectively. So then your hand and paint brush points will map accordingly.