Conversion of depth values to meters

#1
by yaraalaa0 - opened

Hello,
I would like to ask please how to convert the pixel values in the depth images to values in meters. When I read any depth image, I get RGB values ranging from 0 to 255 but I don't know how to convert them to meters.

Thank you

To convert the depth values to metric scale, use the following formula:

normalized = (R + G * 256 + B * 256 * 256) / (256 * 256 * 256 - 1)
depth_in_meters = 1000 * normalized

Where R, G, and B are the red, green, and blue channel values (0-255) respectively. Reference: https://carla.readthedocs.io/en/latest/ref_sensors/#depth-camera

sahilkhose changed discussion status to closed

Sign up or log in to comment