Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
尽管我正确给出了路径,但图像没有加载。
import cv2 from PIL import Image a = Image.open('me.jpg') a.show()
我在 Windows 8 64 位上使用 OpenCV2.4。
如果您确定图片在项目目录中,请尝试:
在您的代码中没有路径,只有文件名....
import cv2 import os from PIL import Image a = Image.open(os.path.join(os.path.dirname(__file__)) + '/me.jpg') a.show()