cpp-toolbox  0.0.1
A toolbox library for C++
Loading...
Searching...
No Matches
toolbox::metrics::LCPMetric< T > Class Template Reference

LCP (Largest Common Pointset) metric for evaluating point cloud registration. More...

#include <point_cloud_metrics.hpp>

Inheritance diagram for toolbox::metrics::LCPMetric< T >:

Public Types

using element_type = T
 
using point_type = toolbox::types::point_t< T >
 
using cloud_type = toolbox::types::point_cloud_t< T >
 
using transformation_type = Eigen::Matrix< T, 4, 4 >
 
- Public Types inherited from toolbox::metrics::base_metric_t< LCPMetric< T >, T >
using element_type = T
 
using result_type = T
 

Public Member Functions

 LCPMetric (T inlier_threshold=T(1.0))
 Constructor.
 
constexpr T distance_impl (const T *cloud_a, const T *cloud_b, std::size_t size) const
 
compute_lcp_score (const cloud_type &source, const cloud_type &target, const transformation_type &transform, std::vector< std::size_t > *inliers=nullptr) const
 Compute LCP score between two point clouds.
 
void set_inlier_threshold (T threshold)
 Set inlier threshold.
 
get_inlier_threshold () const
 Get inlier threshold.
 
constexpr T squared_distance_impl (const T *a, const T *b, std::size_t size) const
 
- Public Member Functions inherited from toolbox::metrics::base_metric_t< LCPMetric< T >, T >
constexpr T distance (const T *a, const T *b, std::size_t size) const
 
constexpr T distance (const Container &a, const Container &b) const
 
constexpr T squared_distance (const T *a, const T *b, std::size_t size) const
 
constexpr T squared_distance (const Container &a, const Container &b) const
 

Detailed Description

template<typename T>
class toolbox::metrics::LCPMetric< T >

LCP (Largest Common Pointset) metric for evaluating point cloud registration.

Computes the average distance between transformed source points and their nearest neighbors in the target cloud, considering only points within a threshold. Lower scores indicate better alignment.

Template Parameters
TData type (float or double)

Member Typedef Documentation

◆ cloud_type

template<typename T >
using toolbox::metrics::LCPMetric< T >::cloud_type = toolbox::types::point_cloud_t<T>

◆ element_type

template<typename T >
using toolbox::metrics::LCPMetric< T >::element_type = T

◆ point_type

template<typename T >
using toolbox::metrics::LCPMetric< T >::point_type = toolbox::types::point_t<T>

◆ transformation_type

template<typename T >
using toolbox::metrics::LCPMetric< T >::transformation_type = Eigen::Matrix<T, 4, 4>

Constructor & Destructor Documentation

◆ LCPMetric()

template<typename T >
toolbox::metrics::LCPMetric< T >::LCPMetric ( inlier_threshold = T(1.0))
inlineexplicit

Constructor.

Parameters
inlier_thresholdDistance threshold for considering a point as an inlier

Member Function Documentation

◆ compute_lcp_score()

template<typename T >
T toolbox::metrics::LCPMetric< T >::compute_lcp_score ( const cloud_type source,
const cloud_type target,
const transformation_type transform,
std::vector< std::size_t > *  inliers = nullptr 
) const
inline

Compute LCP score between two point clouds.

Parameters
sourceSource point cloud
targetTarget point cloud
transformTransformation to apply to source points
[out]inliersOptional output vector of inlier indices
Returns
Average distance of inliers (lower is better)

◆ distance_impl()

template<typename T >
constexpr T toolbox::metrics::LCPMetric< T >::distance_impl ( const T *  cloud_a,
const T *  cloud_b,
std::size_t  size 
) const
inlineconstexpr

◆ get_inlier_threshold()

template<typename T >
T toolbox::metrics::LCPMetric< T >::get_inlier_threshold ( ) const
inline

Get inlier threshold.

Returns
Current threshold value

◆ set_inlier_threshold()

template<typename T >
void toolbox::metrics::LCPMetric< T >::set_inlier_threshold ( threshold)
inline

Set inlier threshold.

Parameters
thresholdNew threshold value

◆ squared_distance_impl()

template<typename T >
constexpr T toolbox::metrics::LCPMetric< T >::squared_distance_impl ( const T *  a,
const T *  b,
std::size_t  size 
) const
inlineconstexpr

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