Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about camera poses #23

Open
Loydian opened this issue Jul 28, 2023 · 2 comments
Open

Question about camera poses #23

Loydian opened this issue Jul 28, 2023 · 2 comments

Comments

@Loydian
Copy link

Loydian commented Jul 28, 2023

Thanks for your extraordinary work and the released code.
But I found that, after you transform the camera poses from llff format to nerf format with the following code,

  poses = np.concatenate(
      [poses[:, 1:2, :], -poses[:, 0:1, :], poses[:, 2:, :]], 1
  )

but you inverse the y and z axis again by the parse_llff_pose function as follows. What is this for?

def parse_llff_pose(pose):
  """convert llff format pose to 4x4 matrix of intrinsics and extrinsics."""

  h, w, f = pose[:3, -1]
  c2w = pose[:3, :4]
  c2w_4x4 = np.eye(4)
  c2w_4x4[:3] = c2w
  c2w_4x4[:, 1:3] *= -1
  intrinsics = np.array(
      [[f, 0, w / 2.0, 0], [0, f, h / 2.0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]
  )
  return intrinsics, c2w_4x4

This really confuses me.

@Loydian
Copy link
Author

Loydian commented Jul 28, 2023

It seems that you transform poses into opencv format. What is this for?

@zhengqili
Copy link
Collaborator

This is some historical/compatibility reasons to keep code same as original NeRF and IBRNet data format and codebase. Basically, the script loads colmap format and convert and save to llff format. In the end, the dataloader will transform it into colmap again. So baiscally, opencv in and opencv out for training and inference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants