Loading...
Searching...
No Matches
pcl::VoxelGridCovariance< PointT > Class Template Reference

A searchable voxel structure containing the mean and covariance of the data. More...

`#include <pcl/filters/voxel_grid_covariance.h>`

Inheritance diagram for pcl::VoxelGridCovariance< PointT >:

## Classes

struct | Leaf
| Simple structure to hold a centroid, covarince and the number of points in a leaf. More...

## Public Types

using | Ptr = shared_ptr< VoxelGrid< PointT > >
using | ConstPtr = shared_ptr< const VoxelGrid< PointT > >
using | LeafPtr = Leaf *
| Pointer to VoxelGridCovariance leaf structure.
using | LeafConstPtr = const Leaf *
| Const pointer to VoxelGridCovariance leaf structure.
Public Types inherited from pcl::VoxelGrid< PointT >
using | Ptr = shared_ptr< VoxelGrid< PointT > >
using | ConstPtr = shared_ptr< const VoxelGrid< PointT > >
Public Types inherited from pcl::Filter< PointT >
using | Ptr = shared_ptr< Filter< PointT > >
using | ConstPtr = shared_ptr< const Filter< PointT > >
using | PointCloud = pcl::PointCloud< PointT >
using | PointCloudPtr = typename PointCloud::Ptr
using | PointCloudConstPtr = typename PointCloud::ConstPtr
Public Types inherited from pcl::PCLBase< PointT >
using | PointCloud = pcl::PointCloud< PointT >
using | PointCloudPtr = typename PointCloud::Ptr
using | PointCloudConstPtr = typename PointCloud::ConstPtr
using | PointIndicesPtr = PointIndices::Ptr
using | PointIndicesConstPtr = PointIndices::ConstPtr

## Public Member Functions

| VoxelGridCovariance ()
| Constructor.
void | setMinPointPerVoxel (int min_points_per_voxel)
| Set the minimum number of points required for a cell to be used (must be 3 or greater for covariance calculation).
int | getMinPointPerVoxel ()
| Get the minimum number of points required for a cell to be used.
void | setCovEigValueInflationRatio (double min_covar_eigvalue_mult)
| Set the minimum allowable ratio between eigenvalues to prevent singular covariance matrices.
double | getCovEigValueInflationRatio ()
| Get the minimum allowable ratio between eigenvalues to prevent singular covariance matrices.
void | filter (PointCloud &output, bool searchable=false)
| Filter cloud and initializes voxel structure.
void | filter (bool searchable=false)
| Initializes voxel structure.
LeafConstPtr | getLeaf (int index)
| Get the voxel containing point p.
LeafConstPtr | getLeaf (PointT &p)
| Get the voxel containing point p.
LeafConstPtr | getLeaf (Eigen::Vector3f &p)
| Get the voxel containing point p.
int | getNeighborhoodAtPoint (const Eigen::Matrix< int, 3, Eigen::Dynamic > &relative_coordinates, const PointT &reference_point, std::vector< LeafConstPtr > &neighbors) const
| Get the voxels surrounding point p designated by `relative_coordinates`.
int | getNeighborhoodAtPoint (const PointT &reference_point, std::vector< LeafConstPtr > &neighbors) const
| Get the voxels surrounding point p, not including the voxel containing point p.
int | getVoxelAtPoint (const PointT &reference_point, std::vector< LeafConstPtr > &neighbors) const
| Get the voxel at p.
int | getFaceNeighborsAtPoint (const PointT &reference_point, std::vector< LeafConstPtr > &neighbors) const
| Get the voxel at p and its facing voxels (up to 7 voxels).
int | getAllNeighborsAtPoint (const PointT &reference_point, std::vector< LeafConstPtr > &neighbors) const
| Get all 3x3x3 neighbor voxels of p (up to 27 voxels).
const std::map< std::size_t, Leaf > & | getLeaves ()
| Get the leaf structure map.
PointCloudPtr | getCentroids ()
| Get a pointcloud containing the voxel centroids.
void | getDisplayCloud (pcl::PointCloud< PointXYZ > &cell_cloud, int pnt_per_cell=1000) const
| Get a cloud to visualize each voxels normal distribution.
int | nearestKSearch (const PointT &point, int k, std::vector< LeafConstPtr > &k_leaves, std::vector< float > &k_sqr_distances) const
| Search for the k-nearest occupied voxels for the given query point.
int | nearestKSearch (const PointCloud &cloud, int index, int k, std::vector< LeafConstPtr > &k_leaves, std::vector< float > &k_sqr_distances) const
| Search for the k-nearest occupied voxels for the given query point.
int | radiusSearch (const PointT &point, double radius, std::vector< LeafConstPtr > &k_leaves, std::vector< float > &k_sqr_distances, unsigned int max_nn=0) const
| Search for all the nearest occupied voxels of the query point in a given radius.
int | radiusSearch (const PointCloud &cloud, int index, double radius, std::vector< LeafConstPtr > &k_leaves, std::vector< float > &k_sqr_distances, unsigned int max_nn=0) const
| Search for all the nearest occupied voxels of the query point in a given radius.
Public Member Functions inherited from pcl::VoxelGrid< PointT >
PCL_MAKE_ALIGNED_OPERATOR_NEW | VoxelGrid ()
| Empty constructor.
| ~VoxelGrid () override=default
| Destructor.
void | setLeafSize (const Eigen::Vector4f &leaf_size)
| Set the voxel grid leaf size.
void | setLeafSize (float lx, float ly, float lz)
| Set the voxel grid leaf size.
Eigen::Vector3f | getLeafSize () const
| Get the voxel grid leaf size.
void | setDownsampleAllData (bool downsample)
| Set to true if all fields need to be downsampled, or false if just XYZ.
bool | getDownsampleAllData () const
| Get the state of the internal downsampling parameter (true if all fields need to be downsampled, false if just XYZ).
void | setMinimumPointsNumberPerVoxel (unsigned int min_points_per_voxel)
| Set the minimum number of points required for a voxel to be used.
unsigned int | getMinimumPointsNumberPerVoxel () const
| Return the minimum number of points required for a voxel to be used.
void | setSaveLeafLayout (bool save_leaf_layout)
| Set to true if leaf layout information needs to be saved for later access.
bool | getSaveLeafLayout () const
| Returns true if leaf layout information will to be saved for later access.
Eigen::Vector3i | getMinBoxCoordinates () const
| Get the minimum coordinates of the bounding box (after filtering is performed).
Eigen::Vector3i | getMaxBoxCoordinates () const
| Get the minimum coordinates of the bounding box (after filtering is performed).
Eigen::Vector3i | getNrDivisions () const
| Get the number of divisions along all 3 axes (after filtering is performed).
Eigen::Vector3i | getDivisionMultiplier () const
| Get the multipliers to be applied to the grid coordinates in order to find the centroid index (after filtering is performed).
int | getCentroidIndex (const PointT &p) const
| Returns the index in the resulting downsampled cloud of the specified point.
std::vector< int > | getNeighborCentroidIndices (const PointT &reference_point, const Eigen::MatrixXi &relative_coordinates) const
| Returns the indices in the resulting downsampled cloud of the points at the specified grid coordinates, relative to the grid coordinates of the specified point (or -1 if the cell was empty/out of bounds).
std::vector< int > | getLeafLayout () const
| Returns the layout of the leafs for fast access to cells relative to current position.
Eigen::Vector3i | getGridCoordinates (float x, float y, float z) const
| Returns the corresponding (i,j,k) coordinates in the grid of point (x,y,z).
int | getCentroidIndexAt (const Eigen::Vector3i &ijk) const
| Returns the index in the downsampled cloud corresponding to a given set of coordinates.
void | setFilterFieldName (const std::string &field_name)
| Provide the name of the field to be used for filtering data.
std::string const | getFilterFieldName () const
| Get the name of the field used for filtering.
void | setFilterLimits (const double &limit_min, const double &limit_max)
| Set the field filter limits.
void | getFilterLimits (double &limit_min, double &limit_max) const
| Get the field filter limits (min/max) set by the user.
void | setFilterLimitsNegative (const bool limit_negative)
| Set to true if we want to return the data outside the interval specified by setFilterLimits (min, max).
void | getFilterLimitsNegative (bool &limit_negative) const
| Get whether the data outside the interval (min/max) is to be returned (true) or inside (false).
bool | getFilterLimitsNegative () const
| Get whether the data outside the interval (min/max) is to be returned (true) or inside (false).
Public Member Functions inherited from pcl::Filter< PointT >
| Filter (bool extract_removed_indices=false)
| Empty constructor.
IndicesConstPtr const | getRemovedIndices () const
| Get the point indices being removed.
void | getRemovedIndices (PointIndices &pi)
| Get the point indices being removed.
void | filter (PointCloud &output)
| Calls the filtering method and returns the filtered dataset in output.
Public Member Functions inherited from pcl::PCLBase< PointT >
| PCLBase ()
| Empty constructor.
| PCLBase (const PCLBase &base)
| Copy constructor.
virtual | ~PCLBase ()=default
| Destructor.
virtual void | setInputCloud (const PointCloudConstPtr &cloud)
| Provide a pointer to the input dataset.
PointCloudConstPtr const | getInputCloud () const
| Get a pointer to the input point cloud dataset.
virtual void | setIndices (const IndicesPtr &indices)
| Provide a pointer to the vector of indices that represents the input data.
virtual void | setIndices (const IndicesConstPtr &indices)
| Provide a pointer to the vector of indices that represents the input data.
virtual void | setIndices (const PointIndicesConstPtr &indices)
| Provide a pointer to the vector of indices that represents the input data.
virtual void | setIndices (std::size_t row_start, std::size_t col_start, std::size_t nb_rows, std::size_t nb_cols)
| Set the indices for the points laying within an interest region of the point cloud.
IndicesPtr | getIndices ()
| Get a pointer to the vector of indices used.
IndicesConstPtr const | getIndices () const
| Get a pointer to the vector of indices used.
const PointT & | operator[] (std::size_t pos) const
| Override PointCloud operator[] to shorten code.

## Protected Types

using | FieldList = typename pcl::traits::fieldList< PointT >::type
using | PointCloud = typename Filter< PointT >::PointCloud
using | PointCloudPtr = typename PointCloud::Ptr
using | PointCloudConstPtr = typename PointCloud::ConstPtr
Protected Types inherited from pcl::VoxelGrid< PointT >
using | PointCloud = typename Filter< PointT >::PointCloud
using | PointCloudPtr = typename PointCloud::Ptr
using | PointCloudConstPtr = typename PointCloud::ConstPtr
using | FieldList = typename pcl::traits::fieldList< PointT >::type

## Protected Member Functions

void | applyFilter (PointCloud &output) override
| Filter cloud and initializes voxel structure.
Protected Member Functions inherited from pcl::Filter< PointT >
const std::string & | getClassName () const
| Get a string representation of the name of this class.
Protected Member Functions inherited from pcl::PCLBase< PointT >
bool | initCompute ()
| This method should get called before starting the actual computation.
bool | deinitCompute ()
| This method should get called after finishing the actual computation.

## Protected Attributes

bool | searchable_ {true}
| Flag to determine if voxel structure is searchable.
int | min_points_per_voxel_ {6}
| Minimum points contained with in a voxel to allow it to be usable.
double | min_covar_eigvalue_mult_ {0.01}
| Minimum allowable ratio between eigenvalues to prevent singular covariance matrices.
std::map< std::size_t, Leaf > | leaves_
| Voxel structure containing all leaf nodes (includes voxels with less than a sufficient number of points).
PointCloudPtr | voxel_centroids_
| Point cloud containing centroids of voxels containing atleast minimum number of points.
std::vector< int > | voxel_centroids_leaf_indices_
| Indices of leaf structures associated with each point in voxel_centroids_ (used for searching).
KdTreeFLANN< PointT > | kdtree_
| KdTree generated using voxel_centroids_ (used for searching).
Protected Attributes inherited from pcl::VoxelGrid< PointT >
Eigen::Vector4f | leaf_size_
| The size of a leaf.
Eigen::Array4f | inverse_leaf_size_
| Internal leaf sizes stored as 1/leaf_size_ for efficiency reasons.
bool | downsample_all_data_ {true}
| Set to true if all fields need to be downsampled, or false if just XYZ.
bool | save_leaf_layout_ {false}
| Set to true if leaf layout information needs to be saved in leaf_layout_.
std::vector< int > | leaf_layout_
| The leaf layout information for fast access to cells relative to current position.
Eigen::Vector4i | min_b_
| The minimum and maximum bin coordinates, the number of divisions, and the division multiplier.
Eigen::Vector4i | max_b_
Eigen::Vector4i | div_b_
Eigen::Vector4i | divb_mul_
std::string | filter_field_name_
| The desired user filter field name.
double | filter_limit_min_ {std::numeric_limits<float>::lowest()}
| The minimum allowed filter value a point will be considered from.
double | filter_limit_max_ {std::numeric_limits<float>::max()}
| The maximum allowed filter value a point will be considered from.
bool | filter_limit_negative_ {false}
| Set to true if we want to return the data outside (filter_limit_min_;filter_limit_max_).
unsigned int | min_points_per_voxel_ {0}
| Minimum number of points per voxel for the centroid to be computed.
Protected Attributes inherited from pcl::Filter< PointT >
IndicesPtr | removed_indices_
| Indices of the points that are removed.
std::string | filter_name_
| The filter name.
bool | extract_removed_indices_
| Set to true if we want to return the indices of the removed points.
Protected Attributes inherited from pcl::PCLBase< PointT >
PointCloudConstPtr | input_
| The input point cloud dataset.
IndicesPtr | indices_
| A pointer to the vector of point indices to use.
bool | use_indices_
| Set to true if point indices are used.
bool | fake_indices_
| If no set of indices are given, we construct a set of fake indices that mimic the input PointCloud.

## Detailed Description

template<typename PointT>
class pcl::VoxelGridCovariance< PointT >

A searchable voxel structure containing the mean and covariance of the data.

Note
  For more information please see Magnusson, M. (2009). The Three-Dimensional Normal-Distributions Transform — an Efﬁcient Representation for Registration, Surface Analysis, and Loop Detection. PhD thesis, Orebro University. Orebro Studies in Technology 36

Author
  Brian Okorn (Space and Naval Warfare Systems Center Pacific)

Definition at line 55 of file voxel_grid_covariance.h.

## Member Typedef Documentation

## ConstPtr

template<typename PointT >

using pcl::VoxelGridCovariance< PointT >::ConstPtr = shared_ptr<const VoxelGrid<PointT> >

Definition at line 86 of file voxel_grid_covariance.h.

## FieldList

template<typename PointT >

using pcl::VoxelGridCovariance< PointT >::FieldList = typename pcl::traits::fieldList<PointT>::type

protected

Definition at line 78 of file voxel_grid_covariance.h.

## LeafConstPtr

template<typename PointT >

using pcl::VoxelGridCovariance< PointT >::LeafConstPtr = const Leaf *

Const pointer to VoxelGridCovariance leaf structure.

Definition at line 190 of file voxel_grid_covariance.h.

## LeafPtr

template<typename PointT >

using pcl::VoxelGridCovariance< PointT >::LeafPtr = Leaf *

Pointer to VoxelGridCovariance leaf structure.

Definition at line 187 of file voxel_grid_covariance.h.

## PointCloud

template<typename PointT >

using pcl::VoxelGridCovariance< PointT >::PointCloud = typename Filter<PointT>::PointCloud

protected

Definition at line 79 of file voxel_grid_covariance.h.

## PointCloudConstPtr

template<typename PointT >

using pcl::VoxelGridCovariance< PointT >::PointCloudConstPtr = typename PointCloud::ConstPtr

protected

Definition at line 81 of file voxel_grid_covariance.h.

## PointCloudPtr

template<typename PointT >

using pcl::VoxelGridCovariance< PointT >::PointCloudPtr = typename PointCloud::Ptr

protected

Definition at line 80 of file voxel_grid_covariance.h.

## Ptr

template<typename PointT >

using pcl::VoxelGridCovariance< PointT >::Ptr = shared_ptr<VoxelGrid<PointT> >

Definition at line 85 of file voxel_grid_covariance.h.

## Constructor & Destructor Documentation

## VoxelGridCovariance()

template<typename PointT >

pcl::VoxelGridCovariance< PointT >::VoxelGridCovariance | ( |  | ) |

inline

Constructor.

Sets leaf_size_ to 0 and searchable_ to false.

Definition at line 197 of file voxel_grid_covariance.h.

References pcl::VoxelGrid< PointT >::downsample_all_data_, pcl::Filter< PointT >::filter_name_, pcl::VoxelGrid< PointT >::leaf_size_, pcl::VoxelGrid< PointT >::max_b_, pcl::VoxelGrid< PointT >::min_b_, and pcl::VoxelGrid< PointT >::save_leaf_layout_.

## Member Function Documentation

## applyFilter()

template<typename PointT >

void pcl::VoxelGridCovariance< PointT >::applyFilter | ( | PointCloud & | output | ) |

override protected virtual

Filter cloud and initializes voxel structure.

Parameters

  [out] | output | cloud containing centroids of voxels containing a sufficient number of points

Reimplemented from pcl::VoxelGrid< PointT >.

Definition at line 53 of file voxel_grid_covariance.hpp.

References pcl::VoxelGridCovariance< PointT >::Leaf::centroid, pcl::VoxelGridCovariance< PointT >::Leaf::cov_, pcl::VoxelGridCovariance< PointT >::Leaf::evals_, pcl::VoxelGridCovariance< PointT >::Leaf::evecs_, pcl::VoxelGridCovariance< PointT >::Leaf::icov_, pcl::isXYZFinite(), pcl::VoxelGridCovariance< PointT >::Leaf::mean_, and pcl::VoxelGridCovariance< PointT >::Leaf::nr_points.

Referenced by pcl::VoxelGridCovariance< PointT >::filter(), and pcl::VoxelGridCovariance< PointT >::filter().

## filter() [1/2]

template<typename PointT >

void pcl::VoxelGridCovariance< PointT >::filter | ( | bool | searchable = `false` | ) |

inline

Initializes voxel structure.

Parameters

  [in] | searchable | flag if voxel structure is searchable, if true then kdtree is built

Definition at line 282 of file voxel_grid_covariance.h.

References pcl::VoxelGridCovariance< PointT >::applyFilter(), pcl::Filter< PointT >::getClassName(), pcl::VoxelGridCovariance< PointT >::kdtree_, pcl::VoxelGridCovariance< PointT >::searchable_, and pcl::VoxelGridCovariance< PointT >::voxel_centroids_.

## filter() [2/2]

template<typename PointT >

void pcl::VoxelGridCovariance< PointT >::filter | ( | PointCloud & | output,
|  | bool | searchable = `false`
| ) |  |

inline

Filter cloud and initializes voxel structure.

Parameters

  [out] | output | cloud containing centroids of voxels containing a sufficient number of points
  [in] | searchable | flag if voxel structure is searchable, if true then kdtree is built

Definition at line 259 of file voxel_grid_covariance.h.

References pcl::VoxelGridCovariance< PointT >::applyFilter(), pcl::Filter< PointT >::getClassName(), pcl::VoxelGridCovariance< PointT >::kdtree_, pcl::VoxelGridCovariance< PointT >::searchable_, and pcl::VoxelGridCovariance< PointT >::voxel_centroids_.

Referenced by pcl::NormalDistributionsTransform< PointSource, PointTarget, Scalar >::init().

## getAllNeighborsAtPoint()

template<typename PointT >

int pcl::VoxelGridCovariance< PointT >::getAllNeighborsAtPoint | ( | const PointT & | reference_point,
|  | std::vector< LeafConstPtr > & | neighbors
| ) |  | const

Get all 3x3x3 neighbor voxels of p (up to 27 voxels).

Note
  Only voxels containing a sufficient number of points are used.

Parameters

  [in] | reference_point | the point to get the leaf structure at
  [out] | neighbors |

Returns
  number of neighbors found (up to 27)

Definition at line 434 of file voxel_grid_covariance.hpp.

References pcl::getAllNeighborCellIndices().

## getCentroids()

template<typename PointT >

PointCloudPtr pcl::VoxelGridCovariance< PointT >::getCentroids | ( |  | ) |

inline

Get a pointcloud containing the voxel centroids.

Note
  Only voxels containing a sufficient number of points are used.

Returns
  a map contataining all leaves

Definition at line 429 of file voxel_grid_covariance.h.

References pcl::VoxelGridCovariance< PointT >::voxel_centroids_.

Referenced by pcl::NormalDistributionsTransform< PointSource, PointTarget, Scalar >::init().

## getCovEigValueInflationRatio()

template<typename PointT >

double pcl::VoxelGridCovariance< PointT >::getCovEigValueInflationRatio | ( |  | ) |

inline

Get the minimum allowable ratio between eigenvalues to prevent singular covariance matrices.

Returns
  the minimum allowable ratio between eigenvalues

Definition at line 249 of file voxel_grid_covariance.h.

References pcl::VoxelGridCovariance< PointT >::min_covar_eigvalue_mult_.

## getDisplayCloud()

template<typename PointT >

void pcl::VoxelGridCovariance< PointT >::getDisplayCloud | ( | pcl::PointCloud< PointXYZ > & | cell_cloud,
|  | int | pnt_per_cell = `1000`
| ) |  | const

Get a cloud to visualize each voxels normal distribution.

Parameters

  [out] | cell_cloud | a cloud created by sampling the normal distributions of each voxel
  [in] | pnt_per_cell | how many points should be generated for each cell

Definition at line 445 of file voxel_grid_covariance.hpp.

References pcl::PointCloud< PointT >::clear(), pcl::VoxelGridCovariance< PointT >::Leaf::cov_, pcl::VoxelGridCovariance< PointT >::Leaf::mean_, pcl::VoxelGridCovariance< PointT >::Leaf::nr_points, pcl::PointCloud< PointT >::push_back(), and pcl::PointCloud< PointT >::reserve().

## getFaceNeighborsAtPoint()

template<typename PointT >

int pcl::VoxelGridCovariance< PointT >::getFaceNeighborsAtPoint | ( | const PointT & | reference_point,
|  | std::vector< LeafConstPtr > & | neighbors
| ) |  | const

Get the voxel at p and its facing voxels (up to 7 voxels).

Note
  Only voxels containing a sufficient number of points are used.

Parameters

  [in] | reference_point | the point to get the leaf structure at
  [out] | neighbors |

Returns
  number of neighbors found (up to 7)

Definition at line 418 of file voxel_grid_covariance.hpp.

## getLeaf() [1/3]

template<typename PointT >

LeafConstPtr pcl::VoxelGridCovariance< PointT >::getLeaf | ( | Eigen::Vector3f & | p | ) |

inline

Get the voxel containing point p.

Parameters

  [in] | p | the point to get the leaf structure at

Returns
  const pointer to leaf structure

Definition at line 347 of file voxel_grid_covariance.h.

References pcl::VoxelGrid< PointT >::divb_mul_, pcl::VoxelGrid< PointT >::inverse_leaf_size_, pcl::VoxelGridCovariance< PointT >::leaves_, and pcl::VoxelGrid< PointT >::min_b_.

## getLeaf() [2/3]

template<typename PointT >

LeafConstPtr pcl::VoxelGridCovariance< PointT >::getLeaf | ( | int | index | ) |

inline

Get the voxel containing point p.

Parameters

  [in] | index | the index of the leaf structure node

Returns
  const pointer to leaf structure

Definition at line 305 of file voxel_grid_covariance.h.

References pcl::VoxelGridCovariance< PointT >::leaves_.

## getLeaf() [3/3]

template<typename PointT >

LeafConstPtr pcl::VoxelGridCovariance< PointT >::getLeaf | ( | PointT & | p | ) |

inline

Get the voxel containing point p.

Parameters

  [in] | p | the point to get the leaf structure at

Returns
  const pointer to leaf structure

Definition at line 321 of file voxel_grid_covariance.h.

References pcl::VoxelGrid< PointT >::divb_mul_, pcl::VoxelGrid< PointT >::inverse_leaf_size_, pcl::VoxelGridCovariance< PointT >::leaves_, and pcl::VoxelGrid< PointT >::min_b_.

## getLeaves()

template<typename PointT >

const std::map< std::size_t, Leaf > & pcl::VoxelGridCovariance< PointT >::getLeaves | ( |  | ) |

inline

Get the leaf structure map.

Returns
  a map contataining all leaves

Definition at line 419 of file voxel_grid_covariance.h.

References pcl::VoxelGridCovariance< PointT >::leaves_.

## getMinPointPerVoxel()

template<typename PointT >

int pcl::VoxelGridCovariance< PointT >::getMinPointPerVoxel | ( |  | ) |

inline

Get the minimum number of points required for a cell to be used.

Returns
  the minimum number of points for required for a voxel to be used

Definition at line 231 of file voxel_grid_covariance.h.

References pcl::VoxelGridCovariance< PointT >::min_points_per_voxel_.

## getNeighborhoodAtPoint() [1/2]

template<typename PointT >

int pcl::VoxelGridCovariance< PointT >::getNeighborhoodAtPoint | ( | const Eigen::Matrix< int, 3, Eigen::Dynamic > & | relative_coordinates,
|  | const PointT & | reference_point,
|  | std::vector< LeafConstPtr > & | neighbors
| ) |  | const

Get the voxels surrounding point p designated by `relative_coordinates`.

Note
  Only voxels containing a sufficient number of points are used.

Parameters

  [in] | relative_coordinates | 3xN matrix that represents relative coordinates of N neighboring voxels with respect to the center voxel
  [in] | reference_point | the point to get the leaf structure at
  [out] | neighbors |

Returns
  number of neighbors found

Definition at line 371 of file voxel_grid_covariance.hpp.

## getNeighborhoodAtPoint() [2/2]

template<typename PointT >

int pcl::VoxelGridCovariance< PointT >::getNeighborhoodAtPoint | ( | const PointT & | reference_point,
|  | std::vector< LeafConstPtr > & | neighbors
| ) |  | const

Get the voxels surrounding point p, not including the voxel containing point p.

Note
  Only voxels containing a sufficient number of points are used.

Parameters

  [in] | reference_point | the point to get the leaf structure at
  [out] | neighbors |

Returns
  number of neighbors found (up to 26)

Definition at line 403 of file voxel_grid_covariance.hpp.

## getVoxelAtPoint()

template<typename PointT >

int pcl::VoxelGridCovariance< PointT >::getVoxelAtPoint | ( | const PointT & | reference_point,
|  | std::vector< LeafConstPtr > & | neighbors
| ) |  | const

Get the voxel at p.

Note
  Only voxels containing a sufficient number of points are used.

Parameters

  [in] | reference_point | the point to get the leaf structure at
  [out] | neighbors |

Returns
  number of neighbors found (up to 1)

Definition at line 411 of file voxel_grid_covariance.hpp.

## nearestKSearch() [1/2]

template<typename PointT >

int pcl::VoxelGridCovariance< PointT >::nearestKSearch | ( | const PointCloud & | cloud,
|  | int | index,
|  | int | k,
|  | std::vector< LeafConstPtr > & | k_leaves,
|  | std::vector< float > & | k_sqr_distances
| ) |  | const

inline

Search for the k-nearest occupied voxels for the given query point.

Note
  Only voxels containing a sufficient number of points are used.

Parameters

  [in] | cloud | the given query point
  [in] | index | the index
  [in] | k | the number of neighbors to search for
  [out] | k_leaves | the resultant leaves of the neighboring points
  [out] | k_sqr_distances | the resultant squared distances to the neighboring points

Returns
  number of neighbors found

Definition at line 491 of file voxel_grid_covariance.h.

References pcl::VoxelGridCovariance< PointT >::nearestKSearch().

## nearestKSearch() [2/2]

template<typename PointT >

int pcl::VoxelGridCovariance< PointT >::nearestKSearch | ( | const PointT & | point,
|  | int | k,
|  | std::vector< LeafConstPtr > & | k_leaves,
|  | std::vector< float > & | k_sqr_distances
| ) |  | const

inline

Search for the k-nearest occupied voxels for the given query point.

Note
  Only voxels containing a sufficient number of points are used.

Parameters

  [in] | point | the given query point
  [in] | k | the number of neighbors to search for
  [out] | k_leaves | the resultant leaves of the neighboring points
  [out] | k_sqr_distances | the resultant squared distances to the neighboring points

Returns
  number of neighbors found

Definition at line 451 of file voxel_grid_covariance.h.

References pcl::Filter< PointT >::getClassName(), pcl::VoxelGridCovariance< PointT >::kdtree_, pcl::VoxelGridCovariance< PointT >::leaves_, pcl::VoxelGridCovariance< PointT >::searchable_, and pcl::VoxelGridCovariance< PointT >::voxel_centroids_leaf_indices_.

Referenced by pcl::VoxelGridCovariance< PointT >::nearestKSearch().

## radiusSearch() [1/2]

template<typename PointT >

int pcl::VoxelGridCovariance< PointT >::radiusSearch | ( | const PointCloud & | cloud,
|  | int | index,
|  | double | radius,
|  | std::vector< LeafConstPtr > & | k_leaves,
|  | std::vector< float > & | k_sqr_distances,
|  | unsigned int | max_nn = `0`
| ) |  | const

inline

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

Note
  Only voxels containing a sufficient number of points are used.

Parameters

  [in] | cloud | the given query point
  [in] | index | a valid index in cloud representing a valid (i.e., finite) query point
  [in] | radius | the radius of the sphere bounding all of p_q's neighbors
  [out] | k_leaves | the resultant leaves of the neighboring points
  [out] | k_sqr_distances | the resultant squared distances to the neighboring points
  [in] | max_nn |

Returns
  number of neighbors found

Definition at line 551 of file voxel_grid_covariance.h.

References pcl::VoxelGridCovariance< PointT >::radiusSearch().

## radiusSearch() [2/2]

template<typename PointT >

int pcl::VoxelGridCovariance< PointT >::radiusSearch | ( | const PointT & | point,
|  | double | radius,
|  | std::vector< LeafConstPtr > & | k_leaves,
|  | std::vector< float > & | k_sqr_distances,
|  | unsigned int | max_nn = `0`
| ) |  | const

inline

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

Note
  Only voxels containing a sufficient number of points are used.

Parameters

  [in] | point | the given query point
  [in] | radius | the radius of the sphere bounding all of p_q's neighbors
  [out] | k_leaves | the resultant leaves of the neighboring points
  [out] | k_sqr_distances | the resultant squared distances to the neighboring points
  [in] | max_nn |

Returns
  number of neighbors found

Definition at line 510 of file voxel_grid_covariance.h.

References pcl::Filter< PointT >::getClassName(), pcl::VoxelGridCovariance< PointT >::kdtree_, pcl::VoxelGridCovariance< PointT >::leaves_, pcl::VoxelGridCovariance< PointT >::searchable_, and pcl::VoxelGridCovariance< PointT >::voxel_centroids_leaf_indices_.

Referenced by pcl::VoxelGridCovariance< PointT >::radiusSearch().

## setCovEigValueInflationRatio()

template<typename PointT >

void pcl::VoxelGridCovariance< PointT >::setCovEigValueInflationRatio | ( | double | min_covar_eigvalue_mult | ) |

inline

Set the minimum allowable ratio between eigenvalues to prevent singular covariance matrices.

Parameters

  [in] | min_covar_eigvalue_mult | the minimum allowable ratio between eigenvalues

Definition at line 240 of file voxel_grid_covariance.h.

References pcl::VoxelGridCovariance< PointT >::min_covar_eigvalue_mult_.

## setMinPointPerVoxel()

template<typename PointT >

void pcl::VoxelGridCovariance< PointT >::setMinPointPerVoxel | ( | int | min_points_per_voxel | ) |

inline

Set the minimum number of points required for a cell to be used (must be 3 or greater for covariance calculation).

Parameters

  [in] | min_points_per_voxel | the minimum number of points for required for a voxel to be used

Definition at line 214 of file voxel_grid_covariance.h.

References pcl::Filter< PointT >::getClassName(), and pcl::VoxelGridCovariance< PointT >::min_points_per_voxel_.

Referenced by pcl::NormalDistributionsTransform< PointSource, PointTarget, Scalar >::setMinPointPerVoxel().

## Member Data Documentation

## kdtree_

template<typename PointT >

KdTreeFLANN<PointT> pcl::VoxelGridCovariance< PointT >::kdtree_

protected

KdTree generated using voxel_centroids_ (used for searching).

Definition at line 586 of file voxel_grid_covariance.h.

Referenced by pcl::VoxelGridCovariance< PointT >::filter(), pcl::VoxelGridCovariance< PointT >::filter(), pcl::VoxelGridCovariance< PointT >::nearestKSearch(), and pcl::VoxelGridCovariance< PointT >::radiusSearch().

## leaves_

template<typename PointT >

std::map<std::size_t, Leaf> pcl::VoxelGridCovariance< PointT >::leaves_

protected

Voxel structure containing all leaf nodes (includes voxels with less than a sufficient number of points).

Definition at line 577 of file voxel_grid_covariance.h.

Referenced by pcl::VoxelGridCovariance< PointT >::getLeaf(), pcl::VoxelGridCovariance< PointT >::getLeaf(), pcl::VoxelGridCovariance< PointT >::getLeaf(), pcl::VoxelGridCovariance< PointT >::getLeaves(), pcl::VoxelGridCovariance< PointT >::nearestKSearch(), and pcl::VoxelGridCovariance< PointT >::radiusSearch().

## min_covar_eigvalue_mult_

template<typename PointT >

double pcl::VoxelGridCovariance< PointT >::min_covar_eigvalue_mult_ {0.01}

protected

Minimum allowable ratio between eigenvalues to prevent singular covariance matrices.

Definition at line 574 of file voxel_grid_covariance.h.

Referenced by pcl::VoxelGridCovariance< PointT >::getCovEigValueInflationRatio(), and pcl::VoxelGridCovariance< PointT >::setCovEigValueInflationRatio().

## min_points_per_voxel_

template<typename PointT >

int pcl::VoxelGridCovariance< PointT >::min_points_per_voxel_ {6}

protected

Minimum points contained with in a voxel to allow it to be usable.

Definition at line 571 of file voxel_grid_covariance.h.

Referenced by pcl::VoxelGridCovariance< PointT >::getMinPointPerVoxel(), and pcl::VoxelGridCovariance< PointT >::setMinPointPerVoxel().

## searchable_

template<typename PointT >

bool pcl::VoxelGridCovariance< PointT >::searchable_ {true}

protected

Flag to determine if voxel structure is searchable.

Definition at line 568 of file voxel_grid_covariance.h.

Referenced by pcl::VoxelGridCovariance< PointT >::filter(), pcl::VoxelGridCovariance< PointT >::filter(), pcl::VoxelGridCovariance< PointT >::nearestKSearch(), and pcl::VoxelGridCovariance< PointT >::radiusSearch().

## voxel_centroids_

template<typename PointT >

PointCloudPtr pcl::VoxelGridCovariance< PointT >::voxel_centroids_

protected

Point cloud containing centroids of voxels containing atleast minimum number of points.

Definition at line 580 of file voxel_grid_covariance.h.

Referenced by pcl::VoxelGridCovariance< PointT >::filter(), pcl::VoxelGridCovariance< PointT >::filter(), and pcl::VoxelGridCovariance< PointT >::getCentroids().

## voxel_centroids_leaf_indices_

template<typename PointT >

std::vector<int> pcl::VoxelGridCovariance< PointT >::voxel_centroids_leaf_indices_

protected

Indices of leaf structures associated with each point in voxel_centroids_ (used for searching).

Definition at line 583 of file voxel_grid_covariance.h.

Referenced by pcl::VoxelGridCovariance< PointT >::nearestKSearch(), and pcl::VoxelGridCovariance< PointT >::radiusSearch().

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

- pcl/filters/voxel_grid_covariance.h
- pcl/filters/impl/voxel_grid_covariance.hpp