66 template <
typename Po
intInT,
typename Po
intNT,
typename Po
intOutT,
typename Po
intRFT = pcl::ReferenceFrame>
90 nr_shape_bins_ (nr_shape_bins),
92 sqradius_ (0), radius3_4_ (0), radius1_4_ (0), radius1_2_ (0),
94 maxAngularSectors_ (28),
97 feature_name_ =
"SHOTEstimation";
109 const std::vector<int> &indices,
110 const std::vector<float> &sqr_dists,
111 Eigen::VectorXf &shot) = 0;
129 interpolateSingleChannel (
const std::vector<int> &indices,
130 const std::vector<float> &sqr_dists,
132 std::vector<double> &binDistance,
134 Eigen::VectorXf &shot);
141 normalizeHistogram (Eigen::VectorXf &shot,
int desc_length);
151 createBinDistanceShape (
int index,
const std::vector<int> &indices,
152 std::vector<double> &bin_distance_shape);
158 Eigen::VectorXf shot_;
173 const int nr_grid_sector_;
176 const int maxAngularSectors_;
275 template <
typename Po
intInT,
typename Po
intNT,
typename Po
intOutT = pcl::SHOT352,
typename Po
intRFT = pcl::ReferenceFrame>
305 feature_name_ =
"SHOTEstimation";
316 const std::vector<int> &indices,
317 const std::vector<float> &sqr_dists,
318 Eigen::VectorXf &shot);
346 template <
typename Po
intInT,
typename Po
intNT,
typename Po
intRFT>
348 <PointInT, PointNT, pcl::SHOT, PointRFT>
349 :
public SHOTEstimationBase<PointInT, PointNT, pcl::SHOT, PointRFT>
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_;
380 feature_name_ =
"SHOTEstimation";
391 const std::vector<int> &indices,
392 const std::vector<float> &sqr_dists,
393 Eigen::VectorXf &shot);
422 template <
typename Po
intInT,
typename Po
intNT,
typename Po
intRFT>
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_;
450 feature_name_ =
"SHOTEstimation";
451 nr_shape_bins_ = nr_shape_bins;
511 template <
typename Po
intInT,
typename Po
intNT,
typename Po
intOutT = pcl::SHOT1344,
typename Po
intRFT = pcl::ReferenceFrame>
512 class SHOTColorEstimation :
public SHOTEstimationBase<PointInT, PointNT, PointOutT, PointRFT>
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_;
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),
549 feature_name_ =
"SHOTColorEstimation";
560 const std::vector<int> &indices,
561 const std::vector<float> &sqr_dists,
562 Eigen::VectorXf &shot);
583 interpolateDoubleChannel (
const std::vector<int> &indices,
584 const std::vector<float> &sqr_dists,
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);
593 bool b_describe_shape_;
596 bool b_describe_color_;
611 RGB2CIELAB (
unsigned char R,
unsigned char G,
unsigned char B,
float &L,
float &A,
float &B2);
613 static float sRGB_LUT[256];
614 static float sXYZ_LUT[4000];
617 template <
typename Po
intInT,
typename Po
intNT,
typename Po
intRFT>
618 class SHOTColorEstimation<PointInT, PointNT, Eigen::MatrixXf, PointRFT> :
public SHOTColorEstimation<PointInT, PointNT, pcl::SHOT1344, PointRFT>
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_;
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)
655 feature_name_ =
"SHOTColorEstimation";
656 nr_shape_bins_ = nr_shape_bins;
657 nr_color_bins_ = nr_color_bins;
668 pcl::SHOTColorEstimation<PointInT, PointNT, pcl::SHOT1344, PointRFT>::computeEigen (output);
705 template <
typename Po
intNT,
typename Po
intRFT>
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>
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_;
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)
750 feature_name_ =
"SHOTEstimation";
761 const std::vector<int> &indices,
762 const std::vector<float> &sqr_dists,
763 Eigen::VectorXf &shot);
786 interpolateDoubleChannel (
const std::vector<int> &indices,
787 const std::vector<float> &sqr_dists,
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);
804 RGB2CIELAB (
unsigned char R,
unsigned char G,
unsigned char B,
float &L,
float &A,
float &B2);
807 bool b_describe_shape_;
810 bool b_describe_color_;
816 static float sRGB_LUT[256];
817 static float sXYZ_LUT[4000];
837 template <
typename Po
intNT,
typename Po
intRFT>
839 <pcl::PointXYZRGBA, PointNT, Eigen::MatrixXf, PointRFT>
840 :
public SHOTEstimation<pcl::PointXYZRGBA, PointNT, pcl::SHOT, PointRFT>
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_;
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) {};
896 #endif //#ifndef PCL_SHOT_H_