Loading...
Searching...
No Matches
distance_coherence.h
#pragma once
#include <pcl/tracking/coherence.h>
#include <pcl/memory.h>
namespace pcl {
namespace tracking {
/** \brief @b DistanceCoherence computes coherence between two points from the distance
* between them. the coherence is calculated by 1 / (1 + weight * d^2 ).
* \author Ryohei Ueda
* \ingroup tracking
*/
template <typename PointInT>
class DistanceCoherence : public PointCoherence<PointInT> {
public:
using Ptr = shared_ptr<DistanceCoherence<PointInT>>;
using ConstPtr = shared_ptr<const DistanceCoherence<PointInT>>;
/** \brief initialize the weight to 1.0. */
DistanceCoherence() : PointCoherence<PointInT>() {}
/** \brief set the weight of coherence.
* \param weight the value of the wehgit.
*/
inline void
setWeight(double weight)
{
weight_ = weight;
}
/** \brief get the weight of coherence.*/
inline double
getWeight()
{
return weight_;
}
protected:
/** \brief return the distance coherence between the two points.
* \param source instance of source point.
* \param target instance of target point.
*/
double
computeCoherence(PointInT& source, PointInT& target) override;
/** \brief the weight of coherence.*/
double weight_{1.0};
};
} // namespace tracking
} // namespace pcl
#ifdef PCL_NO_PRECOMPILE
#include <pcl/tracking/impl/distance_coherence.hpp>
#endif
pcl::tracking::DistanceCoherence::getWeight
double getWeight()
get the weight of coherence.
Definition distance_coherence.h:33
pcl::tracking::DistanceCoherence::Ptr
shared_ptr< DistanceCoherence< PointInT > > Ptr
Definition distance_coherence.h:16
pcl::tracking::DistanceCoherence::setWeight
void setWeight(double weight)
set the weight of coherence.
Definition distance_coherence.h:26
pcl::tracking::DistanceCoherence::DistanceCoherence
DistanceCoherence()
initialize the weight to 1.0.
Definition distance_coherence.h:20
pcl::tracking::DistanceCoherence::ConstPtr
shared_ptr< const DistanceCoherence< PointInT > > ConstPtr
Definition distance_coherence.h:17
pcl::tracking::DistanceCoherence::computeCoherence
double computeCoherence(PointInT &source, PointInT &target) override
return the distance coherence between the two points.
Definition distance_coherence.hpp:10
pcl::tracking::DistanceCoherence::weight_
double weight_
the weight of coherence.
Definition distance_coherence.h:47
pcl::tracking::PointCoherence::PointCoherence
PointCoherence()=default
empty constructor
memory.h
Defines functions, macros and traits for allocating and using memory.
pcl::tracking
Definition approx_nearest_pair_point_cloud_coherence.h:7
pcl
Definition convolution.h:46