Point Cloud Library (PCL) 1.12.0
Loading...
Searching...
No Matches
shot_omp.h
1/*
2 * Software License Agreement (BSD License)
3 *
4 * Point Cloud Library (PCL) - www.pointclouds.org
5 * Copyright (c) 2009, 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 *
38 */
39
40#pragma once
41
42#include <pcl/point_types.h>
43#include <pcl/features/feature.h>
44#include <pcl/features/shot.h>
45
46namespace pcl
47{
48 /** \brief SHOTEstimationOMP estimates the Signature of Histograms of OrienTations (SHOT) descriptor for a given point cloud dataset
49 * containing points and normals, in parallel, using the OpenMP standard.
50 *
51 * The suggested PointOutT is pcl::SHOT352.
52 *
53 * \note If you use this code in any academic work, please cite:
54 *
55 * - F. Tombari, S. Salti, L. Di Stefano
56 * Unique Signatures of Histograms for Local Surface Description.
57 * In Proceedings of the 11th European Conference on Computer Vision (ECCV),
58 * Heraklion, Greece, September 5-11 2010.
59 * - F. Tombari, S. Salti, L. Di Stefano
60 * A Combined Texture-Shape Descriptor For Enhanced 3D Feature Matching.
61 * In Proceedings of the 18th International Conference on Image Processing (ICIP),
62 * Brussels, Belgium, September 11-14 2011.
63 *
64 * \author Samuele Salti
65 * \ingroup features
66 */
67
68 template <typename PointInT, typename PointNT, typename PointOutT = pcl::SHOT352, typename PointRFT = pcl::ReferenceFrame>
69 class SHOTEstimationOMP : public SHOTEstimation<PointInT, PointNT, PointOutT, PointRFT>
70 {
71 public:
93
96
97 /** \brief Empty constructor. */
102
103 /** \brief Initialize the scheduler and set the number of threads to use.
104 * \param nr_threads the number of hardware threads to use (0 sets the value back to automatic)
105 */
106 void
107 setNumberOfThreads (unsigned int nr_threads = 0);
108
109 protected:
110
111 /** \brief Estimate the Signatures of Histograms of OrienTations (SHOT) descriptors at a set of points given by
112 * <setInputCloud (), setIndices ()> using the surface in setSearchSurface () and the spatial locator in
113 * setSearchMethod ()
114 * \param output the resultant point cloud model dataset that contains the SHOT feature estimates
115 */
116 void
118
119 /** \brief This method should get called before starting the actual computation. */
120 bool
121 initCompute () override;
122
123 /** \brief The number of threads the scheduler should use. */
124 unsigned int threads_;
125 };
126
127 /** \brief SHOTColorEstimationOMP estimates the Signature of Histograms of OrienTations (SHOT) descriptor for a given point cloud dataset
128 * containing points, normals and colors, in parallel, using the OpenMP standard.
129 *
130 * The suggested PointOutT is pcl::SHOT1344.
131 *
132 * \note If you use this code in any academic work, please cite:
133 *
134 * - F. Tombari, S. Salti, L. Di Stefano
135 * Unique Signatures of Histograms for Local Surface Description.
136 * In Proceedings of the 11th European Conference on Computer Vision (ECCV),
137 * Heraklion, Greece, September 5-11 2010.
138 * - F. Tombari, S. Salti, L. Di Stefano
139 * A Combined Texture-Shape Descriptor For Enhanced 3D Feature Matching.
140 * In Proceedings of the 18th International Conference on Image Processing (ICIP),
141 * Brussels, Belgium, September 11-14 2011.
142 *
143 * \author Samuele Salti
144 * \ingroup features
145 */
146
147 template <typename PointInT, typename PointNT, typename PointOutT = pcl::SHOT1344, typename PointRFT = pcl::ReferenceFrame>
148 class SHOTColorEstimationOMP : public SHOTColorEstimation<PointInT, PointNT, PointOutT, PointRFT>
149 {
150 public:
175
178
179 /** \brief Empty constructor. */
187
188 /** \brief Initialize the scheduler and set the number of threads to use.
189 * \param nr_threads the number of hardware threads to use (0 sets the value back to automatic)
190 */
191 void
192 setNumberOfThreads (unsigned int nr_threads = 0);
193
194 protected:
195
196 /** \brief Estimate the Signatures of Histograms of OrienTations (SHOT) descriptors at a set of points given by
197 * <setInputCloud (), setIndices ()> using the surface in setSearchSurface () and the spatial locator in
198 * setSearchMethod ()
199 * \param output the resultant point cloud model dataset that contains the SHOT feature estimates
200 */
201 void
203
204 /** \brief This method should get called before starting the actual computation. */
205 bool
206 initCompute () override;
207
208 /** \brief The number of threads the scheduler should use. */
209 unsigned int threads_;
210 };
211
212}
213
214#ifdef PCL_NO_PRECOMPILE
215#include <pcl/features/impl/shot_omp.hpp>
216#endif
Iterator class for point clouds with or without given indices.
PointCloudNConstPtr normals_
A pointer to the input dataset that contains the point normals of the XYZ dataset.
Definition feature.h:355
Feature represents the base feature class.
Definition feature.h:107
double search_parameter_
The actual search parameter (from either search_radius_ or k_).
Definition feature.h:237
const std::string & getClassName() const
Get a string representation of the name of this class.
Definition feature.h:247
double search_radius_
The nearest neighbors search radius for each point.
Definition feature.h:240
int k_
The number of K nearest neighbors to use for each point.
Definition feature.h:243
std::string feature_name_
The feature name.
Definition feature.h:223
PointCloudInConstPtr surface_
An input point cloud describing the surface that is to be used for nearest neighbors estimation.
Definition feature.h:231
bool fake_surface_
If no surface is given, we use the input PointCloud as the surface.
Definition feature.h:258
FeatureWithLocalReferenceFrames provides a public interface for descriptor extractor classes which ne...
Definition feature.h:449
PointCloudLRFConstPtr frames_
A boost shared pointer to the local reference frames.
Definition feature.h:483
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
SHOTColorEstimation estimates the Signature of Histograms of OrienTations (SHOT) descriptor for a giv...
Definition shot.h:299
bool b_describe_color_
Compute color descriptor.
Definition shot.h:387
bool b_describe_shape_
Compute shape descriptor.
Definition shot.h:384
int nr_color_bins_
The number of bins in each color histogram.
Definition shot.h:390
SHOTColorEstimationOMP estimates the Signature of Histograms of OrienTations (SHOT) descriptor for a ...
Definition shot_omp.h:149
void setNumberOfThreads(unsigned int nr_threads=0)
Initialize the scheduler and set the number of threads to use.
Definition shot_omp.hpp:209
typename Feature< PointInT, PointOutT >::PointCloudOut PointCloudOut
Definition shot_omp.h:176
unsigned int threads_
The number of threads the scheduler should use.
Definition shot_omp.h:209
SHOTColorEstimationOMP(bool describe_shape=true, bool describe_color=true, unsigned int nr_threads=0)
Empty constructor.
Definition shot_omp.h:180
typename Feature< PointInT, PointOutT >::PointCloudIn PointCloudIn
Definition shot_omp.h:177
void computeFeature(PointCloudOut &output) override
Estimate the Signatures of Histograms of OrienTations (SHOT) descriptors at a set of points given by ...
Definition shot_omp.hpp:223
bool initCompute() override
This method should get called before starting the actual computation.
Definition shot_omp.hpp:88
SHOTEstimation estimates the Signature of Histograms of OrienTations (SHOT) descriptor for a given po...
Definition shot.h:71
double radius1_2_
1/2 of the search radius.
Definition shot.h:188
const int nr_grid_sector_
Number of azimuthal sectors.
Definition shot.h:191
double radius3_4_
3/4 of the search radius.
Definition shot.h:182
int descLength_
One SHOT length.
Definition shot.h:197
double sqradius_
The squared search radius.
Definition shot.h:179
float lrf_radius_
The radius used for the LRF computation.
Definition shot.h:176
int nr_shape_bins_
The number of bins in each shape histogram.
Definition shot.h:170
double radius1_4_
1/4 of the search radius.
Definition shot.h:185
SHOTEstimation estimates the Signature of Histograms of OrienTations (SHOT) descriptor for a given po...
Definition shot.h:221
SHOTEstimationOMP estimates the Signature of Histograms of OrienTations (SHOT) descriptor for a given...
Definition shot_omp.h:70
unsigned int threads_
The number of threads the scheduler should use.
Definition shot_omp.h:124
void setNumberOfThreads(unsigned int nr_threads=0)
Initialize the scheduler and set the number of threads to use.
Definition shot_omp.hpp:126
bool initCompute() override
This method should get called before starting the actual computation.
Definition shot_omp.hpp:50
void computeFeature(PointCloudOut &output) override
Estimate the Signatures of Histograms of OrienTations (SHOT) descriptors at a set of points given by ...
Definition shot_omp.hpp:140
SHOTEstimationOMP(unsigned int nr_threads=0)
Empty constructor.
Definition shot_omp.h:98
typename Feature< PointInT, PointOutT >::PointCloudIn PointCloudIn
Definition shot_omp.h:95
typename Feature< PointInT, PointOutT >::PointCloudOut PointCloudOut
Definition shot_omp.h:94
Defines all the PCL implemented PointT point type structures.