-
Notifications
You must be signed in to change notification settings - Fork 619
How to get/output the distance a person is away from the Kinect once their body is detected? #1042
Comments
My guess would be choosing a position from the body (i.e. head) and just calculate the euclidean distance to 0|0|0 because thats the position of the depth camera. Example: |
can you give me the source code please if you have. |
Sorry I don't have an working example at hand, but you could check out this example on how to get all the joint positions: So after line 15 you would calculate the joints distance to the camera like this: For the "sqrt" function you would need to include "math.h" |
Thank you.
…On Wed, Feb 12, 2020 at 10:04 AM Stephan Mävers ***@***.***> wrote:
Sorry I don't have an working example at hand, but you could check out
this example on how to get all the joint positions:
https://github.com/microsoft/Azure-Kinect-Samples/blob/master/body-tracking-samples/simple_cpp_sample/main.cpp#L15
So after line 15 you would calculate the joints distance to the camera
like this:
sqrt(position.v[0]*position.v[0] + position.v[1] * position.v[1] +
position.v[2] + position.v[2])
For the "sqrt" function you would need to include "math.h"
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1042?email_source=notifications&email_token=AIU3RCLHB5XYVPKJUMATKOTRCNDKLA5CNFSM4KJGFRSKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELO4PUA#issuecomment-584959952>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIU3RCK7WJAONZ5FIP6SNGTRCNDKLANCNFSM4KJGFRSA>
.
|
Piggy backing on this comment, is there a way to get the distance of a segmented body that does not have body tracker active on it? |
I'm pretty new to developing with the Kinect and I'm using the Kinect to extract data a person's movements in a room.
Firstly, I want to get the distance a person is away from the Kinect after their body has been detected using the body tracking SDK.
I'm looking to achieve something similar to the Cognitive Services example where a distance in mm is output when a person is detected.
Any suggestions are appreciated! Thanks.
The text was updated successfully, but these errors were encountered: