Skip to content

Commit

Permalink
fix homogeneous part of transform_scene_to_imu based on results of my…
Browse files Browse the repository at this point in the history
… test code
  • Loading branch information
rennis250 committed Aug 22, 2024
1 parent eb76bb4 commit 9834242
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions alpha-lab/imu-transformations/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ def transform_scene_to_imu(coords_in_scene, translation = None):
scene_to_imu_homogeneous[:3, :3] = scene_to_imu
scene_to_imu_homogeneous[:3, 3] = translation

coords_in_scene_homogeneous = cv2.convertPointsToHomogeneous(coords_in_scene)
return cv2.convertPointsFromHomogeneous(
scene_to_imu_homogeneous @ coords_in_scene_homogeneous
)
coords_in_scene_homogeneous = cv2.convertPointsToHomogeneous(coords_in_scene.T)
coords_in_imu_homogeneous = scene_to_imu_homogeneous @ coords_in_scene_homogeneous.reshape(-1, 4).T
coords_in_imu = cv2.convertPointsFromHomogeneous(coords_in_imu_homogeneous.T)
return coords_in_imu.reshape(-1, 3).T
else:
return scene_to_imu @ coords_in_scene

Expand Down Expand Up @@ -193,7 +193,7 @@ eyeball_centers_in_world = transform_imu_to_world(
)

optical_axes_in_imu = transform_scene_to_imu(
optical_axes.T, translation=scene_camera_position_in_imu,
optical_axes.T,
)
optical_axes_in_world = transform_imu_to_world(
optical_axes_in_imu.T, imu_quaternions,
Expand Down

0 comments on commit 9834242

Please sign in to comment.