load_clouds.h
#pragma once
#include "typedefs.h"
#include <pcl/io/pcd_io.h>
template <typename PointT>
typename pcl::PointCloud<PointT>::Ptr
loadPointCloud (std::string filename, std::string suffix)
{
typename pcl::PointCloud<PointT>::Ptr output (new pcl::PointCloud<PointT>);
filename.append (suffix);
pcl::io::loadPCDFile (filename, *output);
pcl::console::print_info ("Loaded %s (%lu points)\n", filename.c_str (), output->size ());
return (output);
}
PointCloudPtr
loadPoints (std::string filename)
{
PointCloudPtr output (new PointCloud);
filename.append ("_points.pcd");
pcl::io::loadPCDFile (filename, *output);
pcl::console::print_info ("Loaded %s (%lu points)\n", filename.c_str (), output->size ());
return (output);
}
SurfaceNormalsPtr
loadSurfaceNormals(std::string filename)
{
SurfaceNormalsPtr output (new SurfaceNormals);
filename.append ("_normals.pcd");
pcl::io::loadPCDFile (filename, *output);
pcl::console::print_info ("Loaded %s (%lu points)\n", filename.c_str (), output->size ());
return (output);
}
PointCloudPtr
loadKeypoints (std::string filename)
{
PointCloudPtr output (new PointCloud);
filename.append ("_keypoints.pcd");
pcl::io::loadPCDFile (filename, *output);
pcl::console::print_info ("Loaded %s (%lu points)\n", filename.c_str (), output->size ());
return (output);
}
LocalDescriptorsPtr
loadLocalDescriptors (std::string filename)
{
LocalDescriptorsPtr output (new LocalDescriptors);
filename.append ("_localdesc.pcd");
pcl::io::loadPCDFile (filename, *output);
pcl::console::print_info ("Loaded %s (%lu points)\n", filename.c_str (), output->size ());
return (output);
}
GlobalDescriptorsPtr
loadGlobalDescriptors (std::string filename)
{
GlobalDescriptorsPtr output (new GlobalDescriptors);
filename.append ("_globaldesc.pcd");
pcl::io::loadPCDFile (filename, *output);
pcl::console::print_info ("Loaded %s (%lu points)\n", filename.c_str (), output->size ());
return (output);
}
pcl::PointCloud
PointCloud represents the base class in PCL for storing collections of 3D points.
Definition: projection_matrix.h:52
pcl::console::print_info
PCL_EXPORTS void print_info(const char *format,...)
Print an info message on stream with colors.
pcl::PointCloud::Ptr
shared_ptr< PointCloud< PointT > > Ptr
Definition: point_cloud.h:415
pcl::io::loadPCDFile
int loadPCDFile(const std::string &file_name, pcl::PCLPointCloud2 &cloud)
Load a PCD v.6 file into a templated PointCloud type.
Definition: pcd_io.h:620