Filter points that lie inside or outside a 3D closed surface or 2D closed polygon, as generated by the ConvexHull or ConcaveHull classes. More...
#include <crop_hull.h>
Public Member Functions | |
CropHull () | |
Empty Constructor. | |
PointCloudPtr | getHullCloud () const |
Get the point cloud that the hull indices refer to. | |
std::vector< Vertices > | getHullIndices () const |
Get the vertices of the hull used to filter points. | |
void | setCropOutside (bool crop_outside) |
Remove points outside the hull (default), or those inside the hull. | |
void | setDim (int dim) |
Set the dimensionality of the hull to be used. This should be set to correspond to the dimensionality of the convex/concave hull produced by the pcl::ConvexHull and pcl::ConcaveHull classes. | |
void | setHullCloud (PointCloudPtr points) |
Set the point cloud that the hull indices refer to. | |
void | setHullIndices (const std::vector< Vertices > &polygons) |
Set the vertices of the hull used to filter points. | |
Protected Member Functions | |
void | applyFilter (PointCloud &output) |
Filter the input points using the 2D or 3D polygon hull. | |
void | applyFilter (std::vector< int > &indices) |
Filter the input points using the 2D or 3D polygon hull. | |
Private Types | |
typedef Filter< PointT > ::PointCloud | PointCloud |
typedef PointCloud::ConstPtr | PointCloudConstPtr |
typedef PointCloud::Ptr | PointCloudPtr |
Private Member Functions | |
template<unsigned PlaneDim1, unsigned PlaneDim2> | |
void | applyFilter2D (PointCloud &output) |
Apply the two-dimensional hull filter. All points are assumed to lie in the same plane as the 2D hull, an axis-aligned 2D coordinate system using the two dimensions specified (PlaneDim1, PlaneDim2) is used for calculations. | |
template<unsigned PlaneDim1, unsigned PlaneDim2> | |
void | applyFilter2D (std::vector< int > &indices) |
Apply the two-dimensional hull filter. All points are assumed to lie in the same plane as the 2D hull, an axis-aligned 2D coordinate system using the two dimensions specified (PlaneDim1, PlaneDim2) is used for calculations. | |
void | applyFilter3D (PointCloud &output) |
Apply the three-dimensional hull filter. Polygon-ray crossings are used for three rays cast from each point being tested, and a majority vote of the resulting polygon-crossings is used to decide whether the point lies inside or outside the hull. | |
void | applyFilter3D (std::vector< int > &indices) |
Apply the three-dimensional hull filter. Polygon-ray crossings are used for three rays cast from each point being tested, and a majority vote of the resulting polygon-crossings is used to decide whether the point lies inside or outside the hull. | |
Eigen::Vector3f | getHullCloudRange () |
Return the size of the hull point cloud in line with coordinate axes. This is used to choose the 2D projection to use when cropping to a 2d polygon. | |
Static Private Member Functions | |
template<unsigned PlaneDim1, unsigned PlaneDim2> | |
static bool | isPointIn2DPolyWithVertIndices (const PointT &point, const Vertices &verts, const PointCloud &cloud) |
Test an individual point against a 2D polygon. PlaneDim1 and PlaneDim2 specify the x/y/z coordinate axes to use. | |
static bool | rayTriangleIntersect (const PointT &point, const Eigen::Vector3f &ray, const Vertices &verts, const PointCloud &cloud) |
Does a ray cast from a point intersect with an arbitrary triangle in 3D? See: http://softsurfer.com/Archive/algorithm_0105/algorithm_0105.htm#intersect_RayTriangle() | |
Private Attributes | |
bool | crop_outside_ |
If true, the filter will remove points outside the hull. If false, those inside will be removed. | |
int | dim_ |
The dimensionality of the hull to be used. | |
PointCloudPtr | hull_cloud_ |
The point cloud that the hull indices refer to. | |
std::vector< pcl::Vertices > | hull_polygons_ |
The vertices of the hull used to filter points. |
Filter points that lie inside or outside a 3D closed surface or 2D closed polygon, as generated by the ConvexHull or ConcaveHull classes.
Definition at line 53 of file crop_hull.h.
typedef Filter<PointT>::PointCloud pcl::CropHull< PointT >::PointCloud [private] |
Reimplemented from pcl::FilterIndices< PointT >.
Definition at line 59 of file crop_hull.h.
typedef PointCloud::ConstPtr pcl::CropHull< PointT >::PointCloudConstPtr [private] |
Reimplemented from pcl::Filter< PointT >.
Definition at line 61 of file crop_hull.h.
typedef PointCloud::Ptr pcl::CropHull< PointT >::PointCloudPtr [private] |
Reimplemented from pcl::Filter< PointT >.
Definition at line 60 of file crop_hull.h.
pcl::CropHull< PointT >::CropHull | ( | ) | [inline] |
Empty Constructor.
Definition at line 65 of file crop_hull.h.
void pcl::CropHull< PointT >::applyFilter | ( | PointCloud & | output | ) | [protected, virtual] |
Filter the input points using the 2D or 3D polygon hull.
[out] | output | The set of points that passed the filter |
Implements pcl::Filter< PointT >.
Definition at line 45 of file crop_hull.hpp.
void pcl::CropHull< PointT >::applyFilter | ( | std::vector< int > & | indices | ) | [protected, virtual] |
Filter the input points using the 2D or 3D polygon hull.
[out] | indices | the indices of the set of points that passed the filter. |
Implements pcl::FilterIndices< PointT >.
Definition at line 70 of file crop_hull.hpp.
void pcl::CropHull< PointT >::applyFilter2D | ( | PointCloud & | output | ) | [private] |
Apply the two-dimensional hull filter. All points are assumed to lie in the same plane as the 2D hull, an axis-aligned 2D coordinate system using the two dimensions specified (PlaneDim1, PlaneDim2) is used for calculations.
[out] | output | The set of points that pass the 2D polygon filter. |
Definition at line 122 of file crop_hull.hpp.
void pcl::CropHull< PointT >::applyFilter2D | ( | std::vector< int > & | indices | ) | [private] |
Apply the two-dimensional hull filter. All points are assumed to lie in the same plane as the 2D hull, an axis-aligned 2D coordinate system using the two dimensions specified (PlaneDim1, PlaneDim2) is used for calculations.
[out] | indices | The indices of the set of points that pass the 2D polygon filter. |
Definition at line 151 of file crop_hull.hpp.
void pcl::CropHull< PointT >::applyFilter3D | ( | PointCloud & | output | ) | [private] |
Apply the three-dimensional hull filter. Polygon-ray crossings are used for three rays cast from each point being tested, and a majority vote of the resulting polygon-crossings is used to decide whether the point lies inside or outside the hull.
[out] | output | The set of points that pass the 3D polygon hull filter. |
Definition at line 175 of file crop_hull.hpp.
void pcl::CropHull< PointT >::applyFilter3D | ( | std::vector< int > & | indices | ) | [private] |
Apply the three-dimensional hull filter. Polygon-ray crossings are used for three rays cast from each point being tested, and a majority vote of the resulting polygon-crossings is used to decide whether the point lies inside or outside the hull.
[out] | indices | The indices of the set of points that pass the 3D polygon hull filter. |
Definition at line 211 of file crop_hull.hpp.
PointCloudPtr pcl::CropHull< PointT >::getHullCloud | ( | ) | const [inline] |
Get the point cloud that the hull indices refer to.
Definition at line 103 of file crop_hull.h.
Eigen::Vector3f pcl::CropHull< PointT >::getHullCloudRange | ( | ) | [private] |
Return the size of the hull point cloud in line with coordinate axes. This is used to choose the 2D projection to use when cropping to a 2d polygon.
Definition at line 95 of file crop_hull.hpp.
std::vector<Vertices> pcl::CropHull< PointT >::getHullIndices | ( | ) | const [inline] |
Get the vertices of the hull used to filter points.
Definition at line 87 of file crop_hull.h.
bool pcl::CropHull< PointT >::isPointIn2DPolyWithVertIndices | ( | const PointT & | point, |
const Vertices & | verts, | ||
const PointCloud & | cloud | ||
) | [inline, static, private] |
Test an individual point against a 2D polygon. PlaneDim1 and PlaneDim2 specify the x/y/z coordinate axes to use.
[in] | point | Point to test against the polygon. |
[in] | verts | Vertex indices of polygon. |
[in] | cloud | Cloud from which the vertex indices are drawn. |
Definition at line 238 of file crop_hull.hpp.
bool pcl::CropHull< PointT >::rayTriangleIntersect | ( | const PointT & | point, |
const Eigen::Vector3f & | ray, | ||
const Vertices & | verts, | ||
const PointCloud & | cloud | ||
) | [inline, static, private] |
Does a ray cast from a point intersect with an arbitrary triangle in 3D? See: http://softsurfer.com/Archive/algorithm_0105/algorithm_0105.htm#intersect_RayTriangle()
[in] | point | Point from which the ray is cast. |
[in] | ray | Vector in direction of ray. |
[in] | verts | Indices of vertices making the polygon. |
[in] | cloud | Cloud from which the vertex indices are drawn. |
Definition at line 280 of file crop_hull.hpp.
void pcl::CropHull< PointT >::setCropOutside | ( | bool | crop_outside | ) | [inline] |
Remove points outside the hull (default), or those inside the hull.
[in] | crop_outside | If true, the filter will remove points outside the hull. If false, those inside will be removed. |
Definition at line 125 of file crop_hull.h.
void pcl::CropHull< PointT >::setDim | ( | int | dim | ) | [inline] |
Set the dimensionality of the hull to be used. This should be set to correspond to the dimensionality of the convex/concave hull produced by the pcl::ConvexHull and pcl::ConcaveHull classes.
[in] | dim | Dimensionailty of the hull used to filter points. |
Definition at line 115 of file crop_hull.h.
void pcl::CropHull< PointT >::setHullCloud | ( | PointCloudPtr | points | ) | [inline] |
Set the point cloud that the hull indices refer to.
[in] | points | the point cloud that the hull indices refer to |
Definition at line 96 of file crop_hull.h.
void pcl::CropHull< PointT >::setHullIndices | ( | const std::vector< Vertices > & | polygons | ) | [inline] |
Set the vertices of the hull used to filter points.
[in] | polygons | Vector of polygons (Vertices structures) forming the hull used for filtering points. |
Definition at line 79 of file crop_hull.h.
bool pcl::CropHull< PointT >::crop_outside_ [private] |
If true, the filter will remove points outside the hull. If false, those inside will be removed.
Definition at line 230 of file crop_hull.h.
int pcl::CropHull< PointT >::dim_ [private] |
The dimensionality of the hull to be used.
Definition at line 225 of file crop_hull.h.
PointCloudPtr pcl::CropHull< PointT >::hull_cloud_ [private] |
The point cloud that the hull indices refer to.
Definition at line 222 of file crop_hull.h.
std::vector<pcl::Vertices> pcl::CropHull< PointT >::hull_polygons_ [private] |
The vertices of the hull used to filter points.
Definition at line 219 of file crop_hull.h.