|
Point Cloud Library (PCL)
1.6.0
|
00001 /* 00002 * Software License Agreement (BSD License) 00003 * 00004 * Point Cloud Library (PCL) - www.pointclouds.org 00005 * Copyright (c) 2010-2012, Willow Garage, Inc. 00006 * Copyright (c) 2012-, Open Perception, Inc. 00007 * 00008 * All rights reserved. 00009 * 00010 * Redistribution and use in source and binary forms, with or without 00011 * modification, are permitted provided that the following conditions 00012 * are met: 00013 * 00014 * * Redistributions of source code must retain the above copyright 00015 * notice, this list of conditions and the following disclaimer. 00016 * * Redistributions in binary form must reproduce the above 00017 * copyright notice, this list of conditions and the following 00018 * disclaimer in the documentation and/or other materials provided 00019 * with the distribution. 00020 * * Neither the name of the copyright holder(s) nor the names of its 00021 * contributors may be used to endorse or promote products derived 00022 * from this software without specific prior written permission. 00023 * 00024 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00025 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00026 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 00027 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 00028 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 00029 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 00030 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00031 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00032 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00033 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 00034 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00035 * POSSIBILITY OF SUCH DAMAGE. 00036 * 00037 * $Id: pfh.hpp 5027 2012-03-12 03:10:45Z rusu $ 00038 * 00039 */ 00040 #ifndef PCL_ESF_H_ 00041 #define PCL_ESF_H_ 00042 00043 #include <pcl/features/feature.h> 00044 #define GRIDSIZE 64 00045 #define GRIDSIZE_H GRIDSIZE/2 00046 //#include <boost/multi_array.hpp> 00047 #include <vector> 00048 00049 namespace pcl 00050 { 00059 template <typename PointInT, typename PointOutT = pcl::ESFSignature640> 00060 class ESFEstimation: public Feature<PointInT, PointOutT> 00061 { 00062 public: 00063 using Feature<PointInT, PointOutT>::feature_name_; 00064 using Feature<PointInT, PointOutT>::getClassName; 00065 using Feature<PointInT, PointOutT>::indices_; 00066 using Feature<PointInT, PointOutT>::k_; 00067 using Feature<PointInT, PointOutT>::search_radius_; 00068 using Feature<PointInT, PointOutT>::input_; 00069 using Feature<PointInT, PointOutT>::surface_; 00070 00071 typedef typename pcl::PointCloud<PointInT> PointCloudIn; 00072 typedef typename Feature<PointInT, PointOutT>::PointCloudOut PointCloudOut; 00073 00075 ESFEstimation () : lut_ (), local_cloud_ () 00076 { 00077 feature_name_ = "ESFEstimation"; 00078 lut_.resize (GRIDSIZE); 00079 for (int i = 0; i < GRIDSIZE; ++i) 00080 { 00081 lut_[i].resize (GRIDSIZE); 00082 for (int j = 0; j < GRIDSIZE; ++j) 00083 lut_[i][j].resize (GRIDSIZE); 00084 } 00085 //lut_.resize (boost::extents[GRIDSIZE][GRIDSIZE][GRIDSIZE]); 00086 search_radius_ = 0; 00087 k_ = 5; 00088 } 00089 00093 void 00094 compute (PointCloudOut &output); 00095 00096 protected: 00097 00102 void 00103 computeFeature (PointCloudOut &output); 00104 00106 int 00107 lci (const int x1, const int y1, const int z1, 00108 const int x2, const int y2, const int z2, 00109 float &ratio, int &incnt, int &pointcount); 00110 00112 void 00113 computeESF (PointCloudIn &pc, std::vector<float> &hist); 00114 00116 void 00117 voxelize9 (PointCloudIn &cluster); 00118 00120 void 00121 cleanup9 (PointCloudIn &cluster); 00122 00124 void 00125 scale_points_unit_sphere (const pcl::PointCloud<PointInT> &pc, float scalefactor, Eigen::Vector4f& centroid); 00126 00127 private: 00128 00130 //boost::multi_array<int, 3> lut_; 00131 std::vector<std::vector<std::vector<int> > > lut_; 00132 00134 PointCloudIn local_cloud_; 00135 00139 void 00140 computeFeatureEigen (pcl::PointCloud<Eigen::MatrixXf> &) {} 00141 }; 00142 } 00143 00144 #endif // #
1.7.6.1