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

Diagonal scaling matrix get incorrectly initialized to a full-one matrix #37

Closed
Mistariano opened this issue Feb 17, 2024 · 2 comments
Closed

Comments

@Mistariano
Copy link

Hi guys,

I wonder that ths S matrix defined in computeCov3D funcs for both fwd/bwd computations is now incorrectly initialized to full-one:

glm::mat3 S = glm::mat3(1.0f);

If I understand correctly, here we expect an identity matrix instead:

glm::mat3 S = glm::mat3(
    1.0f, 0.0f, 0.0f,
    0.0f, 1.0f, 0.0f,
    0.0f, 0.0f, 1.0f
);

Fortunately, such a full-one matrix with a scaled main diagonal is usually positively defined and symmetric. Thus, the reparameterized $R^TSSR$ is still a covariance matrix.

I have roughly checked that this issue is not so influential to the PSNR performance. If required and agreed, I'm more than glad to submit a hotfix PR for it.

@ys-koshelev
Copy link

@Mistariano Please beware, that according to the Sec. 5.4.2 of OpenGL API docs

If there is a single scalar parameter to a vector constructor, it is used to initialize all components of the constructed vector to that scalar’s value. If there is a single scalar parameter to a matrix constructor, it is used to initialize all the components on the matrix’s diagonal, with the remaining components initialized to 0.0.

For this reason, glm::mat3 S = glm::mat3(1.0f); provides identity matrix, not the matrix full of ones.

@Mistariano
Copy link
Author

@ys-koshelev Thanks a lot for your kind reply. I will close this issue.

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