Skip to content
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

World coordinate system #60

Open
chenguolin opened this issue Jan 23, 2025 · 1 comment
Open

World coordinate system #60

chenguolin opened this issue Jan 23, 2025 · 1 comment

Comments

@chenguolin
Copy link

It seems that the preprocessing of the DL3DV world coordinate system is incorrect.

In the latest NerfStudio:
https://github.com/nerfstudio-project/nerfstudio/blob/main/nerfstudio/process_data/colmap_utils.py#L445-L449

# Convert from COLMAP's camera coordinate system (OpenCV) to ours (OpenGL)
c2w[0:3, 1:3] *= -1
if not keep_original_world_coordinate:
    c2w = c2w[np.array([0, 2, 1, 3]), :]
    c2w[2, :] *= -1

However, in

def opengl_c2w_to_opencv_w2c(c2w: np.ndarray) -> np.ndarray:
c2w = c2w.copy()
c2w[2, :] *= -1
c2w = c2w[np.array([1, 0, 2, 3]), :]
c2w[0:3, 1:3] *= -1
w2c_opencv = np.linalg.inv(c2w)
return w2c_opencv

Should c2w = c2w[np.array([1, 0, 2, 3]), :] be c2w = c2w[np.array([0, 2, 1, 3]), :]?

Or is this a problem of NerfStudio version, as I found the same code as this repo in a NerfStudio issue (May 19, 2023)
nerfstudio-project/nerfstudio#1708 (comment)

c2w = np.linalg.inv(w2c)
# Convert from COLMAP's camera coordinate system (OpenCV) to ours (OpenGL)
c2w[0:3, 1:3] *= -1
c2w = c2w[np.array([1, 0, 2, 3]), :]
c2w[2, :] *= -1
@chenguolin
Copy link
Author

It seems like indeed a bug fixed recently by NerfStudio (2024.Jan.19): nerfstudio-project/nerfstudio#2793

So c2w = c2w[np.array([0, 2, 1, 3]), :] should be correct and reasonable for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant