cpp-toolbox  0.0.1
A toolbox library for C++
Loading...
Searching...
No Matches
toolbox::pcl::pfh_extractor_t< DataType, KNN > Class Template Reference

PFH (Point Feature Histogram) descriptor extractor. More...

#include <pfh_extractor.hpp>

Inheritance diagram for toolbox::pcl::pfh_extractor_t< DataType, KNN >:

Public Types

using base_type = base_descriptor_extractor_t< pfh_extractor_t< DataType, KNN >, DataType, pfh_signature_t< DataType > >
 
using data_type = DataType
 
using signature_type = pfh_signature_t< DataType >
 
using knn_type = KNN
 
using point_cloud = toolbox::types::point_cloud_t< DataType >
 
using point_cloud_ptr = std::shared_ptr< point_cloud >
 

Public Member Functions

 pfh_extractor_t ()=default
 
std::size_t set_input (const point_cloud &cloud)
 Set the input point cloud.
 
std::size_t set_input (const point_cloud_ptr &cloud)
 
std::size_t set_knn (const knn_type &knn)
 Set the KNN search algorithm.
 
std::size_t set_search_radius (data_type radius)
 Set the search radius for neighbor search.
 
std::size_t set_num_neighbors (std::size_t num_neighbors)
 Set the maximum number of neighbors to consider.
 
void set_normals (const point_cloud_ptr &normals)
 Set the point cloud normals (optional, will be computed if not provided)
 
void set_num_subdivisions (std::size_t subdivisions)
 Set the number of subdivision for each angular feature (default: 5)
 
void enable_parallel_impl (bool enable)
 Enable or disable parallel processing.
 
void compute_impl (const point_cloud &cloud, const std::vector< std::size_t > &keypoint_indices, std::vector< signature_type > &descriptors) const
 Compute descriptors for given keypoints.
 
void compute_impl (const point_cloud &cloud, const std::vector< std::size_t > &keypoint_indices, std::unique_ptr< std::vector< signature_type > > &descriptors) const
 

Detailed Description

template<typename DataType, typename KNN = kdtree_generic_t<point_t<DataType>, toolbox::metrics::L2Metric<DataType>>>
class toolbox::pcl::pfh_extractor_t< DataType, KNN >

PFH (Point Feature Histogram) descriptor extractor.

Template Parameters
DataTypeThe data type (float or double)
KNNThe K-nearest neighbor search algorithm type

PFH encodes the local geometry around a point by computing angular features between all pairs of points in the neighborhood. It captures detailed geometric information but is computationally expensive with O(k^2) complexity.

Reference: Rusu, R. B., Blodow, N., Marton, Z. C., & Beetz, M. (2008). Aligning point cloud views using persistent feature histograms.

// Basic usage example
using data_type = float;
point_cloud_t<data_type> cloud = load_point_cloud();
// Create PFH descriptor extractor
// Set parameters
extractor.set_input(cloud);
extractor.set_search_radius(0.05f); // Search radius for neighbors
extractor.set_num_neighbors(30); // Maximum number of neighbors
// Set up KNN search
extractor.set_knn(kdtree);
// Extract descriptors for keypoints
std::vector<std::size_t> keypoint_indices = {10, 20, 30};
std::vector<pfh_signature_t<data_type>> descriptors;
extractor.compute(cloud, keypoint_indices, descriptors);
Definition kdtree.hpp:14
PFH (Point Feature Histogram) descriptor extractor.
Definition pfh_extractor.hpp:89
std::size_t set_knn(const knn_type &knn)
Set the KNN search algorithm.
Definition pfh_extractor_impl.hpp:25
std::size_t set_search_radius(data_type radius)
Set the search radius for neighbor search.
Definition pfh_extractor_impl.hpp:37
std::size_t set_num_neighbors(std::size_t num_neighbors)
Set the maximum number of neighbors to consider.
Definition pfh_extractor_impl.hpp:44
std::size_t set_input(const point_cloud &cloud)
Set the input point cloud.
Definition pfh_extractor_impl.hpp:11
DataType data_type
Definition pfh_extractor.hpp:94

Member Typedef Documentation

◆ base_type

template<typename DataType , typename KNN = kdtree_generic_t<point_t<DataType>, toolbox::metrics::L2Metric<DataType>>>
using toolbox::pcl::pfh_extractor_t< DataType, KNN >::base_type = base_descriptor_extractor_t<pfh_extractor_t<DataType, KNN>, DataType, pfh_signature_t<DataType> >

◆ data_type

template<typename DataType , typename KNN = kdtree_generic_t<point_t<DataType>, toolbox::metrics::L2Metric<DataType>>>
using toolbox::pcl::pfh_extractor_t< DataType, KNN >::data_type = DataType

◆ knn_type

template<typename DataType , typename KNN = kdtree_generic_t<point_t<DataType>, toolbox::metrics::L2Metric<DataType>>>
using toolbox::pcl::pfh_extractor_t< DataType, KNN >::knn_type = KNN

◆ point_cloud

template<typename DataType , typename KNN = kdtree_generic_t<point_t<DataType>, toolbox::metrics::L2Metric<DataType>>>
using toolbox::pcl::pfh_extractor_t< DataType, KNN >::point_cloud = toolbox::types::point_cloud_t<DataType>

◆ point_cloud_ptr

template<typename DataType , typename KNN = kdtree_generic_t<point_t<DataType>, toolbox::metrics::L2Metric<DataType>>>
using toolbox::pcl::pfh_extractor_t< DataType, KNN >::point_cloud_ptr = std::shared_ptr<point_cloud>

◆ signature_type

template<typename DataType , typename KNN = kdtree_generic_t<point_t<DataType>, toolbox::metrics::L2Metric<DataType>>>
using toolbox::pcl::pfh_extractor_t< DataType, KNN >::signature_type = pfh_signature_t<DataType>

Constructor & Destructor Documentation

◆ pfh_extractor_t()

template<typename DataType , typename KNN = kdtree_generic_t<point_t<DataType>, toolbox::metrics::L2Metric<DataType>>>
toolbox::pcl::pfh_extractor_t< DataType, KNN >::pfh_extractor_t ( )
default

Member Function Documentation

◆ compute_impl() [1/2]

template<typename DataType , typename KNN >
void toolbox::pcl::pfh_extractor_t< DataType, KNN >::compute_impl ( const point_cloud cloud,
const std::vector< std::size_t > &  keypoint_indices,
std::unique_ptr< std::vector< signature_type > > &  descriptors 
) const

◆ compute_impl() [2/2]

template<typename DataType , typename KNN >
void toolbox::pcl::pfh_extractor_t< DataType, KNN >::compute_impl ( const point_cloud cloud,
const std::vector< std::size_t > &  keypoint_indices,
std::vector< signature_type > &  descriptors 
) const

Compute descriptors for given keypoints.

◆ enable_parallel_impl()

template<typename DataType , typename KNN >
void toolbox::pcl::pfh_extractor_t< DataType, KNN >::enable_parallel_impl ( bool  enable)

Enable or disable parallel processing.

◆ set_input() [1/2]

template<typename DataType , typename KNN >
std::size_t toolbox::pcl::pfh_extractor_t< DataType, KNN >::set_input ( const point_cloud cloud)

Set the input point cloud.

◆ set_input() [2/2]

template<typename DataType , typename KNN >
std::size_t toolbox::pcl::pfh_extractor_t< DataType, KNN >::set_input ( const point_cloud_ptr cloud)

◆ set_knn()

template<typename DataType , typename KNN >
std::size_t toolbox::pcl::pfh_extractor_t< DataType, KNN >::set_knn ( const knn_type knn)

Set the KNN search algorithm.

◆ set_normals()

template<typename DataType , typename KNN >
void toolbox::pcl::pfh_extractor_t< DataType, KNN >::set_normals ( const point_cloud_ptr normals)

Set the point cloud normals (optional, will be computed if not provided)

◆ set_num_neighbors()

template<typename DataType , typename KNN >
std::size_t toolbox::pcl::pfh_extractor_t< DataType, KNN >::set_num_neighbors ( std::size_t  num_neighbors)

Set the maximum number of neighbors to consider.

◆ set_num_subdivisions()

template<typename DataType , typename KNN >
void toolbox::pcl::pfh_extractor_t< DataType, KNN >::set_num_subdivisions ( std::size_t  subdivisions)

Set the number of subdivision for each angular feature (default: 5)

◆ set_search_radius()

template<typename DataType , typename KNN >
std::size_t toolbox::pcl::pfh_extractor_t< DataType, KNN >::set_search_radius ( data_type  radius)

Set the search radius for neighbor search.


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