|
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-2011, Willow Garage, Inc. 00006 * 00007 * All rights reserved. 00008 * 00009 * Redistribution and use in source and binary forms, with or without 00010 * modification, are permitted provided that the following conditions 00011 * are met: 00012 * 00013 * * Redistributions of source code must retain the above copyright 00014 * notice, this list of conditions and the following disclaimer. 00015 * * Redistributions in binary form must reproduce the above 00016 * copyright notice, this list of conditions and the following 00017 * disclaimer in the documentation and/or other materials provided 00018 * with the distribution. 00019 * * Neither the name of Willow Garage, Inc. nor the names of its 00020 * contributors may be used to endorse or promote products derived 00021 * from this software without specific prior written permission. 00022 * 00023 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00024 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00025 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 00026 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 00027 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 00028 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 00029 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00030 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00031 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00032 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 00033 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00034 * POSSIBILITY OF SUCH DAMAGE. 00035 * 00036 * $Id: intensity_spin.h 5026 2012-03-12 02:51:44Z rusu $ 00037 * 00038 */ 00039 #ifndef PCL_INTENSITY_SPIN_H_ 00040 #define PCL_INTENSITY_SPIN_H_ 00041 00042 #include <pcl/features/feature.h> 00043 00044 namespace pcl 00045 { 00056 template <typename PointInT, typename PointOutT> 00057 class IntensitySpinEstimation: public Feature<PointInT, PointOutT> 00058 { 00059 public: 00060 using Feature<PointInT, PointOutT>::feature_name_; 00061 using Feature<PointInT, PointOutT>::getClassName; 00062 00063 using Feature<PointInT, PointOutT>::input_; 00064 using Feature<PointInT, PointOutT>::indices_; 00065 using Feature<PointInT, PointOutT>::surface_; 00066 00067 using Feature<PointInT, PointOutT>::tree_; 00068 using Feature<PointInT, PointOutT>::search_radius_; 00069 00070 typedef typename pcl::PointCloud<PointInT> PointCloudIn; 00071 typedef typename Feature<PointInT, PointOutT>::PointCloudOut PointCloudOut; 00072 00074 IntensitySpinEstimation () : nr_distance_bins_ (4), nr_intensity_bins_ (5), sigma_ (1.0) 00075 { 00076 feature_name_ = "IntensitySpinEstimation"; 00077 }; 00078 00089 void 00090 computeIntensitySpinImage (const PointCloudIn &cloud, 00091 float radius, float sigma, int k, 00092 const std::vector<int> &indices, 00093 const std::vector<float> &squared_distances, 00094 Eigen::MatrixXf &intensity_spin_image); 00095 00099 inline void 00100 setNrDistanceBins (size_t nr_distance_bins) { nr_distance_bins_ = static_cast<int> (nr_distance_bins); }; 00101 00103 inline int 00104 getNrDistanceBins () { return (nr_distance_bins_); }; 00105 00109 inline void 00110 setNrIntensityBins (size_t nr_intensity_bins) { nr_intensity_bins_ = static_cast<int> (nr_intensity_bins); }; 00111 00113 inline int 00114 getNrIntensityBins () { return (nr_intensity_bins_); }; 00115 00119 inline void 00120 setSmoothingBandwith (float sigma) { sigma_ = sigma; }; 00121 00123 inline float 00124 getSmoothingBandwith () { return (sigma_); }; 00125 00126 00131 void 00132 computeFeature (PointCloudOut &output); 00133 00135 int nr_distance_bins_; 00136 00138 int nr_intensity_bins_; 00139 00141 float sigma_; 00142 00143 private: 00147 void 00148 computeFeatureEigen (pcl::PointCloud<Eigen::MatrixXf> &) {} 00149 }; 00150 00161 template <typename PointInT> 00162 class IntensitySpinEstimation<PointInT, Eigen::MatrixXf>: public IntensitySpinEstimation<PointInT, pcl::Histogram<20> > 00163 { 00164 public: 00165 using IntensitySpinEstimation<PointInT, pcl::Histogram<20> >::getClassName; 00166 using IntensitySpinEstimation<PointInT, pcl::Histogram<20> >::input_; 00167 using IntensitySpinEstimation<PointInT, pcl::Histogram<20> >::indices_; 00168 using IntensitySpinEstimation<PointInT, pcl::Histogram<20> >::surface_; 00169 using IntensitySpinEstimation<PointInT, pcl::Histogram<20> >::search_radius_; 00170 using IntensitySpinEstimation<PointInT, pcl::Histogram<20> >::nr_intensity_bins_; 00171 using IntensitySpinEstimation<PointInT, pcl::Histogram<20> >::nr_distance_bins_; 00172 using IntensitySpinEstimation<PointInT, pcl::Histogram<20> >::tree_; 00173 using IntensitySpinEstimation<PointInT, pcl::Histogram<20> >::sigma_; 00174 using IntensitySpinEstimation<PointInT, pcl::Histogram<20> >::compute; 00175 00176 private: 00181 void 00182 computeFeatureEigen (pcl::PointCloud<Eigen::MatrixXf> &output); 00183 00187 void 00188 compute (pcl::PointCloud<pcl::Normal> &) {} 00189 }; 00190 } 00191 00192 #endif // #ifndef PCL_INTENSITY_SPIN_H_
1.7.6.1