def test_adm_dwt2_idwt2_py(self): np.random.seed(0) x = np.random.uniform(low=-128, high=127, size=[324, 576]).astype(np.float64) a, ds = adm_dwt2_py(x) x2 = adm_idwt2_py((a, ds)) self.assertAlmostEqual(np.abs(np.max(x - x2)), 0.0, places=10)
def test_adm_dwt2_py(self): np.random.seed(0) x = np.random.uniform(low=-128, high=127, size=[324, 576]).astype(np.float64) a, v, h, d = adm_dwt2_py(x) self.assertEqual(a.shape, (162, 288)) self.assertEqual(v.shape, (162, 288)) self.assertEqual(h.shape, (162, 288)) self.assertEqual(d.shape, (162, 288)) self.assertAlmostEqual(float(np.std(a)), 73.8959273922819, places=5) self.assertAlmostEqual(float(np.std(v)), 73.69196319580078, places=5) self.assertAlmostEqual(float(np.std(h)), 73.53559112548828, places=5) self.assertAlmostEqual(float(np.std(d)), 73.52173614501953, places=5)