Pyhton实现点云保存为bin文件

# -*- coding: utf-8 -*-
"""
Created on Mon Nov 21 2022
@author: MMG
"""
# coding=utf-8

def data2bin(points, no):
    processed_dir = '/home/processed_lidar'
    points.astype(np.float32).tofile(os.path.join(processed_dir, str(no)))

def main():
     root_dir = '/home/gmm/snowyweather/Lidar'  # txt数据集路径
    cat = os.listdir(root_dir)
    iteration_num = len(cat)
    for i in range(iteration_num):
        filename = os.path.join(root_dir, cat[i])
        db_np = read_velodyne_txt(filename)        # 这个函数需要自己写
        data2bin(fiterdata, cat[i])


if __name__ == main():
    main()

你可能感兴趣的:(激光雷达点云数据处理,python)