Point Cloud Library (PCL)  1.14.1-dev
ppf.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  */
38 
39 #pragma once
40 
41 #include <pcl/features/feature.h>
42 
43 namespace pcl
44 {
45  /** \brief
46  * \param[in] p1
47  * \param[in] n1
48  * \param[in] p2
49  * \param[in] n2
50  * \param[out] f1
51  * \param[out] f2
52  * \param[out] f3
53  * \param[out] f4
54  */
55  PCL_EXPORTS bool
56  computePPFPairFeature (const Eigen::Vector4f &p1, const Eigen::Vector4f &n1,
57  const Eigen::Vector4f &p2, const Eigen::Vector4f &n2,
58  float &f1, float &f2, float &f3, float &f4);
59 
60 
61  /** \brief Class that calculates the "surflet" features for each pair in the given
62  * pointcloud. Please refer to the following publication for more details:
63  * B. Drost, M. Ulrich, N. Navab, S. Ilic
64  * Model Globally, Match Locally: Efficient and Robust 3D Object Recognition
65  * 2010 IEEE Conference on Computer Vision and Pattern Recognition (CVPR)
66  * 13-18 June 2010, San Francisco, CA
67  *
68  * PointOutT is meant to be pcl::PPFSignature - contains the 4 values of the Surflet
69  * feature and in addition, alpha_m for the respective pair - optimization proposed by
70  * the authors (see above)
71  *
72  * \author Alexandru-Eugen Ichim
73  */
74  template <typename PointInT, typename PointNT, typename PointOutT>
75  class PPFEstimation : public FeatureFromNormals<PointInT, PointNT, PointOutT>
76  {
77  public:
78  using Ptr = shared_ptr<PPFEstimation<PointInT, PointNT, PointOutT> >;
79  using ConstPtr = shared_ptr<const PPFEstimation<PointInT, PointNT, PointOutT> >;
85 
87 
88  /** \brief Empty Constructor. */
89  PPFEstimation ();
90 
91 
92  private:
93  /** \brief The method called for actually doing the computations
94  * \param[out] output the resulting point cloud (which should be of type pcl::PPFSignature);
95  * its size is the size of the input cloud, squared (i.e., one point for each pair in
96  * the input cloud);
97  */
98  void
99  computeFeature (PointCloudOut &output) override;
100  };
101 }
102 
103 #ifdef PCL_NO_PRECOMPILE
104 #include <pcl/features/impl/ppf.hpp>
105 #endif
Feature represents the base feature class.
Definition: feature.h:107
shared_ptr< Feature< PointInT, PointOutT > > Ptr
Definition: feature.h:114
shared_ptr< const Feature< PointInT, PointOutT > > ConstPtr
Definition: feature.h:115
PCL base class.
Definition: pcl_base.h:70
Class that calculates the "surflet" features for each pair in the given pointcloud.
Definition: ppf.h:76
PPFEstimation()
Empty Constructor.
Definition: ppf.hpp:49
PCL_EXPORTS bool computePPFPairFeature(const Eigen::Vector4f &p1, const Eigen::Vector4f &n1, const Eigen::Vector4f &p2, const Eigen::Vector4f &n2, float &f1, float &f2, float &f3, float &f4)
#define PCL_EXPORTS
Definition: pcl_macros.h:323