Exemplo n.º 1
0
def test_transform_array():
    trans = BboxTransform(SMALL, LARGE)
    result = trans.transform(np.array([(SMALL.x0, SMALL.y0),
                                       (SMALL.x1, SMALL.y1)]))
    expected = [(LARGE.x0, LARGE.y0),
                (LARGE.x1, LARGE.y1)]
    assert_allclose(result, expected)
Exemplo n.º 2
0
def test_transform_list_of_points():
    trans = BboxTransform(SMALL, LARGE)
    result = trans.transform([(SMALL.x0, SMALL.y0),
                              (SMALL.x1, SMALL.y1)])
    expected = [(LARGE.x0, LARGE.y0),
                (LARGE.x1, LARGE.y1)]
    assert_allclose(result, expected)