杂记1

import numpy as np

from PIL import Image

image_path="路径"

img_PIL = Image.open(image_path)

#numpy.array()  对PIL图片进行转化

img_array = np.array(img_PIL)

从PIL到numpy,需要在add_image()中指定shape中每个数字/维表示的含义

 

posted @ 2021-11-24 22:02  夏不眠  阅读(19)  评论(0)    收藏  举报