Point Cloud Library (PCL)  1.10.1-dev
cppf.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  * Copyright (c) 2013, Martin Szarski
8  *
9  * All rights reserved.
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions
13  * are met:
14  *
15  * * Redistributions of source code must retain the above copyright
16  * notice, this list of conditions and the following disclaimer.
17  * * Redistributions in binary form must reproduce the above
18  * copyright notice, this list of conditions and the following
19  * disclaimer in the documentation and/or other materials provided
20  * with the distribution.
21  * * Neither the name of the copyright holder(s) nor the names of its
22  * contributors may be used to endorse or promote products derived
23  * from this software without specific prior written permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
28  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
29  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
30  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
31  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
32  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
33  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
35  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36  * POSSIBILITY OF SUCH DAMAGE.
37  *
38  */
39 
40 #pragma once
41 
42 #include <pcl/features/feature.h>
43 #include <pcl/features/boost.h>
44 
45 namespace pcl
46 {
47  /** \brief
48  * \param[in] p1
49  * \param[in] n1
50  * \param[in] p2
51  * \param[in] n2
52  * \param[in] c1
53  * \param[in] c2
54  * \param[out] f1
55  * \param[out] f2
56  * \param[out] f3
57  * \param[out] f4
58  * \param[out] f5
59  * \param[out] f6
60  * \param[out] f7
61  * \param[out] f8
62  * \param[out] f9
63  * \param[out] f10
64  */
65  PCL_EXPORTS bool
66  computeCPPFPairFeature (const Eigen::Vector4f &p1, const Eigen::Vector4f &n1, const Eigen::Vector4i &c1,
67  const Eigen::Vector4f &p2, const Eigen::Vector4f &n2, const Eigen::Vector4i &c2,
68  float &f1, float &f2, float &f3, float &f4, float &f5, float &f6, float &f7, float &f8, float &f9, float &f10);
69 
70 
71 
72  /** \brief Class that calculates the "surflet" features for each pair in the given
73  * pointcloud. Please refer to the following publication for more details:
74  * C. Choi, Henrik Christensen
75  * 3D Pose Estimation of Daily Objects Using an RGB-D Camera
76  * Proceedings of IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS)
77  * 2012
78  *
79  * PointOutT is meant to be pcl::CPPFSignature - contains the 10 values of the Surflet
80  * feature and in addition, alpha_m for the respective pair - optimization proposed by
81  * the authors (see above)
82  *
83  * \author Martin Szarski, Alexandru-Eugen Ichim
84  */
85 
86  template <typename PointInT, typename PointNT, typename PointOutT>
87  class CPPFEstimation : public FeatureFromNormals<PointInT, PointNT, PointOutT>
88  {
89  public:
97 
99 
100  /** \brief Empty Constructor. */
101  CPPFEstimation ();
102 
103 
104  private:
105  /** \brief The method called for actually doing the computations
106  * \param[out] output the resulting point cloud (which should be of type pcl::CPPFSignature);
107  * its size is the size of the input cloud, squared (i.e., one point for each pair in
108  * the input cloud);
109  */
110  void
111  computeFeature (PointCloudOut &output) override;
112  };
113 }
114 
115 #ifdef PCL_NO_PRECOMPILE
116 #include <pcl/features/impl/cppf.hpp>
117 #endif
PCL_EXPORTS bool computeCPPFPairFeature(const Eigen::Vector4f &p1, const Eigen::Vector4f &n1, const Eigen::Vector4i &c1, const Eigen::Vector4f &p2, const Eigen::Vector4f &n2, const Eigen::Vector4i &c2, float &f1, float &f2, float &f3, float &f4, float &f5, float &f6, float &f7, float &f8, float &f9, float &f10)
Class that calculates the "surflet" features for each pair in the given pointcloud.
Definition: cppf.h:87
CPPFEstimation()
Empty Constructor.
Definition: cppf.hpp:49
shared_ptr< const CPPFEstimation< PointInT, PointNT, PointOutT > > ConstPtr
Definition: cppf.h:91
shared_ptr< CPPFEstimation< PointInT, PointNT, PointOutT > > Ptr
Definition: cppf.h:90
PCL base class.
Definition: pcl_base.h:70
Feature represents the base feature class.
Definition: feature.h:106
boost::shared_ptr< T > shared_ptr
Alias for boost::shared_ptr.
Definition: memory.h:81
#define PCL_EXPORTS
Definition: pcl_macros.h:276