How to determine the "real world" of x, y coordinates from kinekt depth data?

The depth values โ€‹โ€‹returned by the kinect sensor correspond to the distance of the real world z (in mm) from the xy plane. So far, I can not find anything in the last sdk that returns something like this for the x and y coordinates. Is it provided in sdk? Otherwise, what would be a good way to calculate x and y?

+4
source share
1 answer

You can use the KinectSensor.MapDepthToSkeletonPoint method, which returns SkeletonPoint. Example code could be

using (DepthImageFrame depthimageFrame = e.OpenDepthImageFrame()) { if (depthimageFrame == null) { return; } pixelData = new short[depthimageFrame.PixelDataLength]; depthimageFrame.CopyPixelDataTo(pixelData); for (int x = 0; x < depthimageFrame.Width; x++) { for (int y = 0; y < depthimageFrame.Height; y++) { SkeletonPoint p = sensor.MapDepthToSkeletonPoint(DepthImageFormat.Resolution640x480Fps30, x, y, pixelData[x + depthimageFrame.Width * y]); } } } 
+6
source

All Articles