解决Python下imread,imwrite不支持中文

由以下函数代替该功能:

def cv_imread(file_path):
    cv_img=cv2.imdecode(np.fromfile(file_path,dtype=np.uint8),-1)
    return cv_img
def cv_imwrite(filename,src):
    cv2.imencode('.jpg',src)[1].tofile(filename)

猜你喜欢

转载自blog.csdn.net/qq_40250862/article/details/81316366