def transform(time_poses): pose_table = tables.expand_views( struct(camera=camera_poses, times=time_poses)) return tables.transform_points( tables.expand_dims(pose_table, (2, 3)), tables.expand_dims(world_points, (0, 1)))
def project_points(pose_table, cameras, camera_poses, world_points): pose_estimates = struct(camera=camera_poses, times=pose_table) pose_table = tables.expand_views(pose_estimates) points = tables.transform_points(tables.expand_dims(pose_table, (2, 3)), tables.expand_dims(world_points, (0, 1))) return project_cameras(cameras, points)
def update_calibration(self, calib): self.meshes.update(calib) self.view_poses = tables.inverse( tables.expand_views(calib.pose_estimates)) for camera_set, pose in zip(self.camera_sets, self.view_poses._sequence(1)): camera_set.update_poses(pose) self.board_set.update_poses(calib.pose_estimates.board)
def __init__(self, viewer, calib, board_colors): self.viewer = viewer self.view_poses = tables.inverse( tables.expand_views(calib.pose_estimates)) self.meshes = SceneMeshes(calib) self.board_set = BoardSet(self.viewer, calib.pose_estimates.board, self.meshes.board, board_colors) self.camera_sets = [ CameraSet(self.viewer, poses, self.meshes.camera) for poses in self.view_poses._sequence(1) ] self.axis_set = AxisSet(self.viewer, self.meshes.axis, self.view_poses._index[:, 0]) self.show(False)