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