Point Cloud Library (PCL)  1.14.0-dev
List of all members | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
pcl::ConditionalRemoval< PointT > Class Template Reference

ConditionalRemoval filters data that satisfies certain conditions. More...

#include <pcl/filters/conditional_removal.h>

+ Inheritance diagram for pcl::ConditionalRemoval< PointT >:
+ Collaboration diagram for pcl::ConditionalRemoval< PointT >:

Public Types

using ConditionBase = pcl::ConditionBase< PointT >
 
using ConditionBasePtr = typename ConditionBase::Ptr
 
using ConditionBaseConstPtr = typename ConditionBase::ConstPtr
 
using Ptr = shared_ptr< ConditionalRemoval< PointT > >
 
using ConstPtr = shared_ptr< const ConditionalRemoval< PointT > >
 
- Public Types inherited from pcl::Filter< PointT >
using Ptr = shared_ptr< Filter< PointT > >
 
using ConstPtr = shared_ptr< const Filter< PointT > >
 
using PointCloud = pcl::PointCloud< PointT >
 
using PointCloudPtr = typename PointCloud::Ptr
 
using PointCloudConstPtr = typename PointCloud::ConstPtr
 
- Public Types inherited from pcl::PCLBase< PointT >
using PointCloud = pcl::PointCloud< PointT >
 
using PointCloudPtr = typename PointCloud::Ptr
 
using PointCloudConstPtr = typename PointCloud::ConstPtr
 
using PointIndicesPtr = PointIndices::Ptr
 
using PointIndicesConstPtr = PointIndices::ConstPtr
 

Public Member Functions

 ConditionalRemoval (int extract_removed_indices=false)
 the default constructor. More...
 
void setKeepOrganized (bool val)
 Set whether the filtered points should be kept and set to the value given through setUserFilterValue (default: NaN), or removed from the PointCloud, thus potentially breaking its organized structure. More...
 
bool getKeepOrganized () const
 
void setUserFilterValue (float val)
 Provide a value that the filtered points should be set to instead of removing them. More...
 
void setCondition (ConditionBasePtr condition)
 Set the condition that the filter will use. More...
 
- Public Member Functions inherited from pcl::Filter< PointT >
 Filter (bool extract_removed_indices=false)
 Empty constructor. More...
 
IndicesConstPtr const getRemovedIndices () const
 Get the point indices being removed. More...
 
void getRemovedIndices (PointIndices &pi)
 Get the point indices being removed. More...
 
void filter (PointCloud &output)
 Calls the filtering method and returns the filtered dataset in output. More...
 
- Public Member Functions inherited from pcl::PCLBase< PointT >
 PCLBase ()
 Empty constructor. More...
 
 PCLBase (const PCLBase &base)
 Copy constructor. More...
 
virtual ~PCLBase ()=default
 Destructor. More...
 
virtual void setInputCloud (const PointCloudConstPtr &cloud)
 Provide a pointer to the input dataset. More...
 
PointCloudConstPtr const getInputCloud () const
 Get a pointer to the input point cloud dataset. More...
 
virtual void setIndices (const IndicesPtr &indices)
 Provide a pointer to the vector of indices that represents the input data. More...
 
virtual void setIndices (const IndicesConstPtr &indices)
 Provide a pointer to the vector of indices that represents the input data. More...
 
virtual void setIndices (const PointIndicesConstPtr &indices)
 Provide a pointer to the vector of indices that represents the input data. More...
 
virtual void setIndices (std::size_t row_start, std::size_t col_start, std::size_t nb_rows, std::size_t nb_cols)
 Set the indices for the points laying within an interest region of the point cloud. More...
 
IndicesPtr getIndices ()
 Get a pointer to the vector of indices used. More...
 
IndicesConstPtr const getIndices () const
 Get a pointer to the vector of indices used. More...
 
const PointToperator[] (std::size_t pos) const
 Override PointCloud operator[] to shorten code. More...
 

Protected Member Functions

void applyFilter (PointCloud &output) override
 Filter a Point Cloud. More...
 
- Protected Member Functions inherited from pcl::Filter< PointT >
const std::string & getClassName () const
 Get a string representation of the name of this class. More...
 
- Protected Member Functions inherited from pcl::PCLBase< PointT >
bool initCompute ()
 This method should get called before starting the actual computation. More...
 
bool deinitCompute ()
 This method should get called after finishing the actual computation. More...
 

Protected Attributes

bool capable_ {false}
 True if capable. More...
 
bool keep_organized_ {false}
 Keep the structure of the data organized, by setting the filtered points to the a user given value (NaN by default). More...
 
ConditionBasePtr condition_
 The condition to use for filtering. More...
 
float user_filter_value_
 User given value to be set to any filtered point. More...
 
- Protected Attributes inherited from pcl::Filter< PointT >
IndicesPtr removed_indices_
 Indices of the points that are removed. More...
 
std::string filter_name_
 The filter name. More...
 
bool extract_removed_indices_
 Set to true if we want to return the indices of the removed points. More...
 
- Protected Attributes inherited from pcl::PCLBase< PointT >
PointCloudConstPtr input_
 The input point cloud dataset. More...
 
IndicesPtr indices_
 A pointer to the vector of point indices to use. More...
 
bool use_indices_
 Set to true if point indices are used. More...
 
bool fake_indices_
 If no set of indices are given, we construct a set of fake indices that mimic the input PointCloud. More...
 

Detailed Description

template<typename PointT>
class pcl::ConditionalRemoval< PointT >

ConditionalRemoval filters data that satisfies certain conditions.

A ConditionalRemoval must be provided a condition. There are two types of conditions: ConditionAnd and ConditionOr. Conditions require one or more comparisons and/or other conditions. A comparison has a name, a comparison operator, and a value.

An ConditionAnd will evaluate to true when ALL of its encapsulated comparisons and conditions are true.

An ConditionOr will evaluate to true when ANY of its encapsulated comparisons and conditions are true.

Depending on the derived type of the comparison, the name can correspond to a PointCloud field name, or a color component in rgb color space or hsi color space.

Here is an example usage:

// Build the condition
// Build the filter
range_filt.setCondition (range_cond);
range_filt.setKeepOrganized (false);
shared_ptr< ConditionAnd< PointT > > Ptr
ConditionalRemoval filters data that satisfies certain conditions.
void setCondition(ConditionBasePtr condition)
Set the condition that the filter will use.
void setKeepOrganized(bool val)
Set whether the filtered points should be kept and set to the value given through setUserFilterValue ...
The field-based specialization of the comparison object.
shared_ptr< FieldComparison< PointT > > Ptr
Author
Louis LeGrand, Intel Labs Seattle

Definition at line 591 of file conditional_removal.h.

Member Typedef Documentation

◆ ConditionBase

template<typename PointT >
using pcl::ConditionalRemoval< PointT >::ConditionBase = pcl::ConditionBase<PointT>

Definition at line 605 of file conditional_removal.h.

◆ ConditionBaseConstPtr

template<typename PointT >
using pcl::ConditionalRemoval< PointT >::ConditionBaseConstPtr = typename ConditionBase::ConstPtr

Definition at line 607 of file conditional_removal.h.

◆ ConditionBasePtr

template<typename PointT >
using pcl::ConditionalRemoval< PointT >::ConditionBasePtr = typename ConditionBase::Ptr

Definition at line 606 of file conditional_removal.h.

◆ ConstPtr

template<typename PointT >
using pcl::ConditionalRemoval< PointT >::ConstPtr = shared_ptr<const ConditionalRemoval<PointT> >

Definition at line 610 of file conditional_removal.h.

◆ Ptr

template<typename PointT >
using pcl::ConditionalRemoval< PointT >::Ptr = shared_ptr<ConditionalRemoval<PointT> >

Definition at line 609 of file conditional_removal.h.

Constructor & Destructor Documentation

◆ ConditionalRemoval()

template<typename PointT >
pcl::ConditionalRemoval< PointT >::ConditionalRemoval ( int  extract_removed_indices = false)
inline

the default constructor.


All ConditionalRemovals require a condition which can be set using the setCondition method

Parameters
extract_removed_indicesextract filtered indices from indices vector

Definition at line 619 of file conditional_removal.h.

References pcl::Filter< PointT >::filter_name_.

Member Function Documentation

◆ applyFilter()

template<typename PointT >
void pcl::ConditionalRemoval< PointT >::applyFilter ( PointCloud output)
overrideprotectedvirtual

◆ getKeepOrganized()

template<typename PointT >
bool pcl::ConditionalRemoval< PointT >::getKeepOrganized ( ) const
inline

◆ setCondition()

template<typename PointT >
void pcl::ConditionalRemoval< PointT >::setCondition ( ConditionBasePtr  condition)

Set the condition that the filter will use.


Parameters
conditioneach point must satisfy this condition to avoid being removed by the filter

All ConditionalRemovals require a condition

Definition at line 617 of file conditional_removal.hpp.

Referenced by pcl::kinfuLS::WorldModel< PointT >::getExistingData(), and pcl::kinfuLS::WorldModel< PointT >::setSliceAsNans().

◆ setKeepOrganized()

template<typename PointT >
void pcl::ConditionalRemoval< PointT >::setKeepOrganized ( bool  val)
inline

Set whether the filtered points should be kept and set to the value given through setUserFilterValue (default: NaN), or removed from the PointCloud, thus potentially breaking its organized structure.

By default, points are removed.

Parameters
valset to true whether the filtered points should be kept and set to a given user value (default: NaN)

Definition at line 635 of file conditional_removal.h.

References pcl::ConditionalRemoval< PointT >::keep_organized_.

Referenced by pcl::kinfuLS::WorldModel< PointT >::getExistingData(), and pcl::kinfuLS::WorldModel< PointT >::setSliceAsNans().

◆ setUserFilterValue()

template<typename PointT >
void pcl::ConditionalRemoval< PointT >::setUserFilterValue ( float  val)
inline

Provide a value that the filtered points should be set to instead of removing them.

Used in conjunction with setKeepOrganized ().

Parameters
valthe user given value that the filtered point dimensions should be set to

Definition at line 652 of file conditional_removal.h.

References pcl::ConditionalRemoval< PointT >::user_filter_value_.

Member Data Documentation

◆ capable_

template<typename PointT >
bool pcl::ConditionalRemoval< PointT >::capable_ {false}
protected

True if capable.

Definition at line 674 of file conditional_removal.h.

◆ condition_

template<typename PointT >
ConditionBasePtr pcl::ConditionalRemoval< PointT >::condition_
protected

The condition to use for filtering.

Definition at line 682 of file conditional_removal.h.

◆ keep_organized_

template<typename PointT >
bool pcl::ConditionalRemoval< PointT >::keep_organized_ {false}
protected

Keep the structure of the data organized, by setting the filtered points to the a user given value (NaN by default).

Definition at line 679 of file conditional_removal.h.

Referenced by pcl::ConditionalRemoval< PointT >::getKeepOrganized(), and pcl::ConditionalRemoval< PointT >::setKeepOrganized().

◆ user_filter_value_

template<typename PointT >
float pcl::ConditionalRemoval< PointT >::user_filter_value_
protected

User given value to be set to any filtered point.

Casted to the correct field type.

Definition at line 687 of file conditional_removal.h.

Referenced by pcl::ConditionalRemoval< PointT >::setUserFilterValue().


The documentation for this class was generated from the following files: