asweigart / pyautogui

A cross-platform GUI automation Python module for human beings. Used to programmatically control the mouse & keyboard.
BSD 3-Clause "New" or "Revised" License
10.22k stars 1.24k forks source link

Support Chinese file name 让img路径支持中文的一些建议 #661

Closed doom189 closed 2 years ago

doom189 commented 2 years ago

pyautogui.locateCenterOnScreen(img cv2.imread(Chinese FileName) is None 文件名是中文 例如: 地鼠.png 我通过搜索, 处理了 import cv2 import numpy as np cv2.imdecode(np.fromfile("D:\haha哈哈.png",dtype=np.uint8), cv2.IMREAD_COLOR) cv2.imdecode(np.fromfile("D:\haha哈哈.png",dtype=np.uint8), cv2.IMREAD_GRAYSCALE) 处理后如下图: image

doom189 commented 2 years ago

提错地方了, 应该是PyScreeze项目的Issue