赞
踩
pillow就是PIL模块,安装方法pip install pillow,可以加入镜像源,比如:-i https://pypi.tuna.tsinghua.edu.cn/simple
from PIL import Image
import matplotlib.pyplot as plt
pillow不区分中英文路径,都可以正确读入,功能强大,这一点比opencv更出色
PIL_in_path = "fruit1/脆桃/脆桃-19453282-321255571.png"
PIL_out_path = "fruit3/脆桃/脆桃-19453282-321255571.png"
img = Image.open(PIL_in_path)
print(img) # <PIL.PngImagePlugin.PngImageFile image mode=RGBA size=220x220 at 0x2377
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。