cpp-toolbox  0.0.1
A toolbox library for C++
Loading...
Searching...
No Matches
toolbox::pcl::base_signature_t< DataType, Derived > Struct Template Reference

描述子签名的基类 / Base class for descriptor signatures More...

#include <base_descriptor_extractor.hpp>

Public Types

using data_type = DataType
 
using derived_type = Derived
 

Public Member Functions

DataType distance (const Derived &other) const
 计算与另一个签名的距离 / Calculate distance to another signature
 

Detailed Description

template<typename DataType, class Derived>
struct toolbox::pcl::base_signature_t< DataType, Derived >

描述子签名的基类 / Base class for descriptor signatures

该类定义了所有描述子签名类型的通用接口,主要提供距离计算功能。 This class defines the common interface for all descriptor signature types, mainly providing distance calculation functionality.

Template Parameters
DataType数据类型(如float或double) / Data type (e.g., float or double)
Derived派生的签名类型 / Derived signature type
// 自定义描述子签名示例 / Custom descriptor signature example
struct my_signature_t : base_signature_t<float, my_signature_t> {
std::array<float, 128> histogram;
float distance_impl(const my_signature_t& other) const {
float dist = 0;
for (size_t i = 0; i < 128; ++i) {
dist += std::abs(histogram[i] - other.histogram[i]);
}
return dist;
}
};
描述子签名的基类 / Base class for descriptor signatures
Definition base_descriptor_extractor.hpp:38

Member Typedef Documentation

◆ data_type

template<typename DataType , class Derived >
using toolbox::pcl::base_signature_t< DataType, Derived >::data_type = DataType

◆ derived_type

template<typename DataType , class Derived >
using toolbox::pcl::base_signature_t< DataType, Derived >::derived_type = Derived

Member Function Documentation

◆ distance()

template<typename DataType , class Derived >
DataType toolbox::pcl::base_signature_t< DataType, Derived >::distance ( const Derived &  other) const
inline

计算与另一个签名的距离 / Calculate distance to another signature

Parameters
other另一个签名 / Another signature
Returns
距离值 / Distance value

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