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

基于曲率的关键点提取器 / Curvature-based keypoint extractor More...

#include <curvature_keypoints.hpp>

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

Public Types

using base_type = base_keypoint_extractor_t< curvature_keypoint_extractor_t< DataType, KNN >, DataType, KNN >
 
using data_type = typename base_type::data_type
 
using knn_type = typename base_type::knn_type
 
using point_cloud = typename base_type::point_cloud
 
using point_cloud_ptr = typename base_type::point_cloud_ptr
 
using indices_vector = typename base_type::indices_vector
 

Public Member Functions

 curvature_keypoint_extractor_t ()=default
 
std::size_t set_input_impl (const point_cloud &cloud)
 CRTP实现方法 - 设置输入点云 / CRTP implementation - set input point cloud.
 
std::size_t set_input_impl (const point_cloud_ptr &cloud)
 
std::size_t set_knn_impl (const knn_type &knn)
 CRTP实现方法 - 设置KNN算法 / CRTP implementation - set KNN algorithm.
 
std::size_t set_search_radius_impl (data_type radius)
 CRTP实现方法 - 设置搜索半径 / CRTP implementation - set search radius.
 
void enable_parallel_impl (bool enable)
 CRTP实现方法 - 启用并行处理 / CRTP implementation - enable parallel processing.
 
indices_vector extract_impl ()
 CRTP实现方法 - 提取关键点 / CRTP implementation - extract keypoints.
 
void extract_impl (indices_vector &keypoint_indices)
 
point_cloud extract_keypoints_impl ()
 
void extract_keypoints_impl (point_cloud_ptr output)
 
void set_curvature_threshold (data_type threshold)
 设置曲率阈值 / Set curvature threshold
 
void set_min_neighbors (std::size_t min_neighbors)
 设置最小邻居数量 / Set minimum number of neighbors
 
void set_non_maxima_radius (data_type radius)
 设置非极大值抑制半径 / Set non-maxima suppression radius
 
data_type get_curvature_threshold () const
 获取曲率阈值 / Get curvature threshold
 
std::size_t get_min_neighbors () const
 获取最小邻居数量 / Get minimum number of neighbors
 
data_type get_non_maxima_radius () const
 获取非极大值抑制半径 / Get non-maxima suppression radius
 

Detailed Description

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

基于曲率的关键点提取器 / Curvature-based keypoint extractor

Template Parameters
DataType数据类型(float或double) / Data type (float or double)
KNN最近邻搜索算法类型,默认使用 kdtree_generic_t / K-nearest neighbor search algorithm type, defaults to kdtree_generic_t

该类通过计算每个点的主曲率来检测关键点。曲率较大的点通常对应于角点、边缘等几何特征 / This class detects keypoints by computing principal curvatures at each point. Points with high curvature typically correspond to corners, edges, and other geometric features

// 基本使用示例 / Basic usage example
using data_type = float;
point_cloud_t<data_type> cloud = load_point_cloud();
// 创建曲率关键点提取器 / Create curvature keypoint extractor
// 设置参数 / Set parameters
extractor.set_input(cloud);
extractor.set_search_radius(0.5f);
extractor.set_curvature_threshold(0.01f);
extractor.set_non_maxima_radius(0.3f);
extractor.set_min_neighbors(10);
// 设置KNN算法 / Set KNN algorithm
extractor.set_knn(kdtree);
// 提取关键点 / Extract keypoints
auto keypoints = extractor.extract();
std::cout << "找到 " << keypoints.size() << " 个曲率关键点 / Found " << keypoints.size() << " curvature keypoints" << std::endl;
基于曲率的关键点提取器 / Curvature-based keypoint extractor
Definition curvature_keypoints.hpp:61
void set_non_maxima_radius(data_type radius)
设置非极大值抑制半径 / Set non-maxima suppression radius
Definition curvature_keypoints.hpp:125
void set_curvature_threshold(data_type threshold)
设置曲率阈值 / Set curvature threshold
Definition curvature_keypoints.hpp:109
typename base_type::data_type data_type
Definition curvature_keypoints.hpp:66
void set_min_neighbors(std::size_t min_neighbors)
设置最小邻居数量 / Set minimum number of neighbors
Definition curvature_keypoints.hpp:117
Definition kdtree.hpp:14
// 并行处理示例 / Parallel processing example
parallel_extractor.set_input(large_cloud);
parallel_extractor.enable_parallel(true); // 启用多线程 / Enable multithreading
parallel_extractor.set_knn(parallel_knn);
auto keypoints = parallel_extractor.extract();
Definition bfknn_parallel.hpp:14

Member Typedef Documentation

◆ base_type

template<typename DataType , typename KNN = kdtree_generic_t<point_t<DataType>, toolbox::metrics::L2Metric<DataType>>>
using toolbox::pcl::curvature_keypoint_extractor_t< DataType, KNN >::base_type = base_keypoint_extractor_t<curvature_keypoint_extractor_t<DataType, KNN>, DataType, KNN>

◆ data_type

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

◆ indices_vector

template<typename DataType , typename KNN = kdtree_generic_t<point_t<DataType>, toolbox::metrics::L2Metric<DataType>>>
using toolbox::pcl::curvature_keypoint_extractor_t< DataType, KNN >::indices_vector = typename base_type::indices_vector

◆ knn_type

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

◆ point_cloud

template<typename DataType , typename KNN = kdtree_generic_t<point_t<DataType>, toolbox::metrics::L2Metric<DataType>>>
using toolbox::pcl::curvature_keypoint_extractor_t< DataType, KNN >::point_cloud = typename base_type::point_cloud

◆ point_cloud_ptr

template<typename DataType , typename KNN = kdtree_generic_t<point_t<DataType>, toolbox::metrics::L2Metric<DataType>>>
using toolbox::pcl::curvature_keypoint_extractor_t< DataType, KNN >::point_cloud_ptr = typename base_type::point_cloud_ptr

Constructor & Destructor Documentation

◆ curvature_keypoint_extractor_t()

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

Member Function Documentation

◆ enable_parallel_impl()

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

CRTP实现方法 - 启用并行处理 / CRTP implementation - enable parallel processing.

◆ extract_impl() [1/2]

template<typename DataType , typename KNN >
curvature_keypoint_extractor_t< DataType, KNN >::indices_vector toolbox::pcl::curvature_keypoint_extractor_t< DataType, KNN >::extract_impl ( )

CRTP实现方法 - 提取关键点 / CRTP implementation - extract keypoints.

◆ extract_impl() [2/2]

template<typename DataType , typename KNN >
void toolbox::pcl::curvature_keypoint_extractor_t< DataType, KNN >::extract_impl ( indices_vector keypoint_indices)

◆ extract_keypoints_impl() [1/2]

template<typename DataType , typename KNN >
curvature_keypoint_extractor_t< DataType, KNN >::point_cloud toolbox::pcl::curvature_keypoint_extractor_t< DataType, KNN >::extract_keypoints_impl ( )

◆ extract_keypoints_impl() [2/2]

template<typename DataType , typename KNN >
void toolbox::pcl::curvature_keypoint_extractor_t< DataType, KNN >::extract_keypoints_impl ( point_cloud_ptr  output)

◆ get_curvature_threshold()

template<typename DataType , typename KNN = kdtree_generic_t<point_t<DataType>, toolbox::metrics::L2Metric<DataType>>>
data_type toolbox::pcl::curvature_keypoint_extractor_t< DataType, KNN >::get_curvature_threshold ( ) const
inline

获取曲率阈值 / Get curvature threshold

Returns
当前的曲率阈值 / Current curvature threshold

◆ get_min_neighbors()

template<typename DataType , typename KNN = kdtree_generic_t<point_t<DataType>, toolbox::metrics::L2Metric<DataType>>>
std::size_t toolbox::pcl::curvature_keypoint_extractor_t< DataType, KNN >::get_min_neighbors ( ) const
inline

获取最小邻居数量 / Get minimum number of neighbors

Returns
当前的最小邻居数量 / Current minimum number of neighbors

◆ get_non_maxima_radius()

template<typename DataType , typename KNN = kdtree_generic_t<point_t<DataType>, toolbox::metrics::L2Metric<DataType>>>
data_type toolbox::pcl::curvature_keypoint_extractor_t< DataType, KNN >::get_non_maxima_radius ( ) const
inline

获取非极大值抑制半径 / Get non-maxima suppression radius

Returns
当前的非极大值抑制半径 / Current non-maxima suppression radius

◆ set_curvature_threshold()

template<typename DataType , typename KNN = kdtree_generic_t<point_t<DataType>, toolbox::metrics::L2Metric<DataType>>>
void toolbox::pcl::curvature_keypoint_extractor_t< DataType, KNN >::set_curvature_threshold ( data_type  threshold)
inline

设置曲率阈值 / Set curvature threshold

Parameters
threshold曲率阈值,超过此值的点被认为是关键点候选 / Curvature threshold, points exceeding this value are considered keypoint candidates

较小的阈值会检测更多关键点,较大的阈值只检测曲率显著的点 / Smaller thresholds detect more keypoints, larger thresholds only detect points with significant curvature

◆ set_input_impl() [1/2]

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

CRTP实现方法 - 设置输入点云 / CRTP implementation - set input point cloud.

◆ set_input_impl() [2/2]

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

◆ set_knn_impl()

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

CRTP实现方法 - 设置KNN算法 / CRTP implementation - set KNN algorithm.

◆ set_min_neighbors()

template<typename DataType , typename KNN = kdtree_generic_t<point_t<DataType>, toolbox::metrics::L2Metric<DataType>>>
void toolbox::pcl::curvature_keypoint_extractor_t< DataType, KNN >::set_min_neighbors ( std::size_t  min_neighbors)
inline

设置最小邻居数量 / Set minimum number of neighbors

Parameters
min_neighbors计算曲率所需的最小邻居点数 / Minimum number of neighbor points required for curvature computation

较少的邻居可能导致曲率估计不稳定,建议至少使用10个邻居 / Fewer neighbors may lead to unstable curvature estimation, at least 10 neighbors are recommended

◆ set_non_maxima_radius()

template<typename DataType , typename KNN = kdtree_generic_t<point_t<DataType>, toolbox::metrics::L2Metric<DataType>>>
void toolbox::pcl::curvature_keypoint_extractor_t< DataType, KNN >::set_non_maxima_radius ( data_type  radius)
inline

设置非极大值抑制半径 / Set non-maxima suppression radius

Parameters
radius非极大值抑制的半径 / Radius for non-maxima suppression

在此半径内只保留曲率最大的点作为关键点 / Only the point with maximum curvature within this radius is kept as keypoint

◆ set_search_radius_impl()

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

CRTP实现方法 - 设置搜索半径 / CRTP implementation - set search radius.


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