Point Cloud Library (PCL) 1.12.0
Loading...
Searching...
No Matches
fpfh_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 * $Id$
38 *
39 */
40
41#pragma once
42
43#include <pcl/features/feature.h>
44#include <pcl/features/fpfh.h>
45
46namespace pcl
47{
48 /** \brief FPFHEstimationOMP estimates the Fast Point Feature Histogram (FPFH) descriptor for a given point cloud
49 * dataset containing points and normals, in parallel, using the OpenMP standard.
50 *
51 * \note If you use this code in any academic work, please cite:
52 *
53 * - R.B. Rusu, N. Blodow, M. Beetz.
54 * Fast Point Feature Histograms (FPFH) for 3D Registration.
55 * In Proceedings of the IEEE International Conference on Robotics and Automation (ICRA),
56 * Kobe, Japan, May 12-17 2009.
57 * - R.B. Rusu, A. Holzbach, N. Blodow, M. Beetz.
58 * Fast Geometric Point Labeling using Conditional Random Fields.
59 * In Proceedings of the 22nd IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS),
60 * St. Louis, MO, USA, October 11-15 2009.
61 *
62 * \attention
63 * The convention for FPFH features is:
64 * - if a query point's nearest neighbors cannot be estimated, the FPFH feature will be set to NaN
65 * (not a number)
66 * - it is impossible to estimate a FPFH descriptor for a point that
67 * doesn't have finite 3D coordinates. Therefore, any point that contains
68 * NaN data on x, y, or z, will have its FPFH feature property set to NaN.
69 *
70 * \author Radu B. Rusu
71 * \ingroup features
72 */
73 template <typename PointInT, typename PointNT, typename PointOutT>
74 class FPFHEstimationOMP : public FPFHEstimation<PointInT, PointNT, PointOutT>
75 {
76 public:
91
93
94 /** \brief Initialize the scheduler and set the number of threads to use.
95 * \param[in] nr_threads the number of hardware threads to use (0 sets the value back to automatic)
96 */
97 FPFHEstimationOMP (unsigned int nr_threads = 0) : nr_bins_f1_ (11), nr_bins_f2_ (11), nr_bins_f3_ (11)
98 {
99 feature_name_ = "FPFHEstimationOMP";
100
102 }
103
104 /** \brief Initialize the scheduler and set the number of threads to use.
105 * \param[in] nr_threads the number of hardware threads to use (0 sets the value back to automatic)
106 */
107 void
108 setNumberOfThreads (unsigned int nr_threads = 0);
109
110 private:
111 /** \brief Estimate the Fast Point Feature Histograms (FPFH) 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[out] output the resultant point cloud model dataset that contains the FPFH feature estimates
115 */
116 void
117 computeFeature (PointCloudOut &output) override;
118
119 public:
120 /** \brief The number of subdivisions for each angular feature interval. */
122 private:
123 /** \brief The number of threads the scheduler should use. */
124 unsigned int threads_;
125 };
126}
127
128#ifdef PCL_NO_PRECOMPILE
129#include <pcl/features/impl/fpfh_omp.hpp>
130#endif
Iterator class for point clouds with or without given indices.
FPFHEstimation estimates the Fast Point Feature Histogram (FPFH) descriptor for a given point cloud d...
Definition fpfh.h:79
Eigen::MatrixXf hist_f3_
Placeholder for the f3 histogram.
Definition fpfh.h:209
Eigen::MatrixXf hist_f2_
Placeholder for the f2 histogram.
Definition fpfh.h:206
Eigen::MatrixXf hist_f1_
Placeholder for the f1 histogram.
Definition fpfh.h:203
void weightPointSPFHSignature(const Eigen::MatrixXf &hist_f1, const Eigen::MatrixXf &hist_f2, const Eigen::MatrixXf &hist_f3, const pcl::Indices &indices, const std::vector< float > &dists, Eigen::VectorXf &fpfh_histogram)
Weight the SPFH (Simple Point Feature Histograms) individual histograms to create the final FPFH (Fas...
Definition fpfh.hpp:110
FPFHEstimationOMP estimates the Fast Point Feature Histogram (FPFH) descriptor for a given point clou...
Definition fpfh_omp.h:75
int nr_bins_f1_
The number of subdivisions for each angular feature interval.
Definition fpfh_omp.h:121
void setNumberOfThreads(unsigned int nr_threads=0)
Initialize the scheduler and set the number of threads to use.
Definition fpfh_omp.hpp:52
typename Feature< PointInT, PointOutT >::PointCloudOut PointCloudOut
Definition fpfh_omp.h:92
FPFHEstimationOMP(unsigned int nr_threads=0)
Initialize the scheduler and set the number of threads to use.
Definition fpfh_omp.h:97
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
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
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