ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Kinect depth image to real world coordinate

asked 2018-03-12 11:59:49 -0600

Divus12 gravatar image

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 flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2018-03-12 12:41:02 -0600

Gayan Brahmanage gravatar image

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
edit flag offensive delete link more

Comments

Hi Gayan,

Thank you for your time to answer my question.

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;

Divus12 gravatar image Divus12  ( 2018-03-12 23:33:15 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-03-12 11:59:49 -0600

Seen: 749 times

Last updated: Mar 12 '18