Open Incenter2016 opened 6 years ago
def resize_image(image, input_width): im_arr = imread(image, mode='L') r, c = np.shape(im_arr)
if c > input_width: c = input_width ratio = float(input_width) / c final_arr = imresize(im_arr, (int(32 * ratio), input_width)) else: final_arr = np.zeros((32, input_width))
final_arr = np.zeros((32, input_width), dtype=np.uint8)
def resize_image(image, input_width): im_arr = imread(image, mode='L') r, c = np.shape(im_arr)