Point Cloud Library (PCL)
1.14.1-dev
|
ExtractPolygonalPrismData uses a set of point indices that represent a planar model, and together with a given height, generates a 3D polygonal prism. More...
#include <pcl/segmentation/extract_polygonal_prism_data.h>
Public Types | |
using | PointCloud = pcl::PointCloud< PointT > |
using | PointCloudPtr = typename PointCloud::Ptr |
using | PointCloudConstPtr = typename PointCloud::ConstPtr |
using | PointIndicesPtr = PointIndices::Ptr |
using | PointIndicesConstPtr = PointIndices::ConstPtr |
Public Types inherited from pcl::PCLBase< PointT > | |
using | PointCloud = pcl::PointCloud< PointT > |
using | PointCloudPtr = typename PointCloud::Ptr |
using | PointCloudConstPtr = typename PointCloud::ConstPtr |
using | PointIndicesPtr = PointIndices::Ptr |
using | PointIndicesConstPtr = PointIndices::ConstPtr |
Public Member Functions | |
ExtractPolygonalPrismData ()=default | |
Empty constructor. More... | |
void | setInputPlanarHull (const PointCloudConstPtr &hull) |
Provide a pointer to the input planar hull dataset. More... | |
void | setPolygons (const std::vector< pcl::Vertices > &polygons) |
Provide a vector of the concave polygons indices, as recieved from ConcaveHull::polygons. More... | |
PointCloudConstPtr | getInputPlanarHull () const |
Get a pointer the input planar hull dataset. More... | |
void | setHeightLimits (double height_min, double height_max) |
Set the height limits. More... | |
void | getHeightLimits (double &height_min, double &height_max) const |
Get the height limits (min/max) as set by the user. More... | |
void | setViewPoint (float vpx, float vpy, float vpz) |
Set the viewpoint. More... | |
void | getViewPoint (float &vpx, float &vpy, float &vpz) const |
Get the viewpoint. More... | |
void | segment (PointIndices &output) |
Cluster extraction in a PointCloud given by <setInputCloud (), setIndices ()> More... | |
Public Member Functions inherited from pcl::PCLBase< PointT > | |
PCLBase () | |
Empty constructor. More... | |
PCLBase (const PCLBase &base) | |
Copy constructor. More... | |
virtual | ~PCLBase ()=default |
Destructor. More... | |
virtual void | setInputCloud (const PointCloudConstPtr &cloud) |
Provide a pointer to the input dataset. More... | |
PointCloudConstPtr const | getInputCloud () const |
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 (std::size_t row_start, std::size_t col_start, std::size_t nb_rows, std::size_t nb_cols) |
Set the indices for the points laying within an interest region of the point cloud. More... | |
IndicesPtr | getIndices () |
Get a pointer to the vector of indices used. More... | |
IndicesConstPtr const | getIndices () const |
Get a pointer to the vector of indices used. More... | |
const PointT & | operator[] (std::size_t pos) const |
Override PointCloud operator[] to shorten code. More... | |
Protected Member Functions | |
virtual std::string | getClassName () const |
Class getName method. 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 | |
PointCloudConstPtr | planar_hull_ {nullptr} |
A pointer to the input planar hull dataset. More... | |
std::vector< pcl::Vertices > | polygons_ |
polygons indices vectors, as recieved from ConcaveHull More... | |
int | min_pts_hull_ {3} |
The minimum number of points needed on the convex hull. More... | |
double | height_limit_min_ {0.0} |
The minimum allowed height (distance to the model) a point will be considered from. More... | |
double | height_limit_max_ {std::numeric_limits<float>::max()} |
The maximum allowed height (distance to the model) a point will be considered from. More... | |
float | vpx_ {0.0f} |
Values describing the data acquisition viewpoint. More... | |
float | vpy_ {0.0f} |
float | vpz_ {0.0f} |
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... | |
ExtractPolygonalPrismData uses a set of point indices that represent a planar model, and together with a given height, generates a 3D polygonal prism.
The polygonal prism is then used to segment all points lying inside it.
An example of its usage is to extract the data lying within a set of 3D boundaries (e.g., objects supported by a plane).
Example usage:
Definition at line 103 of file extract_polygonal_prism_data.h.
using pcl::ExtractPolygonalPrismData< PointT >::PointCloud = pcl::PointCloud<PointT> |
Definition at line 111 of file extract_polygonal_prism_data.h.
using pcl::ExtractPolygonalPrismData< PointT >::PointCloudConstPtr = typename PointCloud::ConstPtr |
Definition at line 113 of file extract_polygonal_prism_data.h.
using pcl::ExtractPolygonalPrismData< PointT >::PointCloudPtr = typename PointCloud::Ptr |
Definition at line 112 of file extract_polygonal_prism_data.h.
using pcl::ExtractPolygonalPrismData< PointT >::PointIndicesConstPtr = PointIndices::ConstPtr |
Definition at line 116 of file extract_polygonal_prism_data.h.
using pcl::ExtractPolygonalPrismData< PointT >::PointIndicesPtr = PointIndices::Ptr |
Definition at line 115 of file extract_polygonal_prism_data.h.
|
default |
Empty constructor.
|
inlineprotectedvirtual |
Class getName method.
Definition at line 220 of file extract_polygonal_prism_data.h.
|
inline |
Get the height limits (min/max) as set by the user.
The default values are 0, std::numeric_limits<float>::max().
[out] | height_min | the resultant min height limit |
[out] | height_max | the resultant max height limit |
Definition at line 161 of file extract_polygonal_prism_data.h.
References pcl::ExtractPolygonalPrismData< PointT >::height_limit_max_, and pcl::ExtractPolygonalPrismData< PointT >::height_limit_min_.
|
inline |
Get a pointer the input planar hull dataset.
Definition at line 140 of file extract_polygonal_prism_data.h.
References pcl::ExtractPolygonalPrismData< PointT >::planar_hull_.
|
inline |
Get the viewpoint.
Definition at line 182 of file extract_polygonal_prism_data.h.
References pcl::ExtractPolygonalPrismData< PointT >::vpx_, pcl::ExtractPolygonalPrismData< PointT >::vpy_, and pcl::ExtractPolygonalPrismData< PointT >::vpz_.
void pcl::ExtractPolygonalPrismData< PointT >::segment | ( | pcl::PointIndices & | output | ) |
Cluster extraction in a PointCloud given by <setInputCloud (), setIndices ()>
[out] | output | the resultant point indices that support the model found (inliers) |
Definition at line 149 of file extract_polygonal_prism_data.hpp.
References pcl::computeMeanAndCovarianceMatrix(), pcl::geometry::distance(), pcl::eigen33(), pcl::PointIndices::header, pcl::PointIndices::indices, pcl::isXYPointIn2DXYPolygon(), pcl::pointToPlaneDistanceSigned(), pcl::SampleConsensusModelPlane< PointT >::projectPoints(), pcl::PointCloud< PointT >::resize(), and pcl::PointCloud< PointT >::size().
|
inline |
Set the height limits.
All points having distances to the model outside this interval will be discarded.
[in] | height_min | the minimum allowed distance to the plane model value |
[in] | height_max | the maximum allowed distance to the plane model value |
Definition at line 149 of file extract_polygonal_prism_data.h.
References pcl::ExtractPolygonalPrismData< PointT >::height_limit_max_, and pcl::ExtractPolygonalPrismData< PointT >::height_limit_min_.
|
inline |
Provide a pointer to the input planar hull dataset.
[in] | hull | the input planar hull dataset |
Definition at line 126 of file extract_polygonal_prism_data.h.
References pcl::ExtractPolygonalPrismData< PointT >::planar_hull_.
|
inline |
Provide a vector of the concave polygons indices, as recieved from ConcaveHull::polygons.
[in] | polygons | - see ConcaveHull::polygons |
Definition at line 133 of file extract_polygonal_prism_data.h.
References pcl::ExtractPolygonalPrismData< PointT >::polygons_.
|
inline |
Set the viewpoint.
[in] | vpx | the X coordinate of the viewpoint |
[in] | vpy | the Y coordinate of the viewpoint |
[in] | vpz | the Z coordinate of the viewpoint |
Definition at line 173 of file extract_polygonal_prism_data.h.
References pcl::ExtractPolygonalPrismData< PointT >::vpx_, pcl::ExtractPolygonalPrismData< PointT >::vpy_, and pcl::ExtractPolygonalPrismData< PointT >::vpz_.
|
protected |
The maximum allowed height (distance to the model) a point will be considered from.
Definition at line 213 of file extract_polygonal_prism_data.h.
Referenced by pcl::ExtractPolygonalPrismData< PointT >::getHeightLimits(), and pcl::ExtractPolygonalPrismData< PointT >::setHeightLimits().
|
protected |
The minimum allowed height (distance to the model) a point will be considered from.
Definition at line 208 of file extract_polygonal_prism_data.h.
Referenced by pcl::ExtractPolygonalPrismData< PointT >::getHeightLimits(), and pcl::ExtractPolygonalPrismData< PointT >::setHeightLimits().
|
protected |
The minimum number of points needed on the convex hull.
Definition at line 203 of file extract_polygonal_prism_data.h.
|
protected |
A pointer to the input planar hull dataset.
Definition at line 197 of file extract_polygonal_prism_data.h.
Referenced by pcl::ExtractPolygonalPrismData< PointT >::getInputPlanarHull(), and pcl::ExtractPolygonalPrismData< PointT >::setInputPlanarHull().
|
protected |
polygons indices vectors, as recieved from ConcaveHull
Definition at line 200 of file extract_polygonal_prism_data.h.
Referenced by pcl::ExtractPolygonalPrismData< PointT >::setPolygons().
|
protected |
Values describing the data acquisition viewpoint.
Default: 0,0,0.
Definition at line 216 of file extract_polygonal_prism_data.h.
Referenced by pcl::ExtractPolygonalPrismData< PointT >::getViewPoint(), and pcl::ExtractPolygonalPrismData< PointT >::setViewPoint().
|
protected |
Definition at line 216 of file extract_polygonal_prism_data.h.
Referenced by pcl::ExtractPolygonalPrismData< PointT >::getViewPoint(), and pcl::ExtractPolygonalPrismData< PointT >::setViewPoint().
|
protected |
Definition at line 216 of file extract_polygonal_prism_data.h.
Referenced by pcl::ExtractPolygonalPrismData< PointT >::getViewPoint(), and pcl::ExtractPolygonalPrismData< PointT >::setViewPoint().