cpp-toolbox  0.0.1
A toolbox library for C++
Loading...
Searching...
No Matches
描述子提取 / Descriptor Extraction

Functions

template<typename Signature >
std::vector< std::pair< size_t, size_t > > toolbox::pcl::match_descriptors (const std::vector< Signature > &source_descriptors, const std::vector< Signature > &target_descriptors, typename Signature::data_type max_distance)
 描述子类型及其特点 / Descriptor types and their characteristics
 
template<typename Signature >
std::vector< std::pair< size_t, size_t > > toolbox::pcl::match_descriptors_ratio_test (const std::vector< Signature > &source_descriptors, const std::vector< Signature > &target_descriptors, float ratio_threshold=0.8f)
 使用比率测试的描述子匹配 / Descriptor matching with ratio test
 
template<typename Signature >
Signature toolbox::pcl::compute_descriptor_centroid (const std::vector< Signature > &descriptors)
 计算描述子集的统计信息 / Compute statistics of descriptor set
 
template<typename Signature >
std::pair< float, float > toolbox::pcl::evaluate_descriptor_matching (const std::vector< Signature > &descriptors1, const std::vector< Signature > &descriptors2, const std::vector< std::pair< size_t, size_t > > &ground_truth_matches, typename Signature::data_type max_distance)
 描述子性能评估辅助函数 / Descriptor performance evaluation helper
 

Detailed Description

Function Documentation

◆ compute_descriptor_centroid()

template<typename Signature >
Signature toolbox::pcl::compute_descriptor_centroid ( const std::vector< Signature > &  descriptors)

计算描述子集的统计信息 / Compute statistics of descriptor set

Template Parameters
Signature描述子签名类型 / Descriptor signature type
Parameters
descriptors描述子集 / Descriptor set
Returns
平均描述子(用于聚类等) / Average descriptor (for clustering etc.)
// 计算描述子集的中心 / Compute centroid of descriptor set
auto centroid = compute_descriptor_centroid(descriptors);
Signature compute_descriptor_centroid(const std::vector< Signature > &descriptors)
计算描述子集的统计信息 / Compute statistics of descriptor set
Definition descriptors.hpp:184

◆ evaluate_descriptor_matching()

template<typename Signature >
std::pair< float, float > toolbox::pcl::evaluate_descriptor_matching ( const std::vector< Signature > &  descriptors1,
const std::vector< Signature > &  descriptors2,
const std::vector< std::pair< size_t, size_t > > &  ground_truth_matches,
typename Signature::data_type  max_distance 
)

描述子性能评估辅助函数 / Descriptor performance evaluation helper

Template Parameters
Signature描述子签名类型 / Descriptor signature type
Parameters
descriptors1第一组描述子 / First descriptor set
descriptors2第二组描述子 / Second descriptor set
ground_truth_matches真实匹配对 / Ground truth matches
Returns
准确率和召回率 / Precision and recall
// 评估描述子匹配性能 / Evaluate descriptor matching performance
auto [precision, recall] = evaluate_descriptor_matching(
desc1, desc2, ground_truth, 0.25f);
std::cout << "准确率 / Precision: " << precision << std::endl;
std::cout << "召回率 / Recall: " << recall << std::endl;
std::pair< float, float > evaluate_descriptor_matching(const std::vector< Signature > &descriptors1, const std::vector< Signature > &descriptors2, const std::vector< std::pair< size_t, size_t > > &ground_truth_matches, typename Signature::data_type max_distance)
描述子性能评估辅助函数 / Descriptor performance evaluation helper
Definition descriptors.hpp:216

◆ match_descriptors()

template<typename Signature >
std::vector< std::pair< size_t, size_t > > toolbox::pcl::match_descriptors ( const std::vector< Signature > &  source_descriptors,
const std::vector< Signature > &  target_descriptors,
typename Signature::data_type  max_distance 
)

描述子类型及其特点 / Descriptor types and their characteristics

局部描述子 / Local Descriptors:

  • PFH (Point Feature Histogram): 125维,精确但计算较慢 / 125D, accurate but slow
  • FPFH (Fast PFH): 33维,PFH的快速近似版本 / 33D, fast approximation of PFH
  • SHOT (Signature of Histograms of OrienTations): 352维,包含颜色和形状信息 / 352D, includes color and shape
  • 3DSC (3D Shape Context): 1980维,基于球形网格的形状描述 / 1980D, spherical grid-based shape description
  • ROPS (Rotational Projection Statistics): 135维,旋转不变性 / 135D, rotation invariant

全局描述子 / Global Descriptors:

  • VFH (Viewpoint Feature Histogram): 308维,整个物体的描述 / 308D, describes entire object
  • CVFH (Clustered VFH): 308维×聚类数,处理遮挡情况 / 308D×clusters, handles occlusion
// 选择合适的描述子 / Choose appropriate descriptor
if (need_fast_matching) {
// FPFH: 快速且效果良好 / FPFH: fast and effective
} else if (need_high_accuracy) {
// SHOT: 更高的区分度 / SHOT: higher discriminative power
shot_extractor_t<float> extractor;
} else if (need_global_descriptor) {
// VFH: 全局物体描述 / VFH: global object description
vfh_extractor_t<float> extractor;
}
FPFH (Fast Point Feature Histogram) descriptor extractor.
Definition fpfh_extractor.hpp:89

描述子匹配辅助函数 / Descriptor matching helper function

Template Parameters
Signature描述子签名类型 / Descriptor signature type
Parameters
source_descriptors源描述子集 / Source descriptor set
target_descriptors目标描述子集 / Target descriptor set
max_distance最大匹配距离 / Maximum matching distance
Returns
匹配对的索引 / Indices of matched pairs
// 匹配两个点云的描述子 / Match descriptors between two point clouds
auto matches = match_descriptors(source_desc, target_desc, 0.25f);
for (const auto& [src_idx, tgt_idx] : matches) {
std::cout << "匹配 / Match: " << src_idx << " -> " << tgt_idx << std::endl;
}
std::vector< std::pair< size_t, size_t > > match_descriptors(const std::vector< Signature > &source_descriptors, const std::vector< Signature > &target_descriptors, typename Signature::data_type max_distance)
描述子类型及其特点 / Descriptor types and their characteristics
Definition descriptors.hpp:98

◆ match_descriptors_ratio_test()

template<typename Signature >
std::vector< std::pair< size_t, size_t > > toolbox::pcl::match_descriptors_ratio_test ( const std::vector< Signature > &  source_descriptors,
const std::vector< Signature > &  target_descriptors,
float  ratio_threshold = 0.8f 
)

使用比率测试的描述子匹配 / Descriptor matching with ratio test

Template Parameters
Signature描述子签名类型 / Descriptor signature type
Parameters
source_descriptors源描述子集 / Source descriptor set
target_descriptors目标描述子集 / Target descriptor set
ratio_threshold比率阈值(通常0.7-0.8) / Ratio threshold (typically 0.7-0.8)
Returns
匹配对的索引 / Indices of matched pairs
// 使用Lowe's ratio test进行鲁棒匹配 / Robust matching using Lowe's ratio test
auto matches = match_descriptors_ratio_test(source_desc, target_desc, 0.8f);
std::vector< std::pair< size_t, size_t > > match_descriptors_ratio_test(const std::vector< Signature > &source_descriptors, const std::vector< Signature > &target_descriptors, float ratio_threshold=0.8f)
使用比率测试的描述子匹配 / Descriptor matching with ratio test
Definition descriptors.hpp:139