200字范文,内容丰富有趣,生活中的好帮手!
200字范文 > cv2.imread 中文路径返回null

cv2.imread 中文路径返回null

时间:2019-07-28 18:42:11

相关推荐

cv2.imread 中文路径返回null

经过测试,发现cv2.imread读取图片,路径中有中文,则返回null

cv2.imread 中文路径返回null

这个方法还没试:

file = askopenfilename()

im2 = cv2.imread(file.encode('gbk')

opencv c++是支持中文的,python不支持中文。

读取图片

import cv2img = cv2.imdecode(np.fromfile(img_path, dtype=np.uint8), 1)img=cv2.imdecode(np.fromfile(img_path, dtype=np.uint8),-1)# 读入完整图片,见下面解释img=cv2.imdecode(np.fromfile(img_path, dtype=np.uint8),0)# 读成灰度img=cv2.imdecode(np.fromfile(img_path, dtype=np.uint8),1)# 读成彩图

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。