点云技术相关产学研社区

 找回密码
 立即注册加入PCL中国点云技术相关产学研社区

扫一扫,访问微社区

查看: 3956|回复: 0

ExtractPolygonalPrismData

[复制链接]
发表于 2017-2-15 16:45:35 | 显示全部楼层 |阅读模式
这个类可以用来对一个二维多边形加上一个高度限定的区域内部点进行提取。

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:

double z_min = 0., z_max = 0.05; // we want the points above the plane, no farther than 5 cm from the surface
pcl::PointCloud<pcl::PointXYZ>::Ptr hull_points (new pcl::PointCloud<pcl::PointXYZ> ());
pcl::ConvexHull<pcl::PointXYZ> hull;
// hull.setDimension (2); // not necessarily needed, but we need to check the dimensionality of the output
hull.setInputCloud (cloud);
hull.reconstruct (hull_points);
if (hull.getDimension () == 2)
{
  pcl::ExtractPolygonalPrismData<pcl::PointXYZ> prism;
  prism.setInputCloud (point_cloud);
  prism.setInputPlanarHull (hull_points);
  prism.setHeightLimits (z_min, z_max);
  prism.segment (cloud_indices);
}
else
PCL_ERROR ("The input cloud does not represent a planar surface.\n");


回复

使用道具 举报

本版积分规则

QQ|小黑屋|点云技术相关产学研社区 ( 陕ICP备13001629号 )

GMT+8, 2024-4-29 14:32 , Processed in 2.397977 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表