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