22 #ifndef _LIBS_PCL_UTILS_COMPARISONS_H_
23 #define _LIBS_PCL_UTILS_COMPARISONS_H_
25 #include <pcl/ModelCoefficients.h>
26 #include <pcl/filters/conditional_removal.h>
27 #include <pcl/point_cloud.h>
28 #include <pcl/segmentation/extract_polygonal_prism_data.h>
41 template <
typename Po
intT>
42 class PolygonComparison :
public pcl::ComparisonBase<PointT>
44 using pcl::ComparisonBase<PointT>::capable_;
48 typedef boost::shared_ptr<PolygonComparison<PointT>>
Ptr;
50 typedef boost::shared_ptr<const PolygonComparison<PointT>>
ConstPtr;
59 capable_ = (polygon.size() >= 3);
75 return pcl::isPointIn2DPolygon(point,
polygon_);
77 return !pcl::isPointIn2DPolygon(point,
polygon_);
97 template <
typename Po
intT>
100 using pcl::ComparisonBase<PointT>::capable_;
104 typedef boost::shared_ptr<PlaneDistanceComparison<PointT>>
Ptr;
106 typedef boost::shared_ptr<const PlaneDistanceComparison<PointT>>
ConstPtr;
114 pcl::ComparisonOps::CompareOp op = pcl::ComparisonOps::GT,
115 float compare_val = 0.)
118 capable_ = (
coeff_->values.size() == 4);
133 (
coeff_->values[0] * point.x +
coeff_->values[1] * point.y +
coeff_->values[2] * point.z
140 if (
op_ == pcl::ComparisonOps::GT) {
142 }
else if (
op_ == pcl::ComparisonOps::GE) {
144 }
else if (
op_ == pcl::ComparisonOps::LT) {
146 }
else if (
op_ == pcl::ComparisonOps::LE) {
155 pcl::ModelCoefficients::ConstPtr
coeff_;
157 pcl::ComparisonOps::CompareOp
op_;