40 #ifndef PCL_GAUSSIAN_KERNEL_IMPL 41 #define PCL_GAUSSIAN_KERNEL_IMPL 43 #include <pcl/exceptions.h> 45 template <
typename Po
intT>
void 47 boost::function <
float (
const PointT& p)> field_accessor,
48 const Eigen::VectorXf&
kernel,
51 assert(kernel.size () % 2 == 1);
52 int kernel_width = kernel.size () -1;
53 int radius = kernel.size () / 2.0;
62 for(
int j = 0; j < input.
height; j++)
64 for (i = 0 ; i < radius ; i++)
67 for ( ; i < input.
width - radius ; i++) {
69 for (
int k = kernel_width, l = i - radius; k >= 0 ; k--, l++)
70 output (i,j) += field_accessor (input (l,j)) * kernel[k];
73 for ( ; i < input.
width ; i++)
78 template <
typename Po
intT>
void 80 boost::function <
float (
const PointT& p)> field_accessor,
81 const Eigen::VectorXf&
kernel,
84 assert(kernel.size () % 2 == 1);
85 int kernel_width = kernel.size () -1;
86 int radius = kernel.size () / 2.0;
95 for(
int i = 0; i < input.
width; i++)
97 for (j = 0 ; j < radius ; j++)
100 for ( ; j < input.
height - radius ; j++) {
102 for (
int k = kernel_width, l = j - radius ; k >= 0 ; k--, l++)
104 output (i,j) += field_accessor (input (i,l)) * kernel[k];
108 for ( ; j < input.
height ; j++)
std::vector< PointT, Eigen::aligned_allocator< PointT > > points
The point data.
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.
uint32_t height
The point cloud height (if organized as an image-structure).
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.
uint32_t width
The point cloud width (if organized as an image-structure).
PointCloud represents the base class in PCL for storing collections of 3D points. ...
A point structure representing Euclidean xyz coordinates, and the RGB color.