コード例 #1
0
ファイル: transform_test.py プロジェクト: lanery/odemis
 def test_rigid_transform_apply_known_values(self):
     """
     RigidTransform should return known result with known input for rigid
     transformations.
     """
     src = RIGID_KNOWN_VALUES[0][-1]
     for rotation, _, _, translation, dst in RIGID_KNOWN_VALUES:
         tform = RigidTransform(rotation=rotation, translation=translation)
         numpy.testing.assert_array_almost_equal(dst, tform.apply(src))
コード例 #2
0
 def test_rigid_transform_from_pointset_known_values(self):
     """
     RigidTransform.from_pointset should return known result with known
     input for rigid transformations.
     """
     src = RIGID_KNOWN_VALUES[0][-1]
     for rotation, _, _, translation, dst in RIGID_KNOWN_VALUES:
         tform = RigidTransform.from_pointset(src, dst)
         self.assertAlmostEqual(0., _angle_diff(rotation, tform.rotation))
         numpy.testing.assert_array_almost_equal(translation, tform.translation)
コード例 #3
0
 def test_rigid_transform_matrix_known_values(self):
     for rotation, _, _, _, _ in RIGID_KNOWN_VALUES:
         tform = RigidTransform(rotation=rotation)
         matrix = _rotation_matrix_from_angle(rotation)
         numpy.testing.assert_array_almost_equal(matrix, tform.transformation_matrix)