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

conversion between the colmap qvec, tvec and NeRF render json #2853

Open
Ting-Wei-Chang626 opened this issue Jan 31, 2024 · 3 comments
Open

Comments

@Ting-Wei-Chang626
Copy link

I'm wondering how to transfer the colmap result into camera_path to render.

I have tried the script in colmap_to_json.py to transform the qvec and tvec into c2w matrix.
R = qvec2rotmat(qvec)
t = tvec.reshape([3,1])
w2c = np.concatenate([R, t], 1)
w2c = np.concatenate([w2c, np.array([[0, 0, 0, 1]])], 0)
c2w = np.linalg.inv(w2c)
c2w[0:3, 1:3] *= -1
c2w = c2w[np.array([1, 0, 2, 3]), :]
c2w[2, :] *= -1

And then write it into the camera_path.json.
just like
螢幕快照 2024-01-31 132425

It seems the render result is different from expectation. And, the camera is in the wrong position.
Do anyone know that the correct conversion between colmap trajectory and NeRF render path?

@Ting-Wei-Chang626 Ting-Wei-Chang626 changed the title conversion between the colmap qvec and tvec and NeRF render json conversion between the colmap qvec, tvec and NeRF render json Jan 31, 2024
@kerrj
Copy link
Collaborator

kerrj commented Jan 31, 2024

It's possible you need to consider the dataparser transform too, which scales and shifts the poses to be centered at the origin with a scale of 1.

@sean880304
Copy link

facing similar problem

@Ting-Wei-Chang626
Copy link
Author

In my case, I use nerfstudio to visualize the result from Gaussian Splatting. The scale and origin of imported point cloud is same with the original colmap one.

Does nerfstudio change the original and scale while rendering the trained result?

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

3 participants