Point Cloud Library (PCL) 1.12.0
nearest_pair_point_cloud_coherence.h
1#pragma once
2
3#include <pcl/search/search.h>
4#include <pcl/tracking/coherence.h>
5
6namespace pcl {
7namespace tracking {
8/** \brief @b NearestPairPointCloudCoherence computes coherence between two pointclouds
9 * using the nearest point pairs.
10 * \author Ryohei Ueda
11 * \ingroup tracking
12 */
13template <typename PointInT>
15public:
19
24
25 using Ptr = shared_ptr<NearestPairPointCloudCoherence<PointInT>>;
26 using ConstPtr = shared_ptr<const NearestPairPointCloudCoherence<PointInT>>;
29
30 /** \brief empty constructor */
32 : new_target_(false), search_(), maximum_distance_(std::numeric_limits<double>::max())
33 {
34 coherence_name_ = "NearestPairPointCloudCoherence";
35 }
36
37 /** \brief Provide a pointer to a dataset to add additional information
38 * to estimate the features for every point in the input dataset. This
39 * is optional, if this is not set, it will only use the data in the
40 * input cloud to estimate the features. This is useful when you only
41 * need to compute the features for a downsampled cloud.
42 * \param search a pointer to a PointCloud message
43 */
44 inline void
46 {
47 search_ = search;
48 }
49
50 /** \brief Get a pointer to the point cloud dataset. */
51 inline SearchPtr
53 {
54 return (search_);
55 }
56
57 /** \brief add a PointCoherence to the PointCloudCoherence.
58 * \param[in] cloud coherence a pointer to PointCoherence.
59 */
60 inline void
61 setTargetCloud(const PointCloudInConstPtr& cloud) override
62 {
63 new_target_ = true;
65 }
66
67 /** \brief set maximum distance to be taken into account.
68 * \param[in] val maximum distance.
69 */
70 inline void
72 {
74 }
75
76protected:
78
79 /** \brief This method should get called before starting the actual
80 * computation. */
81 bool
82 initCompute() override;
83
84 /** \brief A flag which is true if target_input_ is updated */
86
87 /** \brief A pointer to the spatial search object. */
89
90 /** \brief max of distance for points to be taken into account*/
92
93 /** \brief compute the nearest pairs and compute coherence using
94 * point_coherences_ */
95 void
97 const IndicesConstPtr& indices,
98 float& w_j) override;
99};
100} // namespace tracking
101} // namespace pcl
102
103// #include <pcl/tracking/impl/nearest_pair_point_cloud_coherence.hpp>
104#ifdef PCL_NO_PRECOMPILE
105#include <pcl/tracking/impl/nearest_pair_point_cloud_coherence.hpp>
106#endif
shared_ptr< const pcl::search::Search< PointT > > ConstPtr
Definition: search.h:82
shared_ptr< pcl::search::Search< PointT > > Ptr
Definition: search.h:81
NearestPairPointCloudCoherence computes coherence between two pointclouds using the nearest point pai...
bool new_target_
A flag which is true if target_input_ is updated.
bool initCompute() override
This method should get called before starting the actual computation.
typename pcl::search::Search< PointInT >::ConstPtr SearchConstPtr
void setMaximumDistance(double val)
set maximum distance to be taken into account.
void setTargetCloud(const PointCloudInConstPtr &cloud) override
add a PointCoherence to the PointCloudCoherence.
SearchPtr getSearchMethod()
Get a pointer to the point cloud dataset.
double maximum_distance_
max of distance for points to be taken into account
typename pcl::search::Search< PointInT >::Ptr SearchPtr
void computeCoherence(const PointCloudInConstPtr &cloud, const IndicesConstPtr &indices, float &w_j) override
compute the nearest pairs and compute coherence using point_coherences_
void setSearchMethod(const SearchPtr &search)
Provide a pointer to a dataset to add additional information to estimate the features for every point...
SearchPtr search_
A pointer to the spatial search object.
PointCloudCoherence is a base class to compute coherence between the two PointClouds.
Definition: coherence.h:59
typename PointCloudIn::ConstPtr PointCloudInConstPtr
Definition: coherence.h:66
typename PointCoherence< PointInT >::Ptr PointCoherencePtr
Definition: coherence.h:68
virtual void setTargetCloud(const PointCloudInConstPtr &cloud)
add a PointCoherence to the PointCloudCoherence.
Definition: coherence.h:115
std::string coherence_name_
The coherence name.
Definition: coherence.h:138
shared_ptr< PointCloudCoherence< PointInT > > Ptr
Definition: coherence.h:61
shared_ptr< const PointCloudCoherence< PointInT > > ConstPtr
Definition: coherence.h:62
shared_ptr< const Indices > IndicesConstPtr
Definition: pcl_base.h:59