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)
65 if (!tree->nearestKSearch (src.
points[i], 1, nn_indices, nn_distances))
67 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);
71 if (nn_distances[0] > threshold)
72 src_indices.push_back (i);
76 output.
points.resize (src_indices.size ());
78 output.
width =
static_cast<uint32_t
> (src_indices.size ());
94 template <
typename Po
intT>
void
97 output.
header = input_->header;
107 if (target_->points.empty ())
116 if (target_->isOrganized ())
122 tree_->setInputCloud (target_);
129 #define PCL_INSTANTIATE_SegmentDifferences(T) template class PCL_EXPORTS pcl::SegmentDifferences<T>;
130 #define PCL_INSTANTIATE_getPointCloudDifference(T) template PCL_EXPORTS void pcl::getPointCloudDifference<T>(const pcl::PointCloud<T> &, const pcl::PointCloud<T> &, double, const boost::shared_ptr<pcl::search::Search<T> > &, pcl::PointCloud<T> &);
132 #endif // PCL_SEGMENTATION_IMPL_SEGMENT_DIFFERENCES_H_