Skip to content

Commit

Permalink
Applied @papr 's suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
N-M-T committed Aug 19, 2021
1 parent c22df91 commit c9372ea
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pupil_src/shared_modules/head_pose_tracker/function/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ def get_camera_pose(camera_extrinsics):
rotation_pose = -rotation_ext
translation_pose = np.matmul(-cv2.Rodrigues(rotation_ext)[0].T, translation_ext)
camera_pose = merge_extrinsics(rotation_pose, translation_pose)
camera_orientation = rod_to_euler(rotation_pose)
return camera_pose, camera_orientation
euler_orientation = rod_to_euler(rotation_pose)
return camera_pose, euler_orientation


def convert_marker_extrinsics_to_points_3d(marker_extrinsics):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def _export_poses(rec_dir, poses):
logger.info("Exporting {} head poses to {}".format(len(poses), rec_dir))
poses_path = os.path.join(rec_dir, "head_pose_tracker_poses.csv")
poses_flat = [
(p["timestamp"], *p["camera_poses"], *p["camera_orientation"]) for p in poses
(p["timestamp"], *p["camera_poses"], *p["euler_orientation"]) for p in poses
]
_write_csv(poses_path, POSES_HEADER, poses_flat)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@

def get_pose_data(extrinsics, timestamp):
if extrinsics is not None:
camera_poses, camera_orientation = utils.get_camera_pose(extrinsics)
camera_poses, euler_orientation = utils.get_camera_pose(extrinsics)
camera_pose_matrix = utils.convert_extrinsic_to_matrix(camera_poses)
return {
"camera_extrinsics": extrinsics.tolist(),
"camera_poses": camera_poses.tolist(),
"camera_trace": camera_poses[3:6].tolist(),
"camera_pose_matrix": camera_pose_matrix.tolist(),
"camera_orientation": camera_orientation.tolist(),
"euler_orientation": euler_orientation.tolist(),
"timestamp": timestamp,
}
else:
Expand All @@ -34,7 +34,7 @@ def get_pose_data(extrinsics, timestamp):
"camera_poses": [np.nan, np.nan, np.nan, np.nan, np.nan, np.nan],
"camera_trace": [np.nan, np.nan, np.nan],
"camera_pose_matrix": None,
"camera_orientation": [np.nan, np.nan, np.nan],
"euler_orientation": [np.nan, np.nan, np.nan],
"timestamp": timestamp,
}

Expand Down

0 comments on commit c9372ea

Please sign in to comment.