Point Cloud Library (PCL)  1.14.1-dev
narf_descriptor.h
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Point Cloud Library (PCL) - www.pointclouds.org
5  * Copyright (c) 2010, 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 #pragma once
39 
40 #include <pcl/point_types.h>
41 #include <pcl/features/feature.h>
42 
43 namespace pcl
44 {
45  // Forward declarations
46  class RangeImage;
47 
48  /** @b Computes NARF feature descriptors for points in a range image
49  * See B. Steder, R. B. Rusu, K. Konolige, and W. Burgard
50  * Point Feature Extraction on 3D Range Scans Taking into Account Object Boundaries
51  * In Proc. of the IEEE Int. Conf. on Robotics &Automation (ICRA). 2011.
52  * \author Bastian Steder
53  * \ingroup features
54  */
55  class PCL_EXPORTS NarfDescriptor : public Feature<PointWithRange,Narf36>
56  {
57  public:
58  using Ptr = shared_ptr<NarfDescriptor>;
59  using ConstPtr = shared_ptr<const NarfDescriptor>;
60  // =====TYPEDEFS=====
62 
63  // =====STRUCTS/CLASSES=====
64  struct Parameters
65  {
66  Parameters() = default;
67  float support_size{-1.0f};
68  bool rotation_invariant{true};
69  };
70 
71  // =====CONSTRUCTOR & DESTRUCTOR=====
72  /** Constructor */
73  NarfDescriptor (const RangeImage* range_image=nullptr, const pcl::Indices* indices=nullptr);
74  /** Destructor */
75  ~NarfDescriptor() override;
76 
77  // =====METHODS=====
78  //! Set input data
79  void
80  setRangeImage (const RangeImage* range_image, const pcl::Indices* indices=nullptr);
81 
82  //! Overwrite the compute function of the base class
83  void
85 
86  // =====GETTER=====
87  //! Get a reference to the parameters struct
88  Parameters&
89  getParameters () { return parameters_;}
90 
91  protected:
92  // =====PROTECTED MEMBER VARIABLES=====
93  const RangeImage* range_image_{};
95 
96  // =====PROTECTED METHODS=====
97  /** Implementation of abstract derived function */
98  void
99  computeFeature (PointCloudOut& output) override;
100  };
101 
102 } // namespace end
Feature represents the base feature class.
Definition: feature.h:107
Computes NARF feature descriptors for points in a range image See B.
shared_ptr< NarfDescriptor > Ptr
void compute(PointCloudOut &output)
Overwrite the compute function of the base class.
void computeFeature(PointCloudOut &output) override
Implementation of abstract derived function.
NarfDescriptor(const RangeImage *range_image=nullptr, const pcl::Indices *indices=nullptr)
Constructor.
void setRangeImage(const RangeImage *range_image, const pcl::Indices *indices=nullptr)
Set input data.
~NarfDescriptor() override
Destructor.
shared_ptr< const NarfDescriptor > ConstPtr
Parameters & getParameters()
Get a reference to the parameters struct.
PointCloud represents the base class in PCL for storing collections of 3D points.
Definition: point_cloud.h:173
RangeImage is derived from pcl/PointCloud and provides functionalities with focus on situations where...
Definition: range_image.h:55
Defines all the PCL implemented PointT point type structures.
IndicesAllocator<> Indices
Type used for indices in PCL.
Definition: types.h:133
#define PCL_EXPORTS
Definition: pcl_macros.h:323