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