AutoRF-pytorch icon indicating copy to clipboard operation
AutoRF-pytorch copied to clipboard

duplicate expression

Open finninmunich opened this issue 1 year ago • 1 comments

Hello, I check your codes and I found that in src/kitti.py, you have:

        self.cam_pos = torch.eye(4)[None, :, :]
        self.cam_pos[:, 2, 2] = -1
        self.cam_pos[:, 1, 1] = -1

Then, inside this function:

      render_rays = kitti_util.gen_rays(
            self.cam_pos, imshape[1], imshape[0], 
            torch.tensor([calib.f_u, calib.f_v]), 0, np.inf, 
            torch.tensor([calib.c_u, calib.c_v])
        )[0].numpy()

the kitti_util.gen_rays has this operation:

 cam_unproj_map = (
        unproj_map(width, height, focal.squeeze(), c=c, device=device)
        .unsqueeze(0)
        .repeat(num_images, 1, 1, 1)

the unprojection map has this line:

unproj = torch.stack((X, -Y, -Z), dim=-1)`

Since at last you will have cam_raydir = torch.matmul( poses[:, None, None, :3, :3], cam_unproj_map.unsqueeze(-1) )[:, :, :, :, 0], I think here we have somethign duplicated.

finninmunich avatar May 16 '23 17:05 finninmunich

it seems that the derection of axis keeps the same as the camera coordinate (X,Y,Z)

xuyanging avatar Aug 23 '23 06:08 xuyanging