当使用pythons在构建函数“打开”时,我收到了一个错误,并且不知道如何使它对png文件工作。
:img =open('here.png').read()
错误:UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 101: character maps to <undefined>
发布于 2018-05-10 01:45:29
要打开图像,我建议您使用python的opencv
或PIL
模块。
使用 OpenCV
import cv2
img = cv2.imread('here.png',0)
使用PIL的
from PIL import Image
im = Image.open("here.png")
im.show()
如果您只想使用open
打开
img =open('here.png','rb').read()
https://stackoverflow.com/questions/50264277
复制相似问题