nerfstudio
nerfstudio copied to clipboard
conversion between the colmap qvec, tvec and NeRF render json
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
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?
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.
facing similar problem
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?