graphdeco-inria / gaussian-splatting

Original reference implementation of "3D Gaussian Splatting for Real-Time Radiance Field Rendering"
https://repo-sam.inria.fr/fungraph/3d-gaussian-splatting/
Other
14.29k stars 1.85k forks source link

confusion about radii #216

Closed ian19981210 closed 1 year ago

ian19981210 commented 1 year ago

Hi, thanks for sharing this great work!I found that you calculate the radius of gaussian in forward.cu by float my_radius = ceil(3.f * sqrt(max(lambda1, lambda2))); but the radius should be 1/sqrt(lamda) in linear algebra.so why you don't use a reciprocal and why you multiple 3.0? thanks for your reply!!!

Snosixtyboo commented 1 year ago

Hi,

why do you think the radius should be the reciprocal? The eigenvalues of the covariance matrix are equivalent to the variance of an unrotated Gaussian. The square root of the variance gives the standard deviation. We extend the radius to 3 * the standard deviation of the Gaussian (99% confidence interval) to compute its "fuzzy" radius (strictly speaking, a Gaussian extends into infinity).

Snosixtyboo commented 1 year ago

Closed due to inactivity

elenacliu commented 10 months ago

@Snosixtyboo That's because the ellipse's major radius = $\frac{1}{\sqrt{\lambda1}}$, minor radius = $\frac{1}{\sqrt{\lambda2}}$. I have the same question as @ian19981210

elenacliu commented 10 months ago

I found an explanation here

elenacliu commented 10 months ago

Hello, I guess I know why.

In fact, the 2D gaussian distribution should be (I ignore the multiplier):

$$ G(x)=\exp(-\frac{1}{2}(x)^T \Sigma^{-1} (x)) $$

with its covariance $\Sigma$. In paper, $\Sigma=RSS^TR^T$ and the ellipse is represented by $x^T\Sigma^{-1} x=1$.

For example, I draw a picture where $\Sigma=\text{diag}([5,1])$. If the ellipse is represented by $x^T\Sigma x=1$, the direction of the ellipse will be wrong.

image

So the major radius should be $\max(\sqrt{\lambda_1}, \sqrt{\lambda_2})$, minor $\min(\sqrt{\lambda_1}, \sqrt{\lambda_2})$, bacause the ellipse is represented by the inverse of $\Sigma$.