Point Cloud Library (PCL)
1.15.1
Toggle main menu visibility
Loading...
Searching...
No Matches
pcl
tracking
nearest_pair_point_cloud_coherence.h
1
#pragma once
2
3
#include <pcl/search/search.h>
4
#include <pcl/tracking/coherence.h>
5
6
namespace
pcl
{
7
namespace
tracking
{
8
/** \brief @b NearestPairPointCloudCoherence computes coherence between two pointclouds
9
* using the nearest point pairs.
10
* \author Ryohei Ueda
11
* \ingroup tracking
12
*/
13
template
<
typename
Po
int
InT>
14
class
PCL_EXPORTS
NearestPairPointCloudCoherence
15
:
public
PointCloudCoherence
<PointInT> {
16
public
:
17
using
PointCloudCoherence
<PointInT>
::getClassName
;
18
using
PointCloudCoherence
<PointInT>
::coherence_name_
;
19
using
PointCloudCoherence
<PointInT>
::target_input_
;
20
21
using
PointCoherencePtr
=
typename
PointCloudCoherence<PointInT>::PointCoherencePtr
;
22
using
PointCloudInConstPtr
=
23
typename
PointCloudCoherence<PointInT>::PointCloudInConstPtr
;
24
using
BaseClass
=
PointCloudCoherence<PointInT>
;
25
26
using
Ptr
= shared_ptr<NearestPairPointCloudCoherence<PointInT>>;
27
using
ConstPtr
= shared_ptr<const NearestPairPointCloudCoherence<PointInT>>;
28
using
SearchPtr
=
typename
pcl::search::Search<PointInT>::Ptr
;
29
using
SearchConstPtr
=
typename
pcl::search::Search<PointInT>::ConstPtr
;
30
31
/** \brief empty constructor */
32
NearestPairPointCloudCoherence
()
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
45
setSearchMethod
(
const
SearchPtr
&
search
)
46
{
47
search_
=
search
;
48
}
49
50
/** \brief Get a pointer to the point cloud dataset. */
51
inline
SearchPtr
52
getSearchMethod
()
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
;
64
PointCloudCoherence<PointInT>::setTargetCloud
(cloud);
65
}
66
67
/** \brief set maximum distance to be taken into account.
68
* \param[in] val maximum distance.
69
*/
70
inline
void
71
setMaximumDistance
(
double
val)
72
{
73
maximum_distance_
= val;
74
}
75
76
protected
:
77
using
PointCloudCoherence
<PointInT>::point_coherences_;
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 */
85
bool
new_target_
{
false
};
86
87
/** \brief A pointer to the spatial search object. */
88
SearchPtr
search_
{
nullptr
};
89
90
/** \brief max of distance for points to be taken into account*/
91
double
maximum_distance_
{std::numeric_limits<double>::max()};
92
93
/** \brief compute the nearest pairs and compute coherence using
94
* point_coherences_ */
95
void
96
computeCoherence(
const
PointCloudInConstPtr& cloud,
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
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::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::PointCloudInConstPtr
typename PointCloudCoherence< PointInT >::PointCloudInConstPtr PointCloudInConstPtr
Definition
nearest_pair_point_cloud_coherence.h:22
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