40 #include <pcl/memory.h>
41 #include <pcl/pcl_macros.h>
42 #include <pcl/common/eigen.h>
43 #include <pcl/filters/filter.h>
48 namespace ComparisonOps
61 template<
typename Po
intT>
89 template<
typename Po
intT>
93 using Ptr = shared_ptr<ComparisonBase<PointT> >;
94 using ConstPtr = shared_ptr<const ComparisonBase<PointT> >;
129 template<
typename Po
intT>
137 using Ptr = shared_ptr<FieldComparison<PointT> >;
138 using ConstPtr = shared_ptr<const FieldComparison<PointT> >;
187 compare_val_ (), point_data_ ()
194 template<
typename Po
intT>
201 using Ptr = shared_ptr<PackedRGBComparison<PointT> >;
202 using ConstPtr = shared_ptr<const PackedRGBComparison<PointT> >;
233 component_offset_ (), compare_val_ ()
241 template<
typename Po
intT>
248 using Ptr = shared_ptr<PackedHSIComparison<PointT> >;
249 using ConstPtr = shared_ptr<const PackedHSIComparison<PointT> >;
290 component_id_ (), compare_val_ (), rgb_offset_ ()
310 template<
typename Po
intT>
316 using Ptr = shared_ptr<TfQuadraticXYZComparison<PointT> >;
317 using ConstPtr = shared_ptr<const TfQuadraticXYZComparison<PointT> >;
334 const Eigen::Vector3f &comparison_vector,
const float &comparison_scalar,
335 const Eigen::Affine3f &comparison_transform = Eigen::Affine3f::Identity ());
404 tf_comp_matr_ = transform.transpose () *
comp_matr_ * transform;
405 tf_comp_vect_ =
comp_vect_.transpose () * transform;
440 Eigen::Matrix4f tf_comp_matr_;
441 Eigen::Vector4f tf_comp_vect_;
446 template<
typename Po
intT>
454 using Ptr = shared_ptr<ConditionBase<PointT> >;
455 using ConstPtr = shared_ptr<const ConditionBase<PointT> >;
503 template<
typename Po
intT>
510 using Ptr = shared_ptr<ConditionAnd<PointT> >;
511 using ConstPtr = shared_ptr<const ConditionAnd<PointT> >;
531 template<
typename Po
intT>
538 using Ptr = shared_ptr<ConditionOr<PointT> >;
539 using ConstPtr = shared_ptr<const ConditionOr<PointT> >;
590 template<
typename Po
intT>
687 #ifdef PCL_NO_PRECOMPILE
688 #include <pcl/filters/impl/conditional_removal.hpp>
void setComparisonMatrix(const Eigen::Matrix3f &matrix)
set the matrix "A" of the comparison "p'Ap + 2v'p + c [OP] 0".
A comparison whether the (x,y,z) components of a given point satisfy (p'Ap + 2v'p + c [OP] 0)...
std::uint32_t rgb_offset_
The offset of the component.
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.
virtual bool evaluate(const PointT &point) const =0
Evaluate function.
shared_ptr< ConditionBase< PointT > > Ptr
shared_ptr< ComparisonBase< PointT > > Ptr
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 ...
ComponentId component_id_
The ID of the component.
FieldComparison & operator=(const FieldComparison &src)
Copy operator.
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'Ap + 2v'p + c [OP] 0".
void setUserFilterValue(float val)
Provide a value that the filtered points should be set to instead of removing them.
ConditionAnd()
Constructor.
bool isCapable() const
Return if the comparison is capable.
bool evaluate(const PointT &point) const override
Determine the result of this comparison.
A datatype that enables type-correct comparisons.
void setCondition(ConditionBasePtr condition)
Set the condition that the filter will use.
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.
bool evaluate(const PointT &point) const override
Determine if a point meets this condition.
void setComparisonVector(const Eigen::Vector3f &vector)
set the vector "v" of the comparison "p'Ap + 2v'p + c [OP] 0".
ConditionOr()
Constructor.
bool evaluate(const PointT &point) const override
Determine if a point meets this condition.
void setComparisonVector(const Eigen::Vector4f &homogeneousVector)
set the vector "v" of the comparison "p'Ap + 2v'p + c [OP] 0".
std::uint8_t datatype_
The type of data.
bool isCapable() const
Check if evaluation requirements are met.
#define PCL_MAKE_ALIGNED_OPERATOR_NEW
Macro to signal a class requires a custom allocator.
typename ConditionBase::Ptr ConditionBasePtr
ComparisonOps::CompareOp op_
The comparison operator type.
std::uint32_t component_offset_
The offset of the component.
~PackedHSIComparison()
Destructor.
ConditionalRemoval(int extract_removed_indices=false)
the default constructor.
virtual bool evaluate(const PointT &point) const =0
Determine if a point meets this condition.
ConditionalRemoval filters data that satisfies certain conditions.
bool capable_
True if capable.
std::uint32_t offset_
The data offset.
shared_ptr< PointCloud< PointT > > Ptr
Filter represents the base filter class.
void applyFilter(PointCloud &output) override
Filter a Point Cloud.
int compare(const PointT &p, const double &val)
Compare function.
virtual ~ComparisonBase()
Destructor.
ConditionBasePtr condition_
The condition to use for filtering.
Eigen::Vector4f comp_vect_
bool getKeepOrganized() const
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'Ap + 2v'p + c [OP] 0".
A packed rgb specialization of the comparison object.
typename PointCloud::Ptr PointCloudPtr
bool capable_
True if capable.
bool evaluate(const PointT &point) const override
Determine the result of this comparison.
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...
bool evaluate(const PointT &point) const override
Determine the result of this comparison.
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
TfQuadraticXYZComparison()
Constructor.
void setComparisonScalar(const float &scalar)
set the scalar "c" of the comparison "p'Ap + 2v'p + c [OP] 0".
ConditionBase()
Constructor.
void addCondition(Ptr condition)
Add a nested condition to this condition.
PointCloud represents the base class in PCL for storing collections of 3D points. ...
~PackedRGBComparison()
Destructor.
FieldComparison(const FieldComparison &src)
Copy constructor.
shared_ptr< const PointCloud< PointT > > ConstPtr
Eigen::Matrix4f comp_matr_
typename ComparisonBase::ConstPtr ComparisonBaseConstPtr
virtual ~ConditionBase()=default
Destructor.
void addComparison(ComparisonBaseConstPtr comparison)
Add a new comparison.
bool evaluate(const PointT &point) const override
Determine the result of this comparison.
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.
std::string filter_name_
The filter name.
A point structure representing Euclidean xyz coordinates, and the RGB color.
~FieldComparison()
Destructor.
shared_ptr< const ComparisonBase< PointT > > ConstPtr
PointDataAtOffset(std::uint8_t datatype, std::uint32_t offset)
Constructor.
std::vector< Ptr > conditions_
The collection of all conditions that need to be verified.
shared_ptr< const ConditionBase< PointT > > ConstPtr
std::uint32_t offset_
The data offset.
typename PointCloud::ConstPtr PointCloudConstPtr