Point Cloud Library (PCL)  1.14.1-dev
List of all members | Public Member Functions | Static Public Attributes
pcl::GaussianKernel Class Reference

Class GaussianKernel assembles all the method for computing, convolving, smoothing, gradients computing an image using a gaussian kernel. More...

#include <pcl/common/gaussian.h>

Public Member Functions

void compute (float sigma, Eigen::VectorXf &kernel, unsigned kernel_width=MAX_KERNEL_WIDTH) const
 Computes the gaussian kernel and dervative associated to sigma. More...
 
void compute (float sigma, Eigen::VectorXf &kernel, Eigen::VectorXf &derivative, unsigned kernel_width=MAX_KERNEL_WIDTH) const
 Computes the gaussian kernel and dervative associated to sigma. More...
 
void convolveRows (const pcl::PointCloud< float > &input, const Eigen::VectorXf &kernel, pcl::PointCloud< float > &output) const
 Convolve a float image rows by a given kernel. More...
 
template<typename PointT >
void convolveRows (const pcl::PointCloud< PointT > &input, std::function< float(const PointT &p)> field_accessor, const Eigen::VectorXf &kernel, pcl::PointCloud< float > &output) const
 Convolve a float image rows by a given kernel. More...
 
void convolveCols (const pcl::PointCloud< float > &input, const Eigen::VectorXf &kernel, pcl::PointCloud< float > &output) const
 Convolve a float image columns by a given kernel. More...
 
template<typename PointT >
void convolveCols (const pcl::PointCloud< PointT > &input, std::function< float(const PointT &p)> field_accessor, const Eigen::VectorXf &kernel, pcl::PointCloud< float > &output) const
 Convolve a float image columns by a given kernel. More...
 
void convolve (const pcl::PointCloud< float > &input, const Eigen::VectorXf &horiz_kernel, const Eigen::VectorXf &vert_kernel, pcl::PointCloud< float > &output) const
 Convolve a float image in the 2 directions. More...
 
template<typename PointT >
void convolve (const pcl::PointCloud< PointT > &input, std::function< float(const PointT &p)> field_accessor, const Eigen::VectorXf &horiz_kernel, const Eigen::VectorXf &vert_kernel, pcl::PointCloud< float > &output) const
 Convolve a float image in the 2 directions. More...
 
void computeGradients (const pcl::PointCloud< float > &input, const Eigen::VectorXf &gaussian_kernel, const Eigen::VectorXf &gaussian_kernel_derivative, pcl::PointCloud< float > &grad_x, pcl::PointCloud< float > &grad_y) const
 Computes float image gradients using a gaussian kernel and gaussian kernel derivative. More...
 
template<typename PointT >
void computeGradients (const pcl::PointCloud< PointT > &input, std::function< float(const PointT &p)> field_accessor, const Eigen::VectorXf &gaussian_kernel, const Eigen::VectorXf &gaussian_kernel_derivative, pcl::PointCloud< float > &grad_x, pcl::PointCloud< float > &grad_y) const
 Computes float image gradients using a gaussian kernel and gaussian kernel derivative. More...
 
void smooth (const pcl::PointCloud< float > &input, const Eigen::VectorXf &gaussian_kernel, pcl::PointCloud< float > &output) const
 Smooth image using a gaussian kernel. More...
 
template<typename PointT >
void smooth (const pcl::PointCloud< PointT > &input, std::function< float(const PointT &p)> field_accessor, const Eigen::VectorXf &gaussian_kernel, pcl::PointCloud< float > &output) const
 Smooth image using a gaussian kernel. More...
 

Static Public Attributes

static const unsigned MAX_KERNEL_WIDTH = 71
 

Detailed Description

Class GaussianKernel assembles all the method for computing, convolving, smoothing, gradients computing an image using a gaussian kernel.

The image is stored in point cloud elements intensity member or rgb or...

Author
Nizar Sallem

Definition at line 57 of file gaussian.h.

Member Function Documentation

◆ compute() [1/2]

void pcl::GaussianKernel::compute ( float  sigma,
Eigen::VectorXf &  kernel,
Eigen::VectorXf &  derivative,
unsigned  kernel_width = MAX_KERNEL_WIDTH 
) const

Computes the gaussian kernel and dervative associated to sigma.

The kernel and derivative width are adjusted according.

Parameters
[in]sigma
[out]kernelthe computed gaussian kernel
[out]derivativethe computed kernel derivative
[in]kernel_widththe desired kernel width upper bond
Exceptions
pcl::KernelWidthTooSmallException

◆ compute() [2/2]

void pcl::GaussianKernel::compute ( float  sigma,
Eigen::VectorXf &  kernel,
unsigned  kernel_width = MAX_KERNEL_WIDTH 
) const

Computes the gaussian kernel and dervative associated to sigma.

The kernel and derivative width are adjusted according.

Parameters
[in]sigma
[out]kernelthe computed gaussian kernel
[in]kernel_widththe desired kernel width upper bond
Exceptions
pcl::KernelWidthTooSmallException

◆ computeGradients() [1/2]

void pcl::GaussianKernel::computeGradients ( const pcl::PointCloud< float > &  input,
const Eigen::VectorXf &  gaussian_kernel,
const Eigen::VectorXf &  gaussian_kernel_derivative,
pcl::PointCloud< float > &  grad_x,
pcl::PointCloud< float > &  grad_y 
) const
inline

Computes float image gradients using a gaussian kernel and gaussian kernel derivative.

Parameters
[in]inputimage to compute gardients for
[in]gaussian_kernelthe gaussian kernel to be used
[in]gaussian_kernel_derivativethe associated derivative
[out]grad_xgradient along X direction
[out]grad_ygradient along Y direction
Note
if output doesn't fit in input i.e. output.rows () < input.rows () or output.cols () < input.cols () then output is resized to input sizes.

Definition at line 195 of file gaussian.h.

◆ computeGradients() [2/2]

template<typename PointT >
void pcl::GaussianKernel::computeGradients ( const pcl::PointCloud< PointT > &  input,
std::function< float(const PointT &p)>  field_accessor,
const Eigen::VectorXf &  gaussian_kernel,
const Eigen::VectorXf &  gaussian_kernel_derivative,
pcl::PointCloud< float > &  grad_x,
pcl::PointCloud< float > &  grad_y 
) const
inline

Computes float image gradients using a gaussian kernel and gaussian kernel derivative.

Parameters
[in]inputimage to compute gardients for
[in]field_accessora field accessor
[in]gaussian_kernelthe gaussian kernel to be used
[in]gaussian_kernel_derivativethe associated derivative
[out]grad_xgradient along X direction
[out]grad_ygradient along Y direction
Note
if output doesn't fit in input i.e. output.rows () < input.rows () or output.cols () < input.cols () then output is resized to input sizes.

Definition at line 217 of file gaussian.h.

◆ convolve() [1/2]

void pcl::GaussianKernel::convolve ( const pcl::PointCloud< float > &  input,
const Eigen::VectorXf &  horiz_kernel,
const Eigen::VectorXf &  vert_kernel,
pcl::PointCloud< float > &  output 
) const
inline

Convolve a float image in the 2 directions.

Parameters
[in]horiz_kernelkernel for convolving rows
[in]vert_kernelkernel for convolving columns
[in]inputimage to convolve
[out]outputthe convolved image
Note
if output doesn't fit in input i.e. output.rows () < input.rows () or output.cols () < input.cols () then output is resized to input sizes.

Definition at line 149 of file gaussian.h.

References pcl::PointCloud< PointT >::height, and pcl::PointCloud< PointT >::width.

◆ convolve() [2/2]

template<typename PointT >
void pcl::GaussianKernel::convolve ( const pcl::PointCloud< PointT > &  input,
std::function< float(const PointT &p)>  field_accessor,
const Eigen::VectorXf &  horiz_kernel,
const Eigen::VectorXf &  vert_kernel,
pcl::PointCloud< float > &  output 
) const
inline

Convolve a float image in the 2 directions.

Parameters
[in]inputimage to convolve
[in]field_accessora field accessor
[in]horiz_kernelkernel for convolving rows
[in]vert_kernelkernel for convolving columns
[out]outputthe convolved image
Note
if output doesn't fit in input i.e. output.rows () < input.rows () or output.cols () < input.cols () then output is resized to input sizes.

Definition at line 171 of file gaussian.h.

References pcl::PointCloud< PointT >::height, and pcl::PointCloud< PointT >::width.

◆ convolveCols() [1/2]

void pcl::GaussianKernel::convolveCols ( const pcl::PointCloud< float > &  input,
const Eigen::VectorXf &  kernel,
pcl::PointCloud< float > &  output 
) const

Convolve a float image columns by a given kernel.

Parameters
[in]inputthe image to convolve
[in]kernelconvolution kernel
[out]outputthe convolved image
Note
if output doesn't fit in input i.e. output.rows () < input.rows () or output.cols () < input.cols () then output is resized to input sizes.

◆ convolveCols() [2/2]

template<typename PointT >
void pcl::GaussianKernel::convolveCols ( const pcl::PointCloud< PointT > &  input,
std::function< float(const PointT &p)>  field_accessor,
const Eigen::VectorXf &  kernel,
pcl::PointCloud< float > &  output 
) const

Convolve a float image columns by a given kernel.

Parameters
[in]inputthe image to convolve
[in]field_accessora field accessor
[in]kernelconvolution kernel
[out]outputthe convolved image
Note
if output doesn't fit in input i.e. output.rows () < input.rows () or output.cols () < input.cols () then output is resized to input sizes.

Definition at line 82 of file gaussian.hpp.

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

◆ convolveRows() [1/2]

void pcl::GaussianKernel::convolveRows ( const pcl::PointCloud< float > &  input,
const Eigen::VectorXf &  kernel,
pcl::PointCloud< float > &  output 
) const

Convolve a float image rows by a given kernel.

Parameters
[in]kernelconvolution kernel
[in]inputthe image to convolve
[out]outputthe convolved image
Note
if output doesn't fit in input i.e. output.rows () < input.rows () or output.cols () < input.cols () then output is resized to input sizes.

◆ convolveRows() [2/2]

template<typename PointT >
void pcl::GaussianKernel::convolveRows ( const pcl::PointCloud< PointT > &  input,
std::function< float(const PointT &p)>  field_accessor,
const Eigen::VectorXf &  kernel,
pcl::PointCloud< float > &  output 
) const

Convolve a float image rows by a given kernel.

Parameters
[in]inputthe image to convolve
[in]field_accessora field accessor
[in]kernelconvolution kernel
[out]outputthe convolved image
Note
if output doesn't fit in input i.e. output.rows () < input.rows () or output.cols () < input.cols () then output is resized to input sizes.

Definition at line 49 of file gaussian.hpp.

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

◆ smooth() [1/2]

void pcl::GaussianKernel::smooth ( const pcl::PointCloud< float > &  input,
const Eigen::VectorXf &  gaussian_kernel,
pcl::PointCloud< float > &  output 
) const
inline

Smooth image using a gaussian kernel.

Parameters
[in]inputimage
[in]gaussian_kernelthe gaussian kernel to be used
[out]outputthe smoothed image
Note
if output doesn't fit in input i.e. output.rows () < input.rows () or output.cols () < input.cols () then output is resized to input sizes.

Definition at line 236 of file gaussian.h.

◆ smooth() [2/2]

template<typename PointT >
void pcl::GaussianKernel::smooth ( const pcl::PointCloud< PointT > &  input,
std::function< float(const PointT &p)>  field_accessor,
const Eigen::VectorXf &  gaussian_kernel,
pcl::PointCloud< float > &  output 
) const
inline

Smooth image using a gaussian kernel.

Parameters
[in]inputimage
[in]field_accessora field accessor
[in]gaussian_kernelthe gaussian kernel to be used
[out]outputthe smoothed image
Note
if output doesn't fit in input i.e. output.rows () < input.rows () or output.cols () < input.cols () then output is resized to input sizes.

Definition at line 252 of file gaussian.h.

Member Data Documentation

◆ MAX_KERNEL_WIDTH

const unsigned pcl::GaussianKernel::MAX_KERNEL_WIDTH = 71
static

Definition at line 61 of file gaussian.h.


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