def test_align_2d_similarity_set_target(): linear_component = np.array([[2, -6], [6, 2]]) translation_component = np.array([7, -8]) h_matrix = np.eye(3, 3) h_matrix[:-1, :-1] = linear_component h_matrix[:-1, -1] = translation_component similarity = Similarity(h_matrix) source = PointCloud(np.array([[0, 1], [1, 1], [-1, -5], [3, -5]])) target = similarity.apply(source) # estimate the transform from source to source estimate = AlignmentSimilarity(source, source, allow_mirror=True) # and set the target estimate.set_target(target) # check the estimates is correct assert_allclose(similarity.h_matrix, estimate.h_matrix)