def test_denormlize_poses(self): pose_seq_0 = pose.PoseSequence( self.joint_names, self.joint_tree, self.point0_screen, self.frame_indices, 'screen', camera=self.camera0, screen_size=(2048, 2048, 2048), z_joint_reference_name='head', z_joint_reference_coordinates=self.z_ref0) pose_seq_1 = pose.PoseSequence( self.joint_names, self.joint_tree, self.point1_screen, self.frame_indices, 'screen', camera=self.camera1, screen_size=(2048, 2048, 2048), z_joint_reference_name='head', z_joint_reference_coordinates=self.z_ref1) pose_seq_0.denormlize_poses() pose_seq_1.denormlize_poses() point0_3d_world = pose_seq_0.poses point1_3d_world = pose_seq_1.poses self.assertIsClose(self.point_3d_world, point0_3d_world, atol=1e-2, rtol=0) self.assertIsClose(self.point_3d_world, point1_3d_world, atol=1e-2, rtol=0)
def test_normlize_poses(self): pose_seq_0 = pose.PoseSequence(self.joint_names, self.joint_tree, self.point_3d_world, self.frame_indices, 'world', camera=self.camera0, screen_size=(2048, 2048, 2048), z_joint_reference_name='head') pose_seq_1 = pose.PoseSequence(self.joint_names, self.joint_tree, self.point_3d_world, self.frame_indices, 'world', camera=self.camera1, screen_size=(2048, 2048, 2048), z_joint_reference_name='head') pose_seq_0.normlize_poses() pose_seq_1.normlize_poses() point0_screen = pose_seq_0.poses point1_screen = pose_seq_1.poses self.assertIsClose(self.point0_screen, point0_screen, atol=1e-2, rtol=0) self.assertIsClose(self.point1_screen, point1_screen, atol=1e-2, rtol=0)
def test_poses_from_camera_to_world(self): pose_seq_0 = pose.PoseSequence(self.joint_names, self.joint_tree, self.point0_3d_camera, self.frame_indices, 'camera', camera=self.camera0) pose_seq_1 = pose.PoseSequence(self.joint_names, self.joint_tree, self.point1_3d_camera, self.frame_indices, 'camera', camera=self.camera1) pose_seq_0.poses_from_camera_to_world() pose_seq_1.poses_from_camera_to_world() point0_3d_world = pose_seq_0.poses point1_3d_world = pose_seq_1.poses self.assertIsClose(self.point_3d_world, point0_3d_world, atol=1e-2, rtol=0) self.assertIsClose(self.point_3d_world, point1_3d_world, atol=1e-2, rtol=0)
def test_poses_from_normlized_device_to_camera(self): pose_seq_0 = pose.PoseSequence( self.joint_names, self.joint_tree, self.point0_normlized_device, self.frame_indices, 'normlized_device', camera=self.camera0, z_joint_reference_name='head', z_joint_reference_coordinates=self.z_ref0) pose_seq_1 = pose.PoseSequence( self.joint_names, self.joint_tree, self.point1_normlized_device, self.frame_indices, 'normlized_device', camera=self.camera1, z_joint_reference_name='head', z_joint_reference_coordinates=self.z_ref1) pose_seq_0.poses_from_normlized_device_to_camera() pose_seq_1.poses_from_normlized_device_to_camera() point0_3d_camera = pose_seq_0.poses point1_3d_camera = pose_seq_1.poses self.assertIsClose(self.point0_3d_camera, point0_3d_camera, atol=1e-2, rtol=0) self.assertIsClose(self.point1_3d_camera, point1_3d_camera, atol=1e-2, rtol=0)
def test_poses_from_screen_to_normlized_device(self): pose_seq_0 = pose.PoseSequence(self.joint_names, self.joint_tree, self.point0_screen, self.frame_indices, 'screen', camera=self.camera0, screen_size=(2048, 2048, 2048), z_joint_reference_name='head') pose_seq_1 = pose.PoseSequence(self.joint_names, self.joint_tree, self.point1_screen, self.frame_indices, 'screen', camera=self.camera1, screen_size=(2048, 2048, 2048), z_joint_reference_name='head') pose_seq_0.poses_from_screen_to_normlized_device() pose_seq_1.poses_from_screen_to_normlized_device() point0_normlized_device = pose_seq_0.poses point1_normlized_device = pose_seq_1.poses self.assertIsClose(self.point0_normlized_device, point0_normlized_device, atol=1e-6, rtol=0) self.assertIsClose(self.point1_normlized_device, point1_normlized_device, atol=1e-6, rtol=0)
def test_poses_from_camera_to_normlized_device(self): pose_seq_0 = pose.PoseSequence(self.joint_names, self.joint_tree, self.point0_3d_camera, self.frame_indices, 'camera', camera=self.camera0, z_joint_reference_name='head') pose_seq_1 = pose.PoseSequence(self.joint_names, self.joint_tree, self.point1_3d_camera, self.frame_indices, 'camera', camera=self.camera1, z_joint_reference_name='head') pose_seq_0.poses_from_camera_to_normlized_device() pose_seq_1.poses_from_camera_to_normlized_device() point0_normlized_device = pose_seq_0.poses point1_normlized_device = pose_seq_1.poses self.assertIsClose(self.point0_normlized_device, point0_normlized_device, atol=1e-6, rtol=0) self.assertIsClose(self.point1_normlized_device, point1_normlized_device, atol=1e-6, rtol=0)