我想使用2D(xyz
)标准搜索我的3D(xy
)点云。
即。 "找到x = 2和y = 4附近的所有点,无论它们的Z坐标是什么"
从概念上讲,我认为我可以通过创建一个仅考虑x&的KD树来解决这个问题。 y,但我似乎无法用PCL工具找到它。
有一种好的(已经写好的)方法吗?或者我是否必须实现自己的[可能更慢]的Kd树?
答案 0 :(得分:2)
如果您正在考虑KD树,那么您对检索到的点数有一些限制,无论是最近的数量还是它们的距离。
在你的情况下,那应该是距离,那么,你得到(x-dx, x+dx) and (y-dy, y+dy)
之间的点。
在pcl中执行此操作的一种方法是使用pcl::getPointsInBox()
获取一组位于框中的点,并给出其边界。
参数
cloud the point cloud data message min_pt the minimum bounds max_pt the maximum bounds indices the resultant set of point indices residing in the box
所以,如果你想得到x(1.25,1.75)和y(2.25,2.75)之间的点,你必须创建两个MinMax点,如下所示:
PointMin(1.25, 2.25, min_z)
PointMax(1.75, 2.75, max_z)
min_z & max_z
可以任意设置为低和高(-15,40),这样就可以获得具有指定(x,y)范围的所有点,而不考虑(z)