简体   繁体   中英

c# Kinect 2.0 How to detect how far a body away from the center of Kinect sensor

When I stand at the left hand side of the Kinect sensor, how can I calculate the distance between me and the center of Kinect sensor? 细节

For me I use the CameraSpacePoint class.

For this I use 1 Joint for example the center of the body, and i convert it in CameraSpacePoint .

For example:

CameraSpacePoint myPoint = myJoint.Position;
Console.WriteLine(pointLeft.X);//for have your distance 

The distance was in meter with 0 the center of Kinect Sensor

It works also with Y and Z.

You can found more information here: CameraSpacePoint Structure .

It seems pretty straightforward. The Kinect actually gives you the distance from the sensor, regardless of the direction...

Based on that, you just need to make the depth comparison between your point and the center point of the frame. That difference gives you the difference you are looking for.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM