38#ifndef PCL_SEGMENTATION_IMPL_EXTRACT_POLYGONAL_PRISM_DATA_H_
39#define PCL_SEGMENTATION_IMPL_EXTRACT_POLYGONAL_PRISM_DATA_H_
41#include <pcl/segmentation/extract_polygonal_prism_data.h>
42#include <pcl/sample_consensus/sac_model_plane.h>
44#include <pcl/common/eigen.h>
47template <
typename Po
intT>
bool
53 Eigen::Vector4f xyz_centroid;
107template <
typename Po
intT>
bool
111 double x1, x2,
y1,
y2;
136 if ( (
xnew < point.x) == (point.x <=
xold) && (point.y -
y1) * (x2 - x1) < (
y2 -
y1) * (point.x - x1) )
148template <
typename Po
intT>
void
151 output.header = input_->header;
159 if (
static_cast<int> (planar_hull_->size ()) < min_pts_hull_)
161 PCL_ERROR(
"[pcl::%s::segment] Not enough points (%zu) in the hull!\n",
162 getClassName().
c_str(),
163 static_cast<std::size_t
>(planar_hull_->size()));
171 Eigen::Vector4f xyz_centroid;
189 Eigen::Vector4f
vp (vpx_, vpy_, vpz_, 0);
191 vp -= (*planar_hull_)[0].getVector4fMap ();
218 polygon.resize (planar_hull_->size ());
219 for (std::size_t i = 0; i < planar_hull_->size (); ++i)
221 Eigen::Vector4f
pt ((*planar_hull_)[i].x, (*planar_hull_)[i].y, (*planar_hull_)[i].z, 0);
230 output.indices.resize (indices_->size ());
249 output.indices[l++] = (*indices_)[i];
251 output.indices.resize (l);
256#define PCL_INSTANTIATE_ExtractPolygonalPrismData(T) template class PCL_EXPORTS pcl::ExtractPolygonalPrismData<T>;
257#define PCL_INSTANTIATE_isPointIn2DPolygon(T) template bool PCL_EXPORTS pcl::isPointIn2DPolygon<T>(const T&, const pcl::PointCloud<T> &);
258#define PCL_INSTANTIATE_isXYPointIn2DXYPolygon(T) template bool PCL_EXPORTS pcl::isXYPointIn2DXYPolygon<T>(const T &, const pcl::PointCloud<T> &);
Define methods for centroid estimation and covariance matrix calculus.
Iterator class for point clouds with or without given indices.
ConstCloudIterator(const PointCloud< PointT > &cloud)
std::size_t size() const
Size of the range the iterator is going through.
unsigned int computeMeanAndCovarianceMatrix(const pcl::PointCloud< PointT > &cloud, Eigen::Matrix< Scalar, 3, 3 > &covariance_matrix, Eigen::Matrix< Scalar, 4, 1 > ¢roid)
Compute the normalized 3x3 covariance matrix and the centroid of a given set of points in a single lo...
void eigen33(const Matrix &mat, typename Matrix::Scalar &eigenvalue, Vector &eigenvector)
determines the eigenvector and eigenvalue of the smallest eigenvalue of the symmetric positive semi d...
double pointToPlaneDistanceSigned(const Point &p, double a, double b, double c, double d)
Get the distance from a point to a plane (signed) defined by ax+by+cz+d=0.
bool isPointIn2DPolygon(const PointT &point, const pcl::PointCloud< PointT > &polygon)
General purpose method for checking if a 3D point is inside or outside a given 2D polygon.
bool isXYPointIn2DXYPolygon(const PointT &point, const pcl::PointCloud< PointT > &polygon)
Check if a 2d point (X and Y coordinates considered only!) is inside or outside a given polygon.
A point structure representing Euclidean xyz coordinates, and the RGB color.