Depthmap data (image_raw topic) [closed]

asked 2012-07-03 07:17:48 -0500

ZdenekM gravatar image

updated 2016-10-24 08:37:24 -0500

ngrennan gravatar image


I have some difficulties while working with depthmaps - with Turtlebot simulator I'm using /depth/image_raw topic. As I can see from message header, it's in mono8 encoding, but why is step equal to 1? It should be 1280 as far as I know, right?

Update: I performed experiments with real Kinect and messages on /camera/depth/image_raw topic have encoding 16UC1 and step 1280... So how can I convert data from simulation to another encoding? Or is it possible to set simulation to produce data of same encoding as real kinect?

Actually, I want to access each pixel of depthmap (distance in mm) and do some computation with it. Using real Kinect I was able to get reasonable numbers, but I have troubles using simulated one. My code is here. Problem is that I'm getting strange numbers (too high) when I place object in front of TB (it looks like that something is overflowing).

If I visualize depthmap from my code it looks like this:

image description

Thanks in advance for any hints.

Update 2: In callback of image_raw topic I made copy of message, then I changed encoding to 16UC1, step to 1280. After then I use toCvCopy, perform some processing and then convert image to CV_32FC1 a publish it. Result is much better, but still not exactly what I want - It looks like depth map is copied three times on top of image. Despite this fact it seems to be ok.

image description

Current code can be found here.

Many thanks in advance...

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by tfoote
close date 2015-03-26 16:42:13.329250


I suppose you don't have this problem anymore, right? It is now fixed, at least in Indigo

jorge gravatar imagejorge ( 2014-09-03 09:36:51 -0500 )edit