40 #include <pcl/segmentation/segment_differences.h>
42 #include <pcl/common/io.h>
43 #include <pcl/common/point_tests.h>
44 #include <pcl/search/organized.h>
45 #include <pcl/search/kdtree.h>
49 template <
typename Po
intT>
void
58 std::vector<float> nn_distances (1);
64 for (
index_t i = 0; i < static_cast<index_t> (src.
size ()); ++i)
72 PCL_WARN (
"No neighbor found for point %lu (%f %f %f)!\n", i, src[i].x, src[i].y, src[i].z);
76 if (nn_distances[0] > threshold)
77 src_indices.push_back (i);
90 template <
typename Po
intT>
void
93 output.
header = input_->header;
103 if (target_->points.empty ())
112 if (target_->isOrganized ())
118 tree_->setInputCloud (target_);
125 #define PCL_INSTANTIATE_SegmentDifferences(T) template class PCL_EXPORTS pcl::SegmentDifferences<T>;
126 #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).
void clear()
Removes all points in a cloud and sets the width and height to 0.
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 neighbor search in organized projectable point clo...
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...
detail::int_type_t< detail::index_type_size, detail::index_type_signed > index_t
Type used for an index in PCL.
IndicesAllocator<> Indices
Type used for indices in PCL.