def preprocessImage(self, img):
'''Compute luminance (grayscale in range [0, 1]) and resize to (D, D).'''
img = rgb2gray(img) # compute luminance 210x160
img = resize(img, (self.D, self.D), mode='constant') # resize image
return img
评论列表
文章目录