def center_crop(image, pre_height, pre_width, height, width):
h, w = image.shape[:2]
j, i = int((h - pre_height)/2.), int((w - pre_width)/2.)
return scipy.misc.imresize(
image[j:j+pre_height, i:i+pre_width], [height, width])
评论列表
文章目录