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...
typedef pcl::PointCloud< PointInT > | PointCloudIn
Public Types inherited from pcl::PCLBase< PointInT >
typedef pcl::PointCloud< PointInT > | PointCloud
typedef PointCloud::Ptr | PointCloudPtr
typedef PointCloud::ConstPtr | PointCloudConstPtr
typedef boost::shared_ptr< PointIndices > | PointIndicesPtr
typedef boost::shared_ptr< PointIndices const > | PointIndicesConstPtr

## Public Member Functions

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

## Protected Member Functions

void | computeGaussianKernel (const size_t kernel_size, const float sigma, std::vector< float > &kernel_values)
| Computes the Gaussian kernel used for smoothing. More...
void | computeMaxColorGradients (const typename pcl::PointCloud< pcl::RGB >::ConstPtr &cloud)
| Computes the max-RGB gradients for the specified cloud. More...
void | computeMaxColorGradientsSobel (const typename pcl::PointCloud< pcl::RGB >::ConstPtr &cloud)
| Computes the max-RGB gradients for the specified cloud using sobel. More...
void | quantizeColorGradients ()
| Quantizes the color gradients. More...
void | filterQuantizedColorGradients ()
| Filters the quantized gradients. More...
Protected Member Functions inherited from pcl::PCLBase< PointInT >
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...

## Static Protected Member Functions

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

## Additional Inherited Members

Protected Attributes inherited from pcl::PCLBase< PointInT >
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 PointInT>
class pcl::ColorGradientModality< PointInT >

Modality based on max-RGB gradients.

Author
  Stefan Holzer

Definition at line 58 of file color_gradient_modality.h.

## Member Typedef Documentation

template<typename PointInT>

typedef pcl::PointCloud<PointInT> pcl::ColorGradientModality< PointInT >::PointCloudIn

Definition at line 85 of file color_gradient_modality.h.

## Member Enumeration Documentation

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 88 of file color_gradient_modality.h.

## Constructor & Destructor Documentation

template<typename PointInT >

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

Constructor.

Definition at line 277 of file color_gradient_modality.h.

References pcl::ColorGradientModality< PointInT >::~ColorGradientModality().

Referenced by pcl::ColorGradientModality< PointRGBT >::setInputCloud().

template<typename PointInT >

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

virtual

Destructor.

Definition at line 294 of file color_gradient_modality.h.

References pcl::ColorGradientModality< PointInT >::computeGaussianKernel().

Referenced by pcl::ColorGradientModality< PointInT >::ColorGradientModality().

## Member Function Documentation

template<typename PointInT >

void pcl::ColorGradientModality< PointInT >::computeGaussianKernel | ( | const 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 301 of file color_gradient_modality.h.

References pcl::ColorGradientModality< PointInT >::processInputData().

Referenced by pcl::ColorGradientModality< PointInT >::processInputData(), pcl::ColorGradientModality< PointRGBT >::setInputCloud(), and pcl::ColorGradientModality< PointInT >::~ColorGradientModality().

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 755 of file color_gradient_modality.h.

References pcl::GradientXY::angle, pcl::ColorGradientModality< PointInT >::computeMaxColorGradientsSobel(), pcl::PointCloud< PointT >::height, pcl::GradientXY::magnitude, pcl::PointCloud< PointT >::points, pcl::PointCloud< PointT >::width, pcl::GradientXY::x, and pcl::GradientXY::y.

Referenced by pcl::ColorGradientModality< PointInT >::extractAllFeatures(), and pcl::ColorGradientModality< PointRGBT >::setInputCloud().

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 842 of file color_gradient_modality.h.

References pcl::GradientXY::angle, pcl::PointCloud< PointT >::height, pcl::GradientXY::magnitude, pcl::PointCloud< PointT >::points, pcl::ColorGradientModality< PointInT >::quantizeColorGradients(), pcl::PointCloud< PointT >::width, pcl::GradientXY::x, and pcl::GradientXY::y.

Referenced by pcl::ColorGradientModality< PointInT >::computeMaxColorGradients(), pcl::ColorGradientModality< PointInT >::processInputData(), and pcl::ColorGradientModality< PointRGBT >::setInputCloud().

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 1097 of file color_gradient_modality.h.

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

Referenced by pcl::ColorGradientModality< PointInT >::extractFeatures(), pcl::ColorGradientModality< PointInT >::filterQuantizedColorGradients(), and pcl::ColorGradientModality< PointRGBT >::setInputCloud().

template<typename PointInT >

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

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 705 of file color_gradient_modality.h.

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

Referenced by pcl::ColorGradientModality< PointInT >::extractFeatures(), and pcl::ColorGradientModality< PointRGBT >::getMaxColorGradients().

template<typename PointInT >

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

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 418 of file color_gradient_modality.h.

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

Referenced by pcl::ColorGradientModality< PointRGBT >::getMaxColorGradients(), and pcl::ColorGradientModality< PointInT >::processInputDataFromFiltered().

template<typename PointInT >

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

protected

Filters the quantized gradients.

Definition at line 1027 of file color_gradient_modality.h.

References pcl::ColorGradientModality< PointInT >::erode(), pcl::QuantizedMap::getData(), pcl::PCLBase< PointInT >::input_, and pcl::QuantizedMap::resize().

Referenced by pcl::ColorGradientModality< PointInT >::processInputData(), pcl::ColorGradientModality< PointInT >::quantizeColorGradients(), and pcl::ColorGradientModality< PointRGBT >::setInputCloud().

template<typename PointInT>

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

inline

Returns a point cloud containing the max-RGB gradients.

Definition at line 161 of file color_gradient_modality.h.

template<typename PointInT>

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

inline virtual

Returns a reference to the internally computed quantized map.

Implements pcl::QuantizableModality.

Definition at line 147 of file color_gradient_modality.h.

template<typename PointInT>

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

inline virtual

Returns a reference to the internally computed spreaded quantized map.

Implements pcl::QuantizableModality.

Definition at line 154 of file color_gradient_modality.h.

template<typename PointInT >

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

virtual

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

Definition at line 348 of file color_gradient_modality.h.

References pcl::ColorGradientModality< PointInT >::computeGaussianKernel(), pcl::ColorGradientModality< PointInT >::computeMaxColorGradientsSobel(), pcl::filters::Convolution< PointIn, PointOut >::convolve(), pcl::ColorGradientModality< PointInT >::filterQuantizedColorGradients(), pcl::PointCloud< PointT >::height, pcl::PCLBase< PointInT >::input_, pcl::PointCloud< PointT >::is_dense, pcl::ColorGradientModality< PointInT >::processInputDataFromFiltered(), pcl::ColorGradientModality< PointInT >::quantizeColorGradients(), pcl::PointCloud< PointT >::resize(), pcl::filters::Convolution< PointIn, PointOut >::setInputCloud(), pcl::filters::Convolution< PointIn, PointOut >::setKernel(), pcl::QuantizedMap::spreadQuantizedMap(), and pcl::PointCloud< PointT >::width.

Referenced by pcl::ColorGradientModality< PointInT >::computeGaussianKernel(), and pcl::ColorGradientModality< PointRGBT >::setInputCloud().

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 406 of file color_gradient_modality.h.

References pcl::ColorGradientModality< PointInT >::extractFeatures(), and pcl::QuantizedMap::spreadQuantizedMap().

Referenced by pcl::ColorGradientModality< PointInT >::processInputData(), and pcl::ColorGradientModality< PointRGBT >::setInputCloud().

template<typename PointInT >

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

protected

Quantizes the color gradients.

Definition at line 964 of file color_gradient_modality.h.

References pcl::ColorGradientModality< PointInT >::filterQuantizedColorGradients(), pcl::PCLBase< PointInT >::input_, and pcl::QuantizedMap::resize().

Referenced by pcl::ColorGradientModality< PointInT >::computeMaxColorGradientsSobel(), pcl::ColorGradientModality< PointInT >::processInputData(), and pcl::ColorGradientModality< PointRGBT >::setInputCloud().

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 124 of file color_gradient_modality.h.

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 105 of file color_gradient_modality.h.

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 115 of file color_gradient_modality.h.

template<typename PointInT>

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

inline virtual

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 191 of file color_gradient_modality.h.

template<typename PointInT>

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

inline

Sets the spreading size for spreading the quantized data.

Definition at line 131 of file color_gradient_modality.h.

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 140 of file color_gradient_modality.h.

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

- /build/pcl-6_P28C/pcl-1.7.2/recognition/include/pcl/recognition/color_gradient_modality.h