How do I read an image from a path with Unicode characters?

前端 未结 4 621
广开言路
广开言路 2020-12-03 05:13

I have the following code and it fails, because it cannot read the file from disk. The image is always None.

# -*- coding: utf-8 -*-
import cv2
         


        
4条回答
  •  时光说笑
    2020-12-03 06:05

    bgrImage = cv2.imread(filename.encode('utf-8'))
    

    encode file full path to utf-8

提交回复
热议问题