Point Cloud Library (PCL)  1.6.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
shot.h
Go to the documentation of this file.
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Point Cloud Library (PCL) - www.pointclouds.org
5  * Copyright (c) 2010-2011, Willow Garage, Inc.
6  *
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  *
13  * * Redistributions of source code must retain the above copyright
14  * notice, this list of conditions and the following disclaimer.
15  * * Redistributions in binary form must reproduce the above
16  * copyright notice, this list of conditions and the following
17  * disclaimer in the documentation and/or other materials provided
18  * with the distribution.
19  * * Neither the name of Willow Garage, Inc. nor the names of its
20  * contributors may be used to endorse or promote products derived
21  * from this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34  * POSSIBILITY OF SUCH DAMAGE.
35  *
36  *
37  */
38 
39 #ifndef PCL_SHOT_H_
40 #define PCL_SHOT_H_
41 
42 #include <pcl/point_types.h>
43 #include <pcl/features/feature.h>
44 
45 namespace pcl
46 {
66  template <typename PointInT, typename PointNT, typename PointOutT, typename PointRFT = pcl::ReferenceFrame>
67  class SHOTEstimationBase : public FeatureFromNormals<PointInT, PointNT, PointOutT>,
68  public FeatureWithLocalReferenceFrames<PointInT, PointRFT>
69  {
70  public:
82 
84 
85  protected:
89  SHOTEstimationBase (int nr_shape_bins = 10) :
90  nr_shape_bins_ (nr_shape_bins),
91  shot_ (),
92  sqradius_ (0), radius3_4_ (0), radius1_4_ (0), radius1_2_ (0),
93  nr_grid_sector_ (32),
94  maxAngularSectors_ (28),
95  descLength_ (0)
96  {
97  feature_name_ = "SHOTEstimation";
98  };
99 
100  public:
107  virtual void
108  computePointSHOT (const int index,
109  const std::vector<int> &indices,
110  const std::vector<float> &sqr_dists,
111  Eigen::VectorXf &shot) = 0;
112 
113  protected:
114 
116  virtual bool
117  initCompute ();
118 
128  void
129  interpolateSingleChannel (const std::vector<int> &indices,
130  const std::vector<float> &sqr_dists,
131  const int index,
132  std::vector<double> &binDistance,
133  const int nr_bins,
134  Eigen::VectorXf &shot);
135 
140  void
141  normalizeHistogram (Eigen::VectorXf &shot, int desc_length);
142 
143 
150  void
151  createBinDistanceShape (int index, const std::vector<int> &indices,
152  std::vector<double> &bin_distance_shape);
153 
155  int nr_shape_bins_;
156 
158  Eigen::VectorXf shot_;
159 
161  double sqradius_;
162 
164  double radius3_4_;
165 
167  double radius1_4_;
168 
170  double radius1_2_;
171 
173  const int nr_grid_sector_;
174 
176  const int maxAngularSectors_;
177 
179  int descLength_;
180 
184  void
185  computeFeatureEigen (pcl::PointCloud<Eigen::MatrixXf> &) {}
186  };
187 
205  //template <typename PointInT, typename PointNT, typename PointRFT>
206  //PCL_DEPRECATED (class, "SHOTEstimationBase<..., Eigen::MatrixXf, ...> IS DEPRECATED")
207  //SHOTEstimationBase<PointInT, PointNT, Eigen::MatrixXf, PointRFT> : public SHOTEstimationBase<PointInT, PointNT, pcl::SHOT, PointRFT>
208  //{
209  //public:
210  //using SHOTEstimationBase<PointInT, PointNT, pcl::SHOT, PointRFT>::getClassName;
211  //using SHOTEstimationBase<PointInT, PointNT, pcl::SHOT, PointRFT>::input_;
212  //using SHOTEstimationBase<PointInT, PointNT, pcl::SHOT, PointRFT>::indices_;
213  //using SHOTEstimationBase<PointInT, PointNT, pcl::SHOT, PointRFT>::k_;
214  //using SHOTEstimationBase<PointInT, PointNT, pcl::SHOT, PointRFT>::search_parameter_;
215  //using SHOTEstimationBase<PointInT, PointNT, pcl::SHOT, PointRFT>::search_radius_;
216  //using SHOTEstimationBase<PointInT, PointNT, pcl::SHOT, PointRFT>::surface_;
217  //using SHOTEstimationBase<PointInT, PointNT, pcl::SHOT, PointRFT>::descLength_;
218  //using SHOTEstimationBase<PointInT, PointNT, pcl::SHOT, PointRFT>::nr_grid_sector_;
219  //using SHOTEstimationBase<PointInT, PointNT, pcl::SHOT, PointRFT>::nr_shape_bins_;
220  //using SHOTEstimationBase<PointInT, PointNT, pcl::SHOT, PointRFT>::sqradius_;
221  //using SHOTEstimationBase<PointInT, PointNT, pcl::SHOT, PointRFT>::radius3_4_;
222  //using SHOTEstimationBase<PointInT, PointNT, pcl::SHOT, PointRFT>::radius1_4_;
223  //using SHOTEstimationBase<PointInT, PointNT, pcl::SHOT, PointRFT>::radius1_2_;
224  //using SHOTEstimationBase<PointInT, PointNT, pcl::SHOT, PointRFT>::shot_;
225  //using FeatureWithLocalReferenceFrames<PointInT, PointRFT>::frames_;
226 //
228  //* \param[in] nr_shape_bins the number of bins in the shape histogram
229  //*/
230  //SHOTEstimationBase (int nr_shape_bins = 10) : SHOTEstimationBase<PointInT, PointNT, pcl::SHOT, PointRFT> (nr_shape_bins) {};
231 //
233  //* <setInputCloud (), setIndices ()> using the surface in setSearchSurface () and the spatial locator in
234  //* setSearchMethod ()
235  //* \param output the resultant point cloud model dataset that contains the SHOT feature estimates
236  //*/
237  //void
238  //computeFeatureEigen (pcl::PointCloud<Eigen::MatrixXf> &output);
239 //
241  //* <setInputCloud (), setIndices ()> using the surface in setSearchSurface ()
242  //* and the spatial locator in setSearchMethod ()
243  //* \param[out] output the resultant point cloud model dataset containing the estimated features
244  //*/
245  //void
246  //computeEigen (pcl::PointCloud<Eigen::MatrixXf> &output)
247  //{
248  //pcl::SHOTEstimationBase<PointInT, PointNT, pcl::SHOT, PointRFT>::computeEigen (output);
249  //}
250 //
252  //* \param[out] output the output point cloud
253  //*/
254  //void
255  //compute (pcl::PointCloud<pcl::SHOT> &) {}
256  //};
257 
275  template <typename PointInT, typename PointNT, typename PointOutT = pcl::SHOT352, typename PointRFT = pcl::ReferenceFrame>
276  class SHOTEstimation : public SHOTEstimationBase<PointInT, PointNT, PointOutT, PointRFT>
277  {
278  public:
299 
301 
303  SHOTEstimation () : SHOTEstimationBase<PointInT, PointNT, PointOutT, PointRFT> (10)
304  {
305  feature_name_ = "SHOTEstimation";
306  };
307 
314  virtual void
315  computePointSHOT (const int index,
316  const std::vector<int> &indices,
317  const std::vector<float> &sqr_dists,
318  Eigen::VectorXf &shot);
319  protected:
325  void
326  computeFeature (pcl::PointCloud<PointOutT> &output);
327  };
328 
346  template <typename PointInT, typename PointNT, typename PointRFT>
347  class PCL_DEPRECATED_CLASS (SHOTEstimation, "SHOTEstimation<..., pcl::SHOT, ...> IS DEPRECATED, USE SHOTEstimation<..., pcl::SHOT352, ...> INSTEAD")
348  <PointInT, PointNT, pcl::SHOT, PointRFT>
349  : public SHOTEstimationBase<PointInT, PointNT, pcl::SHOT, PointRFT>
350  {
351  public:
352  using SHOTEstimationBase<PointInT, PointNT, pcl::SHOT, PointRFT>::feature_name_;
353  using SHOTEstimationBase<PointInT, PointNT, pcl::SHOT, PointRFT>::getClassName;
354  using SHOTEstimationBase<PointInT, PointNT, pcl::SHOT, PointRFT>::indices_;
355  using SHOTEstimationBase<PointInT, PointNT, pcl::SHOT, PointRFT>::k_;
356  using SHOTEstimationBase<PointInT, PointNT, pcl::SHOT, PointRFT>::search_parameter_;
357  using SHOTEstimationBase<PointInT, PointNT, pcl::SHOT, PointRFT>::search_radius_;
358  using SHOTEstimationBase<PointInT, PointNT, pcl::SHOT, PointRFT>::surface_;
359  using SHOTEstimationBase<PointInT, PointNT, pcl::SHOT, PointRFT>::input_;
360  using SHOTEstimationBase<PointInT, PointNT, pcl::SHOT, PointRFT>::normals_;
361  using SHOTEstimationBase<PointInT, PointNT, pcl::SHOT, PointRFT>::descLength_;
362  using SHOTEstimationBase<PointInT, PointNT, pcl::SHOT, PointRFT>::nr_grid_sector_;
363  using SHOTEstimationBase<PointInT, PointNT, pcl::SHOT, PointRFT>::nr_shape_bins_;
364  using SHOTEstimationBase<PointInT, PointNT, pcl::SHOT, PointRFT>::sqradius_;
365  using SHOTEstimationBase<PointInT, PointNT, pcl::SHOT, PointRFT>::radius3_4_;
366  using SHOTEstimationBase<PointInT, PointNT, pcl::SHOT, PointRFT>::radius1_4_;
367  using SHOTEstimationBase<PointInT, PointNT, pcl::SHOT, PointRFT>::radius1_2_;
368  using SHOTEstimationBase<PointInT, PointNT, pcl::SHOT, PointRFT>::maxAngularSectors_;
369  using SHOTEstimationBase<PointInT, PointNT, pcl::SHOT, PointRFT>::interpolateSingleChannel;
370  using SHOTEstimationBase<PointInT, PointNT, pcl::SHOT, PointRFT>::shot_;
371  using FeatureWithLocalReferenceFrames<PointInT, PointRFT>::frames_;
372 
374 
378  SHOTEstimation (int nr_shape_bins = 10) : SHOTEstimationBase<PointInT, PointNT, pcl::SHOT, PointRFT> (nr_shape_bins)
379  {
380  feature_name_ = "SHOTEstimation";
381  };
382 
389  virtual void
390  computePointSHOT (const int index,
391  const std::vector<int> &indices,
392  const std::vector<float> &sqr_dists,
393  Eigen::VectorXf &shot);
394 
395  protected:
401  void
402  computeFeature (pcl::PointCloud<pcl::SHOT> &output);
403  };
404 
422  template <typename PointInT, typename PointNT, typename PointRFT>
423  class SHOTEstimation<PointInT, PointNT, Eigen::MatrixXf, PointRFT> : public SHOTEstimation<PointInT, PointNT, pcl::SHOT352, PointRFT>
424  {
425  public:
426  using SHOTEstimation<PointInT, PointNT, pcl::SHOT352, PointRFT>::feature_name_;
427  using SHOTEstimation<PointInT, PointNT, pcl::SHOT352, PointRFT>::getClassName;
428  using SHOTEstimation<PointInT, PointNT, pcl::SHOT352, PointRFT>::indices_;
429  using SHOTEstimation<PointInT, PointNT, pcl::SHOT352, PointRFT>::k_;
430  using SHOTEstimation<PointInT, PointNT, pcl::SHOT352, PointRFT>::search_parameter_;
431  using SHOTEstimation<PointInT, PointNT, pcl::SHOT352, PointRFT>::search_radius_;
432  using SHOTEstimation<PointInT, PointNT, pcl::SHOT352, PointRFT>::surface_;
433  using SHOTEstimation<PointInT, PointNT, pcl::SHOT352, PointRFT>::input_;
434  using SHOTEstimation<PointInT, PointNT, pcl::SHOT352, PointRFT>::normals_;
435  using SHOTEstimation<PointInT, PointNT, pcl::SHOT352, PointRFT>::descLength_;
436  using SHOTEstimation<PointInT, PointNT, pcl::SHOT352, PointRFT>::nr_grid_sector_;
437  using SHOTEstimation<PointInT, PointNT, pcl::SHOT352, PointRFT>::nr_shape_bins_;
438  using SHOTEstimation<PointInT, PointNT, pcl::SHOT352, PointRFT>::sqradius_;
439  using SHOTEstimation<PointInT, PointNT, pcl::SHOT352, PointRFT>::radius3_4_;
440  using SHOTEstimation<PointInT, PointNT, pcl::SHOT352, PointRFT>::radius1_4_;
441  using SHOTEstimation<PointInT, PointNT, pcl::SHOT352, PointRFT>::radius1_2_;
442  using SHOTEstimation<PointInT, PointNT, pcl::SHOT352, PointRFT>::maxAngularSectors_;
443  using SHOTEstimation<PointInT, PointNT, pcl::SHOT352, PointRFT>::interpolateSingleChannel;
444  using SHOTEstimation<PointInT, PointNT, pcl::SHOT352, PointRFT>::shot_;
445  using FeatureWithLocalReferenceFrames<PointInT, PointRFT>::frames_;
446 
448  SHOTEstimation (int nr_shape_bins = 10) : SHOTEstimation<PointInT, PointNT, pcl::SHOT352, PointRFT> ()
449  {
450  feature_name_ = "SHOTEstimation";
451  nr_shape_bins_ = nr_shape_bins;
452  };
453 
459  void
461  {
463  }
464 
471  //virtual void
472  //computePointSHOT (const int index,
473  //const std::vector<int> &indices,
474  //const std::vector<float> &sqr_dists,
475  //Eigen::VectorXf &shot);
476 
477  protected:
483  void
484  computeFeatureEigen (pcl::PointCloud<Eigen::MatrixXf> &output);
485 
486 
490  void
491  compute (pcl::PointCloud<pcl::SHOT352> &) { assert(0); }
492  };
493 
511  template <typename PointInT, typename PointNT, typename PointOutT = pcl::SHOT1344, typename PointRFT = pcl::ReferenceFrame>
512  class SHOTColorEstimation : public SHOTEstimationBase<PointInT, PointNT, PointOutT, PointRFT>
513  {
514  public:
515  using SHOTEstimationBase<PointInT, PointNT, PointOutT, PointRFT>::feature_name_;
516  using SHOTEstimationBase<PointInT, PointNT, PointOutT, PointRFT>::getClassName;
517  using SHOTEstimationBase<PointInT, PointNT, PointOutT, PointRFT>::indices_;
518  using SHOTEstimationBase<PointInT, PointNT, PointOutT, PointRFT>::k_;
519  using SHOTEstimationBase<PointInT, PointNT, PointOutT, PointRFT>::search_parameter_;
520  using SHOTEstimationBase<PointInT, PointNT, PointOutT, PointRFT>::search_radius_;
521  using SHOTEstimationBase<PointInT, PointNT, PointOutT, PointRFT>::surface_;
522  using SHOTEstimationBase<PointInT, PointNT, PointOutT, PointRFT>::input_;
523  using SHOTEstimationBase<PointInT, PointNT, PointOutT, PointRFT>::normals_;
524  using SHOTEstimationBase<PointInT, PointNT, PointOutT, PointRFT>::descLength_;
525  using SHOTEstimationBase<PointInT, PointNT, PointOutT, PointRFT>::nr_grid_sector_;
526  using SHOTEstimationBase<PointInT, PointNT, PointOutT, PointRFT>::nr_shape_bins_;
527  using SHOTEstimationBase<PointInT, PointNT, PointOutT, PointRFT>::sqradius_;
528  using SHOTEstimationBase<PointInT, PointNT, PointOutT, PointRFT>::radius3_4_;
529  using SHOTEstimationBase<PointInT, PointNT, PointOutT, PointRFT>::radius1_4_;
530  using SHOTEstimationBase<PointInT, PointNT, PointOutT, PointRFT>::radius1_2_;
531  using SHOTEstimationBase<PointInT, PointNT, PointOutT, PointRFT>::maxAngularSectors_;
532  using SHOTEstimationBase<PointInT, PointNT, PointOutT, PointRFT>::interpolateSingleChannel;
533  using SHOTEstimationBase<PointInT, PointNT, PointOutT, PointRFT>::shot_;
534  using FeatureWithLocalReferenceFrames<PointInT, PointRFT>::frames_;
535 
537 
542  SHOTColorEstimation (bool describe_shape = true,
543  bool describe_color = true)
544  : SHOTEstimationBase<PointInT, PointNT, PointOutT, PointRFT> (10),
545  b_describe_shape_ (describe_shape),
546  b_describe_color_ (describe_color),
547  nr_color_bins_ (30)
548  {
549  feature_name_ = "SHOTColorEstimation";
550  };
551 
558  virtual void
559  computePointSHOT (const int index,
560  const std::vector<int> &indices,
561  const std::vector<float> &sqr_dists,
562  Eigen::VectorXf &shot);
563  protected:
569  void
570  computeFeature (pcl::PointCloud<PointOutT> &output);
571 
582  void
583  interpolateDoubleChannel (const std::vector<int> &indices,
584  const std::vector<float> &sqr_dists,
585  const int index,
586  std::vector<double> &binDistanceShape,
587  std::vector<double> &binDistanceColor,
588  const int nr_bins_shape,
589  const int nr_bins_color,
590  Eigen::VectorXf &shot);
591 
593  bool b_describe_shape_;
594 
596  bool b_describe_color_;
597 
599  int nr_color_bins_;
600 
601  public:
610  static void
611  RGB2CIELAB (unsigned char R, unsigned char G, unsigned char B, float &L, float &A, float &B2);
612 
613  static float sRGB_LUT[256];
614  static float sXYZ_LUT[4000];
615  };
616 
617  template <typename PointInT, typename PointNT, typename PointRFT>
618  class SHOTColorEstimation<PointInT, PointNT, Eigen::MatrixXf, PointRFT> : public SHOTColorEstimation<PointInT, PointNT, pcl::SHOT1344, PointRFT>
619  {
620  public:
621  using SHOTColorEstimation<PointInT, PointNT, pcl::SHOT1344, PointRFT>::feature_name_;
622  using SHOTColorEstimation<PointInT, PointNT, pcl::SHOT1344, PointRFT>::getClassName;
623  using SHOTColorEstimation<PointInT, PointNT, pcl::SHOT1344, PointRFT>::indices_;
624  using SHOTColorEstimation<PointInT, PointNT, pcl::SHOT1344, PointRFT>::k_;
625  using SHOTColorEstimation<PointInT, PointNT, pcl::SHOT1344, PointRFT>::search_parameter_;
626  using SHOTColorEstimation<PointInT, PointNT, pcl::SHOT1344, PointRFT>::search_radius_;
627  using SHOTColorEstimation<PointInT, PointNT, pcl::SHOT1344, PointRFT>::surface_;
628  using SHOTColorEstimation<PointInT, PointNT, pcl::SHOT1344, PointRFT>::input_;
629  using SHOTColorEstimation<PointInT, PointNT, pcl::SHOT1344, PointRFT>::normals_;
630  using SHOTColorEstimation<PointInT, PointNT, pcl::SHOT1344, PointRFT>::descLength_;
631  using SHOTColorEstimation<PointInT, PointNT, pcl::SHOT1344, PointRFT>::nr_grid_sector_;
632  using SHOTColorEstimation<PointInT, PointNT, pcl::SHOT1344, PointRFT>::nr_shape_bins_;
633  using SHOTColorEstimation<PointInT, PointNT, pcl::SHOT1344, PointRFT>::sqradius_;
634  using SHOTColorEstimation<PointInT, PointNT, pcl::SHOT1344, PointRFT>::radius3_4_;
635  using SHOTColorEstimation<PointInT, PointNT, pcl::SHOT1344, PointRFT>::radius1_4_;
636  using SHOTColorEstimation<PointInT, PointNT, pcl::SHOT1344, PointRFT>::radius1_2_;
637  using SHOTColorEstimation<PointInT, PointNT, pcl::SHOT1344, PointRFT>::maxAngularSectors_;
638  using SHOTColorEstimation<PointInT, PointNT, pcl::SHOT1344, PointRFT>::interpolateSingleChannel;
639  using SHOTColorEstimation<PointInT, PointNT, pcl::SHOT1344, PointRFT>::shot_;
640  using SHOTColorEstimation<PointInT, PointNT, pcl::SHOT1344, PointRFT>::b_describe_shape_;
641  using SHOTColorEstimation<PointInT, PointNT, pcl::SHOT1344, PointRFT>::b_describe_color_;
642  using SHOTColorEstimation<PointInT, PointNT, pcl::SHOT1344, PointRFT>::nr_color_bins_;
643  using FeatureWithLocalReferenceFrames<PointInT, PointRFT>::frames_;
644 
649  SHOTColorEstimation (bool describe_shape = true,
650  bool describe_color = true,
651  int nr_shape_bins = 10,
652  int nr_color_bins = 30)
653  : SHOTColorEstimation<PointInT, PointNT, pcl::SHOT1344, PointRFT> (describe_shape, describe_color)
654  {
655  feature_name_ = "SHOTColorEstimation";
656  nr_shape_bins_ = nr_shape_bins;
657  nr_color_bins_ = nr_color_bins;
658  };
659 
665  void
667  {
668  pcl::SHOTColorEstimation<PointInT, PointNT, pcl::SHOT1344, PointRFT>::computeEigen (output);
669  }
670 
671  protected:
677  void
678  computeFeatureEigen (pcl::PointCloud<Eigen::MatrixXf> &output);
679 
680 
684  void
685  compute (pcl::PointCloud<pcl::SHOT1344> &) { assert(0); }
686  };
687 
705  template <typename PointNT, typename PointRFT>
706  class PCL_DEPRECATED_CLASS (SHOTEstimation, "SHOTEstimation<pcl::PointXYZRGBA,...,pcl::SHOT,...> IS DEPRECATED, USE SHOTEstimation<pcl::PointXYZRGBA,...,pcl::SHOT352,...> FOR SHAPE AND SHOTColorEstimation<pcl::PointXYZRGBA,...,pcl::SHOT1344,...> FOR SHAPE+COLOR INSTEAD")
707  <pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>
708  : public SHOTEstimationBase<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>
709  {
710  public:
711  using SHOTEstimationBase<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>::feature_name_;
712  using SHOTEstimationBase<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>::indices_;
713  using SHOTEstimationBase<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>::k_;
714  using SHOTEstimationBase<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>::search_parameter_;
715  using SHOTEstimationBase<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>::search_radius_;
716  using SHOTEstimationBase<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>::surface_;
717  using SHOTEstimationBase<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>::input_;
718  using FeatureFromNormals<pcl::PointXYZRGBA, PointNT, pcl::SHOT>::normals_;
719  using FeatureWithLocalReferenceFrames<pcl::PointXYZRGBA, PointRFT>::frames_;
720  using SHOTEstimationBase<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>::getClassName;
721  using SHOTEstimationBase<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>::descLength_;
722  using SHOTEstimationBase<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>::nr_grid_sector_;
723  using SHOTEstimationBase<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>::nr_shape_bins_;
724  using SHOTEstimationBase<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>::sqradius_;
725  using SHOTEstimationBase<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>::radius3_4_;
726  using SHOTEstimationBase<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>::radius1_4_;
727  using SHOTEstimationBase<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>::radius1_2_;
728  using SHOTEstimationBase<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>::maxAngularSectors_;
729  using SHOTEstimationBase<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>::interpolateSingleChannel;
730  using SHOTEstimationBase<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>::shot_;
731 
734 
741  SHOTEstimation (bool describe_shape = true,
742  bool describe_color = false,
743  const int nr_shape_bins = 10,
744  const int nr_color_bins = 30)
745  : SHOTEstimationBase<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT> (nr_shape_bins),
746  b_describe_shape_ (describe_shape),
747  b_describe_color_ (describe_color),
748  nr_color_bins_ (nr_color_bins)
749  {
750  feature_name_ = "SHOTEstimation";
751  };
752 
759  virtual void
760  computePointSHOT (const int index,
761  const std::vector<int> &indices,
762  const std::vector<float> &sqr_dists,
763  Eigen::VectorXf &shot);
764 
765  protected:
766 
772  void
773  computeFeature (PointCloudOut &output);
774 
785  void
786  interpolateDoubleChannel (const std::vector<int> &indices,
787  const std::vector<float> &sqr_dists,
788  const int index,
789  std::vector<double> &binDistanceShape,
790  std::vector<double> &binDistanceColor,
791  const int nr_bins_shape,
792  const int nr_bins_color,
793  Eigen::VectorXf &shot);
794 
803  static void
804  RGB2CIELAB (unsigned char R, unsigned char G, unsigned char B, float &L, float &A, float &B2);
805 
807  bool b_describe_shape_;
808 
810  bool b_describe_color_;
811 
813  int nr_color_bins_;
814 
815  public:
816  static float sRGB_LUT[256];
817  static float sXYZ_LUT[4000];
818  };
819 
837  template <typename PointNT, typename PointRFT>
838  class PCL_DEPRECATED_CLASS (SHOTEstimation, "SHOTEstimation<pcl::PointXYZRGBA,...,Eigen::MatrixXf,...> IS DEPRECATED, USE SHOTColorEstimation<pcl::PointXYZRGBA,...,Eigen::MatrixXf,...> FOR SHAPE AND SHAPE+COLOR INSTEAD")
839  <pcl::PointXYZRGBA, PointNT, Eigen::MatrixXf, PointRFT>
840  : public SHOTEstimation<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>
841  {
842  public:
843  using SHOTEstimation<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>::feature_name_;
844  using SHOTEstimation<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>::getClassName;
845  using SHOTEstimation<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>::indices_;
846  using SHOTEstimation<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>::k_;
847  using SHOTEstimation<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>::search_parameter_;
848  using SHOTEstimation<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>::search_radius_;
849  using SHOTEstimation<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>::surface_;
850  using SHOTEstimation<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>::input_;
851  using SHOTEstimation<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>::descLength_;
852  using SHOTEstimation<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>::nr_grid_sector_;
853  using SHOTEstimation<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>::nr_shape_bins_;
854  using SHOTEstimation<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>::sqradius_;
855  using SHOTEstimation<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>::radius3_4_;
856  using SHOTEstimation<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>::radius1_4_;
857  using SHOTEstimation<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>::radius1_2_;
858  using SHOTEstimation<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>::maxAngularSectors_;
859  using SHOTEstimation<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>::interpolateSingleChannel;
860  using SHOTEstimation<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>::shot_;
861  using SHOTEstimation<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>::b_describe_shape_;
862  using SHOTEstimation<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>::b_describe_color_;
863  using SHOTEstimation<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>::nr_color_bins_;
864  using FeatureWithLocalReferenceFrames<pcl::PointXYZRGBA, PointRFT>::frames_;
865 
872  SHOTEstimation (bool describe_shape = true,
873  bool describe_color = false,
874  const int nr_shape_bins = 10,
875  const int nr_color_bins = 30)
876  : SHOTEstimation<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT> (describe_shape, describe_color, nr_shape_bins, nr_color_bins) {};
877 
878  protected:
884  void
885  computeFeatureEigen (pcl::PointCloud<Eigen::MatrixXf> &output);
886 
887 
891  void
892  compute (pcl::PointCloud<pcl::SHOT> &) { assert(0); }
893  };
894 }
895 
896 #endif //#ifndef PCL_SHOT_H_
897 
898