Pixel-Depth Scaling Incorrect
See original GitHub issueI believe the calculation for the pixel-depth of the Camera sensor to be incorrect. Please see the below two images:
As you can see, the image on the left is using the default near_far=(0.01, 1000)
during Camera initialisation. However this image is completely useless for vehicle navigation because all objects close to the car for a significant distance, such as bushes, have a lightness value of 0. So, I have reduced the Camera on the right’s near_far=(0.01, 100)
, expecting that objects at a distance of 100 to have a lightness value of 255 and objects at 0.01 to have a lightness value of 0. This should result in objects closer to the vehicle having a much more fine and resolved lightness scale. As you can see this is not the case.
The lightness values are not scaling whatsoever with the near_far
setting of the camera. The image on the right shows that all objects within range of the cameras near_far
clipping range, have the exact same lightness values as the image on the left. The only difference is the sky appearing darker because it is clipped at a shorter distance. I am almost certain this is not correct behaviour?
I believe the above code located in the Camera class in the decode_response
method is maybe the culprit.
If indeed this is normal behaviour, how can I go about making objects closer to the vehicle have a finer resolution of depth? Because these depth images are completely useless to me.
Reproducing
To reproduce this behaviour, simply attach a Camera to a vehicle and adjust the near_far setting:
If the lightness values are scaled correctly, i would expect the sky to always remain white (lightness 255).
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (9 by maintainers)
@pascale-commits Thanks for the guidelines. I’ve submitted a new pull request and also agreed to the CLA (sent an email to info@beamng.gmbh) https://github.com/BeamNG/BeamNGpy/pull/110
Hi! I have the same problem. This should fix it #105