Point Cloud Library (PCL) 1.15.0
Loading...
Searching...
No Matches
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
44namespace 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 PointT, typename PointNT, typename PointFeature>
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_;
67 using FeatureFromNormals<PointT, PointNT, PointFeature>::normals_;
68
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 */
78 : FeatureFromNormals<PointT, PointNT, PointFeature> ()
79 {
80 }
81
82 /** \brief Setter method for the N parameter - the length of the columns used for the Discrete Fourier Transform.
83 * \param[in] n the length of the columns used for the Discrete Fourier Transform.
84 */
85 inline void
86 setN (std::size_t n) { N_ = n; }
87
88 /** \brief Returns the N parameter - the length of the columns used for the Discrete Fourier Transform. */
89 inline std::size_t
90 getN () { return N_; }
91
92 /** \brief Setter method for the M parameter - the length of the rows used for the Discrete Cosine Transform.
93 * \param[in] m the length of the rows used for the Discrete Cosine Transform.
94 */
95 inline void
96 setM (std::size_t m) { M_ = m; }
97
98 /** \brief Returns the M parameter - the length of the rows used for the Discrete Cosine Transform */
99 inline std::size_t
100 getM () { return M_; }
101
102 /** \brief Setter method for the N' parameter - the number of columns to be taken from the matrix of DFT and DCT
103 * values that will be contained in the output feature vector
104 * \note This value directly influences the dimensions of the type of output points (PointFeature)
105 * \param[in] n_prime the number of columns from the matrix of DFT and DCT that will be contained in the output
106 */
107 inline void
108 setNPrime (std::size_t n_prime) { N_prime_ = n_prime; }
109
110 /** \brief Returns the N' parameter - the number of rows to be taken from the matrix of DFT and DCT
111 * values that will be contained in the output feature vector
112 * \note This value directly influences the dimensions of the type of output points (PointFeature)
113 */
114 inline std::size_t
115 getNPrime () { return N_prime_; }
116
117 /** \brief Setter method for the M' parameter - the number of rows to be taken from the matrix of DFT and DCT
118 * values that will be contained in the output feature vector
119 * \note This value directly influences the dimensions of the type of output points (PointFeature)
120 * \param[in] m_prime the number of rows from the matrix of DFT and DCT that will be contained in the output
121 */
122 inline void
123 setMPrime (std::size_t m_prime) { M_prime_ = m_prime; }
124
125 /** \brief Returns the M' parameter - the number of rows to be taken from the matrix of DFT and DCT
126 * values that will be contained in the output feature vector
127 * \note This value directly influences the dimensions of the type of output points (PointFeature)
128 */
129 inline std::size_t
130 getMPrime () { return M_prime_; }
131
132 /** \brief Setter method for the scale parameter - used to determine the radius of the sampling disc around the
133 * point of interest - linked to the smoothing scale of the input cloud
134 */
135 inline void
136 setScale (float scale) { scale_h_ = scale; }
137
138 /** \brief Returns the scale parameter - used to determine the radius of the sampling disc around the
139 * point of interest - linked to the smoothing scale of the input cloud
140 */
141 inline float
142 getScale () { return scale_h_; }
143
144
145 protected:
146 void
147 computeFeature (FeatureCloud &output) override;
148
149 private:
150 float scale_h_{};
151 std::size_t N_{36}, M_{8}, N_prime_{4}, M_prime_{3};
152 };
153}
154
155#ifdef PCL_NO_PRECOMPILE
156#include <pcl/features/impl/normal_based_signature.hpp>
157#endif
PointCloudNConstPtr normals_
A pointer to the input dataset that contains the point normals of the XYZ dataset.
Definition feature.h:349
Feature represents the base feature class.
Definition feature.h:107
double search_radius_
The nearest neighbors search radius for each point.
Definition feature.h:237
KdTreePtr tree_
A pointer to the spatial search object.
Definition feature.h:231
Normal-based feature signature estimation class.
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...
pcl::PointCloud< PointFeature > FeatureCloud
void setM(std::size_t m)
Setter method for the M parameter - the length of the rows used for the Discrete Cosine Transform.
void setScale(float scale)
Setter method for the scale parameter - used to determine the radius of the sampling disc around the ...
void computeFeature(FeatureCloud &output) override
std::size_t getN()
Returns the N parameter - the length of the columns used for the Discrete Fourier Transform.
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...
float getScale()
Returns the scale parameter - used to determine the radius of the sampling disc around the point of i...
std::size_t getM()
Returns the M parameter - the length of the rows used for the Discrete Cosine Transform.
std::size_t getMPrime()
Returns the M' parameter - the number of rows to be taken from the matrix of DFT and DCT values that ...
shared_ptr< const NormalBasedSignatureEstimation< PointT, PointNT, PointFeature > > ConstPtr
void setN(std::size_t n)
Setter method for the N parameter - the length of the columns used for the Discrete Fourier Transform...
NormalBasedSignatureEstimation()
Empty constructor, initializes the internal parameters to the default values.
shared_ptr< NormalBasedSignatureEstimation< PointT, PointNT, PointFeature > > Ptr
std::size_t getNPrime()
Returns the N' parameter - the number of rows to be taken from the matrix of DFT and DCT values that ...
PCL base class.
Definition pcl_base.h:70
PointCloudConstPtr input_
The input point cloud dataset.
Definition pcl_base.h:147
IndicesPtr indices_
A pointer to the vector of point indices to use.
Definition pcl_base.h:150
PointCloud represents the base class in PCL for storing collections of 3D points.
A point structure representing Euclidean xyz coordinates, and the RGB color.