google / mipnerf

Apache License 2.0
894 stars 109 forks source link

How is formula (8) derived? #6

Open Luciennnnnnn opened 3 years ago

Luciennnnnnn commented 3 years ago

I can't derive Sigma in equ (8), could you please explain it a bit more?

Luciennnnnnn commented 3 years ago

Eagerly waiting for the answer

jonbarron commented 3 years ago

There's nothing happening in Equation 8 besides straightforward linear algebra and manipulating Gaussians. If you have a Gaussian defined along an axis (in this case, d) with a variance along the axis of sigma_t^2 and the variance perpendicular to the axis of sigma_r^2, and you want to construct a covariance matrix in 3D, then you should "inflate" that gaussian by sigma_t^2 along the space spanned by d (which is dd^T) and you should "inflate" it in the perpendicular direction (I - dd^T, the null space of d) by sigma_r^2.

AlphaPlusTT commented 2 years ago

@jonbarron Does setting diag = true (use d**2 instead of dd^T) in your code mean that you believe the r and t are irrelevant?

jonbarron commented 2 years ago

No, it doesn't. Setting diag=true makes no assumptions, it just takes advantage of some math to compute an identical quantity a faster way.

KevinSONG729 commented 1 year ago

@jonbarron I think that the coefficients of the two terms(sigma_t^2 and sigma_r^2) in formula 8(2) represent the decomposition of the vector. In the second coefficient, the unit matrix represents the vector itself, and the one that is subtracted represents the projection from the conical frustum coordinate system to the world coordinate system in the direction of the axis, so the second term can only represent the variance perpendicular to the direction of the axis. If we follow the above way of understanding, why is there a formal inconsistency between the coefficients of the first term and the subtracted coefficients of the second term (they differ by ||d||_2^2 times)? I hope you can answer my confusion, thank you very much!

wqx854987945 commented 1 year ago

i have the same question.Hope someone can solve the problem @jonbarron @KevinSONG729

qhdqhd commented 1 year ago

If the direction is normalized, then ||d||=1. But mipnerf used an unnormalized direction vector, which is confusing...

@jonbarron I think that the coefficients of the two terms(sigma_t^2 and sigma_r^2) in formula 8(2) represent the decomposition of the vector. In the second coefficient, the unit matrix represents the vector itself, and the one that is subtracted represents the projection from the conical frustum coordinate system to the world coordinate system in the direction of the axis, so the second term can only represent the variance perpendicular to the direction of the axis. If we follow the above way of understanding, why is there a formal inconsistency between the coefficients of the first term and the subtracted coefficients of the second term (they differ by ||d||_2^2 times)? I hope you can answer my confusion, thank you very much!

qhdqhd commented 1 year ago

@jonbarron I think that the coefficients of the two terms(sigma_t^2 and sigma_r^2) in formula 8(2) represent the decomposition of the vector. In the second coefficient, the unit matrix represents the vector itself, and the one that is subtracted represents the projection from the conical frustum coordinate system to the world coordinate system in the direction of the axis, so the second term can only represent the variance perpendicular to the direction of the axis. If we follow the above way of understanding, why is there a formal inconsistency between the coefficients of the first term and the subtracted coefficients of the second term (they differ by ||d||_2^2 times)? I hope you can answer my confusion, thank you very much!

I think so. The non-diagonal of the covariance matrix is 0, right?