distance_coherence.h
#pragma once
#include <boost/shared_ptr.hpp>
#include <pcl/tracking/coherence.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> ()
, weight_ (1.0)
{}
/** \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_;
};
}
}
#ifdef PCL_NO_PRECOMPILE
#include <pcl/tracking/impl/distance_coherence.hpp>
#endif
pcl
This file defines compatibility wrappers for low level I/O functions.
Definition: convolution.h:45
pcl::tracking::DistanceCoherence::computeCoherence
double computeCoherence(PointInT &source, PointInT &target) override
return the distance coherence between the two points.
Definition: distance_coherence.hpp:12
pcl::tracking::DistanceCoherence::weight_
double weight_
the weight of coherence.
Definition: distance_coherence.h:47
pcl::tracking::PointCoherence::Ptr
shared_ptr< PointCoherence< PointInT > > Ptr
Definition: coherence.h:19
pcl::tracking::DistanceCoherence::DistanceCoherence
DistanceCoherence()
initialize the weight to 1.0.
Definition: distance_coherence.h:25
pcl::tracking::PointCoherence::ConstPtr
shared_ptr< const PointCoherence< PointInT > > ConstPtr
Definition: coherence.h:20
pcl::tracking::DistanceCoherence
DistanceCoherence computes coherence between two points from the distance between them.
Definition: distance_coherence.h:17
pcl::tracking::DistanceCoherence::getWeight
double getWeight()
get the weight of coherence.
Definition: distance_coherence.h:36
pcl::tracking::PointCoherence
PointCoherence is a base class to compute coherence between the two points.
Definition: coherence.h:16
pcl::shared_ptr
boost::shared_ptr< T > shared_ptr
Alias for boost::shared_ptr.
Definition: pcl_macros.h:90
pcl::tracking::DistanceCoherence::setWeight
void setWeight(double weight)
set the weight of coherence.
Definition: distance_coherence.h:33