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>
9 template <
typename Po
intInT>
16 for (
const auto& point : *cloud) {
18 float k_distance = 0.0;
20 PointInT input_point = point;
21 search_->approxNearestSearch(input_point, k_index, k_distance);
22 if (k_distance < maximum_distance_ * maximum_distance_) {
23 PointInT target_point = (*target_input_)[k_index];
24 double coherence_val = 1.0;
25 for (std::size_t i = 0; i < point_coherences_.size(); i++) {
27 double w = coherence->compute(input_point, target_point);
33 w = -
static_cast<float>(val);
36 template <
typename Po
intInT>
41 PCL_ERROR(
"[pcl::%s::initCompute] PointCloudCoherence::Init failed.\n",
42 getClassName().c_str());
51 if (new_target_ && target_input_) {
52 search_->setInputCloud(target_input_);
62 #define PCL_INSTANTIATE_ApproxNearestPairPointCloudCoherence(T) \
63 template class PCL_EXPORTS pcl::tracking::ApproxNearestPairPointCloudCoherence<T>;
bool initCompute() override
This method should get called before starting the actual computation.
typename NearestPairPointCloudCoherence< PointInT >::PointCloudInConstPtr PointCloudInConstPtr
void computeCoherence(const PointCloudInConstPtr &cloud, const IndicesConstPtr &indices, float &w_j) override
compute the nearest pairs and compute coherence using point_coherences_
typename NearestPairPointCloudCoherence< PointInT >::PointCoherencePtr PointCoherencePtr
PointCloudCoherence is a base class to compute coherence between the two PointClouds.
shared_ptr< const Indices > IndicesConstPtr
detail::int_type_t< detail::index_type_size, detail::index_type_signed > index_t
Type used for an index in PCL.