-
点云数据的目的是将噪声点云进行处理,去除噪声干扰,使其尽最大可能回归到应有的位置,将散乱的、含有噪声的点云变成规则的、高精度的点云,从而使得目标中的平面区域更加平顺,细节部分更加精细,在此同时,尽最大可能保留目标应该有的细节信息,避免在数据去噪过程中产生细节消失、扭曲、伸缩等现象,得到目标的真实外形点云, 为后续的点云处理做好准备。为了实现这个目的,采取了基于主成分分析的去噪、曲面拟合、滤波3个步骤。其中主成分分析的目的是找到曲面的前两个主成分,从而方便在第3个主成分进行去噪滤波;曲面拟合将在前两个主成分的基础上进行拟合,求出每个曲面;最后将基于拟合出来的曲面和第3个主成分方向进行去噪处理。具体描述如下。
-
对点云,以一定半径窗口进行滑动,每个窗口内,求取点云的xyz坐标均值(ox, oy, oz)。求取协方差矩阵:
$ \left[ \begin{array}{l} \ \ \ \ \ \ \ \sum {{{({x_i} - {o_x})}^2}\ \ \ \ \ \ \ \ \ \ \sum {({x_i} - {o_x})({y_i} - {o_y})} \ \ \ \ \ \sum {({x_i} - {o_x})({z_i} - {o_z})} } \\ \sum {({y_i} - {o_y})({x_i} - {o_x})}\ \ \ \ \ \ \ \ \ \ \ \sum {{{({y_i} - {o_y})}^2}}\ \ \ \ \ \ \ \ \ \ \ \ \ \sum {({y_i} - {o_y})({z_i} - {o_z})} \\ \sum {({z_i} - {o_z})({x_i} - {o_x})}\ \ \ \ \sum {({z_i} - {o_z})({y_i} - {o_y})} \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \sum {{{({z_i} - {o_z})}^2}} \end{array} \right] $
(1) 式中, (xi, yi, zi)为窗口内每个点的坐标。求取矩阵的两个主方向($\overrightarrow x ,\overrightarrow y $),既为窗口点云的主方向,两个主方向差乘,得到的方向为点云噪声方向$\overrightarrow z $。在两个主方向上对进行局部平面拟合,然后求出每个点(xi, yi, zi)与平面沿噪声方向$\overrightarrow z $的距离${d_{\overrightarrow z }}$。
每个点在噪声方向进行位移,位移距离d为:
$ d = {d_{\overrightarrow z }} \times \alpha $
(2) 式中, α为系数。
该步骤可以去除较大的噪声,尤其离群点噪声。
-
去除较大噪声后,对点云进一步进行曲面拟合的方程为:
$ \begin{array}{c} f(x,y) = \sum\limits_{i = 0}^n {\sum\limits_{j = 0}^n {{a_{ij}}{x^i}{y^i}} } \\ (i,j = 0,1,2, \cdots ,n) \end{array} $
(3) 式中, aij为系数,为了求得最优aij,定义误差函数为:
$ E({a_{ij}}) = \sum\limits_{i = 1}^n {{{[{z_i} - f({x_i},{y_i})]}^2}} $
(4) 将所有点代入,转为多项式求解,通过整体误差最小,求得系数:
$ \frac{{\partial E({a_{ij}})}}{{\partial {a_{ij}}}} = 0 $
(5) 整幅点云范围较大,为了方便处理,在计算过程中,采取窗口扫面方式对点云进行拟合处理。针对每个窗口点云,采用(4)式和(5)式进行处理。当窗口遍历完所有点云后,得到整体点云曲面。
曲面大小的计算方法为距离待处理像素(x0, y0, z0)的欧式距离在一定范围T内的点云,即:
$ \begin{array}{c} \{ {x_i},{y_i},{z_i}\} \in \\ \sqrt {{{({x_i} - {x_0})}^2} + {{({y_i} - {y_0})}^2} + {{({z_i} - {z_0})}^2}} \end{array} $
(6) 式中, {xi, yi, zi}为在(x0, y0, z0)周围进行曲面拟合的所有点云。
-
滤波算法为:
$ f(x,y,z) = \frac{{\sum {{\sigma _{x,y,z}}} \times (x,y,z) \times \widetilde d}}{{\sum {{\sigma _{x,y,z}}} }} $
(7) 式中, $\widetilde d$为该点到曲面的距离,x, y, z为坐标值。
在(7)式中,σx, y, z为窗口内标准差,计算方法如下:
$ \begin{array}{c} {\sigma _{x,y,z}} = \frac{1}{{(2M + 1)(2M + 1)}} \times \\ \sum {[(} x,y,z) - ({o_x},{o_y},{o_z}){]^2} \end{array} $
(8) 式中, 窗口大小为(2M+1)(2M+1)。随不同区域起伏不同,M值也随着调整。M的计算过程为:
$ M = k \times f $
(9) 式中,k为给定的系数,f为范围T内的点云的起伏情况,f的计算方法为:
$ f = {\rm mean}({\widetilde d_i}) $
(10) 即每个点到曲面距离绝对值的均值,其中${\widetilde d_i}$为每个点到曲面距离绝对值。
-
实验结果分别如图 1和图 2所示。可以看出,经本文中提出的方法滤波后,消除了较大的噪声,有效地保留模型中的尖锐、边缘特征及细节特征。从图 1中可以看到,椅子边缘的噪声被滤波去掉,保留的椅子边缘细腻。从图 2中可以看到,经过滤波后,gargo的细节能够比较清晰地展现出来。
表 1中对4种去噪算法进行了滤波效果比较,从中可以发现,与3种滤波算法相比,提出的算法在进行滤波处理后,点云平均误差更小,通过统计发现,整体上与原始模型更为接近;同时,提出的滤波算法,相对其它3种算法比较,最大误差较更小,这表明所提出的算法能够更好地将目标的高频特征或细节特征保留。
Table 1. Performance comparison of several filter method
表 2中给出了曲面拟合窗口的大小T对整体滤波精度的影响。从表中可以看到,T对去噪效果有一定影响。T过大及过低,对滤波效果都有坏处,合适的滤波窗口,将带来最佳的滤波效果。在T=28时,能够得到最低的平均误差和最大误差,可见T=28为最佳的曲面拟合窗口。随着滤波目标的形状不同,T会发生适当的变化。
Table 2. Effect of surface fitting window T to filter
point cloud average error max error T=16 T=22 T=28 T=31 T=37 T=35 T=16 T=22 T=28 T=31 T=37 T=35 chair 0.032 0.029 0.019 0.026 0.031 0.031 0.031 0.027 0.025 0.028 0.032 0.035 gargo 0.041 0.032 0.027 0.031 0.037 0.042 0.039 0.039 0.037 0.034 0.041 0.046 -
在激光对目标进行3维扫描过程中,由于环境中的粉尘干扰、周围杂散光干扰、物体表面反射材料、雨衰、测量中人操作产生的误差等因素,必然会包含一定的噪声点。噪声点会导致展现的目标形状和原实物相差很多,尤其是点云中存在一些孤立噪声点、离群点直接影响点云数据的质量和后期处理等问题。这会严重影响后续点云的处理,尤其在一些实际应用中,比如自动驾驶中的目标提取计算、3维点云立体重构中的重构精度等。因此,在对点云处理工作时,必须要进行点云去噪滤波工作。
从前人的研究论文中可以发现,经历了多年的探索研究,有众多的去噪滤波算法,有些技术分支已经日趋成熟。众多的思路基本都是需要根据点云之间的相对位置关系,进行综合处理。但是在实际应用过程中发现,由于环境干扰,实际扫描的点云所含噪声都较大,或者噪声较多时候,点云之间的相对关系易被破坏,点云滤波的精度难以保证,滤波的处理复杂度不断增加,此时,前人的滤波方法对处理效果没有明显的增强,滤波过程中还容易产生局部细节损失现象。根据这种情况,进行了研究,从实验结果可以看到,提出的方法能解决上述问题, 得到较高精度的去噪滤波结果。
进一步,表 3中给出了滤波窗口的大小M对整体滤波精度的影响。从表中可以看到,去噪效果随着滤波窗口M的变化而变化。M增大时,点云去噪最大误差呈减小趋势,随着M进一步增大,点云去噪最大误差逐步平缓,而后M越大,点云去噪最大误差增大。这是由于M控制滤波窗口点云采样个数,采样个数的适当增加,对滤波效果有好处,但是当增加到一定程度的时候,效果反而变差,因此,滤波窗口系数的合理选择,对滤波去噪效果有很大的影响。
Table 3. Effect of surface window M to filter
point cloud average error max error M=10 M=15 M=20 M=25 M=30 M=35 M=10 M=15 M=20 M=25 M=30 M=35 chair 0.028 0.026 0.018 0.023 0.027 0.031 0.029 0.025 0.024 0.025 0.028 0.031 gargo 0.033 0.031 0.028 0.030 0.034 0.037 0.039 0.035 0.032 0.036 0.039 0.042 同时从表 1中曲面拟合窗口大小和表 3中滤波窗口大小对处理精度比较来看,窗口大小对精度的影响略有不同,在曲面拟合过程中,窗口大一些好,在滤波过程中,窗口稍小一些好。这是因为在曲面拟合过程中,窗口适当大一些,拟合的精度高,不会变形,而在滤波过程中,小窗口对精度有提升。
从上述实验结果及分析可以看出,该方法通过拟合运算,滤波精度高。有效处理了噪声点、离群点。对于陡峭、平坦的区域,该方法具有较好的滤波效果,适用于各种目标点云。该算法结构简单,同时能够有效保留细节信息。
由于传统的移动曲面的最小二乘滤波只在较小区域时候有效,而且受所取曲面周围区域的大小制约,将主成分分析基础上进行曲面拟合,而后去噪,取得了较为理想的效果。与采用双边滤波算法、改进双边滤波、三边滤波或Fleishman方法等算法进行比较,提出的方法能够在较大范围内、较高噪声情况下,进行大规模散乱点云处理,去噪效果明显,细节特征保留,同时光顺区域误差也比较小。
基于主成分分析与曲面拟合的激光点云滤波去噪
Laser point cloud denoising based on principal component analysis and surface fitting
-
摘要: 为了消除激光点云采集时点云中的噪声点,避免噪声尤其是一些孤立离群点对点云数据质量的影响,将散乱的、含有噪声点云变成规则的、高精度的点云,采用了基于主成分分析与曲面拟合进行点云去噪的方法,首先提出了点云区域的主成分分析计算方法,在主成分分析的法向量进行粗去噪,而后去噪后的点云进行曲面拟合,最后根据点到曲面的距离进行了点云的滤波,得到滤波后的点云。结果表明,该方法去噪效果精度高,尤其针对散乱点云,去噪效果明显,最佳滤波性能误差仅为0.018mm。该研究为散乱激光点云的去噪滤波提供了参考。Abstract: In order to eliminate the noise points in the process of collecting laser point cloud and avoid the impact of noise the data quality of the point cloud, especially some isolated outliers. The scattered and noisy point cloud is transformed into regular and high-precision point cloud, and the method of point cloud denoising based on principal component analysis and surface fitting is adopted. In this paper, a point cloud denoising method based on principal component analysis and surface fitting was proposed. Firstly, the principal component analysis method of point cloud region was proposed. Then, the principal component analysis normal vector was used for rough denoising, and the rough denoising point cloud was used for surface fitting. Finally, the point cloud was filtered according to the synthetic distance between the point and the surface. The experimental result shows that the denoising effect is accurate. From the above experimental results and analysis, it can be seen that this method has high filtering accuracy through fitting operation. The algorithm is simple in structure and can retain the details effectively, the error of the best filter performance is only 0.018mm. This study provides a reference for the denoising and filtering of scattered laser point clouds.
-
Key words:
- laser technique /
- filtering /
- surface fitting /
- point cloud
-
Table 1. Performance comparison of several filter method
Table 2. Effect of surface fitting window T to filter
point cloud average error max error T=16 T=22 T=28 T=31 T=37 T=35 T=16 T=22 T=28 T=31 T=37 T=35 chair 0.032 0.029 0.019 0.026 0.031 0.031 0.031 0.027 0.025 0.028 0.032 0.035 gargo 0.041 0.032 0.027 0.031 0.037 0.042 0.039 0.039 0.037 0.034 0.041 0.046 Table 3. Effect of surface window M to filter
point cloud average error max error M=10 M=15 M=20 M=25 M=30 M=35 M=10 M=15 M=20 M=25 M=30 M=35 chair 0.028 0.026 0.018 0.023 0.027 0.031 0.029 0.025 0.024 0.025 0.028 0.031 gargo 0.033 0.031 0.028 0.030 0.034 0.037 0.039 0.035 0.032 0.036 0.039 0.042 -
[1] TAUBIN G. A signal processing approach to fair surface design[C]//ACM Proceedings of the 22nd Annual Conference on Computer Graphics and Interactive Techniques. Palo Alto, USA: Stanford University Press, 1995: 351-358. [2] TAUBIN G. Linear anisotropic mesh filters[C]//IBM Research Report RC22213(W0110-051). New York, USA: Computer Science, 2001: 110-115. [3] JONES T R, DURAND F, DESBRUN M. Non-iterative, feature-preserving mesh smoothing[C]//ACM Transactions on Graphics. New York, USA: ACM, 2003, 22(3): 943-949. [4] HILDEBRANDT K, POLTHIER K. Anisotropic filtering of non-linear surface features [J]. Computer Graphics Forum, 2004, 23(3):391-400. doi: 10.1111/j.1467-8659.2004.00770.x [5] ZHANG W, DENG B, ZHANG J, et al. Guided mesh normal filtering[J]. Computer Graphics Forum, 2015, 34(7): 23-34. doi: 10.1111/cgf.12742 [6] YAGOU H, OHTAKE Y, BELYAEV A. Mesh smoothing via mean and median filtering applied to face normals[C]//IEEE Geometric Modeling and Processing. New York, USA: IEEE, 2002: 124-131. [7] FAN H, YU Y, PENG Q. Robust feature-preserving mesh denoising based on consistent subneighborhoods[J]. IEEE Transactions on Visualization and Computer Graphics, 2010, 16(2): 312-324. doi: 10.1109/TVCG.2009.70 [8] FLEISHMAN S, DRORI I, COHEN-OR D. Bilateral mesh denoising[J]. ACM Transactions on Graphics, 2003, 22(3): 950-953. doi: 10.1145/882262.882368 [9] CHOUDHURY P, TUMBLIN J. The trilateral filter for high contrast images and meshes[C]//Eurographics Workshop on Rendering Techniques. New York, USA: ACM, 2003: 186-196. [10] DUGUET F, DURAND F, DRETTAKIS G.Robust higher-order filtering of points[J]. Rapport de Recherche Inria, 2004, 17(4):12-18. [11] TASDIZEN T, WHITAKER R, BURCHARD P, et al. Geometric surface smoothing via anisotropic diffusion of normals[C]// IEEE Proceedings of the Conference on Visualization. New York, USA: Computer Society, 2002: 125-132. [12] MEDEROS B, VELHO L, de FIGUEIREDO L H. Robust smoothing of noisy point clouds[C]//Slam Conference on Geometric Design & Computing. New York, USA: IEEE, 2003: 405-416. [13] CLARENZ U, RUMPF M, TELEA A. Fairing of point based surfaces[C]//IEEE Computer Graphics International. New York, USA: IEEE, 2004: 600-603. [14] PAULY M, KOBBELT L, GROSS M. Multiresolution modeling of point-sampled geometry[M].Zurich, Swiss: Swiss Federal Institute of Technology Zurich Press, 2002:42-49. [15] WANG R, CHEN W, ZHANG S, et al. Similarity-based denoising of point-sampled surfaces[J]. Journal of Zhejiang University, 2008, 9(6): 807-815. doi: 10.1631/jzus.A071465 [16] FAN H Q, MIAO L F, ZHANG X, et al. Robust high-order bilateral denoising filter[J]. Journal of Computer-aided Design & Computer Graphics, 2009, 21(6):813-818 (in Chinese). [17] FU Y, ZHAI J L. Research on scattered points cloud denoising algorithm [C]// IEEE Intemationai Conference on Signal Communications and Computing. New York, USA: IEEE, 2015: 1-5. [18] SONG D H, LI Zh K, WANG Zh, et al. A feature-preserving algorithm of point cloud smoothing[J]. China Mechanical Engineering, 2014, 25(11):1498-1501 (in Chinese). [19] NARVÁEZ E A L, NARVÁEZ N E L. Point cloud denoising using robust principal component analysis[C]//Proceedings of the First International Conference on Computer Graphics Theory and Applications. New York, USA: IEEE, 2006: 51-58. [20] LANGE C, POLTHIER K. Anisotropic smoothing of point sets[J]. Computer Aided Geometric Design, 2005, 22(7): 680-692. doi: 10.1016/j.cagd.2005.06.010 [21] HU G, PENG Q, FORREST A R. Mean shift denoising of point-sampled surfaces[J]. The Visual Computer, 2006, 22(3):147-157. doi: 10.1007/s00371-006-0372-0 [22] LEVIN D. Mesh-independent surface interpolation[M]. Berlin, Germany: Springer Press, 2004: 37-49. [23] GUENNEBAUD G, GROSS M. Algebraic point set surfaces[J]. ACM Transactions on Graphics, 2007, 26(3): 231-236. [24] WANG J, YU Z. Feature-preserving mesh denoising via anisotropic surface fitting[J]. Journal of Computer Science and Technology, 2012, 27(1): 163-173. doi: 10.1007/s11390-012-1214-3 [25] ZHENG Y, FU H, AU O K C, et al. Bilateral normal filtering for mesh denoising[J]. IEEE Transactions on Visualization and Computer Graphics, 2011, 17(10): 1521-1530. doi: 10.1109/TVCG.2010.264 [26] SHI L, GUO T, PENG Ch, et al. Segmentation of laser point cloud and safety detection of power lines [J].Laser Technology, 2019, 43(3): 341-3346 (in Chinese).