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

Fix conversion from Blender to COLMAP coords in NeRF camera import. #111

Merged
merged 1 commit into from
Aug 24, 2023
Merged

Fix conversion from Blender to COLMAP coords in NeRF camera import. #111

merged 1 commit into from
Aug 24, 2023

Conversation

jakubcerveny
Copy link
Contributor

The NeRF camera import code incorrectly converts from OpenGL/Blender camera axes to COLMAP camera axes.

The original code flips the sign of YZ rows of the world-to-camera matrix, which turns the world 180 degrees around the X axis, but doesn't convert the camera. Then the line T = -matrix[:3, 3] moves the camera to an antipodal point, which accidentally works, but the cameras stay in the Blender format and project "backwards". With the random initial point cloud the synthetic NeRF benchmarks work, but using a initial point cloud from custom data fails.

The Blender cameras need to be converted while the matrix is still in the camera-to-world format, which is what this PR does.

(The PR addresses issue #100)

@grgkopanas
Copy link
Collaborator

Hi,

Thank you so much for actually finding this. Have you run it in any of the blender datasets of nerf-synthetic? What PSNR did you get in the end in the test set?

@jakubcerveny
Copy link
Contributor Author

I tested the fix on "lego" and "ship", both seemed to work exactly as before. Since the error metric doesn't penalize the model ending up flipped 180 degrees in world space, I would expect the PSNR to be exactly the same (I didn't check though). The only positive effect is compatibility with a custom initial point cloud.

@grgkopanas grgkopanas merged commit 0f125cb into graphdeco-inria:main Aug 24, 2023
nicolaihaeni pushed a commit to nicolaihaeni/gaussian-splatting that referenced this pull request Sep 12, 2023
…raphdeco-inria#111)

Co-authored-by: Jakub Červený <jakub.cerveny@melowntech.com>
nicolaihaeni pushed a commit to nicolaihaeni/gaussian-splatting that referenced this pull request Sep 12, 2023
Update README.md

Update README.md

Update README.md

Update README.md

Update README.md

Update README.md

Update README.md

Update README.md

Update README.md

Fix conversion from Blender to COLMAP coords in NeRF camera import. (graphdeco-inria#111)

Co-authored-by: Jakub Červený <jakub.cerveny@melowntech.com>
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

Successfully merging this pull request may close these issues.

2 participants