facebookresearch / mvp

Training and Evaluation Code for "Mixture of Volumetric Primitives for Efficient Neural Rendering"
Other
191 stars 16 forks source link

The meaning of transform in multiviewvideo.py and volumetric.py #19

Open auroraxs opened 1 year ago

auroraxs commented 1 year ago

Hi, I am confused about the transform in multiviewvideo.py and volumetric.py Specifically,

  1. self.campos[cam] = (-np.dot(krt[cam]['extrin'][:3, :3].T, krt[cam]['extrin'][:3, 3])).astype(np.float32) the line calculate the camera position in world space ?
  2. self.camrot[cam] = (krt[cam]['extrin'][:3, :3]).astype(np.float32), this matrix is the camera rot in world space ?
  3. result[k] = to4x4(np.dot( np.linalg.inv(to4x4(frametransf)), to4x4(self.basetransf))[:3, :4]) what is the meaning of this transform?
  4. result[k] = to4x4(np.dot( np.linalg.inv(to4x4(self.basetransf)), to4x4(frametransf))[:3, :4]) what is the meaning of this transform?
  5. result["campos"] = np.dot(self.basetransf[:3, :3].T, self.campos[cam] - self.basetransf[:3, 3]) meaning of this ?
  6. result["camrot"] = np.dot(self.basetransf[:3, :3].T, self.camrot[cam].T).T meaning of this?
  7. viewrot = torch.bmm(camrot, modelmatrixinv[:, :3, :3]) meaning of this?
  8. viewpos = torch.bmm((campos[:, :] - modelmatrixinv[:, :3, 3])[:, None, :], modelmatrixinv[:, :3, :3])[:, 0, :] and meaning of this ?

I want to use the multiface dataset to train a NeRF, which need multi-view and correspondence camera parameters. To get these data, i think it's a good way to understand the coordinates transform of mvp. So i am pleased if you can answer above questions ?