def test_SimpleMatch(self):
        m = CoherentPointDriftMatcher2D()

        p2, p1 = Utils.getSimplePatterns()
        Utils.addPointsToDrifter(p1, m, 1)
        Utils.addPointsToDrifter(p2, m, 2)

        scale, rotation, translation = m.match()
        self.assertAlmostEqual(scale, 2.0)
    def test_SameMatch(self):
        m = CoherentPointDriftMatcher2D()

        pattern1, _ = Utils.getSimplePatterns()
        Utils.addPointsToDrifter(pattern1, m, 1)
        Utils.addPointsToDrifter(pattern1, m, 2)

        scale, rotation, translation = m.match()
        self.assertAlmostEqual(scale[0][0], 1.0)
        self.assertMatrixAlmostEquals(rotation, np.eye(2))
        self.assertMatrixAlmostEquals(translation, np.zeros((1, 2)))