python3下 解决cv2读取中文路径问题

来源:互联网 发布:咸阳网络买花花店 编辑:程序博客网 时间:2024/05/01 12:27


python3:

img_path =  ' '

im = cv2.imdecode(np.fromfile(img_path,dtype = np.uint8),-1)


save_path =  ' '

cv2.imencode('.jpg',im)[1].tofile(save_path)



python2.7:

img_path = ' '

im = cv2.imread(img_path.decode(‘utf-8'))

原创粉丝点击