hazerd论文中mat格式深度图转提取并转npy文件

import numpy
import scipy.io as scio
import os
dataFile = r'C:\Users\Administrator\Desktop\test\hazerd\data\depth'

result_depth = []
for root, _, fnames in sorted(os.walk(dataFile)):
    for fname in fnames:
        path = os.path.join(root, fname)
        result_depth.append(path)

for i in result_depth:
    data = scio.loadmat(i)
    f,n = os.path.split(i)
    name = os.path.join(f,n+'.npy')
    depth = data['imDepth']
    numpy.save(name,depth)

你可能感兴趣的:(图像处理,#,图像去雾加雾,计算机视觉,计算机视觉,人工智能)