Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1"""
2Loads grid images.
3"""
4import numpy
5from skimage.transform import resize
8def reduce_image(img, new_size):
9 """
10 Reduces an image.
11 :param name: numpy array
12 :param new_size: new_size
13 :return: new image
14 """
15 img = resize(img.astype(numpy.float64), new_size,
16 mode='constant', anti_aliasing=True)
17 img = img >= 0.5
18 return img.astype(numpy.int32)