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

Mge/zoom #714

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Mge/zoom #714

wants to merge 3 commits into from

Conversation

ookey
Copy link

@ookey ookey commented Mar 18, 2024

Some data have image centers different from (w/2,h/2). This can be after a correction of distortion, or because some images are cropped.
To manage this case, we pass projmatrix to the rendering classes, which include cx,cy information (on top of fx, fy).

Note that this evolution depends on a change the signature of the diff-gaussian-rasterization module: CudaRasterizer::Rasterizer::forward projmatrix parameter is now the plain projection_matrix (whereas it used to be the full_projection_matrix), and tan_fovx and tan_fovy are not needed anymore.

How to test:
0. build the submodule $ pip install diff-gaussian-rasterization

  1. download dataset example with cx,cy != 0.5,0.5 https://drive.google.com/file/d/1Yg-yZy0OiZCd7P1VZrY0WtB6HJrHEIOE/view?usp=sharing
  2. train gaussian splatting on the dataset
  3. check the result with the standard sibr_player

In some cases, calibration gives central point cx,cy != (0.5,0.5), or it
can be decided to crop the input images.
In those cases, it is necessary to split fovx to fovXleft,fovXright and fovy to fovYtop,fovYbottom

Note that the export of cameras to cameras.json merges those values back
to the basic fovx,fovy. This aims at avoiding the modification of
diff_gaussian_rasterization branch used for SIBR_gaussianViewer_app.

Signed-off-by: Matthieu Gendrin <[email protected]>
…nsform to cuda code

full_projection_transform is the multiplication of view_matrix and
projection_matrix. Thus, passing (view_matrix, projection_matrix) is
equivalent to (view_matrix, full_projection_transform).

Passing projection_matrix as arguments to rasterize_gaussians enables
to get intrinsics informations in the rendering code. Since we'll need
central point (cx, cy), this is the aim of this refacto commit.

Signed-off-by: Matthieu Gendrin <[email protected]>
fovx and fovy are not relevant anymore. Intrinsics are read from
projection_matrix. Thus, we don't pass them to the rendering code.

Signed-off-by: Matthieu Gendrin <[email protected]>
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

Successfully merging this pull request may close these issues.

None yet

1 participant