def test_affine(): X = loadPoints(Path("tests/fixtures/ref.txt")) Y = loadPoints(Path("tests/fixtures/deg.txt")) expected = loadXform(Path("tests/fixtures/affine.pickle")) P, xform = last(islice(driftAffine(X, Y, w=0.5), 100)) np.testing.assert_almost_equal(xform.B, expected.B) np.testing.assert_almost_equal(xform.t, expected.t)
def test_affine(): X = loadPoints(Path("tests/fixtures/ref.txt")) Y = loadPoints(Path("tests/fixtures/deg.txt")) expected = loadXform(Path("tests/fixtures/affine.pickle")) P, xform = last(islice(driftAffine(X, Y, w=0.5), 100)) np.testing.assert_almost_equal(xform.B, expected.B) np.testing.assert_almost_equal(xform.t, expected.t)
def test_global(): X = loadPoints(Path("tests/fixtures/ref.txt")) Y = loadPoints(Path("tests/fixtures/deg.txt")) expected = loadXform(Path("tests/fixtures/xform.pickle")) P, xform = globalAlignment(X, Y, w=0.5, mirror=True) np.testing.assert_almost_equal(xform.R, expected.R) np.testing.assert_almost_equal(xform.t, expected.t) np.testing.assert_almost_equal(xform.s, expected.s)
def test_global(): X = loadPoints(Path("tests/fixtures/ref.txt")) Y = loadPoints(Path("tests/fixtures/deg.txt")) expected = loadXform(Path("tests/fixtures/xform.pickle")) P, xform = globalAlignment(X, Y, w=0.5, mirror=True) np.testing.assert_almost_equal(xform.R, expected.R) np.testing.assert_almost_equal(xform.t, expected.t) np.testing.assert_almost_equal(xform.s, expected.s)
def test_align(): args = split("align tests/fixtures/ref.txt tests/fixtures/deg.txt " "--format pickle --scope global") expected = loadXform(Path("tests/fixtures/xform.pickle")) r = run(cmd + args, stdout=PIPE, universal_newlines=False) assert not r.returncode result = loads(r.stdout) np.testing.assert_almost_equal(result.R, expected.R) np.testing.assert_almost_equal(result.t, expected.t) np.testing.assert_almost_equal(result.s, expected.s)
def test_align(): args = split("align tests/fixtures/ref.txt tests/fixtures/deg.txt " "--format pickle --scope global") expected = loadXform(Path("tests/fixtures/xform.pickle")) r = run(cmd + args, stdout=PIPE, universal_newlines=False) assert not r.returncode result = loads(r.stdout) np.testing.assert_almost_equal(result.R, expected.R) np.testing.assert_almost_equal(result.t, expected.t) np.testing.assert_almost_equal(result.s, expected.s)