How to use depth position data instead of skeleton data and/or both together

Feb 28, 2012 at 4:27 PM
Edited Feb 28, 2012 at 4:27 PM

I wonder does anyone know how to use the position data from depth stream instead of skeleton data to control mouse? I wish to take all users into account using my multipoint project (passive and active) then pass the positional data/if mouse is clicked to my mouse emulator and im still working on testing out mouse clicks but it moves the mouse just fine. I will partner my project with yours because it wouldn't take much modification from your code to get it working with my project except I need more then two users using the mouse devices my emulator creates. Its the same principles I noticed as sendinput like: mouse position is relative so you have to do math to make it move to correct position.

So heres the overall two things I need to make modifications to your code for kinect mouse to have my project up and running on v1:

1. Take into account passive kinect users and active users that can be tracked - done this one already or in progress.

2. Add both types of users into the mouse move and click - trouble is how do I convert the depth image to a skeleton one for tracking those passive users too?

Feb 29, 2012 at 8:31 PM

checkout http://channel9.msdn.com/Series/KinectQuickstart/Working-with-Depth-Data

and download quick slides and samples 

 

/*inside _depthFrameReady function you create an array of rawdepthdata and fill it with depth data from depthframe:*/

using (depthFrame = e.OpenDepthImageFrame())

            { 

              if (depthFrame == null)                    return;                               

if (rawDepthData.Length != depthFrame.PixelDataLength)

                {

                    rawDepthData = new short[depthFrame.PixelDataLength];

                     pixDepth = new int[depthFrame.PixelDataLength];

                }               

depthFrame.CopyPixelDataTo(rawDepthData);

 

////////and then you fill the pixdepth array 

for (int depthIndex = 0; depthIndex < rawDepthData.Length; depthIndex++)            {               

                //gets the depth value               

int depth = rawDepthData[depthIndex] >> DepthImageFrame.PlayerIndexBitmaskWidth;   

         pixDepth[depthIndex] = depth;                //.9M or 2.95'

}