0
$\begingroup$

Rosanswers logo

Hi, I know this question might be very easy but I could not find a direct solution for that in the previous questions. I have a kinect and I use openni_tracker to detect the person's joint. Now I want to find the distance of the person to the camera. I know that I receive XYZ information for every joint, and in my case X will be the distance to the camera, but I want to use another node (openni_camera) to find out distance information, it is needed to be very accurate! I am not very familiar with PCL or Open_CV. Do I need to use them? Which topic in openni_camera will give me the calibrated and accurate depth (distance) information? I just need the distance of the person (for example his torso) from the camera every time.


Originally posted by Antares on ROS Answers with karma: 27 on 2012-05-31

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

openni_tracker broadcasts tf data for the body pose (not just XYZ data), and to be clear, X DOES NOT represent the distance from the camera, it represents the X coordinate of the 3D position of that point in some coordinate frame.

If you want to find the distance of the tracked person from the camera, you should choose one of the frames that openni_tracker broadcasts (torso might be a good choice), then lookup the transform between camera_depth_optical_frame and torso. Once you have that transform, you can take the translation X,Y,Z values and use the Pythagorean theorem to find the distance. No OpenCV or PCL required.


Originally posted by Dan Lazewatsky with karma: 9115 on 2012-05-31

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.