Exemple #1
0
def test_homog_compose_after_uniformscale():
    homog = Homogeneous(np.array([[0, 1, 0],
                                  [1, 0, 0],
                                  [0, 0, 1]]))
    s = UniformScale(3, 2)
    res = homog.compose_after(s)
    assert(type(res) == Homogeneous)
    assert_allclose(res.h_matrix, np.array([[0, 3, 0],
                                            [3, 0, 0],
                                            [0, 0, 1]]))
Exemple #2
0
def test_homog_compose_after_alignment_rotation():
    homog = Homogeneous(np.array([[0, 1, 0],
                                  [1, 0, 0],
                                  [0, 0, 1]]))
    source = PointCloud(np.array([[0, 1],
                                  [1, 1],
                                  [-1, -5],
                                  [3, -5]]))
    r = AlignmentRotation(source, source)
    res = homog.compose_after(r)
    assert(type(res) == Homogeneous)