def test_ewt2d_curveletWavelet8(self): #Tests curvelet filterbank construction if given scale out of bounds (above) h = 127 w = 127 option = 1 bounds_scales = [.5, .9, 1.3, 3.4] #between 0 and pi bounds_angles = [-2, -.5, .3] #between -3pi/4(-2.356+ and pi/4 (.7854) mfb = ewt2d.ewt2d_curveletFilterbank(bounds_scales, bounds_angles, h, w, option) tmp = np.zeros([h, w]) for i in range(0, len(mfb)): for j in range(0, len(mfb[i])): tmp += mfb[i][j]**2 self.assertAlmostEqual(np.max(tmp), 1.0) self.assertAlmostEqual(np.min(tmp), 1.0)
def test_ewt2d_curveletWavelet3(self): #Tests curvelet filterbank construction if given two scales that are very close h = 127 w = 127 option = 1 epsilon = 0.0000000001 bounds_scales = [.5, .9, 1.3, 1.3 + epsilon, 3] #between 0 and pi bounds_angles = [-2, -.5, .3] #between -3pi/4(-2.356+ and pi/4 (.7854) mfb = ewt2d.ewt2d_curveletFilterbank(bounds_scales, bounds_angles, h, w, option) tmp = np.zeros([h, w]) for i in range(0, len(mfb)): for j in range(0, len(mfb[i])): tmp += mfb[i][j]**2 self.assertAlmostEqual(np.max(tmp), 1.0) self.assertAlmostEqual(np.min(tmp), 1.0)