43 #include <pcl/filters/voxel_grid.h>
62 template <
typename Po
intT>
106 const Eigen::Vector3i& in_target_voxel);
120 std::vector<Eigen::Vector3i, Eigen::aligned_allocator<Eigen::Vector3i> >& out_ray,
121 const Eigen::Vector3i& in_target_voxel);
129 occlusionEstimationAll (std::vector<Eigen::Vector3i, Eigen::aligned_allocator<Eigen::Vector3i> >& occluded_voxels);
141 inline Eigen::Vector3f
147 inline Eigen::Vector3f
155 inline Eigen::Vector4f
187 const Eigen::Vector4f& direction);
199 const Eigen::Vector4f& origin,
200 const Eigen::Vector4f& direction,
213 rayTraversal (std::vector<Eigen::Vector3i, Eigen::aligned_allocator<Eigen::Vector3i> >& out_ray,
214 const Eigen::Vector3i& target_voxel,
215 const Eigen::Vector4f& origin,
216 const Eigen::Vector4f& direction,
226 return static_cast<float> (std::floor (d + 0.5f));
234 inline Eigen::Vector3i
256 #ifdef PCL_NO_PRECOMPILE
257 #include <pcl/filters/impl/voxel_grid_occlusion_estimation.hpp>
typename PointCloud::Ptr PointCloudPtr
typename PointCloud::ConstPtr PointCloudConstPtr
PointCloud represents the base class in PCL for storing collections of 3D points.
shared_ptr< PointCloud< PointT > > Ptr
shared_ptr< const PointCloud< PointT > > ConstPtr
VoxelGrid assembles a local 3D grid over a given PointCloud, and downsamples + filters the data.
Eigen::Vector4i min_b_
The minimum and maximum bin coordinates, the number of divisions, and the division multiplier.
void setSaveLeafLayout(bool save_leaf_layout)
Set to true if leaf layout information needs to be saved for later access.
Eigen::Vector4f leaf_size_
The size of a leaf.
Eigen::Array4f inverse_leaf_size_
Internal leaf sizes stored as 1/leaf_size_ for efficiency reasons.
VoxelGrid to estimate occluded space in the scene.
typename Filter< PointT >::PointCloud PointCloud
void initializeVoxelGrid()
Initialize the voxel grid, needs to be called first Builts the voxel grid and computes additional val...
int occlusionEstimationAll(std::vector< Eigen::Vector3i, Eigen::aligned_allocator< Eigen::Vector3i > > &occluded_voxels)
Computes the voxel coordinates (i, j, k) of all occluded voxels in the voxel grid.
Eigen::Quaternionf sensor_orientation_
PCL_MAKE_ALIGNED_OPERATOR_NEW VoxelGridOcclusionEstimation()
Empty constructor.
float round(float d)
Returns a value rounded to the nearest integer.
Eigen::Vector3i getGridCoordinatesRound(float x, float y, float z)
Returns the corresponding (i,j,k) coordinates in the grid of point (x,y,z).
PointCloud getFilteredPointCloud()
Returns the voxel grid filtered point cloud.
float rayBoxIntersection(const Eigen::Vector4f &origin, const Eigen::Vector4f &direction)
Returns the scaling value (tmin) were the ray intersects with the voxel grid bounding box.
Eigen::Vector3f getMaxBoundCoordinates()
Returns the maximum bounding of coordinates of the voxel grid (x,y,z).
int rayTraversal(const Eigen::Vector3i &target_voxel, const Eigen::Vector4f &origin, const Eigen::Vector4f &direction, const float t_min)
Returns the state of the target voxel (0 = visible, 1 = occupied) using a ray traversal algorithm.
~VoxelGridOcclusionEstimation() override=default
Destructor.
PointCloud filtered_cloud_
Eigen::Vector4f sensor_origin_
int occlusionEstimation(int &out_state, const Eigen::Vector3i &in_target_voxel)
Computes the state (free = 0, occluded = 1) of the voxel after utilizing a ray traversal algorithm to...
Eigen::Vector3f getMinBoundCoordinates()
Returns the minimum bounding of coordinates of the voxel grid (x,y,z).
Eigen::Vector4f getCentroidCoordinate(const Eigen::Vector3i &ijk)
Returns the corresponding centroid (x,y,z) coordinates in the grid of voxel (i,j,k).
#define PCL_MAKE_ALIGNED_OPERATOR_NEW
Macro to signal a class requires a custom allocator.