Answered by:
Units for SkeletonPoint data?
Question

Hi there,
I'm converting my raw depth data into real world coordinates using MapDepthToSkeletonPoint() but I'm not sure about the values I'm getting.
For example (xvalue, yvalue, depthvalue) of (36, 197, 2580) maps to (0.139, 0.08, 0.322). Looking at previous documentation it implies that this sort of thing should be in metres but all the values are too small)
My values of x and y are assuming the top left of image is the centre and then 197 rows down and 36 across.
Any help please?
Answers

Note that this is intended to be used directly with data from the depth pixel buffer, not a "coordinate". The difference here is that (36, 197, ...) is, as you say, 36 over, 197 down, the depth value should be the depth value in the depth pixel buffer at that point.
In this case, a pixel with a depth of 2580mm and with, say, player index 4 found, would have a value of:
(2580 << DepthImageFrame.PlayerIndexBitmaskWidth)  4;
So, your depth was interpreted as (2580 >> DepthImageFrame.PlayerIndexBitmaskWidth) (that is, divided by 8), which is 322mm, which is precisely what you received.
Like the Depth value, the X and Y coords are also "meters from the center of the frame".
Adam Smith [MSFT]
 Marked as answer by Carmine Si  MSFTMicrosoft employee Friday, February 17, 2012 10:35 PM
All replies

The depth data is already converted for you. The depthValue = 2580 is the distance in millimeters. Can you provide more detail on how you are getting the depth value?
Is your intent to map a depth distance value to a position on a skeleton in the "real world"
 Edited by Carmine Si  MSFTMicrosoft employee Friday, February 17, 2012 1:54 AM

Note that this is intended to be used directly with data from the depth pixel buffer, not a "coordinate". The difference here is that (36, 197, ...) is, as you say, 36 over, 197 down, the depth value should be the depth value in the depth pixel buffer at that point.
In this case, a pixel with a depth of 2580mm and with, say, player index 4 found, would have a value of:
(2580 << DepthImageFrame.PlayerIndexBitmaskWidth)  4;
So, your depth was interpreted as (2580 >> DepthImageFrame.PlayerIndexBitmaskWidth) (that is, divided by 8), which is 322mm, which is precisely what you received.
Like the Depth value, the X and Y coords are also "meters from the center of the frame".
Adam Smith [MSFT]
 Marked as answer by Carmine Si  MSFTMicrosoft employee Friday, February 17, 2012 10:35 PM

Hi there,
Yes I am trying to adjust into a real world coordinate system as I am trying to get a plane equation for the floor and then calculate the distance between the centre of an object and the floor (I know there's a way to do this with a skeleton but I'm trying to do it with not just skeletons)
Thankyou Adam, that makes more sense now. I've fed in the depth pixel buffer value instead and the numbers make a lot more sense :)
