【问题标题】:convert point cloud .npy file to .h5 in python在python中将点云.npy文件转换为.h5
【发布时间】:2018-09-27 10:34:13
【问题描述】:

我之前问过类似的问题 (how to convert .pts or .npy file into .ply or .h5 file?)。

但我有更高级的问题。

h5format

如上图所示,这个.h5文件有(N,N,3)的形状。

我的点云数据为 (N,3) 形状的 .npy 文件格式。

我将 .npy 转换为 .h5 作为前一个问题的答案的方式(以上链接)

结果.h5显示(N,3)形状。(如下图)

converted_1

您能否参考我的示例代码或帮助我转换文件格式?

对不起,我的英语水平很差。

【问题讨论】:

    标签: python numpy hdf5 point-clouds


    【解决方案1】:

    抱歉,我从许多其他示例代码中得到了解决方案。

    for i in range(0, len(filenames)):
        if filenames[i] == "":
            continue        
        npydata = np.load("./data/npy/" + filenames[i] + ".npy")
    
        print(npydata.shape)
    
        for j in range(0, 2048):
            a_data[i, j] = [npydata[j][0], npydata[j][1], npydata[j][2]]
    
    data = f.create_dataset("data", data = a_data)
    f.close()
    

    上面的代码解决了我的问题。

    【讨论】:

      猜你喜欢
      • 2019-02-18
      • 2019-02-22
      • 1970-01-01
      • 2017-05-21
      • 1970-01-01
      • 2019-09-10
      • 2022-11-10
      • 2019-08-12
      • 2019-04-14
      相关资源
      最近更新 更多