lgsvl / simulator

A ROS/ROS2 Multi-robot Simulator for Autonomous Vehicles
Other
2.24k stars 768 forks source link

Depth Camera Output #1417

Open crixcrixcrix opened 3 years ago

crixcrixcrix commented 3 years ago

I am trying to interpret images output from a depth camera. A previous answer says:

Each pixel in the result records the Euclidean distance between the 3D point corresponding to that pixel and the camera origin

However this does not seem to be the case: values in the depth image are greater for objects closer to the camera, and do not appear to scale linearly with distance. How do I compute distance from the values in the depth image?

crixcrixcrix commented 3 years ago

Here are the settings used for the depth camera: image

And here is an example depth image: image

PyTorr commented 2 years ago

How do you save the Depth image?

zxydi1992 commented 2 years ago

Hi,

I have the same question, from the simulator's code, I guess it is non-linear in distance.

Sijie-L commented 1 year ago

Hi, Any update on this question? @crixcrixcrix @zxydi1992 From the source code I found that the depth is the distance I want but then it goes through some calculations and gets the outColor. Any suggestion on how to decode/transform the int we get from the depth image back to the distance will be really appreciated...