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)
66 if (!tree->nearestKSearch (src.
points[i], 1, nn_indices, nn_distances))
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 boost::shared_ptr<pcl::search::Search<T> > &, pcl::PointCloud<T> &);
124 #endif // PCL_SEGMENTATION_IMPL_SEGMENT_DIFFERENCES_H_