我有一个test/
包含图像的目录0.jpg
,并且1.jpg
. 如何使用imageio
'smimread
函数指定目录test
并同时读取0
和1
?或者这不是它的本意?
我试过imageio.mimread(uri="/path/to/test/", format=".jpg")
但得到以下结果:
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-43-89a6d166a345> in <module>()
----> 1 imageio.mimread(uri="test", format=".jpg", memtest=True)
/Users/myuser/anaconda/envs/python3/lib/python3.5/site-packages/imageio/core/functions.py in mimread(uri, format, memtest, **kwargs)
279
280 # Get reader
--> 281 reader = read(uri, format, 'I', **kwargs)
282
283 # Read
/Users/myuser/anaconda/envs/python3/lib/python3.5/site-packages/imageio/core/functions.py in get_reader(uri, format, mode, **kwargs)
127
128 # Return its reader object
--> 129 return format.get_reader(request)
130
131
/Users/myuser/anaconda/envs/python3/lib/python3.5/site-packages/imageio/core/format.py in get_reader(self, request)
165 if select_mode not in self.modes:
166 raise RuntimeError('Format %s cannot read in mode %r' %
--> 167 (self.name, select_mode))
168 return self.Reader(self, request)
169
RuntimeError: Format JPEG-PIL cannot read in mode 'I'