38 #ifndef PCL_FILTERS_APPROXIMATE_VOXEL_GRID_MAP_H_ 39 #define PCL_FILTERS_APPROXIMATE_VOXEL_GRID_MAP_H_ 41 #include <pcl/filters/boost.h> 42 #include <pcl/filters/filter.h> 47 template <
typename Po
intT>
54 p2_ (reinterpret_cast<Pod&>(p2)),
62 *
reinterpret_cast<T*
>(data_ptr) = static_cast<T> (p1_[f_idx_++]);
66 const Eigen::VectorXf &p1_;
72 template <
typename Po
intT>
78 : p1_ (reinterpret_cast<const Pod&>(p1)), p2_ (p2), f_idx_ (0) { }
85 p2_[f_idx_++] =
static_cast<float> (*
reinterpret_cast<const T*
>(data_ptr));
99 template <
typename Po
intT>
114 he () : ix (), iy (), iz (), count (0), centroid () {}
117 Eigen::VectorXf centroid;
122 typedef boost::shared_ptr< ApproximateVoxelGrid<PointT> >
Ptr;
123 typedef boost::shared_ptr< const ApproximateVoxelGrid<PointT> >
ConstPtr;
129 leaf_size_ (
Eigen::Vector3f::Ones ()),
130 inverse_leaf_size_ (
Eigen::Array3f::Ones ()),
131 downsample_all_data_ (true), histsize_ (512),
132 history_ (new he[histsize_])
134 filter_name_ =
"ApproximateVoxelGrid";
142 leaf_size_ (src.leaf_size_),
143 inverse_leaf_size_ (src.inverse_leaf_size_),
144 downsample_all_data_ (src.downsample_all_data_),
145 histsize_ (src.histsize_),
148 history_ =
new he[histsize_];
149 for (
size_t i = 0; i < histsize_; i++)
172 history_ =
new he[histsize_];
173 for (
size_t i = 0; i < histsize_; i++)
184 leaf_size_ = leaf_size;
185 inverse_leaf_size_ = Eigen::Array3f::Ones () / leaf_size_.array ();
196 setLeafSize (Eigen::Vector3f (lx, ly, lz));
200 inline Eigen::Vector3f
237 applyFilter (PointCloud &output);
242 flush (PointCloud &output,
size_t op, he *hhe,
int rgba_index,
int centroid_size);
246 #ifdef PCL_NO_PRECOMPILE 247 #include <pcl/filters/impl/approximate_voxel_grid.hpp> 250 #endif //#ifndef PCL_FILTERS_VOXEL_GRID_MAP_H_ ~ApproximateVoxelGrid()
Destructor.
bool getDownsampleAllData() const
Get the state of the internal downsampling parameter (true if all fields need to be downsampled...
PointCloud::ConstPtr PointCloudConstPtr
Eigen::Vector3f getLeafSize() const
Get the voxel grid leaf size.
This file defines compatibility wrappers for low level I/O functions.
xNdCopyEigenPointFunctor(const Eigen::VectorXf &p1, PointT &p2)
boost::shared_ptr< const ApproximateVoxelGrid< PointT > > ConstPtr
ApproximateVoxelGrid()
Empty constructor.
boost::shared_ptr< ApproximateVoxelGrid< PointT > > Ptr
ApproximateVoxelGrid assembles a local 3D grid over a given PointCloud, and downsamples + filters the...
boost::shared_ptr< PointCloud< PointT > > Ptr
size_t histsize_
history buffer size, power of 2
PointCloud::Ptr PointCloudPtr
Filter represents the base filter class.
Eigen::Array3f inverse_leaf_size_
Compute 1/leaf_size_ to avoid division later.
boost::shared_ptr< const PointCloud< PointT > > ConstPtr
traits::POD< PointT >::type Pod
void setLeafSize(float lx, float ly, float lz)
Set the voxel grid leaf size.
PointCloud represents the base class in PCL for storing collections of 3D points. ...
xNdCopyPointEigenFunctor(const PointT &p1, Eigen::VectorXf &p2)
Eigen::Vector3f leaf_size_
The size of a leaf.
void setDownsampleAllData(bool downsample)
Set to true if all fields need to be downsampled, or false if just XYZ.
Helper functor structure for copying data between an Eigen::VectorXf and a PointT.
bool downsample_all_data_
Set to true if all fields need to be downsampled, or false if just XYZ.
struct he * history_
history buffer
traits::POD< PointT >::type Pod
Helper functor structure for copying data between an Eigen::VectorXf and a PointT.
pcl::traits::fieldList< PointT >::type FieldList
A point structure representing Euclidean xyz coordinates, and the RGB color.
void setLeafSize(const Eigen::Vector3f &leaf_size)
Set the voxel grid leaf size.
ApproximateVoxelGrid(const ApproximateVoxelGrid &src)
Copy constructor.