Point Cloud Library (PCL)
1.15.1
Toggle main menu visibility
Loading...
Searching...
No Matches
pcl
features
pfhrgb.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 Similar to the Point Feature Histogram descriptor, but also takes color into account. See also \ref PFHEstimation
47
* \ingroup features
48
*/
49
template
<
typename
Po
int
InT,
typename
Po
int
NT,
typename
Po
int
OutT = pcl::PFHRGBSignature250>
50
class
PFHRGBEstimation
:
public
FeatureFromNormals
<PointInT, PointNT, PointOutT>
51
{
52
public
:
53
using
Ptr
= shared_ptr<PFHRGBEstimation<PointInT, PointNT, PointOutT> >;
54
using
ConstPtr
= shared_ptr<const PFHRGBEstimation<PointInT, PointNT, PointOutT> >;
55
using
PCLBase
<PointInT>
::indices_
;
56
using
Feature
<PointInT, PointOutT>
::feature_name_
;
57
using
Feature
<PointInT, PointOutT>
::surface_
;
58
using
Feature
<PointInT, PointOutT>
::k_
;
59
using
Feature
<PointInT, PointOutT>
::search_parameter_
;
60
using
FeatureFromNormals
<PointInT, PointNT, PointOutT>
::normals_
;
61
using
PointCloudOut
=
typename
Feature<PointInT, PointOutT>::PointCloudOut
;
62
63
64
PFHRGBEstimation
()
65
: d_pi_ (1.0f / (2.0f * static_cast<float> (
M_PI
)))
66
{
67
feature_name_
=
"PFHRGBEstimation"
;
68
}
69
70
bool
71
computeRGBPairFeatures
(
const
pcl::PointCloud<PointInT>
&cloud,
const
pcl::PointCloud<PointNT>
&normals,
72
int
p_idx,
int
q_idx,
73
float
&f1,
float
&f2,
float
&f3,
float
&f4,
float
&f5,
float
&f6,
float
&f7);
74
75
void
76
computePointPFHRGBSignature
(
const
pcl::PointCloud<PointInT>
&cloud,
const
pcl::PointCloud<PointNT>
&normals,
77
const
pcl::Indices
&indices,
int
nr_split, Eigen::VectorXf &pfhrgb_histogram);
78
79
protected
:
80
void
81
computeFeature
(
PointCloudOut
&output)
override
;
82
83
private
:
84
/** \brief The number of subdivisions for each angular feature interval. */
85
int
nr_subdiv_{5};
86
87
/** \brief Placeholder for a point's PFHRGB signature. */
88
Eigen::VectorXf pfhrgb_histogram_;
89
90
/** \brief Placeholder for a PFHRGB 7-tuple. */
91
Eigen::VectorXf pfhrgb_tuple_;
92
93
/** \brief Placeholder for a histogram index. */
94
int
f_index_[7];
95
96
/** \brief Float constant = 1.0 / (2.0 * M_PI) */
97
float
d_pi_;
98
};
99
}
100
101
#ifdef PCL_NO_PRECOMPILE
102
#include <pcl/features/impl/pfhrgb.hpp>
103
#endif
pcl::FeatureFromNormals< PointInT, PointNT, pcl::PFHRGBSignature250 >::FeatureFromNormals
FeatureFromNormals()
Definition
feature.h:329
pcl::FeatureFromNormals< PointInT, PointNT, pcl::PFHRGBSignature250 >::normals_
PointCloudNConstPtr normals_
Definition
feature.h:349
pcl::Feature
Feature represents the base feature class.
Definition
feature.h:107
pcl::Feature< PointInT, pcl::PFHRGBSignature250 >::search_parameter_
double search_parameter_
Definition
feature.h:234
pcl::Feature::PointCloudOut
pcl::PointCloud< PointOutT > PointCloudOut
Definition
feature.h:124
pcl::Feature< PointInT, pcl::PFHRGBSignature250 >::k_
int k_
Definition
feature.h:240
pcl::Feature< PointInT, pcl::PFHRGBSignature250 >::feature_name_
std::string feature_name_
Definition
feature.h:220
pcl::Feature< PointInT, pcl::PFHRGBSignature250 >::surface_
PointCloudInConstPtr surface_
Definition
feature.h:228
pcl::PointCloudOut
pcl::PCLBase
PCL base class.
Definition
pcl_base.h:70
pcl::PCLBase< PointInT >::indices_
IndicesPtr indices_
Definition
pcl_base.h:150
pcl::PFHRGBEstimation::computeRGBPairFeatures
bool computeRGBPairFeatures(const pcl::PointCloud< PointInT > &cloud, const pcl::PointCloud< PointNT > &normals, int p_idx, int q_idx, float &f1, float &f2, float &f3, float &f4, float &f5, float &f6, float &f7)
Definition
pfhrgb.hpp:47
pcl::PFHRGBEstimation::Ptr
shared_ptr< PFHRGBEstimation< PointInT, PointNT, PointOutT > > Ptr
Definition
pfhrgb.h:53
pcl::PFHRGBEstimation::PFHRGBEstimation
PFHRGBEstimation()
Definition
pfhrgb.h:64
pcl::PFHRGBEstimation::PointCloudOut
typename Feature< PointInT, PointOutT >::PointCloudOut PointCloudOut
Definition
pfhrgb.h:61
pcl::PFHRGBEstimation::computeFeature
void computeFeature(PointCloudOut &output) override
Definition
pfhrgb.hpp:135
pcl::PFHRGBEstimation::ConstPtr
shared_ptr< const PFHRGBEstimation< PointInT, PointNT, PointOutT > > ConstPtr
Definition
pfhrgb.h:54
pcl::PFHRGBEstimation::computePointPFHRGBSignature
void computePointPFHRGBSignature(const pcl::PointCloud< PointInT > &cloud, const pcl::PointCloud< PointNT > &normals, const pcl::Indices &indices, int nr_split, Eigen::VectorXf &pfhrgb_histogram)
Definition
pfhrgb.hpp:64
pcl::PointCloud
PointCloud represents the base class in PCL for storing collections of 3D points.
Definition
point_cloud.h:174
pcl
Definition
convolution.h:46
pcl::Indices
IndicesAllocator<> Indices
Type used for indices in PCL.
Definition
types.h:133
M_PI
#define M_PI
Definition
pcl_macros.h:203