yenchenlin / nerf-pytorch

A PyTorch implementation of NeRF (Neural Radiance Fields) that reproduces the results.
MIT License
5.33k stars 1.04k forks source link

Regarding to c2w parameter of get_rays function #110

Closed cmh1027 closed 1 year ago

cmh1027 commented 1 year ago

def get_rays_np(H, W, K, c2w): The fourth parameter is c2w matrix, which seems obviously transformation matrix of camera to world coordinates. However, according to the code below, rays = np.stack([get_rays_np(H, W, K, p) for p in poses[:,:3,:4]], 0) it seems not c2w matrix, but w2c matrix is passed to the function because 'poses' variable has extrinsic parameter, which is 'world to camera' matrix. Do I misunderstand something? Or does 'poses' variable have originally c2w matrix?