42 #include <pcl/common/gaussian.h>
48 template <
typename Po
intT>
void
50 std::function <
float (
const PointT& p)> field_accessor,
51 const Eigen::VectorXf&
kernel,
54 assert(
kernel.size () % 2 == 1);
55 int kernel_width =
kernel.size () -1;
56 int radius =
kernel.size () / 2.0;
65 for(
int j = 0; j < input.
height; j++)
67 for (i = 0 ; i < radius ; i++)
70 for ( ; i < input.
width - radius ; i++) {
72 for (
int k = kernel_width, l = i - radius; k >= 0 ; k--, l++)
73 output (i,j) += field_accessor (input (l,j)) *
kernel[k];
76 for ( ; i < input.
width ; i++)
81 template <
typename Po
intT>
void
83 std::function <
float (
const PointT& p)> field_accessor,
84 const Eigen::VectorXf&
kernel,
87 assert(
kernel.size () % 2 == 1);
88 int kernel_width =
kernel.size () -1;
89 int radius =
kernel.size () / 2.0;
98 for(
int i = 0; i < input.
width; i++)
100 for (j = 0 ; j < radius ; j++)
103 for ( ; j < input.
height - radius ; j++) {
105 for (
int k = kernel_width, l = j - radius ; k >= 0 ; k--, l++)
107 output (i,j) += field_accessor (input (i,l)) *
kernel[k];
111 for ( ; j < input.
height ; j++)
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.
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.
PointCloud represents the base class in PCL for storing collections of 3D points.
void resize(std::size_t count)
Resizes the container to contain count elements.
std::uint32_t width
The point cloud width (if organized as an image-structure).
std::uint32_t height
The point cloud height (if organized as an image-structure).
A point structure representing Euclidean xyz coordinates, and the RGB color.