40 #include <pcl/segmentation/segment_differences.h>
42 #include <pcl/common/io.h>
43 #include <pcl/common/point_tests.h>
47 template <
typename Po
intT>
void
55 std::vector<int> nn_indices (1);
56 std::vector<float> nn_distances (1);
59 std::vector<int> src_indices;
62 for (
int i = 0; i < static_cast<int> (src.
size ()); ++i)
70 PCL_WARN (
"No neighbor found for point %lu (%f %f %f)!\n", i, src[i].x, src[i].y, src[i].z);
74 if (nn_distances[0] > threshold)
75 src_indices.push_back (i);
88 template <
typename Po
intT>
void
91 output.
header = input_->header;
101 if (target_->points.empty ())
110 if (target_->isOrganized ())
116 tree_->setInputCloud (target_);
123 #define PCL_INSTANTIATE_SegmentDifferences(T) template class PCL_EXPORTS pcl::SegmentDifferences<T>;
124 #define PCL_INSTANTIATE_getPointCloudDifference(T) template PCL_EXPORTS void pcl::getPointCloudDifference<T>(const pcl::PointCloud<T> &, double, const typename pcl::search::Search<T>::Ptr &, pcl::PointCloud<T> &);
PointCloud represents the base class in PCL for storing collections of 3D points.
bool is_dense
True if no points are invalid (e.g., have NaN or Inf values in any of their floating point fields).
std::uint32_t width
The point cloud width (if organized as an image-structure).
pcl::PCLHeader header
The point cloud header.
std::uint32_t height
The point cloud height (if organized as an image-structure).
std::vector< PointT, Eigen::aligned_allocator< PointT > > points
The point data.
void segment(PointCloud &output)
Segment differences between two input point clouds.
search::KdTree is a wrapper class which inherits the pcl::KdTree class for performing search function...
OrganizedNeighbor is a class for optimized nearest neigbhor search in organized point clouds.
shared_ptr< pcl::search::Search< PointT > > Ptr
virtual int nearestKSearch(const PointT &point, int k, Indices &k_indices, std::vector< float > &k_sqr_distances) const =0
Search for the k-nearest neighbors for the given query point.
void copyPointCloud(const pcl::PointCloud< PointInT > &cloud_in, pcl::PointCloud< PointOutT > &cloud_out)
Copy all the fields from a given point cloud into a new point cloud.
void getPointCloudDifference(const pcl::PointCloud< PointT > &src, double threshold, const typename pcl::search::Search< PointT >::Ptr &tree, pcl::PointCloud< PointT > &output)
Obtain the difference between two aligned point clouds as another point cloud, given a distance thres...
bool isFinite(const PointT &pt)
Tests if the 3D components of a point are all finite param[in] pt point to be tested return true if f...