Point Cloud Library (PCL)
1.7.0
|
00001 #ifndef PCL_TRACKING_DISTANCE_COHERENCE_H_ 00002 #define PCL_TRACKING_DISTANCE_COHERENCE_H_ 00003 00004 #include <pcl/tracking/coherence.h> 00005 00006 namespace pcl 00007 { 00008 namespace tracking 00009 { 00010 /** \brief @b DistanceCoherence computes coherence between two points from the distance 00011 between them. the coherence is calculated by 1 / (1 + weight * d^2 ). 00012 * \author Ryohei Ueda 00013 * \ingroup tracking 00014 */ 00015 template <typename PointInT> 00016 class DistanceCoherence: public PointCoherence<PointInT> 00017 { 00018 public: 00019 00020 /** \brief initialize the weight to 1.0. */ 00021 DistanceCoherence () 00022 : PointCoherence<PointInT> () 00023 , weight_ (1.0) 00024 {} 00025 00026 /** \brief set the weight of coherence. 00027 * \param weight the value of the wehgit. 00028 */ 00029 inline void setWeight (double weight) { weight_ = weight; } 00030 00031 /** \brief get the weight of coherence.*/ 00032 inline double getWeight () { return weight_; } 00033 00034 protected: 00035 00036 /** \brief return the distance coherence between the two points. 00037 * \param source instance of source point. 00038 * \param target instance of target point. 00039 */ 00040 double computeCoherence (PointInT &source, PointInT &target); 00041 00042 /** \brief the weight of coherence.*/ 00043 double weight_; 00044 }; 00045 } 00046 } 00047 00048 #ifdef PCL_NO_PRECOMPILE 00049 #include <pcl/tracking/impl/distance_coherence.hpp> 00050 #endif 00051 00052 // #include <pcl/tracking/impl/distance_coherence.hpp> 00053 00054 #endif