Point Cloud Library (PCL)  1.7.1
distance_coherence.hpp
1 #ifndef PCL_TRACKING_IMPL_DISTANCE_COHERENCE_H_
2 #define PCL_TRACKING_IMPL_DISTANCE_COHERENCE_H_
3 
4 #include <Eigen/Dense>
5 #include <pcl/tracking/distance_coherence.h>
6 
7 namespace pcl
8 {
9  namespace tracking
10  {
11  template <typename PointInT> double
12  DistanceCoherence<PointInT>::computeCoherence (PointInT &source, PointInT &target)
13  {
14  Eigen::Vector4f p = source.getVector4fMap ();
15  Eigen::Vector4f p_dash = target.getVector4fMap ();
16  double d = (p - p_dash).norm ();
17  return 1.0 / (1.0 + d * d * weight_);
18  }
19  }
20 }
21 
22 #define PCL_INSTANTIATE_DistanceCoherence(T) template class PCL_EXPORTS pcl::tracking::DistanceCoherence<T>;
23 
24 #endif
double computeCoherence(PointInT &source, PointInT &target)
return the distance coherence between the two points.