-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question on OPENCV and OPENGL data convention #1286
Comments
I also confused that. |
Here is some info on the coordinate system - https://docs.nerf.studio/en/latest/quickstart/data_conventions.html#camera-view-space |
Thank you! |
I can get the meaning of the line
|
@duonglt19 @tancik I also got confused by these row swapping and z flipping operation, and did a quick investigation. It seems that these two operations have the effect of swapping x and y axes, and flipping z axis in the world space. I'm not sure why this is needed though. (If it's not important, I could submit a PR removing these two lines to avoid future confusions.) Here's the brief proof. (Please feel free to point out any errors) A = np.array([[0, 1, 0, 0],
[1, 0, 0, 0],
[0, 0, -1, 0],
[0, 0, 0, 1])).astype(float)
C2W = A @ C2W The line B = np.diag([1, -1, -1, 1]).astype(float)
C2W = C2W @ B Putting together, we have the following matrix formulation of the function C2W = A @ C2W @ B (Btw, the above Suppose we have a 3d point |
It seems like the code first convert OPENCV camera coordinate (right down forward, RDF) to OPENGL coordinate (right up backward, RUB), and then change the world coordinate from RUB to (down right back, DRB), which can also be seen in the original nerf documentation . But why do we need to convert RUB to DRB exactly? |
It seems this logic origins from instant-ngp (code location). |
Maybe Nerfstuido not only want to use OpenGL camera coordinate, but aslo they want rotate the whole world system. multipling from right changes the camera coordinate, multipling from left changes the whole world system (it just like you want to roate the whole point cloud.) #2793 |
You mentioned you are using OPENGL data convention in this codebase. However I saw the following code in
colmap_to_json()
innerfstudio/process_data/colmap_utils.py
. Assume the output of COLMAP is in OPENCV data convention, can you please explain the following transformation code? Why are you switching the rows and why the third row is multiplied with -1? Thank you!The text was updated successfully, but these errors were encountered: