本文介绍了从点云检测平面集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一组点云,我想测试3D房间中是否有角.因此,我想讨论一下我的方法,以及在速度方面是否有更好的方法,因为我想在手机上对其进行测试.

I have a set of point cloud, and I would like to test if there is a corner in a 3D room. So I would like to discuss my approach and if there is a better approach or not in terms of speed, because I want to test it on mobile phones.

我将尝试使用霍夫变换检测线,然后尝试查看是否有三条线相交并且它们也构成了两条相交的平面.

I will try to use hough tranform to detect lines, then I will try to see if there are three lines that are intersecting and they make a two plane that are intersecting too.

推荐答案

如果点云数据来自深度传感器,则您的墙的采样相对较密集.我发现与深度传感器(例如Kinect或DepthSense)配合使用的一件事是@MartinBeckett建议的RANSAC过程的可靠版本.与其随机选择3个点,不如随机选择一个点,并获得云中的相邻点.有两种方法可以做到这一点:

If the point cloud data comes from a depth sensor, then you have a relatively dense sampling of your walls. One thing I found that works well with depth sensors (e.g. Kinect or DepthSense) is a robust version of the RANSAC procedure that @MartinBeckett suggested.Instead of picking 3 points at random, pick one point at random, and get the neighboring points in the cloud. There are two ways to do that:

  1. 正确的方法:使用3D最近邻查询数据结构(例如KD树)来获取距查询点只有一小段距离的所有点.
  2. 草率但较快的方法:使用随机选择的像素的像素网格邻域.这可能包括3D距离远的点,因为它们位于不同的平面/对象上,但是可以,因为该像素不会从数据中获得太多支持.

下一步是从那组3D点生成平面方程.您可以在其3D坐标上使用PCA来获取两个最重要的特征向量,它们定义了平面(最后一个特征向量应为法线).

The next step is to generate a plane equation from that group of 3D points. You can use PCA on their 3D coordinates to get the two most significant eigenvectors, which define the plane surface (the last eigenvector should be the normal).

从那里开始,RANSAC算法照常进行:检查数据中还有多少其他点靠近该平面,并找到具有最大支持力的平面.我发现最好找到最大的支撑平面,删除支撑的3D点,然后再次运行算法以查找其他较小的"平面.这样一来,您便可以将房间的所有墙壁都拿起来.

From there, the RANSAC algorithm proceeds as usual: check how many other points in the data are close to that plane, and find the plane(s) with maximal support. I found it better to find the largest support plane, remove the supporting 3D points, and run the algorithm again to find other 'smaller' planes. This way you may be able to get all the walls in your room.

为澄清上述问题:假设平面的支撑是所有3D点的集合,这些点与该平面的距离最多为某个阈值(例如10 cm,应取决于深度传感器的测量误差模型).在每次运行RANSAC算法后,将选择具有最大支持的飞机.通过在支撑集上执行PCA/线性回归,可以使用所有支持该平面的点来细化平面方程(这比仅使用相邻点更鲁棒).

To clarify the above: the support of a hypothesized plane is the set of all 3D points whose distance from that plane is at most some threshold (e.g. 10 cm, should depend on the depth sensor's measurement error model).After each run of the RANSAC algorithm, the plane that had the largest support is chosen. All the points supporting that plane may be used to refine the plane equation (this is more robust than just using the neighboring points) by performing PCA/linear regression on the support set.

为了继续查找其他平面,应从3D点集中删除上一次迭代的支持,以使其余点位于其他平面上.只要有足够的点并且最佳平面拟合误差不会太大,就可以重复此操作.在您的情况下(寻找一个角),您至少需要3个垂直平面.如果找到两个大支撑且大致平行的平面,则它们可能是地板和一些柜台,或者是两个平行的墙.房间没有可见的角落,或者您需要继续寻找支撑较小的垂直平面.

In order to proceed and find other planes, the support of the previous iteration should be removed from the 3D point set, so that remaining points lie on other planes. This may be repeated as long as there are enough points and best plane fit error is not too large.In your case (looking for a corner), you need at least 3 perpendicular planes. If you find two planes with large support which are roughly parallel, then they may be the floor and some counter, or two parallel walls. Either the room has no visible corner, or you need to keep looking for a perpendicular plane with smaller support.

这篇关于从点云检测平面集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-14 00:46