@@ -213,7 +213,7 @@ class pointOpTests(unittest.TestCase):
213
213
def test1 (self ):
214
214
matImg = scipy .io .loadmat (op .join (matfiles_path , 'pointOp1.mat' ))
215
215
img = pt .synthetic_images .ramp ((200 ,200 ))
216
- filt = np .array ([0.2 , 0.5 , 1.0 , 0.4 , 0.1 ]);
216
+ filt = np .asarray ([0.2 , 0.5 , 1.0 , 0.4 , 0.1 ]);
217
217
#foo = pointOp(200, 200, img, 5, filt, 0, 1, 0);
218
218
foo = pt .pointOp (img , filt , 0 , 1 );
219
219
foo = np .reshape (foo ,(200 ,200 ))
@@ -249,15 +249,15 @@ def test13(self):
249
249
250
250
class binomialFilterTests (unittest .TestCase ):
251
251
def test1 (self ):
252
- target = np .array ([[0.5 ],[0.5 ]])
252
+ target = np .asarray ([[0.5 ],[0.5 ]])
253
253
#target = target / np.sqrt(np.sum(target ** 2))
254
254
self .assertTrue ((pt .binomial_filter (2 ) == target ).all () )
255
255
def test2 (self ):
256
- target = np .array ([[0.25 ], [0.5 ], [0.25 ]])
256
+ target = np .asarray ([[0.25 ], [0.5 ], [0.25 ]])
257
257
#target = target / np.sqrt(np.sum(target ** 2))
258
258
self .assertTrue ((pt .binomial_filter (3 ) == target ).all ())
259
259
def test3 (self ):
260
- target = np .array ([[0.0625 ], [0.25 ], [0.3750 ], [0.25 ], [0.0625 ]])
260
+ target = np .asarray ([[0.0625 ], [0.25 ], [0.3750 ], [0.25 ], [0.0625 ]])
261
261
#target = target / np.sqrt(np.sum(target ** 2))
262
262
self .assertTrue ((pt .binomial_filter (5 ) == target ).all ())
263
263
@@ -269,13 +269,13 @@ def test1(self):
269
269
self .assertTrue (pt .comparePyr (matPyr ['pyr' ], pyPyr ))
270
270
def test2 (self ):
271
271
matPyr = scipy .io .loadmat (op .join (matfiles_path , 'buildGpyr2row.mat' ))
272
- img = np .array (list (range (256 ))).astype (float )
272
+ img = np .asarray (list (range (256 ))).astype (float )
273
273
img = img .reshape (1 , 256 )
274
274
pyPyr = pt .pyramids .GaussianPyramid (img )
275
275
self .assertTrue (pt .comparePyr (matPyr ['pyr' ], pyPyr ))
276
276
def test3 (self ):
277
277
matPyr = scipy .io .loadmat (op .join (matfiles_path , 'buildGpyr2col.mat' ))
278
- img = np .array (list (range (256 ))).astype (float )
278
+ img = np .asarray (list (range (256 ))).astype (float )
279
279
img = img .reshape (256 , 1 )
280
280
pyPyr = pt .pyramids .GaussianPyramid (img )
281
281
self .assertTrue (pt .comparePyr (matPyr ['pyr' ], pyPyr ))
@@ -318,17 +318,17 @@ def test4(self):
318
318
self .assertTrue (pt .comparePyr (matPyr ['pyr' ], pyPyr ))
319
319
def test5 (self ):
320
320
matPyr = scipy .io .loadmat (op .join (matfiles_path , 'buildLpyr5.mat' ))
321
- pyRamp = np .array (list (range (200 ))).reshape (1 , 200 )
321
+ pyRamp = np .asarray (list (range (200 ))).reshape (1 , 200 )
322
322
pyPyr = pt .pyramids .LaplacianPyramid (pyRamp )
323
323
self .assertTrue (pt .comparePyr (matPyr ['pyr' ], pyPyr ))
324
324
def test5bis (self ):
325
325
matPyr = scipy .io .loadmat (op .join (matfiles_path , 'buildLpyr5.mat' ))
326
- pyRamp = np .array (list (range (200 )))
326
+ pyRamp = np .asarray (list (range (200 )))
327
327
pyPyr = pt .pyramids .LaplacianPyramid (pyRamp )
328
328
self .assertTrue (pt .comparePyr (matPyr ['pyr' ], pyPyr ))
329
329
def test6 (self ):
330
330
matPyr = scipy .io .loadmat (op .join (matfiles_path , 'buildLpyr6.mat' ))
331
- pyRamp = np .array (list (range (200 )))
331
+ pyRamp = np .asarray (list (range (200 )))
332
332
pyPyr = pt .pyramids .LaplacianPyramid (pyRamp )
333
333
self .assertTrue (pt .comparePyr (matPyr ['pyr' ], pyPyr ))
334
334
def test7 (self ):
@@ -1145,16 +1145,16 @@ def test0(self):
1145
1145
matPyr = scipy .io .loadmat (op .join (matfiles_path , 'imGradient0.mat' ))
1146
1146
ramp = pt .synthetic_images .ramp (10 )
1147
1147
[dx ,dy ] = pt .image_gradient (ramp )
1148
- dx = np .array (dx )
1149
- dy = np .array (dy )
1148
+ dx = np .asarray (dx )
1149
+ dy = np .asarray (dy )
1150
1150
self .assertTrue (pt .compareRecon (matPyr ['res' ][:,:,0 ], dx ))
1151
1151
self .assertTrue (pt .compareRecon (matPyr ['res' ][:,:,1 ], dy ))
1152
1152
def test1 (self ):
1153
1153
matPyr = scipy .io .loadmat (op .join (matfiles_path , 'imGradient1.mat' ))
1154
1154
ramp = pt .synthetic_images .ramp (10 )
1155
1155
[dx ,dy ] = pt .image_gradient (ramp , 'reflect1' )
1156
- dx = np .array (dx )
1157
- dy = np .array (dy )
1156
+ dx = np .asarray (dx )
1157
+ dy = np .asarray (dy )
1158
1158
self .assertTrue (pt .compareRecon (matPyr ['res' ][:,:,0 ], dx ))
1159
1159
self .assertTrue (pt .compareRecon (matPyr ['res' ][:,:,1 ], dy ))
1160
1160
0 commit comments