def crop_resize(img, meta, img_shape=(64, 64)): """ Crop center and resize. :param img: image to be cropped and resized. """ if img.shape[0] < img.shape[1]: img = img.T # we crop image from center short_edge = min(img.shape[:2]) yy = int((img.shape[0] - short_edge) / 2) xx = int((img.shape[1] - short_edge) / 2) crop_img = img[yy:yy + short_edge, xx:xx + short_edge] img = crop_img img = sk_imresize(img, img_shape) return img
def crop_resize(img,meta,img_shape=(64,64)): """ Crop center and resize. :param img: image to be cropped and resized. """ if img.shape[0] < img.shape[1]: img = img.T # we crop image from center short_edge = min(img.shape[:2]) yy = int((img.shape[0] - short_edge) / 2) xx = int((img.shape[1] - short_edge) / 2) crop_img = img[yy: yy + short_edge, xx: xx + short_edge] img = crop_img img = sk_imresize(img, img_shape) return img
def imresize(img, meta, img_shape=(64, 64)): return sk_imresize(img, img_shape)
def imresize(img,meta,img_shape=(64,64)): return sk_imresize(img,img_shape)