NASA Astrobee Robot Software  0.19.1
Flight software for the Astrobee robots operating inside the International Space Station.
pcl::search::OrganizedNeighbor2< PointT > Class Template Reference

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

#include <organized_neighbor2.h>

Inheritance diagram for pcl::search::OrganizedNeighbor2< PointT >:
Inheritance graph

Classes

struct  Entry
 

Public Types

typedef pcl::PointCloud< PointT > PointCloud
 
typedef boost::shared_ptr< PointCloudPointCloudPtr
 
typedef boost::shared_ptr< const PointCloudPointCloudConstPtr
 
typedef boost::shared_ptr< const std::vector< int > > IndicesConstPtr
 
typedef boost::shared_ptr< pcl::search::OrganizedNeighbor2< PointT > > Ptr
 
typedef boost::shared_ptr< const pcl::search::OrganizedNeighbor2< PointT > > ConstPtr
 

Public Member Functions

 OrganizedNeighbor2 (bool sorted_results=false)
 Constructor. More...
 
virtual ~OrganizedNeighbor2 ()
 Empty deconstructor. More...
 
virtual void setInputCloud (const PointCloudConstPtr &cloud, const IndicesConstPtr &indices=IndicesConstPtr())
 Provide a pointer to the input data set, if user has focal length he must set it before calling this. More...
 
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
 Search for all neighbors of query point that are within a given radius. More...
 
int nearestKSearch (const PointT &p_q, int k, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances) const
 Search for the k-nearest neighbors for a given query point. More...
 
Eigen::Vector2f projectPoint (const Eigen::Vector3f &p) const
 projects a point into the image More...
 
void setIntrinsicsMatrix (const Eigen::Matrix3d &intrinsics_matrix)
 

Protected Member Functions

bool testPoint (const PointT &query, unsigned k, std::priority_queue< Entry > &queue, unsigned index) const
 test if point given by index is among the k NN in results to the query point. More...
 
void clipRange (int &begin, int &end, int min, int max) const
 
void getProjectedRadiusSearchBox (const PointT &point, float squared_radius, unsigned &minX, unsigned &minY, unsigned &maxX, unsigned &maxY) const
 Obtain a search box in 2D from a sphere with a radius in 3D. More...
 

Protected Attributes

Eigen::Matrix3f intrinsics_matrix_
 the intrinsics matrix. More...
 
Eigen::Matrix3f KR_KRT_
 
std::vector< unsigned char > mask_
 mask, indicating whether the point was in the indices list or not. More...
 

Detailed Description

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

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

Author
Radu B. Rusu, Julius Kammerl, Suat Gedikli, Koen Buys

Member Typedef Documentation

◆ ConstPtr

template<typename PointT >
typedef boost::shared_ptr<const pcl::search::OrganizedNeighbor2<PointT> > pcl::search::OrganizedNeighbor2< PointT >::ConstPtr

◆ IndicesConstPtr

template<typename PointT >
typedef boost::shared_ptr<const std::vector<int> > pcl::search::OrganizedNeighbor2< PointT >::IndicesConstPtr

◆ PointCloud

template<typename PointT >
typedef pcl::PointCloud<PointT> pcl::search::OrganizedNeighbor2< PointT >::PointCloud

◆ PointCloudConstPtr

template<typename PointT >
typedef boost::shared_ptr<const PointCloud> pcl::search::OrganizedNeighbor2< PointT >::PointCloudConstPtr

◆ PointCloudPtr

template<typename PointT >
typedef boost::shared_ptr<PointCloud> pcl::search::OrganizedNeighbor2< PointT >::PointCloudPtr

◆ Ptr

template<typename PointT >
typedef boost::shared_ptr<pcl::search::OrganizedNeighbor2<PointT> > pcl::search::OrganizedNeighbor2< PointT >::Ptr

Constructor & Destructor Documentation

◆ OrganizedNeighbor2()

template<typename PointT >
pcl::search::OrganizedNeighbor2< PointT >::OrganizedNeighbor2 ( bool  sorted_results = false)
inlineexplicit

Constructor.

Parameters
[in]sorted_resultswhether the results should be return sorted in ascending order on the distances or not. This applies only for radius search, since knn always returns sorted resutls

◆ ~OrganizedNeighbor2()

template<typename PointT >
virtual pcl::search::OrganizedNeighbor2< PointT >::~OrganizedNeighbor2 ( )
inlinevirtual

Empty deconstructor.

Member Function Documentation

◆ clipRange()

template<typename PointT >
void pcl::search::OrganizedNeighbor2< PointT >::clipRange ( int &  begin,
int &  end,
int  min,
int  max 
) const
inlineprotected

◆ getProjectedRadiusSearchBox()

template<typename PointT >
void pcl::search::OrganizedNeighbor2< PointT >::getProjectedRadiusSearchBox ( const PointT &  point,
float  squared_radius,
unsigned &  minX,
unsigned &  minY,
unsigned &  maxX,
unsigned &  maxY 
) const
protected

Obtain a search box in 2D from a sphere with a radius in 3D.

Parameters
[in]pointthe query point (sphere center)
[in]squared_radiusthe squared sphere radius
[out]minXthe min X box coordinate
[out]minYthe min Y box coordinate
[out]maxXthe max X box coordinate
[out]maxYthe max Y box coordinate

◆ nearestKSearch()

template<typename PointT >
int pcl::search::OrganizedNeighbor2< PointT >::nearestKSearch ( const PointT &  p_q,
int  k,
std::vector< int > &  k_indices,
std::vector< float > &  k_sqr_distances 
) const

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_sqr_distances
Note
this function does not return distances
Returns
number of neighbors found

◆ projectPoint()

template<typename PointT >
Eigen::Vector2f pcl::search::OrganizedNeighbor2< PointT >::projectPoint ( const Eigen::Vector3f &  p) const

projects a point into the image

Parameters
[in]ppoint in 3D World Coordinate Frame to be projected onto the image plane
Returns
The 2D projected point in pixel coordinates (u,v)

◆ radiusSearch()

template<typename PointT >
int pcl::search::OrganizedNeighbor2< PointT >::radiusSearch ( const PointT &  p_q,
double  radius,
std::vector< int > &  k_indices,
std::vector< float > &  k_sqr_distances,
unsigned int  max_nn = 0 
) const

Search for all neighbors of query point that are within a given radius.

Parameters
[in]p_qthe 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_sqr_distancesthe resultant squared distances to the neighboring points
[in]max_nnif given, bounds the maximum returned neighbors to this value. If max_nn is set to 0 or to a number higher than the number of points in the input cloud, all neighbors in radius will be returned.
Returns
number of neighbors found in radius

◆ setInputCloud()

template<typename PointT >
virtual void pcl::search::OrganizedNeighbor2< PointT >::setInputCloud ( const PointCloudConstPtr cloud,
const IndicesConstPtr indices = IndicesConstPtr() 
)
inlinevirtual

Provide a pointer to the input data set, if user has focal length he must set it before calling this.

Parameters
[in]cloudthe const boost shared pointer to a PointCloud message
[in]indicesthe const boost shared pointer to PointIndices

◆ setIntrinsicsMatrix()

template<typename PointT >
void pcl::search::OrganizedNeighbor2< PointT >::setIntrinsicsMatrix ( const Eigen::Matrix3d &  intrinsics_matrix)
inline

◆ testPoint()

template<typename PointT >
bool pcl::search::OrganizedNeighbor2< PointT >::testPoint ( const PointT &  query,
unsigned  k,
std::priority_queue< Entry > &  queue,
unsigned  index 
) const
inlineprotected

test if point given by index is among the k NN in results to the query point.

Parameters
[in]queryquery point
[in]knumber of maximum nn interested in
[in]queuepriority queue with k NN
[in]indexindex on point to be tested
Returns
wheter the top element changed or not.

Member Data Documentation

◆ intrinsics_matrix_

template<typename PointT >
Eigen::Matrix3f pcl::search::OrganizedNeighbor2< PointT >::intrinsics_matrix_
protected

the intrinsics matrix.

◆ KR_KRT_

template<typename PointT >
Eigen::Matrix3f pcl::search::OrganizedNeighbor2< PointT >::KR_KRT_
protected

◆ mask_

template<typename PointT >
std::vector<unsigned char> pcl::search::OrganizedNeighbor2< PointT >::mask_
protected

mask, indicating whether the point was in the indices list or not.


The documentation for this class was generated from the following files: