ROS Answers: Open Source Q&A Forum - RSS feedhttps://answers.ros.org/questions/Open source question and answer forum written in Python and DjangoenROS Answers is licensed under Creative Commons Attribution 3.0Mon, 12 Mar 2018 23:33:15 -0500Kinect depth image to real world coordinatehttps://answers.ros.org/question/285156/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?Mon, 12 Mar 2018 11:59:49 -0500https://answers.ros.org/question/285156/kinect-depth-image-to-real-world-coordinate/Answer by Gayan Brahmanage for <p>Im currently using Kinect xbox 360 with MATLAB software.
My current approach to convert depth image to real world coordinate is by using;</p>
<p>X = (j - w/2) * 320/w * M * Z</p>
<p>Y = (i - h/2) * 240/h * M * Z</p>
<p>where,
i = row,
j = column,
w = width of the photo,
h = height of the photo, <br>
M = NUI_CAMERA_DEPTH_IMAGE_TO_SKELETON_MULTIPLIER_320x240 and
Z = distance</p>
<p>what i want to do is to calculate the length in meter of a human shoulder width, so i continue by using the formula</p>
<p>length = X2 - X1.</p>
<p>but still i couldnt get the appropriate answer.. Is my direction correct?</p>
https://answers.ros.org/question/285156/kinect-depth-image-to-real-world-coordinate/?answer=285163#post-id-285163 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 rightMon, 12 Mar 2018 12:41:02 -0500https://answers.ros.org/question/285156/kinect-depth-image-to-real-world-coordinate/?answer=285163#post-id-285163Comment by Divus12 for <p>Use following formulas with correct directions. </p>
<pre><code> (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
</code></pre>
https://answers.ros.org/question/285156/kinect-depth-image-to-real-world-coordinate/?comment=285195#post-id-285195Hi 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;Mon, 12 Mar 2018 23:33:15 -0500https://answers.ros.org/question/285156/kinect-depth-image-to-real-world-coordinate/?comment=285195#post-id-285195