gsgen3d / gsgen

[CVPR 2024] Text-to-3D using Gaussian Splatting
https://arxiv.org/abs/2309.16585
MIT License
761 stars 42 forks source link

[BUG???] Correct way to calculate distance_to_gaussian_surface #32

Open MrForExample opened 8 months ago

MrForExample commented 8 months ago

In script: utils/ops.py#L153 Inside function distance_to_gaussian_surface(mean, svec, rotmat, query) It calculates squared Mahalanobis distance by : r2 = svec[..., 2] ** 2 * cos_theta**2 + d2**2 * sin_theta**2 But according to Mahalanobis distance formula it should be : r2 = svec[..., 2] ** 2 * cos_theta**2 + d2 * sin_theta**2

Reference: https://en.wikipedia.org/wiki/Mahalanobis_distance https://math.stackexchange.com/questions/18776/mean-distance-between-a-fixed-point-and-a-gaussian-distributed-random-variable http://www.open3d.org/docs/latest/tutorial/geometry/distance_queries.html

I have tested both formula, and both seem to work fine Is this merely a trivial bug or is there any reason that I missed for your specific formula? Please let me know :)