Closed gvillette closed 7 years ago
Z only exists in depth space. You may use _mapper.MapCameraPointToDepthSpace from low-level API for mapping body joints to depth space. Or you can use body_joint_to_color_space and body_joints_to_color_space I've just added.
@vladkol
joints = body.joints
# convert joint coordinates to color space
joint_points = self._kinect.body_joints_to_depth_space(joints)
print joint_points[PyKinectV2.JointType_AnkleLeft].x
print joint_points[PyKinectV2.JointType_AnkleLeft].y
print joint_points[PyKinectV2.JointType_AnkleLeft].z ###This gives error.
You need to get z from depth frame using x and y you got from body_joints_to_depth_space
@vladkol Hi Vlad, Thanks for your comment. Can we use the following equation to calculate z from x and y ? Or any other equation ?
z = sqrt(x² + y² - 2 x y * cos(γ))
@vladkol
I don't think so, unless your Kinect is facing a surface that may be defined by an equation. Depth frame has Z-data, you can get it from there.
Hi, Is it possible to retrieve the z coordinates for skeleton ? I'm trying by inspriring of the exemple, but ColorSpacePoint don't have it, and if i add it myself i don't retrieve it in the joints later ...