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

ScanCapture pose format #26

Open
Yzhbuaa opened this issue Mar 22, 2023 · 1 comment
Open

ScanCapture pose format #26

Yzhbuaa opened this issue Mar 22, 2023 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@Yzhbuaa
Copy link

Yzhbuaa commented Mar 22, 2023

Hello, I captured several datasets using the ScanCapture App. But I don't know the definition of the image pose in poses.txt file. Could you explain it in detail? Thank you!

@sarlinpe
Copy link
Collaborator

The pose is the transformation from camera frame to world frame but follows the computer graphics conventions: https://developer.apple.com/documentation/arkit/arcamera/2866108-transform
https://developer.apple.com/documentation/arkit/configuration_objects/understanding_world_tracking

the y-axis points upward, and (when relevant) the z-axis points toward the viewer and the x-axis points toward the viewer's right.

Here is how to parse it:

# Poses from ARKit & ARCore use the computer graphics conventions (inverted y and z)
rot_cg_to_cv = Rotation.from_matrix(np.diag([1, -1, -1]))
rows = read_csv(path)
for ts, status, tx, ty, tz, qx, qy, qz, qw, w, h, fx, fy, cx, cy, *_ in tqdm(rows):
ts = int(ts)
if status != 'normal':
logger.warning('Tracking of %d with abnormal status: %s.', ts, status)
tvec = np.array([tx, ty, tz], float)
qvec = np.array([qw, qx, qy, qz], float)
rot = Pose(qvec).r * rot_cg_to_cv
pose = Pose(rot, tvec)

@sarlinpe sarlinpe added the documentation Improvements or additions to documentation label Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants