nerfstudio-project / nerfstudio

A collaboration friendly studio for NeRFs
https://docs.nerf.studio
Apache License 2.0
8.87k stars 1.18k forks source link

Question about the value of 'fov' for 'ns-render camera-path' that can render exactly as in training dataset #3176

Open stanathong opened 1 month ago

stanathong commented 1 month ago

Hi, thank you for making the project available to the public and for maintaining it.

I have a question about the value of 'fov' used in camera_path.json. How can I find the value of 'fov' such that the rendered images from ns-render camera-path are the same/close to that obtained from ns-render dataset or is this possible?

I'm current computing these values using the focal length in transforms.json as below.

fov_x = 2 std::atan(0.5 image_width / f_x); fov_y = 2 std::atan(0.5 image_height / f_y);

I tried both fov_x and fov_y but I can't get the results closer to the original training images.

Due to some limitations of the repo I used, my camera poses are optimised prior to the training. However, I have applied dataparser_transforms to the exported camera pose using ns-export when computing the camera-path.json file. Does this affect the rendered results or do I have to apply any transform to 'fov'?

Thank you very much for your help.

stanathong commented 1 month ago

To answer one of my questions, it's fov_y = 2 std::atan(0.5 image_height / f_y) if the camera poses are not optimised.