ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Accurate distance to kinect with Openni

asked 2012-05-31 02:11:39 -0600

Antares gravatar image

updated 2016-10-24 09:01:55 -0600

ngrennan gravatar image

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-05-31 05:51:34 -0600

updated 2012-05-31 05:51:55 -0600

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2012-05-31 02:11:39 -0600

Seen: 1,014 times

Last updated: May 31 '12