Point Cloud Library (PCL)  1.7.0
distance_coherence.h
1 #ifndef PCL_TRACKING_DISTANCE_COHERENCE_H_
2 #define PCL_TRACKING_DISTANCE_COHERENCE_H_
3 
4 #include <pcl/tracking/coherence.h>
5 
6 namespace pcl
7 {
8  namespace tracking
9  {
10  /** \brief @b DistanceCoherence computes coherence between two points from the distance
11  between them. the coherence is calculated by 1 / (1 + weight * d^2 ).
12  * \author Ryohei Ueda
13  * \ingroup tracking
14  */
15  template <typename PointInT>
16  class DistanceCoherence: public PointCoherence<PointInT>
17  {
18  public:
19 
20  /** \brief initialize the weight to 1.0. */
22  : PointCoherence<PointInT> ()
23  , weight_ (1.0)
24  {}
25 
26  /** \brief set the weight of coherence.
27  * \param weight the value of the wehgit.
28  */
29  inline void setWeight (double weight) { weight_ = weight; }
30 
31  /** \brief get the weight of coherence.*/
32  inline double getWeight () { return weight_; }
33 
34  protected:
35 
36  /** \brief return the distance coherence between the two points.
37  * \param source instance of source point.
38  * \param target instance of target point.
39  */
40  double computeCoherence (PointInT &source, PointInT &target);
41 
42  /** \brief the weight of coherence.*/
43  double weight_;
44  };
45  }
46 }
47 
48 #ifdef PCL_NO_PRECOMPILE
49 #include <pcl/tracking/impl/distance_coherence.hpp>
50 #endif
51 
52 // #include <pcl/tracking/impl/distance_coherence.hpp>
53 
54 #endif
double computeCoherence(PointInT &source, PointInT &target)
return the distance coherence between the two points.
double getWeight()
get the weight of coherence.
void setWeight(double weight)
set the weight of coherence.
DistanceCoherence()
initialize the weight to 1.0.
PointCoherence is a base class to compute coherence between the two points.
Definition: coherence.h:17
double weight_
the weight of coherence.
DistanceCoherence computes coherence between two points from the distance between them...