2 #include <pcl/point_types.h>
3 #include <pcl/point_cloud.h>
4 #include <pcl/PolygonMesh.h>
10 typedef Eigen::Matrix<bool, Eigen::Dynamic, 1> VectorXb;
12 using pcl::PointCloud;
17 TRAJOPT_API
typename pcl::PointCloud<T>::Ptr readPCD(
const std::string& pcdfile);
20 TRAJOPT_API
void saveCloud(
const pcl::PointCloud<T>& cloud,
const std::string& pcdfile);
22 TRAJOPT_API
void saveMesh(
const pcl::PolygonMesh& mesh,
const std::string& fname);
24 TRAJOPT_API pcl::PolygonMesh::Ptr loadMesh(
const std::string& fname);
31 TRAJOPT_API
typename pcl::PointCloud<T>::Ptr downsampleCloud(
typename pcl::PointCloud<T>::ConstPtr in,
float vsize);
33 TRAJOPT_API std::vector<int> getNearestNeighborIndices(pcl::PointCloud<pcl::PointXYZ>::Ptr src, pcl::PointCloud<pcl::PointXYZ>::Ptr targ);
35 TRAJOPT_API pcl::PointCloud<pcl::PointXYZ>::Ptr computeConvexHull(pcl::PointCloud<pcl::PointXYZ>::ConstPtr in, std::vector<pcl::Vertices>* polygons);
36 TRAJOPT_API pcl::PointCloud<pcl::PointXYZ>::Ptr computeAlphaShape(pcl::PointCloud<pcl::PointXYZ>::ConstPtr in,
float alpha,
int dim, std::vector<pcl::Vertices>* polygons);
38 TRAJOPT_API pcl::PointCloud<pcl::PointNormal>::Ptr mlsAddNormals(PointCloud<pcl::PointXYZ>::ConstPtr in,
float searchRadius);
40 TRAJOPT_API PointCloud<pcl::Normal>::Ptr integralNormalEstimation(PointCloud<pcl::PointXYZ>::ConstPtr in,
float maxDepthChangeFactor,
float normalSmoothingSize);
43 TRAJOPT_API
typename pcl::PointCloud<pcl::PointXYZ>::Ptr toXYZ(
typename pcl::PointCloud<T>::ConstPtr in);
49 TRAJOPT_API
typename pcl::PointCloud<T>::Ptr medianFilter(
typename pcl::PointCloud<T>::ConstPtr in,
int windowSize,
float maxAllowedMovement);
57 TRAJOPT_API
typename pcl::PointCloud<T>::Ptr fastBilateralFilter(
typename pcl::PointCloud<T>::ConstPtr in,
float sigmaS,
float sigmaR);
68 TRAJOPT_API pcl::PolygonMesh::Ptr meshGP3(PointCloud<pcl::PointNormal>::ConstPtr cloud,
float mu,
int maxnn,
float searchRadius);
75 TRAJOPT_API pcl::PolygonMesh::Ptr meshOFM(PointCloud<pcl::PointXYZ>::ConstPtr cloud,
int edgeLengthPixels,
float maxEdgeLength);
86 TRAJOPT_API
typename pcl::PointCloud<T>::Ptr maskFilter(
typename pcl::PointCloud<T>::ConstPtr in,
const VectorXb& mask,
bool keep_organized);
92 TRAJOPT_API VectorXb boxMask(
typename pcl::PointCloud<T>::ConstPtr,
float xmin,
float ymin,
float zmin,
float xmax,
float ymax,
float zmax);
98 TRAJOPT_API
typename pcl::PointCloud<T>::Ptr boxFilter(
typename pcl::PointCloud<T>::ConstPtr in,
float xmin,
float ymin,
float zmin,
float xmax,
float ymax,
float zmax,
bool keep_organized) {
99 return maskFilter<T>(in, boxMask<T>(in, xmin,ymin,zmin,xmax,ymax,zmax), keep_organized);
106 TRAJOPT_API
typename pcl::PointCloud<T>::Ptr boxFilterNegative(
typename pcl::PointCloud<T>::ConstPtr in,
float xmin,
float ymin,
float zmin,
float xmax,
float ymax,
float zmax,
bool keep_organized) {
107 return maskFilter<T>(in, 1 - boxMask<T>(in, xmin,ymin,zmin,xmax,ymax,zmax).array(), keep_organized);