Created
March 16, 2018 07:42
-
-
Save mintisan/f42a77ddacb08d5bbd72c6721973306d to your computer and use it in GitHub Desktop.
Python 下 OpenCV 保存图片时包含中文路径
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import os | |
# ref. : http://blog.csdn.net/carryheart/article/details/61937872 | |
# https://stackoverflow.com/questions/541390/extracting-extension-from-filename-in-python/ | |
# image: image to be saved | |
# filename: filename with absolute path | |
cv2.imencode(os.path.splitext(filename)[1], image)[1].tofile(filename) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment