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

About projection matrix #6

Open
dingjr7 opened this issue Sep 4, 2024 · 3 comments
Open

About projection matrix #6

dingjr7 opened this issue Sep 4, 2024 · 3 comments

Comments

@dingjr7
Copy link

dingjr7 commented Sep 4, 2024

What is the camera coordinate defined in mini-splatting? I find the closest one is the one from direct3D.
屏幕截图 2024-09-04 233732
However, you commented out the P[2, 2]. Moreover, the sign of P[0, 2] and P[1, 2] are not the same.

@fatPeter
Copy link
Owner

fatPeter commented Sep 5, 2024

Thank you for your interest.

Please check this issue (graphdeco-inria/gaussian-splatting#388) for more information.
Besides, ensure that the inverse projection (https://github.com/fatPeter/mini-splatting/blob/main/submodules/diff-gaussian-rasterization_ms/cuda_rasterizer/forward.cu#L497C24-L497C53) is correspondingly modified if the projective matrix is modified.

@dingjr7
Copy link
Author

dingjr7 commented Sep 5, 2024

I am still confused. If this follows the opengl's coordinate, then P[2, 3] should be multiplied by 2. The issue suggests that the z range is mapped to [0,1] rather than [-1,1].

@fatPeter
Copy link
Owner

fatPeter commented Sep 5, 2024

You are right. The original and the opengl projection matrix are more technically correct.
The thrid row (P[2,0] to P[2,3]) of the projection matrix indicates normalization along z-axis. Ideally, using mapping from (n, f) to (-1, 1), (0, 1) or any (x, y) does not affect the final reconstruction result in the camera or world space. The key point is to ensure the consistency between the point projection and the inverse projection as:
image
Thank you for pointing it out, and I will switch to the original projection matrix in the following version of mini-splatting.

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