Unit of captured depth image value by python

Hello there,

What is the unit of captured depth image value by Python? As stated in SyntheticDataHelper(), I used to get the data, however it turns incorrect.

sd = omni.syntheticdata._syntheticdata
sdi = sd.acquire_syntheticdata_interface()

def _get_sensor_data(sensor, dtype):
    width = sdi.get_sensor_width(sensor)
    height = sdi.get_sensor_height(sensor)
    row_size = sdi.get_sensor_ros_size(sensor)
    get_sensor = {
            "uint32": sdi.get_sensor_host_uint32_texture_array,
            "float": sdi.get_sensor_host_float_texture_array,
    }
    return get_sensor[dtype](sensor, width, height, row_size)

depth = _get_sensor_data(sd.SensorType.Depth, "float")

Say, the received value is [0.0094961, 0.00948272, …] while the real value(unit:meter) in the simulation would be [7.4304, 7.4352, …]. Any other transformation steps needed?

Can anyone help? Thanks~!

Hi @rosy.luo

depth = _get_sensor_data(sd.SensorType.Depth, "float") refers to the inverse depth value. To get the real depth value in meter, please use depth = _get_sensor_data(sd.SensorType.DepthLinear, "float")

It works! Thanks~!

Best regards,
Rosy

1 Like