Open UestcJay opened 2 years ago
This is changing the pixel values to rays its a camera model concept. basically doing K.inv@pixel_value
+1
Why it has positive x-value and negative y and z-values?
dirs = torch.stack([(i-K[0][2])/K[0][0], -(j-K[1][2])/K[1][1], -torch.ones_like(i)], -1)
If you do K.inv@pixel_value then your result should be:
dirs = torch.stack([(i-K[0][2])/K[0][0], (j-K[1][2])/K[1][1], torch.ones_like(i)], 1)
or at least:
dirs = torch.stack([-(i-K[0][2])/K[0][0], -(j-K[1][2])/K[1][1], -torch.ones_like(i)], -1)
Hi, I found the reason.
dirs = torch.stack([(i-K[0][2])/K[0][0], -(j-K[1][2])/K[1][1], -torch.ones_like(i)], -1)
in fact transforms the resulted 3D coordinates (X, Y, Z) to (X, -Y, -Z).
The reason is that the coordinates system that OpenCV/COLMAP used is different from the NeRF/OpenGL used, thus the transformation is required.
Hi, I found the reason.
dirs = torch.stack([(i-K[0][2])/K[0][0], -(j-K[1][2])/K[1][1], -torch.ones_like(i)], -1)
in fact transforms the resulted 3D coordinates (X, Y, Z) to (X, -Y, -Z). The reason is that the coordinates system that OpenCV/COLMAP used is different from the NeRF/OpenGL used, thus the transformation is required.
I wonder why the coordinate system is important in the NeRF model? If i dont transfrom the coordinate system it will beform worse?
Hi, did u try to train? without orienting to nerf coordinate system?
many thanks for your great work! I read the code ,have some questions, What does this line of code mean?