Thursday, February 16, 2012 11:38 PM
I'm converting my raw depth data into real world co-ordinates 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?
Friday, February 17, 2012 1:47 AMOwner
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, Owner Friday, February 17, 2012 1:54 AM
Friday, February 17, 2012 5:10 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, Owner Friday, February 17, 2012 10:35 PM
Friday, February 17, 2012 9:34 AM
Yes I am trying to adjust into a real world co-ordinate 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 :)
Friday, February 17, 2012 4:19 PMIt may not work for you, but you may find SkeletonFrame.FloorClipPlane useful to consider. The 4 item tuple represent the coefficients for a floorplane equation in the form Ax+By+Cz+d = 0.
-Adam Smith [MSFT]