skimage读取不到图片会报错 cv2读取不到图片返回None

# '/Volumes/qiang/window_door/2020-0904-testdataset-aggregate/0000000002_10158273_阳台.jpg'图片是我把.txt后缀改为.jpg得到的
import cv2
img = cv2.imread('/Volumes/qiang/window_door/2020-0904-testdataset-aggregate/0000000002_10158273_阳台.jpg')
print(img)
返回:
None

from skimage import io
img = io.imread('/Volumes/qiang/window_door/2020-0904-testdataset-aggregate/0000000002_10158273_阳台.jpg')
返回:
Traceback (most recent call last):
  File "/Users/chensi/Library/Python/3.7/lib/python/site-packages/IPython/core/interactiveshell.py", line 3343, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-20-f032805a7902>", line 1, in <module>
    img = io.imread('/Volumes/qiang/window_door/2020-0904-testdataset-aggregate/0000000002_10158273_阳台.jpg')
  File "/Users/chensi/Library/Python/3.7/lib/python/site-packages/skimage/io/_io.py", line 48, in imread
    img = call_plugin('imread', fname, plugin=plugin, **plugin_args)
  File "/Users/chensi/Library/Python/3.7/lib/python/site-packages/skimage/io/manage_plugins.py", line 209, in call_plugin
    return func(*args, **kwargs)
  File "/Users/chensi/Library/Python/3.7/lib/python/site-packages/skimage/io/_plugins/imageio_plugin.py", line 10, in imread
    return np.asarray(imageio_imread(*args, **kwargs))
  File "/Users/chensi/Library/Python/3.7/lib/python/site-packages/imageio/core/functions.py", line 265, in imread
    reader = read(uri, format, "i", **kwargs)
  File "/Users/chensi/Library/Python/3.7/lib/python/site-packages/imageio/core/functions.py", line 182, in get_reader
    "Could not find a format to read the specified file in %s mode" % modename
ValueError: Could not find a format to read the specified file in single-image mode

 

  • 3
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值