Ask Your Question

The depth information from Kinect VS actual distance

asked 2011-10-19 10:19:46 -0500

alexQ gravatar image

updated 2016-10-24 09:02:13 -0500

ngrennan gravatar image

Hi guys, I am quite new to ROS. What I've been trying to do is to obtain the depth data detected by Kinect in order to figure out how these data related to the actual distance.
The project I am using is Openni_Kinect. After launching it, I tried to get the depth information by using rostopic echo camera/depth/image as it provides Unrectified depth image with float depths in m. However, what I got is a huge amount of numbers like 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 75, 120, 148, 65, 75, 120, 148, 65, 75, 120, 148, 65, 75, 120, 148, 65...
So does anyone know what these number represent? Or am I doing it right? Do I need to switch to OpenNI to directly get the depth data?
Thanks in advance!

edit retag flag offensive close merge delete


If you're interested in raw Kinect data, I think using OpenNI directly is probably better.
LiMuBei gravatar image LiMuBei  ( 2011-10-19 20:24:33 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2011-10-19 21:38:57 -0500

sebsch gravatar image

rostopic does not handle float images correctly and will instead interpret the data as an array of unsigned characters (bytes), which is what you see.

If you only want to have a look at what the depth image looks like, you can display it using image_view:

rosrun image_view image_view image:=/camera/depth/image

If you need access to the raw float data, you should write a small node that subscribes and processes these float images. Check this tutorial

edit flag offensive delete link more


Thanks for your reply. Just as you said, the data provided by the topic /camera/depth/image_raw is actually what I wanted.
alexQ gravatar image alexQ  ( 2011-10-23 08:30:32 -0500 )edit

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: 2011-10-19 10:19:46 -0500

Seen: 1,329 times

Last updated: Oct 19 '11