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