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>
boost::shared_ptr< const ConditionBase< PointT > > ConstPtr
virtual bool evaluate(const PointT &point) const
Determine the result of this comparison.
virtual bool evaluate(const PointT &point) const =0
Evaluate function.
ConditionalRemoval filters data that satisfies certain conditions.
ConditionAnd()
Constructor.
std::vector< ComparisonBaseConstPtr > comparisons_
The collection of all comparisons that need to be verified.
boost::shared_ptr< const ConditionOr< PointT > > ConstPtr
virtual ~PackedRGBComparison()
Destructor.
pcl::traits::fieldList< PointT >::type FieldList
void setUserFilterValue(float val)
Provide a value that the filtered points should be set to instead of removing them.
The field-based specialization of the comparison object.
uint8_t datatype_
The type of data.
bool capable_
True if capable.
PointCloud::Ptr PointCloudPtr
void setCondition(ConditionBasePtr condition)
Set the condition that the filter will use.
The (abstract) base class for the comparison object.
void setKeepOrganized(bool val)
Set whether the filtered points should be kept and set to the value given through setUserFilterValue ...
void addCondition(Ptr condition)
Add a nested condition to this condition.
ComparisonBase()
Constructor.
virtual ~ConditionBase()
Destructor.
ConditionBase()
Constructor.
PointDataAtOffset< PointT > * point_data_
The point data to compare.
boost::shared_ptr< const ConditionAnd< PointT > > ConstPtr
uint32_t offset_
The data offset.
void transformComparison(const Eigen::Matrix4f &transform)
transform the coordinate system of the comparison.
boost::shared_ptr< const FieldComparison< PointT > > ConstPtr
void setComparisonMatrix(const Eigen::Matrix3f &matrix)
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
std::string filter_name_
The filter name.
A packed HSI specialization of the comparison object.
boost::shared_ptr< PackedHSIComparison< PointT > > Ptr
A comparison whether the (x,y,z) components of a given point satisfy (p'Ap + 2v'p + c [OP] 0)...
virtual ~FieldComparison()
Destructor.
boost::shared_ptr< const TfQuadraticXYZComparison< PointT > > ConstPtr
Eigen::Vector4f comp_vect_
ComparisonBase::Ptr ComparisonBasePtr
float user_filter_value_
User given value to be set to any filtered point.
boost::shared_ptr< const PackedRGBComparison< PointT > > ConstPtr
Filter represents the base filter class.
std::string component_name_
The name of the component.
virtual bool evaluate(const PointT &point) const
Determine the result of this comparison.
ComponentId component_id_
The ID of the component.
virtual bool evaluate(const PointT &point) const
Determine if a point meets this condition.
double compare_val_
All types (that we care about) can be represented as a double.
boost::shared_ptr< FieldComparison< PointT > > Ptr
ConditionOr()
Constructor.
FieldComparison(const FieldComparison &src)
Copy constructor.
boost::shared_ptr< const ComparisonBase< PointT > > ConstPtr
PointDataAtOffset(uint8_t datatype, uint32_t offset)
Constructor.
void setComparisonMatrix(const Eigen::Matrix4f &homogeneousMatrix)
set the matrix "A" of the comparison "p'Ap + 2v'p + c [OP] 0".
bool capable_
True if capable.
void applyFilter(PointCloud &output)
Filter a Point Cloud.
void setComparisonVector(const Eigen::Vector4f &homogeneousVector)
set the vector "v" of the comparison "p'Ap + 2v'p + c [OP] 0".
bool isCapable() const
Check if evaluation requirements are met.
FieldComparison & operator=(const FieldComparison &src)
Copy operator.
pcl::ComparisonBase< PointT > ComparisonBase
CompareOp
The kind of comparison operations that are possible within a comparison object.
virtual ~TfQuadraticXYZComparison()
Empty destructor.
int compare(const PointT &p, const double &val)
Compare function.
std::string field_name_
Field name to compare data on.
uint32_t offset_
The data offset.
boost::shared_ptr< PackedRGBComparison< PointT > > Ptr
ConditionalRemoval(int extract_removed_indices=false)
the default constructor.
std::string component_name_
The name of the component.
boost::shared_ptr< const PackedHSIComparison< PointT > > ConstPtr
bool keep_organized_
Keep the structure of the data organized, by setting the filtered points to the a user given value (N...
pcl::ConditionBase< PointT > ConditionBase
virtual bool evaluate(const PointT &point) const
Determine if a point meets this condition.
boost::shared_ptr< ComparisonBase< PointT > > Ptr
ComparisonOps::CompareOp op_
The comparison operator type.
ConditionBase::ConstPtr ConditionBaseConstPtr
double compare_val_
All types (that we care about) can be represented as a double.
void setComparisonVector(const Eigen::Vector3f &vector)
set the vector "v" of the comparison "p'Ap + 2v'p + c [OP] 0".
virtual ~ComparisonBase()
Destructor.
double compare_val_
All types (that we care about) can be represented as a double.
ConditionBasePtr condition_
The condition to use for filtering.
ConditionalRemoval(ConditionBasePtr condition, bool extract_removed_indices=false)
a constructor that includes the condition.
bool capable_
True if capable.
boost::shared_ptr< PointCloud< PointT > > Ptr
A datatype that enables type-correct comparisons.
bool getKeepOrganized() const
void addComparison(ComparisonBaseConstPtr comparison)
Add a new 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.
PointCloud::ConstPtr PointCloudConstPtr
boost::shared_ptr< const PointCloud< PointT > > ConstPtr
boost::shared_ptr< ConditionOr< PointT > > Ptr
ConditionBase::Ptr ConditionBasePtr
uint32_t rgb_offset_
The offset of the component.
std::vector< Ptr > conditions_
The collection of all conditions that need to be verified.
boost::shared_ptr< ConditionAnd< PointT > > Ptr
uint32_t component_offset_
The offset of the component.
void setComparisonOperator(const pcl::ComparisonOps::CompareOp op)
set the operator "[OP]" of the comparison "p'Ap + 2v'p + c [OP] 0".
virtual bool evaluate(const PointT &point) const
Determine the result of this comparison.
bool isCapable() const
Return if the comparison is capable.
A packed rgb specialization of the comparison object.
virtual bool evaluate(const PointT &point) const =0
Determine if a point meets this condition.
virtual ~PackedHSIComparison()
Destructor.
A point structure representing Euclidean xyz coordinates, and the RGB color.
void transformComparison(const Eigen::Affine3f &transform)
transform the coordinate system of the comparison.
TfQuadraticXYZComparison()
Constructor.
Eigen::Matrix4f comp_matr_
ComparisonBase::ConstPtr ComparisonBaseConstPtr
boost::shared_ptr< ConditionBase< PointT > > Ptr