sta*_*ion 1 python image-processing python-2.7
我试图使用PIL的图像的开放方法打开图像,但是我收到以下错误.
我已将图像存储在C:\a.jpg.
>>> h1 = Image.open("C:\a.jpg").histogram()
Traceback (most recent call last):
File "<pyshell#8>", line 1, in <module>
h1 = Image.open("C:\a.jpg").histogram()
File "C:\Python27\lib\site-packages\PIL\Image.py", line 1952, in open
fp = __builtin__.open(fp, "rb")
IOError: [Errno 22] invalid mode ('rb') or filename: 'C:\x07.jpg'
Run Code Online (Sandbox Code Playgroud)
你有使用@NelleshSharma或者方法的转义字符问题
Image.open(r'c:\a.jpg').histogram();
Run Code Online (Sandbox Code Playgroud)