다운샘플링-PCL-Python (50%)

Jupyter 버젼은 [이곳]에서 확인 가능 합니다.

import pcl

def do_voxel_grid_downssampling(pcl_data,leaf_size):
    '''
    Create a VoxelGrid filter object for a input point cloud
    :param pcl_data: point cloud data subscriber
    :param leaf_size: voxel(or leaf) size
    :return: Voxel grid downsampling on point cloud
    :https://github.com/fouliex/RoboticPerception
    '''
    vox = pcl_data.make_voxel_grid_filter()
    vox.set_leaf_size(leaf_size, leaf_size, leaf_size) # The bigger the leaf size the less information retained
    return  vox.filter()


cloud = pcl.load("./sample/lobby.pcd")
print(cloud)


LEAF_SIZE = 0.01 
cloud = do_voxel_grid_downssampling(cloud,LEAF_SIZE)
print(cloud)

Last updated