38 #ifndef PCL_FILTER_FIELD_VAL_CONDITION_H_
39 #define PCL_FILTER_FIELD_VAL_CONDITION_H_
40 #include <pcl/common/eigen.h>
41 #include <pcl/filters/filter.h>
46 namespace ComparisonOps
59 template<
typename Po
intT>
87 template<
typename Po
intT>
91 typedef boost::shared_ptr< ComparisonBase<PointT> >
Ptr;
92 typedef boost::shared_ptr< const ComparisonBase<PointT> >
ConstPtr;
127 template<
typename Po
intT>
135 typedef boost::shared_ptr< FieldComparison<PointT> >
Ptr;
136 typedef boost::shared_ptr< const FieldComparison<PointT> >
ConstPtr;
192 template<
typename Po
intT>
199 typedef boost::shared_ptr< PackedRGBComparison<PointT> >
Ptr;
200 typedef boost::shared_ptr< const PackedRGBComparison<PointT> >
ConstPtr;
239 template<
typename Po
intT>
246 typedef boost::shared_ptr< PackedHSIComparison<PointT> >
Ptr;
247 typedef boost::shared_ptr< const PackedHSIComparison<PointT> >
ConstPtr;
308 template<
typename Po
intT>
312 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
314 typedef boost::shared_ptr<TfQuadraticXYZComparison<PointT> >
Ptr;
315 typedef boost::shared_ptr<const TfQuadraticXYZComparison<PointT> >
ConstPtr;
332 const Eigen::Vector3f &comparison_vector,
const float &comparison_scalar,
333 const Eigen::Affine3f &comparison_transform = Eigen::Affine3f::Identity ());
402 tf_comp_matr_ = transform.transpose () *
comp_matr_ * transform;
403 tf_comp_vect_ =
comp_vect_.transpose () * transform;
438 Eigen::Matrix4f tf_comp_matr_;
439 Eigen::Vector4f tf_comp_vect_;
444 template<
typename Po
intT>
452 typedef boost::shared_ptr<ConditionBase<PointT> >
Ptr;
453 typedef boost::shared_ptr<const ConditionBase<PointT> >
ConstPtr;
508 template<
typename Po
intT>
515 typedef boost::shared_ptr<ConditionAnd<PointT> >
Ptr;
516 typedef boost::shared_ptr<const ConditionAnd<PointT> >
ConstPtr;
536 template<
typename Po
intT>
543 typedef boost::shared_ptr<ConditionOr<PointT> >
Ptr;
544 typedef boost::shared_ptr<const ConditionOr<PointT> >
ConstPtr;
593 template<
typename Po
intT>
705 #ifdef PCL_NO_PRECOMPILE
706 #include <pcl/filters/impl/conditional_removal.hpp>
std::string filter_name_
The filter name.
uint8_t datatype_
The type of data.
virtual bool evaluate(const PointT &point) const
Determine if a point meets this condition.
virtual ~FieldComparison()
Destructor.
ConditionalRemoval(int extract_removed_indices=false)
the default constructor.
bool getKeepOrganized() const
double compare_val_
All types (that we care about) can be represented as a double.
bool keep_organized_
Keep the structure of the data organized, by setting the filtered points to the a user given value (N...
void setComparisonVector(const Eigen::Vector3f &vector)
set the vector "v" of the comparison "p'Ap + 2v'p + c [OP] 0".
pcl::ConditionBase< PointT > ConditionBase
void setComparisonOperator(const pcl::ComparisonOps::CompareOp op)
set the operator "[OP]" of the comparison "p'Ap + 2v'p + c [OP] 0".
uint32_t component_offset_
The offset of the component.
PointCloud::ConstPtr PointCloudConstPtr
ComparisonBase::ConstPtr ComparisonBaseConstPtr
std::vector< ComparisonBaseConstPtr > comparisons_
The collection of all comparisons that need to be verified.
void setComparisonMatrix(const Eigen::Matrix4f &homogeneousMatrix)
set the matrix "A" of the comparison "p'Ap + 2v'p + c [OP] 0".
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef boost::shared_ptr< TfQuadraticXYZComparison< PointT > > Ptr
void addCondition(Ptr condition)
Add a nested condition to this condition.
pcl::ComparisonBase< PointT > ComparisonBase
virtual ~ConditionBase()
Destructor.
FieldComparison(const FieldComparison &src)
Copy constructor.
virtual bool evaluate(const PointT &point) const =0
Evaluate function.
boost::shared_ptr< const PointCloud< PointT > > ConstPtr
boost::shared_ptr< ConditionBase< PointT > > Ptr
virtual bool evaluate(const PointT &point) const
Determine the result of this comparison.
boost::shared_ptr< const TfQuadraticXYZComparison< PointT > > ConstPtr
FieldComparison & operator=(const FieldComparison &src)
Copy operator.
ConditionBase()
Constructor.
bool isCapable() const
Return if the comparison is capable.
boost::shared_ptr< PointCloud< PointT > > Ptr
uint32_t offset_
The data offset.
ConditionBase::ConstPtr ConditionBaseConstPtr
ConditionalRemoval filters data that satisfies certain conditions.
bool capable_
True if capable.
ConditionBasePtr condition_
The condition to use for filtering.
PointDataAtOffset< PointT > * point_data_
The point data to compare.
boost::shared_ptr< const FieldComparison< PointT > > ConstPtr
void setKeepOrganized(bool val)
Set whether the filtered points should be kept and set to the value given through setUserFilterValue ...
A comparison whether the (x,y,z) components of a given point satisfy (p'Ap + 2v'p + c [OP] 0)...
void addComparison(ComparisonBaseConstPtr comparison)
Add a new comparison.
PointCloud::Ptr PointCloudPtr
bool isCapable() const
Check if evaluation requirements are met.
CompareOp
The kind of comparison operations that are possible within a comparison object.
Eigen::Vector4f comp_vect_
Eigen::Matrix4f comp_matr_
std::vector< Ptr > conditions_
The collection of all conditions that need to be verified.
ComponentId component_id_
The ID of the component.
pcl::traits::fieldList< PointT >::type FieldList
The (abstract) base class for the comparison object.
double compare_val_
All types (that we care about) can be represented as a double.
std::string component_name_
The name of the component.
A datatype that enables type-correct comparisons.
boost::shared_ptr< const ConditionAnd< PointT > > ConstPtr
void setUserFilterValue(float val)
Provide a value that the filtered points should be set to instead of removing them.
A packed HSI specialization of the comparison object.
double compare_val_
All types (that we care about) can be represented as a double.
boost::shared_ptr< FieldComparison< PointT > > Ptr
boost::shared_ptr< const ConditionOr< PointT > > ConstPtr
boost::shared_ptr< ConditionOr< PointT > > Ptr
ConditionAnd()
Constructor.
int compare(const PointT &p, const double &val)
Compare function.
PointDataAtOffset(uint8_t datatype, uint32_t offset)
Constructor.
virtual bool evaluate(const PointT &point) const
Determine the result of this comparison.
void setComparisonVector(const Eigen::Vector4f &homogeneousVector)
set the vector "v" of the comparison "p'Ap + 2v'p + c [OP] 0".
bool capable_
True if capable.
std::string component_name_
The name of the component.
virtual ~TfQuadraticXYZComparison()
Empty destructor.
uint32_t offset_
The data offset.
void applyFilter(PointCloud &output)
Filter a Point Cloud.
void transformComparison(const Eigen::Matrix4f &transform)
transform the coordinate system of the comparison.
ConditionOr()
Constructor.
virtual bool evaluate(const PointT &point) const
Determine the result of this comparison.
void setComparisonMatrix(const Eigen::Matrix3f &matrix)
set the matrix "A" of the comparison "p'Ap + 2v'p + c [OP] 0".
ComparisonOps::CompareOp op_
The comparison operator type.
boost::shared_ptr< PackedHSIComparison< PointT > > Ptr
virtual bool evaluate(const PointT &point) const
Determine if a point meets this condition.
The field-based specialization of the comparison object.
virtual bool evaluate(const PointT &point) const =0
Determine if a point meets this condition.
A packed rgb specialization of the comparison object.
void setCondition(ConditionBasePtr condition)
Set the condition that the filter will use.
boost::shared_ptr< ConditionAnd< PointT > > Ptr
TfQuadraticXYZComparison()
Constructor.
std::string field_name_
Field name to compare data on.
boost::shared_ptr< const ComparisonBase< PointT > > ConstPtr
boost::shared_ptr< const PackedRGBComparison< PointT > > ConstPtr
A point structure representing Euclidean xyz coordinates, and the RGB color.
boost::shared_ptr< ComparisonBase< PointT > > Ptr
uint32_t rgb_offset_
The offset of the component.
Filter represents the base filter class.
float user_filter_value_
User given value to be set to any filtered point.
boost::shared_ptr< const ConditionBase< PointT > > ConstPtr
virtual ~ComparisonBase()
Destructor.
ComparisonBase::Ptr ComparisonBasePtr
virtual ~PackedHSIComparison()
Destructor.
boost::shared_ptr< const PackedHSIComparison< PointT > > ConstPtr
boost::shared_ptr< PackedRGBComparison< PointT > > Ptr
void transformComparison(const Eigen::Affine3f &transform)
transform the coordinate system of the comparison.
void setComparisonScalar(const float &scalar)
set the scalar "c" of the comparison "p'Ap + 2v'p + c [OP] 0".
virtual bool evaluate(const PointT &point) const
Determine the result of this comparison.
bool capable_
True if capable.
ConditionBase::Ptr ConditionBasePtr
virtual ~PackedRGBComparison()
Destructor.
ConditionalRemoval(ConditionBasePtr condition, bool extract_removed_indices=false)
a constructor that includes the condition.
ComparisonBase()
Constructor.