Point Cloud Library (PCL)
1.12.1
Toggle main menu visibility
Loading...
Searching...
No Matches
pcl
features
normal_based_signature.h
1
/*
2
* Software License Agreement (BSD License)
3
*
4
* Point Cloud Library (PCL) - www.pointclouds.org
5
* Copyright (c) 2011, Alexandru-Eugen Ichim
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
#pragma once
41
42
#include <pcl/features/feature.h>
43
44
namespace
pcl
45
{
46
/** \brief Normal-based feature signature estimation class. Obtains the feature vector by applying Discrete Cosine and
47
* Fourier Transforms on an NxM array of real numbers representing the projection distances of the points in the input
48
* cloud to a disc around the point of interest.
49
* Please consult the following publication for more details:
50
* Xinju Li and Igor Guskov
51
* Multi-scale features for approximate alignment of point-based surfaces
52
* Proceedings of the third Eurographics symposium on Geometry processing
53
* July 2005, Vienna, Austria
54
*
55
* \note These features were meant to be used at keypoints detected by a detector using different smoothing radii
56
* (e.g., SmoothedSurfacesKeypoint)
57
* \author Alexandru-Eugen Ichim
58
*/
59
template
<
typename
Po
int
T,
typename
Po
int
NT,
typename
Po
int
Feature>
60
class
NormalBasedSignatureEstimation
:
public
FeatureFromNormals
<PointT, PointNT, PointFeature>
61
{
62
public
:
63
using
Feature
<PointT, PointFeature>
::input_
;
64
using
Feature
<PointT, PointFeature>
::tree_
;
65
using
Feature
<PointT, PointFeature>
::search_radius_
;
66
using
PCLBase
<PointT>
::indices_
;
67
using
FeatureFromNormals
<PointT, PointNT, PointFeature>
::normals_
;
68
69
using
FeatureCloud
=
pcl::PointCloud<PointFeature>
;
70
using
Ptr
= shared_ptr<NormalBasedSignatureEstimation<PointT, PointNT, PointFeature> >;
71
using
ConstPtr
= shared_ptr<const NormalBasedSignatureEstimation<PointT, PointNT, PointFeature> >;
72
73
74
75
/** \brief Empty constructor, initializes the internal parameters to the default values
76
*/
77
NormalBasedSignatureEstimation
()
78
:
FeatureFromNormals
<PointT, PointNT, PointFeature> (),
79
scale_h_ (),
80
N_ (36),
81
M_ (8),
82
N_prime_ (4),
83
M_prime_ (3)
84
{
85
}
86
87
/** \brief Setter method for the N parameter - the length of the columns used for the Discrete Fourier Transform.
88
* \param[in] n the length of the columns used for the Discrete Fourier Transform.
89
*/
90
inline
void
91
setN
(std::size_t n) { N_ = n; }
92
93
/** \brief Returns the N parameter - the length of the columns used for the Discrete Fourier Transform. */
94
inline
std::size_t
95
getN
() {
return
N_; }
96
97
/** \brief Setter method for the M parameter - the length of the rows used for the Discrete Cosine Transform.
98
* \param[in] m the length of the rows used for the Discrete Cosine Transform.
99
*/
100
inline
void
101
setM
(std::size_t m) { M_ = m; }
102
103
/** \brief Returns the M parameter - the length of the rows used for the Discrete Cosine Transform */
104
inline
std::size_t
105
getM
() {
return
M_; }
106
107
/** \brief Setter method for the N' parameter - the number of columns to be taken from the matrix of DFT and DCT
108
* values that will be contained in the output feature vector
109
* \note This value directly influences the dimensions of the type of output points (PointFeature)
110
* \param[in] n_prime the number of columns from the matrix of DFT and DCT that will be contained in the output
111
*/
112
inline
void
113
setNPrime
(std::size_t n_prime) { N_prime_ = n_prime; }
114
115
/** \brief Returns the N' parameter - the number of rows to be taken from the matrix of DFT and DCT
116
* values that will be contained in the output feature vector
117
* \note This value directly influences the dimensions of the type of output points (PointFeature)
118
*/
119
inline
std::size_t
120
getNPrime
() {
return
N_prime_; }
121
122
/** \brief Setter method for the M' parameter - the number of rows to be taken from the matrix of DFT and DCT
123
* values that will be contained in the output feature vector
124
* \note This value directly influences the dimensions of the type of output points (PointFeature)
125
* \param[in] m_prime the number of rows from the matrix of DFT and DCT that will be contained in the output
126
*/
127
inline
void
128
setMPrime
(std::size_t m_prime) { M_prime_ = m_prime; }
129
130
/** \brief Returns the M' parameter - the number of rows to be taken from the matrix of DFT and DCT
131
* values that will be contained in the output feature vector
132
* \note This value directly influences the dimensions of the type of output points (PointFeature)
133
*/
134
inline
std::size_t
135
getMPrime
() {
return
M_prime_; }
136
137
/** \brief Setter method for the scale parameter - used to determine the radius of the sampling disc around the
138
* point of interest - linked to the smoothing scale of the input cloud
139
*/
140
inline
void
141
setScale
(
float
scale) { scale_h_ = scale; }
142
143
/** \brief Returns the scale parameter - used to determine the radius of the sampling disc around the
144
* point of interest - linked to the smoothing scale of the input cloud
145
*/
146
inline
float
147
getScale
() {
return
scale_h_; }
148
149
150
protected
:
151
void
152
computeFeature
(
FeatureCloud
&output)
override
;
153
154
private
:
155
float
scale_h_;
156
std::size_t N_, M_, N_prime_, M_prime_;
157
};
158
}
159
160
#ifdef PCL_NO_PRECOMPILE
161
#include <pcl/features/impl/normal_based_signature.hpp>
162
#endif
pcl::FeatureFromNormals< PointT, PointNT, PointFeature >::FeatureFromNormals
FeatureFromNormals()
Definition
feature.h:332
pcl::FeatureFromNormals< PointT, PointNT, PointFeature >::normals_
PointCloudNConstPtr normals_
Definition
feature.h:355
pcl::Feature
Feature represents the base feature class.
Definition
feature.h:107
pcl::Feature< PointT, PointFeature >::search_radius_
double search_radius_
Definition
feature.h:240
pcl::Feature< PointT, PointFeature >::tree_
KdTreePtr tree_
Definition
feature.h:234
pcl::NormalBasedSignatureEstimation::setNPrime
void setNPrime(std::size_t n_prime)
Setter method for the N' parameter - the number of columns to be taken from the matrix of DFT and DCT...
Definition
normal_based_signature.h:113
pcl::NormalBasedSignatureEstimation::FeatureCloud
pcl::PointCloud< PointFeature > FeatureCloud
Definition
normal_based_signature.h:69
pcl::NormalBasedSignatureEstimation::setM
void setM(std::size_t m)
Setter method for the M parameter - the length of the rows used for the Discrete Cosine Transform.
Definition
normal_based_signature.h:101
pcl::NormalBasedSignatureEstimation::setScale
void setScale(float scale)
Setter method for the scale parameter - used to determine the radius of the sampling disc around the ...
Definition
normal_based_signature.h:141
pcl::NormalBasedSignatureEstimation::computeFeature
void computeFeature(FeatureCloud &output) override
Abstract feature estimation method.
Definition
normal_based_signature.hpp:46
pcl::NormalBasedSignatureEstimation::getN
std::size_t getN()
Returns the N parameter - the length of the columns used for the Discrete Fourier Transform.
Definition
normal_based_signature.h:95
pcl::NormalBasedSignatureEstimation::setMPrime
void setMPrime(std::size_t m_prime)
Setter method for the M' parameter - the number of rows to be taken from the matrix of DFT and DCT va...
Definition
normal_based_signature.h:128
pcl::NormalBasedSignatureEstimation::getScale
float getScale()
Returns the scale parameter - used to determine the radius of the sampling disc around the point of i...
Definition
normal_based_signature.h:147
pcl::NormalBasedSignatureEstimation::getM
std::size_t getM()
Returns the M parameter - the length of the rows used for the Discrete Cosine Transform.
Definition
normal_based_signature.h:105
pcl::NormalBasedSignatureEstimation::getMPrime
std::size_t getMPrime()
Returns the M' parameter - the number of rows to be taken from the matrix of DFT and DCT values that ...
Definition
normal_based_signature.h:135
pcl::NormalBasedSignatureEstimation::ConstPtr
shared_ptr< const NormalBasedSignatureEstimation< PointT, PointNT, PointFeature > > ConstPtr
Definition
normal_based_signature.h:71
pcl::NormalBasedSignatureEstimation::setN
void setN(std::size_t n)
Setter method for the N parameter - the length of the columns used for the Discrete Fourier Transform...
Definition
normal_based_signature.h:91
pcl::NormalBasedSignatureEstimation::NormalBasedSignatureEstimation
NormalBasedSignatureEstimation()
Empty constructor, initializes the internal parameters to the default values.
Definition
normal_based_signature.h:77
pcl::NormalBasedSignatureEstimation::Ptr
shared_ptr< NormalBasedSignatureEstimation< PointT, PointNT, PointFeature > > Ptr
Definition
normal_based_signature.h:70
pcl::NormalBasedSignatureEstimation::getNPrime
std::size_t getNPrime()
Returns the N' parameter - the number of rows to be taken from the matrix of DFT and DCT values that ...
Definition
normal_based_signature.h:120
pcl::PCLBase
PCL base class.
Definition
pcl_base.h:70
pcl::PCLBase::input_
PointCloudConstPtr input_
The input point cloud dataset.
Definition
pcl_base.h:147
pcl::PCLBase::indices_
IndicesPtr indices_
A pointer to the vector of point indices to use.
Definition
pcl_base.h:150
pcl::PointCloud
PointCloud represents the base class in PCL for storing collections of 3D points.
Definition
point_cloud.h:173
pcl
Definition
convolution.h:46