Point Cloud Library (PCL)
1.10.1
|
43 #include <pcl/point_cloud.h>
44 #include <pcl/point_representation.h>
45 #include <pcl/common/io.h>
46 #include <pcl/common/copy_point.h>
54 template <
typename Po
intT>
100 inline PointCloudConstPtr
137 std::vector<int> &k_indices, std::vector<float> &k_sqr_distances)
const = 0;
157 std::vector<int> &k_indices, std::vector<float> &k_sqr_distances)
const
159 assert (index >= 0 && index < static_cast<int> (cloud.
points.size ()) &&
"Out-of-bounds error in nearestKSearch!");
172 template <
typename Po
intTDiff>
inline int
174 std::vector<int> &k_indices, std::vector<float> &k_sqr_distances)
const
200 std::vector<int> &k_indices, std::vector<float> &k_sqr_distances)
const
204 assert (index >= 0 && index < static_cast<int> (
input_->points.size ()) &&
"Out-of-bounds error in nearestKSearch!");
207 assert (index >= 0 && index < static_cast<int> (
indices_->size ()) &&
"Out-of-bounds error in nearestKSearch!");
223 std::vector<float> &k_sqr_distances,
unsigned int max_nn = 0)
const = 0;
244 std::vector<int> &k_indices, std::vector<float> &k_sqr_distances,
245 unsigned int max_nn = 0)
const
247 assert (index >= 0 && index < static_cast<int> (cloud.
points.size ()) &&
"Out-of-bounds error in radiusSearch!");
248 return (
radiusSearch(cloud.
points[index], radius, k_indices, k_sqr_distances, max_nn));
261 template <
typename Po
intTDiff>
inline int
262 radiusSearchT (
const PointTDiff &point,
double radius, std::vector<int> &k_indices,
263 std::vector<float> &k_sqr_distances,
unsigned int max_nn = 0)
const
267 return (
radiusSearch (p, radius, k_indices, k_sqr_distances, max_nn));
291 std::vector<float> &k_sqr_distances,
unsigned int max_nn = 0)
const
295 assert (index >= 0 && index < static_cast<int> (
input_->points.size ()) &&
"Out-of-bounds error in radiusSearch!");
296 return (
radiusSearch (
input_->points[index], radius, k_indices, k_sqr_distances, max_nn));
298 assert (index >= 0 && index < static_cast<int> (
indices_->size ()) &&
"Out-of-bounds error in radiusSearch!");
int min_pts_
Minimum allowed number of k nearest neighbors points that a viable result must contain.
Defines all the PCL and non-PCL macros used.
shared_ptr< const std::vector< int > > IndicesConstPtr
This file defines compatibility wrappers for low level I/O functions.
virtual void setEpsilon(float eps)
Set the search epsilon precision (error bound) for nearest neighbors searches.
std::vector< PointT, Eigen::aligned_allocator< PointT > > points
The point data.
KdTree represents the base spatial locator class for kd-tree implementations.
shared_ptr< const KdTree< FeatureT > > ConstPtr
int radiusSearchT(const PointTDiff &point, double radius, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances, unsigned int max_nn=0) const
Search for all the nearest neighbors of the query point in a given radius.
shared_ptr< const Indices > IndicesConstPtr
DefaultPointRepresentation extends PointRepresentation to define default behavior for common point ty...
IndicesConstPtr indices_
A pointer to the vector of point indices to use.
shared_ptr< const PointRepresentation< PointT > > ConstPtr
virtual void setInputCloud(const PointCloudConstPtr &cloud, const IndicesConstPtr &indices=IndicesConstPtr())
Provide a pointer to the input dataset.
void setMinPts(int min_pts)
Minimum allowed number of k nearest neighbors points that a viable result must contain.
A point structure representing Euclidean xyz coordinates, and the RGB color.
shared_ptr< std::vector< int > > IndicesPtr
virtual int radiusSearch(const PointCloud &cloud, int index, double radius, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances, unsigned int max_nn=0) const
Search for all the nearest neighbors of the query point in a given radius.
float getEpsilon() const
Get the search epsilon precision (error bound) for nearest neighbors searches.
PointRepresentationConstPtr getPointRepresentation() const
Get a pointer to the point representation used when converting points into k-D vectors.
void copyPoint(const PointInT &point_in, PointOutT &point_out)
Copy the fields of a source point into a target point.
virtual int radiusSearch(const PointT &p_q, double radius, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances, unsigned int max_nn=0) const =0
Search for all the nearest neighbors of the query point in a given radius.
virtual std::string getName() const =0
Class getName method.
typename PointCloud::Ptr PointCloudPtr
IndicesConstPtr getIndices() const
Get a pointer to the vector of indices used.
PointCloudConstPtr getInputCloud() const
Get a pointer to the input point cloud dataset.
PointRepresentationConstPtr point_representation_
For converting different point structures into k-dimensional vectors for nearest-neighbor search.
bool sorted_
Return the radius search neighbours sorted.
shared_ptr< PointCloud< PointT > > Ptr
virtual ~KdTree()
Destructor for KdTree.
shared_ptr< KdTree< FeatureT > > Ptr
virtual int radiusSearch(int index, double radius, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances, unsigned int max_nn=0) const
Search for all the nearest neighbors of the query point in a given radius (zero-copy).
shared_ptr< const PointCloud< PointT > > ConstPtr
float epsilon_
Epsilon precision (error bound) for nearest neighbors searches.
typename PointRepresentation::ConstPtr PointRepresentationConstPtr
int nearestKSearchT(const PointTDiff &point, int k, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances) const
Search for k-nearest neighbors for the given query point.
PointCloudConstPtr input_
The input point cloud dataset containing the points we need to use.
int getMinPts() const
Get the minimum allowed number of k nearest neighbors points that a viable result must contain.
virtual int nearestKSearch(const PointT &p_q, int k, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances) const =0
Search for k-nearest neighbors for the given query point.
virtual int nearestKSearch(int index, int k, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances) const
Search for k-nearest neighbors for the given query point (zero-copy).
virtual int nearestKSearch(const PointCloud &cloud, int index, int k, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances) const
Search for k-nearest neighbors for the given query point.
typename PointCloud::ConstPtr PointCloudConstPtr
boost::shared_ptr< T > shared_ptr
Alias for boost::shared_ptr.
void setPointRepresentation(const PointRepresentationConstPtr &point_representation)
Provide a pointer to the point representation to use to convert points into k-D vectors.
KdTree(bool sorted=true)
Empty constructor for KdTree.