我正在使用Kinect定位应用程序,我想在Android应用程序中显示它。我得到的深度值以米为单位,并且它的值为负值,因为坐标零位于Kinect的中心。我仍然困惑如何使像素坐标和计算成为真实值。有人可以给我建议,还是可以在Android中显示建议?这是代码的一部分:
if (dataReceived)
{
foreach (Body body in _bodies)
{
if (body.IsTracked)
{
IReadOnlyDictionary<JointType, Joint> joints = body.Joints;
Dictionary<JointType, Point> jointPoints = new Dictionary<JointType, Point>();
foreach (JointType jointType in joints.Keys)
{
// sometimes the depth(Z) of an inferred joint may show as negative
// clamp down to 0.1f to prevent coordinatemapper from returning (-Infinity, -Infinity)
CameraSpacePoint position = joints[jointType].Position;
if (position.Z < 0)
{
position.Z = InferredZPositionClamp;
}
DepthSpacePoint depthSpacePoint = this.coordinateMapper.MapCameraPointToDepthSpace(position);
jointPoints[jointType] = new Point(depthSpacePoint.X, depthSpacePoint.Y);
}
Joint Head = joints[JointType.Head];
float x = Head.Position.X;
float y = Head.Position.Z;
因为我想使其成为二维空间,所以我将z用作y,因为我认为y坐标并不重要。我的下一个问题是y Kinect坐标对二维空间有影响吗?