Getting the depth information in meter

Hi,

is there an easy way to get the depth information in meter, for example the “left_depth_image” from “CoarseToFineStereoDepth”:
https://docs.nvidia.com/isaac/isaac/doc/doc/component_api.html#isaac-stereo-depth-coarsetofinestereodepth

When i use the DepthCameraViewer (https://docs.nvidia.com/isaac/isaac/doc/doc/component_api.html#isaac-viewers-depthcameraviewer), i have 3 color channels but i want one with the depth information in meter.

There must be a way to read the information directly from the “left_depth_image”?

Thanks for your help!

Hi @paxipax,

isaac.stereo_depth.CoarseToFineStereoDepth
output
left_depth_image [DepthCameraProto]: The inferred depth in meters (from the view of the left camera).
containing

  # A depth value for every pixel in the image. The pixel type is a single 32-bit float.
  depthImage @0: ImageProto;
  # The minimum and maximum depth used
  minDepth @1: Float32;
  maxDepth @2: Float32;
  # Intrinsic camera parameters
  pinhole @3: PinholeProto;

So the depthImage is a 32b grayscale image of depth in meter.
So if minDeth is 0 and maxDepth is 10 that would mean that a pixel of the depthImage with 50% of white mean 5m and a completly black pixel mean >=10m.
You can send the depthImage to a cpp custom code to do stuff with it, to do that follow the Ping Pong tuto that show how to get data from Isaac, if you need help with your cpp code don’t hesitate to tell me what is blocking you.

Hope I could help,
regards,
Planktos

1 Like

Hey @Planktos

thank you very much! I was hoping there was an easier way but i think I did it.
Now I’m struggling to include my own libraries.
The libraries are loaded but I get a error message when I try to use functions from my own library: “undefined symbol” but only if i run it, when i build it, its all fine.
Is it even possible to integrate own libraries into the cpp custom code?

Thank you,
paxipax

Hey,
Yes it is perfectly possible

1 Like

haha well,
then the problem is probably in front of the computer. Thank you, I will dig into it.