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

The proper way of getting C2W matrix from self.world_view_transform? #1185

Open
justin4ai opened this issue Mar 10, 2025 · 3 comments
Open

Comments

@justin4ai
Copy link

Hi,

thanks for your amazing code work, we are able to access to W2C matrix(= self.world_view_transform) here.

However, the code for the function getWorld2View2 is very tricky; The function that I'm confused with the way of getting the proper C2W matrix from self.world_view_transform.

Do I need to 1. transpose 0th and 1st dimension against self.world_view_transform and 2. apply the inverse function (just following the exact reverse step)?

Thanks,
Junyeong Ahn

@sonbosung
Copy link

It seems that the transpose operation is just for following glm convention(column-major order). The diff-gaussian-rasterization submodule uses glm library.

@justin4ai
Copy link
Author

justin4ai commented Mar 11, 2025

Thanks for your help. Then self.world_view_transform.T must stand for the right world to camera matrix (based on row-major Python). Applying inverse function after the transpose may lead to C2W matrix.

@sonbosung
Copy link

sonbosung commented Mar 11, 2025

You're correct. Also, you can note a potentially confusing expression in the getWorld2View2 function, where it transposes the given rotation matrix R. When reading the dataset in the readColmapCameras function in dataset_readers.py, it assigns the transposed rotation matrix to R.

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