Point Cloud Library (PCL)
1.15.1
Toggle main menu visibility
Loading...
Searching...
No Matches
pcl
registration
impl
correspondence_rejection_features.hpp
1
/*
2
* Software License Agreement (BSD License)
3
*
4
* Point Cloud Library (PCL) - www.pointclouds.org
5
* Copyright (c) 2010-2011, Willow Garage, Inc.
6
* Copyright (c) 2012-, Open Perception, Inc.
7
*
8
* All rights reserved.
9
*
10
* Redistribution and use in source and binary forms, with or without
11
* modification, are permitted provided that the following conditions
12
* are met:
13
*
14
* * Redistributions of source code must retain the above copyright
15
* notice, this list of conditions and the following disclaimer.
16
* * Redistributions in binary form must reproduce the above
17
* copyright notice, this list of conditions and the following
18
* disclaimer in the documentation and/or other materials provided
19
* with the distribution.
20
* * Neither the name of the copyright holder(s) nor the names of its
21
* contributors may be used to endorse or promote products derived
22
* from this software without specific prior written permission.
23
*
24
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
27
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
28
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
29
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
30
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
31
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
32
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
34
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35
* POSSIBILITY OF SUCH DAMAGE.
36
*
37
* $Id$
38
*
39
*/
40
41
#ifndef PCL_REGISTRATION_IMPL_CORRESPONDENCE_REJECTION_FEATURES_HPP_
42
#define PCL_REGISTRATION_IMPL_CORRESPONDENCE_REJECTION_FEATURES_HPP_
43
44
#include <boost/pointer_cast.hpp>
// for static_pointer_cast
45
46
namespace
pcl
{
47
48
namespace
registration
{
49
50
template
<
typename
FeatureT>
51
inline
void
52
CorrespondenceRejectorFeatures::setSourceFeature
(
53
const
typename
pcl::PointCloud<FeatureT>::ConstPtr
& source_feature,
54
const
std::string& key)
55
{
56
if
(
features_map_
.count(key) == 0)
57
features_map_
[key].reset(
new
FeatureContainer<FeatureT>
);
58
boost::static_pointer_cast<FeatureContainer<FeatureT>>(
features_map_
[key])
59
->
setSourceFeature
(source_feature);
60
}
61
62
template
<
typename
FeatureT>
63
inline
typename
pcl::PointCloud<FeatureT>::ConstPtr
64
CorrespondenceRejectorFeatures::getSourceFeature
(
const
std::string& key)
65
{
66
if
(
features_map_
.count(key) == 0)
67
return
(
nullptr
);
68
return
(boost::static_pointer_cast<
FeatureContainer<FeatureT>
>(
features_map_
[key])
69
->
getSourceFeature
());
70
}
71
72
template
<
typename
FeatureT>
73
inline
void
74
CorrespondenceRejectorFeatures::setTargetFeature
(
75
const
typename
pcl::PointCloud<FeatureT>::ConstPtr
& target_feature,
76
const
std::string& key)
77
{
78
if
(
features_map_
.count(key) == 0)
79
features_map_
[key].reset(
new
FeatureContainer<FeatureT>
);
80
boost::static_pointer_cast<FeatureContainer<FeatureT>>(
features_map_
[key])
81
->
setTargetFeature
(target_feature);
82
}
83
84
template
<
typename
FeatureT>
85
inline
typename
pcl::PointCloud<FeatureT>::ConstPtr
86
CorrespondenceRejectorFeatures::getTargetFeature
(
const
std::string& key)
87
{
88
if
(
features_map_
.count(key) == 0)
89
return
(
nullptr
);
90
return
(boost::static_pointer_cast<
FeatureContainer<FeatureT>
>(
features_map_
[key])
91
->
getTargetFeature
());
92
}
93
94
template
<
typename
FeatureT>
95
inline
void
96
CorrespondenceRejectorFeatures::setDistanceThreshold
(
double
thresh,
97
const
std::string& key)
98
{
99
if
(
features_map_
.count(key) == 0)
100
features_map_
[key].reset(
new
FeatureContainer<FeatureT>
);
101
boost::static_pointer_cast<FeatureContainer<FeatureT>>(
features_map_
[key])
102
->
setDistanceThreshold
(thresh);
103
}
104
105
template
<
typename
FeatureT>
106
inline
void
107
CorrespondenceRejectorFeatures::setFeatureRepresentation
(
108
const
typename
pcl::PointRepresentation<FeatureT>::ConstPtr
& fr,
109
const
std::string& key)
110
{
111
if
(
features_map_
.count(key) == 0)
112
features_map_
[key].reset(
new
FeatureContainer<FeatureT>
);
113
boost::static_pointer_cast<FeatureContainer<FeatureT>>(
features_map_
[key])
114
->
setFeatureRepresentation
(fr);
115
}
116
117
}
// namespace registration
118
}
// namespace pcl
119
120
#endif
/* PCL_REGISTRATION_IMPL_CORRESPONDENCE_REJECTION_FEATURES_HPP_ */
pcl::PointCloud::ConstPtr
shared_ptr< const PointCloud< PointT > > ConstPtr
Definition
point_cloud.h:415
pcl::PointRepresentation::ConstPtr
shared_ptr< const PointRepresentation< PointT > > ConstPtr
Definition
point_representation.h:79
pcl::registration::CorrespondenceRejectorFeatures::FeatureContainer
An inner class containing pointers to the source and target feature clouds and the parameters needed ...
Definition
correspondence_rejection_features.h:190
pcl::registration::CorrespondenceRejectorFeatures::setFeatureRepresentation
void setFeatureRepresentation(const typename pcl::PointRepresentation< FeatureT >::ConstPtr &fr, const std::string &key)
Provide a boost shared pointer to a PointRepresentation to be used when comparing features.
Definition
correspondence_rejection_features.hpp:107
pcl::registration::CorrespondenceRejectorFeatures::getSourceFeature
pcl::PointCloud< FeatureT >::ConstPtr getSourceFeature(const std::string &key)
Get a pointer to the source cloud's feature descriptors, specified by the given key.
Definition
correspondence_rejection_features.hpp:64
pcl::registration::CorrespondenceRejectorFeatures::setTargetFeature
void setTargetFeature(const typename pcl::PointCloud< FeatureT >::ConstPtr &target_feature, const std::string &key)
Provide a pointer to a cloud of feature descriptors associated with the target point cloud.
Definition
correspondence_rejection_features.hpp:74
pcl::registration::CorrespondenceRejectorFeatures::features_map_
FeaturesMap features_map_
An STL map containing features to use when performing the correspondence search.
Definition
correspondence_rejection_features.h:180
pcl::registration::CorrespondenceRejectorFeatures::setDistanceThreshold
void setDistanceThreshold(double thresh, const std::string &key)
Set a hard distance threshold in the feature FeatureT space, between source and target features.
Definition
correspondence_rejection_features.hpp:96
pcl::registration::CorrespondenceRejectorFeatures::setSourceFeature
void setSourceFeature(const typename pcl::PointCloud< FeatureT >::ConstPtr &source_feature, const std::string &key)
Provide a pointer to a cloud of feature descriptors associated with the source point cloud.
Definition
correspondence_rejection_features.hpp:52
pcl::registration::CorrespondenceRejectorFeatures::getTargetFeature
pcl::PointCloud< FeatureT >::ConstPtr getTargetFeature(const std::string &key)
Get a pointer to the source cloud's feature descriptors, specified by the given key.
Definition
correspondence_rejection_features.hpp:86
pcl::registration
Definition
convergence_criteria.h:46
pcl
Definition
convolution.h:46