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

Harris 3D 关键点提取器 / Harris 3D keypoint extractor. More...

#include <harris3d_keypoints.hpp>

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

Public Types

using base_type = base_keypoint_extractor_t< harris3d_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

 harris3d_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_threshold (data_type threshold)
 设置Harris响应阈值 / Set Harris response threshold
 
void set_harris_k (data_type k)
 设置Harris参数k / Set Harris parameter k
 
void set_suppression_radius (data_type radius)
 设置非极大值抑制半径 / Set non-maxima suppression radius
 
void set_num_neighbors (std::size_t num_neighbors)
 设置近邻数量 / Set number of neighbors
 
data_type get_threshold () const
 获取Harris响应阈值 / Get Harris response threshold
 
data_type get_harris_k () const
 获取Harris参数k / Get Harris parameter k
 
data_type get_suppression_radius () const
 获取非极大值抑制半径 / Get non-maxima suppression radius
 
std::size_t get_num_neighbors () const
 获取近邻数量 / Get number of neighbors
 

Detailed Description

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

Harris 3D 关键点提取器 / Harris 3D 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

Harris 3D算法是经典Harris角点检测算法在3D点云中的扩展。它通过计算点云局部邻域的协方差矩阵来检测几何特征显著的点 / The Harris 3D algorithm extends the classic Harris corner detection to 3D point clouds. It detects geometrically salient points by computing the covariance matrix of local neighborhoods

// 基本使用示例 / Basic usage example
using data_type = float;
point_cloud_t<data_type> cloud = load_point_cloud();
// 创建Harris3D关键点提取器 / Create Harris3D keypoint extractor
// 设置参数 / Set parameters
extractor.set_input(cloud);
extractor.set_search_radius(0.5f); // 搜索半径 / Search radius
extractor.set_threshold(0.01f); // Harris响应阈值 / Harris response threshold
extractor.set_harris_k(0.04f); // Harris参数k / Harris parameter k
extractor.set_suppression_radius(0.1f); // 非极大值抑制半径 / Non-maxima suppression radius
extractor.set_num_neighbors(20); // K近邻数量 / Number of k-neighbors
// 设置KNN算法 / Set KNN algorithm
extractor.set_knn(kdtree);
// 提取关键点 / Extract keypoints
auto keypoints = extractor.extract();
std::cout << "找到 " << keypoints.size() << " 个Harris3D关键点 / Found " << keypoints.size() << " Harris3D keypoints" << std::endl;
Harris 3D 关键点提取器 / Harris 3D keypoint extractor.
Definition harris3d_keypoints.hpp:63
void set_threshold(data_type threshold)
设置Harris响应阈值 / Set Harris response threshold
Definition harris3d_keypoints.hpp:111
typename base_type::data_type data_type
Definition harris3d_keypoints.hpp:68
void set_num_neighbors(std::size_t num_neighbors)
设置近邻数量 / Set number of neighbors
Definition harris3d_keypoints.hpp:135
void set_suppression_radius(data_type radius)
设置非极大值抑制半径 / Set non-maxima suppression radius
Definition harris3d_keypoints.hpp:127
void set_harris_k(data_type k)
设置Harris参数k / Set Harris parameter k
Definition harris3d_keypoints.hpp:119
Definition kdtree.hpp:14
// 调整参数以获得不同的检测结果 / Adjust parameters for different detection results
// 更严格的阈值,获得更少但更可靠的关键点 / Stricter threshold for fewer but more reliable keypoints
extractor.set_threshold(0.05f);
// 使用固定K近邻而非半径搜索 / Use fixed k-neighbors instead of radius search
extractor.set_num_neighbors(50); // 使用50个最近邻 / Use 50 nearest neighbors
// 调整Harris参数k以改变角点响应 / Adjust Harris parameter k to change corner response
extractor.set_harris_k(0.01f); // 更敏感的检测 / More sensitive detection

Member Typedef Documentation

◆ base_type

template<typename DataType , typename KNN = kdtree_generic_t<point_t<DataType>, toolbox::metrics::L2Metric<DataType>>>
using toolbox::pcl::harris3d_keypoint_extractor_t< DataType, KNN >::base_type = base_keypoint_extractor_t<harris3d_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::harris3d_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::harris3d_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::harris3d_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::harris3d_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::harris3d_keypoint_extractor_t< DataType, KNN >::point_cloud_ptr = typename base_type::point_cloud_ptr

Constructor & Destructor Documentation

◆ harris3d_keypoint_extractor_t()

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

Member Function Documentation

◆ enable_parallel_impl()

template<typename DataType , typename KNN >
void toolbox::pcl::harris3d_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 >
harris3d_keypoint_extractor_t< DataType, KNN >::indices_vector toolbox::pcl::harris3d_keypoint_extractor_t< DataType, KNN >::extract_impl ( )

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

◆ extract_impl() [2/2]

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

◆ extract_keypoints_impl() [1/2]

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

◆ extract_keypoints_impl() [2/2]

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

◆ get_harris_k()

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

获取Harris参数k / Get Harris parameter k

Returns
当前的Harris参数k / Current Harris parameter k

◆ get_num_neighbors()

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

获取近邻数量 / Get number of neighbors

Returns
当前的近邻数量 / Current number of neighbors

◆ get_suppression_radius()

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

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

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

◆ get_threshold()

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

获取Harris响应阈值 / Get Harris response threshold

Returns
当前的Harris响应阈值 / Current Harris response threshold

◆ set_harris_k()

template<typename DataType , typename KNN = kdtree_generic_t<point_t<DataType>, toolbox::metrics::L2Metric<DataType>>>
void toolbox::pcl::harris3d_keypoint_extractor_t< DataType, KNN >::set_harris_k ( data_type  k)
inline

设置Harris参数k / Set Harris parameter k

Parameters
kHarris角点响应函数中的k参数 / Parameter k in Harris corner response function

通常取值范围为[0.04, 0.06]。较小的k值会产生更多的角点 / Typical range is [0.04, 0.06]. Smaller k values produce more corners

◆ set_input_impl() [1/2]

template<typename DataType , typename KNN >
std::size_t toolbox::pcl::harris3d_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::harris3d_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::harris3d_keypoint_extractor_t< DataType, KNN >::set_knn_impl ( const knn_type knn)

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

◆ set_num_neighbors()

template<typename DataType , typename KNN = kdtree_generic_t<point_t<DataType>, toolbox::metrics::L2Metric<DataType>>>
void toolbox::pcl::harris3d_keypoint_extractor_t< DataType, KNN >::set_num_neighbors ( std::size_t  num_neighbors)
inline

设置近邻数量 / Set number of neighbors

Parameters
num_neighbors计算Harris响应时使用的近邻数量 / Number of neighbors used for Harris response computation

当使用固定K近邻而非半径搜索时使用此参数 / This parameter is used when using fixed k-neighbors instead of radius search

◆ set_search_radius_impl()

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

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

◆ set_suppression_radius()

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

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

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

在此半径内只保留Harris响应最大的点 / Only the point with maximum Harris response within this radius is kept

◆ set_threshold()

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

设置Harris响应阈值 / Set Harris response threshold

Parameters
thresholdHarris响应的最小阈值 / Minimum threshold for Harris response

只有Harris响应值大于此阈值的点才会被考虑为关键点候选 / Only points with Harris response greater than this threshold are considered as keypoint candidates


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