python3.6 opencv 读取带中文路径的图

#可以读取带中文路径的图
def cv_imread(file_path,type=0):
    cv_img=cv2.imdecode(np.fromfile(file_path,dtype=np.uint8),-1)
    if(type==0):
        cv_img = cv2.cvtColor(cv_img, cv2.COLOR_BGR2GRAY)
    return cv_img

猜你喜欢

转载自blog.csdn.net/sxlsxl119/article/details/81332856