Letian Huang
Jiayang Bai
Jie Guo*
Yuanqi Li
Yanwen Guo
Nanjing University
[2024.11.14] 🖊️ Add derivation of the backward passes.
[2024.07.16] 🎈 We release the code.
[2024.07.05] Birthday of the repository.
- Release the code (submodule for the pinhole camera's rasterization).
- Release the submodule for the panorama's rasterization.
- Release the submodule for the fisheye camera's rasterization.
- Code optimization (as mentioned in the limitation of the paper, the current CUDA implementation is slow and needs optimization).
We derive the mathematical expectation of the projection error (Top left), visualize the graph of the error function under two distinct domains and analyze when this function takes extrema through methods of function optimization (Top right). We further derive the projection error function with respect to image coordinates and focal length through the coordinate transformation between image coordinates and polar coordinates and visualize this function, with the left-to-right sequence corresponding to the 3D-GS rendered images under long focal length, 3D-GS rendered images under short focal length, the error function under long focal length, and the error function under short focal length (Below).
Illustration of the rendering pipeline for our Optimal Gaussian Splatting and the projection of 3D Gaussian Splatting. The blue box depicts the projection process of the original 3D-GS, which straightforwardly projects all Gaussians onto the same projection plane. In contrast, the red box illustrates our approach, where we project individual Gaussians onto corresponding tangent planes.
Clone the repository and create an anaconda environment using
git clone git@github.com:LetianHuang/op43dgs.git
cd op43dgs
SET DISTUTILS_USE_SDK=1 # Windows only
conda env create --file environment.yml
conda activate op43dgs
The repository contains several submodules, thus please check it out with
# Pinhole
pip install submodules/diff-gaussian-rasterization-pinhole
or
# Panorama
pip install submodules/diff-gaussian-rasterization-panorama
or
# Fisheye
pip install submodules/diff-gaussian-rasterization-fisheye
Please download the data from the Mip-NeRF 360.
Please download the data from the 3D Gaussian Splatting.
Please download the data from the 3D Gaussian Splatting.
By default, the trained models use all available images in the dataset. To train them while withholding a test set for evaluation, use the --eval
flag. This way, you can render training/test sets and produce error metrics as follows:
python train.py -s <path to COLMAP or NeRF Synthetic dataset> --eval # Train with train/test split
python render.py -m <path to trained model> --fov_ratio 1 # Generate renderings
Command Line Arguments for render.py
Path to the trained model directory you want to create renderings for.
Flag to skip rendering the training set.
Flag to skip rendering the test set.
Flag to omit any text written to standard out pipe.
Focal length reduction ratios.
This project is built upon 3DGS. Please follow the license of 3DGS. We thank all the authors for their great work and repos.
If you find this work useful in your research, please cite:
@inproceedings{10.1007/978-3-031-72643-9_15,
author="Huang, Letian and Bai, Jiayang and Guo, Jie and Li, Yuanqi and Guo, Yanwen",
title="On the Error Analysis of 3D Gaussian Splatting and an Optimal Projection Strategy",
booktitle="Computer Vision -- ECCV 2024",
year="2025",
publisher="Springer Nature Switzerland",
address="Cham",
pages="247--263",
isbn="978-3-031-72643-9"
}
Derivation in diff-gaussian-rasterization
Gaussian's position in image space:
Projection coordinates of the pixel on the unit sphere (in renderCUDA
):
Camera intrinsic parameters for pinhole:
For the pinhole camera model, we can compute the corresponding camera coordinate based on the Gaussian position
Then calculate the projection of
Subsequently, calculate the projection of
Then, calculate the matrix
Subsequently, the projection of the pixel onto the tangent plane after transformerd into the local coordinate system can be obtained through the
Finally, the difference between the projection of the Gaussian mean and the pixel projection onto the tangent plane can be calculated:
It is recommended to use scientific computing tools to compute the gradient!
First, calculate the partial derivatives of
Then, calculate the gradient of
Using the chain rule, we can obtain: