解决办法:
imread不能读就不用这个,换成imdecode,具体这么写,
image = imdecode(fromfile('中文.jpg', dtype=uint8), -1)
其中,fromfile和uint8都是numpy里面的东西。
另外,在写入的时候,imwrite也是不能够正确的写入带有中文名字的文件,需要用imencode来代替它,具体这么写:
cv2.imencode('.jpg', img_data)[1].tofile(file_path)
image = imdecode(fromfile('中文.jpg', dtype=uint8), -1)
cv2.imencode('.jpg', img_data)[1].tofile(file_path)