Ask Your Question
0

The depth information from Kinect VS actual distance

asked 2011-10-19 10:19:46 -0600

alexQ gravatar image

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

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

Comments

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

1 Answer

Sort by ยป oldest newest most voted
1

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

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

Comments

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 imagealexQ ( 2011-10-23 08:30:32 -0600 )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

Stats

Asked: 2011-10-19 10:19:46 -0600

Seen: 1,285 times

Last updated: Oct 19 '11