Skip to content

codebydant/upsamplingCloudPCL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

upsamplingCloudPCL

Upsampling method for an input cloud using MovingLeastSquares method of PCL

Input file structure support

Format Description
.pcd Point Cloud Data file format
.ply Polygon file format
.txt Text file format
.xyz X Y Z Text file format

Output file structure (.pcd)

  • unsampled_cloud.pcd

Example




Command line

Usage: ./upsampling_cloud [options] 

Optional arguments:
-h --help         	shows help message and exits [default: false]
-v --version      	prints version information and exits [default: false]
--cloudfile       	input cloud file [required]
--search-radius   	search radius value [default: 0.03]
--sampling-radius 	sampling radius value [default: 0.005]
--step-size       	step size [default: 0.005]
-o --output-dir   	output dir to save upsampled cloud [default: "-"] (not configured)
-d --display      	display upsampling in the pcl visualizer [default: false]

Dependencies

This projects depends on the Point Cloud Library (it works with version 1.8...1.12.1) and its dependencies.

Package Version Description
VTK 9.0.0 Visualization toolkit
PCL 1.12.1 The Point Cloud Library (PCL)
Eigen 3.7.7 Eigen is a library of template headers for linear algebra
Flann 1.9.1 Fast Library for Approximate Nearest Neighbors
Boost 1.77.0 Provides support for linear algebra, pseudorandom number generation, multithreading
OpenGL 21.2.6 Programming interface for rendering 2D and 3D vector graphics.

Compilation

Compile from source

  1. Download source code
git clone https://github.com/danielTobon43/upsamplingCloudPCL
  1. Create a "build" folder at the top level of the upsamplingCloudPCL
cd upsamplingCloudPCL/ && mkdir build
  1. Compile with CMake
cd build/ && cmake ../ && make

Test

cd /build
./upsampling_cloud --cloudfile <path/to/cloud-file>

Note

You can modify the parameters to obtain better results here

mls.setComputeNormals(true);
mls.setInputCloud(input_cloud);
mls.setSearchMethod(kd_tree);
mls.setSearchRadius(search_radius);
mls.setUpsamplingMethod(pcl::MovingLeastSquares<pcl::PointXYZRGB, pcl::PointXYZRGB>::UpsamplingMethod::SAMPLE_LOCAL_PLANE);
mls.setUpsamplingRadius(sampling_radius);
mls.setUpsamplingStepSize(step_size);
mls.setPolynomialOrder(pol_order);
mls.setSqrGaussParam(gauss_param);// (the square of the search radius works best in general)
mls.setCacheMLSResults(true);//Set whether the mls results should be stored for each point in the input cloud.
mls.setNumberOfThreads(num_threats);