Point Cloud Library (PCL) 1.3.1
Public Types | Public Member Functions
pcl::search::OrganizedNeighbor< PointT > Class Template Reference

OrgfanizedNeighbor is a class for optimized nearest neigbhor search in organized point clouds. More...

#include </builddir/build/BUILD/PCL-1.3.1-Source/search/include/pcl/search/organized.h>

Inheritance diagram for pcl::search::OrganizedNeighbor< PointT >:
Inheritance graph
[legend]
Collaboration diagram for pcl::search::OrganizedNeighbor< PointT >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef boost::shared_ptr
< pcl::search::Search< PointT > > 
Ptr
typedef boost::shared_ptr
< const pcl::search::Search
< PointT > > 
ConstPtr
typedef boost::shared_ptr
< std::vector< int > > 
IndicesPtr

Public Member Functions

 OrganizedNeighbor ()
 OrganizedNeighbor constructor.
 ~OrganizedNeighbor ()
 Empty deconstructor.
void setInputCloud (const PointCloudConstPtr &cloud)
 Provide a pointer to the input data set.
PointCloudConstPtr getInputCloud ()
 Get a pointer to the input dataset as passed by the user.
double getMaxDistance () const
 Get the maximum allowed distance between the query point and its nearest neighbors.
void setMaxDistance (double max_dist)
 Set the maximum allowed distance between the query point and its nearest neighbors.
void setSearchWindow (int horizontal, int vertical)
 set the search window (horizontal, vertical) in pixels.
void setSearchWindowAsK (int k)
 Estimate the search window (horizontal, vertical) in pixels in order to get up to k-neighbors.
int getHorizontalSearchWindow () const
 Get the horizontal search window in pixels.
int getVerticalSearchWindow () const
 Get the vertical search window in pixels.
int nearestKSearch (const PointT &p_q, int k, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances)
 Search for the k-nearest neighbors for a given query point.
int nearestKSearch (int index, int k, std::vector< int > &k_indices, std::vector< float > &k_distances)
 Search for the k-nearest neighbors for the given query point (zero-copy).
int nearestKSearch (const pcl::PointCloud< PointT > &cloud, int index, int k, std::vector< int > &k_indices, std::vector< float > &k_distances)
 Search for the k-nearest neighbors for a given query point.
int radiusSearch (const pcl::PointCloud< PointT > &cloud, int index, double radius, std::vector< int > &k_indices, std::vector< float > &k_distances, int max_nn=INT_MAX)
 Approximate search for neighbors around the given query point within radius.
int radiusSearch (int index, double radius, std::vector< int > &k_indices, std::vector< float > &k_distances, int max_nn=INT_MAX) const
 Approximate search for neighbors around the given query point within radius.
int radiusSearch (const PointT &p_q, double radius, std::vector< int > &k_indices, std::vector< float > &k_distances, int max_nn=INT_MAX) const
 Approximate search for neighbors around the given query point within radius.
virtual void setInputCloud (const PointCloudConstPtr &cloud, const IndicesConstPtr &indices)
 Pass the input dataset that the search will be performed on.
virtual void setInputCloud (const PointCloudConstPtr &cloud)=0
 Pass the input dataset that the search will be performed on.
virtual IndicesConstPtr const getIndices ()
 Get a pointer to the vector of indices used.
virtual int nearestKSearch (const PointCloud &cloud, int index, int k, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances)=0
 Search for the k-nearest neighbors for the given query point.
template<typename PointTDiff >
int nearestKSearchT (const PointTDiff &point, int k, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances)
 Search for the k-nearest neighbors for the given query point.
virtual int radiusSearch (const PointCloud &cloud, int index, double radius, std::vector< int > &k_indices, std::vector< float > &k_distances, int max_nn=-1)=0
 Search for all the nearest neighbors of the query point in a given radius.
template<typename PointTDiff >
int radiusSearchT (const PointTDiff &point, double radius, std::vector< int > &k_indices, std::vector< float > &k_distances, int max_nn=-1)
 Search for all the nearest neighbors of the query point in a given radius.

Detailed Description

template<typename PointT>
class pcl::search::OrganizedNeighbor< PointT >

OrgfanizedNeighbor is a class for optimized nearest neigbhor search in organized point clouds.

Author:
Radu B. Rusu, Julius Kammerl, Suat Gedikli

Definition at line 61 of file organized.h.


Member Typedef Documentation

template<typename PointT>
typedef boost::shared_ptr<const pcl::search::Search<PointT> > pcl::search::Search< PointT >::ConstPtr [inherited]
template<typename PointT>
typedef boost::shared_ptr<std::vector<int> > pcl::search::Search< PointT >::IndicesPtr [inherited]
template<typename PointT>
typedef boost::shared_ptr<pcl::search::Search<PointT> > pcl::search::Search< PointT >::Ptr [inherited]

Constructor & Destructor Documentation

template<typename PointT >
pcl::search::OrganizedNeighbor< PointT >::OrganizedNeighbor ( ) [inline]

OrganizedNeighbor constructor.

Definition at line 72 of file organized.h.

template<typename PointT >
pcl::search::OrganizedNeighbor< PointT >::~OrganizedNeighbor ( ) [inline]

Empty deconstructor.

Definition at line 80 of file organized.h.


Member Function Documentation

template<typename PointT >
int pcl::search::OrganizedNeighbor< PointT >::getHorizontalSearchWindow ( ) const [inline]

Get the horizontal search window in pixels.

Definition at line 134 of file organized.h.

template<typename PointT>
virtual IndicesConstPtr const pcl::search::Search< PointT >::getIndices ( ) [inline, virtual, inherited]

Get a pointer to the vector of indices used.

Reimplemented in pcl::search::AutotunedSearch< PointT >, pcl::search::KdTree< PointT >, and pcl::search::Octree< PointT, LeafTWrap, OctreeT >.

Definition at line 95 of file search.h.

template<typename PointT >
PointCloudConstPtr pcl::search::OrganizedNeighbor< PointT >::getInputCloud ( ) [inline, virtual]

Get a pointer to the input dataset as passed by the user.

Implements pcl::search::Search< PointT >.

Definition at line 96 of file organized.h.

template<typename PointT >
double pcl::search::OrganizedNeighbor< PointT >::getMaxDistance ( ) const [inline]

Get the maximum allowed distance between the query point and its nearest neighbors.

Definition at line 103 of file organized.h.

template<typename PointT >
int pcl::search::OrganizedNeighbor< PointT >::getVerticalSearchWindow ( ) const [inline]

Get the vertical search window in pixels.

Definition at line 141 of file organized.h.

template<typename PointT >
int pcl::search::OrganizedNeighbor< PointT >::nearestKSearch ( const PointT &  p_q,
int  k,
std::vector< int > &  k_indices,
std::vector< float > &  k_sqr_distances 
) [inline, virtual]

Search for the k-nearest neighbors for a given query point.

Note:
limiting the maximum search radius (with setMaxDistance) can lead to a significant improvement in search speed
Parameters:
[in]p_qthe given query point (setInputCloud must be given a-priori!)
[in]kthe number of neighbors to search for (used only if horizontal and vertical window not given already!)
[out]k_indicesthe resultant point indices (must be resized to k beforehand!)
[out]k_distances
Note:
this function does not return distances
Returns:
number of neighbors found

Implements pcl::search::Search< PointT >.

Definition at line 155 of file organized.h.

template<typename PointT>
virtual int pcl::search::Search< PointT >::nearestKSearch ( const PointCloud cloud,
int  index,
int  k,
std::vector< int > &  k_indices,
std::vector< float > &  k_sqr_distances 
) [pure virtual, inherited]

Search for the k-nearest neighbors for the given query point.

Parameters:
[in]cloudthe point cloud data
[in]indexthe index in cloud representing the query point
[in]kthe number of neighbors to search for
[out]k_indicesthe resultant indices of the neighboring points (must be resized to k a priori!)
[out]k_sqr_distancesthe resultant squared distances to the neighboring points (must be resized to k a priori!)
Returns:
number of neighbors found

Implemented in pcl::search::AutotunedSearch< PointT >, pcl::search::KdTree< PointT >, and pcl::search::Octree< PointT, LeafTWrap, OctreeT >.

template<typename PointT >
int pcl::search::OrganizedNeighbor< PointT >::nearestKSearch ( int  index,
int  k,
std::vector< int > &  k_indices,
std::vector< float > &  k_distances 
) [virtual]

Search for the k-nearest neighbors for the given query point (zero-copy).

Note:
limiting the maximum search radius (with setMaxDistance) can lead to a significant improvement in search speed
Parameters:
[in]indexthe index representing the query point in the dataset (setInputCloud must be given a-priori!)
[in]kthe number of neighbors to search for (used only if horizontal and vertical window not given already!)
[out]k_indicesthe resultant point indices (must be resized to k beforehand!)
[out]k_distances
Note:
this function does not return distances
Returns:
number of neighbors found

Implements pcl::search::Search< PointT >.

Definition at line 210 of file organized.hpp.

template<typename PointT >
int pcl::search::OrganizedNeighbor< PointT >::nearestKSearch ( const pcl::PointCloud< PointT > &  cloud,
int  index,
int  k,
std::vector< int > &  k_indices,
std::vector< float > &  k_distances 
)

Search for the k-nearest neighbors for a given query point.

Note:
limiting the maximum search radius (with setMaxDistance) can lead to a significant improvement in search speed
Parameters:
[in]cloudthe point cloud data
[in]indexthe index in cloud representing the query point
[in]kthe number of neighbors to search for (used only if horizontal and vertical window not given already!)
[out]k_indicesthe resultant point indices (must be resized to k beforehand!)
[out]k_distances
Note:
this function does not return distances
Returns:
number of neighbors found

Definition at line 277 of file organized.hpp.

template<typename PointT>
template<typename PointTDiff >
int pcl::search::Search< PointT >::nearestKSearchT ( const PointTDiff &  point,
int  k,
std::vector< int > &  k_indices,
std::vector< float > &  k_sqr_distances 
) [inline, inherited]

Search for the k-nearest neighbors for the given query point.

Parameters:
[in]pointthe given query point
[in]kthe number of neighbors to search for
[out]k_indicesthe resultant indices of the neighboring points (must be resized to k a priori!)
[out]k_sqr_distancesthe resultant squared distances to the neighboring points (must be resized to k a priori!)
Returns:
number of neighbors found

Definition at line 118 of file search.h.

template<typename PointT>
virtual int pcl::search::Search< PointT >::radiusSearch ( const PointCloud cloud,
int  index,
double  radius,
std::vector< int > &  k_indices,
std::vector< float > &  k_distances,
int  max_nn = -1 
) [pure virtual, inherited]

Search for all the nearest neighbors of the query point in a given radius.

Parameters:
[in]cloudthe point cloud data
[in]indexthe index in cloud representing the query point
[in]radiusthe radius of the sphere bounding all of p_q's neighbors
[out]k_indicesthe resultant indices of the neighboring points
[out]k_distancesthe resultant squared distances to the neighboring points
[in]max_nnif given, bounds the maximum returned neighbors to this value
Returns:
number of neighbors found in radius

Implemented in pcl::search::AutotunedSearch< PointT >, pcl::search::KdTree< PointT >, and pcl::search::Octree< PointT, LeafTWrap, OctreeT >.

template<typename PointT >
int pcl::search::OrganizedNeighbor< PointT >::radiusSearch ( int  index,
double  radius,
std::vector< int > &  k_indices,
std::vector< float > &  k_distances,
int  max_nn = INT_MAX 
) const [virtual]

Approximate search for neighbors around the given query point within radius.

Parameters:
[in]indexthe index representing the query point in the dataset (setInputCloud must be given a-priori!)
[in]radiusthe maximum distance to search for neighbors in.
[out]k_indicesthe resultant point indices
[out]k_distancesthe resultant !squared! point distances
[in]max_nnmaximum number of points to return

Implements pcl::search::Search< PointT >.

Definition at line 125 of file organized.hpp.

template<typename PointT >
int pcl::search::OrganizedNeighbor< PointT >::radiusSearch ( const pcl::PointCloud< PointT > &  cloud,
int  index,
double  radius,
std::vector< int > &  k_indices,
std::vector< float > &  k_distances,
int  max_nn = INT_MAX 
)

Approximate search for neighbors around the given query point within radius.

Parameters:
[in]cloudthe point cloud data.
[in]indexthe index in cloud representing the query point.
[in]radiusthe maximum distance to search for neighbors in.
[out]k_indicesthe resultant point indices
[out]k_distancesthe resultant !squared! point distances
[in]max_nnmaximum number of points to return

Definition at line 47 of file organized.hpp.

template<typename PointT >
int pcl::search::OrganizedNeighbor< PointT >::radiusSearch ( const PointT &  p_q,
double  radius,
std::vector< int > &  k_indices,
std::vector< float > &  k_distances,
int  max_nn = INT_MAX 
) const [inline, virtual]

Approximate search for neighbors around the given query point within radius.

Parameters:
[in]pointthe given query point
[in]radiusthe maximum distance to search for neighbors in.
[out]k_indicesthe resultant point indices
[out]k_distancesthe resultant !squared! point distances
[in]max_nnmaximum number of points to return

Implements pcl::search::Search< PointT >.

Definition at line 220 of file organized.h.

template<typename PointT>
template<typename PointTDiff >
int pcl::search::Search< PointT >::radiusSearchT ( const PointTDiff &  point,
double  radius,
std::vector< int > &  k_indices,
std::vector< float > &  k_distances,
int  max_nn = -1 
) [inline, inherited]

Search for all the nearest neighbors of the query point in a given radius.

Parameters:
[in]pointthe given query point
[in]radiusthe radius of the sphere bounding all of p_q's neighbors
[out]k_indicesthe resultant indices of the neighboring points
[out]k_distancesthe resultant squared distances to the neighboring points
[in]max_nnif given, bounds the maximum returned neighbors to this value
Returns:
number of neighbors found in radius

Definition at line 177 of file search.h.

template<typename PointT>
virtual void pcl::search::Search< PointT >::setInputCloud ( const PointCloudConstPtr cloud) [pure virtual, inherited]

Pass the input dataset that the search will be performed on.

Parameters:
[in]clouda const pointer to the PointCloud data

Implemented in pcl::search::KdTree< PointT >.

template<typename PointT>
virtual void pcl::search::Search< PointT >::setInputCloud ( const PointCloudConstPtr cloud,
const IndicesConstPtr indices 
) [inline, virtual, inherited]

Pass the input dataset that the search will be performed on.

Parameters:
[in]clouda const pointer to the PointCloud data
[in]indicesthe point indices subset that is to be used from the cloud

Reimplemented in pcl::search::KdTree< PointT >.

Definition at line 81 of file search.h.

template<typename PointT >
void pcl::search::OrganizedNeighbor< PointT >::setInputCloud ( const PointCloudConstPtr &  cloud) [inline]

Provide a pointer to the input data set.

Parameters:
cloudthe const boost shared pointer to a PointCloud message

Definition at line 88 of file organized.h.

template<typename PointT >
void pcl::search::OrganizedNeighbor< PointT >::setMaxDistance ( double  max_dist) [inline]

Set the maximum allowed distance between the query point and its nearest neighbors.

Definition at line 110 of file organized.h.

template<typename PointT >
void pcl::search::OrganizedNeighbor< PointT >::setSearchWindow ( int  horizontal,
int  vertical 
) [inline]

set the search window (horizontal, vertical) in pixels.

Parameters:
horizontalthe horizontal window in pixel
verticalthe vertical window in pixel

Definition at line 120 of file organized.h.

template<typename PointT >
void pcl::search::OrganizedNeighbor< PointT >::setSearchWindowAsK ( int  k)

Estimate the search window (horizontal, vertical) in pixels in order to get up to k-neighbors.

Parameters:
kthe number of neighbors requested

Definition at line 339 of file organized.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines