NearestNeighborsGraphBuilder< PointT, GraphT > Class Template Reference

This class builds a point cloud graph representing an input dataset by using nearest neighbor search. More...

#include <VisionX/libraries/PointCloudGraph/nearest_neighbors_graph_builder.h>

+ Inheritance diagram for NearestNeighborsGraphBuilder< PointT, GraphT >:

Public Types

typedef pcl::search::Search< PointOutTSearch
 
typedef Search::Ptr SearchPtr
 
- Public Types inherited from GraphBuilder< PointT, GraphT >
typedef PointT PointInT
 Type of points in the input cloud. More...
 
typedef point_cloud_graph_traits< GraphT >::point_type PointOutT
 Type of points in the output graph. More...
 
typedef boost::shared_ptr< GraphBuilder< PointT, GraphT > > Ptr
 
typedef boost::graph_traits< GraphT >::vertex_descriptor VertexId
 

Public Member Functions

virtual void compute (GraphT &graph)
 Build a graph based on the provided input data. More...
 
size_t getNumberOfNeighbors () const
 Returns the number of neighbors to find when building a graph. More...
 
SearchPtr getSearchMethod () const
 Get the search method used for finding nearest neighbors when building a graph. More...
 
 NearestNeighborsGraphBuilder (size_t num_neighbors=14)
 Constructor. More...
 
void setNumberOfNeighbors (size_t num_neighbors)
 Set the number of neighbors to find when building a graph. More...
 
void setSearchMethod (const SearchPtr &search)
 Set search method that will be used for finding K nearest neighbors when building a graph. More...
 
- Public Member Functions inherited from GraphBuilder< PointT, GraphT >
const std::vector< VertexId > & getPointToVertexMap () const
 Get a mapping between points in the input cloud and the vertices in the output graph. More...
 

Additional Inherited Members

- Protected Attributes inherited from GraphBuilder< PointT, GraphT >
std::vector< VertexIdpoint_to_vertex_map_
 

Detailed Description

template<typename PointT, typename GraphT>
class pcl::graph::NearestNeighborsGraphBuilder< PointT, GraphT >

This class builds a point cloud graph representing an input dataset by using nearest neighbor search.

The points from the input cloud become vertices and the edges are established between each point and its neighbors (as found by the search object provided with setSearchMethod()). The user may choose to use the default search method, which will be either KdTree or OrganizedNeighbor depending on whether the input point cloud is organized or not.

The data contained in the points of the input cloud will be copied inside the vertices of the newly created graph. Note that the points in the input cloud and the output graph may have different types, in which case only the intersecting fields will be copied over.

For additional information see documentation for GraphBuilder.

Author
Sergey Alexandrov

Definition at line 67 of file nearest_neighbors_graph_builder.h.

Member Typedef Documentation

◆ Search

typedef pcl::search::Search<PointOutT> Search

Definition at line 84 of file nearest_neighbors_graph_builder.h.

◆ SearchPtr

typedef Search::Ptr SearchPtr

Definition at line 85 of file nearest_neighbors_graph_builder.h.

Constructor & Destructor Documentation

◆ NearestNeighborsGraphBuilder()

NearestNeighborsGraphBuilder ( size_t  num_neighbors = 14)
inline

Constructor.

Parameters
[in]num_neighborsnumber of neighbors to find when building a graph (default: 14)

Definition at line 91 of file nearest_neighbors_graph_builder.h.

Member Function Documentation

◆ compute()

void compute ( GraphT &  graph)
virtual

Build a graph based on the provided input data.

Implements GraphBuilder< PointT, GraphT >.

Definition at line 50 of file nearest_neighbors_graph_builder.hpp.

+ Here is the call graph for this function:

◆ getNumberOfNeighbors()

size_t getNumberOfNeighbors ( ) const
inline

Returns the number of neighbors to find when building a graph.

Definition at line 124 of file nearest_neighbors_graph_builder.h.

◆ getSearchMethod()

SearchPtr getSearchMethod ( ) const
inline

Get the search method used for finding nearest neighbors when building a graph.

Definition at line 110 of file nearest_neighbors_graph_builder.h.

◆ setNumberOfNeighbors()

void setNumberOfNeighbors ( size_t  num_neighbors)
inline

Set the number of neighbors to find when building a graph.

Definition at line 117 of file nearest_neighbors_graph_builder.h.

◆ setSearchMethod()

void setSearchMethod ( const SearchPtr search)
inline

Set search method that will be used for finding K nearest neighbors when building a graph.

Definition at line 102 of file nearest_neighbors_graph_builder.h.


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