Loading...
Searching...
No Matches
pcl::ColorGradientModality< PointInT > Class Template Reference

Modality based on max-RGB gradients. More...

`#include <pcl/recognition/color_gradient_modality.h>`

Inheritance diagram for pcl::ColorGradientModality< PointInT >:

## Classes

struct | Candidate
| Candidate for a feature (used in feature extraction methods). More...

## Public Types

enum | FeatureSelectionMethod { MASK_BORDER_HIGH_GRADIENTS , MASK_BORDER_EQUALLY , DISTANCE_MAGNITUDE_SCORE }
| Different methods for feature selection/extraction. More...
using | PointCloudIn = pcl::PointCloud< PointInT >
Public Types inherited from pcl::PCLBase< PointInT >
using | PointCloud = pcl::PointCloud< PointInT >
using | PointCloudPtr = typename PointCloud::Ptr
using | PointCloudConstPtr = typename PointCloud::ConstPtr
using | PointIndicesPtr = PointIndices::Ptr
using | PointIndicesConstPtr = PointIndices::ConstPtr

## Public Member Functions

| ColorGradientModality ()
| Constructor.
| ~ColorGradientModality () override
| Destructor.
void | setGradientMagnitudeThreshold (const float threshold)
| Sets the threshold for the gradient magnitude which is used when quantizing the data.
void | setGradientMagnitudeThresholdForFeatureExtraction (const float threshold)
| Sets the threshold for the gradient magnitude which is used for feature extraction.
void | setFeatureSelectionMethod (const FeatureSelectionMethod method)
| Sets the feature selection method.
void | setSpreadingSize (const std::size_t spreading_size)
| Sets the spreading size for spreading the quantized data.
void | setVariableFeatureNr (const bool enabled)
| Sets whether variable feature numbers for feature extraction is enabled.
QuantizedMap & | getQuantizedMap () override
| Returns a reference to the internally computed quantized map.
QuantizedMap & | getSpreadedQuantizedMap () override
| Returns a reference to the internally computed spread quantized map.
pcl::PointCloud< pcl::GradientXY > & | getMaxColorGradients ()
| Returns a point cloud containing the max-RGB gradients.
void | extractFeatures (const MaskMap &mask, std::size_t nr_features, std::size_t modalityIndex, std::vector< QuantizedMultiModFeature > &features) const override
| Extracts features from this modality within the specified mask.
void | extractAllFeatures (const MaskMap &mask, std::size_t nr_features, std::size_t modalityIndex, std::vector< QuantizedMultiModFeature > &features) const override
| Extracts all possible features from the modality within the specified mask.
void | setInputCloud (const typename PointCloudIn::ConstPtr &cloud) override
| Provide a pointer to the input dataset (overwrites the PCLBase::setInputCloud method)
virtual void | processInputData ()
| Processes the input data (smoothing, computing gradients, quantizing, filtering, spreading).
virtual void | processInputDataFromFiltered ()
| Processes the input data assuming that everything up to filtering is already done/available (so only spreading is performed).
Public Member Functions inherited from pcl::QuantizableModality
| QuantizableModality ()
| Constructor.
virtual | ~QuantizableModality ()
| Destructor.
Public Member Functions inherited from pcl::PCLBase< PointInT >
| PCLBase ()
| Empty constructor.
| PCLBase (const PCLBase &base)
| Copy constructor.
virtual | ~PCLBase ()=default
| Destructor.
virtual void | setInputCloud (const PointCloudConstPtr &cloud)
| Provide a pointer to the input dataset.
PointCloudConstPtr const | getInputCloud () const
| Get a pointer to the input point cloud dataset.
virtual void | setIndices (const IndicesPtr &indices)
| Provide a pointer to the vector of indices that represents the input data.
virtual void | setIndices (const IndicesConstPtr &indices)
| Provide a pointer to the vector of indices that represents the input data.
virtual void | setIndices (const PointIndicesConstPtr &indices)
| Provide a pointer to the vector of indices that represents the input data.
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.
IndicesPtr | getIndices ()
| Get a pointer to the vector of indices used.
IndicesConstPtr const | getIndices () const
| Get a pointer to the vector of indices used.
const PointInT & | operator[] (std::size_t pos) const
| Override PointCloud operator[] to shorten code.

## Protected Member Functions

void | computeGaussianKernel (const std::size_t kernel_size, const float sigma, std::vector< float > &kernel_values)
| Computes the Gaussian kernel used for smoothing.
void | computeMaxColorGradients (const typename pcl::PointCloud< pcl::RGB >::ConstPtr &cloud)
| Computes the max-RGB gradients for the specified cloud.
void | computeMaxColorGradientsSobel (const typename pcl::PointCloud< pcl::RGB >::ConstPtr &cloud)
| Computes the max-RGB gradients for the specified cloud using sobel.
void | quantizeColorGradients ()
| Quantizes the color gradients.
void | filterQuantizedColorGradients ()
| Filters the quantized gradients.
Protected Member Functions inherited from pcl::PCLBase< PointInT >
bool | initCompute ()
| This method should get called before starting the actual computation.
bool | deinitCompute ()
| This method should get called after finishing the actual computation.

## Static Protected Member Functions

static void | erode (const pcl::MaskMap &mask_in, pcl::MaskMap &mask_out)
| Erodes a mask.

## Additional Inherited Members

Protected Attributes inherited from pcl::PCLBase< PointInT >
PointCloudConstPtr | input_
| The input point cloud dataset.
IndicesPtr | indices_
| A pointer to the vector of point indices to use.
bool | use_indices_
| Set to true if point indices are used.
bool | fake_indices_
| If no set of indices are given, we construct a set of fake indices that mimic the input PointCloud.

## Detailed Description

template<typename PointInT>
class pcl::ColorGradientModality< PointInT >

Modality based on max-RGB gradients.

Author
  Stefan Holzer

Definition at line 57 of file color_gradient_modality.h.

## Member Typedef Documentation

## PointCloudIn

template<typename PointInT >

using pcl::ColorGradientModality< PointInT >::PointCloudIn = pcl::PointCloud<PointInT>

Definition at line 84 of file color_gradient_modality.h.

## Member Enumeration Documentation

## FeatureSelectionMethod

template<typename PointInT >

enum pcl::ColorGradientModality::FeatureSelectionMethod

Different methods for feature selection/extraction.

Enumerator
MASK_BORDER_HIGH_GRADIENTS |
MASK_BORDER_EQUALLY |
DISTANCE_MAGNITUDE_SCORE |

Definition at line 87 of file color_gradient_modality.h.

## Constructor & Destructor Documentation

## ColorGradientModality()

template<typename PointInT >

pcl::ColorGradientModality< PointInT >::ColorGradientModality | ( |  | ) |

Constructor.

Definition at line 275 of file color_gradient_modality.h.

## ~ColorGradientModality()

template<typename PointInT >

pcl::ColorGradientModality< PointInT >::~ColorGradientModality | ( |  | ) |

override default

Destructor.

## Member Function Documentation

## computeGaussianKernel()

template<typename PointInT >

void pcl::ColorGradientModality< PointInT >::computeGaussianKernel | ( | const std::size_t | kernel_size,
|  | const float | sigma,
|  | std::vector< float > & | kernel_values
| ) |  |

protected

Computes the Gaussian kernel used for smoothing.

Parameters

  [in] | kernel_size | the size of the Gaussian kernel.
  [in] | sigma | the sigma.
  [out] | kernel_values | the destination for the values of the kernel.

Definition at line 289 of file color_gradient_modality.h.

## computeMaxColorGradients()

template<typename PointInT >

void pcl::ColorGradientModality< PointInT >::computeMaxColorGradients | ( | const typename pcl::PointCloud< pcl::RGB >::ConstPtr & | cloud | ) |

protected

Computes the max-RGB gradients for the specified cloud.

Parameters

  [in] | cloud | the cloud for which the gradients are computed.

Definition at line 741 of file color_gradient_modality.h.

References pcl::GradientXY::angle, pcl::PointCloud< PointT >::height, pcl::GradientXY::magnitude, pcl::PointCloud< PointT >::width, pcl::GradientXY::x, and pcl::GradientXY::y.

## computeMaxColorGradientsSobel()

template<typename PointInT >

void pcl::ColorGradientModality< PointInT >::computeMaxColorGradientsSobel | ( | const typename pcl::PointCloud< pcl::RGB >::ConstPtr & | cloud | ) |

protected

Computes the max-RGB gradients for the specified cloud using sobel.

Parameters

  [in] | cloud | the cloud for which the gradients are computed.

Definition at line 828 of file color_gradient_modality.h.

References pcl::GradientXY::angle, pcl::PointCloud< PointT >::height, pcl::GradientXY::magnitude, pcl::PointCloud< PointT >::width, pcl::GradientXY::x, and pcl::GradientXY::y.

## erode()

template<typename PointInT >

void pcl::ColorGradientModality< PointInT >::erode | ( | const pcl::MaskMap & | mask_in,
|  | pcl::MaskMap & | mask_out
| ) |  |

static protected

Erodes a mask.

Parameters

  [in] | mask_in | the mask which will be eroded.
  [out] | mask_out | the destination for the eroded mask.

Definition at line 1083 of file color_gradient_modality.h.

References pcl::MaskMap::getHeight(), pcl::MaskMap::getWidth(), and pcl::MaskMap::resize().

## extractAllFeatures()

template<typename PointInT >

void pcl::ColorGradientModality< PointInT >::extractAllFeatures | ( | const MaskMap & | mask,
|  | std::size_t | nr_features,
|  | std::size_t | modalityIndex,
|  | std::vector< QuantizedMultiModFeature > & | features
| ) |  | const

override virtual

Extracts all possible features from the modality within the specified mask.

Parameters

  [in] | mask | defines the areas where features are searched in.
  [in] | nr_features | IGNORED (TODO: remove this parameter).
  [in] | modalityIndex | the index which is stored in the extracted features.
  [out] | features | the destination for the extracted features.

Implements pcl::QuantizableModality.

Definition at line 691 of file color_gradient_modality.h.

References pcl::MaskMap::getHeight(), pcl::MaskMap::getWidth(), pcl::ColorGradientModality< PointInT >::Candidate::gradient, pcl::GradientXY::magnitude, pcl::QuantizedMultiModFeature::modality_index, pcl::QuantizedMultiModFeature::quantized_value, pcl::ColorGradientModality< PointInT >::Candidate::x, pcl::QuantizedMultiModFeature::x, pcl::ColorGradientModality< PointInT >::Candidate::y, and pcl::QuantizedMultiModFeature::y.

## extractFeatures()

template<typename PointInT >

void pcl::ColorGradientModality< PointInT >::extractFeatures | ( | const MaskMap & | mask,
|  | std::size_t | nr_features,
|  | std::size_t | modalityIndex,
|  | std::vector< QuantizedMultiModFeature > & | features
| ) |  | const

override virtual

Extracts features from this modality within the specified mask.

Parameters

  [in] | mask | defines the areas where features are searched in.
  [in] | nr_features | defines the number of features to be extracted (might be less if not sufficient information is present in the modality).
  [in] | modalityIndex | the index which is stored in the extracted features.
  [out] | features | the destination for the extracted features.

Implements pcl::QuantizableModality.

Definition at line 405 of file color_gradient_modality.h.

References pcl::MaskMap::getDifferenceMask(), pcl::MaskMap::getHeight(), pcl::MaskMap::getWidth(), pcl::ColorGradientModality< PointInT >::Candidate::gradient, pcl::GradientXY::magnitude, pcl::QuantizedMultiModFeature::modality_index, pcl::QuantizedMultiModFeature::quantized_value, pcl::ColorGradientModality< PointInT >::Candidate::x, pcl::QuantizedMultiModFeature::x, pcl::ColorGradientModality< PointInT >::Candidate::y, and pcl::QuantizedMultiModFeature::y.

## filterQuantizedColorGradients()

template<typename PointInT >

void pcl::ColorGradientModality< PointInT >::filterQuantizedColorGradients | ( |  | ) |

protected

Filters the quantized gradients.

Definition at line 1013 of file color_gradient_modality.h.

## getMaxColorGradients()

template<typename PointInT >

pcl::PointCloud< pcl::GradientXY > & pcl::ColorGradientModality< PointInT >::getMaxColorGradients | ( |  | ) |

inline

Returns a point cloud containing the max-RGB gradients.

Definition at line 160 of file color_gradient_modality.h.

## getQuantizedMap()

template<typename PointInT >

QuantizedMap & pcl::ColorGradientModality< PointInT >::getQuantizedMap | ( |  | ) |

inline override virtual

Returns a reference to the internally computed quantized map.

Implements pcl::QuantizableModality.

Definition at line 146 of file color_gradient_modality.h.

## getSpreadedQuantizedMap()

template<typename PointInT >

QuantizedMap & pcl::ColorGradientModality< PointInT >::getSpreadedQuantizedMap | ( |  | ) |

inline override virtual

Returns a reference to the internally computed spread quantized map.

Implements pcl::QuantizableModality.

Definition at line 153 of file color_gradient_modality.h.

## processInputData()

template<typename PointInT >

void pcl::ColorGradientModality< PointInT >::processInputData | ( |  | ) |

virtual

Processes the input data (smoothing, computing gradients, quantizing, filtering, spreading).

Definition at line 335 of file color_gradient_modality.h.

References pcl::filters::Convolution< PointIn, PointOut >::convolve(), pcl::PointCloud< PointT >::height, pcl::PointCloud< PointT >::is_dense, pcl::PointCloud< PointT >::resize(), pcl::filters::Convolution< PointIn, PointOut >::setInputCloud(), pcl::filters::Convolution< PointIn, PointOut >::setKernel(), pcl::QuantizedMap::spreadQuantizedMap(), and pcl::PointCloud< PointT >::width.

## processInputDataFromFiltered()

template<typename PointInT >

void pcl::ColorGradientModality< PointInT >::processInputDataFromFiltered | ( |  | ) |

virtual

Processes the input data assuming that everything up to filtering is already done/available (so only spreading is performed).

Definition at line 393 of file color_gradient_modality.h.

References pcl::QuantizedMap::spreadQuantizedMap().

## quantizeColorGradients()

template<typename PointInT >

void pcl::ColorGradientModality< PointInT >::quantizeColorGradients | ( |  | ) |

protected

Quantizes the color gradients.

Definition at line 950 of file color_gradient_modality.h.

## setFeatureSelectionMethod()

template<typename PointInT >

void pcl::ColorGradientModality< PointInT >::setFeatureSelectionMethod | ( | const FeatureSelectionMethod | method | ) |

inline

Sets the feature selection method.

Parameters

  [in] | method | the feature selection method.

Definition at line 123 of file color_gradient_modality.h.

## setGradientMagnitudeThreshold()

template<typename PointInT >

void pcl::ColorGradientModality< PointInT >::setGradientMagnitudeThreshold | ( | const float | threshold | ) |

inline

Sets the threshold for the gradient magnitude which is used when quantizing the data.

Gradients with a smaller magnitude are ignored.

Parameters

  [in] | threshold | the new gradient magnitude threshold.

Definition at line 104 of file color_gradient_modality.h.

## setGradientMagnitudeThresholdForFeatureExtraction()

template<typename PointInT >

void pcl::ColorGradientModality< PointInT >::setGradientMagnitudeThresholdForFeatureExtraction | ( | const float | threshold | ) |

inline

Sets the threshold for the gradient magnitude which is used for feature extraction.

Gradients with a smaller magnitude are ignored.

Parameters

  [in] | threshold | the new gradient magnitude threshold.

Definition at line 114 of file color_gradient_modality.h.

## setInputCloud()

template<typename PointInT >

void pcl::ColorGradientModality< PointInT >::setInputCloud | ( | const typename PointCloudIn::ConstPtr & | cloud | ) |

inline override

Provide a pointer to the input dataset (overwrites the PCLBase::setInputCloud method)

Parameters

  cloud | the const boost shared pointer to a PointCloud message

Definition at line 190 of file color_gradient_modality.h.

References pcl::PCLBase< PointInT >::input_.

## setSpreadingSize()

template<typename PointInT >

void pcl::ColorGradientModality< PointInT >::setSpreadingSize | ( | const std::size_t | spreading_size | ) |

inline

Sets the spreading size for spreading the quantized data.

Definition at line 130 of file color_gradient_modality.h.

## setVariableFeatureNr()

template<typename PointInT >

void pcl::ColorGradientModality< PointInT >::setVariableFeatureNr | ( | const bool | enabled | ) |

inline

Sets whether variable feature numbers for feature extraction is enabled.

Parameters

  [in] | enabled | enables/disables variable feature numbers for feature extraction.

Definition at line 139 of file color_gradient_modality.h.

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

- pcl/recognition/color_gradient_modality.h