#pragma once #include #include 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 class DistanceCoherence : public PointCoherence { public: using Ptr = shared_ptr>; using ConstPtr = shared_ptr>; /** \brief initialize the weight to 1.0. */ DistanceCoherence() : PointCoherence(), 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_; }; } // namespace tracking } // namespace pcl #ifdef PCL_NO_PRECOMPILE #include #endif