1 #ifndef PCL_TRACKING_IMPL_APPROX_NEAREST_PAIR_POINT_CLOUD_COHERENCE_H_
2 #define PCL_TRACKING_IMPL_APPROX_NEAREST_PAIR_POINT_CLOUD_COHERENCE_H_
4 #include <pcl/search/octree.h>
5 #include <pcl/tracking/approx_nearest_pair_point_cloud_coherence.h>
11 template <
typename Po
intInT>
void
17 for (std::size_t i = 0; i < cloud->points.size (); i++)
20 float k_distance = 0.0;
22 PointInT input_point = cloud->points[i];
23 search_->approxNearestSearch(input_point, k_index, k_distance);
24 if (k_distance < maximum_distance_ * maximum_distance_)
26 PointInT target_point = target_input_->points[k_index];
27 double coherence_val = 1.0;
28 for (std::size_t i = 0; i < point_coherences_.size (); i++)
31 double w = coherence->compute (input_point, target_point);
37 w = - static_cast<float> (val);
40 template <
typename Po
intInT>
bool
45 PCL_ERROR (
"[pcl::%s::initCompute] PointCloudCoherence::Init failed.\n", getClassName ().c_str ());
54 if (new_target_ && target_input_)
56 search_->setInputCloud (target_input_);
66 #define PCL_INSTANTIATE_ApproxNearestPairPointCloudCoherence(T) template class PCL_EXPORTS pcl::tracking::ApproxNearestPairPointCloudCoherence<T>;