在Python中加载.mat格式的图像时出错

2024-05-01 22:13:03 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试使用scipy加载python中.mat格式的matlab图像。它给出了一个错误。然而,当我在matlab中加载时,它显示了它的样子。如何在python中加载.mat图像?你知道吗

Traceback (most recent call last):

  File "<ipython-input-28-d42e90ca2d13>", line 1, in <module>
    mat_dict = loadmat('D:/Dataset/Multi-resolution_data/Visual/High/1/image100_256.mat');

  File "d:\python\python37\lib\site-packages\scipy\io\matlab\mio.py", line 217, in loadmat
    MR, _ = mat_reader_factory(f, **kwargs)

  File "d:\python\python37\lib\site-packages\scipy\io\matlab\mio.py", line 78, in mat_reader_factory
    raise NotImplementedError('Please use HDF reader for matlab v7.3 files')

NotImplementedError: Please use HDF reader for matlab v7.3 files```


```im= load('D:/Dataset/Multi-resolution_data/Visual/High/1/image100_256.mat')

output is 256x256x11```

Tags: in图像datalinescipymultidatasetreader