We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi.
I'd like to render an image with exact same pose from transforms.json file using render.py.
For example, datan/nerf/fox/, first image images/0001.jpg has transform matrix as below.
"transform_matrix": [ [ 0.8926439112348871, 0.08799600283226543, 0.4420900262071262, 3.168359405609479 ], [ 0.4464189982715247, -0.03675452191179031, -0.8940689141475064, -5.4794898611466945 ], [ -0.062425682580756266, 0.995442519072023, -0.07209178487538156, -0.9791660699008925 ], [ 0.0, 0.0, 0.0, 1.0 ]
Here, I have to convert it to quaternion & translation to use it as base_cam.json format
for example, ...
"R":[0.8109075427055359,0.03559545800089836,0.5819807648658752,-0.04959719628095627], "T": -2.2435450553894043,0.11715501546859741,1.4327683448791504],"dof":0.0,"fov":50.625,"scale":2.9230759143829346,"slice":0.03611110895872116
I tried to convert it using code below, the result does not match to what I want. Am I missing something?
import numpy as np from scipy.spatial.transform import Rotation as R T = np.array( [[ 0.8926439112348871, 0.08799600283226543, 0.4420900262071262, 3.168359405609479 ], [ 0.4464189982715247, -0.03675452191179031, -0.8940689141475064, -5.4794898611466945 ], [ -0.062425682580756266, 0.995442519072023, -0.07209178487538156, -0.9791660699008925 ]] ) # Extract rotation matrix (R) and translation vector (t) R_mat = T[:3, :3] t = T[:3, 3] # Convert the rotation matrix to a quaternion rot = R.from_matrix(R_mat) q = rot.as_quat()
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi.
I'd like to render an image with exact same pose from transforms.json file using render.py.
For example, datan/nerf/fox/, first image images/0001.jpg has transform matrix as below.
Here, I have to convert it to quaternion & translation to use it as base_cam.json format
for example, ...
I tried to convert it using code below, the result does not match to what I want. Am I missing something?
The text was updated successfully, but these errors were encountered: