Esempio n. 1
0
    def test_decomposeProjectiveTransformation(self):
        R = pgeometry.pg_rotation2H(pgeometry.pg_rotx(np.pi / 2))
        Ha, Hs, Hp, _ = pgeometry.decomposeProjectiveTransformation(R)
        self.assertIsInstance(Ha, np.ndarray)
        np.testing.assert_array_almost_equal(Hs @ Ha @ Hp, R)

        R = pgeometry.pg_rotation2H(pgeometry.pg_rotx(.012))
        Ha, Hs, Hp, _ = pgeometry.decomposeProjectiveTransformation(R)
        np.testing.assert_array_almost_equal(Hs @ Ha @ Hp, R)
Esempio n. 2
0
 def test_pg_rotation2H(self):
     R = pgeometry.pg_rotx(0.12)
     H = pgeometry.pg_rotation2H(R)
     np.testing.assert_almost_equal(R, H[:3, :3])
     self.assertIsNotNone(H)