42 #include <pcl/common/gaussian.h>
47 template <
typename Po
intT>
void
49 std::function <
float (
const PointT& p)> field_accessor,
50 const Eigen::VectorXf&
kernel,
53 assert(
kernel.size () % 2 == 1);
54 int kernel_width =
kernel.size () -1;
55 int radius =
kernel.size () / 2.0;
64 for(
int j = 0; j < input.
height; j++)
66 for (i = 0 ; i < radius ; i++)
69 for ( ; i < input.
width - radius ; i++) {
71 for (
int k = kernel_width, l = i - radius; k >= 0 ; k--, l++)
72 output (i,j) += field_accessor (input (l,j)) *
kernel[k];
75 for ( ; i < input.
width ; i++)
80 template <
typename Po
intT>
void
82 std::function <
float (
const PointT& p)> field_accessor,
83 const Eigen::VectorXf&
kernel,
86 assert(
kernel.size () % 2 == 1);
87 int kernel_width =
kernel.size () -1;
88 int radius =
kernel.size () / 2.0;
97 for(
int i = 0; i < input.
width; i++)
99 for (j = 0 ; j < radius ; j++)
102 for ( ; j < input.
height - radius ; j++) {
104 for (
int k = kernel_width, l = j - radius ; k >= 0 ; k--, l++)
106 output (i,j) += field_accessor (input (i,l)) *
kernel[k];
110 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.