Point Cloud Library (PCL)  1.9.1-dev
conditional_removal.h
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2010, Willow Garage, Inc.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  * * Neither the name of the copyright holder(s) nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *
34  * $Id$
35  *
36  */
37 
38 #pragma once
39 
40 #include <pcl/pcl_macros.h>
41 #include <pcl/common/eigen.h>
42 #include <pcl/filters/filter.h>
43 
44 namespace pcl
45 {
46  //////////////////////////////////////////////////////////////////////////////////////////
47  namespace ComparisonOps
48  {
49  /** \brief The kind of comparison operations that are possible within a
50  * comparison object
51  */
52  enum CompareOp
53  {
54  GT, GE, LT, LE, EQ
55  };
56  }
57 
58  //////////////////////////////////////////////////////////////////////////////////////////
59  /** \brief A datatype that enables type-correct comparisons. */
60  template<typename PointT>
62  {
63  public:
64  /** \brief Constructor. */
65  PointDataAtOffset (uint8_t datatype, uint32_t offset) :
66  datatype_ (datatype), offset_ (offset)
67  {
68  }
69 
70  /** \brief Compare function.
71  * \param p the point to compare
72  * \param val the value to compare the point to
73  */
74  int
75  compare (const PointT& p, const double& val);
76  protected:
77  /** \brief The type of data. */
78  uint8_t datatype_;
79 
80  /** \brief The data offset. */
81  uint32_t offset_;
82  private:
83  PointDataAtOffset () : datatype_ (), offset_ () {}
84  };
85 
86  //////////////////////////////////////////////////////////////////////////////////////////
87  /** \brief The (abstract) base class for the comparison object. */
88  template<typename PointT>
90  {
91  public:
92  using Ptr = boost::shared_ptr<ComparisonBase<PointT> >;
93  using ConstPtr = boost::shared_ptr<const ComparisonBase<PointT> >;
94 
95  /** \brief Constructor. */
96  ComparisonBase () : capable_ (false), offset_ (), op_ () {}
97 
98  /** \brief Destructor. */
99  virtual ~ComparisonBase () {}
100 
101  /** \brief Return if the comparison is capable. */
102  inline bool
103  isCapable () const
104  {
105  return (capable_);
106  }
107 
108  /** \brief Evaluate function. */
109  virtual bool
110  evaluate (const PointT &point) const = 0;
111 
112  protected:
113  /** \brief True if capable. */
114  bool capable_;
115 
116  /** \brief Field name to compare data on. */
117  std::string field_name_;
118 
119  /** \brief The data offset. */
120  uint32_t offset_;
121 
122  /** \brief The comparison operator type. */
124  };
125 
126  //////////////////////////////////////////////////////////////////////////////////////////
127  /** \brief The field-based specialization of the comparison object. */
128  template<typename PointT>
129  class FieldComparison : public ComparisonBase<PointT>
130  {
134 
135  public:
136  using Ptr = boost::shared_ptr<FieldComparison<PointT> >;
137  using ConstPtr = boost::shared_ptr<const FieldComparison<PointT> >;
138 
139 
140  /** \brief Construct a FieldComparison
141  * \param field_name the name of the field that contains the data we want to compare
142  * \param op the operator to use when making the comparison
143  * \param compare_val the constant value to compare the field value too
144  */
145  FieldComparison (const std::string &field_name, ComparisonOps::CompareOp op, double compare_val);
146 
147  /** \brief Copy constructor.
148  * \param[in] src the field comparison object to copy into this
149  */
151  : ComparisonBase<PointT> ()
152  , compare_val_ (src.compare_val_), point_data_ (src.point_data_)
153  {
154  }
155 
156  /** \brief Copy operator.
157  * \param[in] src the field comparison object to copy into this
158  */
159  inline FieldComparison&
160  operator = (const FieldComparison &src)
161  {
162  compare_val_ = src.compare_val_;
163  point_data_ = src.point_data_;
164  return (*this);
165  }
166 
167  /** \brief Destructor. */
168  ~FieldComparison ();
169 
170  /** \brief Determine the result of this comparison.
171  * \param point the point to evaluate
172  * \return the result of this comparison.
173  */
174  bool
175  evaluate (const PointT &point) const override;
176 
177  protected:
178  /** \brief All types (that we care about) can be represented as a double. */
179  double compare_val_;
180 
181  /** \brief The point data to compare. */
183 
184  private:
185  FieldComparison () :
186  compare_val_ (), point_data_ ()
187  {
188  } // not allowed
189  };
190 
191  //////////////////////////////////////////////////////////////////////////////////////////
192  /** \brief A packed rgb specialization of the comparison object. */
193  template<typename PointT>
194  class PackedRGBComparison : public ComparisonBase<PointT>
195  {
198 
199  public:
200  using Ptr = boost::shared_ptr<PackedRGBComparison<PointT> >;
201  using ConstPtr = boost::shared_ptr<const PackedRGBComparison<PointT> >;
202 
203  /** \brief Construct a PackedRGBComparison
204  * \param component_name either "r", "g" or "b"
205  * \param op the operator to use when making the comparison
206  * \param compare_val the constant value to compare the component value too
207  */
208  PackedRGBComparison (const std::string &component_name, ComparisonOps::CompareOp op, double compare_val);
209 
210  /** \brief Destructor. */
212 
213  /** \brief Determine the result of this comparison.
214  * \param point the point to evaluate
215  * \return the result of this comparison.
216  */
217  bool
218  evaluate (const PointT &point) const override;
219 
220  protected:
221  /** \brief The name of the component. */
222  std::string component_name_;
223 
224  /** \brief The offset of the component */
226 
227  /** \brief All types (that we care about) can be represented as a double. */
228  double compare_val_;
229 
230  private:
232  component_offset_ (), compare_val_ ()
233  {
234  } // not allowed
235 
236  };
237 
238  //////////////////////////////////////////////////////////////////////////////////////////
239  /** \brief A packed HSI specialization of the comparison object. */
240  template<typename PointT>
241  class PackedHSIComparison : public ComparisonBase<PointT>
242  {
245 
246  public:
247  using Ptr = boost::shared_ptr<PackedHSIComparison<PointT> >;
248  using ConstPtr = boost::shared_ptr<const PackedHSIComparison<PointT> >;
249 
250  /** \brief Construct a PackedHSIComparison
251  * \param component_name either "h", "s" or "i"
252  * \param op the operator to use when making the comparison
253  * \param compare_val the constant value to compare the component value too
254  */
255  PackedHSIComparison (const std::string &component_name, ComparisonOps::CompareOp op, double compare_val);
256 
257  /** \brief Destructor. */
259 
260  /** \brief Determine the result of this comparison.
261  * \param point the point to evaluate
262  * \return the result of this comparison.
263  */
264  bool
265  evaluate (const PointT &point) const override;
266 
268  {
269  H, // -128 to 127 corresponds to -pi to pi
270  S, // 0 to 255
271  I // 0 to 255
272  };
273 
274  protected:
275  /** \brief The name of the component. */
276  std::string component_name_;
277 
278  /** \brief The ID of the component. */
280 
281  /** \brief All types (that we care about) can be represented as a double. */
282  double compare_val_;
283 
284  /** \brief The offset of the component */
285  uint32_t rgb_offset_;
286 
287  private:
289  component_id_ (), compare_val_ (), rgb_offset_ ()
290  {
291  } // not allowed
292  };
293 
294  //////////////////////////////////////////////////////////////////////////////////////////
295  /**\brief A comparison whether the (x,y,z) components of a given point satisfy (p'Ap + 2v'p + c [OP] 0).
296  * Here [OP] stands for the defined pcl::ComparisonOps, i.e. for GT, GE, LT, LE or EQ;
297  * p = (x,y,z) is a point of the point cloud; A is 3x3 matrix; v is the 3x1 vector; c is a scalar.
298  *
299  * One can also use TfQuadraticXYZComparison for simpler geometric shapes by defining the
300  * quadratic parts (i.e. the matrix A) to be zero. By combining different instances of
301  * TfQuadraticXYZComparison one can get more complex shapes. For example, to have a simple
302  * cylinder (along the x-axis) of specific length one needs three comparisons combined as AND condition:
303  * 1. The cylinder: A = [0 0 0, 0 1 0, 0 0 1]; v = [0, 0, 0]; c = radius²; OP = LT (meaning "<")
304  * 2. X-min limit: A = 0; v = [1, 0, 0]; c = x_min; OP = GT
305  * 3. X-max ...
306  *
307  * \author Julian Löchner
308  */
309  template<typename PointT>
311  {
312  public:
313  PCL_MAKE_ALIGNED_OPERATOR_NEW // needed whenever there is a fixed size Eigen:: vector or matrix in a class
314 
315  using Ptr = boost::shared_ptr<TfQuadraticXYZComparison<PointT> >;
316  using ConstPtr = boost::shared_ptr<const TfQuadraticXYZComparison<PointT> >;
317 
318  /** \brief Constructor.
319  */
321 
322  /** \brief Empty destructor */
324 
325  /** \brief Constructor.
326  * \param op the operator "[OP]" of the comparison "p'Ap + 2v'p + c [OP] 0".
327  * \param comparison_matrix the matrix "A" of the comparison "p'Ap + 2v'p + c [OP] 0".
328  * \param comparison_vector the vector "v" of the comparison "p'Ap + 2v'p + c [OP] 0".
329  * \param comparison_scalar the scalar "c" of the comparison "p'Ap + 2v'p + c [OP] 0".
330  * \param comparison_transform the transformation of the comparison.
331  */
332  TfQuadraticXYZComparison (const pcl::ComparisonOps::CompareOp op, const Eigen::Matrix3f &comparison_matrix,
333  const Eigen::Vector3f &comparison_vector, const float &comparison_scalar,
334  const Eigen::Affine3f &comparison_transform = Eigen::Affine3f::Identity ());
335 
336  /** \brief set the operator "[OP]" of the comparison "p'Ap + 2v'p + c [OP] 0".
337  */
338  inline void
340  {
341  op_ = op;
342  }
343 
344  /** \brief set the matrix "A" of the comparison "p'Ap + 2v'p + c [OP] 0".
345  */
346  inline void
347  setComparisonMatrix (const Eigen::Matrix3f &matrix)
348  {
349  //define comp_matr_ as an homogeneous matrix of the given matrix
350  comp_matr_.block<3, 3> (0, 0) = matrix;
351  comp_matr_.col (3) << 0, 0, 0, 1;
352  comp_matr_.block<1, 3> (3, 0) << 0, 0, 0;
353  tf_comp_matr_ = comp_matr_;
354  }
355 
356  /** \brief set the matrix "A" of the comparison "p'Ap + 2v'p + c [OP] 0".
357  */
358  inline void
359  setComparisonMatrix (const Eigen::Matrix4f &homogeneousMatrix)
360  {
361  comp_matr_ = homogeneousMatrix;
362  tf_comp_matr_ = comp_matr_;
363  }
364 
365  /** \brief set the vector "v" of the comparison "p'Ap + 2v'p + c [OP] 0".
366  */
367  inline void
368  setComparisonVector (const Eigen::Vector3f &vector)
369  {
370  comp_vect_ = vector.homogeneous ();
371  tf_comp_vect_ = comp_vect_;
372  }
373 
374  /** \brief set the vector "v" of the comparison "p'Ap + 2v'p + c [OP] 0".
375  */
376  inline void
377  setComparisonVector (const Eigen::Vector4f &homogeneousVector)
378  {
379  comp_vect_ = homogeneousVector;
380  tf_comp_vect_ = comp_vect_;
381  }
382 
383  /** \brief set the scalar "c" of the comparison "p'Ap + 2v'p + c [OP] 0".
384  */
385  inline void
386  setComparisonScalar (const float &scalar)
387  {
388  comp_scalar_ = scalar;
389  }
390 
391  /** \brief transform the coordinate system of the comparison. If you think of
392  * the transformation to be a translation and rotation of the comparison in the
393  * same coordinate system, you have to provide the inverse transformation.
394  * This function does not change the original definition of the comparison. Thus,
395  * each call of this function will assume the original definition of the comparison
396  * as starting point for the transformation.
397  *
398  * @param transform the transformation (rotation and translation) as an affine matrix.
399  */
400  inline void
401  transformComparison (const Eigen::Matrix4f &transform)
402  {
403  tf_comp_matr_ = transform.transpose () * comp_matr_ * transform;
404  tf_comp_vect_ = comp_vect_.transpose () * transform;
405  }
406 
407  /** \brief transform the coordinate system of the comparison. If you think of
408  * the transformation to be a translation and rotation of the comparison in the
409  * same coordinate system, you have to provide the inverse transformation.
410  * This function does not change the original definition of the comparison. Thus,
411  * each call of this function will assume the original definition of the comparison
412  * as starting point for the transformation.
413  *
414  * @param transform the transformation (rotation and translation) as an affine matrix.
415  */
416  inline void
417  transformComparison (const Eigen::Affine3f &transform)
418  {
419  transformComparison (transform.matrix ());
420  }
421 
422  /** \brief Determine the result of this comparison.
423  * \param point the point to evaluate
424  * \return the result of this comparison.
425  */
426  bool
427  evaluate (const PointT &point) const override;
428 
429  protected:
432 
433  Eigen::Matrix4f comp_matr_;
434  Eigen::Vector4f comp_vect_;
435 
437 
438  private:
439  Eigen::Matrix4f tf_comp_matr_;
440  Eigen::Vector4f tf_comp_vect_;
441  };
442 
443  //////////////////////////////////////////////////////////////////////////////////////////
444  /** \brief Base condition class. */
445  template<typename PointT>
447  {
448  public:
452 
453  using Ptr = boost::shared_ptr<ConditionBase<PointT> >;
454  using ConstPtr = boost::shared_ptr<const ConditionBase<PointT> >;
455 
456  /** \brief Constructor. */
457  ConditionBase () : capable_ (true), comparisons_ (), conditions_ ()
458  {
459  }
460 
461  /** \brief Destructor. */
462  virtual ~ConditionBase ()
463  {
464  // comparisons are boost::shared_ptr.will take care of themselves
465  comparisons_.clear ();
466 
467  // conditions are boost::shared_ptr. will take care of themselves
468  conditions_.clear ();
469  }
470 
471  /** \brief Add a new comparison
472  * \param comparison the comparison operator to add
473  */
474  void
475  addComparison (ComparisonBaseConstPtr comparison);
476 
477  /** \brief Add a nested condition to this condition.
478  * \param condition the nested condition to be added
479  */
480  void
481  addCondition (Ptr condition);
482 
483  /** \brief Check if evaluation requirements are met. */
484  inline bool
485  isCapable () const
486  {
487  return (capable_);
488  }
489 
490  /** \brief Determine if a point meets this condition.
491  * \return whether the point meets this condition.
492  */
493  virtual bool
494  evaluate (const PointT &point) const = 0;
495 
496  protected:
497  /** \brief True if capable. */
498  bool capable_;
499 
500  /** \brief The collection of all comparisons that need to be verified. */
501  std::vector<ComparisonBaseConstPtr> comparisons_;
502 
503  /** \brief The collection of all conditions that need to be verified. */
504  std::vector<Ptr> conditions_;
505  };
506 
507  //////////////////////////////////////////////////////////////////////////////////////////
508  /** \brief AND condition. */
509  template<typename PointT>
510  class ConditionAnd : public ConditionBase<PointT>
511  {
514 
515  public:
516  using Ptr = boost::shared_ptr<ConditionAnd<PointT> >;
517  using ConstPtr = boost::shared_ptr<const ConditionAnd<PointT> >;
518 
519  /** \brief Constructor. */
522  {
523  }
524 
525  /** \brief Determine if a point meets this condition.
526  * \return whether the point meets this condition.
527  *
528  * The ConditionAnd evaluates to true when ALL
529  * comparisons and nested conditions evaluate to true
530  */
531  bool
532  evaluate (const PointT &point) const override;
533  };
534 
535  //////////////////////////////////////////////////////////////////////////////////////////
536  /** \brief OR condition. */
537  template<typename PointT>
538  class ConditionOr : public ConditionBase<PointT>
539  {
542 
543  public:
544  using Ptr = boost::shared_ptr<ConditionOr<PointT> >;
545  using ConstPtr = boost::shared_ptr<const ConditionOr<PointT> >;
546 
547  /** \brief Constructor. */
550  {
551  }
552 
553  /** \brief Determine if a point meets this condition.
554  * \return whether the point meets this condition.
555  *
556  * The ConditionOr evaluates to true when ANY
557  * comparisons or nested conditions evaluate to true
558  */
559  bool
560  evaluate (const PointT &point) const override;
561  };
562 
563  //////////////////////////////////////////////////////////////////////////////////////////
564  /** \brief @b ConditionalRemoval filters data that satisfies certain conditions.
565  *
566  * A ConditionalRemoval must be provided a condition. There are two types of
567  * conditions: ConditionAnd and ConditionOr. Conditions require one or more
568  * comparisons and/or other conditions. A comparison has a name, a
569  * comparison operator, and a value.
570  *
571  * An ConditionAnd will evaluate to true when ALL of its encapsulated
572  * comparisons and conditions are true.
573  *
574  * An ConditionOr will evaluate to true when ANY of its encapsulated
575  * comparisons and conditions are true.
576  *
577  * Depending on the derived type of the comparison, the name can correspond
578  * to a PointCloud field name, or a color component in rgb color space or
579  * hsi color space.
580  *
581  * Here is an example usage:
582  * // Build the condition
583  * pcl::ConditionAnd<PointT>::Ptr range_cond (new pcl::ConditionAnd<PointT> ());
584  * range_cond->addComparison (pcl::FieldComparison<PointT>::Ptr (new pcl::FieldComparison<PointT>("z", pcl::ComparisonOps::LT, 2.0)));
585  * range_cond->addComparison (pcl::FieldComparison<PointT>::Ptr (new pcl::FieldComparison<PointT>("z", pcl::ComparisonOps::GT, 0.0)));
586  * // Build the filter
587  * pcl::ConditionalRemoval<PointT> range_filt;
588  * range_filt.setCondition (range_cond);
589  * range_filt.setKeepOrganized (false);
590  *
591  * \author Louis LeGrand, Intel Labs Seattle
592  * \ingroup filters
593  */
594  template<typename PointT>
595  class ConditionalRemoval : public Filter<PointT>
596  {
600 
603 
604  using PointCloud = typename Filter<PointT>::PointCloud;
605  using PointCloudPtr = typename PointCloud::Ptr;
606  using PointCloudConstPtr = typename PointCloud::ConstPtr;
607 
608  public:
612 
613  /** \brief the default constructor.
614  *
615  * All ConditionalRemovals require a condition which can be set
616  * using the setCondition method
617  * \param extract_removed_indices extract filtered indices from indices vector
618  */
619  ConditionalRemoval (int extract_removed_indices = false) :
620  Filter<PointT>::Filter (extract_removed_indices), capable_ (false), keep_organized_ (false), condition_ (),
621  user_filter_value_ (std::numeric_limits<float>::quiet_NaN ())
622  {
623  filter_name_ = "ConditionalRemoval";
624  }
625 
626  /** \brief Set whether the filtered points should be kept and set to the
627  * value given through \a setUserFilterValue (default: NaN), or removed
628  * from the PointCloud, thus potentially breaking its organized
629  * structure. By default, points are removed.
630  *
631  * \param val set to true whether the filtered points should be kept and
632  * set to a given user value (default: NaN)
633  */
634  inline void
635  setKeepOrganized (bool val)
636  {
637  keep_organized_ = val;
638  }
639 
640  inline bool
642  {
643  return (keep_organized_);
644  }
645 
646  /** \brief Provide a value that the filtered points should be set to
647  * instead of removing them. Used in conjunction with \a
648  * setKeepOrganized ().
649  * \param val the user given value that the filtered point dimensions should be set to
650  */
651  inline void
652  setUserFilterValue (float val)
653  {
654  user_filter_value_ = val;
655  }
656 
657  /** \brief Set the condition that the filter will use.
658  * \param condition each point must satisfy this condition to avoid
659  * being removed by the filter
660  *
661  * All ConditionalRemovals require a condition
662  */
663  void
664  setCondition (ConditionBasePtr condition);
665 
666  protected:
667  /** \brief Filter a Point Cloud.
668  * \param output the resultant point cloud message
669  */
670  void
671  applyFilter (PointCloud &output) override;
672 
673  /** \brief True if capable. */
674  bool capable_;
675 
676  /** \brief Keep the structure of the data organized, by setting the
677  * filtered points to the a user given value (NaN by default).
678  */
680 
681  /** \brief The condition to use for filtering */
683 
684  /** \brief User given value to be set to any filtered point. Casted to
685  * the correct field type.
686  */
688  };
689 }
690 
691 #ifdef PCL_NO_PRECOMPILE
692 #include <pcl/filters/impl/conditional_removal.hpp>
693 #endif
void setComparisonMatrix(const Eigen::Matrix3f &matrix)
set the matrix "A" of the comparison "p&#39;Ap + 2v&#39;p + c [OP] 0".
A comparison whether the (x,y,z) components of a given point satisfy (p&#39;Ap + 2v&#39;p + c [OP] 0)...
ComparisonBase()
Constructor.
double compare_val_
All types (that we care about) can be represented as a double.
double compare_val_
All types (that we care about) can be represented as a double.
uint32_t offset_
The data offset.
PointDataAtOffset< PointT > * point_data_
The point data to compare.
void setKeepOrganized(bool val)
Set whether the filtered points should be kept and set to the value given through setUserFilterValue ...
Base condition class.
ComponentId component_id_
The ID of the component.
uint32_t rgb_offset_
The offset of the component.
std::string component_name_
The name of the component.
bool capable_
True if capable.
void setComparisonOperator(const pcl::ComparisonOps::CompareOp op)
set the operator "[OP]" of the comparison "p&#39;Ap + 2v&#39;p + c [OP] 0".
void setUserFilterValue(float val)
Provide a value that the filtered points should be set to instead of removing them.
uint32_t offset_
The data offset.
ConditionAnd()
Constructor.
This file defines compatibility wrappers for low level I/O functions.
Definition: convolution.h:45
bool isCapable() const
Return if the comparison is capable.
A datatype that enables type-correct comparisons.
uint8_t datatype_
The type of data.
float user_filter_value_
User given value to be set to any filtered point.
void transformComparison(const Eigen::Affine3f &transform)
transform the coordinate system of the comparison.
The (abstract) base class for the comparison object.
void setComparisonVector(const Eigen::Vector3f &vector)
set the vector "v" of the comparison "p&#39;Ap + 2v&#39;p + c [OP] 0".
boost::shared_ptr< ComparisonBase< PointT > > Ptr
ConditionOr()
Constructor.
void setComparisonVector(const Eigen::Vector4f &homogeneousVector)
set the vector "v" of the comparison "p&#39;Ap + 2v&#39;p + c [OP] 0".
bool isCapable() const
Check if evaluation requirements are met.
#define PCL_MAKE_ALIGNED_OPERATOR_NEW
Macro to signal a class requires a custom allocator.
Definition: pcl_macros.h:344
typename ConditionBase::Ptr ConditionBasePtr
ComparisonOps::CompareOp op_
The comparison operator type.
ConditionalRemoval(int extract_removed_indices=false)
the default constructor.
PointDataAtOffset(uint8_t datatype, uint32_t offset)
Constructor.
ConditionalRemoval filters data that satisfies certain conditions.
boost::shared_ptr< const ComparisonBase< PointT > > ConstPtr
bool capable_
True if capable.
Filter represents the base filter class.
Definition: filter.h:83
virtual ~ComparisonBase()
Destructor.
ConditionBasePtr condition_
The condition to use for filtering.
The field-based specialization of the comparison object.
~TfQuadraticXYZComparison()
Empty destructor.
void setComparisonMatrix(const Eigen::Matrix4f &homogeneousMatrix)
set the matrix "A" of the comparison "p&#39;Ap + 2v&#39;p + c [OP] 0".
A packed rgb specialization of the comparison object.
typename PointCloud::Ptr PointCloudPtr
Definition: pcl_base.h:73
bool capable_
True if capable.
std::string component_name_
The name of the component.
bool keep_organized_
Keep the structure of the data organized, by setting the filtered points to the a user given value (N...
uint32_t component_offset_
The offset of the component.
boost::shared_ptr< PointCloud< PointT > > Ptr
Definition: point_cloud.h:429
void transformComparison(const Eigen::Matrix4f &transform)
transform the coordinate system of the comparison.
std::string field_name_
Field name to compare data on.
CompareOp
The kind of comparison operations that are possible within a comparison object.
typename ComparisonBase::Ptr ComparisonBasePtr
PointCloud represents the base class in PCL for storing collections of 3D points. ...
void setComparisonScalar(const float &scalar)
set the scalar "c" of the comparison "p&#39;Ap + 2v&#39;p + c [OP] 0".
ConditionBase()
Constructor.
FieldComparison(const FieldComparison &src)
Copy constructor.
typename ComparisonBase::ConstPtr ComparisonBaseConstPtr
boost::shared_ptr< const PointCloud< PointT > > ConstPtr
Definition: point_cloud.h:430
double compare_val_
All types (that we care about) can be represented as a double.
typename ConditionBase::ConstPtr ConditionBaseConstPtr
std::vector< ComparisonBaseConstPtr > comparisons_
The collection of all comparisons that need to be verified.
A packed HSI specialization of the comparison object.
virtual ~ConditionBase()
Destructor.
A point structure representing Euclidean xyz coordinates, and the RGB color.
std::vector< Ptr > conditions_
The collection of all conditions that need to be verified.
boost::shared_ptr< ConditionBase< PointT > > Ptr
boost::shared_ptr< const ConditionBase< PointT > > ConstPtr
typename PointCloud::ConstPtr PointCloudConstPtr
Definition: pcl_base.h:74