Depthmap data (image_raw topic)
Hello,
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:
Thanks in advance for any hints.
Update 2: In callback of imageraw 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 CV32FC1 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.
Current code can be found here.
Many thanks in advance...
Asked by ZdenekM on 2012-07-03 07:17:48 UTC
Comments
I suppose you don't have this problem anymore, right? It is now fixed, at least in Indigo
Asked by jorge on 2014-09-03 09:36:51 UTC