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

#include <pcl/2d/morphology.h>

+ Inheritance diagram for pcl::Morphology< PointT >:

Public Types

enum  MORPHOLOGICAL_OPERATOR_TYPE {
  EROSION_GRAY, DILATION_GRAY, OPENING_GRAY, CLOSING_GRAY,
  EROSION_BINARY, DILATION_BINARY, OPENING_BINARY, CLOSING_BINARY
}
 
- Public Types inherited from pcl::PCLBase< PointT >
typedef pcl::PointCloud< PointTPointCloud
 
typedef PointCloud::Ptr PointCloudPtr
 
typedef PointCloud::ConstPtr PointCloudConstPtr
 
typedef boost::shared_ptr
< PointIndices
PointIndicesPtr
 
typedef boost::shared_ptr
< PointIndices const > 
PointIndicesConstPtr
 

Public Member Functions

 Morphology ()
 
void openingBinary (pcl::PointCloud< PointT > &output)
 This function performs erosion followed by dilation. More...
 
void closingBinary (pcl::PointCloud< PointT > &output)
 This function performs dilation followed by erosion. More...
 
void erosionBinary (pcl::PointCloud< PointT > &output)
 Binary dilation is similar to a logical disjunction of sets. More...
 
void dilationBinary (pcl::PointCloud< PointT > &output)
 Binary erosion is similar to a logical addition of sets. More...
 
void openingGray (pcl::PointCloud< PointT > &output)
 Grayscale erosion followed by dilation. More...
 
void closingGray (pcl::PointCloud< PointT > &output)
 Grayscale dilation followed by erosion. More...
 
void erosionGray (pcl::PointCloud< PointT > &output)
 Takes the min of the pixels where kernel is 1. More...
 
void dilationGray (pcl::PointCloud< PointT > &output)
 Takes the max of the pixels where kernel is 1. More...
 
void subtractionBinary (pcl::PointCloud< PointT > &output, const pcl::PointCloud< PointT > &input1, const pcl::PointCloud< PointT > &input2)
 Set operation output = input1 - input2. More...
 
void unionBinary (pcl::PointCloud< PointT > &output, const pcl::PointCloud< PointT > &input1, const pcl::PointCloud< PointT > &input2)
 Set operation $output = input1 \cup input2$. More...
 
void intersectionBinary (pcl::PointCloud< PointT > &output, const pcl::PointCloud< PointT > &input1, const pcl::PointCloud< PointT > &input2)
 Set operation $ output = input1 \cap input2 $. More...
 
void structuringElementCircular (pcl::PointCloud< PointT > &kernel, const int radius)
 Creates a circular structing element. More...
 
void structuringElementRectangle (pcl::PointCloud< PointT > &kernel, const int height, const int width)
 Creates a rectangular structing element of size height x width. More...
 
void applyMorphologicalOperation (pcl::PointCloud< PointT > &output)
 
void setStructuringElement (const PointCloudInPtr &structuring_element)
 
- Public Member Functions inherited from pcl::PCLBase< PointT >
 PCLBase ()
 Empty constructor. More...
 
 PCLBase (const PCLBase &base)
 Copy constructor. More...
 
virtual ~PCLBase ()
 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 (size_t row_start, size_t col_start, size_t nb_rows, size_t nb_cols)
 Set the indices for the points laying within an interest region of the point cloud. More...
 
IndicesPtr const 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[] (size_t pos) const
 Override PointCloud operator[] to shorten code. More...
 

Public Attributes

MORPHOLOGICAL_OPERATOR_TYPE operator_type
 

Additional Inherited Members

- 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 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::Morphology< PointT >

Definition at line 46 of file morphology.h.

Member Enumeration Documentation

template<typename PointT >
enum pcl::Morphology::MORPHOLOGICAL_OPERATOR_TYPE
Enumerator
EROSION_GRAY 
DILATION_GRAY 
OPENING_GRAY 
CLOSING_GRAY 
EROSION_BINARY 
DILATION_BINARY 
OPENING_BINARY 
CLOSING_BINARY 

Definition at line 170 of file morphology.h.

Constructor & Destructor Documentation

template<typename PointT >
pcl::Morphology< PointT >::Morphology ( )
inline

Definition at line 57 of file morphology.h.

Member Function Documentation

template<typename PointT >
void pcl::Morphology< PointT >::applyMorphologicalOperation ( pcl::PointCloud< PointT > &  output)
Parameters
[out]outputOutput point cloud passed by reference
template<typename PointT >
void pcl::Morphology< PointT >::closingBinary ( pcl::PointCloud< PointT > &  output)

This function performs dilation followed by erosion.

It is useful for filling up (holes/cracks/small discontinuities) in a binary segmented region

Parameters
[out]outputOutput point cloud passed by reference

Definition at line 158 of file morphology.hpp.

template<typename PointT >
void pcl::Morphology< PointT >::closingGray ( pcl::PointCloud< PointT > &  output)

Grayscale dilation followed by erosion.

This is used to remove small dark artifacts from the image. Bright features or large dark features are relatively undisturbed.

Parameters
[out]outputOutput point cloud passed by reference

Definition at line 265 of file morphology.hpp.

template<typename PointT >
void pcl::Morphology< PointT >::dilationBinary ( pcl::PointCloud< PointT > &  output)

Binary erosion is similar to a logical addition of sets.

At each pixel having value 1, if at least one pixel in the structuring element is 1 and the corresponding point in the input image is 1, the center pixel is set to 1. Otherwise, it is set to 0.

Parameters
[out]outputOutput point cloud passed by reference

Definition at line 99 of file morphology.hpp.

References pcl::PointCloud< T >::height, pcl::PointCloud< T >::resize(), and pcl::PointCloud< T >::width.

template<typename PointT >
void pcl::Morphology< PointT >::dilationGray ( pcl::PointCloud< PointT > &  output)

Takes the max of the pixels where kernel is 1.

Parameters
[out]outputOutput point cloud passed by reference

Definition at line 211 of file morphology.hpp.

References pcl::PointCloud< T >::height, pcl::PointCloud< T >::resize(), and pcl::PointCloud< T >::width.

template<typename PointT >
void pcl::Morphology< PointT >::erosionBinary ( pcl::PointCloud< PointT > &  output)

Binary dilation is similar to a logical disjunction of sets.

At each pixel having value 1, if for all pixels in the structuring element having value 1, the corresponding pixels in the input image are also 1, the center pixel is set to 1. Otherwise, it is set to 0.

Parameters
[out]outputOutput point cloud passed by reference

Definition at line 44 of file morphology.hpp.

References pcl::PointCloud< T >::height, pcl::PointCloud< T >::resize(), and pcl::PointCloud< T >::width.

template<typename PointT >
void pcl::Morphology< PointT >::erosionGray ( pcl::PointCloud< PointT > &  output)

Takes the min of the pixels where kernel is 1.

Parameters
[out]outputOutput point cloud passed by reference

Definition at line 168 of file morphology.hpp.

References pcl::PointCloud< T >::height, pcl::PointCloud< T >::resize(), and pcl::PointCloud< T >::width.

template<typename PointT >
void pcl::Morphology< PointT >::intersectionBinary ( pcl::PointCloud< PointT > &  output,
const pcl::PointCloud< PointT > &  input1,
const pcl::PointCloud< PointT > &  input2 
)

Set operation $ output = input1 \cap input2 $.

Parameters
[out]outputOutput point cloud passed by reference
[in]input1
[in]input2

Definition at line 319 of file morphology.hpp.

References pcl::PointCloud< T >::height, pcl::PointCloud< T >::resize(), pcl::PointCloud< T >::size(), and pcl::PointCloud< T >::width.

template<typename PointT >
void pcl::Morphology< PointT >::openingBinary ( pcl::PointCloud< PointT > &  output)

This function performs erosion followed by dilation.

It is useful for removing noise in the form of small blobs and patches.

Parameters
[out]outputOutput point cloud passed by reference

Definition at line 147 of file morphology.hpp.

template<typename PointT >
void pcl::Morphology< PointT >::openingGray ( pcl::PointCloud< PointT > &  output)

Grayscale erosion followed by dilation.

This is used to remove small bright artifacts from the image. Large bright objects are relatively undisturbed.

Parameters
[out]outputOutput point cloud passed by reference

Definition at line 255 of file morphology.hpp.

template<typename PointT >
void pcl::Morphology< PointT >::setStructuringElement ( const PointCloudInPtr &  structuring_element)
Parameters
[in]structuring_elementThe structuring element to be used for the morphological operation

Definition at line 375 of file morphology.hpp.

template<typename PointT >
void pcl::Morphology< PointT >::structuringElementCircular ( pcl::PointCloud< PointT > &  kernel,
const int  radius 
)

Creates a circular structing element.

The size of the kernel created is 2*radius x 2*radius. Center of the structuring element is the center of the circle. All values lying on the circle are 1 and the others are 0.

Parameters
[out]kernelstructuring element kernel passed by reference
[in]radiusRadius of the circular structuring element.

Definition at line 341 of file morphology.hpp.

References pcl::PointCloud< T >::height, pcl::PointCloud< T >::resize(), and pcl::PointCloud< T >::width.

template<typename PointT >
void pcl::Morphology< PointT >::structuringElementRectangle ( pcl::PointCloud< PointT > &  kernel,
const int  height,
const int  width 
)

Creates a rectangular structing element of size height x width.

  • All values are 1.
Parameters
[out]kernelstructuring element kernel passed by reference
[in]heightheight number of rows in the structuring element
[in]widthnumber of columns in the structuring element

Definition at line 363 of file morphology.hpp.

References pcl::PointCloud< T >::height, pcl::PointCloud< T >::resize(), pcl::PointCloud< T >::size(), and pcl::PointCloud< T >::width.

template<typename PointT >
void pcl::Morphology< PointT >::subtractionBinary ( pcl::PointCloud< PointT > &  output,
const pcl::PointCloud< PointT > &  input1,
const pcl::PointCloud< PointT > &  input2 
)

Set operation output = input1 - input2.

Parameters
[out]outputOutput point cloud passed by reference
[in]input1
[in]input2

Definition at line 275 of file morphology.hpp.

References pcl::PointCloud< T >::height, pcl::PointCloud< T >::resize(), pcl::PointCloud< T >::size(), and pcl::PointCloud< T >::width.

template<typename PointT >
void pcl::Morphology< PointT >::unionBinary ( pcl::PointCloud< PointT > &  output,
const pcl::PointCloud< PointT > &  input1,
const pcl::PointCloud< PointT > &  input2 
)

Set operation $output = input1 \cup input2$.

Parameters
[out]outputOutput point cloud passed by reference
[in]input1
[in]input2

Definition at line 297 of file morphology.hpp.

References pcl::PointCloud< T >::height, pcl::PointCloud< T >::resize(), pcl::PointCloud< T >::size(), and pcl::PointCloud< T >::width.

Member Data Documentation

template<typename PointT >
MORPHOLOGICAL_OPERATOR_TYPE pcl::Morphology< PointT >::operator_type

Definition at line 182 of file morphology.h.


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