szymanowiczs / splatter-image

Official implementation of `Splatter Image: Ultra-Fast Single-View 3D Reconstruction' CVPR 2024
https://szymanowiczs.github.io/splatter-image
BSD 3-Clause "New" or "Revised" License
795 stars 54 forks source link

Confused about this piece of code,can anyone answer this? #53

Closed yizhangdanikor closed 2 months ago

yizhangdanikor commented 2 months ago

gaussian_predictor.py line520
def init_sh_transform_matrices(self): v_to_sh_transform = torch.tensor([[ 0, 0,-1], [-1, 0, 0], [ 0, 1, 0]], dtype=torch.float32) sh_to_v_transform = v_to_sh_transform.transpose(0, 1) self.register_buffer('sh_to_v_transform', sh_to_v_transform.unsqueeze(0)) self.register_buffer('v_to_sh_transform', v_to_sh_transform.unsqueeze(0))

Why is the v_to_sh_transform matrix like this?What is it based on?The matrix provided in the paper is [[0,1,0],[0,0,1],[1,0,0]]

Also, in line 638 of this file,in the function transfororm_SHs, I don't know if I understand correctly. Is this converting shs to the world coordinate system? Is it okay: sh_to_v_transform source_cameras_to_world v_to_sh_transform shs ? According to the formula for rotational conversion of spherical harmonic coefficients in the paper: inverse(Π)RΠα. In the code, it looks like this: shs sh_to_v_transform source_cameras_to_world * v_to_sh_transform.I feel confused here.