@@ -990,10 +990,10 @@ def test_rotate(self):
990
990
assert np .all (np .array (result_a ) == np .array (result_b ))
991
991
992
992
def test_affine (self ):
993
- input_img = np .zeros ((200 , 200 , 3 ), dtype = np .uint8 )
993
+ input_img = np .zeros ((40 , 40 , 3 ), dtype = np .uint8 )
994
994
pts = []
995
- cnt = [100 , 100 ]
996
- for pt in [(80 , 80 ), (100 , 80 ), (100 , 100 )]:
995
+ cnt = [20 , 20 ]
996
+ for pt in [(16 , 16 ), (20 , 16 ), (20 , 20 )]:
997
997
for i in range (- 5 , 5 ):
998
998
for j in range (- 5 , 5 ):
999
999
input_img [pt [0 ] + i , pt [1 ] + j , :] = [255 , 155 , 55 ]
@@ -1028,7 +1028,7 @@ def _test_transformation(a, t, s, sh):
1028
1028
translate = t , scale = s , shear = sh ))
1029
1029
assert np .sum (np .abs (true_matrix - result_matrix )) < 1e-10
1030
1030
# 2) Perform inverse mapping:
1031
- true_result = np .zeros ((200 , 200 , 3 ), dtype = np .uint8 )
1031
+ true_result = np .zeros ((40 , 40 , 3 ), dtype = np .uint8 )
1032
1032
inv_true_matrix = np .linalg .inv (true_matrix )
1033
1033
for y in range (true_result .shape [0 ]):
1034
1034
for x in range (true_result .shape [1 ]):
0 commit comments