41 #ifndef PCL_FILTERS_VOXEL_GRID_OCCLUSION_ESTIMATION_H_
42 #define PCL_FILTERS_VOXEL_GRID_OCCLUSION_ESTIMATION_H_
44 #include <pcl/filters/voxel_grid.h>
55 template <
typename Po
intT>
97 const Eigen::Vector3i& in_target_voxel);
110 std::vector<Eigen::Vector3i>& out_ray,
111 const Eigen::Vector3i& in_target_voxel);
130 inline Eigen::Vector3f
136 inline Eigen::Vector3f
144 inline Eigen::Vector4f
176 const Eigen::Vector4f& direction);
188 const Eigen::Vector4f& origin,
189 const Eigen::Vector4f& direction,
203 const Eigen::Vector3i& target_voxel,
204 const Eigen::Vector4f& origin,
205 const Eigen::Vector4f& direction,
215 return static_cast<float> (floor (d + 0.5f));
224 inline Eigen::Vector3i
228 static_cast<int> (
round (y * inverse_leaf_size_[1])),
229 static_cast<int> (
round (z * inverse_leaf_size_[2])));
246 #endif //#ifndef PCL_FILTERS_VOXEL_GRID_OCCLUSION_ESTIMATION_H_
void initializeVoxelGrid()
Initialize the voxel grid, needs to be called first Builts the voxel grid and computes additional val...
void setSaveLeafLayout(bool save_leaf_layout)
Set to true if leaf layout information needs to be saved for later access.
Eigen::Vector4f getCentroidCoordinate(const Eigen::Vector3i &ijk)
Returns the corresponding centroid (x,y,z) coordinates in the grid of voxel (i,j,k).
PointCloud::ConstPtr PointCloudConstPtr
PointCloud::Ptr PointCloudPtr
Eigen::Vector3f getMinBoundCoordinates()
Returns the minimum bounding of coordinates of the voxel grid (x,y,z).
int occlusionEstimation(int &out_state, const Eigen::Vector3i &in_target_voxel)
Returns the state (free = 0, occluded = 1) of the voxel after utilizing a ray traversal algorithm to ...
VoxelGridOcclusionEstimation()
Empty constructor.
int occlusionEstimationAll(std::vector< Eigen::Vector3i > &occluded_voxels)
Returns the voxel coordinates (i, j, k) of all occluded voxels in the voxel gird. ...
PointCloud getFilteredPointCloud()
Returns the voxel grid filtered point cloud.
Eigen::Quaternionf sensor_orientation_
Eigen::Vector3i getGridCoordinatesRound(float x, float y, float z)
Returns the corresponding (i,j,k) coordinates in the grid of point (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) unsing a ray traversal algorithm...
boost::shared_ptr< PointCloud< PointT > > Ptr
VoxelGrid to estimate occluded space in the scene.
Eigen::Vector3f getMaxBoundCoordinates()
Returns the maximum bounding of coordinates of the voxel grid (x,y,z).
boost::shared_ptr< const PointCloud< PointT > > ConstPtr
Eigen::Vector4f sensor_origin_
PointCloud filtered_cloud_
VoxelGrid assembles a local 3D grid over a given PointCloud, and downsamples + filters the data...
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.
float round(float d)
Returns a rounded value.
virtual ~VoxelGridOcclusionEstimation()
Destructor.
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...
Filter< PointT >::PointCloud PointCloud
Eigen::Vector4i min_b_
The minimum and maximum bin coordinates, the number of divisions, and the division multiplier...