Last active
September 9, 2020 16:56
-
-
Save JWhitleyWork/c95c87c8c2408a92846d439085a957ab to your computer and use it in GitHub Desktop.
PCD Downsampling Script (Voxel Grid Algorithm)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
LEAF_SIZE=$1 | |
for file in ./original/*.pcd; do | |
filename=$(basename -- "${file}") | |
extension="${filename##*.}" | |
filename="${filename%.*}" | |
new_filename="${filename}_vg_${LEAF_SIZE}.pcd" | |
pcl_voxel_grid ${file} voxel_grid/${new_filename} -leaf ${LEAF_SIZE},${LEAF_SIZE},${LEAF_SIZE} | |
echo "" | |
done | |
pcl_concatenate_points_pcd voxel_grid/*_vg_${LEAF_SIZE}.pcd | |
echo "" | |
mv output.pcd output/AutonomouStuff_Mandli_vg_${LEAF_SIZE}_bin.pcd | |
pcl_convert_pcd_ascii_binary output/AutonomouStuff_Mandli_vg_${LEAF_SIZE}_bin.pcd output/AutonomouStuff_Mandli_vg_${LEAF_SIZE}_ascii.pcd 0 | |
echo "" | |
echo "Done!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment