# Kinect depth image to real world coordinate

Im currently using Kinect xbox 360 with MATLAB software. My current approach to convert depth image to real world coordinate is by using;

X = (j - w/2) * 320/w * M * Z

Y = (i - h/2) * 240/h * M * Z

where, i = row, j = column, w = width of the photo, h = height of the photo,
M = NUI_CAMERA_DEPTH_IMAGE_TO_SKELETON_MULTIPLIER_320x240 and Z = distance

what i want to do is to calculate the length in meter of a human shoulder width, so i continue by using the formula

length = X2 - X1.

but still i couldnt get the appropriate answer.. Is my direction correct?

edit retag close merge delete

Sort by » oldest newest most voted Use following formulas with correct directions.

 (u,v) is the point coordinates in pixels,

P(x, y, z)---->>>  x = depth
y = −(v − 480/2) ∗ depth/focal_length
z = (u − 640/2) ∗ depth/focal_length

x : depth, positive forward
y : height, positive upwards
z : width, positive to the right

more

Hi Gayan,

Would like to ask which value should i use for focal_length??

NUI_CAMERA_DEPTH_NOMINAL_FOCAL_LENGTH_IN_PIXELS = 285.63; NUI_CAMERA_DEPTH_NOMINAL_INVERSE_FOCAL_LENGTH_IN_PIXELS = 3.501e-3;