Loading...
Searching...
No Matches
nearest_pair_point_cloud_coherence.h
#pragma once
#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 PCL_EXPORTS NearestPairPointCloudCoherence
: public PointCloudCoherence<PointInT> {
public:
using PointCloudCoherence<PointInT>::getClassName;
using PointCloudCoherence<PointInT>::coherence_name_;
using PointCloudCoherence<PointInT>::target_input_;
using PointCoherencePtr = typename PointCloudCoherence<PointInT>::PointCoherencePtr;
using PointCloudInConstPtr =
typename PointCloudCoherence<PointInT>::PointCloudInConstPtr;
using BaseClass = PointCloudCoherence<PointInT>;
using Ptr = shared_ptr<NearestPairPointCloudCoherence<PointInT>>;
using ConstPtr = shared_ptr<const NearestPairPointCloudCoherence<PointInT>>;
using SearchPtr = typename pcl::search::Search<PointInT>::Ptr;
using SearchConstPtr = typename pcl::search::Search<PointInT>::ConstPtr;
/** \brief empty constructor */
NearestPairPointCloudCoherence()
{
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.
*/
inline void
setTargetCloud(const PointCloudInConstPtr& cloud) override
{
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. */
bool
initCompute() override;
/** \brief A flag which is true if target_input_ is updated */
bool new_target_{false};
/** \brief A pointer to the spatial search object. */
SearchPtr search_{nullptr};
/** \brief max of distance for points to be taken into account*/
double maximum_distance_{std::numeric_limits<double>::max()};
/** \brief compute the nearest pairs and compute coherence using
* point_coherences_ */
void
computeCoherence(const PointCloudInConstPtr& cloud,
const IndicesConstPtr& indices,
float& w_j) override;
};
} // namespace tracking
} // namespace pcl
// #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
pcl::search::Search::ConstPtr
shared_ptr< const pcl::search::Search< PointT > > ConstPtr
Definition search.h:82
pcl::search::Search::Ptr
shared_ptr< pcl::search::Search< PointT > > Ptr
Definition search.h:81
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:85
pcl::tracking::NearestPairPointCloudCoherence::SearchConstPtr
typename pcl::search::Search< PointInT >::ConstPtr SearchConstPtr
Definition nearest_pair_point_cloud_coherence.h:29
pcl::tracking::NearestPairPointCloudCoherence::setMaximumDistance
void setMaximumDistance(double val)
set maximum distance to be taken into account.
Definition nearest_pair_point_cloud_coherence.h:71
pcl::tracking::NearestPairPointCloudCoherence::PointCoherencePtr
typename PointCloudCoherence< PointInT >::PointCoherencePtr PointCoherencePtr
Definition nearest_pair_point_cloud_coherence.h:21
pcl::tracking::NearestPairPointCloudCoherence::BaseClass
PointCloudCoherence< PointInT > BaseClass
Definition nearest_pair_point_cloud_coherence.h:24
pcl::tracking::NearestPairPointCloudCoherence::PointCloudInConstPtr
typename PointCloudCoherence< PointInT >::PointCloudInConstPtr PointCloudInConstPtr
Definition nearest_pair_point_cloud_coherence.h:22
pcl::tracking::NearestPairPointCloudCoherence::setTargetCloud
void setTargetCloud(const PointCloudInConstPtr &cloud) override
add a PointCoherence to the PointCloudCoherence.
Definition nearest_pair_point_cloud_coherence.h:61
pcl::tracking::NearestPairPointCloudCoherence::getSearchMethod
SearchPtr getSearchMethod()
Get a pointer to the point cloud dataset.
Definition nearest_pair_point_cloud_coherence.h:52
pcl::tracking::NearestPairPointCloudCoherence::NearestPairPointCloudCoherence
NearestPairPointCloudCoherence()
empty constructor
Definition nearest_pair_point_cloud_coherence.h:32
pcl::tracking::NearestPairPointCloudCoherence::Ptr
shared_ptr< NearestPairPointCloudCoherence< PointInT > > Ptr
Definition nearest_pair_point_cloud_coherence.h:26
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:91
pcl::tracking::NearestPairPointCloudCoherence::SearchPtr
typename pcl::search::Search< PointInT >::Ptr SearchPtr
Definition nearest_pair_point_cloud_coherence.h:28
pcl::tracking::NearestPairPointCloudCoherence::ConstPtr
shared_ptr< const NearestPairPointCloudCoherence< PointInT > > ConstPtr
Definition nearest_pair_point_cloud_coherence.h:27
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:45
pcl::tracking::NearestPairPointCloudCoherence::search_
SearchPtr search_
A pointer to the spatial search object.
Definition nearest_pair_point_cloud_coherence.h:88
pcl::tracking::PointCloudCoherence
PointCloudCoherence is a base class to compute coherence between the two PointClouds.
Definition coherence.h:59
pcl::tracking::PointCloudCoherence::target_input_
PointCloudInConstPtr target_input_
a pointer to target point cloud
Definition coherence.h:141
pcl::tracking::PointCloudCoherence::getClassName
const std::string & getClassName() const
Get a string representation of the name of this class.
Definition coherence.h:132
pcl::tracking::PointCloudCoherence::PointCloudInConstPtr
typename PointCloudIn::ConstPtr PointCloudInConstPtr
Definition coherence.h:66
pcl::tracking::PointCloudCoherence::PointCoherencePtr
typename PointCoherence< PointInT >::Ptr PointCoherencePtr
Definition coherence.h:68
pcl::tracking::PointCloudCoherence::setTargetCloud
virtual void setTargetCloud(const PointCloudInConstPtr &cloud)
add a PointCoherence to the PointCloudCoherence.
Definition coherence.h:115
pcl::tracking::PointCloudCoherence::coherence_name_
std::string coherence_name_
The coherence name.
Definition coherence.h:138
pcl::tracking::PointCloudCoherence::PointCloudCoherence
PointCloudCoherence()
Constructor.
Definition coherence.h:70
pcl::search
Definition brute_force.h:45
pcl::tracking
Definition approx_nearest_pair_point_cloud_coherence.h:7
pcl
Definition convolution.h:46
pcl::IndicesConstPtr
shared_ptr< const Indices > IndicesConstPtr
Definition pcl_base.h:59