Point Cloud Library (PCL)
1.10.0
|
38 #ifndef PCL_SEGMENTATION_IMPL_SEGMENT_DIFFERENCES_H_
39 #define PCL_SEGMENTATION_IMPL_SEGMENT_DIFFERENCES_H_
41 #include <pcl/segmentation/segment_differences.h>
42 #include <pcl/common/io.h>
45 template <
typename Po
intT>
void
53 std::vector<int> nn_indices (1);
54 std::vector<float> nn_distances (1);
57 std::vector<int> src_indices;
60 for (
int i = 0; i < static_cast<int> (src.
points.size ()); ++i)
68 PCL_WARN (
"No neighbor found for point %lu (%f %f %f)!\n", i, src.
points[i].x, src.
points[i].y, src.
points[i].z);
72 if (nn_distances[0] > threshold)
73 src_indices.push_back (i);
86 template <
typename Po
intT>
void
89 output.
header = input_->header;
99 if (target_->points.empty ())
108 if (target_->isOrganized ())
114 tree_->setInputCloud (target_);
121 #define PCL_INSTANTIATE_SegmentDifferences(T) template class PCL_EXPORTS pcl::SegmentDifferences<T>;
122 #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> &);
124 #endif // PCL_SEGMENTATION_IMPL_SEGMENT_DIFFERENCES_H_
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.
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...
void segment(PointCloud &output)
Segment differences between two input point clouds.
PCL_EXPORTS void copyPointCloud(const pcl::PCLPointCloud2 &cloud_in, const std::vector< int > &indices, pcl::PCLPointCloud2 &cloud_out)
Extract the indices of a given point cloud as a new point cloud.
PointCloud represents the base class in PCL for storing collections of 3D points.
std::uint32_t width
The point cloud width (if organized as an image-structure).
shared_ptr< pcl::search::Search< PointT > > Ptr
bool is_dense
True if no points are invalid (e.g., have NaN or Inf values in any of their floating point fields).
pcl::PCLHeader header
The point cloud header.
OrganizedNeighbor is a class for optimized nearest neigbhor search in organized point clouds.
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...
virtual int nearestKSearch(const PointT &point, int k, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances) const =0
Search for the k-nearest neighbors for the given query point.