Point Cloud Library (PCL)  1.7.1
List of all members | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
pcl::VoxelGridOcclusionEstimation< PointT > Class Template Reference

VoxelGrid to estimate occluded space in the scene. More...

#include <pcl/filters/voxel_grid_occlusion_estimation.h>

+ Inheritance diagram for pcl::VoxelGridOcclusionEstimation< PointT >:

Public Member Functions

 VoxelGridOcclusionEstimation ()
 Empty constructor. More...
 
virtual ~VoxelGridOcclusionEstimation ()
 Destructor. More...
 
void initializeVoxelGrid ()
 Initialize the voxel grid, needs to be called first Builts the voxel grid and computes additional values for the ray traversal algorithm. More...
 
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 a target voxel in (i, j, k) coordinates. More...
 
int occlusionEstimation (int &out_state, std::vector< Eigen::Vector3i > &out_ray, const Eigen::Vector3i &in_target_voxel)
 Returns the state (free = 0, occluded = 1) of the voxel after utilizing a ray traversal algorithm to a target voxel in (i, j, k) coordinates. More...
 
int occlusionEstimationAll (std::vector< Eigen::Vector3i > &occluded_voxels)
 Returns the voxel coordinates (i, j, k) of all occluded voxels in the voxel gird. More...
 
PointCloud getFilteredPointCloud ()
 Returns the voxel grid filtered point cloud. More...
 
Eigen::Vector3f getMinBoundCoordinates ()
 Returns the minimum bounding of coordinates of the voxel grid (x,y,z). More...
 
Eigen::Vector3f getMaxBoundCoordinates ()
 Returns the maximum bounding of coordinates of the voxel grid (x,y,z). More...
 
Eigen::Vector4f getCentroidCoordinate (const Eigen::Vector3i &ijk)
 Returns the corresponding centroid (x,y,z) coordinates in the grid of voxel (i,j,k). More...
 
- Public Member Functions inherited from pcl::VoxelGrid< PointT >
 VoxelGrid ()
 Empty constructor. More...
 
virtual ~VoxelGrid ()
 Destructor. More...
 
void setLeafSize (const Eigen::Vector4f &leaf_size)
 Set the voxel grid leaf size. More...
 
void setLeafSize (float lx, float ly, float lz)
 Set the voxel grid leaf size. More...
 
Eigen::Vector3f getLeafSize ()
 Get the voxel grid leaf size. More...
 
void setDownsampleAllData (bool downsample)
 Set to true if all fields need to be downsampled, or false if just XYZ. More...
 
bool getDownsampleAllData ()
 Get the state of the internal downsampling parameter (true if all fields need to be downsampled, false if just XYZ). More...
 
void setSaveLeafLayout (bool save_leaf_layout)
 Set to true if leaf layout information needs to be saved for later access. More...
 
bool getSaveLeafLayout ()
 Returns true if leaf layout information will to be saved for later access. More...
 
Eigen::Vector3i getMinBoxCoordinates ()
 Get the minimum coordinates of the bounding box (after filtering is performed). More...
 
Eigen::Vector3i getMaxBoxCoordinates ()
 Get the minimum coordinates of the bounding box (after filtering is performed). More...
 
Eigen::Vector3i getNrDivisions ()
 Get the number of divisions along all 3 axes (after filtering is performed). More...
 
Eigen::Vector3i getDivisionMultiplier ()
 Get the multipliers to be applied to the grid coordinates in order to find the centroid index (after filtering is performed). More...
 
int getCentroidIndex (const PointT &p)
 Returns the index in the resulting downsampled cloud of the specified point. More...
 
std::vector< int > getNeighborCentroidIndices (const PointT &reference_point, const Eigen::MatrixXi &relative_coordinates)
 Returns the indices in the resulting downsampled cloud of the points at the specified grid coordinates, relative to the grid coordinates of the specified point (or -1 if the cell was empty/out of bounds). More...
 
std::vector< int > getLeafLayout ()
 Returns the layout of the leafs for fast access to cells relative to current position. More...
 
Eigen::Vector3i getGridCoordinates (float x, float y, float z)
 Returns the corresponding (i,j,k) coordinates in the grid of point (x,y,z). More...
 
int getCentroidIndexAt (const Eigen::Vector3i &ijk)
 Returns the index in the downsampled cloud corresponding to a given set of coordinates. More...
 
void setFilterFieldName (const std::string &field_name)
 Provide the name of the field to be used for filtering data. More...
 
std::string const getFilterFieldName ()
 Get the name of the field used for filtering. More...
 
void setFilterLimits (const double &limit_min, const double &limit_max)
 Set the field filter limits. More...
 
void getFilterLimits (double &limit_min, double &limit_max)
 Get the field filter limits (min/max) set by the user. More...
 
void setFilterLimitsNegative (const bool limit_negative)
 Set to true if we want to return the data outside the interval specified by setFilterLimits (min, max). More...
 
void getFilterLimitsNegative (bool &limit_negative)
 Get whether the data outside the interval (min/max) is to be returned (true) or inside (false). More...
 
bool getFilterLimitsNegative ()
 Get whether the data outside the interval (min/max) is to be returned (true) or inside (false). More...
 
- Public Member Functions inherited from pcl::Filter< PointT >
 Filter (bool extract_removed_indices=false)
 Empty constructor. More...
 
virtual ~Filter ()
 Empty destructor. More...
 
IndicesConstPtr const getRemovedIndices ()
 Get the point indices being removed. More...
 
void getRemovedIndices (PointIndices &pi)
 Get the point indices being removed. More...
 
void filter (PointCloud &output)
 Calls the filtering method and returns the filtered dataset in output. More...
 
- Public Member Functions inherited from pcl::PCLBase< PointT >
 PCLBase ()
 Empty constructor. More...
 
 PCLBase (const PCLBase &base)
 Copy constructor. More...
 
virtual ~PCLBase ()
 Destructor. More...
 
virtual void setInputCloud (const PointCloudConstPtr &cloud)
 Provide a pointer to the input dataset. More...
 
PointCloudConstPtr const getInputCloud ()
 Get a pointer to the input point cloud dataset. More...
 
virtual void setIndices (const IndicesPtr &indices)
 Provide a pointer to the vector of indices that represents the input data. More...
 
virtual void setIndices (const IndicesConstPtr &indices)
 Provide a pointer to the vector of indices that represents the input data. More...
 
virtual void setIndices (const PointIndicesConstPtr &indices)
 Provide a pointer to the vector of indices that represents the input data. More...
 
virtual void setIndices (size_t row_start, size_t col_start, size_t nb_rows, size_t nb_cols)
 Set the indices for the points laying within an interest region of the point cloud. More...
 
IndicesPtr const getIndices ()
 Get a pointer to the vector of indices used. More...
 
const PointToperator[] (size_t pos)
 Override PointCloud operator[] to shorten code. More...
 

Protected Types

typedef Filter< PointT >
::PointCloud 
PointCloud
 
typedef PointCloud::Ptr PointCloudPtr
 
typedef PointCloud::ConstPtr PointCloudConstPtr
 
- Protected Types inherited from pcl::VoxelGrid< PointT >
typedef Filter< PointT >
::PointCloud 
PointCloud
 
typedef PointCloud::Ptr PointCloudPtr
 
typedef PointCloud::ConstPtr PointCloudConstPtr
 
typedef boost::shared_ptr
< VoxelGrid< PointT > > 
Ptr
 
typedef boost::shared_ptr
< const VoxelGrid< PointT > > 
ConstPtr
 
typedef pcl::traits::fieldList
< PointT >::type 
FieldList
 

Protected Member Functions

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. More...
 
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. More...
 
int rayTraversal (std::vector< Eigen::Vector3i > &out_ray, 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) and the voxels penetrated by the ray unsing a ray traversal algorithm. More...
 
float round (float d)
 Returns a rounded value. More...
 
Eigen::Vector3i getGridCoordinatesRound (float x, float y, float z)
 Returns the corresponding (i,j,k) coordinates in the grid of point (x,y,z). More...
 
- Protected Member Functions inherited from pcl::VoxelGrid< PointT >
void applyFilter (PointCloud &output)
 Downsample a Point Cloud using a voxelized grid approach. More...
 
- Protected Member Functions inherited from pcl::Filter< PointT >
const std::string & getClassName () const
 Get a string representation of the name of this class. More...
 
- Protected Member Functions inherited from pcl::PCLBase< PointT >
bool initCompute ()
 This method should get called before starting the actual computation. More...
 
bool deinitCompute ()
 This method should get called after finishing the actual computation. More...
 

Protected Attributes

bool initialized_
 
Eigen::Vector4f sensor_origin_
 
Eigen::Quaternionf sensor_orientation_
 
Eigen::Vector4f b_min_
 
Eigen::Vector4f b_max_
 
PointCloud filtered_cloud_
 
- Protected Attributes inherited from pcl::VoxelGrid< PointT >
Eigen::Vector4f leaf_size_
 The size of a leaf. More...
 
Eigen::Array4f inverse_leaf_size_
 Internal leaf sizes stored as 1/leaf_size_ for efficiency reasons. More...
 
bool downsample_all_data_
 Set to true if all fields need to be downsampled, or false if just XYZ. More...
 
bool save_leaf_layout_
 Set to true if leaf layout information needs to be saved in leaf_layout_. More...
 
std::vector< int > leaf_layout_
 The leaf layout information for fast access to cells relative to current position. More...
 
Eigen::Vector4i min_b_
 The minimum and maximum bin coordinates, the number of divisions, and the division multiplier. More...
 
Eigen::Vector4i max_b_
 
Eigen::Vector4i div_b_
 
Eigen::Vector4i divb_mul_
 
std::string filter_field_name_
 The desired user filter field name. More...
 
double filter_limit_min_
 The minimum allowed filter value a point will be considered from. More...
 
double filter_limit_max_
 The maximum allowed filter value a point will be considered from. More...
 
bool filter_limit_negative_
 Set to true if we want to return the data outside (filter_limit_min_;filter_limit_max_). More...
 
- Protected Attributes inherited from pcl::Filter< PointT >
IndicesPtr removed_indices_
 Indices of the points that are removed. More...
 
std::string filter_name_
 The filter name. More...
 
bool extract_removed_indices_
 Set to true if we want to return the indices of the removed points. More...
 
- Protected Attributes inherited from pcl::PCLBase< PointT >
PointCloudConstPtr input_
 The input point cloud dataset. More...
 
IndicesPtr indices_
 A pointer to the vector of point indices to use. More...
 
bool use_indices_
 Set to true if point indices are used. More...
 
bool fake_indices_
 If no set of indices are given, we construct a set of fake indices that mimic the input PointCloud. More...
 

Additional Inherited Members

- Public Types inherited from pcl::Filter< PointT >
typedef boost::shared_ptr
< Filter< PointT > > 
Ptr
 
typedef boost::shared_ptr
< const Filter< PointT > > 
ConstPtr
 
typedef pcl::PointCloud< PointTPointCloud
 
typedef PointCloud::Ptr PointCloudPtr
 
typedef PointCloud::ConstPtr PointCloudConstPtr
 

Detailed Description

template<typename PointT>
class pcl::VoxelGridOcclusionEstimation< PointT >

VoxelGrid to estimate occluded space in the scene.

The ray traversal algorithm is implemented by the work of 'John Amanatides and Andrew Woo, A Fast Voxel Traversal Algorithm for Ray Tracing'

Author
Christian Potthast

Definition at line 56 of file voxel_grid_occlusion_estimation.h.

Member Typedef Documentation

template<typename PointT >
typedef Filter<PointT>::PointCloud pcl::VoxelGridOcclusionEstimation< PointT >::PointCloud
protected

Definition at line 65 of file voxel_grid_occlusion_estimation.h.

template<typename PointT >
typedef PointCloud::ConstPtr pcl::VoxelGridOcclusionEstimation< PointT >::PointCloudConstPtr
protected

Definition at line 67 of file voxel_grid_occlusion_estimation.h.

template<typename PointT >
typedef PointCloud::Ptr pcl::VoxelGridOcclusionEstimation< PointT >::PointCloudPtr
protected

Definition at line 66 of file voxel_grid_occlusion_estimation.h.

Constructor & Destructor Documentation

template<typename PointT >
pcl::VoxelGridOcclusionEstimation< PointT >::VoxelGridOcclusionEstimation ( )
inline
template<typename PointT >
virtual pcl::VoxelGridOcclusionEstimation< PointT >::~VoxelGridOcclusionEstimation ( )
inlinevirtual

Destructor.

Definition at line 78 of file voxel_grid_occlusion_estimation.h.

Member Function Documentation

template<typename PointT >
Eigen::Vector4f pcl::VoxelGridOcclusionEstimation< PointT >::getCentroidCoordinate ( const Eigen::Vector3i &  ijk)
inline

Returns the corresponding centroid (x,y,z) coordinates in the grid of voxel (i,j,k).

Parameters
[in]thecoordinate (i, j, k) of the voxel
Returns
the (x,y,z) coordinate of the voxel centroid

Definition at line 145 of file voxel_grid_occlusion_estimation.h.

References pcl::VoxelGridOcclusionEstimation< PointT >::b_min_, pcl::VoxelGrid< PointT >::leaf_size_, and pcl::VoxelGrid< PointT >::min_b_.

template<typename PointT >
PointCloud pcl::VoxelGridOcclusionEstimation< PointT >::getFilteredPointCloud ( )
inline

Returns the voxel grid filtered point cloud.

Parameters
[out]Thevoxel grid filtered point cloud

Definition at line 124 of file voxel_grid_occlusion_estimation.h.

References pcl::VoxelGridOcclusionEstimation< PointT >::filtered_cloud_.

template<typename PointT >
Eigen::Vector3i pcl::VoxelGridOcclusionEstimation< PointT >::getGridCoordinatesRound ( float  x,
float  y,
float  z 
)
inlineprotected

Returns the corresponding (i,j,k) coordinates in the grid of point (x,y,z).

Parameters
[in]xthe X point coordinate to get the (i, j, k) index at
[in]ythe Y point coordinate to get the (i, j, k) index at
[in]zthe Z point coordinate to get the (i, j, k) index at

Definition at line 225 of file voxel_grid_occlusion_estimation.h.

References pcl::VoxelGrid< PointT >::inverse_leaf_size_, and pcl::VoxelGridOcclusionEstimation< PointT >::round().

template<typename PointT >
Eigen::Vector3f pcl::VoxelGridOcclusionEstimation< PointT >::getMaxBoundCoordinates ( )
inline

Returns the maximum bounding of coordinates of the voxel grid (x,y,z).

Returns
the maximum coordinates (x,y,z)

Definition at line 137 of file voxel_grid_occlusion_estimation.h.

References pcl::VoxelGridOcclusionEstimation< PointT >::b_max_.

template<typename PointT >
Eigen::Vector3f pcl::VoxelGridOcclusionEstimation< PointT >::getMinBoundCoordinates ( )
inline

Returns the minimum bounding of coordinates of the voxel grid (x,y,z).

Returns
the minimum coordinates (x,y,z)

Definition at line 131 of file voxel_grid_occlusion_estimation.h.

References pcl::VoxelGridOcclusionEstimation< PointT >::b_min_.

template<typename PointT >
void pcl::VoxelGridOcclusionEstimation< PointT >::initializeVoxelGrid ( )

Initialize the voxel grid, needs to be called first Builts the voxel grid and computes additional values for the ray traversal algorithm.

Definition at line 47 of file voxel_grid_occlusion_estimation.hpp.

template<typename PointT >
int pcl::VoxelGridOcclusionEstimation< PointT >::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 a target voxel in (i, j, k) coordinates.

Parameters
[out]Thestate of the voxel.
[in]Thetarget voxel coordinate (i, j, k) of the voxel.

Definition at line 70 of file voxel_grid_occlusion_estimation.hpp.

template<typename PointT >
int pcl::VoxelGridOcclusionEstimation< PointT >::occlusionEstimation ( int &  out_state,
std::vector< Eigen::Vector3i > &  out_ray,
const Eigen::Vector3i &  in_target_voxel 
)

Returns the state (free = 0, occluded = 1) of the voxel after utilizing a ray traversal algorithm to a target voxel in (i, j, k) coordinates.

Additionally, this function returns the voxels penetrated of the ray-traversal algorithm till reaching the target voxel.

Parameters
[out]Thestate of the voxel.
[out]Thevoxels penetrated of the ray-traversal algorithm.
[in]Thetarget voxel coordinate (i, j, k) of the voxel.

Definition at line 101 of file voxel_grid_occlusion_estimation.hpp.

template<typename PointT >
int pcl::VoxelGridOcclusionEstimation< PointT >::occlusionEstimationAll ( std::vector< Eigen::Vector3i > &  occluded_voxels)

Returns the voxel coordinates (i, j, k) of all occluded voxels in the voxel gird.

Parameters
[out]thecoordinates (i, j, k) of all occluded voxels

Definition at line 133 of file voxel_grid_occlusion_estimation.hpp.

template<typename PointT >
float pcl::VoxelGridOcclusionEstimation< PointT >::rayBoxIntersection ( const Eigen::Vector4f &  origin,
const Eigen::Vector4f &  direction 
)
protected

Returns the scaling value (tmin) were the ray intersects with the voxel grid bounding box.

(p_entry = origin + tmin * orientation)

Parameters
[in]Thesensor origin
[in]Thesensor orientation
Returns
the scaling value

Definition at line 176 of file voxel_grid_occlusion_estimation.hpp.

template<typename PointT >
int pcl::VoxelGridOcclusionEstimation< PointT >::rayTraversal ( const Eigen::Vector3i &  target_voxel,
const Eigen::Vector4f &  origin,
const Eigen::Vector4f &  direction,
const float  t_min 
)
protected

Returns the state of the target voxel (0 = visible, 1 = occupied) unsing a ray traversal algorithm.

Parameters
[in]Thetarget voxel in the voxel grid with coordinate (i, j, k).
[in]Thesensor origin.
[in]Thesensor orientation
[in]Thescaling value (tmin).
Returns
The estimated voxel state.

Definition at line 243 of file voxel_grid_occlusion_estimation.hpp.

template<typename PointT >
int pcl::VoxelGridOcclusionEstimation< PointT >::rayTraversal ( std::vector< Eigen::Vector3i > &  out_ray,
const Eigen::Vector3i &  target_voxel,
const Eigen::Vector4f &  origin,
const Eigen::Vector4f &  direction,
const float  t_min 
)
protected

Returns the state of the target voxel (0 = visible, 1 = occupied) and the voxels penetrated by the ray unsing a ray traversal algorithm.

Parameters
[out]Thevoxels penetrated by the ray in (i, j, k) coordinates
[in]Thetarget voxel in the voxel grid with coordinate (i, j, k).
[in]Thesensor origin.
[in]Thesensor orientation
[in]Thescaling value (tmin).
Returns
The estimated voxel state.

Definition at line 337 of file voxel_grid_occlusion_estimation.hpp.

template<typename PointT >
float pcl::VoxelGridOcclusionEstimation< PointT >::round ( float  d)
inlineprotected

Returns a rounded value.

Parameters
[in]value
Returns
rounded value

Definition at line 213 of file voxel_grid_occlusion_estimation.h.

Referenced by pcl::VoxelGridOcclusionEstimation< PointT >::getGridCoordinatesRound().

Member Data Documentation

template<typename PointT >
Eigen::Vector4f pcl::VoxelGridOcclusionEstimation< PointT >::b_max_
protected
template<typename PointT >
Eigen::Vector4f pcl::VoxelGridOcclusionEstimation< PointT >::b_min_
protected
template<typename PointT >
PointCloud pcl::VoxelGridOcclusionEstimation< PointT >::filtered_cloud_
protected
template<typename PointT >
bool pcl::VoxelGridOcclusionEstimation< PointT >::initialized_
protected
template<typename PointT >
Eigen::Quaternionf pcl::VoxelGridOcclusionEstimation< PointT >::sensor_orientation_
protected

Definition at line 236 of file voxel_grid_occlusion_estimation.h.

template<typename PointT >
Eigen::Vector4f pcl::VoxelGridOcclusionEstimation< PointT >::sensor_origin_
protected

Definition at line 235 of file voxel_grid_occlusion_estimation.h.


The documentation for this class was generated from the following files: