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

组合多个排序器的对应关系排序器 / Correspondence sorter that combines multiple sorters More...

#include <combined_sorter.hpp>

Inheritance diagram for toolbox::pcl::combined_sorter_t< DataType >:

Public Types

using base_type = base_correspondence_sorter_t< combined_sorter_t< DataType >, DataType >
 
- Public Types inherited from toolbox::pcl::base_correspondence_sorter_t< combined_sorter_t< DataType >, DataType >
using point_cloud = toolbox::types::point_cloud_t< DataType >
 
using point_cloud_ptr = std::shared_ptr< point_cloud >
 
using correspondences_ptr = std::shared_ptr< std::vector< correspondence_t > >
 
using quality_scores_t = std::vector< DataType >
 
using sorted_indices_t = std::vector< std::size_t >
 

Public Member Functions

 combined_sorter_t ()=default
 
 ~combined_sorter_t ()=default
 
template<typename SorterType >
void add_sorter (std::shared_ptr< SorterType > sorter, DataType weight)
 添加子排序器及其权重 / Add a sub-sorter with its weight
 
void normalize_weights ()
 归一化权重,使其总和为1 / Normalize weights to sum to 1
 
std::size_t get_num_sorters () const
 获取子排序器数量 / Get number of sub-sorters
 
DataType get_weight (std::size_t index) const
 获取指定索引的权重 / Get weight at specified index
 
void clear_sorters ()
 清除所有子排序器 / Clear all sub-sorters
 
- Public Member Functions inherited from toolbox::pcl::base_correspondence_sorter_t< combined_sorter_t< DataType >, DataType >
 base_correspondence_sorter_t ()=default
 
 base_correspondence_sorter_t (const base_correspondence_sorter_t &)=delete
 
 base_correspondence_sorter_t (base_correspondence_sorter_t &&)=default
 
virtual ~base_correspondence_sorter_t ()=default
 
base_correspondence_sorter_toperator= (const base_correspondence_sorter_t &)=delete
 
base_correspondence_sorter_toperator= (base_correspondence_sorter_t &&)=default
 
void set_point_clouds (const point_cloud_ptr &source, const point_cloud_ptr &target)
 设置源点云和目标点云 / Set source and target point clouds
 
void set_correspondences (const correspondences_ptr &correspondences)
 设置对应关系 / Set correspondences
 
sorted_indices_t compute_sorted_indices (quality_scores_t &scores)
 计算质量分数并返回排序后的索引 / Compute quality scores and return sorted indices
 
quality_scores_t compute_quality_scores ()
 仅计算质量分数,不排序 / Compute quality scores only, without sorting
 
std::string get_sorter_name () const
 获取排序器名称 / Get sorter name
 
void clear_cache ()
 清除缓存 / Clear cache
 
void enable_parallel (bool enable=true)
 启用/禁用并行计算 / Enable/disable parallel computation
 
bool is_parallel_enabled () const
 获取并行计算状态 / Get parallel computation status
 

Protected Member Functions

void compute_quality_scores_impl (quality_scores_t &scores)
 计算质量分数的实现 / Implementation of quality score computation
 
std::string get_sorter_name_impl () const
 获取排序器名称实现 / Get sorter name implementation
 
- Protected Member Functions inherited from toolbox::pcl::base_correspondence_sorter_t< combined_sorter_t< DataType >, DataType >
bool validate_input () const
 验证输入数据 / Validate input data
 
bool validate_input_impl () const
 派生类可选的额外验证 / Optional additional validation for derived class
 
std::string get_sorter_name_impl () const
 派生类必须实现的排序器名称获取方法 / Sorter name getter that derived class must implement
 
const point_cloud_ptrget_source_cloud () const
 获取受保护的成员变量访问 / Get access to protected members
 
const point_cloud_ptrget_target_cloud () const
 
const correspondences_ptrget_correspondences () const
 

Friends

class base_correspondence_sorter_t< combined_sorter_t< DataType >, DataType >
 

Additional Inherited Members

- Protected Attributes inherited from toolbox::pcl::base_correspondence_sorter_t< combined_sorter_t< DataType >, DataType >
point_cloud_ptr m_source_cloud
 
point_cloud_ptr m_target_cloud
 
correspondences_ptr m_correspondences
 
bool m_cached
 
quality_scores_t m_cached_scores
 
sorted_indices_t m_cached_indices
 
bool m_parallel_enabled
 

Detailed Description

template<typename DataType>
class toolbox::pcl::combined_sorter_t< DataType >

组合多个排序器的对应关系排序器 / Correspondence sorter that combines multiple sorters

该排序器可以组合多个子排序器的结果,通过加权平均计算最终质量分数。 This sorter can combine results from multiple sub-sorters by computing a weighted average of their quality scores.

Template Parameters
DataType数据类型(如float或double) / Data type (e.g., float or double)
// 使用示例 / Usage example
combined_sorter_t<float> combined_sorter;
// 添加描述子距离排序器(权重0.6) / Add descriptor distance sorter (weight
0.6) auto dist_sorter =
combined_sorter.add_sorter(dist_sorter, 0.6f);
// 添加几何一致性排序器(权重0.4) / Add geometric consistency sorter
(weight 0.4) auto geom_sorter =
combined_sorter.add_sorter(geom_sorter, 0.4f);
// 归一化权重 / Normalize weights
combined_sorter.normalize_weights();
组合多个排序器的对应关系排序器 / Correspondence sorter that combines multiple sorters
Definition combined_sorter.hpp:47
void normalize_weights()
归一化权重,使其总和为1 / Normalize weights to sum to 1
Definition combined_sorter.hpp:80
void add_sorter(std::shared_ptr< SorterType > sorter, DataType weight)
添加子排序器及其权重 / Add a sub-sorter with its weight
Definition combined_sorter.hpp:65
基于描述子距离的对应关系排序器 / Descriptor distance-based correspondence sorter
Definition descriptor_distance_sorter.hpp:36
基于几何一致性的对应关系排序器 / Geometric consistency-based correspondence sorter
Definition geometric_consistency_sorter.hpp:36

Member Typedef Documentation

◆ base_type

template<typename DataType >
using toolbox::pcl::combined_sorter_t< DataType >::base_type = base_correspondence_sorter_t<combined_sorter_t<DataType>, DataType>

Constructor & Destructor Documentation

◆ combined_sorter_t()

template<typename DataType >
toolbox::pcl::combined_sorter_t< DataType >::combined_sorter_t ( )
default

◆ ~combined_sorter_t()

template<typename DataType >
toolbox::pcl::combined_sorter_t< DataType >::~combined_sorter_t ( )
default

Member Function Documentation

◆ add_sorter()

template<typename DataType >
template<typename SorterType >
void toolbox::pcl::combined_sorter_t< DataType >::add_sorter ( std::shared_ptr< SorterType >  sorter,
DataType  weight 
)
inline

添加子排序器及其权重 / Add a sub-sorter with its weight

Template Parameters
SorterType排序器类型 / Sorter type
Parameters
sorter排序器实例 / Sorter instance
weight权重 / Weight

◆ clear_sorters()

template<typename DataType >
void toolbox::pcl::combined_sorter_t< DataType >::clear_sorters ( )
inline

清除所有子排序器 / Clear all sub-sorters

◆ compute_quality_scores_impl()

template<typename DataType >
void toolbox::pcl::combined_sorter_t< DataType >::compute_quality_scores_impl ( quality_scores_t scores)
inlineprotected

计算质量分数的实现 / Implementation of quality score computation

Parameters
scores[out] 质量分数 / Quality scores

◆ get_num_sorters()

template<typename DataType >
std::size_t toolbox::pcl::combined_sorter_t< DataType >::get_num_sorters ( ) const
inline

获取子排序器数量 / Get number of sub-sorters

Returns
子排序器数量 / Number of sub-sorters

◆ get_sorter_name_impl()

template<typename DataType >
std::string toolbox::pcl::combined_sorter_t< DataType >::get_sorter_name_impl ( ) const
inlineprotected

获取排序器名称实现 / Get sorter name implementation

Returns
排序器名称 / Sorter name

◆ get_weight()

template<typename DataType >
DataType toolbox::pcl::combined_sorter_t< DataType >::get_weight ( std::size_t  index) const
inline

获取指定索引的权重 / Get weight at specified index

Parameters
index索引 / Index
Returns
权重 / Weight

◆ normalize_weights()

template<typename DataType >
void toolbox::pcl::combined_sorter_t< DataType >::normalize_weights ( )
inline

归一化权重,使其总和为1 / Normalize weights to sum to 1

Friends And Related Symbol Documentation

◆ base_correspondence_sorter_t< combined_sorter_t< DataType >, DataType >

template<typename DataType >
friend class base_correspondence_sorter_t< combined_sorter_t< DataType >, DataType >
friend

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