python convert image to array python for CNN code example
Example: transform jpg image into array for conv2d
all_images = []
for image_path in os.listdir(path):
img = io.imread(image_path , as_grey=True)
img = img.reshape([WIDTH, HEIGHT, 1])
all_images.append(img)
x_train = np.array(all_images)