nearest_pair_point_cloud_coherence.h
#ifndef PCL_TRACKING_NEAREST_PAIR_POINT_CLOUD_COHERENCE_H_
#define PCL_TRACKING_NEAREST_PAIR_POINT_CLOUD_COHERENCE_H_
#include <pcl/search/search.h>
#include <pcl/tracking/coherence.h>
namespace pcl
{
namespace tracking
{
/** \brief @b NearestPairPointCloudCoherence computes coherence between two pointclouds using the
nearest point pairs.
* \author Ryohei Ueda
* \ingroup tracking
*/
template <typename PointInT>
class NearestPairPointCloudCoherence: public PointCloudCoherence<PointInT>
{
public:
using PointCloudCoherence<PointInT>::getClassName;
using PointCloudCoherence<PointInT>::coherence_name_;
using PointCloudCoherence<PointInT>::target_input_;
typedef typename PointCloudCoherence<PointInT>::PointCoherencePtr PointCoherencePtr;
typedef typename PointCloudCoherence<PointInT>::PointCloudInConstPtr PointCloudInConstPtr;
typedef PointCloudCoherence<PointInT> BaseClass;
typedef boost::shared_ptr<NearestPairPointCloudCoherence<PointInT> > Ptr;
typedef boost::shared_ptr<const NearestPairPointCloudCoherence<PointInT> > ConstPtr;
typedef boost::shared_ptr<pcl::search::Search<PointInT> > SearchPtr;
typedef boost::shared_ptr<const pcl::search::Search<PointInT> > SearchConstPtr;
/** \brief empty constructor */
NearestPairPointCloudCoherence ()
: new_target_ (false)
, search_ ()
, maximum_distance_ (std::numeric_limits<double>::max ())
{
coherence_name_ = "NearestPairPointCloudCoherence";
}
/** \brief Provide a pointer to a dataset to add additional information
* to estimate the features for every point in the input dataset. This
* is optional, if this is not set, it will only use the data in the
* input cloud to estimate the features. This is useful when you only
* need to compute the features for a downsampled cloud.
* \param search a pointer to a PointCloud message
*/
inline void
setSearchMethod (const SearchPtr &search) { search_ = search; }
/** \brief Get a pointer to the point cloud dataset. */
inline SearchPtr
getSearchMethod () { return (search_); }
/** \brief add a PointCoherence to the PointCloudCoherence.
* \param[in] cloud coherence a pointer to PointCoherence.
*/
virtual inline void
setTargetCloud (const PointCloudInConstPtr &cloud)
{
new_target_ = true;
PointCloudCoherence<PointInT>::setTargetCloud (cloud);
}
/** \brief set maximum distance to be taken into account.
* \param[in] val maximum distance.
*/
inline void setMaximumDistance (double val) { maximum_distance_ = val; }
protected:
using PointCloudCoherence<PointInT>::point_coherences_;
/** \brief This method should get called before starting the actual computation. */
virtual bool initCompute ();
/** \brief A flag which is true if target_input_ is updated */
bool new_target_;
/** \brief A pointer to the spatial search object. */
SearchPtr search_;
/** \brief max of distance for points to be taken into account*/
double maximum_distance_;
/** \brief compute the nearest pairs and compute coherence using point_coherences_ */
virtual void
computeCoherence (const PointCloudInConstPtr &cloud, const IndicesConstPtr &indices, float &w_j);
};
}
}
// #include <pcl/tracking/impl/nearest_pair_point_cloud_coherence.hpp>
#ifdef PCL_NO_PRECOMPILE
#include <pcl/tracking/impl/nearest_pair_point_cloud_coherence.hpp>
#endif
#endif
pcl::tracking::NearestPairPointCloudCoherence::new_target_
bool new_target_
A flag which is true if target_input_ is updated.
Definition: nearest_pair_point_cloud_coherence.h:79
pcl::tracking::NearestPairPointCloudCoherence::search_
SearchPtr search_
A pointer to the spatial search object.
Definition: nearest_pair_point_cloud_coherence.h:82
pcl::tracking::NearestPairPointCloudCoherence
NearestPairPointCloudCoherence computes coherence between two pointclouds using the nearest point pai...
Definition: nearest_pair_point_cloud_coherence.h:18
pcl::tracking::NearestPairPointCloudCoherence::maximum_distance_
double maximum_distance_
max of distance for points to be taken into account
Definition: nearest_pair_point_cloud_coherence.h:85
pcl::tracking::NearestPairPointCloudCoherence::computeCoherence
virtual void computeCoherence(const PointCloudInConstPtr &cloud, const IndicesConstPtr &indices, float &w_j)
compute the nearest pairs and compute coherence using point_coherences_
Definition: nearest_pair_point_cloud_coherence.hpp:13
pcl::tracking::NearestPairPointCloudCoherence::Ptr
boost::shared_ptr< NearestPairPointCloudCoherence< PointInT > > Ptr
Definition: nearest_pair_point_cloud_coherence.h:29
pcl
Definition: cloud_iterator.h:46
pcl::tracking::PointCloudCoherence::PointCoherencePtr
PointCoherence< PointInT >::Ptr PointCoherencePtr
Definition: coherence.h:70
pcl::tracking::NearestPairPointCloudCoherence::initCompute
virtual bool initCompute()
This method should get called before starting the actual computation.
Definition: nearest_pair_point_cloud_coherence.hpp:45
std
Definition: multi_grid_octree_data.hpp:45
pcl::tracking::PointCloudCoherence::coherence_name_
std::string coherence_name_
The coherence name.
Definition: coherence.h:120
pcl::tracking::NearestPairPointCloudCoherence::PointCoherencePtr
PointCloudCoherence< PointInT >::PointCoherencePtr PointCoherencePtr
Definition: nearest_pair_point_cloud_coherence.h:25
pcl::tracking::NearestPairPointCloudCoherence::ConstPtr
boost::shared_ptr< const NearestPairPointCloudCoherence< PointInT > > ConstPtr
Definition: nearest_pair_point_cloud_coherence.h:30
pcl::tracking::NearestPairPointCloudCoherence::setTargetCloud
virtual void setTargetCloud(const PointCloudInConstPtr &cloud)
add a PointCoherence to the PointCloudCoherence.
Definition: nearest_pair_point_cloud_coherence.h:61
pcl::tracking::NearestPairPointCloudCoherence::BaseClass
PointCloudCoherence< PointInT > BaseClass
Definition: nearest_pair_point_cloud_coherence.h:27
pcl::tracking::NearestPairPointCloudCoherence::SearchConstPtr
boost::shared_ptr< const pcl::search::Search< PointInT > > SearchConstPtr
Definition: nearest_pair_point_cloud_coherence.h:32
pcl::tracking::PointCloudCoherence
PointCloudCoherence is a base class to compute coherence between the two PointClouds.
Definition: coherence.h:60
pcl::tracking::NearestPairPointCloudCoherence::PointCloudInConstPtr
PointCloudCoherence< PointInT >::PointCloudInConstPtr PointCloudInConstPtr
Definition: nearest_pair_point_cloud_coherence.h:26
pcl::IndicesConstPtr
boost::shared_ptr< const std::vector< int > > IndicesConstPtr
Definition: pcl_base.h:61
pcl::tracking::PointCloudCoherence::setTargetCloud
virtual void setTargetCloud(const PointCloudInConstPtr &cloud)
add a PointCoherence to the PointCloudCoherence.
Definition: coherence.h:105
pcl::tracking::NearestPairPointCloudCoherence::setMaximumDistance
void setMaximumDistance(double val)
set maximum distance to be taken into account.
Definition: nearest_pair_point_cloud_coherence.h:70
pcl::tracking::NearestPairPointCloudCoherence::setSearchMethod
void setSearchMethod(const SearchPtr &search)
Provide a pointer to a dataset to add additional information to estimate the features for every point...
Definition: nearest_pair_point_cloud_coherence.h:51
pcl::tracking::NearestPairPointCloudCoherence::NearestPairPointCloudCoherence
NearestPairPointCloudCoherence()
empty constructor
Definition: nearest_pair_point_cloud_coherence.h:35
pcl::tracking::NearestPairPointCloudCoherence::getSearchMethod
SearchPtr getSearchMethod()
Get a pointer to the point cloud dataset.
Definition: nearest_pair_point_cloud_coherence.h:55
pcl::tracking::PointCloudCoherence::PointCloudInConstPtr
PointCloudIn::ConstPtr PointCloudInConstPtr
Definition: coherence.h:68
pcl::tracking::NearestPairPointCloudCoherence::SearchPtr
boost::shared_ptr< pcl::search::Search< PointInT > > SearchPtr
Definition: nearest_pair_point_cloud_coherence.h:31