def test_tform_projective(): paramv = np.arange(8) t = ProjectiveTransform(paramv) assert np.all(paramv == t.paramv) mat = parameters_to_projective_matrix('projective', paramv) assert np.all(mat == t.matrix) assert not np.all(mat == ProjectiveTransform().matrix)
def test_tform_similarity(): paramv = [2, np.pi / 3, 10, 20] t = SimilarityTransform(paramv) assert np.all(paramv == t.paramv) mat = parameters_to_projective_matrix('similarity', paramv) assert np.all(mat == t.matrix) assert not np.all(mat == SimilarityTransform().matrix)
def test_tform_affine(): paramv = np.arange(6) t = AffineTransform(paramv) assert np.all(paramv == t.paramv) mat = parameters_to_projective_matrix('affine', paramv) assert np.all(mat == t.matrix) assert not np.all(mat == AffineTransform().matrix)
def test_tform_euclidean(): paramv = [np.pi / 3, 10, 20] t = EuclideanTransform(paramv) assert np.all(paramv == t.paramv) mat = parameters_to_projective_matrix('euclidean', paramv) assert np.all(mat == t.matrix) assert not np.all(mat == EuclideanTransform().matrix)
def test_projective(): paramv = np.arange(8) mat = parameters_to_projective_matrix('projective', paramv) assert np.all(paramv == projective_matrix_to_parameters('projective', mat))
def test_similarity(): paramv = [2, np.pi / 3, 10, 20] mat = parameters_to_projective_matrix('similarity', paramv) assert np.all(paramv == projective_matrix_to_parameters('similarity', mat))
def test_translation(): paramv = [10, 20] mat = parameters_to_projective_matrix('translate', paramv) assert np.all(paramv == projective_matrix_to_parameters('translate', mat))