41 #include <pcl/pcl_config.h>
42 #include <pcl/filters/filter.h>
47 namespace ComparisonOps
60 template<
typename Po
intT>
88 template<
typename Po
intT>
92 using Ptr = shared_ptr<ComparisonBase<PointT> >;
93 using ConstPtr = shared_ptr<const ComparisonBase<PointT> >;
128 template<
typename Po
intT>
136 using Ptr = shared_ptr<FieldComparison<PointT> >;
137 using ConstPtr = shared_ptr<const FieldComparison<PointT> >;
193 template<
typename Po
intT>
200 using Ptr = shared_ptr<PackedRGBComparison<PointT> >;
201 using ConstPtr = shared_ptr<const PackedRGBComparison<PointT> >;
240 template<
typename Po
intT>
247 using Ptr = shared_ptr<PackedHSIComparison<PointT> >;
248 using ConstPtr = shared_ptr<const PackedHSIComparison<PointT> >;
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>
609 using Ptr = shared_ptr<ConditionalRemoval<PointT> >;
610 using ConstPtr = shared_ptr<const ConditionalRemoval<PointT> >;
691 #ifdef PCL_NO_PRECOMPILE
692 #include <pcl/filters/impl/conditional_removal.hpp>
The (abstract) base class for the comparison object.
shared_ptr< ComparisonBase< PointT > > Ptr
shared_ptr< const ComparisonBase< PointT > > ConstPtr
virtual bool evaluate(const PointT &point) const =0
Evaluate function.
ComparisonBase()=default
Constructor.
std::uint32_t offset_
The data offset.
ComparisonOps::CompareOp op_
The comparison operator type.
bool capable_
True if capable.
virtual ~ComparisonBase()=default
Destructor.
bool isCapable() const
Return if the comparison is capable.
std::string field_name_
Field name to compare data on.
bool evaluate(const PointT &point) const override
Determine if a point meets this condition.
ConditionAnd()
Constructor.
bool isCapable() const
Check if evaluation requirements are met.
bool capable_
True if capable.
void addCondition(Ptr condition)
Add a nested condition to this condition.
typename ComparisonBase::Ptr ComparisonBasePtr
typename ComparisonBase::ConstPtr ComparisonBaseConstPtr
std::vector< ComparisonBaseConstPtr > comparisons_
The collection of all comparisons that need to be verified.
shared_ptr< const ConditionBase< PointT > > ConstPtr
std::vector< Ptr > conditions_
The collection of all conditions that need to be verified.
virtual bool evaluate(const PointT &point) const =0
Determine if a point meets this condition.
ConditionBase()
Constructor.
virtual ~ConditionBase()=default
Destructor.
void addComparison(ComparisonBaseConstPtr comparison)
Add a new comparison.
shared_ptr< ConditionBase< PointT > > Ptr
ConditionOr()
Constructor.
bool evaluate(const PointT &point) const override
Determine if a point meets this condition.
ConditionalRemoval filters data that satisfies certain conditions.
typename ConditionBase::ConstPtr ConditionBaseConstPtr
shared_ptr< const ConditionalRemoval< PointT > > ConstPtr
void applyFilter(PointCloud &output) override
Filter a Point Cloud.
ConditionalRemoval(int extract_removed_indices=false)
the default constructor.
bool getKeepOrganized() const
void setCondition(ConditionBasePtr condition)
Set the condition that the filter will use.
bool keep_organized_
Keep the structure of the data organized, by setting the filtered points to the a user given value (N...
void setUserFilterValue(float val)
Provide a value that the filtered points should be set to instead of removing them.
shared_ptr< ConditionalRemoval< PointT > > Ptr
ConditionBasePtr condition_
The condition to use for filtering.
typename ConditionBase::Ptr ConditionBasePtr
bool capable_
True if capable.
void setKeepOrganized(bool val)
Set whether the filtered points should be kept and set to the value given through setUserFilterValue ...
float user_filter_value_
User given value to be set to any filtered point.
The field-based specialization of the comparison object.
~FieldComparison() override
Destructor.
double compare_val_
All types (that we care about) can be represented as a double.
FieldComparison & operator=(const FieldComparison &src)
Copy operator.
PointDataAtOffset< PointT > * point_data_
The point data to compare.
FieldComparison(const FieldComparison &src)
Copy constructor.
bool evaluate(const PointT &point) const override
Determine the result of this comparison.
Filter represents the base filter class.
std::string filter_name_
The filter name.
typename PointCloud::Ptr PointCloudPtr
typename PointCloud::ConstPtr PointCloudConstPtr
A packed HSI specialization of the comparison object.
~PackedHSIComparison() override=default
Destructor.
std::uint32_t rgb_offset_
The offset of the component.
bool evaluate(const PointT &point) const override
Determine the result of this comparison.
std::string component_name_
The name of the component.
ComponentId component_id_
The ID of the component.
double compare_val_
All types (that we care about) can be represented as a double.
A packed rgb specialization of the comparison object.
bool evaluate(const PointT &point) const override
Determine the result of this comparison.
std::uint32_t component_offset_
The offset of the component.
double compare_val_
All types (that we care about) can be represented as a double.
~PackedRGBComparison() override=default
Destructor.
std::string component_name_
The name of the component.
PointCloud represents the base class in PCL for storing collections of 3D points.
shared_ptr< PointCloud< PointT > > Ptr
shared_ptr< const PointCloud< PointT > > ConstPtr
A datatype that enables type-correct comparisons.
int compare(const PointT &p, const double &val)
Compare function.
PointDataAtOffset(std::uint8_t datatype, std::uint32_t offset)
Constructor.
std::uint8_t datatype_
The type of data.
std::uint32_t offset_
The data offset.
A comparison whether the (x,y,z) components of a given point satisfy (p'Ap + 2v'p + c [OP] 0).
TfQuadraticXYZComparison()
Constructor.
void setComparisonVector(const Eigen::Vector3f &vector)
set the vector "v" of the comparison "p'Ap + 2v'p + c [OP] 0".
void setComparisonVector(const Eigen::Vector4f &homogeneousVector)
set the vector "v" of the comparison "p'Ap + 2v'p + c [OP] 0".
Eigen::Matrix4f comp_matr_
void setComparisonScalar(const float &scalar)
set the scalar "c" of the comparison "p'Ap + 2v'p + c [OP] 0".
~TfQuadraticXYZComparison() override=default
Empty destructor.
void transformComparison(const Eigen::Matrix4f &transform)
transform the coordinate system of the comparison.
void setComparisonMatrix(const Eigen::Matrix4f &homogeneousMatrix)
set the matrix "A" of the comparison "p'Ap + 2v'p + c [OP] 0".
void transformComparison(const Eigen::Affine3f &transform)
transform the coordinate system of the comparison.
void setComparisonOperator(const pcl::ComparisonOps::CompareOp op)
set the operator "[OP]" of the comparison "p'Ap + 2v'p + c [OP] 0".
Eigen::Vector4f comp_vect_
void setComparisonMatrix(const Eigen::Matrix3f &matrix)
set the matrix "A" of the comparison "p'Ap + 2v'p + c [OP] 0".
bool evaluate(const PointT &point) const override
Determine the result of this comparison.
#define PCL_MAKE_ALIGNED_OPERATOR_NEW
Macro to signal a class requires a custom allocator.
Defines functions, macros and traits for allocating and using memory.
CompareOp
The kind of comparison operations that are possible within a comparison object.
A point structure representing Euclidean xyz coordinates, and the RGB color.