1

I am currently working on a Kinect project for fall detection. I am only doing a basic detection of the head because that's the only way I know how to. Anyway I need to get the updated position of the MousePointer of a Ellipse. I tried using the MouseMove function but it seems to only update once. I need it to update constantly when it moves.

Is there a way to do this?


Sorry If It sounded vague but I used the Skeleton functions of Kinect to get my joint position. From there, I mapped a david beckham picture onto the head. What I am trying to do is actually detect from pixels whether the head entered the pixels.

My problem now is that the head's location doesn't update REGULARLY when i use the MouseMove function. I am trying to find a solution to that or even better, find a new way to detect the head location because frankly I find my method a little stupid.

Picture of Front Panel

So basically this is the front panel. I don't have the kinect with me so I can't show how it looks like actually.

private void left_ankle_MouseMove(object sender, MouseEventArgs e)
    {
        Point lA = e.GetPosition(this);
        leftAnkleX = lA.X;
        leftAnkleY = lA.Y;
    }

    private void getReady()
    {
        if (null != leftAnkleX && null != leftAnkleY && null != headX && null != headY && null != rightAnkleX && null != rightAnkleY)
        {
             if ((headX > btmLeftX) && (headX <btmRightY) && (headX <topLeftY))
                ss_dis.Text = "Detected"; 

        }
    }

This is how I am trying to grab the david beckham Ellipse but it's not working very well.

Hope there is enough info now!

casperOne
  • 73,706
  • 19
  • 184
  • 253
Bocky
  • 483
  • 1
  • 7
  • 27
  • 1
    Could you elaborate please, I am not sure I understand what you are trying to do. In kinect if you are tracking the head, why do you want to know the position of the mouse? – Andrew Cox Jul 24 '12 at 14:10
  • 2
    Additionally, please provide some skeleton code if you've already tried something and it isn't working. – Jerdak Jul 24 '12 at 17:36
  • Do you mean `Canvas.GetTop` / `Canvas.GetLeft`? – Liam McInroy Jul 24 '12 at 19:34
  • I think I'm still lost as to your goal. This is how I'm interpreting your problem: You use the kinect to detect joint positions, those positions are linked to the icons in your screenshot, and you want to know when David's head moves in to the area on the left? If that's the case, I'm not sure why you're using MouseMove. You can use System::Timers::Timer to create a timer the updates every 30ms or so and does the check for getReady. – Jerdak Jul 25 '12 at 17:55
  • I am actually using pixel counts to get the location of David's head position now. I need MouseMove to tell me where is its exact location. I have a small rectangle box at the bottom of the xaml and thats the detectionzone. If David's head enter that box, then the textblock1 will show "detected". – Bocky Jul 26 '12 at 01:03
  • 2
    I'm going to take 1 more stab at understanding. The only time the MouseMove event fires is when your mouse cursor crosses the object that event is attached to. This shouldn't have anything to do with icons you have of feet or David's head. Barring anything else I would suggest posting a significant portion of your code for review, at the very least you .cs. – Jerdak Jul 26 '12 at 03:05

0 Answers0