np.ndarray conversion target with PIL.Image

Image objects have crop function, that is, image cutting function, but using opencv read the image when the image is converted to np.adarray type that can not use the crop function, type conversion, so the conversion method using the following conversion:

numpy.array (img) img object into an array np

Image.fromarray (arr) np array of objects into img

Guess you like

Origin www.cnblogs.com/liuys635/p/11198794.html