Point Cloud Library (PCL)
1.15.1
Toggle main menu visibility
Loading...
Searching...
No Matches
pcl
features
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
46
namespace
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
Po
int
InT,
typename
Po
int
NT,
typename
Po
int
OutT>
74
class
FPFHEstimationOMP
:
public
FPFHEstimation
<PointInT, PointNT, PointOutT>
75
{
76
public
:
77
using
Ptr
= shared_ptr<FPFHEstimationOMP<PointInT, PointNT, PointOutT> >;
78
using
ConstPtr
= shared_ptr<const FPFHEstimationOMP<PointInT, PointNT, PointOutT> >;
79
using
Feature
<PointInT, PointOutT>
::feature_name_
;
80
using
Feature
<PointInT, PointOutT>
::getClassName
;
81
using
Feature
<PointInT, PointOutT>
::indices_
;
82
using
Feature
<PointInT, PointOutT>
::k_
;
83
using
Feature
<PointInT, PointOutT>
::search_parameter_
;
84
using
Feature
<PointInT, PointOutT>
::input_
;
85
using
Feature
<PointInT, PointOutT>
::surface_
;
86
using
FeatureFromNormals
<PointInT, PointNT, PointOutT>
::normals_
;
87
using
FPFHEstimation
<PointInT, PointNT, PointOutT>
::hist_f1_
;
88
using
FPFHEstimation
<PointInT, PointNT, PointOutT>
::hist_f2_
;
89
using
FPFHEstimation
<PointInT, PointNT, PointOutT>
::hist_f3_
;
90
using
FPFHEstimation
<PointInT, PointNT, PointOutT>
::weightPointSPFHSignature
;
91
92
using
PointCloudOut
=
typename
Feature<PointInT, PointOutT>::PointCloudOut
;
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)
98
{
99
feature_name_
=
"FPFHEstimationOMP"
;
100
101
setNumberOfThreads
(nr_threads);
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. */
121
int
nr_bins_f1_
{11},
nr_bins_f2_
{11},
nr_bins_f3_
{11};
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
pcl::FPFHEstimation< PointInT, PointNT, PointOutT >::hist_f3_
Eigen::MatrixXf hist_f3_
Definition
fpfh.h:209
pcl::FPFHEstimation< PointInT, PointNT, PointOutT >::hist_f2_
Eigen::MatrixXf hist_f2_
Definition
fpfh.h:206
pcl::FPFHEstimation< PointInT, PointNT, PointOutT >::hist_f1_
Eigen::MatrixXf hist_f1_
Definition
fpfh.h:203
pcl::FPFHEstimation< PointInT, PointNT, PointOutT >::FPFHEstimation
FPFHEstimation()
Definition
fpfh.h:95
pcl::FPFHEstimation< PointInT, PointNT, PointOutT >::weightPointSPFHSignature
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)
Definition
fpfh.hpp:110
pcl::FPFHEstimationOMP::nr_bins_f2_
int nr_bins_f2_
Definition
fpfh_omp.h:121
pcl::FPFHEstimationOMP::nr_bins_f3_
int nr_bins_f3_
Definition
fpfh_omp.h:121
pcl::FPFHEstimationOMP::ConstPtr
shared_ptr< const FPFHEstimationOMP< PointInT, PointNT, PointOutT > > ConstPtr
Definition
fpfh_omp.h:78
pcl::FPFHEstimationOMP::nr_bins_f1_
int nr_bins_f1_
The number of subdivisions for each angular feature interval.
Definition
fpfh_omp.h:121
pcl::FPFHEstimationOMP::setNumberOfThreads
void setNumberOfThreads(unsigned int nr_threads=0)
Initialize the scheduler and set the number of threads to use.
Definition
fpfh_omp.hpp:52
pcl::FPFHEstimationOMP::PointCloudOut
typename Feature< PointInT, PointOutT >::PointCloudOut PointCloudOut
Definition
fpfh_omp.h:92
pcl::FPFHEstimationOMP::Ptr
shared_ptr< FPFHEstimationOMP< PointInT, PointNT, PointOutT > > Ptr
Definition
fpfh_omp.h:77
pcl::FPFHEstimationOMP::FPFHEstimationOMP
FPFHEstimationOMP(unsigned int nr_threads=0)
Initialize the scheduler and set the number of threads to use.
Definition
fpfh_omp.h:97
pcl::FeatureFromNormals
Definition
feature.h:309
pcl::FeatureFromNormals::normals_
PointCloudNConstPtr normals_
A pointer to the input dataset that contains the point normals of the XYZ dataset.
Definition
feature.h:349
pcl::Feature
Feature represents the base feature class.
Definition
feature.h:107
pcl::Feature::search_parameter_
double search_parameter_
The actual search parameter (from either search_radius_ or k_).
Definition
feature.h:234
pcl::Feature::getClassName
const std::string & getClassName() const
Get a string representation of the name of this class.
Definition
feature.h:244
pcl::Feature::PointCloudOut
pcl::PointCloud< PointOutT > PointCloudOut
Definition
feature.h:124
pcl::Feature::k_
int k_
The number of K nearest neighbors to use for each point.
Definition
feature.h:240
pcl::Feature::feature_name_
std::string feature_name_
The feature name.
Definition
feature.h:220
pcl::Feature::surface_
PointCloudInConstPtr surface_
An input point cloud describing the surface that is to be used for nearest neighbors estimation.
Definition
feature.h:228
pcl::PointCloudOut
pcl::PCLBase< PointInT >::input_
PointCloudConstPtr input_
Definition
pcl_base.h:147
pcl::PCLBase< PointInT >::indices_
IndicesPtr indices_
Definition
pcl_base.h:150
pcl
Definition
convolution.h:46