princeton-vl / infinigen

Infinite Photorealistic Worlds using Procedural Generation
https://infinigen.org
BSD 3-Clause "New" or "Revised" License
5.14k stars 430 forks source link

Camera focal length #244

Closed TomTomTommi closed 1 month ago

TomTomTommi commented 1 month ago

Hi, is there a script to convert depth to disparity for stereo methods training? (Maybe similar to use disparity=focal length*baseline/depth ?)

Plus, I see baseline in base.gin, how can I find and set focal length?

lahavlipson commented 1 month ago

You can set the focal length (in mm) through gin-config, e.g.,execute_tasks.focal_length=100

To obtain/set the focal length in pixels, you need to multiply by the conversion_factor:

conversion_factor = bpy.context.scene.render.resolution_x / camera.data.sensor_width

We export the depth, camera poses and camera intrinsics for the left and right cameras. So you need to compute the disparity manually using the equation you mention.