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